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 |
|---|---|---|---|---|---|---|
Find a User by a given id. | public Users findByUserid(String id) {
this.createConnection();
try {
Connection con = this.getCon();
PreparedStatement stmnt = con.prepareStatement("select * from user where id=?;");
stmnt.setString(1, id);
ResultSet rs = stmnt.executeQuery();
return get(rs);
} catch (SQLException e) {
System.out.println("SQLException: ");
return new Users();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic User findUser(int id) {\n\n\t\tUser user = em.find(User.class, id);\n\n\t\treturn user;\n\t}",
"public static User findById(final String id) {\n return find.byId(id);\n\n }",
"public User findById(Long id) {\n return genericRepository.find(User.class, id);\n }",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn userDAO.findById(id);\r\n\t}",
"public User findById(int id) {\n\t\treturn userRepository.findOne(id);\n\t}",
"@Override\r\n\tpublic Userinfo findbyid(int id) {\n\t\treturn userDAO.searchUserById(id);\r\n\t}",
"public static User findUser(int id) {\r\n return null;\r\n }",
"public User findUser(int id) {\n for (int i = 0; i < allUsers.size(); i++) {\n if (allUsers.get(i).getId() == id) {\n return allUsers.get(i);\n }\n }\n return null;\n }",
"public User findUser(int id)\n\t\t{\n\t\t\tfor (int i = 0; i < users.size(); i++)\n\t\t\t{\n\t\t\t\tif (id == (users.get(i).getId()))\n\t\t\t\t{\n\t\t\t\t\treturn users.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}",
"public User findById(String id) {\n\t\treturn userDao.findById(id);\n\t}",
"@Override\n\tpublic User findUserById(int id) {\n\t\treturn userDao.findUserById(id);\n\t}",
"@Override\r\n\tpublic User findByIdUser(Integer id) {\n\t\treturn userReposotory.findById(id).get();\r\n\t}",
"public User findUser(int id) {\n\n\t\ttry {\n\t\t\tConnection conn = getConnection();\n\t\t\tPreparedStatement ps = conn.prepareStatement(\"select * from users where id = ?\");\n\t\t\tps.setInt(1, id);\n\n\t\t\tResultSet rs = ps.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tUser foundUser = new User(id, rs.getString(2), rs.getString(3), rs.getString(5),\n\t\t\t\t\t\trs.getDate(6));\n\t\t\t\tconn.close();\n\t\t\t\treturn foundUser;\n\n\t\t\t}\n\t\t\tconn.close();\n\n\t\t} catch (SQLException | IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t\treturn null;\n\t}",
"@Override\n\tpublic User findById(String id) {\n\t\tUser u= em.find(User.class, id);\n\t\tSystem.out.println(u);\n\t\treturn u;\n\t}",
"private User findById(String id) {\n User result = new NullUserOfDB();\n for (User user : this.users) {\n if (user.getId().equals(id)) {\n result = user;\n break;\n }\n }\n return result;\n }",
"User find(long id);",
"public User findUserById(Long id) {\n \tOptional<User> u = userRepository.findById(id);\n \t\n \tif(u.isPresent()) {\n return u.get();\n \t} else {\n \t return null;\n \t}\n }",
"public User findById ( int id) {\n\t\t return users.stream().filter( user -> user.getId().equals(id)).findAny().orElse(null);\n\t}",
"@Override\n\tpublic User findUserByUserId(long id) {\n\t\treturn userDao.getUserByUserId(id);\n\t}",
"@Override\n public UserInfo findById(int id) {\n TypedQuery<UserInfo> query = entityManager.createNamedQuery(\"findUserById\", UserInfo.class);\n query.setParameter(\"id\", id);\n return query.getSingleResult();\n }",
"@Override\r\n public IUser getUserByUserId(String id)\r\n {\r\n EntityManager em = getEntityManager();\r\n\r\n try\r\n {\r\n return em.find(User.class, id);\r\n }\r\n finally\r\n {\r\n em.close();\r\n }\r\n }",
"public User findOneUser(int id) {\n\t\treturn userMapper.findOneUser(id);\r\n\t}",
"@Override\n public User findById(long id) {\n return dao.findById(id);\n }",
"public User findUserByName(String id) {\n return em.find(User.class, id);\n }",
"@RequestMapping(value = \"/find/{id}\", method = RequestMethod.GET)\n @ResponseBody\n public ResponseEntity findUser(@PathVariable long id) {\n User user = userService.findById(id);\n if (user == null) {\n return new ResponseEntity(HttpStatus.NO_CONTENT);\n }\n return new ResponseEntity(user, HttpStatus.OK);\n }",
"@Override\r\n\tpublic TbUser findUserById(Long id) {\n\t\tTbUser tbUser = tbUserMapper.selectByPrimaryKey(id);\r\n\t\treturn tbUser;\r\n\t}",
"public User findUserById (long id){\n if(userRepository.existsById(id)){\n return this.userRepository.findById(id);\n }else{\n throw new UnknownUserException(\"This user doesn't exist in our database\");\n }\n }",
"public User findById(Long id){\n return userRepository.findOne(id);\n }",
"public User user(long id) {\n\t\tOptional<User> user = repository.findById(id);\n\n\t\tif (user.isPresent()) {\n\t\t\treturn user.get();\n\t\t} else {\n\t\t\tthrow new NotFoundException(\"User com o Id: \" + id + \" não encontrado em nossa base de dados!\");\n\t\t}\n\n\t}",
"@Override\n\tpublic User findByUserid(Serializable id) {\n\t\treturn this.userDao.findById(id);\n\t}",
"public User findById(int id) {\n\t\treturn this.getHibernateTemplate().load(User.class, id);// session.load()\r\n\t}",
"@Override\r\n\tpublic User searchUser(Integer id) {\n\t\treturn userReposotory.getById(id);\r\n\t}",
"public User findById(long id) {\n return store.findById(id);\n }",
"User findUserById(Long id) throws Exception;",
"@Override\r\n public Dorm findById(Integer id) {\n return userMapper.findById(id);\r\n }",
"public User getUserFromId(final long id) {\n LOG.info(\"Getting user with id {}\", id);\n return userRepo.get(id);\n }",
"public User getUserFromID(String id) {\r\n // Gets the collection of users and creates a query\r\n MongoCollection<Document> users = mongoDB.getCollection(\"Users\");\r\n Document query = new Document(\"_id\", new ObjectId(id));\r\n\r\n // Loops over users found matching the details, returning the first one\r\n for (User user : users.find(query, User.class)) {\r\n return user;\r\n }\r\n\r\n // Returns null if none are found\r\n return null;\r\n }",
"Optional<User> findUser(int id) throws ServiceException;",
"public User getUserById(int id) {\n\t\treturn em.find(User.class, id);\n\t}",
"public User findById(int id) {\n\t\tString sql = \"SELECT * FROM VIDEOGAMESTORES.USERS WHERE ID=\" +id;\n\t\n\t\ttry {\n\t\t\tSqlRowSet srs = jdbcTemplate.queryForRowSet(sql);\n\t\t\twhile(srs.next())\n\t\t\t{\n\t\t\t\t// Add a new User to the list for every row that is returned\n\t\t\t\treturn new User(srs.getString(\"USERNAME\"), srs.getString(\"PASSWORD\"), srs.getString(\"EMAIL\"),\n\t\t\t\t\t\tsrs.getString(\"FIRST_NAME\"), srs.getString(\"LAST_NAME\"), srs.getInt(\"GENDER\"), srs.getInt(\"USER_PRIVILEGE\"), srs.getInt(\"ID\"));\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn null;\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 }",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn null;\r\n\t}",
"@Override\n public User findById(Integer id) {\n try {\n return runner.query(con.getThreadConnection(),\"select *from user where id=?\",new BeanHandler<User>(User.class),id);\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n throw new RuntimeException(e);\n }\n }",
"User findUserById(int id);",
"public User getUserById(String id){\n\t\tUser e;\n\t\tfor (int i = 0 ; i < users.size() ; i++){\n\t\t\te = users.get(i);\n\t\t\tif (e.getId().equals(id))\n\t\t\t\treturn e;\n\t\t}\n\t\treturn null;\n\t}",
"User findById(Long id);",
"public User findById(Long id);",
"public User findUserById(int id);",
"public Users findById(int id) {\r\n return em.find(Users.class, id);\r\n }",
"public User getUser(long id){\n User user = userRepository.findById(id);\n if (user != null){\n return user;\n } else throw new UserNotFoundException(\"User not found for user_id=\" + id);\n }",
"@Override\n\tpublic Users findByID(int id) {\n\t\treturn usersDAO.findByID(id);\n\t}",
"User findOne(Long id);",
"@Override\r\n\tpublic SpUser findById(String id) {\n\t\treturn null;\r\n\t}",
"public User findUserById(Long id) throws DBException {\n\t\tUser user = null;\n\t\tPreparedStatement pstmt = null;\n\t\tResultSet rs = null;\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = DBManager.getInstance().getConnection();\n\t\t\tpstmt = con.prepareStatement(SQL_FIND_USER_BY_ID);\n\t\t\tpstmt.setLong(1, id);\n\t\t\trs = pstmt.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tuser = extractUser(rs);\n\t\t\t}\n\t\t\tcon.commit();\n\t\t} catch (SQLException ex) {\n\t\t\tDBManager.getInstance().rollback(con);\n\t\t\tLOG.error(Messages.ERR_CANNOT_FIND_USER_BY_ID, ex);\n\t\t\tthrow new DBException(Messages.ERR_CANNOT_FIND_USER_BY_ID, ex);\n\t\t} finally {\n\t\t\tDBManager.getInstance().close(con, pstmt, rs);\n\t\t}\n\t\treturn user;\n\n\t}",
"@Override\n\tpublic User findById(String id) {\n\t\treturn null;\n\t}",
"public User getById(String id){\n List<User> users = userRepo.findAll();\n for (User user : users){\n if(user.getGoogleId().equals(id)){\n return user;\n }\n }\n throw new UserNotFoundException(\"\");\n }",
"public User getUserById(String id) {\n // return userRepo.findById(id);\n\n return null;\n }",
"@RequestMapping(method=RequestMethod.GET, value=\"{id}\")\n\tpublic User getUser(@PathVariable Long id) {\n\t\treturn RestPreconditions.checkFound(repo.findByUserId(id));\n\t}",
"User findById(long id);",
"public Usuario findUserById(Integer id){\n\t\treturn usuarios.findById(id);\n\t}",
"@Override\n\tpublic User getUser(int id) {\n\t\treturn userRepository.findById(id);\n\t}",
"public User getUser(Long id) {\n\t\treturn userRepo.findByUserId(id);\n\t}",
"@Override\n\tpublic SmbmsUser findById(int id) {\n\t\treturn sud.findById(id);\n\t}",
"public UserDTO getUserById(long id) {\n return Optional.of(ObjectMapperUtility.map(dao.findById(id), UserDTO.class))\n .orElseThrow(() -> new UserNotFoundException(\"No users with matching id \" + id));\n // return Optional.of(dao.findById(id)).get().orElseThrow(()-> new UserNotFoundException(\"No users with\n // match\"));\n }",
"@Override\r\n\tpublic User getUserById(int id) {\n\t\treturn userMapper.selById(id);\r\n\t}",
"public User getById(int id) {\n\t\treturn userDao.getById(id);\n\t}",
"public User getUser(Integer id)\n\t{\n\t\t// Create an user -1 for when it isn't in the list\n\t\tUser searchUser = new User();\n\t\t// Index: User's position in the list\n\t\tint index = this.getUserById(id.intValue());\n\t\t// If the user is in the list execute the action\n\t\tif(index != -1)\n\t\t{\n\t\t\tsearchUser = this.usersList.get(index);\n\t\t}\n\t\t\n\t\treturn searchUser;\n\t}",
"@Override\n public ResponseEntity<User> findById(Long id) {\n User res_data = userRepository.findById(id).get();\n if (res_data != null) {\n return new ResponseEntity<>(res_data, HttpStatus.OK);\n }\n return new ResponseEntity<>((User) res_data, HttpStatus.NOT_FOUND);\n }",
"@Transactional\n\tpublic User findUserById(long id) {\n\t\treturn userDao.findUserById(id);\n\t}",
"public Person findUserById(Integer id) {\n\t\treturn null;\n\t}",
"User getUserById(Long id);",
"User getUserById(Long id);",
"public User getUser(int id){\n \n Session session = HibernateUtil.getSessionFactory().openSession();\n Transaction tx = null;\n User user = null;\n try {\n tx = session.beginTransaction();\n\n // Add restriction to get user with username\n Criterion emailCr = Restrictions.idEq(id);\n Criteria cr = session.createCriteria(User.class);\n cr.add(emailCr);\n user = (User)cr.uniqueResult();\n tx.commit();\n } catch (HibernateException e) {\n if (tx != null)\n tx.rollback();\n log.fatal(e);\n } finally {\n session.close();\n }\n return user;\n }",
"public User getUserById(Integer id) {\n\t\treturn userMapper.selectByPrimaryKey(id);\n\t}",
"public User getById(int id) {\n\t\t return (User)sessionFactory.getCurrentSession().get(User.class, id);\n\t}",
"@Override\r\n\tpublic User getUserByID(int id) {\n\t\treturn userMapper.getUserByID(id);\r\n\t}",
"User getUserById(int id);",
"private User getUser(Long id) {\n\t\tEntityManager mgr = getEntityManager();\n\t\tUser user = null;\n\t\ttry {\n\t\t\tuser = mgr.find(User.class, id);\n\t\t} finally {\n\t\t\tmgr.close();\n\t\t}\n\t\treturn user;\n\t}",
"public User getSingleUser(Integer id) {\n\n /*\n * Use the ConnectionFactory to retrieve an open\n * Hibernate Session.\n *\n */\n Session session = ConnectionFactory.getInstance().getSession();\n List results = null;\n try {\n\n results = session.find(\"from User as user where user.userId = ?\",\n new Object[]{id},\n new Type[]{Hibernate.INTEGER});\n\n\n\n } /*\n * If the object is not found, i.e., no Item exists with the\n * requested id, we want the method to return null rather\n * than throwing an Exception.\n *\n */ catch (ObjectNotFoundException onfe) {\n return null;\n } catch (HibernateException e) {\n /*\n * All Hibernate Exceptions are transformed into an unchecked\n * RuntimeException. This will have the effect of causing the\n * user's request to return an error.\n *\n */\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n } /*\n * Regardless of whether the above processing resulted in an Exception\n * or proceeded normally, we want to close the Hibernate session. When\n * closing the session, we must allow for the possibility of a Hibernate\n * Exception.\n *\n */ finally {\n if (session != null) {\n try {\n session.close();\n } catch (HibernateException e) {\n System.err.println(\"Hibernate Exception\" + e.getMessage());\n throw new RuntimeException(e);\n }\n\n }\n }\n if (results.isEmpty()) {\n return null;\n } else {\n return (User) results.get(0);\n }\n\n }",
"public User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\r\n\t}",
"@Override\n\tpublic User getOne(Integer id) {\n\t\treturn userDao.getOne(id);\n\t}",
"public Users getUserById(int id) {\n\t\treturn userMapper.findUserById(id);\n\t}",
"@Override\n\tpublic User findOne(long id) {\n\t\treturn null;\n\t}",
"public PrototypeUser getUserById(Long id) {\n\t\treturn userDao.findById(id);\r\n\t}",
"@Override\n\tpublic User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\n\t}",
"User findOneById(long id);",
"@Override\n\tpublic Usuario findById(Integer id) {\n\t\treturn usuarioRepository.getById(id);\n\t}",
"public User getUserById(int id) {\n System.out.println(id + this.userDao.selectId(id).getUsername());\n\n return this.userDao.selectId(id);\n }",
"User findUser(String userId);",
"User getOne(long id) throws NotFoundException;",
"public User getById(Long id) throws DaoException {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n User user = new User();\n try {\n connection = dataSourceUtils.getConnection(dataSource);\n preparedStatement = connection.prepareStatement(GET_USER_BY_ID);\n ResultSet resultSet = preparedStatement.executeQuery();\n\n if (resultSet.next()) {\n parseResultSet(resultSet, user);\n }\n } catch (SQLException e) {\n throw new DaoException(e);\n } finally {\n DataSourceUtils.releaseConnection(connection, dataSource);\n try {\n preparedStatement.close();\n } catch (SQLException e) {\n LOGGER.error(e);\n }\n }\n return user;\n }",
"User getUser(Long id);",
"public Users getUser(Integer id) {\r\n\t\treturn usDao.findById(id, true);\r\n\r\n\t}",
"public Optional<User> retrieveUser(Long id) {\n\t\treturn userRepository.findById(id);\n\t}",
"@Override\r\n\tpublic Usuario findById(String id) {\n\t\treturn em.find(Usuario.class,id);\r\n\t}",
"@Override\n public TechGalleryUser getUser(final Long id) throws NotFoundException {\n TechGalleryUser userEntity = userDao.findById(id);\n // if user is null, return a not found exception\n if (userEntity == null) {\n throw new NotFoundException(i18n.t(\"No user was found.\"));\n } else {\n return userEntity;\n }\n }",
"public Optional<User> findById(Integer id);",
"@Override\n\tpublic User findNeedById(int id) {\n\t\treturn userdao.findNeedById(id);\n\t}",
"public User getUser(String id) {\n return repository.getUser(id).get(0);\n }",
"@Override\n public User getUserById(int id) {\n Session session = this.sessionFactory.getCurrentSession(); \n User u = (User) session.load(User.class, new Integer(id));\n logger.info(\"User loaded successfully, User details=\"+u);\n return u;\n }"
] | [
"0.8477843",
"0.84258664",
"0.84134024",
"0.83713675",
"0.836103",
"0.83090264",
"0.83013725",
"0.82900804",
"0.82798195",
"0.823492",
"0.8216144",
"0.8190636",
"0.8186358",
"0.8162305",
"0.8160748",
"0.8129078",
"0.81265694",
"0.81178373",
"0.80981183",
"0.8093012",
"0.80865496",
"0.80691326",
"0.80558205",
"0.8048177",
"0.80477405",
"0.8031505",
"0.8025145",
"0.80157596",
"0.8015692",
"0.80023575",
"0.79927456",
"0.79882634",
"0.7978032",
"0.79730976",
"0.7936646",
"0.78932065",
"0.7875581",
"0.7868936",
"0.7842837",
"0.7842626",
"0.7834083",
"0.78337604",
"0.782956",
"0.7815696",
"0.7808864",
"0.77966094",
"0.77881056",
"0.77855825",
"0.7769074",
"0.776646",
"0.77626806",
"0.77415305",
"0.77335155",
"0.77203953",
"0.7709063",
"0.7704063",
"0.7693493",
"0.76932514",
"0.76915765",
"0.76646936",
"0.76619375",
"0.7653781",
"0.76479834",
"0.7632792",
"0.7617378",
"0.761518",
"0.7595981",
"0.75867033",
"0.75737274",
"0.7569454",
"0.7566689",
"0.7566689",
"0.7557673",
"0.7557492",
"0.7556103",
"0.75499415",
"0.75395614",
"0.7532985",
"0.7516328",
"0.7516228",
"0.74844044",
"0.7481",
"0.74720013",
"0.74642664",
"0.7462082",
"0.74616337",
"0.74501294",
"0.7448926",
"0.7448425",
"0.7441686",
"0.7440882",
"0.74373996",
"0.74324834",
"0.74314725",
"0.7418106",
"0.74128306",
"0.74105036",
"0.74060637",
"0.74045503",
"0.73889625"
] | 0.77440596 | 51 |
Insert a UserBean into the database. | public boolean insert(UserBean user) {
this.createConnection();
String stmntAddr = "INSERT INTO " + this.getTableName() + " (username, password, admin, addressid) VALUES (?,?,?,?);";
String stmntNoAddr = "INSERT INTO " + this.getTableName() + " (username, password, admin) VALUES (?,?,?);";
try {
Connection con = this.getCon();
PreparedStatement pstmt = con.prepareStatement(user.getAddress() == null ? stmntNoAddr : stmntAddr);
pstmt.setString(1, user.getUserName());
pstmt.setString(2, user.getPassword());
pstmt.setBoolean(3, user.getAdmin());
if (user.getAddress() != null) {
pstmt.setInt(4, user.getAddress().getId());
}
pstmt.executeUpdate();
return true;
} catch (SQLException e) {
System.out.println("SQL Exception" + e.getErrorCode() + e.getMessage());
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void insertOne(GuestUserVo bean) throws SQLException {\n\t\t\r\n\t}",
"@Override\n\tpublic void insert(User objetc) {\n\t\tuserDao.insert(objetc);\n\t\t\n\t}",
"public void insertUser() {}",
"public void insertUser(User user) {\n mUserDAO.insertUser(user);\n }",
"@Override\n\tpublic void insert(UsersDto dto) {\n\t\tsession.insert(\"users.insert\", dto);\n\t}",
"public void insert(User user);",
"@Override\n\tpublic void insertUser(UserPojo user) {\n\t\tuserDao.insertUser(user);\n\t}",
"private void insert() {//将数据录入数据库\n\t\tUser eb = new User();\n\t\tUserDao ed = new UserDao();\n\t\teb.setUsername(username.getText().toString().trim());\n\t\tString pass = new String(this.pass.getPassword());\n\t\teb.setPassword(pass);\n\t\teb.setName(name.getText().toString().trim());\n\t\teb.setSex(sex1.isSelected() ? sex1.getText().toString().trim(): sex2.getText().toString().trim());\t\n\t\teb.setAddress(addr.getText().toString().trim());\n\t\teb.setTel(tel.getText().toString().trim());\n\t\teb.setType(role.getSelectedIndex()+\"\");\n\t\teb.setState(\"1\");\n\t\t\n\t\tif (ed.addUser(eb) == 1) {\n\t\t\teb=ed.queryUserone(eb);\n\t\t\tJOptionPane.showMessageDialog(null, \"帐号为\" + eb.getUsername()\n\t\t\t\t\t+ \"的客户信息,录入成功\");\n\t\t\tclear();\n\t\t}\n\n\t}",
"@Override\n\tpublic void insert(User user) throws DAOException {\n\t\t\n\t}",
"@Override\n\tpublic void insertUser(User user) {\n\t\t\n\t}",
"public int insertUser(final User user);",
"private void pushToHibernate(){\n DATA_API.saveUser(USER);\n }",
"@Insert({\n \"insert into user_t (id, user_name, \",\n \"password, age, ver)\",\n \"values (#{id,jdbcType=INTEGER}, #{userName,jdbcType=VARCHAR}, \",\n \"#{password,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{ver,jdbcType=INTEGER})\"\n })\n int insert(User record);",
"@Override\r\n\tpublic void insertUser(VIPUser user) {\n\t\ttry{\r\n\t\t\tString sql = \"insert into vipuser(id,name) values (?,?)\";\r\n\t\t\tObject[] args = new Object[]{user.getId(), user.getName()};\r\n\t\t\tdaoTemplate.update(sql, args, false);\r\n\t\t}catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}",
"void add(User user) throws SQLException;",
"void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }",
"public static boolean addNewUser(User bean) throws SQLException{\n \n String sql = \"INSERT INTO $tablename (email, password, firstName, lastName) VALUES (?, ?, ?, ?)\";\n \n String query = sql.replace(\"$tablename\", bean.getTable());\n \n ResultSet keys = null;\n \n try{\n Connection conn = DbUtil.getConn(DbType.MYSQL);\n PreparedStatement stmt = conn.prepareStatement(query, Statement.RETURN_GENERATED_KEYS);\n \n stmt.setString(1, bean.getEmail());\n stmt.setString(2, bean.getPassword());\n stmt.setString(3, bean.getFirstName());\n stmt.setString(4, bean.getLastName());\n \n int affected = stmt.executeUpdate();\n \n return affected == 1;\n \n } catch (SQLException e) {\n System.err.println(e);\n return false;\n } finally {\n if(keys != null) {\n keys.close();\n }\n }\n }",
"public void inserData(MemberBean b) {\n\t\tem.persist(b);\n\t}",
"public void postUser(User u) throws DBException\n {\n String sqlString = \"INSERT INTO user (username, password, email, firstName, \" +\n \"lastName, gender, person_id) VALUES(?,?,?,?,?,?,?)\";\n\n try(PreparedStatement sqlStatement = conn.prepareStatement(sqlString))\n {\n sqlStatement.setString(1, u.getUserName());\n sqlStatement.setString(2, u.getPassword());\n sqlStatement.setString(3, u.getEmail());\n sqlStatement.setString(4, u.getFirstName());\n sqlStatement.setString(5, u.getLastName());\n sqlStatement.setString(6, u.getGender());\n sqlStatement.setString(7, u.getPersonID());\n\n sqlStatement.executeUpdate();\n }\n catch(SQLException ex)\n {\n throw new DBException(\"Unable to insert User\");\n }\n }",
"public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void insertDemoBean(DemoBean demoBean) {\n\t\tdemoDao.insertDemoBean(demoBean);\n\t}",
"@Override\n public boolean userRegister(User user) \n { \n Connection conn = null;\n Statement stmt = null;\n try \n {\n db_controller.setClass();\n conn = db_controller.getConnection();\n stmt = conn.createStatement();\n String sql;\n \n sql = \"INSERT INTO users (firstname,lastname,username,password,city,number) \"\n + \"values ('\"+ user.getFirstname()+\"',\" \n + \"'\" + user.getLastname() + \"',\" \n + \"'\" + user.getUsername() + \"',\" \n + \"'\" + user.getPassword() + \"',\" \n + \"'\" + user.getCity() + \"',\"\n + \"'\" + user.getNumber() + \"')\";\n int result = stmt.executeUpdate(sql);\n \n stmt.close();\n conn.close();\n if(result == 1) return true;\n else return false;\n } \n catch (SQLException ex) { ex.printStackTrace(); return false;} \n catch (ClassNotFoundException ex) { ex.printStackTrace(); return false;} \n }",
"@Override\n\tpublic Integer insert(User user) {\n\t\tuserMapper.insert(user);\n\t\t// MyBatisUtil.closeSqlSession();\n\t\treturn user.getId();\n\t}",
"public void insertDB() {\n //defines Connection con as null\n Connection con = MainWindow.dbConnection();\n try {\n //tries to create a SQL statement to insert values of a User object into the database\n String query = \"INSERT INTO User VALUES ('\" + userID + \"','\" + password + \"','\" + firstName + \"','\" +\n lastName + \"');\";\n Statement statement = con.createStatement();\n statement.executeUpdate(query);\n //shows a message that a new user has been added successfully\n System.out.println(\"new user has been added into the data base successfully\");\n } catch (Exception e) {\n //catches exceptions and show message about them\n System.out.println(e.getMessage());\n Message errorMessage = new Message(\"Error\", \"Something wrong happened, when there was a attempt to add user into the database. Try again later.\");\n }//end try/catch\n //checks if Connection con is equaled null or not and closes it.\n MainWindow.closeConnection(con);\n }",
"Long insert(User record);",
"void insertUser(String pseudo, String password, String email) throws SQLException;",
"public int insertUser(UserData user) {\n try {\n jdbcTemplate.execute(\"SELECT 1 from userData\");\n } catch (Exception ex) {\n creatTable();\n }\n\n\n PreparedStatementSetter preps = new PreparedStatementSetter() {\n @Override\n public void setValues(PreparedStatement ps) throws SQLException {\n ps.setString(1, user.getUserName());\n ps.setString(2, user.getFirstName());\n ps.setString(3, user.getLastName());\n ps.setString(4, user.getEmail());\n ps.setString(5, user.getPassword());\n ps.setString(6, user.getPhoneNo());\n\n ps.setString(7, user.getImage());\n\n }\n };\n\n return jdbcTemplate.update(CREATEUSER, preps);\n\n\n }",
"public String insertUser() throws IOException {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n String query = \"insert into users (first_name, last_name, phone_number, email, address, id_city) values (?, ?, ?, ?, ?, ?)\";\n PreparedStatement ps = conn.prepareStatement(query);\n ps.setString(1, firstName);\n ps.setString(2, lastName);\n ps.setString(3, phoneNumber);\n ps.setString(4, email);\n ps.setString(5, address);\n ps.setInt(6, idCity);\n ps.executeUpdate();\n FacesContext context = FacesContext.getCurrentInstance();\n context.getExternalContext().getFlash().setKeepMessages(true);\n FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, \"User created\", null);\n FacesContext.getCurrentInstance().addMessage(null, msg);\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n lastCreatedUserTable();\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n HttpSession sesija = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);\n Integer type = (Integer) sesija.getAttribute(\"type\");\n if (type == 1) {\n return \"admin?faces-redirect=true\";\n } else {\n return \"operator?faces-redirect=true\";\n }\n\n }",
"@Insert({\n \"insert into tb_user (username, password)\",\n \"values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR})\"\n })\n int insert(User record);",
"int insert(UserEntity record);",
"@Override\r\n\tpublic void insert(User user) {\n\t\tint iRet = dao.insert(user);\r\n\t\tif(iRet != 1){\r\n\t\t\tlogger.error(\"新增失败\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"新增成功\");\r\n\t}",
"@Override\n public void addUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.persist(u);\n logger.info(\"User saved successfully, User Details=\"+u);\n }",
"public User InsertUser(User user){\n\t\t\t//step to call the jpa class and insert user into the db\n\t\t\treturn user;\n\t\t}",
"@Override\n\tpublic void insertOne(User u) {\n\t\tdao.insertOne(u);\n\t}",
"@Test\r\n\t\tpublic void insertUserTestCase() {\r\n\t\t\t\r\n\t\t\tUser user = new User();\r\n\t\t\t\t\t\r\n\t\t//\tuser.setBirthDate(LocalDate.parse(\"1994-04-09\"));\r\n\t\t\tuser.setUsername(\"renu\");\r\n\t\t//\tuser.setUserId(1003);\r\n\t\t\t\r\n\t\t\tuser.setEmail(\"renu@gmail.com\");\r\n\t\t\t\t\t\r\n\t\t\tuser.setFirstname(\"Renu\");\r\n\t\t\tuser.setSurname(\"Rawat\");\r\n\t\t//\tuser.setGender('F');\r\n\t\t\tuser.setPassword(\"renu\");\r\n\t\t\tuser.setPhone(\"9876543210\");\r\n\t\t//\tuser.setStatus(\"A\");\r\n\t\t\tuser.setIsOnline(false);\r\n\t\t\t\r\n\t\t\tuser.setRole(\"ADMIN\");\r\n\t\t//\tuser.setConfmemail(\"renu@gmail.com\");\r\n\t\t//\tuser.setConfpassword(\"renu\");\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"user printed\");\r\n\t\t\tassertEquals(\"successfully!\", Boolean.valueOf(true), userDao.registerUser(user));\r\n\t\t\tSystem.out.println(\"After User Table\");\r\n\t\t\t\r\n\t}",
"@Override\r\n\tpublic int insert(User record) {\n\t\treturn userDao.insert(record);\r\n\t}",
"@Override\r\n\tpublic boolean create(UserInfo bean) throws Exception\r\n\t{\r\n\t\ttry {\r\n\t\t\tif (em.find(UserInfo.class, bean.getUsername()) == null) {\r\n\t\t\t\tem.persist(bean);\r\n\t\t\t\treturn true;\r\n\t\t\t} else\r\n\t\t\t\treturn false;\r\n\t\t} catch (Exception e) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public User insert(User user) throws DataAccessException;",
"public void insert() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.save(this);\n\t\tsession.getTransaction().commit();\n\t}",
"@Override\n\tpublic int AddUser(UserBean userbean) {\n\t\treturn 0;\n\t}",
"private void salvarMysql(User user){\n try{\n Connection conn = usersDataSource.getConnection();\n Statement stmt = conn.createStatement();\n\n stmt.executeUpdate(\"INSERT INTO usuario (name) \" + \"VALUES ( \"+ user.getName() +\")\");\n stmt.close();\n conn.close();\n } catch (Exception e){\n e.printStackTrace();\n }\n }",
"int insert (EmpBean emp) throws ClassNotFoundException, SQLException {\n\t\t\n\tConnection con = DBUtil.getConnection();\n\tString sql= \"insert into empTab values(?,?,?)\";\n\tPreparedStatement ps = con.prepareStatement(sql);\n\tps.setString(1, emp.getEmpName());\n\tps.setString(2, emp.getEmpemailid());\n\tps.setInt(3, emp.getEmpphoneno());\n\t\n\n\treturn ps.executeUpdate(); //1 row inserted\n\t\n\t\n\t\n}",
"void insert(BsUserRole record);",
"int insert(User record);",
"int insert(User record);",
"int insert(User record);",
"int insert(User record);",
"int insert(User record);",
"int insert(User record);",
"int insert(User record);",
"int insert(User record);",
"@Override\n public int insert(Bean bean) {\n \n PreparedStatement ps = null;\n Alumno al = (Alumno) bean;\n CarreraDAO car = new CarreraDAO();\n Connection conexion = DAOFactory.getConexion();\n try {\n ps = conexion.prepareStatement(SQL.insertarAlumno);\n ps.setString(1, al.getMatricula());\n ps.setString(2, al.getNombre());\n ps.setString(3, al.getPaterno());\n ps.setString(4, al.getMaterno() );\n ps.setString(5, al.getTelefono());\n ps.setString(6, al.getFecha());\n ps.setInt(7, car.getIdcarreraByClave(al.getCarrera().getClave()));\n \n ps.executeUpdate();\n } catch (SQLException ex) {\n Logger.getLogger(CarreraDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return 1;\n }",
"@Insert(\"insert into shoppinguser(id,nickname,password,salt,register_date,last_login_date,login_count) \"\n\t\t\t+ \"values(#{id},#{nickname},#{password},#{salt},#{register_date},#{last_login_date},#{login_count})\")\n\tBoolean tx(ShoppingUser user);",
"public void createUtilisateur(UtilisateurBean u) {\n\t}",
"@Override\n\tpublic int insert(User record) {\n\t\treturn userMapper.insert(record);\n\t}",
"public long addNewUser(UserBean ub) throws DBException {\n\t\tConnection conn = null;\n\t\tPreparedStatement ps = null;\n\t\ttry {\n\t\t\tconn = factory.getConnection();\n\t\t\tps = conn\n\t\t\t\t\t.prepareStatement(\"INSERT INTO `webdesigner`.`users` (`id` ,`username` ,`email` ,`password` ,`firstname` ,`lastname`)VALUES (?, ?, ?, ?, ?, ?);\");\n\t\t\tif (ub.getId() == null) {\n\t\t\t\tub.setId(0L);\n\t\t\t}\n\t\t\tuserLoader.loadParameters(ps, ub);\n\t\t\tps.executeUpdate();\n\t\t\tlong a = DBUtil.getLastInsert(conn);\n\t\t\tps.close();\n\t\t\taddUserToRoleTable(ub);\n\t\t\treturn a;\n\t\t} catch (SQLException | NamingException e) {\n\t\t\tthrow new DBException(e);\n\t\t} finally {\n\t\t\tDBUtil.closeConnection(conn, ps);\n\t\t}\n\t}",
"public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"int insert(UUser record);",
"public void insertUser(Long userId) {\n\r\n\t\tTUserDetail detail = new TUserDetail();\r\n\t\tdetail.setUserId(userId);\r\n\t\tdetail.setSex(\"M\");\r\n\t\tdetail.setTel(10000);\r\n\t\tdetail.setLinkman(\"ZS\");\r\n\t\ttUserDetailMapper.insert(detail);\r\n\r\n\t\tTUser user = new TUser(userId);\r\n\t\tuser.setStatus(\"UNOK\");\r\n\t\tuser.setUserName(\"killer\");\r\n\t\ttUserMapper.insert(user);\r\n\t}",
"int insert(UserDO record);",
"Long insert(User user);",
"public void insertData(User user) {\n String sql_user = \"INSERT INTO BGE_users \"\n + \"(username, password, enabled) VALUES (?, ?, ?)\";\n\n String sql_role = \"INSERT INTO BGE_user_roles \"\n + \"(username, ROLE) VALUES (?, 'ROLE_USER')\";\n\n JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);\n\n int var3 = 0;\n\n if (user.isEnabled()) {\n var3 = 1;\n }\n\n //Add the User\n jdbcTemplate.update(\n sql_user,\n new Object[]{user.getUsername(), user.getPassword(), var3});\n\n //Add the Role\n jdbcTemplate.update(\n sql_role,\n new Object[]{user.getUsername()});\n }",
"public boolean insertUser(User user) {\n\t\t try{\n\t\t\t sessionFactory.getCurrentSession().save(user);\n\t\t\treturn true; \n\t\t }\n\t\t catch(Exception e){\n\t\t\t return false; \n\t\t }\n\t}",
"int insert(BizUserWhiteList record);",
"@Override\r\n\tpublic void insertSmsSign(SmsSignBean bean) {\n\t\tsqlSessionTemplate.insert(NAMESPACE+\"insertSmsSign\", bean);\r\n\t}",
"int insert(BaseUser record);",
"public void addUser(User user) {\n try (PreparedStatement pst = this.conn.prepareStatement(\"INSERT INTO users (name, login, email, createDate)\"\n + \"VALUES (?, ?, ?, ?)\")) {\n pst.setString(1, user.getName());\n pst.setString(2, user.getLogin());\n pst.setString(3, user.getEmail());\n pst.setTimestamp(4, user.getCreateDate());\n pst.executeUpdate();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void addUser(IndividualUser u) {\n try {\n PreparedStatement s = sql.prepareStatement(\"INSERT INTO Users (userName, firstName, lastName, friends) VALUES (?,?,?,?);\");\n s.setString(1, u.getId());\n s.setString(2, u.getFirstName());\n s.setString(3, u.getLastName());\n s.setString(4, u.getFriends().toString());\n s.execute();\n s.close();\n\n } catch (SQLException e) {\n sqlException(e);\n }\n }",
"public static boolean addUser(UserDetailspojo user) throws SQLException {\n Connection conn=DBConnection.getConnection();\n String qry=\"insert into users1 values(?,?,?,?,?)\";\n System.out.println(user);\n PreparedStatement ps=conn.prepareStatement(qry);\n ps.setString(1,user.getUserid());\n ps.setString(4,user.getPassword());\n ps.setString(5,user.getUserType());\n ps.setString(3,user.getEmpid());\n ps.setString(2,user.getUserName());\n //ResultSet rs=ps.executeQuery();\n int rs=ps.executeUpdate();\n return rs==1;\n //String username=null;\n }",
"@ApiMethod(name = \"insertMyBean\")\n public MyBean insertMyBean(MyBean myBean) {\n // TODO: Implement this function\n logger.info(\"Calling insertMyBean method\");\n return myBean;\n }",
"@Override\n\tpublic void insert(User entity) {\n\t\tuserlist.put(String.valueOf(entity.getDni()), entity);\n\t}",
"@Override\n\tpublic int insertUser(User user) {\n\t\treturn uDao.insertUser(user);\n\t}",
"public void save(User use) {\n jdbcTemplate.update(\"insert into user (id,name) values(?,?)\", use.getName());\n }",
"int insert(UserPasswordDO record);",
"public void insertUser(String firstname, String lastname, String email) {\n/* 53 */ Connection conn = null;\n/* 54 */ PreparedStatement pstmt = null;\n/* 55 */ String sql = null;\n/* */ \n/* */ try {\n/* 58 */ conn = getConn();\n/* 59 */ System.out.println(\"db접속 성공\");\n/* 60 */ sql = \"insert into members(firstname,lastname,email) values(?,?,?)\";\n/* 61 */ pstmt = conn.prepareStatement(sql);\n/* 62 */ pstmt.setString(1, firstname);\n/* 63 */ pstmt.setString(2, lastname);\n/* 64 */ pstmt.setString(3, email);\n/* 65 */ int i = pstmt.executeUpdate();\n/* */ }\n/* 67 */ catch (Exception e) {\n/* 68 */ e.printStackTrace();\n/* */ } finally {\n/* 70 */ closeDB();\n/* */ } \n/* */ }",
"@RequestMapping(value=\"/insertuser\",method =RequestMethod.GET)\n public boolean insertUser(@RequestBody User user){\n user.setPassword(user.getPassword());\n user.setUsername(user.getUsername());\n return iUserService.save(user);\n }",
"@Override\r\n\tpublic boolean insertUsuario(Usuario user) {\n\t\treturn false;\r\n\t}",
"public Long insert(User object) throws DaoException {\n long id = 0;\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n try {\n connection = dataSourceUtils.getConnection(dataSource);\n preparedStatement = connection.prepareStatement(INSERT_USER);\n\n preparedStatement.setString(1, object.getUserName());\n preparedStatement.setString(2, object.getLogin());\n preparedStatement.setString(3, object.getPassword());\n preparedStatement.executeUpdate();\n\n ResultSet resultSet = preparedStatement.getGeneratedKeys();\n if (resultSet.next()) {\n id = resultSet.getLong(1);\n object.setUserId(id);\n }\n } catch (SQLException e) {\n throw new DaoException(e);\n } finally {\n DataSourceUtils.releaseConnection(connection, dataSource);\n try {\n preparedStatement.close();\n } catch (SQLException e) {\n LOGGER.error(e);\n }\n }\n return id;\n }",
"public UserRegister(String userFirstName, String userLastName, String userEmail, String userPhoneNo, String userName, String userPassword) throws Exception { \r\n\t\t//super(userName, userPassword);\r\n\t\t// add new user to database\r\n\t\ttry {\r\n\t\tString str = \"INSERT INTO tblusers (userName,userPassword, userFirstName, userLastName, userEmail, userPhoneNo, userDateJoined)\" + \r\n\t\t\t\t\"VALUES ('\" + userName + \"', '\" + userPassword + \"', '\" + userFirstName + \"', '\" + userLastName + \"',\" + \r\n\t\t\t\t\" '\" + userEmail + \"', '\" + userPhoneNo + \"', NOW() );\";\r\n\t\tDBConnect.runUpdateQuery(str);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow e;\r\n\t\t\t//System.out.println(e.toString());\r\n\t\t}\r\n\r\n\t}",
"public void addNewUser(User user) throws SQLException {\n PreparedStatement pr = connection.prepareStatement(Queries.insertNewUser);\n pr.setString(1, user.getUserFullName());\n pr.setString(2, user.getUserEmail());\n pr.setInt(3, user.getPhoneNumber());\n pr.setString(4, user.getUserLoginName());\n pr.setString(5, user.getUserPassword());\n pr.execute();\n pr.close();\n }",
"void addUser(BlogUser user) throws DAOException;",
"@Override\r\n\tpublic int inserta(ReservaBean bean) throws Exception {\n\t\treturn 0;\r\n\t}",
"@Insert({\r\n \"insert into umajin.user_master (user_id, nickname, \",\r\n \"sex, age, birthday, \",\r\n \"regist_date, update_date, \",\r\n \"disable)\",\r\n \"values (#{user_id,jdbcType=INTEGER}, #{nickname,jdbcType=VARCHAR}, \",\r\n \"#{sex,jdbcType=INTEGER}, #{age,jdbcType=INTEGER}, #{birthday,jdbcType=DATE}, \",\r\n \"#{regist_date,jdbcType=TIMESTAMP}, #{update_date,jdbcType=TIMESTAMP}, \",\r\n \"#{disable,jdbcType=INTEGER})\"\r\n })\r\n int insert(UserMaster record);",
"public void insertTransaction(DemoBean demoBean) {\n\t\tdemoDao.insertDemoBean(demoBean);\n\t\tthrow new RuntimeException();\n\t}",
"public static void addUserToDb(Person person) {\n\n //converting person's data for SQL database\n String name = person.getName();\n int height = person.getHeight();\n double weight = person.getWeight();\n double waist = person.getWaistCircumference();\n int multiplier = person.getMultiplier();\n double calorieRate = person.getCalorieRate();\n String lastDate = getTodaysDate();\n\n //using data to create a query\n String dbQuery = \"INSERT INTO users(username, userheight, userweight, userwaist, usermultiplier, usercaloryrate, lastdate) \" +\n \"VALUES ('\" + name + \"', \" + height + \", \" + weight + \", \" + waist + \", \" +\n multiplier + \", \" + calorieRate + \", '\" + lastDate + \"')\";\n\n //sending a query and effectively adding user to the DB. Setting sql generated ID to the java object\n int personsId = DbConnector.addingNewRecordToDb(dbQuery);\n person.setId(personsId);\n }",
"int insert(WbUser record);",
"public void SaveUsuario(UsuarioDTO u) {\n Conexion c = new Conexion();\n PreparedStatement ps = null;\n String sql = \"INSERT INTO Usuario(nombre,apellido,usuario,email,password,fecha_nacimiento,fecha_creacion)\"\n + \"VALUES (?,?,?,?,?,?,?)\";\n try {\n ps = c.getConexion().prepareStatement(sql);\n ps.setString(1, u.getNombre());\n ps.setString(2, u.getApellido());\n ps.setString(3, u.getUsuario());\n ps.setString(4, u.getEmail());\n ps.setString(5, u.getPassword());\n ps.setDate(6, Date.valueOf(u.getFecha_Nacimiento()));\n ps.setDate(7, Date.valueOf(u.getFecha_Creacion()));\n ps.executeUpdate();\n } catch (SQLException ex) {\n System.out.println(\"A \" + ex.getMessage());\n } catch (Exception ex) {\n System.out.println(\"B \" + ex.getMessage());\n } finally {\n try {\n ps.close();\n c.cerrarConexion();\n } catch (Exception ex) {\n }\n }\n }",
"private void UserRegister(String fname, String mname, String lname, String address, String username, String userpassword) throws SQLException, ClassNotFoundException\n {\n //Register the driver.i.e Adding mysql database driver to classpath.\n Class.forName(\"com.mysql.cj.jdbc.Driver\");\n //Connect to the database\n Connection dbconn=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/quiz\", \"root\", \"2001\");\n //Query. It represents precomplied SQL statement.\n PreparedStatement st= dbconn.prepareStatement(\"INSERT INTO user (firstname,middlename,lastname,address,username,userpassword)VALUES(?,?,?,?,?,?)\");\n st.setString(1, fname);\n st.setString(2, mname);\n st.setString(3, lname);\n st.setString(4, address);\n st.setString(5, username);\n st.setString(6, userpassword);\n //execute query\n int res =st.executeUpdate();\n JOptionPane.showMessageDialog(this,\"User data Inserted \",\"SUCCESS\",JOptionPane.INFORMATION_MESSAGE);\n \n tf_firstname.setText(\"\");\n tf_middlename.setText(\"\");\n tf_lastname.setText(\"\");\n tf_address.setText(\"\");\n tfUsername.setText(\"\");\n Password.setText(\"\");\n }",
"public void insert1(login uv) {\n\t\ttry\n {\n SessionFactory sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();\n \t\n Session session = sessionFactory.openSession();\n \n Transaction transaction=session.beginTransaction();\n \n session.save(uv);\n \n transaction.commit();\n \n session.close();\n }\n catch(Exception ex)\n {\n ex.printStackTrace();\n }\n\t\t\n\t}",
"public boolean addRecord(UserDetails userobj) \r\n\t{\n\t\t\r\n\t\tConnection connectionobject = null;\r\n\t\tPreparedStatement pst = null;\r\n\t\tboolean f = false;\r\n\t\ttry\r\n\t\t{\r\n\t connectionobject = DBConnectClose.getMySQLConnection();\r\n\t\t \r\n\t pst = connectionobject.prepareStatement(\"insert into userdetails values(?,?,?,?,?,?,?,?,?)\");\r\n\t\t \r\n\t\t pst.setString(1, userobj.getEmail());\r\n\t\t pst.setString(2, userobj.getPassword());\r\n\t\t pst.setString(3, userobj.getName());\r\n\t\t pst.setString(4, userobj.getMobileno());\r\n\t\t pst.setString(5, userobj.getDob());\r\n\t\t pst.setString(6, userobj.getGender());\r\n\t\t pst.setString(7, userobj.getHobbyString());\r\n\t\t pst.setString(8, userobj.getCountry());\r\n\t\t pst.setString(9, userobj.getAddress());\r\n\t\t \t\t \r\n\t\t int i = pst.executeUpdate();\r\n\t\t \r\n\t\t System.out.println(i);\r\n\t\t \r\n\t\t if(i > 0 )\r\n\t\t \t f = true;\r\n \r\n\t }catch(SQLException e){e.printStackTrace();}\r\n\t finally \r\n\t {\r\n\t \t DBConnectClose.closeMySQLPreaparedStatementConnection(pst);\r\n\t \t DBConnectClose.closeMySQLConnection(connectionobject);\r\n\t\t }\r\n\t\t\r\n\t return f;\r\n\t}",
"public void insertNewUser(String username, String password, String emailAddress) {\r\n\t\tConnection c = getConnection();\r\n\t\ttry {\r\n\t\t\tPreparedStatement ptsmt = (PreparedStatement)c.prepareStatement(\"INSERT INTO user(userName, password, emailAddress) VALUES (?, ?, ?)\");\r\n\t\t\tptsmt.setString(1, username );\r\n\t\t\tptsmt.setString(2,password );\r\n\t\t\tptsmt.setString(3, emailAddress);\r\n\t\t\tptsmt.execute();\r\n\t\t\t\r\n\t\t}catch(Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"public void save(Connection conn, User user) throws SQLException {\n\t\tString saveSql=\"insert into tbl_user (name,password,email)values(?,?,?)\";\n\t\tPreparedStatement ps=conn\n\t\t\t\t.prepareCall(saveSql);\n\t\tps.setString(1, user.getName());\n\t\tps.setString(2, user.getPassword());\n\t\tps.setString(3, user.getEmail());\n\t\tps.execute();\n\t}",
"@Override\n\tpublic void insertUserAndShopData() {\n\t\t\n\t}",
"int insert(UserT record);",
"@PostMapping\n public void insertUser(@RequestBody User user) { userService.insertUser(user);}",
"int insert(UserGift record);",
"@Override\n\tpublic int insertUser(String username, String password) {\n\t\treturn userMapper.insertUser(username, password);\n\t}",
"public Integer register(UserBean user, String password) {\n UserBean ubean = null;\n Integer res = null;\n UserBean ubeanuname = findUser(user.getUsername());\n UserBean ubeanemail = findUserByEmail(user.getEmail());\n if(ubeanuname == null && ubeanemail == null) {\n ResultSet resultSet = null;\n try {\n resultSet = queryUpdate(String.format(\n \"INSERT INTO %s (name,email,username,password,phone_number)\"\n + \"VALUES ('%s','%s','%s','%s','%s')\",\n tableName,user.name,user.email,user.username, password, user.phoneNumber\n ));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n try {\n ResultSet temp = query(String.format(\n \"SELECT * FROM %s WHERE username = '%s'\", this.tableName, user.getUsername()));\n if(temp.next()) {\n ubean = parseResultSet(temp);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n res = ubean.getId();\n }\n\n return res;\n }",
"int insert(AdminUser record);",
"int insert(AdminUser record);"
] | [
"0.7498095",
"0.7352662",
"0.7271414",
"0.70951086",
"0.70775837",
"0.70649225",
"0.70116156",
"0.6876943",
"0.6778631",
"0.6747438",
"0.6740396",
"0.67138696",
"0.66054565",
"0.65877205",
"0.6584674",
"0.65824234",
"0.65811425",
"0.65587723",
"0.65483373",
"0.6546823",
"0.65415215",
"0.6534779",
"0.6528892",
"0.65205187",
"0.6497077",
"0.64490646",
"0.64427316",
"0.6425055",
"0.6424342",
"0.6421598",
"0.64199245",
"0.64117146",
"0.6402569",
"0.63790834",
"0.6376147",
"0.63693696",
"0.63649845",
"0.6363399",
"0.63173527",
"0.63129413",
"0.63004386",
"0.629201",
"0.6263381",
"0.6252527",
"0.6252527",
"0.6252527",
"0.6252527",
"0.6252527",
"0.6252527",
"0.6252527",
"0.6252527",
"0.6240635",
"0.6234058",
"0.62285846",
"0.62243867",
"0.6222929",
"0.6212211",
"0.62011147",
"0.6192142",
"0.6182385",
"0.61798143",
"0.6178821",
"0.61758065",
"0.6170819",
"0.6163782",
"0.61609346",
"0.6120014",
"0.6102096",
"0.6098664",
"0.6096829",
"0.60967773",
"0.6078162",
"0.60717535",
"0.6063406",
"0.6059681",
"0.6023678",
"0.60151",
"0.60149896",
"0.60117596",
"0.60027677",
"0.59971577",
"0.5993889",
"0.5989023",
"0.5985682",
"0.5984038",
"0.5982388",
"0.5981629",
"0.59809726",
"0.597738",
"0.5970853",
"0.596419",
"0.59623605",
"0.5958631",
"0.5952066",
"0.5945847",
"0.5939828",
"0.59322476",
"0.592834",
"0.592709",
"0.592709"
] | 0.6358097 | 38 |
Update the passed UserBean in the database. | public boolean update(UserBean user) {
this.createConnection();
try (Connection con = this.getCon();
PreparedStatement pstmt = con.prepareStatement("UPDATE ? SET username=?, password=?, admin=?, addressid=? where id=")) {
pstmt.setString(1, this.getTableName());
pstmt.setString(2, user.getUserName());
pstmt.setString(3, user.getPassword());
pstmt.setBoolean(4, user.getAdmin());
pstmt.setInt(5, user.getAddress().getId());
pstmt.setInt(6, user.getUserId());
pstmt.executeUpdate();
return true;
} catch (SQLException e) {
System.out.println("SQL Exception" + e.getErrorCode() + e.getMessage());
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void update(User objetc) {\n\t\tuserDao.update(objetc);\n\t}",
"void update(User user) throws SQLException;",
"public void editUser(UserBean ub) throws DBException {\n\t\tConnection conn = null;\n\t\tPreparedStatement ps = null;\n\t\ttry {\n\t\t\tconn = factory.getConnection();\n\t\t\tps = conn\n\t\t\t\t\t.prepareStatement(\"UPDATE `webdesigner`.`users` SET `id` = ?,`username` = '?,`email` = ?,`password` = ?,`firstname` = ?,`lastname` = ?' WHERE `users`.`id` =?;\");\n\t\t\tuserLoader.loadParameters(ps, ub);\n\t\t\tint parameterCount = ps.getParameterMetaData().getParameterCount();\n\t\t\tps.setLong(parameterCount, ub.getId());\n\t\t\tps.executeUpdate();\n\t\t} catch (SQLException | NamingException e) {\n\n\t\t\tthrow new DBException(e);\n\t\t} finally {\n\t\t\tDBUtil.closeConnection(conn, ps);\n\t\t}\n\t}",
"public void updateUser() {\n Connection conn = null;\n try {\n conn = DriverManager.getConnection(db.DB.connectionString, db.DB.user, db.DB.password);\n Statement stmt = conn.createStatement();\n String query = \"update users set first_name='\" + firstName + \"', \";\n query += \"last_name='\" + lastName + \"', \";\n query += \"phone_number='\" + phoneNumber + \"', \";\n query += \"email='\" + email + \"', \";\n query += \"address='\" + address + \"', \";\n query += \"id_city='\" + idCity + \"' \";\n query += \"where id_user = \" + id;\n stmt.executeUpdate(query);\n\n User updatedUser = findUser(id);\n updatedUser.setFirstName(firstName);\n updatedUser.setLastName(lastName);\n updatedUser.setPhoneNumber(phoneNumber);\n updatedUser.setEmail(email);\n updatedUser.setIdCity(idCity);\n updatedUser.setAddress(address);\n\n } catch (SQLException ex) {\n Logger.getLogger(UserController.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n clear();\n try {\n conn.close();\n } catch (Exception e) {\n /* ignored */ }\n }\n }",
"@Override\r\n\tpublic int updateOne(GuestUserVo bean) throws SQLException {\n\t\treturn 0;\r\n\t}",
"void updateUser(User entity) throws UserDaoException;",
"@Override\n public void updateUser(User u) {\n Session session = this.sessionFactory.getCurrentSession();\n session.update(u);\n logger.info(\"User updated successfully, User Details=\"+u);\n }",
"public void update(User obj) {\n\t\t\n\t}",
"public User updateUser(User user);",
"void updateUser(UserDTO user);",
"@Override\n\tpublic void update(UsersDto dto) {\n\t\tsession.update(\"users.update\", dto);\n\t}",
"public void updateUser(User user) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().update(user);\r\n\t\t\r\n\t}",
"public void update(User user);",
"public void updateUser(User user) {\n\n String updateSql = \"update USER set name = ?, age = ? , salary = ? where id = ?\";\n jdbcTemplate.update(updateSql, user.getName(), user.getAge(), user.getSalary(), user.getId());\n }",
"public boolean update(User u);",
"public void updateUser(User user) {\n\t\t\r\n\t}",
"@Override\n\n public void update(UserInfoVo userInfoVo) {\n\n userDao.update(userInfoVo);\n\n }",
"@Override\n\tpublic void update(User user) throws DAOException {\n\t\t\n\t}",
"public static boolean updateUser (User bean) {\n \n String sql = \"UPDATE $tablename SET firstName = ?, lastName = ?, email = ? WHERE $idType = ?\";\n \n String query = sql.replace(\"$tablename\", bean.getTable()).replace(\"$idType\", bean.getIdType());\n \n try(\n Connection conn = DbUtil.getConn(DbType.MYSQL);\n PreparedStatement stmt = conn.prepareStatement(query);\n ) {\n \n stmt.setString(1, bean.getFirstName());\n stmt.setString(2, bean.getLastName());\n stmt.setString(3, bean.getEmail());\n stmt.setInt(4, bean.getID());\n \n int affected = stmt.executeUpdate();\n \n return affected == 1;\n \n } catch (Exception e) {\n System.out.println(e);\n return false;\n }\n }",
"@Override\n\tpublic void updateUser(User pUser) {\n\t\t\n\t}",
"@Override\n\tpublic void update(User user)\n\t{\n\t\tuserDAO.update(user);\n\t}",
"public void updateUserDetails() {\n\t\tSystem.out.println(\"Calling updateUserDetails() Method To Update User Record\");\n\t\tuserDAO.updateUser(user);\n\t}",
"@Update({\n \"update user_t\",\n \"set user_name = #{userName,jdbcType=VARCHAR},\",\n \"password = #{password,jdbcType=VARCHAR},\",\n \"age = #{age,jdbcType=INTEGER},\",\n \"ver = #{ver,jdbcType=INTEGER}\",\n \"where id = #{id,jdbcType=INTEGER}\"\n })\n int updateByPrimaryKey(User record);",
"public void update() throws Exception {\n\t HaUserDao.getInstance().updateUser(this);\n\t}",
"void updateUser(@Nonnull User user);",
"@Override\n public User update(User user) {\n return dao.update(user);\n }",
"@Override\n\tpublic void updateUser(user theUser) {\n\t}",
"@Override\r\n\tpublic void update(User user) {\n\t\tuserDao.update(user);\r\n\t}",
"@Override\n\tpublic int update(TbUser user) {\n\t\treturn new userDaoImpl().update(user);\n\t}",
"@Override\n\tpublic void updateUser(User user)\n\t{\n\n\t}",
"public void update(User u) {\n\r\n\t}",
"UserEntity updateUser(UserEntity userEntity);",
"void update(User user);",
"void update(User user);",
"void update(User user, Connection connection) throws DAOException;",
"public void update(JTable tblUser)\n {\n int i = tblUser.getSelectedRow();\n \n if(i != -1)\n {\n usersDto = users[i];\n \n CUpdateUser update;\n \n if(usersDto.getState() == 1)\n {\n update = new CUpdateUser(usersDto.getUserId());\n window.dispose();\n \n } else { JOptionPane.showMessageDialog(null, \"Solo se permite modificar registros activos\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n \n } else { JOptionPane.showMessageDialog(null, \"Seleccione un registro a modificar\", \"ERROR\", JOptionPane.ERROR_MESSAGE); }\n }",
"public void updateUser(Person user) {\n\t\t\n\t}",
"public void updateUser(User oldUser, User newUser) ;",
"public void update(User object) throws DaoException {\n Connection connection = null;\n PreparedStatement preparedStatement = null;\n try {\n connection = dataSourceUtils.getConnection(dataSource);\n preparedStatement = connection.prepareStatement(UPDATE_USER);\n\n preparedStatement.setString(1, object.getUserName());\n preparedStatement.setString(2, object.getLogin());\n preparedStatement.setString(3, object.getPassword());\n preparedStatement.setLong(4, object.getUserId());\n preparedStatement.executeUpdate();\n } catch (SQLException e) {\n throw new DaoException(e);\n } finally {\n DataSourceUtils.releaseConnection(connection, dataSource);\n try {\n preparedStatement.close();\n } catch (SQLException e) {\n LOGGER.error(e);\n }\n }\n }",
"@Override\r\n\tpublic void updateUser(User user) throws ToDoListDAOException{\r\n\t\t// TODO Auto-generated method stub\r\n\t\t Session session = factory.openSession();\r\n\t\t try\r\n\t\t {\r\n\t\t session.beginTransaction();\r\n\t\t Query query = session.createQuery(\"from User where userName = :user\");\r\n\t\t User ifUserExist =(User) query.setParameter(\"user\",user.getUserName()).uniqueResult();\r\n\t\t long id = ifUserExist.getId();\r\n\t\t Query query2 = session.createQuery(\"UPDATE User SET password = :pass , userName= :user\" +\r\n\t\t \" where id = :d\");\r\n\t\t query2.setParameter(\"pass\", user.getPassword());\r\n\t\t query2.setParameter(\"user\", user.getUserName());\r\n\t\t query2.setParameter(\"d\", id);\r\n\t\t query2.executeUpdate();\r\n\t\t session.getTransaction().commit();\r\n\t\t \r\n\t\t }\r\n\t\t catch (HibernateException e)\r\n\t\t {\r\n\t\t e.printStackTrace();\r\n\t\t if(session.getTransaction()!=null) session.getTransaction().rollback();\r\n\t\t }\r\n\t\t finally\r\n\t\t {\r\n\t\t\t if(session != null) \r\n\t\t\t\t{ \r\n\t\t\t\t\tsession.close(); \r\n\t\t\t\t} \r\n\t\t } \r\n\t}",
"public User update(User user) throws DataAccessException;",
"@Override\n\tpublic String updateUser(User studentObject) {\n\t\tjdbcTemplate.execute(\"update student set name='\"+studentObject.getName()+\"',address='\"+studentObject.getAddress()+\"'where id=\"+studentObject.getId()); \n\t\treturn \"updated sucess\";\n\t}",
"void updateUserById(String username, User userData);",
"public User updateUser(long id, UserDto userDto);",
"@Override\n\tpublic void updateProfile(UsersDto dto) {\n\t\tsession.update(\"users.updateProfile\", dto);\n\t}",
"E update(IApplicationUser user, ID id, U updateDto);",
"ManageUserResponse updateUser(UserUpdateRequest user, Long userId);",
"@ApiOperation(value=\"Update User\", notes=\"Update User\", httpMethod = \"POST\")\n\t@RequestMapping(value =\"/v1/updateUser\" , method = RequestMethod.POST)\n \tpublic user updateUser(@RequestBody userBean userbean) {\n\t\tif(null != userbean.getEmailId()) {\n\t\t\tuser.updateUser(userbean);\n\t\t}\n\t\treturn null;\n\t}",
"@Update({\n \"update tb_user\",\n \"set password = #{password,jdbcType=VARCHAR}\",\n \"where username = #{username,jdbcType=VARCHAR}\"\n })\n int updateByPrimaryKey(User record);",
"@Override\r\n\tpublic void update(User user) {\n\t\tint iRet = dao.update(user);\r\n\t\tif(iRet != 1){\r\n\t\t\tlogger.error(\"修改失败\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"修改成功\");\r\n\t}",
"public void wsupdate_user(UserWS user) throws HibernateException \r\n\t\t\t\t{ \r\n\t\t\t\t\tUser user_update = null; \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t try \r\n\t\t\t\t\t { \r\n\t\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t\t user_update = (User) sesion.get(User.class,user.getId_user()); \r\n\t\t\t\t\t \r\n\t\t\t\t\t \r\n\t\t\t\t\t //actualizo los camps de la tabla\r\n\t\t\t\t\t user_update.setLogin(user.getLogin());\r\n\t\t\t\t\t user_update.setMail(user.getLogin());\r\n\t\t\t\t\t user_update.setName(user.getName());\r\n\t\t\t\t\t user_update.setPassword(user.getPassword());;\r\n\t\t\t\t\t user_update.setPhone(user.getPhone());\r\n\t\t\t\t\t user_update.setRole(user.getRole());\r\n\t\t\t\t\t user_update.setDepartment(user.getDepartment());\r\n\t\t\t\t\t \r\n\t\t\t\t\t sesion.update(user_update); //le pasamos todo el objeto a modificar\r\n\t\t\t\t\t tx.commit(); \r\n\t\t\t\t\t } catch (HibernateException he) \r\n\t\t\t\t\t { \r\n\t\t\t\t\t manejaExcepcion(he); \r\n\t\t\t\t\t throw he; \r\n\t\t\t\t\t } finally \r\n\t\t\t\t\t { \r\n\t\t\t\t\t sesion.close(); \r\n\t\t\t\t\t } \r\n\t\t\t\t\t }",
"public static String updateProfile(String username) {\n AccountBean lb;\n\n try {\n Class.forName(\"org.apache.derby.jdbc.ClientDriver\");\n } catch (ClassNotFoundException e) {\n\n System.err.println(e.getMessage());\n System.exit(0);\n\n }//end of catch\nint rowCount = 0;\n try {\n String myDB = \"jdbc:derby://localhost:1527/LinkedUDB\";\n Connection DBConn = DriverManager.getConnection(myDB, \"itkstu\", \"student\");\n\n String queryString = \"UPDATE itkstu.userlogin \"\n + \"SET university = '\" + LoginBean.university\n + \"', email = '\" + LoginBean.email\n + \"', firstname = '\" + LoginBean.firstName\n + \"', lastname = '\" + LoginBean.lastName\n + \"', highschool = '\" + LoginBean.highSchool\n + \"', sports = '\" + LoginBean.sports\n + \"', major = '\" + LoginBean.major\n + \"', awards = '\" + LoginBean.awards\n \n + \"' WHERE USERNAME = '\" + username + \"'\";\n\n Statement stmt = DBConn.createStatement();\n rowCount = stmt.executeUpdate(queryString);\n\n DBConn.close();\n return null;\n\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n return null;\n }",
"@Override\n\tpublic void update(Users entity) {\n\t\tSession session = this.sessionFactory.getCurrentSession();\n \tsession.save(entity);\n\t}",
"public User update(User user)throws Exception;",
"void updateUser(int id, UpdateUserDto updateUserDto);",
"@Override\r\n\tpublic int updateByPrimaryKey(User record) {\n\t\treturn userDao.updateByPrimaryKey(record);\r\n\t}",
"public void editUserPassword(UserBean ub) throws DBException {\n\t\tConnection conn = null;\n\t\tPreparedStatement ps = null;\n\t\ttry {\n\t\t\tconn = factory.getConnection();\n\t\t\tps = conn\n\t\t\t\t\t.prepareStatement(\"UPDATE `webdesigner`.`users` SET `password` = ? WHERE `users`.`id` =?;\");\n\t\t\tuserLoader.loadParameters(ps, ub);\n\t\t\tint parameterCount = ps.getParameterMetaData().getParameterCount();\n\t\t\tps.setString(1, ub.getPassword());\n\t\t\tps.setLong(2, ub.getId());\n\t\t\tps.executeUpdate();\n\t\t} catch (SQLException | NamingException e) {\n\n\t\t\tthrow new DBException(e);\n\t\t} finally {\n\t\t\tDBUtil.closeConnection(conn, ps);\n\t\t}\n\t}",
"int updateUserById( User user);",
"public void update(User u) {\n\t\tUserDao ua=new UserDao();\n\t\tua.update(u);\n\t\t\n\t}",
"public boolean update(UserDTO user){\r\n try {\r\n PreparedStatement preSta = conn.prepareStatement(sqlUpdateUser);\r\n preSta.setString(1,user.getEmail());\r\n preSta.setString(2, user.getPassword());\r\n preSta.setInt(3, user.getRole());\r\n preSta.setInt(4, user.getUserId());\r\n if(preSta.executeUpdate() >0){\r\n return true;\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(UserDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n error=\"khong ton tai userId\"+ user.getUserId();\r\n return false;\r\n }",
"public String updateUser(){\n\t\tusersservice.update(usersId, username, password, department, role, post, positionId);\n\t\treturn \"Success\";\n\t}",
"public void updateUser(String firstName, String lastName, String gender, String password, Long userId) {\n\t\tString sql = \"update HealthUsers set firstName = ?, lastName=?, gender=?, password=? where id=?\";\n\t\tObject args[] = {firstName, lastName, gender, password, userId};\n\t\tjdbcTemplate.update(sql, args);\n\t\t\n\t}",
"@Override\n\tpublic int update(Users user) {\n\t\treturn userDAO.update(user);\n\t}",
"@Override\n\tpublic void updateOne(User u) {\n\t\tdao.updateInfo(u);\n\t}",
"@Override\r\n\tpublic void update(User1 userId) {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tUser1 user = (User1) session.get(User1.class, (Serializable) userId);\r\n\t\tsession.update(user);\r\n\t}",
"@Update({\r\n \"update umajin.user_master\",\r\n \"set nickname = #{nickname,jdbcType=VARCHAR},\",\r\n \"sex = #{sex,jdbcType=INTEGER},\",\r\n \"age = #{age,jdbcType=INTEGER},\",\r\n \"birthday = #{birthday,jdbcType=DATE},\",\r\n \"regist_date = #{regist_date,jdbcType=TIMESTAMP},\",\r\n \"update_date = #{update_date,jdbcType=TIMESTAMP},\",\r\n \"disable = #{disable,jdbcType=INTEGER}\",\r\n \"where user_id = #{user_id,jdbcType=INTEGER}\"\r\n })\r\n int updateByPrimaryKey(UserMaster record);",
"int updateByPrimaryKey(UserEntity record);",
"@Override\r\n\tpublic void updateUser(TUsers tuser) {\n\t\tdao.updateUser(tuser);\r\n\t}",
"@Override\n\tpublic void update(Connection conn, User user,Long id) throws SQLException {\n\t\tString updateSql=\"update tbl_user set name=?,password=?,email=?where id=?\";\n\t\tPreparedStatement ps=conn\n\t\t\t\t.prepareCall(updateSql);\n\t\tps.setString(1, user.getName());\n\t\tps.setString(2, user.getPassword());\n\t\tps.setString(3, user.getEmail());\n\t\tps.setLong(4, id);\n\t\tps.execute();\n\t}",
"@Override\n\tpublic void updateUser(SpaceUserVO spaceUserVO) throws Exception {\n\t\t\n\t}",
"public Boolean updateUserData (User currentUser){ //throws Exception if user not existing in database\n\n if(userRepository.existsById(currentUser.getId())){\n User temp_user = getUserById(currentUser.getId());\n\n temp_user.setUsername(currentUser.getUsername());\n temp_user.setBirthday_date(currentUser.getBirthday_date());\n userRepository.save(temp_user);\n\n return true;\n }else{\n throw new UnknownUserException(\"This user doesn't exist and can therefore not be updated\");\n }\n }",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"int updateByPrimaryKey(User record);",
"@Override\n\tpublic int update(Usuario us) {\n\t\tString SQL =\"update user set nomuser = ?, passuser =?\";\n\t\treturn jdbc.update(SQL, us.getUsername(), us.getPassword());\n\t}",
"int updateByPrimaryKey(UUser record);",
"public void update() throws NotFoundException {\n\tUserDA.update(this);\n }",
"int updateByPrimaryKey(BizUserWhiteList record);",
"@Override\n public void doUpdate(FasciaOrariaBean bean) throws SQLException {\n Connection con = null;\n PreparedStatement statement = null;\n String sql = \"UPDATE fasciaoraria SET fascia=? WHERE id=?\";\n try {\n con = DriverManagerConnectionPool.getConnection();\n statement = con.prepareStatement(sql);\n statement.setString(1, bean.getFascia());\n statement.setInt(2, bean.getId());\n System.out.println(\"doUpdate=\" + statement);\n statement.executeUpdate();\n con.commit();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n\n try {\n\n statement.close();\n DriverManagerConnectionPool.releaseConnection(con);\n\n } catch (SQLException e) {\n\n e.printStackTrace();\n }\n }\n }",
"@Override\n\tpublic int updateByPrimaryKey(User record) {\n\t\treturn userMapper.updateByPrimaryKey(record);\n\t}",
"@Override\n\tpublic void updateUser(User user) {\n\t userMapper.updateUser(user);\n\t}",
"int updateByPrimaryKey(BaseUser record);",
"@Override\n public void updateUser(User user){\n try {\n runner.update(con.getThreadConnection(),\"update user set username=?,address=?,sex=?,birthday=? where id=?\"\n ,user.getUsername(),user.getAddress(),user.getSex(),user.getBirthday(),user.getId());\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n e.printStackTrace();\n }\n }",
"public void update(User user) {\n\t\tString sql=\"update SCOTT.USERS set USERNAME='\"+user.getUsername()+\"',PASSWORD='\"+user.getPassword()+\"',NICKNAME='\"+user.getNickname()+\"',EMAIL='\"+user.getEmail()+\"',STATE='\"+user.getState()+\"',CODE='\"+user.getCode()+\"' where ID='\"+user.getUid()+\"'\";\n\t\t\n\t\tJdbcUtils jdbcutils=new JdbcUtils();\n\t\tjdbcutils.executeUpdate(sql);\n\t\t\n\t}",
"private void updateUser() {\n if (\"\".equals(txtFirstname.getText()) || \"\".equals(txtLastname.getText()) || \"\".equals(txtEmail.getText())) {\n JOptionPane.showMessageDialog(null, \"Select a user to update\");\n } else {\n try {\n //Updates record of selected user\n System.out.println(User);\n String sql = \"UPDATE Accounts SET Firstname = '\" + txtFirstname.getText() + \"', Lastname = '\" + txtLastname.getText() + \"', Email = '\" + txtEmail.getText() + \"' WHERE Username = '\" + User + \"'\";\n\n ps = con.prepareStatement(sql);\n ps.executeUpdate();\n showUserData();\n JOptionPane.showMessageDialog(null, User + \" Your information has been updated\");\n\n } catch (SQLException ex) {\n System.out.println(\"Error: \" + ex);\n Logger.getLogger(myAccount.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n }",
"public void update(T obj) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tsession.update(obj);\n\t\t\n\t}",
"public static void update_TbUser() {\n builder = new Uri.Builder();\n builder.appendQueryParameter(\"username\", Server.owner.get_username());\n builder.appendQueryParameter(\"email\", Server.owner.get_Email());\n builder.appendQueryParameter(\"birthday\", Server.owner.get_Birthday().toString());\n builder.appendQueryParameter(\"gender\", Server.owner.get_gender() ? \"1\" : \"0\");\n builder.appendQueryParameter(\"phone\", Server.owner.get_Phone());\n builder.appendQueryParameter(\"image_source\", Server.owner.get_imageSource());\n builder.appendQueryParameter(\"conversations\", Server.owner.get_AllConversation());\n\n String url = Constant.M_HOST + Constant.M_UPDATE_USER_WITHOUT_PASS;\n String a = uService.execute(builder, url);\n }",
"UpdateUserResult updateUser(UpdateUserRequest updateUserRequest);",
"@Test\n public void updateTest() throws SQLException, IDAO.DALException {\n userDAO.create(user);\n user.setNavn(\"SørenBob\");\n user.setCpr(\"071199-4397\");\n user.setAktiv(false);\n user.setIni(\"SBO\");\n // Opdatere objektet i databasen, og sammenligner.\n userDAO.update(user);\n recivedUser = userDAO.get(-1);\n\n assertEquals(recivedUser.getId(), user.getId());\n assertEquals(recivedUser.getNavn(), user.getNavn());\n assertEquals(recivedUser.getIni(), user.getIni());\n assertEquals(recivedUser.getCpr(), user.getCpr());\n assertEquals(recivedUser.isAktiv(),user.isAktiv());\n }",
"@Override\n\tpublic void updateUser(User curpwd) {\n\t\tuserRepository.save(curpwd);\n\t}",
"public void userUpdate(User user) {\n\t\tdao.userUpdate(user);\n\t}",
"public void updateUser(User user) throws HibernateException\r\n\t{\r\n\t Session session = sessionFactory.getCurrentSession();\r\n\t session.update(user);\r\n\t}",
"public void update(T obj) {\n\t\tSession session = this.sessionFactory.getCurrentSession();\n\t\tsession.update(obj);\n\t}",
"int updateByPrimaryKey(WbUser record);"
] | [
"0.7495966",
"0.7398271",
"0.73295534",
"0.72922635",
"0.728211",
"0.72395706",
"0.71854687",
"0.71785074",
"0.7130143",
"0.71236694",
"0.70619",
"0.70462066",
"0.7040713",
"0.70218617",
"0.70039916",
"0.6999941",
"0.6981543",
"0.6979937",
"0.69492203",
"0.6926688",
"0.6908604",
"0.68866533",
"0.68786275",
"0.68770874",
"0.68720007",
"0.6867945",
"0.68601197",
"0.6846486",
"0.6843639",
"0.682193",
"0.68211085",
"0.67795146",
"0.6778546",
"0.6778546",
"0.6747146",
"0.6739105",
"0.6709932",
"0.6703706",
"0.6698144",
"0.66963816",
"0.66818523",
"0.6676518",
"0.66663647",
"0.6665157",
"0.6664894",
"0.6662485",
"0.66579854",
"0.6652015",
"0.6648329",
"0.6643953",
"0.66383755",
"0.66341764",
"0.6633991",
"0.66313654",
"0.6625648",
"0.66227573",
"0.66173214",
"0.6612919",
"0.6593336",
"0.6590739",
"0.65831745",
"0.65799725",
"0.6577753",
"0.6562429",
"0.656175",
"0.6558167",
"0.6552657",
"0.6549913",
"0.6542644",
"0.6542205",
"0.6540544",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6529201",
"0.6524596",
"0.6522108",
"0.6502692",
"0.64986825",
"0.64972603",
"0.6484775",
"0.64846915",
"0.6484601",
"0.6481463",
"0.6480434",
"0.6479594",
"0.64767414",
"0.647265",
"0.64684355",
"0.6463192",
"0.6443975",
"0.6433845",
"0.64174974",
"0.6417211",
"0.6413161"
] | 0.68129164 | 31 |
Delete the passed user from the database. | public boolean delete(UserBean user) {
this.createConnection();
try (Connection con = this.getCon();
PreparedStatement pstmt = con.prepareStatement("DELETE FROM ? where id = ? ;")) {
pstmt.setString(1, this.getTableName());
pstmt.setInt(2, user.getUserId());
pstmt.executeUpdate();
return true;
} catch (SQLException e) {
System.out.println("SQL Exception" + e.getErrorCode() + e.getMessage());
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void deleteUser(User userToDelete) throws Exception;",
"@Override\n\tpublic void deleteUser(User user)\n\t{\n\n\t}",
"@Override\n\tpublic void deleteUser(user theUser) {\n\t\t\n\t}",
"public boolean delete(User user);",
"public void delete(User user){\n userRepository.delete(user);\n }",
"@Override\n\tpublic void deleteUser(User user) {\n\t\topenSession().createQuery(\"DELETE FROM User where userId =\" + user.getUserId()).executeUpdate();\n\t\t\n\t}",
"void deleteUserById(Long id);",
"@Override\r\n\tpublic void delete(User user) {\n\t\tuserDao.delete(user);\r\n\t}",
"void delete(User user);",
"void delete(User user);",
"@Override\n public void delete(User user) {\n dao.delete(user);\n }",
"public void deleteUser(long userId);",
"boolean delete(User user);",
"@Override\n\tpublic void delete(User user)\n\t{\n\t\tuserDAO.delete(user);\n\t}",
"public void deleteUser(Integer uid);",
"public void delete(User user) {\n repository.delete(user);\n }",
"void deleteUser(String userId);",
"void deleteUserById(Integer id);",
"public void deleteUser(User user) {\n update(\"DELETE FROM user WHERE id = ?\",\n new Object[] {user.getId()});\n }",
"public User delete(String user);",
"void deleteUser(String deleteUserId);",
"public void deleteUser(User user) {\n\t\tdelete(user);\r\n\t}",
"public void deleteUserById(Long userId);",
"public void deleteUser(User user) {\n\t\t\r\n\t\tsessionFactory.getCurrentSession().delete(user);\t\r\n\t\t\r\n\t}",
"public void deleteUser(String name);",
"public void delete(User user) {\n\t\tuserDao.delete(user);\n\t}",
"@Override\n public boolean deleteUser(User user) {\n return controller.deleteUser(user);\n }",
"@Override\r\n\tpublic void delete(UserMain user) {\n\t\tusermaindao.delete(user);\r\n\t}",
"public void deleteUser(user user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_NAME, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }",
"public void deleteUser(User user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USER, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getId())});\n db.close();\n }",
"public User delete(User user);",
"public void deleteUserRecord() {\n\t\tSystem.out.println(\"Calling deleteUserRecord() Method To Delete User Record\");\n\t\tuserDAO.deleteUser(user);\n\t}",
"public void deleteUser(String username);",
"@Override\r\n\tpublic int deleteUser(Users user) {\n\t\treturn 0;\r\n\t}",
"public void deleteUser(long id){\n userRepository.deleteById(id);\n }",
"void deleteUser(int id);",
"@Override\n\tpublic Boolean deleteUser(User user) {\n\t\treturn null;\n\t}",
"@Override\n\tpublic void delete(Connection conn, User user) throws SQLException {\n\t\tString deleteSql=\"delete from tbl_user where id=?\";\n\t\tPreparedStatement ps=conn\n\t\t\t\t.prepareCall(deleteSql);\n\t\tps.setLong(1, user.getId());\n\t\tps.execute();\n\t\t\n\t}",
"@Override\r\n\tpublic void deleteByUser(User user) {\n\t\tuserReposotory.delete(user);\r\n\t}",
"@Override\n\tpublic void deleteOne(User u) {\n\t\tdao.deleteOne(u);\n\t}",
"@Override\n public boolean deleteUser(User user) {\n return false;\n }",
"public void delete(User user)throws Exception;",
"@Override\n\tpublic void delete_User(String user_id) {\n\t\tuserInfoDao.delete_User(user_id);\n\t}",
"void deleteUser(String username) throws UserDaoException;",
"@Override\n\tpublic int delete(Users user) {\n\t\t\n\t\treturn userDAO.delete(user);\n\t}",
"@Override\r\n\tpublic int delete(User user) {\n\t\treturn 0;\r\n\t}",
"@Override\n\tpublic void deleteUser(User user) {\n\t\tiUserDao.deleteUser(user);\n\t}",
"void remove(User user) throws SQLException;",
"void deleteUser( String username );",
"@Override\n\tpublic void delete(User user) throws DAOException {\n\t\t\n\t}",
"public void delete(User usuario);",
"@Override\r\n\tpublic boolean delUser(user user) {\n\t\tif(userdao.deleteByPrimaryKey(user.gettUserid())==1){\r\n\t\t\treturn true;}else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t}",
"@Override\n\tpublic void deleteUser(String userId) {\n\t\t\n\t}",
"public void deleteUser(Userlist user) {\n SQLiteDatabase db = this.getWritableDatabase();\n // delete user record by id\n db.delete(TABLE_USERLIST, COLUMN_USER_ID + \" = ?\",\n new String[]{String.valueOf(user.getID())});\n db.close();\n }",
"void deleteUser(User user, String token) throws AuthenticationException;",
"public void deleteUser(int id) {\r\n userRepo.deleteById(id);\r\n }",
"@Override\r\n\tpublic void delete(User user) {\n\t\tint iRet = dao.delete(user);\r\n\t\tif(iRet != 1){\r\n\t\t\tlogger.error(\"删除失败\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tlogger.info(\"删除成功\");\r\n\t}",
"public void deleteUser(IndividualUser user) {\n try{\n PreparedStatement s = sql.prepareStatement(\"DELETE FROM Users WHERE userName=? AND id=? AND firstName=? AND lastName=?;\");\n s.setString(1, user.getId());\n s.setInt(2,user.getIdNum());\n s.setString(3, user.getFirstName());\n s.setString(4, user.getLastName());\n s.execute();\n s.close();\n } catch (SQLException e) {\n sqlException(e);\n }\n }",
"public void deleteUser(User user) {\r\n\t\tusersPersistence.deleteUser(user);\r\n\t}",
"public Boolean DeleteUser(User user){\n\t\t\treturn null;\n\t\t}",
"public void deleteUser(ExternalUser userMakingRequest, String userId);",
"@Override\n\tpublic void deleteUserById(Integer id) {\n\n\t}",
"@Override\n\tpublic void deleteUser(String id) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void deleteUser(int userId) {\n\t\tuserDao.deleteUser(userId);\n\t}",
"public void deleteUser(int id) {\n\t\tuserRepository.delete(id);\r\n\t}",
"@Override\n\tpublic void deleteUser() {\n\t\tLog.d(\"HFModuleManager\", \"deleteUser\");\n\t}",
"@Override\n\tpublic void deleteUser(int id) {\n\t\tuserMapper.deleteUser(id);\n\t}",
"public void deleteUser(int userid) {\n\t\t\n\t}",
"public void deleteAppUser(AppUserTO appUser) {\n\t\ttry {\n\t\t\tthis.jdbcTemplate.update(\"delete from carbon_app_user where id=?\",\n\t\t\t\t\tappUser.getId());\n\t\t} catch (Exception e) {\n\t\t\tlog.error(\"Error in AppUserDAO: deleteAppUser\", e);\n\t\t}\n\t}",
"@Override\r\n\tpublic void delete(int userId) {\n\t\ttheUserRepository.deleteById(userId);\r\n\t}",
"int deleteByPrimaryKey(Integer user);",
"public void deleteUser() {\n\t\tSystem.out.println(\"com.zzu.yhl.a_jdk deleteUser\");\r\n\t}",
"public void delete(User u) {\n\t\tUserDao ua=new UserDao();\n\t\tua.delete(u);\n\t\t\n\t}",
"public void delete(User obj) {\n\t\t\n\t}",
"@Override\r\n\tpublic void deleteByIdUser(int id) {\n\t\tuserReposotory.deleteById(id);\r\n\t}",
"public void deleteUser(Long userID) {\n\t\t delete(userID);\r\n\t}",
"@Override\n\tpublic int deleteUser(Integer id) {\n\t\treturn userDao.deleteUser(id);\n\t}",
"@Override\n\tpublic int delete(int uid) {\n\t\treturn new userDaoImpl().delete(uid);\n\t}",
"public void destroy(User user);",
"public void deleteUser(Integer id) throws BadRequestException;",
"@Override\n\tpublic void deleteUser(Long userId) {\n\t\tusersRepo.deleteById(userId);\n\n\t}",
"public void delete() throws NotFoundException {\n\tUserDA.delete(this);\n }",
"@Override\r\n\tpublic int deleteByPrimaryKey(Integer id) {\n\t\treturn userDao.deleteByPrimaryKey(id);\r\n\t}",
"public static int delete(User user) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n\n String query = \"DELETE FROM users \"\n + \"WHERE Email = ?\";\n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, user.getEmail());\n\n return ps.executeUpdate();\n } catch (SQLException e) {\n System.out.println(e);\n return 0;\n } finally {\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }",
"@Delete({\r\n \"delete from umajin.user_master\",\r\n \"where user_id = #{user_id,jdbcType=INTEGER}\"\r\n })\r\n int deleteByPrimaryKey(Integer user_id);",
"@Override\n\tpublic int deleteByPrimaryKey(Integer id) {\n\t\treturn userMapper.deleteByPrimaryKey(id);\n\t}",
"Integer removeUserByUserId(Integer user_id);",
"public void deleteUser(String id) {\n\t\tSystem.out.println(\"deleteUser\");\n\t\t personDAO.deleteUser(id);\n\t}",
"@Override\n\tpublic void delete(User entity) {\n\t\tuserlist.remove(String.valueOf(entity.getDni()));\n\t}",
"@Override\r\n\tpublic void deleteUser(String userid) {\n\t\ttry{\r\n\t\t\tString sql = \"delete from vipuser where id=?\";\r\n\t\t\tObject[] args = new Object[]{userid};\r\n\t\t\tdaoTemplate.update(sql, args, false);\r\n\t\t}catch (Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"DeleteUserResult deleteUser(DeleteUserRequest deleteUserRequest);",
"@Override\n\tpublic void delete(User entity) {\n\t\t\n\t}",
"public String deleteUser(){\n\t\tusersservice.delete(usersId);\n\t\treturn \"Success\";\n\t}",
"public void deleteUser(final Long id) {\n userRepository.deleteById(id);\n }",
"public void delete(String username);",
"@Override\n\tpublic void delete(String id) {\n\t\tuserDao.delete(id);\n\t\t\n\t}",
"public void deleteUser(View v){\n Boolean deleteSucceeded = null;\n\n int userId = users.get(userSpinner.getSelectedItemPosition() - 1).getId();\n\n // Delete user from database\n deleteSucceeded = udbHelper.deleteUser(userId);\n\n String message = \"\";\n if(deleteSucceeded){\n message = \"Successfully removed user with id {\" + userId + \"} from database!\";\n }\n else {\n message = \"Failed to save user!\";\n }\n Toast.makeText(ManageAccountsActivity.this, message, Toast.LENGTH_LONG).show();\n\n reloadUserLists();\n }",
"@Override\r\n\tpublic void del(int uid) {\n\t\tuserDao.del(uid);\r\n\t}",
"public void deleteUser(User u) {\n\t\tuserRepository.delete(u);\n\t}",
"public void deleteUserById(int id){\n userListCtrl.deleteUser(id);\n }",
"@Override\n\tpublic void delete(int id) {\n\t\tuserDao.delete(id);\n\t}"
] | [
"0.8287422",
"0.8203062",
"0.81957114",
"0.8191714",
"0.8174596",
"0.8114629",
"0.80716175",
"0.807044",
"0.8065592",
"0.8065592",
"0.8030858",
"0.8013748",
"0.8003616",
"0.79950225",
"0.79790616",
"0.7964821",
"0.7958543",
"0.7949806",
"0.7946644",
"0.7935344",
"0.79312813",
"0.7925496",
"0.7925055",
"0.79196304",
"0.78963697",
"0.7884555",
"0.78773195",
"0.78723586",
"0.78609896",
"0.7854394",
"0.7841042",
"0.7827823",
"0.78198993",
"0.7819739",
"0.7808773",
"0.7770747",
"0.77687144",
"0.7766196",
"0.7763008",
"0.77580214",
"0.7756419",
"0.7747767",
"0.77429366",
"0.7721907",
"0.77174354",
"0.7704959",
"0.7704357",
"0.768721",
"0.76852787",
"0.767869",
"0.7670075",
"0.76648754",
"0.7643825",
"0.7636384",
"0.763621",
"0.76342463",
"0.76187634",
"0.7615467",
"0.76153207",
"0.7597022",
"0.7591635",
"0.75891113",
"0.7584225",
"0.75777537",
"0.7561562",
"0.75572926",
"0.751651",
"0.7505476",
"0.7493957",
"0.74872744",
"0.7483272",
"0.7482574",
"0.7480715",
"0.74797356",
"0.74485314",
"0.7440728",
"0.74205655",
"0.7420521",
"0.7419322",
"0.7409357",
"0.7406025",
"0.74010706",
"0.7389334",
"0.7385736",
"0.73856235",
"0.73850316",
"0.7384765",
"0.7382866",
"0.7380444",
"0.7376133",
"0.73759353",
"0.73707724",
"0.7342722",
"0.7342404",
"0.73366517",
"0.7335775",
"0.73340404",
"0.73205364",
"0.7319914",
"0.7310306",
"0.73011005"
] | 0.0 | -1 |
Interface for refactor code | public interface IFormatter {
/**
* refactor code
* @param reader input code
* @param writer output code
* @throws StreamException if input or output errors
*/
void format(IReader reader, IWriter writer) throws StreamException;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract Refactoring createRefactoring();",
"protected abstract Refactoring createRefactoring();",
"public interface AbstractC2726a {\n /* renamed from: a */\n void mo36480a(int i, int i2, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36481a(int i, ImageView imageView, Uri uri);\n\n /* renamed from: a */\n void mo36482a(ImageView imageView, Uri uri);\n\n /* renamed from: b */\n void mo36483b(int i, ImageView imageView, Uri uri);\n}",
"public interface ChangeHandling {\r\n}",
"interface C0932a {\n /* renamed from: a */\n void mo7438a(int i, int i2);\n\n /* renamed from: b */\n void mo7439b(C0933b bVar);\n\n /* renamed from: c */\n void mo7440c(int i, int i2, Object obj);\n\n /* renamed from: d */\n void mo7441d(C0933b bVar);\n\n /* renamed from: e */\n RecyclerView.ViewHolder mo7442e(int i);\n\n /* renamed from: f */\n void mo7443f(int i, int i2);\n\n /* renamed from: g */\n void mo7444g(int i, int i2);\n\n /* renamed from: h */\n void mo7445h(int i, int i2);\n }",
"public interface C2541a {\n /* renamed from: O */\n boolean mo6498O(C41531v c41531v);\n\n /* renamed from: P */\n boolean mo6499P(C41531v c41531v);\n\n /* renamed from: a */\n void mo6500a(int i, int i2, Object obj, boolean z);\n\n /* renamed from: a */\n void mo6501a(C41531v c41531v, View view, Object obj, int i);\n\n /* renamed from: a */\n boolean mo6502a(C41531v c41531v, Object obj);\n\n /* renamed from: b */\n View mo6503b(RecyclerView recyclerView, C41531v c41531v);\n\n /* renamed from: by */\n void mo6504by(Object obj);\n\n /* renamed from: cu */\n void mo6505cu(View view);\n}",
"interface C23413e {\n /* renamed from: a */\n void mo60902a(AvatarImageWithVerify avatarImageWithVerify);\n\n /* renamed from: a */\n boolean mo60903a(AvatarImageWithVerify avatarImageWithVerify, UserVerify userVerify);\n\n /* renamed from: b */\n void mo60904b(AvatarImageWithVerify avatarImageWithVerify);\n }",
"public interface IMostSpecificOverloadDecider\n{\n OverloadRankingDto inNormalMode(\n WorkItemDto workItemDto, List<OverloadRankingDto> applicableOverloads, List<ITypeSymbol> argumentTypes);\n\n //Warning! start code duplication, more or less the same as in inNormalMode\n List<OverloadRankingDto> inSoftTypingMode(\n WorkItemDto workItemDto, List<OverloadRankingDto> applicableOverloads);\n}",
"public interface C20779a {\n /* renamed from: a */\n C15430g mo56154a();\n\n /* renamed from: a */\n void mo56155a(float f);\n\n /* renamed from: a */\n void mo56156a(int i, int i2);\n\n /* renamed from: b */\n float mo56157b();\n\n /* renamed from: b */\n boolean mo56158b(int i, int i2);\n\n /* renamed from: c */\n int[] mo56159c();\n\n /* renamed from: d */\n int[] mo56160d();\n\n /* renamed from: e */\n void mo56161e();\n\n /* renamed from: f */\n ReactionWindowInfo mo56162f();\n\n /* renamed from: g */\n void mo56163g();\n}",
"public interface Transformer {\n\t/**\n\t * \n\t * @param srcComp an instance of the old version component\n\t * @param targetComp and instance of the new version component\n\t * @return\n\t */\n\tpublic boolean transform(Object srcComp, Object targetComp);\n\n}",
"private interface C0257a {\n /* renamed from: a */\n float mo196a(ViewGroup viewGroup, View view);\n\n /* renamed from: b */\n float mo195b(ViewGroup viewGroup, View view);\n }",
"public interface C46861b {\n /* renamed from: a */\n SharedPreferences mo117960a();\n\n /* renamed from: a */\n boolean mo117961a(Editor editor);\n\n /* renamed from: b */\n Editor mo117962b();\n}",
"public interface C0159fv {\n /* renamed from: a */\n void mo4827a(Context context, C0152fo foVar);\n\n /* renamed from: a */\n void mo4828a(C0152fo foVar, boolean z);\n\n /* renamed from: a */\n void mo4829a(C0158fu fuVar);\n\n /* renamed from: a */\n boolean mo4830a();\n\n /* renamed from: a */\n boolean mo4831a(C0153fp fpVar);\n\n /* renamed from: a */\n boolean mo4832a(C0167gc gcVar);\n\n /* renamed from: b */\n void mo4833b();\n\n /* renamed from: b */\n boolean mo4834b(C0153fp fpVar);\n}",
"UCRefactoringFactory getUCRefactoringFactory();",
"public interface AbstractC18255a {\n /* renamed from: a */\n void mo88521a();\n\n /* renamed from: a */\n void mo88522a(String str);\n\n /* renamed from: b */\n void mo88523b();\n\n /* renamed from: c */\n void mo88524c();\n }",
"public interface C4740t {\n /* renamed from: a */\n void mo25261a(Context context);\n\n /* renamed from: a */\n boolean mo25262a(int i);\n\n /* renamed from: a */\n boolean mo25263a(String str, String str2, boolean z, int i, int i2, int i3, boolean z2, C4619b bVar, boolean z3);\n\n /* renamed from: b */\n byte mo25264b(int i);\n\n /* renamed from: c */\n boolean mo25265c();\n\n /* renamed from: c */\n boolean mo25266c(int i);\n}",
"public interface IInteractorOperations {\n\n String concatenarNombre(String nombres, String apellidos);\n int calcularEdad(String fechaNacimiento);\n}",
"private void someUtilityMethod() {\n }",
"private void someUtilityMethod() {\n }",
"public interface IItemHelper {\n /* renamed from: a */\n void mo66998a(int i);\n\n /* renamed from: a */\n void mo66999a(int i, int i2);\n}",
"public interface C30793j {\n /* renamed from: a */\n void mo80452a();\n\n /* renamed from: a */\n void mo80453a(Message message);\n\n /* renamed from: a */\n void mo80454a(File file, long j);\n\n /* renamed from: b */\n void mo80455b();\n\n /* renamed from: b */\n void mo80456b(Message message);\n\n /* renamed from: c */\n void mo80457c();\n}",
"public interface C1481i {\n /* renamed from: a */\n Bitmap mo6659a(Context context, String str, C1492a aVar);\n\n /* renamed from: a */\n void mo6660a(Context context, String str, ImageView imageView, C1492a aVar);\n\n /* renamed from: a */\n void mo6661a(boolean z);\n}",
"public Problem prepare(RefactoringElementsBag refactoringElements) {\n if (semafor.get() != null) {\n return null;\n }\n semafor.set(new Object());\n try {\n rename = (RenameRefactoring)refactoring;\n \n Problem problem = null;\n Lookup lkp = rename.getRefactoringSource();\n \n TreePathHandle handle = lkp.lookup(TreePathHandle.class);\n if (handle != null) {\n InfoHolder infoholder = examineLookup(lkp);\n Project project = FileOwnerQuery.getOwner(handle.getFileObject());\n if (project == null || project.getLookup().lookup(NbModuleProvider.class) == null) {\n // take just netbeans module development into account..\n return null;\n }\n \n if (infoholder.isClass) {\n checkManifest(project, infoholder.fullName, refactoringElements);\n checkLayer(project, infoholder.fullName, refactoringElements);\n }\n if (infoholder.isMethod) {\n checkMethodLayer(infoholder, handle.getFileObject(), refactoringElements);\n }\n }\n NonRecursiveFolder nrf = lkp.lookup(NonRecursiveFolder.class);\n if (nrf != null) {\n Project project = FileOwnerQuery.getOwner(nrf.getFolder());\n if (project.getLookup().lookup(NbModuleProvider.class) == null) {\n // take just netbeans module development into account..\n return null;\n }\n Sources srcs = org.netbeans.api.project.ProjectUtils.getSources(project);\n SourceGroup[] grps = srcs.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);\n for (SourceGroup gr : grps) {\n if (FileUtil.isParentOf(gr.getRootFolder(), nrf.getFolder())) {\n String relPath = FileUtil.getRelativePath(gr.getRootFolder(), nrf.getFolder());\n relPath.replace('/', '.');\n //TODO probably aslo manifest or layers.\n //TODO how to distinguish single package from recursive folder?\n }\n }\n }\n \n return problem;\n } catch (IOException ex) {\n Exceptions.printStackTrace(ex);\n return null;\n } finally {\n semafor.set(null);\n }\n }",
"public interface C4773c {\n /* renamed from: a */\n void m15858a(int i);\n\n /* renamed from: a */\n void m15859a(int i, int i2);\n\n /* renamed from: a */\n void m15860a(int i, int i2, int i3);\n\n /* renamed from: b */\n void m15861b(int i, int i2);\n}",
"public interface C4211a {\n\n /* renamed from: com.iab.omid.library.oguryco.c.a$a */\n public interface C4212a {\n /* renamed from: a */\n void mo28760a(View view, C4211a aVar, JSONObject jSONObject);\n }\n\n /* renamed from: a */\n JSONObject mo28758a(View view);\n\n /* renamed from: a */\n void mo28759a(View view, JSONObject jSONObject, C4212a aVar, boolean z);\n}",
"public void smell() {\n\t\t\n\t}",
"public void processCode() throws InstantiationException, IllegalAccessException, ClassNotFoundException {\n\t\tsuper.processCode();\t\n\t\t\n\t\tfor (String processor : getProcessors()) {\n\t\t\tString[] refactorName = processor.split(\"\\\\.\");\n\t\t\tString refactor = refactorName[refactorName.length - 1];\n\t\t\t\n\t\t\tswitch (refactor) {\n\t\t\t\tcase \"CollapseHierarchy\" : refactoringsApplied.put(refactor, CollapseHierarchy.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t CollapseHierarchy.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\tcase \"EncapsulateCollection\" : refactoringsApplied.put(refactor, EncapsulateCollection.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t EncapsulateCollection.resetTimesApplied();\n\t\t\t\t \t\t\t\t\t\t\t break;\n\t\t\t\tcase \"EncapsulateField\" \t : refactoringsApplied.put(refactor, EncapsulateField.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t EncapsulateField.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t \t break;\n\t\t\t\tcase \"ExtractSuperClass\" : refactoringsApplied.put(refactor, ExtractSuperClass.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t ExtractSuperClass.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\tcase \"HideMethod\" : refactoringsApplied.put(refactor, HideMethod.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t HideMethod.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\tcase \"PullUpField\"\t\t\t : refactoringsApplied.put(refactor, PullUpField.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t PullUpField.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\tcase \"PullUpMethod\" : refactoringsApplied.put(refactor, PullUpMethod.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t PullUpMethod.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\tcase \"PushDownField\"\t\t : refactoringsApplied.put(refactor, PushDownField.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t PushDownField.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\tcase \"PushDownMethod\"\t : refactoringsApplied.put(refactor, PushDownMethod.getTimesApplied());\n\t\t\t\t\t\t\t\t\t\t\t PushDownMethod.resetTimesApplied();\n\t\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t}\t\n\t\t}\n\t\t\n\t\toutputProcessedCode();\n\t}",
"public interface C22932f {\n /* renamed from: a */\n void mo59932a(String str, JSONObject jSONObject);\n}",
"public interface C20288m {\n /* renamed from: a */\n int mo54403a(String str, String str2);\n\n /* renamed from: a */\n List<DownloadInfo> mo54404a(String str);\n\n /* renamed from: a */\n void mo54405a();\n\n /* renamed from: a */\n void mo54406a(int i);\n\n /* renamed from: a */\n void mo54407a(int i, int i2);\n\n /* renamed from: a */\n void mo54408a(int i, int i2, int i3, int i4);\n\n /* renamed from: a */\n void mo54409a(int i, int i2, int i3, long j);\n\n /* renamed from: a */\n void mo54410a(int i, int i2, long j);\n\n /* renamed from: a */\n void mo54411a(int i, int i2, IDownloadListener iDownloadListener, ListenerType listenerType, boolean z);\n\n /* renamed from: a */\n void mo54412a(int i, Notification notification);\n\n /* renamed from: a */\n void mo54413a(int i, C20254v vVar);\n\n /* renamed from: a */\n void mo54414a(int i, List<DownloadChunk> list);\n\n /* renamed from: a */\n void mo54415a(int i, boolean z);\n\n /* renamed from: a */\n void mo54416a(C20211ac acVar);\n\n /* renamed from: a */\n void mo54417a(DownloadChunk downloadChunk);\n\n /* renamed from: a */\n void mo54418a(DownloadTask downloadTask);\n\n /* renamed from: a */\n void mo54419a(List<String> list);\n\n /* renamed from: a */\n void mo54420a(boolean z, boolean z2);\n\n /* renamed from: a */\n boolean mo54421a(DownloadInfo downloadInfo);\n\n /* renamed from: b */\n DownloadInfo mo54422b(String str, String str2);\n\n /* renamed from: b */\n List<DownloadInfo> mo54423b(String str);\n\n /* renamed from: b */\n void mo54424b(int i);\n\n /* renamed from: b */\n void mo54425b(int i, int i2, IDownloadListener iDownloadListener, ListenerType listenerType, boolean z);\n\n /* renamed from: b */\n void mo54426b(int i, List<DownloadChunk> list);\n\n /* renamed from: b */\n void mo54427b(DownloadInfo downloadInfo);\n\n /* renamed from: b */\n void mo54428b(DownloadTask downloadTask);\n\n /* renamed from: b */\n boolean mo54429b();\n\n /* renamed from: c */\n List<DownloadInfo> mo54430c(String str);\n\n /* renamed from: c */\n boolean mo54431c();\n\n /* renamed from: c */\n boolean mo54432c(int i);\n\n /* renamed from: c */\n boolean mo54433c(DownloadInfo downloadInfo);\n\n /* renamed from: d */\n List<DownloadInfo> mo54434d(String str);\n\n /* renamed from: d */\n void mo54435d();\n\n /* renamed from: d */\n void mo54436d(int i);\n\n /* renamed from: e */\n void mo54437e(int i);\n\n /* renamed from: e */\n boolean mo54438e();\n\n /* renamed from: f */\n long mo54439f(int i);\n\n /* renamed from: f */\n void mo54440f();\n\n /* renamed from: g */\n int mo54441g(int i);\n\n /* renamed from: g */\n boolean mo54442g();\n\n /* renamed from: h */\n boolean mo54443h(int i);\n\n /* renamed from: i */\n DownloadInfo mo54444i(int i);\n\n /* renamed from: j */\n List<DownloadChunk> mo54445j(int i);\n\n /* renamed from: k */\n void mo54446k(int i);\n\n /* renamed from: l */\n void mo54447l(int i);\n\n /* renamed from: m */\n void mo54448m(int i);\n\n /* renamed from: n */\n boolean mo54449n(int i);\n\n /* renamed from: o */\n int mo54450o(int i);\n\n /* renamed from: p */\n boolean mo54451p(int i);\n\n /* renamed from: q */\n void mo54452q(int i);\n\n /* renamed from: r */\n boolean mo54453r(int i);\n\n /* renamed from: s */\n C20254v mo54454s(int i);\n\n /* renamed from: t */\n C20259y mo54455t(int i);\n\n /* renamed from: u */\n C20241o mo54456u(int i);\n}",
"public interface C2672h {\n /* renamed from: a */\n void mo1927a(NLPResponseData nLPResponseData);\n\n /* renamed from: a */\n void mo1931a(C2848p c2848p);\n\n /* renamed from: a */\n void mo1932a(String str);\n\n /* renamed from: b */\n void mo1933b(int i);\n\n /* renamed from: b */\n void mo1934b(String str);\n\n /* renamed from: c */\n void mo1935c(String str);\n\n /* renamed from: i */\n void mo1940i();\n\n /* renamed from: j */\n void mo1941j();\n\n /* renamed from: k */\n void mo1942k();\n\n /* renamed from: l */\n void mo1943l();\n}",
"public interface StatusManager {\n /* renamed from: a */\n List<Status> mo9947a();\n\n /* renamed from: a */\n void mo9948a(Status cVar);\n\n /* renamed from: a */\n void mo9949a(StatusListener eVar);\n\n /* renamed from: b */\n List<StatusListener> mo9950b();\n}",
"public interface C1529m {\n /* renamed from: a */\n void mo3767a(int i);\n\n /* renamed from: a */\n void mo3768a(String str);\n}",
"public interface ToolConverter {\r\n /**\r\n * This method should return a well formed tool\r\n * from the data given.\r\n * <p>\r\n * If is possible to return multiple tools.\r\n * \r\n * @param toolData The data from the lms.\r\n * @return The tool(s) as described in Unipoole.\r\n */\r\n public List<Tool> getTool(Object toolData);\r\n}",
"interface C15937b {\n /* renamed from: a */\n void mo13368a();\n\n /* renamed from: a */\n void mo13369a(int i, int i2, int i3, boolean z);\n\n /* renamed from: a */\n void mo13370a(int i, int i2, List<C15929a> list) throws IOException;\n\n /* renamed from: a */\n void mo13371a(int i, long j);\n\n /* renamed from: a */\n void mo13372a(int i, ErrorCode errorCode);\n\n /* renamed from: a */\n void mo13373a(int i, ErrorCode errorCode, ByteString byteString);\n\n /* renamed from: a */\n void mo13374a(boolean z, int i, int i2);\n\n /* renamed from: a */\n void mo13375a(boolean z, int i, int i2, List<C15929a> list);\n\n /* renamed from: a */\n void mo13376a(boolean z, int i, BufferedSource bufferedSource, int i2) throws IOException;\n\n /* renamed from: a */\n void mo13377a(boolean z, C15943j c15943j);\n }",
"public interface C13373b {\n /* renamed from: a */\n void mo32681a(String str, int i, boolean z);\n}",
"public interface C4522b {\n /* renamed from: a */\n void mo12143a();\n\n /* renamed from: a */\n void mo12147a(View view);\n\n /* renamed from: b */\n android.view.View mo12148b();\n\n /* renamed from: c */\n Room mo12151c();\n\n /* renamed from: d */\n C0043i mo12153d();\n\n void dismiss();\n\n void setCancelable(boolean z);\n }",
"interface C0312e {\n /* renamed from: a */\n void mo4671a(View view, int i, int i2, int i3, int i4);\n }",
"public interface C5138c {\n /* renamed from: e */\n void mo25968e(TemplateInfo templateInfo);\n\n /* renamed from: f */\n void mo25969f(TemplateInfo templateInfo);\n}",
"public interface C5101b {\n /* renamed from: a */\n void mo5289a(C5102c c5102c);\n\n /* renamed from: b */\n void mo5290b(C5102c c5102c);\n}",
"public interface C28392h {\n /* renamed from: a */\n void mo72111a();\n\n /* renamed from: a */\n void mo72112a(float f);\n\n /* renamed from: b */\n void mo72113b();\n\n /* renamed from: c */\n void mo72114c();\n\n /* renamed from: d */\n boolean mo72115d();\n\n void dismiss();\n}",
"public interface C4724o {\n /* renamed from: a */\n void mo4872a(int i, String str);\n\n /* renamed from: a */\n void mo4873a(C4718l c4718l);\n\n /* renamed from: b */\n void mo4874b(C4718l c4718l);\n}",
"protected JBuilderRenameClassRefactoring()\n\t{\n\t\tsuper();\n\t}",
"public Object fix(IModule module);",
"public interface C40453c {\n /* renamed from: a */\n void mo100442a(C40429b bVar);\n\n /* renamed from: a */\n void mo100443a(List<String> list);\n\n /* renamed from: b */\n void mo100444b(List<C40429b> list);\n}",
"public interface C19045k {\n /* renamed from: a */\n void mo50368a(int i, Object obj);\n\n /* renamed from: b */\n void mo50369b(int i, Object obj);\n}",
"interface C33292a {\n /* renamed from: a */\n void mo85415a(String str);\n }",
"public interface AbstractC17367b {\n /* renamed from: a */\n void mo84655a();\n }",
"public interface AbstractC23925a {\n /* renamed from: a */\n void mo105476a();\n }",
"public interface C15428f {\n\n /* renamed from: com.ss.android.ugc.asve.context.f$a */\n public static final class C15429a {\n /* renamed from: a */\n public static String m45146a(C15428f fVar) {\n return \"\";\n }\n\n /* renamed from: b */\n public static String m45147b(C15428f fVar) {\n return \"\";\n }\n }\n\n /* renamed from: a */\n boolean mo38970a();\n\n /* renamed from: b */\n String mo38971b();\n\n /* renamed from: c */\n String mo38972c();\n\n /* renamed from: d */\n int mo38973d();\n\n /* renamed from: e */\n int mo38974e();\n}",
"public interface C0237a {\n /* renamed from: a */\n void mo1791a(String str);\n }",
"public interface C42593b {\n /* renamed from: H */\n void mo34677H(String str, int i, int i2);\n\n void aFq();\n\n void aFr();\n\n void aFs();\n\n void aFt();\n\n void aFu();\n\n void aFv();\n\n /* renamed from: de */\n void mo34684de(int i, int i2);\n }",
"public interface C45112b {\n /* renamed from: a */\n List<C45111a> mo107674a(Integer num);\n\n /* renamed from: a */\n List<C45111a> mo107675a(Integer num, Integer num2);\n\n /* renamed from: a */\n void mo107676a(C45111a aVar);\n\n /* renamed from: b */\n void mo107677b(Integer num);\n\n /* renamed from: c */\n long mo107678c(Integer num);\n}",
"public interface C35590c {\n /* renamed from: a */\n void mo56317a(Context context, Bundle bundle, C4541a c4541a);\n}",
"public interface Transformer {\n /**\n * Transform a string into another string\n * @param input string to be transformed\n * @return transformed string\n */\n public String transform(String input);\n}",
"public interface ILogStore {\n /* renamed from: a */\n int mo13159a(List<Log> list);\n\n /* renamed from: a */\n List<Log> mo13160a(String str, int i);\n\n /* renamed from: a */\n boolean m6609a(List<Log> list);\n\n /* renamed from: c */\n void mo13161c(String str, String str2);\n\n void clear();\n\n /* renamed from: e */\n void mo13163e(int i);\n\n /* renamed from: g */\n int mo13164g();\n}",
"public interface LogAdapter {\n /* renamed from: a */\n String mo131984a();\n\n /* renamed from: a */\n void mo131985a(int i, String str, String str2, Throwable th);\n\n /* renamed from: a */\n void mo131986a(String str, String str2);\n}",
"private void runRefactoring() {\r\n Refactoring refactoring = createRefactoring();\r\n\r\n // Update the code\r\n try {\r\n refactoring.run();\r\n } catch (RefactoringException re) {\r\n JOptionPane.showMessageDialog(null, re.getMessage(), \"Refactoring Exception\",\r\n JOptionPane.ERROR_MESSAGE);\r\n } catch (Throwable thrown) {\r\n ExceptionPrinter.print(thrown, true);\r\n }\r\n\r\n followup(refactoring);\r\n }",
"public interface ErrorReporter {\n /* renamed from: a */\n void mo19167a(String str, String str2, int i, String str3, int i2);\n\n /* renamed from: b */\n EvaluatorException mo19168b(String str, String str2, int i, String str3, int i2);\n}",
"public interface IFileAdapter {\n /**\n * The method is uses to read file\n *\n * @return List lines\n */\n List readFile(String pathToFile);\n\n /**\n * The method is uses to write file\n *\n * @param values List contains a lines for writing\n */\n void write(List<StringBuilder> values);\n\n /**\n * This method is used to move files from one directory to another\n *\n * @param pathToFile contains the path to the file that you want to move\n * @param pathDirectory contains the path to the directory where you want to put the file\n */\n void moveFile(String pathToFile, String pathDirectory);\n\n /**\n * The method is used to get the file paths from the directory\n * along the path specified in app.properties\n */\n List<String> getListPaths();\n\n /**\n * This method is used to move a file to a directory with non-valid files\n */\n void moveFileToDirectoryNotValidFiles(String pathToFile);\n\n /**\n * This method is used to move a file to a directory with converted files\n */\n void moveFileToDirectoryWithConvertedFiles(String pathToFile);\n}",
"public interface C0657b {\n /* renamed from: f */\n void mo3193f();\n\n /* renamed from: r */\n void mo3194r();\n}",
"public interface C39682m {\n\n /* renamed from: com.ss.android.ugc.aweme.shortvideo.edit.m$a */\n public interface C39683a {\n /* renamed from: a */\n int mo98966a(C29296g gVar);\n\n /* renamed from: b */\n int mo98967b(C29296g gVar);\n\n /* renamed from: c */\n float mo98968c(C29296g gVar);\n }\n\n /* renamed from: com.ss.android.ugc.aweme.shortvideo.edit.m$b */\n public interface C39684b {\n /* renamed from: a */\n void mo98969a();\n\n /* renamed from: a */\n void mo98970a(C29296g gVar);\n\n /* renamed from: a */\n void mo98971a(C29296g gVar, int i);\n }\n}",
"public interface C3598a {\n /* renamed from: a */\n void mo11024a(int i, int i2, String str);\n }",
"public interface C1656t {\n /* renamed from: a */\n void mo7350a();\n\n /* renamed from: a */\n void mo7351a(C1655s sVar);\n\n /* renamed from: a */\n void mo7352a(C1655s sVar, AdError adError);\n\n /* renamed from: b */\n void mo7353b();\n\n /* renamed from: b */\n void mo7354b(C1655s sVar);\n\n /* renamed from: c */\n void mo7355c(C1655s sVar);\n\n /* renamed from: d */\n void mo7356d(C1655s sVar);\n\n /* renamed from: e */\n void mo7357e(C1655s sVar);\n\n /* renamed from: f */\n void mo7358f(C1655s sVar);\n}",
"public interface C23407b {\n /* renamed from: a */\n void mo60892a();\n\n /* renamed from: b */\n void mo60893b();\n }",
"public interface IRefactoringProcessorIds {\n\n /**\n\t * Processor ID of the rename Java project processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameJavaProjectProcessor\"</code>).\n\t *\n\t * The rename Java project processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IJavaProject</code>.</li>\n\t * <li>participants registered for renaming <code>IProject</code>.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String RENAME_JAVA_PROJECT_PROCESSOR = \"org.eclipse.jdt.ui.renameJavaProjectProcessor\";\n\n /**\n\t * Processor ID of the rename source folder\n\t * (value <code>\"org.eclipse.jdt.ui.renameSourceFolderProcessor\"</code>).\n\t *\n\t * The rename package fragment root processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IPackageFragmentRoot</code>.</li>\n\t * <li>participants registered for renaming <code>IFolder</code>.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String RENAME_SOURCE_FOLDER_PROCESSOR = \"org.eclipse.jdt.ui.renameSourceFolderProcessor\";\n\n /**\n\t * Processor ID of the rename package fragment processor\n\t * (value <code>\"org.eclipse.jdt.ui.renamePackageProcessor\"</code>).\n\t *\n\t * The rename package fragment processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IPackageFragment</code>.</li>\n\t * <li>participants registered for moving <code>IFile</code> to participate in the\n\t * file moves caused by the package fragment rename.</li>\n\t * <li>participants registered for creating <code>IFolder</code> if the package\n\t * rename results in creating a new destination folder.</li>\n\t * <li>participants registered for deleting <code>IFolder</code> if the package\n\t * rename results in deleting the folder corresponding to the package\n\t * fragment to be renamed.</li>\n\t * </ul>\n\t *\n\t * <p>Since 3.3:</p>\n\t *\n\t * <p>The refactoring processor moves and renames Java elements and resources.\n\t * Rename package fragment participants can retrieve the new location of\n\t * Java elements and resources through the interfaces\n\t * {@link IJavaElementMapper} and {@link IResourceMapper}, which can be\n\t * retrieved from the processor using the getAdapter() method.</p>\n\t */\n //$NON-NLS-1$\n public static String RENAME_PACKAGE_FRAGMENT_PROCESSOR = \"org.eclipse.jdt.ui.renamePackageProcessor\";\n\n /**\n\t * Processor ID of the rename compilation unit processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameCompilationUnitProcessor\"</code>).\n\t *\n\t * The rename compilation unit processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>ICompilationUnit</code>.</li>\n\t * <li>participants registered for renaming <code>IFile</code>.</li>\n\t * <li>participants registered for renaming <code>IType</code> if the\n\t * compilation unit contains a top level type.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String RENAME_COMPILATION_UNIT_PROCESSOR = \"org.eclipse.jdt.ui.renameCompilationUnitProcessor\";\n\n /**\n\t * Processor ID of the rename type processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameTypeProcessor\"</code>).\n\t *\n\t * The rename type processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IType</code>.</li>\n\t * <li>participants registered for renaming <code>ICompilationUnit</code> if the\n\t * type is a public top level type.</li>\n\t * <li>participants registered for renaming <code>IFile</code> if the compilation\n\t * unit gets rename as well.</li>\n\t * </ul>\n\t *\n\t * <p>Since 3.2:</p>\n\t *\n\t * <p>Participants that declare <pre> <param name=\"handlesSimilarDeclarations\" value=\"false\"/> </pre>\n\t * in their extension contribution will not be loaded if the user selects the\n\t * \"update similar declarations\" feature.</p>\n\t *\n\t * <p>Rename type participants can retrieve information about similar declarations by casting the\n\t * RenameArguments to RenameTypeArguments. The new signatures of similar declarations\n\t * (and of other Java elements or resources) are available\n\t * through the interfaces {@link IJavaElementMapper} and {@link IResourceMapper}, which can be retrieved from the\n\t * processor using the getAdapter() method.</p>\n\t *\n\t */\n //$NON-NLS-1$\n public static String RENAME_TYPE_PROCESSOR = \"org.eclipse.jdt.ui.renameTypeProcessor\";\n\n /**\n\t * Processor ID of the rename method processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameMethodProcessor\"</code>).\n\t *\n\t * The rename method processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IMethod</code>. Renaming\n\t * virtual methods will rename methods with the same name in the type\n\t * hierarchy of the type declaring the method to be renamed as well.\n\t * For those derived methods participants will be loaded as well.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String RENAME_METHOD_PROCESSOR = \"org.eclipse.jdt.ui.renameMethodProcessor\";\n\n /**\n\t * Processor ID of the rename field processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameFieldProcessor\"</code>).\n\t *\n\t * The rename filed processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IField</code>.</li>\n\t * <li>participants registered for renaming <code>IMethod</code> if\n\t * corresponding setter and getter methods are renamed as well.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String RENAME_FIELD_PROCESSOR = \"org.eclipse.jdt.ui.renameFieldProcessor\";\n\n /**\n\t * Processor ID of the rename enum constant processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameEnumConstProcessor\"</code>).\n\t *\n\t * The rename filed processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IField</code>.</li>\n\t * </ul>\n\t * @since 3.1\n\t */\n //$NON-NLS-1$\n public static String RENAME_ENUM_CONSTANT_PROCESSOR = \"org.eclipse.jdt.ui.renameEnumConstProcessor\";\n\n /**\n\t * Processor ID of the rename resource processor\n\t * (value <code>\"org.eclipse.jdt.ui.renameResourceProcessor\"</code>).\n\t *\n\t * The rename resource processor loads the following participants:\n\t * <ul>\n\t * <li>participants registered for renaming <code>IResource</code>.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String RENAME_RESOURCE_PROCESSOR = \"org.eclipse.jdt.ui.renameResourceProcessor\";\n\n /**\n\t * Processor ID of the move resource processor\n\t * (value <code>\"org.eclipse.jdt.ui.MoveProcessor\"</code>).\n\t *\n\t * The move processor loads the following participants, depending on the type of\n\t * element that gets moved:\n\t * <ul>\n\t * <li><code>IPackageFragmentRoot</code>: participants registered for moving\n\t * package fragment roots together with participants moving a <code>IFolder\n\t * </code>.</li>\n\t * <li><code>IPackageFragment</code>: participants registered for moving\n\t * package fragments. Additionally move file, create folder and delete\n\t * folder participants are loaded to reflect the resource changes\n\t * caused by a moving a package fragment.</li>\n\t * <li><code>ICompilationUnit</code>: participants registered for moving\n\t * compilation units and <code>IFile</code>. If the compilation unit\n\t * contains top level types, participants for these types are loaded\n\t * as well.</li>\n\t * <li><code>IResource</code>: participants registered for moving resources.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String MOVE_PROCESSOR = \"org.eclipse.jdt.ui.MoveProcessor\";\n\n /**\n\t * Processor ID of the move static member processor\n\t * (value <code>\"org.eclipse.jdt.ui.MoveStaticMemberProcessor\"</code>).\n\t *\n\t * The move static members processor loads participants registered for the\n\t * static Java element that gets moved. No support is available to participate\n\t * in non static member moves.\n\t */\n //$NON-NLS-1$\n public static String MOVE_STATIC_MEMBERS_PROCESSOR = \"org.eclipse.jdt.ui.MoveStaticMemberProcessor\";\n\n /**\n\t * Processor ID of the delete resource processor\n\t * (value <code>\"org.eclipse.jdt.ui.DeleteProcessor\"</code>).\n\t *\n\t * The delete processor loads the following participants, depending on the type of\n\t * element that gets deleted:\n\t * <ul>\n\t * <li><code>IJavaProject</code>: participants registered for deleting <code>IJavaProject\n\t * </code> and <code>IProject</code></li>.\n\t * <li><code>IPackageFragmentRoot</code>: participants registered for deleting\n\t * <code>IPackageFragmentRoot</code> and <code>IFolder</code>.\n\t * <li><code>IPackageFragment</code>: participants registered for deleting\n\t * <code>IPackageFragment</code>. Additionally delete file and delete folder\n\t * participants are loaded to reflect the resource changes caused by\n\t * deleting a package fragment.</li>\n\t * <li><code>ICompilationUnit</code>: participants registered for deleting compilation\n\t * units and files. Additionally type delete participants are loaded to reflect the\n\t * deletion of the top level types declared in the compilation unit.</li>\n\t * <li><code>IType</code>: participants registered for deleting types. Additional\n\t * compilation unit and file delete participants are loaded if the type to be deleted\n\t * is the only top level type of a compilation unit.</li>\n\t * <li><code>IMember</code>: participants registered for deleting members.</li>\n\t * <li><code>IResource</code>: participants registered for deleting resources.</li>\n\t * </ul>\n\t */\n //$NON-NLS-1$\n public static String DELETE_PROCESSOR = \"org.eclipse.jdt.ui.DeleteProcessor\";\n\n /**\n\t * Processor ID of the copy processor (value <code>\"org.eclipse.jdt.ui.CopyProcessor\"</code>).\n\t *\n\t * The copy processor is used when copying elements via drag and drop or when pasting\n\t * elements from the clipboard. The copy processor loads the following participants,\n\t * depending on the type of the element that gets copied:\n\t * <ul>\n\t * <li><code>IJavaProject</code>: no participants are loaded.</li>\n\t * <li><code>IPackageFragmentRoot</code>: participants registered for copying\n\t * <code>IPackageFragmentRoot</code> and <code>ResourceMapping</code>.</li>\n\t * <li><code>IPackageFragment</code>: participants registered for copying\n\t * <code>IPackageFragment</code> and <code>ResourceMapping</code>.</li>\n\t * <li><code>ICompilationUnit</code>: participants registered for copying\n\t * <code>ICompilationUnit</code> and <code>ResourceMapping</code>.</li>\n\t * <li><code>IType</code>: like ICompilationUnit if the primary top level type is copied.\n\t * Otherwise no participants are loaded.</li>\n\t * <li><code>IMember</code>: no participants are loaded.</li>\n\t * <li><code>IFolder</code>: participants registered for copying folders.</li>\n\t * <li><code>IFile</code>: participants registered for copying files.</li>\n\t * </ul>\n\t * <p>\n\t * Use the method {@link ResourceMapping#accept(ResourceMappingContext context, IResourceVisitor visitor, IProgressMonitor monitor)}\n\t * to enumerate the resources which form the Java element. <code>ResourceMappingContext.LOCAL_CONTEXT</code>\n\t * should be use as the <code>ResourceMappingContext</code> passed to the accept method.\n\t * </p>\n\t * @see org.eclipse.core.resources.mapping.ResourceMapping\n\t * @since 3.3\n\t */\n //$NON-NLS-1$\n public static String COPY_PROCESSOR = \"org.eclipse.jdt.ui.CopyProcessor\";\n}",
"public interface StringUtil$StringProcessor {\n String m3918a(Object obj);\n}",
"public interface C1115k {\n /* renamed from: a */\n int mo5866a(State state, String... strArr);\n\n /* renamed from: a */\n int mo5867a(String str, long j);\n\n /* renamed from: a */\n List<C1111j> mo5868a();\n\n /* renamed from: a */\n List<C1111j> mo5869a(int i);\n\n /* renamed from: a */\n void mo5870a(C1111j jVar);\n\n /* renamed from: a */\n void mo5871a(String str);\n\n /* renamed from: a */\n void mo5872a(String str, Data data);\n\n /* renamed from: b */\n List<C1111j> mo5873b();\n\n /* renamed from: b */\n List<C1113b> mo5874b(String str);\n\n /* renamed from: b */\n void mo5875b(String str, long j);\n\n /* renamed from: c */\n List<String> mo5876c();\n\n /* renamed from: c */\n List<String> mo5877c(String str);\n\n /* renamed from: d */\n int mo5878d();\n\n /* renamed from: d */\n C1114c mo5879d(String str);\n\n /* renamed from: e */\n State mo5880e(String str);\n\n /* renamed from: f */\n C1111j mo5881f(String str);\n\n /* renamed from: g */\n int mo5882g(String str);\n\n /* renamed from: h */\n List<C1114c> mo5883h(String str);\n\n /* renamed from: i */\n List<Data> mo5884i(String str);\n\n /* renamed from: j */\n int mo5885j(String str);\n\n /* renamed from: k */\n List<C1114c> mo5886k(String str);\n}",
"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 interface C0087c {\n /* renamed from: a */\n String mo150a(String str);\n}",
"@Override\n\tpublic void alterar() {\n\t\t\n\t}",
"interface C8361a {\n /* renamed from: b */\n float mo18284b(ViewGroup viewGroup, View view);\n\n /* renamed from: c */\n float mo18281c(ViewGroup viewGroup, View view);\n }",
"interface C3069a {\n @C0193h0\n /* renamed from: a */\n Bitmap mo12204a(int i, int i2, Config config);\n\n /* renamed from: a */\n void mo12205a(Bitmap bitmap);\n\n /* renamed from: a */\n void mo12206a(byte[] bArr);\n\n /* renamed from: a */\n void mo12207a(int[] iArr);\n\n /* renamed from: a */\n int[] mo12208a(int i);\n\n /* renamed from: b */\n byte[] mo12209b(int i);\n }",
"public interface C39504az {\n /* renamed from: a */\n int mo98207a();\n\n /* renamed from: a */\n void mo98208a(boolean z);\n\n /* renamed from: b */\n int mo98209b();\n\n /* renamed from: c */\n int mo98355c();\n\n /* renamed from: d */\n int mo98356d();\n\n /* renamed from: e */\n int mo98357e();\n\n /* renamed from: f */\n int mo98358f();\n}",
"public interface C18928d {\n /* renamed from: a */\n void mo50320a(C18924b bVar);\n\n /* renamed from: b */\n void mo50321b(C18924b bVar);\n}",
"interface C9251a {\n /* renamed from: a */\n boolean mo24941a(Context context);\n }",
"interface C30585a {\n /* renamed from: b */\n void mo27952b(C5379a c5379a, int i, C46650a c46650a, C7620bi c7620bi);\n }",
"public interface C44963i {\n /* renamed from: a */\n void mo63037a(int i, int i2);\n\n void aA_();\n\n /* renamed from: b */\n void mo63039b(int i, int i2);\n}",
"public interface CodeFormatter\n{\n}",
"public interface C2603a {\n /* renamed from: a */\n String mo1889a(String str, String str2, String str3, String str4);\n }",
"public interface AbstractC16592a {\n /* renamed from: a */\n void mo67920a();\n\n /* renamed from: a */\n void mo67921a(Object obj);\n\n /* renamed from: a */\n void mo67922a(AbstractC32732ag agVar, Throwable th);\n\n /* renamed from: b */\n void mo67923b();\n\n /* renamed from: c */\n void mo67924c();\n }",
"public interface C2950c {\n /* renamed from: a */\n int mo9690a(int i, int i2);\n\n /* renamed from: a */\n int mo9691a(String str, String str2, float f);\n\n /* renamed from: a */\n int mo9692a(String[] strArr, int i);\n\n /* renamed from: a */\n void mo9693a();\n\n /* renamed from: a */\n void mo9694a(float f, float f2);\n\n /* renamed from: a */\n void mo9695a(float f, float f2, float f3, float f4, float f5);\n\n /* renamed from: a */\n void mo9696a(float f, float f2, int i);\n\n /* renamed from: a */\n void mo9697a(String str);\n\n /* renamed from: a */\n void mo9698a(String str, float f);\n\n /* renamed from: a */\n void mo9699a(String str, String str2, boolean z);\n\n /* renamed from: a */\n void mo9700a(String str, boolean z);\n\n /* renamed from: a */\n void mo9701a(boolean z);\n\n /* renamed from: b */\n int mo9702b(String str, String str2, float f);\n\n /* renamed from: b */\n void mo9703b(float f, float f2);\n\n /* renamed from: b */\n void mo9704b(float f, float f2, int i);\n\n /* renamed from: c */\n void mo9705c(float f, float f2);\n}",
"public interface C21298a {\n /* renamed from: a */\n void mo57275a();\n\n /* renamed from: a */\n void mo57276a(Exception exc);\n\n /* renamed from: b */\n void mo57277b();\n\n /* renamed from: c */\n void mo57278c();\n }",
"public interface C0310c {\n /* renamed from: a */\n void mo4102a(int i, int i2);\n\n /* renamed from: b */\n void mo4103b(int i, int i2);\n }",
"public interface C2604b {\n /* renamed from: a */\n void mo1886a(String str, String str2);\n\n /* renamed from: a */\n boolean mo1887a(String str);\n\n /* renamed from: b */\n String mo1888b(String str, String str2, String str3, String str4);\n }",
"public RefactoringTask() {\n\t\tlauncher = new Launcher();\n\t\tinputSources = new ArrayList<String>();\n\t\tprocessors = new ArrayList<String>();\n\t\ttemplates = new ArrayList<SpoonResource>();\n\t\trefactoringsApplied = new HashMap<String, Integer>();\n\t\toutputSource = \"\";\n\t\tisProcessed = false;\n\t\tisModelBuilt = false;\n\t}",
"public abstract void mutate();",
"public interface C5951a {\n /* renamed from: e */\n void mo12651e(String str, String str2, Object... objArr);\n\n /* renamed from: i */\n void mo12652i(String str, String str2, Object... objArr);\n\n void printErrStackTrace(String str, Throwable th, String str2, Object... objArr);\n\n /* renamed from: w */\n void mo12654w(String str, String str2, Object... objArr);\n }",
"abstract int patch();",
"public interface C5527c {\n /* renamed from: a */\n int mo4095a(int i);\n\n /* renamed from: b */\n C5537g mo4096b(int i);\n}",
"public interface C32457c<T> {\n /* renamed from: a */\n void mo83699a(T t, int i, int i2, String str);\n }",
"public interface C26438t {\n /* renamed from: b */\n void mo5959b(boolean z, String str, Bundle bundle);\n}",
"public interface URLmanipulatorInterface {\n\t\n\t/**\n\t * Finds the base element of a URL\n\t * @param startingURL, the URL for which we wish to identify the base element.\n\t * @return the base URL of the startingURL.\n\t */\n\tpublic URL makeBase(URL startingURL);\n\n\t/**\n\t * Makes a full URL from relative/absolute parts. \n\t * \n\t * @param scrapedString, representing a relative URL or a full URL\n\t * @param base, the base URL for the page the scraped string came from.\n\t * @return the full URL, either direct from the scraped URL (if it is absolute) or from the combination of the string \n\t * and the base (if the string is relative). \n\t */\n\tpublic URL makeFullUrl(String scrapedString, URL base);\n\t\n\t/**\n\t * Accesses a range of functions to ensure a well structured URL\n\t * @param startingURL, the URL to be standardized.\n\t * @return the standardized version of the provided URL.\n\t */\n\tpublic URL standardizeURL(URL startingURL);\n\t\t\n\t/**\n\t * Helps writes any malformedURL exception to a log file.\n\t * @param report, the report to be logged. \n\t */\n\tpublic void writeToExceptionLog(String report);\n}",
"public interface RemotInterfaceOperations \n{\n String createDRecord (String managerId, String firstName, String lastName, String address, String phone, String specialization, String location);\n String createNRecord (String managerId, String firstName, String lastName, String designation, String status, String statusDate);\n String getRecordCount (String managerId, int recordType);\n String editRecord (String managerId, String recordID, String fieldName, String newValue);\n String transferRecord (String managerID, String recordID, String remoteClinicServerName);\n}",
"public interface C27084a {\n /* renamed from: a */\n void mo69874a();\n\n /* renamed from: a */\n void mo69875a(List<Aweme> list, boolean z);\n }",
"public interface am extends ak {\r\n /* renamed from: a */\r\n void mo194a(int i) throws RemoteException;\r\n\r\n /* renamed from: a */\r\n void mo195a(List<LatLng> list) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo196b(float f) throws RemoteException;\r\n\r\n /* renamed from: b */\r\n void mo197b(boolean z);\r\n\r\n /* renamed from: c */\r\n void mo198c(boolean z) throws RemoteException;\r\n\r\n /* renamed from: g */\r\n float mo199g() throws RemoteException;\r\n\r\n /* renamed from: h */\r\n int mo200h() throws RemoteException;\r\n\r\n /* renamed from: i */\r\n List<LatLng> mo201i() throws RemoteException;\r\n\r\n /* renamed from: j */\r\n boolean mo202j();\r\n\r\n /* renamed from: k */\r\n boolean mo203k();\r\n}",
"public static interface Enhancer{\r\n\t\t\r\n\t\tpublic Classification getClassification(ClassifierGenerator generator, Processor processor, TreeNode tree, Tuple tuple, long dueTime);\r\n\t}",
"default void refactoring() {\n templateBuilder.set(new StringBuilder());\n }",
"public interface C9715b {\n\n /* renamed from: com.tencent.mm.modelvideo.b$a */\n public interface C9714a {\n /* renamed from: ad */\n void mo9058ad(String str, int i);\n\n /* renamed from: h */\n void mo9075h(String str, int i, int i2);\n\n /* renamed from: ml */\n void mo21050ml(int i);\n\n void onDataAvailable(String str, int i, int i2);\n }\n\n /* renamed from: a */\n void mo8712a(C9714a c9714a);\n\n /* renamed from: dV */\n void mo8713dV(String str);\n\n boolean isVideoDataAvailable(String str, int i, int i2);\n\n /* renamed from: r */\n void mo8715r(String str, String str2, String str3);\n\n void requestVideoData(String str, int i, int i2);\n}",
"public interface DownloadController {\n /* renamed from: a */\n int mo44964a();\n\n /* renamed from: b */\n int mo44965b();\n\n /* renamed from: c */\n boolean mo44966c();\n\n /* renamed from: d */\n boolean mo44967d();\n}",
"public interface C1061nc extends IInterface {\n /* renamed from: a */\n String mo2800a();\n\n /* renamed from: a */\n String mo2801a(String str);\n\n /* renamed from: a */\n void mo2802a(String str, boolean z);\n\n /* renamed from: a */\n boolean mo2803a(boolean z);\n}"
] | [
"0.7081916",
"0.7081916",
"0.6036695",
"0.5884191",
"0.5836823",
"0.5771339",
"0.5767523",
"0.57438236",
"0.5737498",
"0.5732981",
"0.57050765",
"0.56878424",
"0.5676416",
"0.56398165",
"0.5626502",
"0.55915594",
"0.5585261",
"0.55723304",
"0.55723304",
"0.55719465",
"0.55655986",
"0.55459404",
"0.5540229",
"0.55130494",
"0.5509146",
"0.5500735",
"0.54968774",
"0.5495477",
"0.5492424",
"0.54889965",
"0.54880464",
"0.54653025",
"0.5459924",
"0.5458509",
"0.5455141",
"0.5453214",
"0.54388905",
"0.54379606",
"0.54349095",
"0.54277813",
"0.5425739",
"0.54226995",
"0.541543",
"0.54131436",
"0.54045177",
"0.53954333",
"0.53894216",
"0.53826874",
"0.53825784",
"0.5376749",
"0.5368605",
"0.53613275",
"0.53583586",
"0.5350776",
"0.5348631",
"0.53472525",
"0.5341556",
"0.5337278",
"0.5336629",
"0.5336371",
"0.5336242",
"0.5335731",
"0.53272676",
"0.53249586",
"0.532312",
"0.53227603",
"0.53204054",
"0.5312306",
"0.53047967",
"0.53000176",
"0.5295165",
"0.5291047",
"0.5285882",
"0.52844137",
"0.5278472",
"0.52753514",
"0.52660924",
"0.52640307",
"0.52625656",
"0.5261141",
"0.5260587",
"0.5259688",
"0.52562815",
"0.5252859",
"0.5251477",
"0.5248867",
"0.5246081",
"0.52422595",
"0.5233999",
"0.5232551",
"0.52323145",
"0.522934",
"0.5221641",
"0.5219286",
"0.5218482",
"0.5213913",
"0.52130145",
"0.521219",
"0.52082443",
"0.5206262"
] | 0.5881652 | 4 |
implements IAccount since inherits from Account (implementing would be redundant) | public StandardAccount(int accountNumber, double creditLimit) {
super(accountNumber);
this.creditLimit = creditLimit;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface Account {\n\t\n//\t\n//\t\tMoney money;\n//\t\tInterestRate interestRate;\n//\t\tPeriod interestPeriod;\n\t\t\n\t\tpublic int deposit(int depositAmmount);\n//\t\t{\n//\t\t\treturn money.getMoney()+depositAmmount;\n//\t\t}\n\t\t\n\t\tpublic int withdrawl(int withdrawAmmount);\n//\t\t{\n//\t\t\treturn money.getMoney()-withdrawAmmount;\n//\t\t}\n\t\t\n\t\tpublic int getBalance();\n//\t\t{\n//\t\t\treturn money.getMoney()*interestRate.getInterestRate()*interestPeriod.getPeriod()/100;\n//\t\t}\n\t}",
"public interface Account {\n\n\tpublic String getId();\n\n\tpublic String getEmail();\n\n\tpublic AccountState getState();\n\tpublic void setState(AccountState state);\n\t\n\tpublic void setEmail(String email);\n\n\tpublic String getCompanyName();\n\n\tpublic void setCompanyName(String companyName);\n\n\tpublic Name getFullName();\n\n\tpublic void setFullName(Name fullName);\n\n\tpublic Address getAddress();\n\n\tpublic void setAddress(Address address);\n\t\n\tpublic Map<String, String> getExternalAccounts();\n\t\n\tpublic void setExternalAccounts(Map<String, String> externalAccounts);\n\t\n}",
"public interface Account extends LrsObject {\n /**\n * The canonical home page for the system the account is on. This is based on FOAF's accountServiceHomePage.\n */\n InternationalizedResourceLocator getHomePage();\n\n /**\n * The unique id or name used to log in to this account. This is based on FOAF's accountName.\n */\n String getName();\n}",
"Account getAccount();",
"public interface IAccount {\n\n public double getCurrentBalance();\n public String getAccountNumber();\n public String getType();\n String getPartyType();\n}",
"public Account getAccount() {\n return account;\n }",
"public Account getAccount() {\n return account;\n }",
"public\n Account\n getAccount()\n {\n return itsAccount;\n }",
"public Account getAccount() {\r\n\t\treturn account;\r\n\t}",
"interface AccountInterface{\n\tabstract void deposit();\n\tvoid withdraw();\n\tvoid roi();\n}",
"public String getAccount() {\r\n return account;\r\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"public String getAccount() {\n return account;\n }",
"java.lang.String getAccount();",
"public String getAccount() {\r\n\t\treturn account;\r\n\t}",
"public String getAccount(){\n\t\treturn account;\n\t}",
"public interface IAccountRepository {\n boolean createAccount(Account account);\n Account getAccount(int customer_id);\n List<Account> getAllAccounts();\n}",
"Account() { }",
"public interface UserAccount {\n\n public String registration(String name, String password);\n\n public String logIn(String name, String password);\n\n public String deleteAccount(String name, String password);\n}",
"Account getAccount(Integer accountNumber);",
"public\n void\n setAccount(Account account)\n {\n itsAccount = account;\n }",
"public interface AdultAccountInterface {\n\n\tpublic void makeAccount();\n}",
"public interface Account {\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: Resource Etag.\n *\n * @return the etag value.\n */\n String etag();\n\n /**\n * Gets the kind property: The Kind of the resource.\n *\n * @return the kind value.\n */\n String kind();\n\n /**\n * Gets the sku property: The resource model definition representing SKU.\n *\n * @return the sku value.\n */\n Sku sku();\n\n /**\n * Gets the identity property: Identity for the resource.\n *\n * @return the identity value.\n */\n Identity identity();\n\n /**\n * Gets the systemData property: Metadata pertaining to creation and last modification of the resource.\n *\n * @return the systemData value.\n */\n SystemData systemData();\n\n /**\n * Gets the tags property: Resource tags.\n *\n * @return the tags value.\n */\n Map<String, String> tags();\n\n /**\n * Gets the location property: The geo-location where the resource lives.\n *\n * @return the location value.\n */\n String location();\n\n /**\n * Gets the properties property: Properties of Cognitive Services account.\n *\n * @return the properties value.\n */\n AccountProperties properties();\n\n /**\n * Gets the region of the resource.\n *\n * @return the region of the resource.\n */\n Region region();\n\n /**\n * Gets the name of the resource region.\n *\n * @return the name of the resource region.\n */\n String regionName();\n\n /**\n * Gets the name of the resource group.\n *\n * @return the name of the resource group.\n */\n String resourceGroupName();\n\n /**\n * Gets the inner com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner object.\n *\n * @return the inner object.\n */\n AccountInner innerModel();\n\n /** The entirety of the Account definition. */\n interface Definition\n extends DefinitionStages.Blank, DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate {\n }\n\n /** The Account definition stages. */\n interface DefinitionStages {\n /** The first stage of the Account definition. */\n interface Blank extends WithResourceGroup {\n }\n\n /** The stage of the Account definition allowing to specify parent resource. */\n interface WithResourceGroup {\n /**\n * Specifies resourceGroupName.\n *\n * @param resourceGroupName The name of the resource group. The name is case insensitive.\n * @return the next definition stage.\n */\n WithCreate withExistingResourceGroup(String resourceGroupName);\n }\n\n /**\n * The stage of the Account definition which contains all the minimum required properties for the resource to be\n * created, but also allows for any other optional properties to be specified.\n */\n interface WithCreate\n extends DefinitionStages.WithLocation,\n DefinitionStages.WithTags,\n DefinitionStages.WithKind,\n DefinitionStages.WithSku,\n DefinitionStages.WithIdentity,\n DefinitionStages.WithProperties {\n /**\n * Executes the create request.\n *\n * @return the created resource.\n */\n Account create();\n\n /**\n * Executes the create request.\n *\n * @param context The context to associate with this operation.\n * @return the created resource.\n */\n Account create(Context context);\n }\n\n /** The stage of the Account definition allowing to specify location. */\n interface WithLocation {\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithCreate withRegion(Region location);\n\n /**\n * Specifies the region for the resource.\n *\n * @param location The geo-location where the resource lives.\n * @return the next definition stage.\n */\n WithCreate withRegion(String location);\n }\n\n /** The stage of the Account definition allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n WithCreate withTags(Map<String, String> tags);\n }\n\n /** The stage of the Account definition allowing to specify kind. */\n interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n WithCreate withKind(String kind);\n }\n\n /** The stage of the Account definition allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The resource model definition representing SKU.\n *\n * @param sku The resource model definition representing SKU.\n * @return the next definition stage.\n */\n WithCreate withSku(Sku sku);\n }\n\n /** The stage of the Account definition allowing to specify identity. */\n interface WithIdentity {\n /**\n * Specifies the identity property: Identity for the resource..\n *\n * @param identity Identity for the resource.\n * @return the next definition stage.\n */\n WithCreate withIdentity(Identity identity);\n }\n\n /** The stage of the Account definition allowing to specify properties. */\n interface WithProperties {\n /**\n * Specifies the properties property: Properties of Cognitive Services account..\n *\n * @param properties Properties of Cognitive Services account.\n * @return the next definition stage.\n */\n WithCreate withProperties(AccountProperties properties);\n }\n }\n\n /**\n * Begins update for the Account resource.\n *\n * @return the stage of resource update.\n */\n Account.Update update();\n\n /** The template for Account update. */\n interface Update\n extends UpdateStages.WithTags,\n UpdateStages.WithKind,\n UpdateStages.WithSku,\n UpdateStages.WithIdentity,\n UpdateStages.WithProperties {\n /**\n * Executes the update request.\n *\n * @return the updated resource.\n */\n Account apply();\n\n /**\n * Executes the update request.\n *\n * @param context The context to associate with this operation.\n * @return the updated resource.\n */\n Account apply(Context context);\n }\n\n /** The Account update stages. */\n interface UpdateStages {\n /** The stage of the Account update allowing to specify tags. */\n interface WithTags {\n /**\n * Specifies the tags property: Resource tags..\n *\n * @param tags Resource tags.\n * @return the next definition stage.\n */\n Update withTags(Map<String, String> tags);\n }\n\n /** The stage of the Account update allowing to specify kind. */\n interface WithKind {\n /**\n * Specifies the kind property: The Kind of the resource..\n *\n * @param kind The Kind of the resource.\n * @return the next definition stage.\n */\n Update withKind(String kind);\n }\n\n /** The stage of the Account update allowing to specify sku. */\n interface WithSku {\n /**\n * Specifies the sku property: The resource model definition representing SKU.\n *\n * @param sku The resource model definition representing SKU.\n * @return the next definition stage.\n */\n Update withSku(Sku sku);\n }\n\n /** The stage of the Account update allowing to specify identity. */\n interface WithIdentity {\n /**\n * Specifies the identity property: Identity for the resource..\n *\n * @param identity Identity for the resource.\n * @return the next definition stage.\n */\n Update withIdentity(Identity identity);\n }\n\n /** The stage of the Account update allowing to specify properties. */\n interface WithProperties {\n /**\n * Specifies the properties property: Properties of Cognitive Services account..\n *\n * @param properties Properties of Cognitive Services account.\n * @return the next definition stage.\n */\n Update withProperties(AccountProperties properties);\n }\n }\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @return the refreshed resource.\n */\n Account refresh();\n\n /**\n * Refreshes the resource to sync with Azure.\n *\n * @param context The context to associate with this operation.\n * @return the refreshed resource.\n */\n Account refresh(Context context);\n\n /**\n * Lists the account keys for the specified Cognitive Services account.\n *\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account along with {@link Response}.\n */\n Response<ApiKeys> listKeysWithResponse(Context context);\n\n /**\n * Lists the account keys for the specified Cognitive Services account.\n *\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account.\n */\n ApiKeys listKeys();\n\n /**\n * Regenerates the specified account key for the specified Cognitive Services account.\n *\n * @param parameters regenerate key parameters.\n * @param context The context to associate with this operation.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account along with {@link Response}.\n */\n Response<ApiKeys> regenerateKeyWithResponse(RegenerateKeyParameters parameters, Context context);\n\n /**\n * Regenerates the specified account key for the specified Cognitive Services account.\n *\n * @param parameters regenerate key parameters.\n * @throws IllegalArgumentException thrown if parameters fail the validation.\n * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.\n * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n * @return the access keys for the cognitive services account.\n */\n ApiKeys regenerateKey(RegenerateKeyParameters parameters);\n}",
"public interface AccountSpecifier {\n\tpublic void setAccount(Account account);\n}",
"public void setAccount(Account account) {\n this.account = account;\n }",
"public interface AccountStore {\n boolean insertAccount(String accountId, Account account);\n\n Account getAccount(String accountId);\n}",
"public interface AccountData {\n\n /**\n * Gets the participant id of the user who owns this account. This is the\n * primary identifier for accounts.\n *\n * @return returns a non-null participant id.\n */\n ParticipantId getId();\n\n /**\n * @return true iff this account is a {@link HumanAccountData}.\n */\n boolean isHuman();\n\n /**\n * Returns this account as a {@link HumanAccountData}.\n *\n * @precondition isHuman()\n */\n HumanAccountData asHuman();\n\n /**\n * @return true iff this account is a {@link RobotAccountData}.\n */\n boolean isRobot();\n\n /**\n * Returns this account as a {@link RobotAccountData}.\n *\n * @precondition isRobot()\n */\n RobotAccountData asRobot();\n}",
"@Override\r\n\tpublic void NroAccount() {\n\t\t\r\n\t}",
"Account getAccount(int id);",
"@Override public Account provideAccount(String accountJson) {\n return null;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public void setAccount(String account) {\n this.account = account;\n }",
"public Account() {\n super();\n }",
"UserAccount getUserAccountById(long id);",
"public static interface AccountsAdder {\n void addAccount(String s);\n }",
"public abstract GDataAccount getAccount(String account) throws ServiceException;",
"private GetAccount()\r\n/* 19: */ {\r\n/* 20:18 */ super(new APITag[] { APITag.ACCOUNTS }, new String[] { \"account\" });\r\n/* 21: */ }",
"public interface bdp extends android.os.IInterface {\n android.accounts.Account a();\n}",
"public interface AccountRepository {\n\t\n\t/**\n\t * Retrieves account info based on authenticated username\n\t * @param username\n\t * @return\n\t */\n\tdefault public Account getAccountForUser(String username) {\n\t\tthrow DefaultHandler.notSupported();\n\t}\n\t\n\t/**\n\t * Retrieves Views (Lists) mapped to an userId\n\t * @param userId\n\t * @return\n\t */\n\tdefault public List<View> getViewsForUserId(long userId){\n\t\tthrow DefaultHandler.notSupported();\n\t}\n\t\n\t/**\n\t * Retrieves Categories mapped to an userId\n\t * @param userId\n\t * @return\n\t */\n\tdefault public List<Category> getCategoriesForUserId(long userId){\n\t\tthrow DefaultHandler.notSupported();\n\t}\n}",
"public void openAccount(Account a) {}",
"public void setAccount(String account) {\r\n\t\tthis.account = account;\r\n\t}",
"public interface AccountDao extends IDao<Account> {\n /**\n * @param accNo the account number that should be searched for\n * @return the account object that has been searched for\n */\n Account getByAccountNo(String accNo);\n\n /**\n * @param accountName the account name the searched account has\n * @return the account matching the account name\n */\n Account getByName(String accountName);\n}",
"public void addAccount(Person p, Account a);",
"@SuppressWarnings(\"unused\")\npublic interface AccountI extends Remote {\n String login(String id, String passwd) throws RemoteException;\n String signUp(String id, String passwd, String secureQuestion, String answer)throws RemoteException;\n String logOut(String userName) throws RemoteException;\n String forgetPassword(String username)throws RemoteException;\n String resetPassword(String username,String answer, String password)throws RemoteException;\n void startIO()throws RemoteException;\n int getRuntimeServer()throws RemoteException;\n int getFileServer() throws RemoteException;\n int getIOUniqueNumber()throws RemoteException;\n}",
"void updateAccount(Account account);",
"public abstract int getAccountType();",
"void setAccount(final Account account);",
"public interface IAccountbService {\n\n int add(Accountb account);\n\n int update(Accountb account);\n\n int delete(int id);\n\n Accountb findAccountById(int id);\n\n List<Accountb> findAccountList();\n\n Accountb findAccountByName(String name);\n\n\n\n\n}",
"public AccountInfo getAccountInfo() {\n return accountInfo;\n }",
"public interface AccountDao {\n\n /**\n * Retrieve a specific bank account by id\n *\n * @param id the account id to retrieve\n * @return Account object representing the bank account\n */\n Account getAccount(int id);\n\n /**\n * Retrieve all accounts for a given customer\n *\n * @param customerId the customer id to lookup\n * @return list of accounts belonging to the given customer\n */\n List<Account> getAccountsForCustomerId(int customerId);\n\n /**\n * Add a new account to the data source\n *\n * Note that the account id will be automatically generated\n *\n * @param account the account information to store\n * @return generated account id\n */\n int createAccount(Account account);\n\n /**\n * Update stored information for a given account\n *\n * @param account the account to update\n */\n void updateAccount(Account account);\n}",
"public interface AccountGateway extends Gateway {\n Account save(Account account);\n\n void delete(Account account);\n\n Account findAccountByReference(String reference);\n\n List<Account> findAccountsWhereReferenceIn(List<String> references);\n\n List<Account> findAllAccounts();\n\n List<Account> findAccountsMatchingReference(String filterText);\n\n List<Account> findAccountsMatchingName(String filterText);\n\n}",
"public MnoAccount getAccountById(String id);",
"protected final Account getAccount() {\n\t\treturn getRegisterView().getAccount();\n\t}",
"@Override\r\n\tpublic void showAccount() {\n\t\t\r\n\t}",
"AccountDetail getAccount(String number) throws Exception;",
"public Account() {\n this(DSL.name(\"account\"), null);\n }",
"public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public interface AccountService {\n\tpublic Long getUserId(String name);\n\tpublic MessageSystem getMessageSystem();\n}",
"public interface AccountService {\n\n Account createAccount(Account account);\n\n AccountDto.ResponseAccount getAccountById(Long accountId);\n\n}",
"net.nyhm.protonet.example.proto.AccountProto.Account getAccount();",
"net.nyhm.protonet.example.proto.AccountProto.Account getAccount();",
"public interface EmailAccount extends GraphObject {\n\n\t/**\n\t * Get the email address associated with this account\n\t * \n\t * @return String The email address\n\t */\n\tpublic String getEmailAddress();\n\n\t/**\n\t * Set the email address associated with this account\n\t * \n\t * @param emailAddress String The email address. Cannot be <code>null</code> or an empty string\n\t */\n\tpublic void setEmailAddress(String emailAddress);\n}",
"public interface AccountDao {\n\t\n\t/**\n\t * Gets the list of Accounts based on the criteria passed as parameter\n\t * @param map a key value pair map used as criteria\n\t * @return List of {@link Account} satisfying the criteria\n\t * @throws DaoException\n\t */\n\tList<Account> getAccountsBasedOnCriteria(Map<String, Object> map) throws DaoException;\n\t\n\t/**\n\t * Get the {@link Account} object based on its accountNumber\n\t * @param accountNumber\n\t * @return\n\t * @throws DaoException\n\t */\n\tAccount getAccountByAccountNumber(Integer accountNumber) throws DaoException;\n\t\n\t/**\n\t * Update {@link Account}\n\t * @param account {@link Account} object needs to be updated\n\t * @throws DaoException\n\t */\n\tvoid update(Account account) throws DaoException;\n}",
"public interface UserAccountService {\n public void addUserAccount(UserAccount user);\n\n public UserAccount getUserAccount(String uid);\n\n public void update(UserAccount user);\n\n public String login(String uid, String pwd);\n\n public UserAccount getByid(Long id);\n\n public List<String> getUids(List<Long> ids);\n\n public List<Friend> search(final String key);\n}",
"public void addAccount(Account account,Person person);",
"public com.huawei.www.bme.cbsinterface.cbs.businessmgr.Account getAccount() {\r\n return account;\r\n }",
"public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public interface StoreAccount {\n\n /**\n * Store account.\n *\n * @param account Account to store.\n * @throws IllegalStateException If storing account fails.\n * @since 1.0\n */\n void storeAccount(Account account) throws IllegalStateException;\n}",
"Account(int account_number,double balance) //pramiterized constrector\n {\n this.account_number=account_number;\n this.balance=balance;\n }",
"public interface AccountDao {\n int insert(Account account);\n\n Account queryAccountById(Long id);\n\n Account findAccount(Account account);\n\n Account queryAccountByMobile(Long mobile);\n\n Account queryAccountByEmail(String email);\n\n void update(Account account);\n\n void resetPassword(Account account);\n}",
"public LocalAccount\t\tgetAccount();",
"public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public java.lang.String getAccount() {\n java.lang.Object ref = account_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n account_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public java.lang.String getAccount() {\n java.lang.Object ref = account_;\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 account_ = s;\n return s;\n }\n }",
"public com.google.protobuf.ByteString\n getAccountBytes() {\n java.lang.Object ref = account_;\n if (ref instanceof java.lang.String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (java.lang.String) ref);\n account_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public Account() {\n }",
"public interface AccountServer {\r\n\t\r\n\t/**\r\n\t Method: newAccount\r\n\t Inputs: String type, String name, float balance\r\n\t Returns: boolean true if the account was created and stored, false otherwise\r\n\r\n\t Description: Create a new account object in the server. if an account already exists with the given name then a new account is not created and stored.\r\n\t*/\r\n\tpublic boolean\tnewAccount(String type, String name, float balance) throws IllegalArgumentException;\r\n\r\n\t\r\n\t/**\r\n\t Method: closeAccount\r\n\t Inputs: String\r\n\t Returns: boolean true if there was an account with this name and close was successful\r\n\r\n\t Description: Close an account \r\n\t*/\r\n\tpublic boolean\tcloseAccount(String name);\r\n\r\n\t/**\r\n\t * @param name name of the account \r\n\t * @return Account object or null if not found. \r\n\t */\r\n\tpublic Account\tgetAccount(String name);\r\n\r\n\t/** \r\n\t * @return a list of all Accounts inside the server \r\n\t */\r\n\tpublic List<Account> getAllAccounts();\r\n\r\n\t/** \r\n\t * @return a list of Accounts inside the server that are not CLOSED\r\n\t */\r\n\tpublic List<Account> getActiveAccounts();\r\n\r\n\t\r\n\t/**\r\n\t Method: saveAccounts\r\n\t Inputs: none\r\n\t Returns: void\r\n\r\n\t Description: Saves the state of the server\r\n\t*/\r\n\tpublic void\tsaveAccounts() throws IOException;\r\n}",
"public Account(){\n this.id = 0;\n this.balance = 0;\n this.annualInterestRate = 0;\n this.dateCreated = new Date();\n }",
"public interface AccountService {\n void deposit(Account account, double amount);\n\n void withdraw(Account account, double amount) throws NotEnoughFundsException;\n\n void transfer(Account fromAccount, Account toAccount, double amount) throws NotEnoughFundsException;\n\n\n}",
"public int getAccountNumber() {\n return accountNumber;\n }",
"public interface AccountRepo extends JpaRepository<Account,Integer> {\n\n List<Account>findAccountByUser(User user);\n}",
"public interface Accountable {\n\n public String getName();\n public Object[] getTabData();\n\n}",
"BillingAccount getBillingAccount();",
"public interface AccountDAO {\n public BankAccount createAccount(String accountNumber);\n public BankAccount getAccount(String accountNumber);\n public long deposit(String accountNumber, long amount, String description);\n public long withdraw(String accountNumber, long amount, String description);\n}",
"public Account() {\n }",
"public Account() {\n }",
"public java.lang.String getAccount() {\n java.lang.Object ref = account_;\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 account_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public interface IAccountService {\n /**\n * 是否已经登录\n *\n * @return\n */\n boolean isLogin();\n\n /**\n * 获取登录用户的 AccountId\n *\n * @return\n */\n String getAccountId();\n\n Fragment newUserFragment(Activity activity, int containerId, FragmentManager fragmentManager, Bundle bundle, String\n tag);\n}",
"public int getAccountId() {\n return accountId;\n }",
"public int getAccountID() {\n return accountID;\n }",
"@Override\n public String toString()\n {\n return getClass().getSimpleName() + \"(\" + getAccountID() + \")\";\n }"
] | [
"0.80056345",
"0.7840548",
"0.77012575",
"0.7697668",
"0.769364",
"0.74508476",
"0.74508476",
"0.7430289",
"0.7255782",
"0.71954787",
"0.7151061",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.71291673",
"0.70904934",
"0.7079042",
"0.7072012",
"0.7045275",
"0.70308906",
"0.6931246",
"0.6925391",
"0.6891232",
"0.68815446",
"0.6869073",
"0.68332285",
"0.680542",
"0.6799862",
"0.6787017",
"0.678029",
"0.67737174",
"0.67650735",
"0.66954684",
"0.66954684",
"0.66954684",
"0.66954684",
"0.6688153",
"0.6680336",
"0.66732454",
"0.66467756",
"0.66441256",
"0.6598721",
"0.65883905",
"0.6561055",
"0.65492845",
"0.65345514",
"0.6527686",
"0.6514555",
"0.6498937",
"0.64934826",
"0.6489883",
"0.64844817",
"0.6481151",
"0.64784247",
"0.6473248",
"0.64562476",
"0.6451258",
"0.64511955",
"0.64498764",
"0.644743",
"0.6444224",
"0.6440138",
"0.6436465",
"0.64294016",
"0.64294016",
"0.64263636",
"0.6415401",
"0.64091355",
"0.640811",
"0.6389562",
"0.63890433",
"0.63768756",
"0.6367496",
"0.63597834",
"0.6357839",
"0.63560367",
"0.63495404",
"0.63304806",
"0.6329378",
"0.63293284",
"0.6324299",
"0.6323458",
"0.6318017",
"0.63178986",
"0.6310793",
"0.6310591",
"0.63056225",
"0.6300729",
"0.6300201",
"0.6300201",
"0.6296198",
"0.6287402",
"0.6287206",
"0.6286177",
"0.62792635"
] | 0.0 | -1 |
Constructor to initialize maxspeed and altitude of HoverBot | public HoverBot(int maxSpeed, int altitude) {
super(maxSpeed);
this.altitude = altitude;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void init() {\n\t\t//Set movementSpeed in px/s\n\t\tmovementSpeed = 100;\n\t\t//Set previousTime to start at the \n\t}",
"@Override\n public void init()\n {\n target.setAbsoluteTolerance(ANGLE_ABSOLUTE_TOLERANCE); // Configure the target's absolute tolerance\n /*\n Limit the speed on the target between these values to prevent overshooting and damage to motors\n Normally we would leave the output range without bounds because we wish for the end affector to reach the setpoint\n as fast as possible, in a constant time, which would mean having an output proportional to it's error, but in this case\n We don't care how long it takes to reach its target, we just want it to get there in one piece */\n //System.out.println(\"INITIALIZING PID CONTROL\");\n target.setOutputRange(-0.15, 0.15);\n\n /* load percent control in because output is simply a percentage */\n target.loadLeftController(\"percent\");\n target.loadRightController(\"percent\");\n }",
"public SniperEnemy()\n { \n scoreBoost = 15;\n moneyBoost = 300;\n healthPoints = 500; \n fireRate = 45; \n movementCounter = 20;\n movementMod = 20;\n }",
"void setMaxActiveAltitude(double maxActiveAltitude);",
"protected void initialize() {\n \ttarget = (int) SmartDashboard.getNumber(\"target\", 120);\n \ttarget = (int) (target * Constants.TICKS_TO_INCHES);\n\t\tRobot.drive.stop();\n\t\tmaxCount = (int) SmartDashboard.getNumber(\"max count\", 0);\n\t\ttolerance = (int) SmartDashboard.getNumber(\"tolerance\", 0);\n\t\tRobot.drive.left.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n\t\tRobot.drive.right.motor1.setSelectedSensorPosition(0, Constants.kPIDLoopIdx, Constants.kTimeoutMs);\n }",
"public void init() {\n delayingTimer = new ElapsedTime();\n\n // Define and Initialize Motors and Servos: //\n tailMover = hwMap.dcMotor.get(\"tail_lift\");\n grabberServo = hwMap.servo.get(\"grabber_servo\");\n openGrabber();\n\n // Set Motor and Servo Directions: //\n tailMover.setDirection(DcMotorSimple.Direction.FORWARD);\n\n tailMover.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n tailMover.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);\n int prevEncoder = tailMover.getCurrentPosition();\n tailMover.setPower(-0.15);\n mainHW.opMode.sleep (300);\n Log.d(\"catbot\", String.format(\"tail lift power %.2f current position %2d prev %2d\", tailMover.getPower(), tailMover.getCurrentPosition(),prevEncoder));\n runtime.reset();\n while((Math.abs(prevEncoder - tailMover.getCurrentPosition()) > 10)&& (runtime.seconds()<3.0)){\n prevEncoder = tailMover.getCurrentPosition();\n mainHW.opMode.sleep(300);\n Log.d(\"catbot\", String.format(\"tail lift power %.2f current position %2d prev %2d\", tailMover.getPower(), tailMover.getCurrentPosition(),prevEncoder));\n }\n tailMover.setPower(0.0);\n // Set Motor and Servo Modes: //\n tailMover.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);\n\n tailMover.setTargetPosition(0);\n tailMover.setMode(DcMotor.RunMode.RUN_TO_POSITION);\n closeGrabber();\n }",
"public Airplane(){\n\t\tsuper(106, 111);\n\t\tspeed = Math.random() + 2.0;\n\t}",
"@Override\r\n\tpublic void initialise(Agent agent) {\n\t\tthis.maxSpeed = agent.getMaxSpeed();\r\n\t\tsprint = maxSpeed*1.5f;\r\n\t}",
"@Override\n protected void initialize() {\n Robot.tilt.setSpeed(speed);\n }",
"@Override\n public void initialize() {\n shooter.setShooterVelocity(speed);\n }",
"private void setUpPlayerSpeed() \n {\n \tcalculateMovementSpeeds();\n \t\n \tSystem.out.println(\"height : \" + height);\n \tSystem.out.println(\"\\nsetupPlayerSpeed\");\n \tSystem.out.println(\"==============\");\n \tSystem.out.println(\" walkSpeed : \" + walkSpeed);\n \tSystem.out.println(\" maxRunSpeed : \" + maxRunSpeed);\n \tSystem.out.println(\" accelerationRate : \" + accelerationRate);\n \tSystem.out.println(\" maxAccelRate : \" + maxAccelRate);\n \tSystem.out.println(\" initialJumpSpeed : \" + initialJumpSpeed);\n \tSystem.out.println(\" maxJumpSpeed : \" + maxJumpSpeed);\n \tSystem.out.println(\" jumpIncr : \" + jumpIncr);\n \tSystem.out.println(\" maxFallSpeed : \" + maxFallSpeed);\n \t\n \t//System.exit(-1);\n\t}",
"protected void initialize() {\r\n \t((Launcher) Robot.fuelLauncher).controlSpeed(i);\r\n }",
"public BareMetalMachinePowerOffParameters() {\n }",
"public Thrust(Shape host, float acceleration, float max_speed)\n\t{\n\t\tthis.host = host;\n\t\tthis.max_speed = max_speed;\n\t\tthis.acceleration = acceleration;\n\n\t\tthis.speed = 0;\n\t}",
"@Override\n protected void initialize() {\n Robot.SCISSOR.extendLift(speed);\n }",
"protected void initialize() {\n \ttarget = Robot.trackingCamera.getTarget();\n targetX = target[0];\n targetY = target[1];\n \tstopTime = System.currentTimeMillis() + timeOut;\n }",
"protected void initialize()\n\t{\n\t\tRobot.intake.setSpeed(new double[] { leftSpeed, rightSpeed });\n\t}",
"public void init(){\n hp = DEFAULT_MAX_HEALTH;\n bulletsFired = new ArrayList<>();\n initial_y = -1;\n\n //Sets the byte to identify the state of movement\n //For animation purposes in the renderer\n //0 = stationary\n //1 = jumping\n //2 = moving left\n //3 = jumping left\n //4 = right\n //5 = Jumping right\n //6 = crouching\n //8 = crouching left\n //10 = crouching right\n stateOfMovement = 0;\n }",
"public DwarfEnemy()\r\n\t{\r\n\t\tdamagePower = GameStatics.Enemies.Dwarf.damagePower;\r\n\t\tspeed = GameStatics.Enemies.Dwarf.speed;\r\n\t\thp = GameStatics.Enemies.Dwarf.initHp;\r\n\t}",
"protected void initialize() {\n \t_finalTickTargetLeft = _ticksToTravel + Robot.driveTrain.getEncoderLeft();\n \t_finalTickTargetRight = _ticksToTravel + Robot.driveTrain.getEncoderRight();\n \t\n }",
"public Robot() {\t\n\t\tthis.step = myclass.STD_STEP ; \n\t\tthis.speed = myclass.STD_SPEED ; \n\t\tthis.rightM = new EV3LargeRegulatedMotor(myclass.rightP) ; \n\t\tthis.leftM = new EV3LargeRegulatedMotor(myclass.leftP) ; \n\t}",
"public Target()\n\t{\n\t\tx = 2.0;\n\t\ty = 2.0;\n\t\tangle = 0.0;\n\t\tdistance = 0.0;\n\t\tnullTarget=true;\n\t}",
"public Feeder() {\n beltMotor.configPeakOutputForward(1D/3D, 10);\n beltMotor.configPeakOutputReverse(-1D/3D, 10);\n ejectMotor.configPeakOutputForward(1, 10);\n ejectMotor.configPeakOutputReverse(-1, 10);\n\n beltMotor.configSelectedFeedbackSensor(FeedbackDevice.CTRE_MagEncoder_Relative);\n\n SmartDashboard.putNumber(\"Feeder.kBeltIntakeSpeed\", kBeltIntakeSpeed);\n SmartDashboard.putNumber(\"Feeder.kRollerIntakeSpeed\", kRollerIntakeSpeed);\n SmartDashboard.putNumber(\"Feeder.kBeltEjectSpeed\", kBeltEjectSpeed);\n SmartDashboard.putNumber(\"Feeder.kRollerEjectSpeed\", kRollerEjectSpeed);\n SmartDashboard.putNumber(\"Feeder.kInSensorMinDistance\", kInSensorMinDistance);\n SmartDashboard.putNumber(\"Feeder.kInSensorMaxDistance\", kInSensorMaxDistance);\n SmartDashboard.putNumber(\"Feeder.kOutSensorMinDistance\", kOutSensorMinDistance);\n SmartDashboard.putNumber(\"Feeder.kOutSensorMaxDistance\", kOutSensorMaxDistance);\n SmartDashboard.putNumber(\"Feeder.limitDistance\", limitDistance);\n }",
"public void setMaxSpeed() {\n\t\tspeed = MAX_SPEED;\n\t}",
"@Override\n protected void initialize() { \n\n \n SmartDashboard.putNumber(\"Side Velocity\", sideVelocity);\n SmartDashboard.putNumber(\"Belt velocity\", beltVelocity);\n\n }",
"private void default_init(){\n id = 0;\n xPos = 0;\n yPos = 0;\n hp = 100;\n name=\"\";\n character_id = 1;\n weapons = new ArrayList<>();\n weaponEntryTracker = new LinkedList<>();\n isJumping = false;\n isFalling = false;\n initial_y= -1;\n stateOfMovement = 0;\n for(int i = 0; i < 3; i++){\n this.weapons.add(new Pair<>(NO_WEAPON_ID, (short) 0));\n }\n this.weapons.set(0,new Pair<>(PISTOL_ID,DEFAULT_PISTOL_AMMO));\n currentWeapon = this.weapons.get(0);\n bulletsFired = new ArrayList<>();\n shootingDirection = 1;\n energy = 0;\n sprint = false;\n score = 0;\n roundsWon = 0;\n ready = false;\n audioHandler = new AudioHandler();\n }",
"protected void initialize() {\n encoder = winchAndLatchSS.getWinchEncoder();\n counter = 0;\n Robot3663.updateCommandStatus(\"C_WindWinch\", \"initialize \"+targetTicks);\n tightening = winchAndLatchSS.getWinchEncoder() > targetTicks;\n \n if (tightening){\n direction = speed = -1;\n }\n else{\n direction = speed = 1;\n }\n kill = false;\n if((encoder > targetTicks - LEWAY) && (encoder < targetTicks + LEWAY))\n {\n kill = true;\n speed = 0;\n }\n }",
"public void setMaxSpeed(double maxSpeed) {\r\n this.maxSpeed = maxSpeed;\r\n }",
"public void setMaxSpeed(float max_speed)\n\t{\n\t\tthis.max_speed = max_speed;\n\t}",
"@Override\n\tpublic int getMaxSpeed() {\n\t\treturn super.getMaxSpeed();\n\t}",
"public void setMaxSpeed(int MaxSpeed) {\n this.MaxSpeed = MaxSpeed;\n }",
"public Aggressive(){\r\n\t\tsuper();\r\n\t\t\r\n\t}",
"public Block(){\r\n\t\tthis.altitude = 0;\r\n\t\tthis.river = false;\t\r\n\t\tthis.ocean = false;\r\n\t\tthis.river = false;\r\n\t\tborder = false;\r\n\t}",
"public void robotInit() {\r\n\r\n shootstate = down;\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 initialpot = Components.ShooterPot.getAverageVoltage();\r\n //shootpotdown +=initialpot;\r\n //shootpotlow+= initialpot;\r\n //shootpotmiddle+= initialpot;\r\n //shootpothigh+=initialpot;\r\n\r\n }",
"public ArcherTower() {\n\t\tsuper(defaultAttack, defaultRange, defaultAttackSpeed, name);\n\t}",
"protected void initialize() {\n \t\n \ttimeStarted = System.currentTimeMillis();\n \tangle = driveTrain.gyro.getYaw();\n \tspeed = RobotMap.speedAtFullVoltage * power;\n \ttimeToGo = (long)(distance / speed) * 1000;\n }",
"public VelocityWarper() {\r\n // initialize variables\r\n this.angleThres = 0;\r\n this.speedThres = 0;\r\n this.reactionTime = 0;\r\n this.mousePositions = new ArrayList<Point>();\r\n this.fixation = null;\r\n this.information = new PluginInformation(\"Velocity Warper\", \"Uses mouse velocity to calculate warpjump.\", true);\r\n this.angleStartEnd = 0;\r\n this.angleStartMid = 0;\r\n this.propertie = null;\r\n this.isProcessing = false;\r\n this.distanceStopFix = 0;\r\n this.velocityStartEnd = 0;\r\n this.velocityStartMid = 0;\r\n this.setR = 0;\r\n this.setPoint = new Point();\r\n this.xMax = 0;\r\n this.yMax = 0;\r\n this.setIntervall = 1;\r\n this.mid = 0;\r\n this.distance = 0;\r\n\r\n try {\r\n this.robot = new Robot();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n this.timer = new Timer(1, new ActionListener() {\r\n\r\n @SuppressWarnings({ \"synthetic-access\", \"unqualified-field-access\" })\r\n @Override\r\n public void actionPerformed(ActionEvent arg0) {\r\n mousePositions.add(MouseInfo.getPointerInfo().getLocation());\r\n mousePositions.remove(0);\r\n }\r\n });\r\n }",
"public WallAnt()\n {\n health = 4;\n cost = 4;\n }",
"public Monster() {\n\t super();\n\t _hitPts = 150;\n\t _strength = 20 + (int)( Math.random() * 45 ); // [20,65)\n _defense = 40;\n\t _attack = .4;\n }",
"private void setAltitudeValues(){\n minAlt = trackingList.get(0).getAltitude();\n maxAlt = trackingList.get(0).getAltitude();\n averageAlt = trackingList.get(0).getAltitude();\n\n double sumAlt =0.0;\n\n for (TrackingEntry entry:trackingList) {\n\n sumAlt += entry.getAltitude();\n\n //sets min Speed\n if (minAlt > entry.getAltitude()){\n minAlt = entry.getAltitude();\n }\n //sets max Speed\n if (maxAlt < entry.getAltitude()) {\n maxAlt = entry.getAltitude();\n }\n\n }\n averageAlt = sumAlt/trackingList.size();\n }",
"@Override\n public void init() {\n /* Initialize the hardware variables.\n * The init() method of the hardware class does all the work here\n */\n robot.init(hardwareMap);\n // robot.leftBumper.setPosition(.5);\n // robot.leftStageTwo.setPosition(1);\n // robot.rightStageTwo.setPosition(0.1);\n robot.colorDrop.setPosition(0.45);\n robot.align.setPosition(0.95);\n\n // robot.rightBumper.setPosition(.7);\n\n // Send telemetry message to signify robot waiting;\n telemetry.addData(\"Say\", \"Hello Driver\"); //\n }",
"@Override\n protected void initialize() {\n rightTarget = this.distanceInches + Robot.driveTrain.getRightEncoderDistanceInches();\n leftTarget = this.distanceInches + Robot.driveTrain.getLeftEncoderDistanceInches();\n Robot.driveTrain.tankDrive(0, 0);\n this.direction = distanceInches > 0;\n turnPID.resetPID();\n }",
"@Raw\n private void setMaxVelocity(double max){\n \tif (!isValidMaxVelocity(max)) this.maxVelocity = SPEED_OF_LIGHT;\n \telse this.maxVelocity = max;\n }",
"public Heuristic() {\n this(HeuristicUtils.defaultValues);\n }",
"protected Downloader(float maxArea) {\n this.maxArea = maxArea;\n }",
"NetTankSpeed(float speed)\n\t{\n\t\tthis.speed = speed;\n\t}",
"public Quadcopter() {\r\n\t\tsuper();\r\n\t\tmaxFlyingSpeed = 0;\r\n\t}",
"protected void initialize() {\n \tRobot.debug.Start(\"AutoSetLiftPosition\", Arrays.asList(\"Sensor_Position\", \"Sensor_Velocity\",\n \t\t\t\"Trajectory_Position\", \"Trajectory_Velocity\", \"Motor_Output\", \"Error\")); \n \ttotalTimer.reset();\n \ttotalTimer.start();\n\n \tRobot.lift.configGains(\n \t\t\tSmartDashboard.getNumber(\"kF_lift_up\", 0.0), \n \t\t\tSmartDashboard.getNumber(\"kP_lift\", 0.0), \n \t\t\tSmartDashboard.getNumber(\"kI_lift\", 0.0), \n \t\t\tSmartDashboard.getNumber(\"kD_lift\", 0.0),\n \t\t\t(int)SmartDashboard.getNumber(\"kiZone_lift\", 0.0),\n \t\t\t(int)SmartDashboard.getNumber(\"kCruise_lift\", 0.0),\n \t\t\t(int)SmartDashboard.getNumber(\"kAccel_lift\", 0.0));\n \t\n \tRobot.lift.setMotionMagicSetpoint(SmartDashboard.getNumber(\"setpoint_lift\", 0.0));\n }",
"public void setSpeed() {\r\n\t\tthis.currSpeed = this.maxSpeed * this.myStrategy.setEffort(this.distRun);\r\n\t}",
"@Override\n\tpublic void setAltitude(float altitude) {\n\t\t\n\t}",
"protected void initialize() {\n \tstartTime = System.currentTimeMillis();\n \tintake.setLeftPower(power);\n \tintake.setRightPower(power);\n }",
"public Max()\r\n {\r\n }",
"public void setSpeed() {\n if (this.equals(null)) {\n this.speedValue=-5;\n }\n }",
"protected void initialize() {\n \tshooterWheel.shooterWheelSpeedControllerAft.reset();\n \tshooterWheel.shooterWheelSpeedControllerAft.Enable();\n }",
"public TimedChallengeExample(int max) {\n\t\tsuper(\n\t\t\t\tMenuType.SETTINGS, // The menu were your setting will be shown in\n\t\t\t\tmax // Maximum value of challenge\n\t\t);\n\t}",
"public float maxSpeed();",
"public PlayerPiece()\n {\n // initialise instance variables\n //Use the values listed in the comments\n //above that are next to each instance variable\n pieceName = \"no name\";\n pieceType = \"human\";\n currentHealth = 100;\n maxHealth = 100;\n locX = 7;\n locY = 8;\n attackPower = 25;\n defensePower = 20;\n currentSpecialPower = 50;\n maxSpecialPower = 50;\n \n }",
"@Override\n public void teleopInit() {\n /* factory default values */\n _talonL1.configFactoryDefault();\n _talonL2.configFactoryDefault();\n _talonR1.configFactoryDefault();\n _talonR2.configFactoryDefault();\n\n /* flip values so robot moves forward when stick-forward/LEDs-green */\n _talonL1.setInverted(true); // <<<<<< Adjust this\n _talonL2.setInverted(true); // <<<<<< Adjust this\n _talonR1.setInverted(true); // <<<<<< Adjust this\n _talonR2.setInverted(true); // <<<<<< Adjust this\n\n\n /*\n * WPI drivetrain classes defaultly assume left and right are opposite. call\n * this so we can apply + to both sides when moving forward. DO NOT CHANGE\n */\n _drive.setRightSideInverted(true);\n }",
"@Override\r\n\t\t\tpublic void speed(Double speed) {\n\t\t\t\tSystem.out.println(\"defining when object initciated\");\r\n\t\t\t}",
"public LearningOptions(double errorThreshold, double learningRate, double momentum, double characteristicTime,\n double maxNumberOfEpochs) {\n this.errorThreshold = errorThreshold;\n this.learningRate = learningRate;\n this.momentum = momentum;\n this.characteristicTime = characteristicTime;\n this.maxNumberOfEpochs = maxNumberOfEpochs;\n }",
"@Override\n protected void initialize() {\n desiredTime = System.currentTimeMillis() + (long) (seconds * 1000);\n Robot.driveTrain.configForTeleopMode();\n }",
"protected void initialize() {\n \tlogger.info(\"Starting AutoMoveLiftUp Command, encoder inches = {}\", Robot.liftSubsystem.readEncoderInInches());\n \tstartingEncoderPos = Robot.liftSubsystem.readEncoderInInches();\n \tweAreDoneSenor = false;\n \tdesiredStartingPower = getStartingPower();\n \toneFoot = getAccelDecelDistance();\n \tmaxPower = getMaxPower();\n \trequestedEncoderPos = getRequestedEndPos();\n \tslowDownPoint = requestedEncoderPos - oneFoot;\n \tspeedUpPoint = startingEncoderPos + oneFoot;\n }",
"@Override\n public void init(double pNow) {\n if(mTargetHeading == null) {\n mTargetHeading = Rotation2d.fromDegrees(mData.imu.get(EGyro.YAW_DEGREES));\n }\n mInitialDistance = getAverageDriveDistance();\n mLastTime = pNow;\n\n mHeadingController.setContinuous(true);\n mHeadingController.setOutputRange(-1.0, 1.0);\n mHeadingController.reset();\n }",
"@Override\r\n\tpublic void init() {\n\t\tif (target!=null)\r\n\t\t\ttry{\r\n\t\t\t\twriter.write(target.state.getSpeed()+\"\\t\\t\"+target.state.getRPM()+\"\\t\\t\");\r\n\t\t\t\t//System.out.println(target.state.getRPM());\r\n\t\t\t} catch (Exception e){\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t}",
"public void setMaxSpeed(int maxSpeed) {\n\t\tthis.maxSpeed = maxSpeed;\n\t}",
"public void init() {\n robot.init(hardwareMap);\n robot.liftUpDown.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftRotate.setMode(DcMotor.RunMode.RUN_USING_ENCODER);\n robot.liftRotate.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot.liftUpDown.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n robot.blinkinLedDriver.setPattern(RevBlinkinLedDriver.BlinkinPattern.GREEN);\n\n }",
"public EngineClass()\n {\n cyl = 10;\n fuel = new String( BATT );\n }",
"protected void initialize() {\n Timer.delay(7);\n ballIntake.turnOnHorizontalConveyor();\n ballIntake.verticalConveyor.set(-.3);\n }",
"@Override\n public void init() {\n robot.init(hardwareMap, telemetry, false);\n //robot.resetServo();\n telemetry.addData(\"Status\", \"Initialized\");\n telemetry.addData(\"Status\", \"Initialized\");\n // robot.FL.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // robot.FR.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // robot.BL.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n // robot.BR.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);\n\n }",
"@Override \n public void init() {\n intakeLeft = hardwareMap.crservo.get(\"intakeLeft\");\n intakeRight = hardwareMap.crservo.get(\"intakeRight\");\n topLeft = hardwareMap.servo.get(\"topLeft\");\n bottomLeft = hardwareMap.servo.get(\"bottomRight\");\n topRight = hardwareMap.servo.get(\"topRight\");\n bottomRight = hardwareMap.servo.get(\"bottomRight\");\n lift = hardwareMap.dcMotor.get(\"lift\");\n }",
"public static void init() {\n // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n drivetrainSpeedController1 = new CANTalon(1);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 1\", (CANTalon) drivetrainSpeedController1);\n \n drivetrainSpeedController2 = new CANTalon(2);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController2);\n drivetrainSpeedController3 = new CANTalon(3);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController3);\n drivetrainSpeedController4 = new CANTalon(4);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController4);\n drivetrainSpeedController5 = new CANTalon(5);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController5);\n drivetrainSpeedController6 = new CANTalon(6);\n LiveWindow.addActuator(\"Drivetrain\", \"Speed Controller 2\", (CANTalon) drivetrainSpeedController6);\n \n drivetrainRobotDrive21 = new RobotDrive(drivetrainSpeedController1, drivetrainSpeedController2, drivetrainSpeedController3, drivetrainSpeedController4, drivetrainSpeedController5, drivetrainSpeedController6);\n \n drivetrainRobotDrive21.setSafetyEnabled(true);\n drivetrainRobotDrive21.setExpiration(0.1);\n drivetrainRobotDrive21.setSensitivity(0.5);\n drivetrainRobotDrive21.setMaxOutput(1.0);\n\n\n // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS\n }",
"public PotatoPower() {\r\n\t\t//pos5 = .975; //Low Bar and Boulder Pickup\r\n\t\t//pos9 = 1.484; //Low Goal Shoot\r\n\t\t//pos12 = 1.770; //High Goal Shoot\r\n\t\t//pos7 = 2.347; //Scale and Human Station\r\n\t\t//pos3 = 0; //Stop Motor\r\n\t\t//m5stopRange = 0.001; // range above and below set point to allow\r\n\t\t// for over or under when motor is moving faster\r\n\t\t\t// than we are reading the sting pot\r\n\t\tgoBall= false;\r\n\t\t//inAuto = false;\r\n\t}",
"protected void initialize() {\n \tsetTimeout(0.0);\n \t\n \tRobot.vision_.setTargetSnapshot(null);\n \t\n \tpreviousTargetTransform = Robot.vision_.getLatestGearLiftTargetTransform();\n \tRobot.vision_.startGearLiftTracker(trackerFPS_);\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 Light(){\n this(0.0, 0.0, 0.0);\n }",
"public PeakSpeedFragment() {\n }",
"private Tube(final int height) {\n this.height = height;\n position = WIDTH;\n passed = false;\n }",
"public Warlock() {\n name = \"\";\n className = \"\";\n currentHealth = 0;\n strength = 0;\n defense = 0;\n special = 0;\n points = 0;\n }",
"@Override\n public void init() {\n telemetry.addData(\"Status\", \"Initialized Interative TeleOp Mode\");\n telemetry.update();\n\n // Initialize the hardware variables. Note that the strings used here as parameters\n // to 'get' must correspond to the names assigned during the robot configuration\n // step (using the FTC Robot Controller app on the phone).\n leftDrive = hardwareMap.dcMotor.get(\"leftDrive\");\n rightDrive = hardwareMap.dcMotor.get(\"rightDrive\");\n armMotor = hardwareMap.dcMotor.get(\"armMotor\");\n\n leftGrab = hardwareMap.servo.get(\"leftGrab\");\n rightGrab = hardwareMap.servo.get(\"rightGrab\");\n colorArm = hardwareMap.servo.get(\"colorArm\");\n leftTop = hardwareMap.servo.get(\"leftTop\");\n rightTop = hardwareMap.servo.get(\"rightTop\");\n\n /*\n left and right drive = motion of robot\n armMotor = motion of arm (lifting the grippers)\n extendingArm = motion of slider (used for dropping the fake person)\n left and right grab = grippers to get the blocks\n */\n\n }",
"public void setMaxSpeed(double value) {\n super.setMaxSpeed(value);\n }",
"public static void init(){\r\n CommandBase.magazine.setSpeed(0.0);\r\n CommandBase.loader.setSpeed(0.0);\r\n Init.manualTankDrive.start(); \r\n Init.runCompressor.start();\r\n Init.stopGyroDrift.start();\r\n \r\n }",
"public Arm() {\n initializeLogger();\n initializeCurrentLimiting();\n setBrakeMode();\n encoder.setDistancePerPulse(1.0/256.0);\n lastTimeStep = Timer.getFPGATimestamp();\n }",
"public Melee(ScrGame game, Player player){\n super();\n this.game = game;\n this.player = player;\n isPlayer = true;\n\n nSpray = 0;\n nShotsPerFire = 1;\n nAmmo = 1;\n nAmmoMax = nAmmo;\n }",
"@Override\n protected void initialize() {\n m_oldTime = Timer.getFPGATimestamp();\n m_oldError= m_desiredDistance;\n }",
"@Override\n public void init() {\n robot = new MecanumBotHardware(true,true,true,true);\n robot.init(hardwareMap);\n int deg180=845;\n // Create the state machine and configure states.\n smDrive = new StateMachine(this, 16);\n smDrive.addStartState(new WaitState(\"wait\",0.1,\"MainDriveTeleop\"));\n smDrive.addState(new GigabyteTeleopDriveState(\"MainDriveTeleop\", robot));\n smDrive.addState(new SpinPose(\"90DegSpin\",(int)(deg180*0.5),robot,0.1f));\n smDrive.addState(new SpinPose(\"180DegSpin\",deg180,robot,0.1f));\n smDrive.addState(new SpinPose(\"270DegSpin\",(int)(deg180*1.5),robot,0.1f));\n\n smArm = new StateMachine(this, 16);\n smArm.addStartState(new WaitState(\"wait\",0.1,\"MainArmTeleop\"));\n smArm.addState(new GigabyteTeleopArmState(\"MainArmTeleop\", robot));\n smArm.addState(new ShoulderPose(\"Pose1\", robot,0, \"MainArmTeleop\"));//0.12\n smArm.addState(new ShoulderPose(\"Pose2\", robot,1079, \"MainArmTeleop\"));//0.05\n smArm.addState(new ShoulderPose(\"Pose3\", robot,2602, \"MainArmTeleop\"));//-0.17\n smArm.addState(new ShoulderPose(\"Pose4\", robot,3698, \"MainArmTeleop\" ));//-0.35\n // Init the state machine\n smDrive.init();\n smArm.init();\n }",
"@Override\n public void init() {\n telemetry.addData(\">\", \"Initializing...\");\n telemetry.update();\n\n // Sensors\n gyro = new Gyro(hardwareMap, \"gyro\");\n if (!gyro.isAvailable()) {\n telemetry.log().add(\"ERROR: Unable to initalize gyro\");\n }\n\n // Drive motors\n tank = new WheelMotorConfigs().init(hardwareMap, telemetry);\n tank.stop();\n\n // Vuforia\n vuforia = new VuforiaFTC(VuforiaConfigs.AssetName, VuforiaConfigs.TargetCount,\n VuforiaConfigs.Field(), VuforiaConfigs.Bot());\n vuforia.init();\n\n // Wait for the game to begin\n telemetry.addData(\">\", \"Ready for game start\");\n telemetry.update();\n }",
"public void setAltitude(double altitude) {\n this.altitude = altitude;\n }",
"public Hoverboard(){\n this.setName(\"Hoverboard\");\n this.setCost(200);\n }",
"public double getMaxSpeed() {\r\n return maxSpeed;\r\n }",
"@Override\n public void robotInit() {\n\n // Motor controllers\n leftMotor = new CANSparkMax(1, MotorType.kBrushless);\n leftMotor.setInverted(false);\n leftMotor.setIdleMode(IdleMode.kBrake);\n\n CANSparkMax leftSlave1 = new CANSparkMax(2, MotorType.kBrushless);\n leftSlave1.setInverted(false);\n leftSlave1.setIdleMode(IdleMode.kBrake);\n leftSlave1.follow(leftMotor);\n\n CANSparkMax leftSlave2 = new CANSparkMax(3, MotorType.kBrushless);\n leftSlave2.setInverted(false);\n leftSlave2.setIdleMode(IdleMode.kBrake);\n leftSlave2.follow(leftMotor);\n\n rightMotor = new CANSparkMax(4, MotorType.kBrushless);\n rightMotor.setInverted(false);\n rightMotor.setIdleMode(IdleMode.kBrake);\n\n CANSparkMax rightSlave1 = new CANSparkMax(5, MotorType.kBrushless);\n rightSlave1.setInverted(false);\n rightSlave1.setIdleMode(IdleMode.kBrake);\n rightSlave1.follow(leftMotor);\n\n CANSparkMax rightSlave2 = new CANSparkMax(6, MotorType.kBrushless);\n rightSlave2.setInverted(false);\n rightSlave2.setIdleMode(IdleMode.kBrake);\n rightSlave2.follow(leftMotor);\n\n // Encoders\n leftEncoder = leftMotor.getEncoder();\n rightEncoder = rightMotor.getEncoder();\n\n // Gyro\n gyro = new ADXRS450_Gyro();\n\n }",
"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 BaseConfig() {\n\t\tlong current = System.currentTimeMillis();\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTimeInMillis(current);\n\t\tthis.start_hours = cal.get(Calendar.HOUR_OF_DAY);\n\t\tthis.start_minutes = cal.get(Calendar.MINUTE);\n\t\tthis.stop_hours = this.start_hours;\n\t\tthis.stop_minutes = this.start_minutes;\n\t\tthis.force_on = false;\n\t\tthis.force_off = false;\n\t\tthis.sensor_type = SensorType.LIGHT;\n\t\tthis.sensing_threshold = .5f;\n\t\tthis.sensorInterval = 3000;\n\t\t/*String address;\n\t\ttry {\n\t\t\taddress = InetAddress.getLocalHost().toString();\n\t\t\taddress = address.substring(address.indexOf('/') + 1);\n\t\t\tserverIP = address;\n\t\t\tserverPort = 9999;\n\t\t} catch (UnknownHostException e) {\n\t\t\t// Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}*/\n\t\t\n\t}",
"@Override\n\tpublic void robotInit() {\n\t\tm_chooser.setDefaultOption(\"Default Auto\", kDefaultAuto);\n\t\tm_chooser.addOption(\"My Auto\", kCustomAuto);\n\t\tSmartDashboard.putData(\"Auto choices\", m_chooser);\n\n\t\tm_frontRight = new PWMVictorSPX(0);\n\t\tm_frontLeft = new PWMVictorSPX(2);\n\t\tm_backRight = new PWMVictorSPX(1);\n\t\tm_backLeft = new PWMVictorSPX(3);\n\n\t\tx_aligning = false;\n\n\t\tJoy = new Joystick(0);\n\t\tmyTimer = new Timer();\n\n\t\tfinal SpeedControllerGroup m_left = new SpeedControllerGroup(m_frontLeft, m_backLeft);\n\t\tfinal SpeedControllerGroup m_right = new SpeedControllerGroup(m_frontRight, m_backRight);\n\n\t\tm_drive = new DifferentialDrive(m_left, m_right);\n\n\t\tdistanceToTarget = 0;\n\n\t\tcounter = new Counter(9);\n\t\tcounter.setMaxPeriod(10.0);\n\t\tcounter.setSemiPeriodMode(true);\n\t\tcounter.reset();\n\t}",
"public Lift (SpeedController liftMotor, DigitalInput lowerLimit, DigitalInput upperLimit) {\n m_liftMotor = liftMotor;\n m_lowerLimit = lowerLimit;\n m_upperLimit = upperLimit;\n }",
"private SpeedSliderListener()\n {\n }",
"public void setWalkSpeed(int n)\n{\n walkSpeed = n;\n}",
"public Enemy(int startMaxHealth, int startWalkSpeed, int startSprintSpeed, Weapon startWeapon, int startBaseContactDamage, int startBaseFieldOfView, int startBaseSightDistance, List<PassiveItem> startPassiveEffects, String characterName, String characterDescription)\n\t{\n\t\tsuper(characterName, characterDescription);\n\t\t\n\t\tmaxHealth = startMaxHealth;\n\t\tcurrentHealth = startMaxHealth;\n\t\t\n\t\tsprintSpeed = startSprintSpeed;\n\t\twalkSpeed = startWalkSpeed;\n\t\t\n\t\tweapon = startWeapon;\n\t\t\n\t\tbaseContactDamage = startBaseContactDamage;\n\t\t\n\t\tbaseFieldOfView = startBaseFieldOfView;\n\t\t\n\t\tbaseSightDistance = startBaseSightDistance;\n\t\t\n\t\tpassiveEffects = startPassiveEffects;\n\t}",
"public Troop() //make a overloaded constructor \n\t{\n\t\ttroopType = \"light\"; \n\t\tname = \"Default\";\n\t\thp = 50;\n\t\tatt = 20;\n\t}",
"public Commands(){\n this.power = 0;\n this.direction = 0;\n this.started = false;\n this.runTime = new ElapsedTime();\n this.timeGoal = 0;\n }"
] | [
"0.6157273",
"0.6139808",
"0.59566545",
"0.5918888",
"0.587895",
"0.5853852",
"0.5846449",
"0.58395666",
"0.58141947",
"0.5780429",
"0.57768613",
"0.5774207",
"0.57531285",
"0.57488364",
"0.57384956",
"0.5716925",
"0.57047194",
"0.56828445",
"0.56499946",
"0.5644313",
"0.56305546",
"0.5623117",
"0.5612269",
"0.55784667",
"0.5575003",
"0.5568471",
"0.55678725",
"0.55552286",
"0.5536422",
"0.55187887",
"0.55152017",
"0.5511617",
"0.5510862",
"0.550841",
"0.55039",
"0.5495834",
"0.5489703",
"0.5488497",
"0.547948",
"0.546596",
"0.5460465",
"0.5438603",
"0.5430578",
"0.54285103",
"0.54172283",
"0.5407205",
"0.5380978",
"0.53763205",
"0.5374545",
"0.5372542",
"0.5370437",
"0.5364612",
"0.5349495",
"0.5347474",
"0.5339916",
"0.53375036",
"0.53345495",
"0.5324583",
"0.5320996",
"0.53175724",
"0.53097916",
"0.53024167",
"0.5296715",
"0.5294814",
"0.52928454",
"0.5286939",
"0.5285878",
"0.5285163",
"0.527752",
"0.52774096",
"0.52722543",
"0.5266711",
"0.52537817",
"0.52458274",
"0.524327",
"0.5242772",
"0.5240825",
"0.5235754",
"0.52347314",
"0.5231869",
"0.5231164",
"0.5219505",
"0.5215991",
"0.5210516",
"0.5209133",
"0.5207731",
"0.52066845",
"0.5206134",
"0.5197073",
"0.5196181",
"0.51952696",
"0.5182615",
"0.51807934",
"0.5180675",
"0.51741207",
"0.5173613",
"0.51734024",
"0.51716745",
"0.51701456",
"0.51676065"
] | 0.8498425 | 0 |
HoverBot overrides sendData to avoid becoming an abstract class. | public void sendData() {
// HoverBot specific implementation of sendData method
System.out.println("Sending location information...");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void send(Object data) {\n\t\t//do nothing - override to do something\n\t}",
"@Override\n\tpublic void sendData(CharSequence data) {\n\t\t\n\t}",
"@Override\n\tpublic void sendData(int type, byte[] data) {\n\t\t\n\t}",
"protected void sendDataToRobot(byte[] data) {\n\t\thandler.sendData(data);\n\t}",
"private void sendData() {\n final ByteBuf data = Unpooled.buffer();\n data.writeShort(input);\n data.writeShort(output);\n getCasing().sendData(getFace(), data, DATA_TYPE_UPDATE);\n }",
"void sendData() throws IOException\n\t{\n\t}",
"@Override\n public void send(String key, String data) throws IOException {\n\n }",
"public void send(byte[] data) throws IOException {\n dataOutput.write(data);\n dataOutput.flush();\n }",
"@ReactMethod\n public void send(ReadableArray data) {\n byte[] payload = new byte[data.size()];\n for (int i = 0; i < data.size(); i++) {\n payload[i] = (byte)data.getInt(i);\n }\n\n long maxSize = chirpConnect.maxPayloadLength();\n if (maxSize < payload.length) {\n onError(context, \"Invalid payload\");\n return;\n }\n ChirpError error = chirpConnect.send(payload);\n if (error.getCode() > 0) {\n onError(context, error.getMessage());\n }\n }",
"protected final boolean send(final Object data) {\n\t\t// enviamos los datos\n\t\treturn this.send(data, null);\n\t}",
"public void sendData(byte[] data) {\r\n\t\t//send packet\r\n\t\ttry {\r\n\t\t\tout.write(data);\r\n\t\t} catch(IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public boolean sendData(String data) throws IOException;",
"public void sendData(String data) {// send data\n\t\tthis.data = data;\n\t\tthis.start();// spin up a new thread to send data\n\t}",
"public abstract void SendData(int sock, String Data) throws LowLinkException, TransportLayerException, CommunicationException;",
"@Override\n\tpublic void EmergencySend(byte[] data) {\n\t\t\n\t}",
"public abstract void send(String data, String toAddress);",
"public abstract boolean send(byte[] data);",
"public void sendData(String data) {\n\t\tIoBuffer buf = IoBuffer.allocate(data.getBytes().length + 10);\n\t\tbuf.put(data.getBytes());\n\t\tbuf.put((byte)0x00);\n\t\tbuf.flip();\n\t\tsendData(buf);\n\t}",
"private void sendData(String data) {\n\n if (!socket.isConnected() || socket.isClosed()) {\n Toast.makeText(getApplicationContext(), \"Joystick is disconnected...\",\n Toast.LENGTH_LONG).show();\n return;\n }\n\n\t\ttry {\n\t\t\tOutputStream outputStream = socket.getOutputStream();\n\n byte [] arr = data.getBytes();\n byte [] cpy = ByteBuffer.allocate(arr.length+1).array();\n\n for (int i = 0; i < arr.length; i++) {\n cpy[i] = arr[i];\n }\n\n //Terminating the string with null character\n cpy[arr.length] = 0;\n\n outputStream.write(cpy);\n\t\t\toutputStream.flush();\n\n Log.d(TAG, \"Sending data \" + data);\n\t\t} catch (IOException e) {\n Log.e(TAG, \"IOException while sending data \"\n + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t} catch (NullPointerException e) {\n Log.e(TAG, \"NullPointerException while sending data \"\n + e.getMessage());\n\t\t}\n\t}",
"public void sendData(IoBuffer outData) {\n\t\ttry {\n\t\t\tsession.write(outData);\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public abstract void sendData(Float data, int dataType);",
"public void send(byte[] data) {\n final Payload payload = new Payload(OPCODE_BINARY, data);\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n webSocketConnection.sendInternal(payload);\n }\n }).start();\n }",
"public void send( String data ) {\n SendRunnable sendRunnable = new SendRunnable( data );\n Thread sendThread = new Thread( sendRunnable );\n sendThread.start();\n }",
"public void send() {\n\t}",
"public boolean sendData(String data, String prefix) throws IOException;",
"public void sendData(byte[] data) {\n\t\tIoBuffer buf = IoBuffer.allocate(data.length + 10);\n\t\tbuf.put(data);\n\t\tbuf.flip();\n\t\tsendData(buf);\n\t}",
"private static void sendDataMessage() {\r\n\t\tSystem.out.println(\"CLIENT: \" + \" \" + \"DataMessage sent.\");\r\n\t\t\r\n\t\tbyte[] blockNumberAsByteArray = helper.intToByteArray(blockNumberSending);\r\n\t\tsplitUserInput = helper.divideArray(userInputByteArray);\r\n\r\n\t\tsendData = message.dataMessage(blockNumberAsByteArray, splitUserInput[sendingPackageNumber]);\r\n\t\tsendingPackageNumber++;\r\n\t\tblockNumberSending++; // blocknumber that is given to the next message to be transmitted\r\n\r\n\t\t// trims the message (removes empty bytes), so the last message can be detected\r\n\t\ttrimmedSendData = helper.trim(sendData);\r\n\r\n\t\tsendDataMessage = new DatagramPacket(trimmedSendData, trimmedSendData.length, ipAddress, SERVER_PORT);\r\n\t\ttry {\r\n\t\t\tclientSocket.send(sendDataMessage);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\tackNeeded = true;\r\n\r\n\t\tif (trimmedSendData.length < 516) {\r\n\t\t\tlastPackage = true;\r\n\t\t}\r\n\t}",
"public void sendData(String data, int numCapteur);",
"public void send(Opcode opcode, Serializable datum);",
"public void sendPlayerData() throws JSONException {\n\t\tJSONObject json = new JSONObject();\n\t\tJSONObject json2 = new JSONObject();\n\t\tjson2.put(\"Name\", playerModel.getPlayerName());\n\n\t\tswitch (playerModel.getPlayerColor()) {\n\n\t\tcase PL_BLUE:\n\t\t\tjson2.put(\"Farbe\", \"Blau\");\n\t\t\tbreak;\n\t\tcase PL_RED:\n\t\t\tjson2.put(\"Farbe\", \"Rot\");\n\t\t\tbreak;\n\t\tcase PL_WHITE:\n\t\t\tjson2.put(\"Farbe\", \"Weiß\");\n\t\t\tbreak;\n\t\tcase PL_YELLOW:\n\t\t\tjson2.put(\"Farbe\", \"Orange\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\n\t\t}\n\t\tjson.put(\"Spieler\", json2);\n\t\tlog.info(playerModel + \" verschickt\");\n\t\tcontroller.getClient().send(json);\n\t}",
"public void sendMsg(){\r\n\t\tsuper.getPPMsg(send);\r\n\t}",
"@Override\n public void stream(T data) {\n channel.write(new DataMessage<>(data));\n }",
"protected final synchronized boolean send(final Object data, final Commands overWrite) {\n\t\ttry {\n\t\t\t// verificamos si la conexion esta cerrada\n\t\t\tif (this.getConnection().isClosed())\n\t\t\t\t// retornamos false\n\t\t\t\treturn false;\n\t\t\t// mostramos un mensaje\n\t\t\tthis.getLogger().debug((data instanceof Commands || overWrite != null ? \"<<= \" : \"<<< \") + (overWrite != null ? overWrite : data));\n\t\t\t// verificamos si es un comando\n\t\t\tif (!this.getLocalStage().equals(Stage.POST) && data instanceof Commands || overWrite != null)\n\t\t\t\t// almacenamos el ultimo comando enviado\n\t\t\t\tthis.lastCommand = overWrite != null ? overWrite : (Commands) data;\n\t\t\t// enviamos el dato\n\t\t\tthis.getOutputStream().writeObject(data);\n\t\t\t// escribimos el dato\n\t\t\tthis.getOutputStream().flush();\n\t\t} catch (final IOException e) {\n\t\t\t// mostramos el trace\n\t\t\tthis.getLogger().error(e);\n\t\t\t// retornamos false\n\t\t\treturn false;\n\t\t}\n\t\t// retornamos true\n\t\treturn true;\n\t}",
"@Override\n\tpublic void send(OutputStream stream) throws IOException {\n\t\tstream.write(this.data);\n\t}",
"@Override\n\tpublic void directSend(String exchange, String routeKey, Object data) {\n\n\t}",
"public boolean send(NetData data)\n {\n writer.println(data.toString());\n xMessenger.miniMessege(\">>>\"+ data.toString());\n return true;\n }",
"@Override\n\tpublic void sendMessage() {\n\t\t\n\t}",
"public void send_data(int curr_portNo, String data_send) {\n\t\ttry {\n\t\t\tSocket baseSocket = new Socket(Content_Provider.ipAdd, curr_portNo);\n\t\t\tPrintWriter toPeer = new PrintWriter(new BufferedWriter(\n\t\t\t\t\tnew OutputStreamWriter(baseSocket.getOutputStream())), true);\n\t\t\ttoPeer.println(data_send);\n\t\t\tbaseSocket.close();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"private void ipcSend(JSONObject data) {\n JSONObject json = data;\n try {\n json.put(IPC_MESSAGE_APPID, mAppId);\n\n if (mIpcChannel != null) {\n log.e(\"ipcSend:[\" + json.toString() + \"]\");\n\n mIpcChannel.send(json.toString());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"void send(ByteBuffer data) throws CCommException, IllegalStateException;",
"private void sendData(String data) {\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"Sending data: '\" + data + \"'\");\n\n\t\t\t\t// open the streams and send the \"y\" character\n\t\t\t\toutput = serialPort.getOutputStream();\n\t\t\t\toutput.write(data.getBytes());\n\t\t\t} catch (Exception e) {\n\t\t\t\tSystem.err.println(e.toString());\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\n\t\t}",
"public void send(final String data) throws IOException {\r\n\t\t//Writes the packet as a byte buffer, using the data from the packet and converting in to bytes\r\n\t\t//Adds an end-of-packet footer to the data\r\n\t\tif(channel.isConnected()) {\r\n\t\t\tchannel.write(ByteBuffer.wrap((data + \"%EOP%\").getBytes()));\r\n\t\t}\r\n\t}",
"private void writeData(String data) {\n try {\n outStream = btSocket.getOutputStream();\n } catch (IOException e) {\n }\n\n String message = data;\n byte[] msgBuffer = message.getBytes();\n\n try {\n outStream.write(msgBuffer);\n } catch (IOException e) {\n }\n }",
"@Override\n public void send(final EventData data) {\n LOGGER.debug(\"async event {} sent via vert.x EventBus\", data.getData().ret$PQON());\n if (bus != null) {\n final EventParameters attribs = data.getData();\n if (attribs instanceof GenericEvent genericEvent) {\n bus.send(toBusAddress(genericEvent.getEventID()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n } else {\n bus.send(toBusAddress(attribs.ret$PQON()), data, ASYNC_EVENTBUS_DELIVERY_OPTIONS);\n }\n } else {\n LOGGER.error(\"event bus is null - discarding event {}\", data.getData().ret$PQON());\n }\n }",
"@Override\n\tpublic void send(String msg) {\n\t\t\n\t\t\n\t\n\t}",
"@Override\n\tpublic void send(String msg) {\n\t}",
"protected void sendResultMessage(Object data) {\n EventBus.getDefault().post(data);\n }",
"abstract public void sendData(Account account, SyncResult syncResult) throws Exception;",
"@Override\n public boolean sendData(Activity activity, byte[] data) {\n String dataAsBase64 = ByteConverter.encodeAsBase64String(data);\n shareBarcode(activity, dataAsBase64);\n ProtocolMessage protocolMessage = new ProtocolMessage(MessageOrigin.SELF, data);\n notifyDaemonAboutSentData(protocolMessage, true);\n return true;\n }",
"public void SendData(final String data) throws ClientIsDisconnectedException, OutgoingPacketFailedException\n {\n final byte[] bytes = data.getBytes(fMyListener.getCharset());\n SendData(bytes, 0, bytes.length);\n }",
"@Override\n public void send(final EventData data) {\n LOGGER.debug(\"async event {} sent via LocalAsyncProcessor\", data.getData().ret$PQON());\n LOGGER.debug(\"(currently events are discarded in localtests)\");\n }",
"void send();",
"@Override\n public void send(byte[] data) throws SocketException {\n DatagramPacket sendPacket = new DatagramPacket(\n data,\n data.length,\n this.lastClientIPAddress,\n this.lastClientPort);\n try {\n serverSocket.send(sendPacket);\n } catch (IOException ex) {\n Logger.getLogger(UDPServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Override\n public synchronized void send(byte[] data) throws SocketException {\n try {\n connectionSocket.getOutputStream().write(data);\n connectionSocket.getOutputStream().flush();\n connectionSocket.close();\n } catch (IOException ex) {\n Logger.getLogger(TCPServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Override\n\tpublic void send() {\n\t\tSystem.out.println(\"this is send\");\n\t}",
"public void sendPacket(String data) throws IOException {\n\n BufferedWriter out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));\n out.write(data + \"\\0\");\n out.flush();\n }",
"public void sendRemainData();",
"public void sendPing(byte[] data) {\n final Payload payload = new Payload(OPCODE_PING, data);\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n webSocketConnection.sendInternal(payload);\n }\n }).start();\n }",
"void send(ByteBuffer data, Address addr) throws CCommException, IllegalStateException;",
"public void send(final byte[] data) {\n\t\tsend = new Thread(\"Send\") {\n\t\t\t// anaonymous class prevents us from making new class that implemtents Runnable\n\t\t\tpublic void run(){\n\t\t\t\tDatagramPacket packet = new DatagramPacket(data,data.length, ip, port);\n\t\t\t\ttry {\n\t\t\t\t\tsocket.send(packet);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t};\n\t\tsend.start();\n\t}",
"void sendData(String msg) throws IOException\n {\n if ( msg.length() == 0 ) return;\n//\n msg += \"\\n\";\n// Log.d(msg, msg);\n if (outputStream != null)\n outputStream.write(msg.getBytes());\n// myLabel.setText(\"Data Sent\");\n// myTextbox.setText(\" \");\n }",
"default void sendBinary(byte[] data) {\n ByteBuffer buffer = ByteBuffer.wrap(data);\n sendBinary(buffer);\n }",
"private static void sendData(Plugin plugin, JsonObject data) throws Exception {\n if (data == null) {\n throw new IllegalArgumentException(\"Data cannot be null!\");\n }\n if (Server.getInstance().isPrimaryThread()) {\n throw new IllegalAccessException(\"This method must not be called from the main thread!\");\n }\n if (logSentData) {\n plugin.getLogger().info(\"Sending data to bStats: \" + data);\n }\n HttpsURLConnection connection = (HttpsURLConnection) new URL(URL).openConnection();\n \n // Compress the data to save bandwidth\n byte[] compressedData = compress(data.toString());\n \n // Add headers\n connection.setRequestMethod(\"POST\");\n connection.addRequestProperty(\"Accept\", \"application/json\");\n connection.addRequestProperty(\"Connection\", \"close\");\n connection.addRequestProperty(\"Content-Encoding\", \"gzip\"); // We gzip our request\n connection.addRequestProperty(\"Content-Length\", String.valueOf(compressedData.length));\n connection.setRequestProperty(\"Content-Type\", \"application/json\"); // We send our data in JSON format\n connection.setRequestProperty(\"User-Agent\", \"MC-Server/\" + B_STATS_VERSION);\n \n // Send data\n connection.setDoOutput(true);\n try (DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream())) {\n outputStream.write(compressedData);\n }\n \n StringBuilder builder = new StringBuilder();\n try (BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n builder.append(line);\n }\n }\n \n if (logResponseStatusText) {\n plugin.getLogger().info(\"Sent data to bStats and received response: \" + builder);\n }\n }",
"@Override\r\n\tpublic void send() throws Exception {\n\t\t\r\n\t}",
"public void sendCommand(Command cmd);",
"public void postData()\n\t{\n\t\tnew NetworkingTask().execute(message);\n\t}",
"@Override\r\n public void onSendTcp(Object obj) {\n mNetworkManager.sendTCPData(obj);\r\n }",
"void send(SftpDatagram head,byte[] data){\r\n\t\tdata_send = data;\r\n\t\t//first send the first one\r\n\t\ttotal_datagrams = 1;\r\n\t\tcovered_datagrams++;\r\n\t\thead.send_datagram();\r\n\t\tput_and_set_timer(head);\r\n\t\t//sending\r\n\t\tif(data_send != null){\r\n\t\t\tlong size = data_send.length;\r\n\t\t\tif(size != 0)\r\n\t\t\t\ttotal_datagrams = (int)((size+BLOCK_SIZE-1) / BLOCK_SIZE);\r\n\t\t}\r\n\t\t//check sendings(if not small mode)\r\n\t\tcheck_and_send();\r\n\t}",
"public void redirect(Object sendData, NodeInfo nodeInfo){\n send(sendData, nodeInfo);\n\n }",
"private void send(final String data) {\n\t\tif (null != PinPadController) {\n\t\t\tnew Thread() {\n\t\t\t\tpublic void run() {\n\t\t\t\t\tPinPadController.PINPad_sendToPinPad(data);\n\t\t\t\t};\n\t\t\t}.start();\n\t\t\tToast.makeText(this, \"send\", Toast.LENGTH_SHORT).show();\n\t\t}\n\t}",
"void doSend(Map<String, Object> parameters);",
"@Override\n\tpublic String execute() throws Exception {\n\t\treturn \"send\";\n\t}",
"public abstract void send(String message) throws IOException;",
"private void sendData() throws DataProcessingException, IOException {\n Data cepstrum = null;\n do {\n cepstrum = frontend.getData();\n if (cepstrum != null) {\n if (!inUtterance) {\n if (cepstrum instanceof DataStartSignal) {\n inUtterance = true;\n dataWriter.writeDouble(Double.MAX_VALUE);\n dataWriter.flush();\n } else {\n throw new IllegalStateException\n (\"No DataStartSignal read\");\n }\n } else {\n if (cepstrum instanceof DoubleData) {\n // send the cepstrum data\n double[] data = ((DoubleData) cepstrum).getValues();\n for (double val : data) {\n dataWriter.writeDouble(val);\n }\n } else if (cepstrum instanceof DataEndSignal) {\n // send a DataEndSignal\n dataWriter.writeDouble(Double.MIN_VALUE);\n inUtterance = false;\n } else if (cepstrum instanceof DataStartSignal) {\n throw new IllegalStateException\n (\"Too many DataStartSignals.\");\n }\n dataWriter.flush();\n }\n }\n } while (cepstrum != null);\n }",
"public void sendData(byte[] data) {\n\t\tDatagramPacket packet = new DatagramPacket(data, data.length, ipAddress, serverPort);\n\n\t\ttry {\n\t\t\tsocket.send(packet);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"void sendJson(Object data);",
"public void send() {\n try {\n String message = _gson.toJson(this);\n byte[] bytes = message.getBytes(\"UTF-8\");\n int length = bytes.length;\n\n _out.writeInt(length);\n _out.write(bytes);\n \n } catch (IOException ex) {\n Logger.getLogger(ResponseMessage.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"private void sendData(String message) {\n\t\t\ttry {\n\t\t\t\toutput.writeObject(message);\n\t\t\t\toutput.flush(); // flush output to client\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"\\nError writing object\");\n\t\t\t}\n\t\t}",
"@Override\r\n public void sendData(byte[] buffer, int bytes) {\r\n try {\r\n mOutputStream.write(buffer, 0, bytes);\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error sending data on socket: \" + ioe.getMessage());\r\n cancel();\r\n mPeer.communicationErrorOccured();\r\n }\r\n }",
"@Override\n\tpublic void sendMsg(String msg) {\n\n\t}",
"@Override\n\tpublic void onPacketData(NetworkManager network, Packet250CustomPayload packet, Player player)\n\t{\n\n\t}",
"public synchronized void sendData(PrintWriter stream){\r\n\t\t\tstream.println(\"3\");\r\n\t\t\tstream.println(Integer.toString(x));\r\n\t\t\tstream.println(Integer.toString(y));\r\n\t\t\tstream.println(Integer.toString(health));\r\n\t\t\tstream.println(Integer.toString(level));\r\n\t\t}",
"@Override\n\tpublic void messageSent(IoSession arg0, Object arg1) throws Exception {\n\n\t}",
"@Override\n\tpublic void messageSent(IoSession arg0, Object arg1) throws Exception {\n\n\t}",
"public void sendEntity(Entity entity);",
"public void sendToWard(){\r\n\t\t//here is some code that we do not have access to\r\n\t}",
"@Override\n\tpublic void onNotify(EventData data) {\n\t\tEchoResponseEventData echoData = (EchoResponseEventData) data;\n\t\tSocket connection = echoData.getPacket().getConnection();\n\n\t\ttry {\n\t\t\tDataOutputStream dos = new DataOutputStream(\n\t\t\t\t\tconnection.getOutputStream());\n\t\t\tdos.writeUTF(echoData.getPacket().getMessage());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void send(Serializable msg) throws IOException;",
"private void data(Messenger replyTo, int encoderId, Bundle data) {\n\n // obtain new message\n Message message = obtainMessage(Geotracer.MESSAGE_TYPE_DATA, encoderId, 0);\n message.setData(data);\n\n // send response\n send(replyTo, message);\n }",
"public String sendDataToChildren(byte[] data) throws RemoteException;",
"public Reply sendData(InputStream... ios) throws ThingsException, InterruptedException;",
"@Override\n\tpublic void onSendChatDone(byte arg0) {\n\t\t\n\t}",
"void writeData(String messageToBeSent) {\n\n try {\n if (clientSocket != null) {\n outputStream = clientSocket.getOutputStream();\n ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream);\n objectOutputStream.writeObject(messageToBeSent);\n outputStream.flush();\n }\n\n if (getLog().isDebugEnabled()) {\n getLog().debug(\"Artifact configurations and test cases data sent to the synapse agent successfully\");\n }\n } catch (IOException e) {\n getLog().error(\"Error while sending deployable data to the synapse agent \", e);\n }\n }",
"@Override\n\tpublic void sendResponse() {\n\n\t}",
"void sendText(String content);",
"void sendChat(SendChatParam param);",
"public void sendMessage(DeployableNode node, byte[] data)\n {\n try{\n Protos.FrameworkMessage message = Protos.FrameworkMessage.newBuilder()\n .setTaskId(node.getTask().getTaskInfo().getTaskId())\n .setData(ByteString.copyFrom( data ) )\n .build();\n\n this.scheduler.sendFrameworkMessage( node, message );\n }catch (Exception e)\n {\n LOGGER.error( \"Caught exception in sendMessage: \"+e);\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void sendResponse() {\n\t\t\n\t}",
"public int sendData(String command) throws IOException\n {\n return sendCommandWithID(null, command, null);\n }",
"protected void sendDataToTraceFile(String data) {\n\t\thandler.postTraceData(data);\n\t}"
] | [
"0.761365",
"0.74460113",
"0.7118338",
"0.6948371",
"0.67079467",
"0.6626467",
"0.65825665",
"0.65797865",
"0.6557526",
"0.65166247",
"0.6489078",
"0.6485562",
"0.64753366",
"0.6461062",
"0.6344779",
"0.63343185",
"0.6333024",
"0.6313708",
"0.62999874",
"0.6278981",
"0.6269285",
"0.62654287",
"0.6231873",
"0.61985135",
"0.61962646",
"0.6187898",
"0.6168996",
"0.6166708",
"0.61659735",
"0.6159575",
"0.6152833",
"0.6152047",
"0.6150714",
"0.61322093",
"0.6129959",
"0.6120158",
"0.61105996",
"0.60810953",
"0.6070593",
"0.6061123",
"0.60444665",
"0.60074526",
"0.6006356",
"0.6004171",
"0.6003839",
"0.5983724",
"0.5983488",
"0.5971571",
"0.5941837",
"0.5940677",
"0.5916244",
"0.5911997",
"0.5908531",
"0.59031105",
"0.58943886",
"0.58917516",
"0.5880434",
"0.58593434",
"0.58451724",
"0.5829395",
"0.5811511",
"0.58096915",
"0.5808515",
"0.5807128",
"0.5806684",
"0.5798263",
"0.57865757",
"0.5782463",
"0.5778336",
"0.577686",
"0.57729405",
"0.57720274",
"0.5760114",
"0.57580703",
"0.57528603",
"0.5747827",
"0.5744438",
"0.571195",
"0.570565",
"0.5703285",
"0.5687172",
"0.56851417",
"0.5683534",
"0.5683534",
"0.56795555",
"0.5678965",
"0.567275",
"0.56517124",
"0.5651562",
"0.56491363",
"0.5645936",
"0.56439495",
"0.5641696",
"0.562812",
"0.5624895",
"0.56196874",
"0.56181866",
"0.5616462",
"0.56002706",
"0.5600124"
] | 0.7063337 | 3 |
/ Display the database information when the app starts | @Override
protected void onStart() {
super.onStart();
displayDatabaseInfo();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.viewdatabase);\n\t\tSQLiteHelper showdatabase = new SQLiteHelper(this);\n\t\tString database_returned = showdatabase.getData();\n\t\tTextView tvViewDataabase = (TextView) findViewById(R.id.tvViewDatabase);\n\t\ttvViewDataabase.setText(database_returned);\n\t}",
"@Override\n\tpublic void displayTheDatabase() {\n\t\t\n\t}",
"private void displayDatabaseInfo() {\n SQLiteDatabase db = mDbHelper.getReadableDatabase();\n\n // Define a projection that specifies which columns from the database\n // you will actually use after this query.\n String[] projection = {\n ArtistsContracts.GenderEntry._ID,\n ArtistsContracts.GenderEntry.COLUMN_ARTIST_NAME,\n ArtistsContracts.GenderEntry.COLUMN_ARTIST_GENDER};\n\n // Perform a query on the pets table\n Cursor cursor = db.query(\n ArtistsContracts.GenderEntry.TABLE_NAME, // The table to query\n projection, // The columns to return\n null, // The columns for the WHERE clause\n null, // The values for the WHERE clause\n null, // Don't group the rows\n null, // Don't filter by row groups\n null); // The sort order\n\n ListView petListView = (ListView) findViewById(R.id.list);\n\n // Setup an Adapter to create a list item for each row of pet data in the Cursor.\n AtristsCursorAdapter adapter = new AtristsCursorAdapter(this, cursor);\n\n // Attach the adapter to the ListView.\n petListView.setAdapter(adapter);\n }",
"public Database(){\n ItemBox.getLogger().info(\"[Database] protocol version \" + net.mckitsu.itembox.protocol.ItemBoxProtocol.getVersion());\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n openAndQueryDatabase();\n \n displayResultList();\n \n \n }",
"@Override\n public void onDbStarted() {\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n \n ds = new RecordsDataSource(this);\n\n ShowMain ();\n Update ();\n }",
"public void displayDatabaseInfo() {\n SQLiteDatabase db = this.getReadableDatabase();\r\n\r\n String[] projection = {\r\n StoreEntry._ID,\r\n StoreEntry.COLUMN_PRODUCT_NAME,\r\n StoreEntry.COLUMN_PRODUCT_QUANTITY,\r\n StoreEntry.COLUMN_PRODUCT_PRICE,\r\n StoreEntry.COLUMN_PRODUCT_SUPPLIER_NAME,\r\n StoreEntry.COLUMN_PRODUCT_SUPPLIER_PHONE };\r\n\r\n Cursor cursor = db.query(\r\n StoreEntry.TABLE_NAME, // The table to query\r\n projection, // The columns to return\r\n null, // The columns for the WHERE clause\r\n null, // The values for the WHERE clause\r\n null, // Don't group the rows\r\n null, // Don't filter by row groups\r\n null); // The sort order\r\n\r\n try {\r\n\r\n int idColumnIndex = cursor.getColumnIndex(StoreEntry._ID);\r\n int nameColumnIndex = cursor.getColumnIndex(StoreEntry.COLUMN_PRODUCT_NAME);\r\n\r\n while (cursor.moveToNext()) {\r\n\r\n int currentID = cursor.getInt(idColumnIndex);\r\n String currentName = cursor.getString(nameColumnIndex);\r\n\r\n Log.v(currentID + \"\", currentName + \"\");\r\n }\r\n } finally {\r\n cursor.close();\r\n }\r\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tsetContentView(R.layout.layout_con_listmain);\n\n\t\topenDB();\n\t\tgetdataFromDb();\n\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\t//\r\n\t\tsetContentView(R.layout.db_manager);\r\n\r\n\t\t//\r\n\t\tsetListeners();\r\n\t\t\r\n\t}",
"@Override\n public void onDatabaseLoaded() {}",
"private void FetchingData() {\n\t\t try { \n\t\t\t \n\t \tmyDbhelper.onCreateDataBase();\n\t \t \t\n\t \t\n\t \t} catch (IOException ioe) {\n\t \n\t \t\tthrow new Error(\"Unable to create database\");\n\t \n\t \t} \n\t \ttry {\n\t \n\t \t\tmyDbhelper.openDataBase();\n\t \t\tmydb = myDbhelper.getWritableDatabase();\n\t\t\tSystem.out.println(\"executed\");\n\t \t\n\t \t}catch(SQLException sqle){\n\t \n\t \t\tthrow sqle;\n\t \n\t \t}\n\t}",
"private void configureDB() {\n\t\tmDb = mDbHelper.getWritableDatabase();\n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.showexp);\r\n\t\tTextView tv=(TextView)findViewById(R.id.tvSQLinfo2);\r\n\t\tKeeprecord get=new Keeprecord(this);\r\n\t\tget.open();\r\n\t\tString info=get.getData2();\r\n\t\tget.close();\r\n\t\ttv.setText(info);\r\n\t}",
"private void getDatabase(){\n\n }",
"public void initDatabase(){\n CovidOpener cpHelper = new CovidOpener(this);\n cdb = cpHelper.getWritableDatabase();\n }",
"private void initDB(){\n gistHelper = new GistSQLiteHelper(mainActivity, \"GistsDB\", null, 1);\n db = gistHelper.getWritableDatabase();\n }",
"private void openDB() {\n\t\tmyDb = new DBAdapter(this);\n\t\t// open the DB\n\t\tmyDb.open();\n\t\t\n\t\t//populate the list from the database\n\t\tpopulateListViewFromDB();\n\t}",
"public void showDataBase(){\n List<Mission> missions = appDatabase.myDao().getMissions();\n\n\n String info = \"\";\n\n for(Mission mis : missions){\n int id = mis.getId();\n String name = mis.getName();\n String diffic = mis.getDifficulty();\n int pong = mis.getPoints();\n String desc = mis.getDescription();\n\n info = info+\"Id : \" + id + \"\\n\" + \"Name : \" + name + \"\\n\" + \"Difficulty : \" + diffic + \"\\n\" + \"Points : \" + pong + \"\\n\" + \"Description: \" + desc + \"\\n\\n\";\n }\n\n TextView databaseData = (TextView)getView().findViewById(R.id.DatabaseData);\n databaseData.setText(info);\n\n //Toggle visibility for the textview containing the data\n if(databaseData.getVisibility() == View.VISIBLE)\n databaseData.setVisibility(View.GONE);\n else\n databaseData.setVisibility(View.VISIBLE);\n\n }",
"@Override\n public void onCreate() {\n Thread.setDefaultUncaughtExceptionHandler(new TryMe());\n\n super.onCreate();\n\n // Write the content of the current application\n context = getApplicationContext();\n display = context.getResources().getDisplayMetrics();\n\n\n // Initializing DB\n App.databaseManager.initial(App.context);\n\n // Initialize user secret\n App.accountModule.initial();\n }",
"private void setupDatabase() {\r\n\t\tDatabaseHelperFactory.init(this);\r\n\t\tdatabase = DatabaseHelperFactory.getInstance();\r\n\t}",
"public void start(){\n dbConnector = new DBConnector();\n tables = new HashSet<String>();\n tables.add(ALGORITHMS_TABLE);\n tables.add(DATA_STRUCTURES_TABLE);\n tables.add(SOFTWARE_DESIGN_TABLE);\n tables.add(USER_TABLE);\n }",
"private void loadDatabaseSettings() {\r\n\r\n\t\tint dbID = BundleHelper.getIdScenarioResultForSetup();\r\n\t\tthis.getJTextFieldDatabaseID().setText(dbID + \"\");\r\n\t}",
"public String getDatabase();",
"public FakeDatabase() {\n\t\t\n\t\t// Add initial data\n\t\t\n//\t\tSystem.out.println(authorList.size() + \" authors\");\n//\t\tSystem.out.println(bookList.size() + \" books\");\n\t}",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t super.onCreate(savedInstanceState);\n\t setContentView(R.layout.playview);\n\t \n\t db = new DatabaseHandler(this);\n\t \n\t setSpinners();\n\t setButtons();\n\t setText();\n\t setListView();\n\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t super.onCreate(savedInstanceState);\r\n\t setContentView(R.layout.myschedule);\r\n\t this.setTitle(\"My Events\");\r\n\t \r\n\t // TODO: connect to DB\r\n\t \r\n\t}",
"private static void initializeDatabase() {\n\t\tArrayList<String> data = DatabaseHandler.readDatabase(DATABASE_NAME);\n\t\tAbstractSerializer serializer = new CineplexSerializer();\n\t\trecords = serializer.deserialize(data);\n\t}",
"@Override\n protected void onCreate(Bundle savedInstanceState) \n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_details);\n \n // Add toolbar to activity layout\n Toolbar toolbar = (Toolbar) findViewById(R.id.details_toolbar);\n setSupportActionBar(toolbar);\n toolbar.setTitleTextColor(Color.WHITE);\n \n // Open database controller\n dbManager = new DatabaseManager(this);\n\n // Get bundled ProductID\n Intent parentIntent = getIntent();\n int activeProductID = Integer.parseInt(parentIntent.getStringExtra(\"Product ID\"));\n\n // Get product data from ID\n activeProduct = dbManager.getProductByID(activeProductID);\n\n // Update layout view\n updateView();\n }",
"public void printDatabaseName(){\n Realm realm;\n if(realmConfiguration != null) {\n realm = DatabaseUtilities.buildRealm(this.realmConfiguration);\n } else {\n realm = buildRealm(context);\n }\n String str = realm.getConfiguration().getRealmFileName();\n if(!StringUtilities.isNullOrEmpty(str)){\n L.m(\"Database Name: \" + str);\n }\n }",
"public void showInfo() throws SQLException { //to show the info when the page is loaded\n \tshowInfoDump();\n \tshowInfoMatl();\n }",
"String getDatabase();",
"private void initDB() {\n dataBaseHelper = new DataBaseHelper(this);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n //initialize the database helper at each initial load of the application\n dbHelper = new TaskDBHelper(this);\n\n //initialize the list with the information from the database\n listView = (ListView)findViewById(R.id.listView);\n updateUI();\n }",
"@GetMapping(path = \"${pathInitDatabase}\", produces = MediaType.APPLICATION_JSON_VALUE)\r\n\tpublic Object feedDatabase() {\r\n\t\tlivreDAO.feed();\r\n\t\tMap<String, String> r = new HashMap<String, String>();\r\n\t\tr.put(databaseReset, \"\" + true);\r\n\t\tr.put(databaseFeed, \"\" + true);\r\n\t\tr.put(databaseNumberBooks, \"\" + livreDAO.getAllLivres().size());\r\n\r\n\t\treturn r;\r\n\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\t//\r\n\t\tsetContentView(R.layout.db_manager);\r\n\t\t\r\n\t\t//\r\n\t\tsetListeners();\r\n\r\n\t\t// TEMP\r\n//\t\tmodify_table();\r\n//\t\tString[] colNames = getColNames();\r\n//\t\tList<String> colNames = getColNames();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public DataHandlerDBMS() {\n\t\ttry {\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\");\n\t\t\tDBMS = DriverManager.getConnection(url);\n\t\t\tSystem.out.println(\"DBSM inizializzato\");\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"Errore apertura DBMS\");\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\tSystem.out.println(\"Assenza driver mySQL\");\n\t\t}\n\t}",
"private void connectDatabase(){\n }",
"DBConnect() {\n \n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n \n //The UI environment is set\n setContentView(R.layout.activity_main);\n\n //At the very first time, the database is created; then this only connect the app to it.\n applicationDB = new MyCalendarDB(this); \n if(applicationDB.getSettingByName(\"def_view\") == null)\n \tapplicationDB.addSetting(\"def_view\", \"Month\");\n if(applicationDB.getSettingByName(\"def_calendar\") == null)\n \tapplicationDB.addSetting(\"def_calendar\", \"No default\");\n defaultView = applicationDB.getSettingByName(\"def_view\");\n// actualView = applicationDB.getSettingByName(\"last_view\");\n actualCalendar = Calendar.getInstance();\n }",
"public static String getDatabase() {\r\n return database;\r\n }",
"public static String getShowDatabaseStatement() {\n return SHOW_DATABASES;\n }",
"public v_home() {\n initComponents();\n koneksi = DatabaseConnection.getKoneksi(\"localhost\", \"5432\", \"postgres\", \"posgre\", \"db_hesco\");\n showData();\n showStok();\n }",
"public void showInfoDump() throws SQLException {\n \tString sqlDump = \"SELECT * FROM dump;\";\n \tConnectionClass connectionClass = new ConnectionClass();\n\t\tConnection connection = connectionClass.getConnection();\n\t\tStatement statement = connection.createStatement();\n\t\tResultSet rs = statement.executeQuery(sqlDump);\n\t\twhile (rs.next()) {\n\t\t\tmassSelection = rs.getString(1);\n\t\t\tmassCombo.setValue(massSelection);\n\t\t\tsmokeSelection = rs.getString(2);\n\t\t\tsmokeCombo.setValue(smokeSelection);\n\t\t\tframesText.setText(rs.getString(3));\n\t\t\tdtDevcText.setText(rs.getString(4));\n\t\t}\n }",
"private void ini_SelectDB()\r\n\t{\r\n\r\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n // Set the content view for this Activity.\n setContentView(R.layout.activity_liquor_logs);\n\n // Setup support toolbar.\n Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);\n setSupportActionBar(toolbar);\n\n // Create a new RatingOps instance.\n RatingOp RatingOp= new RatingOp(this);\n\n // If we are creating this activity for the first time\n // (savedInstanceState == null) or if we are recreating this\n // activity after a configuration change (savedInstanceState\n // != null), we always want to display the current contents of\n // the SQLite database.\n try {\n RatingOp.displayAll();\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }",
"private void initDB() {\n dataBaseHelper = new DataBaseHelper(getActivity());\n }",
"DatabaseInformationFull(Database db) {\n super(db);\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView( R.layout.main );\n\n ListView list = (ListView)findViewById( R.id.ListView01 );\n\n store = new MainStore( this );\n store.add(\"Xperia\");\n store.add(\"NexusOne\");\n store.add(\"desire\");\n data = store.loadAll();\n store.close();\n \n ArrayAdapter<String> arrayAdapter\n = new ArrayAdapter<String>(this, R.layout.rowitem, data);\n\n list.setAdapter(arrayAdapter);\n }",
"public String getDatabase() {\r\n return Database;\r\n }",
"public String getDB() {\n return database;\n }",
"private void initialize() {\n if (databaseExists()) {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(mContext);\n int dbVersion = prefs.getInt(SP_KEY_DB_VER, 1);\n if (DATABASE_VERSION != dbVersion) {\n File dbFile = mContext.getDatabasePath(DBNAME);\n if (!dbFile.delete()) {\n Log.w(TAG, \"Unable to update database\");\n }\n }\n }\n if (!databaseExists()) {\n createDatabase();\n }\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.plans);\n \n dbHelper = new PlanDbAdapter(this);\n dbHelper.open();\n \n // event handlers\n View add_btn = findViewById(R.id.add_btn);\n add_btn.setOnClickListener(this);\n \n fillData();\n }",
"public MainActivity() {\n initComponents();\n conn = JavaConnect.ConnectDB();\n displayAllTable();\n\n }",
"protected void initializeDB() {\r\n try {\r\n // Load the JDBC driver\r\n // Class.forName(\"oracle.jdbc.driver.OracleDriver\");\r\n Class.forName(\"com.mysql.jdbc.Driver \");\r\n\r\n System.out.println(\"Driver registered\");\r\n\r\n // Establish connection\r\n /*Connection conn = DriverManager.getConnection\r\n (\"jdbc:oracle:thin:@drake.armstrong.edu:1521:orcl\",\r\n \"scott\", \"tiger\"); */\r\n Connection conn = DriverManager.getConnection(\r\n \"jdbc:mysql://localhost/javabook\" , \"scott\", \"tiger\");\r\n System.out.println(\"Database connected\");\r\n\r\n // Create a prepared statement for querying DB\r\n pstmt = conn.prepareStatement(\r\n \"select * from Scores where name = ?\");\r\n }\r\n catch (Exception ex) {\r\n System.out.println(ex);\r\n }\r\n }",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n \n View addFilling = findViewById(R.id.add_filling);\n addFilling.setOnClickListener(this);\n \n dbHelper = new DatabaseHelper(this);\n Cursor cursor = dbHelper.getFillings();\n startManagingCursor(cursor);\n updateStatistics(cursor);\n }",
"@Override\n\tpublic void initDemoDB() {\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 Database initDB() {\n Database db = new Database(\"dataBase.db\");\n\n// db.insertData(\"1 Dragos Dinescu dragos@yahoo.com 0744522600 Digi 10-12-2020\");\n// db.insertData(\"2 Adelina Mirea ademirea@gmail.com 0733651320 Orange 14-10-2020\");\n// db.insertData(\"3 Radu Sorostinean radusoro@gmail.com 0733723321 Digi 1-10-2020\");\n// db.insertData(\"4 Andrei Brasoveanu andreibraso@gmail.com 0732341390 Vodafone 12-11-2020\");\n return db;\n\n //db.deleteFromDB();\n //db.updateDB(\"1 alex radu radu@gmail.com 022256926 orange 10/08/2010\");\n }",
"void onConfigure(SQLiteDatabase database);",
"void onConfigure(SQLiteDatabase database);",
"public void dbConnection()\n {\n\t try {\n\t \t\tClass.forName(\"org.sqlite.JDBC\");\n // userName=rpanel.getUserName();\n String dbName=userName+\".db\";\n c = DriverManager.getConnection(\"jdbc:sqlite:database/\"+dbName);\n }\n //catch the exception\n catch ( Exception e ) \n { \n System.err.println( \"error in catch\"+e.getClass().getName() + \": \" + e.getMessage() );\n System.exit(0);\n }\n\t if(c!=null)\n\t {\n System.out.println(\"Opened database successfully\");\n\t System.out.println(c);\n createData();\n\t}\n }",
"@EventListener(ApplicationReadyEvent.class)\n\tpublic void loadData() {\n\t\tList<AppUser> allUsers = appUserRepository.findAll();\n\t\tList<Customer> allCustomers = customerRepository.findAll();\n\t\tList<Part> allPArts = partRepository.findAll();\n\n\t\tif (allUsers.size() == 0 && allCustomers.size() == 0 && allPArts.size() == 0) {\n\t\t\tSystem.out.println(\"Pre-populating the database with test data\");\n\n\t\t\tResourceDatabasePopulator resourceDatabasePopulator = new ResourceDatabasePopulator(\n\t\t\t\tfalse,\n\t\t\t\tfalse,\n\t\t\t\t\"UTF-8\",\n\t\t\t\tnew ClassPathResource(\"data.sql\"));\n\t\t\tresourceDatabasePopulator.execute(dataSource);\n\t\t}\n\t\tSystem.out.println(\"Application successfully started!\");\n\t}",
"public DatabaseGUI() {\n initComponents();\n refreshDatabaseTables();\n\n }",
"@Override\r\n public void onStart(){\r\n super.onStart();\r\n\r\n if (bd==null) { // Abrimos a base de datos para escritura\r\n bd = new BaseDatos(this);\r\n bd.sqlLiteDB = bd.getWritableDatabase();\r\n }\r\n }",
"void fillDatabase() {\n Type.type( \"FOOD\" );\n Type.type( \"HOT\" );\n Type.type( \"SNACK\" );\n }",
"@FXML\r\n\tprivate void initialize() throws SQLException {\r\n\t\tGetUserID();\r\n\t\tregUsernameField.setText(\"\");\r\n\t\tregFirstNameField.setText(\"\");\r\n\t\tregLastNameField.setText(\"\");\r\n\t\tregPhoneField.setText(\"\");\r\n\t\tregAddressField.setText(\"\");\r\n\t\tregEmailField.setText(\"\");\r\n\t\tregPassField.setText(\"\");\r\n\t\tregConfField.setText(\"\");\r\n\t\tshowList();\r\n\t}",
"public static String view() throws SQLException, ClassNotFoundException {\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\tString displayText = Display.run(conn);\n\t\tconn.close();\n\t\treturn displayText;\n\t}",
"public void initialize() {\r\n final String JDBC_DRIVER = \"org.h2.Driver\";\r\n final String DB_URL = \"jdbc:h2:./res/AnimalShelterDB\";\r\n final String USER = \"\";\r\n final String PASS;\r\n\r\n System.out.println(\"Attempting to connect to database\");\r\n try {\r\n Class.forName(JDBC_DRIVER);\r\n Properties prop = new Properties();\r\n prop.load(new FileInputStream(\"res/properties\"));\r\n PASS = prop.getProperty(\"password\");\r\n conn = DriverManager.getConnection(DB_URL, USER, PASS);\r\n stmt = conn.createStatement();\r\n System.out.println(\"Successfully connected to Animal database!\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n Alert a = new Alert(Alert.AlertType.ERROR);\r\n a.show();\r\n }\r\n startTA();\r\n }",
"DatabaseController() {\n\n\t\tloadDriver();\n\t\tconnection = getConnection(connection);\n\t}",
"private void view() {\n\n\t\ttry {\n\t\t\tString databaseUser = \"blairuser\";\n\t\t\tString databaseUserPass = \"password!\";\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tConnection connection = null;\n\t\t\tString url = \"jdbc:postgresql://13.210.214.176/test\";\n\t\t\tconnection = DriverManager.getConnection(url, databaseUser, databaseUserPass);\n//\t\t\tStatement s = connection.createStatement();\n\t\t\ts = connection.createStatement();\n\t\t\tResultSet rs = s.executeQuery(\"select * from account;\");\n\t\t\t// while (rs.next()) {\n\t\t\tString someobject = rs.getString(\"name\") + \" \" + rs.getString(\"password\");\n\t\t\tSystem.out.println(someobject);\n\t\t\toutput.setText(someobject);\n\t\t\t// output.setText(rs);\n\t\t\t// System.out.println(rs.getString(\"name\")+\" \"+rs.getString(\"message\"));\n\t\t\t// rs.getStatement();\n\t\t\t// }\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\tPostgresJDBC();\n\t}",
"private void displayDatabaseInfo() {\n SQLiteDatabase db = mDbHelper.getReadableDatabase();\n\n // Perform this raw SQL query \"SELECT * FROM pets\"\n // to get a Cursor that contains all rows from the pets table.\n\n String[] projection = {\n WaterEntry._ID,\n WaterEntry.COLUMN_DRINK_NAME,\n WaterEntry.COLUMN_DIURETIC_TYPE,\n WaterEntry.COLUMN_DRINK_OUNCES\n };\n\n Cursor cursor = db.query(\n WaterEntry.TABLE_NAME,\n projection,\n null,\n null,\n null,\n null,\n null);\n\n TextView displayView = (TextView) findViewById(R.id.water_view);\n\n try {\n // Create a header in the Text View that looks like this:\n //\n // The pets table contains <number of rows in Cursor> pets.\n // _id - name - breed - gender - weight\n //\n // In the while loop below, iterate through the rows of the cursor and display\n // the information from each column in this order.\n displayView.setText(\"The pets table contains \" + cursor.getCount() + \" pets.\\n\\n\");\n displayView.append(WaterEntry._ID + \" - \" +\n WaterEntry.COLUMN_DRINK_NAME + \" - \" +\n WaterEntry.COLUMN_DIURETIC_TYPE + \" - \" +\n WaterEntry.COLUMN_DRINK_OUNCES + \"\\n\");\n\n // Figure out the index of each column\n int idColumnIndex = cursor.getColumnIndex(WaterEntry._ID);\n int nameColumnIndex = cursor.getColumnIndex(WaterEntry.COLUMN_DRINK_NAME);\n int typeColumnIndex = cursor.getColumnIndex(WaterEntry.COLUMN_DIURETIC_TYPE);\n int ouncesColumnIndex = cursor.getColumnIndex(WaterEntry.COLUMN_DRINK_OUNCES);\n\n // Iterate through all the returned rows in the cursor\n while (cursor.moveToNext()) {\n // Use that index to extract the String or Int value of the word\n // at the current row the cursor is on.\n int currentID = cursor.getInt(idColumnIndex);\n String currentName = cursor.getString(nameColumnIndex);\n String currentType = cursor.getString(typeColumnIndex);\n int currentOunces = cursor.getInt(ouncesColumnIndex);\n String drinkMeasure =\" oz.\";\n // Display the values from each column of the current row in the cursor in the TextView\n displayView.append((\"\\n\" + currentID + \" - \" +\n currentName + \" - \" +\n currentType + \" - \" +\n currentOunces + drinkMeasure));\n }\n } finally {\n // Always close the cursor when you're done reading from it. This releases all its\n // resources and makes it invalid.\n cursor.close();\n }\n\n }",
"public void postLoadProperties(){\n\ttry{\n\t \n\t switch (source){\n\t case \"heroku\":\n\t\tURL = new String(\"jdbc:postgresql://\" + host + \":\" + port + \"/\" + dbname + \"?sslmode=require&user=\" + user + \"&password=\" +password );\n\t\tbreak;\n\t case \"local\":\n\t\tURL = new String(\"jdbc:postgresql://\" + host + \"/\" + dbname);\n\t break;\n\t case \"elephantsql\":\n\t\n\t \tURL = new String(\"jdbc:postgresql://\" + host + \":\" + port + \"/\" + dbname + \"?user=\" + user + \"&password=\" +password + \"&SSL=true\" );\n\t\tbreak;\n\t}\n\t //\t LOGGER.info(\"URL: \" + URL);\n\n\tdbm = new DatabaseManager( this );\n\tif(authenticated){\n\t dbr = dbm.getDatabaseRetriever();\n\t dbi = dbm.getDatabaseInserter();\n\t dmf = new DialogMainFrame(this);\n\t}else{\n\t \tJOptionPane.showMessageDialog(null,\n\t\t\t \"Invalid username or password. Session terminated.\",\n\t\t\t\t \"Authentication Failure!\",\n\t\t\t JOptionPane.ERROR_MESSAGE);\n\t}\n\t}\n catch(SQLException sqle){\n\tLOGGER.info(\"SQL exception creating DatabaseManager: \" + sqle);\n }\n\t\n }",
"public String getDatabase() {\n return this.database;\n }",
"public void listar()\n\t{\n\t\tdatabase.list().forEach(\n\t\t\t(entidade) -> { IO.println(entidade.print() + \"\\n\"); }\n\t\t);\n\t}",
"private void openDatabase() {\n database = new DatabaseExpenses(this);\n database.open();\n }",
"@Override\r\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\r\n\t\treallynowDB = new ReallyNowDB(this);\r\n\t\t\r\n\t\tprefs = PreferenceManager.getDefaultSharedPreferences(this);\r\n\t\tString str = prefs.getString(\"refresh\", \"10\");\r\n\t\tLog.d(TAG, \"OnCreate\" + str);\r\n\t}",
"public DatabaseAdaptor() {\n\t\ttry {\n\t\t\tdatabase = new MyDatabase(DB_NAME);\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n DBAdapter db = new DBAdapter(this);\n\n //---update title---\n db.open();\n if (db.updateTitle(1, \n \t\t\"1234512345\", \n \t\t\"Android coding references\",\n \t\t\"Jakarta Press\"))\n Toast.makeText(this, \"Update successful.\", \n Toast.LENGTH_LONG).show();\n else\n Toast.makeText(this, \"Update failed.\", \n Toast.LENGTH_LONG).show();\n //-------------------\n \n //---retrieve the same title to verify---\n Cursor c = db.getTitle(1);\n if (c.moveToFirst()) \n DisplayTitle(c);\n else\n Toast.makeText(this, \"No title found\", \n \t\tToast.LENGTH_LONG).show(); \n //------------------- \n db.close();\n }",
"boolean isDbInitialized() {return dbInitialized;}",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\t// TODO Auto-generated method stub\n\t\tsuper.onCreate(savedInstanceState);\n\t\tpre = new Preference(getActivity().getApplicationContext());\n\t\tdbName = pre.getStringPref(\"userId\");\n\t\tuiHelper = new UiLifecycleHelper(getActivity(), this);\n\t\tuiHelper.onCreate(savedInstanceState);\n\n\t}",
"public connect_db() {\n initComponents();\n }",
"private void onOpenDB() {\n\n try {\n mLoginSessionDb = new LoginSessionAdapter(this);\n mLoginSessionDb.open();\n\n mLoginSessionData = mLoginSessionDb.GetLoginSessionData();\n\n mConfigDb = new ConfigAdapter(this);\n mConfigDb.open();\n\n mConfigData = mConfigDb.GetConfigData();\n\n if (mConfigData.getPushConfig().equals(\"\")) {\n mConfigDb.DeleteConfigData();\n mConfigData.setPushConfig(\"Y\");\n mConfigData.setGpsConfig(\"Y\");\n mConfigDb.CreateConfigData(mConfigData);\n }\n } catch (Exception e) { }\n }",
"@Override\n public boolean onCreate() {\n Log.e(TAG,\"onCreate\");\n DatabaseHelper.createDatabase(getContext(), new AppDb());\n return true;\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\tdbHelper = new YaDroidDBHelper(getApplicationContext());\n\n\t\tlv = getListView();\n\t\tlv.setTextFilterEnabled(true);\n\n\t\ttry {\n\t\t\tdao = dbHelper.getVdrDao();\n\t\t} catch (SQLException e) {\n\t\t\tdao = null;\n\t\t}\n\n\t}",
"public String getDatabase()\n {\n return m_database; \n }",
"public Database()\r\n\t{\r\n\t\tinitializeDatabase();\r\n\t\t\r\n\t}",
"DataBase createDataBase();",
"private void initDb() {\n\t\tif (dbHelper == null) {\n\t\t\tdbHelper = new DatabaseOpenHelper(this);\n\t\t}\n\t\tif (dbAccess == null) {\n\t\t\tdbAccess = new DatabaseAccess(dbHelper.getWritableDatabase());\n\t\t}\n\t}",
"@Override\n public void onCreate() {\n super.onCreate();\n initData();\n }",
"Database createDatabase();",
"@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.main);\n MainDBAdapter newdb = new MainDBAdapter(this);\n newdb.open();\n \n \n DatabaseInterface db = new DatabaseInterface(this);\n List<String> alerttype = new ArrayList<String>();\n alerttype.add(\"alert1\"); alerttype.add(\"alert2\");\n Item item = new Item(\"title test\", \"description test\", \"location test\", \"category test\", \n \t\talerttype, \"priority test\", \"Event\", \"starttime test\", \"endtime test\", \n \t\t\"deadline test\", \"alerttime test\", \"repeat test\", \"completed test\", 1);\n \n \n db.AddItemToDatabase(this, item);\n newdb.close();\n }",
"@Override\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Override method declared\r\n\t protected void onCreate(Bundle savedInstanceState) {\t\t\t\t\t\t\t\t\t\t\t//Protected method for onCreate set\r\n\t \r\n\t\t super.onCreate(savedInstanceState);\t\t\t\t\t\t\t\t\t\t\t\t\t\t// This is called for when activity is starting\r\n\t\t setContentView(R.layout.sqlview);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Goes to the sql view xml\r\n\t\t TextView sqlInfo = (TextView) findViewById(R.id.tvSQLinfo);\t\t\t\t\t\t\t\t// Finds the sql id tvSQLinfo\r\n\t\t AddAppointment info = new AddAppointment(this);\t\t\t\t\t\t\t\t\t\t\t// Addappointment set\t\t \t\t\t\t\t\t\t\t\t\t\t// context of this class\r\n\t\t info.open();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Info open set\r\n\t\t String data = info.getData();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// String set to pass in values\r\n\t\t info.close();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Info close\r\n\t\t sqlInfo.setText(data);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Set text get the data\r\n\t }",
"private void initDatabase() {\n\n String sql = \"CREATE TABLE IF NOT EXISTS books (\\n\"\n + \"\tISBN integer PRIMARY KEY,\\n\"\n + \"\tBookName text NOT NULL,\\n\"\n + \" AuthorName text NOT NULL, \\n\"\n + \"\tPrice integer\\n\"\n + \");\";\n\n try (Connection conn = DriverManager.getConnection(urlPath);\n Statement stmt = conn.createStatement()) {\n System.out.println(\"Database connected\");\n stmt.execute(sql);\n\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }",
"public GosplPopulationInDatabase() {\n\t\ttry {\n\t\t\tthis.connection = DriverManager.getConnection(\n\t\t\t\t\t\"jdbc:hsqldb:mem:\"+mySqlDBname+\";shutdown=true\", \"SA\", \"\");\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\"error while trying to initialize the HDSQL database engine in memory: \"+e.getMessage(), e);\n\t\t}\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_mydetialinfo);\n\t\tinit();\n\t}",
"@Override\n public void onCreate() {\n initData();\n }",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_history_appliances);\n\n\t\tgetActionBar().setHomeButtonEnabled(true);\n\t\tgetActionBar().setDisplayHomeAsUpEnabled(true);\n\n\t\ttvDistance = (TextView) findViewById(R.id.tvDistance);\n\t\ttvFuel = (TextView) findViewById(R.id.tvFuel);\n\t\ttvCar = (TextView) findViewById(R.id.tvCar);\n\t\ttvYear = (TextView) findViewById(R.id.tvYear);\n\n\t\tString id = getIntent().getStringExtra(\"id\");\n\t\tpopulateRecord(id);\n\n\t}",
"private void setupDatabase() throws SQLException {\n\t\tdb.open(\"localhost\", 3306, \"wow\", \"greeneconomyapple\");\n\t\tdb.use(\"auctionscan\");\n\t}",
"public Database(Context context)\n\t{\n\t\t/* Instanciation de l'openHelper */\n\t\tDBOpenHelper helper = new DBOpenHelper(context);\n\t\t\n\t\t/* Load de la database */\n\t\t//TODO passer en asynchrone pour les perfs\n\t\tmainDatabase = helper.getWritableDatabase();\n\t\t\n\t\t/* DEBUG PRINT */\n\t\tLog.i(\"info\", \"Database Loading Suceeded\");\n\t}"
] | [
"0.71589655",
"0.682697",
"0.681897",
"0.6734527",
"0.6731096",
"0.6678631",
"0.6652765",
"0.6644426",
"0.65674233",
"0.6502434",
"0.6491971",
"0.64799625",
"0.6462817",
"0.644202",
"0.64176023",
"0.64110184",
"0.6401646",
"0.6382505",
"0.63818866",
"0.63761675",
"0.6363082",
"0.6345162",
"0.63277996",
"0.6273003",
"0.62574154",
"0.62285995",
"0.62275434",
"0.62235004",
"0.62124026",
"0.61965394",
"0.6185251",
"0.6151339",
"0.61280835",
"0.6120512",
"0.61131746",
"0.60971904",
"0.60507864",
"0.6045066",
"0.6044807",
"0.6040982",
"0.6039576",
"0.60323006",
"0.6026105",
"0.60241723",
"0.60187966",
"0.600813",
"0.5998148",
"0.5994936",
"0.59903574",
"0.59873164",
"0.59841347",
"0.59811074",
"0.59780437",
"0.5977585",
"0.5959172",
"0.59576094",
"0.5956628",
"0.5941399",
"0.5932766",
"0.59292674",
"0.59292674",
"0.5921542",
"0.5920922",
"0.59203285",
"0.5916129",
"0.5911836",
"0.5910912",
"0.5905762",
"0.59039253",
"0.58967674",
"0.5889573",
"0.5889421",
"0.5886604",
"0.58861846",
"0.5879776",
"0.5873123",
"0.586645",
"0.58592397",
"0.5856473",
"0.5851736",
"0.585014",
"0.58501",
"0.58496636",
"0.5848667",
"0.5843035",
"0.5840177",
"0.58388066",
"0.5837723",
"0.58348715",
"0.5830789",
"0.58246523",
"0.581654",
"0.58160806",
"0.5815847",
"0.5811828",
"0.5810988",
"0.5804295",
"0.58008516",
"0.5799297",
"0.5798204"
] | 0.7626734 | 0 |
Check if we have write permission | public static void verifyStoragePermissions(Activity activity) {
int permission = ActivityCompat.checkSelfPermission(activity, Manifest.permission.WRITE_EXTERNAL_STORAGE);
if (permission != PackageManager.PERMISSION_GRANTED) {
// We don't have permission so prompt the user
ActivityCompat.requestPermissions(
activity,
PERMISSIONS_STORAGE,
REQUEST_EXTERNAL_STORAGE
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isWritePermissionGranted();",
"boolean isWriteAccess();",
"boolean canWrite();",
"int getPermissionWrite();",
"public boolean isWriteable();",
"private boolean isWriteStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"public boolean checkWritePermission(final DataBucketBean bucket) {\r\n\t\t\treturn checkPermission(bucket, SecurityService.ACTION_READ_WRITE);\r\n\t\t}",
"private boolean checkReadWritePermission() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n if (checkSelfPermission(Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED\n && checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {\n return true;\n } else {\n ActivityCompat.requestPermissions(PanAadharResultActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, 111);\n return false;\n }\n }\n\n return false;\n }",
"public boolean isWritable() {\n return accessControl != null && accessControl.getOpenStatus().isOpen() && !sandboxed;\n }",
"public boolean canWrite() {\n\t\treturn Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());\n\t}",
"private static boolean checkFsWritable() {\n String directoryName = Environment.getExternalStorageDirectory().toString() + \"/DCIM\";\n File directory = new File(directoryName);\n if (!directory.isDirectory()) {\n if (!directory.mkdirs()) {\n return false;\n }\n }\n return directory.canWrite();\n }",
"private boolean hasExternalStorageReadWritePermission() {\n return ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED\n && ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;\n }",
"@Override\n\tpublic boolean getCanWrite()\n\t{\n\t\treturn false;\n\t}",
"public static boolean isWriteStorageAllowed(FragmentActivity act) {\n int result = ContextCompat.checkSelfPermission(act, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"private boolean isReadStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"@Override\n\tpublic boolean isWritable() {\n\t\treturn (Files.isWritable(this.path) && !Files.isDirectory(this.path));\n\t}",
"boolean isWritable();",
"public static boolean setWriteable(File f) {\n if(!f.exists())\n return true;\n\n // non Windows-based systems return the wrong value\n // for canWrite when the argument is a directory --\n // writing is based on the 'x' attribute, not the 'w'\n // attribute for directories.\n if(f.canWrite()) {\n if(!f.isDirectory())\n return true;\n }\n \n String fName;\n try {\n fName = f.getCanonicalPath();\n } catch(IOException ioe) {\n fName = f.getPath();\n }\n \n String cmds[] = null;\n if(f.isDirectory())\n cmds = new String[] { \"chmod\", \"u+w+x\", fName };\n else\n cmds = new String[] { \"chmod\", \"u+w\", fName};\n \n if( cmds != null ) {\n try { \n Process p = Runtime.getRuntime().exec(cmds);\n p.waitFor();\n }\n catch(SecurityException ignored) { }\n catch(IOException ignored) { }\n catch(InterruptedException ignored) { }\n }\n \n\t\treturn f.canWrite();\n }",
"public boolean canReadAndWrite() {\n\t\t//We can read and write in any state that we can read.\n\t\treturn canWrite();\n\t}",
"private boolean checkPermission() {\r\n int result = ContextCompat.checkSelfPermission(UniformDrawer.this, android.Manifest.permission.WRITE_EXTERNAL_STORAGE);\r\n if (result == PackageManager.PERMISSION_GRANTED) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"@Override\n\tpublic boolean isReadWrite() {\n\t\treturn true;\n\t}",
"public static boolean sdAvailableWrite() {\n\t\tboolean sdAccessWrite = false;\n\n\t\t// Comprobamos el estado de la memoria externa (tarjeta SD)\n\t\tString state = Environment.getExternalStorageState();\n\n\t\tif (state.equals(Environment.MEDIA_MOUNTED)) {\n\t\t\tsdAccessWrite = true;\n\t\t} else if (state.equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {\n\t\t\tsdAccessWrite = false;\n\t\t} else {\n\t\t\tsdAccessWrite = false;\n\t\t}\n\t\treturn sdAccessWrite;\n\t}",
"public static boolean Writeable(File Folder) {\n\t\tboolean Check;\n\t\tif (Folder.canWrite() == true) {\n\t\t\tCheck = true;\n\t\t} else {\n\t\t\tCheck = false;\n\t\t}\n\t\treturn Check;\n\t}",
"@Override\n public boolean hasWriteAccess() {\n if (this.employmentDate.isAfter(LocalDate.now().minusMonths(6))) {\n return false;\n } else {\n return true;\n }\n }",
"private boolean checkPermissionStorage() {\n\n boolean isPermissionGranted = true;\n\n int permissionStorage = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n if (permissionStorage != PackageManager.PERMISSION_GRANTED)\n {\n isPermissionGranted = false;\n }\n\n return isPermissionGranted;\n }",
"private boolean isExternalStorageWritable(){\r\n if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {\r\n Log.i(\"State\", \"Yes, it is writable!\");\r\n return true;\r\n } else{\r\n return false;\r\n }\r\n }",
"private boolean checkPermissions() {\n\n if (!isExternalStorageReadable() || !isExternalStorageReadable()) {\n Toast.makeText(this, \"This app only works on devices with usable external storage.\",\n Toast.LENGTH_SHORT).show();\n return false;\n }\n\n int permissionCheck = ContextCompat.checkSelfPermission(this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE);\n if (permissionCheck != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n REQUEST_PERMISSION_WRITE);\n return false;\n } else {\n return true;\n }\n }",
"private static void checkAccess(File directory, boolean isWriteable) throws IOException {\n if(!directory.exists()) {\n if(directory.mkdirs()) {\n logger.debug(\"Created directory [{}]\", directory.getCanonicalPath());\n } else {\n throw new IOException(\"Could not create directory \" +\n \"[\"+directory.getCanonicalPath()+\"], \" +\n \"make sure you have the proper \" +\n \"permissions to create, read & write \" +\n \"to the file system\");\n }\n }\n // Find if we can write to the record root directory\n if(!directory.canRead())\n throw new IOException(\"Cant read from : \"+directory.getCanonicalPath());\n if(isWriteable) {\n if(!directory.canWrite())\n throw new IOException(\"Cant write to : \"+directory.getCanonicalPath());\n }\n }",
"public boolean isWritable(int tid, int varIndex) {\n if (!hasConflict(tid, varIndex, Lock.Type.WRITE)) {\n setLock(tid, varIndex, Lock.Type.WRITE);\n _accessedTransactions.add(tid);\n return true;\n } else {\n return false;\n }\n }",
"public boolean isWritable() {\r\n\t\treturn isWritable;\r\n\t}",
"private boolean isReadStorageAllowed() {\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\n int write = ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED && write == PackageManager.PERMISSION_DENIED) {\n return true;\n } else {\n\n //If permission is not granted returning false\n return false;\n }\n }",
"public static boolean isWriteExternalStorageAllowed(FragmentActivity act) {\n //Getting the permission status\n int result = ContextCompat.checkSelfPermission(act, Manifest.permission.WRITE_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"public static boolean canWriteOnExternalStorage() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean canWrite(Transaction.TransactionType t, Operation o) {\n if (!isActive || Transaction.TransactionType.READ_ONLY.equals(t) ||\n !variables.containsKey(o.getVariableId())) {\n return false;\n }\n return lockManagers.get(o.getVariableId()).canAcquireLock(o.getType(), o.getTransactionId());\n }",
"public boolean isWritable() {\n return false;\n }",
"public boolean canReadWriteOnMyLatestView()\n {\n \t \treturn getAccessBit(2);\n }",
"@Override\n public boolean canEdit(Context context, Item item) throws java.sql.SQLException\n {\n // can this person write to the item?\n return authorizeService.authorizeActionBoolean(context, item, Constants.WRITE, true);\n }",
"boolean isReadAccess();",
"public boolean CheckPermissions() {\n int result = ContextCompat.checkSelfPermission(getApplicationContext(), WRITE_EXTERNAL_STORAGE);\r\n int result1 = ContextCompat.checkSelfPermission(getApplicationContext(), RECORD_AUDIO);\r\n return result == PackageManager.PERMISSION_GRANTED && result1 == PackageManager.PERMISSION_GRANTED;\r\n }",
"private boolean checkSelfPermission() {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, MainActivity.PERMISSION_REQ_ID_WRITE_EXTERNAL_STORAGE);\n return false;\n }\n return true;\n }",
"public boolean isUpdateRight() {\r\n if (getUser() != null) {\r\n return getUser().hasPermission(\"/vocabularies\", \"u\");\r\n }\r\n return false;\r\n }",
"private boolean mayRequestStoragePermission() {\r\n\r\n if(Build.VERSION.SDK_INT < Build.VERSION_CODES.M)\r\n return true;\r\n\r\n if((checkSelfPermission(WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) &&\r\n (checkSelfPermission(CAMERA) == PackageManager.PERMISSION_GRANTED))\r\n return true;\r\n\r\n if((shouldShowRequestPermissionRationale(WRITE_EXTERNAL_STORAGE)) || (shouldShowRequestPermissionRationale(CAMERA))){\r\n Snackbar.make(mRlView, \"Los permisos son necesarios para poder usar la aplicación\",\r\n Snackbar.LENGTH_INDEFINITE).setAction(android.R.string.ok, new View.OnClickListener() {\r\n @TargetApi(Build.VERSION_CODES.M)\r\n @Override\r\n public void onClick(View v) {\r\n requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE, CAMERA}, MY_PERMISSIONS);\r\n }\r\n });\r\n }else{\r\n requestPermissions(new String[]{WRITE_EXTERNAL_STORAGE, CAMERA}, MY_PERMISSIONS);\r\n }\r\n\r\n return false;\r\n }",
"int getPermissionRead();",
"public final boolean canWriteFile(long offset, long len, int pid) {\n\t\t\n\t\t//\tCheck if the lock list is valid\n\t\t\n\t\tif ( m_lockList == null)\n\t\t\treturn true;\n\t\t\t\n\t\t//\tCheck if the file section is writeable by the specified process\n\n\t\tboolean writeOK = false;\n\t\t\t\t\n\t\tsynchronized ( m_lockList) {\n\n\t\t\t//\tCheck if the file section is writeable\n\t\t\t\n\t\t\twriteOK = m_lockList.canWriteFile(offset, len, pid);\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\t//\tReturn the write status\n\t\t\n\t\treturn writeOK;\n\t}",
"private boolean checkPermissions() {\n if (!read_external_storage_granted ||\n !write_external_storage_granted ||\n !write_external_storage_granted) {\n Toast.makeText(getApplicationContext(), \"Die App braucht Zugang zur Kamera und zum Speicher.\", Toast.LENGTH_SHORT).show();\n return false;\n }\n return true;\n }",
"protected final void checkWriteable()\n {\n if( m_readOnly )\n {\n final String message =\n \"Resource (\" + this + \") is read only and can not be modified\";\n throw new IllegalStateException( message );\n }\n }",
"public static boolean isExternalStorageWritable()\n\t{\n\t\tString state = Environment.getExternalStorageState();\n\t\tif (Environment.MEDIA_MOUNTED.equals(state))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"boolean isHasPermissions();",
"private static boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"private void requestWriteStoragePermission() {\n if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n //show explanation to user\n Toast.makeText(this, \"Write storage permission is needed to save photos/videos\", Toast.LENGTH_LONG).show();\n //request the permission\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n WRITE_EXTERNAL_STORAGE_CODE);\n } else {\n // No explanation needed; request the permission\n ActivityCompat.requestPermissions(MainActivity.this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n WRITE_EXTERNAL_STORAGE_CODE);\n\n // WRITE_EXTERNAL_STORAGE_CODE is an\n // app-defined int constant. The onRequestPermissionsResult method gets the code\n }\n }",
"private boolean hasEscalatingPrivilegesOnWrite(List<String> verbs, List<String> resources) {\n if (Collections.disjoint(verbs, EscalatingResources.ESCALATING_VERBS)) {\n return false;\n }\n\n return !Collections.disjoint(resources,\n EscalatingResources.ESCALATING_RESOURCES_ON_WRITE);\n }",
"public boolean ownWrite(Object data);",
"long getLastWriteAccess();",
"private boolean validateAccess(String permission) {\n\t\tif (\"READ\".equalsIgnoreCase(permission)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean hasPerms()\n {\n return ContextCompat.checkSelfPermission(itsActivity, itsPerm) ==\n PackageManager.PERMISSION_GRANTED;\n }",
"private boolean checkPermissions() {\n if (ContextCompat.checkSelfPermission(this, android.Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n return false;\n\n } else {\n return true;\n }\n }",
"public int getUserModificationPermission() {\n return permission;\n }",
"public boolean isExternalStorageWritable(){\n String state = Environment.getExternalStorageState();\n if(Environment.MEDIA_MOUNTED.equals(state)){\n return true;\n }\n return false;\n }",
"boolean isUsedForWriting();",
"private boolean permisos() {\n for(String permission : PERMISSION_REQUIRED) {\n if(ContextCompat.checkSelfPermission(getContext(), permission) != PackageManager.PERMISSION_GRANTED) {\n return false;\n }\n }\n return true;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state))\n return true;\n\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public static boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"public static boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"public static boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"static public boolean hasStorage(boolean requireWriteAccess) {\n String state = Environment.getExternalStorageState();\n Log.v(TAG, \"storage state is \" + state);\n\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n if (requireWriteAccess) {\n boolean writable = checkFsWritable();\n Log.v(TAG, \"storage writable is \" + writable);\n return writable;\n } else {\n return true;\n }\n } else if (!requireWriteAccess && Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {\n return true;\n }\n return false;\n }",
"public static boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"private boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"private boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"private boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n return false;\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"public boolean isExternalStorageWritable() {\n String state = Environment.getExternalStorageState();\n return Environment.MEDIA_MOUNTED.equals(state);\n }",
"public boolean isExternalStorageWritable() {\n\t\tString state = Environment.getExternalStorageState();\n\t\tif (Environment.MEDIA_MOUNTED.equals(state)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isExternalStorageWritable() {\n\t\tString state = Environment.getExternalStorageState();\n\t\tif (Environment.MEDIA_MOUNTED.equals(state)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public static boolean isExternalStorageWritable() {\n try {\n String state = Environment.getExternalStorageState();\n if (Environment.MEDIA_MOUNTED.equals(state)) {\n return true;\n }\n else\n {\n return false;\n }\n\n }\n catch (Exception ex)\n {\n return false;\n }\n }",
"boolean isReadOnly();",
"boolean isReadOnly();",
"boolean needsStoragePermission();",
"public boolean isExternalStorageWritable() {\r\n\t String state = Environment.getExternalStorageState();\r\n\t if (Environment.MEDIA_MOUNTED.equals(state)) {\r\n\t return true;\r\n\t }\r\n\t return false;\r\n\t}",
"public boolean accesspermission()\n {\n AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);\n int mode = 0;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {\n mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,\n Process.myUid(),context.getPackageName());\n }\n if (mode == AppOpsManager.MODE_ALLOWED) {\n\n return true;\n }\n return false;\n\n }",
"@Override\n public void checkPermission(Permission perm) {\n }",
"private boolean isReadStorageAllowed() {\n //Getting the permission status\n int result = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE);\n\n //If permission is granted returning true\n if (result == PackageManager.PERMISSION_GRANTED)\n return true;\n\n //If permission is not granted returning false\n return false;\n }",
"public final boolean needsPermission() {\n return FileUtil.needsPermission(this.form, this.resolvedPath);\n }",
"@Override\n\tpublic boolean isWritable(int arg0) throws SQLException {\n\n\t\treturn true;\n\t}",
"private boolean checkDeviceResourcePermissions() {\n // Check if the user agrees to access the microphone\n boolean hasMicrophonePermission = checkPermissions(\n Manifest.permission.RECORD_AUDIO,\n REQUEST_MICROPHONE);\n boolean hasWriteExternalStorage = checkPermissions(\n Manifest.permission.WRITE_EXTERNAL_STORAGE,\n REQUEST_EXTERNAL_PERMISSION);\n\n if (hasMicrophonePermission && hasWriteExternalStorage) {\n return true;\n } else {\n return false;\n }\n }",
"boolean getDurableWrites();",
"public abstract boolean canEditAccessRights(OwObject object_p) throws Exception;",
"public boolean checkPermission(Permission permission);",
"private void acquireExternalStorageWritePermissionIfNeeded() {\n if (!appHasExternalStorageWritePermission()) {\n\n // Should we show an explanation?\n if (ActivityCompat.shouldShowRequestPermissionRationale(CameraIntent.this,\n Manifest.permission.WRITE_EXTERNAL_STORAGE)) {\n\n // Show an explanation to the user *asynchronously* -- don't block\n // this thread waiting for the user's response! After the user\n // sees the explanation, try again to request the permission.\n\n } else {\n\n // No explanation needed, we can request the permission.\n\n ActivityCompat.requestPermissions(CameraIntent.this,\n new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},\n MY_PERMISSIONS_WRITE_EXTERNAL_STORAGE);\n\n // MY_PERMISSIONS_REQUEST_READ_CONTACTS is an\n // app-defined int constant. The callback method gets the\n // result of the request.\n }\n }\n }",
"private static int check_fd_for_write(int fd) {\n int status = check_fd(fd);\n if (status < 0)\n return -1;\n\n FileDescriptor fileDescriptor = process.openFiles[fd];\n int flags = fileDescriptor.getFlags();\n if ((flags != O_WRONLY) &&\n (flags != O_RDWR)) {\n // return (EBADF) if the file is not open for writing\n process.errno = EBADF;\n return -1;\n }\n\n return 0;\n }",
"@Override\n protected String requiredPutPermission() {\n return \"admin\";\n }",
"public void checkPermission() {\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.RECORD_AUDIO) +\n ContextCompat.checkSelfPermission(this, Manifest.permission.MODIFY_AUDIO_SETTINGS)\n != PackageManager.PERMISSION_GRANTED) {\n\n ActivityCompat.requestPermissions(this, perms, permsRequestCode);\n permissionGranted = false;\n } else {\n permissionGranted = true;\n }\n }",
"public boolean isWritable() {\n return channel instanceof WritableByteChannel;\n }",
"protected boolean hasMonitoringPermissions() {\r\n\t\tfinal Jenkins jenkins = Jenkins.getInstance();\r\n\t\treturn jenkins != null && jenkins.hasPermission(Jenkins.ADMINISTER);\r\n\t}",
"private boolean checkPermission() {\n\n if ((ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)\n != PackageManager.PERMISSION_GRANTED) &&\n (ContextCompat.checkSelfPermission(this,\n Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED)\n\n ) {\n\n // Permission is not granted\n return false;\n\n }\n return true;\n }"
] | [
"0.9099552",
"0.8837813",
"0.80663157",
"0.80243504",
"0.7774986",
"0.77436954",
"0.75657046",
"0.7548023",
"0.7270176",
"0.72674453",
"0.7215455",
"0.7176124",
"0.7007981",
"0.6935691",
"0.68866736",
"0.68647003",
"0.68148607",
"0.6806817",
"0.6791676",
"0.6703497",
"0.66883403",
"0.6680985",
"0.6644264",
"0.66403365",
"0.66116214",
"0.6539655",
"0.6538877",
"0.65173215",
"0.6514448",
"0.6508102",
"0.65004486",
"0.65004474",
"0.64944845",
"0.64929426",
"0.6469867",
"0.6424965",
"0.64065015",
"0.63702005",
"0.63648355",
"0.6362145",
"0.63414425",
"0.63373905",
"0.63278127",
"0.6311438",
"0.6299312",
"0.6290458",
"0.62264204",
"0.62245375",
"0.6214777",
"0.62048143",
"0.62034494",
"0.62029964",
"0.6194832",
"0.61946416",
"0.61892897",
"0.6157247",
"0.6150112",
"0.61301994",
"0.61266166",
"0.61259407",
"0.6112692",
"0.6101156",
"0.60983235",
"0.60983235",
"0.60983235",
"0.60955554",
"0.60913956",
"0.6083479",
"0.6083479",
"0.6083479",
"0.6083479",
"0.6083479",
"0.60828054",
"0.60828054",
"0.60828054",
"0.60796255",
"0.60796255",
"0.60796255",
"0.60764515",
"0.60764515",
"0.60734975",
"0.6072341",
"0.6072341",
"0.6044946",
"0.6044837",
"0.6030122",
"0.602084",
"0.60102665",
"0.6002622",
"0.6001142",
"0.5992892",
"0.59911996",
"0.598787",
"0.59748507",
"0.5962842",
"0.5962393",
"0.59567714",
"0.5940612",
"0.59304714",
"0.59301555",
"0.5922864"
] | 0.0 | -1 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof Probleme)) {
return false;
}
Probleme other = (Probleme) object;
if ((this.idprobleme == null && other.idprobleme != null) || (this.idprobleme != null && !this.idprobleme.equals(other.idprobleme))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void setId(int id) { this.id = id; }",
"public void setId(int id) { this.id = id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public void setId(long id) { this.id = id; }",
"public void setId(long id) { this.id = id; }",
"public int getId(){ return id; }",
"public int getId() {return id;}",
"public int getId() {return Id;}",
"public int getId(){return id;}",
"public void setId(long id) {\n id_ = id;\n }",
"private int getId() {\r\n\t\treturn id;\r\n\t}",
"public Integer getId(){return id;}",
"public int id() {return id;}",
"public long getId(){return this.id;}",
"public int getId(){\r\n return this.id;\r\n }",
"@Override public String getID() { return id;}",
"public Long id() { return this.id; }",
"public Integer getId() { return id; }",
"@Override\n\tpublic Integer getId() {\n return id;\n }",
"@Override\n public Long getId () {\n return id;\n }",
"@Override\n public long getId() {\n return id;\n }",
"public Long getId() {return id;}",
"public Long getId() {return id;}",
"public String getId(){return id;}",
"@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}",
"public Integer getId() { return this.id; }",
"@Override\r\n public int getId() {\n return id;\r\n }",
"@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}",
"public int getId() {\n return id;\n }",
"public long getId() { return _id; }",
"public int getId() {\n/* 35 */ return this.id;\n/* */ }",
"public long getId() { return id; }",
"public long getId() { return id; }",
"public void setId(Long id) \n {\n this.id = id;\n }",
"@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}",
"public void setId(String id) {\n this.id = id;\n }",
"@Override\n\tpublic void setId(Long id) {\n\t}",
"public Long getId() {\n return id;\n }",
"public long getId() { return this.id; }",
"public int getId()\n {\n return id;\n }",
"public void setId(int id){\r\n this.id = id;\r\n }",
"protected abstract String getId();",
"@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}",
"@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public int getID() {return id;}",
"public int getID() {return id;}",
"public int getId ()\r\n {\r\n return id;\r\n }",
"@Override\n public int getField(int id) {\n return 0;\n }",
"public int getId(){\r\n return localId;\r\n }",
"public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }",
"@Override\n public Integer getId() {\n return id;\n }",
"void setId(int id) {\n this.id = id;\n }",
"@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}",
"@Override\n public int getId() {\n return id;\n }",
"@Override\n public int getId() {\n return id;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"public void setId(int id)\n {\n this.id=id;\n }",
"@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }",
"@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}",
"public int getId()\r\n {\r\n return id;\r\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"public void setId(Long id){\n this.id = id;\n }",
"public abstract Long getId();",
"final protected int getId() {\n\t\treturn id;\n\t}",
"private void clearId() {\n \n id_ = 0;\n }",
"public void setId(Long id) \r\n {\r\n this.id = id;\r\n }",
"@Override\n public long getId() {\n return this.id;\n }",
"public String getId(){ return id.get(); }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }",
"public Long getId() \n {\n return id;\n }",
"public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }",
"@Override\n\tpublic void setId(int id) {\n\n\t}",
"@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}",
"public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }",
"public int getId()\n {\n return id;\n }",
"public int getID(){\n return id;\n }",
"public String getID(){\n return Id;\n }"
] | [
"0.6896072",
"0.6839122",
"0.6705258",
"0.66412854",
"0.66412854",
"0.65923095",
"0.65785074",
"0.65785074",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.65752834",
"0.6561566",
"0.6561566",
"0.6545169",
"0.6525343",
"0.65168375",
"0.64885366",
"0.6477314",
"0.64274967",
"0.6420125",
"0.6417802",
"0.640265",
"0.6367859",
"0.6355473",
"0.6352689",
"0.6348769",
"0.63258827",
"0.63203555",
"0.6302521",
"0.62946665",
"0.62946665",
"0.62845194",
"0.62724674",
"0.62673867",
"0.62664896",
"0.62628543",
"0.62604827",
"0.6256597",
"0.62518793",
"0.6248176",
"0.6248176",
"0.62445766",
"0.6240227",
"0.6240227",
"0.62322026",
"0.6223806",
"0.62218046",
"0.6220317",
"0.6212928",
"0.62090635",
"0.6203066",
"0.6201325",
"0.61939746",
"0.6190498",
"0.6190498",
"0.6190498",
"0.6189811",
"0.6189811",
"0.6185415",
"0.618307",
"0.6175355",
"0.6174499",
"0.6167348",
"0.6167341",
"0.61617935",
"0.61569077",
"0.61569077",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61567014",
"0.61423147",
"0.6134403",
"0.6129919",
"0.61289775",
"0.6105535",
"0.6105535",
"0.61055124",
"0.6103899",
"0.6103877",
"0.61027",
"0.61002946",
"0.61002403",
"0.609533",
"0.609243",
"0.609243",
"0.60917705",
"0.6090932",
"0.60905474",
"0.60762745",
"0.6072683",
"0.6072517",
"0.6071208",
"0.60706896",
"0.6070472"
] | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
Stack<String> stack=new Stack<String>();
for(int i=0; i<100; i++) {
stack.push(""+i);
}
System.out.println(stack.pop());
Queue<Integer> queue=new LinkedList<Integer>();
for(int i=0; i<100;i++) {
queue.offer(i);
}
System.out.println(queue.poll());
} | {
"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 | @Override
public TemplateDeDescripcion toObject() {
return null;
} | {
"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 | @Override
public void setObject(TemplateDeDescripcion objeto, int profundidadActual,
int profundidadDeseada) {
} | {
"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 | public static void main(String[] args) {
ArrayList<Integer> arrayList = new ArrayList<Integer>();
arrayList.add(11);
arrayList.add(2);
arrayList.add(7);
arrayList.add(3);
// ArrayList before the sorting
System.out.println("Before Sorting: ");
for(int counter: arrayList)
System.out.println(counter);
// Sorting of arrayList using Collections.sort
Collections.sort(arrayList);
// ArrayList after sorting
System.out.println("\nAfter Sorting: ");
for(int counter: arrayList)
System.out.println(counter);
} | {
"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 |
Aint gonna happen ;} This is a read only bean | public void writeSQL(SQLOutput stream) throws SQLException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onPutBeansRaised() {\n }",
"public EquipmentSetAccessBean () {\n super();\n }",
"public CarAccessBean () {\n super();\n }",
"RoomstlogBean()\n {\n }",
"protected PersonSessionBean getadmin$PersonSessionBean() {\n return (PersonSessionBean) getBean(\"admin$PersonSessionBean\");\n }",
"protected AccessionSessionBean getgermplasm$AccessionSessionBean() {\n return (AccessionSessionBean) getBean(\"germplasm$AccessionSessionBean\");\n }",
"public ListUserBean(){\n \n }",
"public UIUserLogginMangementBean() {\n }",
"@Override\n protected void beforeOpen(HttpServletRequest request, ActionForm form)\n \t\tthrows Exception {\n \tsuper.beforeOpen(request, form);\n \tLong id = RequestUtils.getLongParameter(\"id\", -1);\n \tif(id != -1){\n \t\trequest.setAttribute(\"bean\", this.getService().load(id));\n \t}\n }",
"private ReadProperty()\r\n {\r\n\r\n }",
"public userBean() {\r\n }",
"@Override\n\tpublic int edita(Solicitud bean) throws Exception {\n\t\treturn 0;\n\t}",
"public UpdateStockDetailBean() {\n }",
"public GrlFornecedorNovoBean()\n {\n fornecedor = getInstanciaFornecedor();\n }",
"public editarUsuarioBean() {\r\n }",
"public DonusturucuBean() {\n }",
"@Override\r\n\tpublic void initControllerBean() throws Exception {\n\t}",
"public ModificarPerfilBean() {\r\n }",
"public clientesBean() {\n this.clie = new Clientes();\n }",
"@Override\n\t\tpublic void refreshBeanElement() {\n\n\t\t}",
"public ObjetosBeans() {\n this.init();\n }",
"public ChangePasswordBean() {\n }",
"public ReservaBean() {\r\n nrohabitacion=1;\r\n createLista(nrohabitacion);\r\n editable=true;\r\n sino=\"\";\r\n \r\n reserva = new TReserva();\r\n }",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public CntCuentasAdicionarModificarBacking() {\n }",
"public SuperRegionAccAccessBean () {\n super();\n }",
"public PacienteBean() {\r\n paciente = new Paciente();\r\n logueado = new Usuario();\r\n //datospersonales = new HelperDatosPersonales();\r\n this.resultado = \"\";\r\n pacienteSeleccionado = false;\r\n \r\n // Carga session\r\n faceContext=FacesContext.getCurrentInstance();\r\n httpServletRequest=(HttpServletRequest)faceContext.getExternalContext().getRequest();\r\n if(httpServletRequest.getSession().getAttribute(\"Usuario\") != null)\r\n {\r\n logueado = (Usuario)httpServletRequest.getSession().getAttribute(\"Usuario\");\r\n }\r\n \r\n if(httpServletRequest.getSession().getAttribute(\"Centro\") != null)\r\n {\r\n //logueadoCentro = (Centro)httpServletRequest.getSession().getAttribute(\"Centro\");\r\n CentroID = Integer.parseInt(httpServletRequest.getSession().getAttribute(\"Centro\").toString());\r\n }\r\n }",
"@Override\n\tpublic void change(MemberBean member) {\n\n\t}",
"public LoginBean() {\r\n \r\n \r\n }",
"public User getEditUser()\r\n/* */ {\r\n/* 172 */ return this.editUser;\r\n/* */ }",
"@Override\n public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {\n return bean;\n }",
"@Override\n\tprotected void lazyLoad() {\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"protected Spring() {}",
"public ExternalLoginManagedBean() {\n login = false;\n }",
"public StaffBean() {\n try {\n username = SessionController.getInstance().getUser((HttpSession)FacesContext.getCurrentInstance().getExternalContext().getSession(false));\n genders = GBEnvironment.getInstance().getCatalog(GB_CommonStrConstants.CT_GENDER).getAllCatalog();\n id_types= GBEnvironment.getInstance().getCatalog(GB_CommonStrConstants.CT_IDTYPE).getAllCatalog();\n charge_up();\n } catch (GB_Exception ex) {\n LOG.error(ex);\n GBMessage.putMessage(GBEnvironment.getInstance().getError(28), null);\n }\n }",
"@Override\n protected boolean isMultipleBeans()\n {\n return false;\n }",
"@Override\n protected boolean isMultipleBeans()\n {\n return false;\n }",
"public MainSessionBean() {\r\n init();\r\n }",
"public RegisterUserBean() {\n this.account.setGender(Boolean.TRUE);\n this.roleID = 5;\n }",
"public UserBean() {\n }",
"public UserBean() {\n }",
"public PerfilActBean() {\r\n }",
"public ShoppingCartBean(){\n super();\n }",
"public ClasificacionBean() {\r\n }",
"public SampleBean() {\n }",
"public PersonaBean() {\n domicilio = new Domicilio();\n telefono = new Telefono();\n correoElectronico = new CorreoElectronico();\n persona = new Persona();\n this.tipoOperacion = \"Alta\";\n\n }",
"@Override\r\n\tprotected void criarNovoBean() {\r\n\t\tcurrentBean = new MarcaOsEntity();\r\n\t}",
"Object getBean();",
"public UseBeanBaseTag()\n {\n super();\n initReservedAttributes();\n }",
"protected void accionUsuario() {\n\t\t\r\n\t}",
"public CrudBean() {\n }",
"public CampingBean() {\n }",
"public void test_change_bean() {\r\n Object bean1 = new MyGoodBean();\r\n Object newBean1 = new MyGoodBean();\r\n\r\n BeanId beanId1 = getBeanIdRegister().register(\"bean1\");\r\n BeanId beanIdNE = getBeanIdRegister().register(\"notExisting\");\r\n\r\n\r\n BeanRepository beanRepository = getBeanRepository();\r\n\r\n beanRepository.addBean(beanId1, bean1);\r\n\r\n assertEquals(bean1, beanRepository.getBean(beanId1));\r\n\r\n beanRepository.changeBean(beanId1, newBean1);\r\n\r\n assertEquals(newBean1, beanRepository.getBean(beanId1));\r\n\r\n boolean fired = false;\r\n\r\n try {\r\n \tbeanRepository.changeBean(beanIdNE, new Object());\r\n } catch (IllegalStateException e) {\r\n \tfired = true;\r\n\t\t}\r\n assertTrue(\"The exception did not fire\", fired);\r\n }",
"public OpticalHopAccessBean () {\n super();\n }",
"public RhSubsidioBean ()\n {\n }",
"@Override\n public boolean hasReadAccess() {\n return true;\n }",
"@Test\n public void t() throws Exception {\n TestAutow ta = new TestAutow();\n Class<? extends TestAutow> clazz = ta.getClass();\n Field[] fields = clazz.getDeclaredFields();\n Arrays.asList(fields).stream().forEach(System.out::println);\n System.out.println(ta.getI()+\":\"+ta.getStr());\n\n Field field_i=clazz.getDeclaredField(\"i\");\n //获得许可\n field_i.setAccessible(true);\n field_i.set(ta,7);\n System.out.println(ta.getI()+\":\"+ta.getStr());\n\n\n }",
"public SuperRegionAccessBean () {\n super();\n }",
"@Override\n protected void updateProperties() {\n }",
"@Test\n public void beanFactoryPostProcessir() {\n Person p1 = (Person) applicationContext.getBean(\"p1\");\n //System.out.println(p1.getAge());\n\n // applicationContext.getBean(\"p3\");\n }",
"@Override\n\tpublic boolean isReadOnly() {\n\t\treturn false;\n\t}",
"public void setValue(Object obj) throws AspException\n {\n throw new AspException(\"Modification of read-only variable\");\n }",
"public DelZadBean() {\n }",
"@Override\r\n\tpublic void adminSelectRead() {\n\t\t\r\n\t}",
"public FuncionarioBean() {\n }",
"public libroBean() throws SQLException\r\n {\r\n variables = new VariablesConexion();\r\n variables.iniciarConexion();\r\n conexion=variables.getConexion();\r\n \r\n }",
"public User getCreateUser()\r\n/* */ {\r\n/* 144 */ return this.createUser;\r\n/* */ }",
"public ListaCuentaContableBean getListaCuentaContableBean()\r\n/* 319: */ {\r\n/* 320:383 */ return this.listaCuentaContableBean;\r\n/* 321: */ }",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"private PropertyAccess() {\n\t\tsuper();\n\t}",
"public ProduitManagedBean() {\r\n\t\tthis.produit = new Produit();\r\n//\t\tthis.categorie = new Categorie();\r\n\t}",
"@Bean({\"colBean\" , \"collegeBean\" } )\n\tpublic College collegeBean()//method namecollegeBean is the bean id by default\n\t{\n\t\tCollege college=new College();\n\t\tcollege.setTeacher(teacher()); //setter injection\n\t\treturn college;\n\t}",
"@Override\r\n\tpublic void salvar() {\n\r\n\t}",
"public ListarInscritosManagedBean() {\n this.member1Service = new Member1Service();\n }",
"public ClienteBean() {\n }",
"public ClasseBean() {\r\n }",
"public ClasseBean() {\r\n }",
"public PeopleBean() {\n\n }",
"@Local\npublic interface IGestionarUsuarioBean {\n\n\t\n\t/**\n\t * \n\t * Metodo encargado de crear un usuario y persistirlo\n\t * \n\t * @author ccastano\n\t * \n\t * @param comicNuevo informacion nueva a crear\n\t */\n\tpublic ResultadoDTO crearUsuario(UsuarioDTO UsuarioDTO)throws EntityExistsException, IllegalArgumentException;\n\n\t/**\n\t * \n\t * Metodo encargado de consultar un usuari o modificar su nombre y guardarlo\n\t * \n\t * @author ccastano\n\t * \n\t * @param comicModificar informacion nueva a modificar\n\t */\n\tpublic ResultadoDTO modificarUsuario(String id, String nombre, UsuarioDTO usuarioDTO)throws IllegalArgumentException;\n\n\t/**\n\t * \n\t * Metodo encargado de eliminar un afiliado modificarlo y guardarlo\n\t * \n\t * @author ccastano\n\t * \n\t * @param comicEliminar informacion a eliminar\n\t */\n\tpublic void ponerUsuarioInactivo(String idUsuario);\n\n\t/**\n\t * \n\t * Metodo encargado de retornar la informacion de un usuario\n\t * \n\t * @param idUsuario identificador del usuarioo a ser consultado\n\t * @return usuario Resultado de la consulta\n\t * @throws Exception si no se recibe idComic\n\t */\n\tpublic UsuarioDTO consultarUsuario(String idAfiliado);\n\n\t/**\n\t * \n\t * Metodo encargado de retornar una lista de usuarios\n\t * \n\t * @return\n\t */\n\tpublic List<UsuarioDTO> consultarUsuarios();\n\t\n\t/**\n\t * metodo encargado de validar fecha de ingreso\n\t * @param fechaIngresada\n\t * @return true si es una fecha valida, flase de lo contrario\n\t */\n\tpublic Boolean validarFecha(LocalDate fechaIngresada);\n\t\n\t/**\n\t * metodo encargado de validar si un usuario esta activo\n\t * @param idUsuario\n\t * @return true si el usuario esta activo , false de lo contrario\n\t */\n\tpublic Boolean validarUsuarioActivo(String idUsuario);\n\t\n\t\n}",
"public AdmissionsBean() {\n }",
"private UserPrefernce(){\r\n\t\t\r\n\t}",
"@Override\n public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {\n return bean;\n }",
"@PostConstruct\n\tpublic void inicializar() {\n\t}",
"public ModelAccessException() {\n\t\tsuper();\n\n\t}",
"@Override\n\tpublic BoardVO admin_read(BoardVO obj) {\n\t\treturn null;\n\t}",
"public Empresa getEmpresa()\r\n/* 84: */ {\r\n/* 85:131 */ return this.empresa;\r\n/* 86: */ }",
"public PersistableBusinessObject manageReadOnly(PersistableBusinessObject bo) {\r\n\t\treturn bo;\r\n\t}",
"protected boolean isReadOnly()\n {\n return true;\n }",
"private RepositorioOrdemServicoHBM() {\n\n\t}",
"@Override\r\n\tprotected <T> T getServiceBean() {\n\t\treturn null;\r\n\t}",
"@Bean(initMethod=\"initMethod\",destroyMethod=\"destroyMethod\")\r\n\tpublic Student getStudent() {\n\t\treturn new Student();\r\n\r\n\t}",
"@Test\r\n public void testReadWrite() throws Throwable {\r\n System.out.println(\"testReadWrite\");\r\n\r\n Long o0 = Long.MAX_VALUE;\r\n Integer o1 = 1;\r\n String o2 =\"TEST\";\r\n Date o3 = new Date();\r\n Float o4 = 123456.456F;\r\n\r\n BeanUjoImpl ujb = new BeanUjoImpl();\r\n\r\n BeanUjoImpl.PRO_P0.setValue(ujb, o0);\r\n BeanUjoImpl.PRO_P1.setValue(ujb, o1);\r\n BeanUjoImpl.PRO_P2.setValue(ujb, o2);\r\n BeanUjoImpl.PRO_P3.setValue(ujb, o3);\r\n BeanUjoImpl.PRO_P4.setValue(ujb, o4);\r\n BeanUjoImpl.PRO_P0.setValue(ujb, o0);\r\n BeanUjoImpl.PRO_P1.setValue(ujb, o1);\r\n BeanUjoImpl.PRO_P2.setValue(ujb, o2);\r\n BeanUjoImpl.PRO_P3.setValue(ujb, o3);\r\n BeanUjoImpl.PRO_P4.setValue(ujb, o4);\r\n\r\n assertEquals(o0, BeanUjoImpl.PRO_P0.of(ujb));\r\n assertEquals(o1, BeanUjoImpl.PRO_P1.of(ujb));\r\n assertEquals(o2, BeanUjoImpl.PRO_P2.of(ujb));\r\n assertEquals(o3, BeanUjoImpl.PRO_P3.of(ujb));\r\n assertEquals(o4, BeanUjoImpl.PRO_P4.of(ujb));\r\n assertEquals(o0, BeanUjoImpl.PRO_P0.of(ujb));\r\n assertEquals(o1, BeanUjoImpl.PRO_P1.of(ujb));\r\n assertEquals(o2, BeanUjoImpl.PRO_P2.of(ujb));\r\n assertEquals(o3, BeanUjoImpl.PRO_P3.of(ujb));\r\n assertEquals(o4, BeanUjoImpl.PRO_P4.of(ujb));\r\n\r\n }",
"@Override\n public void perish() {\n \n }",
"public RegistroBean() {\r\n }",
"public UpdateClassManagedBean() {\n }",
"public loginBean() {\n }",
"public boolean update(BaseBean baseBean) throws Exception {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"public JavaBeans() {\r\n\t\tsuper();\r\n\t}"
] | [
"0.6278604",
"0.59894216",
"0.5894083",
"0.58656996",
"0.5852728",
"0.5847511",
"0.5788398",
"0.57446295",
"0.57083917",
"0.570424",
"0.5701733",
"0.57000715",
"0.568666",
"0.5656174",
"0.5645459",
"0.56441283",
"0.56307626",
"0.5614547",
"0.5589156",
"0.5588384",
"0.5586463",
"0.55701774",
"0.55675566",
"0.5549768",
"0.55483377",
"0.55432916",
"0.5536602",
"0.55305934",
"0.5513056",
"0.551227",
"0.5504845",
"0.5484345",
"0.54771835",
"0.547291",
"0.54657227",
"0.54653364",
"0.5452488",
"0.5448307",
"0.5448307",
"0.544652",
"0.5444291",
"0.5440878",
"0.5440878",
"0.54355466",
"0.5434337",
"0.54297906",
"0.54292756",
"0.5426419",
"0.5415841",
"0.54137284",
"0.5412012",
"0.54118073",
"0.54101604",
"0.54023165",
"0.5397378",
"0.53898054",
"0.53841174",
"0.5381682",
"0.5380853",
"0.5376705",
"0.53728867",
"0.537199",
"0.537142",
"0.53701645",
"0.5366679",
"0.53597593",
"0.5355844",
"0.53549534",
"0.53531504",
"0.5353102",
"0.53473866",
"0.5343406",
"0.5343332",
"0.5335321",
"0.5331904",
"0.5325667",
"0.5324033",
"0.5323946",
"0.5323946",
"0.5318527",
"0.5312649",
"0.531076",
"0.53073835",
"0.5306788",
"0.53056633",
"0.5303597",
"0.5303431",
"0.5303097",
"0.53011346",
"0.5289876",
"0.52894217",
"0.5286239",
"0.5279275",
"0.52772117",
"0.52756375",
"0.5273617",
"0.5272204",
"0.52702445",
"0.5265526",
"0.52603525",
"0.52542925"
] | 0.0 | -1 |
TODO: Warning this method won't work in the case the id fields are not set | @Override
public boolean equals(Object object) {
if (!(object instanceof ParametroGeneracionCapacitacion)) {
return false;
}
ParametroGeneracionCapacitacion other = (ParametroGeneracionCapacitacion) object;
if ((this.codigo == null && other.codigo != null) || (this.codigo != null && !this.codigo.equals(other.codigo))) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setId(Integer id) { this.id = id; }",
"private Integer getId() { return this.id; }",
"public void setId(int id){ this.id = id; }",
"public void setId(Long id) {this.id = id;}",
"public void setId(Long id) {this.id = id;}",
"public void setID(String idIn) {this.id = idIn;}",
"public void setId(int id) { this.id = id; }",
"public void setId(int id) { this.id = id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public int getId() { return id; }",
"public void setId(long id) { this.id = id; }",
"public void setId(long id) { this.id = id; }",
"public int getId(){ return id; }",
"public int getId() {return id;}",
"public int getId() {return Id;}",
"public int getId(){return id;}",
"public void setId(long id) {\n id_ = id;\n }",
"private int getId() {\r\n\t\treturn id;\r\n\t}",
"public Integer getId(){return id;}",
"public int id() {return id;}",
"public long getId(){return this.id;}",
"public int getId(){\r\n return this.id;\r\n }",
"@Override public String getID() { return id;}",
"public Long id() { return this.id; }",
"public Integer getId() { return id; }",
"@Override\n\tpublic Integer getId() {\n return id;\n }",
"@Override\n public Long getId () {\n return id;\n }",
"@Override\n public long getId() {\n return id;\n }",
"public Long getId() {return id;}",
"public Long getId() {return id;}",
"public String getId(){return id;}",
"@Override\r\n\tpublic Long getId() {\n\t\treturn null;\r\n\t}",
"public Integer getId() { return this.id; }",
"@Override\r\n public int getId() {\n return id;\r\n }",
"@Override\n\t\tpublic long getId() {\n\t\t\treturn 0;\n\t\t}",
"public int getId() {\n return id;\n }",
"public long getId() { return _id; }",
"public int getId() {\n/* 35 */ return this.id;\n/* */ }",
"public long getId() { return id; }",
"public long getId() { return id; }",
"public void setId(Long id) \n {\n this.id = id;\n }",
"@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic Long getId() {\n\t\treturn null;\n\t}",
"public void setId(String id) {\n this.id = id;\n }",
"@Override\n\tpublic void setId(Long id) {\n\t}",
"public Long getId() {\n return id;\n }",
"public long getId() { return this.id; }",
"public int getId()\n {\n return id;\n }",
"public void setId(int id){\r\n this.id = id;\r\n }",
"@Test\r\n\tpublic void testSetId() {\r\n\t\tbreaku1.setId(5);\r\n\t\texternu1.setId(6);\r\n\t\tmeetingu1.setId(7);\r\n\t\tteachu1.setId(8);\r\n\r\n\t\tassertEquals(5, breaku1.getId());\r\n\t\tassertEquals(6, externu1.getId());\r\n\t\tassertEquals(7, meetingu1.getId());\r\n\t\tassertEquals(8, teachu1.getId());\r\n\t}",
"protected abstract String getId();",
"@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}",
"public int getID() {return id;}",
"public int getID() {return id;}",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public String getId() { return id; }",
"public int getId ()\r\n {\r\n return id;\r\n }",
"@Override\n public int getField(int id) {\n return 0;\n }",
"public void setId(Long id)\n/* */ {\n/* 66 */ this.id = id;\n/* */ }",
"public int getId(){\r\n return localId;\r\n }",
"void setId(int id) {\n this.id = id;\n }",
"@Override\n public Integer getId() {\n return id;\n }",
"@Override\n\tpublic Object selectById(Object id) {\n\t\treturn null;\n\t}",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"@Override\n public int getId() {\n return id;\n }",
"@Override\n public int getId() {\n return id;\n }",
"public void setId(int id)\n {\n this.id=id;\n }",
"@Override\r\n public int getID()\r\n {\r\n\treturn id;\r\n }",
"@Override\n\tpublic Integer getId() {\n\t\treturn null;\n\t}",
"public int getId()\r\n {\r\n return id;\r\n }",
"public void setId(Long id){\n this.id = id;\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"@java.lang.Override\n public int getId() {\n return id_;\n }",
"private void clearId() {\n \n id_ = 0;\n }",
"final protected int getId() {\n\t\treturn id;\n\t}",
"public abstract Long getId();",
"public void setId(Long id) \r\n {\r\n this.id = id;\r\n }",
"@Override\n public long getId() {\n return this.id;\n }",
"public String getId(){ return id.get(); }",
"@SuppressWarnings ( \"unused\" )\n private void setId ( final Long id ) {\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(long id){\n this.id = id;\n }",
"public void setId(Integer id)\r\n/* */ {\r\n/* 122 */ this.id = id;\r\n/* */ }",
"public Long getId() \n {\n return id;\n }",
"@Override\n\tpublic void setId(int id) {\n\n\t}",
"public void test_getId() {\n assertEquals(\"'id' value should be properly retrieved.\", id, instance.getId());\n }",
"@Override\r\n\tpublic Object getId() {\n\t\treturn null;\r\n\t}",
"public int getID(){\n return id;\n }",
"public int getId()\n {\n return id;\n }",
"public String getID(){\n return Id;\n }"
] | [
"0.6896886",
"0.6838461",
"0.67056817",
"0.66419715",
"0.66419715",
"0.6592331",
"0.6579151",
"0.6579151",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.6574321",
"0.65624106",
"0.65624106",
"0.65441847",
"0.65243006",
"0.65154546",
"0.6487427",
"0.6477893",
"0.6426692",
"0.6418966",
"0.6416817",
"0.6401561",
"0.63664836",
"0.63549376",
"0.63515353",
"0.6347672",
"0.6324549",
"0.6319196",
"0.6301484",
"0.62935394",
"0.62935394",
"0.62832105",
"0.62710917",
"0.62661785",
"0.6265274",
"0.6261401",
"0.6259253",
"0.62559646",
"0.6251244",
"0.6247282",
"0.6247282",
"0.6245526",
"0.6238957",
"0.6238957",
"0.6232451",
"0.62247443",
"0.6220427",
"0.6219304",
"0.6211484",
"0.620991",
"0.62023336",
"0.62010616",
"0.6192621",
"0.61895776",
"0.61895776",
"0.61893976",
"0.61893976",
"0.61893976",
"0.6184292",
"0.618331",
"0.61754644",
"0.6173718",
"0.6168409",
"0.6166131",
"0.6161708",
"0.6157667",
"0.6157667",
"0.6157667",
"0.6157667",
"0.6157667",
"0.6157667",
"0.6157667",
"0.61556244",
"0.61556244",
"0.61430943",
"0.61340135",
"0.6128617",
"0.6127841",
"0.61065215",
"0.61043483",
"0.61043483",
"0.6103568",
"0.61028486",
"0.61017346",
"0.6101399",
"0.6098963",
"0.6094214",
"0.6094",
"0.6093529",
"0.6093529",
"0.6091623",
"0.60896",
"0.6076881",
"0.60723215",
"0.6071593",
"0.6070138",
"0.6069936",
"0.6069529"
] | 0.0 | -1 |
Sets up socket listeners | public void configureSocketEvents() {
socket.on("startGame", new Emitter.Listener() {
@Override
public void call(Object... args) {
JSONObject data = (JSONObject) args[0];
try {
String start = (String) data.getString("room");
if (start.equals(roomHost)) {
startGame = true;
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}).on("playerNames", new Emitter.Listener() {
@Override
public void call(Object... args) {
JSONArray data = (JSONArray) args[0];
try {
for (int i = 0; i < data.length(); i++) {
playerNames[i] = (String) data.getString(i);
}
for (int i = data.length(); i < maxPlayers; i++) {
playerNames[i] = "Empty";
}
updateNames();
} catch (JSONException e) {
Gdx.app.log("multiplayer", "unable to update names");
}
}
}).on("maxPlayers", new Emitter.Listener() {
@Override
public void call(Object... args) {
JSONObject data = (JSONObject) args[0];
try {
maxPlayers = (int) data.getInt("maxPlayers");
} catch (JSONException e) {
Gdx.app.log("multiplayer", "unable to get max players");
}
}
}).on("lobbyUpdate", new Emitter.Listener() {
@Override
public void call(Object... args) {
JSONObject data = (JSONObject) args[0];
try {
String room = (String) data.getString("id");
if (room.equals(roomHost)) {
updateLobby();
}
} catch (JSONException e) {
Gdx.app.log("multiplayer", "unable to get max players");
}
}
}).on("roomCanceled", new Emitter.Listener() {
@Override
public void call(Object... args) {
JSONObject data = (JSONObject) args[0];
try {
String room = (String) data.getString("roomid");
if (room.equals(roomHost)) {
mainmenu = true;
}
} catch (JSONException e) {
Gdx.app.log("multiplayer", "unable to get max players");
}
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}",
"private void createAndListen() {\n\n\t\t\n\t}",
"private void initSocketWithHandlers() {\n\t\tfor(String key: eventHandlerMap.keySet()) {\n\t\t\tmSocket.on(key, eventHandlerMap.get(key));\n\t\t}\n\t}",
"private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"public void startListeningForConnection() {\n startInsecureListeningThread();\n }",
"private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}",
"public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}",
"public void startListening() {\r\n\t\tlisten.startListening();\r\n\t}",
"protected void installListeners() {\n\t}",
"protected void installListeners() {\n\n\t}",
"protected void installListeners() {\n }",
"protected void installListeners() {\n }",
"public void setup_connections()\n {\n setup_servers();\n setup_clients();\n }",
"private void listen() {\n\t\ttry {\n\t\t\tServerSocket servSocket = new ServerSocket(PORT);\n\t\t\tSocket clientSocket;\n\t\t\twhile(true) {\n\t\t\t\tclientSocket = servSocket.accept();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error - Could not open connection\");\n\t\t}\n\t\t\n\t}",
"private void setListeners() {\n\n }",
"public void setup_servers()\n {\n // get ServerInfo\n ServerInfo t = new ServerInfo();\n // all 3 servers\n for(int i=0;i<3;i++)\n {\n // get the server IP and port info\n String t_ip = t.hmap.get(i).ip;\n int t_port = Integer.valueOf(t.hmap.get(i).port);\n Thread x = new Thread()\n {\n public void run()\n {\n try\n {\n Socket s = new Socket(t_ip,t_port);\n // SockHandle instance with svr_hdl true and rx_hdl false as this is the socket initiator\n SockHandle t = new SockHandle(s,my_ip,my_port,my_c_id,c_list,s_list,false,true,cnode);\n }\n catch (UnknownHostException e) \n {\n \tSystem.out.println(\"Unknown host\");\n \tSystem.exit(1);\n } \n catch (IOException e) \n {\n \tSystem.out.println(\"No I/O\");\n e.printStackTrace(); \n \tSystem.exit(1);\n }\n }\n };\n \n x.setDaemon(true); \t// terminate when main ends\n x.setName(\"Client_\"+my_c_id+\"_SockHandle_to_Server\"+i);\n x.start(); \t\t\t// start the thread\n }\n }",
"public void setUpNetworking() throws Exception {\n this.serverSock = new ServerSocket(4242);\n\n groupChats = new HashMap<String, ArrayList<String>>();\n groupMessages = new HashMap<String, ArrayList<String>>();\n groupMessages.put(\"Global\", new ArrayList<String>());\n\n int socketOn = 0;\n\n while (true) {\n\n Socket clientSocket = serverSock.accept();\n System.out.println(\"Received connection \" + clientSocket);\n\n ClientObserver writer = new ClientObserver(clientSocket.getOutputStream());\n\n Thread t = new Thread(new ClientHandler(clientSocket, writer));\n t.start();\n System.out.println(\"Connection Established\");\n socketOn = 1;\n }\n }",
"public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}",
"public void listen()\n {\n service = new BService (this.classroom, \"tcp\");\n service.register();\n service.setListener(this);\n }",
"public void startListening() {\n\twhile (true) {\n\t try {\n\t\tSocket s = socket.accept();\n\n\t\tnew TCPSessionClient(s, this.clients);\n\t } // end of try\n\n\t catch (IOException e) {\n\t\te.printStackTrace();\n\t } // end of catch\n\t} // end of while\n }",
"public static void startServer() {\n clientListener.startListener();\n }",
"private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}",
"public void startListener() throws BindException, Exception{ // NOPMD by luke on 5/26/07 11:10 AM\n\t\tsynchronized (httpServerMutex){\n\t\t\t// 1 -- Shutdown the previous instances to prevent multiple listeners\n\t\t\tif( webServer != null )\n\t\t\t\twebServer.shutdownServer();\n\t\t\t\n\t\t\t// 2 -- Spawn the appropriate listener\n\t\t\twebServer = new HttpServer();\n\t\t\t\n\t\t\t// 3 -- Start the listener\n\t\t\twebServer.startServer( serverPort, sslEnabled);\n\t\t}\n\t}",
"private void setUpNetworking() {\n\t\ttry {\n\t\t\t// setup a socket to the server\n\t\t\tsock = new Socket(\"127.0.0.1\", 5000);\n\n\t\t\t// flow for reader client -> buffered reader -> inputstream reader\n\t\t\tInputStreamReader streamReader = new InputStreamReader(sock.getInputStream());\n\t\t\treader = new BufferedReader(streamReader);\n\n\t\t\t// flow for writer client -> printwriter ->outputstream -> server\n\t\t\twriter = new PrintWriter(sock.getOutputStream());\n\t\t\tSystem.out.println(\"networking established\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}",
"private void initServerSock(int port) throws IOException {\n\tserver = new ServerSocket(port);\n\tserver.setReuseAddress(true);\n }",
"public void attachSockets(ArrayList<Socket> sockets) {\n\t}",
"public void addConnectionListener(ConnectionListener listener);",
"public void start(int port)\n\t{\n\t\t// Initialize and start the server sockets. 08/10/2014, Bing Li\n\t\tthis.port = port;\n\t\ttry\n\t\t{\n\t\t\tthis.socket = new ServerSocket(this.port);\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// Initialize a disposer which collects the server listener. 08/10/2014, Bing Li\n\t\tMyServerListenerDisposer disposer = new MyServerListenerDisposer();\n\t\t// Initialize the runner list. 11/25/2014, Bing Li\n\t\tthis.listenerRunnerList = new ArrayList<Runner<MyServerListener, MyServerListenerDisposer>>();\n\t\t\n\t\t// Start up the threads to listen to connecting from clients which send requests as well as receive notifications. 08/10/2014, Bing Li\n\t\tRunner<MyServerListener, MyServerListenerDisposer> runner;\n\t\tfor (int i = 0; i < ServerConfig.LISTENING_THREAD_COUNT; i++)\n\t\t{\n\t\t\trunner = new Runner<MyServerListener, MyServerListenerDisposer>(new MyServerListener(this.socket, ServerConfig.LISTENER_THREAD_POOL_SIZE, ServerConfig.LISTENER_THREAD_ALIVE_TIME), disposer, true);\n\t\t\tthis.listenerRunnerList.add(runner);\n\t\t\trunner.start();\n\t\t}\n\n\t\t// Initialize the server IO registry. 11/07/2014, Bing Li\n\t\tMyServerIORegistry.REGISTRY().init();\n\t\t// Initialize a client pool, which is used by the server to connect to the remote end. 09/17/2014, Bing Li\n\t\tClientPool.SERVER().init();\n\t}",
"@Override\n\tpublic void StartListening()\n\t{\n\t\t\n\t}",
"private void registerConnectivityListeners() {\n\t\tregisterReceiver(mBroadcastReceiver,\n\t\t\t\tnew IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));\n\t\t// mobile connection strength changes\n\t\tmSigStateListener = new SSListener();\n\t\t((TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE)).listen(mSigStateListener,\n\t\t\t\tPhoneStateListener.LISTEN_SIGNAL_STRENGTHS);\n\t}",
"protected void attachListeners() {\n\t\t\n\t}",
"@Override\r\n\tpublic void initListeners() {\n\t\t\r\n\t}",
"protected void bindListener() {\n locationManager= TencentLocationManager.getInstance(this);\n int error = locationManager\n .requestLocationUpdates(\n TencentLocationRequest\n .create().setInterval(3000)\n .setRequestLevel(\n TencentLocationRequest.REQUEST_LEVEL_ADMIN_AREA), this);\n\n switch (error) {\n case 0:\n Log.e(\"location\", \"成功注册监听器\");\n break;\n case 1:\n Log.e(\"location\", \"设备缺少使用腾讯定位服务需要的基本条件\");\n break;\n case 2:\n Log.e(\"location\", \"manifest 中配置的 key 不正确\");\n break;\n case 3:\n Log.e(\"location\", \"自动加载libtencentloc.so失败\");\n break;\n\n default:\n break;\n }\n }",
"void registerListeners();",
"@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\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(\"LocalProxy run on \" + port);\r\n\t}",
"private void setUpServerThread() {\n\t\ttry {\n\t\t\tthis.incomingMsgNodes = new TCPServerThread(0, this);\n\t\t\tThread thread = new Thread(incomingMsgNodes);\n\t\t\tthread.start();\n\t\t\tthis.myServerThreadPortNum = incomingMsgNodes.getPort();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage()\n\t\t\t\t\t+ \" Trouble creating Server Socket\");\n\t\t}\n\t}",
"@Override\n protected void startListener(){\n Socket socket = null;\n while (isRunning()){\n socket = acceptSocket();\n if (socket == null) {\n continue;\n }\n \n try {\n handleConnection(socket);\n } catch (Throwable ex) {\n getLogger().log(Level.FINE, \n \"selectorThread.handleConnectionException\",\n ex);\n try {\n socket.close(); \n } catch (IOException ioe){\n // Do nothing\n }\n continue;\n }\n } \n }",
"public void initialize() throws SocketException{\n defPortUsed = true;\n initializeReal(defPortNumber, defPacketSize);\n }",
"@Override\n\tprotected void initListeners() {\n\t\t\n\t}",
"@Override\r\n\tprotected void setListeners() {\n\t\t\r\n\t}",
"public void setSocket(SocketWrapper socket);",
"private void runServer() {\n while(true) {\n try {\n SSLSocket socket = (SSLSocket)listener.accept();\n\n this.establishClient(socket);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }",
"private void setupStreams() {\n\t\ttry {\n\t\t\tthis.out = new ObjectOutputStream(this.sock.getOutputStream());\n\t\t\tthis.out.flush();\n\t\t\tthis.in = new ObjectInputStream(this.sock.getInputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void run() {\n try {\n this.initialize();\n Listener ln = new Listener(localDir, port);\n ln.run();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void startListening();",
"public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }",
"public void start()\n throws IOException, StunException\n {\n localSocket = new IceUdpSocketWrapper(\n new SafeCloseDatagramSocket(serverAddress));\n\n stunStack.addSocket(localSocket);\n stunStack.addRequestListener(serverAddress, this);\n\n }",
"@Override\r\n\tpublic void start(Socket socket){}",
"public void initializeBuffers(){\r\n\t\ttry {\r\n\t\t\tif(_socket == null) {\r\n\t\t\t\t_connectedSocket = false;\r\n\t\t\t\tthrow(new IOException(\"Cannot initialize connections before socket has been initialized.\"));\r\n\t\t\t}\r\n\t\t\t// Obter printer e reader para o socket\r\n\t\t\t_out = new PrintWriter(_socket.getOutputStream(), true);\r\n\t\t\t_in = new BufferedReader(new InputStreamReader(_socket.getInputStream()));\r\n\t\t\t_outputStream = _socket.getOutputStream();\r\n\t\t\t_connected = true;\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.err.println(\"Nao se conseguiram inicializar os buffers para ler da conexao: \" + e.toString());\r\n\t\t\t_connected = false;\r\n\t\t\t//System.exit(1);\r\n\t\t}\r\n\t\r\n\r\n\t}",
"public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }",
"protected void startAll() throws Throwable {\n\t\tthis.udpServer = new UDPServer(this.agent);\n\t\tthis.connectionServer = new TCPServer(this.agent);\n\t}",
"public ConnListener( MasterServerManager serverManager )\n {\n this.serverManager = serverManager;\n }",
"public abstract void listen(ServiceConfig serviceConfig) throws IOException;",
"public void listen() throws Exception {\n if (serverSocket != null) {\n try {\n serverSocket.setSoTimeout(0);\n } catch (SocketException sx) {\n sx.printStackTrace();\n }\n }\n }",
"@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }",
"void onListeningStarted();",
"private void registerReceivers() { \n\t\t\n\t\tregisterReceiver ( mConnReceiver, new IntentFilter ( ConnectivityManager.CONNECTIVITY_ACTION ) );\n\t\n\t}",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tlisten();\n\t\t\t\t}",
"public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}",
"public GetConnListener() {\n }",
"public void initializeResolveListener() {\n mResolveListener = new NsdManager.ResolveListener() {\n\n @Override\n public void onResolveFailed(NsdServiceInfo serviceInfo, int errorCode) {\n Log.e(TAG, \"Resolve failed\" + errorCode);\n }\n\n @Override\n public void onServiceResolved(NsdServiceInfo serviceInfo) {\n Log.e(TAG, \"Resolve Succeeded. \" + serviceInfo);\n\n if (serviceInfo.getServiceName().equals(mServiceName)) {\n Log.d(TAG, \"Same IP.\");\n return;\n }\n mService = serviceInfo;\n receivedServices = serviceInfo.toString();\n\n }\n };\n }",
"@Override\n\tpublic void listenerStarted(ConnectionListenerEvent evt) {\n\t\t\n\t}",
"public ServerListener(ServerSocket socket) {\n\t\tsuper();\n\t\tthis.socket = socket;\n\t}",
"public void add(ConnectionListener connectionListener) throws ServerException;",
"public synchronized void initListenInfo(@Nonnull String address, int port) {\n if (listenAddress != null) {\n throw new IllegalStateException(\"Already initialized\");\n }\n this.listenAddress = address;\n this.listenPort = port;\n }",
"@Before\n public void setUp() throws IOException {\n serverSocket = new ServerSocket(0, 1);\n }",
"private void setupListeners() {\n\t\tfor (int i = 0; i < _controlPoints.length; i++) {\n\t\t\taddControlPointListener(_controlPoints[i][0], i);\n\t\t\taddControlPointListener(_controlPoints[i][1], i);\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < _selectionButtons.length; i++) {\n\t\t\taddPointSelectionButtonListener(i);\n\t\t}\n\t}",
"protected void registerSockets() {\n if (!registerQueue.isEmpty()) {\n SocketChannel chan;\n while ((chan = registerQueue.poll()) != null) {\n System.out.println(Thread.currentThread().getName() + \": registering a new socket\");\n try {\n chan.configureBlocking(false);\n chan.register(selector, SelectionKey.OP_READ);\n } catch (IOException e) {\n //ignore the failure of not registering a socket\n //it shouldn't affect the rest of the program\n this.logger().log(e);\n e.printStackTrace();\n }\n }\n }\n }",
"public abstract void registerListeners();",
"private void listenForConnection() throws IOException {\n\twhile(true) {\n System.out.println(\"Waiting for connection...\");\n // Wait for client to connect\n Socket cli = server.accept();\n if(connlist.size() < MAX_CONN) {\n\t\t// if numCli is less then 100\n initConnection(cli);\n }\n\t}\n }",
"protected void bind() throws SocketException {\n super.bind();\n\n //start the secure socket\n dtlsSocket = options.getSecurePort() > 0 ? new DatagramSocket(options.getSecurePort()) : new DatagramSocket();\n dtslReceiverThread = createDatagramServer(\"mqttsn-dtls-receiver\", options.getReceiveBuffer(), dtlsSocket);\n }",
"public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }",
"private void startThreads() {\n Listener listener = new Listener();\n Thread listenerThread = new Thread(listener);\n\n listenerThread.start();\n }",
"@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"protected void connect() {\n for (int attempts = 3; attempts > 0; attempts--) {\n try {\n Socket socket = new Socket(\"localhost\", serverPort);\n attempts = 0;\n\n handleConnection(socket);\n }\n catch (ConnectException e) {\n // Ignore the 'connection refused' message and try again.\n // There may be other relevant exception messages that need adding here.\n if (e.getMessage().equals(\"Connection refused (Connection refused)\")) {\n if (attempts - 1 > 0) {\n // Print the number of attempts remaining after this one.\n logger.warning(\"Connection failed (\" + name + \"). \" + \n (attempts - 1) + \" attempts remaining.\");\n }\n else {\n logger.severe(\"Connection failed (\" + name + \"). \");\n }\n }\n else {\n logger.severe(e.toString());\n break;\n }\n }\n catch (Exception e) {\n logger.severe(\"Socket on module '\" + name + \"': \" + e.toString());\n }\n }\n }",
"private void setSockets()\n {\n String s = (String) JOptionPane.showInputDialog(null,\n \"Select Number of Sockets:\", \"Sockets\",\n JOptionPane.PLAIN_MESSAGE, null, socketSelect, \"1\");\n\n if ((s != null) && (s.length() > 0))\n {\n totalNumThreads = Integer.parseInt(s);\n }\n else\n {\n totalNumThreads = 1;\n }\n\n recoveryQueue.setMaxSize(totalNumThreads * 10);\n }",
"public void setup(){\n\t\ttry{\n\t\t\tSocket serverSocket;\n\t\t\tboolean serverRunning = true;\n\t\t\twhile(serverRunning == true){\n\t\t\t\t serverSocket = server.accept();\n\t\t\t\t System.out.println(\"Connected to the server!\");\n\t\t\t\t DungeonClient connectedClient = new DungeonClient(serverSocket, game);\n\t\t\t\t connectedClient.start();\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e){\n\t\t\tSystem.out.println(\"Sorry, there was an IOException!\");\n\t\t}\n\t}",
"private void initListener()\n {\n listenerTimer = new Timer();\n listenerTimer.schedule(new RemoteListner(this), 1000, 2000);\n }",
"@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }",
"public void init() {\r\n\t\ttry {\r\n\t\t\tmessages = new ConcurrentLinkedDeque<>();\r\n\t\t\tout = sock.getOutputStream();\r\n\t\t\tin = sock.getInputStream();\t\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstartMessageThread();\r\n\t}",
"@Override\r\n\tprotected void listeners() {\n\t\t\r\n\t}",
"@Override\n public void beforeAll(ExtensionContext context) {\n localServer = RSocketFactory.receive()\n .acceptor((setupPayload, rSocket) -> Mono.just(new SimpleResponderImpl(setupPayload, rSocket)))\n .transport(LocalServerTransport.create(\"test\"))\n .start()\n .block();\n }",
"private RRCPConnectionListener() {\n mainThread = new Thread(this);\n }",
"@SuppressWarnings(\"resource\")\r\n\tprivate void tryToSetupServer() {\r\n\t\ttry {\r\n\t\t\tsetupStream.write(\"Trying to start on \" + Inet4Address.getLocalHost().toString() + \":\" + port);\r\n\t\t\tcientConn = new ServerSocket(port).accept();\r\n\t\t\tsetupStream.write(\"Client connectd, ready for data\");\r\n\t\t} catch (IOException e) {\r\n\t\t\tif(e.getMessage().contains(\"Bind failed\")) {\r\n\t\t\t\tsetupStream.write(\"You can't use that port\");\r\n\t\t\t} else if(e.getMessage().contains(\"Address already in use\")) {\r\n\t\t\t\tsetupStream.write(\"That port is already in use\");\r\n\t\t\t}\r\n\t\t\tport = -1;\r\n\t\t}\r\n\t}",
"public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }",
"private void initListener() {\n }",
"public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }",
"boolean addConnectionListener(LWSConnectionListener lis);",
"public synchronized void start() {\n if (D) Log.d(TAG, \"start\");\n\n // Cancel any thread attempting to make a connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}\n\n setState(STATE_LISTEN);\n }",
"public void startServer()\n\t{\n\t\twhile(true)\n\t\t{\n\t\t\tSystem.out.println(\"Listen\");\n\t\t\tif(listenInitialValuesRequest)\n\t\t\t{\n\t\t\t\tlistenInitialValuesRequest();\n\t\t\t}\n\t\t}\n\t}",
"private void ccListenerStarter(){\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t//spin off new ccListener\n\t\t\t\t\n\t\t\t\tThread listenerThread = new Thread(\n\t\t\t\t\t\tnew ClientCommunicatorListener(\n\t\t\t\t\t\t\t\tccSocket.getInputStream(), db, this));\n\t\t\t\t\n\t\t\t\tlistenerThread.start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"public void InitSocket(String server, int port) throws IOException {\n socket = new Socket(server, port);\n outputStream = socket.getOutputStream();\n\n Thread receivingThread = new Thread() {\n @Override\n public void run() {\n try {\n \n BufferedReader reader = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n String line;\n while ((line = reader.readLine()) != null)\n notifyObservers(line);\n } catch (IOException ex) {\n notifyObservers(ex);\n }\n }\n };\n receivingThread.start();\n }",
"public void setConnectionEstablishedListener()\r\n\t{\r\n\t\tchatModel.getConnectionEstablishedProperty().addListener(\r\n\t\t\t\tnew ChangeListener<Object>()\r\n\t\t\t\t{\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void changed(\r\n\t\t\t\t\t\t\tObservableValue<? extends Object> observable,\r\n\t\t\t\t\t\t\tObject oldValue, Object newValue)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif (chatModel.isConnectionEstablished())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tenableChat();\r\n\t\t\t\t\t\t\tdeconnecterButton.setDisable(false);\r\n\t\t\t\t\t\t\tbuttonConnexion.setDisable(true);\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tdisableChat();\r\n\t\t\t\t\t\t\tbuttonConnexion.setDisable(false);\r\n\t\t\t\t\t\t\tdeconnecterButton.setDisable(true);\r\n\t\t\t\t\t\t\tserver.closeServerSockets();\r\n\t\t\t\t\t\t\tserver.startOpenSocketThread();\r\n\t\t\t\t\t\t\tserver.startReceiveMessageThread();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t});\r\n\t}",
"public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }",
"public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }",
"public void startServers()\n {\n ExecutorService threads = Executors.newCachedThreadPool();\n threads.submit(new StartServer(host, port));\n threads.submit(new StartServer(host, port + 1));\n threads.shutdown();\n }",
"@Override\n\tpublic void onCreate() \n\t{\n\t\tconManager = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);\n\n\t\t// Timer is used to get info every UPDATE_TIME_PERIOD;\n\t\ttimer = new Timer(); \n\n\n\n\t\tThread thread = new Thread()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void run() {\t\t\t\n\n\t\t\t\tRandom random = new Random();\n\t\t\t\tint tryCount = 0;\n\t\t\t\twhile (socketOperator.startListening(10000 + random.nextInt(20000) ) == 0 )\n\t\t\t\t{\t\t\n\t\t\t\t\ttryCount++; \n\t\t\t\t\tif (tryCount > 10)\n\t\t\t\t\t{\n\t\t\t\t\t\t// if it can't listen a port after trying 10 times, give up...\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\t\t\n\t\tthread.start();\n\t}"
] | [
"0.69314146",
"0.6911977",
"0.68649286",
"0.6707174",
"0.6563931",
"0.65085596",
"0.6417585",
"0.63889843",
"0.63861495",
"0.63731265",
"0.6365616",
"0.6355563",
"0.6355563",
"0.6353548",
"0.6346587",
"0.63155156",
"0.6282069",
"0.6248683",
"0.6241215",
"0.62354124",
"0.6235281",
"0.6200128",
"0.6126332",
"0.61103094",
"0.60471004",
"0.60307604",
"0.6030597",
"0.60285074",
"0.595495",
"0.59305686",
"0.59127617",
"0.5890061",
"0.58721817",
"0.5864757",
"0.5857505",
"0.5852916",
"0.5841131",
"0.5834067",
"0.5826913",
"0.5815724",
"0.5800874",
"0.57881594",
"0.5787314",
"0.5766728",
"0.5758172",
"0.57511497",
"0.57246405",
"0.5715947",
"0.5715915",
"0.5713428",
"0.57001156",
"0.5691353",
"0.5687097",
"0.56809145",
"0.5673944",
"0.56610334",
"0.5657065",
"0.565157",
"0.56359786",
"0.5635029",
"0.56304264",
"0.56283",
"0.56279445",
"0.5627247",
"0.5626519",
"0.56236947",
"0.56127375",
"0.5611536",
"0.56006813",
"0.55973107",
"0.55930126",
"0.5583892",
"0.55819243",
"0.55767375",
"0.55747163",
"0.55740434",
"0.55736166",
"0.5573585",
"0.5573022",
"0.55631447",
"0.556138",
"0.55612403",
"0.5555841",
"0.5543711",
"0.55419886",
"0.55315554",
"0.5529515",
"0.552635",
"0.5522024",
"0.55217195",
"0.55170006",
"0.5515919",
"0.5508207",
"0.5507649",
"0.5475159",
"0.5474547",
"0.54725057",
"0.5469256",
"0.5462638",
"0.54618853"
] | 0.56443095 | 58 |
To zoom In page 6 time using CTRL and + keys. | public static void zoomIn(){
for(int i=0; i<6; i++){
driver.findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL, Keys.ADD));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void zoomIn() { zoomIn(1); }",
"public void zoomIn() {\n \t\tzoom(1);\n \t}",
"public void zoomIn() {\n\tsetZoom(getNextZoomLevel());\n}",
"public void zoomIn()\n {\n zoomIn(1, width >> 1, height >> 1);\n }",
"public void zoomIn() {\n if (scale < 0.8) {\n double scaleFactor = (scale + 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale += 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n\n }",
"public void zoomIn() {\n if (currentViewableRange.getLength() > 1) {\n zoomToLength(currentViewableRange.getLength() / 2);\n }\n }",
"@Override\n public void Zoom(double zoomNo) {\n\t \n }",
"void multitouchZoom(int new_zoom);",
"public void zoom_control()\n {\n simpleZoomControls.setOnZoomInClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _cnt++;\n int ss = _cnt / 60; int ss1 = _cnt % 60;\n _str_break = get_string(ss, ss1);\n mTxtBreakTime.setText(_str_break);\n }\n });\n // perform setOnZoomOutClickListener event on ZoomControls\n simpleZoomControls.setOnZoomOutClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _cnt--;\n if(_cnt <= 0) _cnt = 0;\n\n int ss = _cnt / 60; int ss1 = _cnt % 60;\n _str_break = get_string(ss, ss1);\n mTxtBreakTime.setText(_str_break);\n }\n });\n }",
"public static void zoomOut(){\n for(int i=0; i<6; i++){\n driver.findElement(By.tagName(\"html\")).sendKeys(Keys.chord(Keys.CONTROL, Keys.SUBTRACT));\n }\n }",
"public void zoomIn() {\n if (zoom > 0) {\n zoom--;\n spielPanel.setZoom(zoom);\n }\n }",
"public void zoomIn() {\n\t\tif (this.zoom + DELTA_ZOOM <= MAX_ZOOM)\n\t\t\tthis.setZoom(this.zoom + DELTA_ZOOM);\n\t}",
"public void zoomOut() { zoomOut(1); }",
"public void zoomIn(double i) {\n Rectangle2D r = getExtents();\n double exp = Math.pow(1.5,i); double cx = r.getX() + r.getWidth()/2, cy = r.getY() + r.getHeight()/2;\n setExtents(new Rectangle2D.Double(cx - r.getWidth()/(exp*2), cy - r.getHeight()/(exp*2), r.getWidth()/exp, r.getHeight()/exp));\n }",
"protected void zoomToPresent(){\n if(xpCursor1 >=0){\n ixDataCursor1 = ixDataShown[xpCursor1];\n }\n if(xpCursor2 >=0){\n ixDataCursor2 = ixDataShown[xpCursor2];\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n if(widgg.timeorg.timeSpread > 100) { widgg.timeorg.timeSpread /=2; }\n else { widgg.timeorg.timeSpread = 100; }\n bPaintAllCmd = true;\n widgg.redraw(100, 200);\n }",
"@Override\n public void Zoom(double zoomNo, boolean setZoom) {\n\t \n }",
"public void zoomIn() {\r\n \t\tgraph.setScale(graph.getScale() * 1.25);\r\n \t}",
"public static void changeCameraZoom(boolean zoomIn){\r\n\t\tif(zoomIn && zoomLevel > 0){\r\n\t\t\tzoomLevel -= 2;\r\n\t\t}else if(!zoomIn){\r\n\t\t\tzoomLevel += 2;\r\n\t\t}\r\n\t}",
"public void zoomScaleIn() {\n \t\tzoomScale(SCALE_DELTA_IN);\n \t}",
"private void actionZoomIn ()\r\n\t{\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\t//---- Calculate zoom scale factor\r\n\t\t\tdouble zoom = mainFormLink.getComponentPanelCenter().getComponentPanelImageView().transformZoom(+FormMainMouse.DEFAULT_ZOOM_DELTA); \r\n\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().repaint();\r\n\r\n\t\t\t//---- Set the current zoom, display the zoom scale factor in the GUI\r\n\t\t\tFormMainMouse.imageViewZoomScale = zoom;\r\n\t\t\tmainFormLink.getComponentPanelDown().getComponentLabelZoom().setText(String.valueOf(zoom));\r\n\t\t}\r\n\t}",
"public ProductGalleryPage zoomIn() {\n SpriiTestFramework.getInstance().waitForElement(By.xpath(zoomInElement), 2000);\n driver.findElement(By.xpath(zoomInElement)).click();\n return this;\n }",
"public void zoom() {\n\t\tdisp.zoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"public void setZoom(){\n\t\tactive.setZoom();\n\t}",
"@Override\n\tpublic void setZoom(int zoom) {\n\t\t\n\t}",
"protected void zoomToPast(){\n //zoom out\n int maxTimeSpread = widgg.timeorg.lastShortTimeDateInCurve - widgg.timeorg.firstShortTimeDateInCurve;\n if(xpCursor1 >=0){\n ixDataCursor1 = ixDataShown[xpCursor1];\n }\n if(xpCursor2 >=0){\n ixDataCursor2 = ixDataShown[xpCursor2];\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n if(widgg.timeorg.timeSpread < 0x3fffffff) { widgg.timeorg.timeSpread *=2; }\n else { widgg.timeorg.timeSpread = 0x7fffffff; }\n bPaintAllCmd = true;\n widgg.redraw(100, 200);\n \n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Zoom less\");\r\n\t\t\t}",
"public int getKeyZoomIn() {\r\n return getKeyUp();\r\n }",
"public void zoomNPinch(WebElement element){\n driver.zoom(element);\n driver.pinch(element);\n }",
"public void zoomOnAddress(){\n adjustZoomLvl(16000);\n adjustZoomFactor();\n }",
"@Override\n public void setZoom(double zoom)\n {\n super.setZoom(zoom);\n delayedRepainting.requestRepaint(ZOOM_REPAINT);\n }",
"public void zoom(int s) {\r\n\t\tzoom += s * ZOOM_FACTOR;\r\n\t}",
"private void dragZoom() {\n\n\t\tint width = this.getWidth();\n\n\t\tint start = cont.getStart();\n\t\tdouble amount = cont.getLength();\n\n\t\tint newStart = (int) DrawingTools.calculatePixelPosition(x ,width,amount,start);\n\t\tint newStop = (int) DrawingTools.calculatePixelPosition(x2,width,amount,start);\n\t\tx = x2 = 0;\n\n\t\tint temp;\n\t\tif (newStop < newStart){\n\t\t\ttemp = newStart;\n\t\t\tnewStart = newStop;\n\t\t\tnewStop = temp;\n\t\t}\n\n\t\tcont.changeSize(newStart,newStop);\n\n\t}",
"protected abstract void handleZoom();",
"public void zoomIn(){\n\t\t zoomed = modifyDimensions(picture.getWidth(),getHeight()); //in primul pas se maresc dimensiunile pozei\n\t\t for(int i = 0; i < zoomed.getHeight(); i += 2) {\n\t for(int j = 0; j < zoomed.getWidth(); j += 2) {\n\t zoomed.setRGB(j, i, picture.getRGB(j / 2,i / 2));\n\n\t if (j + 1 < zoomed.getWidth()) {\n\t zoomed.setRGB(j + 1, i, mediePixeli(picture.getRGB(j / 2, i / 2), picture.getRGB((j + 2) / 2, i / 2))); // intre doua coloane se adauga media pixelilor din acestea\n\t }\n\t }\n\t }\n\n\n\t for(int i = 1; i < zoomed.getHeight(); i += 2){\n\t \tfor(int j = 0; j < zoomed.getWidth(); j++ ){\n\t zoomed.setRGB(j, i, mediePixeli(picture.getRGB((j - 1) / 2, i / 2), picture.getRGB((j + 1) / 2, (i / 2))));\n\t }\n\t }\n\t \n\t }",
"private void checkForZoomIn(){\n if(checkIn == 1){\n zoomLevel++;\n adjustZoomFactor();\n checkOut = 1;\n checkIn = 0;\n } else{\n checkOut = 0;\n checkIn = 1;\n }\n\n }",
"protected void zoomBetweenCursors(){\n ixDataCursor1 = ixDataShown[xpCursor1];\n ixDataCursor2 = ixDataShown[xpCursor2];\n ixDataShowRight = ixDataCursor2 + (((ixDataCursor2 - ixDataCursor1) / 10) & widgg.mIxData);\n int ixiData1 = (ixDataShown[xpCursor1] >> widgg.shIxiData) & widgg.mIxiData;\n int ixiData2 = (ixDataShown[xpCursor2] >> widgg.shIxiData) & widgg.mIxiData;\n int time1 = widgg.tracksValue.getTimeShort(ixiData1);\n int time2 = widgg.tracksValue.getTimeShort(ixiData2);\n if((time2 - time1)>0){\n widgg.timeorg.timeSpread = (time2 - time1) * 10/8;\n assert(widgg.timeorg.timeSpread >0);\n } else {\n widgg.stop();\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n widgg.redraw(100, 200);\n \n }",
"public final void zoomIn(final int zoomStep) {\r\n\r\n final BufferedImage image = imageCanvas.getImage();\r\n\r\n //\r\n // no image, no zoom\r\n\r\n if (image == null) {\r\n return;\r\n }\r\n\r\n int zoomTmp = this.zoom;\r\n\r\n //\r\n // if zoom is best fit\r\n // calculate the zoom based on container size\r\n\r\n if (zoomTmp == ZOOM_BEST_FIT) {\r\n zoomTmp = ImageUtils.calculateSizeToFit(image, imageCanvas.getSize()).width * ZOOM_REAL_SIZE / image.getWidth();\r\n }\r\n\r\n //\r\n // calculate new zoom based on the step parameter\r\n\r\n int newZoom = (int) (Math.floor(((double) zoomTmp) / ((double) zoomStep)) + 1) * zoomStep;\r\n\r\n// if (newZoom == zoomTmp) {\r\n newZoom = newZoom + zoomStep;\r\n// }\r\n\r\n setZoom(newZoom);\r\n }",
"public void zoomOut() {\n if (scale > 0.05) {\n double scaleFactor = (scale - 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale -= 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n }",
"protected void primSetZoom(double zoom) {\n\tPoint p1 = getViewport().getClientArea().getCenter();\n\tPoint p2 = p1.getCopy();\n\tPoint p = getViewport().getViewLocation();\n\tdouble prevZoom = this.zoom;\n\tthis.zoom = zoom;\n\tpane.setScale(zoom);\n\tfireZoomChanged();\n\tgetViewport().validate();\n\t\n\tp2.scale(zoom / prevZoom);\n\tDimension dif = p2.getDifference(p1);\n\tp.x += dif.width;\n\tp.y += dif.height;\n\tsetViewLocation(p);\t\n}",
"public void setZoom(Integer zoom) {\n this.zoom = zoom;\n }",
"public void setZoom(Integer zoom) {\n this.zoom = zoom;\n }",
"public void keyPressed(KeyEvent e)\r\n\t{\r\n\t\tif (e.getKeyCode() == e.VK_UP)\r\n\t\t\ttranslatey++;\r\n\t\telse if (e.getKeyCode() == e.VK_DOWN)\r\n\t\t\ttranslatey--;\r\n\t\telse if (e.getKeyCode() == e.VK_LEFT)\r\n\t\t\ttranslatex--;\r\n\t\telse if (e.getKeyCode() == e.VK_RIGHT)\r\n\t\t\ttranslatex++;\r\n\t\telse if (e.getKeyCode() == e.VK_PLUS || e.getKeyCode() == 61)\r\n\t\t\tzoom = zoom + 0.1;\r\n\t\telse if (e.getKeyCode() == e.VK_MINUS)\r\n\t\t{\r\n\t\t\tzoom = zoom - 0.1;\r\n\t\t\tif (zoom < 0.1)\r\n\t\t\t\tzoom = 0.1;\r\n\t\t}\r\n\t\t\r\n\t\tv2d.zoom = zoom;\r\n\t\t\r\n\t\tv2d.keyPressed(e.getKeyCode());\r\n\t}",
"public void zoomOut() {\n \t\tzoom(-1);\n \t}",
"public int getKeyZoomOut() {\r\n return getKeyDown();\r\n }",
"@Override\n public void onHandle(EventObject eventObject)\n {\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @zoomend, Reverting to Map Zoom: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }",
"public void wheelZoom(MouseWheelEvent e) {\n try {\n int wheelRotation = e.getWheelRotation();\n Insets x = getInsets(); //Top bar space of the application\n Point p = e.getPoint();\n p.setLocation(p.getX() , p.getY()-x.top + x.bottom);\n if (wheelRotation > 0 && zoomLevel != 0) {\n //point2d before zoom\n Point2D p1 = transformPoint(p);\n transform.scale(1 / 1.2, 1 / 1.2);\n //point after zoom\n Point2D p2 = transformPoint(p);\n transform.translate(p2.getX() - p1.getX(), p2.getY() - p1.getY()); //Pan towards mouse\n checkForZoomOut();\n repaint();\n\n } else if (wheelRotation < 0 && zoomLevel != 20) {\n Point2D p1 = transformPoint(p);\n transform.scale(1.2, 1.2);\n Point2D p2 = transformPoint(p);\n transform.translate(p2.getX() - p1.getX(), p2.getY() - p1.getY()); //Pan towards mouse\n checkForZoomIn();\n repaint();\n }\n } catch (NoninvertibleTransformException ex) {\n ex.printStackTrace();\n }\n\n }",
"public void updateZoom() {\n camera.zoom = zoomLevel;\n }",
"void onZoom() {\n\t\tmZoomPending=true;\n\t}",
"public void onZoomIn(View view) {\n if (!checkReady()) {\n return;\n }\n changeCamera(CameraUpdateFactory.zoomIn());\n }",
"public void onZoom(View view){\n if(view.getId() == R.id.Bzoomin){\n mMap.animateCamera(CameraUpdateFactory.zoomIn());\n }\n if(view.getId()==R.id.Bzoomout){\n mMap.animateCamera(CameraUpdateFactory.zoomOut());\n }\n }",
"public View zoom(Integer zoom) {\n setZoom(zoom);\n return this;\n }",
"public void setZoom(float zoom) {\n this.zoom = zoom;\n }",
"public void zoomToFactor(double d) {\n\t\t\n\t}",
"@Test\n public void zoomInAndOut() throws Exception {\n assertEquals(calendarPanel.getCalendarView().getMonthPage(), calendarPanel.getPageBase());\n\n //zoom in to Week Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getWeekPage(), calendarPanel.getPageBase());\n\n //zoom in to Day Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getDayPage(), calendarPanel.getPageBase());\n\n //can't zoom in anymore, stays at Day Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getDayPage(), calendarPanel.getPageBase());\n\n //zoom out to Week Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getWeekPage(), calendarPanel.getPageBase());\n\n //zoom out to Month Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getMonthPage(), calendarPanel.getPageBase());\n\n //zoom out to Year Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getYearPage(), calendarPanel.getPageBase());\n\n //can't zoom out anymore, stays at Year Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getYearPage(), calendarPanel.getPageBase());\n\n //zoom in to Month Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getMonthPage(), calendarPanel.getPageBase());\n }",
"public void zoomCam(float zoom){\n\t\tthis.camera.setZoom(zoom);\n\t}",
"@JavascriptInterface\n public void setZoom(final int zoom) {\n getHandler().post(new Runnable() {\n @Override\n public void run() {\n if (mWebViewFragment.getMapSettings()\n .getZoom() != zoom) {\n if (BuildConfig.DEBUG) {\n Log.d(TAG,\n \"setZoom \" + zoom);\n }\n\n final MapSettings mapSettings = mWebViewFragment.getMapSettings();\n mapSettings.setZoom(zoom);\n mWebViewFragment.setMapSettings(mapSettings);\n }\n }\n });\n }",
"public synchronized void addZoom(float zoom)\r\n {\r\n this.setZoom(zoom + this.getZoom());\r\n }",
"@Override\n\t\tpublic void OnDoubleFingerStartZoom(MotionEvent ev) {\n\n\t\t}",
"public void zoomToLevel(int level) {\n \t\tfloat scale = getScaleFromZoom(level);\n \t\tzoomToScale(scale);\n \t}",
"public void zoomOut() {\n zoomToLength(currentViewableRange.getLength() * 2);\n }",
"boolean allowZoom();",
"public void setZoom( double zoom ) {\n\t\tthis.zoom = zoom;\n\t}",
"public abstract void keyexplore(long ms);",
"@Override\n public void onDoubleTap(SKScreenPoint point) {\n mapView.zoomInAt(point);\n }",
"public void scrollZoom (ScrollEvent scrollEvent){\n //Sets the zoom value from the deltaY value of the scroll event\n double zoom = scrollEvent.getDeltaY()/40;\n\n //Divides the zoom value relative to the current cell draw size.\n if (canvasDrawer.getCellDrawSize() < 3) {\n zoom = zoom / 16;\n } else if (canvasDrawer.getCellDrawSize() < 5) {\n zoom = zoom / 8;\n } else if (canvasDrawer.getCellDrawSize() < 8) {\n zoom = zoom / 4;\n } else if (canvasDrawer.getCellDrawSize() < 20 || canvasDrawer.getCellDrawSize() > 5) {\n zoom = zoom / 2;\n }\n\n canvasDrawer.setZoom(canvasDrawer.getCellDrawSize() + zoom, canvasArea, board);\n draw();\n }",
"public void zoom(int levelDelta) {\n \t\tint newLevel = getZoomLevelFromScale(mapDisplay.sc) + levelDelta;\n \t\tzoomToLevel(newLevel);\n \t}",
"private void adjustZoomFactor(){\n switch(zoomLevel){\n case 0:zoomFactor = 39; break;\n case 1:zoomFactor = 37; break;\n case 2:zoomFactor = 35; break;\n case 3:zoomFactor = 33; break;\n case 4:zoomFactor = 31; break;\n case 5:zoomFactor = 29; break;\n case 6:zoomFactor = 27; break;\n case 7:zoomFactor = 25; break;\n case 8:zoomFactor = 23; break;\n case 9:zoomFactor = 21; break;\n case 10:zoomFactor = 20; break;\n case 11:zoomFactor = 18; break;\n case 12:zoomFactor = 16; break;\n case 13:zoomFactor = 14; break;\n case 14:zoomFactor = 12; break;\n case 15:zoomFactor = 10; break;\n case 16:zoomFactor = 8; break;\n case 17:zoomFactor = 6; break;\n case 18:zoomFactor = 4; break;\n case 19:zoomFactor = 2; break;\n case 20:zoomFactor = 0; break;\n }\n }",
"@Override\n\t\t\tpublic void onMapZoom(MapZoomEvent eventObject)\n\t\t\t{\n\t\t\t}",
"public void zoomInto(Location loc, double zoom) {\n setZoom(zoom);\n setDisplayedLocation(loc);\n }",
"public void setZoom(int ps) {\n P_SCALE = ps;\n //EMBOSS = P_SCALE*8;\n }",
"void startZoom() {\n\t\t// this boolean tells the system that it needs to \n\t\t// initialize itself before trying to zoom\n\t\t// This is cleaner than duplicating code\n\t\t// see processZoom\n\t\tmZoomEstablished=false;\n\t}",
"@Override\n public void setCameraZoom(int zoomLevel) {\n mMap.moveCamera(CameraUpdateFactory.zoomTo(zoomLevel));\n }",
"@Override\n\tpublic void onZoomChanged(GeoPoint center, double diagonal) {\n\t}",
"public void zoomToLength(int length) {\n zoomToLength(length, (getRangeEnd()+ 1 + getRangeStart()) / 2); // + 1 because ranges are inclusive\n }",
"@Override\n public void mouseWheelMoved(MouseWheelEvent e) {\n\n zoomer = true;\n\n //Zoom in\n if (e.getWheelRotation() < 0) {\n zoomFactor *= 1.1;\n repaint();\n }\n //Zoom out\n if (e.getWheelRotation() > 0) {\n zoomFactor /= 1.1;\n repaint();\n }\n }",
"int getMinZoom();",
"public void zoom(boolean in) {\n\t\tAbstractGridGroupRenderer gr = (AbstractGridGroupRenderer) gallery.getGroupRenderer();\n\t\tint height = gr.getItemHeight();\n\t\tint width = gr.getItemWidth();\n\t\t\n\t\tif(in){\n\t\t\theight *= 2;\n\t\t\twidth *= 2;\n\t\t}else{\n\t\t\theight /= 2;\n\t\t\twidth /= 2;\n\t\t}\n\t\t\n\t\tif(height < 64 || width < 64){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(height > 512 || width > 512){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tgr.setItemSize(width, height);\n\t\tgallery.setItemCount(ResourceTypes.TYPES.length);\n\t}",
"public void setZoom(float zoom) {\n\t\tthis.zoom = zoom;\n\t\trevalidate();\n\t\trepaint();\n\t}",
"public void zoomPokemon(){\n }",
"int getZoomPref();",
"static void zoom_callback(int *code,int *color)\n\t{\n\t\ttile_info.flags = (*color & 0x40) ? TILE_FLIPX : 0;\n\t\t*code |= ((*color & 0x03) << 8);\n\t\t*color = zoom_colorbase + ((*color & 0x3c) >> 2);\n\t}",
"public void zoom(Coord crd, int zoom) {\n if(internalNative != null) {\n internalNative.setZoom(crd.getLatitude(), crd.getLongitude(), zoom);\n } else {\n if(internalLightweightCmp != null) {\n internalLightweightCmp.zoomTo(crd, zoom);\n } else {\n // TODO: Browser component \n }\n }\n }",
"@Override\r\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\tCamera.Parameters parameters = myCamera.getParameters();\r\n\t\tswitch(keyCode){\r\n\t\tcase KeyEvent.KEYCODE_VOLUME_UP:\r\n\t\t\tif(parameters.getZoom()<parameters.getMaxZoom()){\r\n\t\t\t\tparameters.setZoom(parameters.getZoom()+1);\r\n\t\t\t\tmyCamera.setParameters(parameters);\r\n\t\t\t}else{\r\n\t\t\t\tToast.makeText(this, \"MAX Zoom IN\", Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\tcase KeyEvent.KEYCODE_VOLUME_DOWN:\r\n\t\t\tif(parameters.getZoom()>0){\r\n\t\t\t\tparameters.setZoom(parameters.getZoom()-1);\r\n\t\t\t\tmyCamera.setParameters(parameters);\r\n\t\t\t}else{\r\n\t\t\t\tToast.makeText(this, \"MAX Zoom OUT\", Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn super.onKeyDown(keyCode, event);\r\n\t}",
"public void setleZoom( double valeur) {\n\t\tzoomMonde = valeur;\n\t}",
"public void zoom(float zoom) { \n if (zoom <=0) {\n throw new IllegalArgumentException();\n }\n\n workTransform.setTransform(null);\n workTransform.mScale(zoom);\n workTransform.mMultiply(userTransform);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"private static void initZoomOptions() {\n\t\tfloat zoom = 0;\n\t\twhile (zoom < DiagramaFigura.MAX_ZOOM) {\n\t\t\tzoom += DiagramaFigura.DELTA_ZOOM;\n\t\t\tif (zoom >= DiagramaFigura.MIN_ZOOM) {\n\t\t\t\tString key = Integer.toString((int) (zoom * 100));\n\t\t\t\tzoomOptions.put(key + \"%\", zoom);\n\t\t\t}\n\t\t}\n\t}",
"public static void registerEvent() {\n if (ZoomKeybinds.areExtraKeybindsEnabled()) {\n ClientTickEvents.END_CLIENT_TICK.register(client -> {\n if (ZoomPackets.getDisableZoomScrolling()) return;\n \n if (ZoomKeybinds.decreaseZoomKey.isPressed()) {\n ZoomUtils.changeZoomDivisor(false);\n }\n \n if (ZoomKeybinds.increaseZoomKey.isPressed()) {\n ZoomUtils.changeZoomDivisor(true);\n }\n \n if (ZoomKeybinds.resetZoomKey.isPressed()) {\n ZoomUtils.resetZoomDivisor();\n }\n });\n }\n }",
"public synchronized void setZoom(float zoom)\r\n {\r\n this.zoom = Utils.clampFloat(zoom, .4f, 1.5f);\r\n }",
"public void zoom(double factor) {\n //Check whether we zooming in or out for adjusting the zoomLvl field\n //Scale the graphic and pan accordingly\n if(factor>1 && zoomLevel!=20) {\n transform.preConcatenate(AffineTransform.getScaleInstance(factor, factor));\n pan(getWidth() * (1 - factor) / 2, getHeight() * (1 - factor) / 2);\n checkForZoomIn();\n }else if(zoomLevel!=0 && factor<1){\n transform.preConcatenate(AffineTransform.getScaleInstance(factor, factor));\n pan(getWidth() * (1 - factor) / 2, getHeight() * (1 - factor) / 2);\n checkForZoomOut();\n }\n }",
"public final void zoomOut(final int zoomStep) {\r\n\r\n final BufferedImage image = imageCanvas.getImage();\r\n\r\n //\r\n // no image, no zoom\r\n\r\n if (image == null) {\r\n return;\r\n }\r\n\r\n int zoomTmp = this.zoom;\r\n\r\n //\r\n // if zoom is best fit\r\n // calculate the zoom based on container size\r\n\r\n if (zoomTmp == ZOOM_BEST_FIT) {\r\n zoomTmp = ImageUtils.calculateSizeToFit(image, imageCanvas.getSize()).width * ZOOM_REAL_SIZE / image.getWidth();\r\n }\r\n\r\n //\r\n // calculate new zoom based on the step parameter\r\n\r\n int newZoom = (int) Math.floor(((double) zoomTmp) / ((double) zoomStep)) * zoomStep;\r\n\r\n// if (newZoom == zoomTmp) {\r\n newZoom = newZoom - zoomStep;\r\n// }\r\n\r\n System.out.println(newZoom);\r\n \r\n setZoom(newZoom);\r\n }",
"private void userInput(){\n if(mousePressed){\n rX -= (mouseY - pmouseY) * 0.002f;//map(mouseY,0,height,-PI,PI);\n rY -= (mouseX - pmouseX) * 0.002f;// map(mouseX,0,width,PI,-PI);\n }\n rotateX(rX);\n rotateY(rY);\n\n if(keyPressed){\n if(keyCode == UP){\n zoom += 0.01f;\n }\n if(keyCode == DOWN){\n zoom -= 0.01f;\n }\n }\n }",
"private void addDefaultHandlers()\n\t{\n\t\t\t\tthis.openLayersMap.getMap().addMapZoomListener(new MapZoomListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onMapZoom(MapZoomEvent eventObject)\n\t\t\t{\n\t\t\t\t//TODO - Do nothing for now, leaving in for testing.\n\t\t\t}\n\t\t});\n\t\t\n\t\t/**\n\t\t This event register is neeeded, because in case the user resizes the browser window, openlayer for some reason\n\t\t\tzooms in. So when it does that, we get back to the default zoom by using the zoomTo method.\n\t\t */\n\t\tthis.openLayersMap.getMap().getEvents().register(\"zoomend\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n \t\t/**\n \t\t\tUsing this technique here, because, in the event that the user double clicks on the map\n\t \t\twe need to wait till this action has completed and then revert to the default map zoom.\n\t \t\tIf we didn't have this, the \"revert\" would not be successful.\n\t \t\thttp://dantwining.co.uk/2010/03/01/gwt-openlayers-and-full-screen-maps/\n \t\t */\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @zoomend, Reverting to Map Zoom: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }\n });\n\t\t\n\t\t/**\n\t\t * This event register is needed because, on mobile devices (tested on ipad2 and ipad mini), after the update size\n\t\t * triggered when the screen went from landscape to portait (in MainAppView) the upper tiles were white. In other\n\t\t * words, the transition did not update the map-tiles-in-view to the new map size. So, by doing this, the map zooms in \n\t\t * when the update size is triggered, which \"enforces\" the updating of the map tiles. Also, because of the \"zoomend\"\n\t\t * event the map will revert to the default zoom level after this.\n\t\t */\n\t\tthis.openLayersMap.getMap().getEvents().register(\"updatesize\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL+1);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @updatesize, Re-zooming after size update: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }\n });\n\t\t\n\t\t/**\n\t\tThe following is useful if we want to convert map coordinates to pixel x,y coordinates.\n\t\tSo, if we want to draw on top of a map layer, this seems to be a good way to do it.\n\t\thttp://stackoverflow.com/questions/6032460/mousemove-events-in-gwt-openlayers \n\t\t \n\t\tthis.openLayersMap.getMap().getEvents().register(\"mousemove\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n JSObject xy = eventObject.getJSObject().getProperty(\"xy\");\n Pixel px = Pixel.narrowToPixel(xy);\n LonLat lonlat = openLayersMap.getMap().getLonLatFromPixel(px);\n System.out.println(\"Caught mousemove event: \"+lonlat);\n }\n });\n\t\t*/\n\t}",
"@Override\n public void onMapZoomChanged(float zoom) {\n presenter.onMapZoomChanged(zoom);\n }",
"@Override\n public void onMapViewZoomLevelChanged(MapView arg0, int arg1) {\n\n }",
"public void upPressed()\r\n {\r\n worldPanel.newMapPos(0,-zoom);\r\n miniMap.newMapPos(0,-1);\r\n }",
"public void setZoom(double zoom) {\n if (zoom > 0) {\n this.zoom = zoom;\n this.rescale();\n }\n }",
"@Override\n public void keyTyped(KeyEvent key) {\n\n switch (key.getKeyChar()) {\n case '+':\n this.startAnimation();\n this.zoomIn();\n break;\n case '-':\n this.startAnimation();\n this.zoomOut();\n break;\n default:\n break;\n }\n }",
"public void setZoom(float zoom){\r\n zoom = zoom * 100;\r\n zoom = Math.round(zoom);\r\n this.zoom = Math.max(zoom / 100, 0.01f);\r\n }",
"public void zoomToFit() { zoomToFit(null); }",
"public void zoomScale(double scaleDelta) {\n \t\tzoomToScale((float) (mapDisplay.sc * scaleDelta));\n \t}"
] | [
"0.7552667",
"0.7268142",
"0.710195",
"0.7080847",
"0.7071117",
"0.683939",
"0.67942894",
"0.6792516",
"0.67640364",
"0.6752541",
"0.66540295",
"0.66037273",
"0.6528687",
"0.6392602",
"0.6366419",
"0.6332549",
"0.62734056",
"0.62472117",
"0.62396663",
"0.6210904",
"0.62008125",
"0.61827755",
"0.6163384",
"0.61461943",
"0.6130883",
"0.61284167",
"0.60874194",
"0.6060834",
"0.6032145",
"0.60284686",
"0.60278124",
"0.6018879",
"0.59852594",
"0.59641606",
"0.589706",
"0.58540064",
"0.5845254",
"0.5841061",
"0.5832694",
"0.58140296",
"0.58140296",
"0.5807365",
"0.5783971",
"0.57806736",
"0.5778241",
"0.5776138",
"0.57473606",
"0.5743652",
"0.5743233",
"0.57027674",
"0.56817204",
"0.56638366",
"0.56571156",
"0.5654939",
"0.56455594",
"0.56398916",
"0.5623142",
"0.56048435",
"0.55804384",
"0.5580196",
"0.55714667",
"0.556269",
"0.55502254",
"0.55162454",
"0.55136013",
"0.5509471",
"0.5501192",
"0.5472992",
"0.5470959",
"0.54683894",
"0.54526424",
"0.5449514",
"0.5448074",
"0.54399216",
"0.5435083",
"0.543326",
"0.5426199",
"0.5390192",
"0.53885126",
"0.53823256",
"0.5380954",
"0.53793013",
"0.53665805",
"0.5361954",
"0.5356157",
"0.53257054",
"0.5312911",
"0.53088146",
"0.5308341",
"0.53082484",
"0.5301325",
"0.5290791",
"0.5290133",
"0.5289825",
"0.52862835",
"0.5284312",
"0.52796125",
"0.5279538",
"0.5278423",
"0.52507377"
] | 0.7729248 | 0 |
To zoom out page 6 time using CTRL and keys. | public static void zoomOut(){
for(int i=0; i<6; i++){
driver.findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL, Keys.SUBTRACT));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void zoomOut() { zoomOut(1); }",
"public static void zoomIn(){\n for(int i=0; i<6; i++){\n driver.findElement(By.tagName(\"html\")).sendKeys(Keys.chord(Keys.CONTROL, Keys.ADD));\n }\n }",
"public void zoomIn() { zoomIn(1); }",
"public void zoomOut() {\n \t\tzoom(-1);\n \t}",
"public void zoomOut() {\n if (scale > 0.05) {\n double scaleFactor = (scale - 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale -= 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n }",
"public void zoomOut() {\n zoomToLength(currentViewableRange.getLength() * 2);\n }",
"public void zoom_control()\n {\n simpleZoomControls.setOnZoomInClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _cnt++;\n int ss = _cnt / 60; int ss1 = _cnt % 60;\n _str_break = get_string(ss, ss1);\n mTxtBreakTime.setText(_str_break);\n }\n });\n // perform setOnZoomOutClickListener event on ZoomControls\n simpleZoomControls.setOnZoomOutClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n _cnt--;\n if(_cnt <= 0) _cnt = 0;\n\n int ss = _cnt / 60; int ss1 = _cnt % 60;\n _str_break = get_string(ss, ss1);\n mTxtBreakTime.setText(_str_break);\n }\n });\n }",
"protected void zoomToPast(){\n //zoom out\n int maxTimeSpread = widgg.timeorg.lastShortTimeDateInCurve - widgg.timeorg.firstShortTimeDateInCurve;\n if(xpCursor1 >=0){\n ixDataCursor1 = ixDataShown[xpCursor1];\n }\n if(xpCursor2 >=0){\n ixDataCursor2 = ixDataShown[xpCursor2];\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n if(widgg.timeorg.timeSpread < 0x3fffffff) { widgg.timeorg.timeSpread *=2; }\n else { widgg.timeorg.timeSpread = 0x7fffffff; }\n bPaintAllCmd = true;\n widgg.redraw(100, 200);\n \n }",
"public void zoomIn() {\n \t\tzoom(1);\n \t}",
"@Override\n public void Zoom(double zoomNo) {\n\t \n }",
"public int getKeyZoomOut() {\r\n return getKeyDown();\r\n }",
"public void zoomIn() {\n\tsetZoom(getNextZoomLevel());\n}",
"void multitouchZoom(int new_zoom);",
"public void zoomIn() {\n if (scale < 0.8) {\n double scaleFactor = (scale + 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale += 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n\n }",
"public void zoomIn()\n {\n zoomIn(1, width >> 1, height >> 1);\n }",
"public final void zoomOut(final int zoomStep) {\r\n\r\n final BufferedImage image = imageCanvas.getImage();\r\n\r\n //\r\n // no image, no zoom\r\n\r\n if (image == null) {\r\n return;\r\n }\r\n\r\n int zoomTmp = this.zoom;\r\n\r\n //\r\n // if zoom is best fit\r\n // calculate the zoom based on container size\r\n\r\n if (zoomTmp == ZOOM_BEST_FIT) {\r\n zoomTmp = ImageUtils.calculateSizeToFit(image, imageCanvas.getSize()).width * ZOOM_REAL_SIZE / image.getWidth();\r\n }\r\n\r\n //\r\n // calculate new zoom based on the step parameter\r\n\r\n int newZoom = (int) Math.floor(((double) zoomTmp) / ((double) zoomStep)) * zoomStep;\r\n\r\n// if (newZoom == zoomTmp) {\r\n newZoom = newZoom - zoomStep;\r\n// }\r\n\r\n System.out.println(newZoom);\r\n \r\n setZoom(newZoom);\r\n }",
"private void actionZoomOut ()\r\n\t{\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\t//---- Calculate zoom scale factor\r\n\t\t\tdouble zoom = mainFormLink.getComponentPanelCenter().getComponentPanelImageView().transformZoom(-FormMainMouse.DEFAULT_ZOOM_DELTA); \r\n\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().repaint();\r\n\r\n\t\t\t//---- Set the current zoom, display the zoom scale factor in the GUI\r\n\t\t\tFormMainMouse.imageViewZoomScale = zoom;\r\n\t\t\tmainFormLink.getComponentPanelDown().getComponentLabelZoom().setText(String.valueOf(zoom));\r\n\t\t}\r\n\t}",
"public void zoomIn() {\n if (zoom > 0) {\n zoom--;\n spielPanel.setZoom(zoom);\n }\n }",
"protected void zoomToPresent(){\n if(xpCursor1 >=0){\n ixDataCursor1 = ixDataShown[xpCursor1];\n }\n if(xpCursor2 >=0){\n ixDataCursor2 = ixDataShown[xpCursor2];\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n if(widgg.timeorg.timeSpread > 100) { widgg.timeorg.timeSpread /=2; }\n else { widgg.timeorg.timeSpread = 100; }\n bPaintAllCmd = true;\n widgg.redraw(100, 200);\n }",
"public void zoomScaleOut() {\n \t\tzoomScale(SCALE_DELTA_OUT);\n \t}",
"public void zoomIn() {\n if (currentViewableRange.getLength() > 1) {\n zoomToLength(currentViewableRange.getLength() / 2);\n }\n }",
"@Override\n public void Zoom(double zoomNo, boolean setZoom) {\n\t \n }",
"public void onZoomOut(View view) {\n if (!checkReady()) {\n return;\n }\n\n changeCamera(CameraUpdateFactory.zoomOut());\n }",
"public void zoomOut() {\r\n \t\tgraph.setScale(graph.getScale() / 1.25);\r\n \t}",
"public void handleEndZoom(ActionEvent event){\n zoomPane.setVisible(false);\n }",
"public void zoomIn() {\n\t\tif (this.zoom + DELTA_ZOOM <= MAX_ZOOM)\n\t\t\tthis.setZoom(this.zoom + DELTA_ZOOM);\n\t}",
"protected abstract void handleZoom();",
"public static void zoomOutPage(int percent) {\r\n\t\tJavascriptExecutor js = (JavascriptExecutor) base.driver;\r\n\t\tjs.executeScript(\"document.body.style.zoom='\" + percent + \"%'\");\r\n\t}",
"public void zoom() {\n\t\tdisp.zoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"public void onZoom(View view){\n if(view.getId() == R.id.Bzoomin){\n mMap.animateCamera(CameraUpdateFactory.zoomIn());\n }\n if(view.getId()==R.id.Bzoomout){\n mMap.animateCamera(CameraUpdateFactory.zoomOut());\n }\n }",
"public void setZoom(){\n\t\tactive.setZoom();\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Zoom less\");\r\n\t\t\t}",
"@Override\n public void setZoom(double zoom)\n {\n super.setZoom(zoom);\n delayedRepainting.requestRepaint(ZOOM_REPAINT);\n }",
"public static void changeCameraZoom(boolean zoomIn){\r\n\t\tif(zoomIn && zoomLevel > 0){\r\n\t\t\tzoomLevel -= 2;\r\n\t\t}else if(!zoomIn){\r\n\t\t\tzoomLevel += 2;\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void setZoom(int zoom) {\n\t\t\n\t}",
"public int getKeyZoomIn() {\r\n return getKeyUp();\r\n }",
"private void dragZoom() {\n\n\t\tint width = this.getWidth();\n\n\t\tint start = cont.getStart();\n\t\tdouble amount = cont.getLength();\n\n\t\tint newStart = (int) DrawingTools.calculatePixelPosition(x ,width,amount,start);\n\t\tint newStop = (int) DrawingTools.calculatePixelPosition(x2,width,amount,start);\n\t\tx = x2 = 0;\n\n\t\tint temp;\n\t\tif (newStop < newStart){\n\t\t\ttemp = newStart;\n\t\t\tnewStart = newStop;\n\t\t\tnewStop = temp;\n\t\t}\n\n\t\tcont.changeSize(newStart,newStop);\n\n\t}",
"@Test\n public void zoomInAndOut() throws Exception {\n assertEquals(calendarPanel.getCalendarView().getMonthPage(), calendarPanel.getPageBase());\n\n //zoom in to Week Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getWeekPage(), calendarPanel.getPageBase());\n\n //zoom in to Day Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getDayPage(), calendarPanel.getPageBase());\n\n //can't zoom in anymore, stays at Day Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getDayPage(), calendarPanel.getPageBase());\n\n //zoom out to Week Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getWeekPage(), calendarPanel.getPageBase());\n\n //zoom out to Month Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getMonthPage(), calendarPanel.getPageBase());\n\n //zoom out to Year Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getYearPage(), calendarPanel.getPageBase());\n\n //can't zoom out anymore, stays at Year Page\n raiseZoomOutEvent();\n assertEquals(calendarPanel.getCalendarView().getYearPage(), calendarPanel.getPageBase());\n\n //zoom in to Month Page\n raiseZoomInEvent();\n assertEquals(calendarPanel.getCalendarView().getMonthPage(), calendarPanel.getPageBase());\n }",
"private void checkForZoomOut(){\n if(checkOut == 1){\n zoomLevel--;\n adjustZoomFactor();\n checkOut = 0;\n checkIn = 1;\n } else{\n checkOut = 1;\n checkIn = 0;\n }\n }",
"public void wheelZoom(MouseWheelEvent e) {\n try {\n int wheelRotation = e.getWheelRotation();\n Insets x = getInsets(); //Top bar space of the application\n Point p = e.getPoint();\n p.setLocation(p.getX() , p.getY()-x.top + x.bottom);\n if (wheelRotation > 0 && zoomLevel != 0) {\n //point2d before zoom\n Point2D p1 = transformPoint(p);\n transform.scale(1 / 1.2, 1 / 1.2);\n //point after zoom\n Point2D p2 = transformPoint(p);\n transform.translate(p2.getX() - p1.getX(), p2.getY() - p1.getY()); //Pan towards mouse\n checkForZoomOut();\n repaint();\n\n } else if (wheelRotation < 0 && zoomLevel != 20) {\n Point2D p1 = transformPoint(p);\n transform.scale(1.2, 1.2);\n Point2D p2 = transformPoint(p);\n transform.translate(p2.getX() - p1.getX(), p2.getY() - p1.getY()); //Pan towards mouse\n checkForZoomIn();\n repaint();\n }\n } catch (NoninvertibleTransformException ex) {\n ex.printStackTrace();\n }\n\n }",
"@Override\n public void onHandle(EventObject eventObject)\n {\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @zoomend, Reverting to Map Zoom: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }",
"void onZoom() {\n\t\tmZoomPending=true;\n\t}",
"public void unzoom() {\n\t\tdisp.unzoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"protected void primSetZoom(double zoom) {\n\tPoint p1 = getViewport().getClientArea().getCenter();\n\tPoint p2 = p1.getCopy();\n\tPoint p = getViewport().getViewLocation();\n\tdouble prevZoom = this.zoom;\n\tthis.zoom = zoom;\n\tpane.setScale(zoom);\n\tfireZoomChanged();\n\tgetViewport().validate();\n\t\n\tp2.scale(zoom / prevZoom);\n\tDimension dif = p2.getDifference(p1);\n\tp.x += dif.width;\n\tp.y += dif.height;\n\tsetViewLocation(p);\t\n}",
"public void scrollZoom (ScrollEvent scrollEvent){\n //Sets the zoom value from the deltaY value of the scroll event\n double zoom = scrollEvent.getDeltaY()/40;\n\n //Divides the zoom value relative to the current cell draw size.\n if (canvasDrawer.getCellDrawSize() < 3) {\n zoom = zoom / 16;\n } else if (canvasDrawer.getCellDrawSize() < 5) {\n zoom = zoom / 8;\n } else if (canvasDrawer.getCellDrawSize() < 8) {\n zoom = zoom / 4;\n } else if (canvasDrawer.getCellDrawSize() < 20 || canvasDrawer.getCellDrawSize() > 5) {\n zoom = zoom / 2;\n }\n\n canvasDrawer.setZoom(canvasDrawer.getCellDrawSize() + zoom, canvasArea, board);\n draw();\n }",
"public void zoomIn() {\r\n \t\tgraph.setScale(graph.getScale() * 1.25);\r\n \t}",
"private void actionZoomIn ()\r\n\t{\r\n\t\tint tableSize = DataController.getTable().getTableSize();\r\n\r\n\t\t//---- Check if the project is empty or not\r\n\t\tif (tableSize != 0)\r\n\t\t{\r\n\t\t\t//---- Calculate zoom scale factor\r\n\t\t\tdouble zoom = mainFormLink.getComponentPanelCenter().getComponentPanelImageView().transformZoom(+FormMainMouse.DEFAULT_ZOOM_DELTA); \r\n\t\t\tmainFormLink.getComponentPanelCenter().getComponentPanelImageView().repaint();\r\n\r\n\t\t\t//---- Set the current zoom, display the zoom scale factor in the GUI\r\n\t\t\tFormMainMouse.imageViewZoomScale = zoom;\r\n\t\t\tmainFormLink.getComponentPanelDown().getComponentLabelZoom().setText(String.valueOf(zoom));\r\n\t\t}\r\n\t}",
"public void zoomOnAddress(){\n adjustZoomLvl(16000);\n adjustZoomFactor();\n }",
"@Override\n public void pinchStop() {\n }",
"protected void zoomBetweenCursors(){\n ixDataCursor1 = ixDataShown[xpCursor1];\n ixDataCursor2 = ixDataShown[xpCursor2];\n ixDataShowRight = ixDataCursor2 + (((ixDataCursor2 - ixDataCursor1) / 10) & widgg.mIxData);\n int ixiData1 = (ixDataShown[xpCursor1] >> widgg.shIxiData) & widgg.mIxiData;\n int ixiData2 = (ixDataShown[xpCursor2] >> widgg.shIxiData) & widgg.mIxiData;\n int time1 = widgg.tracksValue.getTimeShort(ixiData1);\n int time2 = widgg.tracksValue.getTimeShort(ixiData2);\n if((time2 - time1)>0){\n widgg.timeorg.timeSpread = (time2 - time1) * 10/8;\n assert(widgg.timeorg.timeSpread >0);\n } else {\n widgg.stop();\n }\n xpCursor1New = xpCursor2New = cmdSetCursor; \n widgg.redraw(100, 200);\n \n }",
"public void zoom(int s) {\r\n\t\tzoom += s * ZOOM_FACTOR;\r\n\t}",
"public void zoomIn(double i) {\n Rectangle2D r = getExtents();\n double exp = Math.pow(1.5,i); double cx = r.getX() + r.getWidth()/2, cy = r.getY() + r.getHeight()/2;\n setExtents(new Rectangle2D.Double(cx - r.getWidth()/(exp*2), cy - r.getHeight()/(exp*2), r.getWidth()/exp, r.getHeight()/exp));\n }",
"public ProductGalleryPage zoomIn() {\n SpriiTestFramework.getInstance().waitForElement(By.xpath(zoomInElement), 2000);\n driver.findElement(By.xpath(zoomInElement)).click();\n return this;\n }",
"public void zoomToFactor(double d) {\n\t\t\n\t}",
"public void keyPressed(KeyEvent e)\r\n\t{\r\n\t\tif (e.getKeyCode() == e.VK_UP)\r\n\t\t\ttranslatey++;\r\n\t\telse if (e.getKeyCode() == e.VK_DOWN)\r\n\t\t\ttranslatey--;\r\n\t\telse if (e.getKeyCode() == e.VK_LEFT)\r\n\t\t\ttranslatex--;\r\n\t\telse if (e.getKeyCode() == e.VK_RIGHT)\r\n\t\t\ttranslatex++;\r\n\t\telse if (e.getKeyCode() == e.VK_PLUS || e.getKeyCode() == 61)\r\n\t\t\tzoom = zoom + 0.1;\r\n\t\telse if (e.getKeyCode() == e.VK_MINUS)\r\n\t\t{\r\n\t\t\tzoom = zoom - 0.1;\r\n\t\t\tif (zoom < 0.1)\r\n\t\t\t\tzoom = 0.1;\r\n\t\t}\r\n\t\t\r\n\t\tv2d.zoom = zoom;\r\n\t\t\r\n\t\tv2d.keyPressed(e.getKeyCode());\r\n\t}",
"public void setZoom(Integer zoom) {\n this.zoom = zoom;\n }",
"public void setZoom(Integer zoom) {\n this.zoom = zoom;\n }",
"public void resetGraphicsWindowZoomAndMeasurement() {\r\n\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\tthis.graphicsTabItem.setModeState(GraphicsMode.RESET);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tDataExplorer.this.graphicsTabItem.setModeState(GraphicsMode.RESET);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}",
"public abstract void keyexplore(long ms);",
"public void onZoomIn(View view) {\n if (!checkReady()) {\n return;\n }\n changeCamera(CameraUpdateFactory.zoomIn());\n }",
"public void zoomScaleIn() {\n \t\tzoomScale(SCALE_DELTA_IN);\n \t}",
"public void updateZoom() {\n camera.zoom = zoomLevel;\n }",
"@Override\n\tpublic void onZoomChanged(GeoPoint center, double diagonal) {\n\t}",
"private void ZoomOutCircle(double zoom, double circle_speed){\n final double COEFFICIENT=14;\n circle.setRadius(COEFFICIENT*(circle_speed-zoom));\n }",
"public void setZoom(float zoom) {\n this.zoom = zoom;\n }",
"public void zoomNPinch(WebElement element){\n driver.zoom(element);\n driver.pinch(element);\n }",
"@Override\n public void mouseWheelMoved(MouseWheelEvent e) {\n\n zoomer = true;\n\n //Zoom in\n if (e.getWheelRotation() < 0) {\n zoomFactor *= 1.1;\n repaint();\n }\n //Zoom out\n if (e.getWheelRotation() > 0) {\n zoomFactor /= 1.1;\n repaint();\n }\n }",
"public void upPressed()\r\n {\r\n worldPanel.newMapPos(0,-zoom);\r\n miniMap.newMapPos(0,-1);\r\n }",
"public void setleZoom( double valeur) {\n\t\tzoomMonde = valeur;\n\t}",
"public void zoomToFit() { zoomToFit(null); }",
"@JavascriptInterface\n public void setZoom(final int zoom) {\n getHandler().post(new Runnable() {\n @Override\n public void run() {\n if (mWebViewFragment.getMapSettings()\n .getZoom() != zoom) {\n if (BuildConfig.DEBUG) {\n Log.d(TAG,\n \"setZoom \" + zoom);\n }\n\n final MapSettings mapSettings = mWebViewFragment.getMapSettings();\n mapSettings.setZoom(zoom);\n mWebViewFragment.setMapSettings(mapSettings);\n }\n }\n });\n }",
"@Override\n\t\t\tpublic void onMapZoom(MapZoomEvent eventObject)\n\t\t\t{\n\t\t\t}",
"@Override\n\t\tpublic void OnDoubleFingerStartZoom(MotionEvent ev) {\n\n\t\t}",
"public void downPressed()\r\n {\r\n worldPanel.newMapPos(0,zoom);\r\n miniMap.newMapPos(0,1);\r\n }",
"public void zoomCam(float zoom){\n\t\tthis.camera.setZoom(zoom);\n\t}",
"private void checkForZoomIn(){\n if(checkIn == 1){\n zoomLevel++;\n adjustZoomFactor();\n checkOut = 1;\n checkIn = 0;\n } else{\n checkOut = 0;\n checkIn = 1;\n }\n\n }",
"public void setZoom( double zoom ) {\n\t\tthis.zoom = zoom;\n\t}",
"@Override\n public void onMapZoomChanged(float zoom) {\n presenter.onMapZoomChanged(zoom);\n }",
"public void setZoom(int ps) {\n P_SCALE = ps;\n //EMBOSS = P_SCALE*8;\n }",
"public void zoomPokemon(){\n }",
"public void keyReleased(KeyEvent e) {\n \tkeyMouseMove = 0;\n }",
"public void zoomIn(){\n\t\t zoomed = modifyDimensions(picture.getWidth(),getHeight()); //in primul pas se maresc dimensiunile pozei\n\t\t for(int i = 0; i < zoomed.getHeight(); i += 2) {\n\t for(int j = 0; j < zoomed.getWidth(); j += 2) {\n\t zoomed.setRGB(j, i, picture.getRGB(j / 2,i / 2));\n\n\t if (j + 1 < zoomed.getWidth()) {\n\t zoomed.setRGB(j + 1, i, mediePixeli(picture.getRGB(j / 2, i / 2), picture.getRGB((j + 2) / 2, i / 2))); // intre doua coloane se adauga media pixelilor din acestea\n\t }\n\t }\n\t }\n\n\n\t for(int i = 1; i < zoomed.getHeight(); i += 2){\n\t \tfor(int j = 0; j < zoomed.getWidth(); j++ ){\n\t zoomed.setRGB(j, i, mediePixeli(picture.getRGB((j - 1) / 2, i / 2), picture.getRGB((j + 1) / 2, (i / 2))));\n\t }\n\t }\n\t \n\t }",
"public View zoom(Integer zoom) {\n setZoom(zoom);\n return this;\n }",
"@Override\n public void mouseWheelMoved(MouseWheelEvent e) {\n // Check direction of rotation\n if (e.getWheelRotation() < 0) {\n // Zoom in for up\n tr_z += 0.01f;\n } else {\n // Zoom out for down\n tr_z -= 0.01f;\n }\n }",
"static void zoom_callback(int *code,int *color)\n\t{\n\t\ttile_info.flags = (*color & 0x40) ? TILE_FLIPX : 0;\n\t\t*code |= ((*color & 0x03) << 8);\n\t\t*color = zoom_colorbase + ((*color & 0x3c) >> 2);\n\t}",
"@Override\r\n\tpublic boolean onKeyDown(int keyCode, KeyEvent event) {\n\t\tCamera.Parameters parameters = myCamera.getParameters();\r\n\t\tswitch(keyCode){\r\n\t\tcase KeyEvent.KEYCODE_VOLUME_UP:\r\n\t\t\tif(parameters.getZoom()<parameters.getMaxZoom()){\r\n\t\t\t\tparameters.setZoom(parameters.getZoom()+1);\r\n\t\t\t\tmyCamera.setParameters(parameters);\r\n\t\t\t}else{\r\n\t\t\t\tToast.makeText(this, \"MAX Zoom IN\", Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\tcase KeyEvent.KEYCODE_VOLUME_DOWN:\r\n\t\t\tif(parameters.getZoom()>0){\r\n\t\t\t\tparameters.setZoom(parameters.getZoom()-1);\r\n\t\t\t\tmyCamera.setParameters(parameters);\r\n\t\t\t}else{\r\n\t\t\t\tToast.makeText(this, \"MAX Zoom OUT\", Toast.LENGTH_SHORT).show();\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn super.onKeyDown(keyCode, event);\r\n\t}",
"boolean allowZoom();",
"public void handleZoom(MouseEvent event){\n ImageView imageView = (ImageView) event.getSource();\n Image imageToShow = imageView.getImage();\n zoomImage.setImage(imageToShow);\n zoomPane.setVisible(true);\n }",
"@Override\n public void setCameraZoom(int zoomLevel) {\n mMap.moveCamera(CameraUpdateFactory.zoomTo(zoomLevel));\n }",
"public void keyPressed()\n{\n switch (key)\n {\n case ' ': //play and pause\n s =! s;\n if (s == false)\n {\n //pausets = millis()/4;\n controlP5.getController(\"play\").setLabel(\"Play\");\n } else if (s == true )\n {\n //origint = origint + millis()/4 - pausets;\n controlP5.getController(\"play\").setLabel(\"Pause\");\n }\n break; \n\n case TAB: //change of basemap\n if (mapwd == map1)\n {\n mapwd = map3;\n mapwk = map4; \n } else\n {\n mapwd = map1;\n mapwk = map2;\n }\n break; \n\n case ',': //backwards\n runtimes = runtimes - 300;\n break;\n\n case '<': //backwards\n runtimes = runtimes - 300;\n break; \n\n case '.': //forwards\n runtimes = runtimes + 300;\n break;\n\n case '>': //forwards\n runtimes = runtimes + 300;\n break;\n\n case 'z': //zoom to origin layer\n mapwk.zoomAndPanTo(BeijingLocation, 12);\n mapwd.zoomAndPanTo(BeijingLocation, 12);\n break;\n\n// case 'q': //switch mode\n// f.show();\n// break;\n }\n}",
"public void zoomToLevel(int level) {\n \t\tfloat scale = getScaleFromZoom(level);\n \t\tzoomToScale(scale);\n \t}",
"public void zoomToLength(int length) {\n zoomToLength(length, (getRangeEnd()+ 1 + getRangeStart()) / 2); // + 1 because ranges are inclusive\n }",
"private void addDefaultHandlers()\n\t{\n\t\t\t\tthis.openLayersMap.getMap().addMapZoomListener(new MapZoomListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onMapZoom(MapZoomEvent eventObject)\n\t\t\t{\n\t\t\t\t//TODO - Do nothing for now, leaving in for testing.\n\t\t\t}\n\t\t});\n\t\t\n\t\t/**\n\t\t This event register is neeeded, because in case the user resizes the browser window, openlayer for some reason\n\t\t\tzooms in. So when it does that, we get back to the default zoom by using the zoomTo method.\n\t\t */\n\t\tthis.openLayersMap.getMap().getEvents().register(\"zoomend\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n \t\t/**\n \t\t\tUsing this technique here, because, in the event that the user double clicks on the map\n\t \t\twe need to wait till this action has completed and then revert to the default map zoom.\n\t \t\tIf we didn't have this, the \"revert\" would not be successful.\n\t \t\thttp://dantwining.co.uk/2010/03/01/gwt-openlayers-and-full-screen-maps/\n \t\t */\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @zoomend, Reverting to Map Zoom: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }\n });\n\t\t\n\t\t/**\n\t\t * This event register is needed because, on mobile devices (tested on ipad2 and ipad mini), after the update size\n\t\t * triggered when the screen went from landscape to portait (in MainAppView) the upper tiles were white. In other\n\t\t * words, the transition did not update the map-tiles-in-view to the new map size. So, by doing this, the map zooms in \n\t\t * when the update size is triggered, which \"enforces\" the updating of the map tiles. Also, because of the \"zoomend\"\n\t\t * event the map will revert to the default zoom level after this.\n\t\t */\n\t\tthis.openLayersMap.getMap().getEvents().register(\"updatesize\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL+1);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @updatesize, Re-zooming after size update: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }\n });\n\t\t\n\t\t/**\n\t\tThe following is useful if we want to convert map coordinates to pixel x,y coordinates.\n\t\tSo, if we want to draw on top of a map layer, this seems to be a good way to do it.\n\t\thttp://stackoverflow.com/questions/6032460/mousemove-events-in-gwt-openlayers \n\t\t \n\t\tthis.openLayersMap.getMap().getEvents().register(\"mousemove\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n JSObject xy = eventObject.getJSObject().getProperty(\"xy\");\n Pixel px = Pixel.narrowToPixel(xy);\n LonLat lonlat = openLayersMap.getMap().getLonLatFromPixel(px);\n System.out.println(\"Caught mousemove event: \"+lonlat);\n }\n });\n\t\t*/\n\t}",
"public boolean canZoomOut() {\n\treturn getZoom() > getMinZoom();\n}",
"public void setZoomAnimationStyle(int style) {\n\t//zoomAnimationStyle = style;\n}",
"public void setZoom(float zoom) {\n\t\tthis.zoom = zoom;\n\t\trevalidate();\n\t\trepaint();\n\t}",
"public void setZoom(double zoom) {\n if (zoom > 0) {\n this.zoom = zoom;\n this.rescale();\n }\n }",
"public void setZoom(double zoom) {\n if(zoom != mZoom) {\n mZoom = zoom;\n setChanged();\n }\n }",
"public void panOrZoom(ME_ENUM me_enum, MouseEvent me) {\n if (me.getButton() != MouseEvent.BUTTON2 && ui_inter != UI_INTERACTION.PANNING && pan_mode == false) return;\n switch (me_enum) {\n case PRESSED: initializeDragVars(me); ui_inter = UI_INTERACTION.PANNING; repaint(); break;\n case DRAGGED: updateDragVars(me,true); repaint(); break;\n case RELEASED: updateDragVars(me,true); ui_inter = UI_INTERACTION.NONE; \n double dx = m_wx1 - m_wx0, dy = m_wy1 - m_wy0;\n if (dx != 0.0 || dy != 0.0) {\n Rectangle2D r = getExtents();\n setExtents(new Rectangle2D.Double(r.getX() - dx, r.getY() - dy, r.getWidth(), r.getHeight()));\n }\n break;\n case CLICKED: zoomToFit(); break;\n\tcase MOVED:\n\t\tbreak;\n\tcase WHEEL:\n\t\tbreak;\n\tdefault:\n\t\tbreak;\n }\n }",
"@Override\n public void onCameraMove() {\n zoom = GMap.getCameraPosition().zoom;\n if(zoom >= 17.2f){\n map_label.setVisible(true);\n mapOverlay.setVisible(false);\n }\n else{\n map_label.setVisible(false);\n mapOverlay.setVisible(true);\n }\n\n }"
] | [
"0.747133",
"0.6985677",
"0.6956305",
"0.68998355",
"0.6763272",
"0.6742545",
"0.6619561",
"0.6560365",
"0.65041333",
"0.63964134",
"0.63929635",
"0.6302232",
"0.62500834",
"0.6238822",
"0.6236648",
"0.6202651",
"0.61783665",
"0.6166804",
"0.6102404",
"0.6080409",
"0.6061341",
"0.5970599",
"0.596217",
"0.5932741",
"0.59204316",
"0.589918",
"0.5897749",
"0.58547854",
"0.5834715",
"0.5833903",
"0.5818962",
"0.5811494",
"0.5791207",
"0.57685924",
"0.57635283",
"0.5713686",
"0.5702554",
"0.5702372",
"0.5690796",
"0.5644904",
"0.56431407",
"0.55905104",
"0.5578036",
"0.5534461",
"0.5524068",
"0.5515867",
"0.55119663",
"0.55073315",
"0.55063236",
"0.54984665",
"0.54813987",
"0.5465545",
"0.5421745",
"0.5399276",
"0.5393856",
"0.53902906",
"0.53902906",
"0.53852516",
"0.5383988",
"0.53830683",
"0.53823197",
"0.53811866",
"0.5378852",
"0.53652984",
"0.5364318",
"0.5343445",
"0.5329879",
"0.5319921",
"0.5318423",
"0.52980715",
"0.5293225",
"0.528369",
"0.52831125",
"0.52759314",
"0.5268306",
"0.5254217",
"0.524783",
"0.52453846",
"0.5238881",
"0.52286595",
"0.52134943",
"0.52079314",
"0.51770556",
"0.51701117",
"0.5152266",
"0.5141061",
"0.5130846",
"0.5127679",
"0.5126888",
"0.5124732",
"0.5124712",
"0.51180667",
"0.509898",
"0.50983906",
"0.50961006",
"0.50947356",
"0.50926316",
"0.50751215",
"0.5061804",
"0.50569606"
] | 0.76614654 | 0 |
To set browser to default zoom level 100% | public static void set100(){
driver.findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL, "0"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void setZoomLevel() {\n final float oldMaxScale = photoView.getMaximumScale();\n photoView.setMaximumScale(oldMaxScale *2);\n photoView.setMediumScale(oldMaxScale);\n }",
"public void setZoom(){\n\t\tactive.setZoom();\n\t}",
"private void adjustZoomFactor(){\n switch(zoomLevel){\n case 0:zoomFactor = 39; break;\n case 1:zoomFactor = 37; break;\n case 2:zoomFactor = 35; break;\n case 3:zoomFactor = 33; break;\n case 4:zoomFactor = 31; break;\n case 5:zoomFactor = 29; break;\n case 6:zoomFactor = 27; break;\n case 7:zoomFactor = 25; break;\n case 8:zoomFactor = 23; break;\n case 9:zoomFactor = 21; break;\n case 10:zoomFactor = 20; break;\n case 11:zoomFactor = 18; break;\n case 12:zoomFactor = 16; break;\n case 13:zoomFactor = 14; break;\n case 14:zoomFactor = 12; break;\n case 15:zoomFactor = 10; break;\n case 16:zoomFactor = 8; break;\n case 17:zoomFactor = 6; break;\n case 18:zoomFactor = 4; break;\n case 19:zoomFactor = 2; break;\n case 20:zoomFactor = 0; break;\n }\n }",
"public void setZoom(float zoom){\r\n zoom = zoom * 100;\r\n zoom = Math.round(zoom);\r\n this.zoom = Math.max(zoom / 100, 0.01f);\r\n }",
"@Override\n public void setZoom(double zoom)\n {\n super.setZoom(zoom);\n delayedRepainting.requestRepaint(ZOOM_REPAINT);\n }",
"private void unsafeSetInitialZoom() {\n if (hic.isInPearsonsMode()) {\n initialZoom = hic.getMatrix().getFirstPearsonZoomData(HiC.Unit.BP).getZoom();\n } else if (HiCFileTools.isAllChromosome(hic.getXContext().getChromosome())) {\n mainViewPanel.getResolutionSlider().setEnabled(false);\n initialZoom = hic.getMatrix().getFirstZoomData(HiC.Unit.BP).getZoom();\n } else {\n mainViewPanel.getResolutionSlider().setEnabled(true);\n\n HiC.Unit currentUnit = hic.getZoom().getUnit();\n\n List<HiCZoom> zooms = (currentUnit == HiC.Unit.BP ? hic.getDataset().getBpZooms() :\n hic.getDataset().getFragZooms());\n\n\n// Find right zoom level\n\n int pixels = mainViewPanel.getHeatmapPanel().getMinimumDimension();\n int len;\n if (currentUnit == HiC.Unit.BP) {\n len = (Math.max(hic.getXContext().getChrLength(), hic.getYContext().getChrLength()));\n } else {\n len = Math.max(hic.getDataset().getFragmentCounts().get(hic.getXContext().getChromosome().getName()),\n hic.getDataset().getFragmentCounts().get(hic.getYContext().getChromosome().getName()));\n }\n\n int maxNBins = pixels / HiCGlobals.BIN_PIXEL_WIDTH;\n int bp_bin = len / maxNBins;\n initialZoom = zooms.get(zooms.size() - 1);\n for (int z = 1; z < zooms.size(); z++) {\n if (zooms.get(z).getBinSize() < bp_bin) {\n initialZoom = zooms.get(z - 1);\n break;\n }\n }\n\n }\n hic.unsafeActuallySetZoomAndLocation(\"\", \"\", initialZoom, 0, 0, -1, true, HiC.ZoomCallType.INITIAL, true);\n }",
"public void zoomIn() { zoomIn(1); }",
"@Override\n\tpublic void setZoom(int zoom) {\n\t\t\n\t}",
"public void zoom() {\n\t\tdisp.zoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"public void zoomScaleIn() {\n \t\tzoomScale(SCALE_DELTA_IN);\n \t}",
"public void zoomIn() {\n \t\tzoom(1);\n \t}",
"public void zoomToFit() { zoomToFit(null); }",
"public void setZoom(int ps) {\n P_SCALE = ps;\n //EMBOSS = P_SCALE*8;\n }",
"int getZoomPref();",
"public void setZoom(float zoom) {\r\n\t\tif (zoom < 0.1f)\r\n\t\t\treturn;\r\n\t\tthis.zoomFactor = zoom;\r\n\t}",
"public void zoomIn() {\n\tsetZoom(getNextZoomLevel());\n}",
"public synchronized void setZoom(float zoom)\r\n {\r\n this.zoom = Utils.clampFloat(zoom, .4f, 1.5f);\r\n }",
"@Override\n public void Zoom(double zoomNo, boolean setZoom) {\n\t \n }",
"public void setZoom(float zoom) {\n this.zoom = zoom;\n }",
"public void setleZoom( double valeur) {\n\t\tzoomMonde = valeur;\n\t}",
"public void zoomOnAddress(){\n adjustZoomLvl(16000);\n adjustZoomFactor();\n }",
"public void zoomIn() {\n if (scale < 0.8) {\n double scaleFactor = (scale + 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale += 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n\n }",
"public void zoomIn()\n {\n zoomIn(1, width >> 1, height >> 1);\n }",
"public void updateZoom() {\n camera.zoom = zoomLevel;\n }",
"public void setScale() {\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n scaleAffine();\n Scalebar.putZoomLevelDistances();\n\n //Set up the JFrame using the monitors resolution.\n setSize(screenSize); //screenSize\n setPreferredSize(new Dimension(800, 600)); //screenSize\n setExtendedState(Frame.NORMAL); //Frame.MAXIMIZED_BOTH\n }",
"public void zoomToLevel(int level) {\n \t\tfloat scale = getScaleFromZoom(level);\n \t\tzoomToScale(scale);\n \t}",
"private void applyZoomRatio(float ratio) {\n\t\tzoom = zoom * ratio;\n\t}",
"public void setZoom(double zoom) {\n if (zoom > 0) {\n this.zoom = zoom;\n this.rescale();\n }\n }",
"@Override\n public void Zoom(double zoomNo) {\n\t \n }",
"public static void changeCameraZoom(boolean zoomIn){\r\n\t\tif(zoomIn && zoomLevel > 0){\r\n\t\t\tzoomLevel -= 2;\r\n\t\t}else if(!zoomIn){\r\n\t\t\tzoomLevel += 2;\r\n\t\t}\r\n\t}",
"public final void setBestFit() {\r\n setZoom(ZOOM_BEST_FIT);\r\n }",
"protected void zoomToScale(float scale) {\n \t\tif (tweening) {\n \t\t\tscaleIntegrator.target(scale);\n \t\t} else {\n \t\t\tmapDisplay.sc = scale;\n \t\t\t// Also update Integrator to support correct tweening after switch\n \t\t\tscaleIntegrator.target(scale);\n \t\t\tscaleIntegrator.set(scale);\n \t\t}\n \t}",
"public final void setRealSize() {\r\n setZoom(ZOOM_REAL_SIZE);\r\n }",
"public void zoomToFactor(double d) {\n\t\t\n\t}",
"public void zoomIn() {\r\n \t\tgraph.setScale(graph.getScale() * 1.25);\r\n \t}",
"public void setZoom(Integer zoom) {\n this.zoom = zoom;\n }",
"public void setZoom(Integer zoom) {\n this.zoom = zoom;\n }",
"private static void initZoomOptions() {\n\t\tfloat zoom = 0;\n\t\twhile (zoom < DiagramaFigura.MAX_ZOOM) {\n\t\t\tzoom += DiagramaFigura.DELTA_ZOOM;\n\t\t\tif (zoom >= DiagramaFigura.MIN_ZOOM) {\n\t\t\t\tString key = Integer.toString((int) (zoom * 100));\n\t\t\t\tzoomOptions.put(key + \"%\", zoom);\n\t\t\t}\n\t\t}\n\t}",
"protected void primSetZoom(double zoom) {\n\tPoint p1 = getViewport().getClientArea().getCenter();\n\tPoint p2 = p1.getCopy();\n\tPoint p = getViewport().getViewLocation();\n\tdouble prevZoom = this.zoom;\n\tthis.zoom = zoom;\n\tpane.setScale(zoom);\n\tfireZoomChanged();\n\tgetViewport().validate();\n\t\n\tp2.scale(zoom / prevZoom);\n\tDimension dif = p2.getDifference(p1);\n\tp.x += dif.width;\n\tp.y += dif.height;\n\tsetViewLocation(p);\t\n}",
"public void setZoom( double zoom ) {\n\t\tthis.zoom = zoom;\n\t}",
"@JavascriptInterface\n public void setZoom(final int zoom) {\n getHandler().post(new Runnable() {\n @Override\n public void run() {\n if (mWebViewFragment.getMapSettings()\n .getZoom() != zoom) {\n if (BuildConfig.DEBUG) {\n Log.d(TAG,\n \"setZoom \" + zoom);\n }\n\n final MapSettings mapSettings = mWebViewFragment.getMapSettings();\n mapSettings.setZoom(zoom);\n mWebViewFragment.setMapSettings(mapSettings);\n }\n }\n });\n }",
"public void setZoom(double zoom) {\n\tzoom = Math.min(getMaxZoom(), zoom);\n\tzoom = Math.max(getMinZoom(), zoom);\n\tif (this.zoom != zoom)\n\t\tprimSetZoom(zoom);\n}",
"int getMinZoom();",
"private double resolution(int zoom) {\n\t\treturn this.initialResolution / (Math.pow(2, zoom));\r\n\t}",
"private void calculateBasicRatio() {\n if (mLastZoomRatio == DEFAULT_VALUE) {\n if(isAngleCamera()){\n mBasicZoomRatio = 1.6f;\n }else{\n mBasicZoomRatio = ZOOM_UNSUPPORTED_DEFAULT_VALUE;\n }\n } else {\n mBasicZoomRatio = mLastZoomRatio;\n }\n //modify by bv liangchangwei for fixbug 3518\n }",
"public void zoom(int s) {\r\n\t\tzoom += s * ZOOM_FACTOR;\r\n\t}",
"@JSProperty(\"maxZoom\")\n void setMaxZoom(double value);",
"void multitouchZoom(int new_zoom);",
"public void setFacteurZoom(double fac)\n\t{\n \tthis.facteurZoom = this.facteurZoom * fac ;\n \tif (this.facteurZoom == 0)\n \t{\n \t\tthis.facteurZoom = 0.01;\n \t}\n }",
"public void adjustZoomLvl(double scale){\n zoomLevel = ZoomCalculator.calculateZoom(scale);\n scale = ZoomCalculator.setScale(zoomLevel);\n transform.setToScale(scale, -scale);\n }",
"protected abstract void onScalePercentChange(int zoom);",
"public void zoomOut() { zoomOut(1); }",
"public void setZoom(float zoom) {\n\t\tthis.zoom = zoom;\n\t\trevalidate();\n\t\trepaint();\n\t}",
"public void zoomScale(double scaleDelta) {\n \t\tzoomToScale((float) (mapDisplay.sc * scaleDelta));\n \t}",
"public void setZoom(double zoom) {\n if(zoom != mZoom) {\n mZoom = zoom;\n setChanged();\n }\n }",
"private void clampZoom()\n\t{\n\t\tif (zoom < ZOOM_MINIMUM)\n\t\t{\n\t\t\tzoom = ZOOM_MINIMUM;\n\t\t}\n\t\telse if (zoom > ZOOM_MAXIMUM)\n\t\t{\n\t\t\tzoom = ZOOM_MAXIMUM;\n\t\t}\n\t}",
"public void unzoom() {\n\t\tdisp.unzoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"boolean allowZoom();",
"int getMaximumZoomlevel();",
"public double getZoomFactor()\r\n {\r\n return zoomFactor;\r\n }",
"@Override\n public void setCameraZoom(int zoomLevel) {\n mMap.moveCamera(CameraUpdateFactory.zoomTo(zoomLevel));\n }",
"public void setScaleFactor(float scale){\n scaleFactor = scale;\n }",
"public void zoomOut() {\n if (scale > 0.05) {\n double scaleFactor = (scale - 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale -= 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n }",
"public void zoomCam(float zoom){\n\t\tthis.camera.setZoom(zoom);\n\t}",
"public int getZoom() {\n return P_SCALE;\n }",
"public void setScale(float scale);",
"public void setMaxzoom(Integer maxzoom) {\n this.maxzoom = maxzoom;\n }",
"public float getCurZoomRatio(){\n if(mCurZoomRatio<1.0f){\n mCurZoomRatio = ZOOM_UNSUPPORTED_DEFAULT_VALUE;\n }\n return mCurZoomRatio;\n }",
"public long getZoomLevel()\r\n {\r\n return myZoomLevel;\r\n }",
"public void zoomScaleOut() {\n \t\tzoomScale(SCALE_DELTA_OUT);\n \t}",
"void startZoom() {\n\t\t// this boolean tells the system that it needs to \n\t\t// initialize itself before trying to zoom\n\t\t// This is cleaner than duplicating code\n\t\t// see processZoom\n\t\tmZoomEstablished=false;\n\t}",
"@Test\n public void testSetZoomMultiplier() {\n final DraggingCamera camera = newValueObject();\n testBoundField(camera, DraggingCamera.ZOOM_MULTIPLIER, 1.678f);\n }",
"@Test\n public void setZoom() throws Exception {\n Document doc = new Document();\n DocumentBuilder builder = new DocumentBuilder(doc);\n builder.writeln(\"Hello world!\");\n\n doc.getViewOptions().setViewType(ViewType.PAGE_LAYOUT);\n doc.getViewOptions().setZoomPercent(50);\n\n Assert.assertEquals(ZoomType.CUSTOM, doc.getViewOptions().getZoomType());\n Assert.assertEquals(ZoomType.NONE, doc.getViewOptions().getZoomType());\n\n doc.save(getArtifactsDir() + \"ViewOptions.SetZoomPercentage.doc\");\n //ExEnd\n\n doc = new Document(getArtifactsDir() + \"ViewOptions.SetZoomPercentage.doc\");\n\n Assert.assertEquals(ViewType.PAGE_LAYOUT, doc.getViewOptions().getViewType());\n Assert.assertEquals(50, doc.getViewOptions().getZoomPercent());\n Assert.assertEquals(ZoomType.NONE, doc.getViewOptions().getZoomType());\n }",
"@Override\n public void setContentScaleFactor(double v) {\n super.setContentScaleFactor(1);\n }",
"public float getPercentZoom() {\r\n return percentZoom;\r\n }",
"public void zoomIn() {\n if (zoom > 0) {\n zoom--;\n spielPanel.setZoom(zoom);\n }\n }",
"public native final void setMaxZoom(double maxZoom)/*-{\n this.maxZoom = maxZoom;\n }-*/;",
"public void setZoom(float zoomValue) {\n pos.zoom = zoomValue;\n invalidate();\n }",
"protected abstract void handleZoom();",
"public void setScale(double scale) {\r\n if (scale >= 0.1) {\r\n this.scale = scale;\r\n }\r\n }",
"public void setZoomFactor( double inZoomFactor )\r\n {\r\n if( inZoomFactor <= 0 )\r\n throw new RuntimeException( \"Zoom factor \" + inZoomFactor + \" is not > 0\" );\r\n \r\n \r\n // Set zoom factor and update view bounds \r\n zoomFactor = inZoomFactor;\r\n updateViewBounds();\r\n \r\n // Propagate the fact that the size has changed up the container hierarchy\r\n revalidate();\r\n \r\n // Repaint the visualisation now that the size and zoom factor have changed\r\n repaint();\r\n }",
"public void zoom(float zoom) { \n if (zoom <=0) {\n throw new IllegalArgumentException();\n }\n\n workTransform.setTransform(null);\n workTransform.mScale(zoom);\n workTransform.mMultiply(userTransform);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"protected byte desiredWinScale() { return 9; }",
"private void addDefaultHandlers()\n\t{\n\t\t\t\tthis.openLayersMap.getMap().addMapZoomListener(new MapZoomListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onMapZoom(MapZoomEvent eventObject)\n\t\t\t{\n\t\t\t\t//TODO - Do nothing for now, leaving in for testing.\n\t\t\t}\n\t\t});\n\t\t\n\t\t/**\n\t\t This event register is neeeded, because in case the user resizes the browser window, openlayer for some reason\n\t\t\tzooms in. So when it does that, we get back to the default zoom by using the zoomTo method.\n\t\t */\n\t\tthis.openLayersMap.getMap().getEvents().register(\"zoomend\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n \t\t/**\n \t\t\tUsing this technique here, because, in the event that the user double clicks on the map\n\t \t\twe need to wait till this action has completed and then revert to the default map zoom.\n\t \t\tIf we didn't have this, the \"revert\" would not be successful.\n\t \t\thttp://dantwining.co.uk/2010/03/01/gwt-openlayers-and-full-screen-maps/\n \t\t */\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @zoomend, Reverting to Map Zoom: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }\n });\n\t\t\n\t\t/**\n\t\t * This event register is needed because, on mobile devices (tested on ipad2 and ipad mini), after the update size\n\t\t * triggered when the screen went from landscape to portait (in MainAppView) the upper tiles were white. In other\n\t\t * words, the transition did not update the map-tiles-in-view to the new map size. So, by doing this, the map zooms in \n\t\t * when the update size is triggered, which \"enforces\" the updating of the map tiles. Also, because of the \"zoomend\"\n\t\t * event the map will revert to the default zoom level after this.\n\t\t */\n\t\tthis.openLayersMap.getMap().getEvents().register(\"updatesize\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n \t\t\t\t Scheduler.get().scheduleDeferred(new ScheduledCommand() \n \t\t\t {\n \t\t\t\t \t@Override\n \t\t\t\t \tpublic void execute()\n \t\t\t\t \t{\n \t\t\t\t \t\topenLayersMap.getMap().zoomTo(ZOOM_LEVEL+1);\n \t\t\t \t\t\t\tSystem.out.println(\"@MapComponent, @updatesize, Re-zooming after size update: \"+openLayersMap.getMap().getZoom());\n \t\t\t\t \t}\n \t\t\t });\n }\n });\n\t\t\n\t\t/**\n\t\tThe following is useful if we want to convert map coordinates to pixel x,y coordinates.\n\t\tSo, if we want to draw on top of a map layer, this seems to be a good way to do it.\n\t\thttp://stackoverflow.com/questions/6032460/mousemove-events-in-gwt-openlayers \n\t\t \n\t\tthis.openLayersMap.getMap().getEvents().register(\"mousemove\", this.openLayersMap.getMap(), new EventHandler() \n\t\t{\n @Override\n public void onHandle(EventObject eventObject)\n {\n JSObject xy = eventObject.getJSObject().getProperty(\"xy\");\n Pixel px = Pixel.narrowToPixel(xy);\n LonLat lonlat = openLayersMap.getMap().getLonLatFromPixel(px);\n System.out.println(\"Caught mousemove event: \"+lonlat);\n }\n });\n\t\t*/\n\t}",
"public void zoomNPinch(WebElement element){\n driver.zoom(element);\n driver.pinch(element);\n }",
"public void zoomIn() {\n\t\tif (this.zoom + DELTA_ZOOM <= MAX_ZOOM)\n\t\t\tthis.setZoom(this.zoom + DELTA_ZOOM);\n\t}",
"public void zoomOut() {\n \t\tzoom(-1);\n \t}",
"public void setZoomLevel(int index) {\n if (index >= 0 && index < zoomLevels.length) {\n this.zoomLevel = index;\n this.setZoom(zoomLevels[index]);\n }\n }",
"public float getZoom() {\n return zoom;\n }",
"public synchronized float getZoom()\r\n {\r\n return zoom;\r\n }",
"public float getZoom() {\n if(internalNative != null) {\n return internalNative.getZoom();\n } else {\n if(internalLightweightCmp != null) {\n return internalLightweightCmp.getZoomLevel();\n }\n // TODO: Browser component\n return 7;\n } \n }",
"public void setGlobalScale(float newScale) {\n scale(new Vector3(newScale, newScale, newScale));\n }",
"public void resetGraphicsWindowZoomAndMeasurement() {\r\n\t\tif (Thread.currentThread().getId() == DataExplorer.application.getThreadId()) {\r\n\t\t\tthis.graphicsTabItem.setModeState(GraphicsMode.RESET);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tGDE.display.asyncExec(new Runnable() {\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\tDataExplorer.this.graphicsTabItem.setModeState(GraphicsMode.RESET);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}",
"public void setZoomAnimationStyle(int style) {\n\t//zoomAnimationStyle = style;\n}",
"public static void zoomOutPage(int percent) {\r\n\t\tJavascriptExecutor js = (JavascriptExecutor) base.driver;\r\n\t\tjs.executeScript(\"document.body.style.zoom='\" + percent + \"%'\");\r\n\t}",
"public void zoom(int levelDelta) {\n \t\tint newLevel = getZoomLevelFromScale(mapDisplay.sc) + levelDelta;\n \t\tzoomToLevel(newLevel);\n \t}",
"public float getZoom() {\n return zoom;\n }",
"public void setScale(float scale) {\n setLocalScale(scale);\n }",
"public int getZoomLevel() {\n return this.zoomLevel;\n }",
"void onZoom() {\n\t\tmZoomPending=true;\n\t}",
"public void zoomOut() {\r\n \t\tgraph.setScale(graph.getScale() / 1.25);\r\n \t}"
] | [
"0.71625876",
"0.7153255",
"0.7130142",
"0.70315534",
"0.69134456",
"0.6908291",
"0.6898134",
"0.6840462",
"0.6809383",
"0.67923707",
"0.67657185",
"0.66966605",
"0.6686549",
"0.6659474",
"0.6611097",
"0.66003036",
"0.6597883",
"0.65715075",
"0.65577656",
"0.65428525",
"0.6537149",
"0.65310496",
"0.6514918",
"0.65081894",
"0.650306",
"0.6501638",
"0.64973617",
"0.64770895",
"0.6477041",
"0.64764553",
"0.64043087",
"0.638121",
"0.63698655",
"0.63683003",
"0.63677394",
"0.6358734",
"0.6358734",
"0.6327631",
"0.6321335",
"0.6319354",
"0.63182217",
"0.63132674",
"0.6305362",
"0.6291005",
"0.62894833",
"0.62755686",
"0.6274807",
"0.6273072",
"0.6266785",
"0.62534547",
"0.62523913",
"0.62363356",
"0.6225674",
"0.6216265",
"0.61761856",
"0.61715245",
"0.614965",
"0.61327755",
"0.613129",
"0.6125592",
"0.61210537",
"0.6120218",
"0.6086117",
"0.6057017",
"0.60539746",
"0.6028265",
"0.60221094",
"0.6021781",
"0.60053045",
"0.6003779",
"0.60011667",
"0.59677863",
"0.59597796",
"0.59545165",
"0.59499115",
"0.5948058",
"0.59416884",
"0.59272194",
"0.59142673",
"0.5904672",
"0.5902551",
"0.5901014",
"0.58821994",
"0.5879002",
"0.58625424",
"0.58564323",
"0.58398944",
"0.5834556",
"0.5833927",
"0.5826852",
"0.58260065",
"0.58206034",
"0.58143157",
"0.5792244",
"0.5785466",
"0.5783968",
"0.57739615",
"0.57674116",
"0.57518953",
"0.5735483",
"0.5721276"
] | 0.0 | -1 |
/ myApplication myapplication = (myApplication) getApplication(); myapplication.setUsername(name); myapplication.setPsd(psd); | @Override
protected void onSuccess(Call<User> call, Response<User> response) {
Intent intent = new Intent();
intent.setClass(LoginActivity.this, MainActivity.class);
startActivity(intent);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setApp(PR1 application){\n this.application = application;\n }",
"public void setApp(Main application) { this.application = application;}",
"void setApplicationName(String appName);",
"public void setAppName(String appName);",
"Appinfo createAppinfo();",
"public Application(String name, String dob, String gender, String income, String apt, String moveDate, String term, String approval, String username)\n {\n this.name = new SimpleStringProperty(name);\n this.dob = new SimpleStringProperty(dob);\n this.gender = new SimpleStringProperty(gender);\n this.income = new SimpleStringProperty(income);\n this.apt = new SimpleStringProperty(apt);\n this.moveDate = new SimpleStringProperty(moveDate);\n this.term = new SimpleStringProperty(term);\n this.approval = new SimpleStringProperty(approval);\n this.username = new SimpleStringProperty(username);\n }",
"public void setApplication(String application) {\r\n this.application = application;\r\n }",
"void setUser(final ApplicationUser user);",
"public void setApp(Main application){\n this.application = application;\n }",
"CdapApplication createCdapApplication();",
"public void setApplication(String application) {\r\n\t\tthis.application = application;\r\n\t}",
"public com.google.protobuf.Empty setApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.Application request);",
"Application getApplication();",
"public void setApplication(AppW app) {\n\t\tthis.app = app;\n\t}",
"private void setUserData(){\n }",
"public static void setApplication(ApplicationBase instance)\r\n {\r\n ApplicationBase.instance = instance;\r\n }",
"@Override\n \tprotected void setApplicationName(String applicationName)\n \t{\n \t\tsuper.setApplicationName(applicationName);\n \n \t\tPropertiesAndDirectories.setApplicationName(applicationName);\n \t}",
"public void setApp(MainFXApplication main) {\n mainApplication = main;\n database = mainApplication.getUsers();\n\n }",
"public AddApplicationData (){\n }",
"public String _setuser(b4a.HotelAppTP.types._user _u) throws Exception{\n_types._currentuser.username = _u.username;\n //BA.debugLineNum = 168;BA.debugLine=\"Types.currentuser.password = u.password\";\n_types._currentuser.password = _u.password;\n //BA.debugLineNum = 169;BA.debugLine=\"Types.currentuser.available = u.available\";\n_types._currentuser.available = _u.available;\n //BA.debugLineNum = 170;BA.debugLine=\"Types.currentuser.ID = u.ID\";\n_types._currentuser.ID = _u.ID;\n //BA.debugLineNum = 171;BA.debugLine=\"Types.currentuser.TypeOfWorker = u.TypeOfWorker\";\n_types._currentuser.TypeOfWorker = _u.TypeOfWorker;\n //BA.debugLineNum = 172;BA.debugLine=\"Types.currentuser.CurrentTaskID = u.CurrentTaskID\";\n_types._currentuser.CurrentTaskID = _u.CurrentTaskID;\n //BA.debugLineNum = 173;BA.debugLine=\"End Sub\";\nreturn \"\";\n}",
"@Override\n\tpublic void initApplication(BBApplication app) {\n\t\tthis._application = app;\n\t}",
"public void setUser_name(String user_name);",
"public MTApplication(){\r\n\t\tsuper();\r\n\t}",
"@Override\n public void onCreate() {\n super.onCreate();\n application = this;\n }",
"public Application() {\n\t\tinitComponents();\n\t\tthis.service = new PacienteService();\n\t\tthis.AtualizarTabelaPacientes();\n\t\tthis.sexo = this.rd_nao_informado.getText();\n\t\tthis.cb_estados.setSelectedIndex(24);\n\t}",
"public void setApplicationFrame(ApplicationFrame mainFrame) { }",
"static void setApp(PApplet _app){\n app = _app;\n }",
"public interface AppAttributes{\n\n /**\n The DVB registered value for all DVB-J applications.\n */\n public static final int DVB_J_application = 1; \n\n /**\n The DVB registered value for all DVB-HTML applications.\n */\n public static final int DVB_HTML_application = 2;\n\n /**\n * This method returns the type of the application (as registered by DVB).\n *\n * @return the type of the application (as registered by DVB).\n * @since MHP1.0\n */\n public int getType();\n\n /**\n * This method returns the name of the application. If the default language\n * (as specified in user preferences) is in the set of available language / name pairs\n * then the name in that language shall be returned. Otherwise\n * this method will return a name which appears in that set on a \"best-effort basis\".\n * If no application names are signalled, an empty string shall be returned.\n * @return the name of the application\n *\n * @since MHP1.0\n */\n public String getName();\n\n /**\n * This method returns the name of the application in the language which \n * is specified by the parameter passed as an argument. If the language\n * specified is not in the set of available language /name pairs then an\n * exception shall be thrown.\n *\n * @param iso639code the specified language, encoded as per ISO 639.\n * @return returns the name of the application in the specified language\n * @throws LanguageNotAvailableException if the name is not available in the language specified or if the parameter passed is null\n *\n * @since MHP1.0\n */\n public String getName(String iso639code) \n\tthrows LanguageNotAvailableException;\n\n /**\n * This method returns all the available names for the application\n * together with their ISO 639 language code. \n * If no application names are signalled, an array of length zero shall be returned.\n *\n * @return the possible names of the application, along with \n * their ISO 639 language code. The first string in each sub-array is the \n * ISO 639 language code.\n * The second string in each sub-array is the corresponding application name.\n * @since MHP1.0\n */\n public String[][] getNames () ;\n\n /**\n * This method returns those minimum profiles required for the application\n * to execute. Profile\n * names shall be encoded using the same encoding specified elsewhere in this\n * specification as input for use with the <code>java.lang.System.getProperty</code>\n * method to query if a profile is supported by this platform. <p>For example,\n * for implementations conforming to the first version of the \n * specification, the translation from AIT signaling values to strings\n * shall be as follows:\n * <ul>\n * <li> '1' in the signaling will be translated into \n * 'mhp.profile.enhanced_broadcast'\n * <li> '2' in the signaling will be translated into \n * 'mhp.profile.interactive_broadcast'\n * </ul>\n *\n * Only profiles supported by this particular MHP terminal shall be returned.\n * Hence the method can return an array of size zero where all the profiles\n * on which an application can execute are unknown.\n *\n * @return an array of Strings, each String describing a profile.\n *\n * @since MHP1.0\n */\n public String[] getProfiles();\n \n /**\n * This method returns an array of integers containing the version\n * number of the specification required to run this application\n * at the specified profile. \n *\n * @param profile a profile encoded as described in the main body of\n * the present document for use with <code>java.lang.System.getProperty</code>.\n *\n * @return an array of integers, containing the major, minor \n * and micro values (in that order) required for the specified profile. \n * @throws IllegalProfileParameterException thrown if the profile specified\n * is not one of the minimum profiles required for the application to execute\n * or if the parameter passed in is null\n * @since MHP1.0\n */\n public int[] getVersions(String profile) \n\tthrows IllegalProfileParameterException ;\n\n /**\n * This method determines whether the application is bound to a single service.\n *\n * @return true if the application is bound to a single service, false otherwise. \n * @since MHP1.0\n */\n public boolean getIsServiceBound () ;\n\n /**\n * This method determines whether the application is startable or not.\n * An Application is not startable if any of the following apply.<ul>\n\n * <li>The application is transmitted on a remote connection.\n\n * <li>The caller of the method does not have the Permissions to start it.\n * <li>if the application is signalled with a control code which is neither AUTOSTART nor PRESENT.\n * </ul>\n * If none of the above apply, then the application is startable.\n * <p> The value returned by this method does not depend on whether the \n * application is actually running or not.\n * \n * @return true if an application is startable, false otherwise.\n *\n * @since MHP1.0\n */\n public boolean isStartable () ;\n\n /**\n * This method returns the application identifier. \n *\n * @return the application identifier\n * @since MHP1.0\n */\n public AppID getIdentifier () ;\n\n /**\n * This method returns an object encapsulating the information about the\n * icon(s) for the application.\n *\n * @return the information related to the icons that\n * are attached to the application or null if no icon information is available\n * @since MHP1.0\n */\n public AppIcon getAppIcon () ;\n\n /**\n * This method returns the priority of the application.\n *\n * @return the priority of the application.\n *\n * @since MHP1.0\n */\n public int getPriority();\n\n /**\n * This method returns the locator of the Service describing the application. \n * For an application transmitted on a remote connection, the returned\n * locator shall be the service for that remote connection. For applications\n * not transmitted on a remote connection, the service returned shall be the\n * currently selected service of the service context within which the application \n * calling the method is running.\n * \n * @return the locator of the Service describing the application.\n * @since MHP1.0\n */\n public org.davic.net.Locator getServiceLocator();\n\n\n /**\n * The following method is included for properties that do not have \n * explicit property accessors. The naming of properties and their return\n * values are described in the main body of the present document.\n *\n * @since MHP1.0\n * \n * @param index a property name\n * @return either the return value corresponding to the property name or null\n * if the property name is unknown or null\n */\n public Object getProperty (String index) ;\n\n\n /**\n * This method determines whether the application is marked as being\n * visible to users. An inter-operable application shall honour this\n * visibility setting. Thus a generic launching application shall list\n * applications that are marked as visible and shall not list\n * applications that are not marked as visible.\n *\n * @return <code>true</code> if this application is marked as being\n * visible to users, <code>false</code> otherwise.\n * @since MHP1.0.3\n */\n public boolean isVisible();\n\n}",
"protected void setApplication (MauiApplication aApplication)\n\t{\n\t\tif (application != aApplication)\n\t\t{\n\t\t\tapplication = aApplication;\n\t\t\tString theApplicationAddress = aApplication.getApplicationAddress ();\n\t\t\tif (!applications.contains (theApplicationAddress))\n\t\t\t{\n\t\t\t\tapplications.put (theApplicationAddress, aApplication);\t// Cache it\n\t\t\t\tnotifySessionListeners (this, aApplication, true);\n\t\t\t}\n\t\t}\n\t}",
"void setUserUsername(String username);",
"abstract public String getApplicationName();",
"public void setMainApp(MainApp mainApp);",
"public PSFUDApplication()\n {\n loadSnapshot();\n }",
"public Application()\r\n {\r\n pSlot = new ParkingSlot();\r\n cPark = new CarPark();\r\n }",
"private native static int shout_set_user(long shoutInstancePtr, String user);",
"public void setUser(String user)\n {\n _user = user;\n }",
"public static void main(String args[]){\r\n Application theApp = new Application();\r\n theApp.createAccounts();\r\n theApp.processAccounts();\r\n theApp.outputAccounts();\r\n\r\n }",
"void updateActivationCode(User user) ;",
"protected Application getApplication() {\r\n\t\treturn application;\r\n\t}",
"@Override\r\n public void saveEApplication() {\n }",
"public void setupUserInfo(Bundle upUserInfo) {\n // Getting Info\n String name = upUserInfo.getString(\"userName\");\n String email = upUserInfo.getString(\"userEmail\");\n\n\n // Setting local Variables\n this.tutorName = name;\n this.tutorEmail = email;\n\n TextView nameField = (TextView) findViewById(R.id.UserNameField);\n nameField.setText(name);\n\n\n }",
"@Override\r\n\t\tpublic void setTradeApplication(TradeApplication app) {\n\t\t\t\r\n\t\t}",
"public void init(IApplication app){\n\t\tthis.iApp = app;\n\t}",
"public void setProducerApplication(String sProducerApplication) throws IOException;",
"public void setAppName( String appName )\n\t{\n\t\tthis.appName = appName;\n\t}",
"public SharedPreferencesModule(){\n //this.application = application;\n }",
"public String getApp();",
"public void setAppMgr(IApplicationManager theAppMgr) {\n this.theAppMgr = theAppMgr;\n this.setBackground(theAppMgr.getBackgroundColor());\n double r = com.chelseasystems.cr.swing.CMSApplet.r;\n //Loop through and set Application managers for all\n // JCMS components.\n for (int iCtr = 0; iCtr < this.getComponentCount(); iCtr++) {\n Component component = this.getComponent(iCtr);\n if (component instanceof JCMSTextField) {\n ((JCMSTextField)component).setAppMgr(theAppMgr);\n ((JCMSTextField)component).setFont(theAppMgr.getTheme().getTextFieldFont());\n ((JCMSTextField)component).setPreferredSize(new Dimension((int)(65 * r), (int)(25 * r)));\n ((JCMSTextField)component).setMaximumSize(new Dimension((int)(65 * r), (int)(25 * r)));\n ((JCMSTextField)component).setMinimumSize(new Dimension((int)(65 * r), (int)(25 * r)));\n } else if (component instanceof JCMSTextArea) {\n ((JCMSTextArea)component).setAppMgr(theAppMgr);\n ((JCMSTextArea)component).setFont(theAppMgr.getTheme().getTextFieldFont());\n ((JCMSTextArea)component).setPreferredSize(new Dimension((int)(65 * r), (int)(50 * r)));\n } else if (component instanceof JCMSLabel) {\n ((JCMSLabel)component).setAppMgr(theAppMgr);\n ((JCMSLabel)component).setFont(theAppMgr.getTheme().getLabelFont());\n ((JCMSLabel)component).setPreferredSize(new Dimension((int)(115 * r), (int)(25 * r)));\n } else if (component instanceof JCMSComboBox) {\n ((JCMSComboBox)component).setAppMgr(theAppMgr);\n ((JCMSComboBox)component).setPreferredSize(new Dimension((int)(65 * r), (int)(25 * r)));\n ((JCMSComboBox)component).setMaximumSize(new Dimension((int)(65 * r), (int)(25 * r)));\n ((JCMSComboBox)component).setMinimumSize(new Dimension((int)(65 * r), (int)(25 * r)));\n } else if (component instanceof JCMSMaskedTextField) {\n ((JCMSMaskedTextField)component).setAppMgr(theAppMgr);\n ((JCMSMaskedTextField)component).setFont(theAppMgr.getTheme().getTextFieldFont());\n ((JCMSMaskedTextField)component).setPreferredSize(new Dimension((int)(65 * r), (int)(25 * r)));\n ((JCMSMaskedTextField)component).setMaximumSize(new Dimension((int)(65 * r), (int)(25 * r)));\n ((JCMSMaskedTextField)component).setMinimumSize(new Dimension((int)(65 * r), (int)(25 * r)));\n }\n }\n lblReferredBy.setPreferredSize(new Dimension((int)(135 * r), (int)(25 * r)));\n lblPartenerFamName.setPreferredSize(new Dimension((int)(135 * r), (int)(25 * r)));\n }",
"public interface IAComponentContext\r\n {\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n public de.uka.ipd.sdq.simucomframework.variables.userdata.UserData getUserData();\r\n \t \r\n public void setUserData(de.uka.ipd.sdq.simucomframework.variables.userdata.UserData data);\r\n\n\r\n\r\n }",
"public AddApplicationData(String nameApplication, String descriptionApplication, int userId, int companyId){\n _nameApplication = nameApplication;\n _descriptionApplication = descriptionApplication;\n _userId = userId;\n _companyId = companyId;\n }",
"void setUser(OSecurityUser user);",
"public void setApp(EndUser endUser, room Room) {\n\t\tthis.endUser = endUser;\n\t\tthis.Room = Room;\n\t\tthis.cart = this.endUser.getCart();\n\t\tthis.defaultSetup();\n\t}",
"public String getAppName();",
"private void setUserCredentials() {\n ((EditText) findViewById(R.id.username)).setText(\"harish\");\n ((EditText) findViewById(R.id.password)).setText(\"11111111\");\n PayPalHereSDK.setServerName(\"stage2pph10\");\n }",
"public void setOwningApplication(Application owningApplication)\r\n\t{\r\n\t\tthis.owningApplication = owningApplication;\r\n\t}",
"public interface Mvp4gApplication {\n\n\n\n}",
"public static void main ( String[] args ) {\n PhoneBook myApp = new PhoneBook(); \r\n }",
"public org.thethingsnetwork.management.proto.HandlerOuterClass.Application getApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request);",
"@Override\n public void initialize(URL url, ResourceBundle rb) {\n primary.showingProperty().addListener((obs, oldValue, newValue) -> {\n if (newValue) {\n AppBar appBar = MobileApplication.getInstance().getAppBar();\n \n appBar.setVisible(true);\n \n appBar.setNavIcon(MaterialDesignIcon.MENU.button(e -> \n MobileApplication.getInstance().showLayer(App.MENU_LAYER)));\n appBar.setTitleText(\"Perfil\");\n \n userManager = LogicFactory.getUserManager();\n \n //Puts a prompt text on password fields\n tfPassword.setPromptText(\"Contraseña\");\n tfRepeatPassword.setPromptText(\"Repetir contraseña\");\n \n //Load the textField with the current user information.\n tfUserName.setText((String )userManager.getSession().get(\"username\"));\n tfName.setText((String )userManager.getSession().get(\"name\"));\n String[] surnames = ((String )userManager.getSession().get(\"surnames\")).split(\"%\");\n tfFirstSurName.setText(surnames[0]);\n tfSecondSurName.setText(surnames[1]);\n tfDirection.setText((String )userManager.getSession().get(\"address\"));\n tfEmail.setText((String )userManager.getSession().get(\"email\")); \n } \n });\n }",
"public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> setApplication(\n org.thethingsnetwork.management.proto.HandlerOuterClass.Application request);",
"void inject(FeelingApp application);",
"public String getApplication() {\r\n return application;\r\n }",
"void setUserInfo(UserInfo info);",
"@Test\n\tpublic void testApplicationValues() throws Throwable {\n\t\tApplication testedObject = new Application();\n\t\tApplicationInfo appJson = new ApplicationInfo();\n\t\ttestedObject.setAppJson(appJson);\n\t\ttestedObject.setApplicationName(\"applicationName21\");\n\n\t\tassertEquals(appJson, testedObject.getAppJson());\n\t\tassertEquals(\"applicationName21\", testedObject.getApplicationName());\n\t}",
"public void setApplicationDesc(Jnlp jnlp, String mainClass, HttpServletRequest request)\n {\n \tif (jnlp.getApplicationDesc() == null)\n \t\tjnlp.setApplicationDesc(new ApplicationDesc());\n \tApplicationDesc applicationDesc = jnlp.getApplicationDesc();\n \tapplicationDesc.setMainClass(mainClass);\n \t\n \tList<Argument> arguments = applicationDesc.getArgumentList();\n \tif (arguments == null)\n \t applicationDesc.setArgumentList(arguments = new ArrayList<Argument>());\n \t@SuppressWarnings(\"unchecked\")\n Enumeration<String> names = request.getParameterNames();\n \twhile (names.hasMoreElements())\n \t{\n \t String name = names.nextElement();\n if (isServletParam(name))\n continue;\n \t String value = request.getParameter(name);\n \t if (value != null)\n \t name = name + \"=\" + value;\n \tArgument argument = new Argument();\n \targument.setArgument(name);\n \targuments.add(argument);\n \t}\n }",
"void setUsername(String username);",
"public void startApp()\r\n\t{\n\t}",
"public void setApplication(String attName, Object value) {\n servletRequest.getServletContext().setAttribute(attName, value);\n }",
"public void setAppMgr(IApplicationManager theAppMgr) {\n\t\tthis.theAppMgr = theAppMgr;\n\t\tthis.setBackground(theAppMgr.getBackgroundColor());\n\t\tdouble r = com.chelseasystems.cr.swing.CMSApplet.r;\n\t\t// Loop through and set Application managers for all\n\t\t// JCMS components.\n\t\tfor (int iCtr = 0; iCtr < this.getComponentCount(); iCtr++) {\n\t\t\tComponent component = this.getComponent(iCtr);\n\t\t\tif (component instanceof JCMSTextField) {\n\t\t\t\t((JCMSTextField) component).setAppMgr(theAppMgr);\n\t\t\t\t((JCMSTextField) component).setFont(theAppMgr.getTheme().getTextFieldFont());\n\t\t\t\t((JCMSTextField) component).setPreferredSize(new Dimension((int) (65 * r), (int) (30 * r)));\n\t\t\t} else if (component instanceof JCMSTextArea) {\n\t\t\t\t((JCMSTextArea) component).setAppMgr(theAppMgr);\n\t\t\t\t((JCMSTextArea) component).setFont(theAppMgr.getTheme().getTextFieldFont());\n\t\t\t\t((JCMSTextArea) component).setPreferredSize(new Dimension((int) (55 * r), (int) (50 * r)));\n\t\t\t} else if (component instanceof JCMSLabel) {\n\t\t\t\t((JCMSLabel) component).setAppMgr(theAppMgr);\n\t\t\t\t((JCMSLabel) component).setFont(theAppMgr.getTheme().getLabelFont());\n\t\t\t\t((JCMSLabel) component).setPreferredSize(new Dimension((int) (85 * r), (int) (25 * r)));\n\t\t\t} else if (component instanceof JCMSComboBox) {\n\t\t\t\t((JCMSComboBox) component).setAppMgr(theAppMgr);\n\t\t\t\t((JCMSComboBox) component).setPreferredSize(new Dimension((int) (55 * r), (int) (25 * r)));\n\t\t\t} else if (component instanceof JCMSMaskedTextField) {\n\t\t\t\t((JCMSMaskedTextField) component).setAppMgr(theAppMgr);\n\t\t\t\t((JCMSMaskedTextField) component).setFont(theAppMgr.getTheme().getTextFieldFont());\n\t\t\t\t((JCMSMaskedTextField) component).setPreferredSize(new Dimension((int) (55 * r), (int) (30 * r)));\n\t\t\t} else if (component instanceof JPanel) {\n\t\t\t\t((JPanel) component).setFont(theAppMgr.getTheme().getTextFieldFont());\n\t\t\t\t((JPanel) component).setBackground(theAppMgr.getBackgroundColor());\n\t\t\t}\n\t\t}\n\t}",
"void setDevkey(String devkey);",
"void setUserData(Object userData);",
"private void createApplicationProperties()\n {\n _applicationPropertiesMap = new HashMap<String,Object>();\n _message.setApplicationProperties(new ApplicationProperties(_applicationPropertiesMap));\n }",
"public void init(Map<String, String> pParams, Application pApp) throws Exception;",
"AdminApplication getApplication();",
"public void init()\n {\n _appContext = SubAppContext.createOMM(System.out);\n _serviceName = CommandLine.variable(\"serviceName\");\n initGUI();\n }",
"protected void onAfterCreateApplication() {\n\n\t}",
"void setTechStuff(com.hps.july.persistence.Worker aTechStuff) throws java.rmi.RemoteException;",
"public interface BugRegisterInfor {\n String APP_ID = \"6b82b51788\";\n String APP_KEY = \"09872b4e-8da9-442c-b1ac-4e904829e2d8\";\n}",
"public void setApplication(CoveApplication ca) {\n\t\tthis.ca = ca;\n\t}",
"public void setUsername(String username) {this.username = username;}",
"public OSPApplication getOSPApp();",
"private UserPrefernce(){\r\n\t\t\r\n\t}",
"private final class <init>\n implements <init>, com.ebay.nautilus.domain.dcs.tionHelper\n{\n\n private SharedPreferences listingDraftPrefs;\n private SharedPreferences prefs;\n final MyApp this$0;\n\n public void disableDeveloperOptions()\n {\n MyApp.getPrefs().removeGlobalPref(\"developerOptions\");\n }",
"@Override\r\n public void onUserSet(GenericDevice dev, PDeviceHolder devh, PUserHolder us) {\n\r\n }",
"public interface HRServiceAppModule extends ApplicationModule {\r\n void updateDepartmentName(Integer departmentId, String departmentName);\r\n}",
"public String getApplication() {\r\n\t\treturn application;\r\n\t}",
"public interface AppPresenter {\n void startApp(int type);\n}",
"public boolean registerApplication(Application application);",
"public static void setUserDetails(UserSetup userSetup) {\n\n }",
"public com.google.protobuf.Empty registerApplication(org.thethingsnetwork.management.proto.HandlerOuterClass.ApplicationIdentifier request);",
"UserInfo setName(String name);",
"public void setUserData(Object data);",
"@Test\n\tpublic void testApplicationValues2() throws Throwable {\n\t\tApplication testedObject = new Application();\n\t\ttestedObject.setAppJson((ApplicationInfo) null);\n\t\ttestedObject.setApplicationName(\"applicationName0\");\n\n\t\tassertEquals(null, testedObject.getAppJson());\n\t\tassertEquals(\"applicationName0\", testedObject.getApplicationName());\n\t}",
"public String getApplicationdata() {\r\n return applicationdata;\r\n }",
"public void myapp() {\n\n\n }",
"private static final class <init> extends com.ebay.nautilus.kernel.content.\n{\n\n public EbayAppInfo create(EbayContext ebaycontext)\n {\n return new EbayAppInfoImpl(\"com.ebay.mobile\", \"4.1.5.22\", false);\n }",
"@Override\r\n\t\tpublic void onClick(ClickEvent event) {\n\t\t\tString appName = txtAppName.getText();\r\n\t\t\tString appTittle = txtAppTitle.getText();\r\n\t\t\tif ((appName != null) && (appTittle != null)\r\n\t\t\t\t\t&& (!appName.equals(\"\")) && (!appTittle.equals(\"\"))) {\r\n\r\n\t\t\t\t// Set up the callback object.\r\n\t\t\t\tAsyncCallback<Long> callback = new AsyncCallback<Long>() {\r\n\t\t\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t\t\t// TODO: Do something with errors.\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tpublic void onSuccess(Long result) {\r\n\t\t\t\t\t}\r\n\t\t\t\t};\r\n\t\t\t\tif (appObj == null){\r\n\t\t\t\t\tappObj = new Application(userId_);\r\n\t\t\t\t\tappObj.setAppName(appName);\r\n\t\t\t\t\tappObj.setAppTittle(appTittle);\r\n\t\t\t\t\tappScoreSvc.InsertApp(appObj, callback);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tappObj.setAppName(appName);\r\n\t\t\t\t\tappObj.setAppTittle(appTittle);\r\n\t\t\t\t\tappScoreSvc.UpdateApp(appObj, callback);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//GlobalServices.ComebackHome(true);\r\n\t\t\t\tHistory.newItem(\"root-application\");\r\n\t\t\t} else {\r\n\t\t\t\tWindow.alert(\"Please input fully application information.\");\r\n\t\t\t}\r\n\t\t}",
"public void setUsername(String username)\r\n/* 16: */ {\r\n/* 17:34 */ this.username = username;\r\n/* 18: */ }",
"public interface IProgramTransfer extends Screen{\nvoid setProgram(WasherProgram program);\n WasherProgram getProgram();\n}",
"public void setUserProfile(UserProfile userProfile) {this.userProfile = userProfile;}",
"public void setAppNames(String appName) {\n this.appName = appName.toLowerCase();\n this.appExe = ListApps.getNameExe(appName);\n this.appConfig = ListApps.getNameConfig(appName);\n this.appDirectoryConfig = ListApps.getDirectoryConfig(appName);\n }"
] | [
"0.67203295",
"0.6587153",
"0.6494668",
"0.6401451",
"0.6372142",
"0.6339747",
"0.6318633",
"0.63023776",
"0.6272789",
"0.6236764",
"0.61589545",
"0.61283636",
"0.6103455",
"0.6094637",
"0.60748035",
"0.603327",
"0.6026267",
"0.59371614",
"0.58948565",
"0.58746666",
"0.5862687",
"0.5793746",
"0.57924825",
"0.5743757",
"0.56918305",
"0.56529313",
"0.5633666",
"0.56329507",
"0.5623824",
"0.5620573",
"0.56181264",
"0.556039",
"0.5557365",
"0.55274564",
"0.5519143",
"0.5485822",
"0.54600364",
"0.5454088",
"0.54484224",
"0.5448258",
"0.5447351",
"0.5441102",
"0.5437271",
"0.54246473",
"0.5406657",
"0.5403178",
"0.54011506",
"0.53932285",
"0.5385636",
"0.5383669",
"0.5378911",
"0.53777516",
"0.53722477",
"0.5362541",
"0.53410214",
"0.5337091",
"0.5324382",
"0.5321026",
"0.53205305",
"0.53188217",
"0.5318323",
"0.53110445",
"0.5299912",
"0.5284371",
"0.52833754",
"0.52804744",
"0.5276301",
"0.52705246",
"0.5258983",
"0.52561706",
"0.5246222",
"0.52339387",
"0.5233833",
"0.52271235",
"0.5222974",
"0.5221418",
"0.5214926",
"0.5210451",
"0.5209302",
"0.5197344",
"0.5195007",
"0.519444",
"0.51892006",
"0.5181963",
"0.5180761",
"0.51800674",
"0.5176243",
"0.51691157",
"0.516806",
"0.5163694",
"0.51627874",
"0.51627004",
"0.5162116",
"0.51608664",
"0.51538306",
"0.5152825",
"0.5150789",
"0.51476806",
"0.51428485",
"0.5134488",
"0.5133733"
] | 0.0 | -1 |
/ ArrayList lstContacto=new ArrayList(); | public ArrayList<Contacto> obtenerDatos(){
BaseDatos db=new BaseDatos(context);
insertarContactos(db);
return db.obtenerTodosContactos();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ContactList()\n {\n myList = new ArrayList<>();\n }",
"public RAMContactoDAO() {\r\n /*contacto.add(c1);\r\n contacto.add(c2);\r\n contacto.add(c3);\r\n contacto.add(c4);*/\r\n }",
"void setList(ArrayList<UserContactInfo> contactDeatailsList);",
"private void CreateStudentList() {\r\n\t\tStudentList=new ArrayList<Student>();\t\r\n}",
"public ArrayList<Contact> loadContacts()\n\t{\n\t\t//TODO gestion des infos\n\t\t\n\t\t/* Requete SQL */\n\t\tCursor cursor = mainDatabase.rawQuery(\"SELECT \" + DBContract.ContactTable.CONTACT_ID[0] + \", \" +\n\t\t\t\tDBContract.ContactTable.NAME[0] + \", \" + DBContract.ContactTable.SURNAME[0] + \", \" + \n\t\t\t\tDBContract.ContactTable.BILL[0] + \" FROM \" + DBContract.ContactTable.TABLE_NAME, null);\n\t\t\n\t\tArrayList<Contact> result = new ArrayList<Contact>();\n\t\t\n\t\t/* Parcour du resultat */\n\t\tif(cursor.moveToFirst())\n\t\t{\n\t\t\t\twhile(!cursor.isAfterLast())\n\t\t\t\t{\n\t\t\t\t\t/* Instancie le nouveau contact : id-nom-prenom */\n\t\t\t\t\tContact tmp = new Contact(cursor.getInt(0), cursor.getString(1), cursor.getString(2));\n\t\t\t\t\ttmp.addToBill(cursor.getDouble(3));\t\n\t\t\t\t\tresult.add((int) (tmp.getId() - 1), tmp); //TODO mod -1 //TODO verifier qu'il n'y a pas d'id 0 et que tout se passe bien !\n\t\t\t\t\tcursor.moveToNext();\n\t\t\t\t}\n\t\t}\n\t\tcursor.close();\n\t\treturn result;\n\t}",
"java.util.List<com.ubtrobot.phone.PhoneCall.Contact>\n getContactListList();",
"java.util.List<com.ubtrobot.phone.PhoneCall.Contact>\n getContactListList();",
"java.util.List<com.ubtrobot.phone.PhoneCall.Contact>\n getContactListList();",
"java.util.List<com.ubtrobot.phone.PhoneCall.Contact>\n getContactListList();",
"public ComandosJuego() //constructor\n\t{\n\t\tlista = new ArrayList<String>();\n\t}",
"public void addContacts() {\r\n\t\t\r\n\t\t\r\n\t}",
"public ArrayList<Cliente> listaDeClientes() {\n\t\t\t ArrayList<Cliente> misClientes = new ArrayList<Cliente>();\n\t\t\t Conexion conex= new Conexion();\n\t\t\t \n\t\t\t try {\n\t\t\t PreparedStatement consulta = conex.getConnection().prepareStatement(\"SELECT * FROM clientes\");\n\t\t\t ResultSet res = consulta.executeQuery();\n\t\t\t while(res.next()){\n\t\t\t \n\t\t\t int cedula_cliente = Integer.parseInt(res.getString(\"cedula_cliente\"));\n\t\t\t String nombre= res.getString(\"nombre_cliente\");\n\t\t\t String direccion = res.getString(\"direccion_cliente\");\n\t\t\t String email = res.getString(\"email_cliente\");\n\t\t\t String telefono = res.getString(\"telefono_cliente\");\n\t\t\t Cliente persona= new Cliente(cedula_cliente, nombre, direccion, email, telefono);\n\t\t\t misClientes.add(persona);\n\t\t\t }\n\t\t\t res.close();\n\t\t\t consulta.close();\n\t\t\t conex.desconectar();\n\t\t\t \n\t\t\t } catch (Exception e) {\n\t\t\t //JOptionPane.showMessageDialog(null, \"no se pudo consultar la Persona\\n\"+e);\n\t\t\t\t System.out.println(\"No se pudo consultar la persona\\n\"+e);\t\n\t\t\t }\n\t\t\t return misClientes; \n\t\t\t }",
"public PersonList() {\r\n this.personList = new ArrayList<Person>();\r\n }",
"public void setCamino(ArrayList<Posicion> camino)\n{\n m_camino = camino;\n}",
"public void ouvrirListe(){\n\t\n}",
"@Override\n\tpublic List<Contact> listContact() {\n\t\ttry {\n\t\t\tSystem.out.println(\n\t\t\t\t\t\"************************* je suis dans Liste des contacts *********************************\");\n\t\t\tsession = HibernateUtil.getSessionFactory().openSession();\n\t\t\ttx = session.beginTransaction();\n\n\t\t\tQuery query = session.createQuery(\"from Contact\");\n\n\t\t\tSystem.out.println(\"\\n\");\n\t\t\tSystem.out.println(\"liste des contacts: \" + String.valueOf(query.list()));\n\n\t\t\tList<Contact> lc = (List<Contact>) query.list();\n\t\t\ttx.commit();\n\t\t\tsession.close();\n\n\t\t\treturn lc;\n\n\t\t} catch (HibernateException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}",
"public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}",
"protected void setContacts(ArrayList<Contact> contacts){\n this.contacts = contacts;\n }",
"public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}",
"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 }",
"public Lista() {\r\n }",
"public ListPolygone() {\n this.list = new ArrayList();\n }",
"public void listar() {\n\t\t\n\t}",
"public ArrayList< UsuarioVO> listaDePersonas() {\r\n\t ArrayList< UsuarioVO> miUsuario = new ArrayList< UsuarioVO>();\r\n\t Conexion conex= new Conexion();\r\n\t \r\n\t try {\r\n\t PreparedStatement consulta = conex.getConnection().prepareStatement(\"SELECT * FROM usuarios\");\r\n\t ResultSet res = consulta.executeQuery();\r\n\t while(res.next()){\r\n\t\t UsuarioVO persona= new UsuarioVO();\r\n\t persona.setCedula_usuario(Integer.parseInt(res.getString(\"cedula_usuario\")));\r\n\t persona.setEmail_usuario(res.getString(\"email_usuario\"));\r\n\t persona.setNombre_usuario(res.getString(\"nombre_usuario\"));\r\n\t persona.setPassword(res.getString(\"password\"));\r\n\t persona.setUsuario(res.getString(\"usuario\"));\r\n\t \r\n\t \r\n\t miUsuario.add(persona);\r\n\t }\r\n\t res.close();\r\n\t consulta.close();\r\n\t conex.desconectar();\r\n\t \r\n\t } catch (Exception e) {\r\n\t JOptionPane.showMessageDialog(null, \"no se pudo consultar la Persona\\n\"+e);\r\n\t }\r\n\t return miUsuario;\r\n\t }",
"public ArrayList<Invitato> getArraylistInvitati(){\n\n\n return AssegnamentiTavolo;\n }",
"public ArrayList<DataCliente> listarClientes();",
"@Override\r\n\tpublic List<Contacto> getContactosInatec() {\r\n\t\treturn null;\r\n\t}",
"public JsfVenda() {\r\n litem = new ArrayList();\r\n }",
"public void loadContactListToView(){\r\n\t\ttry {\r\n\t\t\tclientView.clearContactList();\r\n\t\t\tHashMap <Long, String> contactList = userModel.getContactList().getClReader().getContactList();\r\n\t\t\tIterator iter = contactList.entrySet().iterator();\r\n\t\t\tMap.Entry <Long, String> pair;\r\n\t\t\tint i =0;\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tSystem.out.println(i++);\r\n\t\t\t\tpair = (Map.Entry <Long, String>)iter.next();\r\n\t\t\t\t\tclientView.addNewUserToContactList(pair.getValue()+\" \"+pair.getKey());\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (NumberFormatException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\tclientView.showMsg(\"Contact list can't be loaded\");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t}",
"public void loadContacts()\n {\n Contact sdhb = new Contact(\"SDHB\", \"(03) 474 00999\");\n //Hospitals\n Contact southland = new Contact(\"Southland Hospital\", \"(03) 218 1949\");\n Contact lakes = new Contact(\"Lakes District Hostpital\", \"(03) 441 0015\");\n Contact dunedin = new Contact(\"Dunedin Hospital\", \"(03) 474 0999\");\n Contact wakari = new Contact(\"Wakari Hospital\", \"(03) 476 2191\");\n //Departments\n Contact compD = new Contact(\"Complements & Complaints (Otago)\", \"(03) 470 9534\");\n Contact compS = new Contact(\"Complements & Complaints (Southland)\", \"(03) 214 5738\");\n\n contacts = new Contact[]{sdhb, dunedin, southland, lakes, wakari, compD, compS};\n }",
"public List<Contact> getAllContacts();",
"@Override\n\tpublic ArrayList<ClienteFisico> listar(String complemento)\n\t\t\tthrows SQLException {\n\t\treturn null;\n\t}",
"public void populateList()\r\n {\n Cursor c = sqLiteDatabase.query(Company_constant.TABLE_NAME, null, null, null, null, null, null);\r\n if (c != null && c.moveToFirst()) {\r\n do {\r\n\r\n int id = c.getInt(c.getColumnIndex(Company_constant.COL_ID));\r\n String name = c.getString(c.getColumnIndex(Company_constant.COL_NAME));\r\n int sal = c.getInt(c.getColumnIndex(Company_constant.COL_SALARY));\r\n // sb.append(id + \"\" + name + \"\" + sal + \"\");\r\n cp=new Company(name,id,sal);\r\n companylist.add(cp);\r\n\r\n\r\n }\r\n\r\n while (c.moveToNext());\r\n }\r\n // Toast.makeText(this, \"\" + sb.toString(), Toast.LENGTH_LONG).show();\r\n ArrayAdapter<Company>ad=new ArrayAdapter<Company>(this,android.R.layout.simple_list_item_1,companylist);\r\n listData.setAdapter(ad);\r\n c.close();\r\n }",
"static public void addPersona(Persona c) { //metodo para añadir a lista y actualizar la lista en tiempo real\r\n listaPersona.add(c);\r\n listaG.setListaGrafica();\r\n \r\n \r\n \r\n }",
"public AddressBook() {\r\n contacts = new ArrayList<AddressEntry>();\r\n }",
"public Artefato() {\r\n\t\tthis.membros = new ArrayList<Membro>();\r\n\t\tthis.servicos = new ArrayList<IServico>();\r\n\t}",
"com.ubtrobot.phone.PhoneCall.Contact getContactList(int index);",
"com.ubtrobot.phone.PhoneCall.Contact getContactList(int index);",
"com.ubtrobot.phone.PhoneCall.Contact getContactList(int index);",
"com.ubtrobot.phone.PhoneCall.Contact getContactList(int index);",
"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 addContacts(List<Contact> contactList){\n for(Contact contact:contactList){\n addContact(contact);\n }\n }",
"static void q2(){\n\t\tArrayList<Integer>myList=new ArrayList<>();\n\t\t\n\t}",
"private void addContact(Contact contact) {\n contactList.add(contact);\n System.out.println(\"contact added whose name is : \" + contact.getFirstName() + \" \" + contact.getLastName());\n\n }",
"public void onCreate(Activity activity, ListView listView, String contactType)\n {\n\n mContactDB = new ContactListDataHelper(activity);\n\n Log.i(\"dhtest\",\"contact1\");\n mContactDB.showList();\n\n //Type Image 변경\n if (contactType.equals(\"edit\")){\n mAdapter = new SimpleAdapter(activity, mContactDB.personList, R.layout.contact_list_edit_item,\n new String[]{\"name\", \"phone\"},\n new int[]{R.id.list_edit_item_name, R.id.list_edit_item_phone});\n }\n\n else{\n mAdapter = new SimpleAdapter(activity, mContactDB.personList, R.layout.contact_list_item,\n new String[]{\"name\", \"phone\"},\n new int[]{R.id.list_item_name, R.id.list_item_phone});\n }\n\n\n listView.setAdapter(mAdapter);\n }",
"public void updateListView() {\n listView = findViewById(R.id.list_view);\n contactList = new ArrayList<>();\n Cursor cursor = db.getAllContacts();\n\n if (cursor.getCount() == 0) {\n contactListAdaptor.clear();\n contactListAdaptor.notifyDataSetChanged();\n Toast.makeText(this, \"No contacts added!\", Toast.LENGTH_SHORT).show();\n } else {\n while (cursor.moveToNext()) {\n Pair<String, String> contact = new Pair<>(cursor.getString(1), cursor.getString(2));\n contactList.add(contact);\n }\n contactListAdaptor = new ContactListAdaptor(this, contactList, this);\n listView.setAdapter(contactListAdaptor);\n }\n }",
"public ListaEtiquetas() {\n this.listaEtiquetas = new ArrayList<>();\n }",
"public ClientInformation(){\n clientList = new ArrayList<>();\n\n }",
"public Lista(){\n inicio=null;\n fin=null;\n }",
"void setLsPersonne(ArrayList<Personne> l) {\n this.lsPersonne = l;\n }",
"public QuanLyChuyenDeImplement() {\n// _lstChuyenDe = new ArrayList<>();\n// _lstChuyenDe = _daoChuyenDe.selectAll();\n }",
"public ListSemental() {\n }",
"public void obtenerLista(){\n listaInformacion = new ArrayList<>();\n for (int i = 0; i < listaPersonales.size(); i++){\n listaInformacion.add(listaPersonales.get(i).getId() + \" - \" + listaPersonales.get(i).getNombre());\n }\n }",
"ArrayListOfStrings () {\n list = new ArrayList<String>();\n }",
"public void insert(ArrayList<T> contactArrayList) throws DaoException;",
"public static void main(String[] args) {\n ContactData contactDatas = new ContactData(\"Mohon\", \"456775439\");\r\n //System.out.println(contactDatas);\r\n\r\n ContactData contactDatas1 = new ContactData(\"shihab\", \"456775439\", \"shihab@gamil.com\");\r\n\r\n ContactList list = new ContactList();\r\n list.createContact(contactDatas);\r\n list.createContact(contactDatas1);\r\n System.out.println(list);\r\n\r\n ContactData search = list.searchContact(\"mohon\");\r\n if (search != null){\r\n System.out.println(search);\r\n } else {\r\n System.out.println(\"Contact not found\");\r\n }\r\n\r\n System.out.println(list.getTotalContact());\r\n }",
"public ArrayList<Mascota> obtenerDatos(){\n\n BaseDatos db = new BaseDatos(context);\n\n ArrayList<Mascota> aux = db.obtenerTodoslosContactos();\n\n if(aux.size()==0){\n insertarMascotas(db);\n aux = db.obtenerTodoslosContactos();\n }\n\n return aux;\n }",
"public ArrayList llenar_lv(){\n ArrayList<String> lista = new ArrayList<>();\n SQLiteDatabase database = this.getWritableDatabase();\n String q = \"SELECT * FROM \" + TABLE_NAME;\n Cursor registros = database.rawQuery(q,null);\n if(registros.moveToFirst()){\n do{\n lista.add(\"\\t**********\\nNombre: \" + registros.getString(0) +\n \"\\nDirección: \"+ registros.getString(1) + \"\\n\" +\n \"Servicio(s): \"+ registros.getString(2) +\n \"\\nEdad: \"+ registros.getString(3) + \" años\\n\" +\n \"Telefono: \"+ registros.getString(4) +\n \"\\nIdioma(s): \"+ registros.getString(5) + \"\\n\");\n }while(registros.moveToNext());\n }\n return lista;\n\n }",
"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 ArrayList<User> getArrayList(){\n return userlist;\n }",
"public ArrayList<String> getContacts()\r\n\t{\r\n\t\treturn contacts;\r\n\t}",
"public static void main(String[] args) {\n ArrayList<Contact> contactBook = new ArrayList();\n\n Contact contact1 = new Contact(\"Gabe Newell\", \"hl3@valve.com\");\n Contact contact2 = new Contact(\"Todd Howard\", \"itjustworks@bethesda.com\");\n\n contactBook.add(contact1);\n contactBook.add(contact2);\n \n for (Contact contacts : contactBook) {\n System.out.println(contacts.toString());\n }\n\n }",
"public List<IContact> getContacts();",
"public OwnerList()\n {\n ownerList = new ArrayList<>();\n }",
"public static ObservableList<Contacts> getAllContacts() {\n try {\n Connection conn = DBConnection.getConnection();\n DBQuery.setStatement(conn);\n Statement statement = DBQuery.getStatement();\n String query = \"SELECT * FROM contacts\";\n ResultSet rs = statement.executeQuery(query);\n while(rs.next()) {\n\n Contacts newContact = new Contacts();\n newContact.setContact_ID(rs.getInt(\"Contact_ID\"));\n newContact.setContact_Name(rs.getString(\"Contact_Name\"));\n newContact.setEmail(rs.getString(\"Email\"));\n Contacts.addContacts(newContact); \n\n }\n statement.close();\n return contact;\n } catch (SQLException e) {\n System.out.println(\"SQLException: \" + e.getMessage());\n return null;\n }\n}",
"testarray() {\r\n \tarrayList = new Arraylist();\t\r\n\t}",
"public static synchronized void loadFriendsList() {\r\n\t\t\t\r\n\t\t\t// TODO Controllare che esista il file CONTACTS.xml\r\n\t\t\t// TODO Se esiste, caricare i contatti dal file altrimenti richiedere al sip\r\n\t\t\tArrayList<Contact> contactList = ContactListManager.getContactList(); \r\n\t\t\t\r\n\t\t\tFriendsList fl = new FriendsList(); \r\n\t\t\t\r\n\t\t\tfor(Contact contact : contactList) {\r\n\t\t\t\tfl.addFriend(contact.getFriend()); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetFriendsList(fl); \r\n\t\t}",
"public void AddContact(View view){\n Utils.Route_Start(ListContact.this,Contato.class);\n // Notificar, para atualizar a lista.\n\n }",
"public void AddReliquias(){\n DLList reliquias = new DLList();\n reliquias.insertarInicio(NombreReliquia); \n }",
"public MyArrayList ()\r\n {\r\n \tlist = new Object[100];\r\n \tnumElements = 0;\r\n }",
"Object getTolist();",
"public ArrayList makeStudentList() {\r\n ArrayList<String> studenter = new ArrayList();\r\n Student student = new Student();\r\n \r\n \r\n \r\n return studenter;\r\n}",
"public void create() {\n String[] arrays = new String[100];\n ArrayList<String> list1 = new ArrayList(); //Object[10]\n list1.size(); //0\n list1.add(\"Vivek\"); //object[0] = \"Vivek\"\n list1.size(); //1\n list1.get(0);//\"Vivek\"\n\n list1.remove(1);\n\n list1.add(0, \"Vivek\");\n\n\n ArrayList<String> list3 = new ArrayList<String>(list1);\n\n ArrayList<Student> list = new ArrayList<Student>();\n\n\n\n }",
"public Adaptador (ArrayList<Mascota> contactos, Activity activity, Fragment fragment){\n this.contactos = contactos;\n this.activity = activity;\n this.fragment = fragment;\n\n }",
"public IHM() {\n initComponents();\n da = new ArrayList<String>();\n ba = new ArrayList<String>();\n //a.lerArraylist();\n }",
"Object getCclist();",
"public void clear(){\n\n \tlist = new ArrayList();\n\n }",
"public List<Contact> getAllContacts() {\n List<Contact> contactList = new ArrayList<Contact>();\n // Select All Query\n String selectQuery = \"SELECT * FROM \" + TABLE_CONTACTS;\n\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (cursor.moveToFirst()) {\n do {\n Contact contact = new Contact();\n contact.set_id((cursor.getInt(0)));\n contact.set_name(cursor.getString(1));\n contact.set_audios(cursor.getString(2));\n contact.set_captured_image(cursor.getString(3));\n contact.set_contents(cursor.getString(4));\n contact.set_delelte_var(cursor.getInt(5));\n contact.set_gallery_image(cursor.getString(6));\n contact.set_recycle_delete(cursor.getInt(7));\n contact.set_photo(cursor.getString(8));\n // Adding contact to list\n contactList.add(contact);\n } while (cursor.moveToNext());\n }\n\n // return contact list\n return contactList;\n }",
"public ArrayList<Libro> recuperaTodos();",
"private ArrayList<Contact> getContactList(Context context) {\n String[] selectCol = new String[] { ContactsContract.Contacts.DISPLAY_NAME,\n ContactsContract.Contacts.HAS_PHONE_NUMBER, ContactsContract.Contacts._ID };\n\n final int COL_NAME = 0;\n final int COL_HAS_PHONE = 1;\n final int COL_ID = 2;\n\n // the selected cols for phones of a user\n String[] selPhoneCols = new String[] { ContactsContract.CommonDataKinds.Phone.NUMBER,\n ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME, ContactsContract.CommonDataKinds.Phone.TYPE };\n\n final int COL_PHONE_NUMBER = 0;\n final int COL_PHONE_NAME = 1;\n final int COL_PHONE_TYPE = 2;\n\n String select = \"((\" + Contacts.DISPLAY_NAME + \" NOTNULL) AND (\" + Contacts.HAS_PHONE_NUMBER + \"=1) AND (\"\n + Contacts.DISPLAY_NAME + \" != '' ))\";\n\n ArrayList<Contact> list = new ArrayList<Contact>();\n Cursor cursor = context.getContentResolver().query(ContactsContract.Contacts.CONTENT_URI, selectCol, select,\n null, ContactsContract.Contacts.DISPLAY_NAME + \" COLLATE LOCALIZED ASC\");\n if (cursor == null) {\n return list;\n }\n if (cursor.getCount() == 0) {\n return list;\n }\n\n cursor.moveToFirst();\n while (!cursor.isAfterLast()) {\n int contactId;\n contactId = cursor.getInt(cursor.getColumnIndex(ContactsContract.Contacts._ID));\n if (cursor.getInt(COL_HAS_PHONE) > 0) {\n // the contact has numbers\n // 获得联系人的电话号码列表\n String displayName;\n displayName = cursor.getString(COL_NAME);\n Cursor phoneCursor = context.getContentResolver().query(\n ContactsContract.CommonDataKinds.Phone.CONTENT_URI, selPhoneCols,\n ContactsContract.CommonDataKinds.Phone.CONTACT_ID + \"=\" + contactId, null, null);\n if (phoneCursor.moveToFirst()) {\n do {\n // 遍历所有的联系人下面所有的电话号码\n String phoneNumber = phoneCursor.getString(COL_PHONE_NUMBER);\n Contact contact = new Contact(0, displayName);\n contact.phoneNumber = phoneNumber;\n list.add(contact);\n } while (phoneCursor.moveToNext());\n \n phoneCursor.close();\n }\n }\n cursor.moveToNext();\n }\n \n cursor.close();\n\n return list;\n }",
"public List<Person> readContactlist()\n {\n List<Person> personList=new ArrayList<Person>();\n\n ContentResolver resolver = getContentResolver();\n Cursor cursor = resolver.query(ContactsContract.Contacts.CONTENT_URI, null, null, null, null);\n\n while (cursor.moveToNext()) {\n String id = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts._ID));\n String name = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.DISPLAY_NAME));\n\n\n Cursor phoneCursor = resolver.query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,\n ContactsContract.CommonDataKinds.Phone.CONTACT_ID + \"= ?\", new String[]{id}, null);\n\n\n while (phoneCursor.moveToNext()) {\n String phoneNumber = phoneCursor.getString(phoneCursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));\n\n personList.add(new Person(name, phoneNumber));\n }\n }\n return personList;\n }",
"public list() {\r\n }",
"List<Persona> obtenerTodasLasPersona();",
"public ContactList(int size) {\n\t\tcontactList = new Person[size];\n\t\tcontactCounter = 0;\n\t}",
"List<Vehiculo>listar();",
"public College()\r\n {\r\n students = new ArrayList<Student>();\r\n }",
"public ArrayList<Articulo> dameArticulo(){\n\t\t\n\t\t\n\t\treturn null;\n\t}",
"public ArrayList<UsuarioVO> consultarPersona(int documento) {\r\n\t ArrayList< UsuarioVO> miUsuario = new ArrayList< UsuarioVO>();\r\n\t Conexion conex= new Conexion();\r\n\t \r\n\t try {\r\n\t PreparedStatement consulta = conex.getConnection().prepareStatement(\"SELECT * FROM usuarios where cedula_usuario = ? \");\r\n\t consulta.setInt(1, documento);\r\n\t ResultSet res = consulta.executeQuery();\r\n\t \r\n\t if(res.next()){\r\n\t\tUsuarioVO persona= new UsuarioVO();\r\n\t persona.setCedula_usuario(Integer.parseInt(res.getString(\"cedula_usuario\")));\r\n\t persona.setEmail_usuario(res.getString(\"email_usuario\"));\r\n\t persona.setNombre_usuario(res.getString(\"nombre_usuario\"));\r\n\t persona.setPassword(res.getString(\"password\"));\r\n\t persona.setUsuario(res.getString(\"usuario\"));\r\n\t \r\n\t miUsuario.add(persona);\r\n\t }\r\n\t res.close();\r\n\t consulta.close();\r\n\t conex.desconectar();\r\n\t \r\n\t } catch (Exception e) {\r\n\t JOptionPane.showMessageDialog(null, \"Error en la Consulta del Usuario\\n\"+e);\r\n\t }\r\n\t return miUsuario;\r\n\t }",
"myArrayList() {\n\t\thead = null;\n\t\ttail = null;\n\t}",
"public ArrayList<Cliente> listarClientes(){\n ArrayList<Cliente> ls = new ArrayList<Cliente>();\n try{\n\t\tString seleccion = \"SELECT codigo, nit, email, pais, fecharegistro, razonsocial, idioma, categoria FROM clientes\";\n\t\tPreparedStatement ps = con.prepareStatement(seleccion);\n //para marca un punto de referencia en la transacción para hacer un ROLLBACK parcial.\n\t\tResultSet rs = ps.executeQuery();\n\t\tcon.commit();\n\t\twhile(rs.next()){\n Cliente cl = new Cliente();\n cl.setCodigo(rs.getInt(\"codigo\"));\n cl.setNit(rs.getString(\"nit\"));\n cl.setRazonSocial(rs.getString(\"razonsocial\"));\n cl.setCategoria(rs.getString(\"categoria\"));\n cl.setEmail(rs.getString(\"email\"));\n Calendar cal = new GregorianCalendar();\n cal.setTime(rs.getDate(\"fecharegistro\")); \n cl.setFechaRegistro(cal.getTime());\n cl.setIdioma(rs.getString(\"idioma\"));\n cl.setPais(rs.getString(\"pais\"));\n\t\t\tls.add(cl);\n\t\t}\n }catch(Exception e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n } \n return ls;\n\t}",
"public Collection<Contact> getContacts();",
"public ArrayList()\n {\n list = new int[SIZE];\n length = 0;\n }",
"ContactsManager(){\n friendsCount = 0;\n myFriends = new Contact[500];\n }",
"public PersonalityList()\n {\n pList= new ArrayList<Personality>();\n }",
"public ArrayList() {\n\t\tthis.elements = new Object[5];\n\t\tthis.last = -1;\n\t}",
"private void getContactList() {\r\n\r\n\t\tgroupData.clear();\r\n\t\tchildData.clear();\r\n\t\tDataHelper dataHelper = new DataHelper(ContactsActivity.this);\r\n\t\tdataHelper.openDatabase();\r\n\t\tgroupData = dataHelper.queryZoneAndCorpInfo(childData);\r\n\t\tdataHelper.closeDatabase();\r\n\t\thandler.sendEmptyMessage(1);\r\n\r\n\t\tif (groupData == null || groupData.size() == 0) {\r\n\t\t\tDataTask task = new DataTask(ContactsActivity.this);\r\n\t\t\ttask.execute(Constants.KServerurl + \"GetAllOrgList\", \"\");\r\n\t\t}\r\n\t}",
"public void insertPhone(ArrayList<DetailModel> detailModelArrayList){\n\n\n\n\n }",
"public ArrayList<Comobox> listaDocumentos()\n {\n @SuppressWarnings(\"MismatchedQueryAndUpdateOfCollection\")\n ArrayList<Comobox> al= new ArrayList<>();\n ResultSet rs = null;\n\n sql=\"select * FROM VER_TIPODOCUMENTO\";\n Conexao conexao = new Conexao();\n if(conexao.getCon()!=null)\n {\n try \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(\"REALID\"), rs.getString(\"DOCUMENTO\")));\n } \n }\n rs.close();\n } \n catch (SQLException ex)\n {\n Logger.getLogger(CreditoDao.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Erro a obter documentos \"+ex.getMessage());\n }\n }\n return al;\n }",
"public ArrayList getList() {\n \t\treturn list;\n \t}",
"public static ArrayList<obj_dos_campos> carga_tipo_producto() {\n ArrayList<obj_dos_campos> lista = new ArrayList<obj_dos_campos>();\n Connection c=null;\n try {\n c = conexion_odbc.Connexion_datos();\n Statement s = c.createStatement();\n ResultSet rs = s.executeQuery(\"select tip_prod_idn as data, tip_prod_nombre as label from tipo_producto order by tip_prod_nombre desc\");\n lista.add(new obj_dos_campos(\"0\",\"-- Seleccione --\"));\n while (rs.next()){\n lista.add(new obj_dos_campos(rs.getString(\"data\"),rs.getString(\"label\")));\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n c.close();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n return lista;\n }"
] | [
"0.78589404",
"0.6952142",
"0.6876022",
"0.6513089",
"0.6461974",
"0.6439434",
"0.6439434",
"0.6439434",
"0.6439434",
"0.6410988",
"0.63594747",
"0.63365227",
"0.63169134",
"0.62594384",
"0.6232992",
"0.6226185",
"0.62199557",
"0.6214661",
"0.6209547",
"0.61657727",
"0.6164124",
"0.6150761",
"0.6141744",
"0.6141565",
"0.61356294",
"0.6126491",
"0.6112296",
"0.60986376",
"0.6075134",
"0.6052694",
"0.60412323",
"0.60395014",
"0.6022975",
"0.5996041",
"0.59948653",
"0.599292",
"0.59922475",
"0.59922475",
"0.59922475",
"0.59922475",
"0.5988349",
"0.5986591",
"0.59822655",
"0.59561366",
"0.59557104",
"0.59539765",
"0.59378856",
"0.59369403",
"0.593645",
"0.59352887",
"0.593322",
"0.59269226",
"0.59220153",
"0.5915606",
"0.5909689",
"0.590757",
"0.58869463",
"0.5884258",
"0.587643",
"0.5876081",
"0.58541125",
"0.58507824",
"0.58480364",
"0.58470374",
"0.5840935",
"0.5837894",
"0.58370876",
"0.58328086",
"0.58273494",
"0.5824283",
"0.5822038",
"0.5814",
"0.57966816",
"0.5795618",
"0.5794034",
"0.57924795",
"0.5790462",
"0.57903457",
"0.5780515",
"0.5776619",
"0.57753986",
"0.57709885",
"0.5764927",
"0.5760598",
"0.57598853",
"0.5758102",
"0.57554555",
"0.5754075",
"0.57527256",
"0.5748587",
"0.574748",
"0.57449144",
"0.5744606",
"0.57406145",
"0.5736035",
"0.57312316",
"0.5722226",
"0.5720638",
"0.57205135",
"0.57197225"
] | 0.62112045 | 18 |
The match this player is assigned or playing. | public abstract Match match(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Match getMatch() {\n return match;\n }",
"@Override\r\n\tpublic String getMatch() {\n\t\treturn match;\r\n\t}",
"public Player getCurrentPlayer(Match match) {\r\n LOGGER.debug(\"--> getCurrentPlayer: match=\" + match);\r\n Player currentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 1) {\r\n currentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 2) {\r\n currentPlayer = match.getPlayer2();\r\n } else if (match.getCurrentPlayer() == 0) {\r\n currentPlayer = match.getPlayer1();\r\n } else {\r\n throw new GeneralException(\"match has no defined currentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getCurrentPlayer\");\r\n return currentPlayer;\r\n }",
"public int getMatchID(){\r\n\t\treturn matchID;\r\n\t}",
"protected Player getOpponentPlayer(Match match) {\r\n LOGGER.debug(\"--> getOpponentPlayer: match=\" + match);\r\n Player opponentPlayer;\r\n\r\n if (match.getCurrentPlayer() == 2) {\r\n opponentPlayer = match.getPlayer1();\r\n } else if (match.getCurrentPlayer() == 1) {\r\n opponentPlayer = match.getPlayer2();\r\n } else {\r\n throw new GeneralException(\"match has no defined opponentPlayer!\");\r\n }\r\n\r\n LOGGER.debug(\"<-- getOpponentPlayer\");\r\n return opponentPlayer;\r\n }",
"public String getMatchName() {\r\n\t\treturn mMatchName;\r\n\t}",
"public boolean getMatch() {\n\t\treturn false;\n\t}",
"Match getCompleteMatch();",
"public String getPlayer() {\r\n return player;\r\n }",
"public String getMatchType() {\n return getStringProperty(\"MatchType\");\n }",
"public String getMatched() {\r\n\t\treturn matched;\r\n\t}",
"float getMatch();",
"public Player isMatchWon(final String matchId) throws MatchNotFoundException {\r\n LOGGER.debug(\"--> isMatchWon: matchId=\" + matchId);\r\n Match match = getMatchById(matchId);\r\n Player player1 = match.getPlayer1();\r\n Player player2 = match.getPlayer2();\r\n int sunkBoatsP1 = countOfStatus(player1, FIELD_SUNK);\r\n int sunkBoatsP2 = countOfStatus(player2, FIELD_SUNK);\r\n if(sunkBoatsP1 == 30){\r\n return player2;\r\n }else if(sunkBoatsP2 == 30){\r\n return player1;\r\n } else {\r\n return null;\r\n }\r\n}",
"@Override\n public Player getWinningPlayer() {\n return wonGame ? currentPlayer : null;\n }",
"private void startMatch() {\n game = new Match(players.get(0), players.get(1), \"Nueva Partida\");\n showMatch();\n state = 1;\n }",
"public String getPlayer() {\n return p;\n }",
"public Match getMatch(int matchNum){\n\t\tfor(Match match : matches){\n\t\t\tif(match.number == matchNum){\n\t\t\t\treturn match;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public int getPlayer() {\r\n\t\treturn player;\r\n\t}",
"@Override\n public double getMatchTime() {\n return MATCH_DURATION_IN_SECONDS;\n }",
"public Match getMatchById(String matchId) throws MatchNotFoundException {\r\n LOGGER.debug(\"--> getMatchById\");\r\n Match match = null;\r\n Optional<Match> optionalMatch = matchRepository.findById(matchId);\r\n if(optionalMatch.isPresent()){\r\n match = optionalMatch.get();\r\n \r\n \r\n }else{\r\n throw new MatchNotFoundException(\"Match nicht gefunden\");\r\n }\r\n \r\n if(match.getPlayer1()!=null&& match.getPlayer2()!=null){\r\n match.setCurrentPlayer(2);\r\n }else if((match.getPlayer1()==null||match.getPlayer2()==null)&&(match.getPlayer1()!=null ||match.getPlayer2()==null)){\r\n match.setCurrentPlayer(1);\r\n }\r\n \r\n \r\n return match;\r\n }",
"public int getPlayer() {\r\n\t\treturn myPlayer;\r\n\t}",
"public String getCurrentPlayer() {\r\n return this.playerIds[this.currentPlayer];\r\n }",
"Player getSelectedPlayer();",
"private void showMatch() {\n System.out.println(\"Player 1\");\n game.getOne().getField().showField();\n System.out.println(\"Player 2\");\n game.getTwo().getField().showField();\n }",
"public int getCurrentPlayer() {\n return player;\n }",
"public void setMatch(OFMatch mt) {\n\t\tthis.match = mt;\r\n\t}",
"public int getCurrentPlayer() {\n\t\treturn player;\n\t}",
"public String getCurrentPlayer() {\n return currentPlayer;\n }",
"Match getTeam1LooserOfMatch();",
"@Override\n\tpublic boolean getIsSingleMatch() {\n\t\treturn _esfTournament.getIsSingleMatch();\n\t}",
"public int getActivePlayer() {\n return activePlayer;\n }",
"public Player currentPlayer() {\n\t\treturn (currentPlayer);\n\t}",
"public int getIdentityFromSummonerID(Match match)\n {\n int playerNum=-1;\n\n for(int i = 0; i<10; i++)\n {\n if(match.getParticipants().get(i).getSummonerID() == playerID)\n playerNum = match.getParticipants().get(i).getParticipantID();\n\n }\n\n return playerNum;\n }",
"Match getTeam2LooserOfMatch();",
"public String getCurrentPlayer() {\n\t\treturn _currentPlayer;\n\t}",
"void playMatch() {\n while (!gameInformation.checkIfSomeoneWonGame() && gameInformation.roundsPlayed() < 3) {\n gameInformation.setMovesToZeroAfterSmallMatch();\n playSmallMatch();\n }\n String winner = gameInformation.getWinner();\n if(winner.equals(\"DRAW!\")){\n System.out.println(messageProvider.provideMessage(\"draw\"));\n }else {\n System.out.println(messageProvider.provideMessage(\"winner\")+\" \"+winner+\"!\");\n }\n }",
"public Player getLoser() {\n\t\treturn getLeader() == player1 ? player2 : player1;\n\t}",
"public int getPlayer()\n {\n return this.player;\n }",
"public PlayerMatches(String player1) {\n this.player1 = player1;\n }",
"@Override\n\tpublic String getPlayer() {\n\t\treturn null;\n\t}",
"public Player getPlayer() {\n return (roomPlayer);\n }",
"@Override\n\tpublic boolean getIsTeamMatch() {\n\t\treturn _esfTournament.getIsTeamMatch();\n\t}",
"public PlayerID getPlayer(){\n\t\treturn this.player;\n\t}",
"@Override\n public int getWinner()\n {\n return currentPlayer;\n }",
"void finishMatch() {\n\t\tint playerResult = ParticipantResult.MATCH_RESULT_NONE;\n\t\tint opponentResult = ParticipantResult.MATCH_RESULT_NONE;\n\n\t\tif (!GameActivity.gameMachine.player.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, false);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t} else if (!GameActivity.gameMachine.opponent.isAlive()) {\n\t\t\tLayoutHelper.showResult(resultTextView, true);\n\t\t\tplayerResult = ParticipantResult.MATCH_RESULT_WIN;\n\t\t\topponentResult = ParticipantResult.MATCH_RESULT_LOSS;\n\t\t}\n\n\t\tArrayList<ParticipantResult> results = new ArrayList<ParticipantResult>();\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getMyId(\n\t\t\t\tgameHelper.getApiClient(), match), playerResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tresults.add(new ParticipantResult(GPGHelper.getOpponentId(\n\t\t\t\tgameHelper.getApiClient(), match), opponentResult,\n\t\t\t\tParticipantResult.PLACING_UNINITIALIZED));\n\n\t\tif (match.getStatus() == TurnBasedMatch.MATCH_STATUS_ACTIVE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId(),\n\t\t\t\t\t\twriteGameState(match), results);\n\t\t\t\tturnUsed = true;\n\t\t\t\tremoveNotification();\n\t\t\t}\n\t\t} else if (match.getStatus() == TurnBasedMatch.MATCH_STATUS_COMPLETE) {\n\t\t\tif (match.getTurnStatus() == TurnBasedMatch.MATCH_TURN_STATUS_MY_TURN) {\n\t\t\t\tGames.TurnBasedMultiplayer.finishMatch(\n\t\t\t\t\t\tgameHelper.getApiClient(), match.getMatchId());\n\t\t\t}\n\t\t}\n\t}",
"public Player getCurrentPlayer(){\n return this.currentPlayer;\n }",
"public int activePlayer() {\n return this.activePlayer;\n }",
"public Date getLastMatchTime(){\n return lastMatchTime;\n }",
"public Player getActivePlayer() {\r\n return activePlayer;\r\n }",
"public Player getWinner() {\n return winner;\n }",
"public Player getCurrentPlayer() {\n return currentPlayer;\n }",
"public Player getCurrentPlayer() {\n return currentPlayer;\n }",
"public void setMatch(Match game) {\n this.game = game;\n }",
"public Player getActivePlayer() {\n return activePlayer;\n }",
"public char getCurrentPlayer() {\n\t\treturn currentPlayer;\n\t}",
"public char getPlayer() {\n return player;\n }",
"public Player getPlayer() {\r\n\t\treturn player;\r\n\t}",
"public ServerPlayer whoWon() {\r\n\t\tif (winner(CROSS)) {\r\n\t\t\treturn getP1();\r\n\t\t} else if (winner(NOUGHT)) {\r\n\t\t\treturn getP2();\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}",
"public Player getCurrentPlayer()\n\t{\n\t\treturn current;\n\t}",
"public final Player getPlayer() {\n return player;\n }",
"public ServerPlayer getCurrentPlayer() {\r\n\t\treturn this.currentPlayer;\r\n\t}",
"public Player lookForWinner(){\n\t\tfor(int i = 0; i < this.players.size(); i++){\n\t\t\tif(this.players.get(i).numCards() == 0)\n\t\t\t\treturn this.players.get(i);\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public PlayerMatches(String player1, String player2) {\n this.player1 = player1;\n this.player2 = player2;\n }",
"public Player getWinner(){\r\n if(!hasMovements(model.getPlayerA().getColor()))\r\n return model.getPlayerB();\r\n if(!hasMovements(model.getPlayerB().getColor()))\r\n return model.getPlayerA();\r\n // In case of draw\r\n return null;\r\n }",
"public static Team getWinner() {\n\t\tif (matches != null && matches.length > 0 && matches[0] != null)\n\t\t\treturn matches[0].getWinner();\n\t\treturn null;\n\t}",
"private void switchPlayer(Player opponentPlayer, Match match) {\r\n if(opponentPlayer.getPlayerId().equals(match.getPlayer1().getPlayerId())){\r\n setCurrentPlayer(match, 1);\r\n } else if (opponentPlayer.getPlayerId().equals(match.getPlayer2().getPlayerId())){\r\n setCurrentPlayer(match, 2);\r\n } else {\r\n LOGGER.error(\"Player not found\");\r\n }\r\n }",
"public int getCurrentPlayer(){\n return this.currentPlayer;\n }",
"public UT2004DeathMatchConfig getMatchConfig() {\n\t\treturn matchConfig;\n\t}",
"public String getOtherPlayer() {\n return otherPlayer;\n }",
"public Player getWinner() {\n if (winner == null) {\n winner = winnerStrategy.winner(this);\n }\n return winner;\n }",
"public Player getPlayer() {\n\t\treturn p;\n\t}",
"public Player getPlayer() {\n\t\treturn this.player;\r\n\t}",
"public Player getPlayer() {\r\n return player;\r\n }",
"public Player getWinner() {\n \tif (!isOver())\n \t\treturn null;\n \tif (player1.getScore() > player2.getScore())\n \t\treturn player1;\n \tif (player2.getScore() > player1.getScore())\n \t\treturn player2;\n \treturn null;\n }",
"public MatchResult getResult() {\n return result;\n }",
"String getPlayer();",
"public int getIdentityFromSummonerName(Match match)\n {\n int playerNum=-1;\n\n for(int i = 0; i<10; i++)\n {\n if(match.getParticipants().get(i).getSummonerName().equals(summonerName))\n playerNum=match.getParticipants().get(i).getParticipantID();\n\n }\n\n return playerNum;\n }",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n\t\treturn player;\n\t}",
"public Player getPlayer() {\n return player;\n }",
"public Player getPlayer() {\n\t\t\treturn player;\n\t\t}",
"public static Player getCurrPlayer(){\n\t\treturn players.get(curr);\n\t}",
"public Player getPlayer()\r\n {\r\n return player;\r\n }",
"public Player winner() {\n Player result = null;\n boolean humanResult = board.fiveInARow(humanPlayer.getPiece());\n boolean player2Result = board.fiveInARow(aiPlayer.getPiece());\n if(humanResult && player2Result) {\n result = new Player(\"Tie\", 'T');\n } else if (humanResult && !player2Result) {\n result = humanPlayer;\n } else if (!humanResult && player2Result) {\n result = aiPlayer;\n }\n return result;\n }",
"protected Player getPlayer() {\n return getGame().getPlayers().get(0);\n }",
"public Player getPlayer() {\n\t\treturn this.player;\n\t}",
"public String getMatchOperation() {\n return matchOperation;\n }",
"public Player getPlayer()\r\n\t{\r\n\t\treturn mPlayer;\r\n\t}",
"public double getCurrentBidToMatch() {\n\t\treturn currentBidToMatch;\n\t}",
"Player getCurrentPlayer();",
"Player getCurrentPlayer();",
"public MatchDAO getMatchDAO() {\n return matchDAO;\n }",
"public Player getTeamMate(){\n\t\tif(team == null) return null;\n\t\tCollection<Player> players = team.getPlayers();\n\t\tfor(Player p : players){\n\t\t\tif(!p.equals(this))return p; \n\t\t}\n\t\treturn null;\n\t}",
"public Strider getPlayer() {\n return player;\n }",
"public ViewerManager2 getPlayer() {\n return this.player;\n }"
] | [
"0.7557566",
"0.74678034",
"0.72294027",
"0.7068111",
"0.6903727",
"0.6866533",
"0.67156917",
"0.655365",
"0.6459954",
"0.6445388",
"0.6385175",
"0.63524485",
"0.63514966",
"0.6284899",
"0.62810546",
"0.6278904",
"0.62404436",
"0.62142444",
"0.6184938",
"0.61737436",
"0.61677897",
"0.61607903",
"0.6149033",
"0.6133231",
"0.6128291",
"0.6116804",
"0.61110795",
"0.6103682",
"0.6078145",
"0.6078057",
"0.60753864",
"0.6075218",
"0.60641056",
"0.60626316",
"0.60583496",
"0.60483164",
"0.6046743",
"0.6045575",
"0.6044381",
"0.60375786",
"0.6033254",
"0.6017612",
"0.6015307",
"0.6013384",
"0.600186",
"0.6001851",
"0.5989759",
"0.598869",
"0.5979241",
"0.5975866",
"0.5972588",
"0.5972588",
"0.59593743",
"0.59538543",
"0.59534204",
"0.59521705",
"0.59460497",
"0.5942345",
"0.59313554",
"0.59085554",
"0.5901001",
"0.58979535",
"0.58924156",
"0.58910435",
"0.5885744",
"0.5878323",
"0.58771586",
"0.5876693",
"0.5874497",
"0.5868248",
"0.5867911",
"0.5867706",
"0.58567363",
"0.58567256",
"0.58550495",
"0.5854019",
"0.58510303",
"0.5846091",
"0.5846091",
"0.5846091",
"0.5846091",
"0.5846091",
"0.5846091",
"0.5846091",
"0.5844087",
"0.58384633",
"0.58380485",
"0.5833991",
"0.5829459",
"0.5818908",
"0.581869",
"0.5812409",
"0.58111596",
"0.58109283",
"0.5810405",
"0.5810405",
"0.5804573",
"0.5802721",
"0.57967633",
"0.5789526"
] | 0.59201634 | 59 |
An action made by the player. | public abstract ActionInMatch act(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void onAction(RPObject player, RPAction action) {\n }",
"public void onAction(Player player) {\n }",
"void doAction(Player player);",
"public String action() { \n return \"Player capped.\";\n }",
"@Override\n\tpublic void doAction(String action) {\n\t\tthis.action = action;\n\t\t\n\t\tthis.gameController.pause();\n\t}",
"@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}",
"private void act() {\n\t\tmyAction.embodiment();\n\t}",
"@Override\r\n\tpublic void getPlayerAction() {\r\n\t\tif(!gameOver())\r\n\t\t\tcomputerTurn();\r\n\t}",
"public void action() {\n action.action();\n }",
"public void executeAction( String actionInfo );",
"public abstract void onAction();",
"@Override\n\t\tpublic void onAction(ForgePlayer player, NBTTagCompound data)\n\t\t{\n\t\t}",
"public void act() \n {\n playerMovement();\n }",
"public void doAction(Action action) {\n\t\tif (!isMyTurn) {\n\t\t\treporter.log(Level.SEVERE, \"User did action but it's not his turn\");\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tconnection.send(action);\n\t\t} catch (IOException e) {\n\t\t\treporter.log(Level.SEVERE, \"Can't send action\", e);\n\t\t\treturn;\n\t\t}\n\t\tif (progress instanceof ProgressRounds) {\n\t\t\tprogress = ((ProgressRounds) progress).advance();\n\t\t}\n\t\tsetMyTurn(false);\n\t\t// notifyListeners(action);\n\t}",
"public void performAction();",
"public boolean nextAction(Player player);",
"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 }",
"@Override\n public void playOneRound (Player player) {\n this.executeActions(this.actionChoosed(player), player);\n }",
"private void play(Poker pokerInstance, int action) {\n if (this.playing) {\n if (action == Poker.ACTION_BET) {\n actionBet(pokerInstance, 50);\n } else if (action == Poker.ACTION_FOLLOW) {\n actionFollow(pokerInstance);\n } else if (action == Poker.ACTION_CHECK) {\n actionCheck();\n } else if (action == Poker.ACTION_BED) {\n actionLeave();\n }\n }\n }",
"public void act()\n {\n if (Greenfoot.mouseClicked(this))\n Greenfoot.playSound(\"fanfare.wav\");\n }",
"public SetPlayerTurnAction() {}",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"public void action(){\n turn.sendMsg(turn.getController().getTurnOwner().getName()+\"'s turn!\");\n if(turn.getPlayer().isDown()){\n turn.setPhase(new RecoveryPhase());\n }else {\n turn.setPhase(new StarsPhase());\n }\n }",
"public abstract CardAction play(Player p);",
"public void act() \n {\n // Add your action code here.\n tempoUp();\n }",
"public void act() \n {\n // Add your action code here.\n // get the Player's location\n if(!alive) return;\n \n int x = getX();\n int y = getY();\n \n // Move the Player. The setLocation() method will move the Player to the new\n // x and y coordinates.\n \n if( Greenfoot.isKeyDown(\"right\") ){\n setLocation(x+1, y);\n } else if( Greenfoot.isKeyDown(\"left\") ){\n setLocation(x-1, y);\n } else if( Greenfoot.isKeyDown(\"down\") ){\n setLocation(x, y+1);\n } else if( Greenfoot.isKeyDown(\"up\") ){\n setLocation(x, y-1);\n } \n \n removeTouching(Fruit.class);\n if(isTouching(Bomb.class)){\n alive = false;\n }\n \n }",
"public void act() \n {\n moveTowardsPlayer(); \n }",
"public void doAction(){}",
"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 }",
"public void performAction() {\n\t\t// TODO Auto-generated method stub\n\t\t\n\t}",
"@Override\r\n\tpublic void action() {\n\t\t\r\n\t}",
"public void performActions(){\n GameInformation gi = this.engine.getGameInformation();\n\n if(gi.getTeam() == 0)\n this.engine.performPlayerAction(\n new MoveAction(src, dst)\n );\n\n }",
"void onAction(TwitchUser sender, TwitchMessage message);",
"@Override\n public void performAction(Player playerActingOn) {\n System.out.println(\"Perform action PlayerPlayingCard\");\n if (this.strengthBoost == 0)\n playerActingOn.gainInstantWin();\n playerActingOn.increaseStrengthGain(this.strengthBoost);\n }",
"abstract public void performAction();",
"@Override\n\tpublic void action(Player player) {\n\t\tfireMessageEvent(player.getPlayerId());\n\t\tplayer.setPosition(jail);\n\t\tplayer.setInJail(true);\n\t}",
"@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tgameType = \"Quick Play\"; \n\t\t\t\t\t\n\t\t\t\t}",
"public void executeAction()\n\t{\t\t\n\t\tthis.getUser().setHealth(this.getUser().getHealth()+HEALTH);\n\t}",
"@Override\n\tpublic void action() {\n\n\t}",
"public void act() \n {\n // Add your action code here.\n if (Greenfoot.mouseClicked(this)){\n Greenfoot.playSound(\"Bridge.wav\");\n }\n }",
"@Override\n public void specificAction(PlayerService playerService) {\n }",
"public void action() {\n }",
"private void action(String action) {\n\n\t\tSystem.out.println(name + \" is \" + action);\n\n\t\ttry {\n\t\t\tThread.sleep(((long)(Math.random() * 150)));\n\t\t} catch (InterruptedException e) {\n\t\t\tThread.currentThread().interrupt();\n\t\t}\n\t}",
"public void act() \r\n {\r\n if (Greenfoot.mouseClicked(this)) {\r\n Greenfoot.setWorld(new howToPlayGuide());\r\n }\r\n }",
"public void takeAction(BoardGameController.BoardBugAction action)\n {\n\n }",
"public void act()\n {\n // handle key events\n String key = Greenfoot.getKey();\n if (key != null)\n {\n handleKeyPress(key);\n } \n\n // handle mouse events\n if (startGameButton.wasClicked())\n {\n handleStartGame();\n }\n }",
"@Override\r\n\tpublic void makeMove(A action) {\r\n\t\tgame.execute(action);\r\n\t}",
"public void action(ActionCard card) {\n if (!myTurn()) {\n return;\n }\n if (handPile.contains(card)) {\n specialAction = card.performAction(this);\n while (specialAction.getDraw() > 0) {\n this.draw(1);\n specialAction.reduceDraw();\n }\n // CardAction cardAct = new CardAction(card, \"Play: \" + card.getName());\n // history.add(cardAct);\n }\n }",
"@Override public void takeAction(Player[] players, Enemy[] enemies, char action)\n {\n \n if (action == 'a') //ATTACK!!!!\n {\n if(gun.isEmpty())\n { \n System.out.println(name+\"'s weapon is empty!\");\n gun.reload();\n }\n else\n {\n Enemy target = target(this, enemies, gun.getAccuracy());\n Attack(target);\n }\n } \n else if (action == 'd')//Hold this position!\n {\n this.defend();\n System.out.println(name+\" hunkers down!\");\n }\n else if (action == 'r')//Reloading! Cover me!\n {\n gun.reload();\n }\n else if (action == 'm')//Fall back! There's too many of them!\n {\n run();\n }\n else\n {\n System.out.println(\"Invalid command.\");\n }\n }",
"@Override\n\t\tpublic void actionPerformed(ActionEvent e)\n\t\t{\n\t\t\tgame.makeMove(activePlayer, null);\n\t\t}",
"public void act() \r\n {\r\n key();\r\n win();\r\n fall();\r\n lunch();\r\n }",
"@Override\n public void run() {\n chosenActionUnit.run(getGame(), inputCommands);\n }",
"public static void sendActionMessage(ServerPlayer player, Component textComponent) {\n sendMessage(player, textComponent, true);\n }",
"public void action(BotInstance bot, Message message);",
"public void handleAction(Action action){\n\t\tSystem.out.println(action.getActionType().getName() + \" : \" + action.getValue());\n\t\tDroneClientMain.runCommand(\"python george_helper.py \" + action.getActionType().getName().toLowerCase() + \" \" + action.getValue());\n\t}",
"private void executeActions (Action action, Player joueur) {\n WarPlayer player = this.castPlayer(joueur);\n super.roundSteps(action, player, player.getFood());\n this.transformResources(player);\n this.feedArmies(player);\n }",
"public void act() \n {\n // Add your action code here.\n MyWorld world = (MyWorld) getWorld();\n jefe = world.comprobarJefe();\n \n \n explotar();\n \n if(jefe)\n {\n girarHaciaEnemigo();\n movimientoPegadoAJefe();\n }\n }",
"public void act()\n {\n trackTime();\n showScore();\n \n }",
"void action(String response, GameChatEvent cause) throws InterruptedException, IOException;",
"@Override\n\tpublic void onActionStart(int action) {\n\t\t\n\t}",
"public void act() \n {\n if (Greenfoot.mouseClicked(this))\n {\n Peter.lb=2; \n Greenfoot.playSound(\"click.mp3\");\n Greenfoot.setWorld(new StartEngleza());\n };\n }",
"public abstract void action();",
"public abstract void action();",
"public abstract void action();",
"public abstract void action();",
"public abstract Action takeTurn();",
"private void playAction(){\n\n if (stopBeforeCall.isSelected()) { execEndAction(execOnEnd.getText()); }\n execStartAction(execOnStart.getText());\n\n //if timer was inicializated\n if (timer != null) {\n if (pto == null) {\n pto = new PlayerTimerOnly(displayTimer);\n pto.play();\n } else {\n pto.stop();\n pto.play();\n }\n }\n //check if play is needed\n SolverProcess sp = solverChoices.getSelectionModel().getSelectedItem();\n if (sp == null || sp.isDummyProcess()){\n return;\n }\n\n Solution s = sp.getSolution();\n\n s = mfd.transofrmSolutionTimeIfChecked(s);\n\n List<List<AgentActionPair>> aapList = Simulator.getAAPfromSolution(s);\n rmp = new RealMapPlayer(aapList,smFront);\n rmp.play();\n\n\n }",
"public void doAction(int action){\n this.hp -= action;\n }",
"@Override\r\n\tpublic void actionFly() {\n\t\tSystem.out.println(\"날 수 있다.\");\r\n\t}",
"public void setAction(String action) { this.action = action; }",
"GameState requestActionGamePiece();",
"public void act() \n {\n mouse = Greenfoot.getMouseInfo();\n \n // Removes the achievement after its duration is over if its a popup (when it pops up during the game)\n if(popup){\n if(popupDuration == 0) getWorld().removeObject(this);\n else popupDuration--;\n }\n // Displays the decription of the achievement when the user hovers over it with the mouse\n else{\n if(Greenfoot.mouseMoved(this)) drawDescription();\n if(Greenfoot.mouseMoved(null) && !Greenfoot.mouseMoved(this)) drawMedal();\n }\n }",
"@Override\n public void act() {\n sleepCheck();\n if (!isAwake()) return;\n while (getActionTime() > 0f) {\n UAction action = nextAction();\n if (action == null) {\n this.setActionTime(0f);\n return;\n }\n if (area().closed) return;\n doAction(action);\n }\n }",
"protected void takeAction() {\n lastAction = System.currentTimeMillis();\n }",
"public void takeAction(int actionCode) {\n\t\tif(this.panel.canTakeAction(actionCode)){\n\t\t\ttry {\n\t\t\t\tthis.receive.acceptActionTra(actionCode, indexOfGame);\n\t\t\t} catch (RemoteException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic void visit(SimpleAction action)\r\n\t{\n\t\t\r\n\t}",
"@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void onActionMove(float x, float y) {\n\n\t\t\t\t}",
"public void act() \n {\n // Add your action code here.\n klawisze();\n stawiaj();\n pobierzJablka();\n }",
"public BlackjackClientState do_action(int action) {\n switch (action) {\n case 0:\n player_stand = true;\n break;\n case 1:\n player_cards.add(deck.get_card());\n break;\n\n }\n return get_state();\n }",
"public void act() \r\n {\n if(getOneIntersectingObject(Player.class)!=null)\r\n {\r\n if(MenuWorld.gamemode == 1)\r\n //marcheaza regenerarea labirintului(trecere la nivelul urmator in Modul Contra Timp)\r\n TAworld.shouldRegen=true;\r\n else\r\n { \r\n //reseteaza variabilele care tin de modul de joc\r\n MenuWorld.gamemode=-1;\r\n MenuWorld.isPlaying=false;\r\n for(int i=0;i<4;i++)\r\n ItemCounter.gems_taken[i]=0;\r\n \r\n //arata fereastra de castig \r\n PMworld.shouldShowVictoryWindow=true;\r\n }\r\n \r\n }\r\n \r\n }",
"@Override\n\tpublic void HandleEvent(int action) {\n\t\tsetActiveAction(action);\n\t\tSystem.out.println(\"action is :\" + action);\n\t\t\n\t}",
"public void execute(A action) {\n\t\tS testState=action.applyTo(currentState);\n\t\tif (stop ||testState.equals(null)){\n\t\t\tString text=\"Impossible to make the action: \";\n\t\t\t\n\t\t\tif(stop){\n\t\t\t\ttext+=\"The game was stopped before \";\n\t\t\t}\n\t\t\telse if(testState.equals(null)){\n\t\t\t\ttext+=\"The game should start before realize an action\";\n\t\t\t}\n\t\t\t\n\t\t\tGameError error=new GameError(text);\n\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Error, null,currentState, error, error.getMessage()));\n\t\t\tthrow error;\n\t\t\t\n\t\t\t\t\t\n\t\t}else{\n\t\t\tthis.currentState=testState;\n\t\t\tnotifyObservers(new GameEvent<S, A>(EventType.Change, action, currentState, null,\"The game has change\"));\n\t\t\t\t\n\t\t}\n\t\t\t\n\t\n \t}",
"public void actionOffered();",
"@Override\n\tpublic void handleEventPlayerActionsUpdate( World world, List<Action> availableActions ) {\n\t\t\n\t}",
"public void grant(int action) {\n if (action == 0) {\n this.raiseEatable(1.25, 0.75);\n } else if (action == 1) {\n this.raisePlayable(1.25, 0.75);\n } else {\n this.raiseIgnorable(1.25, 0.75);\n }\n }",
"@Override\n public Action action(Player p) {\n p.setGold(p.getGold() + this.getGold());\n return new Action(0, \"Vous avez ouvert un coffre contenant \" + this.getGold() + \" pièces d'or.\");\n }",
"public synchronized void applyAction(int action) {\n\n }",
"public void performAction(String s) {\n try {\n CommandToClient command = CommandToClient.valueOf(Parser.getCommand(s));\n s = s.substring(5);\n switch (command) {\n case START:\n gameFrame.startGame();\n break;\n case ATEMP:\n gameFrame.attempt(s);\n break;\n case LAUNC:\n gameFrame.resultOfAttempt(s);\n break;\n case TOCOL:\n // will announce that boat has been sank\n System.out.println(\"You sank the \" + SetOfBoats.getNames()[Integer.parseInt(s)]);\n break;\n case WINNE:\n // will announce that game is won\n System.out.println(\"You have won!\");\n break;\n case PRINT:\n gameFrame.printWG();\n default:\n System.out.println(\"Incorrect command : \" + s);\n }\n\n } catch (CommandException e) {\n System.out.println(\"Command \" + s + \" not valid\");\n e.printStackTrace();\n }\n }",
"public void update(int action) {\n // Let the players play and switch to the next one\n this.players.get(this.currentPlayer).play(this, action);\n updatePlayer();\n updateTurn();\n\n // Increase blind\n if (this.numGame % BLIND_GAME_INCREASE == 0) this.currentSmallBlind *= 2;\n }"
] | [
"0.8103102",
"0.80604255",
"0.79545647",
"0.7830126",
"0.7711488",
"0.7332278",
"0.73071593",
"0.72224814",
"0.71331173",
"0.7120541",
"0.7094157",
"0.7078364",
"0.7074909",
"0.70271844",
"0.69889134",
"0.6969485",
"0.6879662",
"0.6879662",
"0.6870218",
"0.6855829",
"0.6835508",
"0.6833199",
"0.6803891",
"0.6803891",
"0.6803891",
"0.6799588",
"0.6792039",
"0.6787723",
"0.6787379",
"0.67799324",
"0.6760539",
"0.6759126",
"0.6759126",
"0.6759126",
"0.6759126",
"0.6759126",
"0.6759126",
"0.6759126",
"0.6759126",
"0.67531955",
"0.6745287",
"0.6744002",
"0.6718218",
"0.66877985",
"0.6685155",
"0.66801345",
"0.6654981",
"0.6645856",
"0.6637439",
"0.6637361",
"0.6637023",
"0.66286564",
"0.6627969",
"0.66218346",
"0.6616702",
"0.6589294",
"0.6584756",
"0.657225",
"0.6571821",
"0.6568515",
"0.6555205",
"0.65386844",
"0.6535339",
"0.6532706",
"0.6532016",
"0.6522236",
"0.6507021",
"0.65057325",
"0.6487416",
"0.6481567",
"0.64794123",
"0.64663184",
"0.64663184",
"0.64663184",
"0.64663184",
"0.6462191",
"0.6459404",
"0.64592034",
"0.64519644",
"0.6451531",
"0.644484",
"0.6439741",
"0.6437444",
"0.6433095",
"0.6429976",
"0.6427258",
"0.64259803",
"0.64259803",
"0.64259803",
"0.6424064",
"0.6415365",
"0.6412582",
"0.6402266",
"0.6392783",
"0.6375814",
"0.63737524",
"0.63730943",
"0.6371465",
"0.63693243",
"0.6360109",
"0.6359036"
] | 0.0 | -1 |
/ dbname:taskmanager collection: tasks | @Override
public void insertChallenge(Challenge challenge) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"List<Task> getAllTasks();",
"Set<Task> getAllTasks();",
"@GET(\"/task/.json\")\n Call<Map<String, Task>> getAllTasks();",
"public abstract TasksDAO tasksDAO();",
"@Test\r\n\tpublic void testAddTask() {\n\t\ttodo.addTask(new Task(\"Test task1\"));\r\n\t\t\r\n\t\tCollection<Task> col = todo.getAllTasks();\r\n\t\tassertTrue(\"Expected collectioon to contain 1 task object\", col.size() == 1);\t\t\r\n\t\t\r\n\t\tTask[] tasks = new Task[] {};\r\n\t\tTask t = col.toArray(tasks)[0];\r\n\t\t\r\n\t\tassertEquals(\"Test task1\", t.getDescription());\t\t\r\n\t}",
"public static List<Task> getTaskFromDb() {\n List<Task> taskList = new ArrayList<>();\n try {\n // taskList = Task.listAll(Task.class);\n taskList= Select.from(Task.class).orderBy(\"due_date Desc\").where(\"status=?\", new String[] {\"0\"}).list();\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n return taskList;\n\n }",
"public List<Task> getAllTasksForUser(long userId);",
"void addTasks(List<Task> tasks);",
"void getTasks( AsyncCallback<java.util.List<org.openxdata.server.admin.model.TaskDef>> callback );",
"@GetMapping(value = \"/getAllTasks\")\n\tpublic List<Task> getAllTasks()\n\t{\n\t\treturn this.integrationClient.getAllTasks();\n\t}",
"_task selectByPrimaryKey(Integer taskid);",
"public List<TaskDefinition> getTasksDefinition() throws DaoRepositoryException;",
"protected abstract void createTasks();",
"@Test\n public void insertTaskAndGetTasks() {\n mDatabase.taskDao().insertTask(TASK);\n\n // When getting the tasks from the database\n List<Task> tasks = mDatabase.taskDao().getTasks();\n\n // There is only 1 task in the database\n assertThat(tasks.size(), is(1));\n // The loaded data contains the expected values\n assertTask(tasks.get(0), \"id\", \"title\", \"description\", true);\n }",
"@Test\n public void deleteCompletedTasksAndGettingTasks() {\n mDatabase.taskDao().insertTask(TASK);\n\n //When deleting completed tasks\n mDatabase.taskDao().deleteCompletedTasks();\n\n //When getting the tasks\n List<Task> tasks = mDatabase.taskDao().getTasks();\n // The list is empty\n assertThat(tasks.size(), is(0));\n }",
"@Test\n public void deleteTasksAndGettingTasks() {\n mDatabase.taskDao().insertTask(TASK);\n\n //When deleting all tasks\n mDatabase.taskDao().deleteTasks();\n\n //When getting the tasks\n List<Task> tasks = mDatabase.taskDao().getTasks();\n // The list is empty\n assertThat(tasks.size(), is(0));\n }",
"public static List<Task> findAll() {\n\t\treturn getPersistence().findAll();\n\t}",
"public ArrayList<Task> getTasks(Calendar cal) \n\t{\n ArrayList<Task> tasks = new ArrayList<Task>();\n\t\tStatement statement = dbConnect.createStatement();\n\t\t\n\t\tResultSet results = statement.executeQuery(\"SELECT * FROM tasks\");\n\n\t\twhile(results.next())\n\t\t{\n\t\t\tint id = result.getInt(1);\n\t\t\tint year = result.getInt(2);\n\t\t\tint month = result.getInt(3);\n\t\t\tint day = result.getInt(4);\n\t\t\tint hour = result.getInt(5);\n\t\t\tint minute = result.getInt(6);\n\t\t\tString descrip = result.getString(7);\n\t\t\tboolean recurs = result.getBoolean(8);\n\t\t\tint recursDay = result.getInt(9);\n\t\t\t\n\t\t\tCalendar cal = new Calendar();\n\t\t\tcal.set(year, month, day, hour, minute);\n\t\t\t\n\t\t\tTask task;\n\t\t\t\n\t\t\tif(recurs)\n\t\t\t{\n\t\t\t\ttask = new Task(cal, descrip, recursDay));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttask = new Task(cal, descrip));\n\t\t\t}\n\t\t\t\n\t\t\ttask.setID(id);\n\t\t}\n\t\tstatement.close();\n\t\tresults.close();\n return tasks;\n }",
"private List<TaskObject> getAllTasks(){\n RealmQuery<TaskObject> query = realm.where(TaskObject.class);\n RealmResults<TaskObject> result = query.findAll();\n result.sort(\"completed\", RealmResults.SORT_ORDER_DESCENDING);\n\n tasks = new ArrayList<TaskObject>();\n\n for(TaskObject task : result)\n tasks.add(task);\n\n return tasks;\n }",
"Task selectByPrimaryKey(String taskid);",
"public interface TaskManager {\n\t/**\n\t * @return all the tasks that have to be executed\n\t */\n\tvoid getTasks();\n}",
"private void getTasks(){\n\n currentFirebaseUser = FirebaseAuth.getInstance().getCurrentUser();\n if(currentFirebaseUser !=null){\n Log.e(\"Us\", \"onComplete: good\");\n } else {\n Log.e(\"Us\", \"onComplete: null\");\n }\n\n\n mDatabaseReference.child(currentFirebaseUser.getUid())\n .addValueEventListener(new ValueEventListener() {\n //если данные в БД меняются\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (mTasks.size() > 0) {\n mTasks.clear();\n }\n for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {\n Task task = postSnapshot.getValue(Task.class);\n mTasks.add(task);\n if (mTasks.size()>2){\n\n }\n }\n setAdapter(taskId);\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n\n });\n }",
"public int getTasks() {\r\n return tasks;\r\n }",
"List<Task> getTaskdetails();",
"B withTasks(Collection<T> tasks);",
"public void fetchTasks() {\n tasksTotales.clear();\n for (String taskId : taskList) {\n databaseTaskReference.child(taskId).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n com.ijzepeda.armet.model.Task taskTemp = dataSnapshot.getValue(com.ijzepeda.armet.model.Task.class);\n tasksTotales.add(taskTemp);\n taskAdapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }\n\n\n }",
"int activeTasks();",
"public List<Task> listTasks(String extra);",
"@Query(\"SELECT * from task_table ORDER BY task ASC\")\n LiveData<List<Task>> getAllTasks();",
"public Cursor getAllTasks()\n {\n Cursor mCursor = db.query(DATABASE_TABLE, new String[]{KEY_ROWID,\n KEY_TASK_SMALLBLIND,\n KEY_TASK_BUTTON,\n KEY_TASK_CUTOFF,\n KEY_TASK_HIJACK,\n KEY_TASK_LOJACK,\n KEY_TASK_UTG2,\n KEY_TASK_UTG1,\n KEY_TASK_UTG},null,null,null,null,null);\n\n\n return mCursor;\n }",
"public List<TaskMaster> retrieveAllTaskOfProject(Long projectId);",
"@Override\r\n\tpublic List<Task> findAll() {\n\t\treturn taskRepository.findAll();\r\n\t}",
"public List<TaskDescription> getActiveTasks();",
"public List<Task> getAllTasks() {\n List<Task> taskList = new ArrayList<Task>();\n String queryCommand = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor cursor = db.rawQuery(queryCommand, null);\n if (cursor.moveToFirst()) {\n do {\n Task task = new Task();\n task.setId(cursor.getString(0));\n task.setLabel(cursor.getString(1));\n task.setTime(cursor.getString(2));\n taskList.add(task);\n } while (cursor.moveToNext());\n }\n return taskList;\n }",
"public interface TaskStorage {\n\n public long addTask(Task task);\n public int removeTask(long id);\n public List<Task> findAllTasks();\n public long numberOfTasks();\n}",
"public void add(Task task){ this.tasks.add(task);}",
"@Override\n\tpublic ArrayList<DetailedTask> selectAllTasks() throws SQLException, ClassNotFoundException\n\t{\n\t\tArrayList<DetailedTask> returnValue = new ArrayList<DetailedTask>();\n\t\t \n\t\t Gson gson = new Gson();\n\t\t Connection c = null;\n\t Statement stmt = null;\n\t \n\t \n\t Class.forName(\"org.postgresql.Driver\");\n\t c = DriverManager.getConnection(dataBaseLocation, dataBaseUser, dataBasePassword);\n\t c.setAutoCommit(false);\n\t \n\t logger.info(\"Opened database successfully (selectAllTasks)\");\n\n\t stmt = c.createStatement();\n\t ResultSet rs = stmt.executeQuery( \"SELECT * FROM task;\" );\n\n\t while(rs.next())\n\t {\n\t \t Type collectionType = new TypeToken<List<Item>>() {}.getType();\n\t \t List<Item> items = gson.fromJson(rs.getString(\"items\"), collectionType);\n\t \n\t \t returnValue.add(new DetailedTask(rs.getInt(\"id\"), rs.getString(\"description\"), \n\t \t\t rs.getDouble(\"latitude\"), rs.getDouble(\"longitude\"), rs.getString(\"status\"), \n\t \t\t items, rs.getInt(\"plz\"), rs.getString(\"ort\"), rs.getString(\"strasse\"), rs.getString(\"typ\"), \n\t \t\t rs.getString(\"information\"), gson.fromJson(rs.getString(\"hilfsmittel\"), String[].class), rs.getString(\"auftragsfrist\"), \n\t \t\t rs.getString(\"eingangsdatum\")));\n\t }\n\n\t rs.close();\n\t stmt.close();\n\t c.close();\n\t \n\t \n\t return returnValue;\n\t}",
"void setTodos(ArrayList<Task> tasks);",
"public ArrayList<Task> retrieveTaskList() {\r\n\r\n\r\n return taskList;\r\n }",
"List<Workflow> findByIdTask( int nIdTask );",
"@PostConstruct\n public void setUpTasks() {\n final Iterable<Task> findAll = taskService.findAll();\n if (findAll != null) {\n findAll.forEach(task -> {\n\n final RunnableTask runnableTask = new RunnableTask(task.getId(), runTaskService);\n\n if (task.getCronExpression() != null) {\n log.info(\"Adding cron schedule for {} : {}\", task.getId(), task.getCronExpression());\n threadPoolTaskScheduler.schedule(runnableTask, new CronTrigger(task.getCronExpression()));\n }\n else if (task.getDelayPeriod() > 0) {\n log.info(\"Adding periodic schedule for {} : {}\", task.getId(), task.getDelayPeriod());\n threadPoolTaskScheduler.schedule(runnableTask, new PeriodicTrigger(task.getDelayPeriod()));\n }\n else {\n log.error(\"Invalid task {}\", task.getId());\n }\n\n });\n }\n }",
"@Access(AccessType.PUBLIC)\r\n \tpublic Set<String> getTasks();",
"@Override\r\n\tpublic ArrayList<Task> getAllTasks() {\n\t\treturn null;\r\n\t}",
"private TaskBaseBean[] getAllTasksCreatedByUser100() {\n TaskBaseBean[] tasks = TaskServiceClient.findTasks(\n projObjKey,\n AppConstants.TASK_BIA_CREATED_BY,\n \"100\"\n );\n return tasks;\n }",
"public interface ITaskService {\n\n List<Task> selectAll();\n\n Task selectByPrimaryKey(Integer id);\n\n int runTest(String host, String data, String comment);\n\n List<ResultWithBLOBs> selectResult(Integer id, String caseIds);\n\n int deleteTask(Integer ruleId);\n\n}",
"TaskList(List<Task> tasks) {\n this.tasks = tasks;\n }",
"public List<TaskMaster> retrieveTasksForIntervalById(long userId, Calendar startTime, Calendar endTime);",
"public List<TaskMaster> retrieveAllTaskByUserId(Long userId);",
"@Override\n\tpublic List<Task> getTasks() {\n\t\treturn details.getPendingTasks();\n\t}",
"void schedule(Collection<ExportedTaskNode> taskNodes);",
"public List<Task> getAllTasks() {\n List<Task> tasks = new ArrayList<Task>();\n String selectQuery = \"SELECT * FROM \" + TABLE_TASKS+\" ORDER BY \"+KEY_DATE;\n\n Log.e(LOG, selectQuery);\n\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(selectQuery, null);\n\n // looping through all rows and adding to list\n if (c.moveToFirst()) {\n do {\n Task tk = new Task();\n tk.setId(c.getLong((c.getColumnIndex(KEY_ID))));\n tk.setTaskName((c.getString(c.getColumnIndex(KEY_TASKNAME))));\n tk.setDateAt(c.getString(c.getColumnIndex(KEY_DATE)));\n tk.setStatus(c.getInt(c.getColumnIndex(KEY_STATUS)));\n\n // adding to todo list\n tasks.add(tk);\n } while (c.moveToNext());\n }\n c.close();\n return tasks;\n }",
"@RequestMapping(method = RequestMethod.GET, value = \"/get-tasks\")\r\n\tpublic List<Task> getTasks() {\r\n\t\tList<Task> dummyTasks = new ArrayList<Task>();\r\n\t\treturn dummyTasks;\r\n\t}",
"@Query(\"SELECT * FROM \" + TABLE)\n List<Task> getAllSync();",
"public List<Task> getAllTask() {\n\t\treturn taskRepo.findAll();\n\t}",
"@RequestMapping(value=\"/tasks\", method = RequestMethod.GET)\npublic @ResponseBody List<Task> tasks(){\n\treturn (List<Task>) taskrepository.findAll();\n}",
"public static boolean checkTaskInDb() {\n\n List<Task> taskList = new ArrayList<>();\n try {\n // taskList = Task.listAll(Task.class);\n taskList= Select.from(Task.class).orderBy(\"due_date Desc\").where(\"status=?\", new String[] {\"0\"}).list();\n } catch (Exception e) {\n e.printStackTrace();\n\n }\n if(taskList!=null && taskList.size()>0)\n return true;\n return false;\n }",
"public List<ScheduledTask> getAllPendingTasks() {\n \t\tSet<String> smembers = jedisConn.smembers(ALL_TASKS);\n \t\tList<ScheduledTask> alltasks = new ArrayList<>();\n \t\tGson gson = new Gson();\n \t\t// the get actual tasks by the ids\n \t\tfor (String member : smembers) {\n \t\t\tString string = jedisConn.get(PENDING_TASK(member));\n \t\t\tScheduledTask task = gson.fromJson(string, ScheduledTask.class);\n \t\t\talltasks.add(task);\n \t\t}\n \t\treturn alltasks;\n \t}",
"public List<Task> getTasks() {\n return this.tasks;\n }",
"@Test\n public void deleteTaskByIdAndGettingTasks() {\n mDatabase.taskDao().insertTask(TASK);\n\n //When deleting a task by id\n mDatabase.taskDao().deleteTaskById(TASK.getId());\n\n //When getting the tasks\n List<Task> tasks = mDatabase.taskDao().getTasks();\n // The list is empty\n assertThat(tasks.size(), is(0));\n }",
"public void removeTasks() {\n\t\t\r\n\t}",
"ObservableList<Task> getTaskList();",
"@PostMapping(\"/tasks\")\n public List<Task> postTasks(@RequestBody Task task) {\n if (task.getAssignee().equals(\"\")) {\n task.setStatus(\"Available\");\n }else {\n task.setStatus(\"Assigned\");\n sentSMS(task.getTitle());\n }\n taskRepository.save(task);\n List<Task> allTask = (List) taskRepository.findAll();\n return allTask;\n }",
"@GetMapping(\"/users/{name}/tasks\")\n public List<Task> getTaskByAssignee(@PathVariable String name){\n List<Task> allTask = taskRepository.findByAssignee(name);\n return allTask;\n }",
"public List<Task> getTasks() {\n return tasks;\n }",
"public List<Task> getTasks() {\n return tasks;\n }",
"public List<Task> getTasks() {\n return tasks;\n }",
"void addToList(Task task) throws InvalidCommandException;",
"@GetMapping(\"/getall\")\n public List<Task> getAll() {\n return taskService.allTasks();\n\n }",
"public void updateTasks(List<Task> listOfTasks);",
"public ArrayList<Task> getTasks() {\n // List of workouts to return\n ArrayList<Task> tasks = new ArrayList<>();\n\n // Cursor is what moves throughout the entire database\n Cursor cursor = database.query(SQLiteHelper.TABLE_TASKS,\n allColumns, null, null, null, null,\n SQLiteHelper.COLUMN_ID + \" ASC\");\n\n cursor.moveToFirst();\n while (!cursor.isAfterLast()) {\n Task task = cursorToTask(cursor);\n\n tasks.add(task);\n\n cursor.moveToNext();\n }\n cursor.close();\n\n return tasks;\n }",
"@ApiModelProperty(required = true, value = \"List of active tasks generated by the connector\")\n public List<ConnectorTaskId> getTasks() {\n return tasks;\n }",
"TaskList() {\r\n tasks = new ArrayList<>();\r\n }",
"@Test\n public void testGetTasksForSession() {\n\n List<Task> tasks;\n\n tasks = Session.getTasks(Session.NAME.PRE, 1);\n\n assertNotNull(tasks);\n assertTrue(\"Pre should have two tasks.\", tasks.size() == 2);\n assertEquals(\"Unique name for the task should be DASS_21\", \"DASS21_AS\", tasks.get(0).getName());\n assertEquals(\"First task should be named Status Questionnaire\", \"Status Questionnaire\", tasks.get(0).getDisplayName());\n assertEquals(\"First task should point to the DASS21 questionniare\", Task.TYPE.questions, tasks.get(0).getType());\n assertEquals(\"First task should point to the DASS21 questionniare\",\"questions/DASS21_AS\", tasks.get(0).getRequestMapping());\n assertTrue(\"First task should be completed\",tasks.get(0).isComplete());\n assertFalse(\"First task should not be current\",tasks.get(0).isCurrent());\n assertFalse(\"Second task should not be completed\",tasks.get(1).isComplete());\n assertTrue(\"Second task should be current\",tasks.get(1).isCurrent());\n\n Session s = new Session();\n s.setTasks(tasks);\n assertEquals(\"Second task is returned when current requested\", tasks.get(1), s.getCurrentTask());\n\n }",
"@SuppressWarnings(\"unchecked\")\n public List<Item> getListOfTasks() {\n Session session = this.factory.openSession();\n List<Item> list = session.createQuery(\"from Item\").list();\n session.close();\n return list;\n }",
"void addSeeds(TaskList tasks);",
"public TaskList(ArrayList<Task> tasks) {\n this.tasks = tasks;\n }",
"public TaskList(ArrayList<Task> tasks) {\n this.tasks = tasks;\n }",
"public static Recordset findtasks(final TaskQuery taskQuery) {\r\n try {\r\n return ServerFactory.getServer().getSecurityManager().executeAsSystem(new Callable<Recordset>() {\r\n public Recordset call() throws Exception {\r\n return Ivy.wf().getTaskQueryExecutor().getRecordset(taskQuery);\r\n }\r\n });\r\n\r\n } catch (Exception e) {\r\n Ivy.log().error(e);\r\n }\r\n return null;\r\n }",
"public interface Task {\n\t\t/** Insertion tuples */\n\t\tpublic TupleSet insertions();\n\n\t\t/** Deletion tuples. */\n\t\tpublic TupleSet deletions();\n\n\t\t/** The program name that should evaluate the tuples. */\n\t\tpublic String program();\n\n\t\t/** The name of the table to which the tuples belong. */\n\t\tpublic TableName name();\n\t}",
"public ArrayList<Task> getTasks() {\n return tasks;\n }",
"@Override\r\n\tpublic List<ExecuteTask> getAll() {\n\t\tString sql = \"SELECT et_id id,et_member_id memberId,et_task_id taskId,et_comments comments FROM executetask\";\r\n\t\treturn getForList(sql);\r\n\t}",
"public LiveData<List<Task>> getAllTasks(){\n allTasks = dao.getAll();\n return allTasks;\n }",
"void saveTask( org.openxdata.server.admin.model.TaskDef task, AsyncCallback<Void> callback );",
"public void add(Task task)\n {\n this.tasks.add(task);\n }",
"@OneToMany(mappedBy=\"project\", fetch=FetchType.EAGER)\n\t@Fetch(FetchMode.SUBSELECT)\n\t@JsonIgnore\n\tpublic List<Task> getTasks() {\n\t\treturn this.tasks;\n\t}",
"private void processTaskList(List<Task> taskList) throws SQLException, DaoException {\n for (Task currentTask : taskList) {\n processTask(currentTask);\n }\n }",
"void addDoneTasks(List<Task> task);",
"public void loadTasks()\r\n\t{\n\t\ttable = loadTable(\"../data/tasks.csv\", \"header\");\r\n\t\t\r\n\t\t//gets amount of data rows in table\r\n\t\trow_count = table.getRowCount();\r\n\t\t//println(row_count);\r\n\t\t\r\n\t\t//put each row in table into Task class objects and initialise them\r\n\t\tfor(TableRow r : table.rows()){\r\n\t\t\ttasks.add(new Task(r));\r\n\t\t}\r\n\t\t\r\n\t}",
"ObservableList<Task> getCurrentUserTaskList();",
"public TaskManager() {\n\t\tcompletedTasks = new ArrayList<Tasks>();\n\t}",
"public TaskList (ArrayList<Task> tasks){ this.tasks = tasks;}",
"public ArrayList<Task> getAllTasks() {\n \treturn this.taskBuffer.getAllContents();\n }",
"@GetMapping(value=\"/all\",produces= { MediaType.APPLICATION_JSON_VALUE })\n\tpublic List<TaskDTO> getAllTasks()\n\t{ \t\n\t\treturn taskService.getAllTasks();\n\t}",
"@Override\r\n\tpublic List<ExecuteTask> getByTask(int taskId) {\n\t\tString sql = \"SELECT et_id id,et_member_id memberId,et_task_id taskId,et_comments comments FROM executetask\"\r\n\t\t\t\t+ \" WHERE et_task_id = ?\";\r\n\t\treturn getForList(sql,taskId);\r\n\t}",
"@Test\n void displayAllTasks() {\n }",
"TaskList getList();",
"public void processTasks (List tasks) {\n // Should only ever have one task in here\n while (!tasks.isEmpty()) {\n Task t = (Task)tasks.remove(0);\n \n Asset a = findAsset(t);\n PlanElement alloc = createAllocation(t, a);\n publishAddingOfAllocation(alloc);\n } \n }",
"@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<TaskSummary> getTasksByProcessInstance(Long processInstanceId, Status taskStatus) {\n TaskServiceSession taskSession = null;\n try {\n StringBuilder qBuilder = new StringBuilder(\"select new org.jbpm.task.query.TaskSummary(t.id, t.taskData.processInstanceId, name.text, subject.text, description.text, t.taskData.status, t.priority, t.taskData.skipable, t.taskData.actualOwner, t.taskData.createdBy, t.taskData.createdOn, t.taskData.activationTime, t.taskData.expirationTime, t.taskData.processId, t.taskData.processSessionId) \");\n qBuilder.append(\"from Task t \");\n qBuilder.append(\"left join t.taskData.createdBy \");\n qBuilder.append(\"left join t.taskData.actualOwner \");\n qBuilder.append(\"left join t.subjects as subject \");\n qBuilder.append(\"left join t.descriptions as description \");\n qBuilder.append(\"left join t.names as name \");\n qBuilder.append(\"where t.taskData.processInstanceId = \");\n qBuilder.append(processInstanceId);\n if(taskStatus != null) {\n qBuilder.append(\" and t.taskData.status = '\");\n qBuilder.append(taskStatus.name());\n qBuilder.append(\"'\");\n }\n taskSession = taskService.createSession();\n uTrnx.begin();\n List<TaskSummary> taskSummaryList = (List<TaskSummary>)taskSession.query(qBuilder.toString(), 10, 0);\n uTrnx.commit();\n return taskSummaryList;\n }catch(Exception x) {\n throw new RuntimeException(x);\n }finally {\n if(taskSession != null)\n taskSession.dispose();\n }\n }",
"public void addTask(Task task){\n SQLiteDatabase db = this.getWritableDatabase();\n ContentValues values = new ContentValues();\n values.put(KEY_ID, task.getId());\n values.put(KEY_LABEL, task.getLabel());\n values.put(KEY_TIME, task.getTime());\n db.insert(TABLE_NAME, null, values);\n db.close();\n }",
"public void setTaskName(String name) {\n\r\n\t}",
"private void doViewAllTasks() {\n ArrayList<Task> t1 = todoList.getListOfTasks();\n if (t1.size() > 0) {\n for (Task task : t1) {\n System.out.println(task.getTime() + \" \" + task.getDescription() + \" \" + task.getDate());\n }\n } else {\n System.out.println(\"No tasks available.\");\n }\n }"
] | [
"0.6436367",
"0.6328351",
"0.59570664",
"0.5899227",
"0.5896548",
"0.58909535",
"0.58888024",
"0.58826685",
"0.5862097",
"0.586149",
"0.5855284",
"0.58366835",
"0.5802051",
"0.58004737",
"0.57737577",
"0.57486504",
"0.5734697",
"0.573419",
"0.5728812",
"0.5728381",
"0.5727178",
"0.5710614",
"0.5701422",
"0.5699814",
"0.5690346",
"0.5688645",
"0.5680649",
"0.5653215",
"0.5649457",
"0.562253",
"0.5606364",
"0.55977726",
"0.5595698",
"0.55816174",
"0.55775857",
"0.55736846",
"0.5558395",
"0.5545495",
"0.5529001",
"0.5527945",
"0.55245835",
"0.55232334",
"0.55199",
"0.55152696",
"0.55093414",
"0.5479349",
"0.5477581",
"0.54768205",
"0.54733706",
"0.54725873",
"0.54695106",
"0.54675215",
"0.54647607",
"0.5463138",
"0.5462897",
"0.5459897",
"0.5458486",
"0.54540056",
"0.5445619",
"0.5445149",
"0.5441032",
"0.5437481",
"0.5429889",
"0.5426482",
"0.5426482",
"0.5426482",
"0.54169333",
"0.5408656",
"0.53892237",
"0.53859895",
"0.5377156",
"0.53721905",
"0.5370002",
"0.5361707",
"0.5356728",
"0.53550303",
"0.53550303",
"0.5350985",
"0.5350551",
"0.5347661",
"0.5339586",
"0.5332787",
"0.5328628",
"0.532815",
"0.5316159",
"0.53158873",
"0.53148013",
"0.53062147",
"0.5303708",
"0.5298633",
"0.52890456",
"0.5288605",
"0.52878994",
"0.5278863",
"0.52603567",
"0.52542794",
"0.52456635",
"0.52444685",
"0.5244379",
"0.5243545",
"0.52422565"
] | 0.0 | -1 |
Render stack element in Javainspired style: at fileName:lineNumber (functionName) | public void renderJavaStyle(StringBuilder sb) {
sb.append("\tat ").append(fileName);
if (lineNumber > -1) {
sb.append(':').append(lineNumber);
}
if (functionName != null) {
sb.append(" (").append(functionName).append(')');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String callMethodAndLine() {\n\t\tStackTraceElement thisMethodStack = (new Exception()).getStackTrace()[4];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb\n.append(AT)\n\t\t\t\t.append(thisMethodStack.getClassName() + \".\")\n\t\t\t\t.append(thisMethodStack.getMethodName())\n\t\t\t\t.append(\"(\" + thisMethodStack.getFileName())\n\t\t\t\t.append(\":\" + thisMethodStack.getLineNumber() + \") \");\n\t\treturn sb.toString();\n\t}",
"protected void render() {\n\t\tString accion = Thread.currentThread().getStackTrace()[2].getMethodName();\n\t\trender(accion);\n\t}",
"public String getStack();",
"RenderStack getRenderStack();",
"public void renderV8Style(StringBuilder sb) {\n sb.append(\" at \");\n\n if ((functionName == null) || \"anonymous\".equals(functionName) || \"undefined\".equals(functionName)) {\n // Anonymous functions in V8 don't have names in the stack trace\n appendV8Location(sb);\n\n } else {\n sb.append(functionName).append(\" (\");\n appendV8Location(sb);\n sb.append(')');\n }\n }",
"public static void printStacks(Thread currentThread) {\n\t\tStackTraceElement[] stackTrace = currentThread.getStackTrace();\n\t\t\n\t\tif (stackTrace.length == 0) {\n\t\t\tSystem.out.println(\"!!! No stacks available at the moment !!!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"=========================================================\");\n\t\tfor (int i= stackTrace.length-1; i >= 0; i--) {\n\t\t\tStackTraceElement stEle = stackTrace[i];\n\t\t\tSystem.out.println((stackTrace.length - i) + \". \" + stEle.toString());\n\t\t}\n\t\tSystem.out.println(\"=========================================================\\n\");\n\t}",
"public static void rep_Stack(String classNme, String methodNme, String fileNme, int lineNm, String PassedVars) {\n ResultStackTest rs = new ResultStackTest(classNme, methodNme, fileNme, lineNm, PassedVars);\n details_Stack.add(rs);\n }",
"public static void rep_WriteStack(String strTemplatePath, String strOutputPath) {\n try {\n String reportIn = new String(Files.readAllBytes(Paths.get(strTemplatePath)));\n for (int i = details_Stack.size() - 1; i >= 0; i--) {\n if (i == details_Stack.size() - 1) {\n reportIn = reportIn.replaceFirst(resultPlaceholder, \"<tr><td>\" + details_Stack.get(i).getMethodNme() + \"</td><td>\" + details_Stack.get(i).getIntlineNm() + \"</td><td>\" + details_Stack.get(i).getFileNme() + \"</td><td>\" + details_Stack.get(i).getClassNme() + \"</td></tr>\" + resultPlaceholder);\n } else {\n //if statement to prevent duplication of test step numbers in the report\n reportIn = reportIn.replaceFirst(resultPlaceholder, \"<tr><td>\" + details_Stack.get(i).getMethodNme() + \"</td><td>\" + details_Stack.get(i).getIntlineNm() + \"</td><td>\" + details_Stack.get(i).getFileNme() + \"</td><td>\" + details_Stack.get(i).getClassNme() + \"</td><td>\" + details_Stack.get(i).getPassedVars() + \"</td></tr>\" + resultPlaceholder);\n }\n }\n\n String currentDate = new SimpleDateFormat(\"dd-MM-yyyy\").format(new Date());\n\n\n String currentTime = CommonFunctionTest.com_CurrentTime();\n String reportPath = strOutputPath + \"\\\\Appium_stackTrace_\" + currentDate + \"_\" + currentTime + \".html\";\n\n Files.write(Paths.get(reportPath), reportIn.getBytes(), StandardOpenOption.CREATE);\n\n } catch (Exception e) {\n System.out.println(\"Error when writing report file:\\n\" + e.toString());\n }\n }",
"public static String currentStack()\n {\n StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n StringBuilder sb = new StringBuilder(500);\n for (StackTraceElement ste : stackTrace)\n {\n sb.append(\" \").append(ste.getClassName()).append(\"#\").append(ste.getMethodName()).append(\":\").append(ste.getLineNumber()).append('\\n');\n }\n return sb.toString();\n }",
"void printStackTrace(PrintWriter writer);",
"public void printStack(int stackNo){\n\t\tint begin = stackStarts[stackNo-1];\n\t\tfor (int i = begin; i < begin + stackTops[stackNo-1]; i++)\n\t\t\t\tSystem.out.print(stacks[i] + \" \");\n\t\tSystem.out.println();\n\t}",
"Character symbolStackWrite();",
"public ScGridColumn<AcFossWebServiceMessage> newStackTraceColumn()\n {\n return newStackTraceColumn(\"Stack Trace\");\n }",
"public String toString(int stack) {\n\t\tString stkStr = \"\";\n\t\tint start = stack * stackSize;\n\t\tfor (int i = start; i < start + stackPointer[stack]; i++) {\n\t\t\tstkStr += buffer[i] + \" -> \";\n\t\t}\n\t\tstkStr += \"END\";\n\t\treturn stkStr;\n\t}",
"public static final SubLObject setup_stacks_file() {\n Structures.register_method(print_high.$print_object_method_table$.getGlobalValue(), $dtp_stack$.getGlobalValue(), Symbols.symbol_function($sym7$STACK_PRINT_FUNCTION_TRAMPOLINE));\n Structures.def_csetf($sym8$STACK_STRUC_NUM, $sym9$_CSETF_STACK_STRUC_NUM);\n Structures.def_csetf($sym10$STACK_STRUC_ELEMENTS, $sym11$_CSETF_STACK_STRUC_ELEMENTS);\n Equality.identity($sym0$STACK);\n access_macros.register_macro_helper($sym24$DO_STACK_ELEMENTS_STACK_ELEMENTS, $sym25$DO_STACK_ELEMENTS);\n Structures.register_method(print_high.$print_object_method_table$.getGlobalValue(), $dtp_locked_stack$.getGlobalValue(), Symbols.symbol_function($sym36$LOCKED_STACK_PRINT_FUNCTION_TRAMPOLINE));\n Structures.def_csetf($sym37$LOCKED_STACK_STRUC_LOCK, $sym38$_CSETF_LOCKED_STACK_STRUC_LOCK);\n Structures.def_csetf($sym39$LOCKED_STACK_STRUC_STACK, $sym40$_CSETF_LOCKED_STACK_STRUC_STACK);\n Equality.identity($sym29$LOCKED_STACK);\n return NIL;\n }",
"public int getLineNo();",
"public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}",
"public String toString()\n\t{\n\t\treturn \"#\"+ this.getStepLineNumber() + \" \" + this.getClass().getSimpleName();\n\t}",
"String snippet(int line);",
"public interface StackTrace {\r\n\r\n\t /**\r\n\t * Gets the class from which the stack is tracking.\r\n\t * \r\n\t * @return\t\t\tThe name of the class\r\n\t */\r\n public String getClazz();\r\n\r\n /**\r\n * Sets the class from which the stack should tracking.\r\n * \r\n * @param clazz\tThe name of the class\r\n */\r\n public void setClazz(String clazz);\r\n\r\n /**\r\n * Gets the current message from the StackTrace.\r\n * \r\n * @return\t\t\tThe message\r\n */\r\n public String getMessage();\r\n\r\n /**\r\n * Sets a message to the StackTrace.\r\n * \r\n * @param message\tThe message\r\n */\r\n public void setMessage(String message);\r\n\r\n /**\r\n * Gets the current stack.\r\n * \r\n * @return\t\t\tThe current stack\r\n */\r\n public String getStack();\r\n\r\n /**\r\n * Sets the current stack.\r\n * \r\n * @param stack\tThe new stack\r\n */\r\n public void setStack(String stack);\r\n}",
"static String handleStackTrace(Throwable ex){\n // add the stack trace message\n StringBuilder builder = new StringBuilder(SPACE);\n builder.append(ex.getMessage());\n builder.append(NEWLINE);\n\n // add each line of the stack trace.\n for (StackTraceElement element : ex.getStackTrace()){\n builder.append(SPACE);\n builder.append(element.toString());\n builder.append(NEWLINE);\n }\n return builder.toString();\n }",
"public String getContext() {\n int l=code.getCurLine();\n String s=\"\\t\\t at line:\" + l + \" \";\n if (l>-1) {\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l-2);\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l-1);\n s+=\"\\n\\t\\t\\t> \"+code.getLineAsString(l)+\" <\";\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l+1);\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l+2);\n s=s+ \"\\n\\t\\t current token:\" + tok.toString();;\n s=s+ \"\\n\\t\\t Variable dump:\" + vars;\n if (gVars!=null) {\n s=s+ \"\\n\\t\\t Globals:\" + gVars;\n }\n } else s+=\"\\n\\t\\t\\t> \"+tok.getLine()+\" <\";\n\n return s;\n }",
"public int getLineNumber();",
"public void renderMozillaStyle(StringBuilder sb) {\n if (functionName != null) {\n sb.append(functionName).append(\"()\");\n }\n sb.append('@').append(fileName);\n if (lineNumber > -1) {\n sb.append(':').append(lineNumber);\n }\n }",
"public void print(){\n for(int i = 0; i < numElements; i++){\n System.out.print(myCustomStack[i] + \" \");\n }\n }",
"public View getGraphic()\n{\n // Get image for file\n //Image img = _type==FileType.PACKAGE_DIR? Package : ViewUtils.getFileIconImage(_file);\n Image img = ViewUtils.getFileIconImage(_file);\n View grf = new ImageView(img); grf.setPrefSize(18,18);\n \n // If error/warning add Error/Warning badge as composite icon\n /*BuildIssue.Kind status = _proj!=null? _proj.getRootProject().getBuildIssues().getBuildStatus(_file) : null;\n if(status!=null) {\n Image badge = status==BuildIssue.Kind.Error? ErrorBadge : WarningBadge;\n ImageView bview = new ImageView(badge); bview.setLean(Pos.BOTTOM_LEFT);\n StackView spane = new StackView(); spane.setChildren(grf, bview); grf = spane;\n }*/\n \n // Return node\n return grf;\n}",
"public int getDecoratedLine (Node node);",
"private String printStackTrace() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"public String toString(){\n String pileString = \"\";\n\n for(int i = 0; i < this.nbObj; i++)\n {\n pileString += i + \": \" + this.objTab[i].toString() + \"\\n\";\n }\n pileString += \"End of Stack\";\n return pileString;\n }",
"private static void displayXCode() {\n if (dvm.getStartingLine() < 0){\n System.out.println(\"====\"+dvm.getCurrentFunction().toUpperCase()+\"====\");\n }else{\n for (int i = dvm.getStartingLine(); i <= dvm.getEndingLine(); i++) {\n if (dvm.isLineABreakPoint(i)){\n //NOTE: (char)249 is extended ascii for a little solid square.\n //I'm sorry if it comes out as something else on your machine\n //I do not know how (or if its possible) to check if the machine\n //that will run this program supports extended ascii. If it doesnt\n //It should just show up as an empty box, which is acceptable\n //For my purposes as well.\n System.out.print((char)249);\n }else\n System.out.print(\" \");\n\n if (i == dvm.getCurrentLine())\n System.out.println(String.format(\"%1$4s %2$s\", i + \")\", dvm.getLineOfSourceCode(i)+ \" <-----------\"));\n else\n System.out.println(String.format(\"%1$4s %2$s\", i + \")\", dvm.getLineOfSourceCode(i)));\n }\n }\n }",
"public String toString() {\n // Introducing StringBuilder\n StringBuilder sb = new StringBuilder();\n sb.append(String.format(\"\\nThis stack has %d elements and %d of them are used\",\n this.foundation.length, this.usage));\n sb.append(\"\\n\\t[ \");\n for (int i = this.foundation.length - this.usage; i < this.foundation.length; i++) {\n sb.append(String.format(\"%s \", foundation[i]));\n }\n sb.append(\"]\");\n return sb.toString();\n }",
"private static String[] getStackElementParts(int depth) {\n String[] out = new String[2];\n if (-1 == depth) {\n return out;\n } else if (LOG_ALL == depth) {\n out = traceAll(Thread.currentThread().getStackTrace(), LOG_ALL);\n } else if (DEBUG_TRACE_ALL == (DEBUG & DEBUG_TRACE)) {\n out = traceAll(Thread.currentThread().getStackTrace(), DEPTH_ADD + depth);\n } else {\n out[1] = getTraceMethod(Thread.currentThread().getStackTrace(), DEPTH_ADD + depth);\n }\n return out;\n }",
"public static aan getStackMouseOver(int mx, int my) {\n/* */ try {\n/* 143 */ if (!NEIConfig.isEnabled() || NEIConfig.isHidden())\n/* */ {\n/* 145 */ return null;\n/* */ }\n/* */ \n/* 148 */ for (Widget widget : controlWidgets) {\n/* */ \n/* 150 */ aan stack = widget.getStackMouseOver(mx, my);\n/* 151 */ if (stack != null) {\n/* 152 */ return stack;\n/* */ }\n/* */ } \n/* 155 */ } catch (Exception exception) {\n/* */ \n/* 157 */ NEIUtils.reportException(exception);\n/* 158 */ NEIConfig.setEnabled(false);\n/* */ } \n/* 160 */ return null;\n/* */ }",
"private String getStackTrace(Exception ex) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tex.printStackTrace(new PrintWriter(sw));\r\n return sw.toString();\r\n\t}",
"@Override\n public String toString() {\n return \" at \" + this.index + \" [character \" + this.character + \" line \" + this.line + \"]\";\n }",
"private void printStackTrace(Exception ex, GUILog gl) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n gl.log(sw.toString()); // stack trace as a string\n ex.printStackTrace();\n }",
"public String Line() {\n return \"==================================================================================================================\";\n }",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"private static String[] traceAll(StackTraceElement[] stackTraceElements, int depth) {\n if (null == stackTraceElements) {\n return null;\n }\n if ((null != stackTraceElements) && (stackTraceElements.length >= depth)) {\n StackTraceElement source = stackTraceElements[depth];\n StackTraceElement caller = (stackTraceElements.length > (depth + 1))\n ? stackTraceElements[depth + 1]\n : ((stackTraceElements.length > depth) ? stackTraceElements[depth] : stackTraceElements[stackTraceElements.length - 1]);\n if (null != source) {\n if (null != caller) {\n String[] out = new String[8];\n out[0] = source.getFileName();\n out[1] = source.getMethodName();\n out[2] = Integer.toString(source.getLineNumber());\n out[3] = source.getClassName().substring(source.getClassName().lastIndexOf('.') + 1);\n out[4] = caller.getFileName();\n out[5] = caller.getMethodName();\n out[6] = Integer.toString(caller.getLineNumber());\n out[7] = caller.getClassName().substring(caller.getClassName().lastIndexOf('.') + 1);\n return out;\n }\n }\n }\n return null;\n }",
"@Test\n public void testCurlyBracket() {\n String html = source.toHTML(new SEclipseStyle(), new SCurlyBracket());\n assertEquals(html, \"<pre style='color:\"\n + \"#000000;background:#ffffff;'>\"\n + \"public class MainClass {\\n\"\n + \" \\n\"\n + \" public static void main(String args[]){\\n\"\n + \" GradeBook myGradeBook=new GradeBook();\\n\"\n + \" String courseName=\\\"Java \\\";\\n\"\n + \" myGradeBook.displayMessage(courseName);\\n\"\n + \" \\n\"\n + \" }\\n\"\n + \" }public class Foo {\\n\"\n + \" \\n\"\n + \" public boolean bar(){\\n\"\n + \" super.foo();\\n\"\n + \" return false;\\n\"\n + \" \\n\"\n + \" }\\n\"\n + \" }</pre>\");\n }",
"public abstract String describe(int depth);",
"TraceInstructionsView instructions();",
"static String frameToString(RecordedFrame frame, boolean lineNumbers) {\n StringBuilder builder = new StringBuilder();\n RecordedMethod method = frame.getMethod();\n RecordedClass clazz = method.getType();\n if (clazz == null) {\n builder.append(\"<<\");\n builder.append(frame.getType());\n builder.append(\">>\");\n } else {\n builder.append(clazz.getName());\n }\n builder.append(\"#\");\n builder.append(method.getName());\n builder.append(\"()\");\n if (lineNumbers) {\n builder.append(\":\");\n if (frame.getLineNumber() == -1) {\n builder.append(\"(\" + frame.getType() + \" code)\");\n } else {\n builder.append(frame.getLineNumber());\n }\n }\n return builder.toString();\n }",
"public void generate(){\n\t// Write constants/static vars section\n\twriteln(\".data\");\n\tfor ( String global : globalVars ) {\n\t // Initialized to zero. Why not?\n\t writeln(global+\":\\t.word 0\");\n\t}\n\twriteln(\"nl:\\t.asciiz \\\"\\\\n\\\"\");\n writeln(\"\\t.align\\t4\");\n\n\t// Write the prefix\n\twriteln(\".text\");\n\twriteln(\"entry:\");\n writeln(\"\\tjal main\");\n writeln(\"\\tli $v0, 10\");\n writeln(\"\\tsyscall\");\n\twriteln(\"printint:\");\n writeln(\"\\tli $v0, 1\");\n writeln(\"\\tsyscall\");\n writeln(\"\\tla $a0, nl\");\n writeln(\"\\tli $v0, 4\");\n writeln(\"\\tsyscall\");\n writeln(\"\\tjr $ra\");\n\n\tString defun = \"\";\t// Holds the place of the current function\n\tint spDisplacement=0;\t// Stores any displacement we do with $sp\n\n\tfor ( int i=0; i<codeTable.size(); i++ ) {\n\t CodeEntry line = codeTable.get(i);\n\n\t if ( line instanceof Label ) {\n\t\tLabel label = (Label)line;\n\t\twriteln( line.toString() );\n\t\tif ( label.isFunction() )\n\t\t makeFrame( defun = label.name() );\n\t }\n\t else if ( line instanceof Tuple ) {\n\t\tTuple tuple = (Tuple)line;\n\t\t// \n\t\t// Pushing arguments onto the stack (op = \"pusharg\"|\"pushaddr\")\n\t\t// \n\t\tif ( tuple.op.equals(\"pusharg\") || tuple.op.equals(\"pushaddr\") ) {\n\t\t ArrayList<Tuple> argLines = new ArrayList<Tuple>();\n\t\t ArrayList<String> lvOrAddr = new ArrayList<String>();\n\t\t while ( (tuple.op.equals(\"pusharg\") || tuple.op.equals(\"pushaddr\") )\n\t\t\t && i < codeTable.size() ) {\n\t\t\targLines.add( tuple );\n\t\t\tlvOrAddr.add( tuple.op );\n\t\t\tline = codeTable.get( ++i );\n\t\t\tif ( line instanceof Tuple )\n\t\t\t tuple = (Tuple)line;\n\t\t }\n\t\t // Move the stack pointer to accomodate args\n\t\t writeInst(\"subi\t$sp, $sp, \"+(4*argLines.size()));\n\t\t spDisplacement = 4;\n\t\t for ( int j=0; j < argLines.size(); j++ ) {\n\t\t\tTuple argLine = argLines.get(j);\n\t\t\tString theOp = lvOrAddr.get(j);\n\t\t\t// Pass a copy of the argument\n\t\t\tif ( theOp.equals(\"pusharg\") ) {\n\t\t\t if ( isNumber(argLine.place) )\n\t\t\t\twriteInst(\"li\t$t0, \"+argLine.place);\n\t\t\t else\n\t\t\t\twriteInst(\"lw\t$t0, \"+printOffset( defun, argLine.place ));\n\t\t\t}\n\t\t\t// Pass-by-reference\n\t\t\telse {\n\t\t\t writeInst(\"la\t$t0, \"+printOffset( defun, argLine.place));\n\t\t\t}\n\t\t\twriteInst(\"sw\t$t0, \"+spDisplacement+\"($sp)\");\n\t\t\tspDisplacement+=4;\n\t\t }\n\t\t spDisplacement-=4;\n\n\t\t // Reset counter, put back instruction we didn't use.\n\t\t i--;\n\t\t continue;\n\t\t}\n\t\t// \n\t\t// Calling a function\n\t\t// \n\t\telse if ( tuple.op.equals(\"jal\") ) {\n\t\t writeInst(\"jal\t\"+tuple.arg1);\n\t\t if ( ! tuple.place.equals(\"\") )\n\t\t\twriteInst(\"sw\t$v0, \"+printOffset( defun, tuple.place ));\n\t\t // Move back the $sp from all the \"pushargs\" we probably did\n\t\t if ( spDisplacement > 0 )\n\t\t\twriteInst(\"addi\t$sp, $sp, \"+spDisplacement);\n\t\t}\n\t\t//\n\t\t// Returning from a function (\"return\")\n\t\t//\n\t\telse if ( tuple.op.equals(\"return\") ) {\n\t\t if ( ! tuple.place.equals(\"\") ) {\n\t\t\twriteInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t\twriteInst(\"move\t$v0, $t0\");\n\t\t }\n\t\t writeInst(\"move\t$sp, $fp\");\n\t\t writeInst(\"lw\t$ra, -4($sp)\");\n\t\t writeInst(\"lw\t$fp, 0($fp)\");\n\t\t writeInst(\"jr\t$ra\");\n\t\t \n\t\t}\n\t\t//\n\t\t// Arithmetic operations requiring two registers for operands\n\t\t//\n\t\telse if ( tuple.op.equals(\"sub\") ||\n\t\t\t tuple.op.equals(\"mul\") ||\n\t\t\t tuple.op.equals(\"div\") ||\n\t\t\t tuple.op.equals(\"rem\") ) {\n\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t1, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t if ( tuple.op.equals(\"sub\") && isNumber(tuple.arg2) ) {\n\t\t\twriteInst(\"subi\t$t0, $t1, \"+tuple.arg2);\n\t\t }\n\t\t else {\n\t\t\tif ( isNumber(tuple.arg2) )\n\t\t\t writeInst(\"li\t$t2, \"+tuple.arg2);\n\t\t\telse\n\t\t\t writeInst(\"lw\t$t2, \"+printOffset( defun, tuple.arg2 ));\n\t\t\twriteInst(tuple.op+\"\\t$t0, $t1, $t2\");\n\t\t }\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t// \n\t\t// Arithmetic operations that have a separate 'immediate' function,\n\t\t// and where we can reduce # of instructions\n\t\t//\n\t\telse if ( tuple.op.equals(\"add\") ||\n\t\t\t tuple.op.equals(\"and\") ||\n\t\t\t tuple.op.equals(\"or\") ) {\n\t\t if ( isNumber(tuple.arg2) ) {\n\t\t\tif ( isNumber(tuple.arg1) )\n\t\t\t writeInst(\"li\t$t1, \"+tuple.arg1);\n\t\t\telse\n\t\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t\twriteInst(tuple.op+\"i\t$t0, $t1, \"+tuple.arg2);\n\t\t }\n\t\t else if ( isNumber(tuple.arg1) ) {\n\t\t\tif ( isNumber(tuple.arg2) )\n\t\t\t writeInst(\"li\t$t1, \"+tuple.arg2);\n\t\t\telse\n\t\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg2 ));\n\t\t\twriteInst(tuple.op+\"i\t$t0, $t1, \"+tuple.arg1);\n\t\t }\n\t\t else {\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t\twriteInst(\"lw\t$t2, \"+printOffset( defun, tuple.arg2 ));\n\t\t\twriteInst(tuple.op+\"\t$t0, $t1, $t2\");\n\t\t }\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Arithmetic operations requiring only one register for an operand\n\t\t// \n\t\telse if ( tuple.op.equals(\"not\") ||\n\t\t\t tuple.op.equals(\"neg\") ) {\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t1, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(tuple.op+\"\\t$t0, $t1\");\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Immediate arithmetic expressions\n\t\t//\n\t\telse if ( tuple.op.equals(\"addi\") ||\n\t\t\t tuple.op.equals(\"subi\") ) {\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(tuple.op+\"\\t$t0, $t1, \"+tuple.arg2);\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Assignment and other stuff that does '='\n\t\t//\n\t\telse if ( tuple.op.equals(\"copy\") ) {\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t0, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t0, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Loading arrays\n\t\t//\n\t\telse if ( tuple.op.equals(\"lw\") ) {\n\t\t // Find the location of the base address, put it in t0\n\t\t // writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.arg2 ));\n\n\t\t // The base address of the array gets loaded into $t0\n\t\t writeInst(\"la\t$t0, \"+printOffset( defun, tuple.arg2 ));\n\t\t // Add to it the precalculated address offset\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sub\t$t0, $t0, $t1\");\n\t\t // Store a[n] into a temp\n\t\t writeInst(\"lw\t$t0, 0($t0)\");\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Loading arrays that are passed by reference\n\t\t//\n\t\telse if ( tuple.op.equals(\"la\") ) {\n\t\t // The base address of the array gets loaded into $t0\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.arg2 ));\n\t\t // Add to it the precalculated address offset\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sub\t$t0, $t0, $t1\");\n\t\t // Store a[n] into a temp\n\t\t writeInst(\"lw\t$t0, 0($t0)\");\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Writing to arrays\n\t\t//\n\t\telse if ( tuple.op.equals(\"putarray\") || tuple.op.equals(\"putarrayref\") ) {\n\t\t // tuple.place = thing to be stored\n\t\t // tuple.arg1 = base address\n\t\t // tuple.arg2 = offset\n\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t if ( tuple.op.equals(\"putarray\") )\n\t\t\twriteInst(\"la\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"lw\t$t2, \"+printOffset( defun, tuple.arg2 ));\n\t\t writeInst(\"sub\t$t1, $t1, $t2\");\n\t\t writeInst(\"sw\t$t0, 0($t1)\");\n\t\t}\n\t\t//\n\t\t// Writing to pointers\n\t\t//\n\t\telse if ( tuple.op.equals(\"putpointer\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sw\t$t0, ($t1)\");\n\t\t}\n\t\t//\n\t\t// Performing conditional branches\n\t\t// \n\t\telse if ( tuple.op.equals(\"ble\") ||\n\t\t\t tuple.op.equals(\"bge\") ||\n\t\t\t tuple.op.equals(\"beq\") ||\n\t\t\t tuple.op.equals(\"bne\") ||\n\t\t\t tuple.op.equals(\"bgt\") ||\n\t\t\t tuple.op.equals(\"blt\") ||\n\t\t\t tuple.op.equals(\"beq\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t1, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(tuple.op+\"\\t$t0, $t1, \"+tuple.arg2);\n\t\t}\n\t\t//\n\t\t// Unconditional branch\n\t\t//\n\t\telse if ( tuple.op.equals(\"b\") ) {\n\t\t writeInst(\"b\t\"+tuple.place);\n\t\t}\n\t\t//\n\t\t// Branch equal to zero\n\t\t//\n\t\telse if ( tuple.op.equals(\"beqz\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t writeInst(\"beqz\t$t0, \"+tuple.arg1);\n\t\t}\n\t\t//\n\t\t// Dereferences\n\t\t//\n\t\telse if ( tuple.op.equals(\"deref\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"lw\t$t0, ($t1)\");\n\t\t}\n\t\t//\n\t\t// Address-of (&)\n\t\t//\n\t\telse if ( tuple.op.equals(\"addrof\") ) {\n\t\t writeInst(\"la\t$t0, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t }\n\t}\n\n }",
"public String getSourceLine (int line);",
"@Override\r\n\tpublic String toString() {\r\n\t\tString stackString = \"\";\r\n\t\tfor (T e: stack) {\r\n\t\t\tstackString = stackString +e;\r\n\t\t}\r\n\t\treturn stackString;\r\n}",
"public static void print_path(Stack<Node> st){\n for(int i=0;i<st.size();i++){\n System.out.print(st.elementAt(i).data+\" \");\n }\n }",
"public void display() {\n\n for (int i=top;i>=0;i--)\n {\n System.out.println(stack[i]);\n }\n }",
"private void appendStackTraceElement(StringBuilder builder, int indent, StackTraceElementProxy step, StackTraceElementProxy previousStep) {\n if (builder.length() > maxLength) {\n return;\n }\n indent(builder, indent);\n \n StackTraceElement stackTraceElement = step.getStackTraceElement();\n \n String fileName = stackTraceElement.getFileName();\n int lineNumber = stackTraceElement.getLineNumber();\n builder.append(\"at \")\n .append(abbreviator.abbreviate(stackTraceElement.getClassName()))\n .append(\".\")\n .append(stackTraceElement.getMethodName())\n .append(\"(\")\n .append(fileName == null ? \"Unknown Source\" : fileName);\n \n if (lineNumber >= 0) {\n builder.append(\":\")\n .append(lineNumber);\n }\n builder.append(\")\");\n \n if (shouldAppendPackagingData(step, previousStep)) {\n appendPackagingData(builder, step);\n }\n builder.append(CoreConstants.LINE_SEPARATOR);\n }",
"void dump_stacks(int count)\r\n{\r\nint i;\r\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\r\n for (i=0;i<count;i++)\r\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\r\n System.out.println(\"======================\");\r\n}",
"int getLineNumber();",
"static void printStack(Stack<Integer> s)\n\t{\n/*\t\tListIterator<Integer> lt = s.listIterator();\n\n\t\t// forwarding\n\t\twhile (lt.hasNext())\n\t\t\tlt.next();\n\n\t\t// printing from top to bottom\n\t\twhile (lt.hasPrevious())\n\t\t\tSystem.out.print(lt.previous() + \" \");*/\n\t\t\tSystem.out.println(s);\n\t}",
"@Override \n\tpublic String toString() {\n\t\t\n\t\tSystem.out.println(\"New Stack\");\n\t\t\n\t\tfor(int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.println(\"stack: \" + list[i].toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");// Print and empty new line\n\t\t\n\t\treturn \"\";\n\t}",
"static String extractScope(final String stackFrame) {\n int startIndex = getStartIndex(stackFrame);\n final int dotIndex = Math.max(startIndex, stackFrame.indexOf('.', startIndex + 1));\n int lparIndex = stackFrame.indexOf('(', dotIndex);\n final String clsMethodText = stackFrame.substring(dotIndex + 1, lparIndex != -1 ? lparIndex : stackFrame.length());\n int methodStart = clsMethodText.indexOf('/');\n\n return methodStart == -1 ? clsMethodText : clsMethodText.substring(methodStart + 1) + \": \" + clsMethodText.substring(0, methodStart);\n }",
"public void setStack(String stack);",
"@Override\n\tpublic void showContents() {\n\t\tprogram.add(Background);\n\t\tprogram.add(lvl1);\n\t\tprogram.add(lvl2);\n\t\tprogram.add(lvl3);\n\t\tprogram.add(Back);\n\n\t}",
"public String printToList() {\n\t\tif (hierarchy.equals(\"n\")) {\n\t\t\treturn \"<HTML>\" + visability + \" class \" + className\n\t\t\t\t\t+ \"{ <BR> <BR>\";\n\t\t} else if (isFinished == true) {\n\n\t\t\treturn \"}\";\n\t\t} else {\n\t\t\treturn \"<HTML>\" + visability + \" \" + hierarchy + \" class \"\n\t\t\t\t\t+ className + \"{ <BR> <BR>\";\n\t\t}\n\t}",
"public interface StackFrame {\n\t/**\n\t * Indicator for a Stack that grows negatively.\n\t */\n\tpublic final static int GROWS_NEGATIVE = -1;\n\t/**\n\t * Indicator for a Stack that grows positively.\n\t */\n\tpublic final static int GROWS_POSITIVE = 1;\n\t/**\n\t * Indicator for a unknown stack parameter offset\n\t */\n\tpublic static final int UNKNOWN_PARAM_OFFSET = (128 * 1024);\n\n\t/**\n\t * Get the function that this stack belongs to.\n\t * This could return null if the stack frame isn't part of a function.\n\t *\n\t * @return the function\n\t */\n\tpublic Function getFunction();\n\n\t/**\n\t * Get the size of this stack frame in bytes.\n\t *\n\t * @return stack frame size\n\t */\n\tpublic int getFrameSize();\n\n\t/**\n\t * Get the local portion of the stack frame in bytes.\n\t *\n\t * @return local frame size\n\t */\n\tpublic int getLocalSize();\n\n\t/**\n\t * Get the parameter portion of the stack frame in bytes.\n\t *\n\t * @return parameter frame size\n\t */\n\tpublic int getParameterSize();\n\n\t/**\n\t * Get the offset to the start of the parameters.\n\t *\n\t * @return offset\n\t */\n\tpublic int getParameterOffset();\n\n//\t/**\n//\t * Set the offset on the stack of the parameters.\n//\t *\n//\t * @param offset the start offset of parameters on the stack\n//\t */\n//\tpublic void setParameterOffset(int offset) throws InvalidInputException;\n\n\t/**\n\t * Returns true if specified offset could correspond to a parameter\n\t * @param offset\n\t */\n\tpublic boolean isParameterOffset(int offset);\n\n\t/**\n\t * Set the size of the local stack in bytes.\n\t *\n\t * @param size size of local stack\n\t */\n\tpublic void setLocalSize(int size);\n\n\t/**\n\t * Set the return address stack offset.\n\t * @param offset offset of return address.\n\t */\n\tpublic void setReturnAddressOffset(int offset);\n\n\t/**\n\t * Get the return address stack offset.\n\t *\n\t * @return return address offset.\n\t */\n\tpublic int getReturnAddressOffset();\n\n\t/**\n\t * Get the stack variable containing offset. This may fall in\n\t * the middle of a defined variable.\n\t *\n\t * @param offset offset of on stack to get variable.\n\t */\n\tpublic Variable getVariableContaining(int offset);\n\n\t/**\n\t * Create a stack variable. It could be a parameter or a local depending\n\t * on the direction of the stack.\n\t * <p><B>WARNING!</B> Use of this method to add parameters may force the function\n\t * to use custom variable storage. In addition, parameters may be appended even if the\n\t * current calling convention does not support them.\n\t * @throws DuplicateNameException if another variable(parameter or local) already\n\t * exists in the function with that name.\n\t * @throws InvalidInputException if data type is not a fixed length or variable name is invalid.\n\t * @throws VariableSizeException if data type size is too large based upon storage constraints.\n\t */\n\tpublic Variable createVariable(String name, int offset, DataType dataType, SourceType source)\n\t\t\tthrows DuplicateNameException, InvalidInputException;\n\n\t/**\n\t * Clear the stack variable defined at offset\n\t *\n\t * @param offset Offset onto the stack to be cleared.\n\t */\n\tpublic void clearVariable(int offset);\n\n\t/**\n\t * Get all defined stack variables.\n\t * Variables are returned from least offset (-) to greatest offset (+)\n\t *\n\t * @return an array of parameters.\n\t */\n\tpublic Variable[] getStackVariables();\n\n\t/**\n\t * Get all defined parameters as stack variables.\n\t *\n\t * @return an array of parameters.\n\t */\n\tpublic Variable[] getParameters();\n\n\t/**\n\t * Get all defined local variables.\n\t *\n\t * @return an array of all local variables\n\t */\n\tpublic Variable[] getLocals();\n\n\t/**\n\t * A stack that grows negative has local references negative and\n\t * parameter references positive. A positive growing stack has\n\t * positive locals and negative parameters.\n\t *\n\t * @return true if the stack grows in a negative direction.\n\t */\n\tpublic boolean growsNegative();\n}",
"public void addElement(ErStackTraceElement element){\n\n if (className == null){\n\n declaringClass = element.getDeclaringClass();\n if (declaringClass.contains(\".\")){\n className = declaringClass.substring(declaringClass.lastIndexOf(\".\")+1);\n packageName = declaringClass.substring(0,declaringClass.lastIndexOf(\".\"));\n }\n else{\n className = declaringClass;\n packageName = \"\";\n }\n\n fileName = element.getFileName();\n\n if (checkBasePackages(declaringClass)){\n isBasePackage = true;\n }\n }\n\n stackTraceElements.add(element);\n }",
"static void jstack() {\n\n }",
"public void showStack() {\n\n\t\t/*\n\t\t * Traverse the stack by starting at the top node and then get to the\n\t\t * next node by setting to current node \"pointer\" to the next node until\n\t\t * Null is reached.\n\t\t */\n\t\tNode<T> current = getTopNode();\n\n\t\tSystem.out.println(\"\\n---------------------\");\n\t\tSystem.out.println(\"STACK INFO\");\n\n\t\twhile (current != null) {\n\t\t\tSystem.out.println(\"Node Data: \" + current.data);\n\t\t\tcurrent = current.nextNode;\n\t\t}\n\n\t\tSystem.out.println(\"<< Stack Size: \" + getStackSize() + \" >>\");\n\t\tSystem.out.println(\"----------------------\");\n\n\t}",
"@Override\n public String codeGeneration() {\n StringBuilder localDeclarations = new StringBuilder();\n StringBuilder popLocalDeclarations = new StringBuilder();\n\n if (declarationsArrayList.size() > 0) {\n for (INode dec : declarationsArrayList) {\n localDeclarations.append(dec.codeGeneration());\n popLocalDeclarations.append(\"pop\\n\");\n }\n }\n\n //parametri in input da togliere dallo stack al termine del record di attivazione\n StringBuilder popInputParameters = new StringBuilder();\n for (int i = 0; i < parameterNodeArrayList.size(); i++) {\n popInputParameters.append(\"pop\\n\");\n }\n\n\n String funLabel = Label.nuovaLabelFunzioneString(idFunzione.toUpperCase());\n\n if (returnType instanceof VoidType) {\n // siccome il return è Void vengono rimosse le operazioni per restituire returnvalue\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n } else {\n //inserisco il codice della funzione in fondo al main, davanti alla label\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n \"srv\\n\" + //pop del return value\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lrv\\n\" + // push del risultato\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n }\n\n return \"push \" + funLabel + \"\\n\";\n }",
"public void printStack() {\n\t\tif (this.l.getHead() != null) {\n\t\t\tl.printList();\n\t\t} else {\n\t\t\tSystem.out.println(\"No element in stack\");\n\t\t}\n\t}",
"public int getStackDepth()\n/* */ {\n/* 139 */ StackTraceElement[] stes = new Exception().getStackTrace();\n/* 140 */ int len = stes.length;\n/* 141 */ for (int i = 0; i < len; i++) {\n/* 142 */ StackTraceElement ste = stes[i];\n/* 143 */ if (ste.getMethodName().equals(\"_runExecute\"))\n/* */ {\n/* 145 */ return i - 1;\n/* */ }\n/* */ }\n/* 148 */ throw new AssertionError(\"Expected task to be run by WorkerThread\");\n/* */ }",
"public void printStack(){\n\t\tswitch (type) {\n\t\tcase 's' : {\n\t\t\tSystem.out.print(\"[XX]\");\n\t\t}\n\t\tbreak;\n\t\tcase 'w' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\tcase 't' : {\n\t\t\tStack<Card> temp = new Stack<Card>();\n\t\t\tCard currentCard = null;\n\t\t\tString fullStack = \"\";\n\t\t\twhile(!this.isEmpty()){\n\t\t\t\ttemp.push(this.pop());\n\t\t\t}\n\t\t\twhile(!temp.isEmpty()){\n\t\t\t\tcurrentCard = temp.pop();\n\t\t\t\tfullStack += currentCard.isFaceUp() ? currentCard.toString() : \"[XX]\";\n\t\t\t\tthis.push(currentCard);\n\t\t\t}\n\t\t\tSystem.out.println(fullStack);\n\t\t}\n\t\tbreak;\n\t\tcase 'f' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\t}\n\t}",
"void dump_stacks(int count)\n {\n int i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n }",
"@Override\n\tpublic String indentedToString(int level) {\n\t\tStringBuilder build = new StringBuilder(indentation(level)).append(\"FUNCTION HEADER: \").append(name).append('\\n');\n\t\tfor (String arg : arguments) {\n\t\t\tbuild.append(indentation(level + 1)).append(arg).append('\\n');\n\t\t}\n\t\treturn build.toString();\n\t}",
"public void createCode(){\n\t\tsc = animationScript.newSourceCode(new Coordinates(10, 60), \"sourceCode\",\r\n\t\t\t\t\t\t null, AnimProps.SC_PROPS);\r\n\t\t \r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"1. Berechne für jede (aktive) Zeile und Spalte der Kostenmatrix\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" die Differenz aus dem kleinsten (blau) und zweit-kleinsten (lila)\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Element der entsprechenden Zeile/ Spalte.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"2. Wähle die Zeile oder Spalte (grün) aus bei der sich die größte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" Differenz (blau) ergab.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"3. Das kleinste Element der entsprechenden Spalte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" (bzw. Zeile) gibt nun die Stelle an, welche im\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Transporttableau berechnet wird (blau).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"4. Nun wird der kleinere Wert von Angebots- und\", null, 0, null); // 4\r\n\t\tsc.addCodeLine(\" Nachfragevektor im Tableau eingetragen.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"5. Anschließend wird der eingetragene Wert von den Rändern\", null, 0, null); // 5\r\n\t\tsc.addCodeLine(\" abgezogen (mindestens einer muss 0 werden). \", null, 0, null);\r\n\t\tsc.addCodeLine(\"6. Ist nun der Wert im Nachfragevektor Null so markiere\", null, 0, null); // 6\r\n\t\tsc.addCodeLine(\" die entsprechende Spalte in der Kostenmatrix. Diese\", null, 0, null);\r\n\t\tsc.addCodeLine(\" wird nun nicht mehr beachtet (rot). Ist der Wert des\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Angebotsvektors Null markiere die Zeile der Kostenmatrix.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"7. Der Algorithmus wird beendet, falls lediglich eine Zeile oder\", null, 0, null); // 8\r\n\t\tsc.addCodeLine(\" Spalte der Kostenmatrix unmarkiert ist (eines reicht aus).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"8 . Der entsprechenden Zeile bzw. Spalte im Transporttableau werden\", null, 0, null); // 9\t\t \r\n\t\tsc.addCodeLine(\" die restlichen Angebots- und Nachfragemengen zugeordnet.\", null, 0, null);\r\n\t\t\r\n\t}",
"@Override\r\npublic void Display(int depth) {\n\tSystem.out.println(\"-\"+depth);\r\n children.forEach(com->com.Display(depth+2));\r\n }",
"public void stack()\r\n\t{\r\n\t\tfor(Character c: stack)\r\n\t\t{\r\n\t\t\tSystem.out.println(c);\r\n\t\t}\r\n\t}",
"public void displayStack(){\n if(!empty()){\n System.out.println(\"\\n---Stack---\");\n \n int i= this.maxLength-1;\n ParsedToken[] ptCopy = new ParsedToken[this.maxLength];\n \n /* Display and copy depop values */\n while(!empty()){\n ptCopy[i] = pop();\n System.out.println(\"| \"+ptCopy[i]+\" |\");\n i--;\n }\n /* Recopy values into the original stack */\n while(i<this.maxLength-1){\n push(ptCopy[++i]);\n }\n }else{\n System.out.println(\"\\nEmpty Stack : Nothing to display\\n\");\n }\n }",
"public void showLineage() {\n\t\tfor (Iterator i = this.getLineage().iterator(); i.hasNext();) {\n\t\t\tprtln((String) i.next());\n\t\t}\n\t}",
"public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }",
"public static String getStackMessage(Throwable exception) {\n\t\tStringWriter sw = new StringWriter();\n\t\tPrintWriter pw = new PrintWriter(sw);\n\t\tpw.print(\" [ \");\n\t\tpw.print(exception.getClass().getName());\n\t\tpw.print(\" ] \");\n\t\texception.printStackTrace(pw);\n\t\treturn sw.toString();\n\t}",
"public void fireTraceEvent(ElemTemplateElement styleNode)\r\n {\r\n\r\n if (hasTraceListeners())\r\n {\r\n int sourceNode = m_transformer.getXPathContext().getCurrentNode();\r\n Node source = m_transformer.getXPathContext().getDTM(\r\n sourceNode).getNode(sourceNode);\r\n\r\n fireTraceEvent(new TracerEvent(m_transformer, source, \r\n m_transformer.getMode(), /*sourceNode, mode,*/\r\n styleNode));\r\n }\r\n }",
"public int getStackSize() {\n\t\treturn stackSize;\n\t}",
"public void printThreadStack(String threadName) {\n\t\tthis.toSlave.println(MasterProcessInterface.THREAD_STACK_COMMAND + ((threadName == null) ? \"\" : (\":\" + threadName)));\n\t}",
"public String toString()\n\t{\n\t\tString result = \"Highlighted region \"+getMinIndex()+\"-\"+getMaxIndex();\n\t\treturn result;\n\t}",
"@Override\r\n\tpublic void translateToAsm(PrintWriter writer, Memory stack) {\n\t\t\r\n\t}",
"public void visitLineDisplay( DevCat devCat ) {}",
"private void drawJavaString(JComponent frame) {\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\t// opens test.java\n\t\t\tbr = new BufferedReader(new FileReader(\"test.java\"));\n\t\t\t// variables to keep track of message\n\t\t\t//String message = \"<html>\";\n\t\t\tString message = \"\";\n\t\t\tString sCurrentLine;\n\t\t\t// loops through each line to read file\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\t\tmessage += sCurrentLine + \"\\r\";\n\t\t\t}\n\t\t\t//message += \"</html>\";\n\t\t\t// sets JTextPane codeLabel attributes\n\t\t\tcodeLabel.setContentType(\"text/plain\");\n\t\t\tcodeLabel.setText(message);\n\t\t\tcodeLabel.setOpaque(false);\n\t\t\tcodeLabel.setEditable(true);\n\t\t\tcodeLabel.setText(message);\n\t\t\tcodeLabel.setFont(new Font(\"Monospaced\", Font.PLAIN, 12));\n\t\t\tcodeLabel.setForeground(Color.MAGENTA);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public String toString()\n\t{\n\t\tString temp = \"\";\n\t\tfor (int i=0; i< lineCount; i++)\n\t\t{\n\t\t\ttemp += (i+1) + \": \" + codeLines[i] + \"\\n\";\n\t\t}\n\t\treturn temp;\n\t}",
"private void showStacksVisualization() {\n\t\tsetVisualization(new StackVisualization(rootComposite, controller, checklist));\n\t}",
"public String dump() {\n String result = \"\";\n Iterator stackIt = framePointers.iterator();\n int frameEnd;\n int old;\n int pos = 0;\n frameEnd = (int)stackIt.next();\n if(stackIt.hasNext()) {\n frameEnd = (int)stackIt.next();\n }\n else {\n frameEnd = -1;\n }\n while(pos < runStack.size()) {\n result += \"[\";\n if(frameEnd == -1) {\n while(pos < runStack.size()-1) {\n result += runStack.get(pos) + \",\";\n pos++;\n }\n result += runStack.get(pos)+\"] \";\n pos++;\n }\n else {\n while(pos < frameEnd-1) {\n result += runStack.get(pos) + \",\";\n pos++;\n }\n if(pos < frameEnd){\n result += runStack.get(pos);\n pos++;\n }\n result += \"]\";\n }\n if(stackIt.hasNext()) {\n frameEnd = (int)stackIt.next();\n }\n else {\n frameEnd = -1;\n }\n }\n return result;\n }",
"private static <N> void printHtml(TreeNode<N> node, String linePrefix, boolean isTail, StringBuffer buffer, ToString<N> toString){\r\n\t\t\r\n\t\tbuffer.append(linePrefix + (isTail ? \"|__\" : \"|__\") + ((toString != null) ? toString.toString(node.getData()) : node.getData().toString()) + \"<br>\");\r\n\t\t\r\n\t\tif(node.hasChildren()){\r\n\t\t\t\r\n\t\t\tList<TreeNode<N>> children = node.getChildren();\r\n\t\t\r\n\t\t\tfor(int i = 0; i < children.size() - 1; i++) {\r\n\t\t\t\tprintHtml(children.get(i), linePrefix + (isTail ? \" \" : \"| \"), false, buffer, toString);\r\n\t\t\t}\r\n\t\t\tif(node.getChildren().size() >= 1){\r\n\t\t\t\tprintHtml(children.get(children.size() - 1), linePrefix + (isTail ? \" \" : \"| \"), true, buffer, toString);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"void display() {\n\t\t\t\t\tSystem.out.println(\"display: outer_x = \" + outer_x);\n\t\t\t\t}",
"@Override\n\tpublic String toString() {\n\t\tString result = \"\";\n\t\t\n\t\tfor(int i = 0; i < top; i++) {\n\t\t\tresult = result + stack[i].toString() + \"\\n\";\t//shouldn't it start at max --> 0 since its a stack\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"@Override\n protected String getInitialSourceFragment(PythonParseTree.PythonParser.FuncdefContext function) {\n int startWithDecorators;\n RuleContext parent = function.getParent();\n if (parent instanceof PythonParseTree.PythonParser.Class_or_func_def_stmtContext) {\n startWithDecorators = ((PythonParseTree.PythonParser.Class_or_func_def_stmtContext) parent).getStart().getLine();\n } else {\n startWithDecorators = getNameLineNumber();\n }\n String source = getSourceFileContent() + \"\\n<EOF>\";\n // TODO remove trailing whitespace lines\n return Utl.getTextFragment(source, startWithDecorators, getEndLineNumber());\n }",
"public String toString()\n {\n return getIndentation();\n }",
"@Override\r\n \tpublic final String toStringAsNode(boolean printRangeInfo) {\r\n \t\tString str = toStringClassName();\r\n \t\t\r\n \t\tif(printRangeInfo) {\r\n \t\t\tif(hasNoSourceRangeInfo()) {\r\n \t\t\t\tstr += \" [?+?]\";\r\n \t\t\t} else {\r\n \t\t\t\tstr += \" [\"+ getStartPos() +\"+\"+ getLength() +\"]\";\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn str;\r\n \t}",
"LevelStacks() {\n stacks = new ArrayList<>();\n }",
"@Override\r\n public void visit(Print n, functionStruct fStruct) {\r\n String printObject = n.f2.f0.toString();\r\n addId(printObject, fStruct.functionName, fStruct.lineNumber);\r\n \r\n }",
"@Override\n public String visit(Label n) {\n // 注意进入这里的只会有开头的标识 Label\n // 屏蔽 Procedure/CJUMP/JUMP/SimpleExp\n String _ret = null;\n Global.outputString += n.f0.tokenImage + \":\";\n return _ret;\n }",
"void showNewLine(String lineNumber, String directionId);",
"public String toString()\r\n {\r\n String result = \"\";\r\n \r\n for (int index=0; index < top; index++) \r\n result = result + stack[index].toString() + \"\\n\";\r\n \r\n return result;\r\n }",
"public abstract String getLine(int lineNumber);",
"public void printXmlPath(StackTraceElement l) throws IOException {\n\t\t String packageNameOnly = l.getClassName().substring(0, l.getClassName().lastIndexOf(\".\"));\n\t\t String classNameOnly = l.getClassName().substring(1 + l.getClassName().lastIndexOf(\".\"), l.getClassName().length());\n\t\t String xml = \"<class name=\\\"\" + packageNameOnly + \".\" + classNameOnly + \"\\\"><methods><include name=\\\"\" + l.getMethodName() + \"\\\"/></methods></class>\";\n\t\t\t fileWriterPrinter(\" XML Path: \" + xml);\n\t\t\t// Renew XML record:\n\t\t\t fileCleaner(\"xml.path\");\n\t\t\t fileWriter( \"xml.path\", xml);\n\t\t\t// Renew Stack Trace Element record:\n\t\t\t fileCleaner(\"stack.trace\");\n\t\t\t fileWriter( \"stack.trace\", l);\n\t\t\t// Append a New Log record:\n\t\t\t if (fileExist(\"run.log\", false)) { fileWriter(\"run.log\", \" XML Path: \" + xml); } \n\t\t}",
"public static void functionCalled(String message) {\n if(enabled) {\n for (int i = 0; i < depth; i++)\n System.out.print(\"\\t\");\n System.out.println(message);\n depth++;\n }\n }"
] | [
"0.593778",
"0.5889678",
"0.58510095",
"0.5836553",
"0.57642716",
"0.5460565",
"0.5396189",
"0.5298072",
"0.52883404",
"0.5230773",
"0.52276593",
"0.52023876",
"0.5202015",
"0.5201541",
"0.5197426",
"0.5180079",
"0.5173743",
"0.5173743",
"0.51687795",
"0.51640356",
"0.5129331",
"0.51155037",
"0.5108137",
"0.51071554",
"0.5086559",
"0.5041721",
"0.50285155",
"0.5027173",
"0.50202686",
"0.49918115",
"0.49824944",
"0.4972211",
"0.49655858",
"0.49554205",
"0.49432296",
"0.4932852",
"0.4922775",
"0.4920343",
"0.4920343",
"0.4920343",
"0.4910343",
"0.49036375",
"0.49025443",
"0.48953044",
"0.48934668",
"0.48909083",
"0.48867297",
"0.48841333",
"0.48827448",
"0.48767534",
"0.48726714",
"0.4870049",
"0.48698345",
"0.48692992",
"0.48651776",
"0.48615593",
"0.48567006",
"0.484313",
"0.48413005",
"0.48371604",
"0.4835368",
"0.47906294",
"0.47885168",
"0.47825646",
"0.47820613",
"0.4758927",
"0.47586456",
"0.47403288",
"0.47348747",
"0.47279912",
"0.471627",
"0.47136325",
"0.47056842",
"0.47011527",
"0.4701132",
"0.4698323",
"0.46966878",
"0.46959728",
"0.46877223",
"0.46819597",
"0.46790904",
"0.46737427",
"0.46689856",
"0.4663144",
"0.46507627",
"0.46477968",
"0.46425915",
"0.46350318",
"0.46327952",
"0.4632781",
"0.46219364",
"0.46176362",
"0.46108937",
"0.4610331",
"0.46095258",
"0.46067217",
"0.46060076",
"0.4604441",
"0.46007282",
"0.45980334"
] | 0.56320226 | 5 |
Render stack element in Mozilla/Firefox style: | public void renderMozillaStyle(StringBuilder sb) {
if (functionName != null) {
sb.append(functionName).append("()");
}
sb.append('@').append(fileName);
if (lineNumber > -1) {
sb.append(':').append(lineNumber);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"RenderStack getRenderStack();",
"private void showStacksVisualization() {\n\t\tsetVisualization(new StackVisualization(rootComposite, controller, checklist));\n\t}",
"public String getStack();",
"public Figure drawFromStack()\n\t{\n\t\tif (this.on_stack.size() > 0)\n\t\t{\n\t\t Random r = new Random();\n\t\t Figure rf = this.on_stack.get(r.nextInt(this.on_stack.size()));\n\t\t this.on_stack.remove(rf);\n\t\t rf.setPlacement(Placement.ON_SHELF);\n\t\t return rf;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"void push(RtfCompoundObject state) {\r\n _top = new RtfCompoundObjectStackCell(_top, state);\r\n }",
"BrowserStack getBrowserStackInst();",
"public void display() {\n\n for (int i=top;i>=0;i--)\n {\n System.out.println(stack[i]);\n }\n }",
"@Override\r\n\tpublic String toString() {\r\n\t\tString stackString = \"\";\r\n\t\tfor (T e: stack) {\r\n\t\t\tstackString = stackString +e;\r\n\t\t}\r\n\t\treturn stackString;\r\n}",
"public void display() {\t\t\n\t\tparent.pushStyle();\n\t\t\n\t\t//parent.noStroke();\n\t\t//parent.fill(255);\n\t\tparent.noFill();\n\t\tparent.ellipse(pos.x, pos.y, diam, diam);\n\t\tnodeSpin.drawNode(pos.x, pos.y, diam);\n\t\t\n\t\t//This should match what happens in the hover animation\n\t\tif (focused && userId >= 0) {\n\t\t\tparent.fill(Sequencer.colors[userId]);\n\t\t\tparent.ellipse(pos.x, pos.y, diam, diam);\n\t\t}\n\t\t\n\t\trunAnimations();\n\t\t\n\t\tparent.popStyle();\n\t}",
"public View getGraphic()\n{\n // Get image for file\n //Image img = _type==FileType.PACKAGE_DIR? Package : ViewUtils.getFileIconImage(_file);\n Image img = ViewUtils.getFileIconImage(_file);\n View grf = new ImageView(img); grf.setPrefSize(18,18);\n \n // If error/warning add Error/Warning badge as composite icon\n /*BuildIssue.Kind status = _proj!=null? _proj.getRootProject().getBuildIssues().getBuildStatus(_file) : null;\n if(status!=null) {\n Image badge = status==BuildIssue.Kind.Error? ErrorBadge : WarningBadge;\n ImageView bview = new ImageView(badge); bview.setLean(Pos.BOTTOM_LEFT);\n StackView spane = new StackView(); spane.setChildren(grf, bview); grf = spane;\n }*/\n \n // Return node\n return grf;\n}",
"public void displayStack(){\n if(!empty()){\n System.out.println(\"\\n---Stack---\");\n \n int i= this.maxLength-1;\n ParsedToken[] ptCopy = new ParsedToken[this.maxLength];\n \n /* Display and copy depop values */\n while(!empty()){\n ptCopy[i] = pop();\n System.out.println(\"| \"+ptCopy[i]+\" |\");\n i--;\n }\n /* Recopy values into the original stack */\n while(i<this.maxLength-1){\n push(ptCopy[++i]);\n }\n }else{\n System.out.println(\"\\nEmpty Stack : Nothing to display\\n\");\n }\n }",
"void pop()\n\t\t{\n\t\t\tsp--;\n\t\t\tfor(int i = 0; i < sp; i++)\n\t\t\t\tXMLStream.print(\" \");\n\t\t\tif(sp < 0)\n\t\t\t\tDebug.e(\"RFO: XMLOut stack underflow.\");\n\t\t\tXMLStream.println(\"</\" + stack[sp] + \">\");\n\t\t}",
"static void printStack(Stack<Integer> s)\n\t{\n/*\t\tListIterator<Integer> lt = s.listIterator();\n\n\t\t// forwarding\n\t\twhile (lt.hasNext())\n\t\t\tlt.next();\n\n\t\t// printing from top to bottom\n\t\twhile (lt.hasPrevious())\n\t\t\tSystem.out.print(lt.previous() + \" \");*/\n\t\t\tSystem.out.println(s);\n\t}",
"public void printStack() {\n\t\tif (this.l.getHead() != null) {\n\t\t\tl.printList();\n\t\t} else {\n\t\t\tSystem.out.println(\"No element in stack\");\n\t\t}\n\t}",
"public String render() {\n return root.render(0, m_instanceBags);\n }",
"private IRenderingElement generateHighlightElement( IAtom atom ) {\n return null;\n }",
"@Override\n public String toString() {\n \tString retString = \"Stack[\";\n \tfor(int i = 0; i < stack.size() - 1; i++) // append elements up to the second to last onto the return string\n \t\tretString += stack.get(i) + \", \";\n \tif(stack.size() > 0)\n \t\tretString += stack.get(stack.size() - 1); // append final element with out a comma after it\n \tretString += \"]\";\n \treturn retString;\n }",
"private void render(Element element) {\n main.clear();\n Widget content = createElementWidget(element);\n main.add(content);\n }",
"@SubL(source = \"cycl/stacks.lisp\", position = 1818) \n public static final SubLObject create_stack() {\n return clear_stack(make_stack(UNPROVIDED));\n }",
"private Node createFrameHolder(Data<X,Y> dataItem){\n Node frameHolder = dataItem.getNode();\n if (frameHolder == null){\n frameHolder = new StackPane();\n dataItem.setNode(frameHolder);\n }\n frameHolder.getStyleClass().add(getStyleClass(dataItem.getExtraValue()));\n return frameHolder;\n }",
"public DefaultRenderStack(DefaultRenderStack prototype) {\n stack = new ArrayDeque<>(requireNonNull(prototype).stack);\n }",
"public String printCharStack() {\r\n\t\t String elements = \"<\";\r\n\t\t \r\n\t\tfor(int i = 0; i < count; i++) {\r\n\t\t\telements += \" \" + (char)array[i];\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\telements += \">\";\r\n\t\t\treturn elements;\r\n\t }",
"RtfCompoundObjectStack() {\r\n _top = null;\r\n }",
"@Override \n\tpublic String toString() {\n\t\t\n\t\tSystem.out.println(\"New Stack\");\n\t\t\n\t\tfor(int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.println(\"stack: \" + list[i].toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");// Print and empty new line\n\t\t\n\t\treturn \"\";\n\t}",
"public void printStack(){\n\t\tswitch (type) {\n\t\tcase 's' : {\n\t\t\tSystem.out.print(\"[XX]\");\n\t\t}\n\t\tbreak;\n\t\tcase 'w' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\tcase 't' : {\n\t\t\tStack<Card> temp = new Stack<Card>();\n\t\t\tCard currentCard = null;\n\t\t\tString fullStack = \"\";\n\t\t\twhile(!this.isEmpty()){\n\t\t\t\ttemp.push(this.pop());\n\t\t\t}\n\t\t\twhile(!temp.isEmpty()){\n\t\t\t\tcurrentCard = temp.pop();\n\t\t\t\tfullStack += currentCard.isFaceUp() ? currentCard.toString() : \"[XX]\";\n\t\t\t\tthis.push(currentCard);\n\t\t\t}\n\t\t\tSystem.out.println(fullStack);\n\t\t}\n\t\tbreak;\n\t\tcase 'f' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\t}\n\t}",
"public void MakeStacked() {\n\t\tStackedButton = new JButton(\n\t\t\t\t new ImageIcon(getClass().getResource(\n\t\t\t\t GetStackedAreaChartImage())));\n\t\tStackedButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tGetHost().instructionText.setVisible(false);\n\t\t\t\tGetHost().ExportEnabled();\n\t\t\t\t\n\t\t\t\tif(GetHost().GetTitle() == UNSET) {\n\t\t\t\t\tGetHost().LeftPanelContent(new StackedAreaChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\t\"Stacked Area Chart\", \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}else {\n\t\t\t\t\tGetHost().LeftPanelContent(new StackedAreaChart(\n\t\t\t\t\tGetHost().GetGraphData(), \n\t\t\t\t\tGetHost().GetTitle(), \n\t\t\t\t\tGetHost().GetColourScheme(),GetHost()));\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tChartTypeInterface.add(StackedButton);\n\t}",
"public void showStack() {\n\n\t\t/*\n\t\t * Traverse the stack by starting at the top node and then get to the\n\t\t * next node by setting to current node \"pointer\" to the next node until\n\t\t * Null is reached.\n\t\t */\n\t\tNode<T> current = getTopNode();\n\n\t\tSystem.out.println(\"\\n---------------------\");\n\t\tSystem.out.println(\"STACK INFO\");\n\n\t\twhile (current != null) {\n\t\t\tSystem.out.println(\"Node Data: \" + current.data);\n\t\t\tcurrent = current.nextNode;\n\t\t}\n\n\t\tSystem.out.println(\"<< Stack Size: \" + getStackSize() + \" >>\");\n\t\tSystem.out.println(\"----------------------\");\n\n\t}",
"private void renderNode(Node n) {\n root.getChildren().add(n);\n }",
"public void print(){\n for(int i = 0; i < numElements; i++){\n System.out.print(myCustomStack[i] + \" \");\n }\n }",
"public void stack()\r\n\t{\r\n\t\tfor(Character c: stack)\r\n\t\t{\r\n\t\t\tSystem.out.println(c);\r\n\t\t}\r\n\t}",
"static void dump(Stack stack) {\n String temp = \" stack = \";\n for (int i = stack.size() - 1; i >= 0; i--) {\n temp = temp + ((TreeNode) (stack.elementAt(i))).data + \" \";\n }\n System.out.println(temp);\n }",
"@Override\n\tpublic String toString() {\n\t\tString result = \"\";\n\t\t\n\t\tfor(int i = 0; i < top; i++) {\n\t\t\tresult = result + stack[i].toString() + \"\\n\";\t//shouldn't it start at max --> 0 since its a stack\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public static aan getStackMouseOver(int mx, int my) {\n/* */ try {\n/* 143 */ if (!NEIConfig.isEnabled() || NEIConfig.isHidden())\n/* */ {\n/* 145 */ return null;\n/* */ }\n/* */ \n/* 148 */ for (Widget widget : controlWidgets) {\n/* */ \n/* 150 */ aan stack = widget.getStackMouseOver(mx, my);\n/* 151 */ if (stack != null) {\n/* 152 */ return stack;\n/* */ }\n/* */ } \n/* 155 */ } catch (Exception exception) {\n/* */ \n/* 157 */ NEIUtils.reportException(exception);\n/* 158 */ NEIConfig.setEnabled(false);\n/* */ } \n/* 160 */ return null;\n/* */ }",
"public void addStackPane(HBox hb) {\n hb.setStyle(\"-fx-background-color: #363636\");\n StackPane stack = new StackPane();\n\n InnerShadow is = new InnerShadow();\n is.setOffsetX(1.0f);\n is.setOffsetY(1.0f);\n\n Text logoText = new Text();\n logoText.setEffect(is);\n\n logoText.setFill(Color.web(\"#202020\"));\n logoText.setText(\"Wally Save\");\n logoText.setFont(Font.loadFont(WallyHome.class.getResource(\"ConcertOne-Regular.ttf\").toExternalForm(), 50));\n\n\n stack.getChildren().add(logoText);\n stack.setAlignment(Pos.CENTER);\n // Add offset to right for question mark to compensate for RIGHT\n // alignment of all nodes\n\n\n hb.getChildren().add(stack);\n HBox.setHgrow(stack, Priority.ALWAYS);\n\n }",
"protected NamespaceStack createNamespaceStack() {\r\n // actually returns a XMLOutputter.NamespaceStack (see below)\r\n return new NamespaceStack();\r\n }",
"@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Fixed Stack\");\r\n\t\t\r\n\t}",
"private void renderItemStack(Optional<ItemStack> stack, int x, int y) {\n\t\tif (!stack.isPresent())\n\t\t\treturn;\n\t\tstack.get().renderInGui(x, y);\n\t}",
"@Override\n public int getRenderType()\n {\n return 22;\n }",
"public void printStack(Stack list){\n while(!list.isEmpty()){\n temp.push(list.peek());\n list.pop();\n }\n\n //printing temp and inserting items back to list\n while(!temp.isEmpty()){\n System.out.println(temp.peek()+\" \");\n list.push(temp.peek());\n temp.pop();\n }\n System.out.println();\n\n }",
"public PGraphics push() {\n\t\tPGraphics pg = papplet.createGraphics(papplet.width, papplet.height);\n\t\tpg.clear();\n\t\treturn push(pg);\n\t}",
"public static void printStacks(Thread currentThread) {\n\t\tStackTraceElement[] stackTrace = currentThread.getStackTrace();\n\t\t\n\t\tif (stackTrace.length == 0) {\n\t\t\tSystem.out.println(\"!!! No stacks available at the moment !!!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"=========================================================\");\n\t\tfor (int i= stackTrace.length-1; i >= 0; i--) {\n\t\t\tStackTraceElement stEle = stackTrace[i];\n\t\t\tSystem.out.println((stackTrace.length - i) + \". \" + stEle.toString());\n\t\t}\n\t\tSystem.out.println(\"=========================================================\\n\");\n\t}",
"public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }",
"public void display() \n {\n if (top == null) { \n System.out.printf(\"\\nStack Underflow\"); \n \n } \n else { \n Node temp = top; \n while (temp != null) { \n \n // print node data \n System.out.printf(\"%d->\", temp.data); \n \n // assign temp link to temp \n temp = temp.next; \n } \n } \n }",
"@Override\n protected Node newNode() {\n return new WebXStyleElementImpl();\n }",
"@Override\n\tpublic void showContents() {\n\t\tprogram.add(Background);\n\t\tprogram.add(lvl1);\n\t\tprogram.add(lvl2);\n\t\tprogram.add(lvl3);\n\t\tprogram.add(Back);\n\n\t}",
"protected StringBuilder visualize(int node, StringBuilder prefix, boolean isTail, StringBuilder sb) {\r\n\r\n\t\tint right = rightChildOf(node);\r\n\t\tint left = leftChildOf(node);\r\n\t\t\r\n\t if(right < size()) {\r\n\t visualize(right, new StringBuilder().append(prefix).append(isTail ? \"| \" : \" \"), false, sb);\r\n\t }\r\n\t sb.append(prefix).append(isTail ? \"\\\\—— \" : \"/—— \").append(array.get(node)).append(\"\\n\");\r\n\t if(left < size()) {\r\n\t visualize(left, new StringBuilder().append(prefix).append(isTail ? \" \" : \"| \"), true, sb);\r\n\t }\r\n\t return sb;\r\n\t}",
"public void display() \n {\n if (top == null) { \n System.out.printf(\"\\nStack Underflow\"); \n return; \n } \n else { \n Node temp = top; \n while (temp != null) { \n \n // print node data \n System.out.printf(\"%d<-\", temp.data); \n \n // assign temp link to temp \n temp = temp.next; \n } \n } \n }",
"public StackInterface Stack() { return mStack; }",
"public static void main(String[] args) throws Exception {\n\t\t// TODO Auto-generated method stub\n\t\tLinkedListAsStack stack = new LinkedListAsStack();\n\t\tstack.push(10);\n\t\tstack.push(20);\n\t\tstack.push(30);\n\t\tstack.push(40);\n\t\tstack.display();// 40 30 20 10-> act as a stack\n\t\tSystem.out.println(stack.size());// 4\n\t\tSystem.out.println(stack.isEmpty());// false\n\t\tSystem.out.println(stack.pop());// 40\n\t\tSystem.out.println(stack.top());// 30\n\t\tstack.display();// 30 20 10\n\t\tSystem.out.println(stack.size());// 3\n\t}",
"@Override\r\n\tpublic ItemStack getDisplayStack(World world, int x, int y, int z, int meta, TileEntity te) \r\n\t{\r\n\t\treturn null;\r\n\t}",
"public String toString()\r\n {\r\n String result = \"\";\r\n \r\n for (int index=0; index < top; index++) \r\n result = result + stack[index].toString() + \"\\n\";\r\n \r\n return result;\r\n }",
"public void printStack(){\n Stack<Integer> tempStack = new Stack<>();\n if (numStack.empty()==true){\n System.out.println(Integer.MIN_VALUE);\n }\n else{\n while (numStack.empty() == false){\n tempStack.push(numStack.peek());\n numStack.pop();\n }\n while (tempStack.empty() == false){\n int i = tempStack.peek();\n System.out.println(i);\n tempStack.pop();\n numStack.push(i);\n } \n }\n }",
"@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}",
"@Override\n\tpublic void render(Graphics g) {\n\t\t\n\t}",
"private void displayOutput() {\n\t\tlevel = 2;\n\t\t// Level 1 by default\n\t\ttreeBWLevel1.setIcon(new ImageIcon(ClassLoader.getSystemResource(\"image/treeBW.png\")));\n\t\tJLabel text = new JLabel(firstState.getName());\n\t\ttext.setFont(new Font(\"Serif\", Font.BOLD, 16));\n\t\ttext.setForeground(Color.white);\n\t\ttreeBWLevel1.add(text);\n\n\t\tfirstBlock.setTreeLabel(treeBWLevel1);\n\n\t\tline = new Line2D.Double(550, 975, 100, 200);\n\n\t\t// Since , NFA's are practically never ending, we have kept our\n\t\t// implementation upto 4 levels.\n\t\twhile (level != 5) {\n\t\t\tint parentTreeNo = 0;\n\t\t\tfor (StateBlockTreeNo block : previousBlock) {\n\t\t\t\tint currentLevelCounter = 0;\n\t\t\t\tint temp;\n\t\t\t\tHashMap<StateBlock, ArrayList<TransitionBlock>> list = block.getStateBlock().getStateTransitionList();\n\t\t\t\tfor (Map.Entry<StateBlock, ArrayList<TransitionBlock>> entry : list.entrySet()) {\n\t\t\t\t\tStateBlock key = entry.getKey();\n\t\t\t\t\tArrayList<TransitionBlock> value = entry.getValue();\n\t\t\t\t\tfor (TransitionBlock transitionBlock : value) {\n\n\t\t\t\t\t\tString stateName = \"\" + key.getName().toString();\n\t\t\t\t\t\tJLabel stateNo = new JLabel(stateName);\n\t\t\t\t\t\tstateNo.setFont(new Font(\"Serif\", Font.BOLD, 16));\n\t\t\t\t\t\tstateNo.setForeground(Color.white);\n\t\t\t\t\t\t++currentLevelCounter;\n\t\t\t\t\t\tStateBlockTreeNo stateBlockTreeNo = new StateBlockTreeNo();\n\t\t\t\t\t\tstateBlockTreeNo.setStateBlock(key);\n\t\t\t\t\t\tstateBlockTreeNo.setTreeNo(((block.getTreeNo() - 1) * 3) + currentLevelCounter);\n\t\t\t\t\t\tstateBlockTreeNo.setTreeLabel(labelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))));\n\t\t\t\t\t\tstateBlockTreeNo.setForestPosition(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo())));\n\n\t\t\t\t\t\tblock.getTreeConnectionList().put(stateBlockTreeNo, transitionBlock.getName());\n\n\t\t\t\t\t\tint x = labelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).getX();\n\t\t\t\t\t\tint y = labelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).getY();\n\t\t\t\t\t\tJLabel transitionLabel = new JLabel();\n\t\t\t\t\t\tlabelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).setLayout(new FlowLayout(FlowLayout.CENTER));\n\t\t\t\t\t\tlabelList.get(new Integer(Integer.toString(level) + Integer.toString(stateBlockTreeNo.getTreeNo()))).add(stateNo);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * if (level == 4) { transitionLabel.setBounds(x, y +\n\t\t\t\t\t\t * 40, 30, 30); transitionLabel.setIcon(new\n\t\t\t\t\t\t * ImageIcon(\"image/appleLevel4.png\"))); //\n\t\t\t\t\t\t * labelList.get(new Integer(Integer.toString(level) //\n\t\t\t\t\t\t * + //\n\t\t\t\t\t\t * Integer.toString(stateBlockTreeNo.getTreeNo()))).\n\t\t\t\t\t\t * setIcon(new // ImageIcon(\"image/treeLevel4.png\")));\n\t\t\t\t\t\t * transitionValue.setFont(new Font(\"Serif\", Font.BOLD,\n\t\t\t\t\t\t * 10)); fl.setVgap(10); } else {\n\t\t\t\t\t\t * transitionLabel.setBounds(x + 55, y, 40, 40);\n\t\t\t\t\t\t * transitionLabel.setIcon(new\n\t\t\t\t\t\t * ImageIcon(\"image/apple.png\")));\n\t\t\t\t\t\t * transitionValue.setFont(new Font(\"Serif\", Font.BOLD,\n\t\t\t\t\t\t * 16)); // labelList.get(new\n\t\t\t\t\t\t * Integer(Integer.toString(level) // + //\n\t\t\t\t\t\t * Integer.toString\n\t\t\t\t\t\t * (stateBlockTreeNo.getTreeNo()))).setIcon(new //\n\t\t\t\t\t\t * ImageIcon(\"image/tree.png\"))); fl.setVgap(15); }\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\tJLabel transitionValue = new JLabel();\n\t\t\t\t\t\ttransitionValue = appleLabels.get(Integer.parseInt(block.getTreeLabel().getName() + stateBlockTreeNo.getTreeLabel().getName()));\n\n\t\t\t\t\t\tSystem.out.println(Integer.parseInt(block.getTreeLabel().getName() + stateBlockTreeNo.getTreeLabel().getName()));\n\t\t\t\t\t\tString transitionText = transitionBlock.getName();\n\t\t\t\t\t\ttransitionValue.setFont(new Font(\"Serif\", Font.BOLD, 20));\n\t\t\t\t\t\ttransitionValue.setForeground(Color.WHITE);\n\t\t\t\t\t\ttransitionValue.setText(transitionText);\n\t\t\t\t\t\ttransitionValue.setHorizontalTextPosition(JLabel.CENTER);\n\t\t\t\t\t\ttransitionValue.setVerticalTextPosition(JLabel.CENTER);\n\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * JLabel transitionValue = new JLabel(transitionText);\n\t\t\t\t\t\t * transitionValue.setForeground(Color.white);\n\t\t\t\t\t\t * FlowLayout fl = new FlowLayout(FlowLayout.CENTER);\n\t\t\t\t\t\t * transitionLabel =\n\t\t\t\t\t\t * appleLabels.get(Integer.parseInt(block\n\t\t\t\t\t\t * .getTreeLabel().getName() +\n\t\t\t\t\t\t * stateBlockTreeNo.getTreeLabel().getName()));\n\t\t\t\t\t\t * transitionValue.setFont(new Font(\"Serif\", Font.BOLD,\n\t\t\t\t\t\t * 16)); transitionLabel.setLayout(fl);\n\t\t\t\t\t\t * transitionLabel.add(transitionValue);\n\t\t\t\t\t\t */\n\n\t\t\t\t\t\tactionPanel.add(transitionValue);\n\n\t\t\t\t\t\tcurrentBlock.add(stateBlockTreeNo);\n\t\t\t\t\t}\n\t\t\t\t\ttemp = currentLevelCounter / 3;\n\t\t\t\t\tcurrentLevelCounter = currentLevelCounter * (temp + 1);\n\t\t\t\t}\n\t\t\t\tparentTreeNo++;\n\t\t\t}\n\t\t\tlevel++;\n\t\t\tpreviousBlock = (ArrayList<StateBlockTreeNo>) currentBlock.clone();\n\t\t\tcurrentBlock.clear();\n\n\t\t}\n\n\t}",
"public String toString() {\r\n\t\tStringBuilder sb = new StringBuilder(\"(\");\r\n\t\tfor (int j = t; j >= 0; j--) {\r\n\t\t\tsb.append(stack[j]);\r\n\t\t\tif (j > 0)\r\n\t\t\t\tsb.append(\", \");\r\n\t\t}\r\n\t\tsb.append(\")\");\r\n\t\treturn sb.toString();\r\n\t}",
"@Override\n public int getRenderType()\n {\n return 31;\n }",
"@Override\r\n\tpublic void simpleRender(RenderManager rm) {\n\t}",
"private void insertNewInternalFrame(JInternalFrame treeDisplay) {\n jInternalFrameTree = treeDisplay;\n jLayeredPane1.add(jInternalFrameTree, JLayeredPane.PALETTE_LAYER);\n jInternalFrameTree.setMaximizable(true);\n jInternalFrameTree.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);\n jInternalFrameTree.setIconifiable(true);\n jInternalFrameTree.setClosable(true);\n jInternalFrameTree.setVisible(true);\n jInternalFrameTree.addMouseListener(new MouseAdapter(){\n public void mouseClicked(MouseEvent event){\n doMouseClicked(event);\n }\n\n private void doMouseClicked(MouseEvent event) {\n if(event.getButton() == MouseEvent.BUTTON3 && event.getComponent().getParent().getParent() instanceof JSplitPane){\n jInternalFrameTree = ((JInternalFrame)event.getComponent());\n JPopupMenu jPopupMenu = new JPopupMenu();\n JMenuItem jMenuItem = new JMenuItem(\"Window Preview\");\n jPopupMenu.add(jMenuItem);\n jMenuItem.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n setNewWindowEnabled(false);\n }\n\n private void setNewWindowEnabled(boolean b) {\n JFrame frame = new JFrame();\n JMenuBar jMenuBar = new JMenuBar();\n JMenu jMenu = new JMenu(\"Restore size\");\n jMenu.addMouseListener(new MouseAdapter() {\n public void mouseClicked(MouseEvent event){\n jMenuSelected(event);\n }\n\n private void jMenuSelected(MouseEvent event) {\n if(event.getComponent() instanceof JMenu){\n Container container = event.getComponent().getParent().getParent().getParent();\n jInternalFrameTree = new JInternalFrame(((JFrame)event.getComponent().getParent().getParent().getParent().getParent()).getTitle());\n jInternalFrameTree.setToolTipText(\"teste\");\n //jInternalFrameTree.add(null);\n insertNewInternalFrame(jInternalFrameTree);\n }\n }\n });\n jMenuBar.add(jMenu);\n frame.setJMenuBar(jMenuBar);\n frame.setTitle(jInternalFrameTree.getTitle());\n frame.add(jInternalFrameTree.getContentPane());\n try {\n jInternalFrameTree.setClosed(true);\n } catch (PropertyVetoException ex) {\n Logger.getLogger(Tool.class.getName()).log(Level.SEVERE, null, ex);\n }\n //jInternalFrameTree.dispose();\n //jInternalFrameTree = null;\n frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n frame.setSize(800, 800);\n frame.setVisible(true);\n }\n });\n jPopupMenu.show(event.getComponent(), event.getX(), event.getY());\n }\n }\n });\n }",
"public void display() {\n\t\ttree.resize(30,50);\n\t\tfor(int i = 650; i > 0; i -= 100) {\t\n\t\t\tt.image(tree,25,i);\n\t\t}\n\t\tfor(int i = 650; i > 0; i -= 100) {\t\n\t\t\tt.image(tree, 575, i);\n\t\t}\n\t}",
"@Override\n\tpublic void render() {\n\t\t\n\t}",
"private static <N> void printHtml(TreeNode<N> node, String linePrefix, boolean isTail, StringBuffer buffer, ToString<N> toString){\r\n\t\t\r\n\t\tbuffer.append(linePrefix + (isTail ? \"|__\" : \"|__\") + ((toString != null) ? toString.toString(node.getData()) : node.getData().toString()) + \"<br>\");\r\n\t\t\r\n\t\tif(node.hasChildren()){\r\n\t\t\t\r\n\t\t\tList<TreeNode<N>> children = node.getChildren();\r\n\t\t\r\n\t\t\tfor(int i = 0; i < children.size() - 1; i++) {\r\n\t\t\t\tprintHtml(children.get(i), linePrefix + (isTail ? \" \" : \"| \"), false, buffer, toString);\r\n\t\t\t}\r\n\t\t\tif(node.getChildren().size() >= 1){\r\n\t\t\t\tprintHtml(children.get(children.size() - 1), linePrefix + (isTail ? \" \" : \"| \"), true, buffer, toString);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"private List<ThroughNode> popStackStackForward() {\n List<ThroughNode> popped = nodeStackStack.peek();\n nodeStackStack.push(C.tail(popped));\n return popped;\n }",
"@Override\n public void render() { super.render(); }",
"@Override\n\tpublic void render () {\n\n\t}",
"protected NodeFigure createNodeFigure() {\r\n\t\tNodeFigure figure = createNodePlate();\r\n\t\tfigure.setLayoutManager(new StackLayout());\r\n\t\tIFigure shape = createNodeShape();\r\n\t\tfigure.add(shape);\r\n\t\tcontentPane = setupContentPane(shape);\r\n\t\treturn figure;\r\n\t}",
"protected NodeFigure createNodeFigure() {\n\t\tNodeFigure figure = createNodePlate();\n\t\tfigure.setLayoutManager(new StackLayout());\n\t\tIFigure shape = createNodeShape();\n\t\tfigure.add(shape);\n\t\tcontentPane = setupContentPane(shape);\n\t\treturn figure;\n\t}",
"public FreeMindWriter bubbleStyle() {\n if( ! tagOpen ) throw new IllegalStateException( \"Node start element is no longer open\" );\n \n out.print( \" STYLE='bubble'\" );\n return this; \n }",
"public void paint() {\n int L = 150; // Local convenience var\n\n // Declare three lines (left, middle, and right)\n Line left = new Line(L, L, L, getHeight() - L);\n Line middle = new Line(L, getHeight() / 2, getWidth() - L, getHeight() / 2);\n Line right = new Line(getWidth() - L, L, getWidth() - L, getHeight() - L);\n\n getChildren().clear(); // Clear the pane before redisplay\n\n displayHTree(order, left, middle, right); // Call the recursive method\n }",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"@Override\r\n\tpublic void render() {\n\t\t\r\n\t}",
"void dump_stacks(int count)\r\n{\r\nint i;\r\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\r\n for (i=0;i<count;i++)\r\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\r\n System.out.println(\"======================\");\r\n}",
"public static void renderHighlight(MatrixStack matrices, int x, int y, int width, int height) {\n RenderSystem.disableDepthTest();\n RenderSystem.colorMask(true, true, true, false);\n AbstractGui.fill(matrices, x, y, x + width, y + height, 0x80FFFFFF);\n RenderSystem.colorMask(true, true, true, true);\n RenderSystem.enableDepthTest();\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"void render(Graphics2D brush);",
"public void assignStackOrdering(SurfaceControl.Transaction t) {\n int layer;\n int layer2;\n SurfaceControl surfaceControl;\n SurfaceControl surfaceControl2;\n int HOME_STACK_STATE = 0;\n int layer3 = 0;\n int layerForAnimationLayer = 0;\n int layerForBoostedAnimationLayer = 0;\n int layerForHomeAnimationLayer = 0;\n boolean isInHwFreeFormAnimation = false;\n int layerForHwFreeFormAnimationLayer = 0;\n int layerForHwFreeFormAnimationImeLayer = 0;\n int layerForBoostedHwFreeFormAnimationLayer = 0;\n int state = 0;\n while (state <= 2) {\n int i = 0;\n while (i < this.mChildren.size()) {\n TaskStack s = (TaskStack) this.mChildren.get(i);\n boolean notFreeform = s.isAlwaysOnTop() && HwFreeFormUtils.isFreeFormEnable() && !s.inFreeformWindowingMode() && !s.inHwFreeFormWindowingMode();\n if ((state != 0 || s.isActivityTypeHome()) && ((state != 1 || (!s.isActivityTypeHome() && !notFreeform && !s.inHwFreeFormMoveBackState())) && (state != 2 || s.isAlwaysOnTop() || s.inHwFreeFormMoveBackState()))) {\n int layer4 = layer3 + 1;\n s.assignLayer(t, layer3);\n if ((s.inSplitScreenWindowingMode() || s.inHwSplitScreenWindowingMode() || s.inHwMagicWindowingMode()) && s.isVisible() && (surfaceControl2 = this.mSplitScreenDividerAnchor) != null) {\n t.setLayer(surfaceControl2, layer4);\n layer4++;\n }\n if (s.isTaskAnimating() || s.isAppAnimating()) {\n if (state != 2) {\n int layer5 = layer4 + 1;\n layerForAnimationLayer = layer4;\n layerForHwFreeFormAnimationLayer = layerForAnimationLayer;\n if (!s.inHwMagicWindowingMode() || !s.isVisible() || (surfaceControl = this.mSplitScreenDividerAnchor) == null) {\n layer4 = layer5;\n } else {\n t.setLayer(surfaceControl, layer5);\n layer4 = layer5 + 1;\n }\n } else if (s.inHwFreeFormWindowingMode() && s.isAlwaysOnTop()) {\n int layer6 = layer4 + 1;\n layerForHwFreeFormAnimationLayer = layer4;\n layer4 = layer6 + 1;\n layerForHwFreeFormAnimationImeLayer = layer6;\n isInHwFreeFormAnimation = true;\n }\n }\n if (s.inHwFreeFormWindowingMode() && s.getTopChild() != null && ((Task) s.getTopChild()).isHwFreeFormScaleAnimating()) {\n layerForAnimationLayer = layer4;\n layerForHwFreeFormAnimationLayer = layerForAnimationLayer;\n layer4++;\n }\n layer2 = 2;\n if (state != 2) {\n layer = layer4 + 1;\n layerForBoostedAnimationLayer = layer4;\n layerForBoostedHwFreeFormAnimationLayer = layerForBoostedAnimationLayer;\n } else if (!s.inHwFreeFormWindowingMode() || !s.isAlwaysOnTop()) {\n layer = layer4;\n } else {\n layer = layer4 + 1;\n layerForBoostedHwFreeFormAnimationLayer = layer4;\n }\n } else {\n layer = layer3;\n layer2 = 2;\n }\n i++;\n layer3 = layer;\n HOME_STACK_STATE = HOME_STACK_STATE;\n }\n if (state == 0) {\n layerForHomeAnimationLayer = layer3;\n layer3++;\n }\n state++;\n HOME_STACK_STATE = HOME_STACK_STATE;\n }\n SurfaceControl surfaceControl3 = this.mAppAnimationLayer;\n if (surfaceControl3 != null) {\n t.setLayer(surfaceControl3, layerForAnimationLayer);\n }\n SurfaceControl surfaceControl4 = this.mBoostedAppAnimationLayer;\n if (surfaceControl4 != null) {\n t.setLayer(surfaceControl4, layerForBoostedAnimationLayer);\n }\n SurfaceControl surfaceControl5 = this.mAppHwFreeFormAnimationLayer;\n if (surfaceControl5 != null) {\n t.setLayer(surfaceControl5, layerForHwFreeFormAnimationLayer);\n updateImeLayer(isInHwFreeFormAnimation, t, layerForHwFreeFormAnimationImeLayer);\n }\n SurfaceControl surfaceControl6 = this.mBoostedHwFreeFormAnimationLayer;\n if (surfaceControl6 != null) {\n t.setLayer(surfaceControl6, layerForBoostedHwFreeFormAnimationLayer);\n }\n SurfaceControl surfaceControl7 = this.mHomeAppAnimationLayer;\n if (surfaceControl7 != null) {\n t.setLayer(surfaceControl7, layerForHomeAnimationLayer);\n }\n }",
"protected void render() {\n\t\tString accion = Thread.currentThread().getStackTrace()[2].getMethodName();\n\t\trender(accion);\n\t}",
"private static void printStack(ArrayList<Box> listOfBoxes, int[] stackOrderArr, int[] max){\r\n int position = max[2];\r\n int i = 0;\r\n while(i != max[0]) {\r\n System.out.println(listOfBoxes.get(position));\r\n i += listOfBoxes.get(position).weight;\r\n position = stackOrderArr[position];\r\n }\r\n\r\n System.out.println(\"\\nHeaviest stack weight: \" + max[0]);\r\n System.out.println(\"Stack height: \" + max[1]);\r\n }",
"@Test\n\tpublic void testIsDisplayedHyperStack() {\n\t\tip = new ImagePlus();\n\t\tassertFalse(ip.isDisplayedHyperStack());\n\t}",
"@Override\n public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float delta) {\n }",
"public static void printStack(Stack<Integer> s) {\n\t\t// Creates a new stack\n\t\tStack<Integer> temp = new Stack<Integer>();\n\n\t\twhile (!s.isEmpty()) {\n\t\t\t// sets data to the num contained in the node that is being pop\n\t\t\tint data = s.pop();\n\n\t\t\t//Prints out the number\n\t\t\tSystem.out.println(data);\n\t\t\ttemp.push(data);\n\t\t}\n\n\t\t\t//resets s to its original list\n\t\twhile (!temp.isEmpty()) {\n\t\t\ts.push(temp.pop());\n\t\t}\n\n\t}",
"public static void main(String[] args) throws Exception {\n StackUsingArrays stack=new StackUsingArrays(5);\n \n for(int i=1;i<=5;i++) {\n \tstack.push(i*10);\n \tstack.display();\n }\n \n System.out.println(stack.size());\n \n //stack.push(60);\n System.out.println(stack.top());\n \n// while(!stack.isEmpty()) {\n// \tstack.display();\n// \tstack.pop();\n// \t\n// }\n// \n// stack.pop();\n\t}",
"public StackAnalysesView() {\n\t\tsuper(\"Stack Analyses\");\n\t\tinternalBrowser = new InternalBrowser(new DefaultShell());\n\t}",
"Character symbolStackWrite();",
"public Node renderCardBack(State.Hero h){\n this.belongsTo = h;\n Rectangle card = new Rectangle();\n card.setHeight(152);\n card.setWidth(106.4);\n ImagePattern p = new ImagePattern(new Image(\"vendor/assets/card_back.png\"));\n card.setFill(p);\n\n return card;\n }",
"public NotationStack() {\r\n\t\tstack = new ArrayList<T>(1000);\r\n\t\tsize = 1000;\r\n\t}",
"private void renderNode(Graphics g, Node n)\n {\n\tif (n.ancestor) {\n\t //setRenderColor(g,ancestorcolor);\n\t setRenderColor(g,n.path_color);\n\t}\n\trenderFilledCircle(g,n.x,n.y,n.diameter);\n\n\tsetRenderColor(g,Color.black);\n\trenderCircle(g,n.x,n.y,n.diameter);\n\tif (n.clickable)\n\t renderCircle(g,n.x,n.y,n.diameter+4);\n }",
"public void displayStacks(ArrayList<ArrayList<PositionInBoard>> listOfStacks){\n\n for(int i = 0; i< listOfStacks.size(); i++){\n stackPanels[i].removeAll();\n ArrayList<PositionInBoard> aStack = listOfStacks.get(i);\n\n for (PositionInBoard position : aStack){\n stackPanels[i].add(new JLabel(\"\" + position));\n }\n }\n }",
"private void createInnerNodePanel() {\n\t\tcreateLabel(getHierarchy().getName(), null, null);\n\t\taddGeneralInnerImages();\n\t}",
"public String toString(int stack) {\n\t\tString stkStr = \"\";\n\t\tint start = stack * stackSize;\n\t\tfor (int i = start; i < start + stackPointer[stack]; i++) {\n\t\t\tstkStr += buffer[i] + \" -> \";\n\t\t}\n\t\tstkStr += \"END\";\n\t\treturn stkStr;\n\t}",
"@Override\n protected void finalRender() {\n finishTraversalAnimation();\n placeTreeNodes();\n placeNodesAtDestination();\n render();\n\n }",
"private StackPane customButton(String name) {\n StackPane pane = new StackPane();\n Rectangle r = new Rectangle(100, 50, Color.TRANSPARENT);\n Text t = new Text(name);\n t.setTextAlignment(TextAlignment.CENTER);\n pane.getChildren().addAll(r, t);\n pane.setStyle(\"-fx-background-color: orange;\");\n return pane;\n }",
"protected NodeFigure createNodeFigure() {\n\t\tinitializeOperatorImplConnectorCount();\n\t\tNodeFigure figure = createNodePlate();\n\t\tfigure.setLayoutManager(new StackLayout());\n\t\tIFigure shape = createNodeShape();\n\t\tfigure.add(shape);\n\t\tcontentPane = setupContentPane(shape);\n\t\treturn figure;\n\t}",
"public StackPushSingle()\n {\n super(\"PushStackSingle\");\n }"
] | [
"0.66768885",
"0.56638044",
"0.5429503",
"0.52860457",
"0.52464586",
"0.5236459",
"0.52272433",
"0.52234507",
"0.5219946",
"0.5204097",
"0.51857346",
"0.5167329",
"0.5146465",
"0.51210654",
"0.5100976",
"0.5087614",
"0.50509953",
"0.5050048",
"0.50500005",
"0.5047742",
"0.50428224",
"0.5037319",
"0.5006813",
"0.50036687",
"0.50035405",
"0.49911886",
"0.49776322",
"0.49690357",
"0.49550512",
"0.49441308",
"0.49411613",
"0.49348927",
"0.49251905",
"0.49071342",
"0.49031174",
"0.49023858",
"0.49001184",
"0.48810393",
"0.48602998",
"0.48340967",
"0.48315677",
"0.48270673",
"0.48236814",
"0.4802838",
"0.47885126",
"0.4775267",
"0.4772827",
"0.4770862",
"0.47663352",
"0.4762626",
"0.47551623",
"0.4752952",
"0.47466385",
"0.47466385",
"0.47416985",
"0.47378322",
"0.47352004",
"0.47276112",
"0.47176507",
"0.47121042",
"0.47101364",
"0.47098365",
"0.47055823",
"0.470135",
"0.46969044",
"0.46954742",
"0.46921214",
"0.46895182",
"0.46885687",
"0.46872917",
"0.46872917",
"0.46872917",
"0.46727622",
"0.4669014",
"0.4668467",
"0.4665395",
"0.4665395",
"0.4665395",
"0.4665395",
"0.4665395",
"0.4665395",
"0.4665116",
"0.4664909",
"0.46613762",
"0.46612096",
"0.46573266",
"0.4654855",
"0.46482354",
"0.4644553",
"0.46410063",
"0.46401897",
"0.46387005",
"0.46378508",
"0.46356884",
"0.46277115",
"0.46266368",
"0.46253058",
"0.46232092",
"0.4619457",
"0.4618076",
"0.46176887"
] | 0.0 | -1 |
Render stack element in V8 style: at functionName (fileName:lineNumber:columnNumber) or: at fileName:lineNumber:columnNumber | public void renderV8Style(StringBuilder sb) {
sb.append(" at ");
if ((functionName == null) || "anonymous".equals(functionName) || "undefined".equals(functionName)) {
// Anonymous functions in V8 don't have names in the stack trace
appendV8Location(sb);
} else {
sb.append(functionName).append(" (");
appendV8Location(sb);
sb.append(')');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getStack();",
"private static String callMethodAndLine() {\n\t\tStackTraceElement thisMethodStack = (new Exception()).getStackTrace()[4];\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb\n.append(AT)\n\t\t\t\t.append(thisMethodStack.getClassName() + \".\")\n\t\t\t\t.append(thisMethodStack.getMethodName())\n\t\t\t\t.append(\"(\" + thisMethodStack.getFileName())\n\t\t\t\t.append(\":\" + thisMethodStack.getLineNumber() + \") \");\n\t\treturn sb.toString();\n\t}",
"Character symbolStackWrite();",
"public interface StackFrame {\n\t/**\n\t * Indicator for a Stack that grows negatively.\n\t */\n\tpublic final static int GROWS_NEGATIVE = -1;\n\t/**\n\t * Indicator for a Stack that grows positively.\n\t */\n\tpublic final static int GROWS_POSITIVE = 1;\n\t/**\n\t * Indicator for a unknown stack parameter offset\n\t */\n\tpublic static final int UNKNOWN_PARAM_OFFSET = (128 * 1024);\n\n\t/**\n\t * Get the function that this stack belongs to.\n\t * This could return null if the stack frame isn't part of a function.\n\t *\n\t * @return the function\n\t */\n\tpublic Function getFunction();\n\n\t/**\n\t * Get the size of this stack frame in bytes.\n\t *\n\t * @return stack frame size\n\t */\n\tpublic int getFrameSize();\n\n\t/**\n\t * Get the local portion of the stack frame in bytes.\n\t *\n\t * @return local frame size\n\t */\n\tpublic int getLocalSize();\n\n\t/**\n\t * Get the parameter portion of the stack frame in bytes.\n\t *\n\t * @return parameter frame size\n\t */\n\tpublic int getParameterSize();\n\n\t/**\n\t * Get the offset to the start of the parameters.\n\t *\n\t * @return offset\n\t */\n\tpublic int getParameterOffset();\n\n//\t/**\n//\t * Set the offset on the stack of the parameters.\n//\t *\n//\t * @param offset the start offset of parameters on the stack\n//\t */\n//\tpublic void setParameterOffset(int offset) throws InvalidInputException;\n\n\t/**\n\t * Returns true if specified offset could correspond to a parameter\n\t * @param offset\n\t */\n\tpublic boolean isParameterOffset(int offset);\n\n\t/**\n\t * Set the size of the local stack in bytes.\n\t *\n\t * @param size size of local stack\n\t */\n\tpublic void setLocalSize(int size);\n\n\t/**\n\t * Set the return address stack offset.\n\t * @param offset offset of return address.\n\t */\n\tpublic void setReturnAddressOffset(int offset);\n\n\t/**\n\t * Get the return address stack offset.\n\t *\n\t * @return return address offset.\n\t */\n\tpublic int getReturnAddressOffset();\n\n\t/**\n\t * Get the stack variable containing offset. This may fall in\n\t * the middle of a defined variable.\n\t *\n\t * @param offset offset of on stack to get variable.\n\t */\n\tpublic Variable getVariableContaining(int offset);\n\n\t/**\n\t * Create a stack variable. It could be a parameter or a local depending\n\t * on the direction of the stack.\n\t * <p><B>WARNING!</B> Use of this method to add parameters may force the function\n\t * to use custom variable storage. In addition, parameters may be appended even if the\n\t * current calling convention does not support them.\n\t * @throws DuplicateNameException if another variable(parameter or local) already\n\t * exists in the function with that name.\n\t * @throws InvalidInputException if data type is not a fixed length or variable name is invalid.\n\t * @throws VariableSizeException if data type size is too large based upon storage constraints.\n\t */\n\tpublic Variable createVariable(String name, int offset, DataType dataType, SourceType source)\n\t\t\tthrows DuplicateNameException, InvalidInputException;\n\n\t/**\n\t * Clear the stack variable defined at offset\n\t *\n\t * @param offset Offset onto the stack to be cleared.\n\t */\n\tpublic void clearVariable(int offset);\n\n\t/**\n\t * Get all defined stack variables.\n\t * Variables are returned from least offset (-) to greatest offset (+)\n\t *\n\t * @return an array of parameters.\n\t */\n\tpublic Variable[] getStackVariables();\n\n\t/**\n\t * Get all defined parameters as stack variables.\n\t *\n\t * @return an array of parameters.\n\t */\n\tpublic Variable[] getParameters();\n\n\t/**\n\t * Get all defined local variables.\n\t *\n\t * @return an array of all local variables\n\t */\n\tpublic Variable[] getLocals();\n\n\t/**\n\t * A stack that grows negative has local references negative and\n\t * parameter references positive. A positive growing stack has\n\t * positive locals and negative parameters.\n\t *\n\t * @return true if the stack grows in a negative direction.\n\t */\n\tpublic boolean growsNegative();\n}",
"public static String currentStack()\n {\n StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();\n StringBuilder sb = new StringBuilder(500);\n for (StackTraceElement ste : stackTrace)\n {\n sb.append(\" \").append(ste.getClassName()).append(\"#\").append(ste.getMethodName()).append(\":\").append(ste.getLineNumber()).append('\\n');\n }\n return sb.toString();\n }",
"public String toString(int stack) {\n\t\tString stkStr = \"\";\n\t\tint start = stack * stackSize;\n\t\tfor (int i = start; i < start + stackPointer[stack]; i++) {\n\t\t\tstkStr += buffer[i] + \" -> \";\n\t\t}\n\t\tstkStr += \"END\";\n\t\treturn stkStr;\n\t}",
"public String dump() {\n String result = \"\";\n Iterator stackIt = framePointers.iterator();\n int frameEnd;\n int old;\n int pos = 0;\n frameEnd = (int)stackIt.next();\n if(stackIt.hasNext()) {\n frameEnd = (int)stackIt.next();\n }\n else {\n frameEnd = -1;\n }\n while(pos < runStack.size()) {\n result += \"[\";\n if(frameEnd == -1) {\n while(pos < runStack.size()-1) {\n result += runStack.get(pos) + \",\";\n pos++;\n }\n result += runStack.get(pos)+\"] \";\n pos++;\n }\n else {\n while(pos < frameEnd-1) {\n result += runStack.get(pos) + \",\";\n pos++;\n }\n if(pos < frameEnd){\n result += runStack.get(pos);\n pos++;\n }\n result += \"]\";\n }\n if(stackIt.hasNext()) {\n frameEnd = (int)stackIt.next();\n }\n else {\n frameEnd = -1;\n }\n }\n return result;\n }",
"@Override\n public String codeGeneration() {\n StringBuilder localDeclarations = new StringBuilder();\n StringBuilder popLocalDeclarations = new StringBuilder();\n\n if (declarationsArrayList.size() > 0) {\n for (INode dec : declarationsArrayList) {\n localDeclarations.append(dec.codeGeneration());\n popLocalDeclarations.append(\"pop\\n\");\n }\n }\n\n //parametri in input da togliere dallo stack al termine del record di attivazione\n StringBuilder popInputParameters = new StringBuilder();\n for (int i = 0; i < parameterNodeArrayList.size(); i++) {\n popInputParameters.append(\"pop\\n\");\n }\n\n\n String funLabel = Label.nuovaLabelFunzioneString(idFunzione.toUpperCase());\n\n if (returnType instanceof VoidType) {\n // siccome il return è Void vengono rimosse le operazioni per restituire returnvalue\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n } else {\n //inserisco il codice della funzione in fondo al main, davanti alla label\n FunctionCode.insertFunctionsCode(funLabel + \":\\n\" +\n \"cfp\\n\" + //$fp diventa uguale al valore di $sp\n \"lra\\n\" + //push return address\n localDeclarations + //push dichiarazioni locali\n body.codeGeneration() +\n \"srv\\n\" + //pop del return value\n popLocalDeclarations +\n \"sra\\n\" + // pop del return address\n \"pop\\n\" + // pop dell'access link, per ritornare al vecchio livello di scope\n popInputParameters +\n \"sfp\\n\" + // $fp diventa uguale al valore del control link\n \"lrv\\n\" + // push del risultato\n \"lra\\n\" + // push del return address\n \"js\\n\" // jump al return address per continuare dall'istruzione dopo\n );\n }\n\n return \"push \" + funLabel + \"\\n\";\n }",
"RenderStack getRenderStack();",
"public void generate(){\n\t// Write constants/static vars section\n\twriteln(\".data\");\n\tfor ( String global : globalVars ) {\n\t // Initialized to zero. Why not?\n\t writeln(global+\":\\t.word 0\");\n\t}\n\twriteln(\"nl:\\t.asciiz \\\"\\\\n\\\"\");\n writeln(\"\\t.align\\t4\");\n\n\t// Write the prefix\n\twriteln(\".text\");\n\twriteln(\"entry:\");\n writeln(\"\\tjal main\");\n writeln(\"\\tli $v0, 10\");\n writeln(\"\\tsyscall\");\n\twriteln(\"printint:\");\n writeln(\"\\tli $v0, 1\");\n writeln(\"\\tsyscall\");\n writeln(\"\\tla $a0, nl\");\n writeln(\"\\tli $v0, 4\");\n writeln(\"\\tsyscall\");\n writeln(\"\\tjr $ra\");\n\n\tString defun = \"\";\t// Holds the place of the current function\n\tint spDisplacement=0;\t// Stores any displacement we do with $sp\n\n\tfor ( int i=0; i<codeTable.size(); i++ ) {\n\t CodeEntry line = codeTable.get(i);\n\n\t if ( line instanceof Label ) {\n\t\tLabel label = (Label)line;\n\t\twriteln( line.toString() );\n\t\tif ( label.isFunction() )\n\t\t makeFrame( defun = label.name() );\n\t }\n\t else if ( line instanceof Tuple ) {\n\t\tTuple tuple = (Tuple)line;\n\t\t// \n\t\t// Pushing arguments onto the stack (op = \"pusharg\"|\"pushaddr\")\n\t\t// \n\t\tif ( tuple.op.equals(\"pusharg\") || tuple.op.equals(\"pushaddr\") ) {\n\t\t ArrayList<Tuple> argLines = new ArrayList<Tuple>();\n\t\t ArrayList<String> lvOrAddr = new ArrayList<String>();\n\t\t while ( (tuple.op.equals(\"pusharg\") || tuple.op.equals(\"pushaddr\") )\n\t\t\t && i < codeTable.size() ) {\n\t\t\targLines.add( tuple );\n\t\t\tlvOrAddr.add( tuple.op );\n\t\t\tline = codeTable.get( ++i );\n\t\t\tif ( line instanceof Tuple )\n\t\t\t tuple = (Tuple)line;\n\t\t }\n\t\t // Move the stack pointer to accomodate args\n\t\t writeInst(\"subi\t$sp, $sp, \"+(4*argLines.size()));\n\t\t spDisplacement = 4;\n\t\t for ( int j=0; j < argLines.size(); j++ ) {\n\t\t\tTuple argLine = argLines.get(j);\n\t\t\tString theOp = lvOrAddr.get(j);\n\t\t\t// Pass a copy of the argument\n\t\t\tif ( theOp.equals(\"pusharg\") ) {\n\t\t\t if ( isNumber(argLine.place) )\n\t\t\t\twriteInst(\"li\t$t0, \"+argLine.place);\n\t\t\t else\n\t\t\t\twriteInst(\"lw\t$t0, \"+printOffset( defun, argLine.place ));\n\t\t\t}\n\t\t\t// Pass-by-reference\n\t\t\telse {\n\t\t\t writeInst(\"la\t$t0, \"+printOffset( defun, argLine.place));\n\t\t\t}\n\t\t\twriteInst(\"sw\t$t0, \"+spDisplacement+\"($sp)\");\n\t\t\tspDisplacement+=4;\n\t\t }\n\t\t spDisplacement-=4;\n\n\t\t // Reset counter, put back instruction we didn't use.\n\t\t i--;\n\t\t continue;\n\t\t}\n\t\t// \n\t\t// Calling a function\n\t\t// \n\t\telse if ( tuple.op.equals(\"jal\") ) {\n\t\t writeInst(\"jal\t\"+tuple.arg1);\n\t\t if ( ! tuple.place.equals(\"\") )\n\t\t\twriteInst(\"sw\t$v0, \"+printOffset( defun, tuple.place ));\n\t\t // Move back the $sp from all the \"pushargs\" we probably did\n\t\t if ( spDisplacement > 0 )\n\t\t\twriteInst(\"addi\t$sp, $sp, \"+spDisplacement);\n\t\t}\n\t\t//\n\t\t// Returning from a function (\"return\")\n\t\t//\n\t\telse if ( tuple.op.equals(\"return\") ) {\n\t\t if ( ! tuple.place.equals(\"\") ) {\n\t\t\twriteInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t\twriteInst(\"move\t$v0, $t0\");\n\t\t }\n\t\t writeInst(\"move\t$sp, $fp\");\n\t\t writeInst(\"lw\t$ra, -4($sp)\");\n\t\t writeInst(\"lw\t$fp, 0($fp)\");\n\t\t writeInst(\"jr\t$ra\");\n\t\t \n\t\t}\n\t\t//\n\t\t// Arithmetic operations requiring two registers for operands\n\t\t//\n\t\telse if ( tuple.op.equals(\"sub\") ||\n\t\t\t tuple.op.equals(\"mul\") ||\n\t\t\t tuple.op.equals(\"div\") ||\n\t\t\t tuple.op.equals(\"rem\") ) {\n\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t1, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t if ( tuple.op.equals(\"sub\") && isNumber(tuple.arg2) ) {\n\t\t\twriteInst(\"subi\t$t0, $t1, \"+tuple.arg2);\n\t\t }\n\t\t else {\n\t\t\tif ( isNumber(tuple.arg2) )\n\t\t\t writeInst(\"li\t$t2, \"+tuple.arg2);\n\t\t\telse\n\t\t\t writeInst(\"lw\t$t2, \"+printOffset( defun, tuple.arg2 ));\n\t\t\twriteInst(tuple.op+\"\\t$t0, $t1, $t2\");\n\t\t }\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t// \n\t\t// Arithmetic operations that have a separate 'immediate' function,\n\t\t// and where we can reduce # of instructions\n\t\t//\n\t\telse if ( tuple.op.equals(\"add\") ||\n\t\t\t tuple.op.equals(\"and\") ||\n\t\t\t tuple.op.equals(\"or\") ) {\n\t\t if ( isNumber(tuple.arg2) ) {\n\t\t\tif ( isNumber(tuple.arg1) )\n\t\t\t writeInst(\"li\t$t1, \"+tuple.arg1);\n\t\t\telse\n\t\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t\twriteInst(tuple.op+\"i\t$t0, $t1, \"+tuple.arg2);\n\t\t }\n\t\t else if ( isNumber(tuple.arg1) ) {\n\t\t\tif ( isNumber(tuple.arg2) )\n\t\t\t writeInst(\"li\t$t1, \"+tuple.arg2);\n\t\t\telse\n\t\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg2 ));\n\t\t\twriteInst(tuple.op+\"i\t$t0, $t1, \"+tuple.arg1);\n\t\t }\n\t\t else {\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t\twriteInst(\"lw\t$t2, \"+printOffset( defun, tuple.arg2 ));\n\t\t\twriteInst(tuple.op+\"\t$t0, $t1, $t2\");\n\t\t }\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Arithmetic operations requiring only one register for an operand\n\t\t// \n\t\telse if ( tuple.op.equals(\"not\") ||\n\t\t\t tuple.op.equals(\"neg\") ) {\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t1, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(tuple.op+\"\\t$t0, $t1\");\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Immediate arithmetic expressions\n\t\t//\n\t\telse if ( tuple.op.equals(\"addi\") ||\n\t\t\t tuple.op.equals(\"subi\") ) {\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(tuple.op+\"\\t$t0, $t1, \"+tuple.arg2);\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Assignment and other stuff that does '='\n\t\t//\n\t\telse if ( tuple.op.equals(\"copy\") ) {\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t0, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t0, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Loading arrays\n\t\t//\n\t\telse if ( tuple.op.equals(\"lw\") ) {\n\t\t // Find the location of the base address, put it in t0\n\t\t // writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.arg2 ));\n\n\t\t // The base address of the array gets loaded into $t0\n\t\t writeInst(\"la\t$t0, \"+printOffset( defun, tuple.arg2 ));\n\t\t // Add to it the precalculated address offset\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sub\t$t0, $t0, $t1\");\n\t\t // Store a[n] into a temp\n\t\t writeInst(\"lw\t$t0, 0($t0)\");\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Loading arrays that are passed by reference\n\t\t//\n\t\telse if ( tuple.op.equals(\"la\") ) {\n\t\t // The base address of the array gets loaded into $t0\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.arg2 ));\n\t\t // Add to it the precalculated address offset\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sub\t$t0, $t0, $t1\");\n\t\t // Store a[n] into a temp\n\t\t writeInst(\"lw\t$t0, 0($t0)\");\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t\t//\n\t\t// Writing to arrays\n\t\t//\n\t\telse if ( tuple.op.equals(\"putarray\") || tuple.op.equals(\"putarrayref\") ) {\n\t\t // tuple.place = thing to be stored\n\t\t // tuple.arg1 = base address\n\t\t // tuple.arg2 = offset\n\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t if ( tuple.op.equals(\"putarray\") )\n\t\t\twriteInst(\"la\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"lw\t$t2, \"+printOffset( defun, tuple.arg2 ));\n\t\t writeInst(\"sub\t$t1, $t1, $t2\");\n\t\t writeInst(\"sw\t$t0, 0($t1)\");\n\t\t}\n\t\t//\n\t\t// Writing to pointers\n\t\t//\n\t\telse if ( tuple.op.equals(\"putpointer\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sw\t$t0, ($t1)\");\n\t\t}\n\t\t//\n\t\t// Performing conditional branches\n\t\t// \n\t\telse if ( tuple.op.equals(\"ble\") ||\n\t\t\t tuple.op.equals(\"bge\") ||\n\t\t\t tuple.op.equals(\"beq\") ||\n\t\t\t tuple.op.equals(\"bne\") ||\n\t\t\t tuple.op.equals(\"bgt\") ||\n\t\t\t tuple.op.equals(\"blt\") ||\n\t\t\t tuple.op.equals(\"beq\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t if ( isNumber(tuple.arg1) )\n\t\t\twriteInst(\"li\t$t1, \"+tuple.arg1);\n\t\t else\n\t\t\twriteInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(tuple.op+\"\\t$t0, $t1, \"+tuple.arg2);\n\t\t}\n\t\t//\n\t\t// Unconditional branch\n\t\t//\n\t\telse if ( tuple.op.equals(\"b\") ) {\n\t\t writeInst(\"b\t\"+tuple.place);\n\t\t}\n\t\t//\n\t\t// Branch equal to zero\n\t\t//\n\t\telse if ( tuple.op.equals(\"beqz\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t writeInst(\"beqz\t$t0, \"+tuple.arg1);\n\t\t}\n\t\t//\n\t\t// Dereferences\n\t\t//\n\t\telse if ( tuple.op.equals(\"deref\") ) {\n\t\t writeInst(\"lw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t writeInst(\"lw\t$t1, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"lw\t$t0, ($t1)\");\n\t\t}\n\t\t//\n\t\t// Address-of (&)\n\t\t//\n\t\telse if ( tuple.op.equals(\"addrof\") ) {\n\t\t writeInst(\"la\t$t0, \"+printOffset( defun, tuple.arg1 ));\n\t\t writeInst(\"sw\t$t0, \"+printOffset( defun, tuple.place ));\n\t\t}\n\t }\n\t}\n\n }",
"static String frameToString(RecordedFrame frame, boolean lineNumbers) {\n StringBuilder builder = new StringBuilder();\n RecordedMethod method = frame.getMethod();\n RecordedClass clazz = method.getType();\n if (clazz == null) {\n builder.append(\"<<\");\n builder.append(frame.getType());\n builder.append(\">>\");\n } else {\n builder.append(clazz.getName());\n }\n builder.append(\"#\");\n builder.append(method.getName());\n builder.append(\"()\");\n if (lineNumbers) {\n builder.append(\":\");\n if (frame.getLineNumber() == -1) {\n builder.append(\"(\" + frame.getType() + \" code)\");\n } else {\n builder.append(frame.getLineNumber());\n }\n }\n return builder.toString();\n }",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"void dump_stacks(int count)\n{\nint i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n}",
"private String printStackTrace() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }",
"void dump_stacks(int count)\r\n{\r\nint i;\r\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\r\n for (i=0;i<count;i++)\r\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\r\n System.out.println(\"======================\");\r\n}",
"public static void printStacks(Thread currentThread) {\n\t\tStackTraceElement[] stackTrace = currentThread.getStackTrace();\n\t\t\n\t\tif (stackTrace.length == 0) {\n\t\t\tSystem.out.println(\"!!! No stacks available at the moment !!!\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"=========================================================\");\n\t\tfor (int i= stackTrace.length-1; i >= 0; i--) {\n\t\t\tStackTraceElement stEle = stackTrace[i];\n\t\t\tSystem.out.println((stackTrace.length - i) + \". \" + stEle.toString());\n\t\t}\n\t\tSystem.out.println(\"=========================================================\\n\");\n\t}",
"void printStackTrace(PrintWriter writer);",
"static void jstack() {\n\n }",
"public static final SubLObject setup_stacks_file() {\n Structures.register_method(print_high.$print_object_method_table$.getGlobalValue(), $dtp_stack$.getGlobalValue(), Symbols.symbol_function($sym7$STACK_PRINT_FUNCTION_TRAMPOLINE));\n Structures.def_csetf($sym8$STACK_STRUC_NUM, $sym9$_CSETF_STACK_STRUC_NUM);\n Structures.def_csetf($sym10$STACK_STRUC_ELEMENTS, $sym11$_CSETF_STACK_STRUC_ELEMENTS);\n Equality.identity($sym0$STACK);\n access_macros.register_macro_helper($sym24$DO_STACK_ELEMENTS_STACK_ELEMENTS, $sym25$DO_STACK_ELEMENTS);\n Structures.register_method(print_high.$print_object_method_table$.getGlobalValue(), $dtp_locked_stack$.getGlobalValue(), Symbols.symbol_function($sym36$LOCKED_STACK_PRINT_FUNCTION_TRAMPOLINE));\n Structures.def_csetf($sym37$LOCKED_STACK_STRUC_LOCK, $sym38$_CSETF_LOCKED_STACK_STRUC_LOCK);\n Structures.def_csetf($sym39$LOCKED_STACK_STRUC_STACK, $sym40$_CSETF_LOCKED_STACK_STRUC_STACK);\n Equality.identity($sym29$LOCKED_STACK);\n return NIL;\n }",
"@Override\r\n\tpublic String toString() {\r\n\t\tString stackString = \"\";\r\n\t\tfor (T e: stack) {\r\n\t\t\tstackString = stackString +e;\r\n\t\t}\r\n\t\treturn stackString;\r\n}",
"@Override\r\n\tpublic void translateToAsm(PrintWriter writer, Memory stack) {\n\t\t\r\n\t}",
"public String toString ()\n {\n return \"function:\" + _vname;\n }",
"public interface StackTrace {\r\n\r\n\t /**\r\n\t * Gets the class from which the stack is tracking.\r\n\t * \r\n\t * @return\t\t\tThe name of the class\r\n\t */\r\n public String getClazz();\r\n\r\n /**\r\n * Sets the class from which the stack should tracking.\r\n * \r\n * @param clazz\tThe name of the class\r\n */\r\n public void setClazz(String clazz);\r\n\r\n /**\r\n * Gets the current message from the StackTrace.\r\n * \r\n * @return\t\t\tThe message\r\n */\r\n public String getMessage();\r\n\r\n /**\r\n * Sets a message to the StackTrace.\r\n * \r\n * @param message\tThe message\r\n */\r\n public void setMessage(String message);\r\n\r\n /**\r\n * Gets the current stack.\r\n * \r\n * @return\t\t\tThe current stack\r\n */\r\n public String getStack();\r\n\r\n /**\r\n * Sets the current stack.\r\n * \r\n * @param stack\tThe new stack\r\n */\r\n public void setStack(String stack);\r\n}",
"TraceInstructionsView instructions();",
"public Vector getStackTrace() {\r\n final Vector result = new Vector();\r\n\r\n for (int s = ((this.sp + 1) & 0xff) | 0x100; s > 0x100 && s < 0x1ff; s += 2) {\r\n final int adr = (this.memory[s] & 0xff) + (this.memory[s + 1] & 0xff) * 256;\r\n\r\n if (adr == 0) {\r\n break;\r\n }\r\n\r\n result.addElement(new Integer((adr - 2) & 0xffff));\r\n }\r\n\r\n return result;\r\n }",
"private static String[] traceAll(StackTraceElement[] stackTraceElements, int depth) {\n if (null == stackTraceElements) {\n return null;\n }\n if ((null != stackTraceElements) && (stackTraceElements.length >= depth)) {\n StackTraceElement source = stackTraceElements[depth];\n StackTraceElement caller = (stackTraceElements.length > (depth + 1))\n ? stackTraceElements[depth + 1]\n : ((stackTraceElements.length > depth) ? stackTraceElements[depth] : stackTraceElements[stackTraceElements.length - 1]);\n if (null != source) {\n if (null != caller) {\n String[] out = new String[8];\n out[0] = source.getFileName();\n out[1] = source.getMethodName();\n out[2] = Integer.toString(source.getLineNumber());\n out[3] = source.getClassName().substring(source.getClassName().lastIndexOf('.') + 1);\n out[4] = caller.getFileName();\n out[5] = caller.getMethodName();\n out[6] = Integer.toString(caller.getLineNumber());\n out[7] = caller.getClassName().substring(caller.getClassName().lastIndexOf('.') + 1);\n return out;\n }\n }\n }\n return null;\n }",
"protected void render() {\n\t\tString accion = Thread.currentThread().getStackTrace()[2].getMethodName();\n\t\trender(accion);\n\t}",
"public static void rep_Stack(String classNme, String methodNme, String fileNme, int lineNm, String PassedVars) {\n ResultStackTest rs = new ResultStackTest(classNme, methodNme, fileNme, lineNm, PassedVars);\n details_Stack.add(rs);\n }",
"public String visit(Procedure n, Object argu) \r\n\t{\r\n\t\t\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\".text \\n\");\r\n\t\tMipsOutPut.add(n.f0.f0.tokenImage+\": \\n\");\r\n\t MipsOutPut.add(MipsOutPut.Space+\"sw $fp, -8($sp) \\n\");\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\"move $fp, $sp \\n\");\r\n int stackLength = (Integer.parseInt(n.f5.f0.tokenImage)+2)*4;\r\n MipsOutPut.add(MipsOutPut.Space+\"subu $sp, $sp, \" +stackLength +\"\\n\");\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\"sw $ra, -4($fp) \\n\");\r\n\t\tn.f10.accept(this,argu);\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\"lw $ra, -4($fp) \\n\");\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\"lw $fp, -8($fp) \\n\");\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\"addu $sp, $sp, \" +stackLength +\"\\n\");\r\n\t\tMipsOutPut.add(MipsOutPut.Space+\"j $ra \\n\");\r\n\t\treturn null;\r\n\t}",
"public static void rep_WriteStack(String strTemplatePath, String strOutputPath) {\n try {\n String reportIn = new String(Files.readAllBytes(Paths.get(strTemplatePath)));\n for (int i = details_Stack.size() - 1; i >= 0; i--) {\n if (i == details_Stack.size() - 1) {\n reportIn = reportIn.replaceFirst(resultPlaceholder, \"<tr><td>\" + details_Stack.get(i).getMethodNme() + \"</td><td>\" + details_Stack.get(i).getIntlineNm() + \"</td><td>\" + details_Stack.get(i).getFileNme() + \"</td><td>\" + details_Stack.get(i).getClassNme() + \"</td></tr>\" + resultPlaceholder);\n } else {\n //if statement to prevent duplication of test step numbers in the report\n reportIn = reportIn.replaceFirst(resultPlaceholder, \"<tr><td>\" + details_Stack.get(i).getMethodNme() + \"</td><td>\" + details_Stack.get(i).getIntlineNm() + \"</td><td>\" + details_Stack.get(i).getFileNme() + \"</td><td>\" + details_Stack.get(i).getClassNme() + \"</td><td>\" + details_Stack.get(i).getPassedVars() + \"</td></tr>\" + resultPlaceholder);\n }\n }\n\n String currentDate = new SimpleDateFormat(\"dd-MM-yyyy\").format(new Date());\n\n\n String currentTime = CommonFunctionTest.com_CurrentTime();\n String reportPath = strOutputPath + \"\\\\Appium_stackTrace_\" + currentDate + \"_\" + currentTime + \".html\";\n\n Files.write(Paths.get(reportPath), reportIn.getBytes(), StandardOpenOption.CREATE);\n\n } catch (Exception e) {\n System.out.println(\"Error when writing report file:\\n\" + e.toString());\n }\n }",
"public void renderJavaStyle(StringBuilder sb) {\n sb.append(\"\\tat \").append(fileName);\n if (lineNumber > -1) {\n sb.append(':').append(lineNumber);\n }\n if (functionName != null) {\n sb.append(\" (\").append(functionName).append(')');\n }\n }",
"public String getContext() {\n int l=code.getCurLine();\n String s=\"\\t\\t at line:\" + l + \" \";\n if (l>-1) {\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l-2);\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l-1);\n s+=\"\\n\\t\\t\\t> \"+code.getLineAsString(l)+\" <\";\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l+1);\n s+=\"\\n\\t\\t\\t \"+code.getLineAsString(l+2);\n s=s+ \"\\n\\t\\t current token:\" + tok.toString();;\n s=s+ \"\\n\\t\\t Variable dump:\" + vars;\n if (gVars!=null) {\n s=s+ \"\\n\\t\\t Globals:\" + gVars;\n }\n } else s+=\"\\n\\t\\t\\t> \"+tok.getLine()+\" <\";\n\n return s;\n }",
"@Override \n\tpublic String toString() {\n\t\t\n\t\tSystem.out.println(\"New Stack\");\n\t\t\n\t\tfor(int i = 0; i < arraySize; i++) {\n\t\t\tSystem.out.println(\"stack: \" + list[i].toString());\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");// Print and empty new line\n\t\t\n\t\treturn \"\";\n\t}",
"private static String[] getStackElementParts(int depth) {\n String[] out = new String[2];\n if (-1 == depth) {\n return out;\n } else if (LOG_ALL == depth) {\n out = traceAll(Thread.currentThread().getStackTrace(), LOG_ALL);\n } else if (DEBUG_TRACE_ALL == (DEBUG & DEBUG_TRACE)) {\n out = traceAll(Thread.currentThread().getStackTrace(), DEPTH_ADD + depth);\n } else {\n out[1] = getTraceMethod(Thread.currentThread().getStackTrace(), DEPTH_ADD + depth);\n }\n return out;\n }",
"public ScGridColumn<AcFossWebServiceMessage> newStackTraceColumn()\n {\n return newStackTraceColumn(\"Stack Trace\");\n }",
"private void printStackTrace(Exception ex, GUILog gl) {\n StringWriter sw = new StringWriter();\n PrintWriter pw = new PrintWriter(sw);\n ex.printStackTrace(pw);\n gl.log(sw.toString()); // stack trace as a string\n ex.printStackTrace();\n }",
"private String getStackTrace(Exception ex) {\r\n\t\tStringWriter sw = new StringWriter();\r\n\t\tex.printStackTrace(new PrintWriter(sw));\r\n return sw.toString();\r\n\t}",
"public String toString() {\r\n\t\tStringBuilder sb = new StringBuilder(\"(\");\r\n\t\tfor (int j = t; j >= 0; j--) {\r\n\t\t\tsb.append(stack[j]);\r\n\t\t\tif (j > 0)\r\n\t\t\t\tsb.append(\", \");\r\n\t\t}\r\n\t\tsb.append(\")\");\r\n\t\treturn sb.toString();\r\n\t}",
"void dump_stacks(int count)\n {\n int i;\n System.out.println(\"=index==state====value= s:\"+stateptr+\" v:\"+valptr);\n for (i=0;i<count;i++)\n System.out.println(\" \"+i+\" \"+statestk[i]+\" \"+valstk[i]);\n System.out.println(\"======================\");\n }",
"@Override\n public String codeGen() {\n\n\tString labelFun = \"labelFun\" + MiniFunLib.getLabIndex();\n\tString popParSequence = \"\";\n\tString popLocalVariable = \"\";\n\tString localVariableCodeGen = \"\";\n\n\tfor (int i = 0; i < funParams.size(); i++) {\n\t NodeType nt = this.funParams.get(i).getType().getNodeType();\n\n\t if (nt == NodeType.ARROWTYPE_NODE)\n\t\tpopParSequence += VMCommands.POP + \"\\n\" + VMCommands.POP + \"\\n\";\n\t else\n\t\tpopParSequence += VMCommands.POP + \"\\n\";\n\t}\n\n\tfor (int i = 0; i < funLocalVariables.size(); i++) {\n\t localVariableCodeGen += funLocalVariables.get(i).codeGen();\n\t popLocalVariable += VMCommands.POP + \"\\n\";\n\t}\n\n\tString code = labelFun + \" :\\n\" +\n\t// Preparo parte bassa dell'activation Record\n\n\t\t// Il registro FP punterà al nuovo Activation Record\n\t\tVMCommands.CFP + \"\\n\"\n\n\t\t// PUSH dei dati Locali\n\t\t+ localVariableCodeGen +\n\n\t\t// PUSH return address del chiamante\n\t\tVMCommands.LRA + \"\\n\"\n\n\t\t// Corpo della funzione\n\t\t+ funBody.codeGen() +\n\n\t\t// POP RV e salvo nel registro\n\t\tVMCommands.SRV + \"\\n\" +\n\n\t\t// POP RA e salvo nel registro\n\t\tVMCommands.SRA + \"\\n\" +\n\n\t\t// Rimuovo variabili locali\n\t\tpopLocalVariable +\n\t\t// Rimuovo Access Link\n\t\tVMCommands.POP + \"\\n\" +\n\t\t// Rimuovo Pametri\n\t\tpopParSequence +\n\n\t\t// Ripristino il Registro FP che punterà all'Activation Record\n\t\t// del chiamante\n\t\tVMCommands.SFP + \"\\n\" +\n\n\t\t// PUSH valore di ritorno\n\t\tVMCommands.LRV + \"\\n\" +\n\t\t// PUSH indirizzo di ritorno\n\t\tVMCommands.LRA + \"\\n\" +\n\n\t\t// Salto al Chiamante\n\t\tVMCommands.JS + \"\\n\";\n\n\tMiniFunLib.addFunctionCode(code);\n\n\treturn VMCommands.PUSH + \" \" + labelFun + \"\\n\";\n }",
"public String toString(){\n String pileString = \"\";\n\n for(int i = 0; i < this.nbObj; i++)\n {\n pileString += i + \": \" + this.objTab[i].toString() + \"\\n\";\n }\n pileString += \"End of Stack\";\n return pileString;\n }",
"public static String getStackMessage(Throwable exception) {\n\t\tStringWriter sw = new StringWriter();\n\t\tPrintWriter pw = new PrintWriter(sw);\n\t\tpw.print(\" [ \");\n\t\tpw.print(exception.getClass().getName());\n\t\tpw.print(\" ] \");\n\t\texception.printStackTrace(pw);\n\t\treturn sw.toString();\n\t}",
"public void printStack(int stackNo){\n\t\tint begin = stackStarts[stackNo-1];\n\t\tfor (int i = begin; i < begin + stackTops[stackNo-1]; i++)\n\t\t\t\tSystem.out.print(stacks[i] + \" \");\n\t\tSystem.out.println();\n\t}",
"public LocalDebugInfo[] locals();",
"public String visit(AStoreStmt n, Object argu)\r\n\t {\r\n\t\t int stackPos = 4*Integer.parseInt(n.f1.f1.f0.tokenImage);\r\n int RegNum = n.f2.f0.which;\r\n MipsOutPut.add(MipsOutPut.Space+\"sw \" + Regs.RegList[RegNum] +\", \" + stackPos + \"($sp) \\n\");\r\n return null;\r\n\t }",
"@Override\n public String toString() {\n \tString retString = \"Stack[\";\n \tfor(int i = 0; i < stack.size() - 1; i++) // append elements up to the second to last onto the return string\n \t\tretString += stack.get(i) + \", \";\n \tif(stack.size() > 0)\n \t\tretString += stack.get(stack.size() - 1); // append final element with out a comma after it\n \tretString += \"]\";\n \treturn retString;\n }",
"public String toString()\r\n {\r\n String result = \"\";\r\n \r\n for (int index=0; index < top; index++) \r\n result = result + stack[index].toString() + \"\\n\";\r\n \r\n return result;\r\n }",
"static String extractScope(final String stackFrame) {\n int startIndex = getStartIndex(stackFrame);\n final int dotIndex = Math.max(startIndex, stackFrame.indexOf('.', startIndex + 1));\n int lparIndex = stackFrame.indexOf('(', dotIndex);\n final String clsMethodText = stackFrame.substring(dotIndex + 1, lparIndex != -1 ? lparIndex : stackFrame.length());\n int methodStart = clsMethodText.indexOf('/');\n\n return methodStart == -1 ? clsMethodText : clsMethodText.substring(methodStart + 1) + \": \" + clsMethodText.substring(0, methodStart);\n }",
"public String toString()\n{\n StringBuffer sb = new StringBuffer(getClass().getSimpleName()).append(' ');\n if(getName()!=null) sb.append(getName()).append(' ');\n sb.append(getFrame().toString());\n return sb.toString();\n}",
"public String toString() {\n // Introducing StringBuilder\n StringBuilder sb = new StringBuilder();\n sb.append(String.format(\"\\nThis stack has %d elements and %d of them are used\",\n this.foundation.length, this.usage));\n sb.append(\"\\n\\t[ \");\n for (int i = this.foundation.length - this.usage; i < this.foundation.length; i++) {\n sb.append(String.format(\"%s \", foundation[i]));\n }\n sb.append(\"]\");\n return sb.toString();\n }",
"@Override\n\tpublic String indentedToString(int level) {\n\t\tStringBuilder build = new StringBuilder(indentation(level)).append(\"FUNCTION HEADER: \").append(name).append('\\n');\n\t\tfor (String arg : arguments) {\n\t\t\tbuild.append(indentation(level + 1)).append(arg).append('\\n');\n\t\t}\n\t\treturn build.toString();\n\t}",
"@Override\n public String visit(Procedure n) {\n String _ret = null;\n this.procedureName = n.f0.f0.tokenImage;\n this.calcStackSize(Integer.parseInt(n.f2.f0.tokenImage),\n Integer.parseInt(n.f5.f0.tokenImage),\n Integer.parseInt(n.f8.f0.tokenImage));\n this.addProcedureHead();\n n.f10.accept(this);\n this.addProcedureTail();\n return _ret;\n }",
"public static final SourceModel.Expr executionContext_traceShowsFunctionArgs(SourceModel.Expr executionContext) {\n\t\t\treturn \n\t\t\t\tSourceModel.Expr.Application.make(\n\t\t\t\t\tnew SourceModel.Expr[] {SourceModel.Expr.Var.make(Functions.executionContext_traceShowsFunctionArgs), executionContext});\n\t\t}",
"@Override public void visitFrame(\n int type,\n int nLocal,\n Object[] local,\n int nStack,\n Object[] stack) {}",
"@Override\n public String visit(Label n) {\n // 注意进入这里的只会有开头的标识 Label\n // 屏蔽 Procedure/CJUMP/JUMP/SimpleExp\n String _ret = null;\n Global.outputString += n.f0.tokenImage + \":\";\n return _ret;\n }",
"private String vmCode(ArrayList<String> accessArgs, int size, ArrayList<SystemType> signature) {\n\n if(kind == Kind.Expr) {\n // result = className(args); pc += size\n return String.format(\"%s = %s; pc += %d;\", accessArgs.get(accessArgs.size() - 1),\n call(accessArgs, size, signature), size);\n }\n\n if(kind == Kind.Bool) {\n return String.format(\"pc = %s ? %s : %s;\",\n call(accessArgs, size, signature),\n accessArgs.get(accessArgs.size() - 2), accessArgs.get(accessArgs.size() - 1));\n }\n\n // eg jumps. They know best.\n return call(accessArgs, size, signature);\n }",
"static String handleStackTrace(Throwable ex){\n // add the stack trace message\n StringBuilder builder = new StringBuilder(SPACE);\n builder.append(ex.getMessage());\n builder.append(NEWLINE);\n\n // add each line of the stack trace.\n for (StackTraceElement element : ex.getStackTrace()){\n builder.append(SPACE);\n builder.append(element.toString());\n builder.append(NEWLINE);\n }\n return builder.toString();\n }",
"public static void functionCalled(String message) {\n if(enabled) {\n for (int i = 0; i < depth; i++)\n System.out.print(\"\\t\");\n System.out.println(message);\n depth++;\n }\n }",
"public String getFunctionLocation() {\n return \" [\" + name + \"]\";\n }",
"static void dump(Stack stack) {\n String temp = \" stack = \";\n for (int i = stack.size() - 1; i >= 0; i--) {\n temp = temp + ((TreeNode) (stack.elementAt(i))).data + \" \";\n }\n System.out.println(temp);\n }",
"public String _class_globals() throws Exception{\n_nativeme = new anywheresoftware.b4j.object.JavaObject();\n //BA.debugLineNum = 7;BA.debugLine=\"End Sub\";\nreturn \"\";\n}",
"public void setStack(String stack);",
"public String printCharStack() {\r\n\t\t String elements = \"<\";\r\n\t\t \r\n\t\tfor(int i = 0; i < count; i++) {\r\n\t\t\telements += \" \" + (char)array[i];\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\telements += \">\";\r\n\t\t\treturn elements;\r\n\t }",
"public Snippet visit(PrintlnStatement n, Snippet argu) {\n\t\t Snippet _ret= new Snippet(\"\",\"\",null, false);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t Snippet f2 = n.identifier.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t n.nodeToken3.accept(this, argu);\n\t _ret.returnTemp = generateTabs(blockDepth)+\"System.out.println(\"+f2.returnTemp+\");\";\n\t\t\ttPlasmaCode+=_ret.returnTemp+\"\\n\";\n\t return _ret;\n\t }",
"public String toStringAST()\r\n/* 75: */ {\r\n/* 76: 94 */ StringBuilder s = new StringBuilder();\r\n/* 77: */ \r\n/* 78: 96 */ s.append('{');\r\n/* 79: 97 */ int count = getChildCount();\r\n/* 80: 98 */ for (int c = 0; c < count; c++)\r\n/* 81: */ {\r\n/* 82: 99 */ if (c > 0) {\r\n/* 83:100 */ s.append(',');\r\n/* 84: */ }\r\n/* 85:102 */ s.append(getChild(c).toStringAST());\r\n/* 86: */ }\r\n/* 87:104 */ s.append('}');\r\n/* 88:105 */ return s.toString();\r\n/* 89: */ }",
"private static FlexStackFrame createStackFrame(final FlexDebugProcess flexDebugProcess, final String frameText) {\n\n\n VirtualFile file = null;\n\n final Location fileNameAndIndexAndLine = getFileNameAndIdAndLine(frameText);\n final String fileName = fileNameAndIndexAndLine.fileName;\n final String fileId = fileNameAndIndexAndLine.fileId;\n final int line = fileNameAndIndexAndLine.line;\n\n if (!StringUtil.isEmpty(fileName)) {\n file = ReadAction.compute(() -> flexDebugProcess.findFileByNameOrId(fileName, getPackageFromFrameText(frameText), fileId));\n\n if (file == null) {\n // todo find position in decompiled code\n }\n }\n\n final VirtualFile finalFile = file;\n final XSourcePosition sourcePosition = file == null\n ? null\n : ReadAction.compute(\n () -> XDebuggerUtil.getInstance().createPosition(finalFile, line > 0 ? line - 1 : line));\n return sourcePosition != null ? new FlexStackFrame(flexDebugProcess, sourcePosition)\n : new FlexStackFrame(flexDebugProcess, fileName, line);\n }",
"public void display() {\n\n for (int i=top;i>=0;i--)\n {\n System.out.println(stack[i]);\n }\n }",
"StackManipulation cached();",
"public void showStack() {\n\n\t\t/*\n\t\t * Traverse the stack by starting at the top node and then get to the\n\t\t * next node by setting to current node \"pointer\" to the next node until\n\t\t * Null is reached.\n\t\t */\n\t\tNode<T> current = getTopNode();\n\n\t\tSystem.out.println(\"\\n---------------------\");\n\t\tSystem.out.println(\"STACK INFO\");\n\n\t\twhile (current != null) {\n\t\t\tSystem.out.println(\"Node Data: \" + current.data);\n\t\t\tcurrent = current.nextNode;\n\t\t}\n\n\t\tSystem.out.println(\"<< Stack Size: \" + getStackSize() + \" >>\");\n\t\tSystem.out.println(\"----------------------\");\n\n\t}",
"public void createCode(){\n\t\tsc = animationScript.newSourceCode(new Coordinates(10, 60), \"sourceCode\",\r\n\t\t\t\t\t\t null, AnimProps.SC_PROPS);\r\n\t\t \r\n\t\t// Add the lines to the SourceCode object.\r\n\t\t// Line, name, indentation, display dealy\r\n\t\tsc.addCodeLine(\"1. Berechne für jede (aktive) Zeile und Spalte der Kostenmatrix\", null, 0, null); // 0\r\n\t\tsc.addCodeLine(\" die Differenz aus dem kleinsten (blau) und zweit-kleinsten (lila)\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Element der entsprechenden Zeile/ Spalte.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"2. Wähle die Zeile oder Spalte (grün) aus bei der sich die größte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" Differenz (blau) ergab.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"3. Das kleinste Element der entsprechenden Spalte\", null, 0, null); \r\n\t\tsc.addCodeLine(\" (bzw. Zeile) gibt nun die Stelle an, welche im\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Transporttableau berechnet wird (blau).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"4. Nun wird der kleinere Wert von Angebots- und\", null, 0, null); // 4\r\n\t\tsc.addCodeLine(\" Nachfragevektor im Tableau eingetragen.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"5. Anschließend wird der eingetragene Wert von den Rändern\", null, 0, null); // 5\r\n\t\tsc.addCodeLine(\" abgezogen (mindestens einer muss 0 werden). \", null, 0, null);\r\n\t\tsc.addCodeLine(\"6. Ist nun der Wert im Nachfragevektor Null so markiere\", null, 0, null); // 6\r\n\t\tsc.addCodeLine(\" die entsprechende Spalte in der Kostenmatrix. Diese\", null, 0, null);\r\n\t\tsc.addCodeLine(\" wird nun nicht mehr beachtet (rot). Ist der Wert des\", null, 0, null);\r\n\t\tsc.addCodeLine(\" Angebotsvektors Null markiere die Zeile der Kostenmatrix.\", null, 0, null);\r\n\t\tsc.addCodeLine(\"7. Der Algorithmus wird beendet, falls lediglich eine Zeile oder\", null, 0, null); // 8\r\n\t\tsc.addCodeLine(\" Spalte der Kostenmatrix unmarkiert ist (eines reicht aus).\", null, 0, null);\r\n\t\tsc.addCodeLine(\"8 . Der entsprechenden Zeile bzw. Spalte im Transporttableau werden\", null, 0, null); // 9\t\t \r\n\t\tsc.addCodeLine(\" die restlichen Angebots- und Nachfragemengen zugeordnet.\", null, 0, null);\r\n\t\t\r\n\t}",
"String snippet(int line);",
"@SubL(source = \"cycl/stacks.lisp\", position = 1818) \n public static final SubLObject create_stack() {\n return clear_stack(make_stack(UNPROVIDED));\n }",
"public void renderMozillaStyle(StringBuilder sb) {\n if (functionName != null) {\n sb.append(functionName).append(\"()\");\n }\n sb.append('@').append(fileName);\n if (lineNumber > -1) {\n sb.append(':').append(lineNumber);\n }\n }",
"@Test\n public void testCurlyBracket() {\n String html = source.toHTML(new SEclipseStyle(), new SCurlyBracket());\n assertEquals(html, \"<pre style='color:\"\n + \"#000000;background:#ffffff;'>\"\n + \"public class MainClass {\\n\"\n + \" \\n\"\n + \" public static void main(String args[]){\\n\"\n + \" GradeBook myGradeBook=new GradeBook();\\n\"\n + \" String courseName=\\\"Java \\\";\\n\"\n + \" myGradeBook.displayMessage(courseName);\\n\"\n + \" \\n\"\n + \" }\\n\"\n + \" }public class Foo {\\n\"\n + \" \\n\"\n + \" public boolean bar(){\\n\"\n + \" super.foo();\\n\"\n + \" return false;\\n\"\n + \" \\n\"\n + \" }\\n\"\n + \" }</pre>\");\n }",
"public Variable[] getStackVariables();",
"public static String firstOfStack(){\n StringBuilder sb = new StringBuilder(\"1\");\n try{second(sb);}\n catch(Error e) {\n sb.append(\"Catch\");\n }\n sb.append(\"Out\");\n return sb.toString();\n }",
"private void createFrame(){\n System.out.println(\"Assembling \" + name + \" frame.\");\n }",
"public final String toStringX() {\n return this.decompile(Descriptor.P_STMT, new StringBuilder(1024), Descriptor.DECO_STRX).toString();\n }",
"@Override\n public String visit(PassArgStmt n) {\n // 直接将参数保存到下一个栈帧\n // PASSARG 起始1\n int offset = Integer.parseInt(n.f1.f0.tokenImage);\n String r1 = this.reg[n.f2.f0.which];\n Global.outputString += \"sw $\" + r1 + \", -\" + ((offset + 2) * 4)\n + \"($sp)\\n\";\n return null;\n }",
"public abstract int trace();",
"public void traverseStack(){\n // check if there is any stack present or not\n if(this.arr==null){\n System.out.println(\"No stack present, first create a stack\");\n return;\n }\n // check if stack is empty\n if(this.topOfStack==-1){\n System.out.println(\"Stack is empty, can't traverse\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Printing stack...\");\n for(int i=0;i<=this.topOfStack;i++){\n System.out.print(this.arr[i]+\" \");\n }\n System.out.println();\n }",
"public static String printStackTrace() {\n StringBuilder sb = new StringBuilder();\n StackTraceElement[] trace = Thread.currentThread().getStackTrace();\n for (StackTraceElement traceElement : trace) {\n sb.append(\"\\t \").append(traceElement);\n sb.append(System.lineSeparator());\n }\n return sb.toString();\n }",
"public void printStack(){\n\t\tswitch (type) {\n\t\tcase 's' : {\n\t\t\tSystem.out.print(\"[XX]\");\n\t\t}\n\t\tbreak;\n\t\tcase 'w' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\tcase 't' : {\n\t\t\tStack<Card> temp = new Stack<Card>();\n\t\t\tCard currentCard = null;\n\t\t\tString fullStack = \"\";\n\t\t\twhile(!this.isEmpty()){\n\t\t\t\ttemp.push(this.pop());\n\t\t\t}\n\t\t\twhile(!temp.isEmpty()){\n\t\t\t\tcurrentCard = temp.pop();\n\t\t\t\tfullStack += currentCard.isFaceUp() ? currentCard.toString() : \"[XX]\";\n\t\t\t\tthis.push(currentCard);\n\t\t\t}\n\t\t\tSystem.out.println(fullStack);\n\t\t}\n\t\tbreak;\n\t\tcase 'f' : {\n\t\t\tSystem.out.print(this.peek().toString());\n\t\t}\n\t\tbreak;\n\t\t}\n\t}",
"static void printStack(Stack<Integer> s)\n\t{\n/*\t\tListIterator<Integer> lt = s.listIterator();\n\n\t\t// forwarding\n\t\twhile (lt.hasNext())\n\t\t\tlt.next();\n\n\t\t// printing from top to bottom\n\t\twhile (lt.hasPrevious())\n\t\t\tSystem.out.print(lt.previous() + \" \");*/\n\t\t\tSystem.out.println(s);\n\t}",
"private static void displayXCode() {\n if (dvm.getStartingLine() < 0){\n System.out.println(\"====\"+dvm.getCurrentFunction().toUpperCase()+\"====\");\n }else{\n for (int i = dvm.getStartingLine(); i <= dvm.getEndingLine(); i++) {\n if (dvm.isLineABreakPoint(i)){\n //NOTE: (char)249 is extended ascii for a little solid square.\n //I'm sorry if it comes out as something else on your machine\n //I do not know how (or if its possible) to check if the machine\n //that will run this program supports extended ascii. If it doesnt\n //It should just show up as an empty box, which is acceptable\n //For my purposes as well.\n System.out.print((char)249);\n }else\n System.out.print(\" \");\n\n if (i == dvm.getCurrentLine())\n System.out.println(String.format(\"%1$4s %2$s\", i + \")\", dvm.getLineOfSourceCode(i)+ \" <-----------\"));\n else\n System.out.println(String.format(\"%1$4s %2$s\", i + \")\", dvm.getLineOfSourceCode(i)));\n }\n }\n }",
"static void showPush(Stack<String> stack, String str) {\n\t\tstack.push(str);\n\t\tSystem.out.println(\"push(\" + str + \")\");\n\t\tSystem.out.println(\"Stack: \" + stack);\n\t}",
"@Override\n public String toString() {\n return String.format(\"REIL function %s\", getName());\n }",
"private String getFunctionName() {\n StackTraceElement[] sts = Thread.currentThread().getStackTrace();\n if (sts == null) {\n return null;\n }\n for (StackTraceElement st : sts) {\n if (st.isNativeMethod()) {\n continue;\n }\n if (st.getClassName().equals(Thread.class.getName())) {\n continue;\n }\n if (st.getClassName().equals(LogUtils.this.getClass().getName())) {\n continue;\n }\n return \"[ \" + Thread.currentThread().getName() + \": \"\n + st.getFileName() + \":\" + st.getLineNumber() + \" \"\n + st.getMethodName() + \" ]\";\n }\n return null;\n }",
"public Snippet visit(MethodCallStatement n, Snippet argu) {\n\t\t Snippet _ret= new Snippet(\"\", \"\", null, false);\n\t\t\tSnippet f0 =n.methodCall.accept(this, argu);\n\t n.nodeToken.accept(this, argu);\n\t _ret.returnTemp = f0.returnTemp + \";\";\n\t\t\ttPlasmaCode+=generateTabs(blockDepth)+_ret.returnTemp+\"\\n\";\n\t return _ret;\n\t }",
"public String visit(MessageSend n, LLVMRedux argu) throws Exception {\n int i=0;\n String primex_res = n.f0.accept(this, argu);\n Function f = scopeSearch(u.getRegType(primex_res)).getFunction(n.f2.accept(this, argu));\n\n ArrayList<String> localArgList;\n //bitcast\n String bitcast = u.getReg();\n u.println(bitcast+\" = bitcast i8* \"+primex_res+\" to i8***\");\n //load bitcasted to new reg (vtable)\n String load = u.getReg();\n u.println(load+\" = load i8**, i8*** \"+bitcast);\n //getelemntptr from above reg and the functoffset\n String gepr = u.getReg();\n u.println(gepr+\" = getelementptr i8*, i8** \"+load+\", i32 \"+f.offset);\n //get actual funct ptr load new ptr i8* above ptr\n String loader2 = u.getReg();\n u.println(loader2+\" = load i8*, i8** \"+gepr);\n //String functId = ;\n String bitcast2 = u.getReg();\n //if has only one argument copy paste command below without comma and closed parentheses\n if(f.arguments.size()==0){\n u.println(bitcast2+\" = bitcast i8* \"+loader2+\" to \"+u.javaTypeToLLVMType(f.returnType)+\"(i8*)*\");\n }else{\n u.print(bitcast2+\" = bitcast i8* \"+loader2+\" to \"+u.javaTypeToLLVMType(f.returnType)+\"(i8*, \");\n //else c&c c&v comm above & loop\n for (Variable v: f.arguments){\n u.simpleInlinePrint(u.javaTypeToLLVMType(v.type));\n if (!(i==f.arguments.size()-1))u.simpleInlinePrint(\", \");\n i++;\n }\n u.simplePrint(\")*\");\n }\n\n argStack.add(new ArrayList<>());\n argStackIndex++;\n n.f4.accept(this, argu);\n String rvalue= u.getReg(f.returnType);\n if(f.arguments.size()==0){\n u.println(rvalue+\" = call \"+u.javaTypeToLLVMType(f.returnType)+\" \"+bitcast2+\"(i8* \"+primex_res+\")\");\n }else{\n\n u.print(rvalue+\" = call \"+u.javaTypeToLLVMType(f.returnType)+\" \"+bitcast2+\"(i8* \"+primex_res+\", \");\n localArgList = argStack.get(argStackIndex);\n for (i=0;i<f.arguments.size();i++){\n u.simpleInlinePrint(u.javaTypeToLLVMType(f.arguments.get(i).type)+\" \"+localArgList.get(i));\n if (!(i==f.arguments.size()-1))u.simpleInlinePrint(\", \");\n }\n u.simplePrint(\")\");\n }\n\n argStackIndex--;\n argStack.remove(argStack.size()-1);\n return rvalue;\n }",
"public static void print_path(Stack<Node> st){\n for(int i=0;i<st.size();i++){\n System.out.print(st.elementAt(i).data+\" \");\n }\n }",
"@Override\n\tpublic String toString() {\n\t\tString result = \"\";\n\t\t\n\t\tfor(int i = 0; i < top; i++) {\n\t\t\tresult = result + stack[i].toString() + \"\\n\";\t//shouldn't it start at max --> 0 since its a stack\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"@Override\r\n \tpublic final String toStringAsNode(boolean printRangeInfo) {\r\n \t\tString str = toStringClassName();\r\n \t\t\r\n \t\tif(printRangeInfo) {\r\n \t\t\tif(hasNoSourceRangeInfo()) {\r\n \t\t\t\tstr += \" [?+?]\";\r\n \t\t\t} else {\r\n \t\t\t\tstr += \" [\"+ getStartPos() +\"+\"+ getLength() +\"]\";\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn str;\r\n \t}",
"private void substituteStackPointerSet() {\n for (int i = 0; i < tokenization.size(); i++){\n\n if (tokenization.get(i).kind == Token.Kind.ASIS && tokenization.get(i).varName.strip().length() >= 4 && tokenization.get(i).varName.strip().substring(0,3).equals(\"xxx\")) {\n int stackNum = Integer.parseInt(tokenization.get(i).varName.substring(3));\n int stackAddressLower = (stackNum * Constants.stackSize + nextDataSegmentAddress) % 256;\n int upper = stackAddressLower / 16;\n int lower = stackAddressLower % 16;\n tokenization.get(i).varName = \"8\" + Integer.toHexString(upper) + Integer.toHexString(lower) + \"5\";\n tokenization.get(i).varName = \"8\" + Integer.toHexString(upper) + Integer.toHexString(lower) + \"5\";\n }\n else if (tokenization.get(i).kind == Token.Kind.ASIS && tokenization.get(i).varName.strip().length() >= 4 && tokenization.get(i).varName.strip().substring(0,3).equals(\"yyy\")) {\n int stackNum = Integer.parseInt(tokenization.get(i).varName.substring(3));\n int stackAddressUpper = (stackNum * Constants.stackSize + nextDataSegmentAddress) / 256;\n int upper = stackAddressUpper / 16;\n int lower = stackAddressUpper % 16;\n tokenization.get(i).varName = \"9\" + Integer.toHexString(upper) + Integer.toHexString(lower) + \"5\";\n tokenization.get(i).varName = \"9\" + Integer.toHexString(upper) + Integer.toHexString(lower) + \"5\";\n }\n }\n }",
"@Test(timeout = 4000)\n public void test23() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(32767);\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \"%%N)&#pn7Z\", \"%%N)&#pn7Z\", \"Label offset position has not been resolved yet\", (String[]) null, false, true);\n Label label0 = new Label();\n Object object0 = new Object();\n methodWriter0.visitLocalVariable(\"Label offset position has not been resolved yet\", \"Label offset position has not been resolved yet\", \"StackMapTable\", label0, label0, 1);\n MethodWriter methodWriter1 = null;\n try {\n methodWriter1 = new MethodWriter(classWriter0, 3928, \"&h'pH__a\", \"double\", \"StackMapTable\", (String[]) null, false, true);\n fail(\"Expecting exception: StringIndexOutOfBoundsException\");\n \n } catch(StringIndexOutOfBoundsException e) {\n }\n }",
"public void trace(Object message)\n/* */ {\n/* 95 */ debug(message);\n/* */ }",
"@Test(timeout = 4000)\n public void test105() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(23);\n classWriter0.toByteArray();\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 2, \".JAR\", \".JAR\", \".JAR\", (String[]) null, false, false);\n Attribute attribute0 = new Attribute(\"LineNumberTable\");\n methodWriter0.getSize();\n // Undeclared exception!\n try { \n methodWriter0.visitFrame(0, 1, (Object[]) null, 23, (Object[]) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }",
"@Test(timeout = 4000)\n public void test33() throws Throwable {\n ClassWriter classWriter0 = new ClassWriter(32767);\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"tE\";\n stringArray0[1] = \"RuntimeInvisibleParameterAnnotations\";\n stringArray0[2] = \"oG0Y(?Kt\";\n MethodWriter methodWriter0 = new MethodWriter(classWriter0, 32767, \"LocalVariableTable\", \"S&D$-ctBdre@#\", \"LocalVariableTable\", stringArray0, false, false);\n MethodWriter methodWriter1 = classWriter0.firstMethod;\n Object object0 = new Object();\n MethodWriter methodWriter2 = new MethodWriter(classWriter0, (-488), \"tE\", \"S&D$-ctBdre@#\", \"RuntimeInvisibleParameterAnnotations\", stringArray0, false, false);\n int int0 = 2282;\n Object[] objectArray0 = new Object[4];\n objectArray0[0] = (Object) \"oG0Y(?Kt\";\n objectArray0[1] = (Object) \"S&D$-ctBdre@#\";\n objectArray0[2] = (Object) \"RuntimeInvisibleParameterAnnotations\";\n objectArray0[3] = (Object) \"&h'pH__a\";\n // Undeclared exception!\n try { \n methodWriter2.visitFrame(1, 2282, objectArray0, 2, stringArray0);\n fail(\"Expecting exception: ArrayIndexOutOfBoundsException\");\n \n } catch(ArrayIndexOutOfBoundsException e) {\n //\n // 4\n //\n verifyException(\"org.objectweb.asm.jip.MethodWriter\", e);\n }\n }",
"public Snippet visit(LogExpression n, Snippet argu) {\n\t Snippet _ret= new Snippet(\"\",\"\",null,false);\n\t n.nodeToken.accept(this, argu);\n\t n.nodeToken1.accept(this, argu);\n\t n.nodeToken2.accept(this, argu);\n\t n.nodeToken3.accept(this, argu);\n\t Snippet f4 = n.identifier.accept(this, argu);\n\t n.nodeToken4.accept(this, argu);\n\t _ret.returnTemp = \"Math.log(\"+f4.returnTemp+\")\";\n\t return _ret;\n\t }"
] | [
"0.62013996",
"0.5929467",
"0.56982875",
"0.56965566",
"0.56069136",
"0.5592496",
"0.55207896",
"0.54748625",
"0.54684764",
"0.5415451",
"0.54145354",
"0.5404241",
"0.5404241",
"0.5404241",
"0.5366808",
"0.53611636",
"0.5350741",
"0.5346358",
"0.5334145",
"0.5294883",
"0.5284778",
"0.52736205",
"0.525265",
"0.52510977",
"0.5219033",
"0.52170193",
"0.51959085",
"0.51923394",
"0.5181547",
"0.517638",
"0.51729596",
"0.5162116",
"0.5143235",
"0.51322126",
"0.5105144",
"0.5080499",
"0.50756896",
"0.50752133",
"0.507435",
"0.50655544",
"0.50653887",
"0.50583124",
"0.5044019",
"0.5026321",
"0.4982772",
"0.49815926",
"0.49815622",
"0.49685997",
"0.49651623",
"0.49643204",
"0.49637818",
"0.49509636",
"0.49421403",
"0.49350733",
"0.49321812",
"0.49238947",
"0.49113154",
"0.49089095",
"0.4903982",
"0.48935887",
"0.4892044",
"0.48897263",
"0.48881796",
"0.48862985",
"0.48838875",
"0.48817214",
"0.48778144",
"0.48752227",
"0.48747888",
"0.4871178",
"0.48584306",
"0.4855506",
"0.48496926",
"0.48316744",
"0.48306936",
"0.48296636",
"0.48280042",
"0.48125702",
"0.4810408",
"0.4808242",
"0.4808112",
"0.4796492",
"0.47940078",
"0.47939873",
"0.47914004",
"0.47739846",
"0.47656828",
"0.4762832",
"0.4754869",
"0.47535625",
"0.4752922",
"0.47497767",
"0.474708",
"0.4744798",
"0.47355926",
"0.47317293",
"0.47300115",
"0.47266993",
"0.47210503",
"0.4718239"
] | 0.6900397 | 0 |
forward requests to /admin and /user to their index.html | @Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName(
"forward:/index/index.html");
registry.addViewController("/welcome").setViewName(
"forward:/welcome.html");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\t\treq.getRequestDispatcher(\"/index.jsp\").forward(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"login.html\").forward(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n if (Authentication.isAdminInDbByCookies(req)) {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to /admin/registration/registration.html\");\n req.getRequestDispatcher(\"/admin/registration/registration.html\")\n .forward(req, resp);\n\n } else {\n // Authentication.log(req.getCookies()[0].getValue() + \" - redirect to / . Error Authorization.\");\n resp.sendRedirect(\"/\");\n }\n\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tRequestDispatcher dispatcher=req.getRequestDispatcher(\"login.html\");\n\t\tdispatcher.forward(req, resp);\n\t\t\n\t}",
"@GetMapping(\"/admin\")\n public String adminindex(){\n\n return \"adminindex\";\n }",
"@RequestMapping(\"\")\r\n\tpublic String index(HttpServletRequest req, HttpSession s) {\r\n\t\tif (!uS.isValid(s)) {\r\n\t\t\treturn \"redirect:/users/new\";\r\n\t\t} else {\r\n\t\t\tUser user = uS.find((long) s.getAttribute(\"id\"));\r\n\r\n\t\t\tif (user.isHost()) {\r\n\t\t\t\treturn \"redirect:/listings/host\";\r\n\t\t\t} else {\r\n\t\t\t\treturn \"redirect:/listings\";\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"employeelogin.html\").forward(req, resp);\n\t}",
"@RequestMapping(\n value= {\"\", \"index.htm\"},\n produces = \"text/html\")\n public String forwardUrl() {\n return \"forward:/index.html\";\n }",
"@RequestMapping(\"/returnIndex\")\r\n\tpublic ModelAndView returnIndex(HttpServletRequest request) {\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n\t\tUser user = us.findUserSessionByUsername(principal);\r\n\t\treturn new ModelAndView(\"redirect:/users/\" + user.getUserId());\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tAdmin admin = (Admin) request.getSession().getAttribute(\"username\");\n\t\tif (admin != null) {\n\t\t\t// if (administer.getAccessLevel().equals(AccessLevel.ADMIN)) {\n\t\t\tresponse.sendRedirect(\"welcome.jsp\");\n\t\t\t// } else {\n\t\t\t// response.sendRedirect(doc_JSP);\n\t\t\t// }\n\t\t} else {\n\t\t\tRequestDispatcher rd = request.getRequestDispatcher(\"signup.jsp\");\n\t\t\trd.forward(request, response);\n\t\t}\n\n//\t\tRequestDispatcher rd = request.getRequestDispatcher(\"signup.jsp\");\n//\t\trd.forward(request, response);\n\t}",
"private void home(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.sendRedirect(\"/WebBuyPhone/admin/darkboard.jsp\");\n\t}",
"void sendForward(HttpServletRequest request, HttpServletResponse response, String location) throws AccessControlException, ServletException, IOException;",
"public String indexAppusers() {\n\t\treturn \"redirect:/indexAppusers\";\n\t}",
"public static Result index() {\n Skier loggedInSkier = Session.authenticateSession(request().cookie(COOKIE_NAME));\n if(loggedInSkier!=null)\n return redirect(\"/home\");\n else\n return ok(index.render(\"\"));\n }",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n req.getRequestDispatcher(\"/WEB-INF/views/login.jsp\").forward(req, resp);\n }",
"@RequestMapping(\"/\")\n public String home()\n {\n SecurityContext context = SecurityContextHolder.getContext();\n return \"redirect:swagger-ui.html\";\n }",
"@RequestMapping(value=\"admin/users\", method=RequestMethod.GET)\n\tpublic ModelAndView index(ModelAndView model) throws IOException{\n\t\tModelAndView model2 = new ModelAndView();\n\t\tmodel2.setViewName(\"usuarios_admin\");\n\t\t\n\t\treturn model2;\n\t}",
"@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\tString index() {\n\t\tif (StringUtil.isNullOrEmpty(configuration.getHue().getIp())\n\t\t\t\t|| StringUtil.isNullOrEmpty(configuration.getHue().getUser())) {\n\t\t\treturn \"redirect:/setup\";\n\t\t}\n\n\t\treturn \"redirect:/dailySchedules\";\n\t}",
"@RequestMapping(value = \"/admin\", method = RequestMethod.GET)\n public ModelAndView adminPage() {\n logger.info(\"Admin GET request\");\n\n String login = authorizationUtils.getCurrentUserLogin();\n String message = MessageFormat.format(\"User login: {0}\", login);\n logger.info(message);\n\n ModelAndView model = new ModelAndView();\n model.addObject(\"search\", new SearchDto());\n model.setViewName(\"admin\");\n return model;\n }",
"@GetMapping(\"/admin/home\")\n\tpublic ModelAndView goToAdminHome(){\n\t\t\n\t\tModelAndView modelAndView = new ModelAndView(\"admin/home\");\n\t\tAuthentication auth = SecurityContextHolder.getContext().getAuthentication();\n\t\tUser user = userService.findUserByEmail(auth.getName());\n\t\t\n\t\tmodelAndView.addObject(\"userName\", \"Welcome \" + user.getFirstname() + \" \" + user.getLastname() + \" (\" + user.getEmail() + \")\");\n\t\tmodelAndView.addObject(\"adminMessage\",\"Content Available Only for Users with Admin Role\");\n\t\t\n\t\treturn modelAndView;\n\t}",
"@GetMapping(\"/\")\n\tpublic String auth() throws IOException \n\t{\n\t\t/* Returns to home.html : index.html */\n\t\treturn appservice.authentication() ? \"application.html\" : \"log.html\";\n\t}",
"@GetMapping\n\tpublic String home() {\n\t\tSystem.out.println(\"Index page\");\n\t\treturn \"redirect:index.jsp\";\n\t}",
"@RequestMapping(\"/\")\n public String home(HttpServletRequest request) {\n if(!request.isUserInRole(\"ROLE_ADMIN\")){\n return \"home\";\n }\n else {\n return \"redirect:/admin/pocetna\";\n }\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tif(req.getSession().getAttribute(\"Users\")!=null){\r\n\t\t\treq.getSession().removeAttribute(\"Users\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tresp.sendRedirect(PathUtil.getBasePath(req,\"index.jsp\"));\r\n\t\r\n\t}",
"@RequestMapping(method = RequestMethod.GET)\n\tpublic String get(HttpServletRequest request, Model model) {\n\t\tlogger.trace(\"Admin Home\");\n\t\tif(!request.isUserInRole(AccountPrivilege.VIEW.getName())) {\n\t\t\tmodel.addAttribute(\"error\", \"You do not have access to view the admin pages\");\n\t\t\tLoginForm loginForm = new LoginForm();\n\t\t\tmodel.addAttribute(\"loginForm\", loginForm);\n\t\t\tAccountCreateForm accountCreateForm = new AccountCreateForm();\n\t\t\tmodel.addAttribute(\"accountCreateForm\", accountCreateForm);\n\t\t\treturn \"index\";\n\t\t}\n\t\treturn \"admin/home\";\n\t}",
"@RequestMapping(value = {\"/\", \"/home\", \"/index\"})\n public ModelAndView index(Principal principal) {\n String userName = \"Guest\";\n if (principal != null) {\n userName = principal.getName();\n }\n logger.info(userName + \" entering method index()\");\n\n ModelAndView mav = new ModelAndView(\"master\");\n mav.addObject(\"title\", \"Home\");\n mav.addObject(\"stations\", stationService.getAllStations());\n mav.addObject(\"userClickHome\", true);\n return mav;\n }",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\t\tHttpSession session = request.getSession();\n\t\tString url = request.getRequestURI();\n\t\tString user_name = (String) session.getAttribute(\"user_name\");\n\t\tString admin_name = (String) session.getAttribute(\"admin_name\");\n\t\tif(url.equals(\"/shcool/login.action\")||url.equals(\"/shcool/regist.action\")||user_name!=null||admin_name!=null||url.equals(\"/shcool/user/login.action\")||url.equals(\"/shcool/user/regist.action\")||url.equals(\"/shcool/adminlogin.action\")||url.equals(\"/shcool/admin/adminlogin.action\")||url.equals(\"/shcool/addAdmin.action\")||url.equals(\"/shcool/admin/addAdmin.action\")\n\t\t\t\t||url.equals(\"/shcool/verification/imageServlet.action\")||url.equals(\"/shcool/verification/verificationServlet.action\")){\n\t\t\treturn true;\n\t\t}else \n\t\t\tresponse.sendRedirect(request.getContextPath()+\"/login.action\");\n\t\t\treturn false;\n\t\t}",
"public static void redirectToRightHome(HttpServletRequest req,\r\n\t\t\tHttpServletResponse resp) throws IOException {\r\n\t\tHttpSession session = req.getSession();\r\n\t\tString context = req.getContextPath();\r\n\r\n\t\tif (isCustomerLoggedIn(session)) {\r\n\t\t\tresp.sendRedirect(context + \"/home/\");\r\n\t\t} else if (isAdministratorLoggedIn(session)) {\r\n\t\t\tresp.sendRedirect(context + \"/admin/\");\r\n\t\t} else {\r\n\t\t\tresp.sendRedirect(context + \"/\");\r\n\t\t}\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n HttpSession session = request.getSession();\n String action = request.getParameter(\"action\");\n request.setAttribute(\"role\", \"anonymous\");\n \n if (session.getAttribute(\"user\") == null && action == null) {\n getServletContext().getRequestDispatcher(\"/WEB-INF/index.jsp\").forward(request, response);\n return;\n }\n \n if(action != null && action.equals(\"login\")) {\n getServletContext().getRequestDispatcher(\"/WEB-INF/login.jsp\").forward(request, response);\n return;\n }\n \n if (action != null && action.equals(\"logout\")) {\n session.invalidate();\n request.setAttribute(\"role\", \"anonymous\");\n getServletContext().getRequestDispatcher(\"/WEB-INF/index.jsp\").forward(request, response);\n return;\n }\n }",
"@Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {\n\tUser user = (User) request.getSession().getAttribute(\"loggedInUser\");\n\tif (user == null) {\n\t response.sendRedirect(\"/home.html\");\n\t return false;\n\t}\n\n\treturn true;\n\n }",
"public void configureRoutes() {\n Service http = Service.ignite();\n\n http.port( 6001 );\n\n http.after( ( (request, response) -> response.type(\"application/json\" ) ) );\n\n http.post( \"/accounts/authenticate\", this.authRoutes.authenticate );\n http.post( \"/restaurants/authenticate\", this.authRoutes.authenticateRestaurant );\n\n http.post( \"*\", (req, res) -> {\n res.status( HttpStatus.NOT_FOUND_404 );\n\n return \"{}\";\n } );\n }",
"@RequestMapping(value = \"/userhomepage\", method = RequestMethod.GET)\n public ModelAndView displayUserHomepage() {\n return new ModelAndView(\"userhomepage\");\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {\n\t\tresponse.sendRedirect(\"index.jsp\");\n\t\t//seguridad antihackers\n\t}",
"@Override\n public void addViewControllers(ViewControllerRegistry registry){\n registry.addViewController(\"/\").setViewName(\"index\");\n registry.addViewController(\"/login\");\n registry.addViewController(\"/errores/403\").setViewName(\"/errores/403\")\n\n ;\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\n HttpSession session = request.getSession();\n // Test if there is a user signed in.\n User user = (User) session.getAttribute(\"user\");\n \n String url = \"/login.jsp\";\n \n // If no user go to login\n if (user == null){\n url = \"/login.jsp\";\n action = \"no_user\";\n } else if (action == null) {\n // If user but no action go home\n url = \"/home.jsp\";\n } else if(action.equals(\"get_users\")) { \n ArrayList<User> users;\n users = UserDB.selectUsers();\n session.setAttribute(\"users\", users);\n \n url = \"/home.jsp\";\n }\n \n getServletContext()\n .getRequestDispatcher(url)\n .forward(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\n\n UserDao dao = new UserDao();\n log.debug(dao.getAllUsers());\n List<Users> users = dao.getAllUsers();\n req.setAttribute(\"users\", users.get(0).getUserName());\n req.setAttribute(\"users\", users);\n log.debug(users.get(0).getPassword());\n String url = \"/leaderBoard.jsp\";\n\n RequestDispatcher dispatcher\n = getServletContext().getRequestDispatcher(url);\n dispatcher.forward(req, resp);\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n request.getRequestDispatcher(\"login.jsp\").forward(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n // This servlet shouldn't be reached via GET\n response.sendRedirect(\"index.jsp\");\n }",
"@RequestMapping(value = \"/restricted\", method = RequestMethod.GET)\r\n public String homeRestricted(HttpServletRequest request, ModelMap model) throws ServletException, IOException {\r\n return(renderPage(request, model, \"home\", null, null, null, false)); \r\n }",
"@RequestMapping(value = \"/\")\r\n\tpublic ModelAndView home(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) throws IOException {\r\n\t\tSystem.out.println(\"------------ redirecting to home page -------------\");\r\n\t\tList<Employee> employees = dao.getEmployees();\r\n\t\trequest.setAttribute(\"employees\", employees);\r\n\t\treturn new ModelAndView(\"home\");\r\n\t}",
"@Override\n\tpublic void handleRequest(HttpServletRequest request,\n\t\t\tHttpServletResponse response, ServletContext context,\n\t\t\tRequestType type) {\n\t\tUserHomeControl control = new UserHomeControl();\n\t\tLayoutRoot lr = new LayoutRoot(context,request,response);\n\t\t\n\t\tlr.setTitle(\"User home\");\n\t\t\n\t\tif(control.isLoggedIn(request, response)){\n\t\t\tSimpleTemplate custLayout = new SimpleTemplate(context, \"UserHomeLayout.mustache\");\n\t\t\tSimpleTemplate adminLayout = new SimpleTemplate(context, \"UserHomeLayoutAdmin.mustache\");\n\t\t\tSimpleTemplate custMenu = new SimpleTemplate(context, \"UserHomeCustomer.mustache\");\n\t\t\tSimpleTemplate adminMenu = new SimpleTemplate(context, \"UserHomeAdmin.mustache\");\n\t\t\t\n\t\t\tif(control.isAdmin(request, response)){\n\t\t\t\tadminLayout.setVariable(\"user_menu\", custMenu.render());\n\t\t\t\tadminLayout.setVariable(\"admin_menu\", adminMenu.render());\n\t\t\t\tlr.setContent(adminLayout.render());\n\t\t\t\tlr.render(response);\n\t\t\t}else{\n\t\t\t\tcustLayout.setVariable(\"user_menu\", custMenu.render());\n\t\t\t\tlr.setContent(custLayout.render());\n\t\t\t\tlr.render(response);\n\t\t\t}\n\t\t}else{\n\t\t\ttry {\n\t\t\t\tresponse.sendRedirect(CarRentalServlet.getFullURL(context, \"/user/login\"));\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@RequestMapping(\"/\")\n public ModelAndView index() {\n ModelAndView mav = new ModelAndView(\"index\");\n mav.addObject(\"userInfo\", new UserInfo());\n\n User user = (User) session.getAttribute(\"loginUser\");\n if (user != null) {\n List<Content> contents = contentService.showAll(user.getUserId());\n mav.addObject(\"contentList\", new ContentList(contents));\n }\n\n return mav;\n }",
"@Override\r\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)\r\n\t\t\tthrows Exception {\n\t\tString uri = request.getRequestURI();\r\n\t\tif (uri.indexOf(\"login\") >= 0 || uri.indexOf(\"index\") >= 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tUser user = (User) request.getSession().getAttribute(\"loginInfo\");\r\n\t\tif (user == null) {\r\n\t\t\trequest.setAttribute(\"errMsg\", \"ÇëÏȵǼ£¡\");\r\n\t\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/user/login.jsp\").forward(request, response);\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// }\r\n\t}",
"@GET\n\t@RequestMapping(value = \"/admin\")\n\t@Secured(value = { \"ROLE_ADMIN\" })\n\tpublic String openAdminMainPage() {\n\t\t\n\t\treturn \"admin/admin\";\n\t}",
"@Path(\"/index\")\n public void index(){\n }",
"@GetMapping(\"/admin\")\n String dashboard(){\n return \"dashboard\";\n }",
"@Override\n public void doFilter(ServletRequest srequest, ServletResponse sresponse, FilterChain filterChain)\n throws IOException, ServletException {\n HttpServletRequest request = (HttpServletRequest) srequest;\n //用户session是否存在\n boolean vlogin = request.getSession().getAttribute(\"heroList\") == null;\n //是否需要进行拦截 true为需要 false为不需要\n boolean vUrl = false;\n String url = request.getRequestURI();\n List<String> urls = new ArrayList<>();\n //添加需要拦截的url\n urls.add(\"/main\");\n for (String v_url : urls) {\n if (v_url.equals(url)) {\n vUrl = true;\n break;\n }\n }\n //验证登录\n if (vlogin && vUrl) {\n request.setAttribute(\"flag\", \"error\");\n request.getRequestDispatcher(\"/login\").forward(request, sresponse);\n }\n filterChain.doFilter(srequest, sresponse);\n }",
"@RequestMapping(value=\"/\", method=RequestMethod.GET)\n \tpublic ModelAndView handleRoot(HttpServletRequest request){\n \t\tRedirectView rv = new RedirectView(\"/search\",true);\n \t\trv.setStatusCode(HttpStatus.MOVED_PERMANENTLY);\n \t\tModelAndView mv = new ModelAndView(rv);\n \t\treturn mv;\n \t}",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {\n try {\n List<Entity> reviewees = Match.getNotMatchedUsers(\"Reviewee\");\n List<Entity> reviewers = Match.getNotMatchedUsers(\"Reviewer\");\n Match.match(reviewees, reviewers);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n response.sendRedirect(\"/index.html\");\n }",
"@Override\n\tprotected void doGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException {\n\t\t\n this.getServletContext().getRequestDispatcher(linkApp).forward( req,resp);\n\n\t }",
"@Override\r\n public boolean preHandle(HttpServletRequest request,\r\n HttpServletResponse response, Object handler) throws Exception {\n \r\n String servletContext = \"http://\"+request.getServerName()+\":\"+request.getLocalPort()+request.getContextPath();\r\n \r\n \r\n// logger.info(servletContext);\r\n// if(!MRNSystemConstant.SYSTEM_URI_LOGIN.equals(request.getServletPath()) && !MRNSystemConstant.SYSTEM_URI_WELCOME.equals(request.getServletPath())\r\n// \t\t&& !\"/json/raiseInvalidSessionError.do\".equals(request.getServletPath()) && !\"/view/raiseInvalidSessionError.do\".equals(request.getServletPath())\r\n// \t\t&& !\"/logout.do\".equals(request.getServletPath()) && !\"/requestedURLNotSupported.do\".equals(request.getServletPath()) && !\"/json/raiseSystemInternalError.do\".equals(request.getServletPath())\r\n// \t\t&& !request.getRequestURL().toString().contains(MRNSystemConstant.SYSTEM_URI_ALLOTMENT_REQUEST) && !\"/json/raiseNoAuthorityError.do\".equals(request.getServletPath()))\r\n// {\r\n// \t\r\n// \tUserObject userObj = (UserObject) request.getSession().getAttribute(\"USER\");\r\n// \t\r\n// \tif(request.getSession().isNew() || userObj == null)\r\n// \t{\r\n// \t\t\r\n// \t\tif(request.getServletPath().indexOf(MRNSystemConstant.SYSTEM_URI_CONTENT_JSON) != -1)\r\n// \t\t{\r\n// \t\t\tresponse.sendRedirect(request.getContextPath()+\"/json/raiseInvalidSessionError.do\");\r\n// \t\t}\r\n// \t\telse if(request.getServletPath().indexOf(MRNSystemConstant.SYSTEM_URI_CONTENT_VIEW) != -1)\r\n// \t\t{\r\n// \t\t\tresponse.sendRedirect(request.getContextPath()+\"/view/raiseInvalidSessionError.do\");\r\n// \t\t}\r\n// \telse\r\n// \t{\r\n// \t\tif(!\"/main.do\".equals(request.getServletPath()))\r\n// \t\t{\r\n// \t\t\t//response.sendRedirect(request.getContextPath()+\"/json/raiseInvalidSessionError.do\");\r\n// \t\tresponse.sendRedirect(request.getContextPath()+\"/requestedURLNotSupported.do\");\r\n// \t\tlogger.error(\"Invalid url\");\r\n// \t\t//request.getSession().invalidate();\r\n// \t\t}\r\n// \t\telse\r\n// \t\t{\r\n// \t\t\t//if main is called then check if session is expired in main and then display error message with login link \r\n// \t\t\t//else dont show the link to login.\r\n// \t\t\tresponse.sendRedirect(request.getContextPath()+\"/view/raiseInvalidSessionError.do\");\r\n// \t\t}\r\n// \t\t\r\n// \t}\r\n// \t\t\r\n// \t\treturn false;\r\n// \t}\r\n \t\r\n \t//System.out.println(\"MRNContext : \"+mrnContext);\r\n \t//mrnContext.setScreenCd(\"MBPPPP\");\r\n// \tString screenCd = request.getParameter(MRNSystemConstant.SYSTEM_FORM_FIELD_SCREEN_CD);\r\n// \t\r\n// \tif(StringUtil.isEmpty(screenCd))\r\n// \t{ \t\t\r\n// \t\tresponse.sendRedirect(request.getContextPath()+\"/view/requestedScreenCdMissing.do\");\r\n// \t\t\r\n// \t} \r\n \t\r\n \tmrnContext.setScreenCd(\"Test\");\r\n \t\r\n \t\r\n// }\r\n \r\n// String screenCd = request.getParameter(MRNSystemConstant.SYSTEM_FORM_FIELD_SCREEN_CD);\r\n// mrnContext.setScreenCd(screenCd);\r\n //request.setAttribute(\"startTime\", startTime);\r\n //if returned false, we need to make sure 'response' is sent\r\n return true;\r\n }",
"private void checkSessionAction(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.getRequestDispatcher(\"/jsps/manage/index.jsp\").forward(req, resp);\r\n\t}",
"public void doFilter(ServletRequest arg0, ServletResponse arg1,\n\t\t\tFilterChain arg2) throws IOException, ServletException {\n\t\tHttpServletRequest request=(HttpServletRequest)arg0;\n\t\tHttpServletResponse response=(HttpServletResponse)arg1;\n\t\tString url=request.getRequestURI();\n\t\tHttpSession session=request.getSession();\n\t\tString userAccount=(String)session.getAttribute(\"userAccount\");\n\t\tString adminAccount=(String)session.getAttribute(\"adminAccount\");\n\t\tif((userAccount==null&&adminAccount==null)&&(url.indexOf(\"login\")<0)){\n\t\t\tresponse.sendRedirect(request.getContextPath()+\"/jsp/login.jsp\");\n\t\t\treturn;\n\t\t}else{\n\t\t\tif((userAccount!=null&&adminAccount==null)&&(url.indexOf(\"main.\")>0)){\n\t\t\t\tresponse.sendRedirect(request.getContextPath()+\"/jsp/login.jsp\");\n\t\t\t\treturn;\n\t\t\t}else if((userAccount==null&&adminAccount!=null)&&(url.indexOf(\"main_normal.\")>0)){\n\t\t\t\tresponse.sendRedirect(request.getContextPath()+\"/jsp/login.jsp\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\targ2.doFilter(arg0, arg1);\n\t}",
"private void startWebApp(Handler<AsyncResult<HttpServer>> next) {\n Router router = Router.router(vertx);\n\n router.route(\"/assets/*\").handler(StaticHandler.create(\"assets\"));\n router.route(\"/api/*\").handler(BodyHandler.create());\n\n router.route(\"/\").handler(this::handleRoot);\n router.get(\"/api/timer\").handler(this::timer);\n router.post(\"/api/c\").handler(this::_create);\n router.get(\"/api/r/:id\").handler(this::_read);\n router.put(\"/api/u/:id\").handler(this::_update);\n router.delete(\"/api/d/:id\").handler(this::_delete);\n\n // Create the HTTP server and pass the \"accept\" method to the request handler.\n vertx.createHttpServer().requestHandler(router).listen(8888, next);\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException \n\t{\n\t\tString username=req.getParameter(\"username\");\n\t\tString password=req.getParameter(\"password\");\n\t\t\n\t\tPrintWriter pw1=resp.getWriter();\n\t\t// validate and print the output\n\t\tif(username.equals(\"admin\") && password.equals(\"root\"))\n\t\t{\n\t\t\tRequestDispatcher rd=req.getRequestDispatcher(\"servletlink\");\n\t\t\trd.forward(req, resp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPrintWriter pw=resp.getWriter();\n\t\t\tpw.print(\"<h1 style='color:red;'>Please enter valid username or password</h1>\");\n\t\t\tRequestDispatcher rd=req.getRequestDispatcher(\"index.html\");\n\t\t\trd.include(req, resp);\n\t\t\t\n\t\t}\n\t\t\n\t }",
"@Override\r\n protected void doGet(HttpServletRequest request,\r\n HttpServletResponse response) throws ServletException, IOException {\r\n\r\n String path = request.getPathInfo();\r\n Map<String, Object> data = getDefaultData();\r\n Writer writer = response.getWriter();\r\n\r\n if (path == null) {\r\n throw new IOException(\"The associated path information is null\");\r\n }\r\n\r\n if (path.equals(\"/\")) {\r\n processTemplate(MAIN_SITE, data, writer);\r\n } else if (path.equals(\"/login\")) {\r\n processTemplate(LOGIN_SITE, data, writer);\r\n } else if (path.startsWith(\"/login/error\")) {\r\n data.put(\"hasLoginFailed\", true);\r\n AppServlet.processTemplate(LOGIN_SITE, data, response.getWriter());\r\n } else if (path.equals(\"/logout\")) {\r\n request.getSession().invalidate();\r\n response.sendRedirect(\"/login\");\r\n } else if (path.equals(\"/signup\")) {\r\n processTemplate(SIGNUP_SITE, data, response.getWriter());\r\n } else {\r\n processTemplate(NOT_FOUND_SITE, data, writer);\r\n }\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t\tString path = request.getRequestURI();\r\n\t\tString[] parts = path.split(\"/\");\r\n\t\tm.setMessage(\"The requested access is not permitted\");\r\n\t\tstatus = 401;\r\n\r\n\t\tSystem.out.println(\"User requested \" + Integer.parseInt(parts[3]));\r\n\t\tHttpSession session = request.getSession();\r\n\t\tPrintWriter pw = response.getWriter();\r\n\t\tUser currentUser = (User) session.getAttribute(\"currentUser\");\r\n\r\n\t\tif (currentUser != null) {\r\n\t\t\tUser userRequested = UserService.findUserByID(currentUser.getUserId(), Integer.parseInt(parts[3]),\r\n\t\t\t\t\tcurrentUser.getRole().getRoleId());\r\n\r\n\t\t\tif (userRequested != null) {\r\n\t\t\t\tpw.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(userRequested));\r\n\t\t\t\tstatus = 200;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tpw.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(m));\r\n\t\t}\r\n\t\tresponse.setStatus(status);\r\n\r\n\t}",
"@Override\r\n \t\tpublic void configRoute(Routes me) {\n \t\t\tsuper.configRoute(me);\r\n \t\t\tme.add(\"/\", TestController.class, \"\");\r\n \t\t}",
"public static void main(String[] args) {\n\n\t\tJavalin app = Javalin.create(config -> config.addStaticFiles(\n\t\t\t\tstaticFiles ->\n\t\t\t\t{\n\t\t\t\t\tstaticFiles.directory = \"/public\";\n\t\t\t\t}\n\t\t\t\t)\n\t\t\t\t).start(6001);\n\t\t\n\t\t\n\t\tapp.get(\"/\", ctx -> ctx.html(\"hello!\"));\n\t\t\n\t\tapp.post(\"/authenticate\", ctx -> {login(ctx);} ); //Someone has to ping my authenticate, \n\t\t\t\t\t\t\t\t\t\t//before they can access my \"/secret\"\n\t\t\n\t\tapp.get(\"/secret\", ctx -> {\n\t\t\t\n\t\t\tUser sessionUser = ctx.sessionAttribute(\"user\");\n\t\t\t\n\t\t\tif(sessionUser == null) {\n\t\t\t\tctx.res.setStatus(400);\n\t\t\t\tSystem.out.println(\"Login in first!\");\n\t\t\t}else if(sessionUser.isAdmin()) {\n\t\t\t\tctx.res.setStatus(200); //success!\n\t\t\t\tctx.req.getRequestDispatcher(\"/SuperSecretPage.html\").forward(ctx.req, ctx.res);\n\t\t\t}else if(sessionUser.isAdmin() == false) {\n\t\t\t\tctx.res.setStatus(401);\n\t\t\t\tctx.req.getRequestDispatcher(\"/failed.html\").forward(ctx.req, ctx.res);\n\t\t\t}\n\t\t}); //That I only want access once they login!\n\t\t\n\t\tapp.get(\"logout\", ctx -> {\n\t\t\t\n\t\t\tctx.sessionAttribute(\"user\", new User(\"fake\",false)); //instead of removing altogther!\n//\t\t\tctx.consumeSessionAttribute(\"user\"); //logout!\n\t\t\t\n\t\t});\n\t\t\t\n\t\t\n\t\t//creating cookies\n\t\tapp.get(\"/cookie\", ctx -> {\n\t\t\t\n\t\t\t//cookies stored in the client machine! \n\t\t\t\n\t\t\tctx.cookie(\"user\", \"McBobby\");\n\t\t\tctx.cookie(\"favoriteColor\",\"Blue\");\n\t\t\tctx.cookie(\"member\",\"true\"); \n\t\t\tctx.cookie(\"admin\", \"false\");\n\t\t\tctx.cookie(\"access\", \"true\");\n\t\t});\n\t\t\n\t\tapp.get(\"/checkCookies\", ctx -> ctx.html(ctx.cookieMap().toString()));\n\t\t//checking if the cookies exist\n//\t\tapp.get(\"/checkCookies\", ctx -> {\n//\t\t\t\n//\t\t\tctx.res.setStatus(404);\n//\t\t\t\n//\t\t\t//checking if the cookieMap exists\n//\t\t\tif(ctx.cookieMap() != null) {\n//\t\t\t\tif(ctx.cookieMap().get(\"member\")!= null //checking if the \"member\" cookie exists\n//\t\t\t\t\t\t&& ctx.cookieMap().get(\"member\").equals(\"true\")) { //checkif the member cookie has the right value\n//\t\t\t\t\tctx.res.setStatus(200);\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\t\n//\t\t});\n\n\t\t//removing or overwriting the value of the cookie\n\t\tapp.get(\"/removeCookies\", ctx ->{\n\t\t\t\n\t\t\tctx.removeCookie(\"member\");\n\t\t\tctx.cookie(\"access\", \"false\");\n\t\t});\n\t\t\n\t\t\n\t\t\n\t\tapp.get(\"/setSession\", ctx -> {\n\t\t\n\t\t\tctx.sessionAttribute(\"user\", new User(\"Mcbobby\",false));\n\t\t\t\n\t\t});\n\t\t\n\t\tapp.get(\"/checkSession\", ctx -> {\n\n\t\t\tUser sessionUser = ctx.sessionAttribute(\"user\");\n\t\t\tSystem.out.println(sessionUser);\n\t\t});\n\t\t\n\t\tapp.get(\"/invalidateSession\", ctx -> {\n\t\t\t\n\t\t\tctx.consumeSessionAttribute(\"user\"); //this invalidates the session!\n\t\t});\n\t\t\n\t}",
"@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}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n HttpSession session = request.getSession(false);\n if (session == null) {\n getServletContext().getRequestDispatcher(\"/WEB-INF/Login.jsp\").forward(request, response);\n }\n if (session.getAttribute(\"user\") == null) {\n getServletContext().getRequestDispatcher(\"/WEB-INF/Login.jsp\").forward(request, response);\n }\n getServletContext().getRequestDispatcher(\"/WEB-INF/Home.jsp\").forward(request, response);\n\n }",
"@RequestMapping(\"/auth\") \r\n\tpublic String redirect(Model model,HttpServletRequest httpRequest) { \r\n\t\t String path = httpRequest.getContextPath();\r\n\t String basePath = httpRequest.getScheme()+\"://\"+httpRequest.getServerName()+\":\"+httpRequest.getServerPort()+path; \r\n\t model.addAttribute(\"base\", basePath);\r\n\t\treturn \"/index/login\"; \r\n\t}",
"protected void index()\r\n\t{\n\t}",
"@Override\n\tpublic void doFilter(ServletRequest request, ServletResponse response,\n\t\t\tFilterChain chain) throws IOException, ServletException {\n\t\tHttpServletRequest req = (HttpServletRequest) request;\n\t\tHttpServletResponse rep = (HttpServletResponse) response;\n\t\tString path = req.getContextPath();\n\t\tString basePath = request.getScheme()+\"://\"+request.getServerName()+\":\"+request.getServerPort()+path+\"/\";\n\t\t\n\t\t\n\t\tHttpSession session=req.getSession(true);\n\t\tPropertyConfig pc=new PropertyConfig(\"sysConfig.properties\");\n\t\tString loginpath=pc.getValue(\"loginpath\");//登陆页面\n\t\tString requrl=req.getRequestURL().toString();\n\t String requri=req.getServletPath().toString().trim();\n\t\tString ip = req.getHeader(\"x-forwarded-for\");\n\t\tif(ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip)) {\n\t\t\tip = req.getHeader(\"Proxy-Client-IP\");\n\t\t}\n\t\tif(ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip)) {\n\t\t\tip = req.getHeader(\"WL-Proxy-Client-IP\");\n\t\t}\n\t\tif(ip == null || ip.length() == 0 || \"unknown\".equalsIgnoreCase(ip)) {\n\t\t\tip = request.getRemoteAddr();\n\t\t}\n\t\tlogger.info(\"客户端主机地址\"+ip);\n\t\tlogger.info(\"请求页面地址\"+requrl);\n\t\t//登录页不进行过滤\n\t\tif(requrl.indexOf(loginpath)>=0){\n\t\t\tlogger.info(\"是登录页面,不进行拦截\");\n\t\t\tchain.doFilter(request, response);\n\t\t\treturn;\n\t\t}\n\t\tif(requrl.indexOf(\"index_sso.jsp\")>=0){\n\t\t\tlogger.info(\"是单点登录页面,不进行拦截\");\n\t\t\tchain.doFilter(request, response);\n\t\t\treturn;\n\t\t}\n\t\t//不在配置文件制定目录的页面,也不进行过滤\n\t\tString filterpath=pc.getValue(\"filterPath\");\n\t\tif(requrl.indexOf(filterpath)<0||requrl.indexOf(\"addCusinfo.jsp\")>=0){\n\t\t\tlogger.info(\"非拦截目录,不进行拦截\");\n\t\t\tchain.doFilter(request, response);\n\t\t\treturn;\n\t\t}\n\t\tAzdg az=new Azdg();\n\t\tString param=java.net.URLEncoder.encode(az.encrypt(requrl),\"UTF-8\");\n\t\tlogger.info(\"加密后且encode后的url:\"+param);\n\t\tloginpath+=\"?url=\"+param;\n\t\tlogger.info(\"过滤器生成的登录地址\"+basePath+loginpath);\n\t\tObject secret=session.getAttribute(\"secret\");\n\t\tif(secret==null){\n\t\t\tif(requrl.indexOf(\"/mobile/\")>0){\n\t\t\t\tlogger.info(\"移动端未登录,跳转登录>>>>\"+basePath+\"/mobile/\"+loginpath);\n\t\t\t\trep.sendRedirect(basePath+\"/mobile/\"+loginpath);\n\t\t\t}else{\n\t\t\t\tlogger.info(\"未登录,跳转登录>>>>\"+basePath+loginpath);\n\t\t\t\trep.sendRedirect(basePath+loginpath);\n\t\t\t}\n\t\t\treturn;\n\t\t}else{\n//\t\t\tLong time=(Long)session.getAttribute(\"secret\");\n//\t\t\tif((new Date().getTime()-time)>(1000*60*60)){\n//\t\t\t\tlogger.info(\"登录超时,跳转登录界面>>>>\"+basePath+loginpath);\n//\t\t\t\trep.sendRedirect(basePath+loginpath);\n//\t\t\t\treturn;\n//\t\t\t}\n\t\t}\n\t\tchain.doFilter(request, response);\n\t\t\n\t}",
"public static Result home() {\n Skier loggedInSkier = Session.authenticateSession(request().cookie(COOKIE_NAME));\n if(loggedInSkier==null)\n return redirect(\"/\");\n else\n return renderHome(loggedInSkier);\n }",
"public static Result index() {\n // Check that the email matches a confirmed user before we redirect\n String email = ctx().session().get(\"email\");\n if (email != null) {\n User user = User.findByEmail(email);\n if (user != null && user.validated) {\n return GO_DASHBOARD;\n } else {\n Logger.debug(\"Clearing invalid session credentials\");\n session().clear();\n }\n }\n\n return GO_HOME;\n }",
"@RequestMapping(value = \"/newlogin\")\r\n\tpublic String dispatchTodefaultEntryPoint() {\r\n\t\tlogger.entry();\r\n\r\n\t\tsaveUserLoginInformation();\r\n\r\n\t\t// String defaultHome = \"redirect:/home\";\r\n\r\n\t\t// if (Utils.isUserInRole(getInternalUserRoles())) {\r\n\t\t//\r\n\t\t// } else {\r\n\t\t// throw new AccessDeniedException(\"User Role not found\");\r\n\t\t// }\r\n\r\n\t\tString homePage = \"forward:/\" + getHomePageByRole();\r\n\r\n\t\tlogger.exit();\r\n\r\n\t\treturn homePage;\r\n\t}",
"@RequestMapping(\"/\")\r\n String Adminhome() {\r\n return \"Welcome to Admin Home Page\";\r\n }",
"@Override\n public void init(Router router) {\n\n // /////////////////////////////////////////////////////////////////////\n // some default functions\n // /////////////////////////////////////////////////////////////////////\n // simply render a page:\n router.GET().route(\"/\").with(ApplicationController.class, \"index\");\n router.GET().route(\"/examples\").with(ApplicationController.class, \"examples\");\n\n // render a page with variable route parts:\n router.GET().route(\"/user/{id}/{email}/userDashboard\").with(ApplicationController.class, \"userDashboard\");\n\n router.GET().route(\"/validation\").with(ApplicationController.class, \"validation\");\n\n // redirect back to /\n router.GET().route(\"/redirect\").with(ApplicationController.class, \"redirect\");\n\n router.GET().route(\"/session\").with(ApplicationController.class, \"session\");\n \n router.GET().route(\"/flash_success\").with(ApplicationController.class, \"flashSuccess\");\n router.GET().route(\"/flash_error\").with(ApplicationController.class, \"flashError\");\n router.GET().route(\"/flash_any\").with(ApplicationController.class, \"flashAny\");\n \n router.GET().route(\"/htmlEscaping\").with(ApplicationController.class, \"htmlEscaping\");\n\n // /////////////////////////////////////////////////////////////////////\n // Json support\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/api/person.json\").with(PersonController.class, \"getPersonJson\");\n router.POST().route(\"/api/person.json\").with(PersonController.class, \"postPersonJson\");\n \n router.GET().route(\"/api/person.xml\").with(PersonController.class, \"getPersonXml\");\n router.POST().route(\"/api/person.xml\").with(PersonController.class, \"postPersonXml\");\n\n // /////////////////////////////////////////////////////////////////////\n // Form parsing support\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/contactForm\").with(ApplicationController.class, \"contactForm\");\n router.POST().route(\"/contactForm\").with(ApplicationController.class, \"postContactForm\");\n\n // /////////////////////////////////////////////////////////////////////\n // Cache support test\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/test_caching\").with(ApplicationController.class, \"testCaching\");\n \n // /////////////////////////////////////////////////////////////////////\n // Lifecycle support\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/udpcount\").with(UdpPingController.class, \"getCount\");\n \n // /////////////////////////////////////////////////////////////////////\n // Route filtering example:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/filter\").with(FilterController.class, \"filter\");\n router.GET().route(\"/teapot\").with(FilterController.class, \"teapot\");\n\n // /////////////////////////////////////////////////////////////////////\n // Route filtering example:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/injection\").with(InjectionExampleController.class, \"injection\");\n\n // /////////////////////////////////////////////////////////////////////\n // Async example:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/async\").with(AsyncController.class, \"asyncEcho\");\n\n // /////////////////////////////////////////////////////////////////////\n // I18n:\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/i18n\").with(I18nController.class, \"index\");\n router.GET().route(\"/i18n/{language}\").with(I18nController.class, \"indexWithLanguage\");\n\n // /////////////////////////////////////////////////////////////////////\n // Upload showcase\n // /////////////////////////////////////////////////////////////////////\n router.GET().route(\"/upload\").with(UploadController.class, \"upload\");\n router.POST().route(\"/uploadFinish\").with(UploadController.class, \"uploadFinish\");\n \n \n //this is a route that should only be accessible when NOT in production\n // this is tested in RoutesTest\n if (!ninjaProperties.isProd()) {\n router.GET().route(\"/_test/testPage\").with(ApplicationController.class, \"testPage\");\n }\n\n router.GET().route(\"/assets/.*\").with(AssetsController.class, \"serve\");\n }",
"@GetMapping(\"/indexAdmin\")\n public String indexAdmin() {\n return \"indexAdmin\";\n }",
"@RequestMapping(\"/web/*\")\n\tpublic String oneFolder() {\n\t System.out.println(\"In /web/*\");\n\t return \"success\";\n\t}",
"@Override\r\n\tpublic void login_admin() {\n\t\trender(\"admin/login.jsp\");\r\n\t}",
"@RequestMapping(\"/\")\n public String startPage() {\n\n return \"redirect:/html/singlelamp/nnlightctl/Index.html\";\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tfinal String URI = request.getRequestURI().replace(\"/HelloFrontController/\", \"\"); // this is the name of the root project folder\n\t\t\n\t\tswitch(URI) {\n\t\tcase \"login\":\n\t\t\t// call a method from a request helper......\t\n\t\t\tRequestHelper.processLogin(request, response);\n\t\t\tbreak;\n\t\tcase \"employees\":\n\t\t\t// call method show all employees -- this means we'll be querying our DB...\n\t\t\tRequestHelper.processEmployees(request, response);\n\t\t\tbreak;\n\t\tcase \"error\":\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}",
"@RequestMapping(value = \"/\", method = RequestMethod.GET)\r\n public String topLevel(HttpServletRequest request, ModelMap model) throws ServletException, IOException {\r\n System.out.println(\"***** Been redirected to fetch page / - will render default map from here!\");\r\n String mapName = env.getProperty(\"default.map\");\r\n if (mapName.startsWith(\"/restricted/\")) {\r\n /* Ensure that a top-level restricted map always shows the login page when redirected - Polarcode bug 23/04/2018 */\r\n return(\"redirect:\" + mapName); \r\n } else {\r\n return(renderPage(request, model, \"map\", env.getProperty(\"default.map\"), null, null, false));\r\n } \r\n }",
"@RequestMapping(\"/\")\r\n\t\r\n\tpublic String home()\r\n\t{\n\t\t \r\n\t\treturn \"index\";\r\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\tDatabaseManager dbm = new DatabaseManager();\n\t\tString admin = request.getParameter(\"admin?\");\n\t\tif (admin == null) {\n\t\t\tNormaluser user = dbm.normaluserLogin(username, password);\n\t\t\tif (user == null) {\n\t\t\t\tString url=\"index.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCollection<OrderedDish> cart = new ArrayList<OrderedDish>();\n\t\t\t\trequest.getSession().setAttribute(\"cart\", cart);\n\t\t\t\trequest.getSession().setAttribute(\"user\", user);\n\t\t\t\trequest.getSession().setAttribute(\"type\", 1);\n\t\t\t\tString url=\"homePage.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url); \n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tAdministrator administrator = dbm.adminLogin(username, password);\n\t\t\tif (administrator == null) {\n\t\t\t\tString url=\"index.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCollection<OrderedDish> cart = new ArrayList<OrderedDish>();\n\t\t\t\trequest.getSession().setAttribute(\"admin\", administrator);\n\t\t\t\trequest.getSession().setAttribute(\"type\", 2);\n\t\t\t\tString url=\"homePage.jsp\";\n\t\t\t\turl=new String(url.getBytes(\"GBK\"),\"ISO8859_1\"); \n\t\t\t\tresponse.sendRedirect(url); \n\t\t\t}\n\t\t}\n\t}",
"@PreAuthorize(\"hasRole('ADMIN') AND hasRole('USER')\") \n\t@RequestMapping(\"/home\")\n @ResponseBody\n public String home(){\n\t return \"home\";\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}",
"public abstract String redirectTo();",
"@RequestMapping(value = \"/admin/index\", method = GET)\r\n\tpublic String index() {\r\n\t\treturn \"admin/index\";\r\n\t}",
"protected void procActivos(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t\trequest.getRequestDispatcher(\"index.jsp\").forward(request, response);\n\t}",
"private static void getLoginPage() throws IOException {\n get(\"/login\", (request, response) -> {\n Map<String, Object> attributes = new HashMap<>();\n attributes.put(\"title\", \"Login\");\n\n return SessionModelAndView.create(request.session(), attributes, \"index.jade\");\n }, new JadeEngine());\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n UserDAO dao;\n DAO<AreasDeInteresse> daoAreas;\n UserAreasDAO daoUserAreas;\n User user;\n RequestDispatcher dispatcher;\n HttpSession session;\n \n switch (request.getServletPath()) {\n case \"/user\": {\n try ( DAOFactory daoFactory = DAOFactory.getInstance()) {\n dao = (UserDAO) daoFactory.getUserDAO();\n\n List<User> userList = dao.all();\n request.setAttribute(\"userList\", userList);\n } catch (ClassNotFoundException | IOException | SQLException ex) {\n request.getSession().setAttribute(\"error\", ex.getMessage());\n }\n\n dispatcher = request.getRequestDispatcher(\"/view/user/index.jsp\");\n dispatcher.forward(request, response);\n break;\n }\n case \"/user/create\":{\n try ( DAOFactory daoFactory = DAOFactory.getInstance()) {\n daoAreas = daoFactory.getAreaDAO();\n \n List<AreasDeInteresse> areasList = daoAreas.all();\n \n request.setAttribute(\"areasList\", areasList);\n \n dispatcher = request.getRequestDispatcher(\"/view/user/create.jsp\");\n \n dispatcher.forward(request, response);\n \n } catch (ClassNotFoundException | SQLException ex) {\n Logger.getLogger(userController.class.getName()).log(Level.SEVERE, null, ex);\n }\n break;\n }\n case \"/user/read\":{\n try ( DAOFactory daoFactory = DAOFactory.getInstance()) {\n dao = (UserDAO) daoFactory.getUserDAO();\n \n user = dao.read(Integer.parseInt(request.getParameter(\"id\")));\n request.setAttribute(\"user\", user);\n\n dispatcher = request.getRequestDispatcher(\"/view/user/read.jsp\");\n dispatcher.forward(request, response);\n } catch (ClassNotFoundException | IOException | SQLException ex) {\n request.getSession().setAttribute(\"error\", ex.getMessage());\n response.sendRedirect(request.getContextPath() + \"/user\");\n }\n break;\n }\n case \"/user/update\":{\n try ( DAOFactory daoFactory = DAOFactory.getInstance()) {\n \n dao = (UserDAO) daoFactory.getUserDAO();\n daoAreas = daoFactory.getAreaDAO();\n daoUserAreas = (UserAreasDAO) daoFactory.getUserAreasDAO();\n \n session = request.getSession();\n \n user = (User) session.getAttribute(\"usuario\");\n \n if(user.getUserId() == Integer.parseInt(request.getParameter(\"id\"))){\n \n List<AreasDeInteresse> areasList = daoAreas.all();\n List<UserAreas> userAreasList = daoUserAreas.todasAreasUser(Integer.parseInt(request.getParameter(\"id\")));\n \n session.setAttribute(\"areasList\", areasList);\n session.setAttribute(\"userAreasList\",userAreasList);\n \n user = dao.read(Integer.parseInt(request.getParameter(\"id\")));\n request.setAttribute(\"user\", user);\n dispatcher = request.getRequestDispatcher(\"/view/user/update.jsp\");\n \n }else{\n \n String funcao = dao.getFuncao(Integer.parseInt(request.getParameter(\"id\"))) ;\n request.setAttribute(\"id\",Integer.parseInt(request.getParameter(\"id\")) );\n request.setAttribute(\"funcao\",funcao );\n dispatcher = request.getRequestDispatcher(\"/view/user/updateFunction.jsp\"); \n \n }\n \n dispatcher.forward(request, response);\n } catch (ClassNotFoundException | IOException | SQLException ex) {\n request.getSession().setAttribute(\"error\", ex.getMessage());\n response.sendRedirect(request.getContextPath() + \"/user\");\n }\n \n break;\n }\n case \"/user/delete\":{\n try ( DAOFactory daoFactory = DAOFactory.getInstance()) {\n dao = (UserDAO) daoFactory.getUserDAO();\n dao.delete(Integer.valueOf(request.getParameter(\"id\")));\n \n dispatcher = request.getRequestDispatcher(\"/view/user\");\n dispatcher.forward(request, response); \n\n } catch (ClassNotFoundException | IOException | SQLException ex) {\n request.getSession().setAttribute(\"error\", ex.getMessage());\n response.sendRedirect(request.getContextPath() + \"/user\");\n }\n break;\n \n }\n\n }\n\n }",
"private ActionForward home(ActionMapping mapping, ActionForm form, HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\treturn new LoginProxy().loginHome(mapping, form, request, response);\n\t}",
"@RequestMapping(\"/\") //match to root path\r\n String ropa(){\n return \"index\"; //index.html in templates directory\r\n }",
"@RequestMapping(\"/\")\n\t public String index(Model model){\n\t return \"homepage\";\n\t }",
"@Override\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n RequestDispatcher dispatcher = req.getRequestDispatcher(\"/Servlet\");\n dispatcher.forward(req, resp);\n \n}",
"@RequestMapping(\"/admin\")\n public String admin() {\n \t//当前用户凭证\n\t\tSeller principal = (Seller)SecurityUtils.getSubject().getPrincipal();\n\t\tSystem.out.println(\"拿取用户凭证\"+principal);\n return \"index管理员\";\n\n }",
"@RequestMapping(value=\"/admin\" , method= RequestMethod.GET)\n\tpublic String adminPage(ModelMap model) { \n\t\t\n\t\tmodel.addAttribute(\"user\",getUserData());\n\t\treturn\"admin\";\n\t}",
"public static void index()\n {\n String adminId = session.get(\"logged_in_adminid\"); // to display page to logged-in administrator only\n if (adminId == null)\n {\n Logger.info(\"Donor Location: Administrator not logged-in\");\n Welcome.index();\n }\n else\n {\n Logger.info(\"Displaying geolocations of all donors\");\n render();\n }\n }",
"@Override\n\tprotected String[] getServletMappings() {\n\t\treturn new String[] { \"/\" };\n\t}",
"@Override\n\tprotected String[] getServletMappings() {\n\t\treturn new String[] { \"/\" };\n\t}",
"@RequestMapping(\"/\")\n public String index() {\n return \"redirect:/api/v1/tool\";\n }",
"@Override\n public void addDefaultRoutes() {\n super.addDefaultRoutes();\n addRoute( \"/user\", UserResponder.class );\n addRoute( \"/user/:id\", UserResponder.class );\n addRoute( \"/user/help\", GeneralResponder.class );\n addRoute( \"/general/:param1/:param2\", GeneralResponder.class );\n addRoute( \"/photos/:customer_id/:photo_id\", null );\n addRoute( \"/test\", String.class );\n addRoute( \"/interface\", Responder.class ); // this will cause an error\n addRoute( \"/toBeDeleted\", String.class );\n removeRoute( \"/toBeDeleted\" );\n addRoute( \"/stream\", StreamUrl.class );\n addRoute( \"/browse/(.)+\", StaticPageTestResponder.class, new File( \"src/test/resources\" ).getAbsoluteFile() );\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tresponse.getWriter().append(\"Served at: \").append(request.getContextPath());\r\n//\t\tgetServletContext().getRequestDispatcher(\".jsp\").forward(request, response);\r\n//\t\tresponse.sendRedirect(\"index.jsp\");\r\n//\t\tresponse.getOutputStream().write(\"<p>hello, world</p>\".getBytes());\r\n//\t\tresponse.\r\n\t\tresponse.getWriter().append(\"username:\" + request.getParameter(\"username\"));\r\n\t\tresponse.getWriter().append(\"password:\" + request.getParameter(\"password\"));\r\n\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\tHttpSession httpsession=request.getSession();\n\thttpsession.removeAttribute(\"current-user\");\n\tresponse.sendRedirect(\"index.jsp\");\n\t}",
"@GetMapping(\"/\")\n public String index()\n {\n return \"index\";\n }",
"@RequestMapping({\"\", \"/\", \"/index\"})\n public String getIndexPage() {\n System.out.println(\"Some message to say...1234e\");\n return \"index\";\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\n String id = request.getParameter(\"id\"); \n if (action==null) {\n List<User> users = userDao.findAll();\n request.setAttribute(\"users\", users);\n request.getRequestDispatcher(\"list-user.jsp\").forward(request, response);\n } else if (action.equals(\"delete\")){\n if (Controller.controller.deleteUser(Integer.parseInt(id))) {\n response.sendRedirect(\"doUser\");\n } else {\n response.sendRedirect(\"admin.jsp\");\n }\n }\n }"
] | [
"0.6083586",
"0.60232556",
"0.6010691",
"0.5938522",
"0.5868507",
"0.585639",
"0.5842217",
"0.5791745",
"0.5658334",
"0.5653956",
"0.5642788",
"0.5641299",
"0.5640979",
"0.56043637",
"0.55992824",
"0.5589236",
"0.55866337",
"0.5582323",
"0.55660564",
"0.55186695",
"0.549971",
"0.54862976",
"0.5475096",
"0.54638517",
"0.5459777",
"0.54595643",
"0.5458824",
"0.5455972",
"0.5441027",
"0.5439839",
"0.54164165",
"0.5416204",
"0.5412845",
"0.5391513",
"0.53738266",
"0.53541",
"0.53485125",
"0.5343667",
"0.53432626",
"0.5335209",
"0.53313017",
"0.53248596",
"0.5311564",
"0.5309459",
"0.5305355",
"0.5284448",
"0.52727044",
"0.5267001",
"0.52647084",
"0.52605706",
"0.5253421",
"0.52460384",
"0.52390003",
"0.52364445",
"0.5229805",
"0.52226055",
"0.5205026",
"0.5198807",
"0.5198596",
"0.5195077",
"0.5191177",
"0.5191103",
"0.5190562",
"0.51775134",
"0.51658905",
"0.5158642",
"0.5157093",
"0.51563495",
"0.51556784",
"0.5151421",
"0.5145732",
"0.51457286",
"0.51456535",
"0.5145603",
"0.5142723",
"0.51427",
"0.5129105",
"0.51283854",
"0.51022434",
"0.5097318",
"0.5095999",
"0.50813097",
"0.507937",
"0.5075993",
"0.5074731",
"0.5074688",
"0.5069788",
"0.5068483",
"0.50655603",
"0.5064084",
"0.50555617",
"0.5055252",
"0.5055252",
"0.5054561",
"0.5044133",
"0.50340897",
"0.5032633",
"0.5032375",
"0.50316024",
"0.50272983"
] | 0.5523662 | 19 |
adds blocks to first stack | private void addStackBlocks() {
for (int x = numBlocks; x > 0; x--) {
double blockHeight = totalBLockHeight / numBlocks;
double blockWidthChange = (maxBlockWidth - minBlockWidth) / numBlocks;
double blockWidth = minBlockWidth + ((x - 1) * blockWidthChange);
TowerBlock newBlock = new TowerBlock(blockWidth, blockHeight, x);
towerOne.push(newBlock);
}
addBlocks = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Block push(Block blockToAdd){\n\t\tif(tail == (ds.length - 1)){ //checks if stack is full\n\t\t\tSystem.out.println(\"Stack is full!\");\n\t\t\treturn ds[tail];\n\t\t}\n\t\ttail++;\n\t\tds[tail] = blockToAdd;\n\t\treturn blockToAdd;\n\t}",
"private void addBlock(Block one)\n\t{\n\t\tgetChildren().add(one);\n\t\tblocks1.add(one);\n\t\tblocks2.add(one);\n\t}",
"public void addFirst(MemoryBlock block) {\n\t\tNode clone = tail.next; \n\t\tNode newNode = new Node(block);\n\t\tnewNode.next = clone;\n\t\tnewNode.previous = tail;\n\t\ttail.next = newNode;\n\t\tclone.previous = newNode;\n\t\tsize++;\n\t}",
"public void addOne()\n\t{\n\t\tBlock b = new Block(p1.tail.oldPosX, p1.tail.oldPosY, p1.tail, this);\n\t\tBlock b2 = new Block(p2.tail.oldPosX, p2.tail.oldPosY, p2.tail, this);\n\t\t\n\t\tb.setFill(Color.RED.desaturate());\n\t\tb2.setFill(Color.BLUE.desaturate());\n\n\t\tp1.tail = b;\n\t\tp2.tail = b2;\n\t\taddBlock(b);\n\t\taddBlock(b2);\n\t}",
"public void begin(){\n\t\tTransaction block = new Transaction();\n\t\tblock.setPrev(blocks.getLast());\n\t\tblocks.add(block);\n\t}",
"protected ItemStack createStackedBlock(int par1) {\n\t\treturn new ItemStack(this.blockID, 1, par1);\n\t}",
"default ItemStack addStack(ItemStack stack) {\n for (IInventoryAdapter inv : this) {\n InventoryManipulator im = InventoryManipulator.get(inv);\n stack = im.addStack(stack);\n if (InvTools.isEmpty(stack))\n return InvTools.emptyStack();\n }\n return stack;\n }",
"protected void enterBlockStmt(BlockStmt blockStmt) {\n enclosingBlocks.addFirst(blockStmt);\n if (blockStmt.introducesNewScope()) {\n pushScope();\n }\n }",
"public void startImage() {\r\n\t\tm_blocks = new Vector<BlockList>();\r\n\t\tm_feature.clear();\r\n\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\tBlockList blockList = new BlockList();\r\n\t\t\tm_blocks.add(blockList);\r\n\t\t}\r\n\t}",
"public void addBlock(Block block){\n\t\tblocks.addElement(block);\n\t}",
"public MinStack2() {\r\n\t\t\tdata = new Stack<>();\r\n\t\t\thelper = new Stack<>();\r\n\t\t}",
"private List<Block> createBlocks() {\n ArrayList<String> listOfBlocksAndSpacers = new ArrayList<String>();\n boolean buffer = false;\n for (int i = 0; i < level.size(); i++) {\n // if it starts with END_BLOCKS\n if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n } // if the buffer is true\n if (buffer) {\n listOfBlocksAndSpacers.add(level.get(i));\n } // if it starts with START_BLOCKS\n if (level.get(i).startsWith(\"START_BLOCKS\")) {\n buffer = true;\n } else if (level.get(i).startsWith(\"END_BLOCKS\")) {\n buffer = false;\n }\n }\n // find the x position where it all starts\n int startX = Integer.parseInt(this.map.get(\"blocks_start_x\"));\n int xForSave = startX;\n // find the y position where it all starts\n int startY = Integer.parseInt(this.map.get(\"blocks_start_y\"));\n List<Block> listOfBlocks = new ArrayList<>();\n String[] s;\n setBlocks();\n // go over the list of blocks of spacers\n for (int i = 0; i < listOfBlocksAndSpacers.size(); i++) {\n // split it with empty lines\n s = listOfBlocksAndSpacers.get(i).split(\"\");\n for (int j = 0; j < s.length; j++) {\n if (s[j].equals(\"\")) {\n continue;\n } // if it is a block symbol\n if (this.factory.isBlockSymbol(s[j])) {\n // add to listOfBlocks a block\n listOfBlocks.add(this.factory.getBlock(s[j], startX, startY));\n // continue to the next block with the next location\n startX += this.factory.getBlock(s[j], startX, startY).getCollisionRectangle().getWidth();\n } else if (this.factory.isSpaceSymbol(s[j])) { // move following\n // spacers\n startX += this.factory.getSpaceWidth(s[j]);\n }\n }\n startX = xForSave;\n startY += Integer.parseInt(this.map.get(\"row_height\"));\n }\n // put the blocks in a new blocks list and return it\n List<Block> listOfBlocksCopy = new ArrayList<>();\n for (int z = 0; z < listOfBlocks.size(); z++) {\n listOfBlocksCopy.add(listOfBlocks.get(z).copyBlock());\n }\n return listOfBlocksCopy;\n }",
"@Override\n public void push(E z){\n if(isFull()){\n expand();\n System.out.println(\"Stack expanded by \"+ expand+ \" cells\");\n }\n stackArray[count] = z;\n count++;\n }",
"public void addBlock(Block newBlock) {\n\t\tBLOCK_LIST.add(newBlock);\n\t\tSPRITE_LIST.add(newBlock);\n\t}",
"public MinStack() {\r\n stk = new Stack<>();\r\n stk1 = new Stack<>();\r\n }",
"public void addBlock(Block block) {\r\n if (null == blocks) {\r\n blocks = new ArrayList<Block>();\r\n }\r\n blocks.add(block);\r\n maxEntries += block.getHowMany();\r\n }",
"public BranchGroup blocksScene(){\n\t\t\n\t\tIterator iterator = blocks.iterator();\n\t\t\n\t\twhile(iterator.hasNext()){\n\t\t\tbg.addChild(((Block) iterator.next()).boxGridScene());\n\t\t}\n\t\treturn bg;\n\t}",
"public abstract void generateNextBlock();",
"public void insertLoadsAndStores() {\n for (com.debughelper.tools.r8.ir.code.BasicBlock block : code.blocks) {\n com.debughelper.tools.r8.ir.code.InstructionListIterator it = block.listIterator();\n while (it.hasNext()) {\n com.debughelper.tools.r8.ir.code.Instruction current = it.next();\n current.insertLoadAndStores(it, this);\n }\n }\n }",
"public SimpleStackOnLL() {\n\t\tthis.top = null;\n\t\tthis.size = 0;\n\t}",
"@ActionTrigger(action=\"KEY-NXTBLK\", function=KeyFunction.NEXT_BLOCK)\n\t\tpublic void spriden_NextBlock()\n\t\t{\n\t\t\t\n\t\t\t\tgoBlock(toStr(\"SOUNDEX\"));\n\t\t\t\tgetTask().getGoqrpls().gCheckFailure();\n\t\t\t}",
"@Override\r\n\tpublic void push() {\n\t\tSystem.out.println(\"Push logic for Fixed Stack\");\r\n\t\t\r\n\t}",
"public void placeBlockInTopResSpace(Block block, TT tt){\n ResidualSpace res = rs_stack.pop();\n\n // Place the block, this also updates the locations of the parcels inside it\n block.setLocation(res.getLocation().clone());\n\n block_placements.add(block.getId()); // Add the id of the placed block\n\n for(Parcel p:block.getPacking()){\n packing.addParcel(p);\n }\n\n this.total_value = packing.getTotalValue();\n\n // Update the hashkey\n// hashKey = tt.updateHash(hashKey, block_placements.size(), block.getId());\n\n // Remove parcels from the availability\n removeFromBres(block);\n\n // Calculate the new residual spaces\n generateDaughterResSpaces(block, res);\n }",
"public MinStack1() {\r\n stack = new Stack<>();\r\n }",
"public void addBlock(Block b) {\n String previousHash = \"\";\n if (blockChain.size() == 0) {\n previousHash = \"\";\n } else {\n previousHash = getLatestBlock().proofOfWork();\n }\n b.previousHash = previousHash;\n chainHash = b.proofOfWork();\n blockChain.add(b);\n }",
"public abstract void appendBlock();",
"public void addBlock(Block block) {\n this.blocks.add(block);\n }",
"public void createSideBlocks() {\n Fill fill = new FillColor(Color.darkGray);\n Block topB = new Block(new Rectangle(new Point(0, 0), 800, 45), fill);\n Block rightB = new Block(new Rectangle(new Point(775, 25), 25, 576), fill);\n Block leftB = new Block(new Rectangle(new Point(0, 25), 25, 576), fill);\n //add each screen-side block to game and set 1 hitpoint.\n topB.addToGame(this);\n topB.setHitPoints(1);\n rightB.addToGame(this);\n rightB.setHitPoints(1);\n leftB.addToGame(this);\n leftB.setHitPoints(1);\n }",
"public void push(E object) {stackList.insertAtFront(object);}",
"public void pushComputedBlock(String block){\n JsonParser parser = new JsonParser();\n \tJsonObject Block = (JsonObject) parser.parse(block);\n\n processNewBlock(Block);\n\n }",
"protected void stackEmptyButton() {\n \tif (stack.empty()) {\n \t\tenter();\n \t}\n \telse {\n \t\tstack.pop();\n \t\tif (stack.empty()) {\n \t\t\tenter();\n \t}\n \t}\n }",
"private static void addBlockToPixa(Pixa pixa, int x, int y, int width, int height, int depth) {\n final Pix pix = new Pix(width, height, depth);\n final Box box = new Box(x, y, width, height);\n\n pixa.add(pix, box, Constants.L_COPY);\n\n pix.recycle();\n box.recycle();\n }",
"private static void registerBlock(Block b)\n\t{\n\t}",
"LevelStacks() {\n stacks = new ArrayList<>();\n }",
"private void prepare()\n {\n MazeBlock mazeBlock = new MazeBlock();\n addObject(mazeBlock,25,25);\n MazeBlock mazeBlock1 = new MazeBlock();\n addObject(mazeBlock1,25,75);\n MazeBlock mazeBlock2= new MazeBlock();\n addObject(mazeBlock2,75,75);\n MazeBlock mazeBlock3= new MazeBlock();\n addObject(mazeBlock3,75,125);\n MazeBlock mazeBlock4= new MazeBlock();\n addObject(mazeBlock4,125,125);\n MazeBlock mazeBlock5= new MazeBlock();\n addObject(mazeBlock5,175,125);\n MazeBlock mazeBlock6= new MazeBlock();\n addObject(mazeBlock6,225,125);\n MazeBlock mazeBlock7= new MazeBlock();\n addObject(mazeBlock7,275,125);\n MazeBlock mazeBlock8= new MazeBlock();\n addObject(mazeBlock8,275,175);\n MazeBlock mazeBlock9= new MazeBlock();\n addObject(mazeBlock9,275,225);\n MazeBlock mazeBlock10= new MazeBlock();\n addObject(mazeBlock10,275,275);\n MazeBlock mazeBlock11= new MazeBlock();\n addObject(mazeBlock11,275,325);\n MazeBlock mazeBlock12= new MazeBlock();\n addObject(mazeBlock12,325,325);\n MazeBlock mazeBlock13= new MazeBlock();\n addObject(mazeBlock13,375,325);\n MazeBlock mazeBlock14= new MazeBlock();\n addObject(mazeBlock14,425,275);\n MazeBlock mazeBlock15= new MazeBlock();\n addObject(mazeBlock15,475,275);\n MazeBlock mazeBlock16= new MazeBlock();\n addObject(mazeBlock16,125,325);\n MazeBlock mazeBlock17= new MazeBlock();\n addObject(mazeBlock17,125,375);\n MazeBlock mazeBlock18= new MazeBlock();\n addObject(mazeBlock18,125,425);\n MazeBlock mazeBlock19= new MazeBlock();\n addObject(mazeBlock19,175,425);\n MazeBlock mazeBlock20= new MazeBlock();\n addObject(mazeBlock20,225,425);\n\n EnemyFlyer enemyFlyer = new EnemyFlyer();\n addObject(enemyFlyer,29,190);\n EnemyFlyer enemyFlyer3 = new EnemyFlyer();\n addObject(enemyFlyer3,286,389);\n WalkingEnemy walkingEnemy = new WalkingEnemy(true);\n addObject(walkingEnemy,253,293);\n walkingEnemy.setLocation(125,275);\n WalkingEnemy walkingEnemy2 = new WalkingEnemy(false);\n addObject(walkingEnemy2,28,81);\n walkingEnemy2.setLocation(170,82);\n FinalLevel finalLevel = new FinalLevel();\n addObject(finalLevel, 508, 45);\n Hero hero = new Hero();\n addObject(hero,62,499);\n }",
"public _30_min_stack() {\n data = new Stack<>();\n help = new Stack<>();\n }",
"public void fillBlock(TYPE typeOfBlock){\n isFull=true;\n type=typeOfBlock;\n return;\n }",
"public MinStack2() {\n stack1 = new Stack<>();\n stack2 = new Stack<>();\n }",
"@Override\n\tpublic void getSubBlocks(Item i, CreativeTabs tab, List l)\n\t{\n\t\tl.add(new ItemStack(i, 1, 0));\n\t}",
"public LinkedList<BlockFor2048> MergeBlocks(LinkedList<BlockFor2048> original){\n\t\tLinkedList<BlockFor2048> Merged = new LinkedList<BlockFor2048>();\n\t\twhile(original.size() > 0){\n\t\t\tBlockFor2048 first = original.pop();\n\t\t\tif(original.size() == 0){\n\t\t\t\tMerged.add(first);\n\t\t\t}\n\t\t\telse if(original.getFirst().isSameVal(first)){\n\t\t\t\toriginal.pop();\n\t\t\t\tfirst.doubleValue();\n\t\t\t\tthis.ScoreValue += first.getValue();\n\t\t\t\tMerged.add(first);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tMerged.add(first);\n\t\t\t}\n\t\t}\n\t\treturn Merged;\n\t}",
"void buildBlock(Tile t);",
"private void addRootNodeToStack(Deque<NodeExtended> stack) {\n final Integer INDEX_BEFORE_SOURCE_START = -1;\n ArrayList<Integer> indexesBeforeSourceStart = new ArrayList<Integer>();\n indexesBeforeSourceStart.add(INDEX_BEFORE_SOURCE_START);\n indexesBeforeSourceStart.add(INDEX_BEFORE_SOURCE_START);\n\n ArrayList<NodeExtended> childrenNull = new ArrayList<NodeExtended>();\n childrenNull.add(null);\n childrenNull.add(null);\n\n // root node has empty value and no letters from either source string\n NodeExtended root = new NodeExtended(\"\", indexesBeforeSourceStart,\n childrenNull, false, false);\n stack.push(root);\n }",
"private void setNextSuccessor() {\n if (lastBlock != null) // if it is the first block, do nothing\n lastBlock.addSuccessor(currentBlock);\n blocks.add(currentBlock); // Add currentBlock to the global list of blocks\n lastBlock = currentBlock;\n }",
"public void resetBlocks() {\n\t\tBLOCK_LIST.clear();\n\t}",
"public void push()\n {\n\tsetIndentLevel(indentLevel + 1);\n }",
"public void addToBlock(Instruction instn){\n\t\tinstns.add(instn);\n\t}",
"public MinStack() {\n data = new ArrayDeque<>();\n helper = new ArrayDeque<>();\n }",
"private static void populateBlocks() {\n\n //TODO set sensors for each\n\n /* Path A */\n SW1A.setProceeding(new Block[]{SW2A, STA1Z, SW2B});\n SW1A.setPreceding(new Block[]{PTH5A});\n\n SW2A.setProceeding(new Block[]{LD1A});\n SW2A.setPreceding(new Block[]{SW1A});\n\n SW3A.setProceeding(new Block[]{SW4A});\n SW3A.setPreceding(new Block[]{LD1A});\n\n SW4A.setProceeding(new Block[]{PTH1A});\n SW4A.setPreceding(new Block[]{SW3A, STA1Z, SW3B});\n\n PTH1A.setProceeding(new Block[]{PTH2A});\n PTH1A.setPreceding(new Block[]{SW4A});\n\n PTH2A.setProceeding(new Block[]{PTH3A});\n PTH2A.setPreceding(new Block[]{PTH1A});\n\n PTH3A.setProceeding(new Block[]{PTH4A});\n PTH3A.setPreceding(new Block[]{PTH2A});\n\n PTH4A.setProceeding(new Block[]{PTH5A});\n PTH4A.setPreceding(new Block[]{PTH3A});\n\n PTH5A.setProceeding(new Block[]{SW1A});\n PTH5A.setPreceding(new Block[]{PTH4A});\n\n LD1A.setProceeding(new Block[]{SW3A});\n LD1A.setPreceding(new Block[]{SW2A});\n\n\n /* Station */\n STA1Z.setProceeding(new Block[]{SW4A});\n STA1Z.setPreceding(new Block[]{SW1A});\n\n\n /* Path B */\n //TODO path B items aren't in yet\n LD1B.setProceeding(new Block[]{SW3B});\n LD1B.setPreceding(new Block[]{SW2B});\n\n SW2B.setProceeding(new Block[]{LD1B});\n SW2B.setPreceding(new Block[]{SW1B});\n\n SW3B.setProceeding(new Block[]{SW4B});\n SW3B.setPreceding(new Block[]{LD1B});\n\n\n /* Maintenance Bay */\n //TODO maintenance bay items aren't in yet\n\n\n\n\n /* Set up array */\n blocksArray = new Block[] {}; //TODO fill\n }",
"synchronized void putBlock(ICBlock block) {\n mQueue.add(block);\n }",
"public void getSubBlocks(int var1, CreativeTabs var2, List var3)\n {\n var3.add(new ItemStack(this));\n }",
"public void popAllStacks(){\n // if top is lost then all elements are lost.\n top = null;\n }",
"private void populateList(final Vector3 base)\n {\n this.blocks.add(base);\n // Loop untill no new blocks have been added.\n while (this.checked.size() < this.blocks.size())\n {\n final List<Vector3> toAdd = new ArrayList<>();\n // Add all connecting blocks that match, unless they have\n // already been checked.\n for (final Vector3 v : this.blocks) if (!this.checked.contains(v)) this.nextPoint(v, toAdd);\n // Add any blocks that are new to the list.\n for (final Vector3 v : toAdd) if (!this.blocks.contains(v)) this.blocks.add(v);\n }\n }",
"LevelStacks(LevelStacks<E> other) {\n this.stacks = new ArrayList<>(other.stacks.size());\n for (int i = 0; i < other.stacks.size(); i++) {\n stacks.add(other.get(i));\n }\n }",
"public void addLast(MemoryBlock block) {\n\t\tNode clone = head.previous; \n\t\tNode newNode = new Node(block);\n\t\tnewNode.previous = clone;\n\t\tnewNode.next = head;\n\t\thead.previous = newNode;\n\t\tclone.next = newNode;\n\t\tsize++;\n\t}",
"public MinStack2() {\n stack = new Stack<>();\n minStack = new Stack<>();\n }",
"public void addPendingBlock(Block block) {\n\n\t\tList<Block> sameIndexBlocks = pendingBlocks.get(block.getIndex());\n\t\tif(sameIndexBlocks == null) {\n\t\t\tsameIndexBlocks = new ArrayList<Block>();\n\t\t\tpendingBlocks.put(block.getIndex(), sameIndexBlocks);\n\t\t}\n\t\tsameIndexBlocks.add(block);\n\t}",
"public void initStackBricks() {\n\t\tdouble brickSize = MainApplication.WINDOW_HEIGHT / ASPECT_RATIO;\n\t\t// Array of numbered blocks, also formats them\n\t\tfor (int i = 0; i < callStack; i++) {\n\t\t\tstackBricks[i] = new GButton(String.valueOf(i + 1), (i + 1) * brickSize, 0.0, brickSize, brickSize,\n\t\t\t\t\tlevelColor(i + 1), Color.WHITE);\n\t\t}\n\t}",
"public void\npush(SoState state)\n{\n\tsuper.push(state);\n SoLazyElement prevElt = (SoLazyElement)getNextInStack();\n this.coinstate.copyFrom( prevElt.coinstate);\n}",
"public void addBlockList(int n) {\n BlockList.add(n);\r\n }",
"public 用栈实现队列() {\n stack1 = new LinkedList<>();\n stack2 = new LinkedList<>();\n }",
"@Override\r\n\tpublic void visit(BlockStmtNode blockStatement) {\n\t\tnameResolver.pushLocalBlock();\r\n\t\t\r\n\t\t//Push the block statement onto the execution block, that it gets\r\n\t\t//linked to the first statement in the block (if there is any)\r\n\t\t//or to the next statement (if there is no statement in this block)\r\n\t\texecPathStack.pushSingleStatementFrame(blockStatement);\r\n\t\t\r\n\t\tblockStatement.childrenAccept(this);\r\n\t\tnameResolver.popLocalBlock();\r\n\t}",
"public MinStack() {\n dataStack=new Stack<>();\n minStack=new Stack<>();\n }",
"public MinStack() {\r\n list = new LinkedList();\r\n }",
"public GetMinStack() {\n stackData = new Stack<>();\n stackMin = new Stack<>();\n }",
"public MinStack() {\n st = new Stack<>();\n }",
"public MyStack() {\n list = new LinkedList<>();\n list2 = new LinkedList<>();\n }",
"void push(int e) {\r\n\t\tif (top==stack.length) {\r\n\t\t\tmakeNewArray();\r\n\t\t}\r\n\t\tstack[top] = e;\r\n\t\ttop++;\r\n\t}",
"@Test\n public void lastSize() throws Exception{\n rf.insert(maxBlocks-1, testBlock);\n Assert.assertEquals(1, rf.size());\n }",
"@Override\r\n\tpublic boolean push(T e) {\r\n\t\tif(!isFull()) {\r\n\t\t\tstack[topIndex + 1] = e;\r\n\t\t\ttopIndex++;\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 start() {\n\t\tstack = new Stack<>();\t\t\n\t}",
"private void pushStackStackForward( ThroughNode aNode ) {\n List<ThroughNode> curStack = nodeStackStack.peek();\n List<ThroughNode> newStack = new ArrayList<>(curStack.size()+1);\n newStack.add(aNode);\n newStack.addAll(curStack);\n nodeStackStack.push(newStack);\n }",
"private synchronized void PCToStack() throws RuntimeException\n {\n int first8bites, second8bites, third8bits;\n \n first8bites = Utils.get_lobyte(mPC);\n second8bites = Utils.get_hibyte(mPC);\n if (PC_BIT_SIZE == 22)\n third8bits = Utils.get_lobyte(mPC >> 16);\n else\n third8bits = 0;\n mStack.push(first8bites);\n mStack.push(second8bites);\n if (PC_BIT_SIZE == 22)\n mStack.push(third8bits);\n }",
"public MyStack() {\n objects = new LinkedList<>();\n helper = new LinkedList<>();\n }",
"public void push(State s0) {\n\t\tsList.add(s0);\r\n\t}",
"public void addBlock(int x, int y) {\r\n\t\tthis.blockMap.add(new Block(x, y));\r\n\t}",
"private void add() throws Exception {\n BlockingDeque<String> bDeque = new LinkedBlockingDeque<String>(20);\n for (int i = 0; i < 30; i++) {\n // 将指定元素添加到此阻塞栈中\n\n bDeque.putFirst(\"\" + i);\n System.out.println(\"向阻塞栈中添加了元素:\" + i);\n }\n System.out.println(\"程序到此运行结束,即将退出----\");\n }",
"private synchronized void loadSecondaryBlock(boolean next) {\n int step = (next) ? 1 : -2;\n if ((currentBlock + step) < 0) return;//return early if we are already at the beginning\n Controller.INSTANCE.run(() -> {\n String content = fullContent.get(currentBlock) + fullContent.get(currentBlock + step);\n mine.setContent(content);\n return Unit.INSTANCE;\n });\n }",
"Tetrisblock2()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }",
"void push(Location loc) {\n // -\n top = new LocationStackNode(loc, top);\n }",
"public void addBlock(Block block) {\n\t\tblock.setId(this.generateID());\n\t\tthis.blocks.put(block.getId(), block);\n\t}",
"public static BlockExpression block(Expression expression0, Expression expression1) { throw Extensions.todo(); }",
"final void state_push(int state)\r\n{\r\n try {\r\n\t\tstateptr++;\r\n\t\tstatestk[stateptr]=state;\r\n\t }\r\n\t catch (ArrayIndexOutOfBoundsException e) {\r\n int oldsize = statestk.length;\r\n int newsize = oldsize * 2;\r\n int[] newstack = new int[newsize];\r\n System.arraycopy(statestk,0,newstack,0,oldsize);\r\n statestk = newstack;\r\n statestk[stateptr]=state;\r\n }\r\n}",
"private void moveStack1ToStack2() \n {\n while (!stack1.isEmpty())\n stack2.push(stack1.pop());\n }",
"private void createBlocks(){\n for (int row=0; row < grid.length; row++) \n {\n for (int column=0; column < grid[row].length; column++)\n {\n boolean player = false;\n boolean walkable;\n \n switch (grid[row][column]){\n case(0) : \n returnImage = wall; \n walkable = false;\n break;\n case(2) : \n returnImage = start; \n walkable = true;\n player = true;\n break;\n case(4) : \n returnImage = finish; \n walkable = true;\n break;\n \n default :\n returnImage = pad; \n walkable = false;\n }\n \n \n Block blok;\n try {\n if(player==true) \n { \n blok = new Block(returnImage, blockSize, true);\n blok.setTopImage(held);\n }else\n {\n blok = new Block(returnImage, blockSize, false);\n }\n blocks.add(blok);\n } catch (Exception e) {\n \n }\n } \n \n }\n \n }",
"public void moveForwardOneBlock() {\n\t\tBlockInterface nextBlock = this.currentBlock.goesto(previousBlock);\n\t\tthis.previousBlock = this.currentBlock;\n\t\tthis.currentBlock = nextBlock;\n\t\tif(nextBlock instanceof BlockStation){\n\t\t\tString nbname = ((BlockStation)nextBlock).getStationName();\n\t\t\tif(schedule.containsKey(nbname)){\n\t\t\t\tschedule.remove(nbname);\n\t\t\t\t((SchedulePane)c.schedulepane).reloadSchedual();\n\t\t\t}\n\t\t}\n\t}",
"public void push(E e) {\n\t\ttop = new SNode<E>(e, top);\n\t}",
"public void PlantMe(Block block){\n \tplugin.getReplant().add(block);\r\n \t\t//run the timer to load the block\r\n \t\r\n \tif(plugin.getTreeplant_Timer().getPoolSize() < plugin.getTreeplant_Timer().getMaximumPoolSize()){\r\n \t\tplugin.getTreeplant_Timer().schedule(new Runnable() {\r\n \t\t\t\tpublic void run() {\r\n \t\t\t\t\tif(!(plugin.getReplant().isEmpty())){\r\n \t\t\t\t\t\tBlock loadedBlock = plugin.getReplant().get(0);\r\n \t\t\t\t\t\t//remove it from the list\r\n \t\t\t\t\t\tplugin.getReplant().remove(0);\r\n \t\t\t\t\t\t//protect it\r\n \t\t\t\t\t\tProtectMe(loadedBlock);\r\n \t\t\t\t\t\t//made into a sap\r\n \t\t\t\t\t\tif( (loadedBlock.getType().equals(Material.AIR)) || (loadedBlock.getType().equals(Material.FIRE)) ) //just incase it was on fire\r\n \t\t\t\t\t\t\tloadedBlock.setType(Material.SAPLING);\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t\t/* No longer needed! Didn't realized leaves light blocking changed way back when.\r\n \t\t\t\t\t\t * for(int i=loadedBlock.getY(); i < 128; i++){\r\n \t\t\t\t\t\t\t//delete all the leaves in a line to the sky limit\r\n \t\t\t\t\t\t\tif(loadedBlock.getType()==Material.LEAVES){\r\n \t\t\t\t\t\t\t\t//it's a leaf delete it\r\n \t\t\t\t\t\t\t\tloadedBlock.setType(Material.AIR);\r\n \t\t\t\t\t\t\t\t//update on server | Not needed?\r\n \t\t\t\t\t\t\t\t//etc.getServer().setBlock(leafToDelete);\r\n \t\t\t\t\t\t\t}\r\n \t\t\t\t\t\t\t//go up one\r\n \t\t\t\t\t\t\tloadedBlock = loadedBlock.getFace(BlockFace.UP);\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}, plugin.getdelayTime(), TimeUnit.MILLISECONDS);\r\n \t}\r\n \t}",
"public void sortBlocks(){\n\t\tCurrentSets = getCurrentSets();\n\t\tif(CurrentSets == 1){\n\t\t\treturn;\n\t\t}else{\n\t\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\t\tfor(j = i + 1; j < CurrentSets; j++){\n\t\t\t\t\tif((Integer.parseInt(blocks[i].getHexTag(), 16)) > (Integer.parseInt(blocks[j].getHexTag(), 16))){\n\t\t\t\t\t\ttemp = blocks[j];\n\t\t\t\t\t\tblocks[j] = blocks[i];\n\t\t\t\t\t\tblocks[i] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void push(int x) {\n stk1.push(x);\n }",
"public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)\n {\n par3List.add(new ItemStack(par1, 1, 0));\n //par3List.add(new ItemStack(par1, 1, 1));\n //par3List.add(new ItemStack(par1, 1, 2));\n //par3List.add(new ItemStack(par1, 1, 3));\n }",
"public MinStack() {\n sort = new Stack<>();\n stack = new Stack<>();\n }",
"private final void push(Object ob) {\r\n\t\teval_stack.add(ob);\r\n\t}",
"public MinStack() {\n mainstack = new Stack<Integer>();\n secondaryminstack = new Stack<Integer>();\n }",
"@Override\n public ItemStack decrStackSize(int par1, int par2) {\n if (this.stack[par1] != null)\n {\n ItemStack var3;\n\n if (this.stack[par1].stackSize <= par2)\n {\n var3 = this.stack[par1];\n this.stack[par1] = null;\n return var3;\n }\n else\n {\n var3 = this.stack[par1].splitStack(par2);\n\n if (this.stack[par1].stackSize == 0)\n {\n this.stack[par1] = null;\n }\n\n return var3;\n }\n }\n else\n {\n return null;\n }\n }",
"private static void craftSlab(Block block)\r\n\t{\r\n\t\tBlockExtraSlab input = ((BlockExtraSlab)block);\r\n\t\tBlock parent = input.getParent();\r\n\t\tint parentMeta = input.getParentMeta();\r\n\t\t\r\n\t\tGameRegistry.addRecipe(new ItemStack(block, 6, 0), new Object[] { \"###\", '#', new ItemStack(parent, 1, parentMeta) });\r\n\t\tGameRegistry.addRecipe(new ItemStack(parent, 1, parentMeta), new Object[] { \"#\", \"#\", '#', new ItemStack(block) });\r\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}",
"private void setUpBlocks() {\n\t\tdouble xStart=0;\n\t\tdouble midPoint = getWidth()/2;\n\t\tint yStart = BRICK_Y_OFFSET;\t\n\t\t\n\t\tfor(int i = 0; i < NBRICK_ROWS; i++) {\n\t\t\t\n\t\t\txStart = midPoint - (NBRICKS_PER_ROW/2 * BRICK_WIDTH) - BRICK_WIDTH/2;\n\t\t\tlayRowOfBricks(xStart, yStart, i);\n\t\t\tyStart += BRICK_HEIGHT + BRICK_SEP;\n\t\t}\t\n\t}",
"public void push() throws EvaluationException {\n\t\tsetTimeout(Integer.MAX_VALUE);\n\t\tprintln(\"(push 1)\");\n\t\tcheckSuccess();\n\t\tsymbolsByStackPos.addLast(new HashSet<>());\n\t}"
] | [
"0.6856132",
"0.65183866",
"0.6239166",
"0.6219535",
"0.6166166",
"0.61102355",
"0.5998639",
"0.5825117",
"0.5740604",
"0.5737224",
"0.57295835",
"0.5678115",
"0.5657239",
"0.5651251",
"0.5635126",
"0.56228596",
"0.5614805",
"0.56003624",
"0.5566012",
"0.5537121",
"0.55332345",
"0.55300975",
"0.5523925",
"0.55195564",
"0.5511611",
"0.55112374",
"0.55030876",
"0.547875",
"0.5478271",
"0.54535747",
"0.54516613",
"0.5448812",
"0.5445415",
"0.54261607",
"0.542582",
"0.5407242",
"0.5407083",
"0.5403742",
"0.5386495",
"0.53833497",
"0.5371519",
"0.53690124",
"0.53665555",
"0.53634924",
"0.53586483",
"0.5334332",
"0.5331023",
"0.5317228",
"0.5302034",
"0.52972275",
"0.5294887",
"0.52932006",
"0.5291521",
"0.528871",
"0.52879846",
"0.5282242",
"0.5280627",
"0.5279016",
"0.5274945",
"0.526507",
"0.5256768",
"0.525338",
"0.524518",
"0.52434415",
"0.5240193",
"0.523201",
"0.5230648",
"0.52154356",
"0.5214785",
"0.52144986",
"0.521333",
"0.5213055",
"0.52033424",
"0.5198018",
"0.5195177",
"0.5190392",
"0.51874393",
"0.518031",
"0.5176141",
"0.51701605",
"0.51623267",
"0.5161965",
"0.51575005",
"0.51567316",
"0.51554775",
"0.5152536",
"0.514397",
"0.5143273",
"0.5141889",
"0.5140356",
"0.51347446",
"0.51323795",
"0.5129916",
"0.51252633",
"0.51248604",
"0.5121141",
"0.5121141",
"0.5121141",
"0.51098585",
"0.51081884"
] | 0.7678919 | 0 |
/ Full parameter constructor | public PhoneFundraiser(String inLoc, Candidate inCandidate)
{
super(inLoc,inCandidate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Parameters() {\n\t}",
"private Params()\n {\n }",
"public PowerMethodParameter() {\r\n\t\t\r\n\t\t//constructor fara parametru, utilizat in cazul in care utilizatorul nu introduce\r\n\t\t//fisierul sursa si nici fiesierul destinatie ca parametrii in linia de comanda\r\n\t\tSystem.out.println(\"****The constructor without parameters PowerMethodParameter has been called****\");\r\n\t\tSystem.out.println(\"You did not specify the input file and the output file\");\r\n\t\t\r\n\t}",
"public BaseParameters(){\r\n\t}",
"public LightParameter()\r\n\t{\r\n\t}",
"ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}",
"private LocalParameters() {\n\n\t}",
"public Constructor(){\n\t\t\n\t}",
"public ListParameter()\r\n\t{\r\n\t}",
"public Identity()\n {\n super( Fields.ARGS );\n }",
"Parameter createParameter();",
"public aed(World paramaqu)\r\n/* 9: */ {\r\n/* 10: 24 */ super(paramaqu);\r\n/* 11: */ }",
"public ahr(aqu paramaqu)\r\n/* 20: */ {\r\n/* 21: 34 */ super(paramaqu);\r\n/* 22: 35 */ a(0.25F, 0.25F);\r\n/* 23: */ }",
"public Parameter(Parameter template){\n\t\tthis(template.getName(),template.isRequired(),\n\t\t\t template.getType(),(T) template.getDefaultValue());\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"DefaultConstructor(int a){}",
"public Generic(){\n\t\tthis(null);\n\t}",
"public ModuleParams()\n\t{\n\t}",
"public bwq(String paramString1, String paramString2)\r\n/* 10: */ {\r\n/* 11: 9 */ this.a = paramString1;\r\n/* 12:10 */ this.f = paramString2;\r\n/* 13: */ }",
"defaultConstructor(){}",
"public UserParameter() {\n }",
"public JParameterRecord() {\n super(JParameter.PARAMETER);\n }",
"private Parameter(int key, String name, String value){\n this.key = key;\n this.name = name;\n this.value = value;\n }",
"Param createParam();",
"Param createParam();",
"Param createParam();",
"public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }",
"ConstuctorOverloading(int num){\n\t\tSystem.out.println(\"I am contructor with 1 parameter\");\n\t}",
"public ParamJson() {\n\t\n\t}",
"public Complex(){\r\n\t this(0,0);\r\n\t}",
"void DefaultConstructor(){}",
"public Field(){\n\n // this(\"\",\"\",\"\",\"\",\"\");\n }",
"public tn(String paramString, ho paramho)\r\n/* 12: */ {\r\n/* 13:11 */ super(paramString, paramho);\r\n/* 14: */ }",
"public Parameterized() {\n setParameters(null);\n }",
"public MLetter(Parameters parametersObj) {\r\n\t\tsuper(parametersObj);\r\n\t}",
"private void __sep__Constructors__() {}",
"public ParametersBuilder() {\n this(Parameters.DEFAULT);\n }",
"public Object[] getConstructorArgs ();",
"private FunctionParametersValidator() {}",
"public Clade() {}",
"public ListElement()\n\t{\n\t\tthis(null, null, null); //invokes constructor with 3 arguments\n\t}",
"Reproducible newInstance();",
"public u(b paramb)\r\n/* 7: */ {\r\n/* 8: 9 */ this.a = paramb;\r\n/* 9: */ }",
"public ModuleParams() {\n }",
"Fraction () {\n this (0, 1);\n }",
"private Point(int param, double value) {\r\n this(param, value, false);\r\n }",
"protected ParameterList(){\n //title = t;\n //cellWorld = cw;\n }",
"public ahb(ahd paramahd)\r\n/* 12: */ {\r\n/* 13: 36 */ this.d = paramahd;\r\n/* 14: */ }",
"public DepictionParameters() {\n this(200, 150, true, DEFAULT_BACKGROUND);\n }",
"public PotionEffect(int paramInt1, int paramInt2, int paramInt3)\r\n/* 21: */ {\r\n/* 22: 32 */ this(paramInt1, paramInt2, paramInt3, false, true);\r\n/* 23: */ }",
"public Card() { this(12, 3); }",
"public TParametrosVOImpl() {\r\n }",
"public ParameterizedInstantiateFactory() {\r\n super();\r\n }",
"private DBParameter() {\n }",
"public Property() {\n this(0, 0, 0, 0);\n }",
"private Font(long paramLong, Object paramObject) {\n/* 1031 */ this.a = paramLong;\n/* 1032 */ this.b = paramObject;\n/* */ }",
"public Pasien() {\r\n }",
"private Sequence() {\n this(\"<Sequence>\", null, null);\n }",
"Rectangle()\n {\n this(1.0,1.0);\n }",
"public FunctionVariable (Object names[])\n {\n super(names);\n }",
"public CacheFIFO(int paramInt)\r\n/* 11: */ {\r\n/* 12: 84 */ super(paramInt);\r\n/* 13: */ }",
"private FloatCtrl(long param1Long, String param1String1, float param1Float1, float param1Float2, float param1Float3, String param1String2) {\n/* 435 */ this(param1Long, new FCT(param1String1, null), param1Float1, param1Float2, param1Float3, param1String2);\n/* */ }",
"public bsm(PlayerStat paramtq)\r\n/* 7: */ {\r\n/* 8: 9 */ super(paramtq.e);\r\n/* 9:10 */ this.j = paramtq;\r\n/* 10: */ }",
"public lo(int paramInt1, int paramInt2, int paramInt3, int paramInt4, byte paramByte1, byte paramByte2, boolean paramBoolean)\r\n/* 26: */ {\r\n/* 27:33 */ this.a = paramInt1;\r\n/* 28:34 */ this.b = paramInt2;\r\n/* 29:35 */ this.c = paramInt3;\r\n/* 30:36 */ this.d = paramInt4;\r\n/* 31:37 */ this.e = paramByte1;\r\n/* 32:38 */ this.f = paramByte2;\r\n/* 33:39 */ this.g = paramBoolean;\r\n/* 34: */ }",
"public DISPPARAMS() {\n\t\t\tsuper();\n\t\t}",
"@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }",
"public ctq(File paramFile, String paramString, oa paramoa, ckh paramckh)\r\n/* 22: */ {\r\n/* 23: 33 */ super(paramoa);\r\n/* 24: 34 */ this.i = paramFile;\r\n/* 25: 35 */ this.j = paramString;\r\n/* 26: 36 */ this.k = paramckh;\r\n/* 27: */ }",
"private Instantiation(){}",
"public HandicapParameterSet() {\n }",
"MyArg(int value){\n this.value = value;\n }",
"public SeqArg(Argument a1, Argument a2){\n this.a1 = a1;\n this.a2 = a2;\n }",
"public Plato(){\n\t\t\n\t}",
"protected abstract void construct();",
"public Video( int arg1, int arg2 ) { \n\t\tsuper( );\n\t}",
"public MParameterSystem() {\n\t\tsuper();\n\t}",
"public Complex() {\n this(0);\n }",
"public CustomEntitiesTaskParameters() {}",
"public void init(Object[] parameters) {\n\n\t}",
"public Function() {\r\n\r\n\t}",
"public Parameter() {\n this.supersedePermission = new Permission<Parameter<T>>(\n Parameter.class, \"supersede\", this);\n }",
"public AdvancedCFG(String constructor){\n super(constructor);\n }",
"private static Constructor getZeroArgumentConstructor(Class cls) {\n \t\treturn ClassUtils.getConstructor(cls, new Class[] { }, zeroArgumentConstructors);\n \t}",
"public AST_EXP_VAR_PARAM_FUNC( AST_VAR var, String name ,AST_EXP_LIST expList)\r\n\t{\r\n\t\tsuper(var, name, AST_EXP_LIST.toNativeList(expList));\r\n\t}",
"public Person(String first, String last) {\n // Set instance var firstname to what is called from constructor\n this.firstName = first; \n // Set instance var lastname to what is called from constructor\n this.lastName = last;\n }",
"public Valvula(){}",
"public abstract Builder params(String... paramVarArgs);",
"@Test\n\tpublic void testProfessorConstructor2params(){\n\t\tString firstname = \"Steven\";\n\t\tString lastName = \"Beaty\";\n\t\tProfessor testProfessor = new Professor(firstname, lastName);\n\t\tAssert.assertEquals(\"Steven\", testProfessor.getFirstName());\n\t\tAssert.assertEquals(\"Beaty\", testProfessor.getLastName());\n\t}",
"public PotionEffect(int paramInt1, int paramInt2)\r\n/* 16: */ {\r\n/* 17: 28 */ this(paramInt1, paramInt2, 0);\r\n/* 18: */ }",
"public RankingParams() {\n this(\n null,\n null,\n null,\n null,\n null,\n null\n );\n }",
"public aed(World paramaqu, double paramDouble1, double paramDouble2, double paramDouble3)\r\n/* 14: */ {\r\n/* 15: 28 */ super(paramaqu, paramDouble1, paramDouble2, paramDouble3);\r\n/* 16: */ }",
"ComponentParameterInstance createComponentParameterInstance();",
"HxMethod createConstructor(final String... parameterTypes);",
"public static NewExpression new_(Constructor constructor) { throw Extensions.todo(); }",
"O() { super(null); }",
"public Bicycle() {\n // You can also call another constructor:\n // this(1, 50, 5, \"Bontrager\");\n System.out.println(\"Bicycle.Bicycle- no arguments\");\n gear = 1;\n cadence = 50;\n speed = 5;\n name = \"Bontrager\";\n }",
"MultilineParameters() {\n this(0);\n }",
"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}",
"public Value(){}",
"T newInstance(Object... args);",
"public MyPoint1 (double x, double y) {}",
"public no(np paramnp)\r\n/* 13: */ {\r\n/* 14:30 */ this.b = paramnp;\r\n/* 15: */ }"
] | [
"0.7103839",
"0.6999525",
"0.69732445",
"0.6966228",
"0.6895388",
"0.68377775",
"0.67152125",
"0.6671872",
"0.6667296",
"0.6655452",
"0.65853184",
"0.65807813",
"0.6552759",
"0.65096265",
"0.6499005",
"0.6486593",
"0.64824444",
"0.64678514",
"0.6454637",
"0.6452922",
"0.64360094",
"0.6405186",
"0.63786644",
"0.637021",
"0.637021",
"0.637021",
"0.6367035",
"0.63439006",
"0.63167834",
"0.6314797",
"0.63002837",
"0.6298203",
"0.6292246",
"0.6282737",
"0.62782097",
"0.62691563",
"0.62624824",
"0.62616134",
"0.62555903",
"0.6232637",
"0.6220592",
"0.6211534",
"0.620943",
"0.61977106",
"0.6157914",
"0.61551315",
"0.6136925",
"0.61299205",
"0.61281174",
"0.61216736",
"0.6121284",
"0.611978",
"0.6097484",
"0.6091927",
"0.60818255",
"0.60708463",
"0.60565645",
"0.60517234",
"0.6036702",
"0.6029158",
"0.60201705",
"0.6020115",
"0.600201",
"0.5992006",
"0.598983",
"0.5988223",
"0.5969481",
"0.5968306",
"0.59673595",
"0.5965256",
"0.5964706",
"0.5960863",
"0.595488",
"0.5938618",
"0.5933279",
"0.5930838",
"0.5926422",
"0.5925028",
"0.5923007",
"0.5912437",
"0.5912231",
"0.59059924",
"0.59053993",
"0.5905139",
"0.5904837",
"0.58987224",
"0.58975995",
"0.5892117",
"0.5889557",
"0.5885468",
"0.58854675",
"0.58749425",
"0.5873348",
"0.58701247",
"0.5869712",
"0.58677846",
"0.5866619",
"0.5866017",
"0.5860953",
"0.585883",
"0.5858775"
] | 0.0 | -1 |
/ The toString function converts a fundraiser to a string usually for printing | public String toString()
{
return getCandidate().getName() + "'s phone fundraiser takes place in: " + getLocation() + " and has " + getDonors() + " donors attending.\n";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"String toString();",
"public String toString() { return \"Freeform\"; }",
"public String toString(){\r\n return \"Depreciating\" + super.toString() + \" rate: \" + String.format(\"%.1f\", rate) + \"%\";\r\n }",
"@Override\n public String toString() {\n return name + \" Funds: £\" + funds +\n \", Shares: A[\" + shares.get(0) + \"], B[\" + shares.get(1) + \"], C[\" + shares.get(2) +\n \"], D[\" + shares.get(3) + \"], E[\" + shares.get(4) + \"]\";\n }",
"public String toString() ;",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString();",
"public String toString(){\n String r = \"\";\n String s = \"\";\n switch(rank){\n case 1: r = \"Ace\"; break;\n case 2: r = \"Two\"; break;\n case 3: r = \"Three\"; break;\n case 4: r = \"Four\"; break;\n case 5: r = \"Five\"; break;\n case 6: r = \"Six\"; break;\n case 7: r = \"Seven\"; break;\n case 8: r = \"Eight\"; break;\n case 9: r = \"Nine\"; break;\n case 10: r = \"Ten\"; break;\n case 11: r = \"Jack\"; break; \n case 12: r = \"Queen\"; break;\n case 13: r = \"King\"; break;\n }\n \n switch(suit) {\n case 1: s = \" of Clubs\"; break;\n case 2: s = \" of Diamonds\"; break;\n case 3: s = \" of Hearts\"; break;\n case 4: s = \" of Spades\"; break;\n }\n return r + s; //returns the name of the card\n }",
"public String toString() { return stringify(this, true); }",
"public String toString() {\r\n\t\t\r\n\t\tString cardSuit = \"\";\r\n\t\tString cardRank = \"\";\r\n\t\tString cardString = \"\";\r\n\t\t\r\n\t\t\r\n\t\tint cs = getSuit();\r\n\t\tint cr = getRank();\r\n\t\t\r\n\t\tswitch(cr) {\r\n\t\tcase 1:\r\n\t\t\tcardRank = \"ace\";\r\n\t\t\tbreak;\r\n\t\tcase 2: \r\n\t\t\tcardRank =\"2\";\r\n\t\t\tbreak;\r\n\t\tcase 3: \r\n\t\t\tcardRank =\"3\";\r\n\t\t\tbreak;\r\n\t\tcase 4:\r\n\t\t\tcardRank =\"4\";\r\n\t\t\tbreak;\r\n\t\tcase 5:\r\n\t\t\tcardRank =\"5\";\r\n\t\t\tbreak;\r\n\t\tcase 6:\r\n\t\t\tcardRank =\"6\";\r\n\t\t\tbreak;\r\n\t\tcase 7:\r\n\t\t\tcardRank =\"7\";\r\n\t\t\tbreak;\r\n\t\tcase 8:\r\n\t\t\tcardRank =\"8\";\r\n\t\t\tbreak;\r\n\t\tcase 9:\r\n\t\t\tcardRank =\"9\";\r\n\t\t\tbreak;\r\n\t\tcase 10:\r\n\t\t\tcardRank =\"10\";\r\n\t\t\tbreak;\r\n\t\tcase 11:\r\n\t\t\tcardRank =\"jack\";\r\n\t\t\tbreak;\r\n\t\tcase 12:\r\n\t\t\tcardRank =\"queen\";\r\n\t\t\tbreak;\r\n\t\tcase 13:\r\n\t\t\tcardRank =\"king\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tcardRank = \"n/a\";\r\n\t\t\t\r\n\t\t}//switch rank\r\n\t\t\r\n\t\t//got a string representation of the rank\r\n\t\t//now get a string representation of the siut\r\n\t\t\r\n\t\tswitch(cs) {\r\n\t\tcase 0:\r\n\t\t\tcardSuit = \"hearts\";\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t\tcardSuit = \"diamonds\";\r\n\t\t\tbreak;\r\n\t\tcase 2:\r\n\t\t\tcardSuit = \"clubs\";\r\n\t\t\tbreak; \r\n\t\tcase 3:\r\n\t\t\tcardSuit = \"spades\";\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tcardSuit = \"n/a\";\r\n\t\t\t\r\n\t\t}\r\n\t\tcardString = \"file:cards/\"+cardRank+\"_of_\"+cardSuit+\".png\";\r\n\t\t\r\n\t\treturn cardString;\r\n\t\t\r\n\t}",
"@Override\n public String toString(){\n String printString = profile.toString();\n printString = printString + \"Payment $\";\n printString = printString + payDue;\n return printString;\n }",
"public String toString(){\r\n String output = \"\";\r\n //Display the name \r\n output += this.name;\r\n //Turn the cost int in cents to a string in dollars\r\n String totalcost = DessertShoppe.cents2dollarsAndCents(getCost());\r\n //Print out a space between the name and where the cost needs to be\r\n for (int i = this.name.length(); i < DessertShoppe.RECEIPT_WIDTH - totalcost.length(); i++){\r\n output+=\" \";\r\n }\r\n //Print outt he cost string with the dollar sign\r\n output += totalcost;\r\n return output;\r\n \r\n }",
"public String writeToString() {\n\t\tString s = \"\"; \n\t\ts += this.term + \",\" + this.interestRate;\n\t\treturn s;\n\t}",
"@Override String toString();",
"public String toString()\n\t{\n\t\tString output = \"\";\n\t\tfor (int i = 0; i < 20; i++)\n\t\t{\n\t\t\tString animalType = \"Fish\";\n\t\t\tString genderType = \"F\";\n\t\t\t\n\t\t\tif (river[i] != null)\n\t\t\t{\n\t\t\t\tif (river[i].getGender()) { genderType = \"M\"; }\n\t\t\t\tif (river[i] instanceof Bear) { animalType = \"Bear\"; }\n\t\t\t output += String.format(\"Index %d: %s (Gender: %s | Strength: %.1f)\\n\", i, animalType, genderType, river[i].getStrength());\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\toutput += String.format(\"Index %d: \\n\", i);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}",
"public String toString() {\n\t\tString s1,s2,s3,s4;\r\n\t\ts1 = \"{FIR ID: \"+id + \"\\nname= \" + name + \", phone number=\" + phone_no \r\n\t\t\t\t+\"\\nDate: \"+filing_date+\", Address: \" +address\r\n\t\t\t\t+\"\\nFIR Category: \"+category;\r\n\t\t\r\n\t\tif(statement_uploaded) {\r\n\t\t\ts2 = \", Statement Uploaded\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\ts2 = \", Statement Not Uploaded\";\r\n\t\t}\r\n\t\tif(id_proof_uploaded) {\r\n\t\t\ts3 = \", ID Proof Uploaded\";\r\n\t\t}\r\n\t\telse {\r\n\t\t\ts3 = \", ID Proof Not Uploaded\";\r\n\t\t}\r\n\t\ts4 = \"\\nStatus : \"+status+\"}\";\r\n\t\treturn s1+s2+s3+s4;\r\n\t}",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"public abstract String toString();",
"@Override\n\tString toString();",
"@Override\n public String toString(\n ){\n return toXRI(); \n }",
"public String toString() {\n switch (this) {\n case INDIAN_ROSEWOOD:\n return \"Indian Rosewood\";\n case BRAZILIAN_ROSEWOOD:\n return \"Brazilian Rosewood\";\n case MAHOGANY:\n return \"Mahogany\";\n case MAPLE:\n return \"Maple\";\n case COCOBOLO:\n return \"Cocobolo\";\n case CEDAR:\n return \"Cedar\";\n case ADIRONDACK:\n return \"Adirondack\";\n case ALDER:\n return \"Alder\";\n case SITKA:\n return \"Sitka\";\n }\n return null;\n }",
"public String toString(){\r\n return this.deskripsi;\r\n }",
"public String toString(){\n\n\t\t/*\n\t\t *Puts the rental and due dates into two nicely formated\n\t\t *Strings.\n\t\t */\n\t\tdf.setCalendar(bought);\n\t\tString jazz = df.format(bought.getTime());\n\t\tdf.setCalendar(boughtReturn);\n\t\tString jazz2 = df.format(boughtReturn.getTime());\n\n\t\t/*\n\t\t * Returns the components of the DVD class. Categories are \n\t\t * highlighted in red using html codes.\n\t\t */\n\t\treturn \"<html><font color='red'>Name: </font>\" + \n\t\t getNameofRenter() + \", <font color='red'>Title: </font>\" + \n\t\tgetTitle() + \", <font color='red'>Rented On: </font>\"+ jazz + \n\t\t\", \" + \"<font color='red'>Due Back On: </font>\"+ jazz2;\n\n\t}",
"public String toString(){\n String out = \"\";\n for(Flight currentFlight : flights){\n out += currentFlight.toString() + \"\\n\";\n }\n for(Availability currentAvailability : availabilities){\n out += currentAvailability.toString() + \"\\n\";\n }\n for(Price currentPrice : prices){\n out += currentPrice.toString() + \"\\n\";\n }\n out += flightSponsored.toString() + \"\\n\";\n return out;\n }",
"@Override\n public final String toString() {\n return asString(0, 4);\n }",
"public String toString() {\n // return \"Card {suit: \"+getSuitString()+\", rank: \"+getRankString()+\"}\";\n return \"{\"+getSuitString()+\",\"+getRankString()+\"}\";\n }",
"public String toString() {\n StringBuilder str = new StringBuilder(); \n str.append(\"NAME\\t TICKER\\t PRICE\\t # SHARES\\t\\n\"); \n str.append(String.format(\"%1$-\" + 15 + \"s\", \"NAME\") +\n String.format(\"%1$-\" + 15 + \"s\", \"TICKER\") +\n String.format(\"%1$-\" + 15 + \"s\", \"PRICE\") +\n String.format(\"%1$-\" + 15 + \"s\", \"# SHARES\")); \n /*\n for (Stock s : stocks) {\n str.append(String.format(\"%1$-\" + 15 + \"s\", s.getName()) +\n String.format(\"%1$-\" + 15 + \"s\", s.getTicker()) + \n String.format(\"%1$-\" + 15 + \"s\", s.getCurrentPrice().toString()) + \n String.format(\"%1$-\" + 15 + \"s\", s.getVolume())); \n str.append(\"\\n\");\n }\n */\n return str.toString(); \n }",
"@Override\n public String toString() {\n // TODO this is a sudo method only for testing puroposes\n return \"{name: 5aled, age:15}\";\n }",
"public String toString() {\n final StringBuilder buffer = new StringBuilder() ;\n final DecimalFormat df = new DecimalFormat( \"#00.00\" ) ;\n\n buffer.append( StringUtil.rightPad( this.symbol, 20 ) ) ;\n buffer.append( StringUtil.leftPad( \"\" + getNumActiveCashUnits(), 5 ) ) ;\n buffer.append( StringUtil.leftPad( df.format( this.avgCashUnitPrice ), 10 ) ) ;\n buffer.append( StringUtil.leftPad( df.format( this.realizedProfit ), 10 ) ) ;\n buffer.append( StringUtil.leftPad( df.format( getUnRealizedCashProfit() ), 10 ) ) ;\n\n return buffer.toString() ;\n }",
"@Override public String toString();",
"public String toString() {\n System.out.println(this.getName() +\":\");\n System.out.println(\"Balance: $\" + this.getBalance());\n System.out.println(\"Monthly Interest: $\" + this.getMonthlyInterest());\n System.out.println(\"Date Created: \" + this.getDateCreated());\n System.out.println();\n return \"\";\n }",
"@Override\r\n String toString();",
"public String toString() {\n DecimalFormat f1 = new DecimalFormat(\"#,###\");\n if (gender) {\n return \"\" + f1.format(numsBaby) + \" girls named \" + name + \" in \" + year;\n } else {\n return \"\" + f1.format(numsBaby) + \" boys named \" + name + \" in \" + year;\n\n }\n }",
"public String toString();",
"@Override\n public String toString(){\n String str = null;\n for (BuddyInfo bud : buddies) {\n str += bud.toString() + \"\\n\";\n }\n return str;\n }",
"public String toString() {\n\t\tString result = myBurger.toString();\n\t\treturn result;\n\t}",
"public String toString() {\r\n\t\tif (rank == 1) {\r\n\t\t\treturn \"slayer\";\r\n\t\t} else if (rank == 2) {\r\n\t\t\treturn \"scout\";\r\n\t\t} else if (rank == 3) {\r\n\t\t\treturn \"dwraf\";\r\n\t\t} else if (rank == 4) {\r\n\t\t\treturn \"elf\";\r\n\t\t} else if (rank == 5) {\r\n\t\t\treturn \"lavaBeast\";\r\n\t\t} else if (rank == 6) {\r\n\t\t\treturn \"sorceress\";\r\n\t\t} else if (rank == 7) {\r\n\t\t\treturn \"beastRider\";\r\n\t\t} else if (rank == 8) {\r\n\t\t\treturn \"knight\";\r\n\t\t} else if (rank == 9) {\r\n\t\t\treturn \"mage\";\r\n\t\t} else {\r\n\t\t\treturn \"dragon\";\r\n\t\t}\r\n\r\n\t}",
"public String toString() {\r\n\t\tString str;\r\n\t\tstr = (super.toString() + matureToString());\r\n\r\n\t\treturn str;\r\n\t}",
"@Override\n\tpublic String toString() {\n\t\tif (repr == null)\n\t\t\trepr = toString(null);\n\n\t\treturn repr;\n\t}"
] | [
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67507774",
"0.67400163",
"0.6597778",
"0.65675884",
"0.6558628",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.6558571",
"0.654627",
"0.6522338",
"0.65080225",
"0.64985853",
"0.6471077",
"0.6465277",
"0.64090675",
"0.6385466",
"0.63829297",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63721937",
"0.63631123",
"0.636073",
"0.63445807",
"0.63350725",
"0.6334177",
"0.63293165",
"0.6322651",
"0.63116205",
"0.6311513",
"0.6309056",
"0.62996095",
"0.6296497",
"0.6295287",
"0.6294471",
"0.6274229",
"0.6274044",
"0.62725085",
"0.6266772",
"0.6262196",
"0.6256698",
"0.62493604"
] | 0.6362406 | 80 |
/ The raiseMoney function is how to initiate a fundraiser | public int raiseMoney()
{
int total = super.raiseMoney();
getCandidate().setMoneyMod(getCandidate().getMoneyMod() - .05);
return total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void payEconomical() {\n if (this.balance >= 2.50) {\n this.balance -= 2.50;\n }\n }",
"void payBills();",
"@Override\n\tvoid money() {\n\t\t\n\t}",
"private void handleRaiseFund()\n {\n\n Doctor selectedDoctor = selectDoctor(); // will be null if the doctor is occupied\n\n // TODO:\n // step 1. check to see if selectedDoctor is occupied, if the selectedDoctor is occupied, add the string\n // \"Please select a unoccupied doctor.\\n\" to the printResult ArrayList and output the ArrayList to the log\n // window by calling updateListViewLogWindow(), and then return from this method\n // step 2. if the selectedDoctor is not occupied,\n // a. use the doctor object to call raiseFund(), add the returned value to the money of the human\n // player using humanPlayer.collectMoney()\n // b. end the turn for the selectedDoctor\n // c. add the string selectedDoctor.getName() + \" raises \"+fundAmount+\" successfully.\\n\" to\n // printResult where fundAmount is the amount returned by raiseFund() in step 2a\n // d. output the printResult by updateListViewLogWindow()\n // e. now after the selecteddoctor raised the fund, the money of the player is changed, and also the\n // status of the selectedDoctor is also changed (from unoccupied to occupied). So we need to update\n // the display in UI to reflect the changes. To do that we call updateHumanPlayerMoney() and\n // updateListViewDoctorItems()\n // f. set listViewSelectedDoctor to null, this is a string holding all the name, specialty, skill level,\n // salary etc information of the doctor being selected to raise fund. The selectDoctor()\n // method extract the name to search for the doctor object from the doctors list of the player.\n // WE ASSUME DOCTOR NAMES ARE UNIQUE, if this is not the case, selectDoctor() will not work correctly\n if(selectedDoctor == null){ //1\n printResult.add(\"Please select a unoccupied doctor.\\n\");\n updateListViewLogWindow();\n return;\n }\n int fundAmount = selectedDoctor.raiseFund();//a\n humanPlayer.collectMoney(fundAmount);\n selectedDoctor.endTurn();//b\n printResult.add(selectedDoctor.getName() + \" raises \"+fundAmount+\" successfully.\\n\");//c\n updateListViewLogWindow();//d\n updateHumanPlayerMoney();//e\n updateListViewDoctorItems();\n listViewSelectedDoctor = null;//f\n }",
"public void recordPurchase(double amount)\n {\n balance = balance - amount;\n // your code here\n \n }",
"@Override\n public void withdraw(double amount) //Overridden method\n {\n elapsedPeriods++;\n \n if(elapsedPeriods<maturityPeriods)\n {\n double fees = getBalance()*(interestPenaltyRate/100)*elapsedPeriods;\n super.withdraw(fees);//withdraw the penalty\n super.withdraw(amount);//withdraw the actual amount\n \n }\n \n }",
"public abstract String withdrawAmount(double amountToBeWithdrawn);",
"@Override\n\tpublic void withdraw(int money) {\n\t\t\n\t}",
"public void withdraw (double amount)\n {\n super.withdraw (amount);\n imposeTransactionFee ();\n }",
"public void consumeFuel(double amount);",
"private void makeDeposit() {\n\t\t\r\n\t}",
"public void addMoney(double profit){\n money+=profit;\n }",
"public void makeDeposit() {\n deposit();\n }",
"public void companyPayRoll(){\n calcTotalSal();\n updateBalance();\n resetHoursWorked();\n topBudget();\n }",
"public void enterPayment(int coinCount, Coin coinType)\n {\n balance = balance + coinType.getValue() * coinCount;\n // your code here\n \n }",
"public void withdraw(float amount) {}",
"public void withdraw(float amount) {}",
"void setIncome(double amount);",
"public void addMoney(final int newMoney) {\n\t\taddBehaviour(\n new OneShotBehaviour() {\n public void action() {\n budget += newMoney;\n System.out.println(newMoney + \" is added to wallet\");\n }\n }\n ); \n refreshGUI();\n }",
"public void ventaBilleteMaquina1()\n {\n maquina1.insertMoney(500);\n maquina1.printTicket();\n }",
"@Override\n\tpublic void businessMoney() {\n\n\t}",
"double getMoney();",
"@Override\n protected void withdraw(int request, boolean isOverdraft){\n if(request>0){\n request += SERVICE_FEE;\n }\n //need to change both balances just in case there was a LARGE_DEPOSIT \n //making it so that the 2 balance values differ\n setBalance(getBalance() - request);\n setBalanceAvailable(getBalanceAvailable() - request);\n }",
"public void newFund(int year, int order, long yourCoins, long partnerCoins) {\n /* Do nothing */\n }",
"public void applyInterest()\n {\n deposit( (getBalance()* getInterestRate()) /12);\n }",
"public void deposit(double value){\r\n balance += value;\r\n}",
"void addIncomeToBudget();",
"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\tpublic void payRent(RentDue d) {\n\t\t\n\t}",
"abstract Valuable createMoney(double value);",
"public void Deposit(double ammount){\n abal = ammount + abal;\n UpdateDB();\n }",
"public double pay()\r\n{\r\ndouble pay = hoursWorked * payRate;\r\nhoursWorked = 0;\r\nreturn pay;\r\n//IMPLEMENT THIS\r\n}",
"int getMoney();",
"public Object creditEarningsAndPayTaxes()\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setInitialCash : \" + \"Agent\");\r\n/* 144 */ \tgetPriceFromWorld();\r\n/* 145 */ \tgetDividendFromWorld();\r\n/* */ \r\n/* */ \r\n/* 148 */ \tthis.cash -= (this.price * this.intrate - this.dividend) * this.position;\r\n/* 149 */ \tif (this.cash < this.mincash) {\r\n/* 150 */ \tthis.cash = this.mincash;\r\n/* */ }\t\r\n/* */ \r\n/* 153 */ \tthis.wealth = (this.cash + this.price * this.position);\r\n/* */ \r\n/* 155 */ \treturn this;\r\n/* */ }",
"public void claimDollars() {\n if (totalSpent >= 5000) {\n airlineDollars += ( ((totalSpent - (totalSpent % 5000)) / 5000) * 400);\n totalSpent = totalSpent % 5000;\n }\n }",
"@Override\n\tpublic void deposit(int money) {\n\t\t\n\t}",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewCapitalPayed();",
"@Override\n\tpublic void tranfermoney() {\n\t\tSystem.out.println(\"hsbc tranfermoney\");\n\t}",
"public static void deposit(){\n TOTALCMONEY = TOTALCMONEY + BALANCEDEPOSIT; //the cashier money equals the cashier money plus the amount that is being deposited\r\n BALANCE = BALANCE + BALANCEDEPOSIT; //the user balance equals the user balance plus the amount that is being deposited\r\n }",
"public void autoPay() {}",
"public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}",
"public void annualProcess() {\n super.withdraw(annualFee);\n }",
"public static void main(String[] args) {\n\t\t Scanner input=new Scanner(System.in);//Input through Scanner Class\n\t\t System.out.println(\"You have Rs 500 in account\"); \n\t\t System.out.println(\"Enter the amount to be withdrawed\");\n\t\t int amount = input.nextInt();\n\t\t //Enter the amount \n\t\t CurrentAccount deposit=new CurrentAccount();\n\t\t payment(deposit, amount);\n\t\t //Withdraw the amount from bank\n\t\t System.out.println(\"Enter the amount to be deposited\");\n\t\t amount = input.nextInt();\n\t deposit(new SavingsAccount(), amount);\n //Deposit the amount bank\n }",
"public void buyStock(double askPrice, int shares, int tradeTime) {\n }",
"public void doIt() throws InsufficientFundsException {\n\t\tBehaviourInjector behaviourInjector = new BehaviourInjector();\r\n\t\tbehaviourInjector.addResource(\"em\", dbHelper.getEntityManager());\r\n\t\tbehaviourInjector.addResource(\"sc\", new SecurityContextMock());\r\n\t\t\r\n\t\t// convert the domain object into a role, and inject the relevant role methods into it\r\n\t\tISourceAccount_Role source = behaviourInjector.inject(\r\n\t\t\t\tsourceAccount, //domain object\r\n\t\t\t\tSourceAccount_Role.class, //class providing all the impl\r\n\t\t\t\tISourceAccount_Role.class); //the entire role impl\r\n\r\n\t\t//now do the withdraw interaction, get some cash and go shopping!\r\n\t\tsource.withdraw(amount);\r\n\t}",
"public double makeAPayment(double annualLeaseAmount){\n double paymentMade = 0.0;//\n return paymentMade;\n /*Now it's 0.0. There must be a place somewhere\n that has a 'make a payment'\n button or text field or whatever...\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ \n }",
"public void ventaBilleteMaquina2()\n {\n maquina2.insertMoney(600);\n maquina1.printTicket();\n }",
"void setIncome(double newIncome) throws BankException {\n throw new BankException(\"This account does not support this feature\");\n }",
"@Override\r\n public double purchaseFee(){\r\n return fee;\r\n }",
"public void setAmount(double amount) {\nloanAmount = amount;\n}",
"@Override\r\n\tvoid withdraw(double amount) {\n\t\tsuper.withdraw(amount);\r\n\t\tif(minimumblc>500)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"you have withdraw rupees\"+ (amount));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"withdraw failed \");\r\n\t\t}\r\n\t\t\r\n\t}",
"public void withdraw(double ammount) throws insufficientFunds{\n if(ammount > abal)\n throw new insufficientFunds();\n else{\n ammount = abal - ammount;\n UpdateDB();\n }\n }",
"@WebMethod public void addBetMade(Account user, Bet bet, float money);",
"@Override\n\tpublic void passedBy() {\n\t\tMonopolyGameController.getInstance();\n\t\tMonopolyGameController.getCurrentPlayer().increaseMoney(250);\n\t\tLogger.getInstance().notifyAll(MonopolyGameController.getCurrentPlayer().getName()+ \" gained 250 dollars by landing on Bonus Square\");\n\n\t}",
"public void cashReceipt(int amount){\r\n System.out.println(\"Take the receipt\");\r\n }",
"private void makeWithdraw() {\n\t\t\r\n\t}",
"void chargeTf(double amount);",
"public abstract void withdraw(float amount);",
"public synchronized void applyFee() {\r\n balance -= FEE;\r\n }",
"void setExpenses(double amount);",
"public void payFees(int fees) {\n feesPaid += fees;\n School.updateTotalMoneyEarned(feesPaid);\n }",
"@Override\r\n public void dispenseProduct() {\r\n System.out.println(\"Insufficient funds!\");\r\n\r\n }",
"public void deposit (double amount)\n {\n imposeTransactionFee ();\n super.deposit (amount);\n }",
"void deposit(int value)//To deposit money from the account\n {\n balance += value;\n }",
"CarPaymentMethod processHotDollars();",
"public final void payBills() {\n if (this.isBankrupt) {\n return;\n }\n Formulas formulas = new Formulas();\n if ((getInitialBudget() - formulas.monthlySpendings(this)) < 0) {\n setBankrupt(true);\n }\n setInitialBudget(getInitialBudget() - formulas.monthlySpendings(this));\n }",
"int getBonusMoney();",
"public void calculatePayment() {}",
"private static void setBudget() {\n\t\tSystem.out.println(\"How much is the budget:\");\n\t\tScanner scan = new Scanner(System.in);\n\t\tint input = scan.nextInt();\n\t\tbudget = input;\n\t\tSystem.out.println(\"Budget Entry successfull:\"+budget);\n\t}",
"public void surrender() {\n playerCash += playerBet / 2;\n\n //Play dealer's turn\n dealerTurn();\n\n //End the game and change the views\n restartGame();\n }",
"public void createExpense(ExpenseBE expenseBE) {\n\n }",
"public void mutualFund(){\n\t\tSystem.out.println(\"HSBC BANK :: MUTUAL FUND\");\n\t}",
"void deposit(double Cash){\r\n\t\tbalance=balance+Cash;\r\n\t}",
"public static void amountPaid(){\n NewProject.tot_paid = Double.parseDouble(getInput(\"Please enter NEW amount paid to date: \"));\r\n\r\n UpdateData.updatePayment();\r\n updateMenu();\t//Return back to previous menu.\r\n\r\n }",
"ch.crif_online.www.webservices.crifsoapservice.v1_00.Amount addNewAmount();",
"@Test\n public void testGiveChange() throws Exception {\n System.out.println(\"giveChange\");\n //CashRegister instance = new CashRegister();\n assertEquals(0.0, instance.giveChange(), EPSILON);\n instance.scanItem(0.55);\n instance.scanItem(1.27);\n double expResult = 0.18;\n instance.collectPayment(Money.QUARTER, 8);\n double result = instance.giveChange();\n assertEquals(expResult, result, EPSILON);\n \n }",
"public void transferMoney(float amount, String transferToNumber) {}",
"private void initiateBuyRiotPointsEnter(JFrame frame, JTextField account, JTextField amount) {\r\n JButton enter = new JButton(\"Confirm\");\r\n new Confirm(enter);\r\n// enter.setPreferredSize(new Dimension(100, 100));\r\n// enter.setFont(new Font(\"Arial\", Font.PLAIN, 20));\r\n enter.addActionListener(new ActionListener() {\r\n @Override\r\n public void actionPerformed(ActionEvent actionEvent) {\r\n try {\r\n int designated = Integer.parseInt(amount.getText());\r\n selectLeagueOfLegendsAccount(account.getText()).purchasePremium(designated);\r\n displayMessage(printRiotPointsBalance(selectLeagueOfLegendsAccount(account.getText())));\r\n } catch (ImpossibleValue e) {\r\n displayMessage(\"Reload failed, invalid input.\");\r\n }\r\n frame.setVisible(false);\r\n }\r\n });\r\n frame.add(enter);\r\n }",
"public AmountOfMoney pay(AmountOfMoney paidAmount) throws InsufficientFundsException{\n AmountOfMoney change = sale.payForSale(paidAmount);\n SaleDTO finalSaleInformation = sale.getSaleData();\n reciept = new Receipt(finalSaleInformation, change, paidAmount);\n registryCreator.getExternalSystems().updateAccountingSystem(finalSaleInformation);\n registryCreator.getExternalSystems().updateInventorySystem(finalSaleInformation);\n printer.printReciept(reciept);\n \n\n return change;\n\n }",
"public abstract double pay();",
"public Money getInterestDue();",
"@Override\n\tpublic void OkHereIsMoney(double amount) {\n\t\t\n\t}",
"@Override\n\tpublic void DepositMoney(Gamers gamer) {\n\t\tSystem.out.println(\"Lütfen yatıracağınız para miktarını giriniz\");\n\t\tint newDepositMoney;\n\t\tnewDepositMoney=sc.nextInt();\n\t\tsc.nextLine();\n\t\tgamer.setWalletBalance(gamer.getWalletBalance()+newDepositMoney);\n\t\tdbserviceadaptors.Save(gamer);\n\t\tSystem.out.println(\"Yeni bakiyeniz \"+gamer.getWalletBalance()+\" olarak güncellendi.\");\n\t\t\n\t}",
"public void transferMoney() {\n\t\tSystem.out.println(\"HSBC---transferMoney\");\n\t}",
"public void OpeningBalance (double open)\t{\n\t\tbalance = balance + open;\n\t\t}",
"@Override\n public void withdraw(double amount) {\n try {\n if (amount > 1000) {\n throw new InvalidFundingAmountException(amount);\n }\n if (this.getBalance() < 5000) {\n throw new InsufficientFundsException(amount);\n }\n doWithdrawing(amount);\n } catch (BankException e) {\n System.out.println(e.getMessage());\n }\n }",
"private static int requestStartingFunds() {\n Scanner scanner = new Scanner(System.in);\n System.out.print(\"How much money would you like to bring to Las Vegas?\\t\");\n return scanner.nextInt();\n }",
"public void determineWeeklyPay(){\r\n weeklyPay = commission*sales;\r\n }",
"@Override\n\tpublic int withdraw(double amount) throws RaiseException {\n\t\tValidator.validateWithdraw(this.getBalance(), amount);\n\t\tif(amount <= this.getBalance()) {\n\t\t\tthis.setBalance(this.getBalance() - amount);\n\t\t\t\n\t\t\t//create a transaction and adding it to the list of transactions of this account \n\t\t\tTransaction tmpTransaction = new Transaction(amount, EnumTypeTransaction.withdraw);\n\t\t\tthis.addTransaction(tmpTransaction);\n\t\t\t\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}",
"public static void extract_money(){\n TOTALCMONEY = TOTALCMONEY - BALANCERETRIEVE; //the total cashier money equals the total cashier money minus the retrieve request\r\n BALANCE = BALANCE - BALANCERETRIEVE; //the user balance equals the account minus the retrieve request\r\n }",
"private JPanel withdrawMoney() {\n JPanel withdraw = new JPanel();\n currentMoneyLabel = new JLabel(String.format(\"<html>Current Available Money in Machine:<b>$%.2f</html>\", moneyInMachine));\n withdraw.add(currentMoneyLabel);\n withdraw.add(Box.createHorizontalStrut(15));\n JButton withdrawButton = new JButton(\"withdraw funds\");\n withdrawButton.addActionListener(new withdrawMoneyListen());\n withdraw.add(withdrawButton);\n return withdraw;\n }",
"public void mutualFund(){\r\n\t\tSystem.out.println(\"HSBC ---mutualFund method called from Interface BrazilBank\");\r\n\t}",
"public void setMoney(double money) {\n this.money = money;\n }",
"public void deposit(double amount)\n {\n startingBalance += amount;\n }",
"public void addBalance() {\r\n List<String> choices = new ArrayList<>();\r\n choices.add(\"10\");\r\n choices.add(\"20\");\r\n choices.add(\"50\");\r\n ChoiceDialog<String> addBalanceDialog = new ChoiceDialog<>(\"10\", choices);\r\n addBalanceDialog.setTitle(\"Add Balance\");\r\n addBalanceDialog.setContentText(\"Please enter the balance you want to add\");\r\n Optional<String> result = addBalanceDialog.showAndWait();\r\n result.ifPresent(\r\n s -> cardSelected.addMoney(Double.parseDouble(addBalanceDialog.getSelectedItem())));\r\n }",
"public void submitMoney(int rdID) {\n\t\t((BorrowDAL)dal).submitMoney(rdID);\r\n\t}",
"public void buyIn(double buyingAmount) {\n if (bankroll > buyingAmount) {\n bankroll -= buyingAmount;\n activePlayer = true;\n }\n }",
"public void handleNewAuctionRound(int roundNumber, int amount, long price);",
"public void financialCrisis() {}",
"private void setWallet(int dollars) {\n\t\twallet += dollars;\n\t}"
] | [
"0.66318417",
"0.65548545",
"0.65378386",
"0.65171295",
"0.6512932",
"0.6382306",
"0.6337957",
"0.63301224",
"0.62874967",
"0.62535864",
"0.62473124",
"0.62347156",
"0.6233003",
"0.62221",
"0.62208235",
"0.6190269",
"0.6190269",
"0.61759585",
"0.6163861",
"0.6154842",
"0.6128708",
"0.61183465",
"0.6115896",
"0.6114142",
"0.6106151",
"0.6105592",
"0.6100661",
"0.60668415",
"0.6058407",
"0.6049536",
"0.60455054",
"0.60392106",
"0.6028737",
"0.60262716",
"0.6021555",
"0.6010687",
"0.59917855",
"0.59750354",
"0.59737384",
"0.5971079",
"0.5970686",
"0.5966101",
"0.59564036",
"0.5955681",
"0.5955497",
"0.5941319",
"0.5930175",
"0.5922152",
"0.5914686",
"0.5909619",
"0.59028214",
"0.59027",
"0.59005576",
"0.5900416",
"0.5896994",
"0.5888532",
"0.5887623",
"0.58842796",
"0.58804035",
"0.5879373",
"0.5879145",
"0.5871311",
"0.5869446",
"0.58664113",
"0.5859243",
"0.58549064",
"0.5844444",
"0.5840982",
"0.58400303",
"0.5840007",
"0.5839478",
"0.5829864",
"0.5821225",
"0.58192265",
"0.5814601",
"0.58115786",
"0.58068985",
"0.5803163",
"0.57943577",
"0.5793749",
"0.5791879",
"0.5790865",
"0.5789813",
"0.5780503",
"0.5780221",
"0.5779457",
"0.5778162",
"0.5770023",
"0.57670456",
"0.57649237",
"0.57645243",
"0.57557076",
"0.575509",
"0.5753659",
"0.5752398",
"0.5751744",
"0.57487756",
"0.5742632",
"0.57375574",
"0.5737352"
] | 0.64215904 | 5 |
Constructs a new music model with the given parameters. | private ModelImpl(int tempo, List<Note> notes) {
if (tempo < 50000 || tempo > 250000) {
throw new IllegalArgumentException("Invalid tempo.");
}
if (notes.isEmpty()) {
throw new IllegalArgumentException("This shouldn't happen.");
}
this.tempo = tempo;
this.currentMeasure = DEFAULT_START;
this.status = Status.Playing;
this.low = new Note(1, 8, 0, Note.Pitches.C, true, 0, 1);
this.high = new Note(1, 0, 0, Note.Pitches.A, true, 0, 1);
this.sheet = new ArrayList<Set<Note>>();
this.addAll(notes);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MusicModel() {\n this(90000);\n }",
"public static MusicModel createModel() {\n return new MusicModelImpl();\n }",
"MusicModelImpl() {\n if (lowestPitchValue < 0) {\n throw new IllegalArgumentException(\"Invalid music: lowestPitchValue cannot be negative\");\n }\n if (currentBeatNumber < 0) {\n throw new IllegalArgumentException(\"Invalid music: currentBeatNumber \" +\n \"cannot be negative\");\n }\n if (tempo < 0) {\n throw new IllegalArgumentException(\"Invalid music: tempo cannot be negative\");\n }\n this.music = new TreeMap<>();\n this.currentBeatNumber = 0;\n this.highestPitchValue = 0;\n this.lowestPitchValue = 1000;\n // initializes the tempo to\n // 1 million microseconds per beat, 1 beat per second\n this.tempo = 1000000;\n }",
"public Music()\n {\n this(0, \"\", \"\", \"\", \"\", \"\");\n }",
"public MusicModel(int tempo) {\n this.notes = new HashMap<>();\n this.tempo = tempo;\n }",
"public Music createMusic(String file);",
"public Song() {}",
"@Override\n public MusicOperation build() {\n MusicOperation m = new MusicModel(this.tempo);\n listNotes.forEach(n -> m.addNote(n));\n return m;\n }",
"public Songs() {\n }",
"private ModelImpl(int tempo) {\n if (tempo < 50000 || tempo > 250000) {\n throw new IllegalArgumentException(\"Invalid tempo.\");\n }\n this.tempo = tempo;\n this.currentMeasure = DEFAULT_START;\n this.status = Status.Playing;\n this.low = new Note(1, 8, 0, Note.Pitches.C, true, 0, 1);\n this.high = new Note(1, 0, 0, Note.Pitches.A, true, 0, 1);\n this.sheet = new ArrayList<Set<Note>>();\n }",
"public MusicModel() {\n this.notes = new ArrayList<NoteColumn>();\n }",
"public ModelClass(String Main, String Translated, Integer ImageResource, Integer Music) {\n this.Main = Main;\n this.Translated = Translated;\n this.ImageResource = ImageResource;\n this.Music = Music;\n }",
"public SongRecord(){\n\t}",
"Song() {\n\t\tmEnsemble = ensemble;\n\t\tmTitle = \"Strawberry Fields\";\n\t\tmYearReleased = 1969;\n\t}",
"public SoundTrack(String title, String artist, String language){\n this.artist = artist; // assigns passed variable to instance variable\n this.language = language; // assigns passed variable to instance variable\n this.title = title; // assigns passed variable to instance variable\n }",
"public Song(String t, String alb, String art, String y){\n title = t;\n album = alb;\n artist = art;\n year = y; \n }",
"public Song(String title, String artist) {\r\n this.title = title;\r\n this.artist = artist;\r\n }",
"public MusicFilter(List<Music> songs)\n {\n this.songs = songs;\n }",
"public Song(\n String title,\n String artist,\n String year,\n String genre,\n double heardPercentCS,\n double heardPercentMath,\n double heardPercentEng,\n double heardPercentOther,\n double heardPercentSE,\n double heardPercentNE,\n double heardPercentUS,\n double heardPercentOut,\n double heardPercentMusic,\n double heardPercentSports,\n double heardPercentReading,\n double heardPercentArt,\n double likePercentCS,\n double likePercentMath,\n double likePercentEng,\n double likePercentOther,\n double likePercentSE,\n double likePercentNE,\n double likePercentUS,\n double likePercentOut,\n double likePercentMusic,\n double likePercentSports,\n double likePercentReading,\n double likePercentArt) {\n this.title = title;\n this.artist = artist;\n this.year = year;\n this.genre = genre;\n this.heardPercentCS = heardPercentCS;\n this.heardPercentMath = heardPercentMath;\n this.heardPercentEng = heardPercentEng;\n this.heardPercentOther = heardPercentOther;\n this.heardPercentSE = heardPercentSE;\n this.heardPercentNE = heardPercentNE;\n this.heardPercentUS = heardPercentUS;\n this.heardPercentOut = heardPercentOut;\n this.heardPercentMusic = heardPercentMusic;\n this.heardPercentSports = heardPercentSports;\n this.heardPercentReading = heardPercentReading;\n this.heardPercentArt = heardPercentArt;\n this.likePercentCS = likePercentCS;\n this.likePercentMath = likePercentMath;\n this.likePercentEng = likePercentEng;\n this.likePercentOther = likePercentOther;\n this.likePercentSE = likePercentSE;\n this.likePercentNE = likePercentNE;\n this.likePercentUS = likePercentUS;\n this.likePercentOut = likePercentOut;\n this.likePercentMusic = likePercentMusic;\n this.likePercentSports = likePercentSports;\n this.likePercentReading = likePercentReading;\n this.likePercentArt = likePercentArt;\n }",
"public MusicLibrary() {\n\t\tthis.idMap = new HashMap<String, Song>();\n\t\tthis.titleMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.artistMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.tagMap = new TreeMap<String, TreeSet<String>>(new StringComparator());\n\t\t//this.artistList = new ArrayList<>();\n\t}",
"public void initializeModel(SongModel songmodel)\n {\n this.sm = songmodel;\n }",
"public void setMusic(Music music);",
"public Music(String...files){\n musicFiles = new ArrayList<AudioFile>();\n for(String file: files){\n musicFiles.add(new AudioFile(file));\n }\n }",
"public AudioList(){}",
"private void makeNewMusic() {\n File f = music.getFile();\n boolean playing = music.isPlaying();\n music.stop();\n music = new MP3(f);\n if (playing) {\n music.play(nextStartTime);\n }\n }",
"private MusicManager() {\n\t\ttry {\n\t\t\t// init sequencer\n\t\t\tsequencer = MidiSystem.getSequencer();\n\t\t\tsequencer.open();\n\n\t\t\t// init synthesizer\n\t\t\tsynth = MidiSystem.getSynthesizer();\n\t\t\tsynth.open();\n\t\t\t\n\t\t\t// DEBUG\n\t\t\t//System.out.print(\"latency = \" + synth.getLatency());\n\t\t\t//System.out.print(\"max polyphony = \" + synth.getMaxPolyphony());\n\n\t\t\t// get channel for synthesizing: the highest numbered channel. sets it up\n\t\t\tMidiChannel[] channels = synth.getChannels();\n\t\t\tsynthChannel = channels[channels.length - 1];\n\t\t\tsetSynthInstrument(MusicManager.SYNTH_INSTRUMENT);\n\t\t\t\n\t\t} catch (MidiUnavailableException e) {\n\t\t\tErrorHandler.display(\"Cannot play MIDI music\");\n\t\t\tsequencer = null; // remember this! sequencer can be null.\n\t\t\treturn;\n\t\t}\n\t\t\n\t}",
"public Value(MusicFile musicFile){\n this.musicFile = musicFile;\n }",
"public Music(String Level, float volume) throws Exception {\n\t\tsongName = Level;\n\t\tisReverse = false;\n\t\tflangeForward = true;\n\t\tisFlanging = false;\n\t\tisWah = false;\n\t\tisDistorted = false;\n\t\t// Load music file\n\t\tFLACFile fileIn = new FLACFile(\"audio/music/\" + Level + \".flac\");\n\t\t\n\t\t// Create the reverse form\n\t\tByteBuffer forwardBuffer = fileIn.getData();\n\t\tmusicSize = forwardBuffer.limit();\n\t\tByteBuffer reverseBuffer = FilterProcessing.createReverseData(forwardBuffer);\n\t\t// Create the wah'd forms\n\t\tByteBuffer wahBuffer = FilterProcessing.createWahData(forwardBuffer, fileIn.getSampleRate());\n\t\tByteBuffer revWahBuffer = FilterProcessing.createReverseData(wahBuffer);\n\t\t// Create the distorted forms\n\t\tByteBuffer distortBuffer = FilterProcessing.createDistortionData(forwardBuffer, fileIn.getSampleRate());\n\t\tByteBuffer revDistortBuffer = FilterProcessing.createReverseData(distortBuffer);\n\t\t// Create the distorted wah forms\n\t\tByteBuffer wahDistortBuffer = FilterProcessing.createDistortionData(wahBuffer, fileIn.getSampleRate());\n\t\tByteBuffer revWahDistortBuffer = FilterProcessing.createReverseData(wahDistortBuffer);\n\t\t\n\t\t// Get the flanger data\n\t\tflangeMS = fileIn.getSampleRate() / 1000;\n\t\tflangeOffset = flangeMS * 10;\n\t\t\n\t\t// Create the AL buffers\n\t\tmusicBufferIndex = alGenBuffers();\n\t\treverseBufferIndex = alGenBuffers();\n\t\twahBufferIndex = alGenBuffers();\n\t\trevWahBufferIndex = alGenBuffers();\n\t\tdistortBufferIndex = alGenBuffers();\n\t\trevDistortBufferIndex = alGenBuffers();\n\t\twahDistortBufferIndex = alGenBuffers();\n\t\trevWahDistortBufferIndex = alGenBuffers();\n\t alBufferData(musicBufferIndex, fileIn.getFormat(), fileIn.getData(), fileIn.getSampleRate());\n\t alBufferData(reverseBufferIndex, fileIn.getFormat(), reverseBuffer, fileIn.getSampleRate());\n\t alBufferData(wahBufferIndex, fileIn.getFormat(), wahBuffer, fileIn.getSampleRate());\n\t alBufferData(revWahBufferIndex, fileIn.getFormat(), revWahBuffer, fileIn.getSampleRate());\n\t alBufferData(distortBufferIndex, fileIn.getFormat(), distortBuffer, fileIn.getSampleRate());\n\t alBufferData(revDistortBufferIndex, fileIn.getFormat(), revDistortBuffer, fileIn.getSampleRate());\n\t alBufferData(wahDistortBufferIndex, fileIn.getFormat(), wahDistortBuffer, fileIn.getSampleRate());\n\t alBufferData(revWahDistortBufferIndex, fileIn.getFormat(), revWahDistortBuffer, fileIn.getSampleRate());\n\t \n\t // Clear the ByteBuffers\n\t fileIn.dispose();\n\t reverseBuffer.clear();\n\t wahBuffer.clear();\n\t revWahBuffer.clear();\n\t distortBuffer.clear();\n\t revDistortBuffer.clear();\n\t wahDistortBuffer.clear();\n\t revWahDistortBuffer.clear();\n\t \n\t // Create sources\n\t musicSourceIndex = alGenSources();\n\t reverseSourceIndex = alGenSources();\n\t flangeSourceIndex = alGenSources();\n\t revFlangeSourceIndex = alGenSources();\n\t wahSourceIndex = alGenSources();\n\t revWahSourceIndex = alGenSources();\n\t wahFlangeSourceIndex = alGenSources();\n\t revWahFlangeSourceIndex = alGenSources();\n\t\tdistortSourceIndex = alGenSources();\n\t\trevDistortSourceIndex = alGenSources();\n\t distortFlangeSourceIndex = alGenSources();\n\t revDistortFlangeSourceIndex = alGenSources();\n\t\twahDistortSourceIndex = alGenSources();\n\t\trevWahDistortSourceIndex = alGenSources();\n\t\twahDistortFlangeSourceIndex = alGenSources();\n\t\trevWahDistortFlangeSourceIndex = alGenSources();\n\t alSourcei(musicSourceIndex, AL_BUFFER, musicBufferIndex);\n\t alSourcei(reverseSourceIndex, AL_BUFFER, reverseBufferIndex);\n\t alSourcei(flangeSourceIndex, AL_BUFFER, musicBufferIndex);\n\t alSourcei(revFlangeSourceIndex, AL_BUFFER, reverseBufferIndex);\n\t alSourcei(wahSourceIndex, AL_BUFFER, wahBufferIndex);\n\t alSourcei(revWahSourceIndex, AL_BUFFER, revWahBufferIndex);\n\t alSourcei(wahFlangeSourceIndex, AL_BUFFER, wahBufferIndex);\n\t alSourcei(revWahFlangeSourceIndex, AL_BUFFER, revWahBufferIndex);\n\t alSourcei(distortSourceIndex, AL_BUFFER, distortBufferIndex);\n\t alSourcei(revDistortSourceIndex, AL_BUFFER, revDistortBufferIndex);\n\t alSourcei(distortFlangeSourceIndex, AL_BUFFER, distortBufferIndex);\n\t alSourcei(revDistortFlangeSourceIndex, AL_BUFFER, revDistortBufferIndex);\n\t alSourcei(wahDistortSourceIndex, AL_BUFFER, wahDistortBufferIndex);\n\t alSourcei(revWahDistortSourceIndex, AL_BUFFER, revWahDistortBufferIndex);\n\t alSourcei(wahDistortFlangeSourceIndex, AL_BUFFER, wahDistortBufferIndex);\n\t alSourcei(revWahDistortFlangeSourceIndex, AL_BUFFER, revWahDistortBufferIndex);\n\t \n\t // Set music source properties\n\t setVolume(volume);\n\t alSourcei(musicSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(flangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(reverseSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(distortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revDistortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(distortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revDistortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahDistortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahDistortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahDistortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahDistortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t playMusic();\n\t}",
"public Song(String artist, String title) { \r\n\t\tthis.artist = artist;\r\n\t\tthis.title = title;\r\n\t\tthis.minutes = 0;\r\n\t\tthis.seconds = 0;\r\n\t}",
"public Media() {\n\t}",
"public ID3Audio ( Model model, boolean write ) {\r\n\t\tsuper(model, RDFS_CLASS, model.newRandomUniqueURI(), write);\r\n\t}",
"public MusicPlayer() {\n player = new BasicPlayer();\n controller = (BasicController) player;\n volume = -1.0; // indicates that gain has yet to be initialized\n }",
"public Model() {\n\t}",
"public Model() {\n\t}",
"protected ID3Audio ( Model model, URI classURI, org.ontoware.rdf2go.model.node.Resource instanceIdentifier, boolean write ) {\r\n\t\tsuper(model, classURI, instanceIdentifier, write);\r\n\t}",
"public CD(String song1, String song2, String song3, String song4, String song5) {\n songs = new ArrayList<>();\n songs.add(song1);\n songs.add(song2);\n songs.add(song3);\n songs.add(song4);\n songs.add(song5);\n currentindex = songs.size();\n }",
"public Song(String name, String artist, String album, String year) {\n this.name = name;\n this.artist = artist;\n this.album = album;\n this.year = year;\n }",
"public Track() {\r\n }",
"public ID3Audio ( Model model, org.ontoware.rdf2go.model.node.Resource instanceIdentifier, boolean write ) {\r\n\t\tsuper(model, RDFS_CLASS, instanceIdentifier, write);\r\n\t}",
"public Music loadMusic(String fileName);",
"private String addMusic() {\n\t\t// One Parameter: MusicName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|music:\" + parameters[0]);\n\t\treturn tag.toString();\n\n\t}",
"public void loadMusic(File f) {\n music = new MP3(f);\n }",
"public Sound(String theSong)\n\t{\n\t\tminim = new Minim(new PApplet());\n\t\tthis.theSong = theSong;\n\t\tcanPlay = true;\n\t\tswitch (theSong)\n\t\t{\n\t\tcase \"SG1\":\n\t\t\tsong = minim.loadFile(\"assets/shotgunCock1.wav\");\n\t\t\tbreak;\n\t\tcase \"SG2\":\n\t\t\tsong = minim.loadFile(\"assets/shotgunCock2.wav\");\n\t\t\tbreak;\n\t\tcase \"ARFire\":\n\t\t\tsong = minim.loadFile(\"assets/M4Fire.mp3\");\n\t\t\tbreak;\n\t\tcase \"click\":\n\t\t\tsong = minim.loadFile(\"assets/gunClick.mp3\");\n\t\t\tbreak;\n\t\tcase \"clipIn\":\n\t\t\tsong = minim.loadFile(\"assets/clipIn.mp3\");\n\t\t\tbreak;\n\t\tcase \"clipOut\":\n\t\t\tsong = minim.loadFile(\"assets/clipOut.mp3\");\n\t\t\tbreak;\n\t\tcase \"chamberOut\":\n\t\t\tsong = minim.loadFile(\"assets/ARChamberOut.mp3\");\n\t\t\tbreak;\n\t\tcase \"chamberIn\":\n\t\t\tsong = minim.loadFile(\"assets/ARChamberIn.mp3\");\n\t\t\tbreak;\t\t\n\t\tcase \"shell\":\n\t\t\tsong = minim.loadFile(\"assets/shellFall.mp3\");\n\t\t\tbreak;\n\t\tcase \"SGFire\":\n\t\t\tsong = minim.loadFile(\"assets/SGBlast.mp3\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tsong = null;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}",
"public Playlist(String playListName){\n\tgenresList = new Genre[6];\n\tsongList = new Song[30];\n\tthis.playListName = playListName;\n\t}",
"public MyPod()\n {\n color = \"black\";\n memory = 4;\n \n songLibrary[0] = new Song();\n songLibrary[1] = new Song();\n songLibrary[2] = new Song();\n \n \n \n }",
"public MusicServiceImpl(){}",
"public AudioEntity createFromParcel(Parcel in) {\n AudioEntity audioEntity = new AudioEntity();\n audioEntity.readFromParcel(in);\n return audioEntity;\n }",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"public MusicSheet() {\n Log.w(TAG,\"empty constructor\");\n // vertexArray = new VertexArray(VERTEX_DATA);\n }",
"public MusicPlayer() {\n\t\t// initialize all instance variables\n\t\tplaylist = new BinaryHeapA(new Song[0]);\n\t\tfavoritelist = new BinaryHeapA(new Song[0]);\n\t\tisPlaylist = true;\n\t\tsortOrder = 0;\n\t\tisPlaying = false;\n\t\tcurrentSongIndex = 0;\n\t\trepeat = true;\n\t\tshuffle = false;\n\t\tshuffleOrder = new ArrayList<Song>();\n\t\tshuffleSongIndex = -1;\n\t}",
"private Audio() {}",
"public WaveSystem()\n\t{\n\t\t\n\t}",
"private Model(){}",
"public Music getMusic();",
"public Music loadMusic(String fileName, float volume);",
"public Media(String title, String year){\n\t\tthis.title = title;\n\t\tthis.year = year;\n\t}",
"public Model() {\n }",
"public Model() {\n }",
"public Model() {\n }",
"@Override\r\n\tpublic void setMusic() {\r\n\t\tmanager.getMusicManager().setMusic((Music) Gdx.audio.newMusic(Gdx.files.internal(\"Music/Bandit Camp.mp3\")));\r\n\t}",
"void startMusic(AudioTrack newSong);",
"GameModel createGameModel(GameModel gameModel);",
"public Song(Song s) {\r\n\t\tthis.title = getTitle();\r\n\t\tthis.artist = getArtist();\r\n\t\tthis.minutes = getMinutes();\r\n\t\tthis.seconds = getSeconds();\r\n\t\ts = new Song(this.title, this.artist, this.minutes, this.seconds);\r\n\t}",
"public void StartMusic(int music_id);",
"public MusicClientApp() {\n\n tlm = new TrackListModel(new RecordDto());\n rcm = new RecordComboBoxModel(new MusicCollectionDto());\n scm = new PlayerComboBoxModel(new ArrayList<>());\n sercm = new ServerComboBoxModel(new ArrayList<>());\n\n initComponents();\n\n EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n StartMusicClient smc = new StartMusicClient(MusicClientApp.this);\n new Thread(smc).start();\n }\n });\n }",
"Build_Model() {\n\n }",
"public WorldModel(){\t\n\t}",
"public Model() {\n this(DSL.name(\"model\"), null);\n }",
"public CompositeController(IMusicModel model) {\n this.model = model;\n this.view = new CompositeView();\n\n view.setAllNotes(model.getMusic());\n view.setLength(model.getDuration());\n view.setTone(model.getTone(model.getNotes()));\n view.setTempo(model.getTempo());\n }",
"public Model() {\n\n }",
"public Film() {\n\t}",
"public Album() {\n }",
"public Playlist(String name){\n this.name = name;\n this.duration = new Time(0, 0);\n this.playSongs = new Song[MAX_SONGS_PLAYLIST];\n \n }",
"PlayerInRoomModel createPlayerInRoomModel(PlayerInRoomModel playerInRoomModel);",
"public AddSong(String title) {\n id = title;\n initComponents();\n }",
"public SongArray(){\n }",
"public OpenGLModel() {\n\n\n\t}",
"private void initialMusic(){\n\n }",
"Song(Ensemble pEnsemble, String pTitle) {\n\t\tthis.mEnsemble = pEnsemble;\n\t\tthis.mTitle = pTitle;\n\t\tmYearReleased = 0;\n\t}",
"public LibraryBuilder() {\n\t\tthis.addToLibrary = new MyMusicLibrary();\n\t\tthis.addToArtiLibrary = new MyArtistLibrary();\n\t}",
"public M create(P model);",
"public PlayMusic(ArrayList<Note> Notes, boolean Written)\n {\n notes = Notes;\n written = Written;\n threads = new ArrayList<thread>();\n }",
"public QuinzicalModel() throws Exception {\n\t\tinitialiseCategories();\n\t\treadCategories();\n\t\tsetFiveRandomCategories();\n\t\tloadCurrentPlayer();\n\t\tsetAnsweredQuestions();\n\t\tFile winnings = new File(\"data/winnings\");\n\t\tif (!winnings.exists()) {\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/winnings\");\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"echo 0 >> data/winnings\");\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/tts_speed\");\n\t\tloadInternationalUnlocked();\n\t}",
"public Model() {\n this(Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME), new TextRepository());\n }",
"public AudioController(){\n\t sounds = new LinkedList<>();\n\t removables = new LinkedList<>();\n\t availableIds = new HashSet<>();\n\t populateIds();\n\t}",
"public static QuinzicalModel createInstance() throws Exception {\n\t\tif (instance == null) {\n\t\t\tinstance = new QuinzicalModel();\n\t\t}\n\t\treturn instance;\n\t}",
"public Sound(Context context) {\r\n\t\tthis.mp = MediaPlayer.create(context, R.raw.baby);\r\n\t\r\n\t}",
"public Music getMusic() {\n return music;\n }",
"public Play() {\n }",
"public ListViewAdapter(List<SongModel> songs) {\n this.list = songs;\n }",
"public Song(String title, String artist, String year, String genre) {\n this.title = title;\n this.artist = artist;\n this.year = year;\n this.genre = genre;\n heardPercentCS = 0.;\n heardPercentMath = 0.;\n heardPercentEng = 0.;\n heardPercentOther = 0.;\n heardPercentSE = 0.;\n heardPercentNE = 0.;\n heardPercentUS = 0.;\n heardPercentOut = 0.;\n heardPercentMusic = 0.;\n heardPercentSports = 0.;\n heardPercentReading = 0.;\n heardPercentArt = 0.;\n }",
"private SoundPlayer(String mp3) {\n\t\tfile = new File(mp3);\n\t}",
"private void startMusic() {\r\n final Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3);\r\n final Format input2 = new AudioFormat(AudioFormat.MPEG);\r\n final Format output = new AudioFormat(AudioFormat.LINEAR);\r\n PlugInManager.addPlugIn(\r\n \"com.sun.media.codec.audio.mp3.JavaDecoder\",\r\n new Format[]{input1, input2},\r\n new Format[]{output},\r\n PlugInManager.CODEC\r\n );\r\n try {\r\n final File f = new File(\"support_files//tetris.mp3\");\r\n myPlayer = Manager.createPlayer(new MediaLocator(f.toURI().toURL()));\r\n } catch (final NoPlayerException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n if (myPlayer != null) {\r\n myPlayer.start();\r\n }\r\n }",
"@Override\n public Song getSongRepresentation() {\n\n try {\n final Track track = en.uploadTrack(mp3File, true);\n\n // Wait for a predefined period of time in which the track is analyzed\n track.waitForAnalysis(30000);\n\n if (track.getStatus() == Track.AnalysisStatus.COMPLETE) {\n\n final double tempo = track.getTempo();\n final String title = Modulo7Utils.stringAssign(track.getTitle());\n final String artistName = Modulo7Utils.stringAssign(track.getArtistName());\n\n // Gets the time signature\n final int timeSignatureRatio = track.getTimeSignature();\n TimeSignature timeSignature = guessTimeSigntureRatio(timeSignatureRatio);\n\n // Getting the key signature information from the echo nest meta data analysis in integer format\n final int key = track.getKey();\n final int mode = track.getMode();\n\n try {\n keySignature = EchoNestKeySignatureEstimator.estimateKeySignature(key, mode);\n } catch (Modulo7BadKeyException e) {\n logger.error(e.getMessage());\n }\n\n // Gets the duration of the track\n final double duration = track.getDuration();\n\n TrackAnalysis analysis = track.getAnalysis();\n\n Voice voiceOfSong = new Voice();\n\n /**\n * There is no clear distinguishing way of acquiring timbral approximations\n * Hence the only possible approximation I can think of it call the a part of a\n * single voice\n */\n for (final Segment segment : analysis.getSegments()) {\n VoiceInstant songInstant = ChromaAnalysis.getLineInstantFromVector(segment.getPitches(), segment.getDuration());\n voiceOfSong.addVoiceInstant(songInstant);\n }\n if (keySignature == null) {\n return new Song(voiceOfSong, new SongMetadata(artistName, title, (int) tempo), MusicSources.MP3, duration);\n } else {\n if (timeSignature == null) {\n return new Song(voiceOfSong, new SongMetadata(keySignature, artistName, title, (int) tempo),\n MusicSources.MP3, duration);\n } else {\n return new Song(voiceOfSong, new SongMetadata(keySignature, timeSignature, artistName, title,\n (int) tempo), MusicSources.MP3, duration);\n }\n }\n\n } else {\n logger.error(\"Trouble analysing track \" + track.getStatus());\n return null;\n }\n } catch (IOException e) {\n logger.error(\"Trouble uploading file to track analyzer\" + e.getMessage());\n } catch (Modulo7InvalidVoiceInstantSizeException | EchoNestException | Modulo7BadIntervalException | Modulo7BadNoteException e) {\n logger.error(e.getMessage());\n }\n\n // Return null if no song is inferred\n return null;\n }"
] | [
"0.73845047",
"0.7181859",
"0.69136935",
"0.6689479",
"0.6601095",
"0.6494311",
"0.644418",
"0.64010495",
"0.6336988",
"0.6317552",
"0.6278895",
"0.6252023",
"0.61729324",
"0.61274767",
"0.6010983",
"0.6007039",
"0.5998162",
"0.598048",
"0.59413713",
"0.58901626",
"0.58388513",
"0.5837392",
"0.5829865",
"0.5816602",
"0.57149094",
"0.57144743",
"0.56899863",
"0.56798095",
"0.5677952",
"0.56362766",
"0.56299734",
"0.5620089",
"0.5586554",
"0.5586554",
"0.5561361",
"0.55349493",
"0.5531682",
"0.5524439",
"0.55116093",
"0.5511207",
"0.55079275",
"0.55052376",
"0.546916",
"0.54667765",
"0.54652023",
"0.54586095",
"0.5456927",
"0.5450039",
"0.5450039",
"0.5450039",
"0.5450039",
"0.5450039",
"0.5450039",
"0.5450039",
"0.5442878",
"0.54322094",
"0.54217684",
"0.5417653",
"0.540463",
"0.53915393",
"0.5389407",
"0.538855",
"0.53811264",
"0.53811264",
"0.53811264",
"0.53663117",
"0.53480715",
"0.5347628",
"0.5340782",
"0.53369504",
"0.53351295",
"0.53322524",
"0.5329186",
"0.5324843",
"0.5323191",
"0.5322584",
"0.531721",
"0.5295396",
"0.529468",
"0.5272008",
"0.52702844",
"0.5261608",
"0.5258724",
"0.5247692",
"0.52467406",
"0.52432555",
"0.5241621",
"0.52415836",
"0.5235733",
"0.5234037",
"0.5232798",
"0.52321523",
"0.5231695",
"0.5222234",
"0.52220774",
"0.52216274",
"0.5220386",
"0.5220298",
"0.5216653",
"0.52123433"
] | 0.6110208 | 14 |
Constructs a new music model with the given parameters. | private ModelImpl(int tempo) {
if (tempo < 50000 || tempo > 250000) {
throw new IllegalArgumentException("Invalid tempo.");
}
this.tempo = tempo;
this.currentMeasure = DEFAULT_START;
this.status = Status.Playing;
this.low = new Note(1, 8, 0, Note.Pitches.C, true, 0, 1);
this.high = new Note(1, 0, 0, Note.Pitches.A, true, 0, 1);
this.sheet = new ArrayList<Set<Note>>();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public MusicModel() {\n this(90000);\n }",
"public static MusicModel createModel() {\n return new MusicModelImpl();\n }",
"MusicModelImpl() {\n if (lowestPitchValue < 0) {\n throw new IllegalArgumentException(\"Invalid music: lowestPitchValue cannot be negative\");\n }\n if (currentBeatNumber < 0) {\n throw new IllegalArgumentException(\"Invalid music: currentBeatNumber \" +\n \"cannot be negative\");\n }\n if (tempo < 0) {\n throw new IllegalArgumentException(\"Invalid music: tempo cannot be negative\");\n }\n this.music = new TreeMap<>();\n this.currentBeatNumber = 0;\n this.highestPitchValue = 0;\n this.lowestPitchValue = 1000;\n // initializes the tempo to\n // 1 million microseconds per beat, 1 beat per second\n this.tempo = 1000000;\n }",
"public Music()\n {\n this(0, \"\", \"\", \"\", \"\", \"\");\n }",
"public MusicModel(int tempo) {\n this.notes = new HashMap<>();\n this.tempo = tempo;\n }",
"public Music createMusic(String file);",
"public Song() {}",
"@Override\n public MusicOperation build() {\n MusicOperation m = new MusicModel(this.tempo);\n listNotes.forEach(n -> m.addNote(n));\n return m;\n }",
"public Songs() {\n }",
"public MusicModel() {\n this.notes = new ArrayList<NoteColumn>();\n }",
"public ModelClass(String Main, String Translated, Integer ImageResource, Integer Music) {\n this.Main = Main;\n this.Translated = Translated;\n this.ImageResource = ImageResource;\n this.Music = Music;\n }",
"public SongRecord(){\n\t}",
"Song() {\n\t\tmEnsemble = ensemble;\n\t\tmTitle = \"Strawberry Fields\";\n\t\tmYearReleased = 1969;\n\t}",
"private ModelImpl(int tempo, List<Note> notes) {\n if (tempo < 50000 || tempo > 250000) {\n throw new IllegalArgumentException(\"Invalid tempo.\");\n }\n if (notes.isEmpty()) {\n throw new IllegalArgumentException(\"This shouldn't happen.\");\n }\n this.tempo = tempo;\n this.currentMeasure = DEFAULT_START;\n this.status = Status.Playing;\n this.low = new Note(1, 8, 0, Note.Pitches.C, true, 0, 1);\n this.high = new Note(1, 0, 0, Note.Pitches.A, true, 0, 1);\n this.sheet = new ArrayList<Set<Note>>();\n this.addAll(notes);\n }",
"public SoundTrack(String title, String artist, String language){\n this.artist = artist; // assigns passed variable to instance variable\n this.language = language; // assigns passed variable to instance variable\n this.title = title; // assigns passed variable to instance variable\n }",
"public Song(String t, String alb, String art, String y){\n title = t;\n album = alb;\n artist = art;\n year = y; \n }",
"public Song(String title, String artist) {\r\n this.title = title;\r\n this.artist = artist;\r\n }",
"public MusicFilter(List<Music> songs)\n {\n this.songs = songs;\n }",
"public Song(\n String title,\n String artist,\n String year,\n String genre,\n double heardPercentCS,\n double heardPercentMath,\n double heardPercentEng,\n double heardPercentOther,\n double heardPercentSE,\n double heardPercentNE,\n double heardPercentUS,\n double heardPercentOut,\n double heardPercentMusic,\n double heardPercentSports,\n double heardPercentReading,\n double heardPercentArt,\n double likePercentCS,\n double likePercentMath,\n double likePercentEng,\n double likePercentOther,\n double likePercentSE,\n double likePercentNE,\n double likePercentUS,\n double likePercentOut,\n double likePercentMusic,\n double likePercentSports,\n double likePercentReading,\n double likePercentArt) {\n this.title = title;\n this.artist = artist;\n this.year = year;\n this.genre = genre;\n this.heardPercentCS = heardPercentCS;\n this.heardPercentMath = heardPercentMath;\n this.heardPercentEng = heardPercentEng;\n this.heardPercentOther = heardPercentOther;\n this.heardPercentSE = heardPercentSE;\n this.heardPercentNE = heardPercentNE;\n this.heardPercentUS = heardPercentUS;\n this.heardPercentOut = heardPercentOut;\n this.heardPercentMusic = heardPercentMusic;\n this.heardPercentSports = heardPercentSports;\n this.heardPercentReading = heardPercentReading;\n this.heardPercentArt = heardPercentArt;\n this.likePercentCS = likePercentCS;\n this.likePercentMath = likePercentMath;\n this.likePercentEng = likePercentEng;\n this.likePercentOther = likePercentOther;\n this.likePercentSE = likePercentSE;\n this.likePercentNE = likePercentNE;\n this.likePercentUS = likePercentUS;\n this.likePercentOut = likePercentOut;\n this.likePercentMusic = likePercentMusic;\n this.likePercentSports = likePercentSports;\n this.likePercentReading = likePercentReading;\n this.likePercentArt = likePercentArt;\n }",
"public MusicLibrary() {\n\t\tthis.idMap = new HashMap<String, Song>();\n\t\tthis.titleMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.artistMap = new TreeMap<String, TreeSet<Song>>(new StringComparator());\n\t\tthis.tagMap = new TreeMap<String, TreeSet<String>>(new StringComparator());\n\t\t//this.artistList = new ArrayList<>();\n\t}",
"public void setMusic(Music music);",
"public void initializeModel(SongModel songmodel)\n {\n this.sm = songmodel;\n }",
"public Music(String...files){\n musicFiles = new ArrayList<AudioFile>();\n for(String file: files){\n musicFiles.add(new AudioFile(file));\n }\n }",
"public AudioList(){}",
"private void makeNewMusic() {\n File f = music.getFile();\n boolean playing = music.isPlaying();\n music.stop();\n music = new MP3(f);\n if (playing) {\n music.play(nextStartTime);\n }\n }",
"private MusicManager() {\n\t\ttry {\n\t\t\t// init sequencer\n\t\t\tsequencer = MidiSystem.getSequencer();\n\t\t\tsequencer.open();\n\n\t\t\t// init synthesizer\n\t\t\tsynth = MidiSystem.getSynthesizer();\n\t\t\tsynth.open();\n\t\t\t\n\t\t\t// DEBUG\n\t\t\t//System.out.print(\"latency = \" + synth.getLatency());\n\t\t\t//System.out.print(\"max polyphony = \" + synth.getMaxPolyphony());\n\n\t\t\t// get channel for synthesizing: the highest numbered channel. sets it up\n\t\t\tMidiChannel[] channels = synth.getChannels();\n\t\t\tsynthChannel = channels[channels.length - 1];\n\t\t\tsetSynthInstrument(MusicManager.SYNTH_INSTRUMENT);\n\t\t\t\n\t\t} catch (MidiUnavailableException e) {\n\t\t\tErrorHandler.display(\"Cannot play MIDI music\");\n\t\t\tsequencer = null; // remember this! sequencer can be null.\n\t\t\treturn;\n\t\t}\n\t\t\n\t}",
"public Value(MusicFile musicFile){\n this.musicFile = musicFile;\n }",
"public Music(String Level, float volume) throws Exception {\n\t\tsongName = Level;\n\t\tisReverse = false;\n\t\tflangeForward = true;\n\t\tisFlanging = false;\n\t\tisWah = false;\n\t\tisDistorted = false;\n\t\t// Load music file\n\t\tFLACFile fileIn = new FLACFile(\"audio/music/\" + Level + \".flac\");\n\t\t\n\t\t// Create the reverse form\n\t\tByteBuffer forwardBuffer = fileIn.getData();\n\t\tmusicSize = forwardBuffer.limit();\n\t\tByteBuffer reverseBuffer = FilterProcessing.createReverseData(forwardBuffer);\n\t\t// Create the wah'd forms\n\t\tByteBuffer wahBuffer = FilterProcessing.createWahData(forwardBuffer, fileIn.getSampleRate());\n\t\tByteBuffer revWahBuffer = FilterProcessing.createReverseData(wahBuffer);\n\t\t// Create the distorted forms\n\t\tByteBuffer distortBuffer = FilterProcessing.createDistortionData(forwardBuffer, fileIn.getSampleRate());\n\t\tByteBuffer revDistortBuffer = FilterProcessing.createReverseData(distortBuffer);\n\t\t// Create the distorted wah forms\n\t\tByteBuffer wahDistortBuffer = FilterProcessing.createDistortionData(wahBuffer, fileIn.getSampleRate());\n\t\tByteBuffer revWahDistortBuffer = FilterProcessing.createReverseData(wahDistortBuffer);\n\t\t\n\t\t// Get the flanger data\n\t\tflangeMS = fileIn.getSampleRate() / 1000;\n\t\tflangeOffset = flangeMS * 10;\n\t\t\n\t\t// Create the AL buffers\n\t\tmusicBufferIndex = alGenBuffers();\n\t\treverseBufferIndex = alGenBuffers();\n\t\twahBufferIndex = alGenBuffers();\n\t\trevWahBufferIndex = alGenBuffers();\n\t\tdistortBufferIndex = alGenBuffers();\n\t\trevDistortBufferIndex = alGenBuffers();\n\t\twahDistortBufferIndex = alGenBuffers();\n\t\trevWahDistortBufferIndex = alGenBuffers();\n\t alBufferData(musicBufferIndex, fileIn.getFormat(), fileIn.getData(), fileIn.getSampleRate());\n\t alBufferData(reverseBufferIndex, fileIn.getFormat(), reverseBuffer, fileIn.getSampleRate());\n\t alBufferData(wahBufferIndex, fileIn.getFormat(), wahBuffer, fileIn.getSampleRate());\n\t alBufferData(revWahBufferIndex, fileIn.getFormat(), revWahBuffer, fileIn.getSampleRate());\n\t alBufferData(distortBufferIndex, fileIn.getFormat(), distortBuffer, fileIn.getSampleRate());\n\t alBufferData(revDistortBufferIndex, fileIn.getFormat(), revDistortBuffer, fileIn.getSampleRate());\n\t alBufferData(wahDistortBufferIndex, fileIn.getFormat(), wahDistortBuffer, fileIn.getSampleRate());\n\t alBufferData(revWahDistortBufferIndex, fileIn.getFormat(), revWahDistortBuffer, fileIn.getSampleRate());\n\t \n\t // Clear the ByteBuffers\n\t fileIn.dispose();\n\t reverseBuffer.clear();\n\t wahBuffer.clear();\n\t revWahBuffer.clear();\n\t distortBuffer.clear();\n\t revDistortBuffer.clear();\n\t wahDistortBuffer.clear();\n\t revWahDistortBuffer.clear();\n\t \n\t // Create sources\n\t musicSourceIndex = alGenSources();\n\t reverseSourceIndex = alGenSources();\n\t flangeSourceIndex = alGenSources();\n\t revFlangeSourceIndex = alGenSources();\n\t wahSourceIndex = alGenSources();\n\t revWahSourceIndex = alGenSources();\n\t wahFlangeSourceIndex = alGenSources();\n\t revWahFlangeSourceIndex = alGenSources();\n\t\tdistortSourceIndex = alGenSources();\n\t\trevDistortSourceIndex = alGenSources();\n\t distortFlangeSourceIndex = alGenSources();\n\t revDistortFlangeSourceIndex = alGenSources();\n\t\twahDistortSourceIndex = alGenSources();\n\t\trevWahDistortSourceIndex = alGenSources();\n\t\twahDistortFlangeSourceIndex = alGenSources();\n\t\trevWahDistortFlangeSourceIndex = alGenSources();\n\t alSourcei(musicSourceIndex, AL_BUFFER, musicBufferIndex);\n\t alSourcei(reverseSourceIndex, AL_BUFFER, reverseBufferIndex);\n\t alSourcei(flangeSourceIndex, AL_BUFFER, musicBufferIndex);\n\t alSourcei(revFlangeSourceIndex, AL_BUFFER, reverseBufferIndex);\n\t alSourcei(wahSourceIndex, AL_BUFFER, wahBufferIndex);\n\t alSourcei(revWahSourceIndex, AL_BUFFER, revWahBufferIndex);\n\t alSourcei(wahFlangeSourceIndex, AL_BUFFER, wahBufferIndex);\n\t alSourcei(revWahFlangeSourceIndex, AL_BUFFER, revWahBufferIndex);\n\t alSourcei(distortSourceIndex, AL_BUFFER, distortBufferIndex);\n\t alSourcei(revDistortSourceIndex, AL_BUFFER, revDistortBufferIndex);\n\t alSourcei(distortFlangeSourceIndex, AL_BUFFER, distortBufferIndex);\n\t alSourcei(revDistortFlangeSourceIndex, AL_BUFFER, revDistortBufferIndex);\n\t alSourcei(wahDistortSourceIndex, AL_BUFFER, wahDistortBufferIndex);\n\t alSourcei(revWahDistortSourceIndex, AL_BUFFER, revWahDistortBufferIndex);\n\t alSourcei(wahDistortFlangeSourceIndex, AL_BUFFER, wahDistortBufferIndex);\n\t alSourcei(revWahDistortFlangeSourceIndex, AL_BUFFER, revWahDistortBufferIndex);\n\t \n\t // Set music source properties\n\t setVolume(volume);\n\t alSourcei(musicSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(flangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(reverseSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(distortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revDistortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(distortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revDistortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahDistortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahDistortSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(wahDistortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t alSourcei(revWahDistortFlangeSourceIndex, AL_LOOPING, AL_TRUE);\n\t playMusic();\n\t}",
"public Song(String artist, String title) { \r\n\t\tthis.artist = artist;\r\n\t\tthis.title = title;\r\n\t\tthis.minutes = 0;\r\n\t\tthis.seconds = 0;\r\n\t}",
"public Media() {\n\t}",
"public ID3Audio ( Model model, boolean write ) {\r\n\t\tsuper(model, RDFS_CLASS, model.newRandomUniqueURI(), write);\r\n\t}",
"public MusicPlayer() {\n player = new BasicPlayer();\n controller = (BasicController) player;\n volume = -1.0; // indicates that gain has yet to be initialized\n }",
"public Model() {\n\t}",
"public Model() {\n\t}",
"protected ID3Audio ( Model model, URI classURI, org.ontoware.rdf2go.model.node.Resource instanceIdentifier, boolean write ) {\r\n\t\tsuper(model, classURI, instanceIdentifier, write);\r\n\t}",
"public CD(String song1, String song2, String song3, String song4, String song5) {\n songs = new ArrayList<>();\n songs.add(song1);\n songs.add(song2);\n songs.add(song3);\n songs.add(song4);\n songs.add(song5);\n currentindex = songs.size();\n }",
"public Song(String name, String artist, String album, String year) {\n this.name = name;\n this.artist = artist;\n this.album = album;\n this.year = year;\n }",
"public Track() {\r\n }",
"public Music loadMusic(String fileName);",
"public ID3Audio ( Model model, org.ontoware.rdf2go.model.node.Resource instanceIdentifier, boolean write ) {\r\n\t\tsuper(model, RDFS_CLASS, instanceIdentifier, write);\r\n\t}",
"private String addMusic() {\n\t\t// One Parameter: MusicName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|music:\" + parameters[0]);\n\t\treturn tag.toString();\n\n\t}",
"public void loadMusic(File f) {\n music = new MP3(f);\n }",
"public Sound(String theSong)\n\t{\n\t\tminim = new Minim(new PApplet());\n\t\tthis.theSong = theSong;\n\t\tcanPlay = true;\n\t\tswitch (theSong)\n\t\t{\n\t\tcase \"SG1\":\n\t\t\tsong = minim.loadFile(\"assets/shotgunCock1.wav\");\n\t\t\tbreak;\n\t\tcase \"SG2\":\n\t\t\tsong = minim.loadFile(\"assets/shotgunCock2.wav\");\n\t\t\tbreak;\n\t\tcase \"ARFire\":\n\t\t\tsong = minim.loadFile(\"assets/M4Fire.mp3\");\n\t\t\tbreak;\n\t\tcase \"click\":\n\t\t\tsong = minim.loadFile(\"assets/gunClick.mp3\");\n\t\t\tbreak;\n\t\tcase \"clipIn\":\n\t\t\tsong = minim.loadFile(\"assets/clipIn.mp3\");\n\t\t\tbreak;\n\t\tcase \"clipOut\":\n\t\t\tsong = minim.loadFile(\"assets/clipOut.mp3\");\n\t\t\tbreak;\n\t\tcase \"chamberOut\":\n\t\t\tsong = minim.loadFile(\"assets/ARChamberOut.mp3\");\n\t\t\tbreak;\n\t\tcase \"chamberIn\":\n\t\t\tsong = minim.loadFile(\"assets/ARChamberIn.mp3\");\n\t\t\tbreak;\t\t\n\t\tcase \"shell\":\n\t\t\tsong = minim.loadFile(\"assets/shellFall.mp3\");\n\t\t\tbreak;\n\t\tcase \"SGFire\":\n\t\t\tsong = minim.loadFile(\"assets/SGBlast.mp3\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tsong = null;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}",
"public Playlist(String playListName){\n\tgenresList = new Genre[6];\n\tsongList = new Song[30];\n\tthis.playListName = playListName;\n\t}",
"public MyPod()\n {\n color = \"black\";\n memory = 4;\n \n songLibrary[0] = new Song();\n songLibrary[1] = new Song();\n songLibrary[2] = new Song();\n \n \n \n }",
"public MusicServiceImpl(){}",
"public AudioEntity createFromParcel(Parcel in) {\n AudioEntity audioEntity = new AudioEntity();\n audioEntity.readFromParcel(in);\n return audioEntity;\n }",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"Model createModel();",
"public MusicSheet() {\n Log.w(TAG,\"empty constructor\");\n // vertexArray = new VertexArray(VERTEX_DATA);\n }",
"public MusicPlayer() {\n\t\t// initialize all instance variables\n\t\tplaylist = new BinaryHeapA(new Song[0]);\n\t\tfavoritelist = new BinaryHeapA(new Song[0]);\n\t\tisPlaylist = true;\n\t\tsortOrder = 0;\n\t\tisPlaying = false;\n\t\tcurrentSongIndex = 0;\n\t\trepeat = true;\n\t\tshuffle = false;\n\t\tshuffleOrder = new ArrayList<Song>();\n\t\tshuffleSongIndex = -1;\n\t}",
"private Audio() {}",
"public WaveSystem()\n\t{\n\t\t\n\t}",
"private Model(){}",
"public Music loadMusic(String fileName, float volume);",
"public Music getMusic();",
"public Media(String title, String year){\n\t\tthis.title = title;\n\t\tthis.year = year;\n\t}",
"public Model() {\n }",
"public Model() {\n }",
"public Model() {\n }",
"@Override\r\n\tpublic void setMusic() {\r\n\t\tmanager.getMusicManager().setMusic((Music) Gdx.audio.newMusic(Gdx.files.internal(\"Music/Bandit Camp.mp3\")));\r\n\t}",
"void startMusic(AudioTrack newSong);",
"GameModel createGameModel(GameModel gameModel);",
"public void StartMusic(int music_id);",
"public Song(Song s) {\r\n\t\tthis.title = getTitle();\r\n\t\tthis.artist = getArtist();\r\n\t\tthis.minutes = getMinutes();\r\n\t\tthis.seconds = getSeconds();\r\n\t\ts = new Song(this.title, this.artist, this.minutes, this.seconds);\r\n\t}",
"public MusicClientApp() {\n\n tlm = new TrackListModel(new RecordDto());\n rcm = new RecordComboBoxModel(new MusicCollectionDto());\n scm = new PlayerComboBoxModel(new ArrayList<>());\n sercm = new ServerComboBoxModel(new ArrayList<>());\n\n initComponents();\n\n EventQueue.invokeLater(new Runnable() {\n @Override\n public void run() {\n StartMusicClient smc = new StartMusicClient(MusicClientApp.this);\n new Thread(smc).start();\n }\n });\n }",
"Build_Model() {\n\n }",
"public WorldModel(){\t\n\t}",
"public CompositeController(IMusicModel model) {\n this.model = model;\n this.view = new CompositeView();\n\n view.setAllNotes(model.getMusic());\n view.setLength(model.getDuration());\n view.setTone(model.getTone(model.getNotes()));\n view.setTempo(model.getTempo());\n }",
"public Model() {\n this(DSL.name(\"model\"), null);\n }",
"public Model() {\n\n }",
"public Film() {\n\t}",
"public Playlist(String name){\n this.name = name;\n this.duration = new Time(0, 0);\n this.playSongs = new Song[MAX_SONGS_PLAYLIST];\n \n }",
"public Album() {\n }",
"public AddSong(String title) {\n id = title;\n initComponents();\n }",
"PlayerInRoomModel createPlayerInRoomModel(PlayerInRoomModel playerInRoomModel);",
"public SongArray(){\n }",
"public OpenGLModel() {\n\n\n\t}",
"private void initialMusic(){\n\n }",
"Song(Ensemble pEnsemble, String pTitle) {\n\t\tthis.mEnsemble = pEnsemble;\n\t\tthis.mTitle = pTitle;\n\t\tmYearReleased = 0;\n\t}",
"public PlayMusic(ArrayList<Note> Notes, boolean Written)\n {\n notes = Notes;\n written = Written;\n threads = new ArrayList<thread>();\n }",
"public LibraryBuilder() {\n\t\tthis.addToLibrary = new MyMusicLibrary();\n\t\tthis.addToArtiLibrary = new MyArtistLibrary();\n\t}",
"public QuinzicalModel() throws Exception {\n\t\tinitialiseCategories();\n\t\treadCategories();\n\t\tsetFiveRandomCategories();\n\t\tloadCurrentPlayer();\n\t\tsetAnsweredQuestions();\n\t\tFile winnings = new File(\"data/winnings\");\n\t\tif (!winnings.exists()) {\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/winnings\");\n\t\t\tBashCmdUtil.bashCmdNoOutput(\"echo 0 >> data/winnings\");\n\t\t}\n\t\tBashCmdUtil.bashCmdNoOutput(\"touch data/tts_speed\");\n\t\tloadInternationalUnlocked();\n\t}",
"public M create(P model);",
"public AudioController(){\n\t sounds = new LinkedList<>();\n\t removables = new LinkedList<>();\n\t availableIds = new HashSet<>();\n\t populateIds();\n\t}",
"public Sound(Context context) {\r\n\t\tthis.mp = MediaPlayer.create(context, R.raw.baby);\r\n\t\r\n\t}",
"public Model() {\n this(Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME), new TextRepository());\n }",
"public static QuinzicalModel createInstance() throws Exception {\n\t\tif (instance == null) {\n\t\t\tinstance = new QuinzicalModel();\n\t\t}\n\t\treturn instance;\n\t}",
"public Music getMusic() {\n return music;\n }",
"private SoundPlayer(String mp3) {\n\t\tfile = new File(mp3);\n\t}",
"public ListViewAdapter(List<SongModel> songs) {\n this.list = songs;\n }",
"public Play() {\n }",
"public Song(String title, String artist, String year, String genre) {\n this.title = title;\n this.artist = artist;\n this.year = year;\n this.genre = genre;\n heardPercentCS = 0.;\n heardPercentMath = 0.;\n heardPercentEng = 0.;\n heardPercentOther = 0.;\n heardPercentSE = 0.;\n heardPercentNE = 0.;\n heardPercentUS = 0.;\n heardPercentOut = 0.;\n heardPercentMusic = 0.;\n heardPercentSports = 0.;\n heardPercentReading = 0.;\n heardPercentArt = 0.;\n }",
"private void startMusic() {\r\n final Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3);\r\n final Format input2 = new AudioFormat(AudioFormat.MPEG);\r\n final Format output = new AudioFormat(AudioFormat.LINEAR);\r\n PlugInManager.addPlugIn(\r\n \"com.sun.media.codec.audio.mp3.JavaDecoder\",\r\n new Format[]{input1, input2},\r\n new Format[]{output},\r\n PlugInManager.CODEC\r\n );\r\n try {\r\n final File f = new File(\"support_files//tetris.mp3\");\r\n myPlayer = Manager.createPlayer(new MediaLocator(f.toURI().toURL()));\r\n } catch (final NoPlayerException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n if (myPlayer != null) {\r\n myPlayer.start();\r\n }\r\n }",
"@Override\n public Song getSongRepresentation() {\n\n try {\n final Track track = en.uploadTrack(mp3File, true);\n\n // Wait for a predefined period of time in which the track is analyzed\n track.waitForAnalysis(30000);\n\n if (track.getStatus() == Track.AnalysisStatus.COMPLETE) {\n\n final double tempo = track.getTempo();\n final String title = Modulo7Utils.stringAssign(track.getTitle());\n final String artistName = Modulo7Utils.stringAssign(track.getArtistName());\n\n // Gets the time signature\n final int timeSignatureRatio = track.getTimeSignature();\n TimeSignature timeSignature = guessTimeSigntureRatio(timeSignatureRatio);\n\n // Getting the key signature information from the echo nest meta data analysis in integer format\n final int key = track.getKey();\n final int mode = track.getMode();\n\n try {\n keySignature = EchoNestKeySignatureEstimator.estimateKeySignature(key, mode);\n } catch (Modulo7BadKeyException e) {\n logger.error(e.getMessage());\n }\n\n // Gets the duration of the track\n final double duration = track.getDuration();\n\n TrackAnalysis analysis = track.getAnalysis();\n\n Voice voiceOfSong = new Voice();\n\n /**\n * There is no clear distinguishing way of acquiring timbral approximations\n * Hence the only possible approximation I can think of it call the a part of a\n * single voice\n */\n for (final Segment segment : analysis.getSegments()) {\n VoiceInstant songInstant = ChromaAnalysis.getLineInstantFromVector(segment.getPitches(), segment.getDuration());\n voiceOfSong.addVoiceInstant(songInstant);\n }\n if (keySignature == null) {\n return new Song(voiceOfSong, new SongMetadata(artistName, title, (int) tempo), MusicSources.MP3, duration);\n } else {\n if (timeSignature == null) {\n return new Song(voiceOfSong, new SongMetadata(keySignature, artistName, title, (int) tempo),\n MusicSources.MP3, duration);\n } else {\n return new Song(voiceOfSong, new SongMetadata(keySignature, timeSignature, artistName, title,\n (int) tempo), MusicSources.MP3, duration);\n }\n }\n\n } else {\n logger.error(\"Trouble analysing track \" + track.getStatus());\n return null;\n }\n } catch (IOException e) {\n logger.error(\"Trouble uploading file to track analyzer\" + e.getMessage());\n } catch (Modulo7InvalidVoiceInstantSizeException | EchoNestException | Modulo7BadIntervalException | Modulo7BadNoteException e) {\n logger.error(e.getMessage());\n }\n\n // Return null if no song is inferred\n return null;\n }"
] | [
"0.738362",
"0.71791285",
"0.6914286",
"0.66902065",
"0.6601171",
"0.64967346",
"0.6443707",
"0.6399458",
"0.6336965",
"0.6279173",
"0.6250108",
"0.6172079",
"0.61282116",
"0.61091536",
"0.60127705",
"0.6007422",
"0.59997165",
"0.5982312",
"0.59425753",
"0.58905536",
"0.5841508",
"0.5838854",
"0.58317167",
"0.5817709",
"0.5716679",
"0.5715635",
"0.5690912",
"0.5681536",
"0.5679414",
"0.56356823",
"0.5631917",
"0.5622046",
"0.5582506",
"0.5582506",
"0.55639255",
"0.55370194",
"0.553301",
"0.5523773",
"0.5515622",
"0.55144393",
"0.5512005",
"0.55083567",
"0.5472062",
"0.5466688",
"0.5465289",
"0.5459858",
"0.5455922",
"0.54444224",
"0.54444224",
"0.54444224",
"0.54444224",
"0.54444224",
"0.54444224",
"0.54444224",
"0.54426414",
"0.5432977",
"0.5423044",
"0.5417706",
"0.54012686",
"0.53946364",
"0.539443",
"0.53897023",
"0.5377222",
"0.5377222",
"0.5377222",
"0.53704894",
"0.5352321",
"0.5342287",
"0.5341853",
"0.5340079",
"0.5334746",
"0.5327991",
"0.5326474",
"0.53218144",
"0.532123",
"0.5318742",
"0.53153586",
"0.52959746",
"0.52948284",
"0.52717024",
"0.526782",
"0.52611977",
"0.52554464",
"0.52518237",
"0.5248713",
"0.5244041",
"0.5240936",
"0.5235699",
"0.5235457",
"0.52335125",
"0.5233451",
"0.5230303",
"0.52288526",
"0.5225533",
"0.5222568",
"0.5222252",
"0.5221947",
"0.5221475",
"0.5220467",
"0.5213706"
] | 0.63158655 | 9 |
Add a note into the music, if the note is longer than 1 beat, the note should be continuously added to the next measure until the note ends. also adding the note to the note list. | @Override
public void addNote(Note n) {
if (this.sheet.size() < n.getDuration() + n.getStartMeasure()) {
for (int i = this.sheet.size(); i < n.getDuration() + n.getStartMeasure(); i++) {
sheet.add(new HashSet<>());
}
}
for (int i = 0; i < n.getDuration(); i++) {
for (Note t : this.sheet.get(i + n.getStartMeasure())) {
if (t.equals(n)) {
throw new IllegalArgumentException("Already placed a note.");
}
}
}
this.sheet.get(n.getStartMeasure()).add(n);
int currentMeasure = n.getStartMeasure() + 1;
for (int i = 1; i < n.getDuration(); i++) {
Note hold = new Note(1, n.getOctave(), currentMeasure,
n.getPitch(), false, n.getInstrument(), n.getVolume());
this.sheet.get(currentMeasure).add(hold);
currentMeasure++;
}
this.high = this.getHighest();
this.low = this.getLowest();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void addNote(int duration, int octave, int beatNum, String pitch)\n throws IllegalArgumentException;",
"void addNote(int duration, int octave, int beatNum, int instrument, int volume, String pitch)\n throws IllegalArgumentException;",
"@Override\n public void add(Note note) {\n if (this.music.containsKey(note.getStartBeat())) {\n // if the given note already has the same note in the music, replace it\n if (this.music.get(note.getStartBeat()).contains(note)) {\n int indexOfNote = this.music.get(note.getStartBeat()).indexOf(note);\n this.music.get(note.getStartBeat()).set(indexOfNote, note);\n } else {\n // add the note to the arrayList\n this.music.get(note.getStartBeat()).add(note);\n }\n\n // update the pitch value for the music\n if (note.getPitchValue() > this.getHighestPitchValue()) {\n this.highestPitchValue = note.getPitchValue();\n }\n // this.updatePitchValues();\n\n if (note.getPitchValue() < this.getLowestPitchValue()) {\n this.lowestPitchValue = note.getPitchValue();\n }\n }\n // if the arrayList does not exist in map, construct one and put it in the map\n else {\n ArrayList<Note> listOfNote = new ArrayList<>();\n listOfNote.add(note);\n this.music.put(note.getStartBeat(), listOfNote);\n\n // update the pitch value for the music\n if (note.getPitchValue() > this.getHighestPitchValue()) {\n this.highestPitchValue = note.getPitchValue();\n }\n if (note.getPitchValue() < this.getLowestPitchValue()) {\n this.lowestPitchValue = note.getPitchValue();\n }\n }\n\n\n }",
"@Override\n public CompositionBuilder<MusicOperation> addNote(int start, int end, int instrument,\n int pitch, int volume) {\n this.listNotes.add(new SimpleNote(Pitch.values()[(pitch) % 12],\n Octave.values()[(pitch / 12) - 2 ], start, end - start, instrument, volume));\n return this;\n }",
"@Override\n public void addNote(Note note) {\n\n List<Note> notes = new ArrayList<>();\n notes.add(note);\n\n if (this.notes.get(note.getBeat()) == null) {\n this.notes.put(note.getBeat(), notes);\n } else {\n List<Note> oldList = this.notes.remove(note.getBeat());\n oldList.addAll(notes);\n this.notes.put(note.getBeat(), oldList);\n }\n }",
"CompositionBuilder<T> addNote(int start, int end, int instrument, int pitch, int volume);",
"@Override\n public void addNote(int startTime, int duration, Pitch pitch, Octave octave) {\n List<Note> notes = new ArrayList<>();\n Note newNote = new SimpleNote(pitch, octave, startTime, duration);\n notes.add(newNote);\n\n if (this.notes.get(startTime) == null) {\n this.notes.put(startTime, notes);\n } else {\n List<Note> oldList = this.notes.remove(startTime);\n oldList.addAll(notes);\n this.notes.put(startTime, oldList);\n }\n\n }",
"void add(Note note);",
"public void addNote(Note n){\n notes.add(n);\n }",
"public void addNote()\n {\n String stringNote;\n char actualNote;\n int beat;\n \n System.out.print(\"Enter the note > \"); //gets the note from user\n stringNote = in.nextLine();\n actualNote = stringNote.charAt(0);\n \n System.out.print(\"Enter the length of the note in beats > \"); //gets the beats from user\n beat = in.nextInt();\n \n Note note = new Note(actualNote, beat); //creates Note to be added\n \n score.add(note); //adds the note to the score\n \n in.nextLine();\n }",
"@Override\n public void add(Note note) {\n }",
"public void addNote(AdHocCommandNote note) {\n this.data.addNote(note);\n }",
"void note(float start, float duration, float freq){\n\t out.playNote(start,duration,freq); \n\t }",
"public void noteEvent(Note note)\r\n {\r\n byte noteValue = note.getValue();\r\n if (voiceValue != 9) // added D G Gray 5th Feb 2017\r\n {\r\n noteValue += this.interval;\r\n note.setValue(noteValue);\r\n\t }\r\n\r\n getReturnPattern().addElement(note);\r\n }",
"public void addNote(@NonNull Note_Model newNote) {\n noteModelSection.add(0, newNote);\n if (noteModelSection.size() > 1) {\n noteScreenRecycler.smoothScrollToPosition(0);\n }\n for (int position = 0; position < noteModelSection.size(); position++) {\n noteModelSection.get(position).setActualPosition(position);\n }\n mainActivity.get().getNoteScreen().get().getAdapter().updateNotesAdapter(noteModelSection);\n // new Thread(() -> everDataBase.noteManagement().insert(transformNoteModelToNoteDatabase(newNote))).start();\n }",
"@Override\n public void appendModels(MusicOperation model) {\n int length = this.getFinalBeat();\n\n List<Note> currentNotes = model.getNotes();\n\n for (int x = 0; x < currentNotes.size(); x++) {\n Note current = currentNotes.get(x);\n Note newNote = new SimpleNote(current.getPitch(), current.getOctave(),\n current.getBeat() + length, current.getDuration());\n this.addNote(newNote);\n }\n }",
"public void addSample(int note, String fileName, double startMs, double endMs) {\n\t\taddSample(note, fileName, startMs, endMs, 1.0);\n\t}",
"public void addNote(Note newNote) throws NotepadOverflowException {\n for (int i = 0; i < _notes.length; i++) {\n if (_notes[i] == null) {\n _notes[i] = newNote;\n return;\n }\n }\n if (DynamicNotepad) {\n enlargeNotepad(_notes.length);\n addNote(newNote);\n }\n throw new NotepadOverflowException(_notes.length);\n }",
"void addNote(int x, int y);",
"public void sequentialNoteEvent(Note note)\r\n {\r\n byte noteValue = note.getValue();\r\n if (voiceValue != 9) // added D G Gray 5th Feb 2017\r\n {\r\n noteValue += this.interval;\r\n note.setValue(noteValue);\r\n\t }\r\n\r\n\r\n getReturnPattern().addElement(note);\r\n }",
"public final void entryRuleNote() throws RecognitionException {\n try {\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:509:1: ( ruleNote EOF )\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:510:1: ruleNote EOF\n {\n before(grammarAccess.getNoteRule()); \n pushFollow(FOLLOW_ruleNote_in_entryRuleNote1020);\n ruleNote();\n\n state._fsp--;\n\n after(grammarAccess.getNoteRule()); \n match(input,EOF,FOLLOW_EOF_in_entryRuleNote1027); \n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n }\n return ;\n }",
"public void addNote(Note note) {\n\t\tthis.notes.put(note,Idea.NON_PROMPT_NOTE);\n\t}",
"public void addElts(NoteToken note){\r\n NotesList.add(note);\r\n }",
"public void move(Note n, Note.Pitches pitch, int octave, int measure) {\n if (!n.getIsHead()) {\n throw new IllegalArgumentException(\"Can't move a tail note\");\n }\n boolean result = false;\n for (int i = 0; i < n.getDuration(); i++) {\n for (Note t : this.sheet.get(i + n.getStartMeasure())) {\n if (t.equals(n)) {\n result = true;\n }\n }\n }\n if (result == false) {\n throw new IllegalArgumentException(\"note doesn't exist\");\n } else {\n this.removeNote(n);\n }\n Note n2 = n.moveTo(pitch, octave, measure);\n for (int i = 0; i < n2.getDuration(); i++) {\n for (Note t : this.sheet.get(i + n2.getStartMeasure())) {\n if (t.equals(n2)) {\n throw new IllegalArgumentException(\"Already placed a note.\");\n }\n }\n }\n this.addNote(n2);\n }",
"public void addSample(int note, String fileName, double startMs, double endMs, double gain) {\n\t\tif (type != InstrumentType.SAMPLE_BANK) {\n\t\t\tthrow new RuntimeException(\"Can't add samples to \" + type + \" instrument\");\n\t\t}\n\t\tsampleMap.put(note, new SampleInfo(note, fileName, startMs, endMs, gain));\n\t}",
"public void parallelNoteEvent(Note note)\r\n {\r\n byte noteValue = note.getValue();\r\n if (voiceValue != 9) // added D G Gray 5th Feb 2017\r\n {\r\n noteValue += this.interval;\r\n note.setValue(noteValue);\r\n\t }\r\n\r\n\r\n getReturnPattern().addElement(note);\r\n }",
"public void addNote(Note note) throws ChangeVetoException;",
"public static Note add(final Note noteToAdd) {\n try {\r\n // Simulate time for network request.\r\n Thread.sleep(5000);\r\n } catch (Exception e) {\r\n // Just for test purposes so handling error doesn't matter.\r\n }\r\n noteToAdd.setId(4);\r\n return noteToAdd;\r\n }",
"public void sendMessage(final int note) {\n final ShortMessage myMsg = new ShortMessage();\n final long timeStamp = -1;\n\n // hard-coded a moderate velocity of 93 because there is no way of tracking speed of finger movement\n try {\n myMsg.setMessage(ShortMessage.NOTE_ON, 0, note, 93);\n } catch (final InvalidMidiDataException e) {\n System.err.println(\"Could not send midi message! \");\n System.err.println(e.getMessage());\n }\n this.midiReceiver.send(myMsg, timeStamp);\n\n// turn the note off after one second of playing\n final ExecutorService service = Executors.newFixedThreadPool(1);\n service.submit(() -> {\n try {\n Thread.sleep(1000);\n //stop old note from playing\n myMsg.setMessage(ShortMessage.NOTE_OFF, 0, note, 0);\n this.midiReceiver.send(myMsg, timeStamp);\n } catch (final InterruptedException | InvalidMidiDataException e) {\n e.printStackTrace();\n }\n });\n }",
"public void addSample(int note, String fileName, double gain) {\n\t\taddSample(note, fileName, -1, -1, gain);\n\t}",
"public void playNote ( Location loc , byte instrument , byte note ) {\n\t\texecute ( handle -> handle.playNote ( loc , instrument , note ) );\n\t}",
"public static Note createNote(int value, int startBeat, int endBeat, int instrument, int\n volume) {\n return createNote((value / 12) - 1, Pitch.getPitch(value % 12), startBeat, endBeat, instrument,\n volume);\n }",
"public boolean addNote(StatementNote note) {\n\t\treturn this.notes_.add(note);\n\t}",
"private void loveYourz()\n {\n Song loveYourz = new Song();\n loveYourz.add(new Note(noteD4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteG3, 0));\n loveYourz.add(new Note(noteDS3, 0));\n loveYourz.add(new Note(noteC2, 0));\n loveYourz.add(new Note(noteC1, WHOLE_NOTE/2));\n\n loveYourz.add(new Note(noteD4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteG3, 0));\n loveYourz.add(new Note(noteDS3, 0));\n loveYourz.add(new Note(noteC2, 0));\n loveYourz.add(new Note(noteC1, WHOLE_NOTE/4));\n\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteG3, 0));\n loveYourz.add(new Note(noteDS2, 0));\n loveYourz.add(new Note(noteDS1, WHOLE_NOTE/4));\n\n\n loveYourz.add(new Note(noteG4, 0));\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteC4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/2));\n\n loveYourz.add(new Note(noteG4, 0));\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteC4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/8));\n\n loveYourz.add(new Note(noteF4, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/8));\n\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/8));\n\n loveYourz.add(new Note(noteD4, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/8));\n\n\n loveYourz.add(new Note(noteD4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteG3, 0));\n loveYourz.add(new Note(noteDS3, 0));\n loveYourz.add(new Note(noteC2, 0));\n loveYourz.add(new Note(noteC1, WHOLE_NOTE/2));\n\n loveYourz.add(new Note(noteD4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteG3, 0));\n loveYourz.add(new Note(noteDS3, 0));\n loveYourz.add(new Note(noteC2, 0));\n loveYourz.add(new Note(noteC1, WHOLE_NOTE/4));\n\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteG3, 0));\n loveYourz.add(new Note(noteDS2, 0));\n loveYourz.add(new Note(noteDS1, WHOLE_NOTE/4));\n\n\n loveYourz.add(new Note(noteG4, 0));\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteC4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/2));\n\n loveYourz.add(new Note(noteG4, 0));\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteC4, 0));\n loveYourz.add(new Note(noteBB3, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/4));\n\n loveYourz.add(new Note(noteDS4, 0));\n loveYourz.add(new Note(noteGS2, 0));\n loveYourz.add(new Note(noteGS1, WHOLE_NOTE/4));\n playSong(loveYourz);\n playSong(loveYourz);\n }",
"public ChordBuilder add(NoteBuilder noteBuilder) {\n\t\tthis.noteBuilders.add(new NoteBuilder(noteBuilder));\n\t\treturn this;\n\t}",
"public void loadNoteString(String notestring) {\n\t\t// convert the letters in the notestring to upper case\n\t\tnotestring = notestring.toUpperCase();\n\t\t// initialize duration, pitch, and octave\n\t\tint duration = 0;\n\t\tint pitch = 0;\n\t\tint octave = 0;\n\n\t\tString number = \"\";\n\t\tMidiNote midiNote;\n\t\tint prev_pitch = 60; // default : Octave is 0.\n\n\t\tfor (int i = 0; i < notestring.length(); i++) {\n\t\t\tchar note = notestring.charAt(i);\n\n\t\t\tswitch (note) {\n\t\t\t// MidiNote Character\n\t\t\t// Format : A or B or C or ... or G\n\t\t\tcase 'A':\n\t\t\tcase 'B':\n\t\t\tcase 'C':\n\t\t\tcase 'D':\n\t\t\tcase 'E':\n\t\t\tcase 'F':\n\t\t\tcase 'G':\n\t\t\t\tmidiNote = new MidiNote(noteToPitch.get(note) + pitch + octave,\n\t\t\t\t\t\tduration);\n\t\t\t\t// since it's play notes, setSilent to be false\n\t\t\t\tmidiNote.setSilent(false);\n\t\t\t\t\n\t\t\t\tif (i < notestring.length() - 1) {\n\t\t\t\t\t// This increases pitch by 1 for sharp modifier\n\t\t\t\t\tif (notestring.charAt(i + 1) == '#')\n\t\t\t\t\t\tmidiNote.setPitch(midiNote.getPitch() + 1);\n\t\t\t\t\t// This decreases pitch by 1 for flat modifier\n\t\t\t\t\telse if (notestring.charAt(i + 1) == '!')\n\t\t\t\t\t\tmidiNote.setPitch(midiNote.getPitch() - 1);\n\t\t\t\t}\n\t\t\t\tnotes.add(midiNote);\n\t\t\t\tprev_pitch = noteToPitch.get(note) + pitch + octave;\n\t\t\t\tnumber = \"\";\n\t\t\t\tduration = 1; // default value = 1\n\t\t\t\tbreak;\n\n\t\t\t// when it encounters the character 'P', it should be silence\n\t\t\t// instead of reading note. This is for pause\n\t\t\tcase 'P':\n\t\t\t\tmidiNote = new MidiNote(prev_pitch, duration);\n\t\t\t\tmidiNote.setSilent(true);\n\t\t\t\tnotes.add(midiNote);\n\t\t\t\tnumber = \"\";\n\t\t\t\tduration = 1; // default value 1\n\t\t\t\tbreak;\n\n\t\t\t// Octave decreases every time it encounters '<'\n\t\t\t// Format : <\n\t\t\tcase '<':\n\t\t\t\toctave -= 12;\n\t\t\t\tbreak;\n\n\t\t\t// Octave increases every time it encounters '>'\n\t\t\t// Format : >\n\t\t\tcase '>':\n\t\t\t\toctave += 12;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// if encountered a number (between 0 and 9) in the notestring\n\t\t\t\t// don't have to worry about ascii values here\n\t\t\t\tif (note >= '0' && note <= '9') {\n\t\t\t\t\tnumber += note;\n\t\t\t\t\tduration = Integer.parseInt(number);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public Note addNote(String title, String text) {\n Note newNote = new Note(title, text);\n notes.add(newNote); //add to ArrayList\n return newNote;\n }",
"private void playNotes()\n\t{\n\t\t//Update tracks when we can shift chords.\n\t\tChord curChord = ClearComposer.cc.getChord();\n\t\tif (index % ClearComposer.cc.getChordInterval() == 0 && (prevChord == null || prevChord != curChord))\n\t\t{\n\t\t\tprevChord = curChord;\n\t\t\ttracks.forEach(GraphicTrack::updateChord);\n\t\t\tClearComposer.cc.updateChordOutlines();\n\t\t}\n\n\t\tfor (GraphicTrack track : tracks)\n\t\t{\n\t\t\tint temp = track.playNote(index);\n\t\t\tif (temp != -1)\n\t\t\t\tMusicPlayer.playNote(temp);\n\t\t}\n\n\t\tindex++;\n\t\twhile (index >= ClearComposer.cc.getNumNotes())\n\t\t\tindex -= ClearComposer.cc.getNumNotes();\n\t}",
"void addRepeat(int beatNum, RepeatType repeatType);",
"ArrayList<INote> getNotesAt(int beatNum);",
"@Override\n public List<Note> getNotesAtBeat(int beat) {\n ArrayList<Note> listAtBeat = new ArrayList<>();\n\n List<Note> current = notes.get(beat);\n\n if (current == null) {\n this.notes.put(beat, listAtBeat);\n return notes.get(beat);\n } else {\n listAtBeat.addAll(current);\n return listAtBeat;\n }\n }",
"public Note noteAt(int interval) {\n\t\tint newMidiNote = getMidiNumber() + interval;\n\t\t\n\t\treturn new Note(newMidiNote);\n\t}",
"INote removeNote(int beatNum, String pitch, int octave) throws IllegalArgumentException;",
"public static void learnFromSong(String midiFile) throws InvalidMidiDataException, IOException {\n Sequence sequence = MidiSystem.getSequence(new File(midiFile));\n MidiMessage message;\n int key;\n\n int id = 0;\n int[] noteArray=new int[2];\n\n for(Track track : sequence.getTracks()) //for each track\n {\n for(int i=0;i< track.size();i++) //for each signal\n {\n message = track.get(i).getMessage();\n\n if(message instanceof ShortMessage) //if ShortMessage\n {\n ShortMessage sm=(ShortMessage)message;\n\n if(sm.getCommand() == ShortMessage.NOTE_ON) //if note\n {\n key=sm.getData1(); //key in MIDI numder (from 0 to 127)\n\n if(id==2)\n {\n updateWeights(noteArray[0],noteArray[1],key);\n noteArray[0]=noteArray[1];\n noteArray[1]=key;\n }\n else\n noteArray[id++]=key;\n }\n }\n }\n }\n\n Weights.normalize();\n\n }",
"@Override\n public boolean createDailyNote(String note) {\n dailyNotes.add(new DailyNote(note));\n return true;\n }",
"@Override\n public void setCurrentMeasure(int beat) {\n if (beat >= this.getHeadNotes().size() && beat != 0) {\n throw new IllegalArgumentException(\"Beat out of bound\");\n }\n this.currentMeasure = beat;\n }",
"public boolean addNotes(String newNote) {\n\t\tobservationNotes.add(newNote);\n\t\treturn true;\n\t}",
"private boolean checkConglomerateBeatMatch(LinkedList<MidiNote> voiceNotes) {\n\t\tif (voiceNotes.isEmpty()) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tint tactiPerMeasure = beatState.getTactiPerMeasure();\n\t\tint beatLength = subBeatLength * measure.getSubBeatsPerBeat();\n\t\t\n\t\tList<Beat> beats = beatState.getBeats();\n\t\t\n\t\tBeat lastBeat = beats.get(beats.size() - 1);\n\t\tint lastBeatTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), lastBeat.getMeasure(), lastBeat.getBeat());\n\t\tlastBeatTactus -= anacrusisLength * subBeatLength;\n\t\t\n\t\tif (anacrusisLength % measure.getSubBeatsPerBeat() != 0) {\n\t\t\tlastBeatTactus += subBeatLength * (measure.getSubBeatsPerBeat() - (anacrusisLength % measure.getSubBeatsPerBeat()));\n\t\t}\n\t\tint lastBeatNum = lastBeatTactus / beatLength;\n\t\t\n\t\t// First note\n\t\tIterator<MidiNote> iterator = voiceNotes.iterator();\n\t\tMidiNote firstNote = iterator.next();\n\t\titerator.remove();\n\t\t\n\t\tBeat startBeat = firstNote.getOnsetBeat(beats);\n\t\tBeat endBeat = firstNote.getOffsetBeat(beats);\n\t\t\n\t\tint startTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), startBeat.getMeasure(), startBeat.getBeat());\n\t\tint endTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), endBeat.getMeasure(), endBeat.getBeat());\n\t\t\n\t\tint noteLengthTacti = Math.max(1, endTactus - startTactus);\n\t\tstartTactus -= anacrusisLength * subBeatLength;\n\t\tendTactus = startTactus + noteLengthTacti;\n\t\t\n\t\t// Add up possible partial beat at the start\n\t\tif (anacrusisLength % measure.getSubBeatsPerBeat() != 0) {\n\t\t\tstartTactus += subBeatLength * (measure.getSubBeatsPerBeat() - (anacrusisLength % measure.getSubBeatsPerBeat()));\n\t\t}\n\t\tint beatOffset = startTactus % beatLength;\n\t\tint firstBeatNum = startTactus / beatLength;\n\t\t\n\t\t// First note's beat hasn't finished yet\n\t\tif (firstBeatNum == lastBeatNum) {\n\t\t\tvoiceNotes.addFirst(firstNote);\n\t\t\treturn false;\n\t\t}\n\n\t\t// First note doesn't begin on a beat\n\t\tif (beatOffset != 0) {\n\t\t\treturn iterator.hasNext();\n\t\t}\n\t\t\n\t\t// Tracking array\n\t\tMetricalLpcfgQuantum[] quantums = new MetricalLpcfgQuantum[beatLength + 1];\n\t\tArrays.fill(quantums, MetricalLpcfgQuantum.REST);\n\t\t\n\t\t// Add first note into tracking array\n\t\tquantums[beatOffset] = MetricalLpcfgQuantum.ONSET;\n\t\tfor (int tactus = beatOffset + 1; tactus < noteLengthTacti && tactus < quantums.length; tactus++) {\n\t\t\tquantums[tactus] = MetricalLpcfgQuantum.TIE;\n\t\t}\n\t\t\n\t\twhile (iterator.hasNext()) {\n\t\t\tMidiNote note = iterator.next();\n\t\t\t\n\t\t\tstartBeat = note.getOnsetBeat(beats);\n\t\t\tendBeat = note.getOffsetBeat(beats);\n\t\t\t\n\t\t\tstartTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), startBeat.getMeasure(), startBeat.getBeat());\n\t\t\tendTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), endBeat.getMeasure(), endBeat.getBeat());\n\t\t\t\n\t\t\tnoteLengthTacti = Math.max(1, endTactus - startTactus);\n\t\t\tstartTactus -= anacrusisLength * subBeatLength;\n\t\t\tendTactus = startTactus + noteLengthTacti;\n\t\t\t\n\t\t\t// Add up possible partial beat at the start\n\t\t\tif (anacrusisLength % measure.getSubBeatsPerBeat() != 0) {\n\t\t\t\tstartTactus += subBeatLength * (measure.getSubBeatsPerBeat() - (anacrusisLength % measure.getSubBeatsPerBeat()));\n\t\t\t}\n\t\t\tbeatOffset = startTactus % beatLength;\n\t\t\tint beatNum = startTactus / beatLength;\n\t\t\t\n\t\t\tif (beatNum != firstBeatNum) {\n\t\t\t\tif (beatOffset == 0) {\n\t\t\t\t\tquantums[beatLength] = MetricalLpcfgQuantum.ONSET;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// This note was in the same beat. Remove it.\n\t\t\titerator.remove();\n\t\t\t\n\t\t\t// Add note into tracking array\n\t\t\tquantums[beatOffset] = MetricalLpcfgQuantum.ONSET;\n\t\t\tfor (int tactus = beatOffset + 1; tactus - beatOffset < noteLengthTacti && tactus < quantums.length; tactus++) {\n\t\t\t\tquantums[tactus] = MetricalLpcfgQuantum.TIE;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Some note tied over the beat boundary, no match\n\t\tif (quantums[beatLength] == MetricalLpcfgQuantum.TIE) {\n\t\t\treturn iterator.hasNext();\n\t\t}\n\t\t\n\t\t// Get the onsets of this quantum\n\t\tList<Integer> onsets = new ArrayList<Integer>();\n\t\tfor (int tactus = 0; tactus < beatLength; tactus++) {\n\t\t\tMetricalLpcfgQuantum quantum = quantums[tactus];\n\t\t\t\n\t\t\t// There's a REST in this quantum, no match\n\t\t\tif (quantum == MetricalLpcfgQuantum.REST) {\n\t\t\t\treturn iterator.hasNext();\n\t\t\t}\n\t\t\t\n\t\t\tif (quantum == MetricalLpcfgQuantum.ONSET) {\n\t\t\t\tonsets.add(tactus);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Get the lengths of the notes of this quantum\n\t\tList<Integer> lengths = new ArrayList<Integer>(onsets.size());\n\t\tfor (int i = 1; i < onsets.size(); i++) {\n\t\t\tlengths.add(onsets.get(i) - onsets.get(i - 1));\n\t\t}\n\t\tlengths.add(beatLength - onsets.get(onsets.size() - 1));\n\t\t\n\t\t// Only 1 note, no match\n\t\tif (lengths.size() == 1) {\n\t\t\treturn iterator.hasNext();\n\t\t}\n\t\t\n\t\tfor (int i = 1; i < lengths.size(); i++) {\n\t\t\t// Some lengths are different, match\n\t\t\tif (lengths.get(i) != lengths.get(i - 1)) {\n\t\t\t\taddMatch(MetricalLpcfgMatch.BEAT);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// All note lengths were the same, no match\n\t\treturn iterator.hasNext();\n\t}",
"public void setNote( final Double note )\r\n {\r\n this.note = note;\r\n }",
"public void playNote ( Location loc , Instrument instrument , Note note ) {\n\t\texecute ( handle -> handle.playNote ( loc , instrument , note ) );\n\t}",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"private void addNote(){\n DatabaseReference noteRef = mDB.getReference(\"Notes\");\n\n Long time = System.currentTimeMillis();\n\n Bundle bundleNote = new Bundle();\n bundleNote.putString(\"notesDetail\", notes.getText().toString());\n bundleNote.putString(\"notesTime\", time.toString());\n\n Note note = new Note(bundleNote);\n String currNoteKey;\n currNoteKey = noteRef.push().getKey();\n noteRef.child(LoginActivity.currUserID).child(currNoteKey).setValue(note);\n\n }",
"public void setNote(String note) {\r\n this.note = note;\r\n }",
"public void addSample(int note, String fileName) {\n\t\taddSample(note, fileName, -1, -1, 1.0);\n\t}",
"void setNote(int note) {\n\t\tthis.note = note;\n\t}",
"public void addSNArray(StickyNote toAdd);",
"public void setNote(String note) {\r\n\r\n this.note = note;\r\n }",
"@Override\n public ArrayList<Note> getCurrentPlayingNotes(int startBeat) {\n ArrayList<Note> al = this.music.get(startBeat);\n if (al == null) {\n return new ArrayList<>();\n }\n else {\n return al;\n }\n }",
"public void setNote(String note);",
"public static Note createNote(int value, int startBeat, int endBeat) {\n return createNote((value / 12) - 1, Pitch.getPitch(value % 12), startBeat, endBeat);\n }",
"@Override\n\tpublic void playSequenceNote(final int note, final double duration,\n\t\t\tfinal int instrument, final int velocity) {\n\t\ttry {\n\t\t\tstopCurrentSound();\n\t\t\tcurrentSoundType = SOUNDTYPE_MIDI;\n\t\t\tgetMidiSound().playSequenceNote(note, duration, instrument);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void setNote(String note) {\r\n this.note = note; \r\n }",
"public void insertNote(Note note) {\n ProgressTrackerDatabase.databaseWriteExecutor.execute(() -> {\n mNoteDao.insert(note);\n });\n }",
"private void addNote(SheetMusicDrawing sm, JSONObject jsonObject) {\n int x1 = jsonObject.getInt(\"x-position\");\n int y1 = jsonObject.getInt(\"y-position\");\n NoteShape note = new NoteShape(x1, y1, NoteShape.NOTE_WIDTH, NoteShape.NOTE_HEIGHT);\n sm.addNote(note);\n }",
"public void playNote(int pitch) {\n\t\tsynthChannel.noteOn(pitch, MusicManager.SYNTH_NOTE_VELOCITY);\n\t}",
"private void updateMatchType(MidiNote note) {\n\t\tList<Beat> beats = beatState.getBeats();\n\t\tBeat startBeat = note.getOnsetBeat(beats);\n\t\tBeat endBeat = note.getOffsetBeat(beats);\n\t\t\n\t\tint tactiPerMeasure = beatState.getTactiPerMeasure();\n\t\t\n\t\tint startTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), startBeat.getMeasure(), startBeat.getBeat());\n\t\tint endTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), endBeat.getMeasure(), endBeat.getBeat());\n\t\t\n\t\tint noteLengthTacti = Math.max(1, endTactus - startTactus);\n\t\tstartTactus -= anacrusisLength * subBeatLength;\n\t\tendTactus = startTactus + noteLengthTacti;\n\t\t\n\t\tint prefixStart = startTactus;\n\t\tint middleStart = startTactus;\n\t\tint postfixStart = endTactus;\n\t\t\n\t\tint prefixLength = 0;\n\t\tint middleLength = noteLengthTacti;\n\t\tint postfixLength = 0;\n\t\t\n\t\tint beatLength = subBeatLength * measure.getSubBeatsPerBeat();\n\t\t\n\t\t// Reinterpret note given matched levels\n\t\tif (matches(MetricalLpcfgMatch.SUB_BEAT) && startTactus / subBeatLength != (endTactus - 1) / subBeatLength) {\n\t\t\t// Interpret note as sub beats\n\t\t\t\n\t\t\tint subBeatOffset = startTactus % subBeatLength;\n\t\t\tint subBeatEndOffset = endTactus % subBeatLength;\n\t\t\t\n\t\t\t// Prefix\n\t\t\tif (subBeatOffset != 0) {\n\t\t\t\tprefixLength = subBeatLength - subBeatOffset;\n\t\t\t}\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleStart += prefixLength;\n\t\t\tmiddleLength -= prefixLength;\n\t\t\t\n\t\t\t// Postfix\n\t\t\tpostfixStart -= subBeatEndOffset;\n\t\t\tpostfixLength += subBeatEndOffset;\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleLength -= postfixLength;\n\t\t\t\n\t\t} else if (matches(MetricalLpcfgMatch.BEAT) && startTactus / beatLength != (endTactus - 1) / beatLength) {\n\t\t\t// Interpret note as beats\n\t\t\t\n\t\t\t// Add up possible partial beat at the start\n\t\t\tif (anacrusisLength % measure.getSubBeatsPerBeat() != 0) {\n\t\t\t\tint diff = subBeatLength * (measure.getSubBeatsPerBeat() - (anacrusisLength % measure.getSubBeatsPerBeat()));\n\t\t\t\tstartTactus += diff;\n\t\t\t\tendTactus += diff;\n\t\t\t}\n\t\t\tint beatOffset = (startTactus + subBeatLength * (anacrusisLength % measure.getSubBeatsPerBeat())) % beatLength;\n\t\t\tint beatEndOffset = (endTactus + subBeatLength * (anacrusisLength % measure.getSubBeatsPerBeat())) % beatLength;\n\t\t\t\n\t\t\t// Prefix\n\t\t\tif (beatOffset != 0) {\n\t\t\t\tprefixLength = beatLength - beatOffset;\n\t\t\t}\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleStart += prefixLength;\n\t\t\tmiddleLength -= prefixLength;\n\t\t\t\n\t\t\t// Postfix\n\t\t\tpostfixStart -= beatEndOffset;\n\t\t\tpostfixLength += beatEndOffset;\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleLength -= postfixLength;\n\t\t}\n\t\t\n\t\t// Prefix checking\n\t\tif (prefixLength != 0) {\n\t\t\tupdateMatchType(prefixStart, prefixLength);\n\t\t}\n\t\t\n\t\t// Middle checking\n\t\tif (!isFullyMatched() && !isWrong() && middleLength != 0) {\n\t\t\tupdateMatchType(middleStart, middleLength);\n\t\t}\n\t\t\n\t\t// Postfix checking\n\t\tif (!isFullyMatched() && !isWrong() && postfixLength != 0) {\n\t\t\tupdateMatchType(postfixStart, postfixLength);\n\t\t}\n\t}",
"public static Note createNote(int octave, Pitch pitch, int startBeat, int endBeat) {\n return new NoteImpl(octave, pitch, startBeat, endBeat);\n }",
"public void setNote(String note) {\n\t\tthis.note = note;\n\t}",
"private void updateMatchType(int startTactus, int noteLengthTacti) {\n\t\tint beatLength = subBeatLength * measure.getSubBeatsPerBeat();\n\t\tint measureLength = beatLength * measure.getBeatsPerMeasure();\n\t\t\n\t\tint subBeatOffset = startTactus % subBeatLength;\n\t\tint beatOffset = startTactus % beatLength;\n\t\tint measureOffset = startTactus % measureLength;\n\t\t\n\t\tif (matches(MetricalLpcfgMatch.SUB_BEAT)) {\n\t\t\t// Matches sub beat (and not beat)\n\t\t\t\n\t\t\tif (noteLengthTacti < subBeatLength) {\n\t\t\t\t// Note is shorter than a sub beat\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti == subBeatLength) {\n\t\t\t\t// Note is exactly a sub beat\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti < beatLength) {\n\t\t\t\t// Note is between a sub beat and a beat in length\n\t\t\t\t\n\t\t\t\t// Can only happen when the beat is divided in 3, but this is 2 sub beats\n\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti == beatLength) {\n\t\t\t\t// Note is exactly a beat in length\n\t\t\t\t\n\t\t\t\t// Must match exactly\n\t\t\t\taddMatch(beatOffset == 0 ? MetricalLpcfgMatch.BEAT : MetricalLpcfgMatch.WRONG);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Note is greater than a beat in length\n\t\t\t\t\n\t\t\t\tif (noteLengthTacti % beatLength != 0) {\n\t\t\t\t\t// Not some multiple of the beat length\n\t\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} else if (matches(MetricalLpcfgMatch.BEAT)) {\n\t\t\t// Matches beat (and not sub beat)\n\t\t\t\n\t\t\tif (noteLengthTacti < subBeatLength) {\n\t\t\t\t// Note is shorter than a sub beat\n\t\t\t\t\n\t\t\t\tif (subBeatLength % noteLengthTacti != 0 || subBeatOffset % noteLengthTacti != 0) {\n\t\t\t\t\t// Note doesn't divide sub beat evenly\n\t\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti == subBeatLength) {\n\t\t\t\t// Note is exactly a sub beat\n\t\t\t\t\n\t\t\t\t// Must match sub beat exactly\n\t\t\t\taddMatch(subBeatOffset == 0 ? MetricalLpcfgMatch.SUB_BEAT : MetricalLpcfgMatch.WRONG);\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti < beatLength) {\n\t\t\t\t// Note is between a sub beat and a beat in length\n\t\t\t\t\n\t\t\t\t// Wrong if not aligned with beat at onset or offset\n\t\t\t\tif (beatOffset != 0 && beatOffset + noteLengthTacti != beatLength) {\n\t\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti == beatLength) {\n\t\t\t\t// Note is exactly a beat in length\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Note is longer than a beat in length\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// Matches neither sub beat nor beat\n\t\t\t\n\t\t\tif (noteLengthTacti < subBeatLength) {\n\t\t\t\t// Note is shorter than a sub beat\n\t\t\t\t\n\t\t\t\tif (subBeatLength % noteLengthTacti != 0 || subBeatOffset % noteLengthTacti != 0) {\n\t\t\t\t\t// Note doesn't divide sub beat evenly\n\t\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti == subBeatLength) {\n\t\t\t\t// Note is exactly a sub beat\n\t\t\t\t\n\t\t\t\t// Must match sub beat exactly\n\t\t\t\taddMatch(subBeatOffset == 0 ? MetricalLpcfgMatch.SUB_BEAT : MetricalLpcfgMatch.WRONG);\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti < beatLength) {\n\t\t\t\t// Note is between a sub beat and a beat in length\n\t\t\t\t\n\t\t\t\t// Wrong if not aligned with beat at onset or offset\n\t\t\t\tif (beatOffset != 0 && beatOffset + noteLengthTacti != beatLength) {\n\t\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (noteLengthTacti == beatLength) {\n\t\t\t\t// Note is exactly a beat in length\n\t\t\t\t\n\t\t\t\t// Must match beat exactly\n\t\t\t\taddMatch(beatOffset == 0 ? MetricalLpcfgMatch.BEAT : MetricalLpcfgMatch.WRONG);\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Note is greater than a beat in length\n\t\t\t\t\n\t\t\t\tif (measureLength % noteLengthTacti != 0 || measureOffset % noteLengthTacti != 0 ||\n\t\t\t\t\t\tbeatOffset != 0 || noteLengthTacti % beatLength != 0) {\n\t\t\t\t\t// Note doesn't divide measure evenly, or doesn't match a beat\n\t\t\t\t\taddMatch(MetricalLpcfgMatch.WRONG);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public List getNotesPlayingAtBeat(int beat) {\n List<Note> notes = this.getNotes();\n ArrayList<Note> notesAtBeat = new ArrayList<>();\n\n for (int i = 0; i < notes.size(); i++) {\n Note current = notes.get(i);\n\n if (current.isPlaying(beat)) {\n notesAtBeat.add(current);\n }\n }\n\n return notesAtBeat;\n }",
"@Override\n public void removeNote(Note n) {\n if (!n.getIsHead()) {\n throw new IllegalArgumentException(\"cannot remove a note that is not\" +\n \"the head note\");\n }\n boolean result = false;\n for (int i = 0; i < n.getDuration(); i++) {\n for (Note t : this.sheet.get(i + n.getStartMeasure())) {\n if (t.equals(n)) {\n result = true;\n }\n }\n }\n if (result == false) {\n throw new IllegalArgumentException(\"note doesn't exist\");\n }\n Note head = find(n.getStartMeasure(), n.getDuration(), n.getOctave(), n\n .toMidiIndex());\n this.sheet.get(n.getStartMeasure()).remove(head);\n\n\n for (int i = 1; i < n.getDuration(); i++) {\n int currentMeasure = n.getStartMeasure() + i;\n\n Note hold = find(currentMeasure, 1, n.getOctave(), n\n .toMidiIndex());\n this.sheet.get(currentMeasure).remove(hold);\n }\n }",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (!myRec.get(index).isBeat()) {\n\n\t\t\t\t\t\tLog.i(\"recstart\",\n\t\t\t\t\t\t\t\t\"about to play note: \"\n\t\t\t\t\t\t\t\t\t\t+ myRec.get(index).getNoteToPlay());\n\t\t\t\t\t\tsp.playNote(myRec.get(index).getNoteToPlay(), 1);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// is beat\n\t\t\t\t\t\tplayBeat(myRec.get(index).getBeat());\n\t\t\t\t\t\tLog.i(\"recstart\", \"is a beat! playing beat: \"\n\t\t\t\t\t\t\t\t+ myRec.get(index).getBeat());\n\t\t\t\t\t}\n\t\t\t\t}",
"@Override\n\tpublic void reportNote(String note) {\n\t\t//Sends data chunks(note) to the process method\n\t\tpublish(note);\n\t}",
"public void setNote(String note) {\n\t\tthis._note = note;\n\t}",
"public static Note createNote(int octave, Pitch pitch, int startBeat, int endBeat, int\n instrument, int volume) {\n return new NoteImpl(octave, pitch, startBeat, endBeat, instrument, volume);\n }",
"@Override\n\tpublic void add(GalaxyNote phone) {\n\t\t\n\t}",
"@Override\n public void mutate(Song song, int noteIndex) {\n if (Math.random() < this.getProbability()) {\n if (noteIndex > 0) {\n MidiUtil mu = new MidiUtil();\n int nbrOfTotalReversing = nbrOfAdditionalReversing + 1\n + ((int) Math.random() * nbrRange);\n ArrayList<Integer> noteIndexes = new ArrayList<Integer>();\n ArrayList<Note> notes = new ArrayList<Note>();\n noteIndexes.add(noteIndex);\n notes.add(song.getScore().getPart(0).getPhrase(0)\n .getNote(noteIndex));\n int currentIndex = noteIndex - 1;\n noteIteration: for (int i = 1; i < nbrOfTotalReversing; i++) {\n while (mu.isBlank(currentIndex) && currentIndex >= 0) {\n currentIndex--;\n }\n if (currentIndex < 0) {\n break noteIteration;\n } else {\n noteIndexes.add(currentIndex);\n notes.add(song.getScore().getPart(0).getPhrase(0)\n .getNote(currentIndex));\n }\n }\n int totalReverses = noteIndexes.size();\n for (int j = 0; j < noteIndexes.size(); j++) {\n if (withRhythmLength) {\n song.getScore()\n .getPart(0)\n .getPhrase(0)\n .setNote(notes.get(totalReverses - 1 - j),\n noteIndexes.get(j));\n } else {\n int newPitch = notes.get(totalReverses - 1 - j)\n .getPitch();\n song.getScore().getPart(0).getPhrase(0)\n .getNote(noteIndexes.get(j)).setPitch(newPitch);\n }\n }\n }\n }\n }",
"public final void rule__BodyComponent__NoteAssignment_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:3719:1: ( ( ruleNote ) )\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:3720:1: ( ruleNote )\n {\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:3720:1: ( ruleNote )\n // ../ufscar.Compiladores2.ui/src-gen/ufscar/compiladores2/ui/contentassist/antlr/internal/InternalMusy.g:3721:1: ruleNote\n {\n before(grammarAccess.getBodyComponentAccess().getNoteNoteParserRuleCall_1_0()); \n pushFollow(FOLLOW_ruleNote_in_rule__BodyComponent__NoteAssignment_17509);\n ruleNote();\n\n state._fsp--;\n\n after(grammarAccess.getBodyComponentAccess().getNoteNoteParserRuleCall_1_0()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public void addWave(Wave wave)\n\t{\n\t\twaveList.add(wave);\n\t}",
"public void repeatNotes()\n {\n int start, end;\n \n printScore(); //prints the current score that we have for the user to reference\n \n System.out.print(\"\\nEnter the note number that starts the repetition > \"); //prompts to enter the start of the repetition\n start = in.nextInt();\n \n System.out.print(\"Enter the note number that ends the repetition > \"); //prompts user to enter the end of the repetition\n end = in.nextInt();\n \n if (start <= score.size() && start > 0 && end <= score.size() && end >= start)\n {\n for (int i = 0; i <= ((end - 1) - (start - 1)); i++)\n {\n Note tempNote = new Note(score.get((start - 1) + i).getNote(), score.get((start - 1) + i).getBeat());\n score.add(tempNote);\n }\n }\n else\n {\n System.out.print(\"Error. \");\n if (end < 1 || end > score.size())\n System.out.println(\"The ending note number is not valid.\");\n else if (start < 1 || start > score.size())\n System.out.println(\"The starting note number is not valid.\");\n else if (start > end)\n System.out.println(\"The starting note number can not be bigger than the ending note number.\"); \n }\n }",
"@Override\r\n\tpublic void setNote(long d, int hz) {\n\t\t\r\n\t}",
"@Override\n public void playSimultaneously(MusicModel<Note> musicModel) {\n ArrayList<Note> listOfNoteFromModel = musicModel.getAllNotes();\n\n for (Note n : listOfNoteFromModel) {\n this.add(n);\n }\n }",
"public Note(char n, int dur) {\n\t\tnote = n;\n\t\tduration = dur;\n\t}",
"public void playSong() {\n\t\t// Initialize\n\t\tint num = 1;\n\n\t\t// Get the notes to be played from the entryBox\n\t\tString notesString = \"V0 \" + instrumentType + \" \" + entryBox.getText();\n\n\t\t// Create a new rhythm object\n\t\tRhythm rhythm = new Rhythm();\n\n\t\t// Get the rhythm strings from the rhythm entry boxes\n\t\tString rhythmLayer1 = \"V1 \" + rhythm1.getText();\n\t\tString rhythmLayer2 = \"V2 \" + rhythm2.getText();\n\n\t\t// Set the strings to layers\n\t\trhythm.setLayer(1, rhythmLayer1);\n\t\trhythm.setLayer(2, rhythmLayer2);\n\n\t\t// Add the appropriate substitutions\n\t\trhythm.addSubstitution('O', \"[BASS_DRUM]i\");\n\t\trhythm.addSubstitution('o', \"Rs [BASS_DRUM]s\");\n\t\trhythm.addSubstitution('*', \"[ACOUSTIC_SNARE]i\");\n\t\trhythm.addSubstitution('^', \"[PEDAL_HI_HAT]s Rs\");\n\t\trhythm.addSubstitution('!', \"[CRASH_CYMBAL_1]s Rs\");\n\t\trhythm.addSubstitution('.', \"Ri\");\n\n\t\t// Get the rhythm pattern\n\t\tPattern rhythmPattern = rhythm.getPattern();\n\n\t\t// Get how many times the song should repeat\n\t\tString repeatNum = repeatNumber.getText();\n\t\tnum = Integer.parseInt(repeatNum);\n\n\t\t// Get the playback tempo\n\t\tString playTempo = \"T[\" + tempo.getText() + \"] \";\n\n\t\t// Create the song\n\t\tPattern song = new Pattern();\n\t\tsong.add(rhythmPattern);\n\t\tsong.add(notesString);\n\t\tsong.repeat(num);\n\n\t\t// Play the song\n\t\tplayer.play(playTempo + song);\n\n\t}",
"public interface MusicOperations {\n\n\n /**\n * Adds a note to the piece at a given beat number with generic instrument and volume.\n *\n * <p>the String needed for the pitch is the letter of the note, followed by \"SHARP\" if\n * the note is a sharp. Everything must be in all caps.\n * (i.e a C would be given as \"C\", and a C# would be \"CSHARP\" </p>\n *\n * @param pitch pitch of the note to be added as a String\n * @param octave octave of the note to be added.\n * @param duration duration of the note to be added.\n * @param beatNum beat number to add the note at.\n * @throws IllegalArgumentException if note is invalid.\n */\n void addNote(int duration, int octave, int beatNum, String pitch)\n throws IllegalArgumentException;\n\n\n /**\n * Adds a given Repeat at given beat.\n * @param beatNum beatNumber to be placed at.\n * @param repeatType type of repeat to add.\n */\n void addRepeat(int beatNum, RepeatType repeatType);\n\n /**\n * Adds a note to model with given parameters.\n * @param duration duration of Note added.\n * @param octave octave of Note added.\n * @param beatNum beat number to place note at.\n * @param instrument instrument of the note.\n * @param volume the volume of the note added.\n * @param pitch the pitch of the note added as a String. (see prior method for details)\n * @throws IllegalArgumentException if it is an illegal note.\n */\n void addNote(int duration, int octave, int beatNum, int instrument, int volume, String pitch)\n throws IllegalArgumentException;\n\n /**\n * Removes a note from the song.\n * @param beatNum beat number to remove note from.\n * @param pitch pitch of the note.\n * @param octave octave of the note.\n * @return the note that was deleted.\n * @throws IllegalArgumentException if note cannot be found.\n */\n INote removeNote(int beatNum, String pitch, int octave) throws IllegalArgumentException;\n\n /**\n * Edits the given note according to editor.\n * @param editor contains directions to edit note.\n * @param beatNum the beat number the note is at.\n * @param pitch the pitch of the note.\n * @param octave the octave of the note.\n * @throws IllegalArgumentException if note cannot be found.\n */\n void editNote(String editor, int beatNum, String pitch, int octave)\n throws IllegalArgumentException;\n\n /**\n * Merges the given piece with the one in the model.\n * @param piece piece to merge.\n */\n void mergePiece(Piece piece);\n\n /**\n * Adds the given piece at the end of the current one.\n * @param piece piece to be added to current one.\n */\n void addPiece(Piece piece);\n\n\n /**\n * Gets the song in MIDI notation as a String.\n * @return the string.\n */\n String getMIDINotation();\n\n\n /**\n * NEW METHOD to aid view play notes at given beat without parsing.\n * Gets a copy of the Notes that start at given beat number.\n * @param beatNum number to get notes from.\n * @return the list of notes.\n */\n ArrayList<INote> getNotesAt(int beatNum);\n\n /**\n * Gets the minimum note value.\n * @return returns the min.\n */\n int minNoteValue();\n\n /**\n * gets the max note value.\n * @return the value.\n */\n int maxNoteValue();\n\n /**\n * Gets the last beat of the song.\n * @return the last beat number.\n */\n int maxBeatNum();\n\n /**\n * Gets the Tempo of the song.\n * @return the tempo of the song.\n */\n int getTempo();\n\n /**\n * Sets the tempo of the song.\n * @param tempo tempo to be set.\n */\n void setTempo(int tempo);\n\n Repeat getRepeatAt(int beat);\n\n boolean hasRepeatAt(int beat);\n\n List<BeginRepeat> getBeginRepeats();\n\n Map<Integer, Repeat> getRepeats();\n}",
"public int addNote(ObjectListElement e){\n\t\tallNotes.add(e);\n\t\treturn allNotes.indexOf(e);\n\t}",
"private String notesToString(List<Note> notesPlayingAtBeat, int beat) {\n if (notesPlayingAtBeat.size() == 0) {\n return \"\";\n }\n String padding = \" \";\n String onBeat = \" x \";\n String onDuration = \" | \";\n\n Note highest = this.getHighestNote();\n Note lowest = this.getLowestNote();\n int ordinalHighestOctave = highest.getOctave().ordinal();\n int ordinalHighestPitch = highest.getPitch().ordinal();\n int ordinalLowOctave = lowest.getOctave().ordinal();\n int ordinalLowPitch = lowest.getPitch().ordinal();\n int from = ordinalLowOctave * 12 + ordinalLowPitch;\n int to = ordinalHighestOctave * 12 + ordinalHighestPitch;\n\n List<String> listOfNotes = this.allnotes.subList(from, to + 1);\n int allNotesSize = listOfNotes.size();\n\n StringBuilder builder = new StringBuilder();\n List<String> newList = new ArrayList<>();\n\n for (int x = 0; x < allNotesSize; x++) {\n String currentNote = listOfNotes.get(x);\n\n for (int i = 0; i < notesPlayingAtBeat.size(); i++) {\n Note playingNote = notesPlayingAtBeat.get(i);\n String playingString =\n playingNote.getPitch().getValue() + playingNote.getOctave().getValue();\n\n if (playingString.equals(currentNote) && playingNote.getBeat() == beat) {\n newList.add(onBeat);\n break;\n } else if (playingString.equals(currentNote)) {\n newList.add(onDuration);\n break;\n } else if (i == notesPlayingAtBeat.size() - 1) {\n newList.add(padding);\n }\n }\n }\n\n for (int c = 0; c < newList.size(); c++) {\n builder.append(newList.get(c).toString());\n }\n\n return builder.toString();\n\n }",
"public void testfindNote() {\n System.out.println(\"findNote\");\n net.sharedmemory.tuner.Note instance = new net.sharedmemory.tuner.Note();\n\n double frequency = 441.123;\n java.lang.String expectedResult = \"A4\";\n java.lang.String result = instance.findNote(frequency);\n assertEquals(expectedResult, result);\n \n frequency = 523.25;\n expectedResult = \"C5\";\n result = instance.findNote(frequency);\n assertEquals(expectedResult, result);\n \n frequency = 417.96875;\n expectedResult = \"G#4\";\n result = instance.findNote(frequency);\n assertEquals(expectedResult, result);\n \n frequency = 1316.40625;\n expectedResult = \"B5\";\n result = instance.findNote(frequency);\n assertEquals(expectedResult, result);\n }",
"@Test\n public void createNewNote() throws Exception{\n final CourseInfo course = sDataManager.getCourse(\"android_async\");\n final String noteTitle = \"Test note title\";\n final String noteText = \"This is the body test of my text note\";\n\n int noteIndex = sDataManager.createNewNote();\n NoteInfo newNote = sDataManager.getmNotes().get(noteIndex);\n newNote.setmCourses(course);\n newNote.setmTitle(noteTitle);\n newNote.setmText(noteText);\n\n NoteInfo compareNote = sDataManager.getmNotes().get(noteIndex);//contains the things that we put on the note at that point\n assertEquals(compareNote.getmCourses(), course);\n assertEquals(compareNote.getmTitle(), noteTitle);\n assertEquals(compareNote.getmText(), noteText);\n// assertSame(newNote, compareNote);//checks if two references point to the same object\n }",
"public Note(Pitch pitch, int octave, int instrument) {\n if (octave < 0 || octave > 10) {\n throw new IllegalArgumentException(\"octave must be between 0 and 10 (inclusive)\");\n }\n\n this.pitch = pitch;\n this.octave = octave;\n this.instrument = instrument;\n }",
"public Note(int noteNumber, int instrument) {\n this.octave = (noteNumber / 12) - 1;\n this.pitch = Pitch.pitchFromNumber(noteNumber - (this.octave * 12));\n this.instrument = instrument;\n }",
"@Override\n public synchronized void addMeasurement(Measurement m){\n while(toBeConsumed>=size){\n try{\n wait();\n }\n catch (InterruptedException e){\n System.out.println(\"The thread was teared down\");\n }\n }\n /*try {\n Thread.sleep(1000);\n }\n catch(InterruptedException e){\n System.out.println(e.getMessage());\n }*/\n buf[(startIdx+toBeConsumed)%size]=m;\n //System.out.println(\"Inserting \"+m);\n toBeConsumed++;\n\n /*\n If the buffer is no more empty, notify to consumer\n */\n if(toBeConsumed>=windowSize)\n notifyAll();\n }",
"@Test\n\tpublic void addTrack_Test() throws Exception {\n\t\t\n\t\tif (Configuration.featureamp &&\n\t\t\t\tConfiguration.playengine &&\n\t\t\t\tConfiguration.choosefile &&\n\t\t\t\tConfiguration.mp3 &&\n\t\t\t\tConfiguration.gui &&\n\t\t\t\tConfiguration.skins &&\n\t\t\t\tConfiguration.light &&\n\t\t\t\tConfiguration.filesupport &&\n\t\t\t\tConfiguration.showtime &&\n\t\t\t\tConfiguration.playlist \n\t\t\t\t) {\n\t\t\tstart();\n\t\t\tFile file = new File(\"media/note.mp3\");\n\t\t\tgui.addTrack(\"note\",file);\t\n\t\t}\n\t}",
"public void setNote(Note newNote) {\n\t \n\t //stores newNote in the note field\n\t this.note = newNote;\n }",
"private void addNotes(SheetMusicDrawing sm, JSONObject jsonObject) {\n JSONArray jsonArray = jsonObject.getJSONArray(\"notes\");\n for (Object json : jsonArray) {\n JSONObject nextNote = (JSONObject) json;\n addNote(sm, nextNote);\n }\n }",
"public void storeNote(String text) {\r\n\t\tTextNote note = new TextNote();\r\n\t\tnote.setText(text);\r\n\t\tthis.TextNoteList.add(note);\r\n\t}"
] | [
"0.7866429",
"0.78653634",
"0.7518414",
"0.741123",
"0.7394704",
"0.71088845",
"0.7053992",
"0.6904464",
"0.688001",
"0.6832067",
"0.679935",
"0.64551574",
"0.6311466",
"0.61403656",
"0.6122123",
"0.6114366",
"0.60560036",
"0.6055876",
"0.59445864",
"0.59202296",
"0.5908175",
"0.59071857",
"0.5900711",
"0.5880745",
"0.58628345",
"0.58372736",
"0.5798174",
"0.5792965",
"0.57907236",
"0.5777469",
"0.5730556",
"0.57166785",
"0.5707826",
"0.5664485",
"0.5653156",
"0.56528294",
"0.5650405",
"0.5643506",
"0.5634708",
"0.5614596",
"0.5610976",
"0.560243",
"0.55934757",
"0.5586331",
"0.5582119",
"0.5579189",
"0.55728585",
"0.5570226",
"0.55696636",
"0.5566487",
"0.5555257",
"0.5555257",
"0.5555257",
"0.5555257",
"0.5555257",
"0.55450207",
"0.55386627",
"0.55276036",
"0.5526008",
"0.552566",
"0.55179673",
"0.5507909",
"0.54996383",
"0.54906654",
"0.5487153",
"0.5485716",
"0.54844713",
"0.54790294",
"0.5473003",
"0.5466214",
"0.54493827",
"0.5446143",
"0.5418424",
"0.5416229",
"0.5415673",
"0.53995776",
"0.5399367",
"0.5396828",
"0.5391163",
"0.5382477",
"0.53618944",
"0.5361092",
"0.5358674",
"0.5358059",
"0.5351264",
"0.5348195",
"0.53328043",
"0.53145075",
"0.5301777",
"0.5258125",
"0.52574843",
"0.52511036",
"0.52335596",
"0.5228368",
"0.5226735",
"0.5199901",
"0.5178187",
"0.51553524",
"0.513988",
"0.5138765"
] | 0.75829536 | 2 |
Add all notes given. | @Override
public void addAll(List<Note> given) {
for (Note n : given) {
this.addNote(n);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void addNote(Note n){\n notes.add(n);\n }",
"void add(Note note);",
"@Override\n public void add(Note note) {\n }",
"public void insertNotesForApplicant(int userId, List<String> notes) throws SQLException {\n\t\tString delete =\r\n\t\t\t\t\"DELETE FROM applicant_notes WHERE user_id = \" + userId;\r\n\t\t\r\n\t\tdqe.executeStatement(delete);\r\n\t\t\r\n\t\t// Now add the notes we got\r\n\t\tfor(String note : notes) {\r\n\t\t\tString insert =\t\"INSERT INTO applicant_notes (user_id, note) VALUES (\" + userId + \", '\" + note + \"')\";\r\n\t\t\t\r\n\t\t\tdqe.executeStatement(insert);\r\n\t\t}\r\n\t}",
"public void setNotes(String notes) {\n this.notes = notes;\n }",
"public void setNotes(java.lang.String notes) {\n this.notes = notes;\n }",
"Update withNotes(String notes);",
"public void setNotes(String notes) {\n\t\tthis.notes = notes;\r\n\t}",
"public void setNotes(String notes) {\n\t\tthis.notes = notes;\n\t}",
"public void setNotes(String notes) {\n\tthis.notes = notes;\n}",
"@Override\n public void addNote(Note note) {\n\n List<Note> notes = new ArrayList<>();\n notes.add(note);\n\n if (this.notes.get(note.getBeat()) == null) {\n this.notes.put(note.getBeat(), notes);\n } else {\n List<Note> oldList = this.notes.remove(note.getBeat());\n oldList.addAll(notes);\n this.notes.put(note.getBeat(), oldList);\n }\n }",
"public void addElts(NoteToken note){\r\n NotesList.add(note);\r\n }",
"public void addNotes(String[] priceQueryLines){\r\n\t\r\n\t\tfor (String priceQuery : priceQueryLines) {\r\n\t\t\tString noteQuery[] = priceQuery.split(regex);\r\n\t\t\t\r\n\t\t\tif(noteQuery.length == 3 && noteQuery[1].equalsIgnoreCase(is)){\r\n\t\t\t\tNote galacticRomanNote = NoteFactory.GalacticToRomanNote(noteQuery);\r\n\t\t\t\tGalaxyUtil.elementNoteValue.put(galacticRomanNote.element, galacticRomanNote);\r\n\t\t\t}else{\r\n\t\t\t\tNote metalPriceNote = NoteFactory.MetalPriceNote(noteQuery);\r\n\t\t\t\tGalaxyUtil.elementNoteValue.put(metalPriceNote.element, metalPriceNote);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n public void addNote(int startTime, int duration, Pitch pitch, Octave octave) {\n List<Note> notes = new ArrayList<>();\n Note newNote = new SimpleNote(pitch, octave, startTime, duration);\n notes.add(newNote);\n\n if (this.notes.get(startTime) == null) {\n this.notes.put(startTime, notes);\n } else {\n List<Note> oldList = this.notes.remove(startTime);\n oldList.addAll(notes);\n this.notes.put(startTime, oldList);\n }\n\n }",
"public void setNotes(String notes);",
"public void insertNotes(Notes notes) throws DaoException { \t\t\r\n\r\n\t\ttry {\r\n\t\t\t// insert notes\r\n\t\t \tString sql =\r\n\t\t\t\t \"INSERT INTO notes (notesId, userId, content, lastModified,creationDate) \" +\r\n\t\t\t\t \"VALUES (#notesId#, #userId#, #content#, #lastModified#,#creationDate#)\";\r\n\t\t\t\t \r\n\t\t\tsuper.update(sql, notes);\r\n\t\t\t\t\t\t\r\n\r\n\t \t}\r\n\t\tcatch(Exception e) {\t\t\t\r\n\t\t\tlog.error(e.getMessage(), e);\r\n\t\t\tthrow new DaoException(e.toString());\r\n\t\t}\r\n\t}",
"public void setNotes(Set<INote> notes) {\r\n this.no = new NoteOperations(notes);\r\n\r\n // the total beats onscreen.\r\n this.totalBeats = no.pieceLength();\r\n\r\n this.setPreferredSize(getPreferredSize());\r\n }",
"void setNotes(String notes);",
"private List<String> allNotes() {\n List allNotes = new ArrayList();\n\n for (int i = 0; i < 10; i++) {\n Octave octave = getOctave(i);\n\n for (int x = 0; x < 12; x++) {\n Pitch pitch = getPitch(x);\n\n String note = pitch.getValue() + octave.getValue();\n allNotes.add(note);\n }\n }\n return allNotes;\n }",
"public void setNotes(com.sforce.soap.enterprise.QueryResult notes) {\r\n this.notes = notes;\r\n }",
"public void setAnalyticalNotes(java.util.List analyticalNotes);",
"public Note addNote(String title, String text) {\n Note newNote = new Note(title, text);\n notes.add(newNote); //add to ArrayList\n return newNote;\n }",
"public void addSNArray(StickyNote toAdd);",
"@Override\n public CompositionBuilder<MusicOperation> addNote(int start, int end, int instrument,\n int pitch, int volume) {\n this.listNotes.add(new SimpleNote(Pitch.values()[(pitch) % 12],\n Octave.values()[(pitch / 12) - 2 ], start, end - start, instrument, volume));\n return this;\n }",
"public boolean addNotes(String newNote) {\n\t\tobservationNotes.add(newNote);\n\t\treturn true;\n\t}",
"void addNotes(Note arr[]){\n for(int i = 0; i < arr.length; i++){\n System.out.println(\"Please enter the name of the author of this note\");\n String author = sc.nextLine();\n arr[i].setAuthor(author);\n\n System.out.println(\"Please enter the date of this note\");\n String date = sc.nextLine();\n arr[i].setDate(date);\n\n System.out.println(\"You can now enter your note\");\n String description = sc.nextLine();\n arr[i].setDescription(description);\n\n //checks to see if a file exists\n try {\n if(!file.exists()){\n file.createNewFile();\n }\n // BufferedWriter allows the ability to write to file\n BufferedWriter buffer = new BufferedWriter(new FileWriter(file, true));\n buffer.write(author);\n buffer.write(date);\n buffer.write(description);\n\n buffer.close();\n System.out.println(\"Successfully written to file\");\n\n }catch (Exception ex){\n System.out.println(ex);\n }// end of try catch\n }//end of for loop\n }",
"WithCreate withNotes(String notes);",
"@Override\n\tpublic void saveNotes(List<Etudiant> etudiants, List<String> notes, int id_cours) {\n\t\tthis.etudiantDao.saveNotes(etudiants, notes, id_cours);\n\t}",
"@Override\n public void addNote(Note n) {\n if (this.sheet.size() < n.getDuration() + n.getStartMeasure()) {\n for (int i = this.sheet.size(); i < n.getDuration() + n.getStartMeasure(); i++) {\n sheet.add(new HashSet<>());\n }\n }\n for (int i = 0; i < n.getDuration(); i++) {\n for (Note t : this.sheet.get(i + n.getStartMeasure())) {\n if (t.equals(n)) {\n throw new IllegalArgumentException(\"Already placed a note.\");\n }\n }\n }\n this.sheet.get(n.getStartMeasure()).add(n);\n int currentMeasure = n.getStartMeasure() + 1;\n for (int i = 1; i < n.getDuration(); i++) {\n Note hold = new Note(1, n.getOctave(), currentMeasure,\n n.getPitch(), false, n.getInstrument(), n.getVolume());\n this.sheet.get(currentMeasure).add(hold);\n currentMeasure++;\n }\n\n this.high = this.getHighest();\n this.low = this.getLowest();\n }",
"public void addNote(Note note) throws ChangeVetoException;",
"void addNote(int duration, int octave, int beatNum, int instrument, int volume, String pitch)\n throws IllegalArgumentException;",
"public void addNote(@NonNull Note_Model newNote) {\n noteModelSection.add(0, newNote);\n if (noteModelSection.size() > 1) {\n noteScreenRecycler.smoothScrollToPosition(0);\n }\n for (int position = 0; position < noteModelSection.size(); position++) {\n noteModelSection.get(position).setActualPosition(position);\n }\n mainActivity.get().getNoteScreen().get().getAdapter().updateNotesAdapter(noteModelSection);\n // new Thread(() -> everDataBase.noteManagement().insert(transformNoteModelToNoteDatabase(newNote))).start();\n }",
"public int addNote(ObjectListElement e){\n\t\tallNotes.add(e);\n\t\treturn allNotes.indexOf(e);\n\t}",
"protected void addNotes(AccountsPayableDocument accountsPayableDocument, PaymentDetail paymentDetail) {\r\n int count = 1;\r\n\r\n if (accountsPayableDocument instanceof PaymentRequestDocument) {\r\n PaymentRequestDocument prd = (PaymentRequestDocument) accountsPayableDocument;\r\n\r\n if (prd.getSpecialHandlingInstructionLine1Text() != null) {\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(prd.getSpecialHandlingInstructionLine1Text());\r\n paymentDetail.addNote(pnt);\r\n }\r\n\r\n if (prd.getSpecialHandlingInstructionLine2Text() != null) {\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(prd.getSpecialHandlingInstructionLine2Text());\r\n paymentDetail.addNote(pnt);\r\n }\r\n\r\n if (prd.getSpecialHandlingInstructionLine3Text() != null) {\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(prd.getSpecialHandlingInstructionLine3Text());\r\n paymentDetail.addNote(pnt);\r\n }\r\n }\r\n\r\n if (accountsPayableDocument.getNoteLine1Text() != null) {\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(accountsPayableDocument.getNoteLine1Text());\r\n paymentDetail.addNote(pnt);\r\n }\r\n\r\n if (accountsPayableDocument.getNoteLine2Text() != null) {\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(accountsPayableDocument.getNoteLine2Text());\r\n paymentDetail.addNote(pnt);\r\n }\r\n\r\n if (accountsPayableDocument.getNoteLine3Text() != null) {\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(accountsPayableDocument.getNoteLine3Text());\r\n paymentDetail.addNote(pnt);\r\n }\r\n\r\n PaymentNoteText pnt = new PaymentNoteText();\r\n pnt.setCustomerNoteLineNbr(new KualiInteger(count++));\r\n pnt.setCustomerNoteText(\"Sales Tax: \" + accountsPayableDocument.getTotalRemitTax());\r\n }",
"public static List<NoteInfo> searchAllNotes() {\n\n ArrayList<Long> keywordIdList = new ArrayList<Long>();\n ArrayList<Long> finalIdList = new ArrayList<Long>();\n\n String email = Secured.getUser(ctx());\n List<NoteEntry> entryIdList = NoteEntry.find()\n .select(\"entryId\")\n .where()\n .eq(\"email\", email)\n .findList();\n for (NoteEntry entry : entryIdList) {\n finalIdList.add(entry.getEntryId());\n }\n\n List<NoteInfo> noteList = NoteInfo.find()\n .select(\"note\")\n .where()\n .in(\"noteEntryId\", finalIdList)\n .findList();\n\n return noteList;\n }",
"void addNote(int x, int y);",
"private void addNotes(SheetMusicDrawing sm, JSONObject jsonObject) {\n JSONArray jsonArray = jsonObject.getJSONArray(\"notes\");\n for (Object json : jsonArray) {\n JSONObject nextNote = (JSONObject) json;\n addNote(sm, nextNote);\n }\n }",
"public void addNote(AdHocCommandNote note) {\n this.data.addNote(note);\n }",
"void addNote(int duration, int octave, int beatNum, String pitch)\n throws IllegalArgumentException;",
"java.lang.String getNotes();",
"java.lang.String getNotes();",
"CompositionBuilder<T> addNote(int start, int end, int instrument, int pitch, int volume);",
"public String getNotes() {\n return notes;\n }",
"public void addNote(Note newNote) throws NotepadOverflowException {\n for (int i = 0; i < _notes.length; i++) {\n if (_notes[i] == null) {\n _notes[i] = newNote;\n return;\n }\n }\n if (DynamicNotepad) {\n enlargeNotepad(_notes.length);\n addNote(newNote);\n }\n throw new NotepadOverflowException(_notes.length);\n }",
"@Override\n\tprotected void process(List<String> notes) {\n\t\tif(isCancelled()) { return; }\n\t\t//report the last note.\n\t\tprogressMonitorReporter.reportNote(notes.get(notes.size()-1));\n\t}",
"private void setupNotesRecyclerView(List<Note> notes) {\n RecyclerView notesRecyclerView = this.findViewById(R.id.notes_recycler_view);\n\n // TODO: Create and attach a layout manager\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(MainActivity.this,RecyclerView.VERTICAL, false);\n notesRecyclerView.setLayoutManager(linearLayoutManager);\n\n // TODO: Create and attach an adapter\n NotesAdapter notesAdapter = new NotesAdapter(notes);\n notesRecyclerView.setAdapter(notesAdapter);\n }",
"public final void setNotes(java.lang.String notes)\n\t{\n\t\tsetNotes(getContext(), notes);\n\t}",
"public String getNotes() {\n return notes;\n }",
"private void addNote(){\n DatabaseReference noteRef = mDB.getReference(\"Notes\");\n\n Long time = System.currentTimeMillis();\n\n Bundle bundleNote = new Bundle();\n bundleNote.putString(\"notesDetail\", notes.getText().toString());\n bundleNote.putString(\"notesTime\", time.toString());\n\n Note note = new Note(bundleNote);\n String currNoteKey;\n currNoteKey = noteRef.push().getKey();\n noteRef.child(LoginActivity.currUserID).child(currNoteKey).setValue(note);\n\n }",
"@Override\n\tpublic void saveNotes(int id_etudiant,List<Cours> cours, List<String> notes) {\n\t\tthis.etudiantDao.saveNotes(id_etudiant,cours, notes);\n\t}",
"@Override\n public void appendModels(MusicOperation model) {\n int length = this.getFinalBeat();\n\n List<Note> currentNotes = model.getNotes();\n\n for (int x = 0; x < currentNotes.size(); x++) {\n Note current = currentNotes.get(x);\n Note newNote = new SimpleNote(current.getPitch(), current.getOctave(),\n current.getBeat() + length, current.getDuration());\n this.addNote(newNote);\n }\n }",
"public ArrayList<String> getNotes() {\n return notes;\n }",
"public Notes() {\n\t\tsuper();\n\t\t// TODO Auto-generated constructor stub\n\t}",
"public void addNote(Note note) {\n\t\tthis.notes.put(note,Idea.NON_PROMPT_NOTE);\n\t}",
"void updateNotes(Note arr[]){\n\n }",
"@Override\n public List<Note> getNotes() {\n ArrayList<Note> listAllNotes = new ArrayList<>();\n\n ArrayList<Integer> keys = new ArrayList<>(this.notes.keySet());\n\n for (int i = 0; i < keys.size(); i++) {\n int currentKey = keys.get(i);\n\n List<Note> current = this.getNotesAtBeat(currentKey);\n\n listAllNotes.addAll(current);\n }\n return listAllNotes;\n }",
"private void createNote(NewNoteInput note, QueryService service) {\n if ((note.body() == null || note.body().isEmpty()) &&\n (note.title() == null || note.title().isEmpty())) {\n Log.i(LOG_TAG, \"skipped upload of note with empty body\");\n return;\n }\n\n service.createNote(note, (e, response) -> {\n runOnUiThread(() -> {\n if (e != null) {\n Log.e(LOG_TAG, e.getMessage());\n Toast.makeText(getApplicationContext(), getString(R.string.network_err),\n Toast.LENGTH_LONG).show();\n } else {\n Log.i(LOG_TAG, \"note created\");\n Toast.makeText(getApplicationContext(), getString(R.string.activity_note_ncreate),\n Toast.LENGTH_SHORT).show();\n\n finish();\n }\n });\n });\n }",
"public String getNotes() {\n\t\treturn notes;\n\t}",
"public void xsetNotes(org.apache.xmlbeans.XmlString notes)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(NOTES$14, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(NOTES$14);\n }\n target.set(notes);\n }\n }",
"public void addNote()\n {\n String stringNote;\n char actualNote;\n int beat;\n \n System.out.print(\"Enter the note > \"); //gets the note from user\n stringNote = in.nextLine();\n actualNote = stringNote.charAt(0);\n \n System.out.print(\"Enter the length of the note in beats > \"); //gets the beats from user\n beat = in.nextInt();\n \n Note note = new Note(actualNote, beat); //creates Note to be added\n \n score.add(note); //adds the note to the score\n \n in.nextLine();\n }",
"public boolean deleteAllOfNote(Integer idn);",
"@Override\n public void combineCons(ArrayList<Note> list) {\n }",
"public void setNotes(String v) \n {\n \n if (!ObjectUtils.equals(this.notes, v))\n {\n this.notes = v;\n setModified(true);\n }\n \n \n }",
"public void setNotes(ArrayList<Note> notes) {\n\t\tif (null == notes || notes.size() == 0)\n\t\t\tthrow new NullPointerException();\n\t\t\n\t\tnotelist = notes;\n\t\t\n\t\tif (notelist.size() > 1)\n\t\t\ttype = TYPE_CHORD;\n\t\telse if (REST != notelist.get(0).getPitch())\n\t\t\ttype = TYPE_SINGLE_NOTE;\n\t\telse if (REST == notelist.get(0).getPitch())\n\t\t\ttype = TYPE_REST;\n\t\t\n\t}",
"public void setNoteSet(Set<Note> notes) throws ChangeVetoException;",
"public void storeNote(String text) {\r\n\t\tTextNote note = new TextNote();\r\n\t\tnote.setText(text);\r\n\t\tthis.TextNoteList.add(note);\r\n\t}",
"@Test\n\tpublic void multipleNoteRefs() throws Exception {\n\t\tadd(\"test.txt\", \"abc\");\n\t\tString note1 = \"note1\";\n\t\tString note2 = \"note2\";\n\t\tnote(note1);\n\t\tnote(note2, \"commit2\");\n\n\t\tfinal List<String> notes = new ArrayList<String>();\n\n\t\tCommitFinder finder = new CommitFinder(testRepo);\n\t\tfinder.setFilter(new NoteContentFilter() {\n\n\t\t\tprotected boolean include(RevCommit commit, Note note,\n\t\t\t\t\tString content) {\n\t\t\t\tnotes.add(content);\n\t\t\t\treturn super.include(commit, note, content);\n\t\t\t}\n\n\t\t});\n\t\tfinder.find();\n\t\tassertEquals(2, notes.size());\n\t\tassertTrue(notes.contains(note1));\n\t\tassertTrue(notes.contains(note2));\n\t}",
"public void setNotes(java.lang.String notes)\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(NOTES$14, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(NOTES$14);\n }\n target.setStringValue(notes);\n }\n }",
"public void appendToReminders(List<Date> reminders);",
"@Override\n public void add(Note note) {\n if (this.music.containsKey(note.getStartBeat())) {\n // if the given note already has the same note in the music, replace it\n if (this.music.get(note.getStartBeat()).contains(note)) {\n int indexOfNote = this.music.get(note.getStartBeat()).indexOf(note);\n this.music.get(note.getStartBeat()).set(indexOfNote, note);\n } else {\n // add the note to the arrayList\n this.music.get(note.getStartBeat()).add(note);\n }\n\n // update the pitch value for the music\n if (note.getPitchValue() > this.getHighestPitchValue()) {\n this.highestPitchValue = note.getPitchValue();\n }\n // this.updatePitchValues();\n\n if (note.getPitchValue() < this.getLowestPitchValue()) {\n this.lowestPitchValue = note.getPitchValue();\n }\n }\n // if the arrayList does not exist in map, construct one and put it in the map\n else {\n ArrayList<Note> listOfNote = new ArrayList<>();\n listOfNote.add(note);\n this.music.put(note.getStartBeat(), listOfNote);\n\n // update the pitch value for the music\n if (note.getPitchValue() > this.getHighestPitchValue()) {\n this.highestPitchValue = note.getPitchValue();\n }\n if (note.getPitchValue() < this.getLowestPitchValue()) {\n this.lowestPitchValue = note.getPitchValue();\n }\n }\n\n\n }",
"String getNotes();",
"@Override\n public void onChanged(@Nullable List<Note> notes) {\n }",
"public String getNotes() {\n\treturn notes;\n}",
"@Override\n public void combineSim(ArrayList<Note> list) {\n }",
"public List<Note> getNotes(){\n return notes;\n }",
"@GetMapping(\"/notes\")\n public List<Note> getAllNotes() {\n List<Note> temp = noteService.getAllNotes();\n return temp;\n }",
"public Notes() {\n initComponents();\n subjectText = new String ();\n noteText = new String();\n count = 0;\n ArrayMath = new Array[100];\n \n \n }",
"public Builder clearNotes() {\n bitField0_ = (bitField0_ & ~0x00000040);\n notes_ = getDefaultInstance().getNotes();\n onChanged();\n return this;\n }",
"public java.lang.String getNotes() {\n return notes;\n }",
"public Builder clearNotes() {\n \n notes_ = getDefaultInstance().getNotes();\n onChanged();\n return this;\n }",
"public Builder setNotes(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n notes_ = value;\n onChanged();\n return this;\n }",
"public Cursor fetchAllNotes() {\n\n return database.query(NOTES_TABLE, new String[] {KEY_NOTES_ROWID, KEY_NOTES_TITLE,\n KEY_NOTES_BODY}, null, null, null, null, null);\n }",
"public void addToReminders(List<Date> reminders);",
"public void create(Note newNote) {\n\t\t// TODO generate unique ID\n\n\t\tnewNote.setId(Long.valueOf(getNotes().size()));\n\n\t\tString sql = \"INSERT INTO todo VALUES ('\" + newNote.getId() + \"','\" + newNote.getName() + \"','\" + newNote.getAbbreviation() + \"','\" + newNote.getDescription() + \"' );\";\n\n\t\tList<Note> todos = sqlUpdate(sql);\n\t\tsetNotes(todos);\n\n\t\t// this.getHibernateTemplate().delete(project);\n\t}",
"interface WithNotes {\n /**\n * Specifies the notes property: Notes about the lock. Maximum of 512 characters..\n *\n * @param notes Notes about the lock. Maximum of 512 characters.\n * @return the next definition stage.\n */\n Update withNotes(String notes);\n }",
"public Builder setNotes(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000040;\n notes_ = value;\n onChanged();\n return this;\n }",
"public String getNotes();",
"void handle_note_list(LinkedList<Object> args) {\n args.clear();\n args.add(\"note_list\");\n try {\n rsl = sql.executeQuery(\"SELECT note_name FROM data \" +\n \"WHERE user_id=\" + userid);\n String note_name;\n args.add(\"yes\");\n while (rsl.next()) {\n note_name = rsl.getString(1);\n args.add(note_name);\n }\n } catch (Exception e) {\n e.printStackTrace();\n args.add(1, \"no\");\n args.add(2, e.toString());\n }\n }",
"public void repeatNotes()\n {\n int start, end;\n \n printScore(); //prints the current score that we have for the user to reference\n \n System.out.print(\"\\nEnter the note number that starts the repetition > \"); //prompts to enter the start of the repetition\n start = in.nextInt();\n \n System.out.print(\"Enter the note number that ends the repetition > \"); //prompts user to enter the end of the repetition\n end = in.nextInt();\n \n if (start <= score.size() && start > 0 && end <= score.size() && end >= start)\n {\n for (int i = 0; i <= ((end - 1) - (start - 1)); i++)\n {\n Note tempNote = new Note(score.get((start - 1) + i).getNote(), score.get((start - 1) + i).getBeat());\n score.add(tempNote);\n }\n }\n else\n {\n System.out.print(\"Error. \");\n if (end < 1 || end > score.size())\n System.out.println(\"The ending note number is not valid.\");\n else if (start < 1 || start > score.size())\n System.out.println(\"The starting note number is not valid.\");\n else if (start > end)\n System.out.println(\"The starting note number can not be bigger than the ending note number.\"); \n }\n }",
"public void changeNotes(String a) {\r\n notes = a;\r\n }",
"private void printNotes(AbstractInscription... inscs) {\n\t\tfor (AbstractInscription insc : inscs) {\n\t\t\tSystem.out.println(String.format(\n\t\t\t\t\t\"Inscription '%s' : note min = %s, note max = %s, note objectif = %s, note réelle = %s, acquis réel = %s\\r\\n\",\n\t\t\t\t\tinsc, insc.getCalculateur().getNoteMin(), insc.getCalculateur().getNoteMax(),\n\t\t\t\t\tinsc.getCalculateur().getNoteObjectif(), insc.getCalculateur().getNoteReelle(),\n\t\t\t\t\tinsc.getCalculateur().getAcquisReel()));\n\t\t}\n\t}",
"protected void createNewDocumentNote(NoteData newNote) {\n /**\n * get data from the server about tags\n */\n String url = globalVariable.getConfigurationData().getServerURL()\n + globalVariable.getConfigurationData().getApplicationInfixURL()\n + globalVariable.getConfigurationData().getRestDocumentAddNotesURL();\n Log.i(LOG_TAG, \"REST - create new doc notes - call: \" + url);\n\n String postBody = RESTUtils.getJSON(newNote);\n\n AppCompatActivity activity = (AppCompatActivity)getActivity();\n RESTUtils.executePOSTNoteCreationRequest(url, postBody, null, \"\", globalVariable, DocumentTaggingActivity.PROPERTY_BAG_KEY, activity);\n\n // mDataArray = TagItemDataHelper.getAlphabetData();\n }",
"@JsonIgnore\n public List<Note> getNotes() {\n ArrayList<Note> ret = new ArrayList<Note>(noteIds != null ? noteIds.size() : 0);\n\n if (noteIds != null) {\n for (String id : noteIds) {\n ret.add(Note.get(id));\n }\n }\n \n // even if there were no notes, return an empty list\n return ret;\n }",
"public List<String> getFormattedNotes(){\n List formattedNotes = new ArrayList();\n for (int i = 0; i < notes.size(); i++) {\n Note n = notes.get(i);\n String noteInfo = \"Date Created: \" + n.getFormattedDate() + \" Content: \" + n.getContent();\n formattedNotes.add(noteInfo);\n }\n return formattedNotes;\n }",
"@Override\n\tpublic List<Note> showNotes() {\n\t\t\n\t\treturn noterepository.findAll();\n\t}",
"@Override\n public void onClick(View view) {\n //Reads the text that was passed by the user in the EditText and saves it to the notesArrayList.\n String noteText = String.valueOf(noteEditText.getText());\n allNotes.addNote(noteText);\n //Sets the content of the EditText to empty.\n noteEditText.setText(\"\");\n //Gets user back to MainActivity using Intent.\n Intent getBackIntent = new Intent(AddNoteActivity.this,\n MainActivity.class);\n startActivity(getBackIntent);\n }",
"public int placeNote(ObjectListElement e){\n\t\tallNotes.add(e);\n\t\tsortNote();\n\t\treturn allNotes.indexOf(e);\n\t}",
"public boolean addNote(StatementNote note) {\n\t\treturn this.notes_.add(note);\n\t}",
"private void onSaveNote() {\n String text= inputNote.getText().toString();\n if(!text.isEmpty()){\n long date=new Date().getTime(); // get current time\n // Note note= new Note(text,date); because temp now has Note object\n\n // if note exits update else create new\n temp.setNoteText(text);\n temp.setNoteDate(date);\n\n if(temp.getId()==-1)\n dao.insertNote(temp); // insert and save note to database\n else{\n dao.updateNote(temp);\n }\n finish(); // return to the MainActivity\n }\n\n }",
"@Override\n public boolean createDailyNote(String note) {\n dailyNotes.add(new DailyNote(note));\n return true;\n }"
] | [
"0.7030109",
"0.70206887",
"0.6902169",
"0.68047607",
"0.6803689",
"0.66855323",
"0.66578484",
"0.6648763",
"0.6625925",
"0.6575076",
"0.6569805",
"0.65344393",
"0.6533947",
"0.64881885",
"0.6466613",
"0.64428043",
"0.63551104",
"0.6330225",
"0.63083965",
"0.6258612",
"0.62575334",
"0.62259024",
"0.6223409",
"0.62102294",
"0.6208132",
"0.6172005",
"0.61542094",
"0.60652924",
"0.60431415",
"0.60247594",
"0.6011121",
"0.5975593",
"0.5971094",
"0.5954812",
"0.59497476",
"0.59251136",
"0.59209806",
"0.5893822",
"0.58640635",
"0.5862297",
"0.5862297",
"0.58382297",
"0.5827045",
"0.58234954",
"0.58089197",
"0.58070564",
"0.5788894",
"0.5781505",
"0.5781351",
"0.5774355",
"0.5773626",
"0.5762144",
"0.5742563",
"0.571369",
"0.57063234",
"0.5680221",
"0.5666344",
"0.56370056",
"0.5633248",
"0.5621707",
"0.5616972",
"0.5616306",
"0.56050885",
"0.5594988",
"0.555807",
"0.5553925",
"0.5551665",
"0.5551294",
"0.554316",
"0.5524316",
"0.55231315",
"0.5523066",
"0.55222756",
"0.5516579",
"0.5506101",
"0.550401",
"0.5498061",
"0.5494453",
"0.54797584",
"0.54773307",
"0.5470129",
"0.54544735",
"0.5447307",
"0.54389316",
"0.5436734",
"0.54313886",
"0.5430812",
"0.54236627",
"0.5416844",
"0.541226",
"0.54070675",
"0.5401741",
"0.53985244",
"0.53955436",
"0.538836",
"0.53872144",
"0.5380363",
"0.5351465",
"0.53480756",
"0.5345038"
] | 0.7478283 | 0 |
Remove a note from this model. | @Override
public void removeNote(Note n) {
if (!n.getIsHead()) {
throw new IllegalArgumentException("cannot remove a note that is not" +
"the head note");
}
boolean result = false;
for (int i = 0; i < n.getDuration(); i++) {
for (Note t : this.sheet.get(i + n.getStartMeasure())) {
if (t.equals(n)) {
result = true;
}
}
}
if (result == false) {
throw new IllegalArgumentException("note doesn't exist");
}
Note head = find(n.getStartMeasure(), n.getDuration(), n.getOctave(), n
.toMidiIndex());
this.sheet.get(n.getStartMeasure()).remove(head);
for (int i = 1; i < n.getDuration(); i++) {
int currentMeasure = n.getStartMeasure() + i;
Note hold = find(currentMeasure, 1, n.getOctave(), n
.toMidiIndex());
this.sheet.get(currentMeasure).remove(hold);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeNote(Note note) {\n notes.remove(note);\n }",
"public void removeNote(Note note) throws ChangeVetoException;",
"@Override\n public void remove(Note note) {\n }",
"INote removeNote(int beatNum, String pitch, int octave) throws IllegalArgumentException;",
"public void deleteNote() {\n if (cursor == 0) {\n JOptionPane.showMessageDialog(null, \"There's no note to delete!\", \"Invalid Delete\", JOptionPane.WARNING_MESSAGE);\n } else {\n if (sequence.getNote(cursor) == REST) {\n cursor--;\n controller.setSelected(cursor);\n\n sequence = sequence.withNote(REST, cursor);\n controller.setMidiSequence(sequence);\n } else {\n sequence = sequence.withNote(REST, cursor);\n controller.setMidiSequence(sequence);\n }\n }\n }",
"public RemoveNote(IMusicModel model, CompositeView view) {\n this.model = model;\n this.view = view;\n }",
"public void removeNote()\n { \n System.out.print(\"\\nWould you like to remove any of these notes? (y or n) \");\n String stringAnswer = in.nextLine();\n char answer = stringAnswer.charAt(0);\n \n if (answer == 'y')\n {\n System.out.print(\"Enter the note number of the note you would like to remove > \");\n int noteToRemove = in.nextInt();\n \n score.remove(noteToRemove - 1);\n in.nextLine();\n }\n }",
"@Override\n public void removeNote(int startTime, Pitch pitch, Octave octave) {\n List<Note> notes = this.notes.remove(startTime);\n\n if (notes == null) {\n throw new IllegalArgumentException(\"This beat does exist.\");\n }\n\n for (int i = 0; i < notes.size(); i++) {\n Note note = notes.get(i);\n\n if (note.sameValues(startTime, pitch, octave)) {\n notes.remove(i);\n this.notes.put(startTime, notes);\n } else {\n throw new IllegalArgumentException(\"Cant remove this note.\");\n }\n }\n\n }",
"public void removeFile(Note note) {\n File f = new File(SaveProperties.getPath() + \"/\" + note.getTitle() + \".txt\");\n f.delete();\n }",
"public void removeNoteListener(final AutomataNoteListener listener) {\n\t\tnoteListeners.remove(listener);\n\t}",
"public boolean removeNote(StatementNote note) {\n\t\tif (this.isFinalized())\n\t\t\treturn false;\n\t\treturn this.notes_.remove(note);\n\t}",
"public void removeFieldNote(int i)\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(FIELDNOTE$4, i);\r\n }\r\n }",
"@Override\n\tpublic void delete(Note e) {\n\t\t\n\t}",
"public boolean removeNote(long id){\n\t\treturn allNotes.remove(new ObjectListElement(id,\"\"));\n\t}",
"boolean deleteMyNote(MyNoteDto usernote);",
"private void deleteNoteOnFirebaseManager(Note note){\n firebase.deleteNoteOnDB(note, unused -> {\n Toast.makeText(this, R.string.note_deletion_success, Toast.LENGTH_LONG).show();\n finish();\n }, e -> {\n Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();\n });\n }",
"@Override\n\tpublic void delete(GalaxyNote galaxynote) {\n\t\t\n\t}",
"private void clearNote()\n\t{\n\t\t((EditText) findViewById(R.id.note_edittext)).setText(\"\");\n\t\tNoteDbWorker worker = new NoteDbWorker(this);\n\t\tworker.deleteNote(user.userName);\n\t\tworker.close();\n\t\tToast.makeText(this, getString(R.string.note_cleared), Toast.LENGTH_LONG).show();\n\t}",
"public void removeByTodoText(String todoText);",
"protected void removeTraitsFromDatabase(final Note note) {\r\n this.connect();\r\n String where = String.format(\"%s = %d\", this.dbColumns.get(\"note\"), note.getId());\r\n this.database.delete(this.dbHelper.getNoteTraitTable(), where, null);\r\n this.disconnect();\r\n }",
"public void deleteNote(int index) throws NotepadOutOfBoundsException {\n if (!isRightBounds(index))\n throw new NotepadOutOfBoundsException(index);\n _notes[index - 1] = null;\n _notes = moveNotes(index);\n }",
"public void removeFootnote(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FOOTNOTE$8, i);\n }\n }",
"public void removeByTodoId(long todoId);",
"@DeleteMapping(\"/notes/{id}\")\n public boolean deleteNote(@PathVariable(\"id\") UUID id) {\n return noteService.deleteNote(id);\n }",
"private void deleteNote(Integer noteId) {\n notesRepository.markDeleted(noteId, true);\n\n broadcastManager.sendBroadcast(new Intent(ACTION_DELETE));\n getActivity().sendBroadcast(new Intent(ACTION_DELETE));\n\n showDeleteUndoBar(noteId);\n }",
"private void deleteNote(QueryService service, String noteId) {\n service.removeNote(noteId, (e, didSucceed) -> {\n runOnUiThread(() -> {\n if (e != null || didSucceed == null || !didSucceed) {\n Toast.makeText(getApplicationContext(), \"could not delete note\",\n Toast.LENGTH_LONG).show();\n } else {\n Toast.makeText(getApplicationContext(), getString(R.string.activity_note_ndelete),\n Toast.LENGTH_SHORT).show();\n finish();\n }\n });\n });\n }",
"public void removeByTodoRichText(String todoRichText);",
"public Todo remove(long todoId) throws NoSuchTodoException;",
"public void remove() {\n\n }",
"public void remove( IAnswer answerToRemove );",
"@Override\n\tpublic void deleteNoteById(int noteId) {\n\n\t\tSession session = sessionFactory.openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\ttransaction=session.beginTransaction();\n\t\t\t\tString sql=\"delete Note where noteId =:noteId\";\n\t\t\t\tQuery query=session.createQuery(sql);\n\t\t\t\tquery.setParameter(\"noteId\", noteId);\n\t\t\t\tquery.executeUpdate();\n\t\t\t\ttransaction.commit();\n\t\t\t\tSystem.out.println(\"deleted\");\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tif(transaction!=null)\n\t\t\t\t\ttransaction.rollback();\n\t\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tsession.close();\n\t\t\t}\n\t }",
"@Override\n public void onNoteRemove(Note note, AuthenticationInfo subject) {\n if (note.getParagraphs() != null) {\n for (Paragraph paragraph : note.getParagraphs()) {\n try {\n Interpreter interpreter = paragraph.getInterpreter();\n if (interpreter != null) {\n InterpreterSetting interpreterSetting =\n ((ManagedInterpreterGroup) interpreter.getInterpreterGroup()).getInterpreterSetting();\n ExecutionContext executionContext = note.getExecutionContext();\n executionContext.setUser(subject.getUser());\n restart(interpreterSetting.getId(), executionContext);\n }\n } catch (InterpreterNotFoundException e) {\n\n } catch (InterpreterException e) {\n LOGGER.warn(\"Fail to stop interpreter setting\", e);\n }\n }\n }\n\n // remove from all interpreter instance's angular object registry\n for (InterpreterSetting settings : interpreterSettings.values()) {\n InterpreterGroup interpreterGroup = settings.getInterpreterGroup(note.getExecutionContext());\n if (interpreterGroup != null) {\n AngularObjectRegistry registry = interpreterGroup.getAngularObjectRegistry();\n if (registry instanceof RemoteAngularObjectRegistry) {\n // remove paragraph scope object\n for (Paragraph p : note.getParagraphs()) {\n ((RemoteAngularObjectRegistry) registry).removeAllAndNotifyRemoteProcess(note.getId(), p.getId());\n\n // remove app scope object\n List<ApplicationState> appStates = p.getAllApplicationStates();\n if (appStates != null) {\n for (ApplicationState app : appStates) {\n ((RemoteAngularObjectRegistry) registry)\n .removeAllAndNotifyRemoteProcess(note.getId(), app.getId());\n }\n }\n }\n // remove note scope object\n ((RemoteAngularObjectRegistry) registry).removeAllAndNotifyRemoteProcess(note.getId(), null);\n } else {\n // remove paragraph scope object\n for (Paragraph p : note.getParagraphs()) {\n registry.removeAll(note.getId(), p.getId());\n\n // remove app scope object\n List<ApplicationState> appStates = p.getAllApplicationStates();\n if (appStates != null) {\n for (ApplicationState app : appStates) {\n registry.removeAll(note.getId(), app.getId());\n }\n }\n }\n // remove note scope object\n registry.removeAll(note.getId(), null);\n }\n }\n }\n\n removeResourcesBelongsToNote(note.getId());\n }",
"@Cacheable(value = \"DeleteNote\", key = \"#noteId\")\n\t@Override\n\tpublic Response deleteNote(String noteId, String token) throws IOException {\n\t\t\n\t\tString email = jwt.getEmailId(token);\n\t\t\n\t\tif(email != null) {\n\t\t\tnoterepository.deleteById(noteId);\n\t\t\telasticSearchService.deleteDocument(noteId);\n\t\t\treturn new Response(200, noteEnvironment.getProperty(\"Delete_Note\"), noteEnvironment.getProperty(\"DELETE_NOTE\"));\n\t\t}\n\t\treturn new Response(404, noteEnvironment.getProperty(\"UNAUTHORIZED_USER_EXCEPTION\"), null);\n\t}",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"public void remove();",
"@Override\n\tpublic void removeOne(Long id) {\n\t\tnotificationRepository.delete(id);\n\n\t}",
"public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }",
"public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }",
"public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }",
"public void setNote(String note) {\n this.note = note == null ? null : note.trim();\n }",
"void remove( ModelObject object );",
"public void setNote(String note) {\r\n this.note = note == null ? null : note.trim();\r\n }",
"public void removeByTodoDouble(double todoDouble);",
"public void removeByTodoInteger(int todoInteger);",
"public void remove()\n {\n domain.removeParticipant(participant);\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"public void setNote(String note) {\n this.note = note;\n }",
"@POST\n\t@Path(\"/deleteNote/{noteId}\")\n\tpublic Response deleteNote(@PathParam(\"noteId\") String noteid) {\n\n\t\tif (noteid == null) {\n\t\t\treturn Response.ok().entity(\"note id is null\").build();\n\t\t}\n\t\ttry {\n\t\t\tInteger.parseInt(noteid);\n\t\t} catch (NumberFormatException e) {\n\t\t\treturn Response.ok().entity(\"note id is not a valid number\").build();\n\t\t}\n\n\t\tint noteId = Integer.parseInt(noteid);\n\t\tNote note = noteService.findById(noteId);\n\t\tif (note == null) {\n\t\t\treturn Response.ok().entity(\"Requested note is not available in Database\").build();\n\t\t} else {\n\t\t\tnoteService.deleteNote(note);\n\t\t\treturn Response.ok().entity(\"success\").build();\n\t\t}\n\t}",
"public void setNote(String note) {\r\n this.note = note;\r\n }",
"public void setNote(String note);",
"public void deleteTagForNote(Tag t, Note n) {\n\t\tdatabase.delete(DbHelper.LINKS_TABLE_NAME, DbHelper.LINK_NOTE_ID + \" = \" + n.getId() + \r\n\t\t\t\t\" AND \" + DbHelper.LINK_TAG_ID + \" = \" + t.getId(), null);\r\n\t}",
"public void setNote(String note) {\r\n\r\n this.note = note;\r\n }",
"public static void deleteNote(int tenantID, String noteName) throws RegistryException {\n UserRegistry userRegistry = ServiceHolder.getRegistryService().getConfigSystemRegistry(tenantID);\n String noteLocation = getNoteLocation(noteName);\n\n if (userRegistry.resourceExists(noteLocation)) {\n userRegistry.delete(noteLocation);\n } else {\n log.error(\"Cannot to delete note note with name \" + noteName +\n \" for tenant with tenant ID \" + tenantID + \" because it does not exist\");\n }\n }",
"int deleteByExample(ComplainNoteDOExample example);",
"public void removeNotification(Notification notification) {\n\n notifications.remove(notification);\n }",
"public void remove() {\n\t }",
"public void remove() {\n\t }",
"public void remove() {\n\t }",
"public void removeFootnoteRef(int i)\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(FOOTNOTEREF$10, i);\n }\n }",
"public void deleteFromABSTRACT_NOTES( long id ) {\n\t\tlong rows_affected = getWritableDatabase().delete(TABLE_ABSTRACT_NOTES,\n\t\t\t\t\"NOTE_ID = ?\", new String[] { String.valueOf(id) });\n\t\tLog.d(\"GCA-DB\", \"deleted Note from db - no: \" + rows_affected);\n\t\t}",
"public void remove() {\n\t\tSession session = DBManager.getSession();\n\t\tsession.beginTransaction();\n\t\tsession.delete(this);\n\t\tsession.getTransaction().commit();\n\t}",
"public void removeByArticle(java.lang.String articleId);",
"public void removeByArticle(java.lang.String articleId);",
"public void setNote(String note) {\r\n this.note = note; \r\n }",
"public void setNote(String note) {\n\t\tthis.note = note;\n\t}",
"public void remove () {}",
"public void removeItem(T itemModel) {\n\t\tthis.removeItem(this.getItemIndex(itemModel));\n\t}",
"public void removeByTitle(String title);",
"public final void remove () {\r\n }",
"private void removeItem(String title, int position) {\n memoArray.remove(position);\n db.removeNotes(title);\n mAdapter.notifyDataSetChanged();\n Log.i(TAG, \"getTitle : \" + title);\n }",
"public void setNote(String note) {\n if(note==null){\n note=\"\";\n }\n this.note = note;\n }",
"public void remove(int objectId) throws SQLException;",
"public ContentObject remove(\n )\n {\n ContentObject removedObject = objects.remove(index);\n refresh();\n\n return removedObject;\n }",
"public void removeByTodoDocumentLibrary(String todoDocumentLibrary);",
"public void remove() {\n super.remove();\n }",
"public void remove() {\n super.remove();\n }",
"public void remove() {\n super.remove();\n }",
"public void remove() {\n super.remove();\n }",
"public void remove() {\n super.remove();\n }",
"public void remove() {\n super.remove();\n }",
"public void remove() {\n super.remove();\n }",
"public void removeOrderDetail(OrderDetail orderDetail)throws OrderDetailUnableSaveException;",
"public void delete(ReceiptFormPO po) throws RemoteException {\n\t\tSystem.out.println(\"Delete ReceiptFormPO Start!!\");\n\t\t\n\t\tif(po==null){\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tioHelper = new IOHelper();\n\t\tallReceiptForm = ioHelper.readFromFile(file);\n\t\tSystem.out.println(po.getNO() );\n\t\tallReceiptForm.remove(po.getNO());\n\t\tioHelper.writeToFile(allReceiptForm, file);\n\t}",
"public void setNote(String note) {\n\t\tthis._note = note;\n\t}",
"public void remove() {\n removeNode(this);\n }",
"void documentRemoved(SingleDocumentModel model);",
"void removePickDetail(Question question);",
"public void remove() {\r\n super.remove();\r\n }",
"public void remove() {\r\n //\r\n }",
"@Override\n public void remove(News item) {\n }",
"@Override\n public void remove() {\n }",
"public void removeItem(){\n\t\tthis.item = null;\n\t}",
"void remove(String label) throws IOException;",
"E remove(Id id);"
] | [
"0.7867984",
"0.77923375",
"0.7676994",
"0.6781601",
"0.66819173",
"0.6505427",
"0.63233274",
"0.6285756",
"0.61865705",
"0.61809605",
"0.6153908",
"0.61029565",
"0.60551095",
"0.60240597",
"0.6017529",
"0.5957066",
"0.59208167",
"0.5888073",
"0.5850632",
"0.5806317",
"0.57238287",
"0.56847453",
"0.56591886",
"0.5647626",
"0.56384134",
"0.5565166",
"0.5541369",
"0.5505083",
"0.5459944",
"0.5405593",
"0.54034185",
"0.53632414",
"0.5362198",
"0.5351606",
"0.5351606",
"0.5351606",
"0.5351606",
"0.5351606",
"0.53428435",
"0.5335977",
"0.5335977",
"0.5335977",
"0.5335977",
"0.53183013",
"0.53109014",
"0.526969",
"0.52601695",
"0.5257695",
"0.524083",
"0.524083",
"0.524083",
"0.524083",
"0.524083",
"0.52227414",
"0.5198742",
"0.5194764",
"0.5177716",
"0.5172867",
"0.51675624",
"0.51593",
"0.5146416",
"0.51325303",
"0.51325303",
"0.51325303",
"0.5113815",
"0.5109602",
"0.509565",
"0.50894976",
"0.50894976",
"0.5089214",
"0.50720114",
"0.5070537",
"0.5069465",
"0.5063521",
"0.5061857",
"0.5061047",
"0.50595886",
"0.5056315",
"0.5054432",
"0.50531787",
"0.5052127",
"0.5052127",
"0.5052127",
"0.5052127",
"0.5052127",
"0.5052127",
"0.5052127",
"0.5048219",
"0.5041677",
"0.50367683",
"0.5022446",
"0.50158256",
"0.50119585",
"0.5010878",
"0.5007989",
"0.5006662",
"0.49977523",
"0.49930936",
"0.4991683",
"0.4990284"
] | 0.67320335 | 4 |
Render a console view | @Override
public String toString() {
StringBuilder builder = new StringBuilder();
if (this.high.compareTo(low) == -1) {
return "";
}
Note temLow = new Note(this.low.getDuration(), this.low.getOctave(),
this.low.getStartMeasure(), this.low.getPitch(), this.low.getIsHead(),
this.low.getInstrument(), this.low.getVolume());
builder.append(" ");
for (int i = 0; this.high.compareTo(temLow) != -1; i++) {
if (temLow.toString().length() == 3) {
builder.append(temLow.toString());
} else {
builder.append(" " + temLow.toString());
}
temLow.up();
}
builder.append("\n");
for (int i = 0; i < this.sheet.size(); i++) {
if (i < 10) {
builder.append(i + " ");
} else {
builder.append(i);
}
List<Note> list = new ArrayList<Note>(this.sheet.get(i));
Collections.sort(list);
int listIndex = 0;
Note comparator = new Note(this.low.getDuration(), this.low.getOctave(),
this.low.getStartMeasure(), this.low.getPitch(), this.low.getIsHead(),
this.low.getInstrument(), this.low.getVolume());
// when the measure is empty.
if (list.size() == 0) {
builder.append(" ");
}
for (int j = 0; listIndex < list.size() && j <= this.high.howFarUp(this.low); j++) {
if (list.get(listIndex).compareTo(comparator) == 0) {
if (list.get(listIndex).getIsHead()) {
builder.append(" X ");
listIndex++;
} else {
builder.append(" | ");
listIndex++;
}
} else {
builder.append(" ");
}
comparator.up();
}
builder.append("\n");
}
return builder.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void render(CliContext ctx);",
"private void renderView() {\r\n\t\tSystem.out.println(this.currentView.render());\r\n\t}",
"public void printToViewConsole(String arg);",
"@Override\n\tpublic void Render() {\n\t\t\n\t\tSystem.out.println(\"Chocolater Ice Cream\");\n\t\t\n\t}",
"@Override\n public void render() {\n System.out.println(this.input);\n return;\n }",
"private void render() {\n StringBuilder builder = new StringBuilder();\n builder.append(horizontalEdge).append(\"\\n\");\n for (int i = 0; i < this.height; i++) {\n builder.append(VERTICAL_CHAR);\n for (int j = 0; j < this.width; j++) {\n builder.append(pixels[i][j]);\n }\n builder.append(VERTICAL_CHAR);\n builder.append(\"\\n\");\n }\n builder.append(horizontalEdge);\n System.out.printf(builder.toString());\n }",
"void showInConsole();",
"public void render();",
"public OutputConsole() {\n initComponents();\n setSize (1520, 750);\n }",
"void drawOutput(String output);",
"private static String viewCommand(String[] commandLineArguments) {\n \t\t// TODO Auto-generated method stub\n \t\treturn null;\n \t}",
"public String render() {\n\t\tresetOutput();\n\t\trenderBorder();\n\t\trenderPlayerWalls();\n\t\trenderTargetTiles();\n\t\trenderPlayers();\n\n\t\treturn this.buildOutput();\n\t}",
"public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"protected void render() {\n\t\tString accion = Thread.currentThread().getStackTrace()[2].getMethodName();\n\t\trender(accion);\n\t}",
"public ConsoleView() {\n\t\tcrapsControl = new CrapsControl();\n\t\tinput = new Scanner(System.in);\n\t}",
"public void consoleBoardDisplay(){\n\t\tString cell[][] = ttt.getCells();\n\t\tSystem.out.println(\"\\n\" +\n\t\t\t\"R0: \" + cell[0][0] + '|' + cell[0][1] + '|' + cell[0][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R1: \" + cell[1][0] + '|' + cell[1][1] + '|' + cell[1][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R2: \" + cell[2][0] + '|' + cell[2][1] + '|' + cell[2][2] + \"\\n\"\n\t\t);\n\t}",
"public void executeView()\n\t{\n\t\tString cmd = \"\";\n\t\tString opar = Deducer.getUniqueName(\"opar\");\n\t\tcmd += (opar + \" <- par()\"); //save the original margin parameters\n\t\tcmd += (\"\\npar(mar=c(8, 4, 4, 0.5))\"); //give the plot more space at the bottom for long words.\n\t\tcmd += (\n\t\t\t\t\"\\nbarplot(\" \n\t\t\t\t+ \n\t\t\t\ttfDialog.getTermFreqCall(this.getExtraTermFreqArgs()) + \",\" \n\t\t\t\t+\n\t\t\t\t\"cex.names=0.8,\" //make the terms a bit smaller\n\t\t\t\t+\n\t\t\" las=2);\");\n\t\tcmd += (\"\\npar(\"+ opar +\")\");\n\t\tDeducer.execute(cmd);\n\t\tDeducer.execute(\"dev.set()\", false); //give the plot focus\n\t\t\n\t\t\n\t}",
"public void render() {\n }",
"public interface View {\n\n\n /**\n * Launch the view or CLI.\n */\n void launch();\n\n}",
"public static void index() {\r\n render();\r\n }",
"protected void render(){}",
"public void render() {\r\n\r\n }",
"public MyViewCLI(InputStreamReader in, OutputStreamWriter out, Controller controller) {\r\n\t\tcli = new CLI(in, out, controller);\r\n\t\tthis.controller = controller;\r\n\t}",
"protected void render() {\n\t\tentities.render();\n\t\t// Render GUI\n\t\tentities.renderGUI();\n\n\t\t// Flips the page between the two buffers\n\t\ts.drawToGraphics((Graphics2D) Window.strategy.getDrawGraphics());\n\t\tWindow.strategy.show();\n\t}",
"public void displayTextToConsole();",
"private void render() {\n\n StateManager.getState().render();\n }",
"public void display() {\n System.out.println(toString());\n }",
"public void draw() {\r\n System.out.print(this);\r\n }",
"public void render()\r\n\t{\n\t}",
"private void displayLine()\n {\n System.out.println(\"#################################################\");\n }",
"public JPanel buildConsole()\n\t{\n\t\tJPanel output = new JPanel(new BorderLayout());\n\t\tString hold = \"\";\n\t\t\n output.setBorder (new TitledBorder(new EtchedBorder(),\"Console\")); //Create the border\n output.setPreferredSize(new Dimension(50,150)); //Set the size of the JPanel\n console.insert(hold,0);\n console.setLineWrap(true);\n console.setWrapStyleWord(true);\n console.setEditable(false); //Does not allow the user to edit the output\n JScrollPane Cscroll = new JScrollPane (console); //Create a JScrollPane object\n Cscroll.setVerticalScrollBarPolicy ( ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED ); //Set the scroll bars to appear when necessary\n output.add(Cscroll); //Add the scroll to the JPanel\n textField = new JTextField();\n output.add(BorderLayout.PAGE_END, textField);\n \n\t\treturn output;\n\t}",
"private void showCommands() {\n System.out.println(\"\\n Commands:\");\n System.out.println(\"\\t lf: List reference frames\");\n System.out.println(\"\\t af: Add a reference frame\");\n System.out.println(\"\\t rf: Remove a reference frame\");\n System.out.println(\"\\t le: List events\");\n System.out.println(\"\\t ae: Add an event\");\n System.out.println(\"\\t re: Remove an event\");\n System.out.println(\"\\t ve: View all events from a certain frame\");\n System.out.println(\"\\t li: Calculate the Lorentz Invariant of two events\");\n System.out.println(\"\\t s: Save the world to file\");\n System.out.println(\"\\t l: Load the world from file\");\n System.out.println(\"\\t exit: Exit the program\");\n }",
"void visualize(Object o) {\n\t\tif (o == null) {\n\t\t\to = new NullObject();\n\t\t}\n\n\t\tScratch scratch = scratchFactory.create(o);\n\t\tscratch.addCSSClass(\"printOut\");\n\n\t\tvisualizeScratch(scratch);\n\t}",
"public abstract void viewRun();",
"@Override\r\n public void prenderVehiculo() {\r\n System.out.println(\"___________________________________________________\");\r\n System.out.println(\"prender Jet\");\r\n }",
"@Override\n\tprotected void show() {\n\t\tsuper.show();\n\t\tSystem.out.println(\"BBBBBBBBBBBBBBBBBBB\");\n\t}",
"public void showStory() {\r\n\t\tGameEngine.getInstance().getCommandProcessor().clearScreen();\r\n\t\tprintln(\"\");\r\n\t\tprintln(RenderUtil.getWelcomeMessage());\r\n\t\ttry {\r\n\t\t\tfor (String outputString : GamePlayUtil.GAME_STORY) {\r\n\t\t\t\tThread.sleep(1000);\r\n\t\t\t\tRenderUtil.println(\"\\t\" + outputString);\r\n\t\t\t}\r\n\t\t\tThread.sleep(2000);\r\n\t\t} catch (Exception e) {\r\n\t\t\tprintln(\"Problem Occured...\");\r\n\t\t}\r\n\t}",
"void render(IViewModel model);",
"public void Display() {\n\t\tSystem.out.println(Integer.toHexString(PID) + \"\\t\" + Integer.toString(CreationTime) + \"\\t\"+ Integer.toHexString(CommandCounter) + \"\\t\" + ProcessStatus.toString() \n\t\t+ \"\\t\" + Integer.toString(MemoryVolume) + \"\\t\" + Integer.toHexString(Priority) + \"\\t\" + ((MemorySegments != null)? MemorySegments.toString() : \"null\"));\n\t}",
"public void render () \n\t{ \n\t\trenderWorld(batch);\n\t\trenderGui(batch);\n\t}",
"@Override\r\n\tpublic void render() {\n\t\t\r\n\t}",
"@Override\n\tpublic String drawForConsole() {\n\t\tString[][] output = new String[this.getWidth()][this.getHeight()];\n\t\tString image = \"\";\n\t\tfor (int x = 0; x < this.getWidth(); x++) {\n\t\t\tfor (int y = 0; y < this.getHeight(); y++) {\n\t\t\t\tif (x == 0 || x == this.getWidth() - 1) {\n\t\t\t\t\toutput[x][y] = \"#\";\n\t\t\t\t} else if (y == 0 || y == this.getHeight() -1) {\n\t\t\t\t\toutput[x][y] = \"#\";\n\t\t\t\t} else if (this.isFilledIn()) {\n\t\t\t\t\toutput[x][y] = \"#\";\n\t\t\t\t} else {\n\t\t\t\t\toutput[x][y] = \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (int y = 0; y < this.getHeight(); y++) {\n\t\t\tfor (int x = 0; x < this.getWidth(); x++) {\n\t\t\t\timage += output[x][y];\n\t\t\t\tif (x == this.getWidth() - 1) {\n\t\t\t\t\timage += \"\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn image;\n\t}",
"@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"Displaying...\");\r\n\t}",
"void view();",
"@Override\n\tpublic void display() {\n\t\tSystem.out.println(\"This is rectangle\");\n\t}",
"public interface MainView {\n void showOutput(String json);\n}",
"@Override\n\tpublic void render() {\n\t\t\n\t}",
"@Override\n\tpublic void render() {\n\t\tScreen.render();\n\t}",
"private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}",
"public void render() {\n renderHud();\n }",
"public static void display() {\n\n\t\tSystem.out.println(\"************************************************************\");\n\t\tSystem.out.println(\"* Omar Oraby\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* 900133379\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* Salma Talaat *\");\n\t\tSystem.out.println(\"* 900161560\t \t\t\t\t\t *\");\n\t\tSystem.out.println(\"* Ahmed Elshafey *\");\n\t\tSystem.out.println(\"* 900131045 *\");\n\t\tSystem.out.println(\"* Programming in Java *\");\n\t\tSystem.out.println(\"* (2018 Fall) *\");\n\t\tSystem.out.println(\"************************************************************\");\n\t\tSystem.out.println();\n }",
"void render(Object rendererTool);",
"void render(Window window) throws Exception;",
"protected void doDebug(Renderer r) {\n \t\t\tif (showBounds) {\n \t\t\t\tDebugger.drawBounds(rootNode, r, true);\n \t\t\t}\n \n \t\t\tif (showNormals) {\n \t\t\t\tDebugger.drawNormals(rootNode, r);\n \t\t\t\tDebugger.drawTangents(rootNode, r);\n \t\t\t}\n \t\t}",
"public void run() {\n \tdisposeColor(errorColor);\n \tdisposeColor(inputColor);\n \tdisposeColor(messageColor); \t\n \tdisposeColor(bkgColor); \t\n \tRGB errorRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_ERROR_COLOR);\n \tRGB inputRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_OUTPUT_COLOR);\n \tRGB messageRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_INFO_COLOR);\n \tRGB bkgRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_BACKGROUND_COLOR); \t\n \terrorColor = new Color(d, errorRGB);\n \tinputColor = new Color(d, inputRGB);\n \tmessageColor = new Color(d, messageRGB);\n \tbkgColor = new Color(d, bkgRGB);\n error.setColor(errorColor);\n input.setColor(inputColor);\n message.setColor(messageColor);\n console.setBackground(bkgColor);\n }",
"StableView view();",
"@Override\n public void display() {\n EasyViewer.beginOverlay();\n \n glColor4d( 0,1,0,alpha.getValue() );\n glLineWidth(2); \n glBegin( GL_LINE_STRIP );\n for ( int i = 0; i < 10; i++) {\n glVertex2d( 200 + i*10, 100 +i*i );\n }\n glEnd();\n \n glColor4d( 1,0,0,alpha.getValue() );\n glPointSize(5);\n glBegin( GL_POINTS );\n for ( int i = 0; i < 10; i++) {\n glVertex2d( 200 + i*10, 100+i*i );\n } \n glEnd();\n \n \n // lets draw some 2D text\n// glColor4d( 1,1,1,1 ); \n// EasyViewer.printTextLines( \"(100,100)\", 100, 100, 12, GLUT.BITMAP_HELVETICA_10 );\n// glRasterPos2d( 200, 200 );\n// EasyViewer.printTextLines( \"(200,200)\\ncan have a second line of text\", 200, 200, 12, GLUT.BITMAP_HELVETICA_10 );\n \n EasyViewer.endOverlay();\n \n }",
"@Override\n\tpublic void show() {\n\t\tSystem.out.println(\"Line\");\n\t}",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"@Override\n public void simpleRender(RenderManager rm) {\n }",
"public void display() {\n\t\tSystem.out.println(\"display..\");\n\t}",
"public Controller(Game game, View consoleView, View graphicalView){\n\t\tthis.game = game;\n\t\tthis.consoleView = consoleView;\n\t\tthis.graphicalView = graphicalView;\t\n\t\t\n\t\tstart();\n\t}",
"public void displayImageToConsole();",
"void writeJavaScriptRenderer(PrintStream writer);",
"public Console() {\n instance = this;\n\n this.setPrefViewportHeight(300);\n lb = new Label();\n lb.setWrapText(true);\n instance.setContent(lb);\n\n }",
"public void outputVisualObjects ()\n\t{\n\t\toutput (\"\\n> (visual-objects)\\n\");\n\t\tif (model!=null) model.outputVisualObjects();\n\t}",
"public void render() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) {\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t// get graphics object for drawing on canvas\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t// clear screen before drawing new objects to it\n\t\tg.setColor(style.getBackCol());\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t// use style from server to draw time information, only if we have\n\t\t// synced the time with the server.\n\t\tg.setColor(style.getTimeCol());\n\t\tif (tim.TIME_SYNCED) {\n\t\t\t// set font and font size, perhaps font can also be customizable in\n\t\t\t// the future?\n\t\t\tg.setFont(new Font(\"TimesRoman\", Font.PLAIN, style.getTimePoint()));\n\t\t\tFontMetrics metrics = g.getFontMetrics(new Font(\"TimesRoman\", Font.PLAIN, style.getTimePoint()));\n\t\t\t// get height to offset text by when drawing.\n\t\t\tint hgt = metrics.getHeight();\n\t\t\t// System.out.println(\"\" +style.getLeft() * WIDTH);\n\t\t\tg.drawString(tim.getTime(), (int) (style.getLeft() * WIDTH), (int) (style.getTop() * HEIGHT + hgt));\n\t\t}\n\t\t// clear graphics from memory and draw screen buffer\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"public abstract String visualizar();",
"private void render() {\n if (game.isEnded()) {\n if (endGui == null) {\n drawEndScreen();\n }\n\n return;\n }\n\n drawScore();\n drawSnake();\n drawFood();\n }",
"public void display() {\n\t\tSystem.out.println(x + \" \" + y + \" \" + z);\n\t}",
"private void render() {\n final int numBuffers = 3;\n BufferStrategy bs = this.getBufferStrategy(); // starts value at null\n if (bs == null) {\n this.createBufferStrategy(numBuffers); // 3: buffer creations\n return;\n }\n Graphics g = bs.getDrawGraphics();\n\n g.setColor(Color.black); // stops flashing background\n g.fillRect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);\n\n handler.render(g);\n\n if (gameStart == GAME_STATE.Game) {\n hud.render(g);\n } else if (gameStart == GAME_STATE.Menu || gameStart == GAME_STATE.Help || gameStart == GAME_STATE.GameOver || gameStart == GAME_STATE.GameVictory) {\n menu.render(g);\n }\n\n g.dispose();\n bs.show();\n }",
"static void welcome() {\n System.out.println(getAnsiRed() + \"\\n\" +\n \"███████╗████████╗██████╗ █████╗ ███╗ ██╗ ██████╗ ███████╗██████╗ \\n\" +\n \"██╔════╝╚══██╔══╝██╔══██╗██╔══██╗████╗ ██║██╔════╝ ██╔════╝██╔══██╗\\n\" +\n \"███████╗ ██║ ██████╔╝███████║██╔██╗ ██║██║ ███╗█████╗ ██████╔╝\\n\" +\n \"╚════██║ ██║ ██╔══██╗██╔══██║██║╚██╗██║██║ ██║██╔══╝ ██╔══██╗\\n\" +\n \"███████║ ██║ ██║ ██║██║ ██║██║ ╚████║╚██████╔╝███████╗██║ ██║\\n\" +\n \"╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝\\n\" +\n \" ██████╗ █████╗ ███╗ ███╗███████╗ \\n\" +\n \" ██╔════╝ ██╔══██╗████╗ ████║██╔════╝ \\n\" +\n \" ██║ ███╗███████║██╔████╔██║█████╗ \\n\" +\n \" ██║ ██║██╔══██║██║╚██╔╝██║██╔══╝ \\n\" +\n \" ╚██████╔╝██║ ██║██║ ╚═╝ ██║███████╗ \\n\" +\n \" ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ \\n\" +\n getAnsiReset());\n\n System.out.println(\"\\n\" +\n \" Built by Team NullPointer (Team 5)\\n\" +\n \" Neill Perry (https://github.com/neillperry)\\n\" +\n \" Bruce West (https://github.com/BruceBAWest)\\n\" +\n \" Tapan Trivedi (https://github.com/tapantriv)\\n\" +\n \" TLG Learning: Capstone Java Project\\n\" +\n \" https://github.com/NullPointer-Team\");\n }",
"public void render() {\n\t\tscreen.background(255);\n\t\thandler.render();\n\t}",
"@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"RedHeadDuck\");\r\n\t}",
"static void draw()\n {\n for (Viewport viewport : viewports)\n viewport.draw(renderers);\n }",
"private void render() {\n\n\tbs=display.getCanvas().getBufferStrategy();\t\n\t\n\tif(bs==null) \n\t {\t\n\t\tdisplay.getCanvas().createBufferStrategy(3);\n\t\treturn ;\n\t }\n\t\n\tg=bs.getDrawGraphics();\n\n\t//Clear Screen\n\tg.clearRect(0, 0, width, height);\n\t\n\tif(State.getState()!=null )\n\t\tState.getState().render(g);\n\t\n\t//End Drawing!\n\tbs.show();\n\tg.dispose();\n\t\n\t}",
"@Override\n\tpublic void render () {\n\n\t}",
"@Override\r\n\tpublic void simpleRender(RenderManager rm) {\n\t}",
"@Override\n public void render() { super.render(); }",
"private void view() {\n\n\t\ttry {\n\t\t\tString databaseUser = \"blairuser\";\n\t\t\tString databaseUserPass = \"password!\";\n\t\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\tConnection connection = null;\n\t\t\tString url = \"jdbc:postgresql://13.210.214.176/test\";\n\t\t\tconnection = DriverManager.getConnection(url, databaseUser, databaseUserPass);\n//\t\t\tStatement s = connection.createStatement();\n\t\t\ts = connection.createStatement();\n\t\t\tResultSet rs = s.executeQuery(\"select * from account;\");\n\t\t\t// while (rs.next()) {\n\t\t\tString someobject = rs.getString(\"name\") + \" \" + rs.getString(\"password\");\n\t\t\tSystem.out.println(someobject);\n\t\t\toutput.setText(someobject);\n\t\t\t// output.setText(rs);\n\t\t\t// System.out.println(rs.getString(\"name\")+\" \"+rs.getString(\"message\"));\n\t\t\t// rs.getStatement();\n\t\t\t// }\n\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e.getMessage());\n\t\t}\n\t\tPostgresJDBC();\n\t}",
"@Override\r\n\tpublic void display() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void display() {\n\t\t\r\n\t}",
"public void render() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) { //if the buffer strategy doesnt get created, then you create it\n\t\t\tcreateBufferStrategy(3); //the number 3 means it creates triple buffering\n\t\t\treturn;\t\t\t\t\t//, so when you backup frame gets displayed (2) it will also have a backup\t\n\t\t}\n\t\t\n\t\t//apply data to the buffer \"bs\"\n\t\t//this is creating a link to graphics to drawing graphics to the screen.\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t/**\n\t\t * You input all of your graphics inbetween the g object and g.dispose();\n\t\t */\n\t\t//###################\n\t\t\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t//###################\n\t\tg.dispose(); //this dispose of all the graphics\n\t\tbs.show(); //this will make the next available buffer visible\n\t}",
"public void display() {\n\t\tSystem.out.println(\"do something...\");\n\t}",
"@Override\r\n\tpublic void render() {\n\r\n\t}",
"public static void create() {\r\n render();\r\n }",
"public interface View {\r\n\t/**\r\n\t * starting the user interface\r\n\t */\r\n\tpublic void start();\r\n\t/**\r\n\t * returning the command that the user entered\r\n\t * @return string with the command that user entered\r\n\t */\r\n\tpublic String getUserCommand();\r\n\t/**\r\n\t * display the error in the commands that the client wrote\r\n\t * @param message string telling what is the error\r\n\t */\r\n\tpublic void showError(String error);\r\n\t/**\r\n\t * display the outcome of command:dir <path>\r\n\t * displaying the files and directories of the specified path\r\n\t * @param dirArray string's array with the names of files and directories in the specified path\r\n\t */\r\n\tpublic void showDirPath(String[] list);\r\n\t/**\r\n\t * display the message that the maze is ready\r\n\t * @param message string with the massege:maze is ready\r\n\t */\r\n\tpublic void showGenerate3dMaze(String message);\r\n\t/**\r\n\t * displaying the specified maze\r\n\t * @param byteArr byte array representing the maze\r\n\t */\r\n\tpublic void showDisplayName(byte[] byteArr);\r\n\t/**\r\n\t * displaying the cross section which the client asked for\r\n\t * @param crossSection 2d array with the cross section asked\r\n\t */\r\n\tpublic void showDisplayCrossSectionBy(int[][] crossSection);\r\n\t/**\r\n\t * displaying the string:the maze has been saved\r\n\t * @param str string with the word:maze has been saved\r\n\t */\r\n\tpublic void showSaveMaze(String message);\r\n\t/**\r\n\t * displaying the string:the maze has been loaded\r\n\t * @param str string with the word:maze has been loaded\r\n\t */\r\n\tpublic void showLoadMaze(String message);\r\n\t/**\r\n\t * display the maze size in memory(bytes)\r\n\t * @param size the size of the maze in bytes\r\n\t */\r\n\tpublic void showMazeSize(int size);\r\n\t/**\r\n\t * display the maze size in file(bytes)\r\n\t * @param length the size of the maze in file\r\n\t */\r\n\tpublic void showFileSize(long size);\r\n\t/**\r\n\t * displaying the string:solution for maze is ready\r\n\t * @param message string with the words:solution for maze is ready\r\n\t */\r\n\tpublic void showSolveMaze(String message);\r\n\t/**\r\n\t * displaying the solution of the specified maze\r\n\t * @param sol the solution of the maze\r\n\t */\r\n\tpublic void showDisplaySolution(Solution<Position> solution);\r\n\t/**\r\n\t * a command that only gui has:solve from <name> <algorithm> <x> <y> <z>\r\n\t * showing the outcome of this command,in other wards display the solution from specific point in the maze\r\n\t * @param message message that the solution is ready\r\n\t */\r\n\tpublic void showSolveFrom(String message);\r\n\t/**\r\n\t * a command that only gui has:display half solution <name>\r\n\t * displaying a solution for the specified maze\r\n\t * @param solution solution that was calculated in the model\r\n\t */\r\n\tpublic void showDisplayHalfSolution(Solution<Position> solution);\r\n\t/**\r\n\t * display a message about some error\r\n\t */\r\n\tpublic void showExit();\r\n\t/**\r\n\t * displaying help,which shows the commands the client can write\r\n\t */\r\n\tpublic void showHelp();\r\n\t/**\r\n\t * a command that only gui have: load xml\r\n\t * @param p properties object that was loaded by the xml file\r\n\t */\r\n\tpublic void showLoadXML(Properties p);\r\n}",
"public void display() {\n\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t\n\t\tfor (byte r = (byte) (b.length - 1); r >= 0; r--) {\n\t\t\tSystem.out.print(r + 1);\n\t\t\t\n\t\t\tfor (byte c = 0; c < b[r].length; c++) {\n\t\t\t\tSystem.out.print(\" | \" + b[r][c]);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\" |\");\n\t\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" a b c d e f g h\");\n\t}",
"@Override\n public void render() {\n super.render();\n }",
"@Override\n public void render() {\n super.render();\n }",
"public void look() {\n\t\tthis.print((this.observe().get(0)).toString());\n\t\t\n\t}",
"@Override\n\tpublic void view() {\n\t\t\n\t}",
"@Test\n public void execute_validParameters_success() throws CommandException {\n System.setOut(modelPrintStream);\n new ViewParticipantCommand(this.participantToView.getId()).execute(modelOneParticipant);\n String output = modelOut.toString();\n // Configure correct output\n String expectedOutput = new StringBuilder()\n .append(String.format(\"Viewing %s%s\", this.participantToView.getName(), NEW_LINE))\n .append(String.format(\"\\t%s%s\", this.participantToView.toString(), NEW_LINE))\n .toString();\n // Test and reset OutputStream\n assertEquals(expectedOutput, output);\n modelOut.reset();\n }",
"private static void Display()\n\t{\n\t\tStringBuilder memoryValues = new StringBuilder();\n\t\tSystem.out.println(\"\\nPipleline Stages: \");\n\t\tif (stages.get(\"F\") != null)\n\t\t\tSystem.out.println(\"--------Fetch-----------> \" + stages.get(\"F\").getContent());\n\t\tif (stages.get(\"D\") != null)\n\t\t\tSystem.out.println(\"--------Decode----------> \" + stages.get(\"D\").getContent());\n\t\tif (stages.get(\"E\") != null)\n\t\t\tSystem.out.println(\"--------Execution1------> \" + stages.get(\"E\").getContent());\n\t\tif (stages.get(\"E2\") != null)\n\t\t\tSystem.out.println(\"--------Execution2------> \" + stages.get(\"E2\").getContent());\n\t\tif (stages.get(\"B1\") != null)\n\t\t\tSystem.out.println(\"--------Branch----------> \" + stages.get(\"B1\").getContent());\n\t\tif (stages.get(\"Dly\") != null)\n\t\t\tSystem.out.println(\"--------Delay-----------> \" + stages.get(\"Dly\").getContent());\n\t\tif (stages.get(\"M\") != null)\n\t\t\tSystem.out.println(\"--------Memory----------> \" + stages.get(\"M\").getContent());\n\t\tif (stages.get(\"W\") != null)\n\t\t\tSystem.out.println(\"--------Writeback-------> \" + stages.get(\"W\").getContent());\n\n\t\tSystem.out.println(\"\\nRegister File Details: \\n\");\n\t\tfor (Entry<String, Integer> register : registerFile.entrySet())\n\t\t{\n\t\t\tSystem.out.print(register.getKey() + \" : \" + register.getValue() + \"|\\t|\");\n\t\t}\n\t\tSystem.out.println(\"Special Register X:\" + specialRegister);\n\t\tSystem.out.println(\"\\n0 to 99 Memory Address Details: \");\n\t\tfor (int i = 0; i < 100; i++)\n\t\t{\n\t\t\tmemoryValues.append(\" [\" + i + \" - \" + memoryBlocks[i] + \"] \");\n\t\t\tif (i > 0 && i % 10 == 0)\n\t\t\t\tmemoryValues.append(\"\\n\");\n\t\t}\n\t\tSystem.out.println(memoryValues);\n\n\t}",
"public void render () {\n\t\tcam.update();\n\t\tbatch.setProjectionMatrix(cam.combined);\n\t\trenderBackground();\n\t\t/*shapeRender.setProjectionMatrix(cam.combined);\n\t\tshapeRender.begin(ShapeRenderer.ShapeType.Line);\n\t\tshapeRender.ellipse(world.trout.hitBox.x, world.trout.hitBox.y, world.trout.hitBox.width, world.trout.hitBox.height);\n\t\tshapeRender.circle(world.hook.circleBounds.x, world.hook.circleBounds.y, world.hook.circleBounds.radius);\n\t\tshapeRender.point(world.trout.position.x, world.trout.position.y, 0f);*/\n\t\trenderObjects();\n\t\t\n\t}",
"public static void win(){\n System.out.println(\"\\n\" + getAnsiGreen() +\n \"██╗░░░██╗░█████╗░██╗░░░██╗░░░░██╗░░░░░░░██╗░█████╗░███╗░░██╗░░░\\n\" +\n \"╚██╗░██╔╝██╔══██╗██║░░░██║░░░░██║░░██╗░░██║██╔══██╗████╗░██║░░░\\n\" +\n \"░╚████╔╝░██║░░██║██║░░░██║░░░░╚██╗████╗██╔╝██║░░██║██╔██╗██║░░░\\n\" +\n \"░░╚██╔╝░░██║░░██║██║░░░██║░░░░░████╔═████║░██║░░██║██║╚████║░░░\\n\" +\n \"░░░██║░░░╚█████╔╝╚██████╔╝░░░░░╚██╔╝░╚██╔╝░╚█████╔╝██║░╚███║██╗\\n\" +\n \"░░░╚═╝░░░░╚════╝░░╚═════╝░░░░░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚══╝╚═╝\\n\" +\n \"\\n\" +\n \"░█████╗░░█████╗░███╗░░██╗░██████╗░██████╗░░█████╗░████████╗░██████╗██╗██╗\\n\" +\n \"██╔══██╗██╔══██╗████╗░██║██╔════╝░██╔══██╗██╔══██╗╚══██╔══╝██╔════╝██║██║\\n\" +\n \"██║░░╚═╝██║░░██║██╔██╗██║██║░░██╗░██████╔╝███████║░░░██║░░░╚█████╗░██║██║\\n\" +\n \"██║░░██╗██║░░██║██║╚████║██║░░╚██╗██╔══██╗██╔══██║░░░██║░░░░╚═══██╗╚═╝╚═╝\\n\" +\n \"╚█████╔╝╚█████╔╝██║░╚███║╚██████╔╝██║░░██║██║░░██║░░░██║░░░██████╔╝██╗██╗\\n\" +\n \"░╚════╝░░╚════╝░╚═╝░░╚══╝░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚═════╝░╚═╝╚═╝\" + getAnsiReset());\n\n try {\n TimeUnit.SECONDS.sleep(1);\n System.out.println(\"You feel movement in your belly...\");\n startNewOrQuitGame();\n } catch (InterruptedException e) {\n System.out.println(\"Something wrong with the Game!!!\");\n }\n }",
"public void display() {\n\t\t\n\t}"
] | [
"0.7138768",
"0.6943181",
"0.68035096",
"0.6500016",
"0.6227685",
"0.6194153",
"0.59578866",
"0.59040344",
"0.58988404",
"0.58293563",
"0.5795215",
"0.5779105",
"0.5749652",
"0.5725118",
"0.5702755",
"0.5689799",
"0.5669511",
"0.56426287",
"0.56390715",
"0.5637527",
"0.56284314",
"0.56231433",
"0.56108624",
"0.56039536",
"0.5592308",
"0.55882055",
"0.55624336",
"0.55608195",
"0.5555213",
"0.5543208",
"0.55264384",
"0.5518321",
"0.5503479",
"0.5497998",
"0.5495288",
"0.5479211",
"0.54786146",
"0.5476932",
"0.5436076",
"0.5426773",
"0.54246205",
"0.5422575",
"0.54201514",
"0.5406234",
"0.5402289",
"0.5384748",
"0.53787416",
"0.5374148",
"0.53711253",
"0.536782",
"0.5366692",
"0.53346264",
"0.5334103",
"0.53305393",
"0.5305423",
"0.53015006",
"0.52987635",
"0.529873",
"0.52987164",
"0.52987164",
"0.52987164",
"0.52987164",
"0.52987164",
"0.52987164",
"0.5283511",
"0.5280082",
"0.52799314",
"0.5272461",
"0.52673984",
"0.52641535",
"0.52573895",
"0.5251229",
"0.5237687",
"0.5230427",
"0.52251375",
"0.52207214",
"0.5220093",
"0.5215126",
"0.5211573",
"0.5210471",
"0.52055687",
"0.5201941",
"0.52012986",
"0.5197898",
"0.5191319",
"0.5191319",
"0.51907897",
"0.5189749",
"0.51891875",
"0.5188885",
"0.5188323",
"0.518461",
"0.5178309",
"0.5178309",
"0.5176194",
"0.5174827",
"0.51648206",
"0.5154797",
"0.51484126",
"0.51458496",
"0.5145449"
] | 0.0 | -1 |
Move a note to a given pitch at a given measure | public void move(Note n, Note.Pitches pitch, int octave, int measure) {
if (!n.getIsHead()) {
throw new IllegalArgumentException("Can't move a tail note");
}
boolean result = false;
for (int i = 0; i < n.getDuration(); i++) {
for (Note t : this.sheet.get(i + n.getStartMeasure())) {
if (t.equals(n)) {
result = true;
}
}
}
if (result == false) {
throw new IllegalArgumentException("note doesn't exist");
} else {
this.removeNote(n);
}
Note n2 = n.moveTo(pitch, octave, measure);
for (int i = 0; i < n2.getDuration(); i++) {
for (Note t : this.sheet.get(i + n2.getStartMeasure())) {
if (t.equals(n2)) {
throw new IllegalArgumentException("Already placed a note.");
}
}
}
this.addNote(n2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setPitch(int pitch);",
"public void pitch(float amount)\r\n {\r\n //increment the pitch by the amount param\r\n pitch -= amount;\r\n }",
"public void playNote(int pitch) {\n\t\tsynthChannel.noteOn(pitch, MusicManager.SYNTH_NOTE_VELOCITY);\n\t}",
"public void setPitch(int pitch) {\n mSelf.setPitch(pitch);\n }",
"public void pitch(double angle) {\n heading = rotateVectorAroundAxis(heading, left, angle);\r\n up = rotateVectorAroundAxis(up, left, angle);\r\n\r\n }",
"public void addPitch(float pitch) {\n\t\tthis.pitch += pitch;\n\t\tAL10.alSourcef(id, AL10.AL_PITCH, this.pitch);\n\t}",
"double getPitch();",
"float getPitch();",
"float getPitch();",
"private void adjustPitch(double tick) {\n\t\tif(pitch < targetPitch) {\n\t\t\taddPitch((float)tick * deltaPitch);\n\t\t\tif(pitch >= targetPitch)\n\t\t\t\tsetPitch(targetPitch);\n\t\t} else if(pitch > targetPitch) {\n\t\t\taddPitch((float)tick * deltaPitch);\n\t\t\tif(pitch <= targetPitch)\n\t\t\t\tsetPitch(targetPitch);\n\t\t}\n\t}",
"public void setPitch(float pitch) {\n\t\talSourcef(musicSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(reverseSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(flangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(distortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revDistortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(distortFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revDistortFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahDistortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahDistortSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(wahDistortFlangeSourceIndex, AL_PITCH, pitch);\n\t\talSourcef(revWahDistortFlangeSourceIndex, AL_PITCH, pitch);\n\t}",
"void note(float start, float duration, float freq){\n\t out.playNote(start,duration,freq); \n\t }",
"public void setPitch(float pitch) {\n\t\tthis.pitch = pitch;\n\t\ttargetPitch = pitch;\n\t\tAL10.alSourcef(id, AL10.AL_PITCH, pitch);\n\t}",
"public void playNote ( Location loc , byte instrument , byte note ) {\n\t\texecute ( handle -> handle.playNote ( loc , instrument , note ) );\n\t}",
"@Override\n public void mutate(Song song, int noteIndex) {\n if (Math.random() < this.getProbability()) {\n if (noteIndex > 0) {\n MidiUtil mu = new MidiUtil();\n int nbrOfTotalReversing = nbrOfAdditionalReversing + 1\n + ((int) Math.random() * nbrRange);\n ArrayList<Integer> noteIndexes = new ArrayList<Integer>();\n ArrayList<Note> notes = new ArrayList<Note>();\n noteIndexes.add(noteIndex);\n notes.add(song.getScore().getPart(0).getPhrase(0)\n .getNote(noteIndex));\n int currentIndex = noteIndex - 1;\n noteIteration: for (int i = 1; i < nbrOfTotalReversing; i++) {\n while (mu.isBlank(currentIndex) && currentIndex >= 0) {\n currentIndex--;\n }\n if (currentIndex < 0) {\n break noteIteration;\n } else {\n noteIndexes.add(currentIndex);\n notes.add(song.getScore().getPart(0).getPhrase(0)\n .getNote(currentIndex));\n }\n }\n int totalReverses = noteIndexes.size();\n for (int j = 0; j < noteIndexes.size(); j++) {\n if (withRhythmLength) {\n song.getScore()\n .getPart(0)\n .getPhrase(0)\n .setNote(notes.get(totalReverses - 1 - j),\n noteIndexes.get(j));\n } else {\n int newPitch = notes.get(totalReverses - 1 - j)\n .getPitch();\n song.getScore().getPart(0).getPhrase(0)\n .getNote(noteIndexes.get(j)).setPitch(newPitch);\n }\n }\n }\n }\n }",
"@Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }",
"void addNote(int duration, int octave, int beatNum, String pitch)\n throws IllegalArgumentException;",
"@Override\n default void appendPitchRotation(double pitch)\n {\n AxisAngleTools.appendPitchRotation(this, pitch, this);\n }",
"public void playNote ( Location loc , Instrument instrument , Note note ) {\n\t\texecute ( handle -> handle.playNote ( loc , instrument , note ) );\n\t}",
"void addNote(int duration, int octave, int beatNum, int instrument, int volume, String pitch)\n throws IllegalArgumentException;",
"public void sendMessage(final int note) {\n final ShortMessage myMsg = new ShortMessage();\n final long timeStamp = -1;\n\n // hard-coded a moderate velocity of 93 because there is no way of tracking speed of finger movement\n try {\n myMsg.setMessage(ShortMessage.NOTE_ON, 0, note, 93);\n } catch (final InvalidMidiDataException e) {\n System.err.println(\"Could not send midi message! \");\n System.err.println(e.getMessage());\n }\n this.midiReceiver.send(myMsg, timeStamp);\n\n// turn the note off after one second of playing\n final ExecutorService service = Executors.newFixedThreadPool(1);\n service.submit(() -> {\n try {\n Thread.sleep(1000);\n //stop old note from playing\n myMsg.setMessage(ShortMessage.NOTE_OFF, 0, note, 0);\n this.midiReceiver.send(myMsg, timeStamp);\n } catch (final InterruptedException | InvalidMidiDataException e) {\n e.printStackTrace();\n }\n });\n }",
"CompositionBuilder<T> addNote(int start, int end, int instrument, int pitch, int volume);",
"public void stopNote(int pitch) {\n\t\tsynthChannel.noteOff(pitch, 127);\n\t}",
"public final MotionUpdateEvent setPitch(float pitch) {\n rotations.setY(pitch);\n return this;\n }",
"public int getTestNotePitch()\n {\n return super.getTestNotePitch();\n }",
"@Override\n\tpublic void playSequenceNote(final int note, final double duration,\n\t\t\tfinal int instrument, final int velocity) {\n\t\ttry {\n\t\t\tstopCurrentSound();\n\t\t\tcurrentSoundType = SOUNDTYPE_MIDI;\n\t\t\tgetMidiSound().playSequenceNote(note, duration, instrument);\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"INote removeNote(int beatNum, String pitch, int octave) throws IllegalArgumentException;",
"@Override\n public CompositionBuilder<MusicOperation> addNote(int start, int end, int instrument,\n int pitch, int volume) {\n this.listNotes.add(new SimpleNote(Pitch.values()[(pitch) % 12],\n Octave.values()[(pitch / 12) - 2 ], start, end - start, instrument, volume));\n return this;\n }",
"private void updateMatchType(MidiNote note) {\n\t\tList<Beat> beats = beatState.getBeats();\n\t\tBeat startBeat = note.getOnsetBeat(beats);\n\t\tBeat endBeat = note.getOffsetBeat(beats);\n\t\t\n\t\tint tactiPerMeasure = beatState.getTactiPerMeasure();\n\t\t\n\t\tint startTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), startBeat.getMeasure(), startBeat.getBeat());\n\t\tint endTactus = getTactusNormalized(tactiPerMeasure, beats.get(0), endBeat.getMeasure(), endBeat.getBeat());\n\t\t\n\t\tint noteLengthTacti = Math.max(1, endTactus - startTactus);\n\t\tstartTactus -= anacrusisLength * subBeatLength;\n\t\tendTactus = startTactus + noteLengthTacti;\n\t\t\n\t\tint prefixStart = startTactus;\n\t\tint middleStart = startTactus;\n\t\tint postfixStart = endTactus;\n\t\t\n\t\tint prefixLength = 0;\n\t\tint middleLength = noteLengthTacti;\n\t\tint postfixLength = 0;\n\t\t\n\t\tint beatLength = subBeatLength * measure.getSubBeatsPerBeat();\n\t\t\n\t\t// Reinterpret note given matched levels\n\t\tif (matches(MetricalLpcfgMatch.SUB_BEAT) && startTactus / subBeatLength != (endTactus - 1) / subBeatLength) {\n\t\t\t// Interpret note as sub beats\n\t\t\t\n\t\t\tint subBeatOffset = startTactus % subBeatLength;\n\t\t\tint subBeatEndOffset = endTactus % subBeatLength;\n\t\t\t\n\t\t\t// Prefix\n\t\t\tif (subBeatOffset != 0) {\n\t\t\t\tprefixLength = subBeatLength - subBeatOffset;\n\t\t\t}\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleStart += prefixLength;\n\t\t\tmiddleLength -= prefixLength;\n\t\t\t\n\t\t\t// Postfix\n\t\t\tpostfixStart -= subBeatEndOffset;\n\t\t\tpostfixLength += subBeatEndOffset;\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleLength -= postfixLength;\n\t\t\t\n\t\t} else if (matches(MetricalLpcfgMatch.BEAT) && startTactus / beatLength != (endTactus - 1) / beatLength) {\n\t\t\t// Interpret note as beats\n\t\t\t\n\t\t\t// Add up possible partial beat at the start\n\t\t\tif (anacrusisLength % measure.getSubBeatsPerBeat() != 0) {\n\t\t\t\tint diff = subBeatLength * (measure.getSubBeatsPerBeat() - (anacrusisLength % measure.getSubBeatsPerBeat()));\n\t\t\t\tstartTactus += diff;\n\t\t\t\tendTactus += diff;\n\t\t\t}\n\t\t\tint beatOffset = (startTactus + subBeatLength * (anacrusisLength % measure.getSubBeatsPerBeat())) % beatLength;\n\t\t\tint beatEndOffset = (endTactus + subBeatLength * (anacrusisLength % measure.getSubBeatsPerBeat())) % beatLength;\n\t\t\t\n\t\t\t// Prefix\n\t\t\tif (beatOffset != 0) {\n\t\t\t\tprefixLength = beatLength - beatOffset;\n\t\t\t}\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleStart += prefixLength;\n\t\t\tmiddleLength -= prefixLength;\n\t\t\t\n\t\t\t// Postfix\n\t\t\tpostfixStart -= beatEndOffset;\n\t\t\tpostfixLength += beatEndOffset;\n\t\t\t\n\t\t\t// Middle fix\n\t\t\tmiddleLength -= postfixLength;\n\t\t}\n\t\t\n\t\t// Prefix checking\n\t\tif (prefixLength != 0) {\n\t\t\tupdateMatchType(prefixStart, prefixLength);\n\t\t}\n\t\t\n\t\t// Middle checking\n\t\tif (!isFullyMatched() && !isWrong() && middleLength != 0) {\n\t\t\tupdateMatchType(middleStart, middleLength);\n\t\t}\n\t\t\n\t\t// Postfix checking\n\t\tif (!isFullyMatched() && !isWrong() && postfixLength != 0) {\n\t\t\tupdateMatchType(postfixStart, postfixLength);\n\t\t}\n\t}",
"public static int getNormalizedPitch(Note note) {\n try {\n String pitch = note.getPitch().toString();\n String octave = new Integer(note.getOctave()).toString();\n\n String target = null;\n\n if (note.getPitch().equals(Pitch.R)) {\n target = \"REST\";\n } else {\n if(note.getAlteration().equals(Alteration.N))\n target = pitch.concat(octave);\n else if(note.getAlteration().equals(Alteration.F))\n target = pitch.concat(\"F\").concat(octave);\n else\n target = pitch.concat(\"S\").concat(octave);\n }\n\n \n\n Class cClass = ConverterUtil.class;\n Field field = cClass.getField(target);\n Integer value = (Integer) field.get(null);\n\n return value.intValue()%12;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return 0;\n }",
"@Override\n public void move(){\n setDirectionSpeed(180, 7);\n this.moveTowardsAPoint(target.getCenterX(), target.getCenterY());\n }",
"public void onMove(float x, float y, float pressure) {\n/* 135 */ this.mTouchEventSubject.onNext(new InkEvent(InkEventType.ON_TOUCH_MOVE, x, y, this.mIsPressureSensitive ? pressure : 1.0F));\n/* */ }",
"@UiThread\n public synchronized void setPitchOffset(float pitchDegrees) {\n touchPitch = pitchDegrees;\n updatePitchMatrix();\n }",
"private Pitch(String note)\n {\n this.note = note;\n }",
"void move(float tpf);",
"public void setSoundPitch(float soundPitch) {\n _soundPitch = soundPitch;\n }",
"void editNote(String editor, int beatNum, String pitch, int octave)\n throws IllegalArgumentException;",
"public void setPitchShift(float shift) {\n\tthis.pitchShift = shift;\n }",
"public abstract void snapPoseToTileMid();",
"private void move (Point3D target){\n double xPos = drone.getTranslateX();\n double yPos = drone.getTranslateY();\n double zPos = drone.getTranslateZ();\n Point3D from = new Point3D(xPos, yPos, zPos); // get p1\n Point3D to = target;\n Duration duration = Duration.seconds(calculateDistance(from, to) / getSpeed());\n animate(createMoveAnimation(to, duration));\n\n }",
"public String getPitchAsString(){ return Integer.toString(this.pitch);}",
"public Note(int _pitch, int _duration, int _dynamic) {\n pitch = _pitch;\n duration = _duration;\n dynamic = _dynamic;\n tiedIn = false;\n tiedOut = false;\n displayDynamic = false;\n }",
"public void playSoundAt(IPos pos, String sound, float volume, float pitch);",
"private void moveToDestination() throws IOException {\n\t\tfloat x = dataInputStream.readFloat();\n\t\tfloat z = dataInputStream.readFloat();\n\t\t\n\t\tLCD.drawString(\"x: \"+x, 0, onLCDPositionY++);\n\t\tLCD.refresh();\n\t\tLCD.drawString(\"z: \"+z, 0, onLCDPositionY++);\n\t\tLCD.refresh();\n\t\t\n\t\tpose = poseProvider.getPose();\n\t\tPoint destination = new Point(x,z);\n\t\tfloat angle = pose.angleTo(destination);\n\t\t\n\t\t\n\t\tLCD.drawInt((int) pose.getHeading(), 0, onLCDPositionY++);\n\t\t\n\t\t\n\t\tclassPilot.rotate(angle - pose.getHeading());\n\t\tclassPilot.travel(pose.distanceTo(destination));\n\t}",
"public Note(int duration, int offset, int pitch, int channel, int velocity) {\n this.duration = duration;\n this.offset = offset;\n this.pitch = pitch;\n this.channel = channel;\n this.velocity = velocity;\n }",
"public void notePressed(int note) {\n seq.stop();\n seq.addNote(note, 200, 110);\n\n sequence = sequence.withNote(note, cursor);\n controller.setMidiSequence(sequence);\n\n if (cursor < 4) {\n cursor++;\n controller.setSelected(cursor);\n }\n }",
"public void move(Point p);",
"public float getPitch() {\n return pitch_;\n }",
"public float getPitch() {\n return pitch_;\n }",
"public float getPitch() {\n\treturn pitch;\n }",
"@Override\r\n\tpublic void setNote(long d, int hz) {\n\t\t\r\n\t}",
"public Note(Pitch pitch, int octave, int instrument) {\n if (octave < 0 || octave > 10) {\n throw new IllegalArgumentException(\"octave must be between 0 and 10 (inclusive)\");\n }\n\n this.pitch = pitch;\n this.octave = octave;\n this.instrument = instrument;\n }",
"@Override\n public void add(Note note) {\n if (this.music.containsKey(note.getStartBeat())) {\n // if the given note already has the same note in the music, replace it\n if (this.music.get(note.getStartBeat()).contains(note)) {\n int indexOfNote = this.music.get(note.getStartBeat()).indexOf(note);\n this.music.get(note.getStartBeat()).set(indexOfNote, note);\n } else {\n // add the note to the arrayList\n this.music.get(note.getStartBeat()).add(note);\n }\n\n // update the pitch value for the music\n if (note.getPitchValue() > this.getHighestPitchValue()) {\n this.highestPitchValue = note.getPitchValue();\n }\n // this.updatePitchValues();\n\n if (note.getPitchValue() < this.getLowestPitchValue()) {\n this.lowestPitchValue = note.getPitchValue();\n }\n }\n // if the arrayList does not exist in map, construct one and put it in the map\n else {\n ArrayList<Note> listOfNote = new ArrayList<>();\n listOfNote.add(note);\n this.music.put(note.getStartBeat(), listOfNote);\n\n // update the pitch value for the music\n if (note.getPitchValue() > this.getHighestPitchValue()) {\n this.highestPitchValue = note.getPitchValue();\n }\n if (note.getPitchValue() < this.getLowestPitchValue()) {\n this.lowestPitchValue = note.getPitchValue();\n }\n }\n\n\n }",
"private void analyzePitch(java.util.List<Double> samples) {\n \r\n if(samples.isEmpty()) return;\r\n if(samples.size()<=SAMPLE_RATE*MIN_SAMPLE_LENGTH_MS/1000) {\r\n //System.err.println(\"samples too short: \"+samples.size());\r\n return;\r\n }\r\n final Sound pitchSound=Sound.Sound_createSimple(\r\n 1, (double)samples.size() / SAMPLE_RATE, SAMPLE_RATE);\r\n for(int i=1; i < pitchSound.z[1].length; i++) {\r\n pitchSound.z[1][i]=samples.get(i - 1);\r\n }\r\n \r\n final SoundEditor editor=SoundEditor.SoundEditor_create(\"\", pitchSound);\r\n editor.pitch.floor=settings.floor;\r\n editor.pitch.ceiling=settings.ceiling;\r\n //editor.pitch.veryAccurate=1;\r\n \r\n if(DEBUG) System.err.print(\"analyzing \"+samples.size()+\" samples(\"\r\n +editor.pitch.floor+\"-\"+editor.pitch.ceiling+\")...\");\r\n final long start=System.nanoTime();\r\n try {\r\n editor.computePitch();\r\n } catch(Exception e) {\r\n e.printStackTrace();\r\n return;\r\n }\r\n if(DEBUG) System.err.println(\"complete in \"+(System.nanoTime()-start)/1000000.0+\"ms.\");\r\n \r\n \r\n //[ compute average pitch\r\n final java.util.List<Double> pitches=editor.getPitchesInFrequency();\r\n \r\n// diagram.clearData();\r\n// for(double s: pitches) {\r\n// diagram.addData((float)s); \r\n// }\r\n// diagram.setMaximum(500);\r\n// diagram.repaint();\r\n// \r\n double freqSum=0;\r\n int pitchCount=0;\r\n for(double p : pitches) {\r\n if(Double.isNaN(p) || p<=0) continue;\r\n freqSum+=p;\r\n pitchCount++;\r\n }\r\n final double averageFreq=freqSum/pitchCount; \r\n if(Double.isNaN(averageFreq)) {\r\n if(DEBUG) System.err.println(\"can't recognize.\");\r\n return;\r\n }\r\n//System.err.println(averageFreq); \r\n \r\n //[ compute length\r\n final double lengthMs=samples.size()*1000.0/SAMPLE_RATE;\r\n \r\n SwingUtilities.invokeLater(new Runnable() { //>>> not good\r\n public void run() {\r\n for(PitchListener lis: freqListener) {\r\n lis.gotPitch(averageFreq, lengthMs); //notify listeners\r\n }\r\n }\r\n });\r\n \r\n//System.err.println(\"add \"+ DumpReceiver.getKeyName((int) averagePitch));\r\n }",
"public void rotate(double yaw, double pitch)\n {\n this.rotate(yaw, pitch, 0);\n }",
"@Override\n public void setCurrentMeasure(int beat) {\n if (beat >= this.getHeadNotes().size() && beat != 0) {\n throw new IllegalArgumentException(\"Beat out of bound\");\n }\n this.currentMeasure = beat;\n }",
"public Builder setPitch(float value) {\n bitField0_ |= 0x00000040;\n pitch_ = value;\n onChanged();\n return this;\n }",
"public void move(double x, double y, double z) {\n\t\tPublisher move_base = new Publisher(\"/ariac_human/goal_position\", \"geometry_msgs/Point\", bridge);\t\n\t\tmove_base.publish(new Point(x,y,z));\n\t}",
"private synchronized void updatePose(Move event) {\n\t\tfloat angle = event.getAngleTurned() - angle0;\n\t\tfloat distance = event.getDistanceTraveled() - distance0;\n\t\tdouble dx = 0, dy = 0;\n\t\tdouble headingRad = (Math.toRadians(heading));\n\n\t\tif (event.getMoveType() == Move.MoveType.TRAVEL\n\t\t\t\t|| Math.abs(angle) < 0.2f) {\n\t\t\tdx = (distance) * (float) Math.cos(headingRad);\n\t\t\tdy = (distance) * (float) Math.sin(headingRad);\n\t\t} else if (event.getMoveType() == Move.MoveType.ARC) {\n\t\t\tdouble turnRad = Math.toRadians(angle);\n\t\t\tdouble radius = distance / turnRad;\n\t\t\tdy = radius\n\t\t\t\t\t* (Math.cos(headingRad) - Math.cos(headingRad + turnRad));\n\t\t\tdx = radius\n\t\t\t\t\t* (Math.sin(headingRad + turnRad) - Math.sin(headingRad));\n\t\t}\n\t\tx += dx;\n\t\ty += dy;\n\t\theading = normalize(heading + angle); // keep angle between -180 and 180\n\t\tangle0 = event.getAngleTurned();\n\t\tdistance0 = event.getDistanceTraveled();\n\t\tcurrent = !event.isMoving();\n\t}",
"@Override\r\n\tpublic void moveTo(float x, float y) {\n\t\t\r\n\t}",
"public SoundEffect adjust(float volume, float pitch) {\n \t\treturn new SoundEffect(this, volume, pitch);\n \t}",
"@Deprecated\r\n public static void move(Song song, int lineBegin, Note.Position positionBegin, int lineEnd, Note.Position positionEnd,\r\n int lineMoveTo) {\r\n// move\r\n// paste(song, lineMoveTo);\r\n }",
"void openNote(Note note, int position);",
"public void move()\n {\n double angle = Math.toRadians( getRotation() );\n int x = (int) Math.round(getX() + Math.cos(angle) * WALKING_SPEED);\n int y = (int) Math.round(getY() + Math.sin(angle) * WALKING_SPEED);\n setLocation(x, y);\n }",
"public float getPitch() {\n return pitch;\n }",
"public abstract void moveTo(double x, double y);",
"protected abstract void moveTo(final float x, final float y);",
"void setNote(int note) {\n\t\tthis.note = note;\n\t}",
"private void move() {\n\t\t\tx += Math.PI/12;\n\t\t\thead.locY = intensity * Math.cos(x) + centerY;\n\t\t\thead.yaw = spinYaw(head.yaw, 3f);\n\t\t\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, head.getId(), \n\t\t\t\tnew Location(player.getWorld(), head.locX, head.locY, head.locZ, head.yaw, 0));\n\t\t}",
"public void noteEvent(Note note)\r\n {\r\n byte noteValue = note.getValue();\r\n if (voiceValue != 9) // added D G Gray 5th Feb 2017\r\n {\r\n noteValue += this.interval;\r\n note.setValue(noteValue);\r\n\t }\r\n\r\n getReturnPattern().addElement(note);\r\n }",
"@Override\n public void addNote(int startTime, int duration, Pitch pitch, Octave octave) {\n List<Note> notes = new ArrayList<>();\n Note newNote = new SimpleNote(pitch, octave, startTime, duration);\n notes.add(newNote);\n\n if (this.notes.get(startTime) == null) {\n this.notes.put(startTime, notes);\n } else {\n List<Note> oldList = this.notes.remove(startTime);\n oldList.addAll(notes);\n this.notes.put(startTime, oldList);\n }\n\n }",
"void addNote(int x, int y);",
"public void movePiece(Coordinate from, Coordinate to);",
"public void setNote( final Double note )\r\n {\r\n this.note = note;\r\n }",
"public abstract void move(int direction, double speed);",
"@Override\n public void gyroPitch(int value, int timestamp) {\n }",
"public Builder setPitch(float value) {\n bitField0_ |= 0x00000010;\n pitch_ = value;\n onChanged();\n return this;\n }",
"public void move(String direction);",
"public void moveMouth()\n {\n mouthPosition++;\n\n if(mouthPosition > Integer.parseInt(\"5\"))\n {\n mouthPosition = 0;\n }\n }",
"private void procStopTrackingTouch(int userSelectedPosition) {\nlog_d(\"procStopTrackingTouch: \" + userSelectedPosition);\n float ratio = (float)userSelectedPosition/(float)MAX_PROGRESS;\n int position = (int)(ratio * mDuration);\n mAudioPlayer.seekTo(position);\n}",
"public Point2D translatePoint( Figure f, Point2D p, Point2D dir);",
"public void rotate(Point P, int rotation) {\n\n\n }",
"void captureHold(float[] point, float seconds, int sequenceNumber);",
"void moveTo(int dx, int dy);",
"public void setPitch(float hertz) {\n\tthis.pitch = hertz;\n }",
"void seekTo(int positionMs, boolean fromUser);",
"public static int pressNote(Map<String, Sound> instrument,\tString key) {\r\n\t\ttry{\r\n\t\tSound s = instrument.get(key);\t\t\r\n\t\tif(s!=null){\r\n\t\t\tif(s.isBuffering()) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\t\t\tif(s.getPlayState()!=1 ){\r\n\t\t\t\ts.play();\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse \r\n\t\t\treturn -1;\r\n\t\t}catch (Exception e) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\treturn 0;\r\n\t}",
"public void move(int mv){\n\t\t\tx+= mv;\n\t\t}",
"void move(double dx, double dy);",
"public int toMidi(Note n) {\n\n int normIndex = n.getNoteIndex() + numOffset + (7 * octaveOffset);\n int numOctaves = normIndex/7;\n\n int midiAddend = MIDI_OFFSETS[normIndex - (7*numOctaves)];\n\n return 38 + midiAddend + 12*numOctaves; // 37 is low D\n }",
"public abstract void moveShape(double lon, double lat);",
"public String getPitch()\n\t{\n\t\treturn pitch.getText();\n\t}",
"private void move() {\n\t\t\tangle += Math.PI/24;\n\t\n\t\t\tcow.locX = Math.sin(angle) * 2.5 + player.getLocation().getX();\n\t\t\tcow.locZ = Math.cos(angle) * 2.5 + player.getLocation().getZ();\n\t\t\t\n\t\t\tLocation loc = new Location(player.getWorld(), cow.locX, player.getLocation().getY() + 1.5, cow.locZ);\n\t\t\tloc.setDirection(player.getLocation().subtract(loc).toVector()); //Look at the player\n\t\t\t\n\t\t\tPacketHandler.teleportFakeEntity(player, cow.getId(), loc);\n\t\t}",
"public void move(int units)\n\t{\n\t\tsetPosition(position + units, true);\n\t}",
"public void move(int delta);",
"public void moveToPoint(double x, double y, double z);",
"public abstract void move(Point point);",
"public void move() {\n track += speed;\n speed += acceleration;\n if (speed <= 0) {\n speed =0;\n }\n if (speed >= MAX_SPEED) {\n speed = MAX_SPEED;\n }\n y -= dy;\n if (y <=MAX_TOP) {\n y = MAX_TOP;\n }\n if (y >=MAX_BOTTOM){\n y = MAX_BOTTOM;\n }\n if (layer2 - speed <= 0) {\n layer1 = 0;\n layer2 = 2400;\n } else {\n\n layer1 -= speed;\n layer2 -= speed;\n }\n }",
"private void playNotes()\n\t{\n\t\t//Update tracks when we can shift chords.\n\t\tChord curChord = ClearComposer.cc.getChord();\n\t\tif (index % ClearComposer.cc.getChordInterval() == 0 && (prevChord == null || prevChord != curChord))\n\t\t{\n\t\t\tprevChord = curChord;\n\t\t\ttracks.forEach(GraphicTrack::updateChord);\n\t\t\tClearComposer.cc.updateChordOutlines();\n\t\t}\n\n\t\tfor (GraphicTrack track : tracks)\n\t\t{\n\t\t\tint temp = track.playNote(index);\n\t\t\tif (temp != -1)\n\t\t\t\tMusicPlayer.playNote(temp);\n\t\t}\n\n\t\tindex++;\n\t\twhile (index >= ClearComposer.cc.getNumNotes())\n\t\t\tindex -= ClearComposer.cc.getNumNotes();\n\t}",
"public float getPitch() {\n return pitch_;\n }"
] | [
"0.62984276",
"0.61717147",
"0.6137337",
"0.59452015",
"0.5810464",
"0.57380265",
"0.5669959",
"0.5630887",
"0.5630887",
"0.56300044",
"0.56200767",
"0.55653864",
"0.55530125",
"0.5521208",
"0.5517529",
"0.5476305",
"0.5419262",
"0.5378096",
"0.53384936",
"0.5292437",
"0.52685046",
"0.52562857",
"0.51985914",
"0.5198051",
"0.51866066",
"0.517632",
"0.51514137",
"0.51401573",
"0.5106199",
"0.51002103",
"0.5085299",
"0.50851476",
"0.5075358",
"0.5052722",
"0.50506693",
"0.5039918",
"0.50332564",
"0.5023091",
"0.49664333",
"0.49492168",
"0.49358898",
"0.49340746",
"0.49234813",
"0.4890628",
"0.4870374",
"0.4862664",
"0.48620734",
"0.485705",
"0.485705",
"0.48537886",
"0.4850706",
"0.4848416",
"0.48438057",
"0.4838303",
"0.48317492",
"0.48266062",
"0.4817048",
"0.48140353",
"0.48042104",
"0.4802247",
"0.4801501",
"0.47968212",
"0.47925633",
"0.47862127",
"0.478457",
"0.47771776",
"0.47752103",
"0.4774514",
"0.47705507",
"0.47681326",
"0.47673258",
"0.4760724",
"0.47604686",
"0.47565913",
"0.47519845",
"0.4749398",
"0.47463512",
"0.47407064",
"0.4740495",
"0.47358835",
"0.47358462",
"0.4723129",
"0.47208703",
"0.47202215",
"0.47183472",
"0.4715793",
"0.47100037",
"0.47091937",
"0.47090822",
"0.46870753",
"0.4684406",
"0.4676121",
"0.46745694",
"0.46699607",
"0.46690893",
"0.46668318",
"0.4665841",
"0.46649083",
"0.4664618",
"0.4661449"
] | 0.7068235 | 0 |
Get the highest note in this piece. | @Override
public Note getHighest() {
if (this.sheet.isEmpty()) {
throw new IllegalArgumentException("No note is added.");
}
Note currentHigh = new Note(this.high.getDuration(), this.high.getOctave
(), this.high.getStartMeasure(), this.high.getPitch(), this.high
.getIsHead(), this.high.getInstrument(), this.high.getVolume());
for (int i = 0; i < this.sheet.size(); i++) {
for (Note n : this.sheet.get(i)) {
if (currentHigh.compareTo(n) == -1) {
currentHigh = n;
}
}
}
return currentHigh;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Note getHighestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note highestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.ishigher(highestNote)) {\n highestNote = currentNote;\n }\n }\n if (highestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return highestNote;\n }",
"int maxNoteValue();",
"public String maximum(){\n\t\treturn queueArray[1][1];\n\t}",
"public String extractMax(){\n\t\tString maxValue = queueArray[1][1];\n\t\t\n\t\tremove();\n\t\tmove();\n\t\t\n\t\treturn maxValue;\n\t}",
"public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}",
"@Override\n public int getFinalBeat() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n int farthestBeat = 0;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n int currentEnd = currentNote.getBeat() + currentNote.getDuration();\n\n if (currentEnd > farthestBeat) {\n farthestBeat = currentEnd;\n }\n }\n return farthestBeat;\n }",
"public int getHighestVariable() {\n\t\treturn HighestVariable;\n\t}",
"@Override\n public int getDuration() {\n if (this.music.size() == 0) {\n return 0;\n }\n else {\n int highestDuration = 0;\n ArrayList<Note> allNotes = this.getAllNotes();\n // find the note that has the longest length in the last arrayList\n for (Note note : allNotes) {\n if (note.getEndBeat() > highestDuration) {\n highestDuration = note.getEndBeat();\n }\n }\n return highestDuration;\n }\n }",
"public Item max() {\n return heap[0];\n }",
"public String max()\r\n\t {\r\n\t\t if(this.max != null)\r\n\t\t {\r\n\t\t\t return this.max.getValue(); \r\n\t\t }\r\n\t\t return null;\r\n\t }",
"public String getMax() { \n\t\treturn getMaxElement().getValue();\n\t}",
"public Number getMaximum() {\n return ((ADocument) getDocument()).max;\n }",
"public Disc top()\n\t{\n\t\tint poleSize = pole.size();\n\n\t\t// If the pole is empty, return nothing\n\t\tif(poleSize == 0)\n\t\t\treturn null;\n\n\t\t// Otherwise return the top disc\n\t\treturn pole.get(poleSize - 1);\n\t}",
"public String getHighestInterest(){\n if(!interestsNotFilled()) {\n Object highestInterest = interestMap.keySet().toArray()[0];\n for (String interest : interestMap.keySet()) {\n float score = interestMap.get(interest);\n if (score > interestMap.get(highestInterest)) {\n highestInterest = interest;\n }\n }\n return (String) highestInterest;\n }else{\n return null;\n }\n }",
"public int getbestline() {\n\t\tint i=0;\n\t\tint biggest=0;\n\t\tint keep_track=0;\n\t\twhile(i < amount.length) {\n\t\t\tif(Faucets.amount[i] > biggest) {\n\t\t\t\tbiggest = Faucets.amount[i];\n\t\t\t\tkeep_track = i;\n\t\t\t}\n\t\t\ti+=1;\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Keep_Track = \\\"\" + keep_track + \"\\\"\");\n\t\treturn keep_track;\n\t\t\n\t}",
"@Override\n public Note getLowestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note lowestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.isLower(lowestNote)) {\n lowestNote = currentNote;\n }\n }\n if (lowestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return lowestNote;\n }",
"public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }",
"public float getmaxP() {\n Reading maxPressureReading = null;\n float maxPressure = 0;\n if (readings.size() >= 1) {\n maxPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure > maxPressure) {\n maxPressure = readings.get(i).pressure;\n }\n }\n } else {\n maxPressure = 0;\n }\n return maxPressure;\n }",
"public final int getMinor() {\n return get(1);\n }",
"protected String getMaximum()\n {\n return maximum;\n }",
"public int theHighest() {\r\n\t\tint highest = 0;\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\tif(game[i][j].getValue() > highest)\r\n\t\t\t\t\thighest = game[i][j].getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn highest;\r\n\t}",
"public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}",
"public Cell highestCell() {\n for (Cell c : this.board) {\n if (c.height == ForbiddenIslandWorld.ISLAND_SIZE / 2 && !c.isCoastCell()) {\n return c;\n }\n }\n return highestCell();\n }",
"public Point getMax () {\r\n\r\n\treturn getB();\r\n }",
"@JsonIgnore\r\n public String getMax() {\r\n return OptionalNullable.getFrom(max);\r\n }",
"public int top() {\n\t\treturn count == 0? -1 : st[count-1];\r\n\t}",
"public String top(){\n if(!(pilha.size() == 0)){\n return pilha.get(pilha.size()-1);\n }else{\n return null;\n }\n }",
"private int getHighestLevelFromProperties(){\n GameModel gameModel = GameModel.getInstance();\n int highestReachedLevel;\n int level = gameModel.getCurrentLevelIndex();\n String highest = properties.getProperty(\"highestReachedLevel\");\n if (highest!=null){ //if property not saved\n highestReachedLevel = Integer.parseInt(highest);\n } else {\n highestReachedLevel = level;\n }\n return highestReachedLevel;\n }",
"public int getMax(){\n return tab[rangMax()];\n }",
"public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}",
"public String getMax() {\n return max;\n }",
"public int getMax()\n {\n int max = data.get(0).getX();\n\n for(int i = 0; i < data.size(); i++)\n {\n if (data.get(i).getX() > max)\n {\n max = data.get(i).getX();\n }\n }\n\n\n return max;\n }",
"public Note getNote() {\n\t \n\t //returns the objected stored in the note field\n\t return this.note;\n }",
"public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}",
"public int getLowestOctaveMidiNumber() {\n\t\treturn noteName.getLowestOctaveMidiNumber();\n\t}",
"public String max()// return the value of the maximum key in the tree\r\n {\r\n\t if(empty()) {\r\n\t return null;\r\n\t }\r\n\t WAVLNode x = root;\r\n while(x.right!=EXT_NODE) {\r\n \tx=x.right;\r\n }\r\n return x.info;\r\n }",
"public int getMinor() {\n return minor;\n }",
"public Track printLongestTrack()\r\n {\r\n\t// Initialise variables to store longest Track and its Duration\r\n\tTrack longestTrack = null;\r\n\tDuration maxDuration = new Duration();\r\n\r\n\t// Iterate over albums in the collection getting the longest track in\r\n\t// each\r\n\tfor (Album album : this.getAlbums())\r\n\t{\r\n\t Track currentTrack = album.getLongestTrack();\r\n\t Duration currentDuration = currentTrack.getTrackDuration();\r\n\r\n\t // Compare duration of longest track in this album with max duration \r\n\t // found so far. If it is longer, store the track and its duration.\r\n\t if (currentDuration.compareTo(maxDuration) > 0)\r\n\t {\r\n\t\tlongestTrack = currentTrack;\r\n\t\tmaxDuration = currentDuration;\r\n\t }\r\n\t}\r\n\r\n\t// Display the album with max track count\r\n\tString outputString = \"Track in collection with longest duration:\\r\\n\";\r\n\tSystem.out.print(outputString);\r\n\t// Print details of last (longest) track in the sorted track list\r\n\tSystem.out.println(longestTrack);\r\n\treturn longestTrack;\r\n }",
"int getTonicNote(){\n String lastnote=\"\";\n int result;\n lastnote += Strinput.toCharArray()[Strinput.length()-4];\n lastnote += Strinput.toCharArray()[Strinput.length()-3];\n result = Integer.parseInt(lastnote);\n if(result<72){\n return result-60;\n }else{\n return result-12-60;\n }\n }",
"public int getMax() {\n\t\treturn getMax(0.0f);\n\t}",
"public int maximum() {\n \n if (xft.size() == 0) {\n return -1;\n }\n \n Integer maxRepr = xft.maximum();\n \n assert(maxRepr != null);\n \n int index = maxRepr.intValue()/binSz;\n \n TreeMap<Integer, Integer> map = getTreeMap(index);\n \n assert(map != null);\n \n Entry<Integer, Integer> lastItem = map.lastEntry();\n \n assert(lastItem != null);\n \n return lastItem.getKey();\n }",
"public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}",
"public T getLast() {\n return this.getHelper(this.indexCorrespondingToTheLatestElement).data;\n }",
"public int extractMaximum() {\n \n int max = maximum();\n\n if (max == -1) {\n assert(xft.size() == 0);\n return -1;\n }\n \n remove(max);\n \n return max;\n }",
"public int getMinor() {\r\n\t\treturn minor;\r\n\t}",
"public long getHighestPrimeNr(){\n Cursor cursor = database.query(PrimeNrBaseHelper.TABLE, new String[] {\"MAX(\"+PrimeNrBaseHelper.PRIME_NR+\") AS MAX\"},null,null,null\n ,null,null);\n\n long pnr = 0;\n\n try {\n cursor.moveToFirst();\n pnr = cursor.getLong(cursor.getColumnIndex(\"MAX\"));\n } finally {\n cursor.close();\n }\n\n return (pnr > 0) ? pnr : SMALLEST_PRIME_NR;\n }",
"public Integer largest() {\n if (root != null) {\n return root.largest();\n }\n return null;\n }",
"public long getMaximum() {\n\t\treturn this._max;\n\t}",
"protected int getHighestInnovation() {\n\t\treturn highest;\n\t}",
"public float getMax()\n {\n parse_text();\n return max;\n }",
"int maxBeatNum();",
"public long getMax() {\n return m_Max;\n }",
"@Override\n public Note getLowest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentLow = new Note(this.low.getDuration(), this.low.getOctave(),\n this.low.getStartMeasure(), this.low.getPitch(), this.low\n .getIsHead(), this.low.getInstrument(), this.low.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentLow.compareTo(n) == 1) {\n currentLow = n;\n }\n }\n }\n return currentLow;\n }",
"public int getLatestPressure() {\n int pressure = 0;\n if (readings.size() > 0) {\n pressure = readings.get(readings.size() - 1).pressure;\n }\n return pressure;\n }",
"public String getHighestRank() {\n try {\n FileInputStream fis = new FileInputStream(this.databaseName + \".config\");\n\n // Reading in the number of normal records from the .config file starting from offset 104 bytes (where the number for HIGHEST-RANK begins)\n fis.getChannel().position(104);\n byte[] highestRank = new byte[5];\n \n fis.read(highestRank, 0, 5);\n fis.close();\n return new String(highestRank).trim();\n } catch (IOException ex) {\n ex.printStackTrace();\n return \"Error\";\n }\n }",
"public double max() {\n\t\tif (count() > 0) {\n\t\t\treturn _max.get();\n\t\t}\n\t\treturn 0.0;\n\t}",
"public java.lang.Integer getHighestPeriodNum() {\n return highestPeriodNum;\n }",
"public final int getHigh() {\n\treturn(this.high);\n }",
"public int minor() {\n\t\treturn identifiers[MINOR_INDEX];\n\t}",
"public Individual getWorst() {\n\t\treturn individuals[individuals.length-1];\n\t}",
"public int getHighestMethod() {\n\t\treturn HighestMethod;\n\t}",
"public int getHigh() {\n\t\t\treturn high;\n\t\t}",
"public int getMax()\n {\n return 0;\n }",
"public String max() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode max = (AVLNode) this.root;\n\t\twhile (max.getRight().getHeight() != -1) {\n\t\t\tmax = (AVLNode) max.getRight();\n\t\t}\n\t\treturn max.getValue();\n\t}",
"public Quantity<Q> getMax() {\n return max;\n }",
"public int top() {\n\t\treturn list.get(list.size() - 1);\n\t}",
"public int getMaximum() {\n return this.iMaximum;\n }",
"public int getMaximum() {\n \tcheckWidget();\n \treturn maximum;\n }",
"public int getHigh() {\n\t\treturn high;\n\t}",
"public int getMax() {\n return max;\n }",
"public int getMax() {\n return max;\n }",
"public int getMax() {\n return max;\n }",
"public int getMaximun(){\n int highGrade = grades[0]; //assumi que grades[0] é a maior nota\n //faz o loop pelo array de notas\n for(int grade: grades){\n //se a nota for maior que highGrade. atribui essa nota a highGrade\n if(grade > highGrade){\n highGrade = grade; //nota mais alta\n }\n }\n \n return highGrade;\n }",
"public int top() {\n Integer poll = q1.peek();\n return poll == null ? -1 : poll;\n }",
"public int getHigh()\t\n\t{\t//start of getHigh mehtod\n\t\treturn HIGH_NUM;\n\t}",
"public Contenedor getContenedorMaximo()\n {\n Contenedor maxCont = null;\n int maxPeso ;\n\n maxPeso = 0;\n\n for (Contenedor c : this.losContenedores){\n if (c.peso > maxPeso)\n {\n maxPeso = c.peso;\n maxCont = c;\n }\n }\n\n return maxCont;\n }",
"public int top() {\n return queue.peekLast();\n }",
"public int getMaximum() {\r\n return max;\r\n }",
"public long getMaxTime()\n {\n return times[times.length - 1];\n }",
"public Integer max() {\n return this.max;\n }",
"public HighScore getMaxScore(){\n HighScore hs;\n db = helper.getReadableDatabase();\n Cursor scoreCursor = db.query(SQLHelper.DB_TABLE_SCORES, SCORES_COLUMNS, null, null, null, null, SQLHelper.KEY_SCORE + \" DESC\", null);\n scoreCursor.moveToFirst();\n if(scoreCursor.getCount() == 0){\n hs = null;\n }\n else{\n hs = new HighScore(scoreCursor.getString(0), scoreCursor.getLong(1),\n scoreCursor.getLong(2), scoreCursor.getString(3), scoreCursor.getString(4));\n scoreCursor.moveToNext();\n if (scoreCursor != null && !scoreCursor.isClosed()) { // Close cursor\n scoreCursor.close();\n }\n }\n db.close();\n return hs; // Return max high score\n }",
"public java.math.BigDecimal getHigh() {\n return high;\n }",
"public Long getMaximum() {\r\n\t\treturn maximum;\r\n\t}",
"@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }",
"public double max() {\n/* 323 */ Preconditions.checkState((this.count != 0L));\n/* 324 */ return this.max;\n/* */ }",
"public int top() {\n return queue.getLast();\n }",
"public final int getLatestPostNumber() {\n\t\treturn this.latestPostNumber;\n\t}",
"public int largestEntry() throws SQLException {\r\n String statement = \"SELECT Appointment_ID FROM appointments ORDER BY Appointment_ID DESC LIMIT 0,1\";\r\n ResultSet rs = conn.prepareStatement(statement).executeQuery();\r\n rs.next();\r\n return rs.getInt(\"Appointment_ID\");\r\n }",
"public Number getMaximumNumber() {\n/* 221 */ if (this.maxObject == null) {\n/* 222 */ this.maxObject = new Long(this.max);\n/* */ }\n/* 224 */ return this.maxObject;\n/* */ }",
"public int getMax() {\n\t\treturn max;\n\t}",
"public int getMax() {\n\t\treturn max;\n\t}",
"@Override\n\tpublic Food NnmMax() {\n\t\treturn fb.NnmMax();\n\t}",
"public int getHighestId() {\n final SQLiteStatement statement = db.compileStatement(\"SELECT MAX(_id) FROM Games\");\n return (int) statement.simpleQueryForLong();\n }",
"public int getHighestLevel()\n\t{\n\t\tint h = 0;\n\t\tfor(int i = 0; i < m_pokemon.length; i++)\n\t\t\tif(m_pokemon[i] != null && h < m_pokemon[i].getLevel())\n\t\t\t\th = m_pokemon[i].getLevel();\n\t\treturn h;\n\t}",
"public String top() {\n return queue.size() == 0 ? null : queue.get(0);\n }",
"public int maxElement() {\n\t\tNode max=root;\n\t\tint out=-1;\n\t\twhile(max!=null) {\n\t\t\tout=max.data;\n\t\t\tmax=max.right;\n\t\t}\n\t\treturn out;\n\t}",
"public Book mostExpensive() {\n //create variable that stores the book thats most expensive\n Book mostExpensive = bookList.get(0);//most expensive book is set as the first in the array\n for (Book book : bookList) {\n if(book.getPrice() > mostExpensive.getPrice()){\n mostExpensive = book;\n }\n } return mostExpensive;//returns only one (theFIRST) most expensive in the array if tehre are several with the same price\n }",
"int getMaximum();",
"public Long getMaximumquantity() {\r\n return maximumquantity;\r\n }",
"public int getMax()\n\t{\n\t\treturn max;\n\t}"
] | [
"0.82699794",
"0.7370009",
"0.65558267",
"0.64347893",
"0.642901",
"0.6404368",
"0.6368721",
"0.63021",
"0.62717444",
"0.61286974",
"0.6106231",
"0.60994023",
"0.6099386",
"0.60644066",
"0.6045087",
"0.60243165",
"0.5976007",
"0.5966846",
"0.5959967",
"0.59515166",
"0.59476274",
"0.5944413",
"0.59428525",
"0.59051865",
"0.5901885",
"0.58738846",
"0.5871513",
"0.58696765",
"0.5857867",
"0.5849328",
"0.58306116",
"0.58219177",
"0.5812742",
"0.581082",
"0.58063024",
"0.5804361",
"0.57931983",
"0.5787872",
"0.5772013",
"0.57662606",
"0.5763634",
"0.57620186",
"0.5760969",
"0.57570726",
"0.5756374",
"0.5752047",
"0.5744885",
"0.57440114",
"0.57386595",
"0.5735866",
"0.5732841",
"0.57320964",
"0.5726851",
"0.5724529",
"0.57164484",
"0.5713314",
"0.56879365",
"0.5678346",
"0.5669843",
"0.5669375",
"0.56666285",
"0.56664497",
"0.56657434",
"0.56651926",
"0.56621295",
"0.5656906",
"0.5656149",
"0.56428003",
"0.5640665",
"0.5637554",
"0.5637554",
"0.5637554",
"0.5630989",
"0.56253314",
"0.56234515",
"0.5621336",
"0.5619231",
"0.56128514",
"0.56110483",
"0.5606543",
"0.5601736",
"0.5596573",
"0.5596416",
"0.55909234",
"0.5586169",
"0.5583571",
"0.5582178",
"0.5577282",
"0.5574804",
"0.55715775",
"0.55715775",
"0.55694366",
"0.5568364",
"0.5555611",
"0.5553631",
"0.5550725",
"0.554895",
"0.554889",
"0.554849",
"0.55471915"
] | 0.80033886 | 1 |
Get the lowest note in this piece. | @Override
public Note getLowest() {
if (this.sheet.isEmpty()) {
throw new IllegalArgumentException("No note is added.");
}
Note currentLow = new Note(this.low.getDuration(), this.low.getOctave(),
this.low.getStartMeasure(), this.low.getPitch(), this.low
.getIsHead(), this.low.getInstrument(), this.low.getVolume());
for (int i = 0; i < this.sheet.size(); i++) {
for (Note n : this.sheet.get(i)) {
if (currentLow.compareTo(n) == 1) {
currentLow = n;
}
}
}
return currentLow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Note getLowestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note lowestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.isLower(lowestNote)) {\n lowestNote = currentNote;\n }\n }\n if (lowestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return lowestNote;\n }",
"int minNoteValue();",
"public int getLowestOctaveMidiNumber() {\n\t\treturn noteName.getLowestOctaveMidiNumber();\n\t}",
"public int getMin() {\n\t\t\treturn harr[0];\n\t\t}",
"public Number getMinimum() {\n return ((ADocument) getDocument()).min;\n }",
"public E findMin() {\n // TODO: YOUR CODE HERE\n return getElement(1);\n }",
"@Override\n public Note getHighestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note highestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.ishigher(highestNote)) {\n highestNote = currentNote;\n }\n }\n if (highestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return highestNote;\n }",
"public E minimum() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn heap.get(0);\n\t}",
"public E minimum() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse\n\t\t\treturn heap.get(0);\n\t}",
"public int findMin() {\r\n\t\treturn this.min.value;\r\n\t}",
"public E findMin() throws NoSuchElementException {\n\t\treturn minimums.peek();\n\t}",
"public int getMin() {\n\t\treturn getMin(0.0f);\n\t}",
"public String min()\r\n\t {\r\n\t\t if(this.min != null)\r\n\t\t {\r\n\t\t\t return this.min.getValue(); \r\n\t\t }\r\n\t\t return null;\r\n\t }",
"public long min() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] < result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find min of empty array\");\n\t\t}\n\t}",
"public float getminP() {\n Reading minPressureReading = null;\n float minPressure = 0;\n if (readings.size() >= 1) {\n minPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure < minPressure) {\n minPressure = readings.get(i).pressure;\n }\n }\n } else {\n minPressure = 0;\n }\n return minPressure;\n }",
"protected String getMinimum()\n {\n return minimum;\n }",
"int getMin() {\n\t\tif (stack.size() > 0) {\n\t\t\treturn minEle;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}",
"public Integer getMin() { \n\t\treturn getMinElement().getValue();\n\t}",
"private double getLowest()\n {\n if (currentSize == 0)\n {\n return 0;\n }\n else\n {\n double lowest = scores[0];\n for (int i = 1; i < currentSize; i++)\n {\n if (scores[i] < lowest)\n {\n scores[i] = lowest;\n }\n }\n return lowest;\n }\n }",
"public int findMin() {\n\t\tint min = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ((int)data.get(count) < min)\n\t\t\t\tmin = (int)data.get(count);\n\t\treturn min;\n\t}",
"public long getMinimum() {\n\t\treturn this._min;\n\t}",
"public int getMin()\n\t{\n\t\treturn min;\n\t}",
"public float getMin()\n {\n parse_text(); \n return min;\n }",
"public int getMin() {\n\t\treturn min;\n\t}",
"public double min() {\n\t\tif (count() > 0) {\n\t\t\treturn _min.get();\n\t\t}\n\t\treturn 0.0;\n\t}",
"public String min() // return the value of the minimum key in the tree\r\n {\r\n\t \tif(empty()) {\r\n\t \t\treturn null;\r\n\t \t}\r\n return min(root).info;\r\n }",
"@Override\n public Note getHighest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentHigh = new Note(this.high.getDuration(), this.high.getOctave\n (), this.high.getStartMeasure(), this.high.getPitch(), this.high\n .getIsHead(), this.high.getInstrument(), this.high.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentHigh.compareTo(n) == -1) {\n currentHigh = n;\n }\n }\n }\n return currentHigh;\n }",
"public E minimum() {\r\n\t\treturn objectHeap[0];\r\n\t}",
"public Point getMin () {\r\n\r\n\treturn getA();\r\n }",
"public Integer getMin() {\n\t\tif (this.Minimum==null)\n\t\t{\n\t\t\tcalcMinMax();\n\t\t}\n\t\treturn this.Minimum;\n\t}",
"public T minimum() {\n return min.key;\n }",
"public E returnMinElement(){\r\n if (theData.size() <= 0) return null;\r\n\r\n E min = theData.get(0).getData();\r\n\r\n for (int i = 0; i< theData.size() ; i++){\r\n if (min.compareTo(theData.get(i).getData()) > 0 ){\r\n min = theData.get(i).getData();\r\n }\r\n }\r\n return min;\r\n }",
"public int getMin() {\n return min;\n }",
"public int getMin() {\n return min;\n }",
"public int getMin() {\n return min;\n }",
"public E extractMin() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tE minVal = heap.get(0);\n\t\t\theap.set(0, heap.get(heap.size() - 1)); // Move last to position 0\n\t\t\theap.remove(heap.size() - 1);\n\t\t\tminHeapify(heap, 0);\n\t\t\treturn minVal;\n\t\t}\n\t}",
"protected final int getMin() {\n\treturn(this.min);\n }",
"public E extractMin() {\n\t\tif (heap.size() <= 0)\n\t\t\treturn null;\n\t\telse {\n\t\t\tE minVal = heap.get(0);\n\t\t\theap.set(0, heap.get(heap.size()-1)); // Move last to position 0\n\t\t\theap.remove(heap.size()-1);\n\t\t\tminHeapify(heap, 0);\n\t\t\treturn minVal;\n\t\t}\n\t}",
"public int findMin()\n {\n if(isEmpty())\n {\n throw new NoSuchElementException(\"Underflow Exeption\");\n }\n return heap[0];\n }",
"private Point lowestFInOpen() {\n\t\tPoint lowestP = null;\n\t\tfor (Point p : openset) {\n\t\t\tif (lowestP == null) \n\t\t\t\tlowestP = p;\n\t\t\telse if (fscores.get(p) < fscores.get(lowestP))\n\t\t\t\tlowestP = p;\n\t\t}\n\t\treturn lowestP;\n\t}",
"public Integer smallest() {\n if (root != null) {\n return root.smallest();\n }\n return null;\n }",
"public int getMinimum() {\r\n return min;\r\n }",
"public int getMinimum() {\n \tcheckWidget();\n \treturn minimum;\n }",
"public String getMin() {\n return min;\n }",
"public Integer min() {\n return this.min;\n }",
"public Long getMinimum() {\r\n\t\treturn minimum;\r\n\t}",
"public Node getMin() {\n return getMin(root);\n }",
"public int getMin(){\n\t\treturn min;\n\t}",
"public int minimum() {\n \n if (xft.size() == 0) {\n return -1;\n }\n \n Integer repr = xft.minimum();\n \n assert(repr != null);\n \n return repr.intValue();\n }",
"public DHeap_Item Get_Min()\n {\n\treturn array[0];\n }",
"public double min() {\n/* 305 */ Preconditions.checkState((this.count != 0L));\n/* 306 */ return this.min;\n/* */ }",
"public String min() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min.getValue();\n\t}",
"public Quantity<Q> getMin(Unit<Q> unit) {\n return min.to(unit);\n }",
"public T getMin() {\n\t\tif (heapSize > 0) {\n\t\t\treturn lstEle.get(0);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public PropertyCard findCheapest() {\r\n\t\t\r\n\t\t\r\n\t\tif(this.properties.size() == 0) {\r\n\t\t\t//System.out.println(\"returning null\");\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tPropertyCard lowestCard = this.properties.get(0).getLowest();\r\n\t\tint lowest = lowestCard.getValue();\r\n\t\t\r\n\t\tfor(CardStack c: this.properties) {\r\n\t\t\tif(c.getLowest().getValue() < lowest) {\r\n\t\t\t\tlowestCard = c.getLowest();\r\n\t\t\t\tlowest = c.getLowest().getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn lowestCard;\r\n\t}",
"public int getMin() {\n int length = minList.size();\n int returnValue = 0;\n if (length > 0) {\n returnValue = minList.get(length - 1);\n }\n return returnValue;\n \n }",
"public byte get_min() {\n return (byte)getSIntBEElement(offsetBits_min(), 8);\n }",
"public T findLowest(){\n T lowest = array[0]; \n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()<lowest.doubleValue())\n {\n lowest = array[i]; \n } \n }\n return lowest;\n }",
"public AnyType findMin() {\n\t\treturn elementAt(findMin(root));\n\t}",
"public Node min() {\n\t\tNode x = root;\n\t\tif (x == null) return null;\n\t\twhile (x.getLeft() != null)\n\t\t\tx = x.getLeft();\n\t\treturn x;\n\t}",
"@JsonIgnore\r\n public String getMin() {\r\n return OptionalNullable.getFrom(min);\r\n }",
"public final double getMin() {\r\n\t\treturn this.m_min;\r\n\t}",
"public long getMinTime()\n {\n return times[0];\n }",
"public T getMin()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\treturn array[0];\n\t}",
"public float getMinX(){\n return points.get(0).getX();\n }",
"public double min(){\r\n\t\t//variable for min val\r\n\t\tdouble min = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the minimum is more than the current index, change min to that value\r\n\t\t\tif (min > this.data[i]){\r\n\t\t\t\tmin = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the minimum val\r\n\t\treturn min;\r\n\t}",
"public int extractMinimum() {\n \n //O(log_2(w))\n int min = minimum();\n\n if (min == -1) {\n assert(xft.size() == 0);\n return -1;\n }\n \n remove(min);\n \n return min;\n }",
"public double getMinS() {\n return u[0];\n }",
"public double getMinimum() {\n return (min);\n }",
"public Point min() {\n\t\tif (heapSize >= 0)\n\t\t\treturn new Point(heapArr[0]);\n\t\telse\n\t\t\tthrow new RuntimeException(\"MinHeap is empty!\");\n\t}",
"public int heapMin() {\n return array[0];\n }",
"public Score lowestScore()\n {\n Score lowest = new Score();\n int smallSoFar = 201;\n if(scores[0] == null)\n {\n return null;\n }\n else\n {\n for(int i = 0; i < scores.length; i++)\n {\n lowest = scores[0];\n if(scores[i] == null)\n {\n break;\n }\n if(scores[i].getScore() < lowest.getScore())\n {\n lowest = scores[i];\n }\n \n }\n return lowest;\n } \n }",
"protected ValuePosition getMinimum() {\n\t\t// Calcule la position et la durée d'exécution de la requête la plus courte dans le tableau des requêtes\n\t\tValuePosition minimum = new ValuePosition();\n\t\tminimum.position = 0;\n\t\tfor(int pos=0; pos<requests.length; pos++) {\n\t\t\tRequest request = requests[pos];\n\t\t\tif(request == null) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(minimum.value == null || request.getElapsedTime() < minimum.value) {\n\t\t\t\tminimum.position = pos;\n\t\t\t\tminimum.value = request.getElapsedTime();\n\t\t\t}\n\t\t}\n\t\treturn minimum;\n\t}",
"public E findMin() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a left child.\n // temp is then assigned to the next node in the left child and will return\n // the node with the minimum value in the BST. The node that does not have a left\n // child will be the minimum value.\n while(temp.left != null){\n temp = temp.left;\n }\n return temp.getInfo();\n }",
"public int getLow() {\n\t\t\treturn low;\n\t\t}",
"public Disc top()\n\t{\n\t\tint poleSize = pole.size();\n\n\t\t// If the pole is empty, return nothing\n\t\tif(poleSize == 0)\n\t\t\treturn null;\n\n\t\t// Otherwise return the top disc\n\t\treturn pole.get(poleSize - 1);\n\t}",
"public int extractMinimum() {\n if (size == 0) {\n return Integer.MIN_VALUE;\n }\n if (size == 1) {\n size--;\n return arr[0];\n }\n\n MathUtil.swap(arr, 0, size - 1);\n size--;\n minHeapify(0);\n return arr[size];\n }",
"public Quantity<Q> getMin() {\n return min;\n }",
"@Override\n public Long getMin() {\n return min;\n }",
"Coordinate getMinX();",
"private float getMinX(HomePieceOfFurniture piece) {\n float [][] points = piece.getPoints();\n float minX = Float.POSITIVE_INFINITY;\n for (float [] point : points) {\n minX = Math.min(minX, point [0]);\n } \n return minX;\n }",
"public final int getLow() {\n\treturn(this.low);\n }",
"public TreeNode smallest() {\n\t\tif(root == null) {\n\t\t\treturn null;\n\t\t} else {\n\t\t\tTreeNode current = root; \n\t\t\twhile(current.getLeftChild() != null) {\n\t\t\t\tcurrent = current.getLeftChild();\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t}",
"public int getMinInSingleRow() {\n return minInSingleRow;\n }",
"public E findMin(){\n if(!isEmpty()){\n AvlNode<E> node = findMin(root);\n return (E)node.value;\n } else {\n return null;\n }\n }",
"public int getLow() {\n\t\treturn low;\n\t}",
"private Node getLowestNode(Set<Node> openSet)\r\n {\r\n // find the node with the least f\r\n double minF = Double.MAX_VALUE;\r\n Node[] openArray = openSet.toArray(new Node[0]);\r\n\r\n Node q = null;\r\n for (int i = 0; i < openArray.length; ++i)\r\n {\r\n if (openArray[i].f < minF) \r\n {\r\n minF = openArray[i].f;\r\n q = openArray[i];\r\n }\r\n }\r\n return q;\r\n }",
"public Double getMinimum() {\n\t\treturn minimum;\n\t}",
"public static int getNote(MidiMessage mes){\r\n\t\tif (!(mes instanceof ShortMessage))\r\n\t\t\treturn 0;\r\n\t\tShortMessage mes2 = (ShortMessage) mes;\r\n\t\tif (mes2.getCommand() != ShortMessage.NOTE_ON)\r\n\t\t\treturn 0;\t\r\n\t\tif (mes2.getData2() ==0) return -mes2.getData1();\r\n\t\treturn mes2.getData1();\r\n\t}",
"public float getminTemp() {\n Reading minTempReading = null;\n float minTemp = 0;\n if (readings.size() >= 1) {\n minTemp = readings.get(0).temperature;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).temperature < minTemp) {\n minTemp = readings.get(i).temperature;\n }\n }\n } else {\n minTemp = 0;\n }\n return minTemp;\n }",
"public node_data heapExtractMin(){\n\t\tdouble min = _positiveInfinity;\n\t\tnode_data v=null;\n\t\tif (!isEmpty()){\n\t\t\tv = _a[0];\n\t\t\tmin = v.getWeight();\n\t\t\t_a[0]=_a[_size-1];\n\t\t\t_size = _size-1;\n\t\t\tminHeapify(0, _size);\n\t\t}\n\t\treturn v;\n\t}",
"public int getMin() {\r\n // get root\r\n RedBlackTree.Node<Grade> min = rbt.root;\r\n // loop to left of tree\r\n while (min.leftChild != null) {\r\n min = min.leftChild;\r\n }\r\n\r\n return min.data.getGrade();\r\n }",
"public Edge extractMin() {\n return Q.remove(0);\n }",
"public Point ExtractMin() {\n\t\tif (heapSize < 0)\n\t\t\tthrow new RuntimeException(\"MinHeap underflow!\");\n\t\tPoint min = new Point(heapArr[0]);\n\t\theapArr[0] = new Point(heapArr[heapSize - 1]);\n\t\theapSize = heapSize - 1;\n\t\tminHeapify(0);\n\t\treturn min;\n\n\t}",
"public AVLNode findMin() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode min = (AVLNode) this.root;\n\t\twhile (min.getLeft().getHeight() != -1) {\n\t\t\tmin = (AVLNode) min.getLeft();\n\t\t}\n\t\treturn min;\n\t}",
"public String getMinKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getLast()).iterator().next();\n }",
"public java.math.BigDecimal getLow() {\n return low;\n }",
"@Override\n public int getMinMeasurementNumber() {\n return super.getMinMeasurementNumber();\n }",
"public int findLowestTemp() {\n\t\t\n\t\tint min = 0;\n\t\tint indexLow = 0;\n\t\tfor (int i=0; i<temps.length; i++)\n\t\t\tif (temps[i][1] < min) {\n\t\t\t\tmin = temps[i][1];\n\t\t\t\tindexLow = 0;\n\t\t\t}\n\t\t\n\t\treturn indexLow;\n\t\t\n\t}",
"public int getMinimun(){\n int lowGrade = grades[0]; //assume que grades[0] é a menor nota\n \n //faz um loop pelo array de notas\n for(int grade: grades){\n //se nota for mais baixa que lowGrade, essa note é atribuida a lowGrade\n if(grade < lowGrade){\n lowGrade = grade;\n }\n }\n \n return lowGrade;\n }"
] | [
"0.83053815",
"0.73260736",
"0.6977253",
"0.6767103",
"0.660402",
"0.6574416",
"0.65518177",
"0.65263313",
"0.65263313",
"0.64865345",
"0.6485182",
"0.6468663",
"0.6431277",
"0.64241856",
"0.64120054",
"0.6401228",
"0.63825816",
"0.63739806",
"0.63634336",
"0.6347252",
"0.6342074",
"0.63415194",
"0.6340197",
"0.633512",
"0.6330902",
"0.63254267",
"0.6272785",
"0.62724745",
"0.6257287",
"0.62419707",
"0.6234389",
"0.6229483",
"0.61959034",
"0.61959034",
"0.61959034",
"0.61949646",
"0.61895263",
"0.61807436",
"0.6177554",
"0.6156054",
"0.6143627",
"0.6130924",
"0.61199427",
"0.6117675",
"0.6116745",
"0.61146504",
"0.6108812",
"0.6099285",
"0.6098516",
"0.6085886",
"0.6079921",
"0.60740477",
"0.6072158",
"0.6072148",
"0.6071268",
"0.60707283",
"0.6037238",
"0.6012015",
"0.6003453",
"0.5999529",
"0.59934133",
"0.59869504",
"0.5965227",
"0.5964223",
"0.5962431",
"0.5960583",
"0.59546435",
"0.59528226",
"0.5948208",
"0.5947788",
"0.59461325",
"0.5943641",
"0.5941959",
"0.59389496",
"0.5926573",
"0.59263957",
"0.5915567",
"0.5895329",
"0.5894785",
"0.58906126",
"0.58815646",
"0.58788514",
"0.5856079",
"0.5855634",
"0.5841698",
"0.58399963",
"0.5829898",
"0.58252317",
"0.5819656",
"0.5813343",
"0.5812289",
"0.5810419",
"0.5802564",
"0.5785177",
"0.5780982",
"0.5779649",
"0.5778477",
"0.5776564",
"0.577196",
"0.5771748"
] | 0.8190611 | 1 |
Get the highest note stored in this piece. | public String getHigh() {
return this.high.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Note getHighestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note highestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.ishigher(highestNote)) {\n highestNote = currentNote;\n }\n }\n if (highestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return highestNote;\n }",
"@Override\n public Note getHighest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentHigh = new Note(this.high.getDuration(), this.high.getOctave\n (), this.high.getStartMeasure(), this.high.getPitch(), this.high\n .getIsHead(), this.high.getInstrument(), this.high.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentHigh.compareTo(n) == -1) {\n currentHigh = n;\n }\n }\n }\n return currentHigh;\n }",
"int maxNoteValue();",
"public String maximum(){\n\t\treturn queueArray[1][1];\n\t}",
"public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}",
"public String extractMax(){\n\t\tString maxValue = queueArray[1][1];\n\t\t\n\t\tremove();\n\t\tmove();\n\t\t\n\t\treturn maxValue;\n\t}",
"public Item max() {\n return heap[0];\n }",
"public int getHighestVariable() {\n\t\treturn HighestVariable;\n\t}",
"@Override\n public int getFinalBeat() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n int farthestBeat = 0;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n int currentEnd = currentNote.getBeat() + currentNote.getDuration();\n\n if (currentEnd > farthestBeat) {\n farthestBeat = currentEnd;\n }\n }\n return farthestBeat;\n }",
"@Override\n public int getDuration() {\n if (this.music.size() == 0) {\n return 0;\n }\n else {\n int highestDuration = 0;\n ArrayList<Note> allNotes = this.getAllNotes();\n // find the note that has the longest length in the last arrayList\n for (Note note : allNotes) {\n if (note.getEndBeat() > highestDuration) {\n highestDuration = note.getEndBeat();\n }\n }\n return highestDuration;\n }\n }",
"public Disc top()\n\t{\n\t\tint poleSize = pole.size();\n\n\t\t// If the pole is empty, return nothing\n\t\tif(poleSize == 0)\n\t\t\treturn null;\n\n\t\t// Otherwise return the top disc\n\t\treturn pole.get(poleSize - 1);\n\t}",
"public Number getMaximum() {\n return ((ADocument) getDocument()).max;\n }",
"public String max()\r\n\t {\r\n\t\t if(this.max != null)\r\n\t\t {\r\n\t\t\t return this.max.getValue(); \r\n\t\t }\r\n\t\t return null;\r\n\t }",
"public String getHighestInterest(){\n if(!interestsNotFilled()) {\n Object highestInterest = interestMap.keySet().toArray()[0];\n for (String interest : interestMap.keySet()) {\n float score = interestMap.get(interest);\n if (score > interestMap.get(highestInterest)) {\n highestInterest = interest;\n }\n }\n return (String) highestInterest;\n }else{\n return null;\n }\n }",
"public String getMax() { \n\t\treturn getMaxElement().getValue();\n\t}",
"@Override\n public Note getLowestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note lowestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.isLower(lowestNote)) {\n lowestNote = currentNote;\n }\n }\n if (lowestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return lowestNote;\n }",
"public Note getNote() {\n\t \n\t //returns the objected stored in the note field\n\t return this.note;\n }",
"public Cell highestCell() {\n for (Cell c : this.board) {\n if (c.height == ForbiddenIslandWorld.ISLAND_SIZE / 2 && !c.isCoastCell()) {\n return c;\n }\n }\n return highestCell();\n }",
"public String top(){\n if(!(pilha.size() == 0)){\n return pilha.get(pilha.size()-1);\n }else{\n return null;\n }\n }",
"public int theHighest() {\r\n\t\tint highest = 0;\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\tif(game[i][j].getValue() > highest)\r\n\t\t\t\t\thighest = game[i][j].getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn highest;\r\n\t}",
"private int getHighestLevelFromProperties(){\n GameModel gameModel = GameModel.getInstance();\n int highestReachedLevel;\n int level = gameModel.getCurrentLevelIndex();\n String highest = properties.getProperty(\"highestReachedLevel\");\n if (highest!=null){ //if property not saved\n highestReachedLevel = Integer.parseInt(highest);\n } else {\n highestReachedLevel = level;\n }\n return highestReachedLevel;\n }",
"public T getLast() {\n return this.getHelper(this.indexCorrespondingToTheLatestElement).data;\n }",
"public int getbestline() {\n\t\tint i=0;\n\t\tint biggest=0;\n\t\tint keep_track=0;\n\t\twhile(i < amount.length) {\n\t\t\tif(Faucets.amount[i] > biggest) {\n\t\t\t\tbiggest = Faucets.amount[i];\n\t\t\t\tkeep_track = i;\n\t\t\t}\n\t\t\ti+=1;\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Keep_Track = \\\"\" + keep_track + \"\\\"\");\n\t\treturn keep_track;\n\t\t\n\t}",
"public int top() {\n\t\treturn count == 0? -1 : st[count-1];\r\n\t}",
"protected String getMaximum()\n {\n return maximum;\n }",
"public float getmaxP() {\n Reading maxPressureReading = null;\n float maxPressure = 0;\n if (readings.size() >= 1) {\n maxPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure > maxPressure) {\n maxPressure = readings.get(i).pressure;\n }\n }\n } else {\n maxPressure = 0;\n }\n return maxPressure;\n }",
"public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }",
"public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}",
"public String max()// return the value of the maximum key in the tree\r\n {\r\n\t if(empty()) {\r\n\t return null;\r\n\t }\r\n\t WAVLNode x = root;\r\n while(x.right!=EXT_NODE) {\r\n \tx=x.right;\r\n }\r\n return x.info;\r\n }",
"public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}",
"public String getHighestRank() {\n try {\n FileInputStream fis = new FileInputStream(this.databaseName + \".config\");\n\n // Reading in the number of normal records from the .config file starting from offset 104 bytes (where the number for HIGHEST-RANK begins)\n fis.getChannel().position(104);\n byte[] highestRank = new byte[5];\n \n fis.read(highestRank, 0, 5);\n fis.close();\n return new String(highestRank).trim();\n } catch (IOException ex) {\n ex.printStackTrace();\n return \"Error\";\n }\n }",
"public int getLatestPressure() {\n int pressure = 0;\n if (readings.size() > 0) {\n pressure = readings.get(readings.size() - 1).pressure;\n }\n return pressure;\n }",
"public int getMax(){\n return tab[rangMax()];\n }",
"public final int getMinor() {\n return get(1);\n }",
"public int maximum() {\n \n if (xft.size() == 0) {\n return -1;\n }\n \n Integer maxRepr = xft.maximum();\n \n assert(maxRepr != null);\n \n int index = maxRepr.intValue()/binSz;\n \n TreeMap<Integer, Integer> map = getTreeMap(index);\n \n assert(map != null);\n \n Entry<Integer, Integer> lastItem = map.lastEntry();\n \n assert(lastItem != null);\n \n return lastItem.getKey();\n }",
"public Integer largest() {\n if (root != null) {\n return root.largest();\n }\n return null;\n }",
"public int getMax()\n {\n int max = data.get(0).getX();\n\n for(int i = 0; i < data.size(); i++)\n {\n if (data.get(i).getX() > max)\n {\n max = data.get(i).getX();\n }\n }\n\n\n return max;\n }",
"public Point getMax () {\r\n\r\n\treturn getB();\r\n }",
"@JsonIgnore\r\n public String getMax() {\r\n return OptionalNullable.getFrom(max);\r\n }",
"public int top() {\n Integer poll = q1.peek();\n return poll == null ? -1 : poll;\n }",
"public int top() {\n\t\treturn list.get(list.size() - 1);\n\t}",
"public long getHighestPrimeNr(){\n Cursor cursor = database.query(PrimeNrBaseHelper.TABLE, new String[] {\"MAX(\"+PrimeNrBaseHelper.PRIME_NR+\") AS MAX\"},null,null,null\n ,null,null);\n\n long pnr = 0;\n\n try {\n cursor.moveToFirst();\n pnr = cursor.getLong(cursor.getColumnIndex(\"MAX\"));\n } finally {\n cursor.close();\n }\n\n return (pnr > 0) ? pnr : SMALLEST_PRIME_NR;\n }",
"public int top() {\n return queue.peekLast();\n }",
"public int getLowestOctaveMidiNumber() {\n\t\treturn noteName.getLowestOctaveMidiNumber();\n\t}",
"public final int getHigh() {\n\treturn(this.high);\n }",
"public int getHigh() {\n\t\t\treturn high;\n\t\t}",
"protected int getHighestInnovation() {\n\t\treturn highest;\n\t}",
"public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}",
"@Override\n public Note getLowest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentLow = new Note(this.low.getDuration(), this.low.getOctave(),\n this.low.getStartMeasure(), this.low.getPitch(), this.low\n .getIsHead(), this.low.getInstrument(), this.low.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentLow.compareTo(n) == 1) {\n currentLow = n;\n }\n }\n }\n return currentLow;\n }",
"public long getMaximum() {\n\t\treturn this._max;\n\t}",
"public String getMax() {\n return max;\n }",
"public Track printLongestTrack()\r\n {\r\n\t// Initialise variables to store longest Track and its Duration\r\n\tTrack longestTrack = null;\r\n\tDuration maxDuration = new Duration();\r\n\r\n\t// Iterate over albums in the collection getting the longest track in\r\n\t// each\r\n\tfor (Album album : this.getAlbums())\r\n\t{\r\n\t Track currentTrack = album.getLongestTrack();\r\n\t Duration currentDuration = currentTrack.getTrackDuration();\r\n\r\n\t // Compare duration of longest track in this album with max duration \r\n\t // found so far. If it is longer, store the track and its duration.\r\n\t if (currentDuration.compareTo(maxDuration) > 0)\r\n\t {\r\n\t\tlongestTrack = currentTrack;\r\n\t\tmaxDuration = currentDuration;\r\n\t }\r\n\t}\r\n\r\n\t// Display the album with max track count\r\n\tString outputString = \"Track in collection with longest duration:\\r\\n\";\r\n\tSystem.out.print(outputString);\r\n\t// Print details of last (longest) track in the sorted track list\r\n\tSystem.out.println(longestTrack);\r\n\treturn longestTrack;\r\n }",
"public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}",
"public int getHigh() {\n\t\treturn high;\n\t}",
"public int getHighestId() {\n final SQLiteStatement statement = db.compileStatement(\"SELECT MAX(_id) FROM Games\");\n return (int) statement.simpleQueryForLong();\n }",
"public long getMax() {\n return m_Max;\n }",
"public int top() {\n return queue.getLast();\n }",
"public int extractMaximum() {\n \n int max = maximum();\n\n if (max == -1) {\n assert(xft.size() == 0);\n return -1;\n }\n \n remove(max);\n \n return max;\n }",
"public String top() {\n return queue.size() == 0 ? null : queue.get(0);\n }",
"public java.math.BigDecimal getHigh() {\n return high;\n }",
"public Quantity<Q> getMax() {\n return max;\n }",
"public Individual getWorst() {\n\t\treturn individuals[individuals.length-1];\n\t}",
"public java.lang.Integer getHighestPeriodNum() {\n return highestPeriodNum;\n }",
"public String max() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode max = (AVLNode) this.root;\n\t\twhile (max.getRight().getHeight() != -1) {\n\t\t\tmax = (AVLNode) max.getRight();\n\t\t}\n\t\treturn max.getValue();\n\t}",
"public int largestEntry() throws SQLException {\r\n String statement = \"SELECT Appointment_ID FROM appointments ORDER BY Appointment_ID DESC LIMIT 0,1\";\r\n ResultSet rs = conn.prepareStatement(statement).executeQuery();\r\n rs.next();\r\n return rs.getInt(\"Appointment_ID\");\r\n }",
"public T getLast() {\n if (this.getSize() > 0) {\n return buffer[index];\n }\n return null;\n }",
"public HighScore getMaxScore(){\n HighScore hs;\n db = helper.getReadableDatabase();\n Cursor scoreCursor = db.query(SQLHelper.DB_TABLE_SCORES, SCORES_COLUMNS, null, null, null, null, SQLHelper.KEY_SCORE + \" DESC\", null);\n scoreCursor.moveToFirst();\n if(scoreCursor.getCount() == 0){\n hs = null;\n }\n else{\n hs = new HighScore(scoreCursor.getString(0), scoreCursor.getLong(1),\n scoreCursor.getLong(2), scoreCursor.getString(3), scoreCursor.getString(4));\n scoreCursor.moveToNext();\n if (scoreCursor != null && !scoreCursor.isClosed()) { // Close cursor\n scoreCursor.close();\n }\n }\n db.close();\n return hs; // Return max high score\n }",
"public TypeHere getLast() {\n return items[size - 1];\n }",
"public int getHigh()\t\n\t{\t//start of getHigh mehtod\n\t\treturn HIGH_NUM;\n\t}",
"public final int getLatestPostNumber() {\n\t\treturn this.latestPostNumber;\n\t}",
"public Integer max() {\n return this.max;\n }",
"public int getMinor() {\n return minor;\n }",
"public Object getLastObject()\n {\n\tcurrentObject = lastObject;\n\n if (lastObject == null)\n \treturn null;\n else\n \treturn AL.get(AL.size()-1);\n }",
"public E getLast()// you finish (part of HW#4)\n\t{\n\t\t// If the tree is empty, return null\n\t\t// FIND THE RIGHT-MOST RIGHT CHILD\n\t\t// WHEN you can't go RIGHT anymore, return the node's data to last Item\n\t\tif (root == null)\n\t\t\treturn null;\n\t\tBinaryNode<E> iteratorNode = root;\n\t\twhile (iteratorNode.hasRightChild())\n\t\t\titeratorNode = iteratorNode.getRightChild();\n\t\treturn iteratorNode.getData();\n\t}",
"public int getMaximum() {\n return this.iMaximum;\n }",
"public int pullHighest() {\n\t\tint highest = 0;\n\t\tif (isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"Queue is Empty\");\n\t\t}\n\n\t\telse if (currentSize == 1) {\n\t\t\thighest = heap[1];\n\t\t\theap[1] = heap[0];\n\t\t\tcurrentSize--;\n\t\t} else {\n\t\t\thighest = heap[1];\n\t\t\theap[1] = heap[size - 1];\n\t\t\tcompareAndSwap();\n\t\t\tcurrentSize--;\n\t\t}\n\t\treturn highest;\n\t}",
"@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }",
"public double max() {\n\t\tif (count() > 0) {\n\t\t\treturn _max.get();\n\t\t}\n\t\treturn 0.0;\n\t}",
"public int getMax() {\n\t\treturn getMax(0.0f);\n\t}",
"public Item getLast() {\n return items[size - 1];\n }",
"public Number getMaximumNumber() {\n/* 221 */ if (this.maxObject == null) {\n/* 222 */ this.maxObject = new Long(this.max);\n/* */ }\n/* 224 */ return this.maxObject;\n/* */ }",
"public Long getMaximumquantity() {\r\n return maximumquantity;\r\n }",
"public int getMaxID(){\n return recipes.get(recipes.size() - 1).getID();\n }",
"public V getLatest() {\n return lastItemOfList(versions);\n }",
"public Long getMaximum() {\r\n\t\treturn maximum;\r\n\t}",
"public int getMinor() {\r\n\t\treturn minor;\r\n\t}",
"public int getHighestMethod() {\n\t\treturn HighestMethod;\n\t}",
"int getTonicNote(){\n String lastnote=\"\";\n int result;\n lastnote += Strinput.toCharArray()[Strinput.length()-4];\n lastnote += Strinput.toCharArray()[Strinput.length()-3];\n result = Integer.parseInt(lastnote);\n if(result<72){\n return result-60;\n }else{\n return result-12-60;\n }\n }",
"public Card.Face getHighestCard(){\n return uniqueFaces.getFirst();\n }",
"public int minor() {\n\t\treturn identifiers[MINOR_INDEX];\n\t}",
"int maxBeatNum();",
"public int maxElement() {\n\t\tNode max=root;\n\t\tint out=-1;\n\t\twhile(max!=null) {\n\t\t\tout=max.data;\n\t\t\tmax=max.right;\n\t\t}\n\t\treturn out;\n\t}",
"public int getHighestChromID();",
"public int getMaximum() {\n \tcheckWidget();\n \treturn maximum;\n }",
"public int top() {\n return queue.element();\n }",
"public Book mostExpensive() {\n //create variable that stores the book thats most expensive\n Book mostExpensive = bookList.get(0);//most expensive book is set as the first in the array\n for (Book book : bookList) {\n if(book.getPrice() > mostExpensive.getPrice()){\n mostExpensive = book;\n }\n } return mostExpensive;//returns only one (theFIRST) most expensive in the array if tehre are several with the same price\n }",
"public E pollLast() {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tE ret = (E) data.get(data.size() - 1);\r\n\t\tdata.remove(data.size() - 1);\r\n\t\treturn ret;\r\n\t}",
"public String getMaxKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getFirst()).iterator().next();\n }",
"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 E findMax() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a right child.\n // temp is then assigned to the next node in the right child and will return\n // the node with the maximum value in the BST. The node that does not have a right\n // child will be the maximum value.\n while(temp.right != null){\n temp = temp.right;\n }\n return temp.getInfo();\n }",
"public int getMax() {\n return max;\n }"
] | [
"0.8248144",
"0.8021665",
"0.72007763",
"0.65514135",
"0.64727247",
"0.6368084",
"0.6354615",
"0.63455",
"0.6269597",
"0.61580735",
"0.6127284",
"0.6081344",
"0.60794216",
"0.6063163",
"0.6025964",
"0.59948593",
"0.5966581",
"0.594581",
"0.59211326",
"0.5912608",
"0.59099066",
"0.5908541",
"0.5903474",
"0.59022003",
"0.5897992",
"0.5895173",
"0.58812165",
"0.5854378",
"0.5844947",
"0.5840834",
"0.5836808",
"0.5819509",
"0.58061373",
"0.5805828",
"0.5791173",
"0.5775461",
"0.57752097",
"0.5774533",
"0.57678336",
"0.5767503",
"0.5764603",
"0.5757048",
"0.57528263",
"0.57515067",
"0.5749339",
"0.574878",
"0.5747652",
"0.5746989",
"0.57466084",
"0.5739402",
"0.573631",
"0.57351345",
"0.5730701",
"0.57262033",
"0.57205623",
"0.57176906",
"0.5710094",
"0.5686849",
"0.5685107",
"0.5677534",
"0.5675082",
"0.56652254",
"0.5657114",
"0.56490797",
"0.5644602",
"0.56421566",
"0.5640777",
"0.56368846",
"0.56366056",
"0.56300545",
"0.562677",
"0.56267256",
"0.5624581",
"0.5624406",
"0.56170875",
"0.56161314",
"0.56156653",
"0.5615585",
"0.5613169",
"0.5612377",
"0.56116647",
"0.5605099",
"0.55969083",
"0.559515",
"0.5594172",
"0.5593472",
"0.5592392",
"0.55921006",
"0.5588127",
"0.55838275",
"0.5580964",
"0.5578384",
"0.557565",
"0.55729365",
"0.5559795",
"0.55593216",
"0.5557925",
"0.55540454",
"0.5553532",
"0.5549104",
"0.5545189"
] | 0.0 | -1 |
Get the highest note stored in this piece. | public String getLow() {
return this.low.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public Note getHighestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note highestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.ishigher(highestNote)) {\n highestNote = currentNote;\n }\n }\n if (highestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return highestNote;\n }",
"@Override\n public Note getHighest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentHigh = new Note(this.high.getDuration(), this.high.getOctave\n (), this.high.getStartMeasure(), this.high.getPitch(), this.high\n .getIsHead(), this.high.getInstrument(), this.high.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentHigh.compareTo(n) == -1) {\n currentHigh = n;\n }\n }\n }\n return currentHigh;\n }",
"int maxNoteValue();",
"public String maximum(){\n\t\treturn queueArray[1][1];\n\t}",
"public E findMax() {\r\n\t\treturn heap.get(0);\r\n\t}",
"public String extractMax(){\n\t\tString maxValue = queueArray[1][1];\n\t\t\n\t\tremove();\n\t\tmove();\n\t\t\n\t\treturn maxValue;\n\t}",
"public Item max() {\n return heap[0];\n }",
"public int getHighestVariable() {\n\t\treturn HighestVariable;\n\t}",
"@Override\n public int getFinalBeat() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n int farthestBeat = 0;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n int currentEnd = currentNote.getBeat() + currentNote.getDuration();\n\n if (currentEnd > farthestBeat) {\n farthestBeat = currentEnd;\n }\n }\n return farthestBeat;\n }",
"@Override\n public int getDuration() {\n if (this.music.size() == 0) {\n return 0;\n }\n else {\n int highestDuration = 0;\n ArrayList<Note> allNotes = this.getAllNotes();\n // find the note that has the longest length in the last arrayList\n for (Note note : allNotes) {\n if (note.getEndBeat() > highestDuration) {\n highestDuration = note.getEndBeat();\n }\n }\n return highestDuration;\n }\n }",
"public Disc top()\n\t{\n\t\tint poleSize = pole.size();\n\n\t\t// If the pole is empty, return nothing\n\t\tif(poleSize == 0)\n\t\t\treturn null;\n\n\t\t// Otherwise return the top disc\n\t\treturn pole.get(poleSize - 1);\n\t}",
"public Number getMaximum() {\n return ((ADocument) getDocument()).max;\n }",
"public String max()\r\n\t {\r\n\t\t if(this.max != null)\r\n\t\t {\r\n\t\t\t return this.max.getValue(); \r\n\t\t }\r\n\t\t return null;\r\n\t }",
"public String getHighestInterest(){\n if(!interestsNotFilled()) {\n Object highestInterest = interestMap.keySet().toArray()[0];\n for (String interest : interestMap.keySet()) {\n float score = interestMap.get(interest);\n if (score > interestMap.get(highestInterest)) {\n highestInterest = interest;\n }\n }\n return (String) highestInterest;\n }else{\n return null;\n }\n }",
"public String getMax() { \n\t\treturn getMaxElement().getValue();\n\t}",
"@Override\n public Note getLowestNote() {\n List<Note> currentNotes = this.getNotes();\n int size = currentNotes.size();\n Note lowestNote = null;\n\n for (int i = 0; i < size; i++) {\n Note currentNote = currentNotes.get(i);\n\n if (currentNote.isLower(lowestNote)) {\n lowestNote = currentNote;\n }\n }\n if (lowestNote == null) {\n throw new IllegalArgumentException(\"No Notes To Compare\");\n }\n return lowestNote;\n }",
"public Note getNote() {\n\t \n\t //returns the objected stored in the note field\n\t return this.note;\n }",
"public Cell highestCell() {\n for (Cell c : this.board) {\n if (c.height == ForbiddenIslandWorld.ISLAND_SIZE / 2 && !c.isCoastCell()) {\n return c;\n }\n }\n return highestCell();\n }",
"public String top(){\n if(!(pilha.size() == 0)){\n return pilha.get(pilha.size()-1);\n }else{\n return null;\n }\n }",
"public int theHighest() {\r\n\t\tint highest = 0;\r\n\t\tfor(int i = 0; i < rows_size; i++) {\r\n\t\t\tfor(int j = 0; j < columns_size; j++) {\r\n\t\t\t\tif(game[i][j].getValue() > highest)\r\n\t\t\t\t\thighest = game[i][j].getValue();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn highest;\r\n\t}",
"private int getHighestLevelFromProperties(){\n GameModel gameModel = GameModel.getInstance();\n int highestReachedLevel;\n int level = gameModel.getCurrentLevelIndex();\n String highest = properties.getProperty(\"highestReachedLevel\");\n if (highest!=null){ //if property not saved\n highestReachedLevel = Integer.parseInt(highest);\n } else {\n highestReachedLevel = level;\n }\n return highestReachedLevel;\n }",
"public T getLast() {\n return this.getHelper(this.indexCorrespondingToTheLatestElement).data;\n }",
"public int getbestline() {\n\t\tint i=0;\n\t\tint biggest=0;\n\t\tint keep_track=0;\n\t\twhile(i < amount.length) {\n\t\t\tif(Faucets.amount[i] > biggest) {\n\t\t\t\tbiggest = Faucets.amount[i];\n\t\t\t\tkeep_track = i;\n\t\t\t}\n\t\t\ti+=1;\n\t\t\t\n\t\t}\n\t\tSystem.out.println(\"Keep_Track = \\\"\" + keep_track + \"\\\"\");\n\t\treturn keep_track;\n\t\t\n\t}",
"public int top() {\n\t\treturn count == 0? -1 : st[count-1];\r\n\t}",
"protected String getMaximum()\n {\n return maximum;\n }",
"public float getmaxP() {\n Reading maxPressureReading = null;\n float maxPressure = 0;\n if (readings.size() >= 1) {\n maxPressure = readings.get(0).pressure;\n for (int i = 1; i < readings.size(); i++) {\n if (readings.get(i).pressure > maxPressure) {\n maxPressure = readings.get(i).pressure;\n }\n }\n } else {\n maxPressure = 0;\n }\n return maxPressure;\n }",
"public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }",
"public int findMax() {\n\t\tint max = (int)data.get(0);\n\t\tfor (int count = 1; count < data.size(); count++)\n\t\t\tif ( (int)data.get(count) > max)\n\t\t\t\tmax = (int)data.get(count);\n\t\treturn max;\n\t}",
"public String max()// return the value of the maximum key in the tree\r\n {\r\n\t if(empty()) {\r\n\t return null;\r\n\t }\r\n\t WAVLNode x = root;\r\n while(x.right!=EXT_NODE) {\r\n \tx=x.right;\r\n }\r\n return x.info;\r\n }",
"public long max() {\n\t\tif (!this.isEmpty()) {\n\t\t\tlong result = theElements[0];\n\t\t\tfor (int i=1; i<numElements; i++) {\n\t\t\t\tif (theElements[i] > result) {\n\t\t\t\t\tresult = theElements[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t\telse {\n\t\t\tthrow new RuntimeException(\"Attempted to find max of empty array\");\n\t\t}\n\t}",
"public String getHighestRank() {\n try {\n FileInputStream fis = new FileInputStream(this.databaseName + \".config\");\n\n // Reading in the number of normal records from the .config file starting from offset 104 bytes (where the number for HIGHEST-RANK begins)\n fis.getChannel().position(104);\n byte[] highestRank = new byte[5];\n \n fis.read(highestRank, 0, 5);\n fis.close();\n return new String(highestRank).trim();\n } catch (IOException ex) {\n ex.printStackTrace();\n return \"Error\";\n }\n }",
"public int getLatestPressure() {\n int pressure = 0;\n if (readings.size() > 0) {\n pressure = readings.get(readings.size() - 1).pressure;\n }\n return pressure;\n }",
"public final int getMinor() {\n return get(1);\n }",
"public int getMax(){\n return tab[rangMax()];\n }",
"public int maximum() {\n \n if (xft.size() == 0) {\n return -1;\n }\n \n Integer maxRepr = xft.maximum();\n \n assert(maxRepr != null);\n \n int index = maxRepr.intValue()/binSz;\n \n TreeMap<Integer, Integer> map = getTreeMap(index);\n \n assert(map != null);\n \n Entry<Integer, Integer> lastItem = map.lastEntry();\n \n assert(lastItem != null);\n \n return lastItem.getKey();\n }",
"public Integer largest() {\n if (root != null) {\n return root.largest();\n }\n return null;\n }",
"public int getMax()\n {\n int max = data.get(0).getX();\n\n for(int i = 0; i < data.size(); i++)\n {\n if (data.get(i).getX() > max)\n {\n max = data.get(i).getX();\n }\n }\n\n\n return max;\n }",
"public Point getMax () {\r\n\r\n\treturn getB();\r\n }",
"public int top() {\n Integer poll = q1.peek();\n return poll == null ? -1 : poll;\n }",
"@JsonIgnore\r\n public String getMax() {\r\n return OptionalNullable.getFrom(max);\r\n }",
"public int top() {\n\t\treturn list.get(list.size() - 1);\n\t}",
"public long getHighestPrimeNr(){\n Cursor cursor = database.query(PrimeNrBaseHelper.TABLE, new String[] {\"MAX(\"+PrimeNrBaseHelper.PRIME_NR+\") AS MAX\"},null,null,null\n ,null,null);\n\n long pnr = 0;\n\n try {\n cursor.moveToFirst();\n pnr = cursor.getLong(cursor.getColumnIndex(\"MAX\"));\n } finally {\n cursor.close();\n }\n\n return (pnr > 0) ? pnr : SMALLEST_PRIME_NR;\n }",
"public int top() {\n return queue.peekLast();\n }",
"public int getLowestOctaveMidiNumber() {\n\t\treturn noteName.getLowestOctaveMidiNumber();\n\t}",
"@Override\n public Note getLowest() {\n if (this.sheet.isEmpty()) {\n throw new IllegalArgumentException(\"No note is added.\");\n }\n Note currentLow = new Note(this.low.getDuration(), this.low.getOctave(),\n this.low.getStartMeasure(), this.low.getPitch(), this.low\n .getIsHead(), this.low.getInstrument(), this.low.getVolume());\n for (int i = 0; i < this.sheet.size(); i++) {\n for (Note n : this.sheet.get(i)) {\n if (currentLow.compareTo(n) == 1) {\n currentLow = n;\n }\n }\n }\n return currentLow;\n }",
"public final int getHigh() {\n\treturn(this.high);\n }",
"public int getHigh() {\n\t\t\treturn high;\n\t\t}",
"public T getMax()\n\t{\n\t\tif(size == 0)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\telse if(size == 1)\n\t\t{\n\t\t\treturn array[0];\n\t\t}\n\t\telse if(size == 2)\n\t\t{\n\t\t\treturn array[1];\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\tif(object.compare(array[1], array[2]) < 0)\n\t\t\t{\n\t\t\t\treturn array[2];\n\t\t\t}\n\t\t\telse if(object.compare(array[1], array[2]) > 0)\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn array[1];\n\t\t\t}\n\n\t\t}\n\t}",
"protected int getHighestInnovation() {\n\t\treturn highest;\n\t}",
"public long getMaximum() {\n\t\treturn this._max;\n\t}",
"public Track printLongestTrack()\r\n {\r\n\t// Initialise variables to store longest Track and its Duration\r\n\tTrack longestTrack = null;\r\n\tDuration maxDuration = new Duration();\r\n\r\n\t// Iterate over albums in the collection getting the longest track in\r\n\t// each\r\n\tfor (Album album : this.getAlbums())\r\n\t{\r\n\t Track currentTrack = album.getLongestTrack();\r\n\t Duration currentDuration = currentTrack.getTrackDuration();\r\n\r\n\t // Compare duration of longest track in this album with max duration \r\n\t // found so far. If it is longer, store the track and its duration.\r\n\t if (currentDuration.compareTo(maxDuration) > 0)\r\n\t {\r\n\t\tlongestTrack = currentTrack;\r\n\t\tmaxDuration = currentDuration;\r\n\t }\r\n\t}\r\n\r\n\t// Display the album with max track count\r\n\tString outputString = \"Track in collection with longest duration:\\r\\n\";\r\n\tSystem.out.print(outputString);\r\n\t// Print details of last (longest) track in the sorted track list\r\n\tSystem.out.println(longestTrack);\r\n\treturn longestTrack;\r\n }",
"public String getMax() {\n return max;\n }",
"public AnyType findMax() {\n\t\treturn elementAt(findMax(root));\n\t}",
"public int getHigh() {\n\t\treturn high;\n\t}",
"public int getHighestId() {\n final SQLiteStatement statement = db.compileStatement(\"SELECT MAX(_id) FROM Games\");\n return (int) statement.simpleQueryForLong();\n }",
"public long getMax() {\n return m_Max;\n }",
"public int top() {\n return queue.getLast();\n }",
"public int extractMaximum() {\n \n int max = maximum();\n\n if (max == -1) {\n assert(xft.size() == 0);\n return -1;\n }\n \n remove(max);\n \n return max;\n }",
"public String top() {\n return queue.size() == 0 ? null : queue.get(0);\n }",
"public java.math.BigDecimal getHigh() {\n return high;\n }",
"public Quantity<Q> getMax() {\n return max;\n }",
"public Individual getWorst() {\n\t\treturn individuals[individuals.length-1];\n\t}",
"public java.lang.Integer getHighestPeriodNum() {\n return highestPeriodNum;\n }",
"public String max() {\n\t\tif (this.empty()) {\n\t\t\treturn null;\n\t\t}\n\t\tAVLNode max = (AVLNode) this.root;\n\t\twhile (max.getRight().getHeight() != -1) {\n\t\t\tmax = (AVLNode) max.getRight();\n\t\t}\n\t\treturn max.getValue();\n\t}",
"public int largestEntry() throws SQLException {\r\n String statement = \"SELECT Appointment_ID FROM appointments ORDER BY Appointment_ID DESC LIMIT 0,1\";\r\n ResultSet rs = conn.prepareStatement(statement).executeQuery();\r\n rs.next();\r\n return rs.getInt(\"Appointment_ID\");\r\n }",
"public T getLast() {\n if (this.getSize() > 0) {\n return buffer[index];\n }\n return null;\n }",
"public HighScore getMaxScore(){\n HighScore hs;\n db = helper.getReadableDatabase();\n Cursor scoreCursor = db.query(SQLHelper.DB_TABLE_SCORES, SCORES_COLUMNS, null, null, null, null, SQLHelper.KEY_SCORE + \" DESC\", null);\n scoreCursor.moveToFirst();\n if(scoreCursor.getCount() == 0){\n hs = null;\n }\n else{\n hs = new HighScore(scoreCursor.getString(0), scoreCursor.getLong(1),\n scoreCursor.getLong(2), scoreCursor.getString(3), scoreCursor.getString(4));\n scoreCursor.moveToNext();\n if (scoreCursor != null && !scoreCursor.isClosed()) { // Close cursor\n scoreCursor.close();\n }\n }\n db.close();\n return hs; // Return max high score\n }",
"public TypeHere getLast() {\n return items[size - 1];\n }",
"public int getHigh()\t\n\t{\t//start of getHigh mehtod\n\t\treturn HIGH_NUM;\n\t}",
"public final int getLatestPostNumber() {\n\t\treturn this.latestPostNumber;\n\t}",
"public Object getLastObject()\n {\n\tcurrentObject = lastObject;\n\n if (lastObject == null)\n \treturn null;\n else\n \treturn AL.get(AL.size()-1);\n }",
"public int getMinor() {\n return minor;\n }",
"public E getLast()// you finish (part of HW#4)\n\t{\n\t\t// If the tree is empty, return null\n\t\t// FIND THE RIGHT-MOST RIGHT CHILD\n\t\t// WHEN you can't go RIGHT anymore, return the node's data to last Item\n\t\tif (root == null)\n\t\t\treturn null;\n\t\tBinaryNode<E> iteratorNode = root;\n\t\twhile (iteratorNode.hasRightChild())\n\t\t\titeratorNode = iteratorNode.getRightChild();\n\t\treturn iteratorNode.getData();\n\t}",
"public Integer max() {\n return this.max;\n }",
"public int pullHighest() {\n\t\tint highest = 0;\n\t\tif (isEmpty()) {\n\t\t\tthrow new IllegalArgumentException(\"Queue is Empty\");\n\t\t}\n\n\t\telse if (currentSize == 1) {\n\t\t\thighest = heap[1];\n\t\t\theap[1] = heap[0];\n\t\t\tcurrentSize--;\n\t\t} else {\n\t\t\thighest = heap[1];\n\t\t\theap[1] = heap[size - 1];\n\t\t\tcompareAndSwap();\n\t\t\tcurrentSize--;\n\t\t}\n\t\treturn highest;\n\t}",
"public int getMaximum() {\n return this.iMaximum;\n }",
"@Override\n public Long findMAX() {\n\n StringBuffer sql = new StringBuffer(\"select max(magoithau) from goithau\");\n Query query = entityManager.createNativeQuery(sql.toString());\n return Long.parseLong(query.getSingleResult().toString()) ;\n }",
"public double max() {\n\t\tif (count() > 0) {\n\t\t\treturn _max.get();\n\t\t}\n\t\treturn 0.0;\n\t}",
"public Item getLast() {\n return items[size - 1];\n }",
"public int getMax() {\n\t\treturn getMax(0.0f);\n\t}",
"public Number getMaximumNumber() {\n/* 221 */ if (this.maxObject == null) {\n/* 222 */ this.maxObject = new Long(this.max);\n/* */ }\n/* 224 */ return this.maxObject;\n/* */ }",
"public Long getMaximumquantity() {\r\n return maximumquantity;\r\n }",
"public int getMaxID(){\n return recipes.get(recipes.size() - 1).getID();\n }",
"public V getLatest() {\n return lastItemOfList(versions);\n }",
"public int getHighestMethod() {\n\t\treturn HighestMethod;\n\t}",
"public Long getMaximum() {\r\n\t\treturn maximum;\r\n\t}",
"int getTonicNote(){\n String lastnote=\"\";\n int result;\n lastnote += Strinput.toCharArray()[Strinput.length()-4];\n lastnote += Strinput.toCharArray()[Strinput.length()-3];\n result = Integer.parseInt(lastnote);\n if(result<72){\n return result-60;\n }else{\n return result-12-60;\n }\n }",
"public int getMinor() {\r\n\t\treturn minor;\r\n\t}",
"public Card.Face getHighestCard(){\n return uniqueFaces.getFirst();\n }",
"public int minor() {\n\t\treturn identifiers[MINOR_INDEX];\n\t}",
"int maxBeatNum();",
"public int maxElement() {\n\t\tNode max=root;\n\t\tint out=-1;\n\t\twhile(max!=null) {\n\t\t\tout=max.data;\n\t\t\tmax=max.right;\n\t\t}\n\t\treturn out;\n\t}",
"public int getHighestChromID();",
"public int getMaximum() {\n \tcheckWidget();\n \treturn maximum;\n }",
"public int top() {\n return queue.element();\n }",
"public E pollLast() {\r\n\t\tif (isEmpty()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tE ret = (E) data.get(data.size() - 1);\r\n\t\tdata.remove(data.size() - 1);\r\n\t\treturn ret;\r\n\t}",
"public Book mostExpensive() {\n //create variable that stores the book thats most expensive\n Book mostExpensive = bookList.get(0);//most expensive book is set as the first in the array\n for (Book book : bookList) {\n if(book.getPrice() > mostExpensive.getPrice()){\n mostExpensive = book;\n }\n } return mostExpensive;//returns only one (theFIRST) most expensive in the array if tehre are several with the same price\n }",
"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 String getMaxKey() {\n if (list.isEmpty()) {\n return \"\";\n }\n return v.get(list.getFirst()).iterator().next();\n }",
"public E findMax() {\n Node<E> temp = root;\n // while loop will run until there is no longer a node that has a right child.\n // temp is then assigned to the next node in the right child and will return\n // the node with the maximum value in the BST. The node that does not have a right\n // child will be the maximum value.\n while(temp.right != null){\n temp = temp.right;\n }\n return temp.getInfo();\n }",
"public int getMax() {\n return max;\n }"
] | [
"0.824955",
"0.8022378",
"0.7199228",
"0.65507543",
"0.647091",
"0.63678163",
"0.63533324",
"0.6343749",
"0.62711126",
"0.6158931",
"0.61270374",
"0.6078841",
"0.6077105",
"0.60631776",
"0.60236585",
"0.5996906",
"0.5967133",
"0.59447765",
"0.5920069",
"0.5911234",
"0.590867",
"0.59084857",
"0.59027785",
"0.5900682",
"0.5895772",
"0.58932394",
"0.588006",
"0.5852352",
"0.58428246",
"0.5839332",
"0.5834921",
"0.58186936",
"0.5803298",
"0.5802999",
"0.5788513",
"0.5773853",
"0.5773417",
"0.5772368",
"0.5766797",
"0.576555",
"0.57635546",
"0.57541394",
"0.5752349",
"0.5750952",
"0.5747807",
"0.5746351",
"0.5745991",
"0.5745719",
"0.5744438",
"0.57362944",
"0.5735109",
"0.57337874",
"0.5728804",
"0.5723346",
"0.5719728",
"0.5714888",
"0.5709711",
"0.56855494",
"0.56849796",
"0.56752175",
"0.5673138",
"0.5663694",
"0.56545764",
"0.56470704",
"0.564363",
"0.56422526",
"0.5640933",
"0.5636891",
"0.5633358",
"0.5628552",
"0.56250584",
"0.562452",
"0.5624303",
"0.56242305",
"0.56160235",
"0.5614378",
"0.5613519",
"0.5613286",
"0.56124765",
"0.5610379",
"0.56086123",
"0.56030893",
"0.5595462",
"0.559454",
"0.55916786",
"0.5591408",
"0.5591355",
"0.55912435",
"0.5586661",
"0.5581856",
"0.5579254",
"0.55763084",
"0.55741686",
"0.5570092",
"0.5559409",
"0.55586034",
"0.5558374",
"0.5553468",
"0.55524486",
"0.55472463",
"0.5542183"
] | 0.0 | -1 |
Get the number of beats stored in this piece. | @Override
public int getBeats() {
return this.sheet.size();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int numberOfBoats(){\n return this.boats.size();\n }",
"public int countBoats() {\r\n\t\treturn boats.size();\r\n\t}",
"public int getNumOfBoats() {\n\t\treturn numOfBoats;\n\t}",
"public int getHats() {\n return totalHats;\n }",
"public int getNumBoats() {\n return NUM_BOATS;\n }",
"public int getNumberOfCheese() {\n return this.cheese;\n }",
"public Integer numberOfSeats() {\n\t\treturn this.numberOfSeats;\n\t}",
"public int foodCount() {\r\n\t\treturn this.food;\r\n\t}",
"public int getPieceCount () {\n return m_PieceCount;\n\t}",
"public int getNumChips() {\n\t\treturn numChips;\n\t}",
"public int getNumSeats() {\n return numSeats;\n }",
"int getAcksCount();",
"int getAcksCount();",
"public int getCount() {\n\t\treturn channelCountMapper.getCount();\n\t}",
"public int getNumberOfBeds() {\n\t\tint total;\n\t\ttotal = getNbrOfBeds()[0] + getNbrOfBeds()[1] + getNbrOfBeds()[2];\n\t\treturn total;\n\t}",
"public int getNumSeats() {\r\n\t\treturn numSeats;\r\n\t}",
"public int size(){\r\n return boats.size();\r\n }",
"public int getFoodCount()\r\n\t{\r\n\t\treturn foodCount;\r\n\t}",
"public int count() {\n\t\t\tassert wellFormed() : \"invariant false on entry to count()\";\n\n\t\t\tint count = 0;\n\t\t\tfor(Card p = this.first; p != null; p = p.next) {\n\t\t\t\t++count;\n\t\t\t}\n\n\t\t\treturn count; // TODO\n\t\t}",
"public int getTurnCount() {\n return turnEncoder.getCount();\n }",
"public int getCardCount() {\n return cardSet.totalCount();\n }",
"public int getCount(){\n int c = 0;\n for(String s : this.counts){\n c += Integer.parseInt(s);\n }\n return c;\n }",
"public int getBlackMarblesCount()\r\n\t{\r\n\t\treturn this.blackMarblesCount;\r\n\t}",
"public int getTotalSeats() {\n return totalSeats;\n }",
"public int getCount() {\n\t\t\treturn foods.size();\n\t\t}",
"public int getHandKarteCount(){\n return getHandKarte().size();\n }",
"public int getAmountOfCards() {\n\t\t\n\t\treturn myCards.size();\n\t\t\n\t}",
"public int getCalories () {\n\t\treturn this.calories;\n\t}",
"public int numberOfKnightsIn() { // numero di cavalieri a tavola\n \n return numeroCompl;\n }",
"public int getAcksCount() {\n return acks_.size();\n }",
"public int getAcksCount() {\n return acks_.size();\n }",
"public int getAcksCount() {\n return acks_.size();\n }",
"public int getAcksCount() {\n return acks_.size();\n }",
"public int getFaintedPokemonCount() {\n if (faintedPokemonBuilder_ == null) {\n return faintedPokemon_.size();\n } else {\n return faintedPokemonBuilder_.getCount();\n }\n }",
"public int getWhiteMarblesCount()\r\n\t{\r\n\t\treturn whiteMarblesCount;\r\n\t}",
"public int howManyPieces() {\n int totalPieces = 0;\n // for each item in stock\n for (int i = 0; i < this._noOfItems; i++) {\n // add the quantity of the item to the sum\n totalPieces += this._stock[i].getQuantity();\n }\n // and return the total of quantities\n return totalPieces;\n }",
"int count() {\n return index.capacity() / 24;\n }",
"public int getShipPartsNeededCount() {\n return (maxDays * 2) / 3;\n }",
"public int getAnnounceCount() {\n\t\tCursor c = db.query(TABLE_TEACHER_ANNOUNCEMENT,\n\t\t\t\tnew String[] { KEY_ROW_ID }, null, null, null, null, null);\n\t\treturn c == null ? 0 : c.getCount();\n\t}",
"public int getBottles() {\n return totalBottles;\n }",
"public int get_howmany() {\n return how_many;\n }",
"public Integer getNumOfWalls() {\n return numOfWalls;\n }",
"public int getNumCharacters()\n\t{\n\t\treturn gameCharCount;\n\t}",
"public int getBookedseats() {\n\t\treturn bookedseats;\r\n\t}",
"public int get_count() {\n return (int)getUIntBEElement(offsetBits_count(), 16);\n }",
"public int getNumberOfCoins() {\n return coins;\n }",
"public final int count() {\n\t\tCountFunction function = new CountFunction();\n\t\teach(function);\n\t\treturn function.getCount();\n\t}",
"public int getNumberOfSeatsHeld() { return numberOfSeatsHeld; }",
"public int getRemainingSeats() {\n\t\treturn remainingSeats;\n\t}",
"public int count() {\n\t\treturn count;\n\t}",
"public int getCount() {\n\t\treturn Dispatch.get(object, \"Count\").getInt();\n\t}",
"private int getNumberOfFreeChairs() {\n return this.numberOfChairs - waitingStudents.size();\n }",
"public int getCoinCount() {\n return coinCount;\n }",
"public int count() {\n return this.count;\n }",
"public int numHouses() {\n\t\treturn buildings;\n\t}",
"public int getCoinCount() {\r\n\t\treturn this.coinCount;\r\n\t}",
"public int getCalories() {\n return this.calories += ((this.protein * 4) + (this.carbohydrates * 4) + (this.fats * 9));\n }",
"public Integer getNumOfCarbons() {\n return numOfCarbons;\n }",
"public int count() {\r\n return count;\r\n }",
"public int size() {\r\n\t\treturn this.taille;\r\n\t}",
"public int getBlackCountInVector() {\r\n\t\tint count = 0;\r\n\t\tObject tmp[] = piece.values().toArray();\r\n\t\tfor (int i = 0; i < tmp.length; i++) {\r\n\t\t\tChessPiece p = (ChessPiece)tmp[i];\r\n\t\t\tif (p.chessPlayer.equals(\"black\")) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public int numberOfHotels() {\r\n \tint anzahlHotel=hotelDAO.getHotelList().size();\r\n \treturn anzahlHotel;\r\n }",
"public int count() {\n return count;\n }",
"public int getNSteps() {\n //if (mCovered == null) {\n //return 0;\n //}\n return mCovered.length;\n }",
"public int getCount() {\n\t\treturn this.countRound;\n\t}",
"public int getShipsAlive() {\n return this.numberOfShips;\n }",
"public int getToalCoins()\n\t{\n\t\treturn CoinCount;\n\t}",
"public int countBookings() {\n\t\t\treturn Bookings.size();\r\n\t\t}",
"public int getNoOfTickets() {\n\t\treturn noOfTickets;\r\n\t}",
"public int size() {\n return this.deck.size();\n }",
"public int getTotalOfdefeats() {\n return statistics.get(TypeOfGames.SIMGAME).getNumberOfDefeats()\n + statistics.get(TypeOfGames.EASYCOMPUTERGAME).getNumberOfDefeats()\n + statistics.get(TypeOfGames.HARDCOMPUTERGAME).getNumberOfDefeats();\n }",
"public double countCalories() {\n double count = 0;\n\n for (VegetablePortion vegetablePortion : list) {\n count += vegetablePortion.getVegetable().getCalories() * vegetablePortion.getWeight();\n }\n\n return count;\n }",
"protected int getWoodCount() {\n\t\treturn ent.getItemCount(Block.wood.blockID);\n\t}",
"@Override\n\tpublic int boardCateCount(String key) {\n\t\treturn dao.boardCateCount(session, key);\n\t}",
"public int pixelCount()\n {\n int pixelCount = cat.getWidth() * cat.getHeight();\n return pixelCount;\n\n }",
"public int getNumCaught() {\r\n\t\tint count = 0;\r\n\t\tfor (int poke : caughtPokemon.values()) {\r\n\t\t\tcount += poke;\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"public int getCount() {\n return definition.getInteger(COUNT, 1);\n }",
"public int amountOfBuffs() {\r\n return buffs.size();\r\n }",
"public int countHandShakes(){\n\t\tif (this.getNCouples() < 1) {\n\t\t\treturn 0;\n\t\t}else if (this.getNCouples() == 1) {\n\t\t\treturn 1;\n\t\t}else{\n\t\t\tthis.setNCouples(this.getNCouples() - 1);\n\t\t\treturn (this.getNCouples() + 1) * 3 - 2 + countHandShakes();\n\t\t}\n\t}",
"public int getLikesCount() {\n return instance.getLikesCount();\n }",
"public int getCardCount() {\n\t\treturn this.cardsInhand.size();\n\t}",
"public int getMountainCount() {\n\t\tcounter = 0;\n\t\tfor (int row = 0; row < battlefield.length; row++) {\n\t\t\tfor (int column = 0; column < battlefield[row].length; column++) {\n\t\t\t\tif (battlefield[row][column].getTerrain().getIcon() == \"M\") {\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn counter;\n\t}",
"public int getChannelCount() {\n if (channelBuilder_ == null) {\n return channel_.size();\n } else {\n return channelBuilder_.getCount();\n }\n }",
"public int getTrucksCount() {\n if (trucksBuilder_ == null) {\n return trucks_.size();\n } else {\n return trucksBuilder_.getCount();\n }\n }",
"public int getBallsCount() {\n return balls.size();\n }",
"public int getHealthCount() {\n return healthCount;\n }",
"public int getArmyCount() {\n\n return this.totArmyCount;\n }",
"int getWayCount();",
"public int getClicks() {\n return clicks;\n }",
"public int getCoins() {\r\n\t\treturn collectionManager.getCoins();\r\n\t}",
"public int size(){\n\t\treturn howMany; \n\t}",
"public Integer getChapterCount() {\n return chapterCount;\n }",
"public int getNumOfPlayerPieces() {\n return playerPiecePositions.length;\n }",
"public int getBinCapicityFilled() {\n int binCapicity = 0;\n for( Packet p: packets) {\n binCapicity += p.getPacketHeight();\n }\n return binCapicity;\n\n }",
"public int getNumberOfDefeats() {\r\n\t\tint numDefeats = 0;\r\n\t\tfor (int i = 0; i < 2; i++) {\r\n\t\t\tfor (int j = 1; j <= 3; j++) {\r\n\t\t\t\tif (militaryVPS[i][j] == -1)\r\n\t\t\t\t\tnumDefeats++;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn numDefeats;\r\n\t}",
"public int size() {\n return deck.size();\n }",
"public int getK9Count(){\r\n\t\t//if(_debug) Log.v(_context, \"NotificationViewFlipper.getK9Count() K9Count: \" + _k9Count);\r\n\t\treturn _k9Count;\r\n\t}",
"public Integer getBuyCount() {\n return buyCount;\n }",
"public int getCardCount() {\r\n\t\treturn this.cards;\r\n\t}",
"public int getDraws() {\n return draws;\n }"
] | [
"0.74223775",
"0.7336743",
"0.7191363",
"0.7161836",
"0.7055025",
"0.68476",
"0.6806004",
"0.6695457",
"0.6676748",
"0.66746795",
"0.6634694",
"0.66184574",
"0.66184574",
"0.6591023",
"0.65477335",
"0.65278",
"0.6513718",
"0.6487737",
"0.64630514",
"0.6401696",
"0.6385017",
"0.6372805",
"0.63685817",
"0.6361979",
"0.6354034",
"0.6349387",
"0.6339174",
"0.6316248",
"0.6300384",
"0.6299557",
"0.6299557",
"0.62774396",
"0.62774396",
"0.6267074",
"0.6264663",
"0.62578154",
"0.62359995",
"0.62176514",
"0.62070477",
"0.62011695",
"0.6180217",
"0.6172042",
"0.6168501",
"0.6159108",
"0.6154912",
"0.6147288",
"0.61421674",
"0.61386317",
"0.61210966",
"0.61201257",
"0.611813",
"0.61095303",
"0.61022294",
"0.6101558",
"0.6097062",
"0.60960454",
"0.6090459",
"0.608691",
"0.60852385",
"0.6084947",
"0.60794115",
"0.60787064",
"0.6076366",
"0.60706234",
"0.60701823",
"0.6066944",
"0.6066215",
"0.606462",
"0.6063424",
"0.60588497",
"0.60570794",
"0.6040881",
"0.6034819",
"0.60313165",
"0.6029099",
"0.6024487",
"0.6022546",
"0.6021191",
"0.6016855",
"0.60129076",
"0.6007966",
"0.6006015",
"0.60056686",
"0.5998664",
"0.5996795",
"0.5996326",
"0.59951806",
"0.5994849",
"0.5991827",
"0.5986092",
"0.5984012",
"0.5972513",
"0.59712243",
"0.59711915",
"0.5967081",
"0.59646684",
"0.5960312",
"0.5960262",
"0.5954251",
"0.5953396"
] | 0.68700814 | 5 |
Get the current measure | @Override
public int getCurrentMeasure() {
return this.currentMeasure;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract double getMeasure();",
"public Location getMeasureStart() {\n if(measureStart == null) {\n return currentLocation;\n } else {\n return measureStart;\n }\n }",
"Measure getMeasure ()\n {\n return null;\n }",
"@Override\n public double getMeasure() {\n return getFuelEffieciency();\n }",
"public String getMeasureResult() {\r\n return measureResult;\r\n }",
"protected abstract float getMeasurement();",
"public abstract double getMeasurement();",
"public abstract double getMeasurement();",
"public Location getMeasureStop() {\n if(measureStart == null) {\n return currentLocation;\n } else {\n return measureStop;\n }\n }",
"public float getUtilityMeasure() {\n return utilityMeasure;\n }",
"public String getUnitOfMeasure() {\r\n return this.unitOfMeasure;\r\n }",
"private static MeasureProcessing getMeasureProcessing() {\n if(measure == null) {\n measure = new MeasureProcessing();\n }\n return measure;\n }",
"public Measure getMeasureId() {\r\n\t\treturn measureId;\r\n\t}",
"public MeasureExport getMeasureExport() {\n\t\treturn measureExport;\n\t}",
"public String getMeasureId() {\r\n\t\treturn measureId;\r\n\t}",
"public Date getdMeasureTime() {\r\n return dMeasureTime;\r\n }",
"public MeasureDefinition getMeasuredBy() {\n\t\treturn measuredBy;\n\t}",
"public String getUnitOfMeasure() {\r\n\t\t\r\n\t\treturn McsElement.getElementByXpath(driver, \"//input[@name='unitOfMeasure']/following-sibling::input[@type='text']\").getAttribute(\"value\");\r\n\t}",
"public double getCurrent( )\n {\n // Implemented by student.\n }",
"int measure();",
"public synchronized double measure(long newWhen) {\n return measure(newWhen - when, newWhen);\n }",
"@Override\n public List<String> getMeasures() {\n return measures;\n }",
"public Measure<?, ?> getLowerMeasure() {\n return this.lowerMeasure;\n }",
"public Measure<?, ?> getUpperMeasure() {\n return this.upperMeasure;\n }",
"public String getCurrentScale() {\n return currentScale;\n }",
"public String getMeasurementValue() {\n\t\t\t\t\t\treturn measurementValue;\n\t\t\t\t\t}",
"public String getMeasuredUnitId() {\n return this.measuredUnitId;\n }",
"Measurement getAccumulation();",
"public double getCurrent() {\n return elevatorSpark.getOutputCurrent();\n }",
"public String getUnitOfMeasurement() {\r\n\t\treturn unitOfMeasurement;\r\n\t}",
"public String getMetric() {\n return metric;\n }",
"@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Long getManagementElapsed() {\n return (java.lang.Long)__getInternalInterface().getFieldValue(MANAGEMENTELAPSED_PROP.get());\n }",
"public String getMetric() {\n return this.metric;\n }",
"double getCurrentTfConsumed();",
"public double getCurrentValue()\r\n\t{\r\n\t\tcurrentValue=(2*border+24)/2;\r\n\t\treturn currentValue;\r\n\t}",
"@ComputerMethod\n private FloatingLong getEnergyUsage() {\n return getActive() ? energyContainer.getEnergyPerTick() : FloatingLong.ZERO;\n }",
"public double getReading() {\r\n\t\tresult = clicks;\r\n\t\tif(metric) result *= 0.2;\r\n\t\telse result *= 0.01;\r\n\t\treturn result;\r\n\t\t\r\n\t}",
"@gw.internal.gosu.parser.ExtendedProperty\n public java.lang.Long getManagementElapsed() {\n return (java.lang.Long)__getInternalInterface().getFieldValue(MANAGEMENTELAPSED_PROP.get());\n }",
"public float getCurrentDimValue() {\n\t\treturn currentDimValue;\n\t}",
"public CharSequence obtainTextToMeasure() {\n return this.textView.getText();\n }",
"public final ArrayList<Double> getMeasureValues() {\r\n return this.measureValues;\r\n }",
"MeasureType getQuantity();",
"public float getDisp();",
"public boolean isMeasured() {\n return _isMeasured;\n }",
"public float getCurrentValue() {\n return currentValue;\n }",
"@Override\n public double getValue() {\n return currentLoad;\n }",
"public double getLiveDemand() {\n\n return liveConsumption;\n }",
"public String getCurrentContent() {\n return this.currentUnit.chStored;\n }",
"@Override\n\tpublic IMetricDimension getMetricUnit() {\n\n\t\t// TODO Auto-generated method stub\n\t\treturn null;\n\t}",
"public double getPDPTotalCurrent() { return totalCurrent; }",
"@ComputerMethod\n private FloatingLong getEnergyUsage() {\n return energyContainer.getEnergyPerTick();\n }",
"@Override\n public synchronized double get() {\n if (m_running) {\n return ((getMsClock() - m_startTime) + m_accumulatedTime) / 1000.0;\n }\n return m_accumulatedTime;\n }",
"public String getUnit()\n {\n return (this.unit);\n }",
"Metrics getMetrics();",
"public float getCurrentX(){\n return curX;\n }",
"MetricOuterClass.Metric getMetricControl();",
"public interface Measurable {\n double getMeasure();\n}",
"public float getElapsed()\n {\n return this.elapsed;\n }",
"public int getUnits()\n {\n return m_cCurUnits;\n }",
"@Override\r\n public double doubleValue() {\r\n return this.m_current;\r\n }",
"public Measure getMeasureInstanceByName(String name) {\n\t\tBasicStoredCube last_cube = BasicCubes.get(BasicCubes.size() - 1);\n\t\tfor (int i = 0; i < last_cube.Msr.size(); i++) {\n\t\t\tMeasure msr = last_cube.Msr.get(i);\n\t\t\tif (msr.getName().equals(name))\n\t\t\t\treturn msr;\n\t\t}\n\t\treturn null;\n\t}",
"@JsonIgnore\n\tpublic DecimalMeasure<Temperature> getTemperatureAsMeasure()\n\t{\n\t\treturn this.temperatureAsMeasure;\n\t}",
"public String toString()\n {\n return \"Measure (\" + id + \") = '\" + systolic + \"|\" + diastolic + \"' @ \" + time;\n }",
"double computeFMeasure() {\n\t\tfMeasure = (2 * recall * precision) / (recall + precision);\n\t\treturn fMeasure;\n\t}",
"public long getCurrent() {\n m_Runtime = Runtime.getRuntime();\n m_Total = m_Runtime.totalMemory();\n\n return m_Total;\n }",
"public float getCurrentRatio(){\n return mCurZoomRatio;\n }",
"@Override\r\n\tpublic long getCurrent() {\n\t\treturn 0;\r\n\t}",
"protected float getDpUnit() {\n return mDpUnit;\n }",
"public Perf getPerf() {\n\t\treturn perf;\n\t}",
"public Identifier getCostUnitOfMeasureIdentifier()\r\n\t{\r\n\t\treturn costUnitOfMeasureIdentifier;\r\n\t}",
"GrossWeightMeasureType getGrossWeightMeasure();",
"public double getCurrentSpeed(){\r\n return speed;\r\n }",
"public String getUnit();",
"public void measure(){\n \tend = System.nanoTime(); \n \tlong elapsedTime = end - start;\n\n \t//convert to seconds \n \tseconds = (double)elapsedTime / 1000000000.0f;\n \tend =0; //歸零\n \tstart =0;\n }",
"public String unit() {\n return this.unit;\n }",
"public double ElectricCurrent() {\n return OCCwrapJavaJNI.Units_Dimensions_ElectricCurrent(swigCPtr, this);\n }",
"@Override\r\n\tpublic int getMS() {\n\t\treturn MS;\r\n\t}",
"ChargeableWeightMeasureType getChargeableWeightMeasure();",
"@Override\n public double getMeasure(String additionalMeasureName) {\n\n if (additionalMeasureName.equalsIgnoreCase(\"measureNumRules\")) {\n return tree.getNumLeaves();\n }\n if (additionalMeasureName.equalsIgnoreCase(\"measureNumPositiveRules\")) {\n return tree.numPosRulesAndNumPosConditions()[0];\n }\n if (additionalMeasureName\n .equalsIgnoreCase(\"measureNumConditionsInPositiveRules\")) {\n return tree.numPosRulesAndNumPosConditions()[1];\n } else {\n throw new IllegalArgumentException(additionalMeasureName\n + \" not supported (MultiInstanceRuleLearner)\");\n }\n }",
"public double recallMemory() {\n return memoryValue;\n }",
"public String getMetricName() {\n return this.MetricName;\n }",
"public double getSetpoint() {\n return getController().getSetpoint();\n }",
"String getUnit();",
"public double GetSetpoint() {\n\t\treturn msc.GetSetpoint();\n\t}",
"public double getCurrentAmount() {\n return this.currentAmount;\n }",
"public jkt.hms.masters.business.MasUnitOfMeasurement getUnitOfMeasurement() {\n\t\treturn unitOfMeasurement;\n\t}",
"public double getCurrentFuel();",
"public float getCurrentTime () {\n\t\treturn timer;\n\t}",
"@Override\n\tpublic double getMetricValue() {\n\n\t\t// TODO Auto-generated method stub\n\t\treturn 0;\n\t}",
"public Integer getMeterNumerator() {\n return this.meterNumerator;\n }",
"public double getM() {\r\n return m;\r\n }",
"public double getSetpoint() {\n \treturn this.CTCSpeed;\n }",
"@Override\n public Enumeration<String> enumerateMeasures() {\n\n Vector<String> newVector = new Vector<String>(3);\n newVector.addElement(\"measureNumRules\");\n newVector.addElement(\"measureNumPositiveRules\");\n newVector.addElement(\"measureNumConditionsInPositiveRules\");\n return newVector.elements();\n }",
"public double getReading() {\n return this.getDataRef().get();\n }",
"public BigDecimal getConsumption() {\n return consumption;\n }",
"public List<Measure> getRepeat(){\n\t\treturn meas;\n\t}",
"io.netifi.proteus.admin.om.Metrics getMetrics();",
"double getStep() {\n\t\t\treturn scale;\n\t\t}",
"public void setMeasuredBy(MeasureDefinition measure) {\n\t\t\n\t\tthis.measuredBy = measure;\n\t}",
"public float getMetric(){\n float distance = 0.0f;\n MeasurementService.DataPoint prv = center;\n\n for(MeasurementService.DataPoint d : list){\n distance += Math.sqrt(\n Math.pow(prv.getX() - d.getX(),2) +\n Math.pow(prv.getY() - d.getY(),2)\n );\n prv = d;\n }\n\n return distance;\n }"
] | [
"0.77550644",
"0.7651668",
"0.74597204",
"0.7319198",
"0.73188126",
"0.7205173",
"0.71149874",
"0.71149874",
"0.70359814",
"0.70238006",
"0.6982464",
"0.6958864",
"0.69499665",
"0.690612",
"0.6854039",
"0.66617626",
"0.65809333",
"0.65400875",
"0.6509898",
"0.64924496",
"0.64097375",
"0.637383",
"0.63126755",
"0.6270461",
"0.62328166",
"0.6215185",
"0.6208878",
"0.6198493",
"0.6189102",
"0.61828905",
"0.6175385",
"0.6137441",
"0.61314845",
"0.6130995",
"0.6129439",
"0.612333",
"0.6121661",
"0.6115259",
"0.60629123",
"0.6050308",
"0.6048233",
"0.6036705",
"0.6031285",
"0.59695035",
"0.5963303",
"0.5950816",
"0.5942656",
"0.5938643",
"0.59195375",
"0.5912844",
"0.5895573",
"0.58795416",
"0.5877231",
"0.58754265",
"0.58712745",
"0.5869282",
"0.5865516",
"0.5846902",
"0.58423424",
"0.58390784",
"0.58300704",
"0.58230084",
"0.5815918",
"0.5815654",
"0.5812841",
"0.57910866",
"0.57882214",
"0.5783452",
"0.5771517",
"0.57580364",
"0.57531524",
"0.57512283",
"0.57446223",
"0.57382995",
"0.5735222",
"0.57254285",
"0.5720874",
"0.57183635",
"0.5716965",
"0.5712954",
"0.57068896",
"0.57057494",
"0.56965905",
"0.56854284",
"0.5685322",
"0.56818223",
"0.5677969",
"0.567402",
"0.56738806",
"0.56708276",
"0.566586",
"0.56601334",
"0.5658067",
"0.56568825",
"0.56434095",
"0.56376386",
"0.56367886",
"0.56363374",
"0.56076354",
"0.55951834"
] | 0.88975155 | 0 |
Sets the current measure | @Override
public void setCurrentMeasure(int beat) {
if (beat >= this.getHeadNotes().size() && beat != 0) {
throw new IllegalArgumentException("Beat out of bound");
}
this.currentMeasure = beat;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public int getCurrentMeasure() {\n return this.currentMeasure;\n }",
"public void setMeasureStart(Location measureStart) {\n this.measureStart = measureStart;\n }",
"public void setMeasuredBy(MeasureDefinition measure) {\n\t\t\n\t\tthis.measuredBy = measure;\n\t}",
"public void setMeasureSpace(float measurespace) {\n\t\tthis.measurespace = measurespace;\n\t}",
"public void editMeasures() {\r\n \t\tdialogFactory.getDialog(new MeasurePanel(model, model, model), \"Define performance indices\");\r\n \t}",
"public void setMeasureIdentification(final Identifier newValue) {\n checkWritePermission(measureIdentification);\n measureIdentification = newValue;\n }",
"public void setMeasureID(Integer measureID) {\n this.measureID = measureID;\n }",
"protected final void setMeasureValue(String inMeasureId, String inValue) {\r\n\t\tcache.setValue(inMeasureId, inValue);\r\n\t}",
"public abstract double getMeasure();",
"@Override\r\n\tpublic void setCurrent(double iCurrent) {\n\r\n\t}",
"void addMeasure(double currentMeasure) {\n\t\t// If there is no more failed allowed, do nothing\n\t\tif(isTraining()) {\n\t\t\t/* Repeat 4x times from the second time\n\t\t\t * What we do is add:\n\t\t\t * (measure 3 - measure 2) + (measure 4 - measure 3) + ... */\n\t\t\tif(1 <= remainingLearnExample && remainingLearnExample <= 4)\n\t\t\t\tappendMeasureToSlope(currentMeasure);\n\t\t\t/* We need to keep the current measure for the next time\n\t\t\t * the method is called */\n\t\t\tlastMeasure = currentMeasure;\n\n\t\t\tremainingLearnExample--;\n\t\t\tif(remainingLearnExample == 0) {\n\t\t\t\t// If the random freq gave better results, keep it\n\t\t\t\tupdateBestFrequency();\n\t\t\t\trandomExploFreq = random.nextDouble(0.01, 1);\n\t\t\t\treset();\n\t\t\t}\n\t\t}\n\t}",
"public void setMeasureExport(MeasureExport measureExport) {\n\t\tthis.measureExport = measureExport;\n\t}",
"public void addMeasureProperty(Property measure, String label){\n\t\tdataCubeModel.add(measure, RDF.type, QB.MeasureProperty);\n\t\tdataCubeModel.add(measure, RDFS.label, label);\n\t}",
"public void setMeasureId(Measure measureId) {\r\n\t\tthis.measureId = measureId;\r\n\t}",
"public String getMeasureId() {\r\n\t\treturn measureId;\r\n\t}",
"public void setUnit () {\n\t\tdouble f = factor;\n\t\t/* Transform the value as a part of Unit */\n\t\tif (Double.isNaN(value)) return;\n\t\tif ((mksa&_log) != 0) {\n\t\t\tif ((mksa&_mag) != 0) value *= -2.5;\n\t\t\tfactor *= AstroMath.dexp(value);\n\t\t\tvalue = 0;\n\t\t}\n\t\telse {\n\t\t\tfactor *= value;\n\t\t\tvalue = 1.;\n\t\t}\n\t\t// Transform also the symbol\n\t\tif (f != factor) {\n\t\t\tif (symbol == null) symbol = edf(factor);\n\t\t\telse symbol = edf(factor) + toExpr(symbol);\n\t\t}\n\t}",
"public void setdMeasureTime(Date dMeasureTime) {\r\n this.dMeasureTime = dMeasureTime;\r\n }",
"public void setIsMeasured(boolean isMeasured) {\n _isMeasured = isMeasured;\n setDirty(true);\n }",
"public void setMeasureResult(String measureResult) {\r\n this.measureResult = measureResult;\r\n }",
"public void setMeasureId(String measureId) {\r\n\t\tthis.measureId = measureId;\r\n\t}",
"public MolapMeasure(String measureName) \r\n\t{\r\n\t\tthis.measureName = measureName;\r\n\t}",
"public Measure getMeasureId() {\r\n\t\treturn measureId;\r\n\t}",
"Measure getMeasure ()\n {\n return null;\n }",
"public void setMeasureDescription(final InternationalString newValue) {\n checkWritePermission(measureDescription);\n measureDescription = newValue;\n }",
"private void updateFMeasure(){\n double precisionValue = precision.get(precision.size()-1);\n double recallValue = recall.get(recall.size()-1);\n if(precisionValue==0.0 || recallValue==0.0){\n fMeasures.add(0.0);\n }else{\n fMeasures.add((2*precisionValue*recallValue)/(precisionValue+recallValue));\n }\n \n }",
"public void setUnitOfMeasure(String unitOfMeasure) {\r\n this.unitOfMeasure = unitOfMeasure;\r\n }",
"@Override\r\n public boolean visit (Measure measure)\r\n {\r\n // Adjust measure abscissae\r\n if (!measure.isDummy()) {\r\n measure.resetAbscissae();\r\n }\r\n\r\n // Set measure id, based on a preceding measure, whatever the part\r\n Measure precedingMeasure = measure.getPreceding();\r\n\r\n // No preceding system?\r\n if (precedingMeasure == null) {\r\n ScoreSystem prevSystem = (ScoreSystem) measure.getSystem()\r\n .getPreviousSibling();\r\n\r\n if (prevSystem != null) { // No preceding part\r\n precedingMeasure = prevSystem.getFirstRealPart()\r\n .getLastMeasure();\r\n }\r\n }\r\n\r\n if (precedingMeasure != null) {\r\n measure.setId(precedingMeasure.getId() + 1);\r\n } else {\r\n // Very first measure\r\n measure.setId(measure.isImplicit() ? 0 : 1);\r\n }\r\n\r\n return true;\r\n }",
"@Override\n public void setMeasures(List<String> measures) {\n this.measures = measures;\n }",
"@Override\n public double calculate(double measurement, double setpoint) {\n // Set setpoint to provided value\n setSetpoint(setpoint);\n return calculate(measurement);\n }",
"public void setValue(int measureIndex, Double value) {\r\n\t\tvalues[measureIndex] = value != null ? value : Double.NaN;\r\n\t}",
"@Override\n public double getMeasure() {\n return getFuelEffieciency();\n }",
"public static void registerMeasure(String name, ParticleMeasure.MeasurePropertyType t)\n\t\t{\n\t\tsynchronized (measures)\n\t\t\t{\n\t\t\tmeasures.put(name, t);\n\t\t\t}\n\t\t}",
"public void set(double d);",
"public void setText(String text) {\n\t\tif (measureType != null) {\n\t\t\tsuper.setText(text + \" \" + measureType);\n\t\t} else {\n\t\t\tsuper.setText(text);\n\t\t}\n\t}",
"private void setMemory() {\n\t\tlong allMemory = MemoryManager.getPhoneTotalRamMemory();\n\t\tlong freeMemory = MemoryManager.getPhoneFreeRamMemory(this);\n\t\tlong usedMemory = allMemory - freeMemory;\n\t\tint angle = (int) (usedMemory*360/allMemory);\n\t\tclearView.setAngleWithAnim(angle);\n\t}",
"@Override\n\tpublic void setPersonal_4_HalfGaugeMeter() \n\t{\n\t}",
"public void set(double val);",
"public void setSetpoint(double setpoint) {\n \tthis.CTCSpeed = setpoint;\n }",
"@Override\n public double calculate(double measurement) {\n return calculate(measurement) + (m_Kf * getSetpoint());\n }",
"public void setCurrentSpeed (double speed);",
"protected abstract float getMeasurement();",
"@Override\n public void setMetric(final Metric metric) {\n this.metric = metric;\n }",
"public abstract void setDecimation(float decimation);",
"public void onMeasure(int i, int i2) {\n AppMethodBeat.m2504i(38322);\n super.onMeasure(i, i2);\n AppMethodBeat.m2505o(38322);\n }",
"public String getMeasureResult() {\r\n return measureResult;\r\n }",
"public Location getMeasureStart() {\n if(measureStart == null) {\n return currentLocation;\n } else {\n return measureStart;\n }\n }",
"@Update\n void update(Measurement measurement);",
"public void setSetpoint(double setpoint);",
"void setCurrentAmount(double newAmount) {\n this.currentAmount = newAmount;\n }",
"public MeasureExport getMeasureExport() {\n\t\treturn measureExport;\n\t}",
"public void setMeasurementActive(String recordKey, boolean enabled) {\r\n\t\tif (isRecordSetVisible(GraphicsType.HISTO) && this.histoSet.getTrailRecordSet().containsKey(recordKey)) {\r\n\t\t\tif (!enabled) this.histoGraphicsTabItem.getGraphicsComposite().cleanMeasurementPointer();\r\n\t\t\tthis.histoSet.getTrailRecordSet().setMeasurementMode(recordKey, enabled);\r\n\t\t\tTrailRecord trailRecord = (TrailRecord) this.histoSet.getTrailRecordSet().get(recordKey);\r\n\t\t\tif (enabled && !trailRecord.isVisible()) {\r\n\t\t\t\tthis.histoGraphicsTabItem.getCurveSelectorComposite().setRecordSelection(trailRecord, true);\r\n\t\t\t\tthis.histoGraphicsTabItem.getGraphicsComposite().redrawGraphics();\r\n\t\t\t}\r\n\t\t\tif (enabled) this.histoGraphicsTabItem.getGraphicsComposite().drawMeasurePointer(this.histoSet.getTrailRecordSet(), HistoGraphicsMode.MEASURE, false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tboolean isGraphicsTypeNormal = isRecordSetVisible(GraphicsType.NORMAL);\r\n\t\t\tRecordSet recordSet = isGraphicsTypeNormal ? Channels.getInstance().getActiveChannel().getActiveRecordSet() : this.compareSet;\r\n\t\t\tif (recordSet != null && recordSet.containsKey(recordKey)) {\r\n\t\t\t\tif (isGraphicsTypeNormal) {\r\n\t\t\t\t\trecordSet.setMeasurementMode(recordKey, enabled);\r\n\t\t\t\t\tif (enabled)\r\n\t\t\t\t\t\tthis.graphicsTabItem.getGraphicsComposite().drawMeasurePointer(recordSet, GraphicsMode.MEASURE, false);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tthis.graphicsTabItem.getGraphicsComposite().cleanMeasurementPointer();\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.compareTabItem != null && !this.compareTabItem.isDisposed()) {\r\n\t\t\t\t\trecordSet = DataExplorer.application.getCompareSet();\r\n\t\t\t\t\tif (recordSet != null && recordSet.containsKey(recordKey)) {\r\n\t\t\t\t\t\trecordSet.setMeasurementMode(recordKey, enabled);\r\n\t\t\t\t\t\tif (enabled)\r\n\t\t\t\t\t\t\tthis.compareTabItem.getGraphicsComposite().drawMeasurePointer(recordSet, GraphicsMode.MEASURE, false);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthis.compareTabItem.getGraphicsComposite().cleanMeasurementPointer();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setMach(float Mach);",
"private static MeasureProcessing getMeasureProcessing() {\n if(measure == null) {\n measure = new MeasureProcessing();\n }\n return measure;\n }",
"public void setFactor(Double factor);",
"public void set(float signal);",
"public abstract double getMeasurement();",
"public abstract double getMeasurement();",
"public void setSelDataPoint(DataPoint aDP)\n{\n if(SnapUtils.equals(aDP, _selPoint)) return;\n firePropChange(SelDataPoint_Prop, _selPoint, _selPoint = aDP);\n repaint();\n}",
"public ChunkDataSetBuilder addMeasure(BugPronenessMeasure measure) {\n\t\tthis.measures.add(measure);\n\t\tthis.attributes.addAttribute(new Attribute(measure.getName()));\n\t\treturn this;\n\t}",
"public void startMeasuring() {\n\tsuper.startMeasuring();\n}",
"public void setX(double X)\r\n {\r\n curX = X;\r\n }",
"public void setScaleX(double aValue)\n{\n if(aValue==getScaleX()) return;\n repaint();\n firePropertyChange(\"ScaleX\", getRSS().scaleX, getRSS().scaleX = aValue, -1);\n}",
"public void setSkewX(double aValue)\n{\n if(aValue==getSkewX()) return;\n repaint();\n firePropertyChange(\"SkewX\", getRSS().skewX, getRSS().skewX = aValue, -1);\n}",
"public void addMeasureSpecs(Resource component, String label, Resource measureProperty){\n\t\tdataCubeModel.add(component, RDF.type, QB.ComponentSpecification);\n\t\tdataCubeModel.add(component, RDFS.label, label);\n\t\tdataCubeModel.add(component, QB.measure, measureProperty);\n\t}",
"public void setDataRetentionPeriodUnitOfMeasure(com.exacttarget.wsdl.partnerapi.RecurrenceTypeEnum.Enum dataRetentionPeriodUnitOfMeasure)\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(DATARETENTIONPERIODUNITOFMEASURE$28, 0);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DATARETENTIONPERIODUNITOFMEASURE$28);\n }\n target.setEnumValue(dataRetentionPeriodUnitOfMeasure);\n }\n }",
"public void setCurrentValue(float currentValue) {\n this.currentValue = currentValue;\n }",
"public final void set(float scale) {\n\tm00 = scale; m01 = 0.0f; m02 = 0.0f;\n\tm10 = 0.0f; m11 = scale; m12 = 0.0f;\n\tm20 = 0.0f; m21 = 0.0f; m22 = scale;\n }",
"@Override\n public void setSetpoint(double setpoint) {\n if (getController() != null) {\n getController().setSetpoint(Utilities.clip(setpoint, Constants.Hood.MIN_ANGLE, Constants.Hood.MAX_ANGLE));\n }\n super.setSetpoint(Utilities.clip(setpoint, Constants.Hood.MIN_ANGLE, Constants.Hood.MAX_ANGLE));\n }",
"public void setFxSpotMargen(double value) {\r\n this.fxSpotMargen = value;\r\n }",
"void setScale(ScaleSelector sensor, int scaleNo);",
"void setValue(double value);",
"public void setSkewY(double aValue)\n{\n if(aValue==getSkewY()) return;\n repaint();\n firePropertyChange(\"SkewY\", getRSS().skewY, getRSS().skewY = aValue, -1);\n}",
"public synchronized double measure(long newWhen) {\n return measure(newWhen - when, newWhen);\n }",
"public void setFlete(double param){\n \n this.localFlete=param;\n \n\n }",
"@Override\n\tpublic void setMontant(double s) {\n\t\t\n\t}",
"public void setMark( String newMark )\n\t\t{\n\t\t\tmark = newMark; // set mark of square\n\t\t\trepaint(); //repaint square\n\t\t}",
"@java.lang.Override\n\tpublic java.lang.String toString()\n\t{\n\t\treturn \"SetMetric\";\n\t}",
"public T add(T measure);",
"public final void set () {\t\n\t\tsymbol = null;\t\n\t\tmksa = underScore; factor = 1;\n\t\tvalue = 0./0.;\t\t\t// NaN\n\t\toffset = 0.;\n\t}",
"public void setTotal(Double total);",
"public void setMagnitude()\n {\n magnitude = (float) Math.sqrt(Math.pow(fx, 2) + Math.pow(fy, 2) + Math.pow(fz, 2));\n }",
"private void updateAmplificationValue() {\n ((TextView) findViewById(R.id.zoomUpDownText)).setText(String.valueOf(curves[0].getCurrentAmplification()));\n }",
"public void setDm(double value) {\n this.dm = value;\n }",
"private void checkPaintMeasures() {\r\n\t\t\r\n\t\t//Check from change\r\n\t\tint sizeNow = fontSize;\r\n\t\tif(sizeNow == sizeThen)return;\r\n\t\tsizeThen = sizeNow;\r\n\t\t\r\n\t\t//Set units\r\n\t\tmarkWidth = (double) sizeNow / 15;\r\n\t\tsizePaintLength = p.textLength(text, surface, sizeNow, bold, italic);\r\n\t\tif (viewPaintLength != viewPaintLength) viewPaintLength = sizePaintLength;\r\n\t}",
"@Override\n public List<String> getMeasures() {\n return measures;\n }",
"public void setValue(double newvalue){\n value = newvalue;\n }",
"public void setScaleY(double aValue)\n{\n if(aValue==getScaleY()) return;\n repaint();\n firePropertyChange(\"ScaleY\", getRSS().scaleY, getRSS().scaleY = aValue, -1);\n}",
"int measure();",
"protected final void registerMeasure(String inId) {\r\n\t\tmeasureIds.add(inId);\r\n\t}",
"@Override\n public void onChanged(Measurement measurement) {\n updateTextViews(measurement.getTimeStamp(),\n measurement.isGi(), measurement.getAmount(),\n measurement.getStress(), measurement.getTired(), measurement.isPhysicallyActivity(),\n measurement.isAlcoholConsumed(), measurement.isIll(), measurement.isMedication(),\n measurement.isPeriod(), measurement.getGlucoseStart(), measurement.getGlucose15(),\n measurement.getGlucose30(), measurement.getGlucose45(), measurement.getGlucose60(),\n measurement.getGlucose75(), measurement.getGlucose90(), measurement.getGlucose105(),\n measurement.getGlucose120()\n );\n }",
"public Date getdMeasureTime() {\r\n return dMeasureTime;\r\n }",
"public void setValue(double value) {\n this.value = value; \n }",
"public void setCurrentQuantity(int currentQuantity) {\n this.currentQuantity = currentQuantity;\n }",
"public void setDeltaMeasurementActive(String recordKey, boolean enabled) {\r\n\t\tif (log.isLoggable(Level.OFF)) log.log(Level.OFF, recordKey);\r\n\t\tif (isRecordSetVisible(GraphicsType.HISTO) && this.histoSet.getTrailRecordSet().containsKey(recordKey)) {\r\n\t\t\tif (!enabled) this.histoGraphicsTabItem.getGraphicsComposite().cleanMeasurementPointer();\r\n\t\t\tthis.histoSet.getTrailRecordSet().setDeltaMeasurementMode(recordKey, enabled);\r\n\t\t\tTrailRecord trailRecord = (TrailRecord) this.histoSet.getTrailRecordSet().get(recordKey);\r\n\t\t\tif (enabled && !trailRecord.isVisible()) {\r\n\t\t\t\tthis.histoGraphicsTabItem.getCurveSelectorComposite().setRecordSelection(trailRecord, true);\r\n\t\t\t\tthis.histoGraphicsTabItem.getGraphicsComposite().redrawGraphics();\r\n\t\t\t}\r\n\t\t\tif (enabled) this.histoGraphicsTabItem.getGraphicsComposite().drawMeasurePointer(this.histoSet.getTrailRecordSet(), HistoGraphicsMode.MEASURE_DELTA, false);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tboolean isGraphicsTypeNormal = isRecordSetVisible(GraphicsType.NORMAL);\r\n\t\t\tRecordSet recordSet = isGraphicsTypeNormal ? Channels.getInstance().getActiveChannel().getActiveRecordSet() : this.compareSet;\r\n\t\t\tif (recordSet != null && recordSet.containsKey(recordKey)) {\r\n\t\t\t\tif (isGraphicsTypeNormal) {\r\n\t\t\t\t\trecordSet.setDeltaMeasurementMode(recordKey, enabled);\r\n\t\t\t\t\tif (enabled)\r\n\t\t\t\t\t\tthis.graphicsTabItem.getGraphicsComposite().drawMeasurePointer(recordSet, GraphicsMode.MEASURE_DELTA, false);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tthis.graphicsTabItem.getGraphicsComposite().cleanMeasurementPointer();\r\n\t\t\t\t}\r\n\t\t\t\telse if (this.compareTabItem != null && !this.compareTabItem.isDisposed()) {\r\n\t\t\t\t\trecordSet = DataExplorer.application.getCompareSet();\r\n\t\t\t\t\tif (recordSet != null && recordSet.containsKey(recordKey)) {\r\n\t\t\t\t\t\trecordSet.setDeltaMeasurementMode(recordKey, enabled);\r\n\t\t\t\t\t\tif (enabled)\r\n\t\t\t\t\t\t\tthis.compareTabItem.getGraphicsComposite().drawMeasurePointer(recordSet, GraphicsMode.MEASURE_DELTA, false);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tthis.compareTabItem.getGraphicsComposite().cleanMeasurementPointer();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void setRoll(double aValue)\n{\n if(aValue==getRoll()) return;\n repaint();\n firePropertyChange(\"Roll\", getRSS().roll, getRSS().roll = aValue, -1);\n}",
"public String getUnitOfMeasure() {\r\n return this.unitOfMeasure;\r\n }",
"public void meditate() {\n int currentSamuraiHealth = this.getHealth();\n this.setHealth(currentSamuraiHealth/2 + currentSamuraiHealth);\n System.out.println(\"Samurai's new health is : \" + this.getHealth());\n }",
"public void setManagementElapsed(java.lang.Long value) {\n __getInternalInterface().setFieldValue(MANAGEMENTELAPSED_PROP.get(), value);\n }",
"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 }",
"void setDeviation(double deviation);"
] | [
"0.7176087",
"0.71060824",
"0.7001359",
"0.6494067",
"0.640679",
"0.63901657",
"0.6363213",
"0.6239401",
"0.62338966",
"0.61595356",
"0.61522865",
"0.6136587",
"0.6082984",
"0.606849",
"0.5995068",
"0.59769136",
"0.5923077",
"0.5889956",
"0.5887741",
"0.58687484",
"0.58599174",
"0.58542204",
"0.5843557",
"0.58212453",
"0.5785611",
"0.57694846",
"0.57309043",
"0.572329",
"0.56672955",
"0.5649531",
"0.56098413",
"0.56021315",
"0.5589342",
"0.557791",
"0.55665624",
"0.556293",
"0.55477554",
"0.55100864",
"0.5498802",
"0.5495949",
"0.54950845",
"0.54597193",
"0.54571384",
"0.54497445",
"0.54257226",
"0.542385",
"0.5412012",
"0.541148",
"0.540598",
"0.54000086",
"0.5395342",
"0.5389463",
"0.5388764",
"0.53802085",
"0.5361378",
"0.5361148",
"0.5361148",
"0.53611076",
"0.53282195",
"0.5322716",
"0.53226644",
"0.5280421",
"0.52764356",
"0.5275787",
"0.5257645",
"0.5243336",
"0.52408034",
"0.5234664",
"0.5211736",
"0.51811796",
"0.51705366",
"0.51694643",
"0.516635",
"0.5165205",
"0.51650435",
"0.51648873",
"0.5162393",
"0.5156625",
"0.51509845",
"0.51448673",
"0.51442665",
"0.51396894",
"0.51372826",
"0.5131052",
"0.51292074",
"0.5124523",
"0.51168406",
"0.51146585",
"0.5114285",
"0.5111806",
"0.5103024",
"0.5102674",
"0.5097139",
"0.50962955",
"0.5095372",
"0.5091759",
"0.5090419",
"0.5079902",
"0.50772196",
"0.5076818"
] | 0.6726183 | 3 |
This method is called directly by the timer and runs in the same thread as the timer. We call the method that will work with the UI through the runOnUiThread method. | private void timerMethod() {
getActivity().runOnUiThread(refreshListView);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void TimerMethod() {\n this.runOnUiThread(Timer_Tick);\n }",
"@Override\n public void runOnUiThread(Runnable r) {\n }",
"@Override\n\tpublic void run() {\n\t\t((Activity)context).runOnUiThread(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tString string = context.getString(R.string.message_timer, MainActivity.TIMER_TASK_PERIOD / 1000);\n\t\t\t\tToast.makeText(context, string, Toast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tLog.e(\"timer\",\"calling\");\n\t\t\t\tMessage message = mHandler.obtainMessage();\n\t\t\t\tmessage.sendToTarget();\n\n\t\t\t}",
"private void updateUI() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n\n if(timer_count==5) {\n\n //Animation Starts by Singing Si\n animateReceiveMoney();\n animateSendMoney();\n PlayIntoSound(siID);\n\n tvSiOut.setVisibility(View.VISIBLE);\n tvSiIn.setVisibility(View.VISIBLE);\n tvDoIn.setVisibility(View.VISIBLE);\n tvDoOut.setVisibility(View.VISIBLE);\n tvSIDO.setVisibility(View.VISIBLE);\n tvSIDO.setText(\"SI\");\n }\n\n else if(timer_count==20){\n //Animation Ends by Singing Do\n PlayIntoSound(doID);\n\n //dISPLAY DO TEXT\n tvSIDO.setText(\"SIDO\");\n\n\n }\n\n else if(timer_count==25){\n\n //DISPLAY mONEY TRANSFER TEXT\n tvMoneyTransfer.setVisibility(View.VISIBLE);\n\n }\n\n }\n });\n }",
"private void m50364C() {\n m50412n().runOnUiThread(new C11092g(this));\n }",
"public void run() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n TextView tdate=(TextView)findViewById(R.id.textview_time);\n long date=System.currentTimeMillis();\n SimpleDateFormat sdf=new SimpleDateFormat(\"hh-mm a\");\n String dateString=sdf.format(date);\n tdate.setText(dateString);\n }\n });\n }",
"@Override\n public void run() {\n if (!started) {\n timerTxt.setText(\"00:00:00\");\n }\n else {\n long currentTime = System.currentTimeMillis() - startTime;\n updateTime = currentTime;\n int secs = (int) (updateTime / 1000);\n int mins = secs / 60;\n int hours = mins / 60;\n secs %= 60;\n timerTxt.setText(\"\" + String.format(\"%02d\", hours) + \":\" + String.format(\"%02d\", mins) + \":\" + String.format(\"%02d\", secs), TextView.BufferType.EDITABLE);\n handler.post(this);\n }\n }",
"@Override\n public void run() {\n time_ = (int) (System.currentTimeMillis() - startTime_) / 1000;\n updateUI();\n\n if (time_ >= maxTime_) {\n // Log.v(VUphone.tag, \"TimerTask.run() entering timeout\");\n handler_.post(new Runnable() {\n public void run() {\n report(true);\n }\n });\n }\n }",
"public abstract void runOnUiThread(Runnable runnable);",
"@Override\n public void run() {\n updateInstanceFields();\n updateUI();\n /* and here comes the \"trick\" */\n updateHandler.postDelayed(this, 100);\n }",
"public void run() {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\tThread.sleep(500L);\n\t\t\t\t\t// Thread.sleep(30);\n\t\t\t\t\trunOnUiThread(done);\n\n\t\t\t\t} catch (InterruptedException 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}",
"@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tupdateUI();\n\t\t\t\t\t\t}",
"@Override\n public void run() {\n textTimer.setText(String.valueOf(currentTime));\n }",
"public void run() {\n\t\t\t\t\t\tif (!compositeUnderDisplay.isDisposed()) {\n\t\t\t\t\t\t\tfinal DeviceUI ui = (DeviceUI) compositeUnderDisplay;\n\t\t\t\t\t\t\tui.updateTimers(deviceUnderDisplay, kind, duration);\n\t\t\t\t\t\t}\n\t\t\t\t\t}",
"@Override\r\n public void run() {\n if (D) Log.w(TAG, \"Wait Progress Timeout\");\r\n // stop timer\r\n cancelProgressBar();\r\n\r\n if (mProgressBarSupperCallback != null) {\r\n mProgressBarSupperCallback.onSupperTimeout();\r\n }\r\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\tpostInvalidate();\r\n\t\t\t//postDelayed(this, SCROLLER_DISTANCE);\r\n\t\t}",
"private void updateUI() {\n handler_.post(new Runnable() {\n public void run() {\n bar_.setProgress(time_);\n String remTimeStr = \"\" + (maxTime_ - time_);\n timeRemaining_.setText(REM_STRING.replace(\"?\", remTimeStr));\n }\n });\n }",
"private void timerStart()\r\n { updateTimer.postDelayed(updateTimerTask, UPDATE_TIME); }",
"public void doWork() {\r\n runOnUiThread(new Runnable() {\r\n @SuppressWarnings(\"deprecation\")\r\n public void run() {\r\n try{\r\n TextView txtCurrentTime= (TextView)findViewById(R.id.time);\r\n Date dt = new Date();\r\n int hours = dt.getHours();\r\n int minutes = dt.getMinutes();\r\n int seconds = dt.getSeconds();\r\n\r\n String time = \"AM\";\r\n String min = Integer.toString(minutes);\r\n String sec =Integer.toString(seconds);\r\n\r\n if (hours > 12) {\r\n hours = hours - 12;\r\n time = \"PM\";\r\n }\r\n if (hours == 12)\r\n {\r\n time = \"PM\";\r\n }\r\n if (minutes < 10){\r\n DecimalFormat formatter = new DecimalFormat(\"00\");\r\n min = formatter.format(minutes);\r\n }\r\n if (seconds < 10){\r\n DecimalFormat formatter = new DecimalFormat(\"00\");\r\n sec = formatter.format(seconds);\r\n }\r\n String curTime = hours + \":\" + min + \":\" + sec;\r\n txtCurrentTime.setText(\"Current Time: \" + curTime + \" \" + time);\r\n\r\n int i=0, x=0;\r\n for (String temp [] : stops){\r\n int size = temp.length;\r\n\r\n Log.i(\"StopsActivity_x\", \"x is: \" + x);\r\n for (i=2; i<size; i++){\r\n\r\n if (temp[i].contains (\"AM\") || temp[i].contains (\"PM\")){\r\n\r\n Log.i(\"StopsActivity_x\", \"temp is: \" + temp[i]);\r\n //Log.i(\"StopsActivity_stops\", temp[i]);\r\n String split[] = temp[i].split(\":\");\r\n int stopTime = Integer.parseInt(split[0]);\r\n\r\n if (split[1].contains(\"PM\") && stopTime != 12) {\r\n stopTime = stopTime + 12;\r\n } else if (split[1].contains(\"AM\") && stopTime == 12)\r\n stopTime = 0;\r\n\r\n //Log.i(\"StopsActivity_test\", \"12-hour time is: \" + split[0] + \" 24 hour time is: \" + stopTime);\r\n\r\n int currHour = hours;\r\n\r\n if (time.contains(\"PM\") && currHour != 12) {\r\n currHour = currHour + 12;\r\n } else if (time.contains(\"AM\") && currHour == 12)\r\n currHour = 0;\r\n\r\n //Log.i(\"StopsActivity_test\", \"12-hour current time is: \" + hours + \" 24 hour current time is: \" + currHour);\r\n\r\n Log.i (\"StopsActivity_x\", \"stopTime is: \" + stopTime + \" and currHour is: \" + currHour);\r\n if (stopTime == currHour) {\r\n\r\n String busSplit[] = split[1].split(\" \");\r\n\r\n int curMin = Integer.parseInt(min);\r\n int busMin = Integer.parseInt(busSplit[0]);\r\n\r\n if (busMin > curMin) {\r\n String des = \"Next Bus at: \" + temp[i];\r\n routeItems.get(x).setRouteDescription(des);\r\n //TextView nextTime = (TextView) view.findViewById(R.id.nextbus);\r\n //nextTime.setText(\"Next Bus at: \" + temp[i]);\r\n break;\r\n }\r\n }\r\n else if (stopTime > currHour) {\r\n\r\n //TextView nextTime = (TextView) view.findViewById(R.id.nextbus);\r\n //nextTime.setText(\"Next Bus at: \" + temp[i]);\r\n String des = \"Next Bus at: \" + temp[i];\r\n routeItems.get(x).setRouteDescription(des);\r\n break;\r\n }\r\n }\r\n }\r\n x++;\r\n }\r\n }\r\n catch (Exception e) {}\r\n }\r\n });\r\n }",
"@Override\n public void run() {\n long seconds = millisUntilFinished / 1000;\n long minutes = seconds / 60;\n\n String time = minutes % 60 + \":\" + seconds % 60;\n// double timeInDouble = Double.parseDouble(time);\n if(minutes >= 0 && seconds >= 0)holder.setText(time);\n else holder.setText(\"Task Completed\");\n\n millisUntilFinished -= 1000;\n\n Log.d(\"DEV123\",time);\n// imageView.setX(imageView.getX()+seconds);\n /* and here comes the \"trick\" */\n handler.postDelayed(this, 1000);\n }",
"protected void updateUI() {\n this.runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n // TODO Auto-generated method stub\n xWakeupUncalibratedGyro.setText(\"Wakeup Uncalibrated Gyro X:\\n\"\n + mWakeupUncalibratedGyroData[0]);\n yWakeupUncalibratedGyro.setText(\"Wakeup Uncalibrated Gyro Y:\\n\"\n + mWakeupUncalibratedGyroData[1]);\n zWakeupUncalibratedGyro.setText(\"Wakeup Uncalibrated Gyro Z:\\n\"\n + mWakeupUncalibratedGyroData[2]);\n }\n });\n }",
"@Override\n public void onClick(View v) {\n startTime = SystemClock.uptimeMillis();\n\n //postDelayed will have the runnable to be added to the message queue by the specified\n //value which in this case would be 0\n handler.postDelayed(runnable, 0);\n\n //This will make the reset button inactive while the timer is going\n reset.setEnabled(false);\n }",
"@Override\n public void run() {\n BookInfo.this.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mSwipyRefreshLayout.setRefreshing(false);\n }\n });\n }",
"@Override\n\t public void run()\n\t {\n\t \ttv_sys_uptime.setText(getUptime()); \n\t mHandler.postDelayed(this, 1000);\n\t }",
"@Override\r\n\t\tpublic void run() {\n\t\t\tSystem.out.println(\"updateThread\");\r\n\t\t\thandler.postDelayed(updateThread, 3000);\r\n\t\t}",
"public void run() {\n if (currentTimer <= TIMEOUT_VALUE) {\n currentTimer++; // Increments the timer value.\n readySongTimerHandler.postDelayed(this, 1000); // Thread is run again in 1000 ms.\n }\n\n // Displays an timeout error message and stops the ready song timer thread.\n else {\n SSToast.toastyPopUp(\"The track could not be played due to a time-out error.\", getApplicationContext());\n pauseTrack(true); // Stops attempted playback of track.\n stopSongPrepare(true); // Signals the SSPlayerFragment to stop song preparation conditions.\n currentTimer = 0; // Resets the current timer value.\n readySongTimerHandler.removeCallbacks(this);\n }\n }",
"@Override\n public void run() {\n runOnUiThread(new Runnable() {\n public void run() {\n\n if (page > 5) {\n mViewPager.setCurrentItem(page);\n\n // In my case the number of pages are 5\n// timer.cancel();\n// // Showing a toast for just testing purpose\n// Toast.makeText(getApplicationContext(), \"Timer stoped\",\n// Toast.LENGTH_LONG).show();\n } else {\n mViewPager.setCurrentItem(page++);\n }\n }\n });\n\n }",
"private void runTimer() {\n\n // Handler\n final Handler handler = new Handler();\n\n handler.post(new Runnable() {\n @Override\n public void run() {\n\n if (playingTimeRunning) {\n playingSecs++;\n }\n\n handler.postDelayed(this, 1000);\n }\n });\n\n }",
"@Override\n public void onClick(View v) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n gameStatus.restartTimer();\n View v1 = findViewById(R.id.game_layout);\n View v = findViewById(R.id.dlb_game_over_view);\n v.setVisibility(View.GONE);\n gameView.resetLife();\n gameView.setRunning(true);\n v1.setVisibility(View.VISIBLE);\n }\n });\n }",
"@Override\r\n\t\t public void run() {\r\n\t\t\t\tPlatform.runLater(new Runnable() {\r\n\t\t\t\t\tpublic void run() {\r\n\t\t \t timerLabel.setText(\"Time left: \" + countDown);\r\n\t\t countDown--;\r\n\t\t if (countDown < 0){timer.cancel();}\r\n\t\t\t}});}",
"@Override\n public void run() {\n Message uiMSG;\n //Create message with only SHOW_ORIGINAL_COLOR argument\n uiMSG = BackgroundThread.this.uiHandler.obtainMessage(BidirectionalMessageActivity.SHOW_ORIGINAL_COLOR, 0, 0, null);\n BackgroundThread.this.uiHandler.sendMessage(uiMSG); //Send start message to UI thread\n\n fillProgressbar(progressBar); //Fill progress bar as a long time operation\n //Message with information SHOW_NEW_COLOR as a end of long time operation\n uiMSG = BackgroundThread.this.uiHandler.obtainMessage(BidirectionalMessageActivity.SHOW_NEW_COLOR, 0, 0, null);\n BackgroundThread.this.uiHandler.sendMessage(uiMSG); //Message with end result is sent\n }",
"@Override\n public void run() {\n SimpleDateFormat todayFormat = new SimpleDateFormat(\"dd-MMM-yyyy\");\n String todayKey = todayFormat.format(Calendar.getInstance(TimeZone.getDefault(), Locale.getDefault()).getTime());\n contactsToday.setText(\"Today's exposure score: \" + prefs.getInt(todayKey, 0));\n if (isVisible) {\n chartView.loadUrl(generateChartString(prefs.getInt(\"chartMode\", 2))); //update the chart\n }\n\n //show the devices contirbuting--this is not visible by default because the textView that holds it is set to GONE but can be turned pn\n String dispResult = \"\";\n for (String i : scanData.getInstance().getData().keySet()) {\n ScanResult temp = scanData.getInstance().getData().get(i);\n if (temp.getRssi() > LIST_THRESH) {\n dispResult = dispResult + temp.getDevice().getAddress() + \" : \" + temp.getDevice().getName() + \" \" + temp.getRssi() + \"\\n\";\n }\n }\n status.setText(dispResult);\n\n handler.postDelayed(this, 30000);\n\n }",
"@Override\n\tpublic void runOnUiThread( final Runnable action ) {\n\t\tif ( mContext != null ) ( (Activity) mContext ).runOnUiThread( action );\n\t}",
"@Override\n public void run() {\n handler.postDelayed(runnableCode, apiCallFrequency);\n\n //Initiates reload of forceLoad() in TickerLoader\n reload();\n }",
"@Override\n\t\tpublic void run()\n\t\t{\n\t\t\tif (mStartTime == -1)\n\t\t\t{\n\t\t\t\tmStartTime = System.currentTimeMillis();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * We do do all calculations in long to reduce software float\n\t\t\t\t * calculations. We use 1000 as it gives us good accuracy and\n\t\t\t\t * small rounding errors\n\t\t\t\t */\n\t\t\t\tlong normalizedTime =\n\t\t\t\t\t\t(1000 * (System.currentTimeMillis() - mStartTime))\n\t\t\t\t\t\t\t\t/ mDuration;\n\t\t\t\tnormalizedTime = Math.max(Math.min(normalizedTime, 1000), 0);\n\t\t\t\tfinal int deltaY =\n\t\t\t\t\t\tMath.round((mScrollFromY - mScrollToY)\n\t\t\t\t\t\t\t\t* mInterpolator\n\t\t\t\t\t\t\t\t\t\t.getInterpolation(normalizedTime / 1000f));\n\t\t\t\tmCurrentY = mScrollFromY - deltaY;\n\t\t\t\t// setHeaderScroll(mCurrentY);\n\t\t\t\tfinal int maximumPullScroll = getMaximumPullScroll();\n\t\t\t\tint value =\n\t\t\t\t\t\tMath.min(maximumPullScroll,\n\t\t\t\t\t\t\t\tMath.max(-maximumPullScroll, mCurrentY));\n\t\t\t\t// Log.d(TAG, \"value:\" + value);\n\t\t\t\t// 动态设置HeadView的位置 达到动画效果\n\t\t\t\tLayoutParams params =\n\t\t\t\t\t\t(LayoutParams) mHeaderView.getLayoutParams();\n\t\t\t\tparams.topMargin = value;\n\t\t\t\tmHeaderView.setLayoutParams(params);\n\t\t\t\tmHandler.sendEmptyMessage(0);\n\t\t\t}\n\t\t\t// If we're not at the target Y, keep going...\n\t\t\tif (mContinueRunning && mScrollToY != mCurrentY)\n\t\t\t{\n\t\t\t\tViewCompat.postOnAnimation(PullToRefreshView.this, this);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (null != mListener)\n\t\t\t\t{\n\t\t\t\t\tmListener.onSmoothScrollFinished();\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n public void run() {\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n Log.d(\"UI thread\", \"I am the UI thread\");\n Log.i(TAG,\"Make Call: \"+selGroup);\n makeCall();\n }\n });\n /*\n MainActivity.this.myView.post(new Runnable() {\n public void run() {\n Log.d(\"UI thread\", \"I am the UI thread\");\n Log.i(TAG,\"Make Call: \"+selGroup);\n makeCall();\n }\n });\n */\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tMusicActivity.lrcView.SetIndex(new LrcIndex().LrcIndex());\n\t\t\tMusicActivity.lrcView.invalidate();\n\t\t\tmHandler.postDelayed(mRunnable, 100);\n\t\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tif(mVideoView != null && mVideoView.isPlaying())\n\t\t\t\t\tstartTimer();\n\t\t\t}",
"public void run()\n \t\t{\n \t\t\t//Update the timer label\n \t\t\tsetTime();\n \t\t}",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile(mActivityPauseFlag != 1)\n\t\t\t\t{\n\n\t\t\t\t\tint mins = getSleepTimeValue();\n\t\t\t\t\tmSleepTimeHour = mins / 60;\n\t\t\t\t\tmSleepTimeMin = mins % 60;\n\t\t\t\t\t\n\t\t\t\t\tif(quickmenu.isShowing())\n\t\t\t\t\t{\n\t\t\t\t\t\thandler.sendEmptyMessage(MSG_REFRESH_TIMER);\n\t\t\t\t\t}\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(5000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}",
"public void run() {\n mTextView.setTranslationY(-mTextView.getHeight());\n mTextView.animate().setDuration(duration / 2).translationY(0).alpha(1)\n .setInterpolator(sDecelerator);\n }",
"public void mo64138d() {\n postDelayed(new Runnable() {\n /* class com.zhihu.android.app.p1011ad.pushad.$$Lambda$AbstractNotificationView$HVHAzhbCxIMQZsjZXHKewL15mps */\n\n public final void run() {\n AbstractNotificationView.lambda$HVHAzhbCxIMQZsjZXHKewL15mps(AbstractNotificationView.this);\n }\n }, 6000);\n }",
"@Override\n public void run() {\n mHandler.post(new Runnable() {\n\n @Override\n public void run() {\n // display toast\n locationupdate();\n }\n\n });\n }",
"public void run() {\n\t\t\tif (minutes == 0 && hours > 0) {\n\t\t\t\thours--;\n\t\t\t\tminutes = 60;\n\t\t\t}\n\t\t\tif (seconds == 0 && minutes > 0) {\n\t\t\t\tminutes--;\n\t\t\t\tseconds = 60;\n\t\t\t\tClientUI.clientHandler.handleMessageFromClientUI(\"getExamChanges:::\" + examID);\n\t\t\t\tString[] respond = stringSplitter.dollarSplit((String) ClientHandler.returnMessage);\n\t\t\t\tif (respond[0].equals(\"approved\") && flag) {\n\t\t\t\t\tflag = false;\n\t\t\t\t\tupdateClock(respond[1]);\n\t\t\t\t}\n\t\t\t\tif (respond[0].equals(\"locked\")) {\n\t\t\t\t\thours = 0;\n\t\t\t\t\tminutes = 0;\n\t\t\t\t\tseconds = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tseconds--;\n\t\t\ttimeString = String.format(\"%02d:%02d:%02d\", hours, minutes, seconds);\n\t\t\tTimerDisplayTxt.setText(timeString);\n\t\t\tif (hours == 0 && minutes == 0 && seconds == 0)\n\t\t\t\texemTimeOver();\n\t\t}",
"private void timmer() {\n showTimmerOptions();\n\n\n\n final int val = 500;\n taskProgressInner = (ProgressBar) findViewById(com.ryansplayllc.ryansplay.R.id.TaskProgress_Inner);\n new Thread(new Runnable() {\n public void run() {\n int tmp = (val / 100);\n\n for (int incr = 0; incr <= val; incr++) {\n\n try {\n taskProgressInner.setProgress(incr);\n if ((incr % 100) == 0) {\n tmp--;\n }\n Thread.sleep(10);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }).start();\n\n // intilaizating count down timer object\n progressDialog.dismiss();\n countDownTimer = new CountDownTimer(4000, 1000) {\n\n public void onTick(long millisUntilFinished) {\n countDownTextView.setText(Long\n .toString(millisUntilFinished / 1000));\n\n\n }\n\n public void onFinish() {\n\n countDownTextView.setText(\"0\");\n\n\n isSelectable = false;\n\n\n // changing text view if player is not umpire\n if (!Utility.isUmpire) {\n\n runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n String message = \"Waiting for the Umpire result.\";\n// showWaitingPopUp(message);\n showBallinPlayView();\n final ImageView gamescreenbackground = (ImageView) findViewById(com.ryansplayllc.ryansplay.R.id.umpirescreenfield);\n gamescreenbackground.setImageResource(com.ryansplayllc.ryansplay.R.drawable.baseball_field);\n\n\n }\n });\n }\n // calling method to submit result\n submitPlayerPrediction();\n }\n };\n isSelectable = true;\n countDownTimer.start();\n\n }",
"public void run()\r\n {\n \tm_Handler.sendEmptyMessage(JMSG_TIMER);\r\n }",
"@Override\n public void run() {\n getUserServiceability();\n handler.postDelayed(this, 20000);\n }",
"@Override\n \t public void run() {\n \t while (true) {\n \t try {\n \t Thread.sleep(3000);\n \t mHandler.post(new Runnable() {\n\n \t @Override\n \t public void run() {\n \t // TODO Auto-generated method stub\n \t // Write your code here to update the UI.\n \t \tGetMessageUnreadFunc();\n \t }\n \t });\n \t } catch (Exception e) {\n \t // TODO: handle exception\n \t }\n \t }\n \t }",
"@Override\n public void onClick(View v) {\n timeBuff += mSecTime;\n\n //removeCallbacks will remove the runnable that are in the message queue\n handler.removeCallbacks(runnable);\n\n //this will enable the reset button\n reset.setEnabled(true);\n }",
"public void run() {\n handler.post(new Runnable() {\n public void run() {\n\n //TODO CALL NOTIFICATION FUNC\n String lg_ti = \"Test.\";\n String des_ti = \"The license valid until \";\n String ban_ti = \"Warning!\";\n getNotificationData();\n //notificationShow(des_ti,lg_ti,ban_ti);\n }\n });\n }",
"@Override\n public void run() {\n sec++;\n if (sec > 9) {\n sec = 0;\n min++;\n }\n timer.setText(String.format(\"%02d\", sec) + \":\" + String.format(\"%02d\", min));\n handler.postDelayed(this, 1000);\n }",
"public void run() {\n handler.post(new Runnable() {\n public void run() {\n YOURNOTIFICATIONFUNCTION();\n\n Log.e(\"WWWWW\", \"WWWWWWWWW\" + timer);\n\n }\n });\n }",
"@Override\n public void run()\n {\n\n runOnUiThread(new Runnable()\n {\n @Override\n public void run()\n {\n if(bShift)\n if(iconShift!=null)iconShift.setBackgroundResource(R.drawable.shifting);\n else\n if(iconShift!=null)iconShift.setBackgroundResource(R.drawable.shift);\n\n //\n //Check combination status\n if(bOrdering)\n {\n\n if(!menuInitd)\n {\n Thread t = new Thread(new Runnable()\n {\n @Override\n public void run()\n {\n bInternet = getConnectionStatus();\n }\n });\n menuInitd = true;\n }\n\n //Check internet status\n if(bInternet)\n {\n if(iconInternet!=null)iconInternet.setBackgroundResource(R.drawable.internet);\n if(iconInput!=null)iconInput.setBackgroundResource(R.drawable.input);//tell user to input order\n //txtNotif.setText(\"<Empty>\");\n }\n else\n {\n if(iconInput!=null)iconInput.setBackgroundResource(R.drawable.no_input);//no internet - input would be kinda useless - for now\n if(iconInternet!=null)iconInternet.setBackgroundResource(R.drawable.no_internet);\n }\n\n //Set status\n switch(item.getRecStat())\n {\n case 0:\n if(iconStatus!=null)iconStatus.setBackgroundResource(R.drawable.exclaim);\n break;\n case 1:\n if(iconStatus!=null)iconStatus.setBackgroundResource(R.drawable.pending);\n break;\n case 2:\n if(iconStatus!=null)iconStatus.setBackgroundResource(R.drawable.ready);\n break;\n case 3:\n if(iconStatus!=null)iconStatus.setBackgroundResource(R.drawable.cancelled);\n break;\n default:\n if(iconStatus!=null)iconStatus.setBackgroundResource(R.drawable.question);\n break;\n }\n }\n else\n {\n //Reset icons\n if(txtNotif!=null)txtNotif.setText(\"\");\n if(iconInput!=null)iconInput.setBackgroundResource(R.drawable.rad);\n if(iconInternet!=null)iconInternet.setBackgroundResource(R.color.black);\n if(iconStatus!=null)iconStatus.setBackgroundResource(R.color.black);\n }\n }\n });\n }",
"public void m14058b() {\n if (this.f18063n == null) {\n this.f18063n = new Handler();\n }\n this.f18063n.postDelayed(new C33311(this), 3000);\n }",
"@Override\n public void run() {\n if (isRunScreenSaver == true) { //如果屏保正在显示,就计算不断持续显示\n//\t\t\t\thideOriginalLayout();\n showScreenSaver();\n mHandler02.postDelayed(mTask02, intervalScreenSaver);\n } else {\n mHandler02.removeCallbacks(mTask02); //如果屏保没有显示则移除线程\n }\n }",
"@Override \n\t\tpublic void run() {\n\t\t\trunOnUiThread(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tIGPSService gpsService = gpsServiceConnection.getServiceIfBound();\n\t\t\t \tif (gpsService != null) {\n\t\t\t \t\ttry {\n\t\t\t \t\t\tmLastSuccess.setText(gpsService.getLastSuccessfulRequest());\n\t\t\t\t\t\t} catch (RemoteException e) {\n\t\t\t\t\t\t\tLog.d(LocationUtils.APPTAG, e.getLocalizedMessage());\n\t\t\t\t\t\t}\n\t\t\t \t}\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"private void startTimerAfterCountDown() {\n \t\thandler = new Handler();\n \t\tprepareTimeCountingHandler();\n \t\thandler.post(new CounterRunnable(COUNT_DOWN_TIME));\n \t}",
"@Override\n public void run() {\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"hh:mm aa\",\n Locale.getDefault());\n String formattedTime = sdf.format(System.currentTimeMillis());\n tvAlarmTime.setText(formattedTime);\n\n tvAlarmTitle.setText(R.string.snoozed_alarm);\n }",
"void start_timer(){\n tv_verify_downtime.setVisibility(View.VISIBLE);\n countDownTimer.start();\n }",
"public void runOnUiThread(Runnable action) {\n h.post(action);\n }",
"@Override\n public void run() {\n if (timerValidFlag)\n gSeconds++;\n Message message = new Message();\n message.what = 1;\n handler.sendMessage(message);\n }",
"public void run() {\n\t\t\t\t\tmHandler.post(new Runnable() {\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\tprogressbar.setProgress(Integer\r\n\t\t\t\t\t\t\t\t\t.parseInt(tvsp.progress));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t}",
"public void run() {\n runOnUiThread(new Runnable() {\n public void run() {\n imageSwitcher.setImageResource(gallery[position]);\n position++;\n if (position == 8) {\n position = 0;\n }\n }\n });\n }",
"public void run(){\n \t\t\t\tif (duration>0) {\r\n \t\t\t\t\trecord.startRecording();\r\n \t\t\t\t\tstpBtn.setEnabled(true);\r\n \t\t\t\t\t//psBtn.setEnabled(true); //TODO: pause button action\r\n \t\t\t\t\t(new Timer()).schedule(new TimerTask() {\r\n \t\t\t\t\t\tpublic void run () {\r\n \t\t\t\t\t\t\t//stop recording\r\n \t\t\t\t\t\t\trecord.stopRecording();\r\n \t\t\t\t\t\t\trcrdBtn.setEnabled(true);\r\n \t\t\t\t\t\t\tstpBtn.setEnabled(false);\r\n \t\t\t\t\t\t\tpsBtn.setEnabled(false);\r\n \t\t\t\t\t\t}\r\n \t\t\t\t\t}, duration);\r\n \t\t\t\t} else { //countdown, no timer\r\n \t\t\t\t\t//start recording\r\n \t\t\t\t\trecord.startRecording();\r\n \t\t\t\t\t//stop and pause buttons come visible after countdown has run\r\n \t\t\t\t\trcrdBtn.setEnabled(false);\r\n \t\t\t\t\tstpBtn.setEnabled(true);\r\n \t\t\t\t\t//psBtn.setEnabled(true); TODO: implement pause action\r\n \t\t\t\t\t//TODO: Mimimize frame to taskbar\r\n \t\t\t\t}\r\n \t\t\t}",
"private void setNewTimer() {\n if (!isSetNewTimerThreadEnabled) {\n return;\n }\n\n timer = new Timer();\n timer.scheduleAtFixedRate(new TimerTask() {\n\n @Override\n public void run() {\n // Send the message to the handler to update the UI of the GameView\n GameActivity.this.handler.sendEmptyMessage(UPDATE);\n\n // For garbage collection\n System.gc();\n }\n\n }, 0, 17);\n }",
"@Override\n public void run() {\n codeTime--;\n get_code_btn.setText(codeTime + \"s\");\n if (codeTime <= 0) {\n if (timer != null) {\n timer.cancel();\n }\n get_code_btn.setText(\"获取验证码\");\n isGetVerification=false;\n }\n }",
"@Override\n public void onClick(View v) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n doClickOnButton();\n }\n });\n }",
"public void run() {\n loadAlertAnimationDelay(aType);\n }",
"@Override\n public void run() {\n while(timerFlag){\n\n if(count == 700){\n\n if(timer_count == true) {\n //TODO 업데이트가 되어 오면 true로 변경경\n break;\n }\n else if(timer_count ==false)\n {\n /* MainActivity.getInstance().showToastOnWorking(\"제어가 되지 않았습니다.\");*/\n\n //timer\n Message msg = timercountHandler.obtainMessage();\n msg.what = 1;\n msg.obj = getResources().getString(R.string.not_controled);//\"제어가 동작하지 않았습니다.\";\n timercountHandler.sendMessage(msg);\n count = 0;\n\n Message msg1 = timercountHandler.obtainMessage();\n msg1.what = 2;\n timercountHandler.sendMessage(msg1);\n\n// deviceUIsetting();\n break;\n }\n }\n\n count++;\n// Log.d(TAG,\"count : \" + count);\n\n try {\n Thread.sleep(CONTROL_OPTIONS_TIMEOUT);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n\n }\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\twhile((second--)!=1) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\tPlatform.runLater(new Runnable() {\r\n\t\t\t\t\t\t @Override\r\n\t\t\t\t\t\t public void run() {\r\n\t\t\t\t\t\t\t SetTime();\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t});\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tsubmitbtn.setDisable(true);\r\n\t\t\tbackbtn.setDisable(false);\r\n\t\t\t}",
"public void timerCallBack() {\r\n\t\tif (!ConfigManager.IS_MUSIC) {\r\n\t\t\tmusicBtn.setCurrentTileIndex(1);\r\n\t\t}\r\n\t\tif (!ConfigManager.IS_SOUND) {\r\n\t\t\tsoundBtn.setCurrentTileIndex(1);\r\n\t\t}\r\n\r\n\t\t// TODO Auto-generated method stub\r\n\t\tif (bgSettingSpr.isVisible()) {\r\n\t\t\tif (isSetting) {\r\n\t\t\t\tif (!musicBtn.isVisible()) {\r\n\t\t\t\t\tshowSettingButton(true);\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tbgSettingSpr.setVisible(false);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tbgSettingSpr.setVisible(false);\r\n\t\t\tsettingBtn.setCurrentTileIndex(0);\r\n\r\n\t\t\tif (musicBtn.isVisible()) {\r\n\t\t\t\tshowSettingButton(false);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}",
"@Override\n public void run() {\n progressBar.setVisibility(View.GONE);\n // Esse método será executado sempre que o timer acabar\n // E inicia a activity principal\n Intent i = new Intent(SplashAct.this, LogEnter.class);\n startActivity(i);\n\n // Fecha esta activity\n finish();\n }",
"@Override\n protected void onPostExecute(String s) {\n\n super.onPostExecute(s);\n loading.dismiss();\n parseAndShow(s);\n //startTime = SystemClock.uptimeMillis();\n //handler.postDelayed(updateTimerThread, 0);\n //startTimer();\n\n }",
"public void run() {\n handler.post(new Runnable() {\r\n public void run() {\r\n // Toast.makeText(getApplicationContext(), \"driver view refresh\", Toast.LENGTH_SHORT).show();\r\n \t\t\r\n\t\t\tarraylist_destination.clear();\r\n\t\t\tarraylist_driverid.clear();\r\n\t\t\tarraylist_riderid.clear();\r\n\t\t\tarraylist_drivername.clear();\r\n\t\t\tarraylist_pickuptime.clear();\r\n\t\t\tarraylist_tripid.clear();\r\n\t\t\tarraylist_driver_image.clear();\r\n\t\t\tarraylist_rider_image.clear();\r\n\t\t\tarraylist_distance.clear();\r\n\t\t\tarraylist_requesttype.clear();\r\n\t\t\tarraylist_start.clear();\r\n\t\t\tarraylist_actualfare.clear();\r\n\t\t\tarraylist_suggestion.clear();\r\n\t\t\tarraylist_eta.clear();\r\n\t\t\tarraylist_driverrating.clear();\r\n\t\t\tarraylist_status.clear();\r\n\t\t\tarraylist_vehicle_color.clear();\r\n\t\t\tarraylist_vehicle_type.clear();\r\n\t\t\tarraylist_vehicle_name.clear();\r\n\t\t\tarraylist_vehicle_img.clear();\r\n\t\t\tarraylist_vehicle_year.clear();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(Utility.isConnectingToInternet(RiderQueue_Activity.this))\r\n \t \t{\r\n \t\t\t\t/**call pending request for rider queue class**/\r\n\t\t\t\tnew httpPendingRequest_riderqueue().execute(); \r\n \t \t\t}\r\n \t \telse{\r\n \t \t\tUtility.alertMessage(RiderQueue_Activity.this,\"error in internet connection\");\r\n \t \t}\r\n\t\t \r\n }\r\n });\r\n }",
"private void runStopHolder() {\n Log.d(TAG, \"stop holder has been just started!\");\n mStopHandler = new Handler(Looper.getMainLooper());\n mStopHolder.setHandler(mStopHandler);\n mStopHandler.postDelayed(mStopHolder, Resources.DISTANCE_CALCULATOR_STOP_DELAY);\n }",
"@Override\r\n\t\t\t\tpublic void run()\r\n\t\t\t\t{\n\t\t\t\t\tsendMessage(UPDATE_TEXTVIEW);\r\n\t\t\t\t\tdo\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(count == size)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tmHandler.sendEmptyMessage(PLAY_END);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttry\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// Log.i(\"\", \"sleep(1000)...\");\r\n\t\t\t\t\t\t\tThread.sleep(1000);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch (InterruptedException e)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\twhile(isPause);\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}",
"private void trackerTimer() {\n\n Thread timer;\n timer = new Thread() {\n\n @Override\n public void run() {\n while (true) {\n\n if (Var.timerStart) {\n try {\n Var.sec++;\n if (Var.sec == 59) {\n Var.sec = 0;\n Var.minutes++;\n }\n if (Var.minutes == 59) {\n Var.minutes = 0;\n Var.hours++;\n }\n Thread.sleep(1000);\n } catch (Exception cool) {\n System.out.println(cool.getMessage());\n }\n\n }\n timerText.setText(Var.hours + \":\" + Var.minutes + \":\" + Var.sec);\n }\n\n }\n };\n\n timer.start();\n }",
"@Override\n public void call(Object... args) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n\n //edit.setText(\"Success!!!!!\");\n Toast.makeText(getApplicationContext(),\"Success send Test \",Toast.LENGTH_LONG).show();\n }\n });\n }",
"@Override\r\n protected void onResume() {\n mDjiGLSurfaceView.resume();\r\n \r\n mTimer = new Timer();\r\n Task task = new Task();\r\n mTimer.schedule(task, 0, 500); \r\n \r\n DJIDrone.getDjiMC().startUpdateTimer(1000);\r\n super.onResume();\r\n }",
"@Override\r\n\tprotected void onResume() {\n\t\tmTextView.postDelayed(animation_runnable, 1000);\r\n\t\tsuper.onResume();\r\n\t}",
"@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tThread.sleep(this.timerTime);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tthis.timerFinished = true;\n\t}",
"@Override\n public void run() {\n if (!MainActivity.pause) {\n MainActivity.fetch = MainActivity.fetch - 1;\n MainActivity.cpbProgress.setProgress(MainActivity.fetch);\n if (MainActivity.fetch < 10) {\n MainActivity.tvTimer.setText(Constant.ZERO + MainActivity.fetch + \"\");\n } else {\n MainActivity.tvTimer.setText(MainActivity.fetch + \"\");\n }\n if (MainActivity.fetch == 0) {\n /*Toast t=Toast.makeText(MainActivity.act, \"Sorry time is Up....\",4000);//////..........not working............///////\n t.show();*/\n finish();\n System.exit(0);\n }\n } else {\n i--;\n }\n }",
"@Override // se crea una clase anonima donde se implementa el metodo run porque Timer task implementa la interfaz runnable\r\n public void run() {\r\n System.out.println(\"Tarea realizada en: \" + new Date() + \" nombre del Thread: \"\r\n + Thread.currentThread().getName()); //retorna el nombre del hilo actual\r\n System.out.println(\"Finaliza el tiempo\");\r\n timer.cancel(); // termina este timer descartando cualquier tarea programada actual\r\n }",
"@Override\n public void run() {\n xWakeupUncalibratedGyro.setText(\"Wakeup Uncalibrated Gyro X:\\n\"\n + mWakeupUncalibratedGyroData[0]);\n yWakeupUncalibratedGyro.setText(\"Wakeup Uncalibrated Gyro Y:\\n\"\n + mWakeupUncalibratedGyroData[1]);\n zWakeupUncalibratedGyro.setText(\"Wakeup Uncalibrated Gyro Z:\\n\"\n + mWakeupUncalibratedGyroData[2]);\n }",
"@Override\n public void run() {\n messageUpdater.run();\n // Re-run it after the update interval\n mHandler.postDelayed(this, UPDATE_INTERVAL);\n }",
"public void onFinish() {\n\n Log.i(\"Done!\", \"Coundown Timer Finished\");\n\n }",
"@Override\n public void onTick(long millisUntilFinished) {\n mCurrentTimer -= 1000;\n mTimer.setText(String.valueOf((int) (millisUntilFinished / 1000)));\n }",
"@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 }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tstartRecallJobTask();\n\t\t\t\tmHandler.postDelayed(mHandlerTask, INTERVAL);\n\t\t\t}",
"@Override\n public void run() {\n super.run();\n\n /*This Looper.prepare() method Prepare the Looper of this current Thread and also\n * make a MessageQueue for this Thread which this Looper can loop through. and Now this Looper\n * is Associated with Current Thread.\n *\n * NOTE: 1. one thing to note that Thread should be in running state while Looper is being\n * prepared.\n *\n * 2. Preparing looper may take some time, and Handler is only prepared after the Looper\n * being Prepared and ready to use.*/\n Looper.prepare();\n\n /*Handler only made when Looper is ready, Current Looper object will implicitly passed to\n * this Handler constructor so that this Handler is Associated with the Looper\n *\n * We can also pass the Looper Object explicitly like:\n * mHandler = new Handler(Looper.getMainLooper());\n * Now this Handler is Associated with the Looper of Main Thread and this handler now can\n * only handle the Main Thread Messages.*/\n mHandler = new Handler(){\n\n /*Now this Message execute the Message Object using this Current Thread, when Looper\n * dequeue the Message from MessageQueue it will return back the Mesasge Object to the\n * Handler which enqueue the Message in MessageQueue*/\n @Override\n public void handleMessage(Message msg) {\n super.handleMessage(msg);\n Log.d(TAG,\"In Handler, Msg = \"+msg.arg1);\n }\n };\n /*loop() method will keep the Thread running until quit method is not called.*/\n Looper.loop();\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\tMusicPlayerContainer.this.adjustInfoTextViewAlpha();\r\n\t\t}",
"@Override\n public void run() { // This is running in the UI Thread so updating the label\n ourLabel.setText(\"We did something\");\n }",
"@Override\n public void run() {\n if(mProgressBar.getProgress() < maxTime) {\n mProgressBar.incrementProgressBy(1);\n if(mProgressListener != null){\n mProgressListener.progress(mProgressBar.getProgress());\n }\n mHandler.postDelayed(timeCount, 1000);\n }else{\n if(mProgressListener != null){\n mProgressListener.finish();\n }\n mHandler.removeCallbacks(timeCount);\n// Log.i(\"slack\",\"timeCount finish...\");\n }\n\n }",
"@Override\n public void run() {\n try {\n // Sleeping\n Thread.sleep(2800);\n } catch (Exception e) {\n Log.e(TAG, e.getMessage());\n }\n\n startMainActivity();\n }",
"public void startTimer() {\n mStatusChecker.run();\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\tfor (int i = 10; i >=0; i--) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsleep(1000);\r\n\t\t\t\t\ttimer.setText(\"시간:\"+i);\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttimer.setText(\"시간종료\");\r\n\t\t\tbtn.setEnabled(false);\r\n\t\t}",
"@Override\n\tpublic void run() {\n\t\t\n\t // Inizializza nome thread\n\t Thread.currentThread().setName(\"Timer\");\n\t \n\t // Richiama procedura di gestione aggiornamento configurazione\n\t update();\n }",
"@Override\n public void run() {\n drawComponents();\n // Ve lai sau 1p\n drawComponentsHandler.postDelayed(drawComponentsRunnable, 60000);\n }",
"public void handleScreenOnTimeout() {\n this.mTimeoutSummary = getTimeoutSummary();\n Slog.e(TAG, this.mTimeoutSummary);\n this.mHandler.sendEmptyMessageDelayed(5, REPORT_DELAY);\n }"
] | [
"0.83312476",
"0.7194935",
"0.7182472",
"0.69755036",
"0.693194",
"0.6827146",
"0.6824895",
"0.67844623",
"0.6691253",
"0.66764224",
"0.6583415",
"0.6552524",
"0.65217125",
"0.6504249",
"0.64918816",
"0.6491603",
"0.6443043",
"0.6438413",
"0.643839",
"0.64230984",
"0.64136475",
"0.63862085",
"0.6382291",
"0.6374916",
"0.63593495",
"0.63498557",
"0.6336009",
"0.6331989",
"0.63184625",
"0.63138425",
"0.631126",
"0.63061213",
"0.6296612",
"0.62898254",
"0.6242634",
"0.6240711",
"0.62359345",
"0.6209606",
"0.61859673",
"0.61375225",
"0.6135653",
"0.61220354",
"0.6115263",
"0.6107322",
"0.6095381",
"0.608258",
"0.607993",
"0.60786194",
"0.60738343",
"0.607059",
"0.6050105",
"0.6042392",
"0.603886",
"0.6032491",
"0.6026723",
"0.6022984",
"0.6022793",
"0.60205096",
"0.6015178",
"0.601375",
"0.6011027",
"0.59815687",
"0.5974673",
"0.59416556",
"0.59389055",
"0.5917505",
"0.5909496",
"0.590835",
"0.58999413",
"0.5896431",
"0.589178",
"0.58878624",
"0.58808327",
"0.5866233",
"0.58554727",
"0.5854519",
"0.584984",
"0.58301073",
"0.5824555",
"0.5822807",
"0.5821383",
"0.58198303",
"0.5815703",
"0.5814408",
"0.5813294",
"0.5812944",
"0.58126634",
"0.5810409",
"0.5809755",
"0.5808898",
"0.5807882",
"0.5802104",
"0.5790874",
"0.57908535",
"0.57880515",
"0.5787673",
"0.5787101",
"0.578668",
"0.5785751",
"0.5783375"
] | 0.73132944 | 1 |
This method runs in the same thread as the UI. Do something to the UI thread here Go through the list of the markers and call that remove on the ones that are too old (5s) | public void run() {
subredditApiRequest = new SubredditApiRequest(SubredditListViewFragment.this);
subredditApiRequest.execute(subreddit);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void removeMarkers() throws CoreException {\r\n if (resource == null) {\r\n return;\r\n }\r\n IMarker[] tMarkers = null;\r\n int depth = 2;\r\n tMarkers = resource.findMarkers(LPEXTask.ID, true, depth);\r\n for (int i = tMarkers.length - 1; i >= 0; i--) {\r\n tMarkers[i].delete();\r\n }\r\n }",
"private void updateMarkers()\n {\n if( mPopulateImagesTask != null )\n mPopulateImagesTask.cancel(true);\n\n mPopulateImagesTask = new PopulateBirdImagesTask()\n {\n @Override\n protected void onPostExecute(List<RemoteSighting> remoteSightings) {\n super.onPostExecute(remoteSightings);\n\n if( mSelectedMarker != null ) {\n // refresh\n mSelectedMarker.hideInfoWindow();\n mSelectedMarker.showInfoWindow();\n }\n }\n };\n mPopulateImagesTask.execute(mBirds);\n\n\n // Now let's create the markers\n Marker marker;\n MarkerOptions markerOptions;\n LatLng location;\n boolean isSelectedMarker = false;\n\n mLocationBirdsMap.clear();\n mMarkerBirdsMap.clear();\n\n float maxbirds = 1.0f; // For marker hue\n\n for( RemoteSighting bird: mBirds )\n {\n location = new LatLng(bird.getLat(), bird.getLng());\n\n if( !mLocationBirdsMap.containsKey(location) )\n mLocationBirdsMap.put(location, new ArrayList<RemoteSighting>());\n\n ArrayList<RemoteSighting> birdsAtLocation = mLocationBirdsMap.get(location);\n birdsAtLocation.add(bird);\n\n if( birdsAtLocation.size() > maxbirds )\n maxbirds = birdsAtLocation.size();\n }\n\n for (Map.Entry<LatLng, ArrayList<RemoteSighting>> entry : mLocationBirdsMap.entrySet()) {\n ArrayList<RemoteSighting> birds = (entry.getValue());\n RemoteSighting firstBird = birds.get(0);\n markerOptions = new MarkerOptions().\n position(entry.getKey()).\n alpha( ((birds.size()/maxbirds) * 0.5f) + 0.5f).\n title(firstBird.getLocName()).\n snippet(birds.size() + (birds.size() > 1 ? \" birds\" : \" bird\") );\n\n if (mSelectedBird != null)\n {\n LatLng birdLocation = entry.getKey();\n LatLng selectedBirdLocation = new LatLng(mSelectedBird.getLat(), mSelectedBird.getLng());\n\n if( selectedBirdLocation.equals(birdLocation)) {\n isSelectedMarker = true;\n }\n }\n\n marker = mMap.addMarker(markerOptions);\n\n if( !mMarkerBirdsMap.containsKey(marker) )\n mMarkerBirdsMap.put(marker, entry.getValue());\n\n if( isSelectedMarker ) {\n mSelectedMarker = marker;\n marker.showInfoWindow();\n isSelectedMarker = false;\n }\n }\n\n\n }",
"void clearMarkers()\n/* */ {\n/* 1019 */ synchronized (this) {\n/* 1020 */ this.typeAheadMarkers.clear();\n/* */ }\n/* */ }",
"@Override\r\n public void clearMarkers() {\r\n if (mMarkerList != null) {\r\n for (Marker marker : mMarkerList) {\r\n marker.remove();\r\n }\r\n mMarkerList.clear();\r\n }\r\n }",
"public void updateMarkers() {\n\t\tArrayList<Parking> items = getMarkersForLocation();\n\t\tfor (Parking item : items) {\n\t\t\tint id = item.getParkingId();\n\t\t\tParking inHashItem = parkingsArray.get(id);\n\t\t\tparkingsArray.delete(id);\n\t\t\t// if the item already exists, update the position\n\t\t\tif (inHashItem != null) {\n\t\t\t\tLog.d(\"Markers\", \"An old item\");\n\t\t\t\tparkingsArray.put(id, inHashItem); // put it at the end\n\t\t\t} else {\n\t\t\t\tLog.d(\"Markers\", \"A new item\");\n\t\t\t\titem.addMarkerToMap(map);\n\t\t\t\tparkingsArray.put(id, item);\n\t\t\t}\n\t\t}\n\n\t\t// remove extras\n\t\tremoveOldMarkers();\n\t}",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tLocation myLocation = googleMap.getMyLocation();\r\n\t\t\t\t\t\tif (myLocation != null) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t GPSTracker gpsTracker = new GPSTracker(context); \r\n\t\t\t\t\t\t\t if(gpsTracker.canGetLocation()) \r\n\t\t\t\t\t\t\t { \r\n\t\t\t\t\t\t\t\t String stringLatitude = String.valueOf(gpsTracker.latitude); \r\n\t\t\t\t\t\t\t\t String stringLongitude = String.valueOf(gpsTracker.longitude); \r\n\t\t\t\t\t\t\t\t currentlocation = new LatLng(gpsTracker.latitude,gpsTracker.longitude);\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t/*double dclat = googleMap.getMyLocation()\r\n\t\t\t\t\t\t\t\t\t.getLatitude();\r\n\t\t\t\t\t\t\tdouble dclon = googleMap.getMyLocation()\r\n\t\t\t\t\t\t\t\t\t.getLongitude();\r\n\t\t\t\t\t\t\tcurrentlocation = new LatLng(dclat, dclon);*/\r\n\r\n\t\t\t\t\t\t\tif (!myList.contains(currentlocation)\r\n\t\t\t\t\t\t\t\t\t&& (currentlocation != null)) {\r\n\t\t\t\t\t\t\t\tmyList.add(currentlocation);\r\n\r\n\t\t\t\t\t\t\t\tdouble lat = currentlocation.latitude;\r\n\t\t\t\t\t\t\t\tdouble lon = currentlocation.longitude;\r\n\t\t\t\t\t\t\t\tuploadarraylist.add(String.valueOf(lon) + \",\"\r\n\t\t\t\t\t\t\t\t\t\t+ String.valueOf(lat));\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (myList.size() == 1) {\r\n\t\t\t\t\t\t\t\tSystem.err.println(\"First zoom\");\r\n\t\t\t\t\t\t\t\tLatLng CurrentLocation = new LatLng(googleMap\r\n\t\t\t\t\t\t\t\t\t\t.getMyLocation().getLatitude(),\r\n\t\t\t\t\t\t\t\t\t\tgoogleMap.getMyLocation()\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getLongitude());\r\n\t\t\t\t\t\t\t\tCameraPosition cameraPosition = new CameraPosition.Builder()\r\n\t\t\t\t\t\t\t\t\t\t.target(CurrentLocation).zoom(18)\r\n\t\t\t\t\t\t\t\t\t\t.bearing(70).tilt(25).build();\r\n\t\t\t\t\t\t\t\tgoogleMap.animateCamera(CameraUpdateFactory\r\n\t\t\t\t\t\t\t\t\t\t.newCameraPosition(cameraPosition));\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (myList.size() >= 2) {\r\n\t\t\t\t\t\t\t\tdouble slat = myList.get(myList.size() - 2).latitude;\r\n\t\t\t\t\t\t\t\tdouble slon = myList.get(myList.size() - 2).longitude;\r\n\r\n\t\t\t\t\t\t\t\tdouble dlat = myList.get(myList.size() - 1).latitude;\r\n\t\t\t\t\t\t\t\tdouble dlon = myList.get(myList.size() - 1).latitude;\r\n\r\n\t\t\t\t\t\t\t\tLatLng mmarkersourcelatlng = new LatLng(myList\r\n\t\t\t\t\t\t\t\t\t\t.get(1).latitude,\r\n\t\t\t\t\t\t\t\t\t\tmyList.get(1).longitude);\r\n\t\t\t\t\t\t\t\tmsourcelatlng = new LatLng(slat, slon);\r\n\t\t\t\t\t\t\t\tmdestlatlng = new LatLng(dlat, dlon);\r\n\t\t\t\t\t\t\t\tSystem.err.println(\"myLocation:\"\r\n\t\t\t\t\t\t\t\t\t\t+ currentlocation);\r\n\t\t\t\t\t\t\t\tfor (int i = 1; i < myList.size() - 1; i++) {\r\n\t\t\t\t\t\t\t\t\tLatLng src = myList.get(i);\r\n\t\t\t\t\t\t\t\t\tLatLng dest = myList.get(i + 1);\r\n\t\t\t\t\t\t\t\t\tPolyline line = googleMap\r\n\t\t\t\t\t\t\t\t\t\t\t.addPolyline(new PolylineOptions()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// mMap is the Map Object\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.add(new LatLng(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc.latitude,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc.longitude),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew LatLng(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdest.latitude,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdest.longitude))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.width(10)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.color(R.color.pink)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.geodesic(true));\r\n\t\t\t\t\t\t\t\t\tmsmarker = googleMap\r\n\t\t\t\t\t\t\t\t\t\t\t.addMarker(new MarkerOptions()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.position(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmmarkersourcelatlng)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.title(\"Source\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.icon(BitmapDescriptorFactory\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));\r\n\r\n\t\t\t\t\t\t\t\t\tif (mdmarker != null) {\r\n\t\t\t\t\t\t\t\t\t\tmdmarker.remove();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmdmarker = googleMap\r\n\t\t\t\t\t\t\t\t\t\t\t.addMarker(new MarkerOptions()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.position(msourcelatlng)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.title(\"Destination\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.icon(BitmapDescriptorFactory\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.defaultMarker(BitmapDescriptorFactory.HUE_RED)));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.err.println(\"Mylocation Empty\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t});\r\n\t\t\t}",
"private void updateMyMarkers(List<MarkerOptions> markers) {\n if(myGoogleMap == null) return;\n\n myGoogleMap.clear();\n LatLngBounds.Builder builder = new LatLngBounds.Builder();\n for (MarkerOptions m : markers) {\n myGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(m.getPosition(), 15), 1000, null);\n myGoogleMap.addMarker(new MarkerOptions()\n .position(m.getPosition())\n .title(m.getTitle())/*.snippet(m.getSnippet())*/.icon(m.getIcon()));\n builder.include(m.getPosition());\n }\n\n LatLngBounds bounds = builder.build();\n int padding = 0; // offset from edges of the map in pixels\n CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, padding);\n myGoogleMap.animateCamera(cu);\n }",
"public void clearLastMarker(){\n lastMarker.remove();\n }",
"@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true){\n \t\t\t\t\tscheduleMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < scheduleMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = scheduleMarkerNames.get(i);\n \t\t\t\t\t\tscheduleMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(scheduleMarkersOnMap.get(name).get(0), scheduleMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(120))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < scheduleMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=scheduleMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true){\n \t\t\t\t\tscheduleMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < scheduleMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = scheduleMarkerNames.get(i);\n \t\t\t\t\t\tscheduleMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(scheduleMarkersOnMap.get(name).get(0), scheduleMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(120))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < scheduleMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=scheduleMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"public void finish() throws SharedUtil.MapMarkerInvalidStateException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException\r\n\t{\n\t\tif(state!=STATE.ITERATE)\r\n\t\t\tthrow new SharedUtil.MapMarkerInvalidStateException(\"invalid mapMarker manager state: finish() only allow state of STATE.ITERATE\");\r\n\r\n\t\tfor(int i :dellist.keySet())\r\n\t\t{\r\n\t\t\tT tmp=dellist.get(i);\r\n\t\t\t\r\n\t\t\tif(tmp.timeout()){\r\n\t\t\t\tif(tmp.getMarker()!=null)\r\n\t\t\t\t{\ttmp.getMarker().remove();\r\n\t\t\t\t\tLog.d(\"****[deleting unvisited marker]\", tmp.getMarker().getPosition().toString());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\ttmp.startTime();\r\n\t\t\t\tkeeplist.put(i, tmp);\r\n\t\t\t}\r\n\t\t}\r\n\t\tdellist.clear();\r\n\t\tstate=STATE.START;\r\n\t}",
"public void updateMarkers(){\n markerMap = new HashMap<>();\n googleMap.clear();\n for (Station station : main.getStations()) {\n float fillLevel = station.getFillLevel();\n float colour = fillLevel * 120;\n Marker marker = googleMap.addMarker(new MarkerOptions().position(station.getLocation()).title(station.getName()).snippet(Integer.toString(station.getOccupancy())).icon(BitmapDescriptorFactory.defaultMarker(colour)));\n marker.setTag(station.getId());\n markerMap.put(station.getId(), marker);\n }\n }",
"public void clearMarkers() {\n googleMap.clear();\n markers.clear();\n }",
"private void loadMarkers(){\n if (partnerLocs){\n latLngs = dataStorage.getPartnerLatLngList();\n locationNames = dataStorage.getPartnerLocNameList();\n }else{\n String favLatLngFromJson = dataStorage.getLatLngList();\n String favNamesFromJson = dataStorage.getLocNameList();\n\n if(favNamesFromJson != null && favLatLngFromJson != null){\n String[] favNames = new Gson().fromJson(favNamesFromJson, String[].class);\n LatLng[] favLatLng = new Gson().fromJson(favLatLngFromJson, LatLng[].class);\n\n //Convert json to the actual ArrayLists\n latLngs = Arrays.asList(favLatLng);\n latLngs = new ArrayList<LatLng>(latLngs);\n locationNames = Arrays.asList(favNames);\n locationNames = new ArrayList<String>(locationNames);\n }\n }\n\n\n\n\n //Add the markers back onto the map\n for (int i = 0; i < latLngs.size(); i++) {\n LatLng point = latLngs.get(i);\n String name = locationNames.get(i);\n Marker addedMarker = mMap.addMarker(new MarkerOptions().position(new LatLng\n (point.latitude, point.longitude)).title(name));\n if(partnerLocs){\n addedMarker.setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE));\n }\n\n if(name.equals(locClicked)){\n markerClicked = addedMarker;\n }\n }\n }",
"public void reloadMarkers() {\n this.markers.reload();\n }",
"private void m7632a() {\n Exception e;\n if (!this.f6418o) {\n this.f6406c.removeAnnotations();\n this.f6417n = true;\n Icon fromDrawable = IconFactory.getInstance(this).fromDrawable(getResources().getDrawable(C1373R.drawable.ic_grid_oval_icon));\n for (GridDTO latLng1 : this.f6414k) {\n this.f6415l.add((MarkerOptions) ((MarkerOptions) new MarkerOptions().icon(fromDrawable)).position(latLng1.getLatLng1()));\n }\n try {\n C2568n.a(this.f6406c, this.f6415l);\n } catch (ExecutionException e2) {\n e = e2;\n e.printStackTrace();\n } catch (InterruptedException e3) {\n e = e3;\n e.printStackTrace();\n }\n }\n }",
"@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true){\n \t\t\t\t\ttodoMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < todoMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = todoMarkerNames.get(i);\n \t\t\t\t\t\ttodoMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(todoMarkersOnMap.get(name).get(0), todoMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(0))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < todoMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=todoMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true){\n \t\t\t\t\ttodoMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < todoMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = todoMarkerNames.get(i);\n \t\t\t\t\t\ttodoMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(todoMarkersOnMap.get(name).get(0), todoMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(0))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < todoMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=todoMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"public void eraseOnClick(View view){\n mMap.clear();//clears the map\r\n points = new ArrayList<LatLng>();//resets the markers holder\r\n }",
"private void drawMarkers () {\n // Danh dau chang chua di qua\n boolean danhDauChangChuaDiQua = false;\n // Ve tat ca cac vi tri chang tren ban do\n for (int i = 0; i < OnlineManager.getInstance().mTourList.get(tourOrder).getmTourTimesheet().size(); i++) {\n\n TourTimesheet timesheet = OnlineManager.getInstance().mTourList.get(tourOrder).getmTourTimesheet().get(i);\n // Khoi tao vi tri chang\n LatLng position = new LatLng(timesheet.getmBuildingLocation().latitude, timesheet.getmBuildingLocation().longitude);\n // Thay doi icon vi tri chang\n MapNumberMarkerLayoutBinding markerLayoutBinding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.map_number_marker_layout, null, false);\n // Thay doi so thu tu timesheet\n markerLayoutBinding.number.setText(String.valueOf(i + 1));\n // Thay doi trang thai markup\n // Lay ngay cua tour\n Date tourDate = OnlineManager.getInstance().mTourList.get(tourOrder).getmDate();\n // Kiem tra xem ngay dien ra tour la truoc hay sau hom nay. 0: hom nay, 1: sau, -1: truoc\n int dateEqual = Tour.afterToday(tourDate);\n // Kiem tra xem tour da dien ra chua\n if (dateEqual == -1) {\n // Tour da dien ra, thay doi mau sac markup thanh xam\n markerLayoutBinding.markerImage.setColorFilter(Color.GRAY, PorterDuff.Mode.SRC_ATOP);\n } else if (dateEqual == 1) {\n // Tour chua dien ra, thay doi mau sac markup thanh vang\n markerLayoutBinding.markerImage.setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP);\n } else {\n // Kiem tra xem chang hien tai la truoc hay sau gio nay. 0: gio nay, 1: gio sau, -1: gio truoc\n int srcStartEqual = Tour.afterCurrentHour(timesheet.getmStartTime());\n int srcEndEqual = Tour.afterCurrentHour(timesheet.getmEndTime());\n if(srcStartEqual == 1){\n // Chang chua di qua\n if (danhDauChangChuaDiQua == true) {\n // Neu la chang sau chang sap toi thi chuyen thanh mau mau vang\n markerLayoutBinding.markerImage.setColorFilter(Color.YELLOW, PorterDuff.Mode.SRC_ATOP);\n } else {\n // Neu la chang ke tiep thi giu nguyen mau do\n danhDauChangChuaDiQua = true;\n }\n } else if(srcStartEqual == -1 && srcEndEqual == 1){\n // Chang dang di qua\n markerLayoutBinding.markerImage.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP);\n } else{\n // Chang da di qua\n markerLayoutBinding.markerImage.setColorFilter(Color.GRAY, PorterDuff.Mode.SRC_ATOP);\n }\n }\n // Marker google map\n View markerView = markerLayoutBinding.getRoot();\n // Khoi tao marker\n MarkerOptions markerOptions = new MarkerOptions()\n .draggable(false)\n .title(timesheet.getmBuildingName() + '-' + timesheet.getmClassroomName())\n .position(position)\n .icon(BitmapDescriptorFactory.fromBitmap(getMarkerBitmapFromView(markerView)));\n if (timesheet.getmClassroomNote() != null && !timesheet.getmClassroomNote().equals(\"\") && !timesheet.getmClassroomNote().equals(\"null\")) {\n markerOptions.snippet(timesheet.getmClassroomNote());\n }\n mMap.addMarker(markerOptions);\n // add marker to the array list to display on AR Camera\n markerList.add(markerOptions);\n // Goi su kien khi nhan vao tieu de marker\n mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n @Override\n public void onInfoWindowClick(Marker marker) {\n // TODO: Chuyen sang man hinh thong tin chang khi nhan vao tieu de chang\n openTimesheetInfo(marker.getTitle());\n }\n });\n }\n }",
"public void markerCreator(List<Employee>employeeArray) {\n\n employeeArrayforData= employeeArray;\n List<MarkerOptions> markers = new ArrayList<MarkerOptions>();\n for (int i = 0; i < employeeArray.size(); i++) {\n if(employeeArray.get(i).lastLocation.isEmpty())\n continue;\n// markers.add((new MarkerOptions()\n// .position(new LatLng(LatLong.getLat(employeeArray.get(i).lastLocation.replace(\": (\",\":(\")),\n// LatLong.getLongt(employeeArray.get(i).lastLocation.replace(\": (\",\":(\"))))\n// .title(employeeArray.get(i).name)));\n// updateMyMarkers(markers);\n Log.i(\"****\",employeeArray.get(i).lastLocation);\n Log.i(\"****\",\"hi\");\n if (employeeArray.get(i).online)\n\n {\n markers.add((new MarkerOptions()\n .position(new LatLng(LatLong.getLat(employeeArray.get(i).lastLocation),\n LatLong.getLongt(employeeArray.get(i).lastLocation)))\n .title(i+\":\"+employeeArray.get(i).name))\n .snippet((\"Rate = \"+employeeArray.get(i).rate+\",\"+employeeArray.get(i).email\n )).alpha(0.9f).icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_picker_green)));\n\n }\n else{\n markers.add((new MarkerOptions()\n .position(new LatLng(LatLong.getLat(employeeArray.get(i).lastLocation),\n LatLong.getLongt(employeeArray.get(i).lastLocation)))\n .title(i+\":\"+employeeArray.get(i).name))\n .snippet((\"Rate = \"+employeeArray.get(i).rate+\"\"+employeeArray.get(i).email\n )).alpha(0.1f).icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_picker_red)));\n }\n\n updateMyMarkers(markers);\n }\n }",
"public void deselectMarkers() {\n if (!this.selectedMarkers.isEmpty()) {\n for (Marker next : this.selectedMarkers) {\n if (next != null && next.isInfoWindowShown()) {\n next.hideInfoWindow();\n }\n }\n this.selectedMarkers.clear();\n }\n }",
"@Override\n public void run() {\n for (ListIterator<BtDeviceObject> btDeviceListIterator = mBtDeviceObjectList.listIterator(); btDeviceListIterator.hasNext();) {\n BtDeviceObject btDeviceObject = btDeviceListIterator.next();\n if(new Date().getTime() - btDeviceObject.timeSinceLastUpdate > 2000){\n btDeviceListIterator.remove();\n mBtDeviceAddress.remove(btDeviceObject.bluetoothDevice.getMacAddress());\n mDeviceListAdapter.notifyDataSetChanged();\n }\n }\n\n mCheckIfBtDeviceTimerExpiredHandler.postDelayed(this, 500);\n }",
"private void refreshDBDangerZone(){\n FirebaseDatabase.getInstance().getReference().child(\"Danger Zone Markers\")\n .addListenerForSingleValueEvent(new ValueEventListener() {\n Date currentDate = new Date();\n String currentDateString = currentDate.toString();\n String getCurrentDateSubString = currentDateString.substring(0,10);\n\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n int numberOfMarkers = 0;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n numberOfMarkers++;\n String markerDate = snapshot.child(\"time\").getValue().toString();\n System.out.println(\"MARKER DATE: \" + markerDate);\n System.out.println(\"CURRENT DATE: \" + getCurrentDateSubString);\n if(numberOfMarkers>1){\n if(!(markerDate.contains(getCurrentDateSubString))) {\n snapshot.getRef().removeValue();\n }\n }\n\n\n }\n\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n }",
"@Override\n public void onMarkerDragStart(Marker marker) {\n\n int selectedItem = spnPointType.getSelectedItemPosition();\n\n switch (selectedItem){\n case 0:\n markerDraggedPos = markersMain.indexOf(marker);\n if (markerDraggedPos != -1) Log.d(TAG, \"Dragged marker at pos \" + markerDraggedPos);\n //remove the marker of the array.\n markersMain.remove(markerDraggedPos);\n break;\n case 1:\n markerDraggedPos = markersWater.indexOf(marker);\n if (markerDraggedPos != -1) Log.d(TAG, \"Dragged marker at pos \" + markerDraggedPos);\n //remove the marker of the array.\n markersWater.remove(markerDraggedPos);\n break;\n case 2:\n markerDraggedPos = markersAtractivos.indexOf(marker);\n if (markerDraggedPos != -1) Log.d(TAG, \"Dragged marker at pos \" + markerDraggedPos);\n //remove the marker of the array.\n markersAtractivos.remove(markerDraggedPos);\n break;\n\n }\n\n }",
"private void updateFriendsLocation(ArrayList<ObjectLocation> friends_location){\n if(mMap==null)\n return;\n //if friends names is not ready yet which should not ever happen then return\n if(friends_names.isEmpty())\n return;\n\n //this do only first time, if markers is set then just update markers location (else branch)\n if(markers.isEmpty()) {\n for (int i = 0; i < friends_location.size(); i++) {\n LatLng latLng = new LatLng(friends_location.get(i).getLat(), friends_location.get(i).getLng());\n String friendID = friends_location.get(i).getObjectId();\n\n MarkerOptions markerOptions = new MarkerOptions()\n .position(latLng)\n .title(friends_names.get(friendID))//set friend name in title\n .icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_default_friend));\n\n //this is necessary for onInfoWindowClick\n Marker marker = mMap.addMarker(markerOptions);\n markerOnClick.put(marker,new MyMarker(friends_location.get(i).getObjectId(),true));\n //this is necessary for later update -friend icon(once) and his location on every change\n markers.put(friendID, marker);\n\n //make request for image\n userHandler.getUserImageInBitmap(friends_location.get(i).getObjectId(), REQUEST_TAG, new GetFriendsBitmapListener(this,friendID));\n }\n Log.i(LOG_TAG,\"Friends placed on the map, for the first time.\");\n }else{\n for (int i = 0; i < friends_location.size(); i++) {\n String friendID = friends_location.get(i).getObjectId();\n animateMarker(markers.get(friendID),new LatLng(friends_location.get(i).getLat(),friends_location.get(i).getLng()),new LatLngInterpolator.Linear());\n }\n }\n }",
"@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true){\n \t\t\t\t\tmeetMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < meetMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = meetMarkerNames.get(i);\n \t\t\t\t\t\tmeetMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(meetMarkersOnMap.get(name).get(0), meetMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(60))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < meetMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=meetMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\tif(arg1==true){\n \t\t\t\t\tmeetMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < meetMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = meetMarkerNames.get(i);\n \t\t\t\t\t\tmeetMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(meetMarkersOnMap.get(name).get(0), meetMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(60))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < meetMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=meetMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}",
"public void removeLocationUpdates() {\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n if (insideOrganization != null) {\n\n organizationAccess = new OrganizationAccess();\n //Update the access' list when the user exits from organization.\n organizationAccess.setEntranceTimestamp(organizationAccessTime);\n organizationAccess.setAccessType(accessType);\n organizationAccess.setOrganizationId(insideOrganization.getOrgID());\n organizationAccess.setOrgName(insideOrganization.getName());\n organizationAccess.setExitTimestamp(OffsetDateTime.now());\n organizationAccess.setTimeStay(HomePageActivity.getCurrentTime());\n\n if (HomePageActivity.getSwitcherModeStatus()) {\n //Comunicates the server that user is outside the organization(authenticated).\n server.performOrganizationMovementServer(insideOrganization.getOrgAuthServerID(), insideOrganization.getOrgID(), userToken, -1, organizationMovement.getExitToken(),organizationAccess,prefsEditor,gson);\n } else {\n //Comunicates the server that user is outside the organization(anonymous).\n server.performOrganizationMovementServer(null, insideOrganization.getOrgID(),userToken, -1, organizationMovement.getExitToken(), organizationAccess,prefsEditor,gson);\n }\n\n flag = false;\n\n\n organizationMovement = null;\n String organizationMovementJson = gson.toJson(null);\n String insideOrganizationJson = gson.toJson(null);\n prefsEditor.putString(\"organizationMovement\",organizationMovementJson);\n prefsEditor.putString(\"insideOrganization\",insideOrganizationJson);\n prefsEditor.commit();\n }\n if (insidePlace != null) {\n\n placeAccess = new PlaceAccess();\n //Update the access' list when the user exits from organization and place.\n placeAccess.setEntranceTimestamp(placeAccessTime);\n placeAccess.setPlaceName(insidePlace.getName());\n placeAccess.setOrgId(orgID);\n placeAccess.setExitTimestamp(OffsetDateTime.now());\n\n if (HomePageActivity.getSwitcherModeStatus()) {\n //Comunicates the server that user is outside the place(authenticated).\n server.performPlaceMovementServer(placeMovement.getExitToken(), -1, insidePlace.getId(), insideOrganization.getOrgAuthServerID(), userToken, placeAccess,prefsEditor,gson);\n } else {\n //Comunicates the server that user is outside the place(anonymous).\n server.performPlaceMovementServer(placeMovement.getExitToken(), -1, insidePlace.getId(), null, userToken, placeAccess,prefsEditor,gson);\n }\n\n //Deletes the place's list of the organization.\n insidePlace = null;\n placeMovement = null;\n String placeMovementJson = gson.toJson(null);\n String insidePlacejson = gson.toJson(null);\n prefsEditor.putString(\"placeMovement\",placeMovementJson);\n prefsEditor.putString(\"insidePlace\",insidePlacejson);\n prefsEditor.commit();\n }\n\n }\n }, 2000);\n\n if (insideOrganization != null) {\n Toast.makeText(getApplicationContext(), \"Sei uscito dall'organizzazione: \" + insideOrganization.getName(), Toast.LENGTH_SHORT).show();\n\n }\n if (insidePlace != null) {\n Toast.makeText(getApplicationContext(), \"Sei uscito dal luogo: \" + insidePlace.getName(), Toast.LENGTH_SHORT).show();\n\n }\n\n HomePageActivity.setNameOrg(\"Nessuna organizzazione\");\n HomePageActivity.setNamePlace(\"Nessun luogo\");\n HomePageActivity.playPauseTimeService();\n HomePageActivity.resetTime();\n\n HomePageActivity.playPauseTimeServicePlace();\n HomePageActivity.resetTimePlace();\n\n timer.schedule(new TimerTask() {\n @Override\n public void run() {\n Intent intent = new Intent(ACTION_BROADCAST);\n intent.putExtra(EXTRA_LOCATION, mLocation);\n LocalBroadcastManager.getInstance(getApplicationContext()).sendBroadcast(intent);\n }\n },5000);\n //Reset of all parameters.\n Log.i(TAG, \"Removing location updates\");\n\n try {\n mFusedLocationClient.removeLocationUpdates(mLocationCallback);\n Utils.setRequestingLocationUpdates(this, false);\n if(!mPrefs.getBoolean(\"switchTrack\", false)) {\n stopSelf();\n }\n\n } catch (SecurityException unlikely) {\n Utils.setRequestingLocationUpdates(this, true);\n Log.e(TAG, \"Lost location permission. Could not remove updates. \" + unlikely);\n }\n }",
"@Override\n\t\t\t\t\t\t\t\t\tpublic void done(ParseException arg0) {\n\t\t\t\t\t\t\t\t\t\tTheMissApplication.getInstance().hideProgressDialog();\n\t\t\t\t\t\t\t\t\t\tif(arg0 == null){\n\t\t\t\t\t\t\t\t\t\t\tmFlaggedPicturesList.remove(flaggedPicture);\n\t\t\t\t\t\t\t\t\t\t\tFlaggedPicturesListCellAdapter.this.notifyDataSetChanged();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}",
"private void recreate_fragments(){\n GoogleMapsUtils google_maps_utils = new GoogleMapsUtils(getApplicationContext(), this, mToolbar_navig_utils);\n google_maps_utils.getLocationPermission();\n\n if(getPageAdapter()!=null)\n getPageAdapter().getMapsFragment().getMapView().removeAllViews();\n\n // Launch progressBar\n if(mProgressBar!=null) {\n runOnUiThread(() -> mProgressBar.setVisibility(View.VISIBLE));\n }\n }",
"@Override\n public void handleGeofenceChange(ArrayList<GeofenceObjectContent> currentGeofences) {\n super.handleGeofenceChange(currentGeofences);\n MainActivity mainActivity = (MainActivity) getActivity();\n\n for (int i = 0; i<currentGeofenceMarkers.size(); i++){\n boolean removeMarker = true;\n for(int j =0; j<currentGeofences.size(); j++){\n if(currentGeofenceMarkers.get(i).getTitle().equals(currentGeofences.get(j).getName())){\n removeMarker = false;\n }\n }\n if(removeMarker){\n currentGeofenceMarkers.get(i).remove();\n currentGeofencesInfoMap.remove(currentGeofencesInfoMap.get(currentGeofenceMarkers.get(i).getTitle()));\n currentGeofenceMarkers.remove(i);\n }\n }\n\n this.currentGeofences = currentGeofences;\n if(mainActivity != null && currentGeofences != null) {\n if (mainActivity.isConnectedToNetwork()) {\n ArrayList<GeofenceObjectContent> singleGeofence = new ArrayList<>(1);\n for(int i = 0; i<currentGeofences.size(); i++){\n if(!currentGeofencesInfoMap.containsKey(currentGeofences.get(i).getName()) && !geofenceNamesBeingQueriedForInfo.containsKey(currentGeofences.get(i).getName())){\n singleGeofence.clear();\n singleGeofence.add(currentGeofences.get(i));\n geofenceNamesBeingQueriedForInfo.put(currentGeofences.get(i).getName(), 0);\n Log.i(logMessages.VOLLEY, \"handleGeofenceChange : about to query database : \" + singleGeofence.toString());\n volleyRequester.request(this, singleGeofence);\n }\n\n }\n }\n\n }\n }",
"@Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n int sensorReading1,sensorReading2;\n\n if( dangerCircleSensor1!=null) dangerCircleSensor1.remove(); // every time data changes on database\n if( dangerCircleSensor2!=null) dangerCircleSensor2.remove(); // here we delete all marker and\n\n if( warningCircleSensor1!=null) warningCircleSensor1.remove();\n if( warningCircleSensor2!=null) warningCircleSensor2.remove();\n\n if(dangerMarkerSensor1!=null) dangerMarkerSensor1.remove(); // circle if it is on map\n if(dangerMarkerSensor2!=null) dangerMarkerSensor2.remove(); // later we adding marker and circle again using database value\n\n if(warningMarkerSensor1!=null) warningMarkerSensor1.remove();\n if(warningMarkerSensor2!=null) warningMarkerSensor2.remove();\n\n double db = Double.parseDouble(dataSnapshot.child(\"CITY1LOC1\")\n .child(\"reading\").getValue().toString());\n\n dangerZoneRadSensor1 = Calculator.getDistance(db,highdb,sourceDistance);\n warningZoneRadSensor1 = Calculator.getDistance(db, warningDB,sourceDistance);\n LatLng latLng = new LatLng(sorceLati,sourceLongti);\n dangerMarkerSensor1 = map.addMarker(new MarkerOptions().position(latLng).title(\"Sensor 1 is here\"));// added into\n dangerMarkerSensor1.showInfoWindow();//to display tag always\n Log.d(TAG, \"onDataChange: dangerZoneRadSensor1\" +(int) dangerZoneRadSensor1 );\n dangerCircleSensor1 = map.addCircle(getCircleOption(latLng,(int) dangerZoneRadSensor1,Color.RED));//draw the circle on map added\n // into Circle object\n warningCircleSensor1 = map.addCircle(getCircleOption(latLng,(int)warningZoneRadSensor1,Color.GREEN));\n /*for (DataSnapshot postSnapshot: dataSnapshot.getChildren()){\n String sensor = postSnapshot.getKey().toLowerCase().trim();//it give the sensor name\n //we have to handle the cases for all sensors in our list\n double latitude,longitude;//location in database look like this \"12.3,45.754\" we have to decode this\n // for decoding we use locationDecoder and it will return an array of length 2\n // index 0 gives latitude\n // index 1 gives longitude\n if (sensor.equalsIgnoreCase(\"sensor1\")){\n String location = postSnapshot.child(\"location\").getValue().toString() ;\n double[] locationArray = Calculator.getLocation(location);\n latitude = locationArray[0];\n longitude = locationArray[1];\n LatLng latLng = new LatLng(latitude,longitude);//create location coordinates with lati and longi\n // using latitude and longitude we can mark position in map using below line\n dangerMarkerSensor1 = map.addMarker(new MarkerOptions().position(latLng).title(\"Sensor 1 is here\"));// added into\n dangerMarkerSensor1.showInfoWindow();//to display tag always\n // Marker object\n int dangerRadius = ((Long)postSnapshot.child(\"dangerRadius\").getValue()).intValue();//radius is in long we haveto\n // convert it into int\n int warningRadius = ((Long)postSnapshot.child(\"warningRadius\").getValue()).intValue();\n dangerZoneRadSensor1 = dangerRadius;\n warningZoneRadSensor1 = warningRadius;\n dangerCircleSensor1 = map.addCircle(getCircleOption(latLng,dangerRadius,Color.RED));//draw the circle on map added\n // into Circle object\n warningCircleSensor1 = map.addCircle(getCircleOption(latLng,warningRadius,Color.GREEN));\n }\n else if (sensor.equalsIgnoreCase(\"sensor2\")){\n String location = postSnapshot.child(\"location\").getValue().toString().trim() ;\n double[] locationArray = Calculator.getLocation(location);\n latitude = locationArray[0];\n longitude = locationArray[1];\n LatLng latLng = new LatLng(latitude,longitude);\n dangerMarkerSensor2 = map.addMarker(new MarkerOptions().position(new LatLng(latitude,longitude)).title(\"Sensor 2 is here\"));\n dangerMarkerSensor2.showInfoWindow();//to display tag always\n int dangerRadius = ((Long)postSnapshot.child(\"dangerRadius\").getValue()).intValue();\n int warningRadius = ((Long)postSnapshot.child(\"warningRadius\").getValue()).intValue();\n dangerCircleSensor2 = map.addCircle(getCircleOption(latLng,dangerRadius,Color.BLACK));\n warningCircleSensor2 = map.addCircle(getCircleOption(latLng,warningRadius,Color.GREEN));\n }\n }*/\n\n double latitude=currentLoc.getLatitude();\n double longitude=currentLoc.getLongitude();\n double distance = Calculator.distance(sensor1Lati,latitude,sensor2Longi,longitude,0,0); //gives the distance changed\n preLati = latitude;\n preLogi = longitude;\n // String msg=\"New Latitude: \"+latitude + \"New Longitude: \"+longitude;\n\n if (distance <= dangerZoneRadSensor1)\n Toast.makeText(MapActivity.this,\"You are in danger zone. Move \" + (dangerZoneRadSensor1 - distance) + \" m backwards\" ,Toast.LENGTH_LONG).show();\n else if (distance <= warningZoneRadSensor1 )\n Toast.makeText(MapActivity.this,\"You are in warning zone. \" ,Toast.LENGTH_LONG).show();\n\n }",
"@Override\n protected void onPostExecute(Void result) {\n for(twitter4j.Status tweet : newTweets){\n\n GeoLocation geoLoc = tweet.getGeoLocation();\n if(geoLoc!=null) {\n LatLng loc = new LatLng(geoLoc.getLatitude(), geoLoc.getLongitude());\n Marker marker = mMap.addMarker(new MarkerOptions()\n .snippet(tweet.getText()).\n position(loc).title(\"@\" +tweet.getUser().getScreenName()));\n tweetsList.put(marker.getId(),tweet);\n markersList.add(marker);\n }\n\n }\n\n newTweets.clear();\n\n super.onPostExecute(result);\n }",
"@Override\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\tfor (int i = 0; i < listTempatMakan.size(); i++)\n\t\t\t\t\t{\n\n\t\t\t\t\t\tmap.addMarker(new MarkerOptions()\n\t\t\t\t\t\t\t\t.position(new LatLng(listTempatMakan.get(i).getLat(),\n\t\t\t\t\t\t\t\t\t\tlistTempatMakan.get(i).getLng()))\n\t\t\t\t\t\t\t\t.title(listTempatMakan.get(i).getNama())\n\t\t\t\t\t\t\t\t.snippet(listTempatMakan.get(i).getAlamat()));\n\n\t\t\t\t\t}\n\t\t\t\t}",
"@Override\n public void onMapReady(final GoogleMap googleMap) {\n this.googleMap = googleMap;\n this.googleMap.getUiSettings().setZoomControlsEnabled(true);\n this.googleMap.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() {\n @Override\n public void onCameraChange(CameraPosition cameraPosition) {\n boolean markersVisibility = false;\n if(cameraPosition.zoom>minZoomLevel){\n// googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(cameraPosition.target, minZoomLevel));\n markersVisibility = true;\n }\n for(Marker marker : mapMarkers){\n marker.setVisible(markersVisibility);\n }\n }\n });\n this.googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(25.0449695d, 121.5087531d), minZoomLevel));\n// this.mapItemClusterManager = new ClusterManager<>(this,this.googleMap);\n// this.googleMap.setOnCameraChangeListener(this.mapItemClusterManager);\n// this.googleMap.setOnMarkerClickListener(this.mapItemClusterManager);\n// this.googleMap.setOnInfoWindowClickListener(this.mapItemClusterManager);\n// this.mapItemClusterManager.setRenderer(new DefaultClusterRenderer<ClusterItem>(this,this.googleMap,this.mapItemClusterManager){\n// @Override\n// protected boolean shouldRenderAsCluster(Cluster<ClusterItem> cluster) {\n// return cluster.getSize()>20;\n// }\n// });\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n assetReadHandler.sendEmptyMessage(0);\n BufferedReader busInfoFileBufferReader = new BufferedReader(new InputStreamReader(getAssets().open(\"GetStopLocation.json\")));\n JSONObject busInfoRawJsonObject = new JSONObject(busInfoFileBufferReader.readLine());\n Message message = new Message();\n message.obj = busInfoRawJsonObject;\n assetReadHandler.sendEmptyMessage(1);\n busStateJJsonArrayHandler.sendMessage(message);\n } catch (JSONException e){\n Log.e(\"y3k\", e.getMessage());\n e.printStackTrace();\n } catch (IOException e1){\n Log.e(\"y3k\", e1.getMessage());\n e1.printStackTrace();\n }\n }\n }).start();\n\n// LatLng sydney = new LatLng(-34, 151);\n// googleMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\"));\n// googleMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n }",
"@Override\n protected void onResume() {\n super.onResume();\n if(mvTencentMapView != null) {\n mvTencentMapView.onResume();\n }\n if(!isfist) {\n\n// tencentMap.clearAllOverlays();\n for(Marker item:markerListArticle){\n// item.remove();\n item.setVisible(false);\n }\n for(Marker item:markerListApplyVillage){\n// item.remove();\n item.setVisible(false);\n }\n for(Marker item:markerListBooth){\n// item.remove();\n item.setVisible(false);\n }\n// markerListArticle.clear();\n// markerListApplyVillage.clear();\n// markerListBooth.clear();\n// province1 = null;\n getMapArticle(1);\n initCollectVillageRV();\n// bindListener();\n// initLocation();\n\n\n }\n isfist = false;\n\n\n// getApplyVillage();\n }",
"public void checkMarkers(int num) {\n\t\t\n\t}",
"private void plottingMarkers(){\r\n if (nameList.size()==0) {\r\n }\r\n else {\r\n for (int i = 0; i < nameList.size(); i++) {\r\n Loc2LatLng = new LatLng(Double.parseDouble(latList.get(i)), Double.parseDouble(lngList.get(i)));\r\n MarkerOptions markerSavedLocations = new MarkerOptions();\r\n markerSavedLocations.title(nameList.get(i));\r\n markerSavedLocations.position(Loc2LatLng);\r\n map.addMarker(markerSavedLocations);\r\n }\r\n }\r\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tsynchronized (OnlineObjectsContainer.this.onlineObjects) {\n\t\t\t\t\tIterator<OnlineObject> iterator = OnlineObjectsContainer.this.recentlyAddedObjects.iterator();\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tfinal OnlineObject anObject = iterator.next();\n\t\t\t\t\t\tif (anObject.getSeenAt().getTime() + OnlineObjectsContainer.RECENT_TIMEOUT < System.currentTimeMillis()) {\n\t\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\titerator = OnlineObjectsContainer.this.recentlyRemovedObjects.iterator();\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tfinal OnlineObject anObject = iterator.next();\n\t\t\t\t\t\tif (anObject.getSeenAt().getTime() + OnlineObjectsContainer.RECENT_TIMEOUT < System.currentTimeMillis()) {\n\t\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public void clean() {\n Long now = System.currentTimeMillis();\n for (Iterator<Long> iterator = this.deleted.iterator(); iterator.hasNext();) {\n Long l = iterator.next();\n if (l < now) {\n iterator.remove();\n }\n }\n }",
"public void removeAnnotations() {\n int size = this.annotationsArray.size();\n long[] jArr = new long[size];\n this.selectedMarkers.clear();\n for (int i = 0; i < size; i++) {\n jArr[i] = this.annotationsArray.keyAt(i);\n Annotation annotation = this.annotationsArray.get(jArr[i]);\n if (annotation instanceof Marker) {\n Marker marker = (Marker) annotation;\n marker.hideInfoWindow();\n this.iconManager.iconCleanup(marker.getIcon());\n }\n }\n this.annotations.removeAll();\n }",
"@Override\n \tpublic void onStart() {\n \t\tsuper.onStart();\n \t\tscheduleBox = (CheckBox) view.findViewById(R.id.scheduleBox);\n \t\tscheduleBox.setBackgroundColor(Color.GREEN);\n \t\ttodoBox = (CheckBox) view.findViewById(R.id.toDoBox);\n \t\ttodoBox.setBackgroundColor(Color.RED);\n \t\tmeetBox= (CheckBox) view.findViewById(R.id.meetBox);\n \t\tmeetBox.setBackgroundColor(Color.YELLOW);\n \t\tmeBox = (CheckBox) view.findViewById(R.id.meBox);\n \t\tmeBox.setBackgroundColor(Color.BLUE);\n \t\tscheduleBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {\n \t\t\t@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\t// TODO Auto-generated method stub\n \t\t\t\tif(arg1==true){\n \t\t\t\t\tscheduleMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < scheduleMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = scheduleMarkerNames.get(i);\n \t\t\t\t\t\tscheduleMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(scheduleMarkersOnMap.get(name).get(0), scheduleMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(120))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < scheduleMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=scheduleMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} \n });\n \t\ttodoBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {\n \t\t\t@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\t// TODO Auto-generated method stub\n \t\t\t\tif(arg1==true){\n \t\t\t\t\ttodoMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < todoMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = todoMarkerNames.get(i);\n \t\t\t\t\t\ttodoMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(todoMarkersOnMap.get(name).get(0), todoMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(0))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < todoMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=todoMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} \n });\n \t\tmeetBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {\n \t\t\t@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\t// TODO Auto-generated method stub\n \t\t\t\tif(arg1==true){\n \t\t\t\t\tmeetMarkers.clear();\n \t\t\t\t\tfor (int i = 0; i < meetMarkerNames.size(); i++) {\n \t\t\t\t\t\tString name = meetMarkerNames.get(i);\n \t\t\t\t\t\tmeetMarkers.add(mMap.addMarker(new MarkerOptions().position(new LatLng(meetMarkersOnMap.get(name).get(0), meetMarkersOnMap.get(name).get(1))).title(name).icon(BitmapDescriptorFactory.defaultMarker(60))));\n \t\t\t\t\t}\n \t\t\t\t\tsetUpMapIfNeeded();}\n \t\t\t\telse{\n \t\t\t\t\tfor (int i = 0; i < meetMarkers.size(); i++) {\n \t\t\t\t\t\tMarker mark=meetMarkers.get(i);\n \t\t\t\t\t\tmark.remove();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} \n });\n \t\tmeBox.setOnCheckedChangeListener(new OnCheckedChangeListener() {\n \t\t\t@Override\n \t\t\tpublic void onCheckedChanged(CompoundButton arg0, boolean arg1) {\n \t\t\t\t// TODO Auto-generated method stub\n \t\t\t\tif(arg1==true)\n \t\t\t\t\tmMap.setMyLocationEnabled(true);\n \t\t\t\telse\n \t\t\t\t\tmMap.setMyLocationEnabled(false);\n \t\t\t} \n });\n \t\t\n \t\tsetUpMapIfNeeded();\n \t}",
"private void updateMapWithLatestDetectedPOIs(List<SKDetectedPOI> detectedPois) {\n List<Integer> detectedIdsList = new ArrayList<Integer>();\n for (SKDetectedPOI detectedPoi : detectedPois) {\n detectedIdsList.add(detectedPoi.getPoiID());\n }\n for (int detectedPoiId : detectedIdsList) {\n if (detectedPoiId == -1) {\n continue;\n }\n if (drawnTrackablePOIs.get(detectedPoiId) == null) {\n drawnTrackablePOIs.put(detectedPoiId, trackablePOIs.get(detectedPoiId));\n drawDetectedPOI(detectedPoiId);\n }\n }\n for (int drawnPoiId : new ArrayList<Integer>(drawnTrackablePOIs.keySet())) {\n if (!detectedIdsList.contains(drawnPoiId)) {\n drawnTrackablePOIs.remove(drawnPoiId);\n mapView.deleteAnnotation(drawnPoiId);\n }\n }\n }",
"@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n ArrayList<String> ArrayDescripcionMarker = new ArrayList<String>();\n ArrayList<String> ArrayX = new ArrayList<String>();\n ArrayList<String> ArrayY = new ArrayList<String>();\n Integer tamanio=0;\n\n\n new DataMainActivitBuscarUbicacionReservas(mapa.this).execute();\n\n\n\n System.out.println(\"aca lista1 ANTESSSS\" +getIntent().getStringArrayListExtra(\"miLista\"));\n System.out.println(\"aca tamaño ANTESSSS\" +getIntent().getIntExtra(\"tamanio\",0));\n System.out.println(\"aca lista2 ANTESSS\" +getIntent().getStringArrayListExtra(\"miLista2\"));\n System.out.println(\"aca listaCLIENTE ANTESSS\" +getIntent().getStringArrayListExtra(\"milistaCliente\"));\n\n //cantidad de reservas/markes a dibujar\n tamanio = getIntent().getIntExtra(\"tamanio\",0);\n /// Casteo la lista que tiene las latitudes\n double[] failsArray = new double[tamanio]; //create an array with the size of the failList\n for (int i = 0; i < tamanio; ++i) { //iterate over the elements of the list\n failsArray[i] = Double.parseDouble(getIntent().getStringArrayListExtra(\"miLista\").get(i)); //store each element as a double in the array\n // failsArray[i] = Double.parseDouble(lista.get(i)); //store each element as a double in the array\n }\n\n /// Casteo la lista que tiene las longitudes\n double[] failsArray2 = new double[tamanio]; //create an array with the size of the failList\n for (int i = 0; i < tamanio; ++i) { //iterate over the elements of the list\n failsArray2[i] = Double.parseDouble(getIntent().getStringArrayListExtra(\"miLista2\").get(i)); //store each element as a double in the array\n // failsArray2[i] = Double.parseDouble(lista2.get(i)); //store each element as a double in the array\n }\n\n ///// Recorro las listas y genero el marker.\n for (int i = 0; i < tamanio; i++){\n LatLng vol_1 = new LatLng(failsArray[i], failsArray2[i]);\n mMap.addMarker(new MarkerOptions().position(vol_1).title(getIntent().getStringArrayListExtra(\"milistaCliente\").get(i)));\n // mMap.addMarker(new MarkerOptions().position(vol_1));\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(vol_1, 12f));\n }\n\n\n\n ///////////// DIUJO ZONAS - POLIGIONOS /////////////////\n\n Polygon polygon1 = mMap.addPolygon(new PolygonOptions()\n .add(new LatLng(-34.4466867, -58.7446665),\n new LatLng(-34.4755556, -58.7870237),\n new LatLng( -34.5313786, -58.7034557),\n new LatLng(-34.5005326, -58.6488037))\n .strokeColor(Color.RED));\n polygon1.setTag(\"ZONA 1\");\n polygon1.setStrokeWidth(4f);\n\n\n\n Polygon polygon2 = mMap.addPolygon(new PolygonOptions()\n .add(new LatLng(-34.4466867, -58.7446665),\n new LatLng(-34.4810476,-58.6806737),\n new LatLng( -34.4541926,-58.6249857),\n new LatLng( -34.3982066,-58.6507117))\n .strokeColor(BLUE));\n polygon2.setTag(\"ZONA 2\");\n polygon2.setStrokeWidth(4f);\n\n\n Polygon polygon3 = mMap.addPolygon(new PolygonOptions()\n .add(new LatLng(-34.4810476,-58.6806737),\n new LatLng(-34.5005326, -58.6488037),\n new LatLng( -34.4786136,-58.6067997),\n new LatLng( -34.4547056,-58.6234267))\n .strokeColor(Color.GREEN));\n polygon3.setTag(\"ZONA 3\");\n polygon3.setStrokeWidth(4f);\n\n\n ///////////// FIN DIUJO ZONAS - POLIGIONOS /////////////////\n\n\n\n\n /*\n //DIBUJO ZONAS DE CIRCULOS\n Circle circle = mMap.addCircle(new CircleOptions()\n .center(new LatLng(-34.455587, -58.685503))\n .radius(1800)\n .strokeColor(Color.RED));\n circle.setStrokeWidth(4f);\n circle.setTag(\"Zona1\");\n\n\n Circle circle2 = mMap.addCircle(new CircleOptions()\n .center(new LatLng(-34.480523, -58.717237))\n .radius(1600)\n .strokeColor(Color.BLUE));\n circle2.setStrokeWidth(4f);\n circle2.setTag(\"Zona2\");\n\n\n Circle circle3 = mMap.addCircle(new CircleOptions()\n .center(new LatLng(-34.450193, -58.725039))\n .radius(1800)\n .strokeColor(Color.GREEN));\n circle2.setStrokeWidth(4f);\n circle2.setTag(\"Zona2\");\n\n\n Circle circle4 = mMap.addCircle(new CircleOptions()\n .center(new LatLng(-34.469302, -58.653062))\n .radius(1500)\n .strokeColor(Color.YELLOW));\n circle2.setStrokeWidth(4f);\n circle2.setTag(\"Zona2\");\n\n //funcion que revisa si un punto esta dentro del circulo zona 1\n\n float[] disResultado = new float[2];\n // LatLng pos = new LatLng(40.416775, -3.703790);\n LatLng pos = new LatLng(-34.470327, -58.683718);\n double lat = pos.latitude; //getLatitude\n double lng = pos.longitude;//getLongitude\n\n\n Location.distanceBetween( pos.latitude, pos.longitude,\n circle.getCenter().latitude,\n circle.getCenter().longitude,\n disResultado);\n\n if(disResultado[0] > circle.getRadius()){\n System.out.println(\"FUERAAAA ZONA 1\" );\n } else {\n System.out.println(\"DENTROOO ZONA 1\" );\n }\n\n*/\n\n\n\n }",
"private void requestMarkers(){\n requestQueue= Volley.newRequestQueue(this);\n listMarkers = new ArrayList<>();\n JsonArrayRequest jsArrayRequest = new JsonArrayRequest(URL_MARKERS, new Listener<JSONArray>() {\n\n @Override\n public void onResponse(JSONArray response) {\n if (idioma.equals(\"español\")){\n for(int i=0; i<response.length(); i++){\n try {\n JSONObject objeto= response.getJSONObject(i);\n MarkerPropio marker = new MarkerPropio(objeto.getString(\"description_es\"),\n objeto.getInt(\"id\"),\n objeto.getDouble(\"latitud\"),\n objeto.getDouble(\"longitud\"),\n objeto.getString(\"title_es\"),\n objeto.getInt(\"num_images\"));\n listMarkers.add(marker);\n } catch (JSONException e) {\n Log.e(TAG, \"Error de parsing: \"+ e.getMessage());\n Toast.makeText(getBaseContext(), getText(R.string.internal_fail), Toast.LENGTH_LONG).show();\n\n }\n }\n } else {\n for(int i=0; i<response.length(); i++){\n try {\n JSONObject objeto= response.getJSONObject(i);\n MarkerPropio marker = new MarkerPropio(objeto.getString(\"description_en\"),\n objeto.getInt(\"id\"),\n objeto.getDouble(\"latitud\"),\n objeto.getDouble(\"longitud\"),\n objeto.getString(\"title_en\"),\n objeto.getInt(\"num_images\"));\n listMarkers.add(marker);\n } catch (JSONException e) {\n Log.e(TAG, \"Error de parsing: \"+ e.getMessage());\n Toast.makeText(getBaseContext(), getText(R.string.internal_fail), Toast.LENGTH_LONG).show();\n }\n }\n }\n addMarkers();\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.d(TAG, \"Error Respuesta en JSON: \" + error.getMessage() + \" || \" + error.getLocalizedMessage());\n /*if (markerDao.findMarkers()!=null){\n listMarkers = markerDao.findMarkers();\n addMarkers();\n } else {\n Toast.makeText(getBaseContext(), getText(R.string.server_fail), Toast.LENGTH_LONG).show();\n }*/\n Toast.makeText(getBaseContext(), getText(R.string.server_fail), Toast.LENGTH_LONG).show();\n }\n });\n requestQueue.add(jsArrayRequest);\n }",
"public void removeDuplicates(){ //takes 1st thing, compares to rest, if id match, check date, swap if needed then delete second item\n Map<Long, Long> sensorIdToDateTime = new HashMap<>();\n for (int i = 0; i < sensorList.size(); i++) {\n long sensorId = sensorList.get(i).getSensor_ID();\n long dateTime = sensorList.get(i).getDate_Time();\n if (sensorIdToDateTime.containsKey(sensorId)) {\n if (dateTime > sensorIdToDateTime.get(sensorId)) {\n sensorIdToDateTime.put(sensorId, dateTime);\n }\n }\n else {\n sensorIdToDateTime.put(sensorId, dateTime);\n }\n }\n for (Iterator<SensorResponse> iterator = filteredList.iterator(); iterator.hasNext();) {\n SensorResponse x = iterator.next();\n long sensorId = x.getSensor_ID();\n long dateTime = x.getDate_Time();\n if (sensorIdToDateTime.containsKey(sensorId) && dateTime != sensorIdToDateTime.get(sensorId)) {\n iterator.remove();\n }\n }\n\n notifyDataSetChanged();\n }",
"private void getMarkers() {\n StringRequest strReq = new StringRequest(Request.Method.POST, Config.URL_GET_ALL_DEALER_SVC, new Response.Listener<String>() {\n\n @Override\n public void onResponse(String response) {\n Log.e(\"Response: \", response);\n\n try {\n JSONObject jObj = new JSONObject(response);\n String getObject = jObj.getString(Config.TAG_JSON_ARRAY);\n JSONArray jsonArray = new JSONArray(getObject);\n for (int i = 0; i < jsonArray.length(); i++) {\n JSONObject jsonObject = jsonArray.getJSONObject(i);\n coy_dealer = jsonObject.getString(Config.MAPS_COY_DEALER);\n kd_dealer = jsonObject.getString(Config.MAPS_KD_DEALER);\n title = jsonObject.getString(Config.MAPS_NAMA_DEALER);\n description = jsonObject.getString(Config.MAPS_ALAMAT_DEALER);\n latLng = new LatLng(Double.parseDouble(jsonObject.getString(Config.MAPS_LAT)),\n Double.parseDouble(jsonObject.getString(Config.MAPS_LNG)));\n nview = jsonObject.getString(Config.MAPS_NVIEW);\n naccess = jsonObject.getString(Config.MAPS_NACCESS);\n\n // Menambah data marker untuk di tampilkan ke google map\n addMarker(latLng, title, description, kd_dealer, coy_dealer, nview, naccess);\n }\n\n } catch (JSONException e) {\n // JSON error\n e.printStackTrace();\n }\n\n }\n }, new Response.ErrorListener() {\n\n @Override\n public void onErrorResponse(VolleyError error) {\n Log.e(\"Error: \", error.getMessage());\n Toast.makeText(ListDealerMaps.this, error.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n\n AppController.getInstance().addToRequestQueue(strReq, Config.TAG_JSON_OBJ);\n }",
"private void deleteMarkers(final IFile file) throws CoreException {\n\t\tfile.deleteMarkers(MARKER_TYPE, false, IResource.DEPTH_ZERO);\n\t}",
"@Override\n\tpublic void doCleanup() {\n\t\tmTimestampGapTimer.cancel();\n\t\t\n\t\t// clear the view holder map\n\t\tsynchronized(mTimestampGapMapper) {\n\t\t\tmTimestampGapMapper.clear();\n\t\t}\n\t\t\n\t\tmTimestampGapMapper = null;\n\t}",
"private void ageScoreMarkers(long deltaTime) {\n\t\tfor (int i = 0; i < scoreMarkers.size(); i++) {\n\t\t\tScoreMarker scoreMarker = scoreMarkers.get(i);\n\t\t\tscoreMarker.move(deltaTime);\n\t\t\tif (scoreMarkers.get(i).getAge() > scoreMarkerMaxAge) {\n\t\t\t\tscoreMarkers.remove(i--);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\t\tpublic void run() {\n\t\t\ttry {\n\t\t\t\tThread.sleep(ExploreMapFragment.MAP_CENTER_ANIMATION_DURATION_IN_MS * 3 / 5);\n\t\t\t}\n\t\t\tcatch (InterruptedException e) {\n\t\t\t}\n\n\t\t\tfinal Marker marker = mMarker.get();\n\t\t\tfinal ExploreMapInfoWindowAdapter exploreMapInfoWindowAdapter = mExploreMapInfoWindowAdapter.get();\n\t\t\tfinal Activity activity = mActivity.get();\n\n\t\t\t// Check to see the references are still alive\n\t\t\tif (marker != null && exploreMapInfoWindowAdapter != null && activity != null) {\n\n\t\t\t\t// Then refresh the info window\n\t\t\t\tMarkerInfoWindowRefreshRunnable runnable = new MarkerInfoWindowRefreshRunnable(mlistImageUrl,\n\t\t\t\t\t\tmarker, exploreMapInfoWindowAdapter);\n\t\t\t\tactivity.runOnUiThread(runnable);\n\t\t\t}\n\t\t}",
"public void run() {\n\r\n try {\r\n JSONArray markersData = json.getJSONArray(\"data\");\r\n for (int i=0; i < markersData.length(); i++) {\r\n JSONObject markerData = markersData.getJSONObject(i);\r\n LatLng latLng = new LatLng(\r\n Float.parseFloat(markerData.getString(\"latitude\")),\r\n Float.parseFloat(markerData.getString(\"longitude\"))\r\n );\r\n googleMap.addMarker(new MarkerOptions().position(latLng).title(markerData.getString(\"title\")));\r\n }\r\n } catch (JSONException e) {\r\n return;\r\n }\r\n }",
"@Override protected void onStop() {\n\tsuper.onStop();\n\tm_locManager.removeUpdates(this);\n }",
"private void CallFunction() {\n\t\tmTimer.scheduleAtFixedRate(new TimerTask() {\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// What you want to do goes here\r\n\t\t\t\trunOnUiThread(new Runnable() {\r\n\t\t\t\t\t@SuppressWarnings(\"unused\")\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\tLocation myLocation = googleMap.getMyLocation();\r\n\t\t\t\t\t\tif (myLocation != null) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t GPSTracker gpsTracker = new GPSTracker(context); \r\n\t\t\t\t\t\t\t if(gpsTracker.canGetLocation()) \r\n\t\t\t\t\t\t\t { \r\n\t\t\t\t\t\t\t\t String stringLatitude = String.valueOf(gpsTracker.latitude); \r\n\t\t\t\t\t\t\t\t String stringLongitude = String.valueOf(gpsTracker.longitude); \r\n\t\t\t\t\t\t\t\t currentlocation = new LatLng(gpsTracker.latitude,gpsTracker.longitude);\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t/*double dclat = googleMap.getMyLocation()\r\n\t\t\t\t\t\t\t\t\t.getLatitude();\r\n\t\t\t\t\t\t\tdouble dclon = googleMap.getMyLocation()\r\n\t\t\t\t\t\t\t\t\t.getLongitude();\r\n\t\t\t\t\t\t\tcurrentlocation = new LatLng(dclat, dclon);*/\r\n\r\n\t\t\t\t\t\t\tif (!myList.contains(currentlocation)\r\n\t\t\t\t\t\t\t\t\t&& (currentlocation != null)) {\r\n\t\t\t\t\t\t\t\tmyList.add(currentlocation);\r\n\r\n\t\t\t\t\t\t\t\tdouble lat = currentlocation.latitude;\r\n\t\t\t\t\t\t\t\tdouble lon = currentlocation.longitude;\r\n\t\t\t\t\t\t\t\tuploadarraylist.add(String.valueOf(lon) + \",\"\r\n\t\t\t\t\t\t\t\t\t\t+ String.valueOf(lat));\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (myList.size() == 1) {\r\n\t\t\t\t\t\t\t\tSystem.err.println(\"First zoom\");\r\n\t\t\t\t\t\t\t\tLatLng CurrentLocation = new LatLng(googleMap\r\n\t\t\t\t\t\t\t\t\t\t.getMyLocation().getLatitude(),\r\n\t\t\t\t\t\t\t\t\t\tgoogleMap.getMyLocation()\r\n\t\t\t\t\t\t\t\t\t\t\t\t.getLongitude());\r\n\t\t\t\t\t\t\t\tCameraPosition cameraPosition = new CameraPosition.Builder()\r\n\t\t\t\t\t\t\t\t\t\t.target(CurrentLocation).zoom(18)\r\n\t\t\t\t\t\t\t\t\t\t.bearing(70).tilt(25).build();\r\n\t\t\t\t\t\t\t\tgoogleMap.animateCamera(CameraUpdateFactory\r\n\t\t\t\t\t\t\t\t\t\t.newCameraPosition(cameraPosition));\r\n\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (myList.size() >= 2) {\r\n\t\t\t\t\t\t\t\tdouble slat = myList.get(myList.size() - 2).latitude;\r\n\t\t\t\t\t\t\t\tdouble slon = myList.get(myList.size() - 2).longitude;\r\n\r\n\t\t\t\t\t\t\t\tdouble dlat = myList.get(myList.size() - 1).latitude;\r\n\t\t\t\t\t\t\t\tdouble dlon = myList.get(myList.size() - 1).latitude;\r\n\r\n\t\t\t\t\t\t\t\tLatLng mmarkersourcelatlng = new LatLng(myList\r\n\t\t\t\t\t\t\t\t\t\t.get(1).latitude,\r\n\t\t\t\t\t\t\t\t\t\tmyList.get(1).longitude);\r\n\t\t\t\t\t\t\t\tmsourcelatlng = new LatLng(slat, slon);\r\n\t\t\t\t\t\t\t\tmdestlatlng = new LatLng(dlat, dlon);\r\n\t\t\t\t\t\t\t\tSystem.err.println(\"myLocation:\"\r\n\t\t\t\t\t\t\t\t\t\t+ currentlocation);\r\n\t\t\t\t\t\t\t\tfor (int i = 1; i < myList.size() - 1; i++) {\r\n\t\t\t\t\t\t\t\t\tLatLng src = myList.get(i);\r\n\t\t\t\t\t\t\t\t\tLatLng dest = myList.get(i + 1);\r\n\t\t\t\t\t\t\t\t\tPolyline line = googleMap\r\n\t\t\t\t\t\t\t\t\t\t\t.addPolyline(new PolylineOptions()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// mMap is the Map Object\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.add(new LatLng(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc.latitude,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsrc.longitude),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnew LatLng(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdest.latitude,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdest.longitude))\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.width(10)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.color(R.color.pink)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.geodesic(true));\r\n\t\t\t\t\t\t\t\t\tmsmarker = googleMap\r\n\t\t\t\t\t\t\t\t\t\t\t.addMarker(new MarkerOptions()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.position(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmmarkersourcelatlng)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.title(\"Source\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.icon(BitmapDescriptorFactory\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));\r\n\r\n\t\t\t\t\t\t\t\t\tif (mdmarker != null) {\r\n\t\t\t\t\t\t\t\t\t\tmdmarker.remove();\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmdmarker = googleMap\r\n\t\t\t\t\t\t\t\t\t\t\t.addMarker(new MarkerOptions()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.position(msourcelatlng)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.title(\"Destination\")\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.icon(BitmapDescriptorFactory\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t.defaultMarker(BitmapDescriptorFactory.HUE_RED)));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tSystem.err.println(\"Mylocation Empty\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}, 200, 5000);\r\n\r\n\t}",
"public void updateTempList() {\n if (disableListUpdate == 0) {\n tempAdParts.clear();\n LatLngBounds bounds = mapboxMap.getProjection().getVisibleRegion().latLngBounds;\n iterator = AdParts.listIterator();\n while (iterator.hasNext()) {\n current = iterator.next();\n if (bounds.contains(current.getLatLng())) {\n tempAdParts.add(current);\n }\n }\n AdAdapter adapter = new AdAdapter(MainActivity.this, tempAdParts);\n listView.setAdapter(adapter);\n }\n }",
"private void addMarker(HashMap<String, GeofenceInfoContent[]> geofenceToAdd){\n System.gc();\n MainActivity mainActivity = (MainActivity) getActivity();\n\n for(Map.Entry<String, GeofenceInfoContent[]> e : geofenceToAdd.entrySet()){\n if(!currentGeofencesInfoMap.containsKey(e.getKey())) {\n currentGeofencesInfoMap.put(e.getKey(), e.getValue());\n geofenceNamesBeingQueriedForInfo.remove(e.getKey());\n String curGeofenceName = e.getKey();\n GeofenceObjectContent geofence = mainActivity.getGeofenceMonitor().curGeofencesMap.get(curGeofenceName);\n Bitmap markerIcon = BitmapFactory.decodeResource(getResources(), R.drawable.basic_map_marker);\n LatLng position = new LatLng(geofence.getGeofence().getLocation().getLat(), geofence.getGeofence().getLocation().getLng());\n BitmapDescriptor icon = BitmapDescriptorFactory.fromBitmap(markerIcon);\n MarkerOptions geofenceMarkerOptions = new MarkerOptions()\n .position(position)\n .title(curGeofenceName)\n .icon(icon);\n Marker curGeofenceMarker = mMap.addMarker(geofenceMarkerOptions);\n currentGeofenceMarkers.add(curGeofenceMarker);\n }\n }\n }",
"private void m125724s() {\n ProgressView progressView = this.f90233z;\n if (progressView != null) {\n progressView.mo81953b();\n if (this.f88308f != null) {\n this.f88308f.removeView(this.f90233z);\n }\n }\n }",
"public void generateMarkers(){\n /**\n * State verification\n */\n LocationManager lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n Location location = lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n final double currentlongitude = location.getLongitude();\n final double currentlatitude = location.getLatitude();\n\n final String usersCurrentState = getCurrentState(currentlatitude,currentlongitude);\n System.out.println(\"CURRENT STATE IS: \" + usersCurrentState);\n\n\n FirebaseDatabase.getInstance().getReference().child(\"Danger Zone Markers\")\n .addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n int numberOfMarkers = 0;\n int displayedMarkers = 0;\n for (DataSnapshot snapshot : dataSnapshot.getChildren()) {\n numberOfMarkers++;\n\n String zone_name = snapshot.child(\"zone_name\").getValue().toString();\n String risk_level = snapshot.child(\"risk_level\").getValue().toString();\n String lat = snapshot.child(\"lat\").getValue().toString();\n String longitude = snapshot.child(\"long\").getValue().toString();\n String description = snapshot.child(\"description\").getValue().toString();\n String time = snapshot.child(\"time\").getValue().toString();\n\n String dangerZoneState = getCurrentState(Double.valueOf(lat),Double.valueOf(longitude));\n System.out.println(\"DANGER ZONE STATE: \" + dangerZoneState);\n if(dangerZoneState.equals(usersCurrentState)) {\n displayedMarkers++;\n\n placeMarker(zone_name,risk_level,lat,longitude,description,time);\n\n\n }\n //placeMarker(zone_name,risk_level,lat,longitude,description);\n System.out.println(lat);\n }\n System.out.println(\"NUMBER OF TOTAL MARKERS: \" + numberOfMarkers);\n System.out.println(\"NUMBER OF DISPLAYED MARKERS: \" + displayedMarkers);\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n }\n });\n }",
"public void clearOffScreenResources() {\n int firstPosition = 0;\n int lastPosition = getItemCount();\n int offScreenKeepInCacheCount = mSpanCount;\n RecyclerView recyclerView = getRecyclerView();\n if (recyclerView != null && recyclerView.getLayoutManager() instanceof LinearLayoutManager) {\n LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();\n firstPosition = layoutManager.findFirstVisibleItemPosition();\n lastPosition = layoutManager.findLastVisibleItemPosition();\n }\n if (firstPosition == RecyclerView.NO_POSITION || lastPosition == RecyclerView.NO_POSITION) {\n return;\n }\n\n if (sDebug)\n Log.d(TAG, \"clearOffScreenResources:first:\" + firstPosition + \";last:\" + lastPosition);\n\n Iterator<Integer> it = mCachedPageList.iterator();\n while (it.hasNext()) {\n int page = it.next();\n int position = page - 1;\n\n if (position < (firstPosition - offScreenKeepInCacheCount) || position > (lastPosition + offScreenKeepInCacheCount)) {\n // not in range: clear BitmapDrawable cache, recycle Bitmap\n try {\n Map<String, Object> source = getItem(position);\n if (source != null) {\n // clear the cache\n mDataLock.lock();\n source.put(THUMB_IMAGE, null);\n mDataLock.unlock();\n if (sDebug)\n Log.d(TAG, \"remove image cache for page: \" + page + \"; position: \" + position);\n // this page is no longer cached\n it.remove();\n }\n } catch (Exception ignored) {\n }\n } // else in range: do nothing\n }\n // cancel all off screen tasks as well\n for (int i = 0; i < mTaskList.size(); i++) {\n int page = mTaskList.keyAt(i);\n int position = page - 1;\n if (position < (firstPosition - offScreenKeepInCacheCount) || position > (lastPosition + offScreenKeepInCacheCount)) {\n LoadThumbnailTask task = mTaskList.valueAt(i);\n if (null != task) {\n task.cancel(true);\n }\n } // else in range: do nothing\n }\n }",
"private void drawMarker(Location location){\n LatLng currentPosition = new LatLng(location.getLatitude(),location.getLongitude());\r\n runlist.add(currentPosition);\r\n\r\n\r\n for(int i = 0; i<runlist.size();i++){\r\n\r\n\r\n\r\n Marker marker = mGoogleMap.addMarker(new MarkerOptions()\r\n .position(runlist.get(i))\r\n .title(\"TRACKING\")\r\n .snippet(\"Real Time Locations\"));\r\n\r\n\r\n\r\n }\r\n\r\n AddLines();\r\n //mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(runlist.get(0),13));\r\n mGoogleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(runlist.get(0), 13.9f));\r\n\r\n\r\n }",
"void updateLandmarks() {\n\n\t\t\tregisterUpdateLandmarksTimer();\n\n\t\t\tint m = 2;\n\t\t\tfinal int expectedLandmarks = NumberOfLandmarks + m;\n\t\t\tIterator<Long> ier = pendingHSHLandmarks.keySet().iterator();\n\n\t\t\tSet<AddressIF> tmpList = new HashSet<AddressIF>(1);\n\t\t\tLong curRecord = null;\n\n\t\t\t// get a non-empty list of landmarks\n\t\t\twhile (ier.hasNext()) {\n\t\t\t\tLong nxt = ier.next();\n\t\t\t\tif (pendingHSHLandmarks.get(nxt).IndexOfLandmarks != null\n\t\t\t\t\t\t&& pendingHSHLandmarks.get(nxt).IndexOfLandmarks.size() > 0) {\n\t\t\t\t\ttmpList\n\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(nxt).IndexOfLandmarks);\n\t\t\t\t\tcurRecord = nxt;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if empty, we need to update landmarks immediately\n\t\t\tif (tmpList.size() == 0) {\n\t\t\t\t// remove the record\n\t\t\t\tif (curRecord != null) {\n\t\t\t\t\tpendingHSHLandmarks.get(curRecord).clear();\n\t\t\t\t\tpendingHSHLandmarks.remove(curRecord);\n\t\t\t\t} else {\n\t\t\t\t\t// null curRecord\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tfinal Long Timer = curRecord;\n\t\t\t\t// ping landmarks, if several of them fails, p percentage p=0.2\n\t\t\t\t// , we remove the records, and restart the landmark process\n\t\t\t\t// =================================================================\n\t\t\t\tfinal List<AddressIF> aliveLandmarks = new ArrayList<AddressIF>(\n\t\t\t\t\t\t1);\n\n\t\t\t\tNNManager.collectRTTs(tmpList, new CB2<Set<NodesPair>, String>() {\n\t\t\t\t\tprotected void cb(CBResult ncResult, Set<NodesPair> nps,\n\t\t\t\t\t\t\tString errorString) {\n\t\t\t\t\t\t// send data request message to the core node\n\t\t\t\t\t\tlong timer=System.currentTimeMillis();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (nps != null && nps.size() > 0) {\n\t\t\t\t\t\t\tSystem.out\n\t\t\t\t\t\t\t\t\t.println(\"\\n==================\\n Alive No. of landmarks: \"\n\t\t\t\t\t\t\t\t\t\t\t+ nps.size()\n\t\t\t\t\t\t\t\t\t\t\t+ \"\\n==================\\n\");\n\n\t\t\t\t\t\t\tIterator<NodesPair> NP = nps.iterator();\n\t\t\t\t\t\t\twhile (NP.hasNext()) {\n\t\t\t\t\t\t\t\tNodesPair tmp = NP.next();\n\t\t\t\t\t\t\t\tif (tmp != null && tmp.rtt >= 0) {\n\n\t\t\t\t\t\t\t\t\tAddressIF peer = (AddressIF)tmp.endNode;\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\tif (!ncManager.pendingLatency.containsKey(peer)) {\n\t\t\t\t\t\t\t\t\t\tncManager.pendingLatency.put(peer,\n\t\t\t\t\t\t\t\t\t\t\t\tnew RemoteState<AddressIF>(peer));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tncManager.pendingLatency.get(peer).addSample(tmp.rtt, timer);\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\tif (!pendingHSHLandmarks.containsKey(Timer)\n\t\t\t\t\t\t\t\t\t\t\t|| pendingHSHLandmarks.get(Timer).IndexOfLandmarks == null) {\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tint index = pendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t\t.indexOf(peer);\n\n\t\t\t\t\t\t\t\t\tif (index < 0) {\n\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t\t\t// found the element, and it is smaller\n\t\t\t\t\t\t\t\t\t\t// than\n\t\t\t\t\t\t\t\t\t\t// rank, i.e., it is closer to the\n\t\t\t\t\t\t\t\t\t\t// target\n\t\t\t\t\t\t\t\t\t\taliveLandmarks.add(peer);\n\n\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// wrong measurements\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// empty\n\t\t\t\t\t\t\t// all nodes fail, so there are no alive nodes\n\t\t\t\t\t\t\tif (pendingHSHLandmarks.containsKey(Timer)) {\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.remove(Timer);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// some landmarks are offline, we clear records and\n\t\t\t\t\t\t// start\n\t\t\t\t\t\tif (pendingHSHLandmarks.containsKey(Timer)) {\n\n\t\t\t\t\t\t\tif (aliveLandmarks.size() < 0.8 * expectedLandmarks) {\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.remove(Timer);\n\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// the landmarks are healthy, so we can sleep\n\t\t\t\t\t\t\t\t// awhile\n\t\t\t\t\t\t\t\t// TODO: remove dead landmarks, and resize the\n\t\t\t\t\t\t\t\t// landmarks\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t.clear();\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).IndexOfLandmarks\n\t\t\t\t\t\t\t\t\t\t.addAll(aliveLandmarks);\n\n\t\t\t\t\t\t\t\t// pendingHSHLandmarks.get(Timer).readyForUpdate=false;\n\t\t\t\t\t\t\t\tfinal Set<AddressIF> nodes = new HashSet<AddressIF>(\n\t\t\t\t\t\t\t\t\t\t1);\n\n\t\t\t\t\t\t\t\tnodes\n\t\t\t\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(Timer).IndexOfLandmarks);\n\t\t\t\t\t\t\t\tpendingHSHLandmarks.get(Timer).readyForUpdate = true;\n\n\t\t\t\t\t\t\t\t//update the rtts\n\t\t\t\t\t\t\t\t updateRTTs(Timer.longValue(),nodes, new\n\t\t\t\t\t\t\t\t CB1<String>(){ protected void cb(CBResult\n\t\t\t\t\t\t\t\t ncResult, String errorString){ switch\n\t\t\t\t\t\t\t\t (ncResult.state) { case OK: {\n\t\t\t\t\t\t\t\t System.out.println(\"$: Update completed\");\n\t\t\t\t\t\t\t\t System.out.println();\n\t\t\t\t\t\t\t\t if(errorString.length()<=0){\n\t\t\t\t\t\t\t\t pendingHSHLandmarks\n\t\t\t\t\t\t\t\t .get(Timer).readyForUpdate=true; }\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t break; } case ERROR: case TIMEOUT: { break; }\n\t\t\t\t\t\t\t\t } nodes.clear(); } });\n\t\t\t\t\t\t\t\t \n\n\t\t\t\t\t\t\t\treturn;\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}\n\n\t\t\t// ==================================================================\n\n\t\t\t// expected landmarks, K+m\n\n\t\t\tfinal Set<AddressIF> pendingNodes = new HashSet<AddressIF>(1);\n\n\t\t\tgetRandomNodes(pendingNodes, expectedLandmarks);\n\n\t\t\t// remove myself\n\t\t\tif (pendingNodes.contains(Ninaloader.me)) {\n\t\t\t\tpendingNodes.remove(Ninaloader.me);\n\t\t\t}\n\n\t\t\tSystem.out.println(\"$: HSH: Total number of landmarks are: \"\n\t\t\t\t\t+ pendingNodes.size());\n\n\t\t\tif (pendingNodes.size() == 0) {\n\t\t\t\tString errorString = \"$: HSH no valid nodes\";\n\t\t\t\tSystem.out.println(errorString);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tBarrier barrierUpdate = new Barrier(true);\n\t\t\tfinal StringBuffer errorBuffer = new StringBuffer();\n\n\t\t\tfinal long TimeStamp = System.currentTimeMillis();\n\n\t\t\tfor (AddressIF addr : pendingNodes) {\n\t\t\t\tseekLandmarks(TimeStamp, addr, barrierUpdate,\n\t\t\t\t\t\tpendingHSHLandmarks, errorBuffer);\n\t\t\t}\n\n\t\t\tEL.get().registerTimerCB(barrierUpdate, new CB0() {\n\t\t\t\tprotected void cb(CBResult result) {\n\t\t\t\t\tString errorString;\n\t\t\t\t\tif (errorBuffer.length() == 0) {\n\t\t\t\t\t\terrorString = new String(\"Success\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorString = new String(errorBuffer);\n\t\t\t\t\t}\n\n\t\t\t\t\t// finish the landmark seeking process\n\n\t\t\t\t\tif (!pendingHSHLandmarks.containsKey(Long\n\t\t\t\t\t\t\t.valueOf(TimeStamp))\n\t\t\t\t\t\t\t|| pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks == null) {\n\t\t\t\t\t\tSystem.out.println(\"$: NULL elements! \");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks\n\t\t\t\t\t\t\t.size() < (0.7 * expectedLandmarks)) {\n\t\t\t\t\t\tpendingHSHLandmarks.get(Long.valueOf(TimeStamp))\n\t\t\t\t\t\t\t\t.clear();\n\t\t\t\t\t\tpendingHSHLandmarks.remove(Long.valueOf(TimeStamp));\n\t\t\t\t\t\tSystem.out.println(\"$: not enough landmark nodes\");\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t//\n\t\t\t\t\t\tpendingHSHLandmarks.get(Long.valueOf(TimeStamp)).readyForUpdate = true;\n\t\t\t\t\t\tSystem.out.println(\"$: enough landmark nodes\");\n\t\t\t\t\t\t\n\t\t\t\t\t\tfinal Set<AddressIF> nodes = new HashSet<AddressIF>(1);\n\t\t\t\t\t\tnodes\n\t\t\t\t\t\t\t\t.addAll(pendingHSHLandmarks.get(Long.valueOf(TimeStamp)).IndexOfLandmarks);\n\t\t\t\t\t\tupdateRTTs(Long.valueOf(TimeStamp), nodes, new CB1<String>() {\n\t\t\t\t\t\t\tprotected void cb(CBResult ncResult, String errorString) {\n\t\t\t\t\t\t\t\tswitch (ncResult.state) {\n\t\t\t\t\t\t\t\tcase OK: {\n\t\t\t\t\t\t\t\t\tSystem.out.println(\"$: Update completed\");\n\t\t\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase ERROR:\n\t\t\t\t\t\t\t\tcase TIMEOUT: {\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\t}\n\t\t\t\t\t\t\t\tnodes.clear();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"private boolean markersClose(Marker one, Marker two) {\n if (one.getID() == two.getID()) {\n if (one.getArea() - two.getArea() < 20 && one.getArea() - two\n .getArea\n () > -20) {\n log.debug(TAG, \"Removing double marker! ID: \" + one.getID());\n return true;\n }\n }\n return false;\n }",
"public void cancel(){\n\t\tstartTime = -1;\n\t\tplayersFinished = new ArrayList<>();\n\t\tplayersFinishedMarked = new ArrayList<Player>();\n\t\tDNFs = new ArrayList<>();\n\t\ttempNumber = 0;\n\t\tmarkedNum = 0;\n\t\t//normally we'd mark started racers as such, but we are don't know how many started.\n\t}",
"@Override\n public void onMapClick(LatLng latLng) {\n rvTencentMapViewMessage.setVisibility(View.GONE);\n rlyTencentMapViewCollect.setVisibility(View.GONE);\n handler.removeCallbacks(runnable);\n InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);\n View v = getWindow().peekDecorView();\n if (null != v) {\n imm.hideSoftInputFromWindow(v.getWindowToken(), 0);\n }\n\n rlyTencentMapViewBaiTang.setVisibility(View.GONE);\n if(markers != null){\n markers.remove();\n latLng1 = orginalLng;\n }\n if(scaleMarker != null){\n Animation scaleAnimation2 = new ScaleAnimation((float)1.36,(float) 1,(float)1.36,(float)1);\n scaleAnimation2.setDuration(100);\n scaleMarker.setAnimation(scaleAnimation2);\n scaleMarker.startAnimation();\n scaleMarker = null;\n// scaleMarker.refreshInfoWindow();\n// scaleMarker.setFastLoad(true);\n }\n\n// marker.setIcon(BitmapDescriptorFactory.fromBitmap(getBitMap(R.mipmap.booth,40,40)));\n }",
"void addMarkers() {\n\n Map<String, ProductDetailsCartItem> restaurantGeolocations = new HashMap<>();\n for (UserProductsItem userProductsItem : userProductsItemList) {\n for (ProductDetailsCartItem productDetailsCartItem : userProductsItem.getCartDetails()) {\n ProductDetailsCartItem restaurantDetails = new ProductDetailsCartItem(productDetailsCartItem.getRestaurantGeolocation(), productDetailsCartItem.getRestaurantAddress());\n restaurantGeolocations.put(productDetailsCartItem.getRestaurantName(), restaurantDetails);\n\n }\n }\n restaurantListServices.removeElements();\n LatLng position = new LatLng(0, 0);\n String address = \"\";\n int restaurantPosition = 0;\n for (HashMap.Entry<String, ProductDetailsCartItem> restaurantDetails : restaurantGeolocations.entrySet()) {\n try {\n String geolocation = restaurantDetails.getValue().getRestaurantGeolocation();\n address = restaurantDetails.getValue().getRestaurantAddress();\n String[] lat_long = geolocation.split(\",\");\n\n double lat = Double.parseDouble(lat_long[0]);\n double lng = Double.parseDouble(lat_long[1]);\n position = new LatLng(lat, lng);\n } catch (NumberFormatException e) {\n e.printStackTrace();\n } finally {\n MarkerOptions mo = new MarkerOptions().position(position).title(restaurantDetails.getKey());\n mo.visible(true);\n // mo.flat(true);\n mo.snippet(address);\n\n Marker marker = googleMap.addMarker(mo);\n marker.showInfoWindow();\n // polylineOptions.add(position);\n RestaurantMapItem restaurantMapItem = new RestaurantMapItem(restaurantDetails.getKey(), restaurantDetails.getValue().getRestaurantAddress(), ++restaurantPosition, position, marker);\n restaurantListServices.addRestaurant(restaurantMapItem);\n\n }\n }\n\n UiSettings settings = googleMap.getUiSettings();\n settings.setMapToolbarEnabled(true);\n settings.setMyLocationButtonEnabled(true);\n settings.setCompassEnabled(true);\n googleMap.setContentDescription(\"restaurants\");\n googleMap.setTrafficEnabled(true);\n\n\n googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(position, 12));\n\n googleMap.setOnMyLocationButtonClickListener(this);\n googleMap.setOnMyLocationClickListener(this);\n\n checkPermissions();\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n googleMap.setMyLocationEnabled(true);\n\n restaurantListViewAdapter.notifyDataSetChanged();\n /*if (mMutablePolyline != null) {\n mMutablePolyline.remove();\n }\n mMutablePolyline = googleMap.addPolyline(polylineOptions);\n*/\n }",
"public void addMarkers(View view) {\n if (null == hMap) {\n return;\n }\n if (isAdded) {\n Toast.makeText(this, \"Markers has already added.\", Toast.LENGTH_LONG).show();\n return;\n }\n InputStream inputStream = getResources().openRawResource(R.raw.marker_200);\n List<MarkerOptions> markerOptionsList = null;\n try {\n markerOptionsList = new MyItemReader().read(inputStream);\n } catch (JSONException e) {\n Log.e(TAG, \"JSONException.\");\n }\n if (markerOptionsList == null) {\n return;\n }\n for (MarkerOptions item : markerOptionsList) {\n hMap.addMarker(item);\n }\n isAdded = true;\n }",
"private void addMarkers() {\n\n for (MarkerPropio m : listMarkers) {\n LatLng posicion = new LatLng(m.getLatitud(), m.getLogitud());\n final MarkerOptions marker = new MarkerOptions()\n .position(posicion)\n .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker1))\n .title(m.getTitulo())\n .snippet(m.getDescripcion());\n switch (m.getNumImages()){\n case 1:\n marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker1));\n break;\n case 2:\n marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker2));\n break;\n case 3:\n marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker3));\n break;\n case 4:\n marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker4));\n break;\n case 5:\n marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker5));\n break;\n case 6:\n marker.icon(BitmapDescriptorFactory.fromResource(R.drawable.marker6));\n break;\n\n }\n mMap.addMarker(marker);\n hashMarker.put(posicion, m.getId());\n mMap.setOnInfoWindowClickListener(this);\n }\n }",
"public boolean onMarkerClick(final Marker marker ) {\n marker.showInfoWindow();\n LatLng point = marker.getPosition();\n\n markerPoints.add(point);\n MarkerOptions options = new MarkerOptions();\n options.position(point);\n // marker.setVisible(false);\n // Toast.makeText(getBaseContext(), \"inside marker click \" , Toast.LENGTH_SHORT).show();\n LatLng myLatLng = new LatLng(marker.getPosition().latitude,marker.getPosition().longitude);\n Button delete_Accomodation = (Button) findViewById(R.id.deleteAccomodation);\n delAccOnClickListener delAcc = new delAccOnClickListener( myLatLng, marker)\n {\n @Override\n public void onClick(View v) {\n // Start NewActivity.class\n\n AlertDialog alertDialog = new AlertDialog.Builder(MapsActivity.this).create();\n alertDialog.setTitle(\"Delete Marker\");\n alertDialog.setMessage(\"Want To Delete Marker?\");\n alertDialog.setButton(\"Delete\",new DialogInterface.OnClickListener()\n {\n @SuppressLint({ \"ShowToast\", \"NewApi\" })\n public void onClick(final DialogInterface dialog,final int which)\n {\n\n getKey(googleMap, delAcc.latitude,delAcc.longitude);\n // Below two lines to delete marker\n googleMap.clear();\n getLocation(googleMap);\n // Toast.makeText(getApplicationContext(),\"Transaction ID Created\",1000).show();\n\n }\n });\n alertDialog.setButton2(\"Cancel\",new DialogInterface.OnClickListener()\n {\n @SuppressLint(\"ShowToast\")\n public void onClick(final DialogInterface dialog,final int which)\n {\n\n Toast.makeText(getApplicationContext(),\"Cancelled\",1000).show();\n }\n });\n\n alertDialog.show();\n\n\n }\n };\n\n //return true;\n // Setting button click event listener for the find button\n delete_Accomodation.setOnClickListener(delAcc);\n\n if (markerPoints.size() >= 2) {\n // Get Directions\n Button get_Directions = (Button) findViewById(R.id.getDirection);\n directionsAccOnClickListener getDir = new directionsAccOnClickListener(point) {\n @Override\n public void onClick(View v) {\n // Start NewActivity.class\n\n //getDirections(point, googleMap);\n getDirections(googleMap);\n }\n };\n\n\n // Setting button click event listener for the find button\n get_Directions.setOnClickListener(getDir);\n }\n //\n\n return doNotMoveCameraToCenterMarker;\n }",
"private void loadCrimes(LatLng Loc){\n //create a new instance of parser class. Parser class queries Data.octo.dc.gov for crime data\n mParser = new Parser();\n\n //try and parse data\n try {\n mParser.parse(getResources().getAssets().open(DATA, 0));\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n //get the data from the parser and stores in TreeSet\n mCrimesList= mParser.nearestCrimes(Loc.latitude, Loc.longitude, mRadius);\n\n //Loop through and plot crimes\n List<Address> address;\n int i = 1;\n\n //iterate through crimes and querey google to get latitude and longitude of particular addresses\n for(Crime c: mCrimesList){\n try {\n address = mGeocoder.getFromLocationName(c.address ,1,\n mBounds[0], mBounds[1],mBounds[2], mBounds[3]);\n if(address == null || address.size() == 0){\n Log.i(TAG, \"***Crime:\" + c.offense + \" @ \" + c.address + \" NOT PLOTTED\");\n /*Crimes with addresses that can't be found are added to bad crimes list\n to be removed */\n mBadCrimesList.add(c);\n Log.i(TAG, mBadCrimesList.toString());\n if(i<=MAX_CRIMES) {\n continue;\n }else{\n removeBadCrimes();\n return;\n }\n }\n LatLng coor = new LatLng(address.get(0).getLatitude(), address.get(0).getLongitude());\n\n //Create pin\n Marker crime_marker = mMap.addMarker(new MarkerOptions()\n .position(coor));\n\n //this put geofence around crime points. Team decided to comment out to remove clutter\n /*Circle crime_circle = mMap.addCircle(new CircleOptions()\n .center(new LatLng(coor.latitude, coor.longitude))\n .radius(CIRCLE_SIZE)\n .strokeColor(Color.RED)\n .fillColor(RED_COLOR));\n c.circle = crime_circle;*/\n\n\n //crime object gets reference to its own pin\n c.marker = crime_marker;\n if(c.marker == null){\n Log.i(TAG, \"null marker\");\n }\n if(c.circle == null){\n Log.i(TAG, \"null circle\");\n }\n c.Lat = coor.latitude;\n c.Long = coor.longitude;\n\n //start out crime by being invisible\n c.setVisable(false);\n Log.i(TAG, \"Crime:\" + c.offense + \" @ \" + c.address + \" PLOTTED\");\n }catch(IOException e){\n //catch any issue that google throws\n Log.i(TAG, \"I/O EXCEPTION while plotting crime\");\n mBadCrimesList.add(c);\n continue;\n }\n i++;\n if(i > MAX_CRIMES ){\n removeBadCrimes();\n return;\n }\n }\n\n }",
"public void sortMarkers() {\n\t\tCollections.sort(getMarkerSet().getMarkers(),\r\n\t\t\t\tnew MarkerTimeComparator());\r\n\t\t// log.debug(\"[sortMarkers]after: \" + getMarkerSet().getMarkers());\r\n\r\n\t}",
"@Override\n public void onDone() {\n /*try {\n mOverlay.remove(mEyesGraphic);\n }catch (NullPointerException e){\n e.printStackTrace();\n }*/\n }",
"public void removeMarker(int iIndex)\n \t{\n \t\tlMarkers.remove(iIndex);\n \t}",
"private void cleanSweep(){\n // Corrects the reminder dates for those reminders which will be repeating.\n refreshAllRepeatReminderDates();\n\n // Starts removing expired reminders.\n Calendar timeRightNow = Calendar.getInstance();\n boolean cleanList;\n for (int outerCounter=0; outerCounter<reminderItems.size();outerCounter++) {\n cleanList=true;\n for (int counter = 0; counter < reminderItems.size(); counter++) {\n int year = reminderItems.get(counter).getReminderYear();\n int month = reminderItems.get(counter).getReminderMonth();\n int day = reminderItems.get(counter).getReminderDay();\n int hour = reminderItems.get(counter).getReminderHour();\n int minute = reminderItems.get(counter).getReminderMinute();\n int second = 0;\n\n Calendar timeOfDeletion = Calendar.getInstance();\n timeOfDeletion.set(year, month, day, hour, minute, second);\n\n if (timeOfDeletion.before(timeRightNow)) {\n deleteReminderItem(counter);\n cleanList=false;\n break;\n }\n }\n if(cleanList){\n break;\n }\n }\n\n // Refreshes the reminder date descriptions (correcting \"Today\" and \"Tomorrow\" depending on the date).\n refreshAllDateDescriptions();\n }",
"private void deleteIcons() {\n Uri uri = DatabaseMap.PlaceEntry\n .buildPlaceByFavoriteUri(getResources().getInteger(R.integer.favorite_add));\n String[] projection = {DatabaseMap.PlaceEntry.PLACE_ICON_FILE_NAME};\n Cursor cursor = getContentResolver().query(uri, projection, null, null, null);\n ArrayList<String> favoritesIcons = new ArrayList<String>();\n\n while (cursor.moveToNext()) {\n favoritesIcons.add(cursor.getString(cursor.getColumnIndex(DatabaseMap.PlaceEntry.PLACE_ICON_FILE_NAME)));\n }\n\n String[] files = fileList();\n for (String fileName : files) {\n if (!favoritesIcons.contains(fileName))\n deleteFile(fileName);\n }\n }",
"void UpdateMarkers(){\n final Vector3f eye_pos = new Vector3f();\n final Vector3f lookat_pos = new Vector3f();\n Matrix4f.decompseRigidMatrix(m_params.g_ModelViewMatrix, eye_pos, lookat_pos, null);\n\n final float intersectionHeight = g_ocean_param_quadtree.sea_level;\n final float lambda = (intersectionHeight - eye_pos.getY())/(lookat_pos.getY() - eye_pos.getY());\n// const XMVECTOR sea_level_pos = (1.f - lambda) * eye_pos + lambda * lookat_pos;\n final Vector3f sea_level_pos = Vector3f.linear(eye_pos, 1.f - lambda, lookat_pos, lambda, null);\n// const XMVECTOR sea_level_xy = XMVectorSet(XMVectorGetX(sea_level_pos), XMVectorGetZ(sea_level_pos), 0, 0);\n final Vector3f sea_level_xy = new Vector3f(sea_level_pos.x, sea_level_pos.z, 0);\n\n // Update local marker coords, we could need them any time for remote\n for(int x = 0; x != NumMarkersXY; ++x)\n {\n for(int y = 0; y != NumMarkersXY; ++y)\n {\n// XMVECTOR offset = XMVectorSet(2.f * (x - ((NumMarkersXY - 1) / 2)), 2.f * (y - ((NumMarkersXY - 1) / 2)), 0, 0);\n// XMVECTOR newPos = sea_level_xy / kWaterScale + offset;\n float offsetX = 2.f * (x - ((NumMarkersXY - 1) / 2));\n float offsetY = 2.f * (y - ((NumMarkersXY - 1) / 2));\n float newPosX = sea_level_xy.x/kWaterScale + offsetX;\n float newPosY = sea_level_xy.y/kWaterScale + offsetY;\n\n g_local_marker_coords[y * NumMarkersXY + x].x = newPosX;\n g_local_marker_coords[y * NumMarkersXY + x].x = newPosY;\n }\n }\n\n // Do local readback, if requested\n if(g_ocean_simulation_settings.readback_displacements)\n {\n if(g_ReadbackCoord >= 1.f)\n {\n final float coord = g_ReadbackCoord - (g_LastReadbackKickID[0]-g_LastArchivedKickID[0]) * 1.f/ReadbackArchiveInterval;\n GFSDK_WaveWorks.GFSDK_WaveWorks_Simulation_GetArchivedDisplacements(g_hOceanSimulation, coord, g_local_marker_coords, displacements, NumMarkers);\n }\n else\n {\n GFSDK_WaveWorks.GFSDK_WaveWorks_Simulation_GetDisplacements(g_hOceanSimulation, g_local_marker_coords, displacements, NumMarkers);\n }\n\n for(int ix = 0; ix != NumMarkers; ++ix)\n {\n g_local_marker_positions[ix].x = displacements[ix].x + g_local_marker_coords[ix].x;\n g_local_marker_positions[ix].y = displacements[ix].y + g_local_marker_coords[ix].y;\n g_local_marker_positions[ix].z = displacements[ix].z;\n g_local_marker_positions[ix].w = 1.f;\n }\n }\n\n// if(g_bShowRemoteMarkers && NULL != g_pNetworkClient)\n// {\n// g_pNetworkClient->RequestRemoteMarkerPositions(g_remote_marker_coords,NumMarkers);\n// }\n }",
"private void removeExpired() {\n Map<K,CacheableObject> removeMap = new HashMap<K,CacheableObject>(valueMap.size()/2);\n List<CacheListener<K>> tempListeners = new ArrayList<CacheListener<K>>();\n\n // Retrieve a list of everything that's to be removed\n synchronized(theLock) {\n for (Map.Entry<K,CacheableObject> entry : valueMap.entrySet()) {\n if (isExpired(entry.getValue())) {\n removeMap.put(entry.getKey(), entry.getValue());\n }\n }\n tempListeners.addAll(listeners);\n }\n\n // Remove the entries one-at-a-time, notifying the listener[s] in the process\n for (Map.Entry<K,CacheableObject> entry : removeMap.entrySet()) {\n synchronized(theLock) {\n currentCacheSize -= entry.getValue().containmentCount;\n valueMap.remove(entry.getKey());\n }\n Thread.yield();\n\n for (CacheListener<K> listener : tempListeners) {\n listener.expiredElement(entry.getKey());\n }\n }\n }",
"private void getMarkers() {\n\n // Read from the database\n databaseRef.addValueEventListener(new ValueEventListener() {\n /**\n * listener to get data of vendors from firebase db\n * @param dataSnapshot\n */\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n // This method is called once with the initial value and again\n // whenever data at this location is updated.\n HashMap<String, Object> values = (HashMap<String, Object>) dataSnapshot.getValue();\n for (String UserId : values.keySet()) {\n HashMap<String, Object> userInfo = (HashMap<String, Object>) values.get(UserId);\n\n if (userInfo.get(\"Type\").equals(\"Vendor\")\n && userInfo.containsKey(\"Location\")\n && userInfo.containsKey(\"Name Of Food Truck\")\n && userInfo.containsKey(\"Type Of Food\")\n && userInfo.containsKey(\"Active\")) {\n\n // get info from vendor\n String vendorName = (String) userInfo.get(\"Name Of Food Truck\");\n String foodType = (String) userInfo.get(\"Type Of Food\");\n String coords = (String) userInfo.get(\"Location\");\n String uniqueID = (String) userInfo.get(\"UniqueID\");\n boolean isActive = (boolean)userInfo.get(\"Active\");\n Location l = new Location(coords);\n\n // make green marker if active\n if (isActive) {\n // add marker to map\n mMap.addMarker(new MarkerOptions()\n .position(new LatLng(l.getLat(), l.getLng()))\n .snippet(foodType)\n .title(vendorName)\n .icon(BitmapDescriptorFactory.defaultMarker(\n BitmapDescriptorFactory.HUE_GREEN)))\n .setTag(uniqueID);\n }\n else {\n // add marker to map\n mMap.addMarker(new MarkerOptions()\n .position(new LatLng(l.getLat(), l.getLng()))\n .snippet(foodType)\n .title(vendorName))\n .setTag(uniqueID);\n }\n\n mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n @Override\n public void onInfoWindowClick(Marker marker) {\n Log.d(\"markerOnClick\", \"marker clicked\");\n String uniqueID = (String) marker.getTag();\n Intent i = new Intent(MapsActivity.this, VendorProfileForCustomerActivity.class);\n i.putExtra(\"vendorUniqueID\", uniqueID);\n startActivity(i);\n }\n });\n\n }\n }\n\n }\n\n /**\n * handles error from db\n * @param error\n */\n @Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }\n });\n }",
"@Override\n public void onMapReady(GoogleMap googleMap) {\n gmap = googleMap;\n\n for (Earthquake earthquake: earthquakeList){\n // Create a new coordinates based on the earthquakes geo latitude and geo longitude\n LatLng latLng = new LatLng(earthquake.getGeoLat(), earthquake.getGeoLong());\n // Add the location of the earthquake as a marker on GoogleMaps based on its coordinates\n if (earthquake.getMagnitude() <= 1){\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\n }\n else if (earthquake.getMagnitude() <= 2) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_CYAN));\n }\n else if (earthquake.getMagnitude() <= 3) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_AZURE));\n }\n else if (earthquake.getMagnitude() <= 4) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_BLUE));\n }\n else if (earthquake.getMagnitude() <= 5) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_VIOLET));\n }\n else if (earthquake.getMagnitude() <= 6) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_MAGENTA));\n }\n else if (earthquake.getMagnitude() <= 7) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ROSE));\n }\n else if (earthquake.getMagnitude() <= 8) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_YELLOW));\n }\n else if (earthquake.getMagnitude() <= 9) {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_ORANGE));\n }\n else {\n // Set the title to the earthquake's location name\n gmap.addMarker(new MarkerOptions().position(latLng).title(earthquake.getLocation())).setIcon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));\n }\n\n }\n // Coordinates for London\n LatLng london = new LatLng(51.509865, -0.118092);\n // Moves the camera to the location of London\n // This is to just focus the camera on the UK\n gmap.moveCamera(CameraUpdateFactory.newLatLng(london));\n // Displays the Zoom in and out controls on the Map UI\n gmap.getUiSettings().setZoomControlsEnabled(true);\n }",
"@Override\n public void onMapReady(GoogleMap googleMap) {\n map = googleMap;\n map.setMyLocationEnabled(true);\n currentLatLang = new LatLng(currentLoc.getLatitude(),currentLoc.getLongitude());\n preLati = currentLoc.getLatitude();\n preLogi = currentLoc.getLongitude();\n //map.moveCamera(CameraUpdateFactory.newLatLng(currentLatLang));\n // map.animateCamera(CameraUpdateFactory.newLatLng(currentLatLang));\n map.animateCamera(CameraUpdateFactory.newLatLngZoom(currentLatLang,13));//zoom to current location animation\n //map.addMarker(new MarkerOptions().position(currentLatLang).title(\"You are here\"));\n\n\n //after map assign we are going to do database work here\n //hierarchy is on top Datas there\n //after that Sensor name comes, each sensor child contains two values location and radius\n databaseReference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n //dataSnapshot.key will give \"Datas\" but here i am not using that key\n int sensorReading1,sensorReading2;\n\n if( dangerCircleSensor1!=null) dangerCircleSensor1.remove(); // every time data changes on database\n if( dangerCircleSensor2!=null) dangerCircleSensor2.remove(); // here we delete all marker and\n\n if( warningCircleSensor1!=null) warningCircleSensor1.remove();\n if( warningCircleSensor2!=null) warningCircleSensor2.remove();\n\n if(dangerMarkerSensor1!=null) dangerMarkerSensor1.remove(); // circle if it is on map\n if(dangerMarkerSensor2!=null) dangerMarkerSensor2.remove(); // later we adding marker and circle again using database value\n\n if(warningMarkerSensor1!=null) warningMarkerSensor1.remove();\n if(warningMarkerSensor2!=null) warningMarkerSensor2.remove();\n\n double db = Double.parseDouble(dataSnapshot.child(\"CITY1LOC1\")\n .child(\"reading\").getValue().toString());\n\n dangerZoneRadSensor1 = Calculator.getDistance(db,highdb,sourceDistance);\n warningZoneRadSensor1 = Calculator.getDistance(db, warningDB,sourceDistance);\n LatLng latLng = new LatLng(sorceLati,sourceLongti);\n dangerMarkerSensor1 = map.addMarker(new MarkerOptions().position(latLng).title(\"Sensor 1 is here\"));// added into\n dangerMarkerSensor1.showInfoWindow();//to display tag always\n Log.d(TAG, \"onDataChange: dangerZoneRadSensor1\" +(int) dangerZoneRadSensor1 );\n dangerCircleSensor1 = map.addCircle(getCircleOption(latLng,(int) dangerZoneRadSensor1,Color.RED));//draw the circle on map added\n // into Circle object\n warningCircleSensor1 = map.addCircle(getCircleOption(latLng,(int)warningZoneRadSensor1,Color.GREEN));\n /*for (DataSnapshot postSnapshot: dataSnapshot.getChildren()){\n String sensor = postSnapshot.getKey().toLowerCase().trim();//it give the sensor name\n //we have to handle the cases for all sensors in our list\n double latitude,longitude;//location in database look like this \"12.3,45.754\" we have to decode this\n // for decoding we use locationDecoder and it will return an array of length 2\n // index 0 gives latitude\n // index 1 gives longitude\n if (sensor.equalsIgnoreCase(\"sensor1\")){\n String location = postSnapshot.child(\"location\").getValue().toString() ;\n double[] locationArray = Calculator.getLocation(location);\n latitude = locationArray[0];\n longitude = locationArray[1];\n LatLng latLng = new LatLng(latitude,longitude);//create location coordinates with lati and longi\n // using latitude and longitude we can mark position in map using below line\n dangerMarkerSensor1 = map.addMarker(new MarkerOptions().position(latLng).title(\"Sensor 1 is here\"));// added into\n dangerMarkerSensor1.showInfoWindow();//to display tag always\n // Marker object\n int dangerRadius = ((Long)postSnapshot.child(\"dangerRadius\").getValue()).intValue();//radius is in long we haveto\n // convert it into int\n int warningRadius = ((Long)postSnapshot.child(\"warningRadius\").getValue()).intValue();\n dangerZoneRadSensor1 = dangerRadius;\n warningZoneRadSensor1 = warningRadius;\n dangerCircleSensor1 = map.addCircle(getCircleOption(latLng,dangerRadius,Color.RED));//draw the circle on map added\n // into Circle object\n warningCircleSensor1 = map.addCircle(getCircleOption(latLng,warningRadius,Color.GREEN));\n }\n else if (sensor.equalsIgnoreCase(\"sensor2\")){\n String location = postSnapshot.child(\"location\").getValue().toString().trim() ;\n double[] locationArray = Calculator.getLocation(location);\n latitude = locationArray[0];\n longitude = locationArray[1];\n LatLng latLng = new LatLng(latitude,longitude);\n dangerMarkerSensor2 = map.addMarker(new MarkerOptions().position(new LatLng(latitude,longitude)).title(\"Sensor 2 is here\"));\n dangerMarkerSensor2.showInfoWindow();//to display tag always\n int dangerRadius = ((Long)postSnapshot.child(\"dangerRadius\").getValue()).intValue();\n int warningRadius = ((Long)postSnapshot.child(\"warningRadius\").getValue()).intValue();\n dangerCircleSensor2 = map.addCircle(getCircleOption(latLng,dangerRadius,Color.BLACK));\n warningCircleSensor2 = map.addCircle(getCircleOption(latLng,warningRadius,Color.GREEN));\n }\n }*/\n\n double latitude=currentLoc.getLatitude();\n double longitude=currentLoc.getLongitude();\n double distance = Calculator.distance(sensor1Lati,latitude,sensor2Longi,longitude,0,0); //gives the distance changed\n preLati = latitude;\n preLogi = longitude;\n // String msg=\"New Latitude: \"+latitude + \"New Longitude: \"+longitude;\n\n if (distance <= dangerZoneRadSensor1)\n Toast.makeText(MapActivity.this,\"You are in danger zone. Move \" + (dangerZoneRadSensor1 - distance) + \" m backwards\" ,Toast.LENGTH_LONG).show();\n else if (distance <= warningZoneRadSensor1 )\n Toast.makeText(MapActivity.this,\"You are in warning zone. \" ,Toast.LENGTH_LONG).show();\n\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }",
"private synchronized void invalidate() {\n MoreCloseables.closeQuietly(mNewCallsCursor);\n MoreCloseables.closeQuietly(mOldCallsCursor);\n mNewCallsCursor = null;\n mOldCallsCursor = null;\n }",
"protected void removeOldData() {\n if (!storage.isEmpty()) {\n long timeLowerbound = storage.lastKey() - maxStorageTime;\n while (!storage.isEmpty() && storage.firstKey() < timeLowerbound) {\n storage.pollFirstEntry();\n } \n }\n }",
"private void showPlaceInfo(Marker marker){\n if (marker != null){\n //unlock the drawer\n layout_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED);\n\n et_drawer_name.setText(marker.getTitle());\n\n //open the drawer layer from the right\n layout_drawer.openDrawer(Gravity.RIGHT);\n\n final Marker markerCopy = marker;\n\n Button remove = (Button) findViewById(R.id.drawer_btn_remove);\n remove.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n layout_drawer.closeDrawer(Gravity.RIGHT);\n layout_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(context);\n // set dialog message\n alertDialogBuilder\n .setMessage(\"Are you sure you want to remove location?\")\n .setCancelable(false)\n .setPositiveButton(\"Remove\",new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,int id) {\n removeMarkerFromMap(markerCopy);\n Toast.makeText(getApplicationContext(), \"Location Removed\",\n Toast.LENGTH_SHORT).show();\n }\n })\n .setNegativeButton(\"Cancel\",new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog,int id) {\n // if this button is clicked, just close\n // the dialog box and do nothing\n dialog.cancel();\n }\n });\n\n // create alert dialog\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.show();\n }\n });\n\n //Close the drawer when cancel is pressed\n Button cancel = (Button) findViewById(R.id.drawer_btn_cancel);\n cancel.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n layout_drawer.closeDrawer(Gravity.RIGHT);\n layout_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n }\n });\n\n //Save changes in the name and close drawer when save is pressed\n Button save = (Button) findViewById(R.id.drawer_btn_save);\n save.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n EditText editName = (EditText) findViewById(R.id.drawer_et_name);\n String editedName = editName.getText().toString();\n changeMarkerName(markerCopy, editedName);\n Toast.makeText(getApplicationContext(), \"Name Saved\", Toast.LENGTH_SHORT).show();\n layout_drawer.closeDrawer(Gravity.RIGHT);\n layout_drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n }\n });\n }\n }",
"private void addMarkerOnMap(double latitude, double longitude) {\n try {\n //System.out.println(\"LAT::: \" + latitude);\n //System.out.println(\"LONG::: \" + longitude);\n mCurrentLocationLat = latitude;\n mCurrentLocationLongitude = longitude;\n if (markerOptions == null)\n markerOptions = new MarkerOptions();\n\n // Creating a LatLng object for the current / new location\n LatLng currentLatLng = new LatLng(latitude, longitude);\n markerOptions.position(currentLatLng).icon(BitmapDescriptorFactory.defaultMarker()).title(\"Current Location\");\n\n if (mapMarker != null)\n mapMarker.remove();\n\n mapMarker = mMap.addMarker(markerOptions);\n\n// if (dlBean.getAddress() != null) {\n// if (!dlBean.getAddress().equals(\"No Location Found\") && !dlBean.getAddress().equals(\"No Address returned\") && !dlBean.getAddress().equals(\"No Network To Get Address\"))\n// mapMarker.setTitle(dlBean.getAddress());\n// }\n\n // Showing the current location in Google Map by Zooming it\n mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(currentLatLng, 15));\n\n for (TripsheetSOList saleOrder : tripSheetSOList) {\n AgentLatLong agentLatLong = new AgentLatLong();\n double distance;\n\n // We are calculating distance b/w current location and agent location if lat long are not empty\n if (saleOrder.getmTripshetSOAgentLatitude() != null && !saleOrder.getmTripshetSOAgentLatitude().equals(\"\") && saleOrder.getmTripshetSOAgentLongitude() != null && !saleOrder.getmTripshetSOAgentLongitude().equals(\"\")) {\n double agentLatitude = Double.parseDouble(saleOrder.getmTripshetSOAgentLatitude());\n double agentLongitude = Double.parseDouble(saleOrder.getmTripshetSOAgentLongitude());\n\n distance = getDistanceBetweenLocationsInMeters(mCurrentLocationLat, mCurrentLocationLongitude, agentLatitude, agentLongitude);\n\n agentLatLong.setAgentName(saleOrder.getmTripshetSOAgentFirstName());\n agentLatLong.setLatitude(agentLatitude);\n agentLatLong.setLongitude(agentLongitude);\n agentLatLong.setDistance(distance);\n\n agentsLatLongList.add(agentLatLong);\n\n } else {\n distance = 0.0;\n }\n\n saleOrder.setDistance(Math.round(distance / 1000));\n }\n\n // Sorting by distance in descending order i.e. nearest destination\n Collections.sort(agentsLatLongList, new Comparator<AgentLatLong>() {\n @Override\n public int compare(AgentLatLong o1, AgentLatLong o2) {\n return o1.getDistance().compareTo(o2.getDistance());\n }\n });\n\n Collections.sort(tripSheetSOList, new Comparator<TripsheetSOList>() {\n @Override\n public int compare(TripsheetSOList o1, TripsheetSOList o2) {\n return o1.getDistance().compareTo(o2.getDistance());\n }\n });\n\n // to update distance value in list after getting current location details.\n if (mTripsheetSOAdapter != null) {\n mTripsheetSOAdapter.setAllSaleOrdersList(tripSheetSOList);\n mTripsheetSOAdapter.notifyDataSetChanged();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tsynchronized (OnlineObjectsContainer.this.onlineObjects) {\n\t\t\t\t\tfinal Iterator<OnlineObject> iterator = OnlineObjectsContainer.this.onlineObjects.iterator();\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tfinal OnlineObject anObject = iterator.next();\n\t\t\t\t\t\tif (anObject.getSeenAt().getTime() + OnlineObjectsContainer.EXPIRATION_TIME < System.currentTimeMillis()) {\n\t\t\t\t\t\t\tOnlineObjectsContainer.this.recentlyRemovedObjects.add(anObject);\n\t\t\t\t\t\t\tOnlineObjectsContainer.this.recentlyAddedObjects.remove(anObject);\n\t\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"private HashMap<String, Marker> loadNMarkers(){\n HashMap<String, Marker> map = new HashMap<String, Marker>();\n if (googleMap != null) {\n googleMap.clear();\n }\n float alpha = (float) 0.5;\n if (main.state.getBookingState() != State.RESERVE_BIKE_SELECTION_STATE && main.state.getBookingState() != State.RESERVE_DOCK_SELECTION_STATE){\n alpha = 1;\n }\n for (Station station : stationList) {\n float fillLevel = station.getFillLevel(); // change the marker colors depending on the station fill levels\n float colour = fillLevel * 120;\n Marker marker = googleMap.addMarker(new MarkerOptions().position(station.getLocation()).title(station.getName()).snippet(Integer.toString(station.getOccupancy())).icon(BitmapDescriptorFactory.defaultMarker(colour)).alpha(alpha));\n marker.setTag(station.getId()); // set tag to reference markers later\n map.put(station.getId(), marker);\n }\n return map;\n }",
"protected void applyPendingDeletes ()\n {\n while (!m_aDeleteStack.isEmpty ())\n removeMonitoredFile (m_aDeleteStack.pop ());\n }",
"private void undoLastPoint() {\n \t\tif ( this.markers.isEmpty() ) {\n \t\t\treturn;\n \t\t}\n \n \t\tthis.markers.remove( this.markers.size() - 1 ).remove();\n \t\tthis.commitPolygon();\n \n \t\tif ( this.markers.size() > 1 ) {\n \t\t\tthis.moveCameraToPolygon( true );\n \t\t}\n \n \t\tthis.disableIfDissatisfied();\n \t}",
"@Override\n public void onMapReady(GoogleMap googleMap) {\n mMap = googleMap;\n\n // Add a marker in Sydney and move the camera\n Drawable firstDrawable = getResources().getDrawable(R.drawable.chile_flag);\n BitmapDescriptor firstBitmap = getMarkerIconFromDrawable(firstDrawable);\n LatLng chile = new LatLng(31.761, -71.318);\n mMap.addMarker(new MarkerOptions().position(chile).title(\"Marker in Chile\")).setIcon(firstBitmap);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(chile));\n\n Drawable secondDrawable = getResources().getDrawable(R.drawable.sydney_icon);\n BitmapDescriptor secondBitmap = getMarkerIconFromDrawable(secondDrawable);\n LatLng sydney = new LatLng(-34, 151);\n mMap.addMarker(new MarkerOptions().position(sydney).title(\"Marker in Sydney\")).setIcon(secondBitmap);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));\n\n Drawable thirdDrawable = getResources().getDrawable(R.drawable.home_icon);\n BitmapDescriptor thirdBitmap = getMarkerIconFromDrawable(thirdDrawable);\n LatLng home = new LatLng(40.685, -73.714);\n mMap.addMarker(new MarkerOptions().position(home).title(\"Marker at Home\")).setIcon(thirdBitmap);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(home));\n\n Drawable fourthDrawable = getResources().getDrawable(R.drawable.rollercoaster_icon);\n BitmapDescriptor fourthBitmap = getMarkerIconFromDrawable(fourthDrawable);\n LatLng sixflags = new LatLng(40.137, -74.440);\n mMap.addMarker(new MarkerOptions().position(sixflags).title(\"Marker at SixFlags\")).setIcon(fourthBitmap);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(sixflags));\n\n Drawable fifthDrawable = getResources().getDrawable(R.drawable.malawi_icon);\n BitmapDescriptor fifthBitmap = getMarkerIconFromDrawable(fifthDrawable);\n LatLng malawi = new LatLng(-13.268, 33.930);\n mMap.addMarker(new MarkerOptions().position(malawi).title(\"Marker in Malawi\")).setIcon(fifthBitmap);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(malawi));\n\n Drawable sixthDrawable = getResources().getDrawable(R.drawable.nicaragua_icon);\n BitmapDescriptor sixthBitmap = getMarkerIconFromDrawable(sixthDrawable);\n LatLng nicaragua = new LatLng(12.146, -86.273);\n mMap.addMarker(new MarkerOptions().position(nicaragua).title(\"Marker in Nicaragua\")).setIcon(sixthBitmap);\n mMap.moveCamera(CameraUpdateFactory.newLatLng(nicaragua));\n\n\n\n UiSettings uiSettings = mMap.getUiSettings();\n uiSettings.setZoomControlsEnabled(true);\n uiSettings.setMyLocationButtonEnabled(true);\n\n Geocoder coder = new Geocoder(getApplicationContext());\n List<Address> address;\n LatLng p1 = null;\n\n try {\n // May throw an IOException\n address = coder.getFromLocationName(\"3650 E. Olympic Blvd, Los Angeles, CA 90023\", 5);\n if (address != null) {\n Address location = address.get(0);\n p1 = new LatLng(location.getLatitude(), location.getLongitude());\n mMap.addMarker(new MarkerOptions().position(p1).title(\"Marker at JungleBoys\"));\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED ||\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n ActivityCompat.requestPermissions(this, new String[] {Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}, 1020);\n } else{\n mMap.setMyLocationEnabled(true);\n mFusedLocationClient.getLastLocation()\n .addOnSuccessListener(this, new OnSuccessListener<Location>() {\n @Override\n public void onSuccess(Location location) {\n // Got last known location. In some rare situations this can be null.\n if (location != null) {\n // Logic to handle location object\n double lat = location.getLatitude();\n double lng = location.getLongitude();\n mMap.addMarker(new MarkerOptions().position(new LatLng(lat, lng)).title(\"Marker at current Location\"));\n // mMap.addMarker(new MarkerOptions().position(new LatLng(lat, lng)).title(\"Marker in NYC\").icon(BitmapDescriptorFactory.fromResource(R.mipmap.ic_launcher_round)));\n }\n }\n });\n }\n }",
"@Override\n public void onLocationChanged(Location location) {\n for (Map.Entry<Marker, Integer> e : gameMarkers.entrySet()) {\n double distance = distFrom(\n location.getLatitude(),\n location.getLongitude(),\n e.getKey().getPosition().latitude,\n e.getKey().getPosition().longitude);\n\n if (distance < 25) {\n button.setVisibility(View.VISIBLE);\n standingOnGameId = e.getValue();\n break;\n } else {\n button.setVisibility(View.INVISIBLE);\n }\n }\n }",
"protected void cleanup() {\n synchronized (tokenToDeleteQueue) {\n long now = getCurrentTimeMillis();\n Pair<Long, String> item = tokenToDeleteQueue.peek();\n if (item == null || item.getLeft() > now) {\n return;\n }\n do {\n item = tokenToDeleteQueue.poll();\n if (item == null) {\n return;\n }\n if (item.getLeft() > now) { // put it back since first one isn't timed out yet, stop.\n tokenToDeleteQueue.add(item);\n return;\n }\n store.remove(item.getRight());\n } while (!tokenToDeleteQueue.isEmpty());\n }\n }",
"private void finishErasing() {\n synchronized (lastEraseTrace) {\n if (lastEraseTrace.size() > 0) {\n ArrayList<Shape> t = new ArrayList<Shape>();\n t.add(new EraseTrace(lastEraseTrace, sheet.toSheet(eraserRadius)));\n sheet.doAction(new AddShapes(t));\n lastEraseTrace.clear();\n }\n }\n }",
"@Override\n public void onRemoval() {\n try {\n if (eOutputHatches != null) {\n for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eOutputHatches) {\n hatch_elemental.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_ElementalContainer hatch_elemental : eInputHatches) {\n hatch_elemental.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_OutputData hatch_data : eOutputData) {\n hatch_data.id = -1;\n hatch_data.q = null;\n }\n for (GT_MetaTileEntity_Hatch_InputData hatch_data : eInputData) {\n hatch_data.id = -1;\n }\n for (GT_MetaTileEntity_Hatch_Uncertainty hatch : eUncertainHatches) {\n hatch.getBaseMetaTileEntity().setActive(false);\n }\n for (GT_MetaTileEntity_Hatch_Param hatch : eParamHatches) {\n hatch.getBaseMetaTileEntity().setActive(false);\n }\n }\n cleanOutputEM_EM();\n if (ePowerPass && getEUVar() > V[3] || eDismantleBoom && mMaxProgresstime > 0 && areChunksAroundLoaded_EM()) {\n explodeMultiblock();\n }\n } catch (Exception e) {\n if (DEBUG_MODE) {\n e.printStackTrace();\n }\n }\n }",
"@Override\n\tpublic void redo() {\n\t\tfor (TAPNQuery q : queriesInclusion) {\n\t\t\tq.inclusionPlaces().removePlace(timedPlace);\n\t\t}\n\n\t\ttapn.remove(timedPlace);\n\t\tguiModel.removePetriNetObject(timedPlaceComponent);\n\t}",
"@Override\n public void run() {\n elapsed = SystemClock.uptimeMillis() - start;\n t = elapsed / durationInMs;\n v = interpolator.getInterpolation(t);\n\n LatLng currentPosition = new LatLng(\n startPosition.latitude * (1 - t) + (finalPosition.getLatitude()) * t,\n startPosition.longitude * (1 - t) + (finalPosition.getLongitude()) * t);\n myMarker.setPosition(currentPosition);\n // myMarker.setRotation(finalPosition.getBearing());\n\n\n // Repeat till progress is completeelse\n if (t < 1) {\n // Post again 16ms later.\n handler.postDelayed(this, 16);\n // handler.postDelayed(this, 100);\n } else {\n if (hideMarker) {\n myMarker.setVisible(false);\n } else {\n myMarker.setVisible(true);\n }\n }\n }",
"public void removeSelectedMarker() {\n this.markers.remove(this.selectedMarker);\n this.selectedMarker.remove();\n }",
"private void pollAllWatchersOfThisTile() {\n/* 1287 */ for (VirtualZone vz : getWatchers()) {\n/* */ \n/* */ \n/* */ try {\n/* 1291 */ if (vz.getWatcher() instanceof Player)\n/* */ {\n/* 1293 */ if (!vz.getWatcher().hasLink())\n/* */ {\n/* */ \n/* */ \n/* 1297 */ removeWatcher(vz);\n/* */ }\n/* */ }\n/* */ }\n/* 1301 */ catch (Exception e) {\n/* */ \n/* 1303 */ logger.log(Level.WARNING, e.getMessage(), e);\n/* */ } \n/* */ } \n/* */ }",
"public void mapProgressOff (){\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (tabTourMapBinding.mapProgress.getVisibility() != View.GONE) {\n tabTourMapBinding.mapProgress.setVisibility(View.GONE);\n }\n if (tabTourMapBinding.mapLayout.getVisibility() != View.VISIBLE) {\n tabTourMapBinding.mapLayout.setVisibility(View.VISIBLE);\n }\n }\n });\n }",
"@Override\r\n public void stopAll() {\r\n Log.d(TAG, \"Number of services: \"+ taskRequesterMap.size());\r\n Iterator<Map.Entry<String, TaskRequester>> iterator = taskRequesterMap.entrySet().iterator();\r\n while (iterator.hasNext()) {\r\n Map.Entry<String, TaskRequester> item = iterator.next();\r\n\r\n String name = item.getValue().getName();\r\n String className = item.getValue().getServiceClass().getName();\r\n\r\n// remove(className);\r\n item.getValue().unBind();\r\n Log.d(TAG, \"- \"+name+\" \"+className);\r\n// taskRequesterMap.remove(className);\r\n iterator.remove();\r\n serviceClasses.remove(new TaskModel(name, className, 1));\r\n// taskRequesterMap.remove(new TaskModel(name, className, 1));\r\n }\r\n }",
"@Override\n public void removeCheckInDates() {\n\n List<String> theDatesToRemove = new ArrayList<>(checkInTimeList.getSelectedValuesList());\n DefaultListModel theModel = (DefaultListModel)checkInTimeList.getModel();\n \n //Remote the dates\n for( String aStr : theDatesToRemove )\n theModel.removeElement(aStr); \n \n }",
"protected void timerTask() {\n // Oldest time to allow\n final long oldestTime = System.currentTimeMillis() - 3480000;\n \n synchronized (openFiles) {\n final Collection<String> old = new ArrayList<>(openFiles.size());\n for (Map.Entry<String, OpenFile> entry : openFiles.entrySet()) {\n if (entry.getValue().lastUsedTime < oldestTime) {\n StreamUtils.close(entry.getValue().writer);\n old.add(entry.getKey());\n }\n }\n \n openFiles.keySet().removeAll(old);\n }\n }"
] | [
"0.63446754",
"0.6296377",
"0.626411",
"0.61929095",
"0.6038861",
"0.60179234",
"0.5962304",
"0.5923107",
"0.59162277",
"0.59162277",
"0.59103036",
"0.5888016",
"0.5887059",
"0.5832132",
"0.5748487",
"0.5740986",
"0.5683234",
"0.5683234",
"0.5677944",
"0.56758577",
"0.5666898",
"0.5644929",
"0.5632529",
"0.56083333",
"0.5595943",
"0.5572765",
"0.5525795",
"0.5525795",
"0.5502789",
"0.5498469",
"0.54783374",
"0.5470356",
"0.5464977",
"0.54455274",
"0.54400843",
"0.5438287",
"0.54359746",
"0.54149884",
"0.54127955",
"0.54053617",
"0.5399023",
"0.5378726",
"0.5377894",
"0.53723794",
"0.5360059",
"0.5343966",
"0.53411263",
"0.5338075",
"0.5328163",
"0.53194666",
"0.53168195",
"0.53165865",
"0.5309418",
"0.5308274",
"0.5289926",
"0.5272144",
"0.52665734",
"0.52585846",
"0.5241847",
"0.52211064",
"0.5212806",
"0.52103174",
"0.5198785",
"0.5197517",
"0.51577246",
"0.51566297",
"0.51468486",
"0.5145148",
"0.51396316",
"0.5135332",
"0.5133184",
"0.51303667",
"0.5124721",
"0.5123732",
"0.51203346",
"0.51169217",
"0.51150066",
"0.51107514",
"0.51067716",
"0.50933075",
"0.5087334",
"0.508281",
"0.50806516",
"0.5076607",
"0.50705296",
"0.50624484",
"0.5060261",
"0.5059195",
"0.5051419",
"0.50486577",
"0.50483966",
"0.50409406",
"0.5030703",
"0.5028997",
"0.50288683",
"0.5023325",
"0.5016319",
"0.50080466",
"0.5006047",
"0.50056905",
"0.5003413"
] | 0.0 | -1 |
/ Checks to see if a guessed password is correct. Prints out a correct password with its given user name. Returns TRUE if a guess is correct, FALSE otherwise. | public static boolean guessPW(String pw){
for(int j = 0; j < userList.size(); j++){
User user = userList.get(j);
if(!user.cracked){
String jc = jcrypt.crypt(user.salt, pw);
if(user.ePassword.equals(jc)){
System.out.println("Password for user " + user.name + " is: " + pw);
user.setCracked(true);
user.setPW(pw);
return true;
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean isPassword(String guess) {\n\t return password.equals(guess);\n }",
"public static boolean password() \n\t{\n\t\tScanner keyboard = new Scanner(System.in);\n\n\t\tboolean isCorrect = false;\n\t\tint tryCounter = 3;\n\t\tSystem.out.print(\"Please enter your password to continue: \");\n\t\tString myPassword = keyboard.nextLine().toLowerCase();\n\t\tfor (int tries = 1; tries <= 3; ++tries)\n\t\t{\n\t\t\tif (myPassword.equals(\"deluxepizza\"))\n\t\t\t{\n\t\t\t\tisCorrect = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if(tries == 3)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"It seems you're having trouble typing your password... returning to main menu.\");\n\t\t\t\treturn isCorrect;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t--tryCounter;\n\t\t\t\tSystem.out.println(\"Oops, did your finger slip? Please try again. You have \" + tryCounter + \" tries remaining!\");\n\t\t\t\tmyPassword = keyboard.next().toLowerCase();\n\t\t\t}\t\n\t\t}\n\t\treturn isCorrect;\n\t}",
"public static void main(String[] args) {\n\t// 1. Ask for an initial password, and store it in a variable\n String answer1 = JOptionPane.showInputDialog(null, \"What is the secret message?\"); \n\t// 2. Ask for a message and store it in a variable\n String answer2 = JOptionPane.showInputDialog(null, \"What is your password?\");\n\t// 3. Ask your friend for the password and store it in a variable\n String answer3 = JOptionPane.showInputDialog(\"Do you know the password?\");\n\t// 4. If the password matches,\n if (answer1.equals(answer3))\n {\n\tJOptionPane.showMessageDialog(null, \"\" + answer2);\t\n\t}\n else\n {\n \tJOptionPane.showMessageDialog(null, \"Your wrong.\");\n }\n\t\t// show the secret message\n\t// *5. OPTIONAL: let your friend keep guessing even if they are wrong\n\n}",
"public abstract boolean isGuessCorrect(String guess);",
"boolean isMatchPassword(Password toCheck) throws NoUserSelectedException;",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"boolean hasPassword();",
"public boolean checkpassword(String uname,String uhash)\r\n\t{\r\n\t\tboolean attempt=false;\r\n\t\tint index=user_index(uname);\r\n\t\tif(((User)user_records.get(index)).get_hash_password().equals(uhash))\r\n\t\t{\r\n\t\t\tattempt=true;\r\n\t\t}\r\n\t\treturn attempt;\r\n\t}",
"public boolean isPasswordCorrect() {\n return (CustomerModel.passwordTest(new String(newPasswordTextField.getPassword())));\n }",
"public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}",
"private boolean checkPassword(){\n Pattern p = Pattern.compile(\"^[A-z0-9]*$\");\n Matcher m = p.matcher(newPass.getText());\n boolean b = m.matches();\n if(newPass.getText().compareTo(repeatPass.getText()) != 0 || newPass.getText().isEmpty() || repeatPass.getText().isEmpty()){\n repeatPass.setBackground(Color.red);\n JOptionPane.showMessageDialog(null, \"Password Error\");\n return false;\n }\n else if(newPass.getText().length() > 10 || b == false){\n newPass.setBackground(Color.red);\n JOptionPane.showMessageDialog(null, \"Password Error\");\n return false;\n }\n newPass.setBackground(Color.green);\n repeatPass.setBackground(Color.green);\n return true;\n }",
"private static Boolean checkingPassword(String passwordHash, String Salt, String tryingPassword) throws NoSuchAlgorithmException, InvalidKeySpecException {\n //stores the old salt an hash\n byte[] salt = fromHex(Salt);\n byte[] hash = fromHex(passwordHash);\n //makes a new has for the trying password with the old salt\n PBEKeySpec spec = new PBEKeySpec(tryingPassword.toCharArray(), salt, 1000, hash.length * 8);\n SecretKeyFactory skf = SecretKeyFactory.getInstance(\"PBKDF2WithHmacSHA1\");\n byte[] testHash = skf.generateSecret(spec).getEncoded();\n //checking for differences\n int differece = hash.length ^ testHash.length;\n for(int i = 0; i < hash.length && i < testHash.length; i++)\n {\n differece |= hash[i] ^ testHash[i];\n }\n //returns if they are different\n return differece == 0;\n }",
"private static boolean isPasswordCorrect(char[] input, char[] correctPassword) {\n\t boolean isCorrect = true;\n\t \n\t if (input.length != correctPassword.length) {\n\t isCorrect = false;\n\t } else {\n\t isCorrect = Arrays.equals (input, correctPassword);\n\t }\n\n\t // Zero out the password.\n\t Arrays.fill(correctPassword,'0');\n\n\t return isCorrect;\n\t}",
"private int userLoing() {\n\t\t\n\t\tScanner scan2 = new Scanner(System.in);\n\t\tSystem.out.println(\"\\nPour vous rappler, pour quitter il faut entrer q ou quit pour quitter \\navant de commencer de saisir de mot de passe.\\n\"+\n\t\t\t\t\n\t\t\t\t\"--------------------------------------------------------------------------------------\");\n\t\tboolean correct = true; //To check the confirmation of the password\n\t\t\n\t\t\n\t\t//to get the user's name\n\t\tString nom;\n\t\tdo {\n\t\t System.out.print(\"Entrez un nom d'une longueur qui > 4: \");\n\t\t nom = scan2.nextLine();\n\t\t} while ((nom.length() < 4) && !(nom.equalsIgnoreCase(\"q\")) && !(nom.equalsIgnoreCase(\"quit\")));\n\t\t\n\t\tif(nom.equalsIgnoreCase(\"q\") || nom.equalsIgnoreCase(\"quit\")) {\n\t\t\tSystem.out.println(\"\\n-----------------------------------------------------\\nVous avez été dérigé vers le meun principal!\\n-----------------------------------------------------\");\n\t\t\tcorrect = true;\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t\n\t\t\t//for the password and the confirmation\n\t\t\t\n\t\t\twhile(correct) {\n\t\t\t\tint mdp;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Entrez un mot de passe qui contient au moins 6 chiffres SVP: \");\n\t\t\t\t scan2.next();\n\t\t\t\t }\n\t\t\t\t mdp = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp).length() < 6);\n\t\t\t\t\n\t\t\t\tint mdp2;\n\t\t\t\tdo {\n\t\t\t\t System.out.print(\"Confirmez vôtre mot de passe SVP : \");\n\t\t\t\t while (!scan2.hasNextInt()) {\n\t\t\t\t\t System.err.print(\"Confirmez vôtre mot de passe : \");\n\t\t\t\t scan2.next(); \n\t\t\t\t }\n\t\t\t\t mdp2 = scan2.nextInt();\n\t\t\t\t} while (Integer.toString(mdp2).length() < 6);\n\t\t\t\t\n\t\t\t\tcorrect = mdp == mdp2 ? false: true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tint res = !correct? 1 : 0;\n\t\treturn res;\n\t\t\n\t}",
"boolean hasPassword2();",
"public static Boolean judgeuser(User user) throws SQLException {\n\t\tConnection conn = DBHelper.getConn();\n\t\tString id = user.getid();\n\t\tString passwd = user.getpasswd();\n\t\tStatement sta;\n\t\tsta = conn.createStatement();\n\t\tResultSet rs = sta.executeQuery(\"select count(*) as count from user_master where id = '\" + id + \"'\");\n\t\trs.next();\n\t\tint count = rs.getInt(\"count\");\n\t\tif (count <= 0) {\n\t\t\treturn false;\n\t\t}\n\t\trs = sta.executeQuery(\"select passwd from user_master where id = '\" + id + \"'\");\n\t\trs.next();\n\t\tString str = rs.getString(\"passwd\");\n\t\tif (!passwd.equals(str)) {\n\t\t\treturn false;\n\t\t}\n\t\tconn.close();\n\t\treturn true;\n\t}",
"Boolean isValidUserPassword(String username, String password);",
"public void testCorrectPassword() {\n Password p = new Password(\"jesus\".toCharArray());\n assertTrue(p.checkPassword(\"jesus\".toCharArray()));\n }",
"public boolean isBothPasswordCorrect() { \n String pass1 = new String(newPasswordTextField.getPassword());\n String pass2 = new String(repeatPasswordTextField.getPassword()); \n \n return (pass1.equals(pass2) && isPasswordCorrect());\n }",
"public static User.UserType isPasswordCorrect(User user) {\n ConnectionPool pool = ConnectionPool.getInstance();\n Connection connection = pool.getConnection();\n PreparedStatement ps = null;\n ResultSet rs = null;\n \n String query = \"SELECT * FROM auttc_users.users \"\n + \"WHERE username = ?\";\n \n try {\n ps = connection.prepareStatement(query);\n ps.setString(1, user.getUsername());\n rs = ps.executeQuery();\n \n String dbPassword;\n while (rs.next()) {\n dbPassword = rs.getString(\"password\");\n if (dbPassword.equals(user.getPassword())) {\n System.out.println(rs.getInt(\"admin\"));\n if (0 == rs.getInt(\"admin\")) \n {\n return User.UserType.USER;\n } else {\n \n return User.UserType.ADMIN;\n }\n }\n }\n return User.UserType.NONE;\n \n } catch (SQLException e) {\n System.out.println(e);\n return User.UserType.NONE;\n } finally {\n DBUtil.closeResultSet(rs);\n DBUtil.closePreparedStatement(ps);\n pool.freeConnection(connection);\n }\n }",
"public void wrongGuess()\r\n\t{\r\n\t\tSystem.out.println(\"Sorry, your guess is wrong\");\r\n\t\tif(userRanPan.getValue() == -1)\r\n\t\t\tnewGame.getUserHand().addDash(true,userRanPan);\r\n\t\telse\r\n\t\t\tnewGame.getUserHand().addPanel(userRanPan,true);\r\n\r\n\t\tif(userWon() == false)\r\n\t\t\tcompTurn(false);\r\n\t\telse if(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t}",
"public static boolean checkUserPass(String username, String password){\n getCurrentUsers();\n if(userPasses.containsKey(username)){\n System.out.println(\"bo\");\n if (userPasses.get(username).equals(password)){\n return true;\n }\n }\n System.out.println(username +\"|\"+password);\n return false;\n }",
"public static Boolean checkPassowd(String password){\n\t\t//String password = txtPassword.getText();\n\t\t//System.out.println(password);\n\t\treturn password.equals(\"password\");\n\t}",
"public static boolean checkPassword(String username, String hashedPassword) throws IOException, SQLException, NoSuchAlgorithmException {\n ArrayList<String> user = retrieveUser(username);\n System.out.println(\"This was received: \" + user.toString());\n System.out.println(\"Hashed password from CP: \" + hashedPassword);\n String saltString = user.get(2); // Retrieve salt from database\n String cpSaltedHashedPassword = hash(hashedPassword + saltString);\n String dbSaltedHashedPassword = user.get(1); // Get complete password from database\n System.out.println(\"Salted, hashed password from CP: \" + cpSaltedHashedPassword);\n System.out.println(\"Salted, hashed password from DB: \" + dbSaltedHashedPassword);\n if (dbSaltedHashedPassword.equals(cpSaltedHashedPassword)) { // If password matches the password in the database\n System.out.println(\"Password matches\");\n return true;\n } else { // Password does not match\n System.out.println(\"Password mismatch\");\n return false;\n }\n }",
"private String lookupPassword(String user) {\n\treturn \"happy8\";\r\n\t}",
"public static boolean passwordCorrect(DSUsers dsUsers, DSUser user) {\n\t\tDSUser existedUser = existedUser(dsUsers, user);\n\t\treturn existedUser.getPassword().equals(user.getPassword());\n\t}",
"public boolean verifyPassword() {\n\t\tString hash = securePassword(password);\r\n\t\t\r\n\t\tif(!isPasswordSet()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tString currentPass = getPassword();\r\n\t\tif(hash.equals(currentPass)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public boolean checkPassword(String plainTextPassword, String hashedPassword);",
"public static void main(String[] args) {\n\r\n\t\tString pass = (\"asdasd\");\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tint attempts = 3;\r\n\t\tBoolean passInput = true;\r\n\t\t\r\n\t\tSystem.out.println(\"Enter your password: \");\r\n\t\t\r\n\t\twhile (passInput && attempts-- > 0) {\r\n\t\t\tString passAttempt = input.nextLine();\r\n\t\t\t\r\n\t\t\tif (passAttempt.equals(pass)) {\r\n\t\t\t\tSystem.out.println(\"You're logged in!\");\r\n\t\t\t}\r\n\t\t\telse if (!passAttempt.equals(pass)) {\r\n\t\t\t\tSystem.out.println(\"Wrong password! Attempts remaining: \" + attempts);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tinput.close();\r\n\t}",
"public boolean promptPassword(String message) \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}",
"public void guessName()\n\t{\n\t\tSystem.out.println(\"Who do you think it is?\");\n\t\tguessName = scan.nextLine();\n\t\tif(guessName.equals(name))\n\t\t{\n\t\t\tSystem.out.println(\"Congratulations, you are correct!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"You are incorrect\");\n\t\t\tSystem.out.println(\"The correct answer was \" + name);\n\t\t}\n\t}",
"public void showPasswordPrompt();",
"public boolean checkPassword(String word) {\n\t\tif (word.equals(password)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public boolean passwordCheck(String password) {\n\t\treturn true;\n\t\t\n\t}",
"boolean getPasswordValid();",
"@Test\n public void testPasswordExists() {\n String userInput = \"Mounta1nM@n\";\n Owner testUser = ownerHelper.validateUser(\"harry.louis\", userInput);\n assertEquals(testUser.getPassword(), owner1.getPassword());\n assertEquals(testUser.getFirstName(), owner1.getFirstName());\n assertEquals(testUser.getLastName(), owner1.getLastName());\n\n }",
"public boolean verifyPassword(String pw){\n return BCrypt.checkpw(pw, userPass);\n }",
"public static boolean checkPassword()\n {\n String pw = SmartDashboard.getString(\"Password\");\n SmartDashboard.putString(\"Password\", \"\"); //Clear the password field so that it must be reentered\n\n if(pw.equals(ADMIN_PASSWORD))\n return true;\n else\n {\n log(\"Password invalid\"); //The user gave an incorrect password, inform them.\n return false;\n }\n }",
"@Test\r\n\tpublic void testIsValidPasswordSuccessful()\r\n\t{\r\n\t\tassertTrue(PasswordCheckerUtility.isValidPassword(\"#SuperMan1\"));\r\n\t}",
"public void printWrongGuess() {\r\n\t\t\r\n\t\tSystem.out.print(\"Wrong Guesses: \" + wrongGuess + \"\\n\");\r\n\t}",
"@When(\"^user should enter the valid password in the loginpage$\")\n\tpublic void user_should_enter_the_valid_password_in_the_loginpage() throws Throwable {\n\t\tinputValuestoElement(pa.getAp().getPasswordinput(), \"superman@1010\");\n\t\n\t \n\t}",
"public void testIncorrectPassword() {\n Password p = new Password(\"jesus\".toCharArray());\n assertFalse(p.checkPassword(\"buddha\".toCharArray()));\n }",
"public boolean checkPass(String password){\r\n if (password.equals(this.password)){\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }",
"private boolean isTheSamePassword(){\n\t\tif (!userPasswordField.getText().equals(userConfirmPasswordField.getText())) {\n\t\t\tlackUserConfirmPasswordLabel.setText(\"hasło i powtórzone hasło muszą być takie same\");\n\t\t\tlackUserConfirmPasswordLabel.setVisible(true);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private boolean correctUser() {\n // TODO mirar si l'usuari es unic a la base de dades\n return true;\n }",
"private boolean checkPass(String enterPass) {\n JdbcConnection connection = JdbcConnection.getInstance();\n DaoFactory daoFactory = new RealDaoFactory(connection);\n List<User> users = daoFactory.createUserDao().findAll();\n for (User user : users) {\n if (user.getPasswordHash() == enterPass.hashCode()) {\n return true;\n }\n }\n return false;\n }",
"private boolean checkPassword() {\n String password = getPassword.getText();\n \n if(password.compareTo(\"\") == 0) {\n errorMessage.setText(\"Please enter a password.\");\n return false;\n }\n else if(password.compareTo(getConfirmPassword.getText()) == 0) {\n //Password must be min of 8 characters max of 16\n if((8 > password.length()) || (\n password.length() > 16)) {\n errorMessage.setText(\"Password must be 8-16 characters long.\");\n return false;\n }\n \n boolean upperFlag = false;\n boolean lowerFlag = false;\n boolean numFlag = false;\n boolean charFlag = false;\n \n for(int i = 0; i < password.length(); ++i) {\n String sp = \"/*!@#$%^&*()\\\\\\\"{}_[]|\\\\\\\\?/<>,.\";\n char ch = password.charAt(i);\n \n if(Character.isUpperCase(ch)) { upperFlag = true; }\n if(Character.isLowerCase(ch)) { lowerFlag = true; }\n if(Character.isDigit(ch)) { numFlag = true; }\n if(sp.contains(password.substring(i, i))) { charFlag = true; }\n } \n //Password must contain 1 uppercase letter\n if(!upperFlag) {\n errorMessage.setText(\"Password must contain at least one uppercase letter.\");\n return false;\n }\n //Password must contain 1 lowercase letter\n if(!lowerFlag) {\n errorMessage.setText(\"Password must contain at least one lowercase letter.\");\n return false;\n }\n //Password must contain 1 number\n if(!numFlag) {\n errorMessage.setText(\"Password must contain at least one digit.\");\n return false;\n }\n //Password must contain 1 special character\n if(!charFlag) {\n errorMessage.setText(\"Password must contain at least one special character.\");\n return false;\n }\n return true;\n }\n else {\n errorMessage.setText(\"The entered passwords do not match.\");\n return false; \n }\n }",
"private boolean doCheckNewPassword() {\n\t\tif (!newPassword.equals(confirmPassword)) return false;\n\t\trecord(\"new password checked\");\n\t\treturn true;\n\t}",
"public static boolean isCorrectGuess(char[] word, char[] blanks, char guess) {\n\t\tboolean correct = false;\n\t\tint message = 2;\n\t\tfor (int i = 0; i < word.length; i++) {\n\t\t\tif (word[i] == guess) {\n\t\t\t\tcorrect = true;\n\t\t\t\tif (blanks[i] == guess){\n\t\t\t\t\tmessage = 1;\n\t\t\t\t}\n\t\t\t\telse { \n\t\t\t\t\tblanks[i] = guess; // the actual letter is then displayed.\n\t\t\t\t\tmessage = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (message > 0){\n\t\t\tprint(message, guess); // Call print message for incorrect\n\t\t}\n\t\treturn correct;\n\t}",
"private Boolean changePassword() {\r\n //capture return value from SQL query to check if pass was updated\r\n int updatedRow = 0;\r\n \r\n try {\r\n // load and register JDBC driver for MySQL - \r\n // This tells the Java Class where to find the driver to connect to \r\n // The MySQL Database\r\n Class.forName(\"com.mysql.jdbc.Driver\"); \r\n Connection conn = DriverManager.getConnection(CONN_STRING,USERNAME,PASSWORD);\r\n \r\n //set password to newly generated string and reset failed attempts on account\r\n String updatePassword = \"UPDATE \" + TABLE_NAME + \" SET password = '\" + \r\n newPassword + \"', failed_attempts = 0 WHERE id = \" + user_id;\r\n System.out.println(updatePassword);\r\n PreparedStatement setNewPassword = conn.prepareStatement(updatePassword);\r\n updatedRow = setNewPassword.executeUpdate();\r\n } catch (Exception e) {\r\n System.out.println(e);\r\n }\r\n return (updatedRow > 0);\r\n }",
"public static void checkPassword(String password) {\n\t\t\t\t\t\t\t\t\r\n\t\tif(password.equals(userPassword)) {\r\n\t\t\tSystem.out.println(\"Login Successful\");\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Login Failed\");\r\n\t\t}\r\n\t}",
"public boolean verifyUser(String username, String password) throws SQLException {\n\n // update sql\n String pwGot = getPassword(username);\n\n if (pwGot.equals(password)) {\n return true;\n }\n\n return false;\n }",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n System.out.print(\"Enter a string for password: \");\n String s = input.nextLine();\n\n if (passwordDigitCheck(s) && paswordLengt(s) && passwordCharOrDig(s)){\n System.out.println(\"This password is valid\");\n }else System.out.println(\"This is an invalid password\");\n }",
"boolean checkPasswordMatch(PGPSecretKey secretKey, String password);",
"private boolean hasRight(String introducedUsername, String introducedPaswword) {\n\n boolean hasRight = false;\n System.out.println(\"Hello from hasRight\");\n if(introducedUsername.equals(username) && introducedPaswword.equals(password)) {\n hasRight = true;\n }\n return hasRight;\n }",
"public boolean doChangePasswd() {\n\t\twhile (true) {\n\t\t\tif (!doGetNewPassword()) return false;\n\t\t\tif (!doGetConfirmPassword()) return false;\n\t\t\tif (doCheckNewPassword()) break;\n\t\t}\n\t\tif (!doGetApproval()) return false;\n\t\tdoPrintAdvice();\n\t\treturn true;\n\t}",
"@Test(priority=1)\n\tpublic void verifyPasswordsMatch() {\n\t\tsignup.clearAllFields();\n\t\tsignup.enterId(\"jane@doe.com\");\n\t\tsignup.enterPassword(\"abcd\");\n\t\tsignup.reenterPassword(\"1235\");\n\t\tsignup.clickSubmit();\n\t\tList<String> errors = signup.getErrors();\n\t\tAssert.assertTrue(TestHelper.isStringPresent(errors, \"Passwords do not match; please enter a password and reenter to confirm.\\nPasswords must contain at least 6 characters and no spaces.\"));\n\t}",
"public String CheckPassword(String Password)\n\t{\n\t\tif(Pattern.matches(\"(?=.*[$#@!%^&*])(?=.*[0-9])(?=.*[A-Z]).{8,20}$\",Password))\n\t\treturn \"HAPPY\";\n\t\telse \n\t\treturn \"SAD\";\n\t}",
"public boolean checkPassword(String password)\n {\n boolean correct = false;\n if (password.equals(this.password))\n {\n correct = true;\n }\n return correct;\n }",
"public boolean guessIsRight(String secretWord, char guess){\n\t\tboolean isCorrect = false;\n\t\tfor (int i=0; i<secretWord.length(); i++){\n\t\t\tchar secretLetter = secretWord.charAt(i);\n\t\t\tif (secretLetter == guess){\n\t\t\t\t isCorrect = true;\n\t\t\t}\n\t\t}\n\t\treturn isCorrect;\n\t}",
"public boolean passwordCheck() {\n\t\tSystem.out.println(\"Password is: \"+LoggedUser.getPassword());\n\t\tMapSqlParameterSource params = new MapSqlParameterSource();\n\t\tparams.addValue(\"username\", LoggedUser.getUsername());\n\t\tparams.addValue(\"password\", LoggedUser.getPassword());\n\t\treturn jdbc.queryForObject(\"select count(*) from authors where username=:username and password=:password\", \n\t\t\t\tparams, Integer.class) > 0;\n\t}",
"public abstract boolean guess(String guess);",
"private String getPassword() {\n String Password = \"\";\n while (true) {\n System.out.println(\"Please, Enter Password : \");\n Password = scanner.nextLine();\n System.out.println(\"Please, Enter confirm Password : \");\n if (!Password.equals(scanner.nextLine())) {\n System.out.println(\"Error: Password doesn't match.\");\n } else {\n break;\n }\n }\n return Password;\n }",
"public static boolean validatePassword(char[] password, String correctHash)\r\n throws NoSuchAlgorithmException, InvalidKeySpecException , NumberFormatException{\r\n // Decode the hash into its parameters\r\n \r\n String[] params = correctHash.split(\":\");\r\n int iterations = Integer.parseInt(params[ITERATION_INDEX]);\r\n byte[] salt = fromHex(params[SALT_INDEX]);\r\n byte[] hash = fromHex(params[PBKDF2_INDEX]);\r\n // Compute the hash of the provided password, using the same salt, \r\n // iteration count, and hash length\r\n byte[] testHash = pbkdf2(password, salt, iterations, hash.length);\r\n // Compare the hashes in constant time. The password is correct if\r\n // both hashes match.\r\n return slowEquals(hash, testHash);\r\n }",
"public static boolean pwMatch(String text, SystemUser person, jcrypt checker) {\n\t\tString enc = jcrypt.crypt(person.salt, text);\n\t\tif(enc.equals(person.encField)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"private boolean validatePassword() {\n\t\tEditText pw = (EditText)view.findViewById(R.id.et_enter_new_password);\n\t\tEditText confPW = (EditText)view.findViewById(R.id.et_reenter_new_password);\n\t\t\t\n\t\tString passwd = pw.getText().toString();\n\t\tString confpw = confPW.getText().toString();\n\t\t\n\t\t// Check for nulls\n\t\tif (passwd == null || confpw == null) {\n\t\t\tToast.makeText(view.getContext(), \"Passwords are required\", Toast.LENGTH_LONG).show();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Ensure password and retypted passwords match\n\t\tif (!passwd.contentEquals(confpw)) {\n\t\t\tToast.makeText(view.getContext(), \"Passwords must match\", Toast.LENGTH_LONG).show();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Ensure password meets complexity\n\t\tif (passwd.length() < 7) { // min length of 7 chars\n\t\t\tToast.makeText(view.getContext(), \"Password must be at least 7 characters long\", \n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Not really sure what the requirements are for private key password complexity yet\n\t\tnewPassword = passwd; // Set class variable with new password\n\t\treturn true;\n\t}",
"@Override\r\n\t\tpublic boolean promptPassword(String message) {\n\t\t\treturn false;\r\n\t\t}",
"public int validUser(String name, String pass) {\n this.connect();\n String sql = \"SELECT username, password FROM users WHERE username = ? AND password = ?\";\n int val = 0;\n try (Connection conn = this.getConnection();\n PreparedStatement pstmt = conn.prepareStatement(sql)) {\n pstmt.setString(1, name);\n pstmt.setString(2, pass);\n ResultSet rs = pstmt.executeQuery();\n if (rs.next()) {\n System.out.println(\"Good To Go\");\n val = 1;\n } else {\n System.out.println(\"Not a valid username or password!\");\n val = 0;\n }\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n return val;\n }",
"@Override\n\tpublic boolean checkIsPwdSame(String username, String pwd) {\n\t\tString oldPwd = mvd.querryPwd(username);\n\t\tif(oldPwd.equals(pwd)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public boolean isAnswerCorrect(String attempt){\n\t\t\tif (answer.equals(attempt)) return true;\n\t\t\telse return false;\n\t\t}",
"public Boolean passwordCorrect(String username, String password) {\n if (userDao.correctPassword(username, password)) {\n loggedIn = userDao.findByUsername(username);\n return true;\n }\n return false;\n }",
"private boolean validatePassword() throws NoSuchAlgorithmException, NoSuchProviderException \n {\n String passwordToHash = Password.getText(); \n\t\t\n \tString securePassword = null;\n \tString testPass;\n \tBoolean success=false;\n \tbyte[] salt = null;\n\n\t \n\t \n\t \n try{ \n \t\tmycon=connect.getConnect();\n \t\t \n \t\t \n String query;\n\t query =\"select password, salt\\n\" + \n\t \t\t\"from employee\\n\" + \n\t \t\t\"where userName= ?;\";\n\t \n\t PreparedStatement pstm= mycon.prepareStatement(query);\n\t pstm.setString(1, Username.getText());\n\t ResultSet rs = pstm.executeQuery();\n\t \n\t if(rs.next()) {\n\t \tsecurePassword =rs.getString(1);\n\t \t\n\t \tBlob blob = rs.getBlob(2);\n\t \t int bloblen= (int) blob.length();\n\t \t salt = blob.getBytes(1, bloblen);\n\t \t blob.free();\n\t \t\n\t \t\n\t \n\t }\n\t \n\t \n\t testPass=SecurePass.getSecurePassword(passwordToHash, salt);\n \n \t if(securePassword.equals(testPass)) {\n \t success=true;\n \t this.ActiveUser=Username.getText();\n \t }\n \t\n \t\t\n \t\t\n \t\t\n \t\t} catch (SQLException e ) {\n \t\t\te.printStackTrace(); \t\n \t\t\t\n \t\t}\n\t\treturn success;\n \n\t \t \n \n \n\t\t\n \n }",
"boolean hasPasswd();",
"public static Boolean verifyAuthentification(UserBean user, JdbcConnectionSource jdbc) throws SQLException {\n Map<String, Object> infos = new HashMap<String, Object>();\n infos.put(\"pseudo\", user.getPseudo());\n infos.put(\"password\", user.getPassword());\n List<UserBean> listSameInfos = getDaoUser(jdbc).queryForFieldValues(infos);\n\n if (listSameInfos.isEmpty()) {\n return false;\n }\n user.setId(listSameInfos.get(0).getId());\n return true; //user+pass sont OK\n }",
"private static boolean isValid(String passWord) {\n\t\tString password = passWord;\n\t\tboolean noWhite = noWhiteSpace(password);\n\t\tboolean isOver = isOverEight(password);\n\t\tif (noWhite && isOver) {\n\t\t\tSystem.out.println(\"Password accepted!\");\n\t\t\treturn true;\n\t\t} else return false;\n\t}",
"public boolean verifiyPassword(String password) {\n SQLiteDatabase db = this.getWritableDatabase();\n String[] projection = {LOGIN_PASSWORD};\n String[] selectionArgs = {\"1\"};\n Cursor cursor = db.query(LOGIN_TABLE, projection, LOGIN_ID, selectionArgs, null, null, null);\n cursor.moveToFirst();\n String pass = cursor.getString(cursor.getColumnIndexOrThrow(LOGIN_PASSWORD));\n db.close();\n cursor.close();\n return pass.equals(password);\n }",
"private String getPasswordFromUser() {\n JPasswordField passField = new JPasswordField(10);\n int action = JOptionPane.showConfirmDialog(null, passField, \"Please enter your password:\", JOptionPane.OK_CANCEL_OPTION);\n\n if (action < 0) {\n System.exit(0);\n }\n\n __logger.info(\"Got password from user\");\n\n return new String(passField.getPassword());\n }",
"@Test\n public void testIsValidPassword() {\n System.out.println(\"isValidPassword\");\n String input = \".%6gwdye\";\n boolean expResult = false;\n boolean result = ValidVariables.isValidPassword(input);\n assertEquals(expResult, result);\n }",
"public boolean verifyPassword(int input){\n return input==password;\n }",
"public static void confirmGuess(String guess) {\n\n\t\t//for debug purposes\n\t\tSystem.out.println(\"User guess is \" + guess + \" and the correct answer is \" + globalColor);\n\n\t\t//userGuess equals globalColor\n\t\tif ((guess.toLowerCase()).equals(globalColor.toLowerCase())) {\n\t\t\t//notify the user that they have won\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is correct!!!\");\n\t\t\t\n\t\t//userGuess does not equal globalColor\n\t\t} else {\n\t\t\t//notify the user that they have lost\n\t\t\tJOptionPane.showMessageDialog(null, \"Your guess is incorrect. Try again.\");\n\t\t}\n\t}",
"public boolean alreadyGuessed(char guess) {\r\n return false;\r\n }",
"public static void main(String[]args){\r\n \r\n \r\n String clave=\"Jeanpool\";\r\n String pass=\"\";\r\n while(clave.equals(pass) == false){\r\n pass=JOptionPane.showInputDialog(\"Introduce la contraseña , porfavor\");\r\n if(clave.equals(pass)==false){\r\n System.out.println(\"Contraseña incorrecta\");\r\n }\r\n }\r\n System.out.println(\"Contraseña correcta. Acceso permitido\");\r\n \r\n \r\n }",
"public boolean isUserValid(String userName, char[] password){\n\t\tConnection dbConnection = null;\n\t\tPreparedStatement selectStatement = null;\t\n\t\tResultSet rs = null;\n\t\ttry{\n\t\t\tdbConnection = DriverManager.getConnection(dataConnection, dataUser, dataPassword);\n\t\t\tselectStatement = dbConnection.prepareStatement(\"SELECT password FROM users WHERE user_name = ?\");\n\t\t\tselectStatement.setString(1, userName);\n\t\t\trs = selectStatement.executeQuery();\t\t\t\n\t\t\tif(rs.next()){\n\t\t\t\tif(Arrays.equals(password, rs.getString(\"password\").toCharArray())){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Sorry, incorrect password.\", \n\t\t\t\t\t\t\t\"Invalid password.\",\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\t\t\treturn false;\n\t\t\t\t}//end if\n\t\t\t}\n\t\t\telse{\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Sorry, the username is not recognised.\", \n\t\t\t\t\t\t\"Invalid username.\",\n\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\t\treturn false;\n\t\t\t}//end if\n\t\t}//end try\n\t\tcatch(SQLException sqlEx){\n\t\t\tJOptionPane.showMessageDialog(null, sqlEx.toString(), \n\t\t\t\t\t\"Error in connecting to database.\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn false;\n\t\t}//end catch\n\t\tcatch(Exception eEx){\n\t\t\tJOptionPane.showMessageDialog(null, eEx.toString(),\n\t\t\t\t\t\"Error in connecting to database\",\n\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\n\t\t\treturn false;\n\t\t}//end catch\n\t\tfinally{\n\t\t\tdbConnection = null;\n\t\t\tselectStatement = null;\n\t\t\trs = null;\n\t\t}//end finally\n\t}",
"private void handlePass(String password) {\n // User has entered a valid username and password is correct\n if (currentUserStatus == userStatus.ENTEREDUSERNAME && password.equals(validPassword)) {\n currentUserStatus = userStatus.LOGGEDIN;\n sendMsgToClient(\"230-Welcome to HKUST\");\n sendMsgToClient(\"230 User logged in successfully\");\n }\n\n // User is already logged in\n else if (currentUserStatus == userStatus.LOGGEDIN) {\n sendMsgToClient(\"530 User already logged in\");\n }\n\n // Wrong password\n else {\n sendMsgToClient(\"530 Not logged in\");\n }\n }",
"private String getPasswordHave( String userName, Callback[] callbacks )\n throws LoginException\n {\n PasswordCallback passwordCallback = ( PasswordCallback ) callbacks[1];\n char[] password = passwordCallback.getPassword();\n passwordCallback.clearPassword();\n if ( password == null || password.length < 1 ) {\n throwLoginException( \"Authentication Failed: User \" + userName + \". Password not supplied\" );\n }\n String passwd = new String( password );\n\n // Print debugging information\n if ( 1 == 1 ) {\n cLogger.info( \"\\tpasswordHave\\t= \" + passwd );\n }\n\n return passwd;\n }",
"private static boolean validatePassword(String originalPassword, String storedPassword) throws NoSuchAlgorithmException, InvalidKeySpecException\n {\n String[] parts = storedPassword.split(\":\");\n int iterations = Integer.parseInt(parts[0]);\n byte[] salt = fromHex(parts[1]);\n byte[] hash = fromHex(parts[2]);\n\n PBEKeySpec spec = new PBEKeySpec(originalPassword.toCharArray(), salt, iterations, hash.length * 8);\n SecretKeyFactory skf = SecretKeyFactory.getInstance(\"PBKDF2WithHmacSHA1\");\n byte[] testHash = skf.generateSecret(spec).getEncoded();\n\n int diff = hash.length ^ testHash.length;\n for(int i = 0; i < hash.length && i < testHash.length; i++)\n {\n diff |= hash[i] ^ testHash[i];\n }\n return diff == 0;\n }",
"public boolean comparePassword(String username, String password) {\n boolean matchedPass = false;\n try {\n conn = dao.getConnection();\n ps = conn.prepareStatement(\"SELECT * FROM USERS WHERE USERNAME=? AND PASSWORD=?\");\n ps.setString(1, username);\n ps.setString(2, password);\n\n ResultSet rs = ps.executeQuery();\n\n // rs.next() is not empty if both user and pass are in the same row\n matchedPass = rs.next();\n\n // close stuff\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return matchedPass;\n }",
"public boolean checkPassword(String password, String actualPassword) {\r\n return password.equals(actualPassword);\r\n }",
"public static void main(String[] args) {\n\n String username = \"Gulzhaina\";\n String password = \"12345\";\n Scanner input = new Scanner(System.in);\n String username2 = input.nextLine();\n\n\n if(username2.equals(username)){\n System.out.println(\"Please enter your password: \");\n String password2 =input.nextLine();\n if(password2.equals(password)){\n System.out.println(\"Login successful\");\n } else{\n System.out.println(\"Wrong password\");\n }\n }\n else {\n System.out.println(\"invalid username\");\n }\n\n }",
"private boolean isValidUser(String userName, String password) {\n\t\tif (userName.equals(\"Admin\") && password.equals(\"Admin\")) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t}",
"public static boolean validate(String un, String pw) {\r\n\t\tboolean status=false;\r\n\t\t\r\n\t\t//Establish connection to MySQL\r\n\t\ttry{ \r\n\t\t\tClass.forName(\"com.mysql.jdbc.Driver\"); \r\n\t\t\tConnection con=DriverManager.getConnection( \r\n\t\t\t\t\t\"jdbc:mysql://localhost:3306/moviedb\",\"root\",\"\"); \r\n \r\n\t\t\tStatement stmt=con.createStatement();\r\n\t\t\t\r\n\t\t\t//execute query for password for given username\r\n\t\t\tResultSet rs=stmt.executeQuery(\"SELECT password FROM users WHERE username='\"+un+\"'\"); \r\n\t\t\t//After query pointer is set on record\r\n\t\t\t//moves pointer before record\r\n\t\t\trs.beforeFirst();\r\n\t\t\t\r\n\t\t\t//Checks that username exists based on if the pointer is before a record\r\n\t\t\tif(rs.isBeforeFirst()) {\r\n\t\t\t\t//Moves pointer back onto record so we can get string\r\n\t\t\t\trs.next();\r\n\t\t\t\t//if entered password matches password in database return true\r\n\t\t\t\tif(pw.equals(rs.getString(1))) {\r\n\t\t\t\t\tstatus = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\telse\r\n\t\t\t\tstatus=false;\r\n\t\t\t\r\n\t\t\t//close connection\r\n\t\t\tcon.close();\r\n\t\t} \r\n\r\n\t\tcatch(Exception e){ \r\n\t\t\tSystem.out.println(e);} \r\n\t\t\r\n\t\treturn status;\r\n\t}",
"public static void main(String[] args) {\r\n\r\n Scanner scan =new Scanner(System.in);\r\n System.out.println(\"User Name:\");\r\n String userName = scan.next();\r\n System.out.println(\"Password:\");\r\n String password = scan.next();\r\n\r\n if (userName.equalsIgnoreCase(\"user123\") && password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"Login Succesfull\");\r\n } else if (! userName.equalsIgnoreCase(\"user123\") && password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"Username is not Correct\");\r\n } else if (userName.equalsIgnoreCase(\"user123\") && ! password.equalsIgnoreCase(\"pass123\")) {\r\n System.out.println(\"Password is not Correct\");\r\n } else if (! userName.equalsIgnoreCase(\"user123\") && ! password.equalsIgnoreCase(\"pass123\") ) {\r\n System.out.println(\"User name and Password is not correct\");\r\n }\r\n\r\n }",
"public boolean userMatchesPassword(String username, String password) throws FileNotFoundException, IOException {\n\t\tConnection connectionToDB = null;\n\t\tconnectionToDB = connectToDB();\n\t\tString query = \"Select count(*) from PESSOA where NOMEUTILIZADOR = ? and PASSWORD = ?\";\n\t\ttry (PreparedStatement ps= connectionToDB.prepareStatement(query)){\n ps.setString(1, username);\n ps.setString(2, password);\n ResultSet rs= ps.executeQuery();\n rs.next();\n\n return (rs.getInt(1)>=1);\n }\n catch (SQLException e){\n System.out.println(e);\n return false;\n }\n\t}",
"@When(\"^The user enters the password$\")\n\tpublic void the_user_enters_the_password() throws Throwable {\n\t\t\n\t lpw.password_textbox();\n\t}"
] | [
"0.7513915",
"0.663462",
"0.63204306",
"0.62869215",
"0.62705344",
"0.62437916",
"0.62437916",
"0.62437916",
"0.62437916",
"0.62437916",
"0.62437916",
"0.62437916",
"0.62437916",
"0.62158513",
"0.62081426",
"0.61659914",
"0.61119735",
"0.611139",
"0.61012155",
"0.60993874",
"0.6073153",
"0.6063747",
"0.60232615",
"0.5960671",
"0.5953969",
"0.59478414",
"0.59373945",
"0.592119",
"0.59129155",
"0.5894775",
"0.5885613",
"0.5853732",
"0.5850925",
"0.58145136",
"0.58067596",
"0.577603",
"0.57618195",
"0.57591265",
"0.5754677",
"0.5754413",
"0.5747202",
"0.57469916",
"0.5725119",
"0.5713538",
"0.57069486",
"0.5705293",
"0.57034045",
"0.5694967",
"0.56881994",
"0.56870204",
"0.56851244",
"0.56807685",
"0.5678512",
"0.56765294",
"0.5672534",
"0.56700087",
"0.56597555",
"0.5658913",
"0.5654302",
"0.5650525",
"0.5642141",
"0.56358176",
"0.56225663",
"0.56097996",
"0.5607629",
"0.56011844",
"0.55932724",
"0.55875856",
"0.5575876",
"0.55743897",
"0.5559933",
"0.5553245",
"0.5531417",
"0.5530367",
"0.5529791",
"0.55272037",
"0.5521549",
"0.5512405",
"0.55024034",
"0.550001",
"0.5487934",
"0.5464983",
"0.5464958",
"0.54624",
"0.54608566",
"0.54571587",
"0.5454674",
"0.5439266",
"0.54340863",
"0.5422813",
"0.5421154",
"0.54165775",
"0.5411172",
"0.54081225",
"0.5407696",
"0.54040176",
"0.5402855",
"0.53991055",
"0.5398743",
"0.5390936"
] | 0.68037206 | 1 |
/ Appends a valid ASCII character to word; in one instance to the front and in another to the back, then sends the result to guessPW(). Goes through all valid ASCII keyboard characters | public static boolean append(String word){
boolean x = false;
boolean y = false;
for(int i = 33; i <= 126; i++){
char c = (char)i;
x = guessPW(word.concat(Character.toString(c)));
y = guessPW(Character.toString(c).concat(word));
}
if(x | y){
return true;
}
else{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"private void playGame() {\n \twhile (guessesLeft > 0) {\n \t\twhile (true) {\n \t\t\tstr = readLine(\"Your guess: \");\n \t\t\tif (str.length() != 1) {\n \t\t\t\tprintln(\"You can only enter one symbol!\");\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tboolean bl = false;\n \t\t\t\n \t\t\t// Change string and char to uppercase\n \t\t\tstr = str.toUpperCase();\n \t\t\tchar ch = str.charAt(0);\n \t\t\t\n \t\t\tfor (int i = 0; i < guesses.length(); i++) {\n \t\t\t\tif (ch == guesses.charAt(i)) {\n \t\t\t\t\tprintln(\"This letter has already written. Enter another one!\");\n \t\t\t\t\tbl = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t}\n \t\t\t\n \t\t\tif (bl) {\n \t\t\t\tcontinue;\n \t\t\t}\n \t\t\t\n \t\t\tbreak;\n \t\t}\n \t\t\n \t\t// Change string and char to uppercase\n \t\tstr = str.toUpperCase();\n \t\tletter = str.charAt(0);\n\n \t\tguesses += letter;\n \t\t\n \t\t// Check if word contains entered letter\n \t\tif (checkWord()) {\n \t\t\tprintln(\"That guess is correct.\");\n \t\t}\n \t\telse {\n \t\t\tprintln(\"There are no \" + letter + \"'s in the word.\");\n \t\t\tincorrectLetters += letter;\n \t\t\tcanvas.noteIncorrectGuess(incorrectLetters);\n \t\t\tguessesLeft--;\n \t\t}\n \t\t\n \t\tif (numberOfSymbols < word.length()) {\n \t\t\tprint(\"The word now looks like this: \");\n \t\t\tfor (int i = 0; i < word.length(); i++) {\n \t\t\t\tif (list[i] == true) {\n \t\t\t\t\tprint(word.charAt(i));\n \t\t\t\t}\n \t\t\t\telse {\n \t\t\t\t\tprint(\"-\");\n \t\t\t\t}\n \t\t\t}\n \t\t\tprintln();\n \t\t\t\n \t\t\tif (guessesLeft == 1) {\n \t\t\t\tprintln(\"You have only one guess left.\");\n \t\t\t}\n \t\t\telse {\n \t\t\t\tprintln(\"You have \" + guessesLeft + \" guesses left.\");\n \t\t\t}\n \t\t}\n \t\telse {\n \t\t\tif (numberOfSymbols == word.length()) {\n \t\t\t\twin = true;\n \t\t\t\tprintln(\"You guessed the word: \" + word);\n \t\t\t\tprintln(\"You win.\");\n \t\t\t\tcanvas.displayWord(word);\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n\t\t\t\t\n \t}\n \t\n \tif (win == false) {\n \t\tprintln(\"You're completely hung.\");\n \t\tprintln(\"The word was: \" + word);\n \t\tprintln(\"You loose.\");\n \t\tcanvas.displayWord(word);\n \t}\n \t\n \tstartNext();\n }",
"public static void solve() {\n\t\tint loop = in.nextInt();\r\n\t\tin.nextLine();\r\n\t\tfor(int t = 0; t < loop; t++) {\r\n\t\t\tString inputtemp = in.nextLine();\r\n\t\t\tString inputcheck = inputtemp.toLowerCase();\r\n\t\t\tString result = \"\";\r\n\t\t\tString input = \"\";\r\n\t\t\tfor(int i = 0; i < inputcheck.length(); i++) {\r\n\t\t\t\tif(Character.isLetter(inputcheck.charAt(i)) || inputcheck.charAt(i) == ' ') input +=inputcheck.charAt(i);\r\n\t\t\t}\r\n\t\t\tfor(int i = input.length() - 1; i >= 0; i--) {\r\n\t\t\t\tchar c = input.charAt(i);\r\n\t\t\t\tif(c == 'o' || c == 's' || c == 'x' || c == 'z') {\r\n\t\t\t\t\tresult+=c;\r\n\t\t\t\t} else if(c == 'a') {\r\n\t\t\t\t\tresult+='e';\r\n\t\t\t\t} else if(c == 'e') {\r\n\t\t\t\t\tresult+='a';\r\n\t\t\t\t} else if(c == 'b') {\r\n\t\t\t\t\tresult+='q';\r\n\t\t\t\t} else if(c == 'q') {\r\n\t\t\t\t\tresult+='b';\r\n\t\t\t\t} else if(c == 'd') {\r\n\t\t\t\t\tresult+='p';\r\n\t\t\t\t} else if(c == 'p') {\r\n\t\t\t\t\tresult+='d';\r\n\t\t\t\t} else if(c == 'h') {\r\n\t\t\t\t\tresult+='y';\r\n\t\t\t\t} else if(c == 'y') {\r\n\t\t\t\t\tresult+='h';\r\n\t\t\t\t} else if(c == 'm') {\r\n\t\t\t\t\tresult+='w';\r\n\t\t\t\t} else if(c == 'w') {\r\n\t\t\t\t\tresult+='m';\r\n\t\t\t\t} else if(c == 'n') {\r\n\t\t\t\t\tresult+='u';\r\n\t\t\t\t} else if(c == 'u') {\r\n\t\t\t\t\tresult+='n';\r\n\t\t\t\t} else if(Character.isAlphabetic(c)) {\r\n\t\t\t\t\tresult+=c;\r\n\t\t\t\t} else result+=\" \";\r\n\t\t\t}\r\n\t\t\tString resulttemp = \"\";\r\n\t\t\tinputtemp = \"\";\r\n\t\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\t\tif(input.charAt(i) != ' ') inputtemp+=input.charAt(i);\r\n\t\t\t}\r\n\t\t\tfor(int i = 0; i < result.length(); i++) {\r\n\t\t\t\tif(result.charAt(i) != ' ') resulttemp += result.charAt(i);\r\n\t\t\t}\r\n\t\t\tboolean is = false;\r\n\t\t\tif(inputtemp.equals(resulttemp)) is = true;\r\n\t\t\tif(is) System.out.println(input + \" (is) \" + result);\r\n\t\t\telse System.out.println(input + \" (not) \" + result);\r\n\t\t}\r\n\t}",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"public void addLettersGuessed(char letter)\n\t {\n\t\t\n\t\t if (mysteryWord.indexOf(letter) == -1)\n\t\t {\n\t\t\t lettersGuessed += letter + \" \"; \n\t\t }\n\t\t \n\t\t missedLetters.setText(lettersGuessed);\n\t\t \n\t }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"public void run() {\n \t canvas.reset();\n \t rg = RandomGenerator.getInstance();\n int index = rg.nextInt(0,9);\n hang = new HangmanLexicon();\n \n //word = hang.getWord(index);\n try{\n BufferedReader br = new BufferedReader(new FileReader(\"HangmanLexicon.txt\"));\n \n while(true){\n \t String line = br.readLine();\n \t if(line == null)\n \t\t continue;\n \t ArrayList<String> kt = new ArrayList<String>();\n \t \n \t \n \t \n }\n for(int k = 0; k < word.length();k++){\n \t t = t + \"-\";\n \t \n }\n \n \twhile(counter >=0){\n \t\n \tsetup();\n \t\n \t\n \t\n \t\n \t}\n \t\n\t}\n\n \n private void setup(){\n \t\n \t\n \t\n \t\n \n int k = word.length();\n \n int i = 65;\n int temp = rg.nextInt(0,25);\n \tchar c = (char)(i + temp);\n \tboolean presentcharacter = false;\n \n \tcanvas.displayWord(t);\n \tSystem.out.println(\"you have only \" + counter + \" cases left\");\n System.out.println(\"Your Guess \"+ c);\n for(int j = 0; j<word.length();j++){\n \t\t\n \t\tif(word.charAt(j) == c){\n \t\t\tpresentcharacter = true;\n \t\t\tk--;\n \t\t}\n \t}\n \t\n \t\n \n \tif(presentcharacter){\n \t\tfor(int num = 0; num<word.length();num++){\n \t\t\tif(word.charAt(num) == c){\n \t\t\t\tSystem.out.println(\"you guessed it right\");\n \t\t\t\tt = t.substring(0,num) +c +t.substring(num+1,t.length());\n \t\t\t \t\n \t\t\t}\n \t\t\t\n \t\t}\n \t\t\n \t\t\n \t\t\n \t\t\n \t}\n \t\n \t\tcanvas.noteIncorrectGuess(c, counter);\n \t\t\n \t\t\n \t\n \tcounter--;\n \n \n \t if(k == 0){\n \t \t\n \t \tSystem.out.println(\"you have won this game\");\n \t \tSystem.out.println(\"Congratulations\");\n return; \t \t\n \t \t\n \t \t\n \t }\n \n }\n \n \n\n private String t = \"\" ;\n public String word;\npublic int counter = 8;\n private HangmanLexicon hang;\n private RandomGenerator rg;\n}",
"public char handleGuess(){\n\t\t\r\n\t\tSystem.out.print(\"Please enter a letter: \");\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString s = sc.next();\r\n\t\tchar letter = s.charAt(0);\r\n\r\n\t\taa:for(int i=0; i<gameLetter.length; i++){\r\n\t\t\tif(letter == gameLetter[i]){\r\n\t\t\t\tcorrectList.add(letter);\r\n\t\t\t\t\r\n\t\t\t\tif(ifWrongListContain(letter)==true){\r\n\t\t\t\t\tfor(int b=0, length=wrongList.size(); b<length; b++){\r\n\t\t\t\t\t\tif(wrongList.get(b)==letter)\r\n\t\t\t\t wrongList.remove(b);\r\n\t\t\t\t length--;\r\n\t\t\t\t b--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tbreak aa;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif(ifWrongListContain(letter)==true)\r\n\t\t\t\t\tcontinue aa;\r\n\t\t\t\telse\r\n\t\t\t\t wrongList.add(letter);\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn letter;\t\t\r\n\t\t\t\t\r\n\t}",
"@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 void setHangmanWord()\n {\n if(word == null || word == \"\") return;\n\n String hangmanWord = \"\";\n for(int i=0; i<word.length(); i++)\n {\n if(showChar[i])\n hangmanWord += word.substring(i, i+1)+\" \";\n else\n hangmanWord += \"_ \";\n }\n\n wordTextField.setText(hangmanWord.substring(0, hangmanWord.length()-1));\n }",
"public void setBasicChar(BasicChar wotCharacter) {\n this.wotCharacter = wotCharacter;\n }",
"private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}",
"public static void playGame(String word) {\n DrawingPanel canvas = new DrawingPanel(500, 500);\n Graphics pen = canvas.getGraphics();\n \n //define flag for while loop\n boolean gameOver = false;\n \n //create a boolean array with elements equal to the number of letters to guess\n boolean[] letters = new boolean[word.length()];\n \n //Create a string that stores all letters that have been guessed\n String guesses = \"\";\n \n //create an int variable that stores the number of wrong guesses\n int wrongGuesses = 0;\n \n //create a scanner object that reads in user guesses.\n Scanner console = new Scanner(System.in);\n \n //meat of the game\n while(!gameOver) {\n \n //prompt user for a guess\n System.out.print(\"Guess a letter: \");\n char guess = Character.toLowerCase(console.next().charAt(0));\n \n \n //check to see if the user has guessed this letter before\n boolean freshGuess = true;\n for(int index = 0; index < guesses.length(); index++) {\n System.out.println(\"Guesses[i] = \" + guesses.charAt(index) + \", Guess = \" + guess);\n if(guess == guesses.charAt(index)) { \n freshGuess = false;\n }\n }\n \n //if the guess is fresh, check if it is correct\n boolean correctGuess = false;\n if(freshGuess) {\n \n for(int index = 0; index < word.length(); index++) {\n if(guess == word.charAt(index)) { \n letters[index] = true;\n correctGuess = true;\n }\n }\n \n if(correctGuess) {\n System.out.println(\"Good guess! The word is:\");\n gameOver = !printGuess(letters, word);\n }\n \n else{\n System.out.println(\"Oops! Letter \" + guess + \" is not there. Adding to hangman... \");\n draw(wrongGuesses, pen);\n wrongGuesses++;\n if(wrongGuesses == 6) { gameOver = true; }\n }\n \n guesses += guess;\n }\n \n //report repeated guess\n else { \n System.out.println(\"You have already guessed \" + guess + \".\");\n }\n \n \n }\n \n //The game is over\n System.out.println(\"Game Over!\");\n \n }",
"public static void hangMan(Scanner input, Questions thisSession){\n hangMan1();\n Random rand=new Random();\n int randomNumber=rand.nextInt(thisSession.getLength());\n String userInput;\n byte lives=6,givenLetterscontrol=0;\n boolean letterIsInAnswer=false,playerWon=false;\n System.out.println(\"Welcome. Please type just one letter and press enter. You have 5 lives to guess the sentence. The questions is:\\n\"+\n thisSession.getQuestion(randomNumber));\n String answerSentence=(thisSession.getAnswer(randomNumber));\n String[] sentence=new String[answerSentence.length()];\n String [] lowDiagonal=new String[answerSentence.length()], givenLetter=new String[lives];\n sentence=answerSentence.split(\"\");\n for (int i=0;i<sentence.length;i++){\n if (sentence[i].equals(\" \")){\n lowDiagonal[i]=\" \";\n }else{ \n lowDiagonal[i]=\"_\";\n }\n System.out.print(lowDiagonal[i]+ \" \");\n }\n do{\n System.out.println(\"\\nWrite a letter and press enter to send the letter\");\n userInput=input.nextLine();\n userInput=userInput.toLowerCase();\n letterIsInAnswer=false;\n if (givenLetterscontrol>0){ //checks if user input has already been given.\n for (int i=0;i<6;i++){\n if (givenLetter[i].equals(userInput)){\n do{\n System.out.println(\"That letter has already been given. Please write another one.\");\n userInput=input.nextLine();\n }while (givenLetter[i].equals(userInput));\n }\n }\n }\n givenLetter[givenLetterscontrol]=userInput;\n for (int i=0;i<sentence.length;i++){ //checks if the letter is in the answer.\n if (sentence[i].equals(userInput)){\n letterIsInAnswer=true;\n lowDiagonal[i]=userInput;\n }\n }\n if (letterIsInAnswer==false){ //If letter was not in the answer, a life is lost.\n lives--;\n switch(lives){\n case 5:\n hangMan2();\n break;\n case 4:\n hangMan3();\n break;\n case 3:\n hangMan4();\n break; \n case 2:\n hangMan5();\n break;\n case 1:\n hangMan6();\n break;\n case 0:\n hangMan7();\n youLost();\n lives=-1;\n break;\n }\n System.out.println(\"That letter is not in the answer.\");\n }\n if (letterIsInAnswer){\n if (Arrays.equals(lowDiagonal,sentence)){\n playerWon=true;\n for (int i=0;i<sentence.length;i++){ \n System.out.print(lowDiagonal[i]+ \" \");\n } \n youWon();\n }else{\n for (int i=0;i<sentence.length;i++){ \n System.out.print(lowDiagonal[i]+ \" \");\n } \n }\n }\n\n }while (lives>=0 && playerWon==false);\n System.out.println(\"Thanks for playing! Returning to main menu...\");\n }",
"@Override\n\tpublic void keyReleased(KeyEvent e) {\n\t\tchar input = e.getKeyChar();\n\t\tString newAnswer = \"\";\n\t\tboolean correct = false;\n\t\t//Text = answer;\n\t\tif(lives > 0) {\n\t\tfor(int a = 0; a < answer.length(); a++) {\n\t\t\tif(answer.charAt(a) == input) {\n\t\t\t\t//System.out.println(answer.toCharArray()[a]);\n\t\t\t\t//Text.toCharArray()[a] = answer.charAt(a);\n\t\t\t\tnewAnswer += input;\n\t\t\t\tcorrect = true;\n\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tnewAnswer += Text.charAt(a);\n\t\t\t\t\n\t\t\t}\n\t\t\t if(Text.charAt(a) != '-') {\n\t\t\t\t correctCharacters++;\n\t\t\t\t System.out.println(correctCharacters + \" correct characters\");\n\t\t\t\t System.out.println(length.length());\n\t\t\t\t \tif(correctCharacters > length.length() + 2) {\n\t\t\t\t \tframe.dispose();\n\t\t\t\t\tstack.clear();\n\t\t\t\t\tint reset = JOptionPane.showConfirmDialog(null, \"Congratulations! You guessed all your words! Play again?\");\n\t\t\t\t\tif(reset == 0) {\n\t\t\t\t\t\tRun();\n\t\t\t\t\t\ttext.setText(Text);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t \telse if (lives <= 0) {\n\t\t\t\t \t\tframe.dispose();\n\t\t\t\t\t\tstack.clear();\n\t\t\t\t\t\tint reset = JOptionPane.showConfirmDialog(null, \"Game Over! Play again?\");\n\t\t\t\t\t\tif(reset == 0) {\n\t\t\t\t\t\t\tRun();\n\t\t\t\t\t\t\ttext.setText(Text);\n\t\t\t\t\t\t}\n\t\t\t\t \t}\n\t\t\t }\n\t\t}\n\t\tif(correct == false) {\n\t\t\tlives--;\n\t\t}\n\t\tText = newAnswer;\n\t\ttext.setText(Text);\n\t\tlifeDisplay.setText(\"Lives: \" + lives);\n\t\tcorrect = false;\n\t\t\n\t}\n\t\t\n\t\telse {\n\t\t\tframe.dispose();\n\t\t\tstack.clear();\n\t\t\tint reset = JOptionPane.showConfirmDialog(null, \"Game Over! Play again?\");\n\t\t\tif(reset == 0) {\n\t\t\t\tRun();\n\t\t\t}\n\t\t}\n\t}",
"public void composeAlphabet() {\n\t\tScanner scanner = new Scanner(System.in);\n\t\tSystem.out.println(\"Please enter a name for this alphabet: \");\n\t\tString alphabetName = scanner.nextLine();\n\t\tSystem.out.println(\"Please enter the location of the window dumps \" + \"(relative to the current folder): \");\n\t\tString alphabetLoc = scanner.nextLine();\n\t\tscanner.close();\n\t\tcomposeAlphabet(alphabetName, alphabetLoc);\n\t}",
"private static void printHangman() {\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tif (guessesResult[i]) {\n\t\t\t\tSystem.out.print(word.charAt(i));\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" _ \");\n\t\t\t}\n\t\t}\n\t}",
"public static char[] visibleLetters(char[] wordToGuess, int asciiGuess){\n int length = wordToGuess.length; //get the length of word that needs to be guessed\n char[] visibleLetters = new char[length]; //create new array same size as word to be guessed\n\n for(int i = 0; i < length; i++){ //fill new array with '-'\n visibleLetters[i] = '-';\n }\n\n char userGuess = (char) asciiGuess; //convert users guess back to char\n for(int j = 0; j < length; j++){ //iterate through whole word\n if(userGuess == wordToGuess[j]){ //check each spot in char array for users letter\n visibleLetters[j] = userGuess; //sets second array '-' to users correct guess\n }\n }\n\n return visibleLetters;\n }",
"private void computerTurn() {\n String text = txtWord.getText().toString();\n String nextWord;\n if (text.length() >= 4 && dictionary.isWord(text)){\n endGame(false, text + \" is a valid word\");\n return;\n } else {\n nextWord = dictionary.getGoodWordStartingWith(text);\n if (nextWord == null){\n endGame(false, text + \" is not a prefix of any word\");\n return;\n } else {\n addTextToGame(nextWord.charAt(text.length()));\n }\n }\n userTurn = true;\n txtLabel.setText(USER_TURN);\n }",
"public static boolean guessBoard(String keyword, char character, char[] guessBoard, char[] alphabetBoard) {\n boolean guess = false;\n try{\n if(alphabetBoard[character - 65] == ' ') { // // Duplicate input.\n System.out.println(\"The character you already entered!\");\n guess = false;\n correctInput = false;\n }\n else { // Correct input.\n alphabetBoard[character - 65] = ' ';\n for(int i = 0; i < guessBoard.length; i++) {\n if (keyword.charAt(i) == character) {\n guessBoard[i] = character;\n guess = true;\n }\n }\n correctInput = true;\n }\n }\n catch(IndexOutOfBoundsException e){\n System.out.println(\"Select alphabet\");\n correctInput = false;\n }\n return guess;\n }",
"public static void initBoards(String keyword, char[] guessBoard, char[] alphabetBoard) {\n Arrays.fill(guessBoard, '_');\n for(int i = 0; i < 26; i++) alphabetBoard[i] = (char) (65 + i);\n }",
"@Test\n public void testWordGuessArray() {\n\n // If I make a new word\n Word word = new Word(\"Llama\", 10);\n\n // The guess array should be initialized to all '_' characters\n // but be of the same length as the number of letters in the word\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess the letter L (uppercase)\n // it should return true, because 'Llama' contains 2 Ls.\n Assert.assertTrue(word.guessLetter('L'));\n\n // It should update the 'guess' character array\n // to have all L's revealed regardless of casing\n // all other letters should stay hidden as '_'\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess an M, it should also be true\n Assert.assertTrue(word.guessLetter('M'));\n\n // and now the m should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And finally an A\n Assert.assertTrue(word.guessLetter('A'));\n\n // The whole word should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // If I guess a bunch of other letters, they should all return false\n // because the word has already been completed, and revealed\n Assert.assertFalse(word.guessLetter('l'));\n Assert.assertFalse(word.guessLetter('m'));\n Assert.assertFalse(word.guessLetter('a'));\n Assert.assertFalse(word.guessLetter('c'));\n Assert.assertFalse(word.guessLetter('v'));\n Assert.assertFalse(word.guessLetter('b'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public void getAllWrongLetters() {\n allWrongLetters = \"\";\n //loop until reaching the last stored wrong letter (wrongLettersCount)\n for (int i = 0; i < this.wrongLettersCount; i++) {\n allWrongLetters += \" \" + inputLetters[i];\n }\n }",
"public char getUserGuess(){\n char letter = '\\u0000';\n if(mGuessEditText.getText().toString().toLowerCase().length() != 0)\n letter = mGuessEditText.getText().toString().toLowerCase().charAt(0);\n return letter;\n }",
"public static void main(String args[]) \n {\n Scanner in=new Scanner(System.in);\n String text=in.nextLine();\n StringBuilder str=new StringBuilder(text);\n int str_len=str.length();\n int key=in.nextInt();\n for(int i=0;i<str_len;i++)\n {\n if(str.charAt(i)!=' ')\n {\n int ch=str.charAt(i)-key;\n if(str.charAt(i)>'A' && str.charAt(i)<'Z')\n {\n if(ch<'A')\n {\n ch=ch+26;\n }\n }\n else if(str.charAt(i)>'a' && str.charAt(i)<'z')\n {\n if(ch<'a')\n {\n ch=ch+26;\n }\n }\n str.setCharAt(i,(char)ch);\n }\n }\n System.out.print(str);\n }",
"public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\n\t\tString xStringA = scan.next() + \"111111\";\n\t\tchar[] xCharA = xStringA.toCharArray();\n\t\tString[] xAlpha = new String[26];\n\t\txAlpha[0]=\"a\";\n\t\txAlpha[1]=\"B\";\n\t\txAlpha[2]=\"C\";\n\t\txAlpha[3]=\"D\";\n\t\txAlpha[4]=\"E\";\n\t\txAlpha[5]=\"F\";\n\t\txAlpha[6]=\"G\";\n\t\txAlpha[7]=\"H\";\n\t\txAlpha[8]=\"I\";\n\t\txAlpha[9]=\"J\";\n\t\txAlpha[10]=\"K\";\n\t\txAlpha[11]=\"L\";\n\t\txAlpha[12]=\"M\";\n\t\txAlpha[13]=\"N\";\n\t\txAlpha[14]=\"O\";\n\t\txAlpha[15]=\"P\";\n\t\txAlpha[16]=\"Q\";\n\t\txAlpha[17]=\"R\";\n\t\txAlpha[18]=\"S\";\n\t\txAlpha[19]=\"T\";\n\t\txAlpha[20]=\"U\";\n\t\txAlpha[21]=\"V\";\n\t\txAlpha[22]=\"W\";\n\t\txAlpha[23]=\"X\";\n\t\txAlpha[24]=\"Y\";\n\t\txAlpha[25]=\"Z\";\n\t\t\n\t\t\n\t\tchar one = xStringA.charAt(0);\n\t\tchar two = xStringA.charAt(1);\n\t\tchar three = xStringA.charAt(2);\n\t\tchar four = xStringA.charAt(3);\n\t\tchar five = xStringA.charAt(4);\n\t\tchar six = xStringA.charAt(5);\n\n\t\tString sOne = Character.toString(one);\n\t\tString sTwo = Character.toString(two);\n\t\tString sThree = Character.toString(three);\n\t\tString sFour = Character.toString(four);\n\t\tString sFive = Character.toString(five);\n\t\tString sSix = Character.toString(six);\n\t/*\t\n\t\tSystem.out.println(sOne);\n\t\tSystem.out.println(sTwo);\n\t\tSystem.out.println(sThree);\n\t\tSystem.out.println(sFour);\n\t\tSystem.out.println(sFive);\n\t\tSystem.out.println(sSix);\n\t*/\n\t\t\n\t\tfor (int i = 0; i < 26 ; i++) {\n\t\t\tif (sOne != xAlpha[i]) {\n\t\t\t\tint oneVar = 1;\n\t\t\t\toneVar = i+1;\n\t\t\t\tSystem.out.println(\"Value is\");\n\t\t\t\tSystem.out.println(sOne + \" \" +xAlpha[i]);\n\t\t\t\tSystem.out.println(oneVar);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"no value was similar1\");\n\t\t\t}\n\t\t\t\n\t\t\tif (sTwo != xAlpha[i]) {\n\t\t\t\tint twoVar = 2;\n\t\t\t\ttwoVar = i+1;\n\t\t\t\tSystem.out.println(\"Value is\");\n\t\t\t\tSystem.out.println(sTwo + \" \" +xAlpha[i]);\n\t\t\t\tSystem.out.println(twoVar);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"no value was similar2\");\n\t\t\t}\n\t\t\t}\n\t\t}",
"public abstract String guessedWord();",
"public MyHangmanGame(String secretWord, int numGuesses, String LetterHistory){\n OriginSecretWord = secretWord;\n GuessRemainingNum = numGuesses;\n LetterLeftNum = secretWord.length();\n for(int i = 0; i < secretWord.length(); i++)\n {\n CurrentState += \"_ \";\n for(int j = i; j > 0; j--)\n {\n if(secretWord.charAt(i) == secretWord.charAt(j-1))\n {\n LetterLeftNum--;//If the letter appears many times in the secret word, it will be counted just once.\n break;\n }\n }\n }\n LetterGuessHistory = LetterHistory;\n }",
"private void updatePatterns(char guess) {\r\n \tfinal char UNDISPLAYED = '-';\r\n \tfor (int i = 0; i < this.activeWords.size(); i++) {\r\n \t\tString word = this.activeWords.get(i);\r\n \t\tfor (int j = 0; j < word.length(); j++) {\r\n \t\t\tif (word.charAt(j) == guess) {\r\n \t\t\t\tthis.patterns.get(i)[j] = guess;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }",
"public void guessLetter()\n\t{\n\t\tSystem.out.println(\"The name is \" + length + \" letters long.\");\n\t\tSystem.out.println(\"Ok, now guess what letters are in the name.\");\n\t\t\n\t\t//This will guess the first letter.\n\t\tguessLetter1 = scan.nextLine();\n\t\tif(name.indexOf(guessLetter1) == -1)\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, that letter is not in the name, try again!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tposition1 = name.indexOf(guessLetter1);\n\t\t\tSystem.out.println(\"You're correct, letter \" + guessLetter1 + \" is in position \" + position1);\n\t\t}\n\t\t\n\t\t//This will guess the second letter.\n\t\tguessLetter2 = scan.nextLine();\n\t\tif(name.indexOf(guessLetter2) == -1)\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, that letter is not in the name, try again!\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tposition2 = name.indexOf(guessLetter2);\n\t\t\tSystem.out.println(\"You're correct, letter \" + guessLetter2 + \" is in position \" + position2);\n\t\t}\n\t\t\n\t\t//This will guess the third letter.\n\t\tguessLetter3 = scan.nextLine();\n\t\tif(name.indexOf(guessLetter3) == -1)\n\t\t{\n\t\t\tSystem.out.println(\"Sorry, that letter is not in the name.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tposition3 = name.indexOf(guessLetter3);\n\t\t\tSystem.out.println(\"You're correct, letter \" + guessLetter3 + \" is in position \" + position3);\n\t\t}\n\t}",
"private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();i++){\n\t\t\tif(sb.charAt(i) == ' ')\n\t\t\t\tsb.setCharAt(i, '_');\n\t\t}\n\t\ttoTextBox = sb.toString();\n\t\ttextField.setText(toTextBox);\n\t\tlblWord.setText(toTextBox);\n\t}",
"Alphabet(String chars) {\n _chars = sanitizeChars(chars);\n }",
"public static String userInput()\r\n {\r\n Scanner link = new Scanner(System.in);\r\n String word = link.next();\r\n char[] chars = word.toCharArray();\r\n boolean checkWord = false; \r\n for(int i = 0; i < chars.length; i++)\r\n {\r\n char c = chars[i];\r\n if((c < 97 || c > 122))\r\n {\r\n checkWord = true;\r\n }\r\n }\r\n link.close();\r\n if(!checkWord)\r\n {\r\n return word;\r\n } \r\n else \r\n System.out.println(\"Not a valid input\");\r\n return null;\r\n }",
"void encryptText() {\n\n ArrayList<Character> punctuation = new ArrayList<>(\n Arrays.asList('\\'', ':', ',', '-', '-', '.', '!', '(', ')', '?', '\\\"', ';'));\n\n for (int i = 0; i < text.length(); ++i) {\n\n if (punctuation.contains(this.text.charAt(i))) {\n\n // only remove punctuation if not ? or . at the very end\n if (!((i == text.length() - 1) && (this.text.charAt(i) == '?' || this.text.charAt(i) == '.'))) {\n this.text.deleteCharAt(i);\n\n // go back to previous position since current char was deleted,\n // meaning the length of the string is now 1 less than before\n --i;\n }\n }\n }\n \n \n // Step 2: convert phrase to lowerCase\n\n this.setText(new StringBuilder(this.text.toString().toLowerCase()));\n\n \n // Step 3: split the phrase up into words and encrypt each word separately using secret key\n\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n \n // Step 3.1:\n\n ArrayList<Character> vowels = new ArrayList<>(Arrays.asList('a', 'e', 'i', 'o', 'u'));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if first char is vowel, add y1x3x4 to the end of word\n if (vowels.contains(words.get(i).charAt(0))) \n words.set(i, words.get(i).substring(0, words.get(i).length()) + this.secretKey.substring(3, 6));\n\n // otherwise, move first char to end of the word, then add x1x2 to the end of word\n else \n words.set(i, words.get(i).substring(1, words.get(i).length()) + words.get(i).charAt(0) + this.secretKey.substring(0, 2));\n }\n\n StringBuilder temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n\n \n // Step 3.2:\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // if position is a multiple of z, insert the special char y2\n if ((i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) && (i != 0)) {\n this.getText().replace(0, this.getText().length(), this.getText().substring(0, i) + this.secretKey.charAt(8)\n + this.getText().substring(i, this.getText().length()));\n }\n }\n \n }",
"public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static void main(String[] args) {\n Scanner input= new Scanner(System.in);\n System.out.println(\" Enter a string value: \");\n String word=input.nextLine();\n String newWord=word.charAt(0)+\"\";\n for (int i = 1; i <word.length() ; i++) {\n if(word.charAt(i)>=65 && word.charAt(i)<=90){\n newWord+=\" \"+word.charAt(i);\n }else{\n newWord+=word.charAt(i);\n }\n\n }\n System.out.println(newWord);\n }",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"private void keyRel(Stage stage) {\n\t\t\n\t\tscene.setOnKeyReleased(new EventHandler<KeyEvent>() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\t\n\t\t\t\t//If the input from the player was a letter key, we continue inside this if statement.\n\t\t\t\tif(e.getCode().isLetterKey()) {\n\t\t\t\t\t\n\t\t\t\t\t//The input is converted to a char variable and a boolean is created and set to false,\n\t\t\t\t\t//in preparation for later in this method.\n\t\t\t\t\tchar letter = e.getText().charAt(0);\n\t\t\t\t\tboolean same = false;\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < currentGuesses.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//If the letter that the user input is the same as the letter found\n\t\t\t\t\t\t//in the currentGuesses char array, the same boolean variable is set\n\t\t\t\t\t\t//to true and we break out of the loop.\n\t\t\t\t\t\tif(letter==currentGuesses[i]) {\n\t\t\t\t\t\t\tsame = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//Otherwise, if we reached a point in the array that has a value of\n\t\t\t\t\t\t//0, instead of a letter, we replace that 0 with the letter that the\n\t\t\t\t\t\t//user just input and break out of the loop, because we know everything\n\t\t\t\t\t\t//past this point are also blanks and don't want to replace them too.\n\t\t\t\t\t\t}else if(currentGuesses[i]==0) {\n\t\t\t\t\t\t\tcurrentGuesses[i] = letter;\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\t\n\t\t\t\t\t//If the letter isn't the same as one already guessed, this if statement happens.\n\t\t\t\t\tif(!same) {\n\t\t\t\t\t\t//A message is sent to the server, including the codename for the server to use\n\t\t\t\t\t\t//and the letter that the user input.\n\t\t\t\t\t\tout.println(\"LetterGuess \" + letter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//A String array is created in preparation for the loop that happens \n\t\t\t\t\t\t//immediately afterwards.\n\t\t\t\t\t\tString[] receive = new String[3];\n\t\t\t\t\t\n\t\t\t\t\t\twhile(receive[0] == null) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t//When the server responds, the String is split into the array, separating \n\t\t\t\t\t\t\t\t//one word from the next by looking for a space.\n\t\t\t\t\t\t\t\treceive = in.readLine().split(\" \");\n\t\t\t\t\t\t\t}catch(IOException ioe) {\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\t\n\t\t\t\t\t\t//The boolean success is set to the second element of the received String that is converted\n\t\t\t\t\t\t//to a boolean. The same is done with the third element and is saved to the finished boolean\n\t\t\t\t\t\t//that exists in the class scope.\n\t\t\t\t\t\tboolean success = Boolean.parseBoolean(receive[1]);\n\t\t\t\t\t\tfinished = Boolean.parseBoolean(receive[2]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Success only needs to exist within this method as it is used here to determine how\n\t\t\t\t\t\t//the statusMessageLabel should be updated.\n\t\t\t\t\t\tif(success) {\n\t\t\t\t\t\t\t//If the player made a successful guess, the status message is set accordingly.\n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There is a '\" + letter + \"' in the word!\");\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t//However, if the player made an unsuccessful guess, the message is set differently,\n\t\t\t\t\t\t\t//the amount of remaining guesses the player has decrements and the drawnPieces\n\t\t\t\t\t\t\t//variable goes up by an amount determined by maths, thanks to the different difficulty\n\t\t\t\t\t\t\t//settings. Assuming easy difficulty, drawnPieces goes up by 1. Medium difficulty\n\t\t\t\t\t\t\t//makes it go up by 1.4 and hard difficulty makes it go up by 2.333. \n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There was no '\" + letter + \"' in the word.\");\n\t\t\t\t\t\t\tremainingGuesses--;\n\t\t\t\t\t\t\tdrawnPieces += (7.0/difficultyGuesses);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//The currentWord label is now set to the value of the first element of the \n\t\t\t\t\t\t//String array.\n\t\t\t\t\t\tcurrentWordLabel = new Label(receive[0]);\n\t\t\t\t\t\t\n\t\t\t\t\t//If the letter is the same as one already guessed, we go here instead\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//Inform the user that they already tried their letter\n\t\t\t\t\t\tstatusMessageLabel = new Label(\"The letter '\" + letter + \"' has already been used\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//The currentGuesses label is updated with the new values of the player's guessed letters.\n\t\t\t\t\t//It is converted from a char array to a String, so that it can be used for the label.\n\t\t\t\t\t//The attemptsRemaining label is also updated, as the value of the remainingGuesses int\n\t\t\t\t\t//may have changed, if the player guessed incorrectly. \n\t\t\t\t\tcurrentGuessesLabel = new Label(new String(currentGuesses));\n\t\t\t\t\tattemptsRemainingLabel = new Label(\"Attempts remaining: \" + remainingGuesses);\n\n\t\t\t\t\t//Since the labels have been updated, the finalLine HBox needs to be updated with the\n\t\t\t\t\t//new labels. \n\t\t\t\t\tfinalLine = new HBox(5,currentGuessesLabel,eh,attemptsRemainingLabel);\n\t\t\t\t\tHBox.setHgrow(eh,Priority.ALWAYS);\n\t\t\t\t\tfinalLine.setAlignment(Pos.CENTER_LEFT);\n\t\t\t\t\t\n\t\t\t\t\t//And since the HBox has been updated, so too does the VBox need to be updated.\n\t\t\t\t\tmassiveSpacing = new VBox(5,group,statusMessageLabel,currentWordLabel,finalLine);\n\t\t\t\t\tmassiveSpacing.setAlignment(Pos.CENTER);\n\t\t\t\t\t\n\t\t\t\t\t//And also, the second group. \n\t\t\t\t\tnewGroup = new Group(massiveSpacing,hangTheMan(Math.toIntExact(Math.round(drawnPieces))));\n\t\t\t\t\tscene = new Scene(newGroup,300,300,Color.LIGHTGREY);\n\t\t\t\t\tstage.setScene(scene);\n\t\t\t\t\t\n\t\t\t\t\t//This method call could be seen as recursive, as it adds the very event listener\n\t\t\t\t\t//that we're inside now to the stage once again.\n\t\t\t\t\tkeyRel(stage);\n\t\t\t\t\t\n\t\t\t\t\t//If the remaining guesses left for the player is 0, then it's game over for them.\n\t\t\t\t\t//The appropriate method is called.\n\t\t\t\t\tif(remainingGuesses==0) {\n\t\t\t\t\t\tgameOver(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Finished will be true if the word has been successfully completed. \n\t\t\t\t\tif(finished) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The completeTime long variable is the difference in values from the current time\n\t\t\t\t\t\t//in milliseconds and the value of epoch, which was the current time in milliseconds\n\t\t\t\t\t\t//when the game started.\n\t\t\t\t\t\tcompleteTime = (System.currentTimeMillis() - epoch);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//In case the player had already played a game before, the values of count and\n\t\t\t\t\t\t//the inputName char array are set to a default value. \n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\tinputName[0] = '_';\n\t\t\t\t\t\tinputName[1] = '_';\n\t\t\t\t\t\tinputName[2] = '_';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The appropriate method is called to progress on from the game.\n\t\t\t\t\t\tgameVictory(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//However, if the player did not click on a letter key and it was instead the escape button,\n\t\t\t\t//this if statement is used instead\n\t\t\t\t}else if(e.getCode()==KeyCode.ESCAPE) {\n\t\t\t\t\t\n\t\t\t\t\t//An Alert window is made, asking the player whether they're sure they want to quit\n\t\t\t\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n\t\t\t\t\talert.setTitle(\"Quit game\");\n\t\t\t\t\talert.setHeaderText(null);\n\t\t\t\t\talert.setContentText(\"Are you sure you wish to quit the game?\\nYour progress will not be saved.\");\n\t\t\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\t\t\t\n\t\t\t\t\tif(result.get() == ButtonType.OK) {\n\t\t\t\t\t\t//If the player clicks on the OK button, an attempt to close the socket is made\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tclient.close();\n\t\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//and the stage is closed, which also ends the client's side of the program.\n\t\t\t\t\t\tstage.close();\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t}\n\t\t});\n\t}",
"@Override\n\t\t\tpublic void handle(KeyEvent event) {\n\t\t\t\tif(game.getGameStatus() != Game.GameStatus.GAME_OVER && game.getGameStatus() != Game.GameStatus.WON) {\n\t\t\t\t\t//if not a letter then return\n\t\t\t\t\tif (!event.getCode().isLetterKey())\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\tchar c = event.getCode().toString().charAt(0);\n\n\t\t\t\t\t//make the characters upper case so its easier to work with\n\t\t\t\t\tif (c > 91)\n\t\t\t\t\t\tc = Character.toUpperCase(c);\n\n\t\t\t\t\t//test to see if the character has already been guessed\n\t\t\t\t\tfor (char ch : guessedLetters) {\n\t\t\t\t\t\tif (ch == c) {\n\t\t\t\t\t\t\t//duplicate found, display error and return\n\t\t\t\t\t\t\tdisplayDuplicateInputError();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//color on of the letters on the screen\n\t\t\t\t\tif (c >= 65 && c <= 90) {\n\t\t\t\t\t\tlblLtrs[c - 65].setTextFill(Color.color(1.0, 0, 0));\n\t\t\t\t\t}\n\t\t\t\t\tguessedLetters.add(c);\n\t\t\t\t\tgame.makeMove(c + \"\");\n\t\t\t\t\tdrawHangman();\n\t\t\t\t}\n\t\t\t}",
"public static void main(String[] args) {\n List<String> words = new ArrayList<>();\n try (BufferedReader br = new BufferedReader(new FileReader(\"google-10000-english-no-swears.txt\"))) {\n while (br.ready()) {\n words.add(br.readLine().toLowerCase());\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n //send a message to rose with the word cookie and your team name to get the next clue\n List<String> cipherWords = new ArrayList<>(Arrays.asList(cipher.split(\" \")));\n\n\n HashMap<Character, List<String>> charOccurrences = new HashMap<>();\n //Add all words where a character occurs to a list then map that list to the character\n for (String cipherWord : cipherWords) {\n for (Character ch : cipherWord.toCharArray()) {\n for (String cipherWord2 : cipherWords) {\n if (cipherWord2.contains(ch.toString())) {\n if (charOccurrences.get(ch) == null) {\n charOccurrences.put(ch, (new ArrayList<>(Collections.singletonList(cipherWord2))));\n } else {\n if (!charOccurrences.get(ch).contains(cipherWord2)) {\n charOccurrences.get(ch).add(cipherWord2);\n }\n }\n }\n }\n }\n }\n HashMap<Character, List<Character>> possibleChars = new HashMap<>();\n //Map all characters to a list of all characters which it could possibly be\n for (Map.Entry<Character, List<String>> entry : charOccurrences.entrySet()) {\n Character key = entry.getKey();\n List<String> value = entry.getValue();\n\n List<List<Character>> lists = new ArrayList<>();\n\n for (String string : value) {\n List<Character> characterList = new ArrayList<>();\n for (String patternMatch : getMatches(string, words)) {\n if (!characterList.contains(patternMatch.charAt(string.indexOf(key)))) {\n characterList.add(patternMatch.charAt(string.indexOf(key)));\n }\n }\n lists.add(characterList);\n }\n possibleChars.put(key, findDupes(lists));\n }\n\n HashMap<Character, Character> keyMap = new HashMap<>();\n\n removeCharacter(possibleChars, keyMap, true);\n\n\n //Loop a bunch of times to eliminate things that characters cant be\n for (int x = 0; x < 10; x++) {\n HashMap<Character, List<Character>> tempMap = new HashMap<>(possibleChars);\n possibleChars.clear();\n for (Map.Entry<Character, List<String>> entry : charOccurrences.entrySet()) {\n Character key = entry.getKey();\n List<String> value = entry.getValue();\n\n List<List<Character>> lists = new ArrayList<>();\n\n for (String string : value) {\n List<Character> characterList = new ArrayList<>();\n for (String patternMatch : getMatchesWithLetters(string, keyMap, tempMap, words)) {\n if (!characterList.contains(patternMatch.charAt(string.indexOf(key)))) {\n characterList.add(patternMatch.charAt(string.indexOf(key)));\n }\n }\n lists.add(characterList);\n }\n possibleChars.put(key, findDupes(lists));\n }\n\n keyMap.clear();\n\n removeCharacter(possibleChars, keyMap, true);\n\n }\n\n System.out.println(cipher);\n //print with a lil bit of frequency analysis to pick most common word if word has multiple possible results\n for (String str : cipherWords) {\n String temp = \"\";\n List<String> matchedWords = getMatchesWithLetters(str, keyMap, possibleChars, words);\n if (matchedWords.size() > 1) {\n int highest = 0;\n for (int x = 1; x < matchedWords.size(); x++) {\n if (words.indexOf(matchedWords.get(highest)) > words.indexOf(matchedWords.get(x))) {\n highest = x;\n }\n }\n temp = matchedWords.get(highest);\n }\n\n if (matchedWords.size() == 1) { //if there only 1 possibility print it.\n System.out.print(matchedWords.get(0));\n System.out.print(\" \");\n } else { //if there's more than 1 print the most common one.\n System.out.print(temp);\n System.out.print(\" \");\n }\n }\n }",
"public void addStrangeCharacter() {\n strangeCharacters++;\n }",
"public boolean takeGuess(char letter) {\n\t\t// reset default result as false\n\t\tboolean result = false;\n\t\t// iterate through the characters in the word\n\t\tfor (int i = 0; i < this.getLength(); i++) {\n\t\t\t// if the guess is correct\n\t\t\tif (this.theWord[i] == letter) {\n\t\t\t\t// unmask the slot, set the result as true\n\t\t\t\tthis.unmaskSlot(i);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\t//return the result\n\t\treturn result;\n\t}",
"public void keyPress(String s)\n\t\t{\n\t\t\tif(s.equals(\"w\"))\n\t\t\t{\n\t\t\t\tjoe.translate(0,-8);\n\t\t\t}\n\t\t\tif(s.equals(\"a\"))\n\t\t\t{\n\t\t\t\tjoe.translate(-8,0);\n\t\t\t}\n\t\t\tif(s.equals(\"s\"))\n\t\t\t{\n\t\t\t\tjoe.translate(0,8);\n\t\t\t}\n\t\t\tif(s.equals(\"d\"))\n\t\t\t{\n\t\t\t\tjoe.translate(8,0);\n\t\t\t}\n\t\t\t\n\t\t\tif(s.equals(\"wa\"))\n\t\t\t{\n\t\t\t\tjoe.translate(0,-8);\n\t\t\t\tjoe.translate(-8,0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tchar done = (char)10;\n\t\t\tString temp = Character.toString(done);\n\t\t\t\n\t\t}",
"public static char[] insertPlugs(String alphabets){\n\n Scanner scan = new Scanner(System.in);\n String insertedPlugs = scan.nextLine().toUpperCase().replaceAll(\"\\\\s+\",\"\"); //read input\n int plugSize = insertedPlugs.length();\n int alphabetsSize = alphabets.length();\n\n boolean validitySize;\n boolean validityString = false;\n boolean[] validityCharacter = new boolean[20];\n\n boolean validity = false;\n\n //check user input validity\n while(!validity) {\n\n //check if user entered input of correct size\n validitySize = false; //set to default, change to true later in test.\n while(!validitySize){\n\n //check if the size is even and no more than 20\n if((plugSize % 2 == 0) && plugSize <= 20){\n\n System.out.println(\"\");\n System.out.println(plugSize + \" plugs provided.\");\n validitySize = true;\n System.out.println(\"\");\n\n } else {\n\n System.out.println(\"\");\n System.out.println(\"Input invalid, wrong number of characters. Please enter again.\");\n insertedPlugs = scan.nextLine().toUpperCase(); // reset input\n plugSize = insertedPlugs.length(); // reset size\n\n }\n\n }\n\n //check if the input are all alphabets\n while (!validityString) {\n\n //set all characters valid as default, test later\n\n for(int i = 0; i < 20; i++){\n\n validityCharacter[i] = true;\n\n }\n\n //check if characters in input match to any alphabet.\n for (int i = 0; i < plugSize; i++) {\n\n validityCharacter[i] = false; // default, change later.\n\n for (int j = 0; j < alphabetsSize; j++) {\n\n\n if (insertedPlugs.charAt(i) == (alphabets.charAt(j))) {\n\n validityCharacter[i] = true;\n\n }\n\n }\n\n if (validityCharacter[i]) {\n\n System.out.println(insertedPlugs.charAt(i) + \" is a valid character.\");\n\n } else {\n\n System.out.println(insertedPlugs.charAt(i) + \" is an invalid character.\");\n\n }\n\n }\n\n //assess matching results\n\n validityString = true; //set as default. If false, change to false later\n for (int i = 0; i < plugSize; i++) {\n\n if (!validityCharacter[i]) {\n\n validityString = false;\n validitySize = false;\n System.out.println(\"\");\n System.out.println(\"Input invalid, invalid characters. Please enter again.\");\n insertedPlugs = scan.nextLine().toUpperCase(); // reset input\n plugSize = insertedPlugs.length(); // reset size\n\n break;\n\n }\n\n }\n\n if(!validityString){\n\n break;\n\n }\n\n }\n\n //check if the input is valid (all alphabets, even, <=20)\n if (validitySize && validityString) {\n\n validity = true;\n System.out.println(\"\");\n System.out.println(\"Letters \" + insertedPlugs + \" are plugged as pairs.\");\n System.out.println(\"\");\n\n }\n\n }\n\n //casting\n char[] plugboard = insertedPlugs.toCharArray();\n\n //feedback\n System.out.println(\"Plugboard settings: \" + java.util.Arrays.toString(plugboard));\n System.out.println(\"\");\n return plugboard;\n\n }",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\n\t}",
"@Override\n\t\t\tpublic void handle(KeyEvent e) {\n\t\t\t\tif(e.getCode().isLetterKey()) {\n\t\t\t\t\t\n\t\t\t\t\t//The input is converted to a char variable and a boolean is created and set to false,\n\t\t\t\t\t//in preparation for later in this method.\n\t\t\t\t\tchar letter = e.getText().charAt(0);\n\t\t\t\t\tboolean same = false;\n\t\t\t\t\t\n\t\t\t\t\tfor(int i = 0; i < currentGuesses.length; i++) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//If the letter that the user input is the same as the letter found\n\t\t\t\t\t\t//in the currentGuesses char array, the same boolean variable is set\n\t\t\t\t\t\t//to true and we break out of the loop.\n\t\t\t\t\t\tif(letter==currentGuesses[i]) {\n\t\t\t\t\t\t\tsame = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//Otherwise, if we reached a point in the array that has a value of\n\t\t\t\t\t\t//0, instead of a letter, we replace that 0 with the letter that the\n\t\t\t\t\t\t//user just input and break out of the loop, because we know everything\n\t\t\t\t\t\t//past this point are also blanks and don't want to replace them too.\n\t\t\t\t\t\t}else if(currentGuesses[i]==0) {\n\t\t\t\t\t\t\tcurrentGuesses[i] = letter;\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\t\n\t\t\t\t\t//If the letter isn't the same as one already guessed, this if statement happens.\n\t\t\t\t\tif(!same) {\n\t\t\t\t\t\t//A message is sent to the server, including the codename for the server to use\n\t\t\t\t\t\t//and the letter that the user input.\n\t\t\t\t\t\tout.println(\"LetterGuess \" + letter);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//A String array is created in preparation for the loop that happens \n\t\t\t\t\t\t//immediately afterwards.\n\t\t\t\t\t\tString[] receive = new String[3];\n\t\t\t\t\t\n\t\t\t\t\t\twhile(receive[0] == null) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t//When the server responds, the String is split into the array, separating \n\t\t\t\t\t\t\t\t//one word from the next by looking for a space.\n\t\t\t\t\t\t\t\treceive = in.readLine().split(\" \");\n\t\t\t\t\t\t\t}catch(IOException ioe) {\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\t\n\t\t\t\t\t\t//The boolean success is set to the second element of the received String that is converted\n\t\t\t\t\t\t//to a boolean. The same is done with the third element and is saved to the finished boolean\n\t\t\t\t\t\t//that exists in the class scope.\n\t\t\t\t\t\tboolean success = Boolean.parseBoolean(receive[1]);\n\t\t\t\t\t\tfinished = Boolean.parseBoolean(receive[2]);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Success only needs to exist within this method as it is used here to determine how\n\t\t\t\t\t\t//the statusMessageLabel should be updated.\n\t\t\t\t\t\tif(success) {\n\t\t\t\t\t\t\t//If the player made a successful guess, the status message is set accordingly.\n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There is a '\" + letter + \"' in the word!\");\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t//However, if the player made an unsuccessful guess, the message is set differently,\n\t\t\t\t\t\t\t//the amount of remaining guesses the player has decrements and the drawnPieces\n\t\t\t\t\t\t\t//variable goes up by an amount determined by maths, thanks to the different difficulty\n\t\t\t\t\t\t\t//settings. Assuming easy difficulty, drawnPieces goes up by 1. Medium difficulty\n\t\t\t\t\t\t\t//makes it go up by 1.4 and hard difficulty makes it go up by 2.333. \n\t\t\t\t\t\t\tstatusMessageLabel = new Label(\"There was no '\" + letter + \"' in the word.\");\n\t\t\t\t\t\t\tremainingGuesses--;\n\t\t\t\t\t\t\tdrawnPieces += (7.0/difficultyGuesses);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//The currentWord label is now set to the value of the first element of the \n\t\t\t\t\t\t//String array.\n\t\t\t\t\t\tcurrentWordLabel = new Label(receive[0]);\n\t\t\t\t\t\t\n\t\t\t\t\t//If the letter is the same as one already guessed, we go here instead\n\t\t\t\t\t}else {\n\t\t\t\t\t\t//Inform the user that they already tried their letter\n\t\t\t\t\t\tstatusMessageLabel = new Label(\"The letter '\" + letter + \"' has already been used\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//The currentGuesses label is updated with the new values of the player's guessed letters.\n\t\t\t\t\t//It is converted from a char array to a String, so that it can be used for the label.\n\t\t\t\t\t//The attemptsRemaining label is also updated, as the value of the remainingGuesses int\n\t\t\t\t\t//may have changed, if the player guessed incorrectly. \n\t\t\t\t\tcurrentGuessesLabel = new Label(new String(currentGuesses));\n\t\t\t\t\tattemptsRemainingLabel = new Label(\"Attempts remaining: \" + remainingGuesses);\n\n\t\t\t\t\t//Since the labels have been updated, the finalLine HBox needs to be updated with the\n\t\t\t\t\t//new labels. \n\t\t\t\t\tfinalLine = new HBox(5,currentGuessesLabel,eh,attemptsRemainingLabel);\n\t\t\t\t\tHBox.setHgrow(eh,Priority.ALWAYS);\n\t\t\t\t\tfinalLine.setAlignment(Pos.CENTER_LEFT);\n\t\t\t\t\t\n\t\t\t\t\t//And since the HBox has been updated, so too does the VBox need to be updated.\n\t\t\t\t\tmassiveSpacing = new VBox(5,group,statusMessageLabel,currentWordLabel,finalLine);\n\t\t\t\t\tmassiveSpacing.setAlignment(Pos.CENTER);\n\t\t\t\t\t\n\t\t\t\t\t//And also, the second group. \n\t\t\t\t\tnewGroup = new Group(massiveSpacing,hangTheMan(Math.toIntExact(Math.round(drawnPieces))));\n\t\t\t\t\tscene = new Scene(newGroup,300,300,Color.LIGHTGREY);\n\t\t\t\t\tstage.setScene(scene);\n\t\t\t\t\t\n\t\t\t\t\t//This method call could be seen as recursive, as it adds the very event listener\n\t\t\t\t\t//that we're inside now to the stage once again.\n\t\t\t\t\tkeyRel(stage);\n\t\t\t\t\t\n\t\t\t\t\t//If the remaining guesses left for the player is 0, then it's game over for them.\n\t\t\t\t\t//The appropriate method is called.\n\t\t\t\t\tif(remainingGuesses==0) {\n\t\t\t\t\t\tgameOver(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Finished will be true if the word has been successfully completed. \n\t\t\t\t\tif(finished) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The completeTime long variable is the difference in values from the current time\n\t\t\t\t\t\t//in milliseconds and the value of epoch, which was the current time in milliseconds\n\t\t\t\t\t\t//when the game started.\n\t\t\t\t\t\tcompleteTime = (System.currentTimeMillis() - epoch);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//In case the player had already played a game before, the values of count and\n\t\t\t\t\t\t//the inputName char array are set to a default value. \n\t\t\t\t\t\tcount = 0;\n\t\t\t\t\t\tinputName[0] = '_';\n\t\t\t\t\t\tinputName[1] = '_';\n\t\t\t\t\t\tinputName[2] = '_';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//The appropriate method is called to progress on from the game.\n\t\t\t\t\t\tgameVictory(stage);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//However, if the player did not click on a letter key and it was instead the escape button,\n\t\t\t\t//this if statement is used instead\n\t\t\t\t}else if(e.getCode()==KeyCode.ESCAPE) {\n\t\t\t\t\t\n\t\t\t\t\t//An Alert window is made, asking the player whether they're sure they want to quit\n\t\t\t\t\tAlert alert = new Alert(AlertType.CONFIRMATION);\n\t\t\t\t\talert.setTitle(\"Quit game\");\n\t\t\t\t\talert.setHeaderText(null);\n\t\t\t\t\talert.setContentText(\"Are you sure you wish to quit the game?\\nYour progress will not be saved.\");\n\t\t\t\t\tOptional<ButtonType> result = alert.showAndWait();\n\t\t\t\t\t\n\t\t\t\t\tif(result.get() == ButtonType.OK) {\n\t\t\t\t\t\t//If the player clicks on the OK button, an attempt to close the socket is made\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tclient.close();\n\t\t\t\t\t\t}catch(IOException ioe) {\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//and the stage is closed, which also ends the client's side of the program.\n\t\t\t\t\t\tstage.close();\n\t\t\t\t\t}\t\n\t\t\t\t}\t\n\t\t\t}",
"private void challengeHandler() {\n String word = txtWord.getText().toString();\n String nextWord;\n if (word.length() >= 4 && dictionary.isWord(word)){\n endGame(true, word + \" is a valid word\");\n } else {\n nextWord = dictionary.getAnyWordStartingWith(word);\n if (nextWord != null){\n endGame(false, word + \" is a prefix of word \\\"\" + nextWord + \"\\\"\");\n } else {\n endGame(true, word + \" is not a prefix of any word\");\n }\n }\n }",
"public void run() {\n \t//reset the canvas for drawing\n\t\tcanvas.reset();\n \tint length = word.length();\n\t\t//generate mask string\n\t\tmask = \"\";\n\t\tfor (int i = 0; i < length; i++)\n\t\t{\n\t\t\tmask += '-';\n\t\t}\n\t\t//now enters the output\n\t\tprintln(\"Welcome to Hangman!\");\n\t\t//loop for game, gameOver() function returns game status\n\t\twhile (!gameOver())\n\t\t{\n\t\t\tcanvas.displayWord(mask);\n\t\t\tprintln(\"The word now looks like this: \"+mask);\n\t\t\tprintln(\"You have \"+guess_number+\" guess(es) left.\");\n\t\t\t//ask for user input and check user input validity\n\t\t\tString input = \"\";\n\t\t\tchar key;\n\t\t\t//check user input and convert to character key\n\t\t\twhile (true) \n\t\t\t{\n\t\t\t\t//check empty input\n\t\t\t\tdo \n\t\t\t\t{\n\t\t\t\t\tinput = readLine(\"Your guess: \");\n\t\t\t\t}\n\t\t\t\twhile (input.isEmpty());\n\t\t\t\tinput = input.toUpperCase();\n\t\t\t\tkey = input.charAt(0);\n\t\t\t\tif (input.length() == 1 && Character.isLetter(key))\n\t\t\t\t\tbreak;\n\t\t\t\tprintln(\"Illegal guess. Please retry.\");\n\t\t\t}\n\t\t\t//checkKey() function compares the input key and string word\n\t\t\t//and update the mask string, and return true or false\n\t\t\tif (checkKey(key))\n\t\t\t{\n\t\t\t\tprintln(\"That guess is correct.\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//guess wrong, add letter and hang man\n\t\t\t\tcanvas.noteIncorrectGuess(key);\n\t\t\t\tprintln(\"There are no \"+key+\"\\'s in the word.\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t//game is over, display end message\n\t\tif (win)\n\t\t{\n\t\t\t//display word on canvas\n\t\t\tcanvas.displayWord(word);\n\t\t\tprintln(\"You guessed the word: \"+word);\n\t\t\tprintln(\"You win.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprintln(\"You're completely hung.\");\n\t\t\t//check whether want to play again\n\t\t\tString playAgain = readLine(\"Play again? (Y/N) \");\n\t\t\tif (playAgain.compareTo(\"Y\")==0 || playAgain.compareTo(\"y\")==0)\n\t\t\t{\n\t\t\t\t//reset the game\n\t\t\t\tguess_number = GUESSES;\n\t\t\t\tthis.run();\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\n\t\t\t\tcanvas.displayWord(word);\n\t\t\t\tprintln(\"The word was: \"+word);\n\t\t\t\tprintln(\"You lose.\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static String modifyGuess(char inChar, String word, String starredWord) {\n\t\tString starWord = starredWord;\n\t\t\n\t\tfor(int i = 0; i < word.length(); i++) {\n\t\t\tif(word.charAt(i) == inChar) {\n\t\t\t\tstarWord = starWord.substring(0,i) + word.charAt(i) + starWord.substring(i+1,starWord.length());\n\t\t\t\t//System.out.println(starWord.substring(i,starWord.length()-1));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(starWord);\n\t\treturn starWord;\n\t}",
"public static void main(String args[])\n {\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n StringBuilder sb = new StringBuilder(str);\n int len = sb.length();\n StringBuilder temp = new StringBuilder(\"\");\n for(int id = 0;id<=len-1;id++)\n {\n if((str.charAt(id)!='a')&&(str.charAt(id)!='e')&&(str.charAt(id)!='i')&&(str.charAt(id)!='o')&&(str.charAt(id)!='u')||(str.charAt(id)==' '))\n {\n temp.append(str.charAt(id));\n }\n }\n System.out.println(temp);\n \n\n }",
"public char askForLetter() {\n\t\tchar guessLetter;\n\t\tboolean validInput = false;\n\t\twhile (validInput == false) {\n\t\t\tSystem.out.println(\"Enter a letter: \");\n\t\t\tString guessLine = keyboard.nextLine();\n\t\t\tif (guessLine.length() == 0 || guessLine.length() >= 2) {\n\t\t\t\tSystem.out.println(\"Please insert a valid input\");\n\t\t\t\tSystem.out.println(\"\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tguessLine = guessLine.toLowerCase();\n\t\t\t\tguessLetter = guessLine.charAt(0);\n\t\t\t\tif(guessLetter >= 'a' && guessLetter <= 'z') {\n\t\t\t\t\tSystem.out.println(\"You entered: \" + guessLetter);\n\t\t\t\t\tvalidInput = true;\n\t\t\t\t\treturn(guessLetter);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Please insert a valid input\");\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn(' ');\n\t\t\n\t\t\n\t}",
"public void noteIncorrectGuess(char letter) {\n\t\taddToWrongLetters(letter);\n\t\tdisplayWrongLetters();\n\t\taddNextBodyPart(wrongLetters.length());\n\t\t\n\t}",
"public void noteIncorrectGuess(char letter) {\n\t\tguesses += letter;\n\t\tguessesLabel.setLabel(guesses);\n\t\tguessesLabel.setLocation((getWidth() - guessesLabel.getWidth()) / 2, wordLabel.getY() + wordLabel.getHeight()\n\t\t\t\t+ WORD_SPACING);\n\t\tif (guesses.length() == 1)\n\t\t\tbody.add(buildHead());\n\t\tif (guesses.length() == 2)\n\t\t\tbody.add(buildTorso());\n\t\tif (guesses.length() == 3)\n\t\t\tbody.add(buildLeftArm());\n\t\tif (guesses.length() == 4)\n\t\t\tbody.add(buildRightArm());\n\t\tif (guesses.length() == 5)\n\t\t\tbody.add(buildLeftLeg());\n\t\tif (guesses.length() == 6)\n\t\t\tbody.add(buildRightLeg());\n\t\tif (guesses.length() == 7)\n\t\t\tbody.add(buildLeftFoot());\n\t\tif (guesses.length() == 8)\n\t\t\tbody.add(buildRightFoot());\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n\n\n\n\n FileReader fileReader = null;\n try {\n // 파일 생성 부분 추가 필요 20151222\n // 파일 생성(R/W) 및 초기 데이터 추가한다.\n // 한글좀 그만 꺠져라..\n // 아좀..\n // 다시 테스트\n // 다시..\n fileReader = new FileReader(\"D:/wordList.txt\");\n } catch (FileNotFoundException e1) {\n // TODO Auto-generated catch block\n System.out.println(\"파일을 찾을 수 없습니다.\");\n System.exit(-1);\n }\n\n BufferedReader bufferedReader = null;\n bufferedReader = new BufferedReader(fileReader);\n\n StringBuffer stringBuffer = null;\n String line = null;\n\n ArrayList<String> wordList = new ArrayList<String>();\n\n try {\n while((line = bufferedReader.readLine()) != null) {\n stringBuffer = new StringBuffer();\n\n stringBuffer.append(line);\n\n wordList.add(stringBuffer.toString());\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n System.out.println(\"파일을 읽는 중 오류가 발생하였습니다.\");\n System.exit(-1);\n }\n\n\n Random random = new Random();\n int randomIndex = random.nextInt(wordList.size());\n String temp = wordList.get(randomIndex);\n\n\n char[] randomChar = temp.toCharArray();\n char[] encChar = new char[randomChar.length];\n\n\n System.out.println(String.valueOf(randomChar));\n\n for(int i = 0; i < randomChar.length; i++) {\n encChar[i] = '*';\n }\n\n System.out.println(String.valueOf(encChar));\n\n\n Career_2015 cc = new Career_2015();\n Scanner in = new Scanner(System.in);\n\n char inputChar = 0;\n boolean isContain = false;\n boolean isExists = false;\n int ascii = 0;\n int errorCount = 0;\n\n\n Map<Character, Boolean> inputCharMap = new HashMap<Character, Boolean>();\n Map<Character, ArrayList<Integer>> changeCharMap = new HashMap<Character, ArrayList<Integer>>();\n\n do {\n System.out.print(\"알파벳 소문자를 입력하세요. : \");\n\n try {\n inputChar = (char)cc.read();\n ascii = (int)inputChar;\n\n\n\n // 입력한 문자가 이미 입력한 문자인지 체크\n if(inputCharMap.containsKey(inputChar)) {\n System.out.println(\"입력했던 문자입니다. 다시 입력해주세요.\");\n isContain = true;\n } else inputCharMap.put(inputChar, true);\n\n // 입력한 글자가 선택한 단어에 포함되는지 체크\n changeCharMap = cc.isChangeChar(randomChar, inputChar);\n if(!changeCharMap.isEmpty()) {\n cc.changeChar(encChar, changeCharMap, inputChar);\n\n System.out.println(String.valueOf(encChar));\n\n if(String.valueOf(randomChar).equals(String.valueOf(encChar))) {\n System.out.println(\"모두 맞히셨습니다. 종료합니다.\");\n System.exit(-1);\n }\n } else {\n errorCount++;\n System.out.println(errorCount + \"번 틀리셨습니다.\");\n }\n\n\n\n\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n } while((ascii < 97 || ascii > 122) || isContain || errorCount < 7);\n\n System.out.println(\"종료\");\n }",
"public void checkOneLetterOff(String queueHead)\n\t{\n\t\tfor(int i =0; i<allWords.size(); i++)\n\t\t{\n\t\t\tString currentWrd = allWords.get(i);\n\t\t\t\n\t\t\t//compares length and if greater than one skips the wordaddWords();\n\t\t\tif(currentWrd.length() == queueHead.length() )\n\t\t\t{\n\t\t\t//looks at length of word and compares chars\n\t\t\t\tnumDiffLetters = 0;\n\t\t\t\tfor(int k =0; k<currentWrd.length(); k++)\n\t\t\t\t{\n\t\t\t\t\t//checks if characters match\n\t\t\t\t\tchar x = queueHead.charAt(k);\n\t\t\t\t\tchar y = currentWrd.charAt(k);\n\t\t\t\t\t//System.out.print(x + \" \" + y + \"\\n\");\n\t\t\t\t\tif(x != y && numDiffLetters <2)\n\t\t\t\t\t{\n\t\t\t\t\t\tnumDiffLetters++;\n\t\t\t\t\t\t//System.out.println(numDiffLetters);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//adds all words one letter diff to queueHead to temp array and removes them from all words to avoid going back\n\t\t\t\tif(numDiffLetters == 1)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\ttmp4.add(currentWrd);\n\t\t\t\t\tif( allWords.contains(currentWrd))\n\t\t\t\t\t{\n\t\t\t\t\t\tallWords.remove(currentWrd);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"void correctKeyPress();",
"public void noteIncorrectGuess(char letter) {\n\t\tupdateIncorrectList(letter);\n\t\tswitch (incorrectGuess.length()) {\n\t\t\tcase 1: \n\t\t\t\tdrawHead();\n\t\t\t\tbreak;\n\t\t\tcase 2: \n\t\t\t\tdrawBody();\n\t\t\t\tbreak;\t\n\t\t\tcase 3: \n\t\t\t\tdrawLeftArm();\n\t\t\t\tbreak;\t\n\t\t\tcase 4: \n\t\t\t\tdrawRightArm();\n\t\t\t\tbreak;\t\n\t\t\tcase 5: \n\t\t\t\tdrawLeftLeg();\n\t\t\t\tbreak;\t\n\t\t\tcase 6: \n\t\t\t\tdrawRightLeg();\n\t\t\t\tbreak;\t\n\t\t\tcase 7: \n\t\t\t\tdrawLeftFoot();\n\t\t\t\tbreak;\t\n\t\t\tcase 8: \n\t\t\t\tdrawRightFoot();\n\t\t\t\tbreak;\t\n\t\t\tdefault: throw new ErrorException(\"getWord: Illegal index\");\n\t\t}\n\t}",
"Alphabet(String chars) {\n _charsString = chars;\n _chars = new char[chars.length()];\n for (int i = 0; i < _chars.length; i += 1) {\n if (alreadyAdded(chars.charAt(i))) {\n throw new EnigmaException(\"Alphabet cannot have duplicates.\");\n } else {\n _chars[i] = chars.charAt(i);\n }\n }\n }",
"@Override\n public boolean onKeyUp(int keyCode, KeyEvent event) {\n\n //if(afterCheck==false) {\n //get char pressed by user from keyboard\n char keyPressed = (char) event.getUnicodeChar();\n if(userTurn==true) {\n if (afterCheck == false) {\n //check whether character pressed is valid i.e between a to z\n if (Character.isLetter(keyPressed)) {\n currentWord = ghostT.getText().toString();\n currentWord += keyPressed;\n ghostT.setText(currentWord);\n\n status.setText(COMPUTER_TURN);\n //set Computer turn\n userTurn = false;\n // challenge.setEnabled(false);\n handler = new Handler();\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //Do something after 2seconds\n //invoke computerturn\n computerTurn();\n }\n }, 2000);\n //invoke computerturn\n //computerTurn();\n\n //check validity for user input\n /**if (dictionary.isWord(currentWord)) {\n status.setText(\"VALID WORD\");\n } else\n status.setText(\"INVALID WORD\");\n return true;\n **/\n return true;\n\n } else {\n Toast.makeText(this, \"Invalid INPUT\", Toast.LENGTH_SHORT).show();\n return super.onKeyUp(keyCode, event);\n }\n }\n }\n\n return false;\n }",
"private String readGuess() {\n\t\tString unsafeGuess = readLine(\"Your Guess: \").trim().toUpperCase();\n\t\tif (!unsafeGuess.matches(\"[a-zA-z]\") || unsafeGuess.length() != 1) {\n\t\t\tprintln(\"Please enter a single letter.\");\n\t\t\treturn readGuess();\n\t\t} else {\n\t\t\treturn unsafeGuess.toUpperCase();\n\t\t}\n\t}",
"public static String randLower(){\n int n = rand.nextInt(26)*2 + 1;\n return String.valueOf(KEYBOARD.charAt(n));\n }",
"CharacterTarget put(char[] symbols) throws PrintingException;",
"public void guessLetter(String letter) {\n \n if (this.word.contains(letter)) {\n if (!this.guessedLetters.contains(letter)) {\n this.guessedLetters += letter;\n } // if the letter has already been guessed, nothing happens\n }else {\n // it the word does not contains the guessed letter, number of faults increase\n if (!this.guessedLetters.contains(letter)) {\n this.guessedLetters += letter;\n this.numberOfFaults++;\n } \n }\n\n \n\n\n }",
"public static String reflect2(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(reverse(word));\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static void main(String args[]) {\n Scanner sc=new Scanner(System.in);\n String s =sc.nextLine();\n int key =sc.nextInt();\n int len =s.length();\n for(int i=0;i<len;i++)\n {\n char ch =s.charAt(i);\n if(ch == ' ')\n System.out.print(\" \");\n else{\n\t\t if(ch >= 65 && ch<= 90){\n\t\t ch = (char)(ch -65);\n\t\t\t ch = (char)((26+ch-key)%26);\n\t\t\t ch =(char)(ch +65);\n\t\t\t System.out.print(ch);\n\t\t }\n\t\t else{\n\t\t ch = (char)(ch -97);\n\t\t\t ch = (char)((26+ch-key)%26);\n\t\t\t ch =(char)(ch +97);\n\t\t\t System.out.print(ch);\n\t\t }\n\t\t \n }\n \n }\n }",
"public String encrypt(String word) {\n char[] encrypted = word.toCharArray();\n for (int i = 0; i < encrypted.length; i++){\n if (encrypted[i] == 'x' || encrypted[i] == 'y' || encrypted[i] == 'z'){\n encrypted[i] -= 23;\n } else {\n encrypted[i] += 3;\n }\n \n }\n String encryptedResult = new String(encrypted);\n return encryptedResult;\n }",
"private void resetGame() {\n \tcanvas.reset();\n \tguessesLeft = 8;\n \tcurrentWord = \"\";\n \t\n \tguesses = \"\";\n \tword = pickWord();\n \tlist = new boolean[word.length()];\n \t\n \tfor (int i = 0; i < word.length(); i++) {\n \t\tcurrentWord += \"-\";\n \t}\n }",
"public boolean guessChar (char c) throws IOException {\n if (lose || victory) return false;\n \t\n \tchar cLower = Character.toLowerCase(c);\n \tString wLower = _word.toLowerCase();\n \t\n int cIndex = wLower.indexOf(cLower);\t// Where is 'c'? \n if (cIndex == -1) { \t// No 'c' found ==> Wrong!\n this.lives--;\n this.attempts.add(cLower);\n \n lose = (lives <= 0) ? true : false; // Any chances left?\n \n return false;\n }\n else {\t\t// Correct\n \tfor (int i = 0; i < _word.length(); i++) {\n \t\tif ( wLower.charAt(i) == cLower ) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t}\n \n // Got the whole word?\n if(this.hint.indexOf(\"_\") == -1) {\n this.victory = true;\n }\n \n return true; // Valid play\n }\n\n \n }",
"@Test\n public void testWordGuessReset() {\n Word word = new Word(\"Llama\", 10);\n\n // And then completely guess it\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // But reset the guesses on the word\n word.resetGuesses();\n\n // All of the characters in the Guess array should be reset to '_'\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And I should be able to completely guess it again\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public String[][] findSuggestions(String w) {\n ArrayList<String> suggestions = new ArrayList<>();\n String word = w.toLowerCase();\n // parse through the word - changing one letter in the word\n for (int i = 0; i < word.length(); i++) {\n // go through each possible character difference\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n // get the character that will change in the word\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n \n // if the selected character is not the same as the character to change - avoids getting the same word as a suggestion\n if (c != word.charAt(i)) {\n // change the character in the word\n String check = word.substring(0, i) + c.toString() + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - adding one letter to the word\n for (int i = 0; i < word.length(); i++) {\n // if the loop is not on the last charcater\n if (i < word.length() - 1) {\n // check words with one character added between current element and next element\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word.substring(0, i) + c.toString() + ((i < word.length()) ? word.substring(i, word.length()) : \"\");\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n // if the loop is on the last character\n else {\n // check the words with one character added to the end of the word\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word + c;\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - removing one letter from the word\n for (int i = 0; i < word.length(); i++) {\n // remove the chracter at the selected index from the word\n String check = word.substring(0, i) + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n \n String[][] rtn = new String[suggestions.size()][1];\n for (int i = 0, n = suggestions.size(); i < n; i++) {\n rtn[i][0] = suggestions.get(i);\n }\n \n return rtn;\n }",
"public void userMessageInput() {\n //declaring and initializing new userScanner variable\n Scanner userScanner = new Scanner(System.in);\n //displayed message to the user with the updating replacedMovie variable\n System.out.println(\"You are guessing :\" + this.replacedMovie);\n //displaying message with total number of wrong trials (guessed letters) to the user ,\n // together with the wrong guessed letter/s.\n getAllWrongLetters(); // calls method to dispaly the whole list of wrong guessed letters.\n System.out.println(\"You have guessed \" + this.wrongLettersCount + \" wrong letter(s): \" + allWrongLetters);\n //displaying a message asking the user to enter a guessed letter\n System.out.println(\"Guess a Letter\");\n //storing the entered letter in userEnteredLetter variable\n this.setUserGuessedLetter(userScanner.next().charAt(0));\n\n //return userEnteredLetter; // returning userEnteredLetter variable\n\n }",
"public void getNewWord(JTextField textField, JTextField clue) {\n\t\ttextField.setText(\"\");\n\t\tclue.setText(\"\");\n\t for(Letter l : letters) l.setStatus(false);\n\t letters.clear();\n\t setWord();\n\t for(int i = 0; i < guessedLetter.length; i++)\n\t \tguessedLetter[i] = false;\n\t}",
"void decryptCode() {\n StringBuilder temp = new StringBuilder(\"\");\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // append char to temp if char at i is not a multiple of z\n if (!(i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) || i == 0)\n temp.append(this.getText().charAt(i));\n }\n\n this.setText(temp);\n\n \n // Step 2:\n\n // split phrase up into words\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if y1x3x4 is at the end of the word, remove it from word\n \n if (words.get(i).substring(words.get(i).length() - 3, words.get(i).length())\n .equals(this.getSecretKey().substring(3, 6)))\n words.set(i, words.get(i).substring(0, words.get(i).length() - 3));\n\n // if x1x2 is at the end of the word\n else {\n // remove x1x2 from end\n words.set(i, words.get(i).substring(0, words.get(i).length() - 2));\n \n // move last char to beginning\n words.set(i, words.get(i).charAt(words.get(i).length() - 1) + words.get(i).substring(0, words.get(i).length() - 1));\n }\n }\n\n temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n }",
"public void moveFromHandToEndOfWord() {\n\t\t//check letters in hand \n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to end of word\n\t\tword.addToEnd(temp);\n\t}",
"public void guessSentence() {\n System.out.println(\"Please guess a letter in the secret word.\");\n }",
"public String shiftKeyboard(String input){\n\t\tStringBuilder strBuilder = new StringBuilder();\n\t\tfor(int i = 0; i < input.length(); i++){\n\t\t\tint lowerLndex = lowerKeys.indexOf(input.charAt(i));\n\t\t\tint upperIndex = upperKeys.indexOf(input.charAt(i));\n\t\t\tif(lowerLndex > -1){\n\t\t\t\tstrBuilder.append(lowerKeys.charAt(lowerLndex - 1));\n\t\t\t}else if(upperIndex > -1){\n\t\t\t\tstrBuilder.append(upperKeys.charAt(upperIndex - 1));\n\t\t\t}else{\n\t\t\t\tstrBuilder.append(\" \");\n\t\t\t}\n\t\t}\n\t\treturn strBuilder.toString();\n\t}",
"String selectRandomSecretWord();",
"CharacterTarget put(char[] symbols, int from, int to) throws PrintingException;",
"public static void upperCaseFirstOfWord() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tString char_prev = \"\";\n\t\t\tString char_current = \"\";\n\t\t\tString key = \" ,.!?:\\\"\";\n\t\t\tresult.append(String.valueOf(str.charAt(0)).toUpperCase());\n\t\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\t\tchar_prev = String.valueOf(str.charAt(i - 1));\n\t\t\t\tchar_current = String.valueOf(str.charAt(i));\n\t\t\t\tif (key.contains(char_prev)) {\n\t\t\t\t\tchar_current = char_current.toUpperCase();//uppercase first letter each word\n\t\t\t\t}\n\t\t\t\tresult.append(char_current);\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi có chữ cái đầu viết hoa: \\n\" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit= scan.next().toString();\n\t\t}\n\t}",
"public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n String str = sc.nextLine();\n char temp;\n for(int i=0; i < str.length(); i++) {\n temp = str.charAt(i);\n \n if(temp>=65 && temp <= 96) {\n // 대문자를 소문자로 변형\n System.out.println((char)(temp+32) +\"\");\n } else if(temp >= 97 && temp <= 122) {\n // 소문자를 대문자로 변형\n System.out.println((char)(temp-32) + \"\");\n } else {\n // 숫자가 들어갔을 때는 그냥 출력\n System.out.println(temp +\"\");\n }\n }\n // 아스키 코드 65 = 'A' ~ 90 = 'Z'\n // 97 = 'a' ~ 122 = 'z'\n }",
"public void updateReplacedMovie(char userLetter) {\n String movieString = this.replacedMovie; // temp variable used to store last value of replacedMovie\n //loop until the end of the pickedMovie length to update\n // all the occurrence of the correct guessed letter entered by the user\n for (int i = 0; i < this.pickedMovie.length(); i++) {\n int replacedIndex = this.pickedMovie.indexOf(userLetter, i); // determine the index of the correct guessed letter\n if (replacedIndex != -1) { //guessed letter found in the pickedMovie\n movieString = movieString.substring(0, replacedIndex) + userLetter + movieString.substring(replacedIndex + 1, movieString.length());\n this.setReplacedMovie(movieString);//updating the replacedMovie variable with the new value\n }\n }\n }",
"public void printHangman() {\n if (incorrectGuesses == 1) {\n hangman[2][11] = '0';\n }\n if (incorrectGuesses == 2) {\n hangman[3][11] = '|';\n }\n if (incorrectGuesses == 3) {\n for (int i = 8; i < 11; i++) {\n hangman[4][i] = '-';\n }\n }\n if (incorrectGuesses == 4) {\n for (int i = 12; i < 15; i++) {\n hangman[4][i] = '-';\n }\n }\n if (incorrectGuesses == 5) {\n hangman[5][10] = '/';\n hangman[6][9] = '/';\n }\n if (incorrectGuesses == 6) {\n hangman[5][12] = '\\\\';\n hangman[6][13] = '\\\\';\n }\n if (incorrectGuesses == 7) {\n hangman[7][7] = '-';\n hangman[7][8] = '-';\n }\n if (incorrectGuesses == 8) {\n hangman[7][14] = '-';\n hangman[7][15] = '-';\n }\n for (char[] line : hangman) {\n for (char c : line) {\n System.out.print(c);\n }\n System.out.println(\"\");\n }\n }",
"private void tryGuess(char letter) {\n\t\tSystem.out.println(\"=============================\");\n\t\t// if the same guess has been done before, print corresponding information\n\t\tif (this.guessedLetters.contains(letter)){\n\t\t\tSystem.out.println(\"Letter already guessed, try another one.\");\n\t\t}else {\n\t\t\t// else, update the guessedLetters\n\t\t\tthis.guessedLetters.add(letter);\n\t\t\t// if the guess is correct\n\t\t\tif(this.word.takeGuess(letter)) {\n\t\t\t\t// print corresponding information\n\t\t\t\tSystem.out.println(\"Correct letter!\");\n\t\t\t}else {\n\t\t\t\t// else, add the letter to the wrongLetters list\n\t\t\t\tthis.wrongLetters.add(letter);\n\t\t\t\t// increase the count of wrong guesses\n\t\t\t\tthis.numOfWrongGuess ++;\n\t\t\t\t// print out the corresponding information\n\t\t\t\tSystem.out.println(\"Wrong letter, better luck next turn.\");\n\t\t\t}\n\t\t}\n\t}",
"private static StringBuffer changeCharacters(int position, StringBuffer password, int length, PDDocument document) {\r\n\t\tfor (int i = 0; i <= dictionary.length - 1; i++) {\r\n\t\t\tpassword.setCharAt(position, dictionary[i]);\r\n\t\t\t// if statements validating whether the password was found\r\n\t\t\tif (position == length - 1) {\r\n\t\t\t\tif (validation(password.toString(), document)) {\r\n\t\t\t\t\tthrow new BruteForceDecrypt.successInterrupter(password.toString());\r\n\t\t\t\t}\r\n\t\t\t\t// If password was not found algorithm will move to another\r\n\t\t\t\t// position\r\n\t\t\t} else {\r\n\t\t\t\tchangeCharacters(position + 1, password, length, document);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn password;\r\n\t}",
"public void updateGuessedWrongLetters(char inputLetter) {\n // variable to check if the guessed letter is entered before or not , if found in array inputLetters\n\n boolean isFound = false;\n int wrongLetters = this.getWrongLettersCount();//variable wrongLetters to keep updating wrong trials\n //loop in the array to check whether the new guessed letter is stored before.\n for (int i = 0; i <= wrongLetters; i++) {\n if (inputLetters[i] == inputLetter) {\n isFound = true;\n break; // break the loop id the new guessed letter found in the inputLe tters array\n }\n }\n\n if (!isFound) { //adding new guessed letter in inputLetters array\n inputLetters[wrongLetters] = inputLetter;\n wrongLetters++;\n this.setWrongLettersCount(wrongLetters); //updating the wrongLettersCount after counting the new wrong trial\n } else {\n //displaying message to warn the user in case he/she guessed wrong letter twice\n System.out.println(\"You have guessed \" + inputLetter + \" before try another letter!\");\n }\n\n }",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"public void checkWord(int largeTile) {\r\n String guess = \"\";\r\n int length = 0;\r\n// int score = 0;\r\n boolean correct = false; // flag for whether the word is valid\r\n\r\n // get word string based on which button was pressed\r\n switch(largeTile) {\r\n case 1:\r\n guess = tile1.toString();\r\n break;\r\n case 2:\r\n guess = tile2.toString();\r\n break;\r\n case 3:\r\n guess = tile3.toString();\r\n break;\r\n case 4:\r\n guess = tile4.toString();\r\n break;\r\n case 5:\r\n guess = tile5.toString();\r\n break;\r\n case 6:\r\n guess = tile6.toString();\r\n break;\r\n case 7:\r\n guess = tile7.toString();\r\n break;\r\n case 8:\r\n guess = tile8.toString();\r\n break;\r\n case 9:\r\n guess = tile9.toString();\r\n break;\r\n default:\r\n guess = \"\";\r\n }\r\n length = guess.length();\r\n\r\n // check if valid word\r\n if (length >= 3) { // check if the length of the word is >= 3\r\n if (dictionary.contains(guess.toLowerCase())) { // check if the dictionary contains the word\r\n correct = true; // true if found\r\n\r\n stringSubmitted[largeTile-1] = 1; // word has been submitted for this tile\r\n\r\n // set amount of points\r\n int bonus = 0;\r\n for (char c : guess.toCharArray()) {\r\n if (c == 'E' || c == 'A' || c == 'I' || c == 'O' || c == 'N' || c == 'R' || c == 'T' || c == 'L' || c == 'S') {\r\n bonus += 1;\r\n } else if (c == 'D' || c == 'G') {\r\n bonus += 2;\r\n } else if (c == 'B' || c == 'C' || c == 'M' || c == 'P') {\r\n bonus += 3;\r\n } else if (c == 'F' || c == 'H' || c == 'V' || c == 'W' || c == 'Y') {\r\n bonus += 4;\r\n } else if (c == 'K') {\r\n bonus += 5;\r\n } else if (c == 'J' || c == 'X') {\r\n bonus += 8;\r\n } else {\r\n bonus += 10;\r\n }\r\n }\r\n if (length == 9 && phase == 1) bonus += length; // bonus for 9 letter word during phase 1\r\n pointsScore += bonus; // calculate total score\r\n scoreBoard.setText(\"\"+pointsScore); // set scoreboard to total\r\n\r\n // save longest word information\r\n if (length > longestLength) {\r\n longestLength = length;\r\n longestWord = guess;\r\n longestWordScore = bonus;\r\n }\r\n\r\n // mark as submitted in tile tacker array\r\n submittedTracker[largeTile-1] = true;\r\n int done = 0;\r\n for (boolean b : submittedTracker) {\r\n if (b == true) done++;\r\n }\r\n// if (done == 9) {\r\n// timer.cancel();\r\n// gameOver();\r\n// }\r\n }\r\n } else {\r\n correct = false; // false if not found\r\n pointsScore -= 3; // penalize for submitting an incorrect word\r\n scoreBoard.setText(\"\"+pointsScore); // set scoreboard to total\r\n }\r\n\r\n // if word is in the dictionary\r\n if (correct) {\r\n mSoundPool.play(mSoundCorrect, mVolume, mVolume, 1, 0, 1f); // chime when correct\r\n adapter.add(guess); // add to list\r\n// Log.e(\"word\", String.valueOf(tile1));\r\n\r\n // set unused tiles to be blank\r\n for (int small = 0; small < 9; small++) { // go through entire list\r\n// Log.e(\"tile # \", Integer.toString(small));\r\n// Log.e(\"selected? \", allTilesInt[largeTile-1][small] == 0 ? \"no\" : \"yes\");\r\n if (allTilesInt[largeTile-1][small] == 0) { // if the tile was not selected\r\n buttonList[largeTile-1][small].setText(\"\"); // remove the letter from the button\r\n buttonList[largeTile-1][small].setClickable(false);\r\n }\r\n }\r\n\r\n // if word was not in the dictionary\r\n } else {\r\n mSoundPool.play(mSoundIncorrect, mVolume, mVolume, 1, 0, 1f); // quack when incorrect\r\n }\r\n }",
"abstract String makeAClue(String puzzleWord);",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"public static void main(String[] args) {\nString given=\"hello im jaiprashanth hw are you\";\nchar ch[]=given.toCharArray();\n\nfor(int i=0;i<ch.length;i++) {\n\tif(ch[i]==' ') {\n\tch[i+1]=(char)(ch[i+1]-32);\n\t}\nSystem.out.println(ch);\n}\n}",
"public boolean isWordFullyGuessed()\n {\n for(int i=0; i<showChar.length; i++)\n {\n if(!showChar[i]) return false;\n }\n\n return true;\n }",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"public static void main(String[] args) {\n Scanner key=new Scanner(System.in);\r\n while(key.hasNext())\r\n {\r\n String s=key.next();\r\n String c=\"\";\r\n for (int i = 0; i <s.length(); i++) {\r\n if((Character)s.charAt(i)=='1'|| (Character)s.charAt(i)=='0'|| (Character)s.charAt(i)=='-')\r\n {\r\n // c=c+c.concat(String.valueOf((Character)s.charAt(i)));\r\n System.out.print((Character)s.charAt(i));\r\n }\r\n else if((Character)s.charAt(i)=='A' || (Character)s.charAt(i)=='B' || (Character)s.charAt(i)=='C')\r\n {\r\n System.out.print(2);\r\n }\r\n else if((Character)s.charAt(i)=='D' || (Character)s.charAt(i)=='E' || (Character)s.charAt(i)=='F')\r\n {\r\n System.out.print(3);\r\n }\r\n else if((Character)s.charAt(i)=='G' || (Character)s.charAt(i)=='H' || (Character)s.charAt(i)=='I')\r\n {\r\n System.out.print(4);\r\n }\r\n else if((Character)s.charAt(i)=='J' || (Character)s.charAt(i)=='K' || (Character)s.charAt(i)=='L')\r\n {\r\n System.out.print(5);\r\n }\r\n else if((Character)s.charAt(i)=='M' || (Character)s.charAt(i)=='N' || (Character)s.charAt(i)=='O')\r\n {\r\n System.out.print(6);\r\n }\r\n else if((Character)s.charAt(i)=='P' || (Character)s.charAt(i)=='Q' || (Character)s.charAt(i)=='R' || (Character)s.charAt(i)=='S')\r\n {\r\n System.out.print(7);\r\n }\r\n else if((Character)s.charAt(i)=='T' || (Character)s.charAt(i)=='U' || (Character)s.charAt(i)=='V')\r\n {\r\n System.out.print(8);\r\n }\r\n else if((Character)s.charAt(i)=='W' || (Character)s.charAt(i)=='X' || (Character)s.charAt(i)=='Y'|| (Character)s.charAt(i)=='Z')\r\n {\r\n System.out.print(9);\r\n }\r\n }\r\n System.out.println();\r\n }\r\n }",
"private char playerGuess(){\r\n System.out.println(\"\\nEnter your guess: \");\r\n guess = input.next();\r\n if (guess.matches(\"[a-zA-z]*$\") && guess.length() == 1){\r\n if(guesses.contains(guess.charAt(0))){\r\n System.out.println(\"You already guessed this character!\");\r\n playerGuess();\r\n }\r\n return Character.toLowerCase(guess.charAt(0));\r\n } else {\r\n System.out.println(\"Invalid guess! Try again!\");\r\n playerGuess();\r\n }\r\n return Character.toLowerCase(guess.charAt(0));\r\n }",
"public void setUserGuessedLetter(char userGuessedLetter) {\n this.userGuessedLetter = userGuessedLetter;\n }",
"public char crypt(char letter){\n\n char l = conns[alphabet.indexOf(letter)];\n\n return l;\n }",
"public void rightGuess()\r\n\t{\r\n\t\tif(userWon())\r\n\t\t{\r\n\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"good job! you've correctly guessed the panel \\n would you like to guess again? if so enter yes, if you would like to add your tile to your code, reply no\\n\\n\");\r\n\t\tString answer = sc.next();\r\n\t\tif(answer.compareTo(\"yes\") == 0 || answer.compareTo(\"Yes\") == 0)\r\n\t\t{\r\n\t\t\tuserTurn(false);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(userRanPan.getValue() == -1)\r\n\t\t\t\tnewGame.getUserHand().addDash(false,userRanPan);\r\n\t\t\telse\r\n\t\t\t\tnewGame.getUserHand().addPanel(userRanPan,false);\r\n\r\n\t\t\tuserGuess.clear();\r\n\t\t\tslide(previousGuess,userRanPan);\r\n\r\n\t\t\tif(userWon() == false)\r\n\t\t\t\tcompTurn(false);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(PLAYER_WIN);\r\n\t\t\t\tSystem.exit(0);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//foo.repaint();\r\n\t}",
"private char getGuessLetter(Scanner sc) {\n\n\t\t// the array format of the input\n\t\tchar[] ch;\n\t\twhile (true) {\n\t\t\t// ask for the input\n\t\t\tSystem.out.println(\"Please enter one letter to guess:\");\n\t\t\tSystem.out.print(\">>>\");\n\t\t\t// reading the input\n\t\t\tString input = sc.nextLine();\n\t\t\tch = input.toCharArray();\n\t\t\t// if the input is a allowed letter\n\t\t\tif(ch.length == 1\n\t\t\t\t&&(dr.isAllowed(ch[0]) || Character.isUpperCase(ch[0]))) {\n\t\t\t\t// break the loop\n\t\t\t\tbreak;\n\t\t\t}else {\n\t\t\t\tSystem.out.println(\"Please enter an allowed letter.\");\n\t\t\t}\n\t\t}\n\t\t//return the lower-cased version of the letter\n\t\treturn Character.toLowerCase(ch[0]);\n\t}",
"public static void paintHangman() {\n if (count == 1) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"1 incorrect guess, 6 guesses left\");\n }\n if (count == 2) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" | |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"2 incorrect guesses, 5 guesses left\");\n }\n if (count == 3) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|\");\n System.out.println(\" | / |\");\n System.out.println(\" | / |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"3 incorrect guesses, 4 guesses left\");\n }\n if (count == 4) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"4 incorrect guesses, 3 guesses left\");\n }\n if (count == 5) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | /\");\n System.out.println(\" | /\");\n System.out.println(\" | _/\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"5 incorrect guesses, 2 guesses left\");\n }\n if (count == 6) {\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / 0 0 \\\\\");\n System.out.println(\" | | < ' |\");\n System.out.println(\" | | ~~ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"6 incorrect guesses, only 1 guess left!\");\n }\n if (count == 7) {\n System.out.println(\"GAME OVER!\");\n System.out.println(\"7 incorrect guesses\");\n System.out.println(\"Wrong guess, try again\");\n System.out.println(\" ______________\");\n System.out.println(\" | _|_\");\n System.out.println(\" | / X X \\\\\");\n System.out.println(\" | | < |\");\n System.out.println(\" | | __ |\");\n System.out.println(\" | \\\\_____/\");\n System.out.println(\" | |\");\n System.out.println(\" | __|__\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / | \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | / \\\\\");\n System.out.println(\" | _/ \\\\_\");\n System.out.println(\" |\");\n System.out.println(\" |\");\n System.out.println(\"____|____\");\n System.out.println(\"RIP \" + UserName.getUserName());\n System.out.println(\"GAME OVER! The word was \" + CategorySelector.word);\n }\n }",
"public static int Main()\n\t{\n\t\tString a = new String(new char[101]);\n\t\ta = new Scanner(System.in).nextLine();\n\t\tint la;\n\t\tla = a.length();\n\t\tfor (int i = 0;i < la;i++)\n\t\t{\n\t\t\tif (a.charAt(i) == ' ')\n\t\t\t{\n\t\t\t\tif (a.charAt(i + 1) == ' ')\n\t\t\t\t{\n\t\t\t\t\tfor (int j = i;j < la;j++)\n\t\t\t\t\t{\n\t\t\t\t\t\ta = tangible.StringFunctions.changeCharacter(a, j, a.charAt(j + 1));\n\t\t\t\t\t}\n\t\t\t\t\tla--;\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\tfor (int i = 0;i < la;i++)\n\t\t{\n\t\tSystem.out.print(a.charAt(i));\n\t\t}\n\t\treturn 0;\n\t}"
] | [
"0.6824335",
"0.6210697",
"0.5983233",
"0.59672445",
"0.58888924",
"0.5799273",
"0.57832605",
"0.57514507",
"0.57450825",
"0.57086086",
"0.5689798",
"0.5679198",
"0.5678284",
"0.5673795",
"0.56691206",
"0.56662613",
"0.5651838",
"0.5647577",
"0.5636132",
"0.56133056",
"0.56099313",
"0.56015164",
"0.55997205",
"0.55958134",
"0.5583032",
"0.55584294",
"0.55580896",
"0.5534408",
"0.55329406",
"0.55184937",
"0.550992",
"0.5502531",
"0.5500714",
"0.5487565",
"0.54646975",
"0.5460409",
"0.5459732",
"0.54523885",
"0.54342437",
"0.54197854",
"0.54175",
"0.54150975",
"0.54098916",
"0.54063076",
"0.5395908",
"0.53831625",
"0.5380925",
"0.5367721",
"0.5358975",
"0.5357992",
"0.53382164",
"0.53277373",
"0.5327104",
"0.53217536",
"0.530242",
"0.53015554",
"0.52884054",
"0.5280748",
"0.5278957",
"0.52768576",
"0.5272322",
"0.52628696",
"0.5262793",
"0.5246716",
"0.52441967",
"0.5243458",
"0.5243177",
"0.5242839",
"0.5237805",
"0.5220858",
"0.5218241",
"0.520356",
"0.5201154",
"0.5198645",
"0.51984495",
"0.5196569",
"0.51936555",
"0.5190162",
"0.5186005",
"0.51785475",
"0.517833",
"0.51646453",
"0.5161509",
"0.5160828",
"0.51581365",
"0.51550853",
"0.5154711",
"0.51528746",
"0.5150566",
"0.5149058",
"0.5141316",
"0.51410884",
"0.5136467",
"0.5132776",
"0.51322675",
"0.5122252",
"0.5115516",
"0.51086485",
"0.51086414",
"0.51025987"
] | 0.6460769 | 1 |
/ Deletes the first character in word and tests the result in guessPW(). Returns the new word | public static String delFirstChar(String word){
if(word.length() <= 1){
return word;
}
word = word.substring(1, word.length());
guessPW(word);
return word;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String delLastChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(0, word.length() - 1);\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"public static String reflect2(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(reverse(word));\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"String selectRandomSecretWord();",
"public void removeWord(String word) throws WordException;",
"public void removeWord()\n {\n \tlastRow = -1;\n \tlastColumn = -1;\n \t\n \tguess = \"\";\n \tguessWordArea.setText( \"\" );\n \t\n \t//Reset the letters that have been used for a word\n \tused = new boolean[BOARD_SIZE][BOARD_SIZE];\n \t//Change the background colour of all of the buttons in the grid\n \tfor( int i = 0; i < BOARD_SIZE; i++ )\n \t{\n \t\tfor( int j = 0; j < BOARD_SIZE; j++ )\n \t\t{\n \t\t\tgridButtons[i][j].setBackground( restart.getBackground() ); //The restart button will always have the default background\n \t\t}\n \t}\n }",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"public static String removeNonWord(String message)\r\n {\r\n int start = getLetterIndex(message, head); //get the fist index that contain English letter\r\n int end = getLetterIndex(message, tail); //get the last index that contain English letter\r\n if (start == end) // if only contain one letter\r\n return String.valueOf(message.charAt(start)); // return the letter\r\n return message.substring(start, end + 1); // return the content that contain English letter\r\n }",
"private String pickWord() {\n \thangmanWords = new HangmanLexicon();\n \tint randomWord = rgen.nextInt(0, (hangmanWords.getWordCount() - 1)); \n \tString pickedWord = hangmanWords.getWord(randomWord);\n \treturn pickedWord;\n }",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\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 static String modifyGuess(char inChar, String word, String starredWord) {\n\t\tString starWord = starredWord;\n\t\t\n\t\tfor(int i = 0; i < word.length(); i++) {\n\t\t\tif(word.charAt(i) == inChar) {\n\t\t\t\tstarWord = starWord.substring(0,i) + word.charAt(i) + starWord.substring(i+1,starWord.length());\n\t\t\t\t//System.out.println(starWord.substring(i,starWord.length()-1));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(starWord);\n\t\treturn starWord;\n\t}",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }",
"public static String reverse(String word){\n\t\tStringBuilder result = new StringBuilder();\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\n\t\tfor(int i = word.length() - 1; i >= 0; i--){\n\t\t\tresult.append(word.charAt(i));\n\t\t}\n\t\tguessPW(result.toString());\n\t\treturn result.toString();\n\t}",
"public static String mut4(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, word.length()-1);\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String mut2(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor(int i=0; i< chars.length; i++) {\n\t\t\ttemp = word + chars[i];\n\t\t\tif(pwMatch(temp, person, w)) \n\t\t\t\treturn temp;\n\t\t\telse if(isDouble)\n\t\t\t\treturn temp;\n\t\t}\n\t\treturn null;\n\t}",
"private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public void getNewWord(JTextField textField, JTextField clue) {\n\t\ttextField.setText(\"\");\n\t\tclue.setText(\"\");\n\t for(Letter l : letters) l.setStatus(false);\n\t letters.clear();\n\t setWord();\n\t for(int i = 0; i < guessedLetter.length; i++)\n\t \tguessedLetter[i] = false;\n\t}",
"public abstract String guessedWord();",
"public static String mut5(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String mut3(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"public String getCorrectionWord(String misspell);",
"public String getSecretWord() {\r\n \tint index = (int) (Math.random() * this.activeWords.size());\r\n return this.activeWords.get(index);\r\n }",
"public static String reducedWord(String word) {\n String lcWord = word.toLowerCase();\n String redVowels = convertVowels(lcWord);\n String noDuplicates = removeDuplicate(redVowels);\n return noDuplicates;\n }",
"public static String mut7(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tString temp2 = word +temp;\n\t\tif(pwMatch(temp2, person, w)) \n\t\t\treturn temp2;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\ttemp = temp+word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\n\t\treturn null;\n\t}",
"public static String removeDuplicate(String word) {\n StringBuffer sb = new StringBuffer();\n if(word.length() <= 1) {\n return word;\n }\n char current = word.charAt(0);\n sb.append(current);\n for(int i = 1; i < word.length(); i++) {\n char c = word.charAt(i);\n if(c != current) {\n sb.append(c);\n current = c;\n }\n }\n return sb.toString();\n }",
"public static String mut9(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toLowerCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public String getSecretWord() {\r\n \t//Return remaining word if only 1\r\n \tif (activeWords.size() == 1) {\r\n \t\treturn activeWords.get(0);\r\n \t//return random of remaining\r\n \t} else {\r\n \treturn activeWords.get((int)(Math.random()*activeWords.size()+1));\r\n \t}\r\n }",
"public static String mut10(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1).toUpperCase() + \"\" + word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private void reset(){\r\n lives = 6;\r\n playerWins = false;\r\n word = randWord();\r\n wordArray = word.toCharArray();\r\n hidden = hideTheWord(word.length());\r\n guesses.clear();\r\n }",
"public static void upperCaseFirstOfWord() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tString char_prev = \"\";\n\t\t\tString char_current = \"\";\n\t\t\tString key = \" ,.!?:\\\"\";\n\t\t\tresult.append(String.valueOf(str.charAt(0)).toUpperCase());\n\t\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\t\tchar_prev = String.valueOf(str.charAt(i - 1));\n\t\t\t\tchar_current = String.valueOf(str.charAt(i));\n\t\t\t\tif (key.contains(char_prev)) {\n\t\t\t\t\tchar_current = char_current.toUpperCase();//uppercase first letter each word\n\t\t\t\t}\n\t\t\t\tresult.append(char_current);\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi có chữ cái đầu viết hoa: \\n\" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit= scan.next().toString();\n\t\t}\n\t}",
"@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }",
"public void setHangmanWord()\n {\n if(word == null || word == \"\") return;\n\n String hangmanWord = \"\";\n for(int i=0; i<word.length(); i++)\n {\n if(showChar[i])\n hangmanWord += word.substring(i, i+1)+\" \";\n else\n hangmanWord += \"_ \";\n }\n\n wordTextField.setText(hangmanWord.substring(0, hangmanWord.length()-1));\n }",
"public void setWord(String newWord)\n\t{\n\t\tword = newWord;\n\t}",
"public static String mut11(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1) + \"\" + word.substring(1, word.length()).toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private static String removeWord(String string, String word) {\n\t\tif (string.contains(word)) {\n\t\t\tstring = string.replaceAll(word, \"\");\n\t\t}\n\n\t\t// Return the resultant string\n\t\treturn string;\n\t}",
"private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}",
"@Test\n public void testWordGuessReset() {\n Word word = new Word(\"Llama\", 10);\n\n // And then completely guess it\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // But reset the guesses on the word\n word.resetGuesses();\n\n // All of the characters in the Guess array should be reset to '_'\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And I should be able to completely guess it again\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public static String getWord(){\n\t\t\n\t\tSystem.out.println(\"--------- Welcome to Hangman ---------\");\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a word:\");\n\t return input.nextLine();\n\t}",
"public String hiddenWord() {\n int hiddenWordUnderscores = 0;\n String hiddenWord = \"\";\n StringBuilder newHiddenWord = new StringBuilder(\"\");\n \n for (int i = 0; i < this.word.length(); i++) {\n hiddenWord += \"_\";\n newHiddenWord.append(\"_\");\n }\n \n // GO THROUGH EACH CHARACTER IN THIS.WORD AND SEE IF IT MATCHES THE GUESS. \n // IF IT DOES, REPLACE THE UNDERSCORE AT THAT INDEX WITH THE GUESSED LETTER.\n for (int i = 0; i < this.word.length(); i++) {\n char currentChar = this.word.charAt(i);\n String currentLetter = \"\" + currentChar;\n \n // IF THE CURRENT LETTER IS IN THE WORD\n if (this.guessedLetters.contains(currentLetter)) {\n // GET THE CURRENT UNDERSCORE OF THE INDEX WE ARE IN, SET IT TO currentChar\n newHiddenWord.setCharAt(i, currentChar);\n }\n } \n hiddenWord = newHiddenWord.toString();\n\n return hiddenWord;\n \n }",
"public boolean takeGuess(char letter) {\n\t\t// reset default result as false\n\t\tboolean result = false;\n\t\t// iterate through the characters in the word\n\t\tfor (int i = 0; i < this.getLength(); i++) {\n\t\t\t// if the guess is correct\n\t\t\tif (this.theWord[i] == letter) {\n\t\t\t\t// unmask the slot, set the result as true\n\t\t\t\tthis.unmaskSlot(i);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\t//return the result\n\t\treturn result;\n\t}",
"private static String capitaliseSingleWord(String word) {\n String capitalisedFirstLetter = word.substring(0, 1).toUpperCase();\n String lowercaseRemaining = word.substring(1).toLowerCase();\n return capitalisedFirstLetter + lowercaseRemaining;\n }",
"public static String mut8(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public void removeWord () {\r\n int index = Components.wordList.getSelectedIndex ();\r\n if (index >= 0) {\r\n String word = (String) Components.wordList.getSelectedValue ();\r\n words.remove (word);\r\n Components.wordList.getContents ().remove (index);\r\n Components.wordList.setSelectedIndex ((index > 0) ? index - 1 : index);\r\n }\r\n }",
"public static String getWord(String sentence, char word) {\n\t\tString[] words;\n\t\twords = sentence.split(\" \");\n\t\tString cleanedWord=\"\";\n\t\t\n\t\tif(word=='f') {//return the first word\n\t\t\tString temp = words[0];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else {//return the last word\n\t\t\tString temp = words[words.length -1];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn cleanedWord;\n\t}",
"public static String mut6(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word + \"\" + word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private String getConvertedWord(String word) {\r\n\t\tString newWord = \"\";\r\n\t\tif(word == null || word.length() == 0)\r\n\t\t\tnewWord = \"\";\r\n\t\telse if(word.length() < 3)\r\n\t\t\tnewWord = word;\r\n\t\telse \r\n\t\t\tnewWord = \"\"+word.charAt(0) + (word.length() - 2) + word.charAt(word.length() - 1);\r\n\t\t\t\r\n\t\tif(DEBUG)\r\n\t\t\tSystem.out.printf(\"Converted %s to %s\\n\", word, newWord);\r\n\t\treturn newWord;\r\n\r\n\t}",
"public String newWord(String word) {\r\n\t\tthis.word = word;\r\n\t\twordLength = word.length();\r\n\t\ttries = word.length();\r\n\t\tunknownCharactersInWordState = word.length();\r\n\t\twordState = UNKNOWN.repeat(wordLength);\r\n\t\tstringBuilder = new StringBuilder(wordState);\r\n\t\tboolean lose = false;\r\n\t\treturn parseState(lose, false);\r\n\t}",
"public String getNewWord(){\n\t\tint randomWord = generator.nextInt(wordList.length);\n\t\tString temp = wordList[randomWord];\n\t\treturn temp;\n\t}",
"public String scramble(String word)\n {\n int i, j;\n String SwappedString = \"\";\n String first, middle, last;\n int wordLength = word.length();\n for (int k = 0; k < wordLength; k++)\n {\n i = generator.nextInt(wordLength-1);\n j = i+1 + generator.nextInt(wordLength-i-1);\n first = word.substring(0,i);\n middle = word.substring(i+1,j);\n if (j != wordLength)\n {\n last = word.substring(j+1);\n }\n else\n {\n last = \"\";\n }\n SwappedString = first + word.substring(j, j + 1) + middle + word.substring(i, i + 1) + last;\n word = SwappedString;\n }\n return SwappedString;\n }",
"public String normalize(String word);",
"String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}",
"void decryptCode() {\n StringBuilder temp = new StringBuilder(\"\");\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // append char to temp if char at i is not a multiple of z\n if (!(i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) || i == 0)\n temp.append(this.getText().charAt(i));\n }\n\n this.setText(temp);\n\n \n // Step 2:\n\n // split phrase up into words\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if y1x3x4 is at the end of the word, remove it from word\n \n if (words.get(i).substring(words.get(i).length() - 3, words.get(i).length())\n .equals(this.getSecretKey().substring(3, 6)))\n words.set(i, words.get(i).substring(0, words.get(i).length() - 3));\n\n // if x1x2 is at the end of the word\n else {\n // remove x1x2 from end\n words.set(i, words.get(i).substring(0, words.get(i).length() - 2));\n \n // move last char to beginning\n words.set(i, words.get(i).charAt(words.get(i).length() - 1) + words.get(i).substring(0, words.get(i).length() - 1));\n }\n }\n\n temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n }",
"public void chooseWord() {\n int length = words.size();\n int index = (int) ((length - 1) * Math.random());\n word = words.get(index);\n }",
"public static boolean append(String word){\n\t\tboolean x = false;\n\t\tboolean y = false;\n\t\tfor(int i = 33; i <= 126; i++){\n\t\t\tchar c = (char)i;\n\t\t\tx = guessPW(word.concat(Character.toString(c)));\n\t\t\ty = guessPW(Character.toString(c).concat(word));\n\t\t}\n\n\t\tif(x | y){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static String userInput()\r\n {\r\n Scanner link = new Scanner(System.in);\r\n String word = link.next();\r\n char[] chars = word.toCharArray();\r\n boolean checkWord = false; \r\n for(int i = 0; i < chars.length; i++)\r\n {\r\n char c = chars[i];\r\n if((c < 97 || c > 122))\r\n {\r\n checkWord = true;\r\n }\r\n }\r\n link.close();\r\n if(!checkWord)\r\n {\r\n return word;\r\n } \r\n else \r\n System.out.println(\"Not a valid input\");\r\n return null;\r\n }",
"private String doubleFinalConsonant(String word) {\n\t\tStringBuffer buffer = new StringBuffer(word);\n\t\tbuffer.append(buffer.charAt(buffer.length() - 1));\n\t\treturn buffer.toString();\n\t}",
"public static String secretWord(String s) {\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\ts = s.replace(s.charAt(i), '*');\r\n\t\t}\r\n\t\treturn s;\r\n\t}",
"private void computerTurn() {\n String text = txtWord.getText().toString();\n String nextWord;\n if (text.length() >= 4 && dictionary.isWord(text)){\n endGame(false, text + \" is a valid word\");\n return;\n } else {\n nextWord = dictionary.getGoodWordStartingWith(text);\n if (nextWord == null){\n endGame(false, text + \" is not a prefix of any word\");\n return;\n } else {\n addTextToGame(nextWord.charAt(text.length()));\n }\n }\n userTurn = true;\n txtLabel.setText(USER_TURN);\n }",
"public String getKeyWord(String word) {\n // COMPLETE THIS METHOD\n word = word.toLowerCase();\n while (word.length() > 0 && !(Character.isDigit(word.charAt(word.length() - 1))) && !(Character.isLetter(word.charAt(word.length() - 1)))) {\n char ch = word.charAt(word.length()-1);\n //if((isPunctuation(ch))){\n if (word.endsWith(\"!\") ||\n word.endsWith(\";\") ||\n word.endsWith(\":\") ||\n word.endsWith(\"?\") ||\n word.endsWith(\",\") ||\n word.endsWith(\".\")) {\n word = word.substring(0, word.length() - 1);\n } else {\n return null;\n }\n }\n\n for (int i = 0; i < word.length(); i++) {\n if (!(Character.isLetter(word.charAt(i)))) {\n return null;\n }\n }\n\n if (noiseWords.containsKey(word))\n return null;\n return word;\n\n }",
"public String getRandomWord() {\r\n Random rand = new Random();\r\n return possibleWords[rand.nextInt(possibleWords.length)]; // Word from a random index\r\n }",
"public static String removePunctuation( String word )\n {\n while(word.length() > 0 && !Character.isAlphabetic(word.charAt(0)))\n {\n word = word.substring(1);\n }\n while(word.length() > 0 && !Character.isAlphabetic(word.charAt(word.length()-1)))\n {\n word = word.substring(0, word.length()-1);\n }\n \n return word;\n }",
"public boolean guessIsRight(String secretWord, char guess){\n\t\tboolean isCorrect = false;\n\t\tfor (int i=0; i<secretWord.length(); i++){\n\t\t\tchar secretLetter = secretWord.charAt(i);\n\t\t\tif (secretLetter == guess){\n\t\t\t\t isCorrect = true;\n\t\t\t}\n\t\t}\n\t\treturn isCorrect;\n\t}",
"public Builder clearWord() {\n bitField0_ = (bitField0_ & ~0x00000004);\n word_ = getDefaultInstance().getWord();\n onChanged();\n return this;\n }",
"private String validateWord (String word) {\r\n String chars = \"\";\r\n for (int i = 0; i < word.length (); ++i) {\r\n if (!Character.isLetter (word.charAt (i))) {\r\n chars += \"\\\"\" + word.charAt (i) + \"\\\" \";\r\n }\r\n }\r\n return chars;\r\n }",
"private static boolean letterDifferByOne(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n\n int differenceCount = 0;\n for (int i = 0; i < word1.length(); i++) {\n if (word1.charAt(i) != word2.charAt(i)) {\n differenceCount++;\n }\n }\n return (differenceCount == 1);\n }",
"java.lang.String getWord();",
"private String removePunctuation(String word) {\n\n StringBuffer sb = new StringBuffer(word);\n if (word.length() == 0) {\n return word;\n }\n for (String cs : COMMON_SUFFIX) {\n if (word.endsWith(\"'\" + cs) || word.endsWith(\"’\" + cs)) {\n sb.delete(sb.length() - cs.length() - 1, sb.length());\n break;\n }\n }\n if (sb.length() > 0) {\n int first = Character.getType(sb.charAt(0));\n int last = Character.getType(sb.charAt(sb.length() - 1));\n if (last != Character.LOWERCASE_LETTER\n && last != Character.UPPERCASE_LETTER) {\n sb.deleteCharAt(sb.length() - 1);\n }\n if (sb.length() > 0 && first != Character.LOWERCASE_LETTER\n && first != Character.UPPERCASE_LETTER) {\n sb.deleteCharAt(0);\n }\n }\n return sb.toString();\n }",
"private String processWord(String word){\r\n\t\tString lword = word.toLowerCase();\r\n\t\tfor (int i = 0;i<word.length();++i){\r\n\t\t\tstemmer.add(lword.charAt(i));\r\n\t\t}\r\n\t\tstemmer.stem();\r\n\t\treturn stemmer.toString();\r\n\t}",
"public static void main(String[] args) {\n Scanner input= new Scanner(System.in);\n System.out.println(\" Enter a string value: \");\n String word=input.nextLine();\n String newWord=word.charAt(0)+\"\";\n for (int i = 1; i <word.length() ; i++) {\n if(word.charAt(i)>=65 && word.charAt(i)<=90){\n newWord+=\" \"+word.charAt(i);\n }else{\n newWord+=word.charAt(i);\n }\n\n }\n System.out.println(newWord);\n }",
"public static String newWord(String strw) {\n String value = \"Encyclopedia\";\n for (int i = 1; i < value.length(); i++) {\n char letter = 1;\n if (i % 2 != 0) {\n letter = value.charAt(i);\n }\n System.out.print(letter);\n }\n return value;\n }",
"private String removeSpecialCharacters(String word)\n\t{\n\t\tString newString = \"\";\n\n\t\tfor (int i = 0; i < word.length(); i++)\n\t\t{\n\t\t\tif (word.charAt(i) != '?' && word.charAt(i) != '!' && word.charAt(i) != '\"' && word.charAt(i) != '\\''\n\t\t\t\t\t&& word.charAt(i) != '#' && word.charAt(i) != '(' && word.charAt(i) != ')' && word.charAt(i) != '$'\n\t\t\t\t\t&& word.charAt(i) != '%' && word.charAt(i) != ',' && word.charAt(i) != '&')\n\t\t\t{\n\t\t\t\tnewString += word.charAt(i);\n\t\t\t}\n\t\t}\n\n\t\treturn newString;\n\t}",
"public String scramble(String wordToScramble){\n\t\tString scrambled = \"\";\n\t\tint randomNumber;\n\n\t\tboolean letter[] = new boolean[wordToScramble.length()];\n\n\t\tdo {\n\t\t\trandomNumber = generator.nextInt(wordToScramble.length());\n\t\t\tif(letter[randomNumber] == false){\n\t\t\t\tscrambled += wordToScramble.charAt(randomNumber);\n\t\t\t\tletter[randomNumber] = true;\n\t\t\t}\n\t\t} while(scrambled.length() < wordToScramble.length());\n\n\t\tif(scrambled.equals(wordToScramble))\n\t\t\tscramble(word);\n\n\t\treturn scrambled;\n\t}",
"@Test\n public void testWordGuessArray() {\n\n // If I make a new word\n Word word = new Word(\"Llama\", 10);\n\n // The guess array should be initialized to all '_' characters\n // but be of the same length as the number of letters in the word\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess the letter L (uppercase)\n // it should return true, because 'Llama' contains 2 Ls.\n Assert.assertTrue(word.guessLetter('L'));\n\n // It should update the 'guess' character array\n // to have all L's revealed regardless of casing\n // all other letters should stay hidden as '_'\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess an M, it should also be true\n Assert.assertTrue(word.guessLetter('M'));\n\n // and now the m should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And finally an A\n Assert.assertTrue(word.guessLetter('A'));\n\n // The whole word should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // If I guess a bunch of other letters, they should all return false\n // because the word has already been completed, and revealed\n Assert.assertFalse(word.guessLetter('l'));\n Assert.assertFalse(word.guessLetter('m'));\n Assert.assertFalse(word.guessLetter('a'));\n Assert.assertFalse(word.guessLetter('c'));\n Assert.assertFalse(word.guessLetter('v'));\n Assert.assertFalse(word.guessLetter('b'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"private void challengeHandler() {\n String word = txtWord.getText().toString();\n String nextWord;\n if (word.length() >= 4 && dictionary.isWord(word)){\n endGame(true, word + \" is a valid word\");\n } else {\n nextWord = dictionary.getAnyWordStartingWith(word);\n if (nextWord != null){\n endGame(false, word + \" is a prefix of word \\\"\" + nextWord + \"\\\"\");\n } else {\n endGame(true, word + \" is not a prefix of any word\");\n }\n }\n }",
"public String getGuessString() {\n\t\tStringBuilder sb = new StringBuilder(wordToGuess);\n\t\tfor (int i = 0; i < wordToGuess.length(); i++) {\n\t\t\tchar letter = wordToGuess.charAt(i);\n\t\t\tif (!guessesMade.contains(letter)) {\n\t\t\t\tsb.setCharAt(i, '-');\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static String mut12(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tchar [] temp = word.toCharArray();\n\t\tString t = \"\";\n\t\tString build = \"\";\n\t\tfor(int i =0; i<word.length(); i++) {\n\t\t\tif(i%2 == 0) {\n\t\t\t\tt = \"\" + temp[i];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[i];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\tbuild = \"\";\n\t\tfor(int j =0; j<word.length(); j++) {\n\t\t\tif(j%2 != 0) {\n\t\t\t\tt = \"\" + temp[j];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[j];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\treturn null;\n\t}",
"public char getUserGuess(){\n char letter = '\\u0000';\n if(mGuessEditText.getText().toString().toLowerCase().length() != 0)\n letter = mGuessEditText.getText().toString().toLowerCase().charAt(0);\n return letter;\n }",
"public boolean isDeActivationString(String word);",
"public boolean isOneLetterOff(String word1, String word2){\n \tif(word1.equals(word2)){ //all letters same\n \t\treturn false;\n \t}\n \tif(word1.substring(1).equals(word2.substring(1))){\t//all letters same except 1st\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,1).equals(word2.substring(0, 1)) && word1.substring(2).equals(word2.substring(2))){ //all letters same except 2nd\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,2).equals(word2.substring(0,2)) && word1.substring(3).equals(word2.substring(3))){\t//all letters same except 3rd\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,3).equals(word2.substring(0,3)) && word1.substring(4).equals(word2.substring(4))){\t//all letters same except 4th\n\t\t\treturn true;\n\t\t}\n\t\tif(word1.substring(0,4).equals(word2.substring(0,4))){\t//all letters same except 5th\n\t\t\treturn true;\n\t\t}\n \treturn false;\n }",
"public NormalSwear(String word) {\n this.word = word;\n }",
"public static String NormalizeText(String Word) {\n String EditText = Word.replaceAll(\"[^a-zA-Z]\", \"\");\r\n String Capstext = EditText.toUpperCase();\r\n System.out.println(Capstext);\r\n return Capstext;\r\n }",
"public static void magicWord(){\n\t\tmagic_str = words.getMagicWord().toLowerCase();\n\t\tmagic_len = magic_str.length();\n\t\tmagic = new char[magic_len];\n\n\t\t// Iterates through word and stores in char magic[]\n\t\tfor(int i = 0; i < magic_len; i++){\n\t\t\tmagic[i] = magic_str.charAt(i);\n\t\t}\n\n\t}",
"public String chooseWord(){\n\t\tRandom a = new Random();\t\t\r\n\t\t\r\n\t\tint randomNumber = a.nextInt(words.length);\r\n\t\t\r\n\t\tString gameWord = words[randomNumber];\r\n\t\t\r\n\t\treturn gameWord;\r\n\t\t\t\t\r\n\t}",
"public void removeWord(int id);",
"public void guessSentence() {\n System.out.println(\"Please guess a letter in the secret word.\");\n }",
"public static String stemNSW(String word)\n\t{\n\t\treturn isNSW(getRoot(word.toLowerCase()));\n\t}",
"private String firstWord(String userMessage) {\n if (userMessage.contains(\" \"))\n return userMessage.substring(0, userMessage.indexOf(\" \"));\n return userMessage;\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 static String removeJunk(String str){\n StringBuilder strnew = new StringBuilder(str);\n for(int i=0;i<strnew.length();i++){\n if(!Character.isLetter(strnew.charAt(i)))\n strnew.delete(i, i+1);\n }\n return strnew.toString();\n }",
"private String generateRandomWord()\n {\t\n\tRandom randomNb = new Random(System.currentTimeMillis());\n\tchar [] word = new char[randomNb.nextInt(3)+5];\n\tfor(int i=0; i<word.length; i++)\n\t word[i] = letters[randomNb.nextInt(letters.length)];\n\treturn new String(word);\n }",
"private Set<String> deletionHelper(String word) {\n\t\tSet<String> deletionWords = new HashSet<String>();\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tdeletionWords.add(word.substring(0, i) + word.substring(i + 1));\n\t\t}\n\t\treturn deletionWords;\n\t}",
"public static String reflect1(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tresult.append(reverse(word)).toString();\n\t\treturn result.toString();\n\t}",
"private String readGuess() {\n\t\tString unsafeGuess = readLine(\"Your Guess: \").trim().toUpperCase();\n\t\tif (!unsafeGuess.matches(\"[a-zA-z]\") || unsafeGuess.length() != 1) {\n\t\t\tprintln(\"Please enter a single letter.\");\n\t\t\treturn readGuess();\n\t\t} else {\n\t\t\treturn unsafeGuess.toUpperCase();\n\t\t}\n\t}"
] | [
"0.72212875",
"0.65626174",
"0.6464278",
"0.63688433",
"0.6300771",
"0.62900305",
"0.6244599",
"0.61733013",
"0.61244226",
"0.60963297",
"0.60962033",
"0.6088682",
"0.6074344",
"0.60507613",
"0.60506386",
"0.59964114",
"0.5984284",
"0.59615046",
"0.59606946",
"0.58880407",
"0.5872965",
"0.5870489",
"0.5837027",
"0.58287144",
"0.5826311",
"0.58258915",
"0.5793343",
"0.579026",
"0.5790144",
"0.57691336",
"0.57529634",
"0.5750552",
"0.5712776",
"0.5708891",
"0.57027274",
"0.5679454",
"0.56596047",
"0.5655614",
"0.5653944",
"0.5647584",
"0.56463015",
"0.56456566",
"0.5631501",
"0.5629021",
"0.5612421",
"0.5603742",
"0.5599298",
"0.5591787",
"0.55901283",
"0.55899954",
"0.558897",
"0.5584429",
"0.5576133",
"0.55615747",
"0.55235225",
"0.5519908",
"0.5484068",
"0.5469721",
"0.54659104",
"0.5461103",
"0.54532295",
"0.5449051",
"0.54471856",
"0.5437403",
"0.5423072",
"0.54171324",
"0.54135036",
"0.5403433",
"0.53906345",
"0.5387561",
"0.5386139",
"0.5385956",
"0.5384138",
"0.53685486",
"0.536224",
"0.53614575",
"0.53610617",
"0.5355046",
"0.5342571",
"0.53340447",
"0.53250307",
"0.53216064",
"0.5312427",
"0.53049386",
"0.53042096",
"0.52727073",
"0.52708817",
"0.52571285",
"0.5254321",
"0.5254175",
"0.5253023",
"0.52494615",
"0.52459013",
"0.52431643",
"0.5238339",
"0.5225677",
"0.52161497",
"0.5192859",
"0.51912296",
"0.5188947"
] | 0.784102 | 0 |
/ Deletes the last character in word and tests the result in guessPW(). Returns the new word | public static String delLastChar(String word){
if(word.length() <= 1){
return word;
}
word = word.substring(0, word.length() - 1);
guessPW(word);
return word;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(1, word.length());\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"public static String reverse(String word){\n\t\tStringBuilder result = new StringBuilder();\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\n\t\tfor(int i = word.length() - 1; i >= 0; i--){\n\t\t\tresult.append(word.charAt(i));\n\t\t}\n\t\tguessPW(result.toString());\n\t\treturn result.toString();\n\t}",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"public static String reflect2(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(reverse(word));\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"private String pickWord() {\n \thangmanWords = new HangmanLexicon();\n \tint randomWord = rgen.nextInt(0, (hangmanWords.getWordCount() - 1)); \n \tString pickedWord = hangmanWords.getWord(randomWord);\n \treturn pickedWord;\n }",
"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 }",
"String selectRandomSecretWord();",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\n\t}",
"public abstract String guessedWord();",
"public static String modifyGuess(char inChar, String word, String starredWord) {\n\t\tString starWord = starredWord;\n\t\t\n\t\tfor(int i = 0; i < word.length(); i++) {\n\t\t\tif(word.charAt(i) == inChar) {\n\t\t\t\tstarWord = starWord.substring(0,i) + word.charAt(i) + starWord.substring(i+1,starWord.length());\n\t\t\t\t//System.out.println(starWord.substring(i,starWord.length()-1));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(starWord);\n\t\treturn starWord;\n\t}",
"public boolean guessIsRight(String secretWord, char guess){\n\t\tboolean isCorrect = false;\n\t\tfor (int i=0; i<secretWord.length(); i++){\n\t\t\tchar secretLetter = secretWord.charAt(i);\n\t\t\tif (secretLetter == guess){\n\t\t\t\t isCorrect = true;\n\t\t\t}\n\t\t}\n\t\treturn isCorrect;\n\t}",
"private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"private String getConvertedWord(String word) {\r\n\t\tString newWord = \"\";\r\n\t\tif(word == null || word.length() == 0)\r\n\t\t\tnewWord = \"\";\r\n\t\telse if(word.length() < 3)\r\n\t\t\tnewWord = word;\r\n\t\telse \r\n\t\t\tnewWord = \"\"+word.charAt(0) + (word.length() - 2) + word.charAt(word.length() - 1);\r\n\t\t\t\r\n\t\tif(DEBUG)\r\n\t\t\tSystem.out.printf(\"Converted %s to %s\\n\", word, newWord);\r\n\t\treturn newWord;\r\n\r\n\t}",
"public void removeWord()\n {\n \tlastRow = -1;\n \tlastColumn = -1;\n \t\n \tguess = \"\";\n \tguessWordArea.setText( \"\" );\n \t\n \t//Reset the letters that have been used for a word\n \tused = new boolean[BOARD_SIZE][BOARD_SIZE];\n \t//Change the background colour of all of the buttons in the grid\n \tfor( int i = 0; i < BOARD_SIZE; i++ )\n \t{\n \t\tfor( int j = 0; j < BOARD_SIZE; j++ )\n \t\t{\n \t\t\tgridButtons[i][j].setBackground( restart.getBackground() ); //The restart button will always have the default background\n \t\t}\n \t}\n }",
"public String getSecretWord() {\r\n \tint index = (int) (Math.random() * this.activeWords.size());\r\n return this.activeWords.get(index);\r\n }",
"public String removeLastWord(String text) {\n return text.substring(0, text.lastIndexOf(\" \"));\n }",
"public void removeWord(String word) throws WordException;",
"public static boolean append(String word){\n\t\tboolean x = false;\n\t\tboolean y = false;\n\t\tfor(int i = 33; i <= 126; i++){\n\t\t\tchar c = (char)i;\n\t\t\tx = guessPW(word.concat(Character.toString(c)));\n\t\t\ty = guessPW(Character.toString(c).concat(word));\n\t\t}\n\n\t\tif(x | y){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static String mut4(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, word.length()-1);\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String removeNonWord(String message)\r\n {\r\n int start = getLetterIndex(message, head); //get the fist index that contain English letter\r\n int end = getLetterIndex(message, tail); //get the last index that contain English letter\r\n if (start == end) // if only contain one letter\r\n return String.valueOf(message.charAt(start)); // return the letter\r\n return message.substring(start, end + 1); // return the content that contain English letter\r\n }",
"public void getNewWord(JTextField textField, JTextField clue) {\n\t\ttextField.setText(\"\");\n\t\tclue.setText(\"\");\n\t for(Letter l : letters) l.setStatus(false);\n\t letters.clear();\n\t setWord();\n\t for(int i = 0; i < guessedLetter.length; i++)\n\t \tguessedLetter[i] = false;\n\t}",
"public String getSecretWord() {\r\n \t//Return remaining word if only 1\r\n \tif (activeWords.size() == 1) {\r\n \t\treturn activeWords.get(0);\r\n \t//return random of remaining\r\n \t} else {\r\n \treturn activeWords.get((int)(Math.random()*activeWords.size()+1));\r\n \t}\r\n }",
"public static String mut7(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tString temp2 = word +temp;\n\t\tif(pwMatch(temp2, person, w)) \n\t\t\treturn temp2;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\ttemp = temp+word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\n\t\treturn null;\n\t}",
"public void setHangmanWord()\n {\n if(word == null || word == \"\") return;\n\n String hangmanWord = \"\";\n for(int i=0; i<word.length(); i++)\n {\n if(showChar[i])\n hangmanWord += word.substring(i, i+1)+\" \";\n else\n hangmanWord += \"_ \";\n }\n\n wordTextField.setText(hangmanWord.substring(0, hangmanWord.length()-1));\n }",
"public String hiddenWord() {\n int hiddenWordUnderscores = 0;\n String hiddenWord = \"\";\n StringBuilder newHiddenWord = new StringBuilder(\"\");\n \n for (int i = 0; i < this.word.length(); i++) {\n hiddenWord += \"_\";\n newHiddenWord.append(\"_\");\n }\n \n // GO THROUGH EACH CHARACTER IN THIS.WORD AND SEE IF IT MATCHES THE GUESS. \n // IF IT DOES, REPLACE THE UNDERSCORE AT THAT INDEX WITH THE GUESSED LETTER.\n for (int i = 0; i < this.word.length(); i++) {\n char currentChar = this.word.charAt(i);\n String currentLetter = \"\" + currentChar;\n \n // IF THE CURRENT LETTER IS IN THE WORD\n if (this.guessedLetters.contains(currentLetter)) {\n // GET THE CURRENT UNDERSCORE OF THE INDEX WE ARE IN, SET IT TO currentChar\n newHiddenWord.setCharAt(i, currentChar);\n }\n } \n hiddenWord = newHiddenWord.toString();\n\n return hiddenWord;\n \n }",
"public static String mut5(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private String doubleFinalConsonant(String word) {\n\t\tStringBuffer buffer = new StringBuffer(word);\n\t\tbuffer.append(buffer.charAt(buffer.length() - 1));\n\t\treturn buffer.toString();\n\t}",
"public synchronized void setLastWord(String lastWord) {\n\t\tthis.lastWord = lastWord;\n\t}",
"public String getCorrectionWord(String misspell);",
"public static String mut3(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String mut2(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor(int i=0; i< chars.length; i++) {\n\t\t\ttemp = word + chars[i];\n\t\t\tif(pwMatch(temp, person, w)) \n\t\t\t\treturn temp;\n\t\t\telse if(isDouble)\n\t\t\t\treturn temp;\n\t\t}\n\t\treturn null;\n\t}",
"public String getGuessString() {\n\t\tStringBuilder sb = new StringBuilder(wordToGuess);\n\t\tfor (int i = 0; i < wordToGuess.length(); i++) {\n\t\t\tchar letter = wordToGuess.charAt(i);\n\t\t\tif (!guessesMade.contains(letter)) {\n\t\t\t\tsb.setCharAt(i, '-');\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public synchronized String getLastWord() {\n\t\treturn lastWord;\n\t}",
"public String getNewWord(){\n\t\tint randomWord = generator.nextInt(wordList.length);\n\t\tString temp = wordList[randomWord];\n\t\treturn temp;\n\t}",
"public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }",
"public void setWord(String newWord)\n\t{\n\t\tword = newWord;\n\t}",
"public static String getWord(){\n\t\t\n\t\tSystem.out.println(\"--------- Welcome to Hangman ---------\");\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a word:\");\n\t return input.nextLine();\n\t}",
"private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}",
"public static String mut9(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toLowerCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"public static String mut8(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n Scanner scan=new Scanner(System.in);\n System.out.println(\"Enter the word:\");\n String word= scan.next();\n\n char lastChar=word.charAt(word.length()-1);\n System.out.println(lastChar);\n\n\n }",
"public String newWord(String word) {\r\n\t\tthis.word = word;\r\n\t\twordLength = word.length();\r\n\t\ttries = word.length();\r\n\t\tunknownCharactersInWordState = word.length();\r\n\t\twordState = UNKNOWN.repeat(wordLength);\r\n\t\tstringBuilder = new StringBuilder(wordState);\r\n\t\tboolean lose = false;\r\n\t\treturn parseState(lose, false);\r\n\t}",
"public static String getWord(String sentence, char word) {\n\t\tString[] words;\n\t\twords = sentence.split(\" \");\n\t\tString cleanedWord=\"\";\n\t\t\n\t\tif(word=='f') {//return the first word\n\t\t\tString temp = words[0];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else {//return the last word\n\t\t\tString temp = words[words.length -1];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn cleanedWord;\n\t}",
"public static String mut6(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word + \"\" + word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public void moveFromHandToEndOfWord() {\n\t\t//check letters in hand \n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to end of word\n\t\tword.addToEnd(temp);\n\t}",
"public static String mut10(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1).toUpperCase() + \"\" + word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"void decryptCode() {\n StringBuilder temp = new StringBuilder(\"\");\n\n // go through entire phrase\n for (int i = 0; i < this.getText().length(); ++i) {\n\n // append char to temp if char at i is not a multiple of z\n if (!(i % Character.getNumericValue(this.secretKey.charAt(7)) == 0) || i == 0)\n temp.append(this.getText().charAt(i));\n }\n\n this.setText(temp);\n\n \n // Step 2:\n\n // split phrase up into words\n ArrayList<String> words = new ArrayList<>(Arrays.asList(this.text.toString().split(\" \")));\n\n for (int i = 0; i < words.size(); ++i) {\n\n // if y1x3x4 is at the end of the word, remove it from word\n \n if (words.get(i).substring(words.get(i).length() - 3, words.get(i).length())\n .equals(this.getSecretKey().substring(3, 6)))\n words.set(i, words.get(i).substring(0, words.get(i).length() - 3));\n\n // if x1x2 is at the end of the word\n else {\n // remove x1x2 from end\n words.set(i, words.get(i).substring(0, words.get(i).length() - 2));\n \n // move last char to beginning\n words.set(i, words.get(i).charAt(words.get(i).length() - 1) + words.get(i).substring(0, words.get(i).length() - 1));\n }\n }\n\n temp = new StringBuilder(\"\");\n\n for (String word : words)\n temp.append(word + \" \");\n\n this.setText(temp);\n }",
"public void removeWord () {\r\n int index = Components.wordList.getSelectedIndex ();\r\n if (index >= 0) {\r\n String word = (String) Components.wordList.getSelectedValue ();\r\n words.remove (word);\r\n Components.wordList.getContents ().remove (index);\r\n Components.wordList.setSelectedIndex ((index > 0) ? index - 1 : index);\r\n }\r\n }",
"@Test\n public void testWordGuessReset() {\n Word word = new Word(\"Llama\", 10);\n\n // And then completely guess it\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // But reset the guesses on the word\n word.resetGuesses();\n\n // All of the characters in the Guess array should be reset to '_'\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And I should be able to completely guess it again\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public void GuessFullWordEvent() {\n\t\t\n\t\tString finalGuess = AnswerBox.getText();\n\t\tfinalGuess = finalGuess.toLowerCase(); // the answer is not case sensitive\n\n\t\t//if the final guess is the correct word or not\n\t\tif(finalGuess.equals(mysteryWord))\n\t\t\tGameWin();\n\t\telse\n\t\t\tGameOver();\n\t}",
"public boolean takeGuess(char letter) {\n\t\t// reset default result as false\n\t\tboolean result = false;\n\t\t// iterate through the characters in the word\n\t\tfor (int i = 0; i < this.getLength(); i++) {\n\t\t\t// if the guess is correct\n\t\t\tif (this.theWord[i] == letter) {\n\t\t\t\t// unmask the slot, set the result as true\n\t\t\t\tthis.unmaskSlot(i);\n\t\t\t\tresult = true;\n\t\t\t}\n\t\t}\n\t\t//return the result\n\t\treturn result;\n\t}",
"@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }",
"public String getRandomWord() {\r\n Random rand = new Random();\r\n return possibleWords[rand.nextInt(possibleWords.length)]; // Word from a random index\r\n }",
"private void reset(){\r\n lives = 6;\r\n playerWins = false;\r\n word = randWord();\r\n wordArray = word.toCharArray();\r\n hidden = hideTheWord(word.length());\r\n guesses.clear();\r\n }",
"public String getKeyWord(String word) {\n // COMPLETE THIS METHOD\n word = word.toLowerCase();\n while (word.length() > 0 && !(Character.isDigit(word.charAt(word.length() - 1))) && !(Character.isLetter(word.charAt(word.length() - 1)))) {\n char ch = word.charAt(word.length()-1);\n //if((isPunctuation(ch))){\n if (word.endsWith(\"!\") ||\n word.endsWith(\";\") ||\n word.endsWith(\":\") ||\n word.endsWith(\"?\") ||\n word.endsWith(\",\") ||\n word.endsWith(\".\")) {\n word = word.substring(0, word.length() - 1);\n } else {\n return null;\n }\n }\n\n for (int i = 0; i < word.length(); i++) {\n if (!(Character.isLetter(word.charAt(i)))) {\n return null;\n }\n }\n\n if (noiseWords.containsKey(word))\n return null;\n return word;\n\n }",
"public static String reducedWord(String word) {\n String lcWord = word.toLowerCase();\n String redVowels = convertVowels(lcWord);\n String noDuplicates = removeDuplicate(redVowels);\n return noDuplicates;\n }",
"public static String removeDuplicate(String word) {\n StringBuffer sb = new StringBuffer();\n if(word.length() <= 1) {\n return word;\n }\n char current = word.charAt(0);\n sb.append(current);\n for(int i = 1; i < word.length(); i++) {\n char c = word.charAt(i);\n if(c != current) {\n sb.append(c);\n current = c;\n }\n }\n return sb.toString();\n }",
"private static void reverseWord(String word) {\n // StringBuild.reverse()\n System.out.println(new StringBuilder(word).reverse().toString());\n\n // Add char one by one iteration method\n StringBuilder reversed = new StringBuilder();\n char[] chars = word.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n reversed.append(chars[chars.length - i - 1]);\n }\n System.out.println(reversed.toString());\n }",
"private String removePunctuation(String word) {\n\n StringBuffer sb = new StringBuffer(word);\n if (word.length() == 0) {\n return word;\n }\n for (String cs : COMMON_SUFFIX) {\n if (word.endsWith(\"'\" + cs) || word.endsWith(\"’\" + cs)) {\n sb.delete(sb.length() - cs.length() - 1, sb.length());\n break;\n }\n }\n if (sb.length() > 0) {\n int first = Character.getType(sb.charAt(0));\n int last = Character.getType(sb.charAt(sb.length() - 1));\n if (last != Character.LOWERCASE_LETTER\n && last != Character.UPPERCASE_LETTER) {\n sb.deleteCharAt(sb.length() - 1);\n }\n if (sb.length() > 0 && first != Character.LOWERCASE_LETTER\n && first != Character.UPPERCASE_LETTER) {\n sb.deleteCharAt(0);\n }\n }\n return sb.toString();\n }",
"public MyHangmanGame(String secretWord, int numGuesses, String LetterHistory){\n OriginSecretWord = secretWord;\n GuessRemainingNum = numGuesses;\n LetterLeftNum = secretWord.length();\n for(int i = 0; i < secretWord.length(); i++)\n {\n CurrentState += \"_ \";\n for(int j = i; j > 0; j--)\n {\n if(secretWord.charAt(i) == secretWord.charAt(j-1))\n {\n LetterLeftNum--;//If the letter appears many times in the secret word, it will be counted just once.\n break;\n }\n }\n }\n LetterGuessHistory = LetterHistory;\n }",
"public void deleteLastWord(TextView englishText,\n TextView morseText) {\n if (sentenceArray.size() > 0) {\n sentenceArray.remove(sentenceArray.size() - 1);\n morseCodeArray.remove(morseCodeArray.size() - 1);\n }\n if (sentenceArray.size() > 0) {\n englishText.setText(Helpers.concatenateList(sentenceArray));\n morseText.setText(Helpers.concatenateList(morseCodeArray));\n } else {\n englishText.setText(\"\");\n morseText.setText(\"\");\n }\n }",
"public static String mut11(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1) + \"\" + word.substring(1, word.length()).toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private String validateWord (String word) {\r\n String chars = \"\";\r\n for (int i = 0; i < word.length (); ++i) {\r\n if (!Character.isLetter (word.charAt (i))) {\r\n chars += \"\\\"\" + word.charAt (i) + \"\\\" \";\r\n }\r\n }\r\n return chars;\r\n }",
"public static void main(String[] args) {\n String word = \"Computer\";\r\n System.out.println(word.length());\r\nSystem.out.println(word.charAt(0));\r\nSystem.out.println(word.charAt(1));\r\nSystem.out.println(word.charAt(2));\r\nSystem.out.println(word.charAt(3));\r\nSystem.out.println(word.charAt(4));\r\nSystem.out.println(word.charAt(5));\r\nSystem.out.println(word.charAt(6));\r\nSystem.out.println(word.charAt(7));\r\n\r\n//\r\n\r\nString word2 = \"Java\";\r\n if(word2.charAt(0) == 'J');{\r\nSystem.out.println(\"J is first character\");\r\n} \r\n \r\n String word3 = \"civic\";\r\n char first = word3.charAt(0); // index always zero\r\n char last = word.charAt(4); \r\n\r\nif (first == last) {\r\n\tSystem.out.println(\"FIrst and last match\");\r\n} else {\r\n\tSystem.out.println(\" not match\");\r\n}\r\n// always print the last character no matter the length\r\n\r\nString word4 = \"abcdefghijklmnopqrstuvwxyz\";\r\n\r\nchar lastChar = word4.charAt(word4.length()-1);\r\n\r\nSystem.out.println(\"last character of the word \" + word4 + \" is \" + lastChar);\r\n\r\n\r\n\r\n\r\n\r\n\r\n\t}",
"public static String newWord(String strw) {\n String value = \"Encyclopedia\";\n for (int i = 1; i < value.length(); i++) {\n char letter = 1;\n if (i % 2 != 0) {\n letter = value.charAt(i);\n }\n System.out.print(letter);\n }\n return value;\n }",
"public static void main(String[] args) {\n Scanner input= new Scanner(System.in);\n System.out.println(\" Enter a string value: \");\n String word=input.nextLine();\n String newWord=word.charAt(0)+\"\";\n for (int i = 1; i <word.length() ; i++) {\n if(word.charAt(i)>=65 && word.charAt(i)<=90){\n newWord+=\" \"+word.charAt(i);\n }else{\n newWord+=word.charAt(i);\n }\n\n }\n System.out.println(newWord);\n }",
"public static boolean differByOne(String word, String ladderLast) {\n if (word.length() != ladderLast.length()) {\n return false;\n }\n int count = 0;\n for (int i = 0; i < word.length(); i++) {\n if (word.charAt(i) != ladderLast.charAt(i)) {\n count++;\n }\n }\n return (count == 1);\n }",
"int lengthLastWord(String input) {\n int len = input.length();\n int lastLen = 0;\n int pastLen = 0;\n for (int index = 0;index < len;index++) {\n lastLen ++;\n if(input.charAt(index) == ' ') {\n pastLen = lastLen;\n lastLen = 0;\n \n }\n }\n \n return pastLen;\n \n}",
"public static String secretWord(String s) {\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\ts = s.replace(s.charAt(i), '*');\r\n\t\t}\r\n\t\treturn s;\r\n\t}",
"private static int lengthOfLastWord(String s) {\n int count = 0;\n char[] arr = s.trim().toCharArray();\n\n for (int i = arr.length - 1; i >= 0; i--) {\n if (arr[i] == ' ') { break; }\n count++;\n }\n return count;\n }",
"public void chooseWord() {\n int length = words.size();\n int index = (int) ((length - 1) * Math.random());\n word = words.get(index);\n }",
"private void renewWordLevel4()\n {\n givenWord = availableWords.randomWordLevel4();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public static String stemNSW(String word)\n\t{\n\t\treturn isNSW(getRoot(word.toLowerCase()));\n\t}",
"public static void upperCaseFirstOfWord() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tString char_prev = \"\";\n\t\t\tString char_current = \"\";\n\t\t\tString key = \" ,.!?:\\\"\";\n\t\t\tresult.append(String.valueOf(str.charAt(0)).toUpperCase());\n\t\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\t\tchar_prev = String.valueOf(str.charAt(i - 1));\n\t\t\t\tchar_current = String.valueOf(str.charAt(i));\n\t\t\t\tif (key.contains(char_prev)) {\n\t\t\t\t\tchar_current = char_current.toUpperCase();//uppercase first letter each word\n\t\t\t\t}\n\t\t\t\tresult.append(char_current);\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi có chữ cái đầu viết hoa: \\n\" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit= scan.next().toString();\n\t\t}\n\t}",
"private String generateRandomWord()\n {\t\n\tRandom randomNb = new Random(System.currentTimeMillis());\n\tchar [] word = new char[randomNb.nextInt(3)+5];\n\tfor(int i=0; i<word.length; i++)\n\t word[i] = letters[randomNb.nextInt(letters.length)];\n\treturn new String(word);\n }",
"private void renewWordLevel2()\n {\n givenWord = availableWords.randomWordLevel2();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"java.lang.String getWord();",
"public void addWord (String word) {\r\n word = word.toUpperCase ();\r\n if (word.length () > 1) {\r\n String s = validateWord (word);\r\n if (!s.equals (\"\")) {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered contained invalid characters\\nInvalid characters are: \" + s, \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n return;\r\n }\r\n checkEasterEgg (word);\r\n words.add (word);\r\n Components.wordList.getContents ().addElement (word);\r\n } else {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered does not meet the minimum requirement length of 2\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }",
"private void computerTurn() {\n String text = txtWord.getText().toString();\n String nextWord;\n if (text.length() >= 4 && dictionary.isWord(text)){\n endGame(false, text + \" is a valid word\");\n return;\n } else {\n nextWord = dictionary.getGoodWordStartingWith(text);\n if (nextWord == null){\n endGame(false, text + \" is not a prefix of any word\");\n return;\n } else {\n addTextToGame(nextWord.charAt(text.length()));\n }\n }\n userTurn = true;\n txtLabel.setText(USER_TURN);\n }",
"@Test\n public void testWordGuessArray() {\n\n // If I make a new word\n Word word = new Word(\"Llama\", 10);\n\n // The guess array should be initialized to all '_' characters\n // but be of the same length as the number of letters in the word\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess the letter L (uppercase)\n // it should return true, because 'Llama' contains 2 Ls.\n Assert.assertTrue(word.guessLetter('L'));\n\n // It should update the 'guess' character array\n // to have all L's revealed regardless of casing\n // all other letters should stay hidden as '_'\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess an M, it should also be true\n Assert.assertTrue(word.guessLetter('M'));\n\n // and now the m should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And finally an A\n Assert.assertTrue(word.guessLetter('A'));\n\n // The whole word should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // If I guess a bunch of other letters, they should all return false\n // because the word has already been completed, and revealed\n Assert.assertFalse(word.guessLetter('l'));\n Assert.assertFalse(word.guessLetter('m'));\n Assert.assertFalse(word.guessLetter('a'));\n Assert.assertFalse(word.guessLetter('c'));\n Assert.assertFalse(word.guessLetter('v'));\n Assert.assertFalse(word.guessLetter('b'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public void noteIncorrectGuess(char letter) {\n\t\tguesses += letter;\n\t\tguessesLabel.setLabel(guesses);\n\t\tguessesLabel.setLocation((getWidth() - guessesLabel.getWidth()) / 2, wordLabel.getY() + wordLabel.getHeight()\n\t\t\t\t+ WORD_SPACING);\n\t\tif (guesses.length() == 1)\n\t\t\tbody.add(buildHead());\n\t\tif (guesses.length() == 2)\n\t\t\tbody.add(buildTorso());\n\t\tif (guesses.length() == 3)\n\t\t\tbody.add(buildLeftArm());\n\t\tif (guesses.length() == 4)\n\t\t\tbody.add(buildRightArm());\n\t\tif (guesses.length() == 5)\n\t\t\tbody.add(buildLeftLeg());\n\t\tif (guesses.length() == 6)\n\t\t\tbody.add(buildRightLeg());\n\t\tif (guesses.length() == 7)\n\t\t\tbody.add(buildLeftFoot());\n\t\tif (guesses.length() == 8)\n\t\t\tbody.add(buildRightFoot());\n\t}",
"private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public boolean isAccepted2(String word) {\r\n\t return word.endsWith(\"baa\");\r\n \r\n }",
"private void challengeHandler() {\n String word = txtWord.getText().toString();\n String nextWord;\n if (word.length() >= 4 && dictionary.isWord(word)){\n endGame(true, word + \" is a valid word\");\n } else {\n nextWord = dictionary.getAnyWordStartingWith(word);\n if (nextWord != null){\n endGame(false, word + \" is a prefix of word \\\"\" + nextWord + \"\\\"\");\n } else {\n endGame(true, word + \" is not a prefix of any word\");\n }\n }\n }",
"private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();i++){\n\t\t\tif(sb.charAt(i) == ' ')\n\t\t\t\tsb.setCharAt(i, '_');\n\t\t}\n\t\ttoTextBox = sb.toString();\n\t\ttextField.setText(toTextBox);\n\t\tlblWord.setText(toTextBox);\n\t}",
"public static String mut12(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tchar [] temp = word.toCharArray();\n\t\tString t = \"\";\n\t\tString build = \"\";\n\t\tfor(int i =0; i<word.length(); i++) {\n\t\t\tif(i%2 == 0) {\n\t\t\t\tt = \"\" + temp[i];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[i];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\tbuild = \"\";\n\t\tfor(int j =0; j<word.length(); j++) {\n\t\t\tif(j%2 != 0) {\n\t\t\t\tt = \"\" + temp[j];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[j];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\r\n // TODO code application logic here\r\n String finalWord = stringGen(0); // Generate Random String to find words in\r\n \r\n String correctGuesses[];\r\n correctGuesses = new String[50];\r\n Boolean running = true;\r\n \r\n System.out.println(finalWord); \r\n \r\n Scanner s = new Scanner(System.in); // sets up user input\r\n \r\n while (running){ // while user still wants to play...\r\n System.out.print(\"Enter a word found in this puzzle (or QUIT to quit): \");\r\n String input = s.nextLine(); // Gets user input\r\n if(quit(input)){\r\n break;\r\n }\r\n if (input.equals(\"yarrimapirate\")) {\r\n yarrimapirate();\r\n }\r\n if(!compare(correctGuesses, input)) { // guessed word isnt in prev list\r\n if(checkWord(finalWord, input)) { // guessed word is found in string\r\n correctGuesses[correctCounter] = input;\r\n System.out.println(\"Yes,\" + input + \" is in the puzzle.\");\r\n correctCounter++;\r\n }\r\n else { // exactly what next line says o.O\r\n System.out.println(input + \" is NOT in the puzzle.\");\r\n }\r\n }\r\n else {\r\n System.out.println(\"Sorry, you have already found that word.\");\r\n }\r\n }\r\n \r\n System.out.println(\"You found the following \" + correctCounter + \" words in the puzzle:\");\r\n \r\n for(int x=0; x<correctCounter; x++) { // lets print out all Correct guesses!\r\n System.out.println(correctGuesses[x]);\r\n }\r\n \r\n }",
"private String readGuess() {\n\t\tString unsafeGuess = readLine(\"Your Guess: \").trim().toUpperCase();\n\t\tif (!unsafeGuess.matches(\"[a-zA-z]\") || unsafeGuess.length() != 1) {\n\t\t\tprintln(\"Please enter a single letter.\");\n\t\t\treturn readGuess();\n\t\t} else {\n\t\t\treturn unsafeGuess.toUpperCase();\n\t\t}\n\t}",
"public static String userInput()\r\n {\r\n Scanner link = new Scanner(System.in);\r\n String word = link.next();\r\n char[] chars = word.toCharArray();\r\n boolean checkWord = false; \r\n for(int i = 0; i < chars.length; i++)\r\n {\r\n char c = chars[i];\r\n if((c < 97 || c > 122))\r\n {\r\n checkWord = true;\r\n }\r\n }\r\n link.close();\r\n if(!checkWord)\r\n {\r\n return word;\r\n } \r\n else \r\n System.out.println(\"Not a valid input\");\r\n return null;\r\n }",
"public boolean checkAndUpdate(String word) {\n if (hashTable.contains(word)) {\n hashTable.put(word, hashTable.get(word) - 1);\n if (hashTable.get(word) == 0) {\n hashTable.delete(word);\n }\n return true;\n }\n return false;\n }",
"public void noteIncorrectGuess(char letter) {\n\t\taddToWrongLetters(letter);\n\t\tdisplayWrongLetters();\n\t\taddNextBodyPart(wrongLetters.length());\n\t\t\n\t}",
"String replaceInString(String s) {\n\t\tString newS = s.replaceAll(\"[a-zA-Z]+\", \"WORT\");\n\t\tif (newS == s) {\n\t\t\tSystem.out.println(\"gleich\");\n\t\t}\n\t\treturn newS;\n\t}",
"private String processWord(String word){\r\n\t\tString lword = word.toLowerCase();\r\n\t\tfor (int i = 0;i<word.length();++i){\r\n\t\t\tstemmer.add(lword.charAt(i));\r\n\t\t}\r\n\t\tstemmer.stem();\r\n\t\treturn stemmer.toString();\r\n\t}"
] | [
"0.6989696",
"0.6484198",
"0.63878256",
"0.6372551",
"0.63658625",
"0.6342798",
"0.6292117",
"0.62642395",
"0.62091357",
"0.6158527",
"0.6134873",
"0.6125074",
"0.5986991",
"0.5980285",
"0.5979958",
"0.5974792",
"0.5910908",
"0.5906418",
"0.5904474",
"0.590043",
"0.5894946",
"0.5875582",
"0.5859335",
"0.5837658",
"0.58285034",
"0.57943666",
"0.5793591",
"0.5785622",
"0.57845944",
"0.577453",
"0.576517",
"0.5748087",
"0.5745111",
"0.57403547",
"0.5730637",
"0.57199275",
"0.5718857",
"0.5699524",
"0.56740993",
"0.56630963",
"0.5637692",
"0.56093585",
"0.5586027",
"0.5580047",
"0.55727184",
"0.5570722",
"0.556052",
"0.5556133",
"0.5537823",
"0.5511652",
"0.5507803",
"0.5505979",
"0.5502181",
"0.54776037",
"0.5467134",
"0.544391",
"0.5443131",
"0.54425156",
"0.5442422",
"0.54304564",
"0.5405562",
"0.5394015",
"0.53809935",
"0.5377575",
"0.53771657",
"0.5371511",
"0.5370061",
"0.5366566",
"0.5355761",
"0.53362346",
"0.533597",
"0.53181434",
"0.53162396",
"0.5314558",
"0.5313299",
"0.5304456",
"0.52982616",
"0.5297514",
"0.5290961",
"0.52897495",
"0.5288051",
"0.528547",
"0.5275946",
"0.5270398",
"0.52679217",
"0.52616143",
"0.5259976",
"0.52394223",
"0.52265733",
"0.5217862",
"0.52156335",
"0.5209464",
"0.52077955",
"0.5207607",
"0.520687",
"0.5200084",
"0.51994675",
"0.5194798",
"0.5191609",
"0.5187935"
] | 0.7914616 | 0 |
/ Reverses the given word and tests the result in guessPW(). Returns the new word | public static String reverse(String word){
StringBuilder result = new StringBuilder();
if(word.length() <= 1){
return word;
}
for(int i = word.length() - 1; i >= 0; i--){
result.append(word.charAt(i));
}
guessPW(result.toString());
return result.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String reflect2(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(reverse(word));\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static void reverser(String word) {\n String newStr = \"\";\n for (int i = word.length(); i > 0; i--) {\n newStr += word.substring(i - 1, i);\n }\n System.out.println(newStr);\n }",
"private static void reverseWord(String word) {\n // StringBuild.reverse()\n System.out.println(new StringBuilder(word).reverse().toString());\n\n // Add char one by one iteration method\n StringBuilder reversed = new StringBuilder();\n char[] chars = word.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n reversed.append(chars[chars.length - i - 1]);\n }\n System.out.println(reversed.toString());\n }",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\n\t}",
"public static String reflect1(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tresult.append(reverse(word)).toString();\n\t\treturn result.toString();\n\t}",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"public static void main(String[] args) {\n String s = \"MOM\";\n String reverse = \"\";\n String d = \"IMTIAZ\";\n String back = \"\";\n char[] word = s.toLowerCase().toCharArray();\n for (int i = s.length() - 1; i >= 0; i--) {\n reverse = reverse + s.charAt(i);\n for (int j = d.length() - 1; j >= 0; j--) {\n back = back + d.charAt(j);\n }\n\n }\n if (s.equals(reverse)) {\n System.out.println(s + \"--word is a palindron\");\n\n } else {\n System.out.println(s + \"--word is not a palindron\");\n }\n if (d.equals(back))\n System.out.println(d + \"--word is a palindron\");\n else\n System.out.println(d + \"--word is not a palindron\");\n\n\n\n isPalindrome(\"MADAM\");\n isPalindrome(\"IMTIAZ\");\n isPalindrome(\"AHMED\");\n isPalindrome(\"MOM\");\n }",
"public abstract String guessedWord();",
"public boolean guessIsRight(String secretWord, char guess){\n\t\tboolean isCorrect = false;\n\t\tfor (int i=0; i<secretWord.length(); i++){\n\t\t\tchar secretLetter = secretWord.charAt(i);\n\t\t\tif (secretLetter == guess){\n\t\t\t\t isCorrect = true;\n\t\t\t}\n\t\t}\n\t\treturn isCorrect;\n\t}",
"public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static boolean isPalindrome(String word) {\n String palindrome = new StringBuilder(word).reverse().toString();\n \n if(word.compareToIgnoreCase(palindrome) == 0) return true;\n else return false;\n }",
"public static String mut8(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n\n System.out.println(\"Palindrome Checker\");\n System.out.print(\"What phrase would you like to check? \");\n String original = in.nextLine();\n\n // Convert to lower case to simplify comparing strings\n String phrase = original.toLowerCase();\n\n String backwards = \"\"; //to be compared\n String forwardLetter = \"\"; //to be compared\n\n char [] charPhrase = phrase.toCharArray(); //change to a character array\n\n\n // loop through the string forwards, starting with the first character and append to a string\n for(int i = 0; i < charPhrase.length; i++){\n\n if( charPhrase[i] >= 'a' && charPhrase[i] <= 'z'){\n forwardLetter += charPhrase[i];\n }\n }\n // loop through the string backwards, starting with the last character and append to a string\n for (int i = charPhrase.length - 1; i >= 0; i--) {\n\n if( charPhrase[i] >= 'a' && charPhrase[i] <= 'z'){\n backwards += charPhrase[i];\n }\n\n /*\n // Extract each letter as the next character\n // and build the backwards string\n String letter = phrase.substring(i, i + 1);\n backwards += letter;\n */\n }\n\n // A palindrome is a word or phrase that is the same forward or\n // backward. This is where we check that.\n if (forwardLetter.equals(backwards)) {\n System.out.println(original + \" is a palindrome!\");\n } else {\n System.out.println(original + \" is not a palindrome!\");\n }\n\n }",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"public static String mut9(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toLowerCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"void setVersesWithWord(Word word);",
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"public static String mut7(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tString temp2 = word +temp;\n\t\tif(pwMatch(temp2, person, w)) \n\t\t\treturn temp2;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\ttemp = temp+word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\n\t\treturn null;\n\t}",
"public String convertToUpperCase(String word);",
"@Test\n\tpublic void revStrSentances() {\n\n\t\tString s = \"i like this program very much\";\n\t\tString[] words = s.split(\" \");\n\t\tString revStr = \"\";\n\t\tfor (int i = words.length - 1; i >= 0; i--) {\n\t\t\trevStr += words[i] + \" \";\n\n\t\t}\n\n\t\tSystem.out.println(revStr);\n\n\t}",
"@Test\n public void reverse_Givenastring_ReverseEachWord()\n {\n\n assertEquals(\"a kciuq nworb xof spmuj revo eht yzal god\",fp.Reversethestring(\"a quick brown fox jumps over the lazy dog\"));\n\n }",
"public static String mut2(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor(int i=0; i< chars.length; i++) {\n\t\t\ttemp = word + chars[i];\n\t\t\tif(pwMatch(temp, person, w)) \n\t\t\t\treturn temp;\n\t\t\telse if(isDouble)\n\t\t\t\treturn temp;\n\t\t}\n\t\treturn null;\n\t}",
"public static String mut5(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private String getConvertedWord(String word) {\r\n\t\tString newWord = \"\";\r\n\t\tif(word == null || word.length() == 0)\r\n\t\t\tnewWord = \"\";\r\n\t\telse if(word.length() < 3)\r\n\t\t\tnewWord = word;\r\n\t\telse \r\n\t\t\tnewWord = \"\"+word.charAt(0) + (word.length() - 2) + word.charAt(word.length() - 1);\r\n\t\t\t\r\n\t\tif(DEBUG)\r\n\t\t\tSystem.out.printf(\"Converted %s to %s\\n\", word, newWord);\r\n\t\treturn newWord;\r\n\r\n\t}",
"private void renewWordLevel2()\n {\n givenWord = availableWords.randomWordLevel2();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public static String mut4(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, word.length()-1);\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"static boolean checkPalin(String word) {\n\t\tint n = word.length();\n\n\t\t// making the check case\n\t\t// case insensitive\n\t\tword = word.toLowerCase();\n\n\t\t// loop to check palindrome\n\t\tfor (int i = 0; i < n; i++, n--)\n\t\t\tif (word.charAt(i) != word.charAt(n - 1))\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}",
"String reverseMyInput(String input);",
"public static void main(String[] args) {\n String input = \"DXC technologies limited\";\n\n String revr = \"\";\n for (int z = input.length() - 1; z >= 0; z--) {\n revr = revr + input.charAt(z);\n }\n System.out.println(revr);\n\n\n String splitwords[] = input.split(\" \");\n String reverseword = \"\";\n\n for (int i = 0; i < splitwords.length; i++) {\n String word = splitwords[i];\n String reversewords = \"\";\n\n for (int j = word.length() - 1; j >= 0; j--) {\n reversewords = reversewords + word.charAt(j);\n }\n reverseword = reverseword + reversewords + \" \";\n\n }\n System.out.println(\"traditional method is \" +trim(reverseword));\n\n //return reverseword;\n\n }",
"public static String mut10(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1).toUpperCase() + \"\" + word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\r\n\t\tString str = \"madam\";\r\n\t\tString rev = \"\";\r\n\t\tfor(int i = str.length()-1; i>=0; i--)\r\n\t\t{\r\n\t\t rev = rev+str.charAt(i);\t\r\n\t\t}\r\n\t\tSystem.out.println(rev);\r\n\t\tif(rev.equals(str))\r\n\t\t{\r\n\t\t\tSystem.out.println(\"its a palendrome\");\r\n\t\t}else {\r\n\t\t\tSystem.out.println(\"its not palendrome\");\r\n\t\t}\r\n\t\treverse(\"avinesh\");\r\n\t\t\r\n\r\n\t}",
"public static void main(String[] args) {\n String str = null;\n //String str = \"My Name Is Aakash\";\n //String str = \"!@@#$%^&*()+_)(*&^%$#@!@#$%^&*(_)(*&^%$%^&**&^%$#$%^&*&^%$##$%^&*&^%$\";\n //String str = \"_sakdkjashdksahkdhjksahdkjakjshdkjahsdkaskdkasdjhasjhckhagcuagskdjkasdjkaskjdhjkashdkjhakjdjkasdkaskjdajksdhjkashdjkahsjkdhjkasckjackhaduihcadlcdjcbkjsbdcjksdjkckjsdcjksdnjkcnjksdhckjsdhjkvsdjvnkjdsbvjkdsvkjdshkhsdkfheklwjfbjkwegfwegfiuwekjfbewjkhfgwejyfguiwejfbwekhfgywegfkjewbhjfgewjfgewhjfjhewgf\";\n\n System.out.println(reverseString(str));\n }",
"public void readWordRightToLeft(String word) {\n }",
"public static void main(String[] args) {\n\r\n\t\tString s = \"hello my name is john\";\r\n\t\t//System.out.println(reverse(s,0,s.length()-1));\r\n\t\t\r\n\t\tSystem.out.println(reverseWordsAlt(s));\r\n\t}",
"public String scramble(String word)\n {\n int i, j;\n String SwappedString = \"\";\n String first, middle, last;\n int wordLength = word.length();\n for (int k = 0; k < wordLength; k++)\n {\n i = generator.nextInt(wordLength-1);\n j = i+1 + generator.nextInt(wordLength-i-1);\n first = word.substring(0,i);\n middle = word.substring(i+1,j);\n if (j != wordLength)\n {\n last = word.substring(j+1);\n }\n else\n {\n last = \"\";\n }\n SwappedString = first + word.substring(j, j + 1) + middle + word.substring(i, i + 1) + last;\n word = SwappedString;\n }\n return SwappedString;\n }",
"public static String mut11(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1) + \"\" + word.substring(1, word.length()).toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"static String reverseWordsInStringInPlace(StringBuffer input_string){\n //step 1\n int j = -1;\n for(int i = 0; i <input_string.length() ;i++ ){\n if(' ' == input_string.charAt(i)){\n reverseString(input_string,j+1,i-1);\n j=i;\n }\n //for last word\n if(i == input_string.length()-1){\n reverseString(input_string,j+1,i);\n }\n }\n //step 2\n reverseString(input_string,0,input_string.length()-1);\n return input_string.toString();\n\n }",
"public static String mut3(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"public String decrypt(String word){\n\tString result = \"\";\n\tString wordLower = word.toLowerCase(); \n\tfor(int i=0; i<wordLower.length(); i++){\n\t if(wordLower.charAt(i)<97 || wordLower.charAt(i)>122)\n\t\tthrow new IllegalArgumentException();\n\t int a = (wordLower.charAt(i)-97);\n\t int b = (int)Math.pow(a,privateD);\n\t int k = (b%26)+97;\n\t result += Character.toString((char)k);\n\t}\n\treturn result;\n }",
"public static boolean palindrome(String word) {\n\t\t\r\n\t\tint equalsCounter=0;\r\n\t\t\r\n\t\tfor(int i=0;i<word.length();i++) {\r\n\t\t\t\r\n\t\tif(word.contains(\" \")) {\r\n\t\t\t\r\n\t\t\tword=word.replace(\" \",\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t if(word.charAt(i)==word.charAt(word.length()-(i+1))){\r\n\t\t\t\t\r\n\t\t\t\tequalsCounter++;\r\n\t\t\t\t\r\n\t\t\t\tif(equalsCounter==word.length()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\t\r\n\t}",
"public boolean pass(String word);",
"public static void main(String[] args) {\r\n // TODO code application logic here\r\n String finalWord = stringGen(0); // Generate Random String to find words in\r\n \r\n String correctGuesses[];\r\n correctGuesses = new String[50];\r\n Boolean running = true;\r\n \r\n System.out.println(finalWord); \r\n \r\n Scanner s = new Scanner(System.in); // sets up user input\r\n \r\n while (running){ // while user still wants to play...\r\n System.out.print(\"Enter a word found in this puzzle (or QUIT to quit): \");\r\n String input = s.nextLine(); // Gets user input\r\n if(quit(input)){\r\n break;\r\n }\r\n if (input.equals(\"yarrimapirate\")) {\r\n yarrimapirate();\r\n }\r\n if(!compare(correctGuesses, input)) { // guessed word isnt in prev list\r\n if(checkWord(finalWord, input)) { // guessed word is found in string\r\n correctGuesses[correctCounter] = input;\r\n System.out.println(\"Yes,\" + input + \" is in the puzzle.\");\r\n correctCounter++;\r\n }\r\n else { // exactly what next line says o.O\r\n System.out.println(input + \" is NOT in the puzzle.\");\r\n }\r\n }\r\n else {\r\n System.out.println(\"Sorry, you have already found that word.\");\r\n }\r\n }\r\n \r\n System.out.println(\"You found the following \" + correctCounter + \" words in the puzzle:\");\r\n \r\n for(int x=0; x<correctCounter; x++) { // lets print out all Correct guesses!\r\n System.out.println(correctGuesses[x]);\r\n }\r\n \r\n }",
"public String getCorrectionWord(String misspell);",
"public static String solution(String word) {\n return Stream.of(word.split(\"\"))\n .reduce(\"\", (original, reverse) ->\n reverse + original);\n }",
"private void renewWordLevel4()\n {\n givenWord = availableWords.randomWordLevel4();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public static void main(String[] args) {\n String s =\" 1\";\n\n System.out.println(reverseWords(s));\n\n }",
"public boolean checkAndUpdate(String word) {\n if (hashTable.contains(word)) {\n hashTable.put(word, hashTable.get(word) - 1);\n if (hashTable.get(word) == 0) {\n hashTable.delete(word);\n }\n return true;\n }\n return false;\n }",
"public String normalize(String word);",
"public static String delLastChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(0, word.length() - 1);\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"abstract String makeAClue(String puzzleWord);",
"public static boolean isPalindrome(String word){\r\n\t\tboolean palindrome = false;\r\n\t\tif(word.length()%2 == 1){\r\n\t\t\tfor(int a= 0; a<word.length()/2; a++){\r\n\t\t\t\tfor (int b = word.length()-1; b> word.length()/2; b--){\r\n\t\t\t\t\tif( word.charAt(a)== word.charAt(b)){\r\n\t\t\t\t\t\tpalindrome = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tpalindrome = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tfor(int a= 0; a<word.length()-1; a++){\r\n\t\t\t\tfor (int b = word.length()-1; b> 0; b--){\r\n\t\t\t\t\tif( word.charAt(a)== word.charAt(b)){\r\n\t\t\t\t\t\tpalindrome = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\tpalindrome = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\treturn palindrome;\r\n\r\n}",
"public static void main(String[] args) {\n\n System.out.println(reverseWordOrder(\"Hello World\"));// ->\"World Hello\";\n System.out.println(reverseWordOrder(\"Java is fun\"));// ->\"fun is Java\"\n System.out.println(reverseWordOrder(\"Hi How Are You\")); //->\"You Are How Hi\"\n System.out.println(reverseWordOrder(\"talk is cheap. show me the code\")) ;//->\"code the me show cheap. is talk\"\n\n }",
"public boolean isPalindrom(String word) {\n boolean palindrom = false;\n int middle = word.length() / 2;\n\n for (int i = 0; i < middle; i++) {\n for (int j = word.length() - i - 1; j >= middle; j--) {\n if (word.charAt(i) == word.charAt(j)) {\n palindrom = true;\n break;\n } else {\n return false;\n }\n }\n }\n\n return palindrom;\n }",
"public static String reverseWordsAlt(String str){\r\n\t\t\r\n\t\tstr = reverse(str, 0,str.length()-1);\r\n\t\t\r\n\t\tint start=0;\r\n\t\tint end =0;\r\n\t\t\r\n\t\twhile(end < str.length()){\r\n\t\t\t\r\n\t\t\twhile(end<str.length() && str.charAt(end)!=' '){\r\n\t\t\t\tend++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(start<end){\r\n\t\t\t\tstr=reverse(str,start,end-1);\r\n\t\t\t\tstart=end+1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tend++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tstr = reverse(str,start,end-1);\r\n\t\t\r\n\t\treturn str;\r\n\t}",
"public String newWord(String word) {\r\n\t\tthis.word = word;\r\n\t\twordLength = word.length();\r\n\t\ttries = word.length();\r\n\t\tunknownCharactersInWordState = word.length();\r\n\t\twordState = UNKNOWN.repeat(wordLength);\r\n\t\tstringBuilder = new StringBuilder(wordState);\r\n\t\tboolean lose = false;\r\n\t\treturn parseState(lose, false);\r\n\t}",
"private String pickWord() {\n \thangmanWords = new HangmanLexicon();\n \tint randomWord = rgen.nextInt(0, (hangmanWords.getWordCount() - 1)); \n \tString pickedWord = hangmanWords.getWord(randomWord);\n \treturn pickedWord;\n }",
"static void reverseWordInMyString(String str) {\r\n\t\tString[] words = str.split(\" \");\r\n\t\tString reversedString = \"\";\r\n\t\tfor (int i = 0; i < words.length; i++) {\r\n\t\t\tString word = words[i];\r\n\t\t\tString reverseWord = \"\";\r\n\t\t\tfor (int j = word.length() - 1; j >= 0; j--) {\r\n\t\t\t\t/*\r\n\t\t\t\t * The charAt() function returns the character at the given position in a string\r\n\t\t\t\t */\r\n\t\t\t\treverseWord = reverseWord + word.charAt(j);\r\n\t\t\t}\r\n\t\t\treversedString = reversedString + reverseWord + \" \";\r\n\t\t}\r\n\t\tSystem.out.println(str);\r\n\t\tSystem.out.println(reversedString);\r\n\t}",
"String selectRandomSecretWord();",
"public boolean checkRightWord(EditText answerWord){\n \t\t return answerWord.getText().toString().equalsIgnoreCase(currentWord);\n \t }",
"public void setWord(String newWord)\n\t{\n\t\tword = newWord;\n\t}",
"public static void main (String [ ] args){//declaracion del programa principal \r\n\t\r\n \tScanner in=new Scanner(System.in); //se crea el objeto de la clase Scanner para poder capturar desde teclado\r\n\r\n\tSystem.out.println(\"Capture a phrase: \"); //se imprime en pantalla la instruccion\r\n\tString normal=in.nextLine();//almacenamos el numero capturado a normal, con el metodo nextLine() \r\n\r\n\tString back=new StringBuilder(normal).reverse().toString();\r\n\tSystem.out.println(\"The phrase backwards is: \"+back);//Impresion de la frase al reves\r\n}",
"public static String mut12(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tchar [] temp = word.toCharArray();\n\t\tString t = \"\";\n\t\tString build = \"\";\n\t\tfor(int i =0; i<word.length(); i++) {\n\t\t\tif(i%2 == 0) {\n\t\t\t\tt = \"\" + temp[i];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[i];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\tbuild = \"\";\n\t\tfor(int j =0; j<word.length(); j++) {\n\t\t\tif(j%2 != 0) {\n\t\t\t\tt = \"\" + temp[j];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[j];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\treturn null;\n\t}",
"@Test\n\tpublic void checkReverseString()\n\n\t{\n\t\tassertEquals(\"nitin si a doog yob \",test.testReverseString(\"nitin is a good boy\"));\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tString sampleStr=\"test a is this\";\r\n\t\tchar sampleInput[] = sampleStr.toCharArray();\r\n\t\t\r\n\t\t//char[] sampleInput= new char[] {'t','e','s','t',' ','a',' ','i','s',' ','t','h','i','s',' ','h','i'};\r\n\t\t\r\n\t\tSystem.out.println(\"Original String # \");\r\n\t\tfor (char c : sampleInput) {\r\n\t\t\tSystem.out.print(c);\r\n\t\t}\r\n\t\t\r\n\t\treverseWord(sampleInput, 0, sampleInput.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\nReverted String # \");\r\n\t\tfor (char c : sampleInput) {\r\n\t\t\tSystem.out.print(c);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tint startindx=0;\r\n\t\t\r\n\t\tfor(int j=0; j<=sampleInput.length; j++) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(j == sampleInput.length || sampleInput[j]==' ') {\t\t\t\r\n\t\t\t\treverseWord(sampleInput,startindx,j-1);\r\n\t\t\t\tstartindx=j+1;\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"\\nFinal String # \");\r\n\t\tfor(int i=0;i<sampleInput.length;i++)\r\n\t\t\tSystem.out.print(sampleInput[i]);\r\n\r\n\t}",
"public static void main(String[] args) {\n\r\n\t\tString str1 = \"madam\";\r\n\t\tString str2 = \"\";\r\n\t\tfor(int i = str1.length()-1;i>=0;i--) {\t\r\n\t\t\tchar[] rev = str1.toCharArray();\r\n\t\t\tstr2 =str2+ rev[i];\r\n\t\t}\r\n\t\tif(str1.equals(str2))System.out.println(\"The \"+str1+\" is a Palindrome\");\r\n\t\telse System.out.println(\"The \"+str1+\" is not a Palindrome\");\r\n\t}",
"public static void main(String[] args) {\n String s = \" \" ;\n\n Solution solution = new Solution();\n String s1 = solution.reverseWords(s);\n\n System.out.println(\"the work is: \" + s1) ;\n }",
"public static boolean abrevChecker(String abrv, String word) {\r\n \r\n //our 3rd word make by decrypting the given word\r\n String newWord = \"\";\r\n\r\n //splitting our two inputs into arrayLists and redefining them\r\n char[] firstWord = abrv.toCharArray();\r\n char[] secondWord = word.toCharArray();\r\n\r\n /*a for loop to check if each letter in word is inside the abbrevbation\r\n and creating a new word made of the commmon letters*/\r\n for (char letter : secondWord) {\r\n if (abrv.indexOf(letter) != -1) {\r\n newWord += letter;\r\n }\r\n }\r\n \r\n //check if the abrevation contains any forgein letters that word doesnt have\r\n for (char letter : firstWord) {\r\n if (word.indexOf(letter) == -1) {\r\n return false;\r\n\r\n /*if the abbrevation contains only letters found in word checks if\r\n the abbrevation is inside the new word*/\r\n } else if (word.indexOf(letter) != -1) {\r\n if (newWord.contains(abrv)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }\r\n\r\n }\r\n\t\treturn false;\r\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"public static String mut6(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word + \"\" + word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String translateWord(String word) {\n\n if (word.length() < 1) return word;\n int[] vowelArray = word.chars().filter(c -> vowels.contains((char) c)).toArray();\n if (vowelArray.length == 0) return word.charAt(0) + word.substring(1).toLowerCase() + \"ay\";\n\n char first = Character.isUpperCase(word.charAt(0))\n ? Character.toUpperCase((char) vowelArray[0]) : (char) vowelArray[0];\n if (vowels.contains(word.charAt(0)))\n word = first + word.substring(1).toLowerCase() + \"yay\";\n else\n word = first + word.substring(word.indexOf(vowelArray[0]) + 1).toLowerCase()\n + word.substring(0, word.indexOf(vowelArray[0])).toLowerCase() + \"ay\";\n return word;\n }",
"public String spellcheck(String word) {\n // Check if the world is already in lcDictionary.\n String lcdictionaryLookup = lcDictionary.get(word.toLowerCase());\n if(lcdictionaryLookup != null) {\n return lcdictionaryLookup;\n }\n String reducedWord = reducedWord(word);\n String rwdictionaryLookup = rwDictionary.get(reducedWord);\n if(rwdictionaryLookup != null) {\n return rwdictionaryLookup;\n }\n return \"NO SUGGESTION\";\n }",
"private void convertWord(String word, int n) {\n\t\t\n\t\tStringBuilder convertedWord;\t\t// A StringBuilder object is used to substitute specific characters at locations\n\t\t\n\t\tfor (int i = n; i < word.length(); i++) {\t\t// Loops through the entire word to make substitutions\n\t\t\tswitch (word.charAt(i)) {\n\t\t\t\tcase 'a':\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\t\t// Creates a new StringBuilder string\n\t\t\t\t\tconvertedWord.setCharAt(i, '4');\t\t\t\t// Substitutes 'a' with '4'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\t\t// Adds the converted word to the trie\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\t\t\t\t\t// Adds the converted word to my_dictionary.txt\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\t\t\t\t// Checks this converted word for more substitutions\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'e':\t\t\t\t\t// These cases all follow the same format; they only differ in the letter that is substituted\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\n\t\t\t\t\tconvertedWord.setCharAt(i, '3');\t\t\t\t// Substitutes 'e' with '3'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'i':\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\n\t\t\t\t\tconvertedWord.setCharAt(i, '1');\t\t\t\t// Substitutes 'i' with '1'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'l':\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\n\t\t\t\t\tconvertedWord.setCharAt(i, '1');\t\t\t\t// Substitutes 'l' with 'i'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'o':\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\n\t\t\t\t\tconvertedWord.setCharAt(i, '0');\t\t\t\t// Substitutes 'o' with '0'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 's':\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\n\t\t\t\t\tconvertedWord.setCharAt(i, '$');\t\t\t\t// Substitutes 's' with '$'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 't':\n\t\t\t\t\tconvertedWord = new StringBuilder(word);\n\t\t\t\t\tconvertedWord.setCharAt(i, '7');\t\t\t\t// Substitutes 't' with '7'\n\t\t\t\t\tDLBTCharMethods.addWord(trie, convertedWord.toString());\n\t\t\t\t\tmyDictionary.println(convertedWord.toString());\n\t\t\t\t\tconvertWord(convertedWord.toString(), i);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public static boolean append(String word){\n\t\tboolean x = false;\n\t\tboolean y = false;\n\t\tfor(int i = 33; i <= 126; i++){\n\t\t\tchar c = (char)i;\n\t\t\tx = guessPW(word.concat(Character.toString(c)));\n\t\t\ty = guessPW(Character.toString(c).concat(word));\n\t\t}\n\n\t\tif(x | y){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"public String alternateWordSwap() {\n\t\tString output=\"\";\r\n\t\tString arr[]=this.str.split(\" \");\r\n\t\tfor(int i=0,j=1;i<arr.length;i+=2,j+=2){\r\n\t\t\tString temp=arr[i];\r\n\t\t\tarr[i]=arr[j];\r\n\t\t\tarr[j]=temp;\r\n\t\t}\r\n\t\t\r\n\t\tfor(String s:arr){\r\n\t\t\toutput+=s+\" \";\r\n\t\t}\r\n\t\treturn output.trim();\r\n\t}",
"public static boolean checkWord(String guess, String solution) {\n\t\tif(guess.equals(solution)) {\n\t\t\treturn true;\n\t\t}else {\n\t\t\treturn false;\n\t\t}\n\t}",
"private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public boolean isPalindrome(String word) {\n if (word == null) {\n /** Unsure about this. Need to verify. */\n return false;\n }\n if (word.length() == 0 || word.length() == 1) {\n return true;\n }\n StringBuilder reverse = new StringBuilder(word).reverse();\n return word.equals(reverse.toString());\n }",
"@Test\n public void testWordGuessArray() {\n\n // If I make a new word\n Word word = new Word(\"Llama\", 10);\n\n // The guess array should be initialized to all '_' characters\n // but be of the same length as the number of letters in the word\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess the letter L (uppercase)\n // it should return true, because 'Llama' contains 2 Ls.\n Assert.assertTrue(word.guessLetter('L'));\n\n // It should update the 'guess' character array\n // to have all L's revealed regardless of casing\n // all other letters should stay hidden as '_'\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // If I guess an M, it should also be true\n Assert.assertTrue(word.guessLetter('M'));\n\n // and now the m should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And finally an A\n Assert.assertTrue(word.guessLetter('A'));\n\n // The whole word should be revealed\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // If I guess a bunch of other letters, they should all return false\n // because the word has already been completed, and revealed\n Assert.assertFalse(word.guessLetter('l'));\n Assert.assertFalse(word.guessLetter('m'));\n Assert.assertFalse(word.guessLetter('a'));\n Assert.assertFalse(word.guessLetter('c'));\n Assert.assertFalse(word.guessLetter('v'));\n Assert.assertFalse(word.guessLetter('b'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public static void main(String[] args) {\n\t\tString str = \"Bangalore is capital of Karnataka where\";\n\t\tString[] words = str.split(\" \");\n\t\tString newString=\"\";\n\t\t\t\n\t\tfor(String word: words) {\n\t\n\t\t\t\tnewString= newString+reverse(word);\n\t\t}\n\t\t\n\t\tSystem.out.println(newString);\n\t}",
"public String decode(String words) {\n \n String reversedLetters = words;\n String [] reverseWordPosition = reversedLetters.split (\" \");\n String [] tempCopy = new String [reverseWordPosition.length];\n \n \n //Reverse the order of the words to position after Transpose has ran.\n for (int i = 0; i <= (((reverseWordPosition.length) - 1 - i) / 2); i++){\n tempCopy [i] = reverseWordPosition [i];\n reverseWordPosition [i] = reverseWordPosition [(reverseWordPosition.length) - 1 - i];\n reverseWordPosition [(reverseWordPosition.length) - 1 - i] = tempCopy [i]; \n }\n \n \n String s = new String();\n //Pass that array into a String\n for (int i = 0; i < reverseWordPosition.length; i++ ){\n s += reverseWordPosition [i] + \" \";\n }\n \n //Words are in original position but letter are still reversed. Decrypt\n //must be implemented after decode.\n \n return s;\n \n \n }",
"public void reverseWords(char[] s) {\n if (s == null || s.length <= 1) {\n return;\n }\n reverse(s, 0, s.length - 1);\n int start = 0;\n for (int i = 0; i < s.length; i++) {\n if (s[i] == ' ') {\n // revresting between publish and i +1\n reverse(s, start, i - 1);\n // setting publish = i +1 assuming there is only\n // one space between words !!!\n start = i + 1;\n } else if (i == s.length - 1) {\n reverse(s, start, i);\n }\n }//end for\n }",
"private static String scramble(final String byte_, final boolean reverse)\n\t{\n\t\tStringBuilder builder = new StringBuilder(byte_);\n\t\tfor( int i = 0; i < byte_.length(); i ++)\n\t\t\tif(byte_.charAt(i) == ( !reverse ? BIT_ONE : BIT_ZERO))\n\t\t\t{\n\t\t\t\tbuilder.setCharAt(i, ( !reverse ? BIT_ZERO : BIT_ONE));\n\t\t\t\treturn builder.toString();\n\t\t\t}\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n\t\tString original=\"kayak radar kayak\";\n\t\tString reversed=\"\";\n\t\t\n\t\tfor(int i=original.length()-1; i>=0; i--) {\n\t\t\t\n\t\t\treversed=reversed+original.charAt(i); // +k=k+a=ka+k\n\t\t}\n\t\tSystem.out.println(reversed);\n\t\t\n\t\tif(original.equals(reversed)) {\n\t\t\tSystem.out.println(\"String is a palindrome \");\n\t\t}else {\n\t\t\tSystem.out.println(\"String is NOT palindrome\");\n\t\t}\n\t\t\n\t}",
"public static String reverseWord(String str){\n StringBuilder result = new StringBuilder();\n StringTokenizer tokenizer = new StringTokenizer(str,\"\");\n\n while (tokenizer.hasMoreTokens()){\n StringBuilder sb = new StringBuilder();\n sb.append(tokenizer.nextToken());\n sb.reverse();\n\n result.append(sb);\n result.append(\" \");\n }\n return result.toString(); //converting the StringBuilder into String\n }",
"public static void main(String[] args) {\n\t\tString reverse = \"Ragha\";\r\n\t\t//String reversed = ;\r\n //System.out.println(reverseAstring(reverse.toCharArray(),0));\r\n \t//printReverseString(reverse.toCharArray(),0);\r\n \tSystem.out.println('A'^'B');\r\n \tSystem.out.println('B'^3);\r\n \tSystem.out.println(3^65);\r\n\t}",
"public static String newWord(String strw) {\n String value = \"Encyclopedia\";\n for (int i = 1; i < value.length(); i++) {\n char letter = 1;\n if (i % 2 != 0) {\n letter = value.charAt(i);\n }\n System.out.print(letter);\n }\n return value;\n }",
"public String reverseText(String words) {\n String reversedLetters = words;\n \n //Split String\n String [] reverseWordPosition = reversedLetters.split (\" \");\n String [] tempCopy = new String [reverseWordPosition.length];\n \n \n //Reverse the order of the words using an array\n for (int i = 0; i <= (((reverseWordPosition.length) - 1) / 2); i++){\n tempCopy [i] = reverseWordPosition [i];\n reverseWordPosition [i] = reverseWordPosition [reverseWordPosition.length - 1 - i];\n reverseWordPosition [reverseWordPosition.length - 1 - i] = tempCopy [i]; \n }\n \n \n String s = new String();\n //Pass that array into a String\n for (int i = 0; i < reverseWordPosition.length; i++ ){\n s += reverseWordPosition [i] + \" \";\n }\n \n return s;\n \n \n \n \n \n }",
"public static void main (String [] args) {\n\n \tString inputString = new String();\n \tString reversedString = new String();\n\n \tString yOrN = new String();\n\n \tchar punctuationAndWhitespace [] = {'!','\"', '\\\\', '#', '$', '%', '&', '\\'', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', ' ', '\\t', '\\f', '\\r'};\n\n \tint incrementorVariable = 0;\n \tint incrementorVariable2 = 0;\n\n \tScanner inputScannerObject = new Scanner(System.in);\n\n \tMainProgramLoop:\n \twhile (1 == 0 || 7 >= (5 % 1)) {\n \t EnterPalindromeLoop:\n \t for (;;) {\n \t\tSystem.out.printf(\"%s\", \"Do you want to enter a palindrome? (Y/N): \");\n \t\tyOrN = inputScannerObject.nextLine();\n \t\tif (yOrN.length() == 1) {\n \t\t switch (yOrN.charAt(0)) {\n \t\t case 'Y':\n \t\t case 'y':\n \t\t\tbreak EnterPalindromeLoop;\n \t\t case 'N':\n \t\t case 'n':\n \t\t\tbreak MainProgramLoop;\n \t\t }\n \t\t}\n \t }\n \t System.out.printf(\"Enter the palindrome: \");\n \t inputString = inputScannerObject.nextLine();\n \t inputString = inputString.toUpperCase();\n\n \t incrementorVariable2 = 0;\n\n \t while (incrementorVariable2 != punctuationAndWhitespace.length) {\n \t\tif (inputString.contains(String.valueOf(punctuationAndWhitespace[incrementorVariable2]))) {\n \t\t for (incrementorVariable = 0; incrementorVariable != inputString.length(); ++incrementorVariable) {\n \t\t\tif (inputString.charAt(incrementorVariable) == punctuationAndWhitespace[incrementorVariable2]) {\n \t\t\t if (inputString.length() - 1 > incrementorVariable) {\n \t\t\t\tinputString = inputString.substring(0, incrementorVariable) + inputString.substring(incrementorVariable + 1);\n \t\t\t }\n \t\t\t else {\n \t\t\t\tinputString = inputString.substring(0, incrementorVariable);\n \t\t\t }\n \t\t\t --incrementorVariable;\n\n \t\t\t}\n \t\t }\n \t\t}\n \t\tincrementorVariable2 += 1;\n \t }\n\n \t reversedString = \"\";\n\n \t for (incrementorVariable = 0; incrementorVariable != inputString.length(); incrementorVariable++) {\n \t\treversedString = reversedString.concat(String.valueOf(inputString.charAt(inputString.length() - incrementorVariable - 1)));\n \t }\n\n \t if (reversedString.equals(inputString)) {\n \t\tSystem.out.format(\"It's a Palindrome!\\n\");\n \t }\n \t else if (!reversedString.equals(inputString)) {\n \t\tSystem.out.println(\"It isn't a Palindrome!\");\n \t }\n\n \t}\n }",
"@Test\n public void testWordGuessReset() {\n Word word = new Word(\"Llama\", 10);\n\n // And then completely guess it\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n // But reset the guesses on the word\n word.resetGuesses();\n\n // All of the characters in the Guess array should be reset to '_'\n Assert.assertEquals(\"Llama\".length(), word.getGuesses().length);\n Assert.assertEquals('_', word.getGuesses()[0]);\n Assert.assertEquals('_', word.getGuesses()[1]);\n Assert.assertEquals('_', word.getGuesses()[2]);\n Assert.assertEquals('_', word.getGuesses()[3]);\n Assert.assertEquals('_', word.getGuesses()[4]);\n\n // And I should be able to completely guess it again\n Assert.assertTrue(word.guessLetter('l'));\n Assert.assertTrue(word.guessLetter('a'));\n Assert.assertTrue(word.guessLetter('m'));\n\n Assert.assertEquals('L', word.getGuesses()[0]);\n Assert.assertEquals('l', word.getGuesses()[1]);\n Assert.assertEquals('a', word.getGuesses()[2]);\n Assert.assertEquals('m', word.getGuesses()[3]);\n Assert.assertEquals('a', word.getGuesses()[4]);\n\n }",
"public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }",
"public static String Rule2(String para_word) {\n\t\tint last = para_word.length();\r\n\r\n\t\t// if it ends in y and there is a vowel in steam change it to i\r\n\t\tif ((para_word.charAt(last - 1) == 'y') && wordSteamHasVowel(para_word)) {\r\n\t\t\tpara_word = para_word.substring(0, last - 1) + \"i\";\r\n\t\t}\r\n\r\n\t\treturn para_word;\r\n\t}",
"public String upperCase(String word){\n return word.toUpperCase();\n }",
"public MyHangmanGame(String secretWord, int numGuesses, String LetterHistory){\n OriginSecretWord = secretWord;\n GuessRemainingNum = numGuesses;\n LetterLeftNum = secretWord.length();\n for(int i = 0; i < secretWord.length(); i++)\n {\n CurrentState += \"_ \";\n for(int j = i; j > 0; j--)\n {\n if(secretWord.charAt(i) == secretWord.charAt(j-1))\n {\n LetterLeftNum--;//If the letter appears many times in the secret word, it will be counted just once.\n break;\n }\n }\n }\n LetterGuessHistory = LetterHistory;\n }",
"public void process(String s)//check if the phrase guess equals the actual phrase\n {\n String phraseGuess = s.toUpperCase();\n String phraseUp = phrase.toUpperCase();\n //comparing guess and actual\n if (phraseGuess.equals(phraseUp))\n {\n System.out.println(\"You Guessed correctly!\");\n screen = phraseUp.toCharArray();\n GamePlay.letterInPhrase = true;\n showPhrase();\n// System.out.println(\"The phrase is: \"+phrase);\n }\n else\n {System.out.println(\"Incorrect Guess Next Player's turn\");\n GamePlay.letterInPhrase = false;\n }\n }",
"@Override\n public String decrypt(String word, int cipher) {\n String result = \"\";\n int postcipher = 0;\n boolean wasUpper = false;\n for(int i = 0; i < word.length(); i++)\n {\n char c = word.charAt(i);\n postcipher = c;\n if(Character.isLetter(c)) {\n if (c < ASCII_LOWER_BEGIN) { //change to lowercase\n c += ASCII_DIFF;\n wasUpper = true;\n }\n postcipher = ((c + (NUM_ALPHABET - cipher) - ASCII_LOWER_BEGIN) % NUM_ALPHABET + ASCII_LOWER_BEGIN); //shift by cipher amount\n if (wasUpper)\n postcipher -= ASCII_DIFF; //turn back into uppercase if it was uppercase\n wasUpper = false;\n }\n result += (char)postcipher; //add letter by letter into string\n }\n return result;\n }",
"public String scramble(String wordToScramble){\n\t\tString scrambled = \"\";\n\t\tint randomNumber;\n\n\t\tboolean letter[] = new boolean[wordToScramble.length()];\n\n\t\tdo {\n\t\t\trandomNumber = generator.nextInt(wordToScramble.length());\n\t\t\tif(letter[randomNumber] == false){\n\t\t\t\tscrambled += wordToScramble.charAt(randomNumber);\n\t\t\t\tletter[randomNumber] = true;\n\t\t\t}\n\t\t} while(scrambled.length() < wordToScramble.length());\n\n\t\tif(scrambled.equals(wordToScramble))\n\t\t\tscramble(word);\n\n\t\treturn scrambled;\n\t}"
] | [
"0.72505254",
"0.66109705",
"0.6546648",
"0.63009846",
"0.62201077",
"0.6124319",
"0.6070191",
"0.60208833",
"0.6000153",
"0.59975684",
"0.59586155",
"0.59172016",
"0.59124714",
"0.5908066",
"0.58990747",
"0.58807224",
"0.584797",
"0.5839304",
"0.5774277",
"0.57614803",
"0.5755694",
"0.5731665",
"0.57312053",
"0.5728856",
"0.56573486",
"0.5642636",
"0.5641899",
"0.56347156",
"0.5632563",
"0.5625042",
"0.56220305",
"0.56110966",
"0.5609673",
"0.5599001",
"0.5596957",
"0.5573642",
"0.5572715",
"0.5572673",
"0.55657107",
"0.5533995",
"0.5506975",
"0.5480332",
"0.54771614",
"0.5465294",
"0.54645896",
"0.5456852",
"0.54542977",
"0.5452406",
"0.54490614",
"0.54468614",
"0.5442759",
"0.5433501",
"0.54306513",
"0.54260176",
"0.5424229",
"0.54210615",
"0.5418515",
"0.5408739",
"0.54051095",
"0.5399376",
"0.5381411",
"0.53801167",
"0.5361622",
"0.5360457",
"0.5360249",
"0.53552866",
"0.5345465",
"0.5343509",
"0.5343179",
"0.53403026",
"0.5337765",
"0.5326303",
"0.53212684",
"0.5319002",
"0.53188384",
"0.5309743",
"0.53088754",
"0.52860826",
"0.5285841",
"0.5262744",
"0.5237523",
"0.52310324",
"0.5220529",
"0.5214723",
"0.52110815",
"0.5210016",
"0.5209383",
"0.5195424",
"0.51935214",
"0.5181766",
"0.51748246",
"0.51741105",
"0.5166483",
"0.51645106",
"0.5163017",
"0.51552355",
"0.51430064",
"0.51399726",
"0.5136179",
"0.5131837"
] | 0.75237286 | 0 |
/ Duplicates word and appends it to the end of word. Tests result in guessPW(). Returns the new word | public static String duplicate(String word){
StringBuilder result = new StringBuilder(word);
guessPW(result.append(word).toString());
return result.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static boolean append(String word){\n\t\tboolean x = false;\n\t\tboolean y = false;\n\t\tfor(int i = 33; i <= 126; i++){\n\t\t\tchar c = (char)i;\n\t\t\tx = guessPW(word.concat(Character.toString(c)));\n\t\t\ty = guessPW(Character.toString(c).concat(word));\n\t\t}\n\n\t\tif(x | y){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"@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 }",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"public void addWord (String word) {\r\n word = word.toUpperCase ();\r\n if (word.length () > 1) {\r\n String s = validateWord (word);\r\n if (!s.equals (\"\")) {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered contained invalid characters\\nInvalid characters are: \" + s, \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n return;\r\n }\r\n checkEasterEgg (word);\r\n words.add (word);\r\n Components.wordList.getContents ().addElement (word);\r\n } else {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered does not meet the minimum requirement length of 2\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }",
"public String scramble(String word)\n {\n int i, j;\n String SwappedString = \"\";\n String first, middle, last;\n int wordLength = word.length();\n for (int k = 0; k < wordLength; k++)\n {\n i = generator.nextInt(wordLength-1);\n j = i+1 + generator.nextInt(wordLength-i-1);\n first = word.substring(0,i);\n middle = word.substring(i+1,j);\n if (j != wordLength)\n {\n last = word.substring(j+1);\n }\n else\n {\n last = \"\";\n }\n SwappedString = first + word.substring(j, j + 1) + middle + word.substring(i, i + 1) + last;\n word = SwappedString;\n }\n return SwappedString;\n }",
"public String getNewWord(){\n\t\tint randomWord = generator.nextInt(wordList.length);\n\t\tString temp = wordList[randomWord];\n\t\treturn temp;\n\t}",
"public static String removeDuplicate(String word) {\n StringBuffer sb = new StringBuffer();\n if(word.length() <= 1) {\n return word;\n }\n char current = word.charAt(0);\n sb.append(current);\n for(int i = 1; i < word.length(); i++) {\n char c = word.charAt(i);\n if(c != current) {\n sb.append(c);\n current = c;\n }\n }\n return sb.toString();\n }",
"public String newWord(String word) {\r\n\t\tthis.word = word;\r\n\t\twordLength = word.length();\r\n\t\ttries = word.length();\r\n\t\tunknownCharactersInWordState = word.length();\r\n\t\twordState = UNKNOWN.repeat(wordLength);\r\n\t\tstringBuilder = new StringBuilder(wordState);\r\n\t\tboolean lose = false;\r\n\t\treturn parseState(lose, false);\r\n\t}",
"public static String reflect2(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(reverse(word));\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public String repeatCharacters(String word) {\n StringBuilder sb = new StringBuilder();\n for (int i = 0; i < word.length(); i++) {\n char c = word.charAt(i);\n sb.append(c);\n if (random.nextFloat() <= 0.5) {\n for (int j = 0; j < random.nextInt(MAX_REPEAT_TIMES); j++) {\n sb.append(c);\n }\n }\n }\n return sb.toString();\n }",
"public static String reducedWord(String word) {\n String lcWord = word.toLowerCase();\n String redVowels = convertVowels(lcWord);\n String noDuplicates = removeDuplicate(redVowels);\n return noDuplicates;\n }",
"public static String \n removeDuplicateWords(String input) \n { \n \n // Regex to matching repeated words. \n String regex \n = \"\\\\b(\\\\w+)(?:\\\\W+\\\\1\\\\b)+\"; \n Pattern p \n = Pattern.compile( \n regex, \n Pattern.CASE_INSENSITIVE); \n \n // Pattern class contains matcher() method \n // to find matching between given sentence \n // and regular expression. \n Matcher m = p.matcher(input); \n \n // Check for subsequences of input \n // that match the compiled pattern \n while (m.find()) { \n input \n = input.replaceAll( \n m.group(), \n m.group(1)); \n } \n return input; \n }",
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"public void addWord(String word) {\n if (word == null || word.equals(\"\")) return;\n char[] str = word.toCharArray();\n WordDictionary cur = this;\n for (char c: str) {\n if (cur.letters[c - 'a'] == null) cur.letters[c - 'a'] = new WordDictionary();\n cur = cur.letters[c - 'a'];\n }\n cur.end = true;\n }",
"public void addWord(Word word);",
"private Set<String> insertionHelper(String word) {\n\t\tSet<String> insertionWords = new HashSet<String>();\n\t\tfor (char letter : LETTERS) {\n\t\t\tfor (int i = 0; i <= word.length(); i++) {\n\t\t\t\tinsertionWords.add(word.substring(0, i) + letter + word.substring(i));\n\t\t\t}\n\t\t}\n\t\treturn insertionWords;\n\t}",
"public void addLettersGuessed(char letter)\n\t {\n\t\t\n\t\t if (mysteryWord.indexOf(letter) == -1)\n\t\t {\n\t\t\t lettersGuessed += letter + \" \"; \n\t\t }\n\t\t \n\t\t missedLetters.setText(lettersGuessed);\n\t\t \n\t }",
"private Set<String> replacementHelper(String word) {\n\t\tSet<String> replacementWords = new HashSet<String>();\n\t\tfor (char letter : LETTERS) {\n\t\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\t\treplacementWords.add(word.substring(0, i) + letter + word.substring(i + 1));\n\t\t\t}\n\t\t}\n\t\treturn replacementWords;\n\t}",
"private void renewWordLevel2()\n {\n givenWord = availableWords.randomWordLevel2();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"private void wordAdd(String word){\n if (!fileWords.containsKey(word)){\n fileWords.put(word,1);\n if (probabilities.containsKey(word)) {\n double oldCount = probabilities.get(word);\n probabilities.put(word, oldCount+1);\n } else {\n probabilities.put(word, 1.0);\n }\n }\n }",
"public void insert(String word) {\n Trie cur = this;\n int i = 0;\n while(i < word.length()) {\n int c = word.charAt(i) - 'a';\n if(cur.tries[c] == null) {\n cur.tries[c] = new Trie();\n }\n cur = cur.tries[c];\n i++;\n }\n cur.hasWord = true;\n }",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\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 static void printDuplicateCharacters(String word) {\r\n\t\tchar[] characters = word.toCharArray();\r\n\t\t// build HashMap with character and number of times they appear in\r\n\t\tMap<Character, Integer> charMap = new HashMap<Character, Integer>();\r\n\t\tfor (Character ch : characters) {\r\n\t\t\tif (charMap.containsKey(ch)) {\r\n\t\t\t\tcharMap.put(ch, charMap.get(ch) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tcharMap.put(ch, 1);\r\n\t\t\t}\r\n\t\t} // Iterate through HashMap to print all duplicate characters of String\r\n\t\tSet<Map.Entry<Character, Integer>> entrySet = charMap.entrySet();\r\n\t\tSystem.out.printf(\"List of duplicate characters in String '%s' %n\", word);\r\n\t\tfor (Map.Entry<Character, Integer> entry : entrySet) {\r\n\t\t\tif (entry.getValue() > 1) {\r\n\t\t\t\tSystem.out.printf(\"%s : %d %n\", entry.getKey(), entry.getValue());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private Word copyWord(Word w1) {\n return new Word(w1.word, w1.subjectivity, w1.position, w1.stemmed, w1.polarity);\n }",
"String selectRandomSecretWord();",
"public static void findDuplicateWords(String inputString)\r\n\t{\r\n\t\t// split the words in words array \r\n\t\tString words[]= inputString.split(\" \");\r\n\t\t\r\n\t\t//Create HashMap for count the words \r\n\t\tHashMap<String, Integer> wordcount = new HashMap<String, Integer>();\r\n\t\t\r\n\t\t// to check each word in given array \r\n\t\t\r\n\t\tfor(String word: words )\r\n\t\t{\r\n\t\t\t//if word is present \r\n\t\t\tif(wordcount.containsKey(word)) {\r\n\t\t\t\twordcount.put(word.toLowerCase(), wordcount.get(word)+1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twordcount.put(word,1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//extracting all the keys of map : wordcount\r\n\t\tSet<String> wordInString = wordcount.keySet();\r\n\t\t\r\n\t\t// iterate the loop through all the wors in wordCount \r\n\t\tfor(String word : wordInString)\r\n\t\t{\r\n\t\t\tif(wordcount.get(word)>1)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(word+ \" : \" + wordcount.get(word));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }",
"public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n String initialString = \"Dong-ding-dong\";\n String secondaryString = in.nextLine();\n\n // Stage 1 : count the letters\n int letterCounter = 0;\n for (int i = 0; i < initialString.length(); i++) {\n if (Character.isLetter(initialString.charAt(i))) {\n letterCounter++;\n }\n }\n System.out.println(\"Initial string contains \" + letterCounter + \" letters.\");\n\n // Stage 2: check if hardcoded string and inputed string are equal ignoring the case\n System.out.println(\"Are the two strings equal? 0 if yes : \" + initialString.compareToIgnoreCase(secondaryString));\n\n // Stage 3: show initial string as all caps and all lowercase\n System.out.println(initialString.toUpperCase());\n System.out.println(initialString.toLowerCase());\n\n // Stage 4: show all dongdexes\n for(int i = -1; i <= initialString.length();){\n i = initialString.toLowerCase().indexOf(\"dong\", i+1);\n if(i != -1){\n System.out.println(i);\n }\n else{\n break;\n }\n }\n\n // Stage 5: replace all words \"dong\" with \"bong\"\n initialString = initialString.toLowerCase().replaceAll(\"dong\",\"bong\");\n System.out.println(initialString);\n\n // Stage 6: search for duplicated words and show their count\n String[] words = initialString.toLowerCase().split(\"-\");\n int counter = 0;\n for(String word : words){\n if(word != \"\"){\n for(int i = 0; i < words.length; i++){\n if(word.matches(words[i])){\n counter++;\n words[i] = \"\";\n }\n }\n System.out.println(\"The word \" + word + \" is repeated \" + counter + \" times.\");\n word = \"\";\n counter = 0;\n }\n }\n }",
"private String generateRandomWord()\n {\t\n\tRandom randomNb = new Random(System.currentTimeMillis());\n\tchar [] word = new char[randomNb.nextInt(3)+5];\n\tfor(int i=0; i<word.length; i++)\n\t word[i] = letters[randomNb.nextInt(letters.length)];\n\treturn new String(word);\n }",
"private String pickWord() {\n \thangmanWords = new HangmanLexicon();\n \tint randomWord = rgen.nextInt(0, (hangmanWords.getWordCount() - 1)); \n \tString pickedWord = hangmanWords.getWord(randomWord);\n \treturn pickedWord;\n }",
"public static String newWord(String strw) {\n String value = \"Encyclopedia\";\n for (int i = 1; i < value.length(); i++) {\n char letter = 1;\n if (i % 2 != 0) {\n letter = value.charAt(i);\n }\n System.out.print(letter);\n }\n return value;\n }",
"public void addWord(String word) {\n // Write your code here\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (now.children[c - 'a'] == null) {\n now.children[c - 'a'] = new TrieNode();\n }\n now = now.children[c - 'a'];\n }\n now.hasWord = true;\n }",
"private void newWord() {\r\n defaultState();\r\n int random_id_String = 0;\r\n int random_id_Char[] = new int[4];\r\n Random random = new Random();\r\n if (wordNumber == WordCollection.NO_OF_WORDS) return;//quit if all word list is complete;\r\n wordNumber++;\r\n //in case the word has already occured\r\n while (currentWord.equals(\"\")) {\r\n random_id_String = random.nextInt(WordCollection.NO_OF_WORDS);\r\n currentWord = tempWord[random_id_String];\r\n }\r\n currentWord.toUpperCase();\r\n tempWord[random_id_String] = \"\";//so that this word will not be used again in the game session\r\n //generates 4 random nums each for each btn char\r\n for (int i = 0; i < 4; i++) {\r\n random_id_Char[i] = (random.nextInt(4));\r\n for (int j = i - 1; j >= 0; j--) {\r\n if (random_id_Char[i] == random_id_Char[j]) i--;\r\n }\r\n }\r\n\r\n btn1.setText((currentWord.charAt(random_id_Char[0]) + \"\").toUpperCase());\r\n btn2.setText((currentWord.charAt(random_id_Char[1]) + \"\").toUpperCase());\r\n btn3.setText((currentWord.charAt(random_id_Char[2]) + \"\").toUpperCase());\r\n btn4.setText((currentWord.charAt(random_id_Char[3]) + \"\").toUpperCase());\r\n }",
"public String scramble(String wordToScramble){\n\t\tString scrambled = \"\";\n\t\tint randomNumber;\n\n\t\tboolean letter[] = new boolean[wordToScramble.length()];\n\n\t\tdo {\n\t\t\trandomNumber = generator.nextInt(wordToScramble.length());\n\t\t\tif(letter[randomNumber] == false){\n\t\t\t\tscrambled += wordToScramble.charAt(randomNumber);\n\t\t\t\tletter[randomNumber] = true;\n\t\t\t}\n\t\t} while(scrambled.length() < wordToScramble.length());\n\n\t\tif(scrambled.equals(wordToScramble))\n\t\t\tscramble(word);\n\n\t\treturn scrambled;\n\t}",
"public static void main(String[] args) {\nString word = \"aabbaaaccbbaacc\";\n String result = \"\";\n\n for (int i = 0; i <=word.length()-1 ; i++) {\n\n if(!result.contains(\"\"+word.charAt(i))){ //if the character is not contained in the result yet\n result+=word.charAt(i); //then add the character to the result\n }\n\n }\n System.out.println(result);\n\n\n\n }",
"private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}",
"public void addWord(String word) {\n TrieNode curr = root;\n for (char c : word.toCharArray()) {\n curr = curr.chars.computeIfAbsent(c, (k) -> new TrieNode());\n\n }\n curr.isWord = true;\n }",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"public void addWord(String word) {\n maxLength = Math.max(maxLength, word.length());\n\n TrieNode temp = root;\n for (int i = 0; i < word.length(); i++) {\n char c = word.charAt(i);\n if (temp.children[c - 'a'] == null) {\n temp.children[c - 'a'] = new TrieNode(c);\n }\n temp = temp.children[c - 'a'];\n }\n temp.isWord = true;\n }",
"@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }",
"public static String findReplacements(TreeSet<String> dictionary, \n\t\t\t\t\t String word)\n\t{\n\t String replacements = \"\";\n\t String leftHalf, rightHalf, newWord;\n\t int deleteAtThisIndex, insertBeforeThisIndex;\n\t char index;\n\t TreeSet<String> alreadyDoneNewWords = new TreeSet<String>();\n\t /* The above TreeSet<String> will hold words that the spell checker\n\t suggests as replacements. By keeping track of what has already\n\t been suggested, the method can make sure not to output the\n\t same recommended word twice. For instance, the word \n\t \"mispelled\" would ordinarily result in two of the same suggested\n\t replacements: \"misspelled\" (where the additional \"s\" is added to \n\t different locations.) */\n\t \n\t // First, we'll look for words to make by subtracting one letter\n\t // from the misspelled word.\n\t for(deleteAtThisIndex = 0; deleteAtThisIndex < word.length();\n\t\tdeleteAtThisIndex ++)\n\t\t{\n\t\t if(deleteAtThisIndex == 0)\n\t\t\t{\n\t\t\t leftHalf = \"\";\n\t\t\t rightHalf = word;\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\t leftHalf = word.substring(0, deleteAtThisIndex);\n\t\t\t rightHalf = word.substring(deleteAtThisIndex+1,\n\t\t\t\t\t\t word.length());\n\t\t\t}\n\n\t\t newWord = \"\";\n\t\t newWord = newWord.concat(leftHalf);\n\t\t newWord = newWord.concat(rightHalf);\n\t\t if(dictionary.contains(newWord) &&\n\t\t !alreadyDoneNewWords.contains(newWord))\n\t\t\t{\n\t\t\t replacements = replacements.concat(newWord + \"\\n\");\n\t\t\t alreadyDoneNewWords.add(newWord);\n\t\t\t}\n\t\t}\n\n\t // The rest of this method looks for words to make by adding a \n\t // new letter to the misspelled word.\n\t for(insertBeforeThisIndex = 0; \n\t\tinsertBeforeThisIndex <= word.length();\n\t\tinsertBeforeThisIndex ++)\n\t\t{\n\t\t if(insertBeforeThisIndex == word.length())\n\t\t\t{\n\t\t\t leftHalf = word;\n\t\t\t rightHalf = \"\";\n\t\t\t}\n\t\t else\n\t\t\t{\n\t\t\t leftHalf = word.substring(0,insertBeforeThisIndex);\n\t\t\t rightHalf = word.substring(insertBeforeThisIndex,\n\t\t\t\t\t\t word.length());\n\t\t\t}\n\t\t \n\t\t for(index = 'a'; index <= 'z'; index ++)\n\t\t\t{\n\t\t\t newWord = \"\";\n\t\t\t newWord = newWord.concat(leftHalf);\n\t\t\t newWord = newWord.concat(\"\" + index + \"\");\n\t\t\t newWord = newWord.concat(rightHalf);\n\t\t\t \n\t\t\t if(dictionary.contains(newWord) &&\n\t\t\t !alreadyDoneNewWords.contains(newWord))\n\t\t\t\t{\n\t\t\t\t replacements \n\t\t\t\t\t= replacements.concat(newWord + \"\\n\");\n\t\t\t\t alreadyDoneNewWords.add(newWord);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t return replacements;\n\t}",
"private void renewWordLevel4()\n {\n givenWord = availableWords.randomWordLevel4();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public void addWord(String word) {\n \tTrieNode curr=root;\n for(int i=0;i<word.length();i++){\n \tchar ch=word.charAt(i);\n \tif(curr.children[ch-'a']==null)\n \t\tcurr.children[ch-'a']=new TrieNode();\n \tif(i==word.length()-1)\n \t\tcurr.children[ch-'a'].isCompleteword=true;\n \t\n \tcurr=curr.children[ch-'a'];\n }\n }",
"private void wordBreakRecur(String word, String result) {\n\t\tint size = word.length();\n\n\t\tfor (int i = 1; i <= size; i++) {\n\t\t\tString prefix = word.substring(0, i);\n\n\t\t\tif (dictionaryContains(prefix)) {\n\t\t\t\tif (i == size) {\n\t\t\t\t\tresult += prefix;\n\t\t\t\t\tSystem.out.println(result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twordBreakRecur(word.substring(i), result + prefix + \" \");\n\t\t\t}\n\t\t}\n\t}",
"private String doubleFinalConsonant(String word) {\n\t\tStringBuffer buffer = new StringBuffer(word);\n\t\tbuffer.append(buffer.charAt(buffer.length() - 1));\n\t\treturn buffer.toString();\n\t}",
"public String generateWord(String prewordTwo, String prewordOne) {\n\t//double sample = Math.random();\n\t//if(sample < Weights[0]){\n\t return Trigram.generateWord(prewordTwo, prewordOne);\n\t /*} else if(sample < Weights[0] + Weights[1]){\n\t return Bigram.generateWord(prewordOne);\n\t} else {\n\t return Unigram.generateWord();\n\t }*/\n\t\n\n\n\n\t/*\tdouble sum = 0.0;\n\tString result = Trigram.generateWord(Weights[0], sample);\n\tif(!reults.equals(\"*UNKNOWN*\")) return result;\n\tsample -= Weights[0];\n\tresult = Bigram.generateWord(Weights[1], sample);\n\tif(!reults.equals(\"*UNKNOWN*\")) return result;\n\treturn Unigram.generateWord(Weights[2], \n\t*/\n\t/*for(String word : Trigram.wordCounter.keySet()) {\n\t sum += Weights[0] * Trigram.wordCounter.getCount(word) / Trigram.getTotal();\n\t if(sum > sample) {\n\t\treturn word;\n\t }\n\t}\n\t*/\n\t\n }",
"public void addWord(String word) {\n // Write your code here\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (!now.children.containsKey(c)) {\n now.children.put(c, new TrieNode());\n }\n now = now.children.get(c);\n }\n now.hasWord = true;\n }",
"public void populateWord(String word) {\n\t\tthis.add(word);\n\t}",
"public void addWord(String word) {\n TrieNode cur = root;\n for (int i=0; i<word.length(); i++) {\n int pos = word.charAt(i) - 'a';\n if (cur.next[pos] == null) {\n cur.next[pos] = new TrieNode();\n }\n cur = cur.next[pos];\n }\n cur.isWord = true;\n }",
"public boolean addWord(String word) {\n return false;\n }",
"public void setWord(String newWord)\n\t{\n\t\tword = newWord;\n\t}",
"public void addWord(String word) {\n TrieNode cur = root;\n for(char c : word.toCharArray()) {\n if(cur.next[c-'a'] == null) {\n cur.next[c-'a'] = new TrieNode(c);\n }\n cur = cur.next[c-'a'];\n }\n cur.isWord = true;\n }",
"public void add(String word) {\n Signature sig = new Signature(word);\n add(sig, word);\n }",
"public static void main(String[] args) {\n List<String> words = new ArrayList<>();\n try (BufferedReader br = new BufferedReader(new FileReader(\"google-10000-english-no-swears.txt\"))) {\n while (br.ready()) {\n words.add(br.readLine().toLowerCase());\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n //send a message to rose with the word cookie and your team name to get the next clue\n List<String> cipherWords = new ArrayList<>(Arrays.asList(cipher.split(\" \")));\n\n\n HashMap<Character, List<String>> charOccurrences = new HashMap<>();\n //Add all words where a character occurs to a list then map that list to the character\n for (String cipherWord : cipherWords) {\n for (Character ch : cipherWord.toCharArray()) {\n for (String cipherWord2 : cipherWords) {\n if (cipherWord2.contains(ch.toString())) {\n if (charOccurrences.get(ch) == null) {\n charOccurrences.put(ch, (new ArrayList<>(Collections.singletonList(cipherWord2))));\n } else {\n if (!charOccurrences.get(ch).contains(cipherWord2)) {\n charOccurrences.get(ch).add(cipherWord2);\n }\n }\n }\n }\n }\n }\n HashMap<Character, List<Character>> possibleChars = new HashMap<>();\n //Map all characters to a list of all characters which it could possibly be\n for (Map.Entry<Character, List<String>> entry : charOccurrences.entrySet()) {\n Character key = entry.getKey();\n List<String> value = entry.getValue();\n\n List<List<Character>> lists = new ArrayList<>();\n\n for (String string : value) {\n List<Character> characterList = new ArrayList<>();\n for (String patternMatch : getMatches(string, words)) {\n if (!characterList.contains(patternMatch.charAt(string.indexOf(key)))) {\n characterList.add(patternMatch.charAt(string.indexOf(key)));\n }\n }\n lists.add(characterList);\n }\n possibleChars.put(key, findDupes(lists));\n }\n\n HashMap<Character, Character> keyMap = new HashMap<>();\n\n removeCharacter(possibleChars, keyMap, true);\n\n\n //Loop a bunch of times to eliminate things that characters cant be\n for (int x = 0; x < 10; x++) {\n HashMap<Character, List<Character>> tempMap = new HashMap<>(possibleChars);\n possibleChars.clear();\n for (Map.Entry<Character, List<String>> entry : charOccurrences.entrySet()) {\n Character key = entry.getKey();\n List<String> value = entry.getValue();\n\n List<List<Character>> lists = new ArrayList<>();\n\n for (String string : value) {\n List<Character> characterList = new ArrayList<>();\n for (String patternMatch : getMatchesWithLetters(string, keyMap, tempMap, words)) {\n if (!characterList.contains(patternMatch.charAt(string.indexOf(key)))) {\n characterList.add(patternMatch.charAt(string.indexOf(key)));\n }\n }\n lists.add(characterList);\n }\n possibleChars.put(key, findDupes(lists));\n }\n\n keyMap.clear();\n\n removeCharacter(possibleChars, keyMap, true);\n\n }\n\n System.out.println(cipher);\n //print with a lil bit of frequency analysis to pick most common word if word has multiple possible results\n for (String str : cipherWords) {\n String temp = \"\";\n List<String> matchedWords = getMatchesWithLetters(str, keyMap, possibleChars, words);\n if (matchedWords.size() > 1) {\n int highest = 0;\n for (int x = 1; x < matchedWords.size(); x++) {\n if (words.indexOf(matchedWords.get(highest)) > words.indexOf(matchedWords.get(x))) {\n highest = x;\n }\n }\n temp = matchedWords.get(highest);\n }\n\n if (matchedWords.size() == 1) { //if there only 1 possibility print it.\n System.out.print(matchedWords.get(0));\n System.out.print(\" \");\n } else { //if there's more than 1 print the most common one.\n System.out.print(temp);\n System.out.print(\" \");\n }\n }\n }",
"public static String modifyGuess(char inChar, String word, String starredWord) {\n\t\tString starWord = starredWord;\n\t\t\n\t\tfor(int i = 0; i < word.length(); i++) {\n\t\t\tif(word.charAt(i) == inChar) {\n\t\t\t\tstarWord = starWord.substring(0,i) + word.charAt(i) + starWord.substring(i+1,starWord.length());\n\t\t\t\t//System.out.println(starWord.substring(i,starWord.length()-1));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(starWord);\n\t\treturn starWord;\n\t}",
"public String[][] findSuggestions(String w) {\n ArrayList<String> suggestions = new ArrayList<>();\n String word = w.toLowerCase();\n // parse through the word - changing one letter in the word\n for (int i = 0; i < word.length(); i++) {\n // go through each possible character difference\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n // get the character that will change in the word\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n \n // if the selected character is not the same as the character to change - avoids getting the same word as a suggestion\n if (c != word.charAt(i)) {\n // change the character in the word\n String check = word.substring(0, i) + c.toString() + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - adding one letter to the word\n for (int i = 0; i < word.length(); i++) {\n // if the loop is not on the last charcater\n if (i < word.length() - 1) {\n // check words with one character added between current element and next element\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word.substring(0, i) + c.toString() + ((i < word.length()) ? word.substring(i, word.length()) : \"\");\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n // if the loop is on the last character\n else {\n // check the words with one character added to the end of the word\n for (int j = 0; j < Node.NUM_VALID_CHARS; j++) {\n Character c = (char) ((j < 26) ? j + 'a' : '\\'');\n\n // add the character to the word\n String check = word + c;\n\n // if the new word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n }\n }\n \n // parse through the word - removing one letter from the word\n for (int i = 0; i < word.length(); i++) {\n // remove the chracter at the selected index from the word\n String check = word.substring(0, i) + ((i + 1 < word.length()) ? word.substring(i + 1, word.length()) : \"\");\n\n // if the chenged word is in the dictionary, add it to the list of suggestions\n if (this.checkDictionary(check)) {\n suggestions.add(check);\n }\n }\n \n String[][] rtn = new String[suggestions.size()][1];\n for (int i = 0, n = suggestions.size(); i < n; i++) {\n rtn[i][0] = suggestions.get(i);\n }\n \n return rtn;\n }",
"private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public void addWord(String word)\n {\n TrieNode1 node = root;\n for (char c:word.toCharArray())\n {\n if (node.childerens[c-'a']==null)\n {\n node.childerens[c-'a'] = new TrieNode1();\n }\n node = node.childerens[c-'a'];\n }\n node.isEnd = true;\n\n }",
"void solution() {\n\t\t/* Write a RegEx matching repeated words here. */\n\t\tString regex = \"(?i)\\\\b([a-z]+)\\\\b(?:\\\\s+\\\\1\\\\b)+\";\n\t\t/* Insert the correct Pattern flag here. */\n\t\tPattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);\n\n\t\tString[] in = { \"I love Love to To tO code\", \"Goodbye bye bye world world world\",\n\t\t\t\t\"Sam went went to to to his business\", \"Reya is is the the best player in eye eye game\", \"in inthe\",\n\t\t\t\t\"Hello hello Ab aB\" };\n\t\tfor (String input : in) {\n\t\t\tMatcher m = p.matcher(input);\n\n\t\t\t// Check for subsequences of input that match the compiled pattern\n\t\t\twhile (m.find()) {\n\t\t\t\t// /* The regex to replace */, /* The replacement. */\n\t\t\t\tinput = input.replaceAll(m.group(), m.group(1));\n\t\t\t}\n\n\t\t\t// Prints the modified sentence.\n\t\t\tSystem.out.println(input);\n\t\t}\n\n\t}",
"private static String hashWord(String word) {\n int[] counts = new int[26];\n for (char c : word.toCharArray()) { // O(c)\n counts[(int)c-97]++;\n }\n StringBuilder sb = new StringBuilder();\n for (int i : counts) { // O(26)\n sb.append(Integer.toString(i));\n }\n return sb.toString();\n }",
"public abstract String guessedWord();",
"private void update() {\n\t\twhile(words.size()<length) {\n\t\t\twords.add(new Word());\n\t\t}\n\t}",
"public void addWord(String word) {\n dataStructure.put(word, \"\");\n }",
"private void addWordHelper( String word, int pos, TrieNode curNode )\n\t{\n\t\t//Check to see if the node has been occupied yet\n\t\tif( curNode.getLetters()[ (int)word.charAt(pos) - 97 ] == null )\n\t\t\t//If we are at the last character of the word\n\t\t\tif( pos >= word.length() - 1 )\n\t\t\t\t//Make sure the isWord property is set to true\n\t\t\t\tcurNode.setLetter( word.charAt( pos ), true );\n\t\t\telse\n\t\t\t\tcurNode.setLetter( word.charAt( pos ), false );\n\t\t\n\t\t//If it hasn't reached the last letter yet\n\t\tif( !( pos >= word.length() - 1 ) )\n\t\t\t//Keep on adding the word\n\t\t\taddWordHelper( word, pos + 1, curNode.getLetters()[ (int)word.charAt( pos ) - 97 ] );\n\t}",
"public void addWord(String word) {\n //Corner Case\n if(word == null || word.length() == 0){\n return;\n }\n TrieNode node = root;\n int d = 0;\n \n while(d<word.length()){\n char c = word.charAt(d);\n if(node.next[c-'a']==null){\n node.next[c-'a'] = new TrieNode();\n }\n node = node.next[c-'a'];\n d++;\n }\n \n node.isWord = true;\n }",
"abstract String makeAClue(String puzzleWord);",
"public String buildWord() {\n\t\tStringBuilder word = new StringBuilder();\n\t\t\n\t\tfor(int i = 0; i < letters.size(); i++) {\n\t\t\tLetter tempLetter = letters.get(i);\n\t\t\t\n\t\t\tif(!(letters.get(i).getLetter() >= 'A' && letters.get(i).getLetter() <= 'Z') || tempLetter.getStatus())\n\t\t\t\tif(letters.get(i).getLetter() != ' ')\n\t\t\t\t\tword.append(tempLetter.getLetter());\n\t\t\t\telse\n\t\t\t\t\tword.append(\" \");\n\t\t\telse\n\t\t\t\tif (i == letters.size()-1) word.append(\"_\");\n\t\t\t\telse word.append(\"_ \");\n\t\t}\n\t\treturn word.toString();\n\t}",
"public String getSecretWord() {\r\n \tint index = (int) (Math.random() * this.activeWords.size());\r\n return this.activeWords.get(index);\r\n }",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"public static void main(String[] args) {\r\n // TODO code application logic here\r\n String finalWord = stringGen(0); // Generate Random String to find words in\r\n \r\n String correctGuesses[];\r\n correctGuesses = new String[50];\r\n Boolean running = true;\r\n \r\n System.out.println(finalWord); \r\n \r\n Scanner s = new Scanner(System.in); // sets up user input\r\n \r\n while (running){ // while user still wants to play...\r\n System.out.print(\"Enter a word found in this puzzle (or QUIT to quit): \");\r\n String input = s.nextLine(); // Gets user input\r\n if(quit(input)){\r\n break;\r\n }\r\n if (input.equals(\"yarrimapirate\")) {\r\n yarrimapirate();\r\n }\r\n if(!compare(correctGuesses, input)) { // guessed word isnt in prev list\r\n if(checkWord(finalWord, input)) { // guessed word is found in string\r\n correctGuesses[correctCounter] = input;\r\n System.out.println(\"Yes,\" + input + \" is in the puzzle.\");\r\n correctCounter++;\r\n }\r\n else { // exactly what next line says o.O\r\n System.out.println(input + \" is NOT in the puzzle.\");\r\n }\r\n }\r\n else {\r\n System.out.println(\"Sorry, you have already found that word.\");\r\n }\r\n }\r\n \r\n System.out.println(\"You found the following \" + correctCounter + \" words in the puzzle:\");\r\n \r\n for(int x=0; x<correctCounter; x++) { // lets print out all Correct guesses!\r\n System.out.println(correctGuesses[x]);\r\n }\r\n \r\n }",
"public void addWord(String word) {\r\n Trie node = root;\r\n for(char ch: word.toCharArray()){\r\n if(node.child[ch - 'a'] == null)\r\n node.child[ch - 'a'] = new Trie(ch);\r\n node = node.child[ch - 'a'];\r\n }\r\n node.end = true;\r\n }",
"public void insert(String word) {\n\t\tTrie curr = this;\n\t\tfor(Character ch : word.toCharArray()) {\n\t\t\tTrie n = curr.nodes[ch - 'a'];\n\t\t\t\n\t\t\tif (n == null) {\n\t\t\t\tn = new Trie();\n\t\t\t\tn.isWord = false;\n\t\t\t\tcurr.nodes[ch - 'a'] = n;\n\t\t\t}\n\t\t\t\n\t\t\tcurr = n;\n\t\t}\n\t\tcurr.isWord = true;\n\t}",
"private Map<String, Double> distance1Generation(String word) {\n if (word == null || word.length() < 1) throw new RuntimeException(\"Input words Error: \" + word);\n\n Map<String, Double> result = new HashMap<String, Double>();\n\n String prev;\n String last;\n\n for (int i = 0; i < word.length(); i++) {\n // Deletion\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n result.put(prev + last, 1.0);\n\n // transposition\n if ((i + 1) < word.length()) {\n prev = word.substring(0, i);\n last = word.substring(i + 2, word.length());\n String trans = prev + word.charAt(i + 1) + word.charAt(i) + last;\n result.put(trans, 1.0);\n }\n\n // alter\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n for (int j = 0; j < 26; j++) {\n result.put(prev + (char) (j + 97) + last, 1.0);\n }\n\n // insertion\n prev = word.substring(0, i);\n last = word.substring(i + 1, word.length());\n for (int j = 0; j < 26; j++) {\n result.put(prev + (char) (j + 97) + word.charAt(i) + last, 1.0);\n result.put(prev + word.charAt(i) + (char) (j + 97) + last, 1.0);\n }\n\n }\n\n result.remove(word);\n return result;\n }",
"public void addWord(String word) {\n TrieNode curr = root;\n for (int i = 0; i < word.length(); i++) {\n char c = word.charAt(i);\n if (curr.children[c - 'a'] == null )\n curr.children[c - 'a'] = new TrieNode();\n curr = curr.children[c - 'a'];\n }\n curr.end = true;\n }",
"public void getNewWord(JTextField textField, JTextField clue) {\n\t\ttextField.setText(\"\");\n\t\tclue.setText(\"\");\n\t for(Letter l : letters) l.setStatus(false);\n\t letters.clear();\n\t setWord();\n\t for(int i = 0; i < guessedLetter.length; i++)\n\t \tguessedLetter[i] = false;\n\t}",
"public boolean addWord(String word) {\n // TODO: Implement this method.\n char[] c = word.toLowerCase().toCharArray();\n\n TrieNode predptr = root;\n boolean isWord = false;\n\n for (int i = 0, n = c.length; i < n; i++) {\n TrieNode next = predptr.insert(c[i]);\n\n if (next != null) {\n predptr = next;\n } else {\n predptr = predptr.getChild(c[i]);\n }\n\n if (i == n - 1) {\n if (!predptr.endsWord()) {\n size++;\n isWord = true;\n predptr.setEndsWord(true);\n }\n }\n\n }\n return isWord;\n }",
"static boolean findDuplicate (String word)\n {\n Stack<Character> st = new Stack<>();\n for (int i = 0; i < word.length(); i++) {\n\n char currentChar = word.charAt(i);\n\n if (currentChar == ')') {\n\n if (st.peek() == '(') {\n return true;\n }\n else {\n while (st.peek() != '(') {\n st.pop();\n }\n st.pop();\n }\n }\n else {\n st.push(currentChar);\n }\n }\n return false;\n }",
"public static String mut7(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tString temp2 = word +temp;\n\t\tif(pwMatch(temp2, person, w)) \n\t\t\treturn temp2;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\ttemp = temp+word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\n\t\treturn null;\n\t}",
"public static void main(String[] args) {\n\n\t\tString regex = \"\\\\b(\\\\w+)(\\\\b\\\\W+\\\\b\\\\1\\\\b)*\";\n\t\tPattern p = Pattern.compile(regex, Pattern.MULTILINE + Pattern.CASE_INSENSITIVE);\n\n\t\tScanner in = new Scanner(System.in);\n\t\tint numSentences = Integer.parseInt(in.nextLine());\n\n\t\twhile (numSentences-- > 0) {\n\t\t\tString input = in.nextLine();\n\n\t\t\tMatcher m = p.matcher(input);\n\n\t\t\t// Check for subsequences of input that match the compiled pattern\n\t\t\twhile (m.find()) {\n\t\t\t\tinput = input.replaceAll(m.group(), m.group(1));\n\t\t\t}\n\n\t\t\t// Prints the modified sentence.\n\t\t\tSystem.out.println(input);\n\t\t}\n\n\t\tin.close();\n\n\t\tnew RegexDuplicateWord().solution();\n\t}",
"public static char [] insertion(char [] word, int index){\n\t\tchar [] temp = new char[word.length+1];\n\n\t\tfor(int i=0; i<word.length+1; i++){\n\t\t\tif(i<index)\n\t\t\t\ttemp[i] = word[i];\n\t\t\telse if(i == index)\n\t\t\t\ttemp[i] = randomLetter();\n\t\t\telse\n\t\t\t\ttemp[i] = word[i-1];\n\t\t}\n\t\treturn temp;\n\t}",
"public void addWord(String word) {\n char[] chs = word.toCharArray();\n TreeNode cur = root;\n for (int i = 0; i < chs.length; i++) {\n int ind = chs[i] - 'a';\n if (cur.map[ind] == null) {\n cur.map[ind] = new TreeNode();\n }\n cur = cur.map[ind];\n }\n cur.end = true;\n }",
"public String getSecretWord() {\r\n \t//Return remaining word if only 1\r\n \tif (activeWords.size() == 1) {\r\n \t\treturn activeWords.get(0);\r\n \t//return random of remaining\r\n \t} else {\r\n \treturn activeWords.get((int)(Math.random()*activeWords.size()+1));\r\n \t}\r\n }",
"private String getConvertedWord(String word) {\r\n\t\tString newWord = \"\";\r\n\t\tif(word == null || word.length() == 0)\r\n\t\t\tnewWord = \"\";\r\n\t\telse if(word.length() < 3)\r\n\t\t\tnewWord = word;\r\n\t\telse \r\n\t\t\tnewWord = \"\"+word.charAt(0) + (word.length() - 2) + word.charAt(word.length() - 1);\r\n\t\t\t\r\n\t\tif(DEBUG)\r\n\t\t\tSystem.out.printf(\"Converted %s to %s\\n\", word, newWord);\r\n\t\treturn newWord;\r\n\r\n\t}",
"public void repopulateWords()\r\n {\n blankSquares();\r\n\r\n //repopulate words\r\n ArrayList al = crossword.getWords();\r\n for (int i = 0; i < al.size(); i++)\r\n {\r\n Word w = (Word) al.get(i);\r\n ArrayList letters = w.getLetters();\r\n\r\n // Lay out the squares, letter by letter, setting the appropriate properties\r\n if (w.getWordDirection() == Word.ACROSS)\r\n {\r\n for (int j = 0; j < letters.size(); j++)\r\n {\r\n Square s = findSquare(w.getY(), w.getX() + j);\r\n if (s.getLetter() == \" \" || s.getLetter() == \"*\" ||\r\n s.getLetter() == \"\")\r\n {\r\n String let = (String) letters.get(j);\r\n if (let == \"*\")\r\n {\r\n let = \" \";\r\n }\r\n s.setLetter(let);\r\n }\r\n\r\n s.setBackground(Color.WHITE);\r\n s.setBorder(BorderFactory.createLineBorder(Color.BLACK,\r\n 1));\r\n\r\n if (s.isAnyWordSelected())\r\n {\r\n s.setBackground(Color.PINK);\r\n s.setResetColour(Color.PINK);\r\n }\r\n //place the clue number\r\n if (j == 0) //ie. first square of word\r\n {\r\n s.setClueNumber(w.getClueIndex());\r\n }\r\n if (s == selectedSquare)\r\n {\r\n s.setBackground(Color.RED);\r\n s.setResetColour(Color.RED);\r\n }\r\n\r\n }\r\n }\r\n else if (w.getWordDirection() == Word.DOWN)\r\n {\r\n\r\n for (int j = 0; j < letters.size(); j++)\r\n {\r\n Square s = findSquare(w.getY() + j, w.getX());\r\n if (s.getLetter() == \" \" || s.getLetter() == \"*\" ||\r\n s.getLetter() == \"\")\r\n {\r\n String let = (String) letters.get(j);\r\n\r\n if (let == \"*\")\r\n {\r\n let = \" \";\r\n }\r\n s.setLetter(let);\r\n }\r\n s.setBackground(Color.WHITE);\r\n s.setBorder(BorderFactory.createLineBorder(Color.BLACK,\r\n 1));\r\n\r\n if (s.isAnyWordSelected())\r\n {\r\n s.setBackground(Color.PINK);\r\n s.setResetColour(Color.PINK);\r\n }\r\n\r\n //place the clue number\r\n if (j == 0) //ie. first square of word\r\n {\r\n s.setClueNumber(w.getClueIndex());\r\n }\r\n if (s == selectedSquare)\r\n {\r\n s.setBackground(Color.RED);\r\n s.setResetColour(Color.RED);\r\n }\r\n }\r\n }\r\n }\r\n //dissociate any blank squares from legacy word relationships\r\n dissociateSquares();\r\n validate();\r\n }",
"public String getGoodWordStartingWith(String s) {\n Random random = new Random();\n String x = s;\n TrieNode temp = searchNode(s);\n if (temp == null){\n return \"noWord\";\n }\n // get a random word\n ArrayList<String> charsNoWord = new ArrayList<>();\n ArrayList<String> charsWord = new ArrayList<>();\n String c;\n\n while (true){\n charsNoWord.clear();\n charsWord.clear();\n for (String ch: temp.children.keySet()){\n if (temp.children.get(ch).isWord){\n charsWord.add(ch);\n } else {\n charsNoWord.add(ch);\n }\n }\n System.out.println(\"------>\"+charsNoWord+\" \"+charsWord);\n if (charsNoWord.size() == 0){\n if(charsWord.size() == 0){\n return \"sameAsPrefix\";\n }\n s += charsWord.get( random.nextInt(charsWord.size()) );\n break;\n } else {\n c = charsNoWord.get( random.nextInt(charsNoWord.size()) );\n s += c;\n temp = temp.children.get(c);\n }\n }\n if(x.equals(s)){\n return \"sameAsPrefix\";\n }else{\n return s;\n }\n }",
"public void insert(String word) {\n TrieNode now = root;\n for(int i = 0; i < word.length(); i++) {\n Character c = word.charAt(i);\n if (!now.children.containsKey(c)) {\n now.children.put(c, new TrieNode());\n }\n now = now.children.get(c);\n }\n now.hasWord = true;\n}",
"public boolean compareWords(String word1, String word2) {\n for (int i = 1; i < 5; i++) {\n if (word2.indexOf(word1.charAt(i)) >= 0) {\n word2.replace(word1.charAt(i), ' ');\n } else\n return false;\n }\n\n return true;\n }",
"public void insert(String word) {\n TrieNode cur = root;\n HashMap<Character, TrieNode> curChildren = root.children;\n char[] wordArray = word.toCharArray();\n for(int i = 0; i < wordArray.length; i++){\n char wc = wordArray[i];\n if(curChildren.containsKey(wc)){\n cur = curChildren.get(wc);\n } else {\n TrieNode newNode = new TrieNode(wc);\n curChildren.put(wc, newNode);\n cur = newNode;\n }\n curChildren = cur.children;\n if(i == wordArray.length - 1){\n cur.hasWord= true;\n }\n }\n }",
"public static String makeItStrong(String s){\r\n //noOfChanges = the minimum number of changes\r\n int noOfChanges = 0;\r\n Random r = new Random();\r\n // a new character used for replacement\r\n char newChar = 0;\r\n\r\n Password password = new Password(s);\r\n String newPassword = password.getPassword();\r\n Password strongerPassword = new Password(newPassword);\r\n\r\n //if the inserted password is already strong returns 0\r\n if(strongerPassword.checkIfStrong())\r\n return \"0\";\r\n\r\n //if the password doesn't have any digit one will be added\r\n if(!strongerPassword.hasDigit()) {\r\n newPassword = newPassword.concat(String.valueOf(r.nextInt(10)));\r\n noOfChanges ++;\r\n\r\n }\r\n\r\n //if the password doesn't have any lowercase letters one will be added\r\n if(!strongerPassword.hasLowercase()){\r\n newChar = (char) ('a' + r.nextInt(26));\r\n newPassword = newPassword.concat(String.valueOf(newChar).toLowerCase());\r\n noOfChanges ++;\r\n }\r\n\r\n //if the password doesn't have any uppercase, one will be added\r\n if(!strongerPassword.hasUppercase()){\r\n newChar = (char) ('A' + r.nextInt(26));\r\n newPassword = newPassword.concat(String.valueOf(newChar).toUpperCase());\r\n noOfChanges ++;\r\n }\r\n\r\n //if the length of the possible-modified password is less than 6 will be inserted the minimum number of characters\r\n //in order for the length to be 6\r\n if (newPassword.length() < 6) {\r\n for (int i = 0; i < 6 - newPassword.length(); i++) {\r\n newPassword = newPassword.concat(String.valueOf(newChar));\r\n noOfChanges++;\r\n }\r\n }\r\n\r\n //if the length of the possible-modified password is bigger than 20, will be deleted the minimum number of characters\r\n //in order for the length to be 20\r\n if(password.getPassword().length() > 20) {\r\n for (int i = 0; i <= password.getPassword().length() - 20; i++) {\r\n strongerPassword = new Password(strongerPassword.deletion());\r\n newPassword = strongerPassword.getPassword();\r\n noOfChanges++;\r\n }\r\n if(!strongerPassword.hasDigit()){\r\n newPassword = newPassword.concat(String.valueOf(r.nextInt(10)));\r\n }\r\n }\r\n\r\n //if there are are more than 2 identical characters, one of the character will be either removed or replaced\r\n if(strongerPassword.charactersNearEachOther()){\r\n\r\n char[] passwordToChar = newPassword.toCharArray(); //creating an array of characters with the passwords length\r\n StringBuffer stringBuffer = new StringBuffer(newPassword);\r\n\r\n for( int i = 0; i < newPassword.length()-1; i++) {\r\n if (passwordToChar[i] == passwordToChar[i + 1]){\r\n\r\n //checking if the password would have the right length if a character will be deleted,\r\n //then going further withe the deletion of one of the duplicate characters\r\n if (new Password(strongerPassword.deletion()).checkLength()) {\r\n newPassword = String.valueOf(stringBuffer.deleteCharAt(i));\r\n noOfChanges++;\r\n i++;\r\n }\r\n //if the length would be too short, one of the duplicate characters will be replaced with a random character\r\n //if newChar(the random character) is the same as the character to be deleted, we'll get another random value\r\n else if (!new Password(strongerPassword.deletion()).checkLength()) {\r\n\r\n if (newChar != passwordToChar[i]){\r\n newPassword = strongerPassword.replacement(passwordToChar[i], newChar);\r\n noOfChanges ++;\r\n }\r\n else {\r\n newChar = (char) ('A' + r.nextInt(26));\r\n newPassword = strongerPassword.replacement(passwordToChar[i], newChar);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return \"An alternative for your password to be stronger: \" + newPassword +\r\n \"\\nThe minimum number of changes: \" + noOfChanges;\r\n }",
"public void insert(String word) {\n Node<String> current = list.getFirst();\n\n while (current != null) {\n String another = (String) current.getValue();\n\n for (int i = 0; i < word.length(); i++) {\n if (word.charAt(i) == another.charAt(i)) {}\n else if (word.charAt(i) < another.charAt(i)) {\n Node<String> node = new Node<String>(word);\n current.getPrevious().setNext(node);\n node.setPrevious(current.getPrevious());\n node.setNext(current);\n current.setPrevious(node);\n return;\n } else { break; }\n }\n current = current.getNext();\n }\n list.getLast().setNext(new Node<String>(word));\n return;\n }",
"public static String delLastChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(0, word.length() - 1);\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"void setWordGuessed( String word )\n\t{\n\t\tfor( int i = 0; i < entry.getLinkedWords().size(); i++ )\n\t\t\tif( entry.getLinkedWords().elementAt(i).equals(word) )\n\t\t\t{\n\t\t\t\twordGuessed[i] = true;\n\t\t\t\twPanel.showWord(i);\n\t\t\t}\n\t}",
"public void insert(String word) {\n Trie root = this;\n for (char c : word.toCharArray()) {\n if (root.next[c - 'a'] == null) {\n root.next[c - 'a'] = new Trie();\n }\n root = root.next[c - 'a'];\n }\n root.word = word;\n }",
"public static HashMap<String,String> nextWord(){\r\n\t\t \r\n\t\tString q1 = \"paple\";\r\n\t\tString a1 = \"apple\";\r\n\t\tString q2 = \"roange\";\r\n\t\tString a2 = \"orange\";\r\n\t\t\r\n\t\tHashMap<String, String> hm = new HashMap<>();\r\n\t\thm.put(q1, a1);\r\n\t\thm.put(q2,a2);\r\n\t\treturn hm;\r\n\t}",
"void addWord(Nod n, String word) {\n\t\tint i = 0;\n\t\twhile (i < 26) {\n\n\t\t\tif (n.frunze.get(i).cuvant.equals(\"%\")) {\n\t\t\t\tn.frunze.get(i).cuvant = word;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}"
] | [
"0.6884019",
"0.6496189",
"0.64303136",
"0.6380039",
"0.62464315",
"0.6243716",
"0.6233326",
"0.622088",
"0.6204423",
"0.6189697",
"0.61721516",
"0.6021148",
"0.60115004",
"0.6010625",
"0.60031176",
"0.5990883",
"0.5981657",
"0.5975669",
"0.58852434",
"0.58754516",
"0.58652365",
"0.58558404",
"0.58142185",
"0.5787839",
"0.57866067",
"0.57702446",
"0.5759123",
"0.5753644",
"0.57527786",
"0.5751251",
"0.5748669",
"0.5744895",
"0.5735204",
"0.57335436",
"0.57328665",
"0.57315415",
"0.57271546",
"0.5721688",
"0.5710071",
"0.5693711",
"0.5687675",
"0.5681378",
"0.5681122",
"0.5675526",
"0.5662178",
"0.5653234",
"0.56358707",
"0.563269",
"0.5631548",
"0.5620139",
"0.5619317",
"0.56187516",
"0.5612257",
"0.56102824",
"0.5597845",
"0.55954033",
"0.55815846",
"0.5569594",
"0.55431587",
"0.5539708",
"0.5531757",
"0.5527934",
"0.5521772",
"0.5516901",
"0.5516153",
"0.55153877",
"0.5512761",
"0.55000067",
"0.54940003",
"0.5482078",
"0.54813623",
"0.54772437",
"0.54757065",
"0.54753864",
"0.5469519",
"0.5469146",
"0.54645",
"0.5461123",
"0.5453871",
"0.5442468",
"0.5433514",
"0.54182667",
"0.5417876",
"0.5408912",
"0.54085666",
"0.54068214",
"0.54042417",
"0.54040974",
"0.54018617",
"0.54016525",
"0.5399224",
"0.53905505",
"0.53884524",
"0.5382398",
"0.53808933",
"0.53802925",
"0.53779614",
"0.5374801",
"0.5370039",
"0.5368872"
] | 0.8141724 | 0 |
/ Flips word and appends it to the end of word. Tests result in guessPW(). Returns the new word. | public static String reflect1(String word){
if(word.length() <= 1){
return word;
}
StringBuilder result = new StringBuilder(word);
result.append(reverse(word)).toString();
return result.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String reflect2(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(reverse(word));\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static String reverse(String word){\n\t\tStringBuilder result = new StringBuilder();\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\n\t\tfor(int i = word.length() - 1; i >= 0; i--){\n\t\t\tresult.append(word.charAt(i));\n\t\t}\n\t\tguessPW(result.toString());\n\t\treturn result.toString();\n\t}",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"private String getConvertedWord(String word) {\r\n\t\tString newWord = \"\";\r\n\t\tif(word == null || word.length() == 0)\r\n\t\t\tnewWord = \"\";\r\n\t\telse if(word.length() < 3)\r\n\t\t\tnewWord = word;\r\n\t\telse \r\n\t\t\tnewWord = \"\"+word.charAt(0) + (word.length() - 2) + word.charAt(word.length() - 1);\r\n\t\t\t\r\n\t\tif(DEBUG)\r\n\t\t\tSystem.out.printf(\"Converted %s to %s\\n\", word, newWord);\r\n\t\treturn newWord;\r\n\r\n\t}",
"private static void reverseWord(String word) {\n // StringBuild.reverse()\n System.out.println(new StringBuilder(word).reverse().toString());\n\n // Add char one by one iteration method\n StringBuilder reversed = new StringBuilder();\n char[] chars = word.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n reversed.append(chars[chars.length - i - 1]);\n }\n System.out.println(reversed.toString());\n }",
"public static boolean append(String word){\n\t\tboolean x = false;\n\t\tboolean y = false;\n\t\tfor(int i = 33; i <= 126; i++){\n\t\t\tchar c = (char)i;\n\t\t\tx = guessPW(word.concat(Character.toString(c)));\n\t\t\ty = guessPW(Character.toString(c).concat(word));\n\t\t}\n\n\t\tif(x | y){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public static void reverser(String word) {\n String newStr = \"\";\n for (int i = word.length(); i > 0; i--) {\n newStr += word.substring(i - 1, i);\n }\n System.out.println(newStr);\n }",
"private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"public static String delLastChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(0, word.length() - 1);\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"public String alternateWordSwap() {\n\t\tString output=\"\";\r\n\t\tString arr[]=this.str.split(\" \");\r\n\t\tfor(int i=0,j=1;i<arr.length;i+=2,j+=2){\r\n\t\t\tString temp=arr[i];\r\n\t\t\tarr[i]=arr[j];\r\n\t\t\tarr[j]=temp;\r\n\t\t}\r\n\t\t\r\n\t\tfor(String s:arr){\r\n\t\t\toutput+=s+\" \";\r\n\t\t}\r\n\t\treturn output.trim();\r\n\t}",
"public static String newWord(String strw) {\n String value = \"Encyclopedia\";\n for (int i = 1; i < value.length(); i++) {\n char letter = 1;\n if (i % 2 != 0) {\n letter = value.charAt(i);\n }\n System.out.print(letter);\n }\n return value;\n }",
"public String makeOutWord(String out, String word) {\r\n String outFrontPart = out.substring(0, 2);\r\n String outRightPart = out.substring(2, 4);\r\n\r\n return outFrontPart + word + outRightPart;\r\n }",
"void putLeftWordToRight(int end) {\n\n String word = bufferLeft.pop();\n int index = end - word.length() + 1;\n System.arraycopy(word.toCharArray(), 0, words, index, word.length());\n words[index-1] = ' ';\n\n }",
"private String doubleFinalConsonant(String word) {\n\t\tStringBuffer buffer = new StringBuffer(word);\n\t\tbuffer.append(buffer.charAt(buffer.length() - 1));\n\t\treturn buffer.toString();\n\t}",
"public String scramble(String word)\n {\n int i, j;\n String SwappedString = \"\";\n String first, middle, last;\n int wordLength = word.length();\n for (int k = 0; k < wordLength; k++)\n {\n i = generator.nextInt(wordLength-1);\n j = i+1 + generator.nextInt(wordLength-i-1);\n first = word.substring(0,i);\n middle = word.substring(i+1,j);\n if (j != wordLength)\n {\n last = word.substring(j+1);\n }\n else\n {\n last = \"\";\n }\n SwappedString = first + word.substring(j, j + 1) + middle + word.substring(i, i + 1) + last;\n word = SwappedString;\n }\n return SwappedString;\n }",
"public String newWord(String word) {\r\n\t\tthis.word = word;\r\n\t\twordLength = word.length();\r\n\t\ttries = word.length();\r\n\t\tunknownCharactersInWordState = word.length();\r\n\t\twordState = UNKNOWN.repeat(wordLength);\r\n\t\tstringBuilder = new StringBuilder(wordState);\r\n\t\tboolean lose = false;\r\n\t\treturn parseState(lose, false);\r\n\t}",
"public static String mut7(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tString temp2 = word +temp;\n\t\tif(pwMatch(temp2, person, w)) \n\t\t\treturn temp2;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\ttemp = temp+word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\n\t\treturn null;\n\t}",
"private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }",
"private String swapFour(int i,char insert,char[]word){\n StringBuilder ste=new StringBuilder(new String(word));\n if(i != word.length)\n ste.insert(i, insert);\n else\n ste.append(insert);\n return new String(ste);\n }",
"public void setWord(String newWord)\n\t{\n\t\tword = newWord;\n\t}",
"public static String mut8(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private void renewWordLevel2()\n {\n givenWord = availableWords.randomWordLevel2();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public void moveFromHandToEndOfWord() {\n\t\t//check letters in hand \n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to end of word\n\t\tword.addToEnd(temp);\n\t}",
"public String encrypt(String word) {\n char[] encrypted = word.toCharArray();\n for (int i = 0; i < encrypted.length; i++){\n if (encrypted[i] == 'x' || encrypted[i] == 'y' || encrypted[i] == 'z'){\n encrypted[i] -= 23;\n } else {\n encrypted[i] += 3;\n }\n \n }\n String encryptedResult = new String(encrypted);\n return encryptedResult;\n }",
"public static void main(String[] args) {\n Scanner input= new Scanner(System.in);\n System.out.println(\" Enter a string value: \");\n String word=input.nextLine();\n String newWord=word.charAt(0)+\"\";\n for (int i = 1; i <word.length() ; i++) {\n if(word.charAt(i)>=65 && word.charAt(i)<=90){\n newWord+=\" \"+word.charAt(i);\n }else{\n newWord+=word.charAt(i);\n }\n\n }\n System.out.println(newWord);\n }",
"public static String mut2(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor(int i=0; i< chars.length; i++) {\n\t\t\ttemp = word + chars[i];\n\t\t\tif(pwMatch(temp, person, w)) \n\t\t\t\treturn temp;\n\t\t\telse if(isDouble)\n\t\t\t\treturn temp;\n\t\t}\n\t\treturn null;\n\t}",
"public void getNewWord(JTextField textField, JTextField clue) {\n\t\ttextField.setText(\"\");\n\t\tclue.setText(\"\");\n\t for(Letter l : letters) l.setStatus(false);\n\t letters.clear();\n\t setWord();\n\t for(int i = 0; i < guessedLetter.length; i++)\n\t \tguessedLetter[i] = false;\n\t}",
"public static String modifyGuess(char inChar, String word, String starredWord) {\n\t\tString starWord = starredWord;\n\t\t\n\t\tfor(int i = 0; i < word.length(); i++) {\n\t\t\tif(word.charAt(i) == inChar) {\n\t\t\t\tstarWord = starWord.substring(0,i) + word.charAt(i) + starWord.substring(i+1,starWord.length());\n\t\t\t\t//System.out.println(starWord.substring(i,starWord.length()-1));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(starWord);\n\t\treturn starWord;\n\t}",
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"public static String mut5(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private void renewWordLevel4()\n {\n givenWord = availableWords.randomWordLevel4();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"private String swapOne(int a,int b,char[] word){\n char tmp=word[a];\n word[a]=word[b];\n word[b]=tmp;\n return new String(word);\n}",
"public static String solution(String word) {\n return Stream.of(word.split(\"\"))\n .reduce(\"\", (original, reverse) ->\n reverse + original);\n }",
"public static String mut11(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1) + \"\" + word.substring(1, word.length()).toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public void setHangmanWord()\n {\n if(word == null || word == \"\") return;\n\n String hangmanWord = \"\";\n for(int i=0; i<word.length(); i++)\n {\n if(showChar[i])\n hangmanWord += word.substring(i, i+1)+\" \";\n else\n hangmanWord += \"_ \";\n }\n\n wordTextField.setText(hangmanWord.substring(0, hangmanWord.length()-1));\n }",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\n\t}",
"public static String mut4(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, word.length()-1);\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String mut10(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1).toUpperCase() + \"\" + word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public String hiddenWord() {\n int hiddenWordUnderscores = 0;\n String hiddenWord = \"\";\n StringBuilder newHiddenWord = new StringBuilder(\"\");\n \n for (int i = 0; i < this.word.length(); i++) {\n hiddenWord += \"_\";\n newHiddenWord.append(\"_\");\n }\n \n // GO THROUGH EACH CHARACTER IN THIS.WORD AND SEE IF IT MATCHES THE GUESS. \n // IF IT DOES, REPLACE THE UNDERSCORE AT THAT INDEX WITH THE GUESSED LETTER.\n for (int i = 0; i < this.word.length(); i++) {\n char currentChar = this.word.charAt(i);\n String currentLetter = \"\" + currentChar;\n \n // IF THE CURRENT LETTER IS IN THE WORD\n if (this.guessedLetters.contains(currentLetter)) {\n // GET THE CURRENT UNDERSCORE OF THE INDEX WE ARE IN, SET IT TO currentChar\n newHiddenWord.setCharAt(i, currentChar);\n }\n } \n hiddenWord = newHiddenWord.toString();\n\n return hiddenWord;\n \n }",
"public String getNewWord(){\n\t\tint randomWord = generator.nextInt(wordList.length);\n\t\tString temp = wordList[randomWord];\n\t\treturn temp;\n\t}",
"public void readWordRightToLeft(String word) {\n }",
"public static String Rule2(String para_word) {\n\t\tint last = para_word.length();\r\n\r\n\t\t// if it ends in y and there is a vowel in steam change it to i\r\n\t\tif ((para_word.charAt(last - 1) == 'y') && wordSteamHasVowel(para_word)) {\r\n\t\t\tpara_word = para_word.substring(0, last - 1) + \"i\";\r\n\t\t}\r\n\r\n\t\treturn para_word;\r\n\t}",
"private void computerTurn() {\n String text = txtWord.getText().toString();\n String nextWord;\n if (text.length() >= 4 && dictionary.isWord(text)){\n endGame(false, text + \" is a valid word\");\n return;\n } else {\n nextWord = dictionary.getGoodWordStartingWith(text);\n if (nextWord == null){\n endGame(false, text + \" is not a prefix of any word\");\n return;\n } else {\n addTextToGame(nextWord.charAt(text.length()));\n }\n }\n userTurn = true;\n txtLabel.setText(USER_TURN);\n }",
"String rotWord(String s) {\n return s.substring(2) + s.substring(0, 2);\n }",
"@Test\n\tpublic void revStrSentances() {\n\n\t\tString s = \"i like this program very much\";\n\t\tString[] words = s.split(\" \");\n\t\tString revStr = \"\";\n\t\tfor (int i = words.length - 1; i >= 0; i--) {\n\t\t\trevStr += words[i] + \" \";\n\n\t\t}\n\n\t\tSystem.out.println(revStr);\n\n\t}",
"public static String reverseWordWise(String input) {\n String output = \"\";\n int index = 0;\n \n for (int i = 0; i < input.length(); i++) {\n if (input.charAt(i) == ' ') {\n index = i+1;\n output += input.charAt(i);\n } else {\n output = output.substring(0,index) + input.charAt(i) + output.substring(index);\n }\n }\n return output;\n\n\t}",
"public void addWord (String word) {\r\n word = word.toUpperCase ();\r\n if (word.length () > 1) {\r\n String s = validateWord (word);\r\n if (!s.equals (\"\")) {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered contained invalid characters\\nInvalid characters are: \" + s, \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n return;\r\n }\r\n checkEasterEgg (word);\r\n words.add (word);\r\n Components.wordList.getContents ().addElement (word);\r\n } else {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered does not meet the minimum requirement length of 2\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }",
"public String getSecretWord() {\r\n \tint index = (int) (Math.random() * this.activeWords.size());\r\n return this.activeWords.get(index);\r\n }",
"public boolean guessIsRight(String secretWord, char guess){\n\t\tboolean isCorrect = false;\n\t\tfor (int i=0; i<secretWord.length(); i++){\n\t\t\tchar secretLetter = secretWord.charAt(i);\n\t\t\tif (secretLetter == guess){\n\t\t\t\t isCorrect = true;\n\t\t\t}\n\t\t}\n\t\treturn isCorrect;\n\t}",
"private String pickWord() {\n \thangmanWords = new HangmanLexicon();\n \tint randomWord = rgen.nextInt(0, (hangmanWords.getWordCount() - 1)); \n \tString pickedWord = hangmanWords.getWord(randomWord);\n \treturn pickedWord;\n }",
"public static void main(String[] args) {\n Scanner input = new Scanner (System.in);\n System.out.println(\"Enter your word here please\");\n String str = input.nextLine();\n int length = str.length();\n\n System.out.println(str.substring(length-1)+ str + ( str.substring(length-1)));\n\n }",
"static String reverseWordsInStringInPlace(StringBuffer input_string){\n //step 1\n int j = -1;\n for(int i = 0; i <input_string.length() ;i++ ){\n if(' ' == input_string.charAt(i)){\n reverseString(input_string,j+1,i-1);\n j=i;\n }\n //for last word\n if(i == input_string.length()-1){\n reverseString(input_string,j+1,i);\n }\n }\n //step 2\n reverseString(input_string,0,input_string.length()-1);\n return input_string.toString();\n\n }",
"public String getSecretWord() {\r\n \t//Return remaining word if only 1\r\n \tif (activeWords.size() == 1) {\r\n \t\treturn activeWords.get(0);\r\n \t//return random of remaining\r\n \t} else {\r\n \treturn activeWords.get((int)(Math.random()*activeWords.size()+1));\r\n \t}\r\n }",
"public static String mut9(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toLowerCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String translateWord(String word) {\n\n if (word.length() < 1) return word;\n int[] vowelArray = word.chars().filter(c -> vowels.contains((char) c)).toArray();\n if (vowelArray.length == 0) return word.charAt(0) + word.substring(1).toLowerCase() + \"ay\";\n\n char first = Character.isUpperCase(word.charAt(0))\n ? Character.toUpperCase((char) vowelArray[0]) : (char) vowelArray[0];\n if (vowels.contains(word.charAt(0)))\n word = first + word.substring(1).toLowerCase() + \"yay\";\n else\n word = first + word.substring(word.indexOf(vowelArray[0]) + 1).toLowerCase()\n + word.substring(0, word.indexOf(vowelArray[0])).toLowerCase() + \"ay\";\n return word;\n }",
"private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();i++){\n\t\t\tif(sb.charAt(i) == ' ')\n\t\t\t\tsb.setCharAt(i, '_');\n\t\t}\n\t\ttoTextBox = sb.toString();\n\t\ttextField.setText(toTextBox);\n\t\tlblWord.setText(toTextBox);\n\t}",
"public static String mut12(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tchar [] temp = word.toCharArray();\n\t\tString t = \"\";\n\t\tString build = \"\";\n\t\tfor(int i =0; i<word.length(); i++) {\n\t\t\tif(i%2 == 0) {\n\t\t\t\tt = \"\" + temp[i];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[i];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\tbuild = \"\";\n\t\tfor(int j =0; j<word.length(); j++) {\n\t\t\tif(j%2 != 0) {\n\t\t\t\tt = \"\" + temp[j];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[j];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\treturn null;\n\t}",
"private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }",
"public static String mut3(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String getWord(){\n\t\t\n\t\tSystem.out.println(\"--------- Welcome to Hangman ---------\");\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a word:\");\n\t return input.nextLine();\n\t}",
"public String encrypt(String word) {\n String [] encr = new String[word.length()];\n StringBuilder encrRet = new StringBuilder();\n for (int i = 0; i<word.length();i++)\n {\n char shift = (char) (((word.charAt(i) - 'a' + 3) % 26) + 'a');\n encrRet = encrRet.append(shift);\n }\n\n return encrRet.toString();\n }",
"public abstract String guessedWord();",
"String selectRandomSecretWord();",
"public static String mut6(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word + \"\" + word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private static String convertToLatin(String word)\n {\n return word.substring(1) + word.substring(0,1) + \"ay\";\n }",
"private void addWordHelper( String word, int pos, TrieNode curNode )\n\t{\n\t\t//Check to see if the node has been occupied yet\n\t\tif( curNode.getLetters()[ (int)word.charAt(pos) - 97 ] == null )\n\t\t\t//If we are at the last character of the word\n\t\t\tif( pos >= word.length() - 1 )\n\t\t\t\t//Make sure the isWord property is set to true\n\t\t\t\tcurNode.setLetter( word.charAt( pos ), true );\n\t\t\telse\n\t\t\t\tcurNode.setLetter( word.charAt( pos ), false );\n\t\t\n\t\t//If it hasn't reached the last letter yet\n\t\tif( !( pos >= word.length() - 1 ) )\n\t\t\t//Keep on adding the word\n\t\t\taddWordHelper( word, pos + 1, curNode.getLetters()[ (int)word.charAt( pos ) - 97 ] );\n\t}",
"public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(1, word.length());\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"void setVersesWithWord(Word word);",
"abstract String makeAClue(String puzzleWord);",
"private void newWord() {\r\n defaultState();\r\n int random_id_String = 0;\r\n int random_id_Char[] = new int[4];\r\n Random random = new Random();\r\n if (wordNumber == WordCollection.NO_OF_WORDS) return;//quit if all word list is complete;\r\n wordNumber++;\r\n //in case the word has already occured\r\n while (currentWord.equals(\"\")) {\r\n random_id_String = random.nextInt(WordCollection.NO_OF_WORDS);\r\n currentWord = tempWord[random_id_String];\r\n }\r\n currentWord.toUpperCase();\r\n tempWord[random_id_String] = \"\";//so that this word will not be used again in the game session\r\n //generates 4 random nums each for each btn char\r\n for (int i = 0; i < 4; i++) {\r\n random_id_Char[i] = (random.nextInt(4));\r\n for (int j = i - 1; j >= 0; j--) {\r\n if (random_id_Char[i] == random_id_Char[j]) i--;\r\n }\r\n }\r\n\r\n btn1.setText((currentWord.charAt(random_id_Char[0]) + \"\").toUpperCase());\r\n btn2.setText((currentWord.charAt(random_id_Char[1]) + \"\").toUpperCase());\r\n btn3.setText((currentWord.charAt(random_id_Char[2]) + \"\").toUpperCase());\r\n btn4.setText((currentWord.charAt(random_id_Char[3]) + \"\").toUpperCase());\r\n }",
"public String convertToUpperCase(String word);",
"public String getGuessString() {\n\t\tStringBuilder sb = new StringBuilder(wordToGuess);\n\t\tfor (int i = 0; i < wordToGuess.length(); i++) {\n\t\t\tchar letter = wordToGuess.charAt(i);\n\t\t\tif (!guessesMade.contains(letter)) {\n\t\t\t\tsb.setCharAt(i, '-');\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static String translate_word_to_pig_latin(String word) {\r\n String new_word = word;\r\n int vowel_index = index_of_first_vowel(word);\r\n // Put starting consonant(s), if any, at the end of the word\r\n if(vowel_index > 0){\r\n new_word = word.substring(vowel_index) + word.substring(0, vowel_index);\r\n }\r\n\r\n // Add the ay to the end of all words\r\n new_word = new_word.concat(\"ay\");\r\n return new_word;\r\n }",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n String word = \"Tenet\";\n String word3 = \"tenet\";\n System.out.println(\"word \" + word);\n word.toLowerCase(); //porównanie bez wielkosci znakow\n //charAt(0) - zero,\n String[] Tablica = new String[word.length()];\n for (int i = 0; i < word.length(); i++) {\n Tablica[i] = String.valueOf(word.charAt(i));\n }\n String word2 = \"\";\n\n for (int i = (word.length() - 1); i >= 0; i--) {\n //System.out.print(Tablica[i]);\n word2 = word2 + Tablica[i];\n }\n //System.out.println();\n System.out.println(\"word 2 \" + word2);\n System.out.println(\"word 3 \" + word3);\n\n System.out.print(\"word 3 i word 2 \");\n if (word3.toLowerCase().equals(word2.toLowerCase())) {\n System.out.println(\"jest palidronem\");\n } else {\n System.out.println(\"nie jest palidronem\");\n }\n\n//koniec\n\n }",
"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 }",
"java.lang.String getWord();",
"public String scramble(String wordToScramble){\n\t\tString scrambled = \"\";\n\t\tint randomNumber;\n\n\t\tboolean letter[] = new boolean[wordToScramble.length()];\n\n\t\tdo {\n\t\t\trandomNumber = generator.nextInt(wordToScramble.length());\n\t\t\tif(letter[randomNumber] == false){\n\t\t\t\tscrambled += wordToScramble.charAt(randomNumber);\n\t\t\t\tletter[randomNumber] = true;\n\t\t\t}\n\t\t} while(scrambled.length() < wordToScramble.length());\n\n\t\tif(scrambled.equals(wordToScramble))\n\t\t\tscramble(word);\n\n\t\treturn scrambled;\n\t}",
"public void setCorrection(String word) throws IOException {\n writeWord(word);\n }",
"public static String translate(String word) {\n\t\t// Method variables.\n\t\tint vowelIndex = 0;\n\t\tint wordLength = word.length();\n\t\tString pigLatin = \"\";\n\n\t\t// Loop through the word marking at what point the first vowel is.\n\t\tfor (int i = 0; i < wordLength; i++) {\n\t\t\t// Gets the char at i and sets it to lower case for comparing to vowels.\n\t\t\tchar letter = Character.toLowerCase(word.charAt(i));\n\n\t\t\t// If a letter of a word equals a vowel break loop\n\t\t\tif (letter == 'a' || letter == 'e' || letter == 'i' || letter == 'o' || letter == 'u') {\n\t\t\t\tvowelIndex = i; // Set the value of firstVowel the index of the character in the word.\n\t\t\t\tbreak; // Exit loops\n\t\t\t}\n\n\t\t}\n\n\t\t// Rearrange word into Pig Latin.\n\t\t// First test if it starts with a vowel\n\t\tif (vowelIndex == 0) {\n\t\t\tpigLatin = word + \"way\"; // Put way on end of any word starting with a vowel.\n\t\t} else {\n\t\t\t// Create substring of characters to add to the end of the word.\n\t\t\tString toEnd = word.substring(0, vowelIndex);\n\t\t\t\n\t\t\t// Create a substring of the new start of the word.\n\t\t\tString newStart = word.substring(vowelIndex, wordLength);\n\n\t\t\t// Combine both substrings together and add ay.\n\t\t\tpigLatin = newStart + toEnd + \"ay\";\n\t\t}\n\n\t\treturn pigLatin.toUpperCase(); // returns the word translated into Pig Latin\n\t}",
"private void wordBreakRecur(String word, String result) {\n\t\tint size = word.length();\n\n\t\tfor (int i = 1; i <= size; i++) {\n\t\t\tString prefix = word.substring(0, i);\n\n\t\t\tif (dictionaryContains(prefix)) {\n\t\t\t\tif (i == size) {\n\t\t\t\t\tresult += prefix;\n\t\t\t\t\tSystem.out.println(result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twordBreakRecur(word.substring(i), result + prefix + \" \");\n\t\t\t}\n\t\t}\n\t}",
"static void reverseWordInMyString(String str) {\r\n\t\tString[] words = str.split(\" \");\r\n\t\tString reversedString = \"\";\r\n\t\tfor (int i = 0; i < words.length; i++) {\r\n\t\t\tString word = words[i];\r\n\t\t\tString reverseWord = \"\";\r\n\t\t\tfor (int j = word.length() - 1; j >= 0; j--) {\r\n\t\t\t\t/*\r\n\t\t\t\t * The charAt() function returns the character at the given position in a string\r\n\t\t\t\t */\r\n\t\t\t\treverseWord = reverseWord + word.charAt(j);\r\n\t\t\t}\r\n\t\t\treversedString = reversedString + reverseWord + \" \";\r\n\t\t}\r\n\t\tSystem.out.println(str);\r\n\t\tSystem.out.println(reversedString);\r\n\t}",
"public void repopulateWords()\r\n {\n blankSquares();\r\n\r\n //repopulate words\r\n ArrayList al = crossword.getWords();\r\n for (int i = 0; i < al.size(); i++)\r\n {\r\n Word w = (Word) al.get(i);\r\n ArrayList letters = w.getLetters();\r\n\r\n // Lay out the squares, letter by letter, setting the appropriate properties\r\n if (w.getWordDirection() == Word.ACROSS)\r\n {\r\n for (int j = 0; j < letters.size(); j++)\r\n {\r\n Square s = findSquare(w.getY(), w.getX() + j);\r\n if (s.getLetter() == \" \" || s.getLetter() == \"*\" ||\r\n s.getLetter() == \"\")\r\n {\r\n String let = (String) letters.get(j);\r\n if (let == \"*\")\r\n {\r\n let = \" \";\r\n }\r\n s.setLetter(let);\r\n }\r\n\r\n s.setBackground(Color.WHITE);\r\n s.setBorder(BorderFactory.createLineBorder(Color.BLACK,\r\n 1));\r\n\r\n if (s.isAnyWordSelected())\r\n {\r\n s.setBackground(Color.PINK);\r\n s.setResetColour(Color.PINK);\r\n }\r\n //place the clue number\r\n if (j == 0) //ie. first square of word\r\n {\r\n s.setClueNumber(w.getClueIndex());\r\n }\r\n if (s == selectedSquare)\r\n {\r\n s.setBackground(Color.RED);\r\n s.setResetColour(Color.RED);\r\n }\r\n\r\n }\r\n }\r\n else if (w.getWordDirection() == Word.DOWN)\r\n {\r\n\r\n for (int j = 0; j < letters.size(); j++)\r\n {\r\n Square s = findSquare(w.getY() + j, w.getX());\r\n if (s.getLetter() == \" \" || s.getLetter() == \"*\" ||\r\n s.getLetter() == \"\")\r\n {\r\n String let = (String) letters.get(j);\r\n\r\n if (let == \"*\")\r\n {\r\n let = \" \";\r\n }\r\n s.setLetter(let);\r\n }\r\n s.setBackground(Color.WHITE);\r\n s.setBorder(BorderFactory.createLineBorder(Color.BLACK,\r\n 1));\r\n\r\n if (s.isAnyWordSelected())\r\n {\r\n s.setBackground(Color.PINK);\r\n s.setResetColour(Color.PINK);\r\n }\r\n\r\n //place the clue number\r\n if (j == 0) //ie. first square of word\r\n {\r\n s.setClueNumber(w.getClueIndex());\r\n }\r\n if (s == selectedSquare)\r\n {\r\n s.setBackground(Color.RED);\r\n s.setResetColour(Color.RED);\r\n }\r\n }\r\n }\r\n }\r\n //dissociate any blank squares from legacy word relationships\r\n dissociateSquares();\r\n validate();\r\n }",
"void pushRightWord(int end) {\n\n int index = end;\n while (true) {\n if (words[--index] == ' ') break;\n }\n\n bufferRight.push(new String(Arrays.copyOfRange(\n words, index+1, end+1)));\n\n }",
"public String getCorrectionWord(String misspell);",
"public static String reverseWordsAlt(String str){\r\n\t\t\r\n\t\tstr = reverse(str, 0,str.length()-1);\r\n\t\t\r\n\t\tint start=0;\r\n\t\tint end =0;\r\n\t\t\r\n\t\twhile(end < str.length()){\r\n\t\t\t\r\n\t\t\twhile(end<str.length() && str.charAt(end)!=' '){\r\n\t\t\t\tend++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(start<end){\r\n\t\t\t\tstr=reverse(str,start,end-1);\r\n\t\t\t\tstart=end+1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tend++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tstr = reverse(str,start,end-1);\r\n\t\t\r\n\t\treturn str;\r\n\t}",
"public boolean checkRightWord(EditText answerWord){\n \t\t return answerWord.getText().toString().equalsIgnoreCase(currentWord);\n \t }",
"private static void printHangman() {\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tif (guessesResult[i]) {\n\t\t\t\tSystem.out.print(word.charAt(i));\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" _ \");\n\t\t\t}\n\t\t}\n\t}",
"private String generateRandomWord()\n {\t\n\tRandom randomNb = new Random(System.currentTimeMillis());\n\tchar [] word = new char[randomNb.nextInt(3)+5];\n\tfor(int i=0; i<word.length; i++)\n\t word[i] = letters[randomNb.nextInt(letters.length)];\n\treturn new String(word);\n }",
"public String normalize(String word);",
"@Override\n public String encrypt(String word, int cipher) {\n String result = \"\";\n int postcipher = 0;\n boolean wasUpper = false;\n for(int i = 0; i < word.length(); i++)\n {\n char c = word.charAt(i);\n postcipher = c;\n if(Character.isLetter(c)) {\n if (c < ASCII_LOWER_BEGIN) { //change to lowercase\n c += ASCII_DIFF;\n wasUpper = true;\n }\n postcipher = ((c + cipher - ASCII_LOWER_BEGIN) % NUM_ALPHABET + ASCII_LOWER_BEGIN); //shift by cipher amount\n if (wasUpper)\n postcipher -= ASCII_DIFF; //turn back into uppercase if it was uppercase\n wasUpper = false;\n }\n result += (char)postcipher; //add letter by letter into string\n }\n return result;\n }",
"public static boolean palindrome(String word) {\n\t\t\r\n\t\tint equalsCounter=0;\r\n\t\t\r\n\t\tfor(int i=0;i<word.length();i++) {\r\n\t\t\t\r\n\t\tif(word.contains(\" \")) {\r\n\t\t\t\r\n\t\t\tword=word.replace(\" \",\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t if(word.charAt(i)==word.charAt(word.length()-(i+1))){\r\n\t\t\t\t\r\n\t\t\t\tequalsCounter++;\r\n\t\t\t\t\r\n\t\t\t\tif(equalsCounter==word.length()) {\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else {\r\n\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\treturn false;\r\n\t\t\t\r\n\t}",
"private String processWord(String word){\r\n\t\tString lword = word.toLowerCase();\r\n\t\tfor (int i = 0;i<word.length();++i){\r\n\t\t\tstemmer.add(lword.charAt(i));\r\n\t\t}\r\n\t\tstemmer.stem();\r\n\t\treturn stemmer.toString();\r\n\t}"
] | [
"0.6905516",
"0.6840522",
"0.6580254",
"0.65349925",
"0.6434856",
"0.6422252",
"0.63784856",
"0.63763314",
"0.6217979",
"0.621525",
"0.6136876",
"0.61072177",
"0.6088742",
"0.60571855",
"0.59340966",
"0.5896257",
"0.5881564",
"0.5807983",
"0.5800246",
"0.5764657",
"0.5746465",
"0.5740875",
"0.57372487",
"0.5732653",
"0.5726951",
"0.5721847",
"0.5702414",
"0.5666891",
"0.5655421",
"0.56458485",
"0.56392115",
"0.5634192",
"0.56265146",
"0.56225044",
"0.562135",
"0.5611985",
"0.56032413",
"0.56028783",
"0.5583619",
"0.5581525",
"0.55613214",
"0.554517",
"0.5544697",
"0.5527965",
"0.55277807",
"0.551511",
"0.54936206",
"0.5492886",
"0.54906505",
"0.5481546",
"0.5472603",
"0.5466131",
"0.5456963",
"0.5455409",
"0.5438655",
"0.54357845",
"0.5431166",
"0.54176325",
"0.5411436",
"0.5398897",
"0.53986746",
"0.53980404",
"0.5391098",
"0.53852445",
"0.53806454",
"0.5378115",
"0.53743416",
"0.5368883",
"0.5365131",
"0.5336552",
"0.53192914",
"0.53187793",
"0.5294376",
"0.52869374",
"0.5283291",
"0.52686894",
"0.5252064",
"0.5250349",
"0.5241108",
"0.5237303",
"0.5236259",
"0.523186",
"0.5228648",
"0.52243435",
"0.5205372",
"0.5203266",
"0.5200148",
"0.51984745",
"0.5191722",
"0.51903653",
"0.51889247",
"0.5187259",
"0.5182087",
"0.5173286",
"0.5172456",
"0.51608324",
"0.5157444",
"0.51564306",
"0.5154104",
"0.5153372"
] | 0.58640957 | 17 |
/ Flips word and appends it to the front of word. Tests result in guessPW(). Returns the new word. | public static String reflect2(String word){
if(word.length() <= 1){
return word;
}
StringBuilder result = new StringBuilder(reverse(word));
guessPW(result.append(word).toString());
return result.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static String reverse(String word){\n\t\tStringBuilder result = new StringBuilder();\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\n\t\tfor(int i = word.length() - 1; i >= 0; i--){\n\t\t\tresult.append(word.charAt(i));\n\t\t}\n\t\tguessPW(result.toString());\n\t\treturn result.toString();\n\t}",
"private String getConvertedWord(String word) {\r\n\t\tString newWord = \"\";\r\n\t\tif(word == null || word.length() == 0)\r\n\t\t\tnewWord = \"\";\r\n\t\telse if(word.length() < 3)\r\n\t\t\tnewWord = word;\r\n\t\telse \r\n\t\t\tnewWord = \"\"+word.charAt(0) + (word.length() - 2) + word.charAt(word.length() - 1);\r\n\t\t\t\r\n\t\tif(DEBUG)\r\n\t\t\tSystem.out.printf(\"Converted %s to %s\\n\", word, newWord);\r\n\t\treturn newWord;\r\n\r\n\t}",
"private String shuffleWord(){\n \t\t currentWord = turn.getWord(); //TODO: Replace\n \t\t String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n \t\t alphabet = shuffle(alphabet);\n \t\t alphabet = alphabet.substring(alphabet.length() - randomNumber(7,4));\n \t\t String guessWord = currentWord + alphabet; \n \t\t guessWord = shuffle(guessWord);\n \t\t return guessWord;\n \t }",
"static String refineWord(String currentWord) {\n\t\t// makes string builder of word\n\t\tStringBuilder builder = new StringBuilder(currentWord);\n\t\tStringBuilder newWord = new StringBuilder();\n\n\t\t// goes through; if it's not a letter, doesn't add to the new word\n\t\tfor (int i = 0; i < builder.length(); i++) {\n\t\t\tchar currentChar = builder.charAt(i);\n\t\t\tif (Character.isLetter(currentChar)) {\n\t\t\t\tnewWord.append(currentChar);\n\t\t\t}\n\t\t}\n\n\t\t// returns lower case\n\t\treturn newWord.toString().toLowerCase().trim();\n\t}",
"public static String duplicate(String word){\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tguessPW(result.append(word).toString());\n\t\treturn result.toString();\n\t}",
"public StringBuffer formTheGuessedWord(String word, String guess, StringBuffer guessedWord) {\r\n\t\tif (guessedWord != null && guessedWord.length() >= 1) {\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tif (word.charAt(i) == guess.charAt(0)) {\r\n\t\t\t\t\tguessedWord.setCharAt(i, guess.charAt(0));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tguessedWord = new StringBuffer(word.length());\r\n\t\t\tfor (int i = 0; i < word.length(); i++) {\r\n\t\t\t\tguessedWord.append(\".\");\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn guessedWord;\r\n\t}",
"public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n System.out.println(\"Enter your word :\");\n String word = scanner.nextLine();\n word = word.toUpperCase();\n// word = Character.toString((char)(word.charAt(0)-32));\n String word1 =Character.toString(word.charAt(0));\n word = word.toLowerCase();\n for (int i = 1; i <word.length() ; i++) {\n word1 += Character.toString(word.charAt(i));\n }\n System.out.println(word1);\n }",
"public static void reverser(String word) {\n String newStr = \"\";\n for (int i = word.length(); i > 0; i--) {\n newStr += word.substring(i - 1, i);\n }\n System.out.println(newStr);\n }",
"private static void reverseWord(String word) {\n // StringBuild.reverse()\n System.out.println(new StringBuilder(word).reverse().toString());\n\n // Add char one by one iteration method\n StringBuilder reversed = new StringBuilder();\n char[] chars = word.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n reversed.append(chars[chars.length - i - 1]);\n }\n System.out.println(reversed.toString());\n }",
"private void renewWord() {\n givenWord = availableWords.randomWordLevel1();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"private void updateGuessedWord(String guessedLetter) {\n\t\tint guessIndex = 0;\n\t\tint indexOffset = 0;\n\t\t//we loop here because there can potentially be multiple instances of guessedLetter in actualWord\n\t\twhile (indexOffset < actualWord.length()) { //could be while true, but this protects against double letters at end of word\n\t\t\tguessIndex = actualWord.indexOf(guessedLetter, indexOffset);\n\t\t\tif (guessIndex < 0) return; //exits loop if no further instances of guessed letter are in actual word\n\t\t\telse {\n\t\t\t\tguessedWord = guessedWord.substring(0, guessIndex) + guessedLetter + guessedWord.substring(guessIndex + 1);\n\t\t\t\tindexOffset = guessIndex + 1;\n\t\t\t}\n\t\t}\n\t}",
"public static String reflect1(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tStringBuilder result = new StringBuilder(word);\n\t\tresult.append(reverse(word)).toString();\n\t\treturn result.toString();\n\t}",
"public static boolean append(String word){\n\t\tboolean x = false;\n\t\tboolean y = false;\n\t\tfor(int i = 33; i <= 126; i++){\n\t\t\tchar c = (char)i;\n\t\t\tx = guessPW(word.concat(Character.toString(c)));\n\t\t\ty = guessPW(Character.toString(c).concat(word));\n\t\t}\n\n\t\tif(x | y){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"public String alternateWordSwap() {\n\t\tString output=\"\";\r\n\t\tString arr[]=this.str.split(\" \");\r\n\t\tfor(int i=0,j=1;i<arr.length;i+=2,j+=2){\r\n\t\t\tString temp=arr[i];\r\n\t\t\tarr[i]=arr[j];\r\n\t\t\tarr[j]=temp;\r\n\t\t}\r\n\t\t\r\n\t\tfor(String s:arr){\r\n\t\t\toutput+=s+\" \";\r\n\t\t}\r\n\t\treturn output.trim();\r\n\t}",
"public String scramble(String word)\n {\n int i, j;\n String SwappedString = \"\";\n String first, middle, last;\n int wordLength = word.length();\n for (int k = 0; k < wordLength; k++)\n {\n i = generator.nextInt(wordLength-1);\n j = i+1 + generator.nextInt(wordLength-i-1);\n first = word.substring(0,i);\n middle = word.substring(i+1,j);\n if (j != wordLength)\n {\n last = word.substring(j+1);\n }\n else\n {\n last = \"\";\n }\n SwappedString = first + word.substring(j, j + 1) + middle + word.substring(i, i + 1) + last;\n word = SwappedString;\n }\n return SwappedString;\n }",
"public String makeOutWord(String out, String word) {\r\n String outFrontPart = out.substring(0, 2);\r\n String outRightPart = out.substring(2, 4);\r\n\r\n return outFrontPart + word + outRightPart;\r\n }",
"private static String updateSpelling(String text) {\n\t\tStringBuilder upSpell = new StringBuilder(32);\n\t\tchar ch = ' ';\n\t\t\n\t\tfor (int i = 0; i<text.length(); i++) {\n\t\t\tif(ch == ' ' && text.charAt(i) != ' ') {\n\t\t\t\tupSpell.append(Character.toUpperCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}else if(Character.isLetter(text.charAt(i))) {\n\t\t\t\tupSpell.append(Character.toLowerCase(text.charAt(i)));\n\t\t\t\t\n\t\t\t}\n\t\t\t// if anything other type of input is added besides letters.\n\t\t\telse {\n\t\t\t\tupSpell.append(text.charAt(i));\n\t\t\t}\n\t\t\t//This will keep track of previous characters inputed.\n\t\t\tch = text.charAt(i);\t\t\t\n\t\t\t\n\t\t}\n\t\treturn upSpell.toString(); \n\t\t\n\t}",
"public static String delLastChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(0, word.length() - 1);\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"public static String newWord(String strw) {\n String value = \"Encyclopedia\";\n for (int i = 1; i < value.length(); i++) {\n char letter = 1;\n if (i % 2 != 0) {\n letter = value.charAt(i);\n }\n System.out.print(letter);\n }\n return value;\n }",
"private String swapOne(int a,int b,char[] word){\n char tmp=word[a];\n word[a]=word[b];\n word[b]=tmp;\n return new String(word);\n}",
"private String swapFour(int i,char insert,char[]word){\n StringBuilder ste=new StringBuilder(new String(word));\n if(i != word.length)\n ste.insert(i, insert);\n else\n ste.append(insert);\n return new String(ste);\n }",
"public boolean guessWord (String gword) {\n \tif (lose || victory) return false;\n \t\n \tif ( gword.toLowerCase().equals(_word.toLowerCase()) ) {\n \t\tthis.victory = true;\n \t\t\n \t\tfor (int i = 0; i < _word.length(); i++) {\n \t\t\thint.setCharAt(2*i, _word.charAt(i));\n \t\t}\n \t\t\n \t\treturn true;\n \t}\n \t\n \treturn false;\n }",
"public static String modifyGuess(char inChar, String word, String starredWord) {\n\t\tString starWord = starredWord;\n\t\t\n\t\tfor(int i = 0; i < word.length(); i++) {\n\t\t\tif(word.charAt(i) == inChar) {\n\t\t\t\tstarWord = starWord.substring(0,i) + word.charAt(i) + starWord.substring(i+1,starWord.length());\n\t\t\t\t//System.out.println(starWord.substring(i,starWord.length()-1));\n\t\t\t}\n\t\t}\n\t\t//System.out.println(starWord);\n\t\treturn starWord;\n\t}",
"public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(1, word.length());\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}",
"public void setHangmanWord()\n {\n if(word == null || word == \"\") return;\n\n String hangmanWord = \"\";\n for(int i=0; i<word.length(); i++)\n {\n if(showChar[i])\n hangmanWord += word.substring(i, i+1)+\" \";\n else\n hangmanWord += \"_ \";\n }\n\n wordTextField.setText(hangmanWord.substring(0, hangmanWord.length()-1));\n }",
"void putLeftWordToRight(int end) {\n\n String word = bufferLeft.pop();\n int index = end - word.length() + 1;\n System.arraycopy(word.toCharArray(), 0, words, index, word.length());\n words[index-1] = ' ';\n\n }",
"public String propergram(String word){\n // word.toLowerCase();\n String[] tempstr =word.split(\"_\");\n String tempstr2;\n\n for(int i=0;i<tempstr.length;i++){\n if((tempstr[i].charAt(0))>='A'&&(tempstr[i].charAt(0))<='Z') {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0)));\n }\n else {\n tempstr2 = (String.valueOf(tempstr[i].charAt(0))).toUpperCase();\n }\n tempstr[i] = tempstr2.concat(tempstr[i].substring(1));\n if (i != 0) {\n word=word.concat(\" \").concat(tempstr[i]);\n } else {\n word = tempstr[i];\n }\n\n }\n return word;\n\n\n }",
"public String newWord(String word) {\r\n\t\tthis.word = word;\r\n\t\twordLength = word.length();\r\n\t\ttries = word.length();\r\n\t\tunknownCharactersInWordState = word.length();\r\n\t\twordState = UNKNOWN.repeat(wordLength);\r\n\t\tstringBuilder = new StringBuilder(wordState);\r\n\t\tboolean lose = false;\r\n\t\treturn parseState(lose, false);\r\n\t}",
"public WordsToGuess(String w)\n\t{\n\t\tword = w;\n\t}",
"public static String mut11(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1) + \"\" + word.substring(1, word.length()).toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"private String doubleFinalConsonant(String word) {\n\t\tStringBuffer buffer = new StringBuffer(word);\n\t\tbuffer.append(buffer.charAt(buffer.length() - 1));\n\t\treturn buffer.toString();\n\t}",
"public static String mut7(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tString temp2 = word +temp;\n\t\tif(pwMatch(temp2, person, w)) \n\t\t\treturn temp2;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\ttemp = temp+word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\n\t\treturn null;\n\t}",
"@Override\r\n public String wordsOriginal(char[] arrayOfword) {\n String origalWord = \"\";//define a String for save the word orignal\r\n try {\r\n for (int i = 0; i < arrayOfword.length; i++) {\r\n origalWord += arrayOfword[i];//each charater put in the string origalWord\r\n }\r\n } catch (Exception e) {\r\n JOptionPane.showMessageDialog(null, \"An error has occured!\");\r\n }\r\n return origalWord;\r\n }",
"public static String translateWord(String word) {\n\n if (word.length() < 1) return word;\n int[] vowelArray = word.chars().filter(c -> vowels.contains((char) c)).toArray();\n if (vowelArray.length == 0) return word.charAt(0) + word.substring(1).toLowerCase() + \"ay\";\n\n char first = Character.isUpperCase(word.charAt(0))\n ? Character.toUpperCase((char) vowelArray[0]) : (char) vowelArray[0];\n if (vowels.contains(word.charAt(0)))\n word = first + word.substring(1).toLowerCase() + \"yay\";\n else\n word = first + word.substring(word.indexOf(vowelArray[0]) + 1).toLowerCase()\n + word.substring(0, word.indexOf(vowelArray[0])).toLowerCase() + \"ay\";\n return word;\n }",
"private void matchletter(){\n\t\t/* Generate a Random Number and use that as a Index for selecting word from HangmanLexicon*/\n\t\tString incorrectwords = \"\";\n\t\tcanvas.reset();\n\t\tHangmanLexicon word= new HangmanLexicon(); // Get Word from Lexicon\n\t\tint index=rgen.nextInt(0, (word.getWordCount() - 1)); // Select the word Randomly\n\t\tString secretword=word.getWord(index);\n\t\tprintln(\"secretword: \"+secretword);\n\t\tint lengthofstring= secretword.length();\n\t\tString createword=concatNcopies(lengthofstring,\"-\"); // Create a blank word the user will guess\n\t\tcanvas.displayWord(createword); // Display the word on the Canvas\n\t\tprintln(\"The word now looks like this:\" +createword);\n\t\tprintln(\"You have \" +lengthofstring+ \" guesses left\");\n\t\tint counter =0;\n\t\tint guess= lengthofstring;\n\t\tint pos = createword.indexOf('-'); // Check for blank Words\n\t\t/* Ask user to input the letter*/\n\t\twhile(counter<lengthofstring && (pos !=-1 )){ \n\t\t\tint check=0;\n\t\t\tpos = createword.indexOf('-',pos); // Check to find Dashes in word\n\t\t\tString userletter= readLine(\"Your Guess:\");\n\t\t\tif(userletter.length() > 1){ // Check for two letters entered\n\t\t\t\tprintln(\"Enter letter Again\");\n\t\t\t}\n\t\t\tchar ch=userletter.charAt(0);\n\t\t\tif(Character.isLowerCase(ch)) { // Convert lower case to upper case\n\t\t\t\tch = Character.toUpperCase(ch);\n\t\t\t}\n\t\t\tfor (int i=0;i<lengthofstring;i++){ // Check for entire letter matching in the secretword\n\t\t\t\tif (ch==secretword.charAt(i) && ch!=createword.charAt(i)) { \n\t\t\t\t\tcreateword = createword.substring(0, i) + ch + createword.substring(i + 1);\n\t\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\t\tcheck++; // If user puts the correct letter again it is flagged as a error\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(check==0){\n\t\t\t\tprintln(\"There are no \"+ch+\"'s in the word\");\n\t\t\t\tguess=guess-1;\n\t\t\t\tincorrectwords = incorrectwords+ch;\n\t\t\t\tcanvas.noteIncorrectGuess(guess, incorrectwords);\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tprintln(\"The word now looks like this:\"+createword);\n\t\t\tprintln(\"You have \" +guess+ \" guesses left\");\n\n\t\t\tif(counter==lengthofstring){ // Checks for Fail condition- Game Over\n\t\t\t\tprintln(\"You are completely hung\");\n\t\t\t\tprintln(\"The word was: \"+secretword);\n\t\t\t\tcanvas.displayWord(secretword);\n\t\t\t\tprintln(\"You lose \");\n\t\t\t}\n\t\t\tpos = createword.indexOf('-');// Check for Win condition\n\t\t\tif(pos < 0){\n\t\t\t\tprintln(\"You saved Hangman\");\n\t\t\t\tprintln(\"You Win !!!\");\n\t\t\t\tcanvas.displayWord(createword);\n\t\t\t\tguess=123;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"public static String mut8(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toUpperCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"String rotWord(String s) {\n return s.substring(2) + s.substring(0, 2);\n }",
"public void getNewWord(JTextField textField, JTextField clue) {\n\t\ttextField.setText(\"\");\n\t\tclue.setText(\"\");\n\t for(Letter l : letters) l.setStatus(false);\n\t letters.clear();\n\t setWord();\n\t for(int i = 0; i < guessedLetter.length; i++)\n\t \tguessedLetter[i] = false;\n\t}",
"public static String mut10(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, 1).toUpperCase() + \"\" + word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String solution(String word) {\n return Stream.of(word.split(\"\"))\n .reduce(\"\", (original, reverse) ->\n reverse + original);\n }",
"public static void main(String[] args) {\n Scanner input= new Scanner(System.in);\n System.out.println(\" Enter a string value: \");\n String word=input.nextLine();\n String newWord=word.charAt(0)+\"\";\n for (int i = 1; i <word.length() ; i++) {\n if(word.charAt(i)>=65 && word.charAt(i)<=90){\n newWord+=\" \"+word.charAt(i);\n }else{\n newWord+=word.charAt(i);\n }\n\n }\n System.out.println(newWord);\n }",
"public String hiddenWord() {\n int hiddenWordUnderscores = 0;\n String hiddenWord = \"\";\n StringBuilder newHiddenWord = new StringBuilder(\"\");\n \n for (int i = 0; i < this.word.length(); i++) {\n hiddenWord += \"_\";\n newHiddenWord.append(\"_\");\n }\n \n // GO THROUGH EACH CHARACTER IN THIS.WORD AND SEE IF IT MATCHES THE GUESS. \n // IF IT DOES, REPLACE THE UNDERSCORE AT THAT INDEX WITH THE GUESSED LETTER.\n for (int i = 0; i < this.word.length(); i++) {\n char currentChar = this.word.charAt(i);\n String currentLetter = \"\" + currentChar;\n \n // IF THE CURRENT LETTER IS IN THE WORD\n if (this.guessedLetters.contains(currentLetter)) {\n // GET THE CURRENT UNDERSCORE OF THE INDEX WE ARE IN, SET IT TO currentChar\n newHiddenWord.setCharAt(i, currentChar);\n }\n } \n hiddenWord = newHiddenWord.toString();\n\n return hiddenWord;\n \n }",
"private String pickWord() {\n \thangmanWords = new HangmanLexicon();\n \tint randomWord = rgen.nextInt(0, (hangmanWords.getWordCount() - 1)); \n \tString pickedWord = hangmanWords.getWord(randomWord);\n \treturn pickedWord;\n }",
"private static String convertToLatin(String word)\n {\n return word.substring(1) + word.substring(0,1) + \"ay\";\n }",
"public String encrypt(String word) {\n char[] encrypted = word.toCharArray();\n for (int i = 0; i < encrypted.length; i++){\n if (encrypted[i] == 'x' || encrypted[i] == 'y' || encrypted[i] == 'z'){\n encrypted[i] -= 23;\n } else {\n encrypted[i] += 3;\n }\n \n }\n String encryptedResult = new String(encrypted);\n return encryptedResult;\n }",
"private void computerTurn() {\n String text = txtWord.getText().toString();\n String nextWord;\n if (text.length() >= 4 && dictionary.isWord(text)){\n endGame(false, text + \" is a valid word\");\n return;\n } else {\n nextWord = dictionary.getGoodWordStartingWith(text);\n if (nextWord == null){\n endGame(false, text + \" is not a prefix of any word\");\n return;\n } else {\n addTextToGame(nextWord.charAt(text.length()));\n }\n }\n userTurn = true;\n txtLabel.setText(USER_TURN);\n }",
"private void renewWordLevel4()\n {\n givenWord = availableWords.randomWordLevel4();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public String getGuessString() {\n\t\tStringBuilder sb = new StringBuilder(wordToGuess);\n\t\tfor (int i = 0; i < wordToGuess.length(); i++) {\n\t\t\tchar letter = wordToGuess.charAt(i);\n\t\t\tif (!guessesMade.contains(letter)) {\n\t\t\t\tsb.setCharAt(i, '-');\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public static String mut2(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor(int i=0; i< chars.length; i++) {\n\t\t\ttemp = word + chars[i];\n\t\t\tif(pwMatch(temp, person, w)) \n\t\t\t\treturn temp;\n\t\t\telse if(isDouble)\n\t\t\t\treturn temp;\n\t\t}\n\t\treturn null;\n\t}",
"private void renewWordLevel2()\n {\n givenWord = availableWords.randomWordLevel2();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public static String mut5(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = \"\";\n\t\tfor (int i = word.length() - 1 ; i >= 0 ; i-- ) {\n\t\t\ttemp += word.charAt(i);\t\n\t\t}\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public void moveFromHandToStartOfWord() {\n\t\t//check letters in hand\n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to start of word\n\t\tword.addToStart(temp);\n\t}",
"public String normalize(String word);",
"@Test\n\tpublic void revStrSentances() {\n\n\t\tString s = \"i like this program very much\";\n\t\tString[] words = s.split(\" \");\n\t\tString revStr = \"\";\n\t\tfor (int i = words.length - 1; i >= 0; i--) {\n\t\t\trevStr += words[i] + \" \";\n\n\t\t}\n\n\t\tSystem.out.println(revStr);\n\n\t}",
"public static String mut4(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(0, word.length()-1);\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String reverseWordWise(String input) {\n String output = \"\";\n int index = 0;\n \n for (int i = 0; i < input.length(); i++) {\n if (input.charAt(i) == ' ') {\n index = i+1;\n output += input.charAt(i);\n } else {\n output = output.substring(0,index) + input.charAt(i) + output.substring(index);\n }\n }\n return output;\n\n\t}",
"public void moveFromHandToEndOfWord() {\n\t\t//check letters in hand \n\t\tif(hand.size() == 0) {\n\t\t\treturn;\n\t\t}\n\t\t// remove letter from hand\n\t\tLetter temp = hand.leftmost;\n\t\thand.remove();\n\t\ttemp.next = null;\n\n\t\t// add letter to end of word\n\t\tword.addToEnd(temp);\n\t}",
"public void readWordRightToLeft(String word) {\n }",
"private void updateTextBox(){\n\t\tString tmpWord = game.getTempAnswer().toString();\n\t\tString toTextBox = \"\";\n\t\tStringBuilder sb = new StringBuilder(tmpWord);\n\n\t\t//if a letter is blank in the temp answer make it an underscore. Goes for as long as the word length\n\t\tfor (int i = 0; i<tmpWord.length();i++){\n\t\t\tif(sb.charAt(i) == ' ')\n\t\t\t\tsb.setCharAt(i, '_');\n\t\t}\n\t\ttoTextBox = sb.toString();\n\t\ttextField.setText(toTextBox);\n\t\tlblWord.setText(toTextBox);\n\t}",
"public static String mut9(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.toLowerCase();\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public void setWord(String newWord)\n\t{\n\t\tword = newWord;\n\t}",
"public String getNewWord(){\n\t\tint randomWord = generator.nextInt(wordList.length);\n\t\tString temp = wordList[randomWord];\n\t\treturn temp;\n\t}",
"public String scramble(String wordToScramble){\n\t\tString scrambled = \"\";\n\t\tint randomNumber;\n\n\t\tboolean letter[] = new boolean[wordToScramble.length()];\n\n\t\tdo {\n\t\t\trandomNumber = generator.nextInt(wordToScramble.length());\n\t\t\tif(letter[randomNumber] == false){\n\t\t\t\tscrambled += wordToScramble.charAt(randomNumber);\n\t\t\t\tletter[randomNumber] = true;\n\t\t\t}\n\t\t} while(scrambled.length() < wordToScramble.length());\n\n\t\tif(scrambled.equals(wordToScramble))\n\t\t\tscramble(word);\n\n\t\treturn scrambled;\n\t}",
"public static String mut3(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word.substring(1, word.length());\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"public static String getWord(){\n\t\t\n\t\tSystem.out.println(\"--------- Welcome to Hangman ---------\");\n\t\tScanner input = new Scanner(System.in);\n\t\tSystem.out.print(\"Enter a word:\");\n\t return input.nextLine();\n\t}",
"static String reverseWordsInStringInPlace(StringBuffer input_string){\n //step 1\n int j = -1;\n for(int i = 0; i <input_string.length() ;i++ ){\n if(' ' == input_string.charAt(i)){\n reverseString(input_string,j+1,i-1);\n j=i;\n }\n //for last word\n if(i == input_string.length()-1){\n reverseString(input_string,j+1,i);\n }\n }\n //step 2\n reverseString(input_string,0,input_string.length()-1);\n return input_string.toString();\n\n }",
"private static String capitaliseSingleWord(String word) {\n String capitalisedFirstLetter = word.substring(0, 1).toUpperCase();\n String lowercaseRemaining = word.substring(1).toLowerCase();\n return capitalisedFirstLetter + lowercaseRemaining;\n }",
"private void renewWordLevel3()\n {\n givenWord = availableWords.randomWordLevel3();\n shuffedWord = availableWords.shuffleWord(givenWord);\n textViewShuffle.setText(shuffedWord);\n }",
"public abstract String guessedWord();",
"private String processWord(String word){\r\n\t\tString lword = word.toLowerCase();\r\n\t\tfor (int i = 0;i<word.length();++i){\r\n\t\t\tstemmer.add(lword.charAt(i));\r\n\t\t}\r\n\t\tstemmer.stem();\r\n\t\treturn stemmer.toString();\r\n\t}",
"static public String straighten_weft2(String redundant) {\n String screened = re_screen(redundant);\n String rex = screened.replaceAll(\"(\\\\\\\\.|.)(\\\\\\\\.|.)\", \"$1[^$2-\\uffff]|\");\n //System.err.println(\"rex: \"+rex);\n String brief = redundant.replaceAll(\"(\" + rex + \"\\0.)|(..)\", \"$2\");\n return brief;\n }",
"public String getCorrectionWord(String misspell);",
"public static String translate_word_to_pig_latin(String word) {\r\n String new_word = word;\r\n int vowel_index = index_of_first_vowel(word);\r\n // Put starting consonant(s), if any, at the end of the word\r\n if(vowel_index > 0){\r\n new_word = word.substring(vowel_index) + word.substring(0, vowel_index);\r\n }\r\n\r\n // Add the ay to the end of all words\r\n new_word = new_word.concat(\"ay\");\r\n return new_word;\r\n }",
"private static String convert(String word) {\n\n char[] charArray = word.toCharArray();\n\n for (int letter = 0; letter < word.length(); letter++) {\n // Finding the first letter of a word.\n if (letter == 0 && charArray[letter] != ' ' || charArray[letter] != ' ' && charArray[letter - 1] == ' ') {\n // Checking if the first letter is lower case.\n if (charArray[letter] >= 'a' && charArray[letter] <= 'z') {\n // Converting first letter to upper case\n charArray[letter] = (char)(charArray[letter] - 'a' + 'A');\n }\n }\n // Checking if the letters other than the first letter are capital\n else if (charArray[letter] >= 'A' && charArray[letter] <= 'Z')\n // Converting uppercase other letters to lower case.\n charArray[letter] = (char)(charArray[letter] + 'a' - 'A');\n }\n // Returning a Title cased String.\n return new String(charArray);\n }",
"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 String encrypt(String word) {\n String [] encr = new String[word.length()];\n StringBuilder encrRet = new StringBuilder();\n for (int i = 0; i<word.length();i++)\n {\n char shift = (char) (((word.charAt(i) - 'a' + 3) % 26) + 'a');\n encrRet = encrRet.append(shift);\n }\n\n return encrRet.toString();\n }",
"String selectRandomSecretWord();",
"public String getSecretWord() {\r\n \t//Return remaining word if only 1\r\n \tif (activeWords.size() == 1) {\r\n \t\treturn activeWords.get(0);\r\n \t//return random of remaining\r\n \t} else {\r\n \treturn activeWords.get((int)(Math.random()*activeWords.size()+1));\r\n \t}\r\n }",
"abstract String makeAClue(String puzzleWord);",
"public static void main(String[] args) {\n Scanner input = new Scanner (System.in);\n System.out.println(\"Enter your word here please\");\n String str = input.nextLine();\n int length = str.length();\n\n System.out.println(str.substring(length-1)+ str + ( str.substring(length-1)));\n\n }",
"public String getSecretWord() {\r\n \tint index = (int) (Math.random() * this.activeWords.size());\r\n return this.activeWords.get(index);\r\n }",
"public static String Rule2(String para_word) {\n\t\tint last = para_word.length();\r\n\r\n\t\t// if it ends in y and there is a vowel in steam change it to i\r\n\t\tif ((para_word.charAt(last - 1) == 'y') && wordSteamHasVowel(para_word)) {\r\n\t\t\tpara_word = para_word.substring(0, last - 1) + \"i\";\r\n\t\t}\r\n\r\n\t\treturn para_word;\r\n\t}",
"java.lang.String getWord();",
"public static void main(String[] args) {\n Scanner input = new Scanner(System.in);\n String word = \"Tenet\";\n String word3 = \"tenet\";\n System.out.println(\"word \" + word);\n word.toLowerCase(); //porównanie bez wielkosci znakow\n //charAt(0) - zero,\n String[] Tablica = new String[word.length()];\n for (int i = 0; i < word.length(); i++) {\n Tablica[i] = String.valueOf(word.charAt(i));\n }\n String word2 = \"\";\n\n for (int i = (word.length() - 1); i >= 0; i--) {\n //System.out.print(Tablica[i]);\n word2 = word2 + Tablica[i];\n }\n //System.out.println();\n System.out.println(\"word 2 \" + word2);\n System.out.println(\"word 3 \" + word3);\n\n System.out.print(\"word 3 i word 2 \");\n if (word3.toLowerCase().equals(word2.toLowerCase())) {\n System.out.println(\"jest palidronem\");\n } else {\n System.out.println(\"nie jest palidronem\");\n }\n\n//koniec\n\n }",
"private void updatePatterns(char guess) {\r\n \tfinal char UNDISPLAYED = '-';\r\n \tfor (int i = 0; i < this.activeWords.size(); i++) {\r\n \t\tString word = this.activeWords.get(i);\r\n \t\tfor (int j = 0; j < word.length(); j++) {\r\n \t\t\tif (word.charAt(j) == guess) {\r\n \t\t\t\tthis.patterns.get(i)[j] = guess;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }",
"public static String translate(String word) {\n\t\t// Method variables.\n\t\tint vowelIndex = 0;\n\t\tint wordLength = word.length();\n\t\tString pigLatin = \"\";\n\n\t\t// Loop through the word marking at what point the first vowel is.\n\t\tfor (int i = 0; i < wordLength; i++) {\n\t\t\t// Gets the char at i and sets it to lower case for comparing to vowels.\n\t\t\tchar letter = Character.toLowerCase(word.charAt(i));\n\n\t\t\t// If a letter of a word equals a vowel break loop\n\t\t\tif (letter == 'a' || letter == 'e' || letter == 'i' || letter == 'o' || letter == 'u') {\n\t\t\t\tvowelIndex = i; // Set the value of firstVowel the index of the character in the word.\n\t\t\t\tbreak; // Exit loops\n\t\t\t}\n\n\t\t}\n\n\t\t// Rearrange word into Pig Latin.\n\t\t// First test if it starts with a vowel\n\t\tif (vowelIndex == 0) {\n\t\t\tpigLatin = word + \"way\"; // Put way on end of any word starting with a vowel.\n\t\t} else {\n\t\t\t// Create substring of characters to add to the end of the word.\n\t\t\tString toEnd = word.substring(0, vowelIndex);\n\t\t\t\n\t\t\t// Create a substring of the new start of the word.\n\t\t\tString newStart = word.substring(vowelIndex, wordLength);\n\n\t\t\t// Combine both substrings together and add ay.\n\t\t\tpigLatin = newStart + toEnd + \"ay\";\n\t\t}\n\n\t\treturn pigLatin.toUpperCase(); // returns the word translated into Pig Latin\n\t}",
"public static void upperCaseFirstOfWord() {\n\t\tString isExit = \"\";\n\t\twhile (!isExit.equals(\"N\")) {\n\t\t\tStringBuffer bf = readInput();\n\t\t\tStringBuffer result = new StringBuffer();\n\t\t\tString str = bf.toString();\n\t\t\tString char_prev = \"\";\n\t\t\tString char_current = \"\";\n\t\t\tString key = \" ,.!?:\\\"\";\n\t\t\tresult.append(String.valueOf(str.charAt(0)).toUpperCase());\n\t\t\tfor (int i = 1; i < str.length(); i++) {\n\t\t\t\tchar_prev = String.valueOf(str.charAt(i - 1));\n\t\t\t\tchar_current = String.valueOf(str.charAt(i));\n\t\t\t\tif (key.contains(char_prev)) {\n\t\t\t\t\tchar_current = char_current.toUpperCase();//uppercase first letter each word\n\t\t\t\t}\n\t\t\t\tresult.append(char_current);\n\t\t\t}\n\t\t\tSystem.out.println(\"Chuỗi có chữ cái đầu viết hoa: \\n\" + result);\n\t\t\tSystem.out.println(\"Bạn có muốn nhập tiếp không(0/1):\");\n\t\t\tisExit= scan.next().toString();\n\t\t}\n\t}",
"@Override\n public String encrypt(String word, int cipher) {\n String result = \"\";\n int postcipher = 0;\n boolean wasUpper = false;\n for(int i = 0; i < word.length(); i++)\n {\n char c = word.charAt(i);\n postcipher = c;\n if(Character.isLetter(c)) {\n if (c < ASCII_LOWER_BEGIN) { //change to lowercase\n c += ASCII_DIFF;\n wasUpper = true;\n }\n postcipher = ((c + cipher - ASCII_LOWER_BEGIN) % NUM_ALPHABET + ASCII_LOWER_BEGIN); //shift by cipher amount\n if (wasUpper)\n postcipher -= ASCII_DIFF; //turn back into uppercase if it was uppercase\n wasUpper = false;\n }\n result += (char)postcipher; //add letter by letter into string\n }\n return result;\n }",
"private static void printHangman() {\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tif (guessesResult[i]) {\n\t\t\t\tSystem.out.print(word.charAt(i));\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" _ \");\n\t\t\t}\n\t\t}\n\t}",
"public String buildWord() {\n\t\tStringBuilder word = new StringBuilder();\n\t\t\n\t\tfor(int i = 0; i < letters.size(); i++) {\n\t\t\tLetter tempLetter = letters.get(i);\n\t\t\t\n\t\t\tif(!(letters.get(i).getLetter() >= 'A' && letters.get(i).getLetter() <= 'Z') || tempLetter.getStatus())\n\t\t\t\tif(letters.get(i).getLetter() != ' ')\n\t\t\t\t\tword.append(tempLetter.getLetter());\n\t\t\t\telse\n\t\t\t\t\tword.append(\" \");\n\t\t\telse\n\t\t\t\tif (i == letters.size()-1) word.append(\"_\");\n\t\t\t\telse word.append(\"_ \");\n\t\t}\n\t\treturn word.toString();\n\t}",
"public String convertToUpperCase(String word);",
"public static String mut12(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tchar [] temp = word.toCharArray();\n\t\tString t = \"\";\n\t\tString build = \"\";\n\t\tfor(int i =0; i<word.length(); i++) {\n\t\t\tif(i%2 == 0) {\n\t\t\t\tt = \"\" + temp[i];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[i];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\tbuild = \"\";\n\t\tfor(int j =0; j<word.length(); j++) {\n\t\t\tif(j%2 != 0) {\n\t\t\t\tt = \"\" + temp[j];\n\t\t\t\tbuild += t.toUpperCase();\n\t\t\t}\n\t\t\telse\n\t\t\t\tbuild += \"\" + temp[j];\n\t\t}\n\t\tif(pwMatch(build, person, w)) \n\t\t\treturn build;\n\t\telse if(isDouble)\n\t\t\treturn build;\n\n\t\treturn null;\n\t}",
"public void addWord (String word) {\r\n word = word.toUpperCase ();\r\n if (word.length () > 1) {\r\n String s = validateWord (word);\r\n if (!s.equals (\"\")) {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered contained invalid characters\\nInvalid characters are: \" + s, \"Error\",\r\n JOptionPane.ERROR_MESSAGE);\r\n return;\r\n }\r\n checkEasterEgg (word);\r\n words.add (word);\r\n Components.wordList.getContents ().addElement (word);\r\n } else {\r\n JOptionPane.showMessageDialog (null, \"The word you have entered does not meet the minimum requirement length of 2\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n }\r\n }",
"public static String mut6(String word, SystemUser person, jcrypt w, boolean isDouble) {\n\t\tString temp = word + \"\" + word;\n\t\tif(pwMatch(temp, person, w)) \n\t\t\treturn temp;\n\t\telse if(isDouble)\n\t\t\treturn temp;\n\t\treturn null;\n\t}",
"void setVersesWithWord(Word word);",
"public static void main(String[] args) {\n String input = \"DXC technologies limited\";\n\n String revr = \"\";\n for (int z = input.length() - 1; z >= 0; z--) {\n revr = revr + input.charAt(z);\n }\n System.out.println(revr);\n\n\n String splitwords[] = input.split(\" \");\n String reverseword = \"\";\n\n for (int i = 0; i < splitwords.length; i++) {\n String word = splitwords[i];\n String reversewords = \"\";\n\n for (int j = word.length() - 1; j >= 0; j--) {\n reversewords = reversewords + word.charAt(j);\n }\n reverseword = reverseword + reversewords + \" \";\n\n }\n System.out.println(\"traditional method is \" +trim(reverseword));\n\n //return reverseword;\n\n }",
"static void reverseWordInMyString(String str) {\r\n\t\tString[] words = str.split(\" \");\r\n\t\tString reversedString = \"\";\r\n\t\tfor (int i = 0; i < words.length; i++) {\r\n\t\t\tString word = words[i];\r\n\t\t\tString reverseWord = \"\";\r\n\t\t\tfor (int j = word.length() - 1; j >= 0; j--) {\r\n\t\t\t\t/*\r\n\t\t\t\t * The charAt() function returns the character at the given position in a string\r\n\t\t\t\t */\r\n\t\t\t\treverseWord = reverseWord + word.charAt(j);\r\n\t\t\t}\r\n\t\t\treversedString = reversedString + reverseWord + \" \";\r\n\t\t}\r\n\t\tSystem.out.println(str);\r\n\t\tSystem.out.println(reversedString);\r\n\t}",
"public static String removeDuplicate(String word) {\n StringBuffer sb = new StringBuffer();\n if(word.length() <= 1) {\n return word;\n }\n char current = word.charAt(0);\n sb.append(current);\n for(int i = 1; i < word.length(); i++) {\n char c = word.charAt(i);\n if(c != current) {\n sb.append(c);\n current = c;\n }\n }\n return sb.toString();\n }",
"private void wordBreakRecur(String word, String result) {\n\t\tint size = word.length();\n\n\t\tfor (int i = 1; i <= size; i++) {\n\t\t\tString prefix = word.substring(0, i);\n\n\t\t\tif (dictionaryContains(prefix)) {\n\t\t\t\tif (i == size) {\n\t\t\t\t\tresult += prefix;\n\t\t\t\t\tSystem.out.println(result);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twordBreakRecur(word.substring(i), result + prefix + \" \");\n\t\t\t}\n\t\t}\n\t}",
"private void addWordHelper( String word, int pos, TrieNode curNode )\n\t{\n\t\t//Check to see if the node has been occupied yet\n\t\tif( curNode.getLetters()[ (int)word.charAt(pos) - 97 ] == null )\n\t\t\t//If we are at the last character of the word\n\t\t\tif( pos >= word.length() - 1 )\n\t\t\t\t//Make sure the isWord property is set to true\n\t\t\t\tcurNode.setLetter( word.charAt( pos ), true );\n\t\t\telse\n\t\t\t\tcurNode.setLetter( word.charAt( pos ), false );\n\t\t\n\t\t//If it hasn't reached the last letter yet\n\t\tif( !( pos >= word.length() - 1 ) )\n\t\t\t//Keep on adding the word\n\t\t\taddWordHelper( word, pos + 1, curNode.getLetters()[ (int)word.charAt( pos ) - 97 ] );\n\t}"
] | [
"0.6662926",
"0.66219354",
"0.66218317",
"0.6510193",
"0.6362419",
"0.6277811",
"0.6277672",
"0.6256407",
"0.6222179",
"0.609109",
"0.6087937",
"0.6078367",
"0.6051686",
"0.5953228",
"0.5932638",
"0.58721286",
"0.5850242",
"0.5838339",
"0.5834825",
"0.5801462",
"0.5786919",
"0.5750339",
"0.57159096",
"0.5678331",
"0.566178",
"0.56519246",
"0.5632296",
"0.56298625",
"0.5629472",
"0.56191385",
"0.5618895",
"0.560963",
"0.56096274",
"0.56012636",
"0.55990696",
"0.55865145",
"0.5566351",
"0.55613923",
"0.5559414",
"0.5551075",
"0.55506545",
"0.5539818",
"0.5537802",
"0.5536255",
"0.55333424",
"0.5532898",
"0.5480791",
"0.5476329",
"0.5475856",
"0.5461872",
"0.5456581",
"0.54481864",
"0.5447011",
"0.5446218",
"0.54364604",
"0.54322684",
"0.5415346",
"0.541179",
"0.53945404",
"0.5389591",
"0.53884864",
"0.53769",
"0.53693265",
"0.53596365",
"0.5356805",
"0.53410053",
"0.53330183",
"0.5329625",
"0.5324171",
"0.530609",
"0.5304681",
"0.52976924",
"0.5292924",
"0.5292537",
"0.5286851",
"0.5280787",
"0.5279185",
"0.52772737",
"0.52765226",
"0.5268404",
"0.52623117",
"0.5241601",
"0.5231977",
"0.5230513",
"0.52242994",
"0.5223124",
"0.52193886",
"0.52180386",
"0.52180356",
"0.5217379",
"0.5201294",
"0.5192524",
"0.5154728",
"0.51335806",
"0.5117198",
"0.51168936",
"0.51049715",
"0.5104231",
"0.5098969",
"0.5095302"
] | 0.6934103 | 0 |
TODO Autogenerated method stub | @Override
public String getTest() {
return "123";
} | {
"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 |
Since a K contains can contain Multiple Images, set the id for each image | @Insert(onConflict = OnConflictStrategy.REPLACE)
public void insertTask(Map<Integer, List<Injuries>> injuriesMap) {
injuriesMap.forEach((k, v) -> {
for (int i = 0; i < v.size(); i++) {
v.get(i).setRecallId(k.intValue());
}
});
//Flatten the list of Images out as one List<List<Images>> -> List<Images> send to insert
List<Injuries> ingList = injuriesMap.entrySet().stream().filter(k -> k.getKey() != null)
.flatMap(v -> v.getValue().stream()).collect(Collectors.toList());
_insertTask(ingList);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setImage(int imageId) {\n this.imageId=imageId;\n\t}",
"@Override\n\tpublic Serializable getId() {\n\t\treturn imageId;\n\t}",
"public Builder setImageId(int value) {\n \n imageId_ = value;\n onChanged();\n return this;\n }",
"public void setImgId(Long imgId) {\r\n this.imgId = imgId;\r\n }",
"public void setAmusementObjectImageA(int imageId){\r\n amusementObjectImageA = imageId;\r\n }",
"public void setIdImagen(int idImagen) {\n this.idImagen = idImagen;\n }",
"public int getImageId(){\n \t\treturn imageId;\n \t}",
"public void setImageId(long imageId) {\n this.imageId = imageId;\n }",
"@Test\n\tpublic void setIdTest() {\n\t\tProductScanImageURIKey key = getDefaultKey();\n\t\tkey.setId(OTHER_ID);\n\t\tAssert.assertEquals(OTHER_ID, key.getId());\n\t}",
"public int getImageId() {\n return imageId_;\n }",
"public void setImageId(long imageId) {\n _courseImage.setImageId(imageId);\n }",
"public String getImgId() {\n return imgId;\n }",
"public Long getImgId() {\r\n return imgId;\r\n }",
"public void setImageId(String imageId) {\n this.imageId = imageId;\n }",
"public String getImgKey() {\n return imgKey;\n }",
"public int getImageId() {\n return imageId_;\n }",
"public void setImageId(String ImageId) {\n this.ImageId = ImageId;\n }",
"abstract public String getImageKey();",
"public void setAmusementObjectImageB(int imageId){\r\n amusementObjectImageB = imageId;\r\n }",
"Receta getByIdWithImages(long id);",
"public void setImageIds(String [] ImageIds) {\n this.ImageIds = ImageIds;\n }",
"public void setImage_id(int image_id) {\n\t\tthis.image_id = image_id;\n\t}",
"private void makeImgToTag() {\n\t\timgToTag = new HashMap<String, HashSet<String>>();\n\t\t// Goes through the tagtoimg map to create this map\n\t\tfor (String tag : tagToImg.keySet()) {\n\t\t\tfor (String pathName : tagToImg.get(tag)) {\n\t\t\t\tif (imgToTag.containsKey(pathName))\n\t\t\t\t\timgToTag.get(pathName).add(tag);\n\t\t\t\telse {\n\t\t\t\t\tHashSet<String> tags = new HashSet<String>();\n\t\t\t\t\ttags.add(tag);\n\t\t\t\t\timgToTag.put(pathName, tags);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public String getImageId() {\n return imageId;\n }",
"public Builder clearImageId() {\n \n imageId_ = 0;\n onChanged();\n return this;\n }",
"public void setImageName(String name) {\n imageToInsert = name;\n}",
"public int getImage_id() {\n\t\treturn image_id;\n\t}",
"public String getImageId() {\n return this.imageId;\n }",
"public String getImageId() {\n return this.ImageId;\n }",
"public void setImageTypeID(int value) {\r\n this.imageTypeID = value;\r\n }",
"public long getImageId() {\n return imageId;\n }",
"public int getImageID() {\n return imageID;\n }",
"public void setImgId(String imgId) {\n this.imgId = imgId == null ? null : imgId.trim();\n }",
"public String getImageId() {\n return mImageId;\n }",
"public String [] getImageIds() {\n return this.ImageIds;\n }",
"public void setIdkey(String pIdkey){\n this.idkey = pIdkey;\n }",
"private void setImage(){\n if(objects.size() <= 0)\n return;\n\n IImage img = objects.get(0).getImgClass();\n boolean different = false;\n \n //check for different images.\n for(IDataObject object : objects){\n IImage i = object.getImgClass();\n \n if((img == null && i != null) || \n (img != null && i == null)){\n different = true;\n break;\n }else if (img != null && i != null){ \n \n if(!i.getName().equals(img.getName()) ||\n !i.getDir().equals(img.getDir())){\n different = true;\n break;\n }\n } \n }\n \n if(!different){\n image.setText(BUNDLE.getString(\"NoImage\"));\n if(img != null){\n imgName = img.getName();\n imgDir = img.getDir();\n image.setImage(img.getImage());\n }else{\n image.setImage(null);\n }\n }else{\n image.setText(BUNDLE.getString(\"DifferentImages\"));\n }\n \n image.repaint();\n }",
"@Override\n public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null || getClass() != o.getClass()) {\n return false;\n }\n Image image = (Image) o;\n if (image.getId() == null || getId() == null) {\n return false;\n }\n return Objects.equals(getId(), image.getId());\n }",
"public long getImageId() {\n return this.imageId;\n }",
"@Override\r\n\tpublic void setId(final K id) {\n\t\tsuper.setId(id);\r\n\t}",
"public void setId(String key, Object value) {\n // remove ID, if empty/0/null\n // if we only skipped it, the existing entry will stay although someone changed it to empty.\n String v = String.valueOf(value);\n if (\"\".equals(v) || \"0\".equals(v) || \"null\".equals(v)) {\n ids.remove(key);\n }\n else {\n ids.put(key, value);\n }\n firePropertyChange(key, null, value);\n\n // fire special events for our well known IDs\n if (Constants.TMDB.equals(key) || Constants.IMDB.equals(key) || Constants.TVDB.equals(key) || Constants.TRAKT.equals(key)) {\n firePropertyChange(key + \"Id\", null, value);\n }\n }",
"public void mo38841a(ImagesRequest imagesRequest) {\n }",
"void lSetImage(Image img);",
"public void setImageGenResults(HashMap<String, View> viewMap, HashMap<String, Bitmap> imageMap) {\n if (map != null) {\n// calling addImages is faster as separate addImage calls for each bitmap.\n map.addImages(imageMap);\n }\n// need to store reference to views to be able to use them as hitboxes for click events.\n this.viewMap = viewMap;\n\n }",
"public void setIdKlinik(String idKlinik) {\n this.idKlinik = idKlinik;\r\n }",
"public void createImageSet() {\n\t\t\n\t\t\n\t\tString image_folder = getLevelImagePatternFolder();\n \n String resource = \"0.png\";\n ImageIcon ii = new ImageIcon(this.getClass().getResource(image_folder + resource));\n images.put(\"navigable\", ii.getImage());\n\n\t}",
"public void setImageId(String imageId) {\n this.imageId = imageId == null ? null : imageId.trim();\n }",
"public final void setKeyId(int keyId)\r\n\t{\r\n\t\tthis.keyId = keyId;\r\n\t}",
"public static Long getAValidImageId() {\n\t\tLong id = getAId();\n\t\tif (id == null) {\n\n\t\t\tImage img = new Image(\"http://dummy.com/img.jpg\", (long)(Math.random()*10000), \"Description\", \"keyword\", new Date(0001L));\n\t\t\tIImageStore imageStore = StoreFactory.getImageStore();\n\t\t\timageStore.insert(img);\n\n\t\t\tid = getAId();\n\t\t\tif (id == null) {\n\t\t\t\tthrow new RuntimeException(\"There are no images in DB, and I can't insert one. Cannot run tests without.\");\n\t\t\t}\n\t\t}\n\t\treturn id;\n\t}",
"public String getImageIdentifier() {\n return this.imageIdentifier;\n }",
"private void setImageDynamic(){\n questionsClass.setQuestions(currentQuestionIndex);\n String movieName = questionsClass.getPhotoName();\n ImageView ReferenceToMovieImage = findViewById(R.id.Movie);\n int imageResource = getResources().getIdentifier(movieName, null, getPackageName());\n Drawable img = getResources().getDrawable(imageResource);\n ReferenceToMovieImage.setImageDrawable(img);\n }",
"@Override\n public String getKey()\n {\n return id; \n }",
"public void setImageIdentifier(String imageIdentifier) {\n this.imageIdentifier = imageIdentifier;\n }",
"@Test\n\tpublic void hashCodeDifferentId() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(2);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}",
"Builder addImage(ImageObject value);",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"private void setID(gw.pl.persistence.core.Key value) {\n __getInternalInterface().setFieldValue(ID_PROP.get(), value);\n }",
"public void generateImage(int imageId, int resolution){\n String openUrl = \"/Users/fengyutian/Desktop/jsc/privacyDemo/web/image/\"+imageId+ \".jpg\";\n String saveUrl = \"/Users/fengyutian/Desktop/jsc/privacyDemo/web/image/tmp\";\n String saveName=String.format(\"%d_%d\", imageId, resolution);\n ImageDeal imageDeal = new ImageDeal(openUrl, saveUrl, saveName, \"jpg\");\n try{\n imageDeal.mosaic((int)Math.floor(264/resolution));\n //Thread.currentThread().sleep(1000);\n }catch(Exception e){\n e.printStackTrace();\n }\n\n System.out.printf(\"Image: %d Resolution: %d was generated.\\n\", imageId, resolution);\n }",
"public void setPrimaryKey(long primaryKey) {\n _courseImage.setPrimaryKey(primaryKey);\n }",
"@Override\n\t\tpublic void affectationImageToClient(int idImageUser, int idUser) {\n\t\t\tClient client=cR.findById(idUser).get();\n\t\t\tImageUser1 imageUser1=iur.findById(idImageUser).get();\n\t\t\timageUser1.setClient(client);\n\t\t\tiur.save(imageUser1);\n}",
"private void setSrcId(int value) {\n \n srcId_ = value;\n }",
"public com.agbar.service.model.ImgImportadas create(long imageId);",
"public void setImg_1(String img_1) {\n this.img_1 = img_1;\n }",
"public void setImages() {\n\n imgBlock.removeAll();\n imgBlock.revalidate();\n imgBlock.repaint();\n labels = new JLabel[imgs.length];\n for (int i = 0; i < imgs.length; i++) {\n\n labels[i] = new JLabel(new ImageIcon(Toolkit.getDefaultToolkit().createImage(imgs[i].getSource())));\n imgBlock.add(labels[i]);\n\n }\n\n SwingUtilities.updateComponentTreeUI(jf); // refresh\n initialized = true;\n\n }",
"public interface Image {\n /**\n * @return the image ID\n */\n String getId();\n\n /**\n * @return the image ID, or null if not present\n */\n String getParentId();\n\n /**\n * @return Image create timestamp\n */\n long getCreated();\n\n /**\n * @return the image size\n */\n long getSize();\n\n /**\n * @return the image virtual size\n */\n long getVirtualSize();\n\n /**\n * @return the labels assigned to the image\n */\n Map<String, String> getLabels();\n\n /**\n * @return the names associated with the image (formatted as repository:tag)\n */\n List<String> getRepoTags();\n\n /**\n * @return the digests associated with the image (formatted as repository:tag@sha256:digest)\n */\n List<String> getRepoDigests();\n}",
"public ImageHandler(Group nGroup){\n\t /* Set up the group reference */\n\t\tgroup = nGroup;\n\t\t\n\t\t/* Instantiate the list of images */\n\t\timages = new ArrayList<ImageView>();\n\t}",
"private void generateThumbnail(String identifier)\r\n {\r\n if (isStringNull(identifier)) { throw new IllegalArgumentException(String.format(\r\n Messagesl18n.getString(\"ErrorCodeRegistry.GENERAL_INVALID_ARG_NULL\"), \"Nodeidentifier\")); }\r\n\r\n try\r\n {\r\n UrlBuilder url = new UrlBuilder(OnPremiseUrlRegistry.getThumbnailUrl(session, identifier));\r\n url.addParameter(OnPremiseConstant.PARAM_AS, true);\r\n // Log.d(\"URL\", url.toString());\r\n\r\n // prepare json data\r\n JSONObject jo = new JSONObject();\r\n jo.put(OnPremiseConstant.THUMBNAILNAME_VALUE, RENDITION_THUMBNAIL);\r\n\r\n final JsonDataWriter formData = new JsonDataWriter(jo);\r\n\r\n // send and parse\r\n post(url, formData.getContentType(), new Output()\r\n {\r\n public void write(OutputStream out) throws IOException\r\n {\r\n formData.write(out);\r\n }\r\n }, ErrorCodeRegistry.DOCFOLDER_GENERIC);\r\n }\r\n catch (Exception e)\r\n {\r\n Log.e(TAG, \"Generate Thumbnail : KO\");\r\n }\r\n }",
"public String getImageResourceIds(){\n return imageResourceIds;\n }",
"@Test\n\tpublic void hashCodeNullID() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}",
"public void setImage(Image itemImg) \n {\n img = itemImg;\n }",
"public void setImage(String key, Image image)\n {\n imageRegistry.put(key, image);\n }",
"@Override\n public void onMapSharedElements(List<String> names, Map<String, View> sharedElements) {\n RecyclerView.ViewHolder selectedViewHolder = mPhotosListView\n .findViewHolderForAdapterPosition(MainActivity.currentPosition);\n if (selectedViewHolder == null) {\n return;\n }\n\n // Map the first shared element name to the child ImageView.\n sharedElements\n .put(names.get(0), selectedViewHolder.itemView.findViewById(R.id.ivPhoto));\n }",
"@Override\n\tpublic void setId(Integer arg0) {\n\n\t}",
"public void setKey(String nkey) {\r\n setAttribute(\"id\", nkey);\r\n }",
"void setImage(String image);",
"protected abstract void setupImages(Context context);",
"public void setCurrentImage(int index) {\n if ((index >= 0) && (index < mTexIdArray.length)) {\n mTexId = mTexIdArray[index];\n }\n }",
"public void setKeyId(String keyId) {\n setProperty(KEY_ID, keyId);\n }",
"private void createImageDescriptor(String id) {\n\t\timageDescriptors.put(id, imageDescriptorFromPlugin(PLUGIN_ID, \"icons/\" + id)); //$NON-NLS-1$\n\t}",
"@Override\n public boolean equals(Object object) {\n if (!(object instanceof ProductImage)) {\n return false;\n }\n ProductImage other = (ProductImage) object;\n if ((this.idImage == null && other.idImage != null) || (this.idImage != null && !this.idImage.equals(other.idImage))) {\n return false;\n }\n return true;\n }",
"Builder addImage(ImageObject.Builder value);",
"public void initImage() {\n if (isInited())\n return;\n //获取大图的游标\n Cursor cursor = context.getContentResolver().query(\n MediaStore.Images.Media.EXTERNAL_CONTENT_URI, // 大图URI\n STORE_IMAGES, // 字段\n null, // No where clause\n null, // No where clause\n MediaStore.Images.Media.DATE_TAKEN + \" DESC\"); //根据时间升序\n Log.e(\"eeeeeeeeeeeeeeeeeee\", \"------cursor:\" + cursor);\n if (cursor == null)\n return;\n while (cursor.moveToNext()) {\n int id = cursor.getInt(0);//大图ID\n String path = cursor.getString(1);//大图路径\n LogTool.setLog(\"大图路径1\", path);\n File file = new File(path);\n //判断大图是否存在\n if (file.exists()) {\n //小图URI\n String thumbUri = getThumbnail(id, path);\n //获取大图URI\n String uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI.buildUpon().\n appendPath(Integer.toString(id)).build().toString();\n LogTool.setLog(\"大图路径2\", uri);\n if (Tools.isEmpty(uri))\n continue;\n if (Tools.isEmpty(thumbUri))\n thumbUri = uri;\n //获取目录名\n String folder = file.getParentFile().getName();\n String appFile = context.getResources().getString(R.string.app_name);\n if (!folder.equals(appFile)) {\n LocalFile localFile = new LocalFile();\n localFile.setPath(path);\n localFile.setOriginalUri(uri);\n localFile.setThumbnailUri(thumbUri);\n int degree = cursor.getInt(2);\n if (degree != 0) {\n degree = degree + 180;\n }\n localFile.setOrientation(360 - degree);\n\n\n paths.add(localFile);\n\n\n //判断文件夹是否已经存在\n if (folders.containsKey(folder)) {\n folders.get(folder).add(localFile);\n } else {\n List<LocalFile> files = new ArrayList<>();\n files.add(localFile);\n folders.put(folder, files);\n }\n }\n }\n }\n folders.put(\"所有图片\", paths);\n cursor.close();\n isRunning = false;\n }",
"private void setAdvertImages()\t{\n\n\t\tviewFlipper = (ViewFlipper) findViewById(R.id.view_flipper_display);\n\n\t\tString[] ids = getImageIDs(shopName);\n\n\t\tif(ids.length == 1)\t{\t\t//Just the logo exists\n\t\t\tLinearLayout ll = new LinearLayout(this);\n\t\t\tll.setOrientation(LinearLayout.VERTICAL);\n\n\t\t\tLinearLayout.LayoutParams lpScan = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);\n\t\t\tll.setLayoutParams(lpScan);\n\t\t\tll.setGravity(Gravity.CENTER);\n\n\t\t\tImageView iv = new ImageView(this);\n\t\t\tiv.setLayoutParams(lpScan);\n\t\t\tiv.setImageBitmap(imageLoadedFromInternalStorage(ids[0]));\t\t//Sets flipper images = logo (ids[0])\n\n\t\t\tll.addView(iv);\n\t\t\tviewFlipper.addView(ll);\t\n\t\t}\n\n\n\t\tfor(int i = 1; i < ids.length; i++)\t{\n\n\t\t\tLinearLayout ll = new LinearLayout(this);\n\t\t\tll.setOrientation(LinearLayout.VERTICAL);\n\n\t\t\tLinearLayout.LayoutParams lpScan = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);\n\t\t\tll.setLayoutParams(lpScan);\n\t\t\tll.setGravity(Gravity.CENTER);\n\n\t\t\tImageView iv = new ImageView(this);\n\t\t\tiv.setLayoutParams(lpScan);\n\t\t\tiv.setImageBitmap(imageLoadedFromInternalStorage(ids[i]));\n\n\t\t\tll.addView(iv);\n\t\t\tviewFlipper.addView(ll);\t\n\t\t}\n\t}",
"public int getmGymImageId() {return mGymImageId; }",
"static void setId(NameSpaceContainer container, String id) {\n switch (container.getType()) {\n case SOURCE:\n container.getSource().setId(new EntityId(id));\n return;\n case SPACE:\n container.getSpace().setId(new EntityId(id));\n return;\n case HOME:\n container.getHome().setId(new EntityId(id));\n return;\n case FOLDER:\n container.getFolder().setId(new EntityId(id));\n return;\n case DATASET:\n container.getDataset().setId(new EntityId(id));\n return;\n default:\n throw new RuntimeException(\"Invalid container type\");\n }\n }",
"@Override\n\tpublic Object key() {\n\t\treturn id;\n\t}",
"public int getAnswerImageId() {\n return answerImageId;\n }",
"@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View v, int position,\r\n\t\t\t\t\t\tlong id) {\n\t\t\t\t\timgID=(int)imgadapter.getItemId(position);\r\n\t\t\t\t\timgv.setImageResource(imgID);\r\n\t\t\t\t\t//imgv.setId(imgID);\r\n\t\t\t\t}",
"void loadImages(int id_image, HouseRepository.GetImageFromHouseCallback callback);",
"private Images() {}",
"@Override\n public void setElementId(String arg0)\n {\n \n }",
"public final void setImportantImageInfo() {\r\n int ix = 0, iy = 0, iz = 0;\r\n int i;\r\n \r\n i = 0;\r\n if (getDimElem(0).name.equalsIgnoreCase(\"time\")) {\r\n i = 1;\r\n }\r\n final String firstDim = getDimElem(i).name;\r\n Preferences.debug(\"firstDim = \" + firstDim + \"\\n\", Preferences.DEBUG_FILEIO);\r\n\r\n final String secondDim = getDimElem(i+1).name;\r\n Preferences.debug(\"secondDim = \" + secondDim + \"\\n\", Preferences.DEBUG_FILEIO);\r\n\r\n String thirdDim = null;\r\n if (getExtents().length > 2) {\r\n thirdDim = getDimElem(i+2).name;\r\n Preferences.debug(\"thirdDim = \" + thirdDim + \"\\n\", Preferences.DEBUG_FILEIO);\r\n }\r\n\r\n for (i = 0; i < varArray.length; i++) {\r\n\r\n if (varArray[i].name.equals(\"image\")) {\r\n setOffset(varArray[i].begin);\r\n Preferences.debug(\"Image offset = \" + getOffset() + \"\\n\", Preferences.DEBUG_FILEIO);\r\n\r\n switch (varArray[i].nc_type) {\r\n\r\n case NC_BYTE:\r\n if (varArray[i].signtype.equals(\"unsigned\")) {\r\n Preferences.debug(\"Data type = UBYTE\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.UBYTE);\r\n } else {\r\n Preferences.debug(\"Data type = BYTE\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.BYTE);\r\n }\r\n\r\n break;\r\n\r\n case NC_SHORT:\r\n if (varArray[i].signtype.equals(\"unsigned\")) {\r\n Preferences.debug(\"Data type = USHORT\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.USHORT);\r\n } else {\r\n Preferences.debug(\"Data type = SHORT\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.SHORT);\r\n }\r\n\r\n break;\r\n\r\n case NC_INT:\r\n if (varArray[i].signtype.equals(\"unsigned\")) {\r\n Preferences.debug(\"Data type = UINTEGER\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.UINTEGER);\r\n } else {\r\n Preferences.debug(\"Data type = INTEGER\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.INTEGER);\r\n }\r\n\r\n break;\r\n\r\n case NC_FLOAT:\r\n Preferences.debug(\"Data type = FLOAT\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.FLOAT);\r\n break;\r\n\r\n case NC_DOUBLE:\r\n Preferences.debug(\"Data type = DOUBLE\\n\", Preferences.DEBUG_FILEIO);\r\n setDataType(ModelStorageBase.DOUBLE);\r\n break;\r\n\r\n default:\r\n Preferences.debug(\"varArray[\" + i + \"].nc_type illegally = \" + varArray[i].nc_type + \"\\n\", \r\n \t\tPreferences.DEBUG_FILEIO);\r\n MipavUtil.displayError(\"Invalid type in FileInfoMinc\");\r\n }\r\n\r\n for (final FileMincAttElem elem : varArray[i].vattArray) {\r\n if (elem.name.equals(\"valid_range\")) {\r\n\r\n switch (elem.nc_type) {\r\n\r\n case NC_BYTE:\r\n vmin = ((Byte) elem.values[0]).byteValue();\r\n vmax = ((Byte) elem.values[1]).byteValue();\r\n break;\r\n\r\n case NC_CHAR:\r\n vmin = ((Character) elem.values[0]).charValue();\r\n vmax = ((Character) elem.values[1]).charValue();\r\n break;\r\n\r\n case NC_SHORT:\r\n vmin = ((Short) elem.values[0]).shortValue();\r\n vmax = ((Short) elem.values[1]).shortValue();\r\n break;\r\n\r\n case NC_INT:\r\n vmin = ((Integer) elem.values[0]).intValue();\r\n vmax = ((Integer) elem.values[1]).intValue();\r\n break;\r\n\r\n case NC_FLOAT:\r\n vmin = ((Float) elem.values[0]).floatValue();\r\n vmax = ((Float) elem.values[1]).floatValue();\r\n break;\r\n\r\n case NC_DOUBLE:\r\n vmin = ((Double) elem.values[0]).doubleValue();\r\n vmax = ((Double) elem.values[1]).doubleValue();\r\n }\r\n\r\n Preferences.debug(\"vmin = \" + vmin + \"\\n\", Preferences.DEBUG_FILEIO);\r\n Preferences.debug(\"vmax = \" + vmax + \"\\n\", Preferences.DEBUG_FILEIO);\r\n } else if (elem.name.equals(\"valid_max\")) {\r\n\r\n switch (elem.nc_type) {\r\n\r\n case NC_BYTE:\r\n vmax = ((Byte) elem.values[0]).byteValue();\r\n break;\r\n\r\n case NC_CHAR:\r\n vmax = ((Character) elem.values[0]).charValue();\r\n break;\r\n\r\n case NC_SHORT:\r\n vmax = ((Short) elem.values[0]).shortValue();\r\n break;\r\n\r\n case NC_INT:\r\n vmax = ((Integer) elem.values[0]).intValue();\r\n break;\r\n\r\n case NC_FLOAT:\r\n vmax = ((Float) elem.values[0]).floatValue();\r\n break;\r\n\r\n case NC_DOUBLE:\r\n vmax = ((Double) elem.values[0]).doubleValue();\r\n }\r\n\r\n Preferences.debug(\"vmax = \" + vmax + \"\\n\", Preferences.DEBUG_FILEIO);\r\n } else if (elem.name.equals(\"valid_min\")) {\r\n\r\n switch (elem.nc_type) {\r\n\r\n case NC_BYTE:\r\n vmin = ((Byte) elem.values[0]).byteValue();\r\n break;\r\n\r\n case NC_CHAR:\r\n vmin = ((Character) elem.values[0]).charValue();\r\n break;\r\n\r\n case NC_SHORT:\r\n vmin = ((Short) elem.values[0]).shortValue();\r\n break;\r\n\r\n case NC_INT:\r\n vmin = ((Integer) elem.values[0]).intValue();\r\n break;\r\n\r\n case NC_FLOAT:\r\n vmin = ((Float) elem.values[0]).floatValue();\r\n break;\r\n\r\n case NC_DOUBLE:\r\n vmin = ((Double) elem.values[0]).doubleValue();\r\n }\r\n\r\n Preferences.debug(\"vmin = \" + vmin + \"\\n\", Preferences.DEBUG_FILEIO);\r\n }\r\n }\r\n } else if (varArray[i].name.equals(thirdDim)) {\r\n axisOrientation[0] = FileInfoMinc.setOrientType(thirdDim, (varArray[i].step > 0));\r\n ix = i;\r\n } else if (varArray[i].name.equals(secondDim)) {\r\n axisOrientation[1] = FileInfoMinc.setOrientType(secondDim, (varArray[i].step > 0));\r\n iy = i;\r\n } else if (varArray[i].name.equals(firstDim)) {\r\n axisOrientation[2] = FileInfoMinc.setOrientType(firstDim, (varArray[i].step > 0));\r\n iz = i;\r\n }\r\n }\r\n\r\n if ( (varArray[ix].cosines != null) && (varArray[iy].cosines != null) && (varArray[iz].cosines != null)) {\r\n final TransMatrix mat = new TransMatrix(3);\r\n mat.set(0, 0, varArray[ix].cosines[0]);\r\n mat.set(1, 0, varArray[ix].cosines[1]);\r\n mat.set(2, 0, varArray[ix].cosines[2]);\r\n mat.set(0, 1, varArray[iy].cosines[0]);\r\n mat.set(1, 1, varArray[iy].cosines[1]);\r\n mat.set(2, 1, varArray[iy].cosines[2]);\r\n mat.set(0, 2, varArray[iz].cosines[0]);\r\n mat.set(1, 2, varArray[iz].cosines[1]);\r\n mat.set(2, 2, varArray[iz].cosines[2]);\r\n axisOrientation = FileInfoMinc.getAxisOrientation(mat);\r\n\r\n if (varArray[ix].step < 0) {\r\n axisOrientation[0] = FileInfoBase.oppositeOrient(axisOrientation[0]);\r\n }\r\n\r\n if (varArray[iy].step < 0) {\r\n axisOrientation[1] = FileInfoBase.oppositeOrient(axisOrientation[1]);\r\n }\r\n\r\n if (varArray[iz].step < 0) {\r\n axisOrientation[2] = FileInfoBase.oppositeOrient(axisOrientation[2]);\r\n }\r\n }\r\n\r\n for (i = 0; i < axisOrientation.length; i++) {\r\n\r\n switch (axisOrientation[i]) {\r\n\r\n case ORI_UNKNOWN_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_UNKNOWN_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_R2L_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_R2L_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_L2R_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_L2R_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_P2A_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_P2A_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_A2P_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_A2P_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_I2S_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_I2S_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n\r\n case ORI_S2I_TYPE:\r\n Preferences.debug(\"axisOrientation[\" + i + \"] = ORI_S2I_TYPE\\n\", Preferences.DEBUG_FILEIO);\r\n break;\r\n }\r\n }\r\n }",
"@Override\n\t\t\tpublic int getCount() {\n\t\t\t\treturn imageId.length;\n\t\t\t}",
"public static void GenerateImageArea(int id)\n\t{\n\t\tareaHeight += 190;\n\t\tHome.createArticle.setPreferredSize(new Dimension(800, areaHeight));\n\t\t\n\t\ti++;\n\t\tgbc.gridx = 0;\n\t\tgbc.gridy = i;\n\t\tgbc.gridwidth = 1;\n\t\tgbc.anchor = GridBagConstraints.LINE_START;\n\t\tgbc.insets = new Insets(10, 0, 0, 0);\n\t\tHome.createArticle.add(imageButtons.get(id), gbc);\n\t\t\n\t\tgbc.gridx = 1;\n\t\tgbc.gridwidth = 3;\n\t\tgbc.weighty = 10;\n\t\tHome.createArticle.add(imageAreas.get(id), gbc);\n\t\t\n\t}",
"public void setId(int i) { id = i; }",
"public void updateImageForIndex(int index) {\n\t\t//Nothing to do\n\t}",
"private void setId() {\n id = count++;\n }",
"@Id\n\t@Key\n\t@Override\n\tpublic void setId(String id)\n\t{\n\t\tsuper.setId(id);\n\t}",
"public static void setIdAssigner(ImageIdAssigner idAssigner)\n\t{\n\t\tif(ItemImage.idAssigner == null)\n\t\t\tItemImage.idAssigner = idAssigner;\n\t}",
"@Nonnull\n static ImageKey of(@Nonnull String groupId, @Nonnull String imageId, int width, int height) {\n return UIInternal.get()._ImageKey_of(groupId, imageId, width, height);\n }"
] | [
"0.6706152",
"0.66866815",
"0.6601235",
"0.64618355",
"0.63746244",
"0.6286222",
"0.6205874",
"0.61988276",
"0.61053574",
"0.61005956",
"0.6069324",
"0.6062536",
"0.60510933",
"0.59785885",
"0.59718037",
"0.59663975",
"0.5932015",
"0.5894192",
"0.58937764",
"0.5863955",
"0.5839983",
"0.5836712",
"0.5797613",
"0.57186615",
"0.5676691",
"0.56751657",
"0.56657034",
"0.5651214",
"0.56435555",
"0.56065124",
"0.55897117",
"0.55843496",
"0.55829877",
"0.5534629",
"0.55179435",
"0.5492024",
"0.5457177",
"0.5433138",
"0.5414592",
"0.5402214",
"0.5399434",
"0.53782016",
"0.5375033",
"0.5373804",
"0.534634",
"0.53414506",
"0.5335433",
"0.5326465",
"0.53144723",
"0.53103316",
"0.5295481",
"0.52712095",
"0.5262976",
"0.5256527",
"0.5249157",
"0.5245973",
"0.5245973",
"0.5245973",
"0.5239021",
"0.52349085",
"0.5222063",
"0.5216362",
"0.5205146",
"0.5197186",
"0.519274",
"0.5182478",
"0.5181106",
"0.5177269",
"0.51758647",
"0.51497453",
"0.5132081",
"0.5128075",
"0.5126897",
"0.51257306",
"0.5124825",
"0.51202446",
"0.51147854",
"0.5112896",
"0.5102789",
"0.509758",
"0.5092259",
"0.5086078",
"0.50803304",
"0.5078825",
"0.50773734",
"0.50748956",
"0.50697774",
"0.50680274",
"0.5056587",
"0.5055522",
"0.50517",
"0.5045322",
"0.5042555",
"0.50400615",
"0.50391376",
"0.5034095",
"0.5028831",
"0.5021318",
"0.501934",
"0.5010469",
"0.5003073"
] | 0.0 | -1 |
Method to remove stop words from a given string. Uses Lucene list of stop words and a custom list stored in the stopwords.txt file | public static String removeStopWords(String textFile) throws Exception {
//CharArraySet stopWords = EnglishAnalyzer.getDefaultStopSet();
StandardAnalyzer analyser = new StandardAnalyzer();
TokenStream tokenStream = new StandardTokenizer(new StringReader(textFile.trim()));
tokenStream = new StopFilter(tokenStream, analyser.STOP_WORDS_SET);
BufferedReader br = new BufferedReader(new FileReader("stopwords.txt"));
String line = null;
List<String> stopw = new ArrayList<String>();
int i =0;
line = br.readLine();
while(line != null){
stopw.add(line);
line = br.readLine();
}
tokenStream = new StopFilter(tokenStream, StopFilter.makeStopSet(stopw));
StringBuilder sb = new StringBuilder();
CharTermAttribute charTermAttribute = tokenStream.addAttribute(CharTermAttribute.class);
tokenStream.reset();
while (tokenStream.incrementToken()) {
String term = charTermAttribute.toString();
if(term.length() > 2)
sb.append(term + " ");
}
return sb.toString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public RemoverStopWords() {\n\t\tBufferedReader br = null;\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"stopwords_en.txt\"));\n\t\t\tString line;\n\n\t\t\twhile ((line = br.readLine()) != null) {\n\t\t\t\tstop_words.add(line.trim());\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null) {\n\t\t\t\t\tbr.close();\n\t\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"private static String removeStopWords(String str) {\n for(int i=0; i<stopWords.size(); i++) {\n String temp = stopWords.get(i);\n if(temp.equalsIgnoreCase(str)) {\n str = \"\";\n }\n }\n return str;\n }",
"public String remove_stop_words(String text) {\n\t\tfor (String w : stop_words) {\n\t\t\ttext = text.replaceAll(\"\\\\s*\\\\b\" + w + \"\\\\b\\\\s*\", \" \");\n\t\t}\n\n\t\treturn text;\n\t}",
"public List<String> stopTermRemoval(List<String> terms) {\r\n\t\tif(swr == null)\r\n\t\t\ttry {\r\n\t\t\t\tswr = new StopTermRemoval(SVMClassifier.class.getClassLoader().getResource(\"stopwords.txt\").openStream());\r\n\t\t\t} catch (Exception 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\tswr.removeSymbolTerms(terms);\r\n\t\tswr.removeStopTerms(terms);\r\n\t\treturn terms;\r\n\t}",
"private String removeStopWords(String str) throws IOException{\n String stopwords = \"!! ?! ?? !? ` `` '' -lrb- -rrb- -lsb- -rsb- , . : ; \\\" ' ? < > { } [ ] + - ( ) & % $ @ ! ^ # * .. ... 'll 's 'm a about above after again against all am an and any are aren't as at be because been before being below between both but by can can't cannot could couldn't did didn't do does doesn't doing don't down during each few for from further had hadn't has hasn't have haven't having he he'd he'll he's her here here's hers herself him himself his how how's i i'd i'll i'm i've if in into is isn't it it's its itself let's me more most mustn't my myself no nor not of off on once only or other ought our ours ourselves out over own same shan't she she'd she'll she's should shouldn't so some such than that that's the their theirs them themselves then there there's these they they'd they'll they're they've this those through to too under until up very was wasn't we we'd we'll we're we've were weren't what what's when when's where where's which while who who's whom why why's with won't would wouldn't you you'd you'll you're you've your yours yourself yourselves ### return arent cant couldnt didnt doesnt dont hadnt hasnt havent hes heres hows im isnt its lets mustnt shant shes shouldnt thats theres theyll theyre theyve wasnt were werent whats whens wheres whos whys wont wouldnt youd youll youre youve\";\n String[] allWords = str.toLowerCase().split(\" \");\n StringBuilder builder = new StringBuilder();\n for(String word : allWords) {\n if(!stopwords.contains(word)) {\n builder.append(word);\n builder.append(' ');\n } \n }\n String result = builder.toString().trim();\n return result;\n }",
"@Test\n\tpublic void testRemoveAllStopWords() {\n\t\tString result;\n\t\ttry {\n\t\t\tresult = sp.removeStopWords(stopWords);\n\t\t\tassertEquals(\"Strings not equal. They should be empty.\", \"\", result);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public StopWordRemover( ) {\n\t\t// Load and store the stop words from the fileinputstream with appropriate data structure.\n\t\t// NT: address of stopword.txt is Path.StopwordDir\n\t}",
"public List<String> removeStopWords2(List<String> tokenizedWords) {\n\n List<String> res = new ArrayList<>();\n for(String word : tokenizedWords) {\n if(!this.stopwords.contains(word)) {\n res.add(word);\n }\n }\n return res;\n }",
"@Override\n public Builder stopWords(@NonNull List<String> stopList) {\n super.stopWords(stopList);\n return this;\n }",
"@Override\n public Builder stopWords(@NonNull Collection<VocabWord> stopList) {\n super.stopWords(stopList);\n return this;\n }",
"public Removalstops()\n {\n stopWords.add(\"am\");\n stopWords.add(\"my\");\nstopWords.add(\"at\");\nstopWords.add(\"a\");\nstopWords.add(\"i\");\nstopWords.add(\"is\");\nstopWords.add(\"of\");\nstopWords.add(\"have\");\nstopWords.add(\"--\");\nstopWords.add(\"do\");\nstopWords.add(\"the\");\nstopWords.add(\"was\");\nstopWords.add(\"iam\");\nstopWords.add(\"there\");\nstopWords.add(\"what\");\nstopWords.add(\"for\");\nstopWords.add(\"in\");\nstopWords.add(\"very\");\nstopWords.add(\"and\");\nstopWords.add(\"to\");\nstopWords.add(\"often\");\nstopWords.add(\"because\");\nstopWords.add(\"in\");\nstopWords.add(\"an\");\nstopWords.add(\"can\");\nstopWords.add(\"via\");\nstopWords.add(\"even\");\nstopWords.add(\"as\");\nstopWords.add(\"best\");\nstopWords.add(\"been\");\nstopWords.add(\"into\");\nstopWords.add(\"by\");\nstopWords.add(\"around\");\nstopWords.add(\"being\");\nstopWords.add(\"from\");\nstopWords.add(\"etc\");\nstopWords.add(\"his\");\nstopWords.add(\"do\");\nstopWords.add(\"have\");\nstopWords.add(\"had\"); \nstopWords.add(\"able\");\nstopWords.add(\"about\");\nstopWords.add(\"above\");\nstopWords.add(\"abroad\");\nstopWords.add(\"according\");\nstopWords.add(\"accordingly\");\nstopWords.add(\"across\");\nstopWords.add(\"actually\");\nstopWords.add(\"adj\");\nstopWords.add(\"after\");\nstopWords.add(\"afterwards\");\nstopWords.add(\"again\");\nstopWords.add(\"against\");\nstopWords.add(\"ago\");\nstopWords.add(\"ahead\");\nstopWords.add(\"ain't\");\nstopWords.add(\"all\");\nstopWords.add(\"allow\");\nstopWords.add(\"allows\");\nstopWords.add(\"almost\");\nstopWords.add(\"alone\");\nstopWords.add(\"along\");\nstopWords.add(\"alongside\");\nstopWords.add(\"already\");\nstopWords.add(\"also\");\nstopWords.add(\"although\");\nstopWords.add(\"always\");\nstopWords.add(\"am\");\nstopWords.add(\"amid\");\nstopWords.add(\"amidst\");\nstopWords.add(\"among\");\nstopWords.add(\"amongst\");\nstopWords.add(\"an\");\nstopWords.add(\"and\");\nstopWords.add(\"another\");\nstopWords.add(\"any\");\nstopWords.add(\"anybody\");\nstopWords.add(\"anyhow\");\nstopWords.add(\"anyone\");\nstopWords.add(\"anything\");\nstopWords.add(\"anyway\");\nstopWords.add(\"anyways\");\nstopWords.add(\"anywhere\");\nstopWords.add(\"apart\");\nstopWords.add(\"appear\");\nstopWords.add(\"appreciate\");\nstopWords.add(\"appropriate\");\nstopWords.add(\"are\");\nstopWords.add(\"aren't\");\nstopWords.add(\"around\");\nstopWords.add(\"as\");\nstopWords.add(\"a's\");\nstopWords.add(\"aside\");\nstopWords.add(\"ask\");\nstopWords.add(\"asking\");\nstopWords.add(\"associated\");\nstopWords.add(\"at\");\nstopWords.add(\"available\");\nstopWords.add(\"away\");\nstopWords.add(\"awfully\");\nstopWords.add(\"back\");\nstopWords.add(\"backward\");\nstopWords.add(\"backwards\");\nstopWords.add(\"be\");\nstopWords.add(\"became\");\nstopWords.add(\"beacause\");\nstopWords.add(\"become\");\nstopWords.add(\"becomes\");\nstopWords.add(\"becoming\");\nstopWords.add(\"been\");\nstopWords.add(\"before\");\nstopWords.add(\"beforehand\");\nstopWords.add(\"begin\");\nstopWords.add(\"behind\");\nstopWords.add(\"being\");\nstopWords.add(\"believe\");\nstopWords.add(\"below\");\nstopWords.add(\"beside\");\nstopWords.add(\"besides\");\nstopWords.add(\"best\");\nstopWords.add(\"better\");\nstopWords.add(\"between\");\nstopWords.add(\"beyond\");\nstopWords.add(\"both\");\nstopWords.add(\"brief\");\nstopWords.add(\"but\");\nstopWords.add(\"by\");\nstopWords.add(\"came\");\nstopWords.add(\"can\");\nstopWords.add(\"cannot\");\nstopWords.add(\"cant\");\nstopWords.add(\"can't\");\nstopWords.add(\"caption\");\nstopWords.add(\"cause\");\nstopWords.add(\"causes\");\nstopWords.add(\"certain\");\nstopWords.add(\"cetrainly\");\nstopWords.add(\"changes\");\nstopWords.add(\"clearly\");\nstopWords.add(\"c'mon\");\nstopWords.add(\"co\");\nstopWords.add(\"co.\");\nstopWords.add(\"com\");\nstopWords.add(\"come\");\nstopWords.add(\"comes\");\nstopWords.add(\"concerning\");\nstopWords.add(\"consequently\");\nstopWords.add(\"consider\");\nstopWords.add(\"considering\");\nstopWords.add(\"could\");\nstopWords.add(\"couldn't\");\nstopWords.add(\"c's\");\nstopWords.add(\"currently\");\nstopWords.add(\"dare\");\nstopWords.add(\"daren't\");\nstopWords.add(\"definitely\");\nstopWords.add(\"described\");\nstopWords.add(\"despite\");\nstopWords.add(\"did\");\nstopWords.add(\"didn't\");\nstopWords.add(\"different\");\nstopWords.add(\"directly\");\nstopWords.add(\"do\");\nstopWords.add(\"does\");\nstopWords.add(\"doesn't\");\nstopWords.add(\"doing\");\nstopWords.add(\"done\");\nstopWords.add(\"don't\");\nstopWords.add(\"down\");\nstopWords.add(\"downwards\");\nstopWords.add(\"during\");\nstopWords.add(\"each\");\nstopWords.add(\"edu\");\nstopWords.add(\"eg\");\nstopWords.add(\"eight\");\nstopWords.add(\"eighty\");\nstopWords.add(\"either\");\nstopWords.add(\"else\");\nstopWords.add(\"elsewhere\");\nstopWords.add(\"end\");\nstopWords.add(\"ending\");\nstopWords.add(\"enough\");\nstopWords.add(\"entirely\");\nstopWords.add(\"especially\");\nstopWords.add(\"et\");\nstopWords.add(\"etc\");\nstopWords.add(\"even\");\nstopWords.add(\"evenmore\");\nstopWords.add(\"every\");\nstopWords.add(\"everybody\");\nstopWords.add(\"everyone\");\nstopWords.add(\"everything\");\nstopWords.add(\"everywhere\");\nstopWords.add(\"ex\");\nstopWords.add(\"exactly\");\nstopWords.add(\"example\");\nstopWords.add(\"except\");\nstopWords.add(\"fairly\");\nstopWords.add(\"far\");\nstopWords.add(\"farhter\");\nstopWords.add(\"few\");\nstopWords.add(\"fewer\");\nstopWords.add(\"fifth\");\nstopWords.add(\"first\");\nstopWords.add(\"five\");\nstopWords.add(\"followed\");\nstopWords.add(\"following\");\nstopWords.add(\"follows\");\nstopWords.add(\"for\");\nstopWords.add(\"forever\");\nstopWords.add(\"former\");\nstopWords.add(\"formerly\");\nstopWords.add(\"forth\");\nstopWords.add(\"forward\");\nstopWords.add(\"found\");\nstopWords.add(\"four\");\nstopWords.add(\"from\");\nstopWords.add(\"further\");\nstopWords.add(\"furthermore\");\nstopWords.add(\"get\");\nstopWords.add(\"gets\");\nstopWords.add(\"getting\");\nstopWords.add(\"given\");\nstopWords.add(\"gives\");\nstopWords.add(\"go\");\nstopWords.add(\"goes\");\nstopWords.add(\"going\");\nstopWords.add(\"gone\");\nstopWords.add(\"got\");\nstopWords.add(\"gotten\");\nstopWords.add(\"greetings\");\nstopWords.add(\"had\");\nstopWords.add(\"hadn't\");\nstopWords.add(\"half\");\nstopWords.add(\"happens\");\nstopWords.add(\"hardly\");\nstopWords.add(\"has\");\nstopWords.add(\"hasn't\");\nstopWords.add(\"have\");\nstopWords.add(\"haven't\");\nstopWords.add(\"having\");\nstopWords.add(\"he\");\nstopWords.add(\"he'd\");\nstopWords.add(\"he'll\");\nstopWords.add(\"hello\");\nstopWords.add(\"help\");\nstopWords.add(\"hence\");\nstopWords.add(\"her\");\nstopWords.add(\"here\");\nstopWords.add(\"hereafter\");\nstopWords.add(\"hereby\");\nstopWords.add(\"herein\");\nstopWords.add(\"here's\");\nstopWords.add(\"hereupon\");\nstopWords.add(\"hers\");\nstopWords.add(\"herself\");\nstopWords.add(\"he's\");\nstopWords.add(\"hi\");\nstopWords.add(\"him\");\nstopWords.add(\"himself\");\nstopWords.add(\"his\");\nstopWords.add(\"hither\");\nstopWords.add(\"hopefully\");\nstopWords.add(\"how\");\nstopWords.add(\"howbeit\");\nstopWords.add(\"however\");\nstopWords.add(\"however\");\nstopWords.add(\"hundred\");\nstopWords.add(\"i'd\");\nstopWords.add(\"ie\");\nstopWords.add(\"if\");\nstopWords.add(\"ignored\");\nstopWords.add(\"i'll\");\nstopWords.add(\"i'm\");\nstopWords.add(\"immediate\");\nstopWords.add(\"in\");\nstopWords.add(\"iansmuch\");\nstopWords.add(\"inc\");\nstopWords.add(\"inc.\");\nstopWords.add(\"indeed\");\nstopWords.add(\"indicate\");\nstopWords.add(\"indicated\");\nstopWords.add(\"indicates\");\nstopWords.add(\"inner\");\nstopWords.add(\"inside\");\nstopWords.add(\"insofar\");\nstopWords.add(\"into\");\nstopWords.add(\"inward\");\nstopWords.add(\"is\");\nstopWords.add(\"isn't\");\nstopWords.add(\"it\");\nstopWords.add(\"it'd\");\nstopWords.add(\"it'll\");\nstopWords.add(\"its\");\nstopWords.add(\"it's\");\nstopWords.add(\"itself\");\nstopWords.add(\"i've\");\nstopWords.add(\"just\");\nstopWords.add(\"k\");\nstopWords.add(\"keep\");\nstopWords.add(\"keeps\");\nstopWords.add(\"kept\");\nstopWords.add(\"know\");\nstopWords.add(\"knows\");\nstopWords.add(\"known\");\nstopWords.add(\"last\");\nstopWords.add(\"lately\");\nstopWords.add(\"later\");\nstopWords.add(\"latter\");\nstopWords.add(\"latterly\");\nstopWords.add(\"least\");\nstopWords.add(\"less\");\nstopWords.add(\"let\");\nstopWords.add(\"let's\");\nstopWords.add(\"like\");\nstopWords.add(\"liked\");\nstopWords.add(\"likely\");\nstopWords.add(\"likewise\");\nstopWords.add(\"little\");\nstopWords.add(\"look\");\nstopWords.add(\"looks\");\nstopWords.add(\"low\");\nstopWords.add(\"lower\");\nstopWords.add(\"ltd\");\nstopWords.add(\"made\");\nstopWords.add(\"mainly\");\nstopWords.add(\"make\");\nstopWords.add(\"makes\");\nstopWords.add(\"many\");\nstopWords.add(\"may\");\nstopWords.add(\"maybe\");\nstopWords.add(\"mayn't\");\nstopWords.add(\"me\");\nstopWords.add(\"mean\");\nstopWords.add(\"meanwhile\");\nstopWords.add(\"merely\");\nstopWords.add(\"might\");\nstopWords.add(\"mightn't\");\nstopWords.add(\"mine\");\nstopWords.add(\"minus\");\nstopWords.add(\"miss\");\nstopWords.add(\"more\");\nstopWords.add(\"moreover\");\nstopWords.add(\"most\");\nstopWords.add(\"mostly\");\nstopWords.add(\"mr\");\nstopWords.add(\"mrs\");\nstopWords.add(\"much\");\nstopWords.add(\"must\");\nstopWords.add(\"mustn't\");\nstopWords.add(\"my\");\nstopWords.add(\"myself\");\nstopWords.add(\"name\");\nstopWords.add(\"namely\");\nstopWords.add(\"nd\");\nstopWords.add(\"near\");\nstopWords.add(\"nearly\");\nstopWords.add(\"necessary\");\nstopWords.add(\"need\");\nstopWords.add(\"needn't\");\nstopWords.add(\"needs\");\nstopWords.add(\"neither\");\nstopWords.add(\"never\");\nstopWords.add(\"neverf\");\nstopWords.add(\"neverless\");\nstopWords.add(\"nevertheless\");\nstopWords.add(\"new\");\nstopWords.add(\"next\");\nstopWords.add(\"nine\");\nstopWords.add(\"ninety\");\nstopWords.add(\"no\");\nstopWords.add(\"nobody\");\nstopWords.add(\"non\");\nstopWords.add(\"none\");\nstopWords.add(\"nonetheless\");\nstopWords.add(\"noone\");\nstopWords.add(\"no-one\");\nstopWords.add(\"nor\");\nstopWords.add(\"normally\");\nstopWords.add(\"not\");\nstopWords.add(\"nothing\");\nstopWords.add(\"notwithstanding\");\nstopWords.add(\"novel\");\nstopWords.add(\"now\");\nstopWords.add(\"nowwhere\");\nstopWords.add(\"obviously\");\nstopWords.add(\"of\");\nstopWords.add(\"off\");\nstopWords.add(\"often\");\nstopWords.add(\"oh\");\nstopWords.add(\"ok\");\nstopWords.add(\"okay\");\nstopWords.add(\"old\");\nstopWords.add(\"on\");\nstopWords.add(\"once\");\nstopWords.add(\"one\");\nstopWords.add(\"ones\");\nstopWords.add(\"one's\");\nstopWords.add(\"only\");\nstopWords.add(\"onto\");\nstopWords.add(\"opposite\");\nstopWords.add(\"or\");\nstopWords.add(\"other\");\nstopWords.add(\"others\");\nstopWords.add(\"otherwise\");\nstopWords.add(\"ought\");\nstopWords.add(\"oughtn't\");\nstopWords.add(\"our\");\nstopWords.add(\"ourselves\");\nstopWords.add(\"out\");\nstopWords.add(\"outside\");\nstopWords.add(\"over\");\nstopWords.add(\"overall\");\nstopWords.add(\"own\");\nstopWords.add(\"particular\");\nstopWords.add(\"particularly\");\nstopWords.add(\"past\");\nstopWords.add(\"per\");\nstopWords.add(\"perhaps\");\nstopWords.add(\"placed\");\nstopWords.add(\"please\");\nstopWords.add(\"plus\");\nstopWords.add(\"possible\");\nstopWords.add(\"presumably\");\nstopWords.add(\"probably\");\nstopWords.add(\"provided\");\nstopWords.add(\"provides\");\nstopWords.add(\"que\");\nstopWords.add(\"quite\");\nstopWords.add(\"qv\");\nstopWords.add(\"rather\");\nstopWords.add(\"rd\");\nstopWords.add(\"re\");\nstopWords.add(\"really\");\nstopWords.add(\"reasonably\");\nstopWords.add(\"recent\");\nstopWords.add(\"recently\");\nstopWords.add(\"regarding\");\nstopWords.add(\"regardless\");\nstopWords.add(\"regards\");\nstopWords.add(\"relatively\");\nstopWords.add(\"respectively\");\nstopWords.add(\"right\");\nstopWords.add(\"round\");\nstopWords.add(\"said\");\nstopWords.add(\"same\");\nstopWords.add(\"saw\");\nstopWords.add(\"say\");\nstopWords.add(\"saying\");\nstopWords.add(\"says\");\nstopWords.add(\"second\");\nstopWords.add(\"secondly\");\nstopWords.add(\"see\");\nstopWords.add(\"seeing\");\nstopWords.add(\"seem\");\nstopWords.add(\"seemed\");\nstopWords.add(\"seeming\");\nstopWords.add(\"seems\");\nstopWords.add(\"seen\");\nstopWords.add(\"self\");\nstopWords.add(\"selves\");\nstopWords.add(\"sensible\");\nstopWords.add(\"sent\");\nstopWords.add(\"serious\");\nstopWords.add(\"seriously\");\nstopWords.add(\"seven\");\nstopWords.add(\"several\");\nstopWords.add(\"shall\");\nstopWords.add(\"shan't\");\nstopWords.add(\"she\");\nstopWords.add(\"she'd\");\nstopWords.add(\"she'll\");\nstopWords.add(\"she's\");\nstopWords.add(\"should\");\nstopWords.add(\"shouldn't\");\nstopWords.add(\"since\");\nstopWords.add(\"six\");\nstopWords.add(\"so\");\nstopWords.add(\"some\");\nstopWords.add(\"somebody\");\nstopWords.add(\"someday\");\nstopWords.add(\"somehow\");\nstopWords.add(\"someone\");\nstopWords.add(\"something\");\nstopWords.add(\"sometime\");\nstopWords.add(\"sometimes\");\nstopWords.add(\"somewhat\");\nstopWords.add(\"somewhere\");\nstopWords.add(\"soon\");\nstopWords.add(\"sorry\");\nstopWords.add(\"specified\");\nstopWords.add(\"specify\");\nstopWords.add(\"specifying\");\nstopWords.add(\"still\");\nstopWords.add(\"sub\");\nstopWords.add(\"such\");\nstopWords.add(\"sup\");\nstopWords.add(\"sure\");\nstopWords.add(\"take\");\nstopWords.add(\"taken\");\nstopWords.add(\"taking\");\nstopWords.add(\"tell\");\nstopWords.add(\"tends\");\nstopWords.add(\"th\");\nstopWords.add(\"than\");\nstopWords.add(\"thank\");\nstopWords.add(\"thanks\");\nstopWords.add(\"thanx\");\nstopWords.add(\"that\");\nstopWords.add(\"that'll\");\nstopWords.add(\"thats\");\nstopWords.add(\"that've\");\nstopWords.add(\"the\");\nstopWords.add(\"their\");\nstopWords.add(\"theirs\");\nstopWords.add(\"them\");\nstopWords.add(\"themselves\");\nstopWords.add(\"then\");\nstopWords.add(\"thence\");\nstopWords.add(\"there\");\nstopWords.add(\"thereafter\");\nstopWords.add(\"thereby\");\nstopWords.add(\"there'd\");\nstopWords.add(\"therefore\");\nstopWords.add(\"therein\");\nstopWords.add(\"ther'll\");\nstopWords.add(\"there're\");\nstopWords.add(\"theres\");\nstopWords.add(\"there's\");\nstopWords.add(\"thereupon\");\nstopWords.add(\"there've\");\nstopWords.add(\"these\");\nstopWords.add(\"they\");\nstopWords.add(\"they'd\");\nstopWords.add(\"they'll\");\nstopWords.add(\"they're\");\nstopWords.add(\"they've\");\nstopWords.add(\"thing\");\nstopWords.add(\"things\");\nstopWords.add(\"think\");\nstopWords.add(\"third\");\nstopWords.add(\"thirty\");\nstopWords.add(\"this\");\nstopWords.add(\"thorough\");\nstopWords.add(\"thoroughly\");\nstopWords.add(\"those\");\nstopWords.add(\"though\");\nstopWords.add(\"throughout\");\nstopWords.add(\"thru\");\nstopWords.add(\"thus\");\nstopWords.add(\"till\");\nstopWords.add(\"to\");\nstopWords.add(\"together\");\nstopWords.add(\"too\");\nstopWords.add(\"took\");\nstopWords.add(\"toward\");\nstopWords.add(\"towards\");\nstopWords.add(\"tried\");\nstopWords.add(\"tries\");\nstopWords.add(\"truly\");\nstopWords.add(\"try\");\nstopWords.add(\"trying\");\nstopWords.add(\"t's\");\nstopWords.add(\"twice\");\nstopWords.add(\"two\");\nstopWords.add(\"un\");\nstopWords.add(\"under\");\nstopWords.add(\"underneath\");\nstopWords.add(\"undoing\");\nstopWords.add(\"unfortunately\");\nstopWords.add(\"unless\");\nstopWords.add(\"unlike\");\nstopWords.add(\"unlikely\");\nstopWords.add(\"untill\");\nstopWords.add(\"unto\");\nstopWords.add(\"up\");\nstopWords.add(\"upon\");\nstopWords.add(\"upwards\");\nstopWords.add(\"us\");\nstopWords.add(\"use\");\nstopWords.add(\"used\");\nstopWords.add(\"useful\");\nstopWords.add(\"uses\");\nstopWords.add(\"using\");\nstopWords.add(\"usually\");\nstopWords.add(\"v\");\nstopWords.add(\"value\");\nstopWords.add(\"various\");\nstopWords.add(\"versus\");\nstopWords.add(\"very\");\nstopWords.add(\"via\");\nstopWords.add(\"viz\");\nstopWords.add(\"vs\");\nstopWords.add(\"want\");\nstopWords.add(\"wants\");\nstopWords.add(\"was\");\nstopWords.add(\"wasn't\");\nstopWords.add(\"way\");\nstopWords.add(\"we\");\nstopWords.add(\"we'd\");\nstopWords.add(\"welcome\");\nstopWords.add(\"well\");\nstopWords.add(\"we'll\");\nstopWords.add(\"went\");\nstopWords.add(\"were\");\nstopWords.add(\"we're\");\nstopWords.add(\"weren't\");\nstopWords.add(\"we've\");\nstopWords.add(\"what\");\nstopWords.add(\"whatever\");\nstopWords.add(\"what'll\");\nstopWords.add(\"what's\");\nstopWords.add(\"what've\");\nstopWords.add(\"when\");\nstopWords.add(\"whence\");\nstopWords.add(\"whenever\");\nstopWords.add(\"where\");\nstopWords.add(\"whereafter\");\nstopWords.add(\"whereas\");\nstopWords.add(\"whereby\");\nstopWords.add(\"wherein\");\nstopWords.add(\"where's\");\nstopWords.add(\"whereupon\");\nstopWords.add(\"whereever\");\nstopWords.add(\"whether\");\nstopWords.add(\"which\");\nstopWords.add(\"whichever\");\nstopWords.add(\"while\");\nstopWords.add(\"whilst\");\nstopWords.add(\"whither\");\nstopWords.add(\"who\");\nstopWords.add(\"who'd\");\nstopWords.add(\"whoever\");\nstopWords.add(\"whole\");\nstopWords.add(\"who'll\");\nstopWords.add(\"whom\");\nstopWords.add(\"whomever\");\nstopWords.add(\"who's\");\nstopWords.add(\"whose\");\nstopWords.add(\"why\");\nstopWords.add(\"will\");\nstopWords.add(\"willing\");\nstopWords.add(\"wish\");\nstopWords.add(\"with\");\nstopWords.add(\"within\");\nstopWords.add(\"without\");\nstopWords.add(\"wonder\");\nstopWords.add(\"won't\");\nstopWords.add(\"would\");\nstopWords.add(\"wouldn't\");\nstopWords.add(\"yes\");\nstopWords.add(\"yet\");\nstopWords.add(\"you\");\nstopWords.add(\"you'd\");\nstopWords.add(\"you'll\");\nstopWords.add(\"your\");\nstopWords.add(\"you're\");\nstopWords.add(\"yours\");\nstopWords.add(\"yourself\");\nstopWords.add(\"you've\");\nstopWords.add(\"zero\");\n\n \n \n }",
"public static void main(String[] args) throws Exception {\n\t\tString[] stopwords=getstopwords(\"Stopwords.txt\");\n //CALLING METHOD TO REMOVE STOPWORDS\n\t\tremoveStopwords();\n\t\t \n}",
"public Set<String> getStopWords() throws Exception{\n\tFile file = new File(\"stopWords/stopwords.txt\");\n\tHashSet<String> stopwords = new HashSet<>();\n\tBufferedReader br = new BufferedReader(new FileReader(file));\n\tString line;\n\twhile((line=br.readLine())!=null){\n\t\tString[] tokens = line.split(\" \");\n\t\tfor(String token : tokens){\n\t\t\tif(!stopwords.contains(token)){\n\t\t\t\tstopwords.add(token);\n\t\t\t}\n\t\t}\n\t}\n\tbr.close();\n\treturn stopwords;\n\t}",
"public Set<String> getStopwords() {\n return stopwords;\n }",
"public static void removeStopwords() throws Exception\n {\n //converting sentence to lowercase \n String[] stopwords=getstopwords(\"Stopwords.txt\");\n //FileWriter f=new FileWriter(\"output.txt\");\n String line=\"\";\n String prcessedtxt=\"\";\n Scanner scanner = new Scanner(new File(\"Sentence.txt\"));\n Scanner newscanner = new Scanner(new File(\"Sentence.txt\"));\n\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"stopwordsremoved.txt\"));\n FileInputStream fstream = new FileInputStream(\"Sentence.txt\");\n BufferedReader br = new BufferedReader(new InputStreamReader(fstream));\n LineNumberReader lineNumberReader =\n new LineNumberReader(br);\n //BufferedReader br = new BufferedReader(new FileReader(\"Sentence.txt\"));\n\n int counter=0;\n int subc=0;\n ArrayList<String> wordList= new ArrayList();\n br.mark(3);\n \n\n HashMap<String, String> capitalCities = new HashMap<String, String>();\n \n\n while (scanner.hasNextLine()) {\n\n line = scanner.nextLine().trim();\n line=line.replaceAll(\"\\\\p{Punct}\", \"\");\n\n line=\"\"+line;\n\n\n \n wordList.addAll(Arrays.asList(line.split(\"[\\\\t, ]\")));\n String title=wordList.get(0);\n wordList.remove(0);\n wordList.add(0,\"\\t\");\n \n List<String> StopwordList= new ArrayList();\n //adding stop words in another array.\n StopwordList.addAll(Arrays.asList(stopwords));\n //removing stopwords from sentence.\n wordList.removeAll(StopwordList);\n \n for(String word:wordList){\n prcessedtxt=prcessedtxt+\" \"+ word;\n }\n writer.write(title+prcessedtxt+\"\\n\"); \n // System.out.print(wordList.toString());\n prcessedtxt=\"\";\n wordList.clear();\n\n\n counter++;\n \n \n\n} \n \n writer.close();\n \nStemmingmethod();\n}",
"@Test\n // Test that the preprocessor removes the relevant stop words\n void removeStopWords01() {\n List<String> stop_words = new ArrayList<>();\n List<String> words = new ArrayList<>(stop_words);\n words.add(\"vigtig\");\n assertEquals(\"vigtig\", preprocessor.removeStopWords(words).get(0));\n }",
"private StopWords() {\r\n\t\tPath source = Paths.get(\"./dat/zaustavne_rijeci.txt\");\r\n\t\ttry {\r\n\t\t\tbody = new String(Files.readAllBytes(source),\r\n\t\t\t\t\tStandardCharsets.UTF_8);\r\n\t\t} catch (IOException ignorable) {\r\n\t\t}\r\n\t\twords = new LinkedHashSet<>();\r\n\t\tfillSet();\r\n\t}",
"public int removings(String s)\n{\n if(stopWords.contains(s))\n {\n return 1;\n }\n else\n {\n return 0;\n }\n}",
"public static void loadStopWords(String file) { \n\t\t\n\t\ttry{\n\t\t\t FileInputStream fstream = new FileInputStream(file);\n\t\t\t DataInputStream in = new DataInputStream(fstream);\n\t\t\t BufferedReader br = new BufferedReader(new InputStreamReader(in));\n\t\t\t String strLine;\n\t\t\t \n\t\t\t while ((strLine = br.readLine()) != null) {\t\t\t\t \n\t\t\t\t stop_words.add(strLine.trim());\n\t\t\t }\n\t\t\t \n\t\t\t in.close();\n\t\t\t \n\t\t\t}\n\t\t\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\n\t\t\t}\n\t}",
"public List<String> getStopWords(String path)\n\t {\n\t\t try \n\t\t {\n\t\t\t\tFileReader inputFile = new FileReader(path);\n\t\t\t\t@SuppressWarnings(\"resource\")\n\t\t\t\tBufferedReader br = new BufferedReader(inputFile);\n\n\t\t\t\tString line;\n\n\t\t\t\twhile ((line = br.readLine()) != null)\n\t\t\t\t{\n\t\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(line, \",\");\n\t\t\t\t\twhile (tokenizer.hasMoreTokens())\n\t\t\t\t\t{\n\t\t\t\t\t\tstopWords.add(tokenizer.nextToken().trim());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t }\n\t\t catch (Exception e)\n\t\t {\n\t\t\t\tSystem.out.println(\"Error while reading file by line:\"\n\t\t\t\t\t\t+ e.getMessage());\n\t\t } \n\t\t \n\t\t return stopWords; \n }",
"public static String getStopWords() throws IOException{\n\t\tString filepath1 = \"C:/Naveen/CCS/IR/AP89_DATA/AP_DATA/stoplist.txt\";\n\t\tPath path1 = Paths.get(filepath1);\n\t\tScanner scanner1 = new Scanner(path1);\n\t\tStringBuffer stopWords = new StringBuffer();\n\t\t\n\t\twhile (scanner1.hasNextLine()){\n\t\t\tString line = scanner1.nextLine();\n\t\t\tstopWords.append(line);\n\t\t\tstopWords.append(\"|\");\n\t } \n\t\t\n\t\tstopWords.append(\"document|discuss|identify|report|describe|predict|cite\");\n\t\tString allStopwords = stopWords.toString();\n\t\t//System.out.println(\"\"+allStopwords);\n\t\treturn allStopwords;\n\t}",
"public synchronized Set<String> getStopWords() throws Exception {\r\n\t\t\r\n\t\tif(stopWords == null){\r\n\t\t\tMTDArquivoEnum enumerado = MTDArquivoEnum.STOP_WORDS;\r\n\t\t\tstopWords = new HashSet<String>();\r\n\t\t\tMTDIterator<String> it = enumerado.lineIterator();\r\n\t\t\twhile (it.hasNext()) {\r\n\t\t\t\tstopWords.add(it.next());\r\n\t\t\t}\r\n\t\t\tit.close();\r\n\t\t}\r\n \r\n return stopWords;\r\n }",
"@Override\r\n\t\t\tpublic Set<String> getStopWords() {\n\t\t\t\treturn null;\r\n\t\t\t}",
"public PorterStopWords()\r\n\t{\r\n\t\tstopWordsSet.addAll( porterStopWordsSet );\r\n\t}",
"public Term[] getStopWords() {\n List<Term> allStopWords = new ArrayList<Term>();\n for (String fieldName : stopWordsPerField.keySet()) {\n Set<String> stopWords = stopWordsPerField.get(fieldName);\n for (String text : stopWords) {\n allStopWords.add(new Term(fieldName, text));\n }\n }\n return allStopWords.toArray(new Term[allStopWords.size()]);\n\t}",
"public abstract boolean isStopWord(String term);",
"public void removeWord(int id);",
"private void loadStopWords() throws FileNotFoundException, IOException{\n\n BufferedReader reader = new BufferedReader(new FileReader(\"src/stopwords/English.txt\"));\n String sWord;\n while ((sWord = reader.readLine()) != null) \n {\n stopWordList.add(sWord);\n }\n reader.close();\n }",
"public void LoadStopwords(String filename) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tnew FileInputStream(filename), \"UTF-8\"));\n\t\t\tString line;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t// it is very important that you perform the same processing\n\t\t\t\t// operation to the loaded stopwords\n\t\t\t\t// otherwise it won't be matched in the text content\n\t\t\t\tline = SnowballStemmingDemo(NormalizationDemo(line));\n\t\t\t\tif (!line.isEmpty())\n\t\t\t\t\tm_stopwords.add(line);\n\t\t\t}\n\t\t\treader.close();\n\t\t\tSystem.out.format(\"Loading %d stopwords from %s\\n\",\n\t\t\t\t\tm_stopwords.size(), filename);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.format(\"[Error]Failed to open file %s!!\", filename);\n\t\t}\n\t}",
"public static void readStopList() throws FileNotFoundException {\n String tempBuffer = \"\";\n Scanner sc_obj = new Scanner(new File(\"./inputFiles/Stopword-List.txt\"));\n\n while(sc_obj.hasNext()) {\n tempBuffer = sc_obj.next();\n stopWords.add(tempBuffer);\n }\n sc_obj.close();\n }",
"public AnalizadorBusqueda(CharArraySet stopwords) {\n this(stopwords, CharArraySet.EMPTY_SET);\n }",
"@Override\r\n\t\t\tpublic boolean isStopWord(String term) {\n\t\t\t\treturn false;\r\n\t\t\t}",
"public boolean isStopWord(String word);",
"void remove (String dataFile) {\n\t\tint i;\t\t\n\t\t\n\n\t\ttry {\n//\t\t\tHash set to store strings\n\t\t\t\t\t\t\n//\t\t\tScanner reads objects from file\n\t\t\tScanner fileInput = new Scanner(new File(dataFile));\n\t\t\t\n//\t\t\treads line from file\n\t\t\twhile(fileInput.hasNextLine()) {\n\t\t\t\tString row = fileInput.nextLine();\n\t\t\t\t\n//\t\t\t\tsplits words by the space\n\t\t\t\tString[] word = row.split(\" \");\n\t\t\t\t\n\t\t\t\tfor(i = 0; i < word.length; i++) {\n\t\t\t\t\t\n//\t\t\t\t\tconvert words to lower case\n\t\t\t\t\tString wordSet = word[i].toLowerCase();\n//\t\t\t\t\tadds words to set\n\t\t\t\t\tuniqueWords.add(wordSet);\n\t\t\t\t}\t\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void loadExemptWords(String fname) {\n\t\ttry {\n\t\t\tBufferedReader wordsReader = new BufferedReader(new FileReader(fname));\n\t \n\t\t\tfor ( ; ; ) {\n\t\t\t\tString line = wordsReader.readLine();\n\t\n\t\t\t\tif (line == null) {\n\t\t\t\t\twordsReader.close();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\n\t\t\t\telse {\n\t\t\t\t\tString[] parts = line.split(\" \");\n\t\t\t\t\tstopWords.add(parts[0]);\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t} catch (Exception e) {\n\t \t LOGGER.warning(e.getMessage());\n\t\t}\n\t}",
"private static void splitWord() {\n\t\tint i = 1;\r\n\t\tfor(String doc : DocsTest) {\r\n\t\t\tArrayList<String> wordAll = new ArrayList<String>();\r\n\t\t\tfor (String word : doc.split(\"[,.() ; % : / \\t -]\")) {\r\n\t\t\t\tword = word.toLowerCase();\r\n\t\t\t\tif(word.length()>1 && !mathMethod.isNumeric(word)) {\r\n\t\t\t\t\twordAll.add(word);\r\n\t\t\t\t\tif(!wordList.contains(word)) {\r\n\t\t\t\t\t\twordList.add(word);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twordAll.removeAll(stopword);\r\n\t\t\tDoclist.put(i, wordAll);\r\n\t\t\ti++;\r\n\t\t}\r\n\t\twordList.removeAll(stopword);\r\n\t}",
"public void LoadStopwords(String filename) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(\n\t\t\t\t\tnew FileInputStream(filename), \"UTF-8\"));\n\t\t\tString line;\n\n\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t// Stemming and Normalization\n\t\t\t\tline = SnowballStemmingDemo(NormalizationDemo(line));\n\t\t\t\tif (!line.isEmpty())\n\t\t\t\t\tm_stopwords.add(line);\n\t\t\t}\n\t\t\treader.close();\n\t\t\tSystem.out.format(\"Loading %d stopwords from %s\\n\",\n\t\t\t\t\tm_stopwords.size(), filename);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.format(\"[Error]Failed to open file %s!!\", filename);\n\t\t}\n\t}",
"public void removeWord(String word) throws WordException;",
"public List<String> stem(List<String> terms) {\r\n\t\tPaiceHuskStemmer stemmer = null;\r\n\t\ttry {\r\n\t\t\tstemmer = PaiceHuskStemmer.getInstance(SVMClassifier.class.getClassLoader().getResource(\"stemrules.txt\").openStream());\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstemmer.setPreStrip(false);\r\n\t\tfor (int i = 0; i < terms.size(); i++) {\r\n\t\t\tString w = terms.get(i);\r\n\t\t\tterms.set(i, stemmer.stripAffixes(w));\r\n\t\t}\r\n\t\treturn terms;\r\n\t}",
"public static void checkStopList(Token stopWord)\r\n\t{\r\n\t\tIterator<String> sl = WordLists.stoplist().iterator();\r\n\r\n\t\twhile(sl.hasNext()) {\r\n\t\t\tString stop = sl.next();\r\n\r\n\t\t\tif (stopWord.getName().equalsIgnoreCase(stop)) {\r\n\t\t\t\tstopWord.getFeatures().setHasStopList(true);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void remove(String dataFile) throws IOException\r\n {\r\n //eliminate duplicate words\r\n BufferedReader bufferedReader = new BufferedReader(new FileReader(dataFile));\r\n String line1 = bufferedReader.readLine();\r\n\r\n //loop that eliminates duplicate words using a set of strings\r\n while(line1 != null)\r\n {\r\n String tempWords[] = line1.split(\" \");\r\n for(String words : tempWords)\r\n {\r\n if(!uniqueWords.contains(words)) uniqueWords.add(words);\r\n }\r\n line1 = bufferedReader.readLine();\r\n }\r\n bufferedReader.close();\r\n }",
"@Override\n public void removeWord(String wordToBeRemoved) {\n int index = 0;\n String[] result = new String[wordsArray.length];\n for (int i = 0; i < wordsArray.length; i++) {\n if (!wordsArray[i].equals( wordToBeRemoved)){\n result[index]= wordsArray[i];\n index++;\n }\n }\n }",
"private void setWordsOnly() throws IOException {\n this.wordsOnly = new HashSet<>();\n new InputAnalyzer().removePunctuation(inputText, wordsOnly::add);\n }",
"public String[] getStopWords(String fieldName) {\n Set<String> stopWords = stopWordsPerField.get(fieldName);\n return stopWords != null ? stopWords.toArray(new String[stopWords.size()]) : new String[0];\n }",
"public PDFAnalyzer(String stopwordFile) {\n List<String> stop_list =\n Lists.newArrayList(StopwordsProvider.getProvider(stopwordFile).getStopwords());\n stop_set = StopFilter.makeStopSet(stop_list);\n }",
"public void removeCueWords(ArrayList<Long> ids){\n\t\tfor(int i = 0; i < ids.size(); i++){\r\n\t\t\tfor(int a = 0; a < cueWords.size(); a++){\r\n\t\t\t\tif(ids.get(i) == cueWords.get(a)){\r\n\t\t\t\t\tcueWords.remove(a);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n//\t\tLog.i(\"TAG\", \"After: \" + cueWords.size());\r\n\t}",
"@Override\n\tprotected boolean isStopword(String word) {\n\t\treturn this.stopwords.contains(word);\n\t}",
"public static void filterNonWords(final List<String> tokens) {\n\tfor (int i = 0; i < tokens.size(); i++) {\n\t if (StringUtils.isComposedOf(tokens.get(i), ALL_DELIMS)) {\n\t\ttokens.remove(i);\n\t }\n\t}\n }",
"public void removeWordsOfLength(int len){\n for(int i=0;i<size();i++)\n if(get(i).length()==len){\n \tremove(i--);\n }\n }",
"public void removeTerm(String name) {\n ArrayList<String> temp = new ArrayList<>();\n\n for (Term t: listOfTerms) {\n String termName = t.getTermName();\n temp.add(termName);\n }\n\n int index = temp.indexOf(name);\n listOfTerms.remove(index);\n }",
"public static String preprocessStemAndTokenize(String data) {\n\n\t\tSet<String> transformedSet = new HashSet<String>(); //Set will make sure only unique terms are kept\n\t\tStringBuilder strBuilder = new StringBuilder();\n\t\tTokenizer analyzer = new Tokenizer(Version.LUCENE_30);\n\t\tTokenStream tokenStream = analyzer.tokenStream(\"\", new StringReader(data));\n\t\tTermAttribute termAttribute;\n\t\tString term;\n\t\t//System.out.println(\"The value of data in tokenizeAndStem: \"+ data);\n\t\ttry {\n\t\t\twhile (tokenStream.incrementToken()) {\n\t\t\t\ttermAttribute = tokenStream.getAttribute(TermAttribute.class);\n\t\t\t\tterm = termAttribute.term(); \n\t\t\t\tif (stopwords.contains(term)){ //ignore stopwords\n\t\t\t\t\t//System.out.println(\"Contains stopword: \"+ term);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (digitPattern.matcher(term).find()) //ignore digits\n\t\t\t\t\tcontinue;\n\t\t\t\tif(term.length() <= 1) //ignore 1 letter words\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\tif (!digitPattern.matcher(term).find()){ //ignore digits\n\t\t\t\t\tstemmer.setCurrent(term);\n\t\t\t\t\tstemmer.stem();\n\t\t\t\t\ttransformedSet.add(stemmer.getCurrent());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t//System.out.println(\"transormed set size in tokenizeAndStem: \"+ transformedSet.size());\n\t\tfor(Object token: transformedSet.toArray()){\n\t\t\tstrBuilder.append(token).append(\" \");\n\t\t}\n\t\t//System.out.println(\"String returned in tokenizeAndStem:\"+ strBuilder.toString());\n\t\treturn strBuilder.toString();\n\t}",
"public void unsetSearchTerms()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_attribute(SEARCHTERMS$6);\n }\n }",
"public void modifyWordsList(Item item, List<List<String>> tokenizedCollect, List<String> bagOfWords) {\n\n // handling user item description\n String desc = item.getDescription();\n List<String> tokenizedText = tokenizeText(desc);\n List<String> cleanText = removeStopWords2(tokenizedText);\n\n // add to collection of tokenized words (a list of list of tokenized words)\n tokenizedCollect.add(cleanText);\n\n // add userA's clean text to bag of words\n for (String word : cleanText) {\n if (!bagOfWords.contains(word)) {\n bagOfWords.add(word);\n }\n }\n }",
"public void removeWord () {\r\n int index = Components.wordList.getSelectedIndex ();\r\n if (index >= 0) {\r\n String word = (String) Components.wordList.getSelectedValue ();\r\n words.remove (word);\r\n Components.wordList.getContents ().remove (index);\r\n Components.wordList.setSelectedIndex ((index > 0) ? index - 1 : index);\r\n }\r\n }",
"private String[] readStopwords(String filepath) {\n // Get filepath\n Path path = Paths.get(filepath);\n\n // Array to hold each stopword\n ArrayList<String> words = new ArrayList<>();\n\n // Read file at that path\n try {\n Files.readAllLines(path).forEach(word -> {\n // Add each stopword\n words.add(word);\n });\n } catch (IOException e) {\n System.out.println(\"No stopwords list found.\");\n System.exit(1);\n }\n\n // Cast to String array and return\n String[] wordsArray = new String[words.size()];\n wordsArray = words.toArray(wordsArray);\n return wordsArray;\n }",
"default boolean isStopWord() {\n return meta(\"nlpcraft:nlp:stopword\");\n }",
"public static Set<String> preprocessStemAndTokenizeAddBigramsInSet(String data) {\n\t\t//System.out.println(\"Preprocess data, remove stop words, stem, tokenize and get bi-grams ..\");\n\n\t\tSet<String> transformedSet = new LinkedHashSet<String>();\n\t\tList<String> stemmedList = new ArrayList<String>();\n\n\t\t//System.out.println(\"Stop words length:\" + stopwords.size());\n\t\tTokenizer analyzer = new Tokenizer(Version.LUCENE_30);\n\t\tTokenStream tokenStream = analyzer.tokenStream(\"\", new StringReader(data));\n\t\tTermAttribute termAttribute;\n\t\tString term;\n\t\ttry {\n\t\t\twhile (tokenStream.incrementToken()) {\n\t\t\t\ttermAttribute = tokenStream.getAttribute(TermAttribute.class);\n\t\t\t\tterm = termAttribute.term();\n\t\t\t\tif (digitPattern.matcher(term).find()) //ignore digits\n\t\t\t\t\tcontinue;\n\t\t\t\tif (stopwords.contains(term)) //ignore stopwords\n\t\t\t\t\tcontinue;\n\t\t\t\tif (term.length() <= 1) //ignore single letter words\n\t\t\t\t\tcontinue;\n\t\t\t\tstemmer.setCurrent(term);\n\t\t\t\tstemmer.stem();\n\t\t\t\tstemmedList.add(stemmer.getCurrent());\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString[] ds = stemmedList.toArray(new String[0]);\n\n\t\t/*for(int i=0; i<stemmedList.size(); i++)\n\t\t\tSystem.out.print(ds[i]+\"\\t\");*/\n\n\t\t//add bi-grams\n\t\tfinal int size = 2;\n\t\tfor (int i = 0; i < ds.length; i++) {\n\t\t\ttransformedSet.add(ds[i]); //add single words\n\t\t\tif (i + size <= ds.length) {\n\t\t\t\tString t = \"\";\n\t\t\t\tfor (int j = i; j < i + size; j++) {\n\t\t\t\t\tt += \" \" + ds[j];\n\t\t\t\t}\n\t\t\t\tt = t.trim().replaceAll(\"\\\\s+\", \"_\");\n\t\t\t\ttransformedSet.add(t); //add bi-gram combined with \"_\"\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\" \")\n\t\tstemmedList.clear();\n\t\tstemmedList = null;\n\t\tds = null;\n\t\treturn transformedSet;\n\t}",
"@Override\n public void removeWord(String wordToBeRemoved) {\n wordsLinkedList.removeIf(wordToBeRemoved::equals);\n }",
"public boolean isStopword(String str) {\n\n return m_Stopwords.containsKey(str.toLowerCase());\n }",
"public static String getWords(String fileName){\n\t\tString result = null;\n\t\ttry {\n\t\t\tFileInputStream fin = new FileInputStream(fileName);\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(fin));\n\t\t\t\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tString line = br.readLine();\n\t\t\t\n\t\t\twhile(line != null){\n\t\t\t\tsb.append(line);\n\t\t\t\tline = br.readLine();\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tresult = Utils.removeStopWords(sb.toString());\n\t\t\treturn result;\n\t\t} \n\t\tcatch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn result;\n\t\t}\n\t}",
"public void unorderList() {\n\t\t\tIoFile io = new IoFile(); //created object of IoFile\n\t\t\tString str[]=io.readFromFile(\"/home/admin1/Documents/Data.txt\").split(\" \"); //read the file using readfromfile method\n\t\t\tUtility u = new Utility(); \n\t\t\tLinkedList list = new LinkedList(); //created object of linklist\n\t\t\tfor(int i=0; i<str.length; i++) { //check the length of string\n\t\t\t\tlist.sort(str[i]); //sorting the string\n\t\t\t}\n\t\t\tlist.display(); //display the list \n\t\t\tString st = u.getNext(\"\\nEnter word\"); //for user input\n\t\t\tif(list.search(st)) { //searched the word from the file\n\t\t\t\tlist.remove(st); //remove the word from the file\n\t\t\t}else list.sort(st); //otherwise again sort the word\n\t\t\tlist.display(); //again display\n\t\t\tio.writeToFile(list,\"/home/admin1/Documents/Data.txt\"); //write into the file\n\t\t}",
"private List<String> readStopFile(File stopFile) throws FileNotFoundException {\n\n Scanner scanner = new Scanner(stopFile);\n List<String> words;\n words = new ArrayList<>();\n String temp;\n\n while (scanner.hasNextLine()) {\n temp = scanner.nextLine();\n words.add(temp.toLowerCase());\n }\n\n return words;\n }",
"public void setStopTerms(String[] newTerms) {\r\n\t\t// TODO\r\n\t\tif (newTerms == null) {\r\n\t\t\tthrow new NullPointerException();\r\n\t\t}\r\n\t\tstop = Arrays.copyOf(newTerms, newTerms.length);\r\n\t}",
"public void remove(T word);",
"public static void removePlurals(ArrayList<String> list){\r\n //Loop through the list\r\n for(i = 0; i < list.size(); i++){\r\n if(list.get(i).endsWith(\"s\") || list.get(i).endsWith(\"S\")){\r\n list.remove(i);\r\n i--;\r\n } \r\n }\r\n }",
"@SafeVarargs\n\tpublic Corpus(Normaliser normaliser, Tokeniser tokeniser, List<String> stopwords, Filter... otherFilters) {\n\t\tthis.normaliser = normaliser;\n\t\tthis.tokeniser = tokeniser;\n\t\tthis.filters.add(Filter.stopwords(stopwords, normaliser, tokeniser));\n\t\tthis.filters.addAll(Arrays.asList(otherFilters));\n\t}",
"public static StopWords getInstance() {\r\n\t\tif (instance == null) {\r\n\t\t\tinstance = new StopWords();\r\n\t\t}\r\n\r\n\t\treturn instance;\r\n\t}",
"private static List<String> computeTwoGramFrequencies(List<String> words, int top_no, List<String> stopwordslist) {\n\t\t\t\n\t\tMap<String, Integer> tempstopmap= new HashMap<String, Integer>();\n\t\tfor (int i=0; i<stopwordslist.size(); i++){\n\t\t\tString tempword = stopwordslist.get(i);\n\t\t\ttempstopmap.put(tempword, 1);\n\t\t}//construct temp stopwordmap\n\t\t\n\t\tint i=0;\n\t\tMap<String, Integer> tempmap= new HashMap<String, Integer>();\n\t\twhile(i<words.size()){\n\t\t\tString temptwogram=\"\";\n\t\t\tString tempword1=\" \";\n\t\t\tString tempword2=\" \";\n\t\t\twhile(true){\n\t\t\t\tif(i>=words.size()-1)\n\t\t\t\t\tbreak;\n\t\t\t\ttempword1=words.get(i);\n\t\t\t\tif(!tempstopmap.containsKey(tempword1))\n\t\t\t\t\tbreak;\n\t\t\t\ti++;\n\t\t\t\ttempword1=\" \";\n\t\t\t}\n\t\t\ti++;\n\t\t\tSystem.out.println(\"b\"+i);\n\t\t\twhile(true){\n\t\t\t\tif(i>=words.size())\n\t\t\t\t\tbreak;\n\t\t\t\ttempword2=words.get(i);\n\t\t\t\tif(!tempstopmap.containsKey(tempword2))\n\t\t\t\t\tbreak;\n\t\t\t\ti++;\n\t\t\t\ttempword2=\" \";\n\t\t\t}//jump for the case that word + stopword +word\n\t\t\t\n\t\t\ttemptwogram = tempword1+\" \"+tempword2; //2-gram\n\t\t\tif (tempmap.containsKey(temptwogram))\n\t\t\t\ttempmap.put(temptwogram, tempmap.get(temptwogram)+1);\n\t\t\telse\n\t\t\t\ttempmap.put(temptwogram, 1);\n\t\t}//construct hashmap to count 2-gram words (key(word), value(frequency))\n\t\tList<Map.Entry<String, Integer>> templist = new ArrayList<Map.Entry<String, Integer>>();\n\t\tfor(Map.Entry<String, Integer> entry: tempmap.entrySet()){\n\t\t\t\n\t\t\t\n\t\t\ttemplist.add(entry);\n\t\t}//construct templist with entry containing word/frequency in map\n\t\t\n\t\tCollections.sort(templist, Collections.reverseOrder(new comparatorByFrequencyReverse()));//sort templist in decresing order\n\n\t\t /*change the templist into sortedlist*/\n\t\tList<String> sortedlist = new ArrayList<String> ();\n\t\tif(templist.size()>=top_no){\n\t\t\tfor (int j=0; j<top_no;j++){\n\t\t\t\tString word = templist.get(j).getKey();\n\t\t\t\tsortedlist.add(word);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor (int j=0; j<templist.size();j++){\n\t\t\t\tString word = templist.get(j).getKey();\n\t\t\t\tsortedlist.add(word);\n\t\t\t}\n\t\t}\n\t\treturn sortedlist;\n\t}",
"public static List<Term> getAllTermsInSentence(String sentence, int maxNoOfWordsInTerms, List<StopWordList> stopWordListCollection, ParseType parseType) {\n\n List<String> wordList = devideSentenceIntoWords(sentence);\n int size = wordList.size();\n List<Term> termList = new ArrayList<>();\n\n for (int noOfWords = 1; noOfWords <= maxNoOfWordsInTerms; noOfWords++) {\n for (int termNo = 0; termNo + noOfWords <= size; termNo++) {\n\n List<String> termWordList = new ArrayList<>();\n\n for (int wordNo = termNo; wordNo < termNo + noOfWords; wordNo++) {\n String word = wordList.get(wordNo);\n termWordList.add(word);\n }\n\n stripStopWordsFromTerm(termWordList, stopWordListCollection, parseType);\n\n if (!termWordList.isEmpty()) {\n termList.add(new Term(termWordList));\n }\n }\n }\n\n return termList;\n }",
"public String stemming(String stopWordRemovalFile, String stemmingFilePath) throws IOException{\n\t\t\n\t\t//Use a for loop to go through each data file\n\t\tfor (int i = 1; i <= numOfFiles; i++) {\n\t\t\t//Use FileInputStream to get the file path and use BufferedReader and InputStreamReader to read the files\n\t\t\tFileInputStream files = new FileInputStream(stopWordRemovalFile + \"/a\" + i + \".txt\");\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(files));\n\t\t\t\n\t\t\t//Use FileWriter to indicate the path to where the data will be outputed and BufferedWriter to write to the indicated files\n\t\t\tFileWriter fileStream = new FileWriter(stemmingFilePath + \"/a\" + i + \".txt\"); \n\t BufferedWriter outputStream = new BufferedWriter(fileStream);\n\t\t\t\n\t //Add each line of the files into an temporary stemmer arraylist to output the words into their root form\n\t\t\tString readStopwordDoc;\n\t\t\twhile((readStopwordDoc = reader.readLine()) != null) {\n\t\t\t\ttempStemmer.add(readStopwordDoc);\n\t\t\t}\n\t\t\t//Use the for loop to get the size of the temporary stemmer arraylist and stem the words\n\t\t\tfor(int j = 0; j < tempStemmer.size(); j++) {\n\t\t\t\tstemming.setCurrent(tempStemmer.get(j).toString());\n\t\t\t\tstemming.stem();\n\t\t\t\toutputStream.write(stemming.getCurrent() + \"\\n\");\n\t\t\t}\n\t\t\ttempStemmer.clear();\n\t\t\t\n\t\t\toutputStream.close();\n\t\t}\n\t\tSystem.out.println(\"See Stemming Folder for to view the results\");\n\t\treturn stemmingFilePath;\n\t}",
"void updateFilteredUndoneTaskListNamePred(Set<String> keywords);",
"public static List<TokenCanonic> stemWords(String wordList) {\n List<TokenCanonic> result = new ArrayList<TokenCanonic>(); \n String [] tokens = wordList.split(\"\\\\s+\");\n for (String t : tokens) {\n if (t.trim().equals(\"\")) continue;\n TokenCanonic tc = new TokenCanonic(); \n tc.token = t; tc.canonic = stemWord(t);\n result.add(tc);\n }\n return result;\n }",
"public static ArrayList<String> getTerms(String comment){\n\n\t\tString[] terms = comment.split(\"[^a-zA-Z]+\");\n\t\t//if(terms.length == 0) System.out.println(\"error: \" + comment);\n\t\tArrayList<String> termsarray = new ArrayList<String>();\n\t\tfor(int i=0;i<terms.length;i++){\n\t\t\t\n\t\t\tString iterm = terms[i].toLowerCase();\n\t\t\tboolean isStopWord = false;\n\t\t\tfor(String s : stopWord){\n\t\t\t\tif(iterm.equals(s)){\n\t\t\t\t\tisStopWord = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isStopWord == true)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tStemmer stemmer = new Stemmer();\n\t\t\tstemmer.add(iterm.toCharArray(), iterm.length());\n\t\t\tstemmer.stem();\n\t\t\titerm = stemmer.toString();\n\t\t\t\n\t\t\t//System.out.println(iterm);\n\t\t\tif(iterm.length() >=2 && !termsarray.contains(iterm))termsarray.add(iterm);\n\t\t}\n\t\n\t\treturn termsarray;\n\t}",
"public static void main(String[] args) throws FileNotFoundException{\n Scanner scnr = new Scanner(new File(\"words.txt\"));\r\n //Declare the ArrayList to store words\r\n ArrayList<String> words = new ArrayList<String>();\r\n \r\n //Read from file and store elements in the ArrayList\r\n //while(scnr.hasNext()) File is too large and will take time\r\n for(int i = 0; i < 2000; i++){\r\n words.add(scnr.next());\r\n }\r\n // Task1: Display the ArrayList\r\n System.out.println(words); //toString() of the ArrayList\r\n \r\n // Task 2: Display words in reverse order\r\n displayReverse(words);\r\n \r\n // Task 3: Display words ending with \"s\" capitalized\r\n displayPlurals(words);\r\n \r\n // Task 4: Remove words ending with \"s\"\r\n removePlurals(words);\r\n System.out.println(words);\r\n \r\n }",
"public void removePos(String word, IPosition pos) throws WordException;",
"public static String preprocessStemAndTokenizeAddBigramsInString(String data) {\n\t\t//System.out.println(\"Preprocess data, remove stop words, stem, tokenize and get bi-grams ..\");\n\n\t\tSet<String> transformedSet = new LinkedHashSet<String>();\n\t\tList<String> stemmedList = new ArrayList<String>();\n\n\t\tTokenizer analyzer = new Tokenizer(Version.LUCENE_30);\n\t\tTokenStream tokenStream = analyzer.tokenStream(\"\", new StringReader(data));\n\t\tTermAttribute termAttribute;\n\t\tString term;\n\t\ttry {\n\t\t\twhile (tokenStream.incrementToken()) {\n\t\t\t\ttermAttribute = tokenStream.getAttribute(TermAttribute.class);\n\t\t\t\tterm = termAttribute.term();\n\t\t\t\tif (digitPattern.matcher(term).find()) //ignore digits\n\t\t\t\t\tcontinue;\n\t\t\t\tif (stopwords.contains(term)) //ignore stopwords\n\t\t\t\t\tcontinue;\n\t\t\t\tif (term.length() <= 1) //ignore stopwords\n\t\t\t\t\tcontinue;\n\t\t\t\tstemmer.setCurrent(term);\n\t\t\t\tstemmer.stem();\n\t\t\t\tstemmedList.add(stemmer.getCurrent());\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString[] ds = stemmedList.toArray(new String[0]);\n\n\t\t/*for(int i=0; i<stemmedList.size(); i++)\n\t\t\tSystem.out.print(ds[i]+\"\\t\");*/\n\n\t\t//add bi-grams\n\t\tfinal int size = 2;\n\t\tfor (int i = 0; i < ds.length; i++) {\n\t\t\ttransformedSet.add(ds[i]); //add single words\n\t\t\tif (i + size <= ds.length) {\n\t\t\t\tString t = \"\";\n\t\t\t\tfor (int j = i; j < i + size; j++) {\n\t\t\t\t\tt += \" \" + ds[j];\n\t\t\t\t}\n\t\t\t\tt = t.trim().replaceAll(\"\\\\s+\", \"_\");\n\t\t\t\ttransformedSet.add(t); //add bi-gram combined with \"_\"\n\t\t\t}\n\t\t}\n\t\t//System.out.println(transformedSet.toArray(new String[transformedSet.size()]).toString());\n\t\treturn StringUtils.join( transformedSet.toArray(new String[transformedSet.size()]), \" \");\n\t\t\n\t}",
"public static ArrayList<String> randomWords(ArrayList<String> words, int nbWords,\n\t\t\tint limit){\n\t\tint index;\n\t\tArrayList<String> toDeleteWords = new ArrayList<String>();\n\t\tRandom random = new Random();\n\t\tfor(int i = 0; i < nbWords; i ++){\n\t\t\tindex = random.nextInt(limit);\n\t\t\ttoDeleteWords.add(words.get(index));\n\t\t}\n\t\treturn toDeleteWords;\n\t}",
"public static final String[] removeCommonWords(String[] words) {\r\n if (commonWordsMap == null) {\r\n synchronized (initLock) {\r\n if (commonWordsMap == null) {\r\n commonWordsMap = new HashMap();\r\n for (int i = 0; i < commonWords.length; i++) {\r\n commonWordsMap.put(commonWords[i], commonWords[i]);\r\n }\r\n }\r\n }\r\n } \r\n ArrayList results = new ArrayList(words.length);\r\n for (int i = 0; i < words.length; i++) {\r\n if (!commonWordsMap.containsKey(words[i])) {\r\n results.add(words[i]);\r\n }\r\n }\r\n return (String[]) results.toArray(new String[results.size()]);\r\n }",
"public static void cleanLine(String[] wordsInLine){\n int i = 0;\n for(String word : wordsInLine){\n wordsInLine[i] = word.toLowerCase().replaceAll(\"[^a-zA-Z0-9\\\\s]\",\"\");\n i++;\n }\n }",
"private static List<Pair<String, Integer>> splitWords(String line) {\n // This is kinda silly: we read and parse the stop words file once for each chunk, but this is the way the book\n // does it, so better stay in line with that.\n Set<String> stopWords = Arrays.stream(readFile(\"../stop_words.txt\").split(\",\")).\n collect(Collectors.toCollection(HashSet::new));\n return Arrays.stream(line.replaceAll(\"[^a-zA-Z\\\\d\\\\s]\", \" \").toLowerCase().split(\" \")).\n filter(w -> w.length() >= 2 && !stopWords.contains(w)).\n map(w -> new Pair<>(w, 1)).\n collect(Collectors.toList());\n }",
"HashSet<String> removeDuplicates(ArrayList<String> words) {\n\t\tHashSet<String> keywords = new HashSet<String>();\n\t\tkeywords.addAll(words);\n\t\treturn keywords;\n\t}",
"public static void generateWordVectorsAndWordList(Set<String> filenames, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString contentDirectory, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString wordListFileName, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString tfidfFileName, \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString outputDirectory,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tint minFrequency,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tint maxFrequency,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tboolean useStemming,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tString language\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) throws Exception {\r\n\r\n\t\t\t// Create the word vector tool\r\n\t\t\tWVTool wvt = new WVTool(true);\r\n\t\t\tWVTFileInputList list = new WVTFileInputList(filenames.size());\r\n\t\t\t\r\n\t\t\t// Add all the files\r\n\t\t\tint cnt = 0;\r\n\t\t\tfor (String filename : filenames) {\r\n\t\t\t\tlist.addEntry(new WVTDocumentInfo(contentDirectory + \"/\" + filename, \"txt\",\"\",\"language\"));\r\n\t\t\t\tcnt++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Processed \" + cnt + \" files\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// Stemming\r\n\t\t\tWVTConfiguration config = new WVTConfiguration();\r\n\t\t\t\r\n\t\t\tif (useStemming) {\r\n\t\t\t\tif (\"german\".equals(language)) {\r\n\t\t\t\t\tconfig.setConfigurationRule(WVTConfiguration.STEP_STEMMER, new WVTConfigurationFact(new FastGermanStemmer()));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tconfig.setConfigurationRule(WVTConfiguration.STEP_STEMMER, new WVTConfigurationFact(new PorterStemmerWrapper()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// create the word list\r\n\t\t\tWVTWordList wordList = wvt.createWordList(list, config);\r\n\r\n\t\t\t// pruning seems to be necessary? \r\n\t\t\twordList.pruneByFrequency(minFrequency, maxFrequency);\r\n\t\t\t\r\n\t\t\t// Store the results somewhere\r\n\t\t\twordList.storePlain(new FileWriter(outputDirectory + \"/\" + wordListFileName));\r\n\t\t\t\r\n\t\t\t// Also the outputs\r\n\t\t\tString tempFile = contentDirectory + tfidfFileName + \".temp\";\r\n\t\t\tSystem.out.println(\"Trying to write to \" + tempFile);\r\n\t\t\t\r\n\t\t\tFileWriter fileWriter = new FileWriter(tempFile);\r\n\t\t\tWordVectorWriter wvw = new WordVectorWriter(fileWriter, true);\r\n\t\t\tconfig.setConfigurationRule( WVTConfiguration.STEP_OUTPUT, new WVTConfigurationFact(wvw));\r\n\t\t\tconfig.setConfigurationRule(WVTConfiguration.STEP_VECTOR_CREATION, new WVTConfigurationFact(new TFIDF()));\r\n\r\n\t\t\t// Create everything and go\r\n\t\t\twvt.createVectors(list, config, wordList);\r\n\t\t\t\r\n\t\t\twvw.close();\r\n\t\t\tfileWriter.close();\r\n\r\n\t\t\t// Now delete all the files we have created\r\n\t\t\tFile fileToDelete;\r\n\t\t\tfor (String filename : filenames) {\r\n\t\t\t\tfileToDelete = new File(filename);\r\n\t\t\t\tfileToDelete.delete();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// transform the outputfile and only keep the id instead of the filename\r\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(tempFile));\r\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(outputDirectory + tfidfFileName));\r\n\t\t\tString line = reader.readLine();\r\n\t\t\tint idx1 = -1;\r\n\t\t\tint idx2 = -1;\r\n\t\t\tString fname;\r\n\t\t\tString id;\r\n\t\t\twhile (line != null) {\r\n\t\t\t\tidx1 = line.indexOf(\";\");\r\n\t\t\t\tfname = line.substring(0,idx1);\r\n\t\t\t\t// find the \r\n\t\t\t\tidx2 = line.lastIndexOf(\"/\");\r\n\t\t\t\tid = fname.substring(idx2+1);\r\n\t\t\t\twriter.write(id + \";\" + line.substring(idx1+1) + \"\\n\");\r\n\t\t\t\tline = reader.readLine();\r\n\t\t\t}\r\n\t\t\treader.close();\r\n\t\t\twriter.close();\r\n\t\t\tfileToDelete = new File(tempFile);\r\n\t\t\tfileToDelete.delete();\r\n\r\n\t}",
"public String[] tokenize(String string) {\n String[] result = null;\n\n if (string != null && !\"\".equals(string)) {\n if (normalizer != null) {\n final NormalizedString nString = normalize(string);\n if (nString != null) {\n result = nString.split(stopwords);\n }\n }\n else if (analyzer != null) {\n final List<String> tokens = LuceneUtils.getTokenTexts(analyzer, label, string);\n if (tokens != null && tokens.size() > 0) {\n result = tokens.toArray(new String[tokens.size()]);\n }\n }\n\n if (result == null) {\n final String norm = string.toLowerCase();\n if (stopwords == null || !stopwords.contains(norm)) {\n result = new String[]{norm};\n }\n }\n }\n\n return result;\n }",
"public static void Stemmingmethod()throws Exception\n{\n char[] w = new char[501];\n Stemmer s = new Stemmer();\n String prcessedtxt=\"\";\n ArrayList<String> finalsen= new ArrayList();\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"fullyprocessed.txt\"));\n\n String u=null;\n \n {\n FileInputStream in = new FileInputStream(\"stopwordsremoved.txt\");\n\n while(true)\n\n { int ch = in.read();\n if (Character.isLetter((char) ch))\n {\n int j = 0;\n while(true)\n { ch = Character.toLowerCase((char) ch);\n w[j] = (char) ch;\n if (j < 500) j++;\n ch = in.read();\n if (!Character.isLetter((char) ch))\n {\n \n s.add(w, j); \n\n s.stem();\n { \n\n u = s.toString();\n finalsen.add(u);\n /* to test getResultBuffer(), getResultLength() : */\n /* u = new String(s.getResultBuffer(), 0, s.getResultLength()); */\n\n System.out.print(u);\n }\n break;\n }\n }\n }\n if (ch < 0) break;\n System.out.print((char)ch);\n finalsen.add(\"\"+(char)ch);\n\n\n }\n }\n \n \n \n for(String word:finalsen){\n prcessedtxt=prcessedtxt+\"\"+ word;\n }\n writer.write(prcessedtxt+\"\\n\"); \n prcessedtxt=\"\";\n finalsen.clear();\n writer.close();\n\n\n \n}",
"public void clearWordList () {\r\n words.clear ();\r\n Components.wordList.getContents ().removeAllElements ();\r\n }",
"public static void main(String[] args) throws Exception \n\t{\n\t\tList<String> stopWords = new ArrayList<String>();\n\t\tstopWords = stopWordsCreation();\n\n\n\t\t\n\t\tHashMap<Integer, String> hmap = new HashMap<Integer, String>();\t//Used in tittle, all terms are unique, and any dups become \" \"\n\t\n\t\t\n\t\tList<String> uniqueTerms = new ArrayList<String>();\n\t\tList<String> allTerms = new ArrayList<String>();\n\t\t\t\t\n\t\t\n\t\tHashMap<Integer, String> hmap2 = new HashMap<Integer, String>();\n\t\tHashMap<Integer, String> allValues = new HashMap<Integer, String>();\n\t\tHashMap<Integer, Double> docNorms = new HashMap<Integer, Double>();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tMap<Integer, List<String>> postingsFileListAllWords = new HashMap<>();\t\t\n\t\tMap<Integer, List<String>> postingsFileList = new HashMap<>();\n\t\t\n\t\tMap<Integer, List<StringBuilder>> docAndTitles = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAbstract = new HashMap<>();\n\t\tMap<Integer, List<StringBuilder>> docAndAuthors = new HashMap<>();\n\t\t\n\t\t\n\t\tMap<Integer, List<Double>> termWeights = new HashMap<>();\n\t\t\n\t\tList<Integer> docTermCountList = new ArrayList<Integer>();\n\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tString sCurrentLine;\n\n\t\tint documentCount = 0;\n\t\tint documentFound = 0;\n\t\tint articleNew = 0;\n\t\tint docTermCount = 0;\n\t\t\n\t\t\n\t\tboolean abstractReached = false;\n\n\t\ttry {\n\t\t\tfr = new FileReader(FILENAME);\n\t\t\tbr = new BufferedReader(fr);\n\n\t\t\t// Continues to get 1 line from document until it reaches the end of EVERY doc\n\t\t\twhile ((sCurrentLine = br.readLine()) != null) \n\t\t\t{\n\t\t\t\t// sCurrentLine now contains the 1 line from the document\n\n\t\t\t\t// Take line and split each word and place them into array\n\t\t\t\tString[] arr = sCurrentLine.split(\" \");\n\n\n\t\t\t\t//Go through the entire array\n\t\t\t\tfor (String ss : arr) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * This section takes the array and checks to see if it has reached a new\n\t\t\t\t\t * document or not. If the current line begins with an .I, then it knows that a\n\t\t\t\t\t * document has just started. If it incounters another .I, then it knows that a\n\t\t\t\t\t * new document has started.\n\t\t\t\t\t */\n\t\t\t\t\t//System.out.println(\"Before anything: \"+sCurrentLine);\n\t\t\t\t\tif (arr[0].equals(\".I\")) \n\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\tif (articleNew == 0) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 1;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t} \n\t\t\t\t\t\telse if (articleNew == 1) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tarticleNew = 0;\n\t\t\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t//System.out.println(documentFound);\n\t\t\t\t\t\t//count++;\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\n\t\t\t\t\t/* This section detects that after a document has entered,\n\t\t\t\t\t * it has to gather all the words contained in the title \n\t\t\t\t\t * section.\n\t\t\t\t\t */\n\t\t\t\t\tif (arr[0].equals(\".T\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndTitles.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder title = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".B|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\t\t\t\n\t\t\t\t\t\t\t/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \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\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\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\ttitle.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (String tittleWords : tittle)\n\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\ttittleWords = tittleWords.toLowerCase();\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'*{}|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\ttittleWords = tittleWords.replaceAll(\"[-&^%'{}*|$+\\\\/\\\\?!<>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\t//System.out.println(tittleWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(tittleWords)) \n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(tittleWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, tittleWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(tittleWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(tittleWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(tittleWords);\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\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\ttitle.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndTitles.get(documentFound).add(title);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (arr[0].equals(\".A\") ) \n\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Go to line UNDER .T since that is where tittle is located\n\t\t\t\t\t\t//sCurrentLine = br.readLine();\n\t\t\t\t\t\tdocAndAuthors.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\t\t\tStringBuilder author = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".N|.X|.K|.C\") )\n\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/* In this section, there are 2 lists being made. One list\n\t\t\t\t\t\t\t * is for all the unique words in every title in the document (hmap).\n\t\t\t\t\t\t\t * Hmap contains all unique words, and anytime a duplicate word is \n\t\t\t\t\t\t\t * found, it is replaced with an empty space in the map.\n\t\t\t\t\t\t\t * All Values \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\t//postingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\t\t\t//postingsFileList.get(documentFound - 1).add(term2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"current line: \"+sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] tittle = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (tittle[0].equals(\".W\") )\n\t\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\t\tabstractReached = true;\n\t\t\t\t\t\t\t\tbreak;\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\tauthor.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//docAndTitles.get(documentCount).add(\" \");\n\t\t\t\t\t\t\tauthor.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"Title: \"+title);\n\t\t\t\t\t\t//System.out.println(\"docAndTitles.get(documentCount+1): \" +docAndTitles.get(documentFound));\n\t\t\t\t\t\tdocAndAuthors.get(documentFound).add(author);\n\t\t\t\t\t\t//System.out.println(\"Done!: \"+ docAndTitles);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t/* Since there may or may not be an asbtract after\n\t\t\t\t\t * the title, we need to check what the next section\n\t\t\t\t\t * is. We know that every doc has a publication date,\n\t\t\t\t\t * so it can end there, but if there is no abstract,\n\t\t\t\t\t * then it will keep scanning until it reaches the publication\n\t\t\t\t\t * date. If abstract is empty (in tests), it will also finish instantly\n\t\t\t\t\t * since it's blank and goes straight to .B (the publishing date).\n\t\t\t\t\t * Works EXACTLY like Title \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\tif (abstractReached) \n\t\t\t\t\t{\t\n\t\t\t\t\t\t//System.out.println(\"\\n\");\n\t\t\t\t\t\t//System.out.println(\"REACHED ABSTRACT and current line is: \" +sCurrentLine);\n\t\t\t\t\t\tdocAndAbstract.put(documentFound, new ArrayList<StringBuilder>());\n\t\t\t\t\t\tStringBuilder totalAbstract = new StringBuilder();\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile ( !(sCurrentLine = br.readLine()).matches(\".T|.I|.A|.N|.X|.K|.C\") )\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tString[] abstaract = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tif (abstaract[0].equals(\".B\") )\n\t\t\t\t\t\t\t{\t\t\t\n\t\t\t\t\t\t\t\tabstractReached = false;\n\t\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalAbstract.append(sCurrentLine);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tString[] misc = sCurrentLine.split(\" \");\n\t\t\t\t\t\t\tfor (String miscWords : misc) \n\t\t\t\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\tmiscWords = miscWords.toLowerCase(); \n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|?{}!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\tmiscWords = miscWords.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"\\\\d]\", \"\");\t\t\n\t\t\t\t\t\t\t\t//System.out.println(miscWords);\n\t\t\t\t\t\t\t\tif (hmap.containsValue(miscWords)) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, \" \");\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tallTerms.add(miscWords);\n\t\t\t\t\t\t\t\t\thmap.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tallValues.put(documentCount, miscWords);\n\t\t\t\t\t\t\t\t\tif (!(uniqueTerms.contains(miscWords)))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif ((stopWordsSetting && !(stopWords.contains(miscWords))))\n\t\t\t\t\t\t\t\t\t\t\tuniqueTerms.add(miscWords);\n\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\n\t\t\t\t\t\t\t\t\tdocumentCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\ttotalAbstract.append(\"\\n\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocAndAbstract.get(documentFound).add(totalAbstract);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t//Once article is found, we enter all of of it's title and abstract terms \n\t\t\t\tif (articleNew == 0) \n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tdocumentFound = documentFound - 1;\n\t\t\t\t\t//System.out.println(\"Words found in Doc: \" + documentFound);\n\t\t\t\t\t//System.out.println(\"Map is\" +allValues);\n\t\t\t\t\tSet set = hmap.entrySet();\n\t\t\t\t\tIterator iterator = set.iterator();\n\n\t\t\t\t\tSet set2 = allValues.entrySet();\n\t\t\t\t\tIterator iterator2 = set2.iterator();\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileList.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\tdocTermCount++;\n\t\t\t\t\t}\n\t\t\t\t\t// \"BEFORE its put in, this is what it looks like\" + hmap);\n\t\t\t\t\thmap2.putAll(hmap);\n\t\t\t\t\thmap.clear();\n\t\t\t\t\tarticleNew = 1;\n\n\t\t\t\t\tdocTermCountList.add(docTermCount);\n\t\t\t\t\tdocTermCount = 0;\n\n\t\t\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\t\t\tMap.Entry mentry2 = (Map.Entry) iterator2.next();\n\t\t\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t\t\t// );\n\t\t\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t\t\t// docTermCount++;\n\t\t\t\t\t}\n\n\t\t\t\t\tallValues.clear();\t\t\t\t\t\n\t\t\t\t\tdocumentFound = Integer.parseInt(arr[1]);\n\n\t\t\t\t\t// \"MEANWHILE THESE ARE ALL VALUES\" + postingsFileListAllWords);\n\n\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\t//System.out.println(\"Looking at final doc!\");\n\t\t\t//Final loop for last sets\n\t\t\tSet set = hmap.entrySet();\n\t\t\tIterator iterator = set.iterator();\n\n\t\t\tSet setA = allValues.entrySet();\n\t\t\tIterator iteratorA = setA.iterator();\n\t\t\tpostingsFileList.put(documentFound - 1, new ArrayList<String>());\n\t\t\tpostingsFileListAllWords.put(documentFound - 1, new ArrayList<String>());\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mentry = (Map.Entry) iterator.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value is: \" + mentry.getValue());\n\t\t\t\t// //);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\tString term2 = mentry.getValue().toString();\n\t\t\t\tpostingsFileList.get(documentFound - 1).add(term2);\n\n\t\t\t\tdocTermCount++;\n\t\t\t}\n\t\t\t//System.out.println(\"Done looking at final doc!\");\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Sorting time!\");\n\t\t\twhile (iteratorA.hasNext()) {\n\t\t\t\tMap.Entry mentry2 = (Map.Entry) iteratorA.next();\n\t\t\t\t// (\"key is: \"+ mentry.getKey() + \" & Value is: \" + mentry.getValue());\n\t\t\t\t// (\"Value2 is: \" + mentry2.getValue());\n\t\t\t\t// //);\n\t\t\t\tString term = mentry2.getValue().toString();\n\t\t\t\t// //\"This is going to be put in doc3: \"+ (documentFound-1));\n\t\t\t\tpostingsFileListAllWords.get(documentFound - 1).add(term);\n\t\t\t\t// if ( !((mentry.getValue()).equals(\" \")) )\n\t\t\t\t// docTermCount++;\n\t\t\t}\n\n\t\t\thmap2.putAll(hmap);\n\t\t\thmap.clear();\n\t\t\tdocTermCountList.add(docTermCount);\n\t\t\tdocTermCount = 0;\n\n\n\t\t\t\n\t\t\n\t\t\t// END OF LOOKING AT ALL DOCS\n\t\t\t\n\t\t\t//System.out.println(\"Docs and titles: \"+docAndTitles);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms);\n\t\t\tString[] sortedArray = allTerms.toArray(new String[0]);\n\t\t\tString[] sortedArrayUnique = uniqueTerms.toArray(new String[0]);\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t\n\t\t\tArrays.sort(sortedArray);\n\t\t\tArrays.sort(sortedArrayUnique);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//Sortings \n\t\t\tSet set3 = hmap2.entrySet();\n\t\t\tIterator iterator3 = set3.iterator();\n\n\t\t\t// Sorting the map\n\t\t\t//System.out.println(\"Before sorting \" +hmap2);\t\t\t\n\t\t\tMap<Integer, String> map = sortByValues(hmap2);\n\t\t\t//System.out.println(\"after sorting \" +map);\n\t\t\t// //\"After Sorting:\");\n\t\t\tSet set2 = map.entrySet();\n\t\t\tIterator iterator2 = set2.iterator();\n\t\t\tint docCount = 1;\n\t\t\twhile (iterator2.hasNext()) {\n\t\t\t\tMap.Entry me2 = (Map.Entry) iterator2.next();\n\t\t\t\t// (me2.getKey() + \": \");\n\t\t\t\t// //me2.getValue());\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(\"Done sorting!\");\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Posting starts \");\n\t\t\t//\"THIS IS START OF DICTIONARTY\" \n\t\t\tBufferedWriter bw = null;\n\t\t\tFileWriter fw = null;\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(\"Start making an array thats big as every doc total \");\n\t\t\tfor (int z = 1; z < documentFound+1; z++)\n\t\t\t{\n\t\t\t\ttermWeights.put(z, new ArrayList<Double>());\n\t\t\t}\n\t\t\t//System.out.println(\"Done making that large array Doc \");\n\t\t\t\n\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\n\t\t\t//System.out.println(\"All terms\" +allTerms)\n\t\t\t//System.out.println(Arrays.toString(sortedArray));\n\t\t\t//System.out.println(Arrays.toString(sortedArrayUnique));\n\t\t\t//System.out.println(uniqueTerms);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//\tSystem.out.println(\"Posting starts \");\n\t\t\t// \tPOSTING FILE STARTS \n\t\t\ttry {\n\t\t\t\t// Posting File\n\t\t\t\t//System.out.println(\"postingsFileListAllWords: \"+postingsFileListAllWords); //Contains every word including Dups, seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileList: \"+postingsFileList); \t\t //Contains unique words, dups are \" \", seperated per doc\n\t\t\t\t//System.out.println(\"postingsFileListAllWords.size(): \" +postingsFileListAllWords.size()); //Total # of docs \n\t\t\t\t//System.out.println(\"Array size: \"+sortedArrayUnique.length);\n\n\t\t\t\tfw = new FileWriter(POSTING);\n\t\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\tString temp = \" \";\n\t\t\t\tDouble termFreq = 0.0;\n\t\t\t\t// //postingsFileListAllWords);\n\t\t\t\tList<String> finalTermList = new ArrayList<String>();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\t// //postingsFileList.get(i).size());\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!(finalTermList.contains(temp))) \n\t\t\t\t\t\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\n\t\t\t\t\t\t\t//PART TO FIND DOCUMENT FREQ\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint docCountIDF = 0;\n\t\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\t\tfor (int totalWords = 0; totalWords < sortedArray.length; totalWords++) \t\t\n\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\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD \n\t\t\t\t\t\t\t\t\t//System.out.println(\"fOUND STOP WORD\");\n\t\t\t\t\t\t\t\t\tcontinue;\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\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tString temp2 = sortedArray[totalWords];\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tdocCountIDF++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Total Number: \" +docCountIDF);\n\t\t\t\t\t\t\t//System.out.println(\"documentFound: \" +documentFound);\n\t\t\t\t\t\t\t//System.out.println(\"So its \" + documentFound + \" dividied by \" +docCountIDF);\n\t\t\t\t\t\t\t//docCountIDF = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble idf = (Math.log10(((double)documentFound/(double)docCountIDF)));\n\t\t\t\t\t\t\t//System.out.println(\"Calculated IDF: \"+idf);\n\t\t\t\t\t\t\tif (idf < 0.0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tidf = 0.0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"IDF is: \" +idf);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Size of doc words: \" + postingsFileListAllWords.size());\n\t\t\t\t\t\t\tfor (int k = 0; k < postingsFileListAllWords.size(); k++) \t\t//Go thru each doc. Since only looking at 1 term, it does it once per doc\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//System.out.println(\"Current Doc: \" +(k+1));\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\t\t\t\t\ttermFreq = 1 + (Math.log10(Collections.frequency(postingsFileListAllWords.get(k), temp)));\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Freq is: \" +Collections.frequency(postingsFileListAllWords.get(k), temp));\n\t\t\t\t\t\t\t\t\t//System.out.println(termFreq + \": \" + termFreq.isInfinite());\n\t\t\t\t\t\t\t\t\tif (termFreq.isInfinite() || termFreq <= 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\ttermFreq = 0.0;\n\t\t\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\t\t//System.out.println(\"termFreq :\" +termFreq); \n\t\t\t\t\t\t\t\t\t//System.out.println(\"idf: \" +idf);\n\t\t\t\t\t\t\t\t\ttermWeights.get(k+1).add( (idf*termFreq) );\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}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t\t\tfinalTermList.add(temp);\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FINALCOUNTER\n\t\t\t\t\t\t//System.out.println(\"Done looking at word: \" +j);\n\t\t\t\t\t\t//System.out.println(\"\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Current Weights: \"+termWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\twhile (true)\n\t\t\t\t {\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Enter a query: \");\n\t\t\t\t\t\n\t \tScanner scanner = new Scanner(System.in);\n\t \tString enterQuery = scanner.nextLine();\n\t \t\n\t \t\n\t\t\t\t\tList<Double> queryWeights = new ArrayList<Double>();\n\t\t\t\t\t\n\t\t\t\t\t// Query turn\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tenterQuery = enterQuery.toLowerCase();\t\t\n\t\t\t\t\tenterQuery = enterQuery.replaceAll(\"[-&^%'*$+|{}?!\\\\/<\\\\>=.,;_:()\\\\[\\\\]\\\"]\", \"\");\n\t\t\t\t\t//System.out.println(\"Query is: \" + enterQuery);\n\t\t\t\t\t\n\t\t\t\t\tif (enterQuery.equals(\"exit\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tString[] queryArray = enterQuery.split(\" \");\n\t\t\t\t\tArrays.sort(queryArray);\n\t\t\t\t\t\n\t\t\t\t\t//Find the query weights for each term in vocab\n\t\t\t\t\tfor (int j = 0; j < sortedArrayUnique.length; ++j)\t\t\t\t\t // go thru each word, CURRENT TERM\n\t\t\t\t\t{\n\t\t\t\t\t\t//System.out.println(\"Term is: \" + sortedArrayUnique[j]);\n\t\t\t\t\t\ttemp = sortedArrayUnique[j];\t\t\t\t\t\n\t\t\t\t\t\tif ((stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\tint docCountDF = 0;\n\t\t\t\t\t\t//Start here for dictionary \n\t\t\t\t\t\tfor (int totalWords = 0; totalWords < queryArray.length; totalWords++) \t\t\n\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (temp.compareTo(\" \") == 0 || (stopWordsSetting && stopWords.contains(temp))) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t//EITHER BLANK OR STOPWORD\n\t\t\t\t\t\t\t\tcontinue;\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\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tString temp2 = queryArray[totalWords];\n\t\t\t\t\t\t\t\t//System.out.println(\"Compare: \"+temp+ \" with \" +temp2);\n\t\t\t\t\t\t\t\tif (temp.compareTo(temp2) == 0) {\n\t\t\t\t\t\t\t\t\t// (temp2+\" \");\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tdocCountDF++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tDouble queryWeight = 1 + (Math.log10(docCountDF));\n\t\t\t\t\t\tif (queryWeight.isInfinite())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tqueryWeight = 0.0;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tqueryWeights.add(queryWeight);\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query WEights is: \"+queryWeights);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Finding the norms for DOCS\t\t\t\t\t\n\t\t\t\t\tfor (int norms = 1; norms < documentFound+1; norms++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble currentTotal = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < termWeights.get(norms).size(); weightsPerDoc++)\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tdouble square = Math.pow(termWeights.get(norms).get(weightsPerDoc), 2);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//System.out.println(\"Current square: \" + termWeights.get(norms).get(weightsPerDoc));\n\t\t\t\t\t\t\tcurrentTotal = currentTotal + square;\n\t\t\t\t\t\t\t//System.out.println(\"Current total: \" + currentTotal);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//System.out.println(\"About to square root this: \" +currentTotal);\n\t\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\t\tdocNorms.put(norms, root);\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(\"All of the docs norms: \"+docNorms);\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Finding the norm for the query\n\t\t\t\t\tdouble currentTotal = 0.0;\t\t\t\t\t\n\t\t\t\t\tfor (int weightsPerDoc = 0; weightsPerDoc < queryWeights.size(); weightsPerDoc++)\n\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\tdouble square = Math.pow(queryWeights.get(weightsPerDoc), 2);\n\t\t\t\t\t\tcurrentTotal = currentTotal + square;\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tdouble root = Math.sqrt(currentTotal);\n\t\t\t\t\tdouble queryNorm = root; \t\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Query norm \" + queryNorm);\n\t\t\t\t\t\n\t\t\t\t\t//Finding the cosine sim\n\t\t\t\t\t//System.out.println(\"Term Weights \" + termWeights);\n\t\t\t\t\tHashMap<Integer, Double> cosineScore = new HashMap<Integer, Double>();\n\t\t\t\t\tfor (int cosineSim = 1; cosineSim < documentFound+1; cosineSim++)\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble total = 0.0;\n\t\t\t\t\t\tfor (int docTerms = 0; docTerms < termWeights.get(cosineSim).size(); docTerms++)\n\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\tdouble docTermWeight = termWeights.get(cosineSim).get(docTerms);\n\t\t\t\t\t\t\tdouble queryTermWeight = queryWeights.get(docTerms);\n\t\t\t\t\t\t\t//System.out.println(\"queryTermWeight \" + queryTermWeight);\n\t\t\t\t\t\t\t//System.out.println(\"docTermWeight \" + docTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = total + (docTermWeight*queryTermWeight);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdouble cosineSimScore = 0.0;\n\t\t\t\t\t\tif (!(total == 0.0 || (docNorms.get(cosineSim) * queryNorm) == 0))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = total / (docNorms.get(cosineSim) * queryNorm);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcosineSimScore = 0.0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tcosineScore.put(cosineSim, cosineSimScore);\n\t\t\t\t\t}\n\t\t\t\t\tcosineScore = sortByValues2(cosineScore);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"This is the cosineScores: \" +cosineScore);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"docAndTitles: \"+ docAndTitles);\n\t\t\t\t\tint topK = 0;\n\t\t\t\t\tint noValue = 0;\n\t\t\t\t\tfor (Integer name: cosineScore.keySet())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (topK < 50)\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\n\t\t\t\t String key =name.toString();\n\t\t\t\t //String value = cosineScore.get(name).toString(); \n\t\t\t\t if (!(cosineScore.get(name) <= 0))\n\t\t\t\t {\n\t\t\t\t \tSystem.out.println(\"Doc: \"+key);\t\t\t\t \t\t\t\t\t \t\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder builder = new StringBuilder();\n\t\t\t\t \tfor (StringBuilder value : docAndTitles.get(name)) {\n\t\t\t\t \t builder.append(value);\n\t\t\t\t \t}\n\t\t\t\t \tString text = builder.toString();\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Title:\\n\" +docAndTitles.get(name));\n\t\t\t\t \tSystem.out.println(\"Title: \" +text);\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t//System.out.println(\"Authors:\\n\" +docAndAuthors.get(name));\n\t\t\t\t \t\n\t\t\t\t \tif (docAndAuthors.get(name) == null || docAndAuthors.get(name).toString().equals(\"\"))\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Authors: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAuthors.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Authors found: \" +text2);\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/* ABSTRACT \n\t\t\t\t \tif (docAndAbstract.get(name) == null)\n\t\t\t\t \t{\n\t\t\t\t \t\tSystem.out.println(\"Abstract: N\\\\A\\n\");\n\t\t\t\t \t}\n\t\t\t\t \telse \n\t\t\t\t \t{\t\t\t\t \t\t\t\t\t\t \t\n\t\t\t\t\t \tStringBuilder builder2 = new StringBuilder();\n\t\t\t\t\t \tfor (StringBuilder value : docAndAbstract.get(name)) {\n\t\t\t\t\t \t builder2.append(value);\n\t\t\t\t\t \t}\n\t\t\t\t\t \tString text2 = builder2.toString();\t\t\t\t \t\n\t\t\t\t\t \t\n\t\t\t\t\t \tSystem.out.println(\"Abstract: \" +text2);\n\t\t\t\t \t}\t\n\t\t\t\t \t*/\n\t\t\t\t \t\n\t\t\t\t \tSystem.out.println(\"\");\n\t\t\t\t }\n\t\t\t\t else {\n\t\t\t\t \tnoValue++;\n\t\t\t\t }\n\t\t\t\t topK++;\n\t\t\t\t \n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (noValue == documentFound)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"No documents contain query!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t\ttopK=0;\n\t\t\t\t\tnoValue = 0;\n\t\t\t\t }\n\t\t\t\t\n\t\t\t} finally {\n\t\t\t\ttry {\n\t\t\t\t\tif (bw != null)\n\t\t\t\t\t\tbw.close();\n\n\t\t\t\t\tif (fw != null)\n\t\t\t\t\t\tfw.close();\n\n\t\t\t\t} catch (IOException ex) {\n\n\t\t\t\t\tex.printStackTrace();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\n\t\t\t\tif (fr != null)\n\t\t\t\t\tfr.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\tint itemCount = uniqueTerms.size();\n\t\t\t//System.out.println(allValues);\n\t\t\tSystem.out.println(\"Total Terms BEFORE STEMING: \" +itemCount);\n\t\t\tSystem.out.println(\"Total Documents \" + documentFound);\n\t\t\t\t\t\t\n\t\t \n\t\t\t \n\t\t\t \n\t\t\t//END OF MAIN\n\t\t}",
"public List<Word> getCleanWordList(String moduleName) {\n return moduleList.stream()\n .skip(moduleList.size() - 1)\n .map(item -> new Word(item, moduleName))\n .collect(Collectors.toList());\n }",
"public boolean isStopword( char[] word ) {\n\t\t// Return true if the input word is a stopword, or false if not.\n\t\treturn false;\n\t}",
"static private void removeOldTerms(DataManager manager, List<Term> oldTerms, ArrayList<Term> newTerms) throws Exception\r\n\t{\r\n\t\t// Create a hash of all new terms\r\n\t\tHashMap<Integer,Term> newTermHash = new HashMap<Integer,Term>();\r\n\t\tfor(Term newTerm : newTerms) newTermHash.put(newTerm.getId(), newTerm);\r\n\r\n\t\t// Remove all terms which are no longer used\r\n\t\tfor(Term term : oldTerms)\r\n\t\t\tif(!newTermHash.containsKey(term.getId()))\r\n\t\t\t\tif(!manager.getSchemaElementCache().deleteSchemaElement(term.getId()))\r\n\t\t\t\t\tthrow new Exception(\"Failed to delete thesaurus term\");\r\n\t}",
"@Test\n public void tweakingEnglishStopwordsAndStemming() throws IOException {\n\n LanguageComponents english = LanguageComponents.load(\"English\");\n\n // Pass-through of all suppliers to English defaults.\n LinkedHashMap<Class<?>, Supplier<?>> componentSuppliers = new LinkedHashMap<>();\n for (Class<?> clazz : english.components()) {\n componentSuppliers.put(clazz, () -> english.get(clazz));\n }\n\n // Now override the suppliers of Stemmer and LexicalData interfaces. These suppliers should be\n // thread-safe, but the instances of corresponding components will not be reused across threads.\n\n // Override the Stemmer supplier.\n componentSuppliers.put(\n Stemmer.class,\n (Supplier<Stemmer>) () -> (word) -> word.toString().toLowerCase(Locale.ROOT));\n\n // Override the default lexical data.\n LexicalData lexicalData =\n new LexicalData() {\n Set<String> ignored = new HashSet<>(Arrays.asList(\"from\", \"what\"));\n\n @Override\n public boolean ignoreLabel(CharSequence labelCandidate) {\n // Ignore any label that has a substring 'data' in it; example.\n return labelCandidate.toString().toLowerCase(Locale.ROOT).contains(\"data\");\n }\n\n @Override\n public boolean ignoreWord(CharSequence word) {\n return word.length() <= 3 || ignored.contains(word.toString());\n }\n };\n componentSuppliers.put(LexicalData.class, () -> lexicalData);\n\n // The custom set of language components can be reused for multiple clustering requests.\n LanguageComponents customLanguage =\n new LanguageComponents(\"English (customized)\", componentSuppliers);\n\n LingoClusteringAlgorithm algorithm = new LingoClusteringAlgorithm();\n algorithm.desiredClusterCount.set(10);\n List<Cluster<Document>> clusters =\n algorithm.cluster(ExamplesData.documentStream(), customLanguage);\n System.out.println(\"Clusters:\");\n ExamplesCommon.printClusters(clusters);\n }",
"@Override\n\tpublic void onStop()\n\t{\n\t\tsuper.onStop();\n\t\tNaviWords.setSearchType(null);\t\n\t}",
"public static void findWords(String target) throws FileNotFoundException{\n //reads file through the scanner\n scan = new Scanner(newFile);\n \n //creates new arraylist \n ArrayList<String> list = new ArrayList<String>();\n int count;\n while(scan.hasNextLine()){\n word = scan.nextLine();\n if(contains(target, word)){\n list.add(word.toLowerCase());\n }\n }\n\n int length = target.length();\n\n for(int i = length; i >= 2; i--){\n count = 0;\n System.out.println(i + \" letter words made by unscrambling the letters in \" + target );\n \n //This loop goes through all the strings in the arraylist of words contained\n //in the target word\n for(String a : list){\n //If the length of word in the arraylist is equal to i it prints the \n //word, as long as the line does not go over 40 characters\n if(a.length() == i) {\n if(count > (40 -a.length())){ \n System.out.print(\"\\n\");\n System.out.print(a + \" \");\n count = 0;\n count += (a.length() + 1);\n }\n else{\n System.out.print(a + \" \");\n count += (a.length() + 1);\n }\n }\n\n }\n //decrements length, and continues going through the loop\n length--;\n System.out.println(\"\\n\");\n }\n }",
"public void removeByTodoRichText(String todoRichText);",
"private List<String> getFilteredWords() {\r\n\t\tArrayList<String> filteredWords = new ArrayList<String>(16);\r\n\t\t\r\n\t\tfor (String word : allWords) {\r\n\t\t\tif (matchesFilter(word) == true) {\r\n\t\t\t\tfilteredWords.add(word);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn filteredWords;\r\n\t}",
"private double checkWordsFromList(List<String> list, String review, int nonStopWordsFromReview) {\n int contor = 0;\n for (String l : list) {\n if (l.endsWith(\"*\")) {\n l = l.substring(0,l.length()-1);\n boolean contains = review.matches(\".*\\\\b\" + l + \".*\");\n if (contains) {\n contor ++;\n }\n } else {\n boolean contains = review.matches(\".*\\\\b\" + l + \"\\\\b.*\");\n if (contains) {\n contor ++;\n }\n }\n }\n double result = 0;\n //System.out.println(\"In review se gasesc \" + contor + \" cuvinte din lista\");\n result = (double)(100*contor)/nonStopWordsFromReview;\n\n DecimalFormat newFormat = new DecimalFormat(\"#.###\");\n double threeDecimal = Double.valueOf(newFormat.format(result));\n\n return threeDecimal;\n }",
"public static Set<String> getNonStopTrigrams(String value) {\n\t\tSet<String> trigrams = new HashSet<>(value.length());\n\t\tfor (int i =0; i < value.length() - 2; ++i) {\n\t\t\tString trigram = value.substring(i,i+3);\n\t\t\tif (!Tools.stop3grams.contains(trigram)) { //this excludes stop-trigrams\n\t\t\t\ttrigrams.add(value.substring(i,i+3));\n\t\t\t}\n\t\t}\t\t\n\t\treturn trigrams;\n\t}",
"public static String preprocessStemAndTokenizeReturnDistinctTokens(String data) {\n\t\t//System.out.println(\"Preprocess data, remove stop words, stem, tokenize ..\");\n\t\tSet<String> transformedSet = new LinkedHashSet<String>();\n\t\tList<String> stemmedList = new ArrayList<String>();\n\n\t\tTokenizer analyzer = new Tokenizer(Version.LUCENE_30);\n\t\tTokenStream tokenStream = analyzer.tokenStream(\"\", new StringReader(data));\n\t\tTermAttribute termAttribute;\n\t\tString term;\n\t\ttry {\n\t\t\twhile (tokenStream.incrementToken()) {\n\t\t\t\ttermAttribute = tokenStream.getAttribute(TermAttribute.class);\n\t\t\t\tterm = termAttribute.term();\n\t\t\t\tif (digitPattern.matcher(term).find()) //ignore digits\n\t\t\t\t\tcontinue;\n\t\t\t\tif (stopwords.contains(term)) //ignore stopwords\n\t\t\t\t\tcontinue;\n\t\t\t\tif (term.length() <= 1) //ignore single letter words\n\t\t\t\t\tcontinue;\n\t\t\t\tstemmer.setCurrent(term);\n\t\t\t\tstemmer.stem();\n\t\t\t\tstemmedList.add(stemmer.getCurrent());\n\t\t\t}\n\t\t\ttransformedSet.addAll(stemmedList);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tstemmedList.clear();\n\t\tstemmedList = null;\n\t\t\n\t\treturn StringUtils.join(transformedSet.toArray(), \" \");\n\t}",
"void stopIndexing();",
"@Override\n public StopTrainingDocumentClassifierResult stopTrainingDocumentClassifier(StopTrainingDocumentClassifierRequest request) {\n request = beforeClientExecution(request);\n return executeStopTrainingDocumentClassifier(request);\n }",
"public static void main(String[] args) throws IOException {\n \n String s = \" Today's is sunny. She is a sunny girl. To be or not to be. She is in Berlin\\r\\n\"\n\t\t\t\t+ \"today. Sunny Berlin! Berlin is always exciting!\"\n\t\t\t\t+ \"\";\n \n PorterStemmer stemmer = new PorterStemmer();\n Tokenizer tokenizer = new StandardTokenizer();\n Tokenizer wt = new WhitespaceTokenizer();\n\t\t\n final List<String> stop_Words = Arrays.asList(\"is\", \"was\", \"in\", \"to\", \"be\");\n\t\tfinal CharArraySet stopSet = new CharArraySet(stop_Words, true);\n\t\t\n\t\t\n\t\ttokenizer.setReader(new StringReader(s));\n\t\tTokenStream tok = tokenizer;\n\t\t\n\t\ttok = new StopFilter(tok, stopSet);\n\t\ttok.reset();\n\t\t\n\t\tCharTermAttribute attr = tok.addAttribute(CharTermAttribute.class);\n\t\t\n\t\t\n\t\twhile(tok.incrementToken()) {\n\t\t // Grab the term\n\t\t String term = attr.toString();\n\n\t\t System.out.println(term);\n\t\t \n\t\t}\n\t\t\n\t}"
] | [
"0.76350886",
"0.75848466",
"0.7573286",
"0.7304466",
"0.7273685",
"0.7168523",
"0.7118565",
"0.7050616",
"0.6663114",
"0.65976113",
"0.6538649",
"0.6526628",
"0.6504247",
"0.64914566",
"0.64764464",
"0.6432003",
"0.6369095",
"0.6159066",
"0.61492336",
"0.6125531",
"0.60637724",
"0.60529107",
"0.59505016",
"0.58386093",
"0.5787207",
"0.569533",
"0.5681621",
"0.5627371",
"0.5626371",
"0.5598247",
"0.558731",
"0.5575708",
"0.55421114",
"0.553301",
"0.55214643",
"0.551875",
"0.5477716",
"0.5445373",
"0.5421741",
"0.53897923",
"0.538491",
"0.53424656",
"0.5341984",
"0.530791",
"0.530001",
"0.5268299",
"0.5266618",
"0.52655375",
"0.5256823",
"0.523919",
"0.5224822",
"0.5203991",
"0.5191466",
"0.51875377",
"0.51725656",
"0.5165028",
"0.5161149",
"0.5145863",
"0.51447564",
"0.5098029",
"0.5086101",
"0.5085527",
"0.50729114",
"0.5058095",
"0.50432634",
"0.5029735",
"0.5013045",
"0.5010355",
"0.5001496",
"0.5001067",
"0.49917263",
"0.4986309",
"0.49720123",
"0.49286562",
"0.49243018",
"0.49155813",
"0.49103704",
"0.49094555",
"0.4902456",
"0.48960328",
"0.4894697",
"0.48857808",
"0.4876578",
"0.4874925",
"0.48739427",
"0.48672536",
"0.48656875",
"0.4852189",
"0.48135746",
"0.48009542",
"0.47958958",
"0.47940236",
"0.4793338",
"0.47854987",
"0.4782013",
"0.47811738",
"0.4777721",
"0.47641662",
"0.4757996",
"0.47452754"
] | 0.7325088 | 3 |
Method to get the unique words in the given String | public static String getWords(String fileName){
String result = null;
try {
FileInputStream fin = new FileInputStream(fileName);
BufferedReader br = new BufferedReader(new InputStreamReader(fin));
StringBuilder sb = new StringBuilder();
String line = br.readLine();
while(line != null){
sb.append(line);
line = br.readLine();
}
br.close();
result = Utils.removeStopWords(sb.toString());
return result;
}
catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return result;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static Set<String> getUniqueWords(String input) {\r\n HashSet<String> hSet = new HashSet<String>();\r\n ArrayList<String> words = getWords(input);\r\n for(String word: words) {\r\n if(!hSet.contains(word)) {\r\n hSet.add(word);\r\n }\r\n }\r\n return hSet;\r\n }",
"public static void findDuplicateWords(String inputString)\r\n\t{\r\n\t\t// split the words in words array \r\n\t\tString words[]= inputString.split(\" \");\r\n\t\t\r\n\t\t//Create HashMap for count the words \r\n\t\tHashMap<String, Integer> wordcount = new HashMap<String, Integer>();\r\n\t\t\r\n\t\t// to check each word in given array \r\n\t\t\r\n\t\tfor(String word: words )\r\n\t\t{\r\n\t\t\t//if word is present \r\n\t\t\tif(wordcount.containsKey(word)) {\r\n\t\t\t\twordcount.put(word.toLowerCase(), wordcount.get(word)+1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\twordcount.put(word,1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//extracting all the keys of map : wordcount\r\n\t\tSet<String> wordInString = wordcount.keySet();\r\n\t\t\r\n\t\t// iterate the loop through all the wors in wordCount \r\n\t\tfor(String word : wordInString)\r\n\t\t{\r\n\t\t\tif(wordcount.get(word)>1)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(word+ \" : \" + wordcount.get(word));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"Set<String> getUniqueCharacterStrings();",
"public static int uniqueWords (String sent) {\n\n \tint counter = 0;\n \tString[] words = sent.split(\" \");\n \t\n \tif(words.length == 1){\n\t\t\tcounter = 1;\n\t\t\treturn counter;\n\t\t}\n \tfor( int i = 0; i < words.length; i++){\n\n \t\tboolean unique = true;\n \t\tfor(int j = 0; j < words.length; j++ ){\n \t\t\tif(i != j){\n \t\t\t\tif(words[i].equals(words[j])){\n \t\t\t\tunique = false;\n \t\t\t}\n \t\t\t}\n \t\t}\n \t\tif(unique == true){\n\t\t\t\tcounter++;\n\t\t\t}\n \t\t\n \t}\n \treturn counter;\n \n }",
"public static String uniques(String str){\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n return uniques;\n\n }",
"public static String \n removeDuplicateWords(String input) \n { \n \n // Regex to matching repeated words. \n String regex \n = \"\\\\b(\\\\w+)(?:\\\\W+\\\\1\\\\b)+\"; \n Pattern p \n = Pattern.compile( \n regex, \n Pattern.CASE_INSENSITIVE); \n \n // Pattern class contains matcher() method \n // to find matching between given sentence \n // and regular expression. \n Matcher m = p.matcher(input); \n \n // Check for subsequences of input \n // that match the compiled pattern \n while (m.find()) { \n input \n = input.replaceAll( \n m.group(), \n m.group(1)); \n } \n return input; \n }",
"public static ArrayList<String> getWords(String input) {\r\n ArrayList<String> w = new ArrayList<String>();\r\n input = input.toLowerCase();\r\n String[] words = input.split(\"\\\\s+\");\r\n for (int i = 0; i < words.length; i++) {\r\n words[i] = words[i].replaceAll(\"[^\\\\w]\", \"\");\r\n }\r\n for(String elem: words) {\r\n w.add(elem);\r\n }\r\n return w;\r\n }",
"public boolean isStringMadeofAllUniqueChars(String word) {\n if (word.length() > 128) {\n return false;\n }\n boolean[] char_set = new boolean[128];\n for (int i = 0; i < word.length(); i++) {\n int val = word.charAt(i);\n System.out.println(val);\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }",
"private Set<String> deletionHelper(String word) {\n\t\tSet<String> deletionWords = new HashSet<String>();\n\t\tfor (int i = 0; i < word.length(); i++) {\n\t\t\tdeletionWords.add(word.substring(0, i) + word.substring(i + 1));\n\t\t}\n\t\treturn deletionWords;\n\t}",
"public static ArrayList<String> words(String s){\n\t\ts = s.toLowerCase().replaceAll(\"[^a-zA-Z ]\", \"\");\n\t\tArrayList<String> arrayList = new ArrayList<String>();\n\t\tString currWord = \"\";\n\n\t\tfor(int i = 0; i < s.length(); i ++){\n\t\t\tchar c = s.charAt(i);\n\t\t\tif (Character.isLetter(c) == false){\n\t\t\t\tarrayList.add(currWord);\n\t\t\t\tcurrWord = \"\";\n\t\t\t}else{\n\t\t\t\tcurrWord = currWord + c;\n\t\t\t}\n\t\t}\n\t\tarrayList = removeSpaces(arrayList);\n\t\treturn arrayList;\n\t}",
"public static void main(String[] args) {\n String str = \"abcDaaafmOO\";\n String uniques = \"\";//lets use string str to find unique characters\n // int count = frequency(str,'a');//return type is int, therefore assign to int variable\n // System.out.println(count);//print the frequency of char 'a'\n//This step is use to identify if the character is unique, let's use loop for this\n for (char each : str.toCharArray()){\n // char ch = str.charAt(i); //to get char as a data type\n int count = frequency(str, each);\n //this is a frequency\n if(count == 1){//if count is equal to 1, concat it to unique variable\n uniques += each;\n }\n }\n System.out.println(\"unique values are: \"+uniques);\n System.out.println(\"========================\");\n String str2 = \"ppppoifugggggsxL\";\n String uniques2 = uniques(str2);\n System.out.println(\"unique values are: \"+uniques2);\n }",
"public ArrayList<String> FindAllCombinationWord(String str) {\r\n\r\n ArrayList<String> wordList = new ArrayList<String>();\r\n\r\n int n = str.length();\r\n ArrayList<String> combinationWord = permute(str, 0, n - 1);\r\n\r\n for (String item : combinationWord) {\r\n int j = 0;\r\n for (int i = n; i >= 2; i--) {\r\n String finalString = item.substring(j);\r\n\r\n if (!wordList.contains(finalString)) {\r\n wordList.add(finalString);\r\n }\r\n j++;\r\n }\r\n }\r\n return wordList;\r\n }",
"HashSet<String> removeDuplicates(ArrayList<String> words) {\n\t\tHashSet<String> keywords = new HashSet<String>();\n\t\tkeywords.addAll(words);\n\t\treturn keywords;\n\t}",
"static Stream<String> splitIntoWords(String str) \r\n\t{\r\n\t\treturn Arrays.stream(str.split(\"\\\\W+\")).filter(s -> s.length() > 0);\r\n\t}",
"static ArrayList<String> split_words(String s){\n ArrayList<String> words = new ArrayList<>();\n\n Pattern p = Pattern.compile(\"\\\\w+\");\n Matcher match = p.matcher(s);\n while (match.find()) {\n words.add(match.group());\n }\n return words;\n }",
"public static ArrayList<String> getWordsInString(String s) {\r\n\t\t// Search words in text\r\n\t\tString[] split = s.replace('-', ' ').split(\" \");\r\n\t\tArrayList<String> words = new ArrayList<String>(split.length);\r\n\t\t// Remove punctuation\r\n\t\tfor(String str : split) {\r\n\t\t\tif(str.isEmpty()) continue;\r\n\t\t\tStringBuilder wordBuilder = new StringBuilder();\r\n\t\t\tfor(int j = 0; j < str.length(); j++) {\r\n\t\t\t\tchar c = str.charAt(j);\r\n\t\t\t\tif(c >= 'A' && c <= 'Z') c = (char) (c + 'a' - 'A');\r\n\t\t\t\tif((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) {\r\n\t\t\t\t\twordBuilder.append(c);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\twords.add(wordBuilder.toString());\r\n\t\t}\r\n\t\treturn words;\r\n\t}",
"public static String reducedWord(String word) {\n String lcWord = word.toLowerCase();\n String redVowels = convertVowels(lcWord);\n String noDuplicates = removeDuplicate(redVowels);\n return noDuplicates;\n }",
"public String function(HashSet<String> Dictionary, String inputString) {\n\n int[] step = new int[inputString.length() + 1];\n\n step[0] = 0;\n\n for (int i = 1; i <= inputString.length(); i++)\n {\n step[i] = -1;\n\n for ( int j = 0 ; j < i ; j++ )\n {\n if ( Dictionary.contains( inputString.substring(j, i) ) && step[j] != -1 )\n {\n step[i] = j;\n break;\n }\n }\n }\n\n // if text can not be made from the whole inputString, return an empty string\n if (step[inputString.length()] == -1)\n return \"\";\n\n // Moving backwards from the end, the words contain words in the reverse order\n ArrayList<String> words = new ArrayList<String>();\n\n for (int x = inputString.length(); x > 0; x = step[x])\n words.add(inputString.substring(step[x], x));\n\n // Create a string using a StringBuilder that contains words in the normal order\n StringBuilder sb = new StringBuilder();\n\n for (int i = words.size()-1; i >= 0; i--)\n sb.append( i > 0 ? words.get(i) + \" \" : words.get(i) );\n\n return sb.toString();\n }",
"public static String[] unique(String[] strings) {\n Set set = new HashSet();\n for (int i=0; i<strings.length; i++) {\n String name = strings[i].toLowerCase();\n set.add(name);\n }\n return (String[])set.toArray(new String[0]);\n }",
"public static List<String> missingWords(String s, String t) {\n String[] a = s.split(\" \");\n String[] b = t.split(\" \");\n int sz = a.length - b.length;\n String [] missing = new String[sz];\n int c = 0;\n for(int i=0;i<a.length;i++){\n int flag=0;\n for(int j=0;j<b.length;j++){\n if(a[i].equals(b[j]))\n flag=1;\n }\n if(flag==0){\n missing[c++]=a[i];\n\n }\n }\n\n List<String> missingWords = new ArrayList<>();\n for(String str: missing){\n missingWords.add(str);\n }\n System.out.println(missingWords);\n return missingWords;\n }",
"public String[] findDuplicates(String string) {\n String[] temp = string.toLowerCase().replaceAll(\"[^a-zA-Z]\", \"\").split(\"\");\n List<String> output = new ArrayList<String>();\n\n for (int i = 0; i < temp.length; i++) {\n int nextElement = i + 1;\n int prevElement = i - 1;\n\n if (nextElement >= temp.length) {\n break;\n }\n\n if (temp[i].equals(temp[nextElement])) {\n if (prevElement != i && !temp[i].equals(temp[prevElement])) {\n output.add(temp[i]);\n }\n }\n }\n\n // Convert the ListString to a traditional array for output\n duplicates = new String[output.size()];\n output.toArray(duplicates);\n\n System.out.println(\"The duplicate chars found are: \" + Arrays.toString(duplicates));\n return duplicates;\n }",
"public static List<String> getUniqueWords(String phrase, Locale locale) {\n\t\tString[] parts = splitPhrase(phrase);\n\t\tList<String> uniqueParts = new Vector<String>();\n\t\t\n\t\tif (parts != null) {\n\t\t\tList<String> conceptStopWords = Context.getConceptService().getConceptStopWords(locale);\n\t\t\tfor (String part : parts) {\n\t\t\t\tif (!StringUtils.isBlank(part)) {\n\t\t\t\t\tString upper = part.trim().toUpperCase();\n\t\t\t\t\tif (!conceptStopWords.contains(upper) && !uniqueParts.contains(upper))\n\t\t\t\t\t\tuniqueParts.add(upper);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn uniqueParts;\n\t}",
"public static TreeSet<String> uniqueStems(String line) {\n\t\t// THIS IS PROVIDED FOR YOU; NO NEED TO MODFY //\n\t\treturn uniqueStems(line, new SnowballStemmer(DEFAULT));\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tScanner sc = new Scanner(System.in);\n\t\tSystem.out.println(\"enter few strings [space in betweeen] \");\n\t\tString s1 = sc.nextLine();\n\t\tString testSA [] = s1.split(\" \");\n\t\t\n\t\tString resSA [] = uniquStrings(testSA);\n\t\t\n\tSystem.out.println(\"the unique strings \" );\n\tfor(String str:resSA)\n\t\tSystem.out.println(str);\n\n\t}",
"public static void findUniqueOptimalSolution(String inputString) {\n boolean[] charArray = new boolean[128];\n for (int i = 0; i < inputString.length(); i++) {\n int val = inputString.charAt(i);\n if (charArray[val]) {\n System.out.println(\"Input String dont have unique characters:\" + inputString);\n return;\n }\n charArray[val] = true;\n }\n System.out.println(\"Input String has unique characters \" + inputString);\n }",
"public static String removeDuplicatesMaintainOrder(String str) {\n\t\tboolean seen[] = new boolean[256];\n\t\tStringBuilder sb = new StringBuilder(seen.length);\n\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\tchar ch = str.charAt(i);\n\t\t\t// System.out.println((int)ch);\n\t\t\tif (!seen[ch]) {\n\t\t\t\tseen[ch] = true;\n\t\t\t\tsb.append(ch);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t}",
"public boolean allUnique(String word) {\n int[] bitVector = new int[8];\n char[] array = word.toCharArray();\n for (char c : array) {\n if ((bitVector[c / 32] >>> (c % 32) & 1) != 0) {\n return false;\n }\n //\n bitVector[c / 32] |= 1 << (c % 32);\n }\n return true;\n }",
"public List<String> uniqueSubstring(String s, int k) {\n List<String> result = new ArrayList<>();\n Set<String> set = new HashSet<>();\n for (int i=0;i<=s.length()-k;i++) {\n set.add(s.substring(i, i+k));\n }\n for (String str: set) {\n result.add(str);\n }\n Collections.sort(result);\n return result;\n }",
"public static TreeSet<String> uniqueStems(String line, Stemmer stemmer) {\n\t\tTreeSet<String> set = new TreeSet<String>();\n\t\tString lines[] = TextParser.parse(line);\n\t\tfor(int i = 0 ; i < lines.length; i++) {\n\t\t\tset.add(stemmer.stem(lines[i]).toString());\n\t\t}\n\t\treturn set;\n\t}",
"public static boolean isUnique(String input) {\r\n // Create a Set to insert characters\r\n Set<Character> set = new HashSet<>();\r\n\r\n // get all characters form String\r\n char[] characters = input.toCharArray();\r\n\r\n for (Character c : characters) {\r\n if (!set.add(c)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public static HashSet<Word> createHashSet (Scanner input){\n HashSet<Word> temp = new HashSet<>();\n while (input.hasNext()){\n Word inputWord = new Word(input.next());\n temp.add(inputWord);\n }\n return temp;\n }",
"public KeyWordList extractKeyWords(String input);",
"private static boolean isUnique(String str) {\n\t\tif(str.length() > 256)\n\t\t\treturn false;\n\t\tboolean [] char_set = new boolean[256];\n\t\tfor(int i =0; i<str.length();i++) {\n\t\t\tint value = str.charAt(i);\n\t\t\tif(char_set[value])\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tchar_set[value] = true;\n\t\t}\n\t\treturn true;\n\t}",
"public static HashSet<String> getAllPermutations(String str) {\n\t\tHashSet<String> permutations = new HashSet<String>();\r\n\r\n\t\tif (str == null || str.length() == 0) {\r\n\t\t\tpermutations.add(\"\");\r\n\t\t\treturn permutations;\r\n\t\t}\r\n\r\n\t\tchar first = str.charAt(0);\r\n\t\tString remainingString = str.substring(1);\r\n\t\tHashSet<String> words = getAllPermutations(remainingString);\r\n\t\tfor (String word : words) {\r\n\t\t\tfor (int i = 0; i <= word.length(); i++) {\r\n\t\t\t\tString prefix = word.substring(0, i);\r\n\t\t\t\tString suffix = word.substring(i);\r\n\t\t\t\tpermutations.add(prefix + first + suffix);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn permutations;\r\n\t}",
"public static int duplicateCount(String text) {\n String[] textArray = text.toLowerCase().split(\"\");\n List<String> temp = new ArrayList<String>();\n\n // Storing all of the duplicated strings\n for(int i=0; i < textArray.length; i++){\n for(int j=i+1; j < textArray.length; j++){\n if(textArray[i].equals(textArray[j])){\n temp.add(textArray[i]);\n }\n }\n }\n \n // Convert list to array\n String[] itemsArray = new String[temp.size()];\n itemsArray = temp.toArray(itemsArray);\n \n // Removing all the duplicated strings by using hashset\n Set<String> set = new HashSet<String>();\n for(int i = 0; i < itemsArray.length; i++){\n set.add(itemsArray[i]);\n }\n\n // Returning the length \n return set.size();\n }",
"public static String answer(String[] words)\n {\n ArrayList<String> alphabets = new ArrayList<>();\n generateAllAlphabets(words, alphabets);\n return eliminateCombine(alphabets);\n }",
"private void exercise5() throws IOException {\n final Path resourcePath = retrieveResourcePath();\n List<String> nonDuplicateList;\n try (BufferedReader reader = newBufferedReader(resourcePath)) {\n nonDuplicateList = reader.lines()\n .flatMap(line -> of(line.split(WORD_REGEXP)))\n .distinct()\n .collect(toList());\n }\n\n nonDuplicateList.forEach(System.out::println);\n }",
"private static String[] transformToUnique(final String... input) {\n final Set<String> inputSet = new HashSet<>(Arrays.asList(input));\n return inputSet.toArray(new String[0]);\n }",
"public static String removeDuplicateLetters(String s) {\r\n\t\t\r\n\t\tStringBuilder output = new StringBuilder();\r\n\t\t\r\n\t\tSet<Character> letters = new HashSet<>();\r\n\t\t\r\n\t\tfor (Character c : s.toCharArray()) {\r\n\t\t\tif (!letters.contains(c) || c.equals(' ')) {\r\n\t\t\t\tletters.add(c);\r\n\t\t\t\toutput.append(c);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn output.toString();\r\n\t}",
"public static String removeDuplicates(String s)\n {\n if (s==null||s.isEmpty()) return s;\n Set<Character> charSet = new HashSet<Character>(s.length());//maximum possible capacity\n //Set.add will only add characters not already in the list\n for (char c : s.toCharArray())\n {\n charSet.add(c);\n }\n StringBuilder sb = new StringBuilder(charSet.size());\n for (Character c : charSet)\n {\n sb.append(c);\n }\n return sb.toString();\n }",
"public Map<String, Integer> wordCount(String string) {\n\t\t//Split the input string by into individual words. Takes out the spaces, commas, apostrophes\n\t\tString[] splitWords = string.split(\"[\\\\s',]\");\n\t\t//Initiate the hashmap to store unique words as keys and incrementing values with repeated keys\n\t\tMap<String, Integer> wordCount = new HashMap<>();\n\t\tfor(int i = 0; i < splitWords.length; i++ ) {\n\t\t\t//increment word count if the word is already in the hashmap. Make a new entry if word is unique to the map.\n\t\t\tif (wordCount.containsKey(splitWords[i])) {\n\t\t\t\twordCount.put(splitWords[i], wordCount.get(splitWords[i])+1);\n\t\t\t}else {\n\t\t\t\twordCount.put(splitWords[i], 1);\n\t\t\t}\t\t\n\t\t}\n\t\t//Remove the empty spaces from the map (to satisfy a test case)\n\t\twordCount.remove(\"\");\n\t\treturn wordCount;\n\t}",
"static void stringConstruction(String s) {\n\n StringBuilder buildUniq = new StringBuilder();\n boolean[] uniqCheck = new boolean[128];\n\n for (int i = 0; i < s.length(); i++) {\n if (!uniqCheck[s.charAt(i)]) {\n uniqCheck[s.charAt(i)] = true;\n if (uniqCheck[s.charAt(i)]){\n buildUniq.append(s.charAt(i));\n }\n }\n }\n String unique=buildUniq.toString();\n int n = unique.length();\n System.out.println(n);\n }",
"public List<Stem> uniqueStems(char word[], int length) {\n List<Stem> stems = new ArrayList<Stem>();\n CharArraySet terms = new CharArraySet(dictionary.getVersion(), 8, dictionary.isIgnoreCase());\n if (dictionary.lookupWord(word, 0, length) != null) {\n stems.add(new Stem(word, length));\n terms.add(word);\n }\n List<Stem> otherStems = stem(word, length, null, 0);\n for (Stem s : otherStems) {\n if (!terms.contains(s.stem)) {\n stems.add(s);\n terms.add(s.stem);\n }\n }\n return stems;\n }",
"public static void findUniqueUsingHashMap(String inputString) {\n\n HashMap<Character, Integer> stringHashMap = new HashMap<>();\n for (int i = 0; i < inputString.length(); i++) {\n if (stringHashMap.containsKey(inputString.charAt(i))) {\n System.out.println(\"Input String dont have unique characters:\" + inputString);\n return;\n }\n stringHashMap.put(inputString.charAt(i), i);\n }\n System.out.println(\"Input String has unique characters \" + inputString);\n }",
"public boolean allUnique(String word) {\n if(word == null || word.length() <= 1) {\n return false;\n }\n char[] array = word.toCharArray();\n int[] alphabet = new int[8];\n for (char c : array) {\n int bitindex = c;\n int row = bitindex / 32;\n int col = bitindex % 32;\n if ((alphabet[row] & (1 << col)) != 0) {\n return false;\n } else {\n alphabet[row] = alphabet[row] | (1 << col);\n }\n }\n return true;\n }",
"public static String uniqueChars(String str) {\n String result = \"\";\n char[] ch = str.toCharArray();\n\n for (int i = 0; i < ch.length; i++) {\n if(!result.contains(\"\" + ch[i])){\n result+=\"\" + ch[i];\n }\n\n }\n\n return result;\n }",
"public void biStringToAl(String s){\n\t\tint i=0, j=0, num=0;\n\t\twhile(i<s.length() - 1){ //avoid index out of range exception\t\t\t\n\t\t\twhile(i < s.length()){\n\t\t\t\ti++;\n\t\t\t\tif(s.charAt(i) == ' ' || i == s.length()-1){ //a word ends\n\t\t\t\t\tnum++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile(num >2 && i < s.length()){\n\t\t\t\tj++;\n\t\t\t\tif(s.charAt(j) == ' '){ // j is 2 words slower than i\n\t\t\t\t\tj = j + 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tString temp;\n\t\t\tif(num >= 2){\n\t\t\t\tif(i == s.length() - 1){\n\t\t\t\t\ttemp =s.substring(j,i+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp =s.substring(j,i);\n\t\t\t\t}\n\t\t\t\tbiWords.add(temp);\n\t\t\t\t//System.out.println(\"temp:\"+temp);\n\t\t\t}\n\t\t}\n\t}",
"public boolean uniqueCharacters(String st) {\n\t\tif(st.length() > 256) return false;\n\t\t\n\t\tboolean[] char_set = new boolean[256];\n\t\tfor(int i=0; i < st.length(); i++) {\n\t\t\tint val = st.charAt(i);\n\t\t\tif(char_set[val])\n\t\t\t\treturn false;\n\t\t\tchar_set[val] = true;\n\t\t}\n\t\treturn true;\n\t}",
"private static boolean isUniqueM1(String str) {\n boolean isUnique = true;\n\n for (int i = 0; i < str.length(); i++) {\n\n for (int j = i + 1; j < str.length(); j++) {\n if (str.charAt(i) == str.charAt(j)) {\n isUnique = false;\n }\n }\n }\n return isUnique;\n }",
"public static boolean findDoubledStrings(String text) {\n Set<String> setStrings = new HashSet<>();\n String[] stringArray = text.split(\" \");\n IntStream.range(0, stringArray.length).forEach(t-> setStrings.add(stringArray[t]));\n return setStrings.size()!=stringArray.length;\n }",
"public static Set<String> getTrigrams(String value) { //linear complexity: O(value.length) \n\t\tSet<String> trigrams = new HashSet<>(value.length());\n\t\tfor (int i =0; i < value.length() - 2; ++i) {\n\t\t\ttrigrams.add(value.substring(i,i+3)); //excluding i+3\t\t\t\n\t\t}\t\t\n\t\treturn trigrams;\n\t}",
"private static boolean isUnique(String str) {\n if (str.length() > 128) {\n return false;\n }\n boolean[] boolArray = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i);\n if (boolArray[val]) {\n return false;\n }\n boolArray[val] = true;\n }\n return true;\n }",
"public static String[] splitWords(String str){\r\n\t\tArrayList<String> wordsList= new ArrayList<String>();\r\n\t\t\r\n\t\tfor(String s:str.split(\" \")){\r\n\t\t\tif(!s.isEmpty()) wordsList.add(s);\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\treturn wordsList.toArray(new String[wordsList.size()]);\r\n\t}",
"public int getTotalUniqueWords() {\n return totalUniqueWords;\n }",
"public static boolean isUnique(String s){\n\n\t\tint length = s.length();\n\t\tboolean count[] = new boolean[256];\n\t\tArrays.fill(count, false);\n\n\n\t\tint i = 0;\n\t\twhile (i < length){\n\t\t\tint num = Character.toLowerCase(s.charAt(i)) - 'a';\n\n\t\t\tif (count[num]){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\tcount[num] = true;\n\t\t\t}\n\t\t\ti += 1;\n\t\t}\n\t\treturn true;\n\n\n\t\t// in the end of the loop, return true\n\t}",
"private static String hashWord(String word) {\n int[] counts = new int[26];\n for (char c : word.toCharArray()) { // O(c)\n counts[(int)c-97]++;\n }\n StringBuilder sb = new StringBuilder();\n for (int i : counts) { // O(26)\n sb.append(Integer.toString(i));\n }\n return sb.toString();\n }",
"public static List<Integer> findWordConcatenation(String str, String[] words) {\n List<Integer> resultIndices = new ArrayList<Integer>();\n if (str == null || str.isEmpty() || words == null || words.length == 0)\n return resultIndices;\n\n int len = words[0].length();\n Map<String, Integer> freqMap = new HashMap();\n\n for (String word : words)\n freqMap.put(word, freqMap.getOrDefault(word, 0) + 1);\n\n Map<String, Integer> curMap = new HashMap();\n int l = 0, cc = 0;\n int i = 0;\n while (i < str.length() - len + 1) {\n String cur = str.substring(i, i + len);\n if (!freqMap.containsKey(cur)) {\n curMap.clear();\n ++i; l = i;\n continue;\n }\n\n curMap.put(cur, curMap.getOrDefault(cur, 0) + 1);\n if (curMap.get(cur) == freqMap.get(cur))\n cc++;\n\n while(curMap.get(cur) > freqMap.get(cur)) {\n String word1 = str.substring(l, l + len);\n curMap.put(word1, curMap.get(word1) - 1);\n if (curMap.get(word1) < freqMap.get(word1))\n --cc;\n l+=len;\n }\n\n if (cc == freqMap.size())\n resultIndices.add(l);\n i+=len;\n }\n return resultIndices;\n }",
"private void fillSet() {\r\n\t\tString regex = \"\\\\p{L}+\";\r\n\t\tMatcher matcher = Pattern.compile(regex).matcher(body);\r\n\t\twhile (matcher.find()) {\r\n\t\t\tif (!matcher.group().isEmpty()) {\r\n\t\t\t\twords.add(matcher.group());\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public static boolean uniqueString(String s) {\n java.util.HashSet<Character> hash = new java.util.HashSet<>();\n\n for (Character c : s.toCharArray()) {\n if (!hash.add(c)) return false;\n }\n return true;\n }",
"static String[] clean(String line) {\n String[] words = line.trim().split(\"[\\\\p{Punct}\\\\s]+\");\n Object[] cleanedWordsArray = Arrays.stream(words)\n .filter(word -> !wordsSet.contains(word))\n .map(String::trim)\n .toArray();\n\n return Arrays.copyOf(cleanedWordsArray, cleanedWordsArray.length, String[].class);\n }",
"public int countDistinct(String s) {\n\t\tTrie root = new Trie();\n\t\tint result = 0;\n for (int i = 0; i < s.length(); i++) {\n \tTrie cur = root;\n \tfor (int j = i; j < s.length(); j++) {\n \t\tint idx = s.charAt(j) - 'a';\n \t\tif (cur.arr[idx] == null) {\n \t\t\tresult++;\n \t\t\tcur.arr[idx] = new Trie();\n \t\t}\n \t\tcur = cur.arr[idx];\n \t}\n }\n return result;\n }",
"private ISet<String> getKeySet(IList<String> words) {\n\t\tISet<String> keySet = new ChainedHashSet<String>();\n\t\tfor (String word: words) {\n\t\t\tkeySet.add(word);\n\t\t}\n\t\treturn keySet;\n }",
"public Collection<String> words() {\n Collection<String> words = new ArrayList<String>();\n TreeSet<Integer> keyset = new TreeSet<Integer>();\n keyset.addAll(countToWord.keySet());\n for (Integer count : keyset) {\n words.addAll(this.countToWord.get(count));\n }\n return words;\n }",
"private static boolean isUniqueM2(String str) {\n\n if (str.length() > 128) return false;\n\n boolean[] char_set = new boolean[128];\n for (int i = 0; i < str.length(); i++) {\n int val = str.charAt(i);\n System.out.println(\"str.charAt(i): \" + val);\n if (char_set[val]) {\n return false;\n }\n char_set[val] = true;\n }\n return true;\n }",
"private static int solution2(String s) {\r\n int n = s.length();\r\n int ans = 0;\r\n for (int i = 0; i < n; i++)\r\n for (int j = i + 1; j <= n; j++)\r\n if (allUnique(s, i, j)) ans = Math.max(ans, j - i);\r\n return ans;\r\n }",
"boolean checkUnique(String str){\r\n\t\tif(str.length()>128){\r\n\t\t\treturn false;\r\n\t\t\t}\r\n\t\tboolean[] arr = new boolean[128];\r\n\t\tfor(int i=0; i< str.length(); i++){\r\n\t\t\tint val = str.charAt(i);\r\n\t\t\tif(arr[val])\r\n\t\t\t\treturn false;\r\n\t\t\tarr[val]=true;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"public static List<String> getWords(String text)\n\t{\n\t\tString lower = text.toLowerCase();\n\t\tString noPunct = lower.replaceAll(\"\\\\W\", \" \");\n\t\tString noNum = noPunct.replaceAll(\"[0-9]\", \" \");\n\t\tList<String> words = Arrays.asList(noNum.split(\"\\\\s+\"));\n\t\treturn words;\n\t}",
"public static Set<String> getHashtagList(String tweet) {\n\t\tPattern MY_PATTERN = Pattern.compile(\"#(\\\\S+)\");\n\t\tMatcher mat = MY_PATTERN.matcher(tweet);\n\t\tSet<String> strs = new HashSet<String>();\n\t\twhile (mat.find()) {\n\t\t\tString hashTag = removeSharp(mat.group(1));\n\t\t\tif (validateHashTag(hashTag))\n\t\t\t\tstrs.add(hashTag);\n\t\t}\n\t\treturn strs;\n\t}",
"public static List<Integer> findSubstringWordConcatenation(String str, String[] words) {\n assert str != null;\n assert words != null;\n List<String> wordList = new ArrayList<>();\n List<Integer> wordIndex = new ArrayList<>();\n int noOfWords = words.length, wordLength = words[0].length();\n Map<String,Integer> wordFrequencyMap = new HashMap<>();\n for(String word: words) {\n wordFrequencyMap.put(word,wordFrequencyMap.getOrDefault(word,0)+1);\n }\n\n for(int windowStart=0; windowStart <= (str.length() - (wordLength * noOfWords)); windowStart++) {\n HashMap<String, Integer> wordsSeen = new HashMap<>();\n /*now look for words*/\n for(int wrd=0; wrd<noOfWords; wrd++) {\n int wordStartIndex = windowStart + (wrd * wordLength);\n String word = str.substring(wordStartIndex, wordStartIndex+wordLength);\n if(wordFrequencyMap.containsKey(word)) {\n wordsSeen.put(word, wordsSeen.getOrDefault(word,0)+1);\n } else {\n break;// break for loop\n }\n if(wordsSeen.get(word) > wordFrequencyMap.getOrDefault(word,0)) {\n break;// frequency is more then required\n }\n if(wordsSeen.size() == wordFrequencyMap.size()) {\n wordList.add(str.substring(windowStart, wordStartIndex+wordLength));\n wordIndex.add(windowStart);\n }\n }\n }\n return wordIndex;\n }",
"private void exercise7() throws IOException {\n final Path resourcePath = retrieveResourcePath();\n List<String> result;\n try (BufferedReader reader = newBufferedReader(resourcePath)) {\n result = reader.lines()\n .flatMap(line -> of(line.split(WORD_REGEXP)))\n .distinct()\n .map(String::toLowerCase)\n .sorted(comparingInt(String::length))\n .collect(toList());\n }\n\n result.forEach(System.out::println);\n }",
"private static void longestSubstringAllUnique(String s) {\n\t\tif(s == null || s.length() == 0) {\n\t\t\tSystem.out.println(\"\");\n\t\t\treturn;\n\t\t}\n\t\t//sliding window : 2 pointers (one is use for traverse)\n\t\tint l = 0;\n\t\tSet<Character> set = new HashSet<>();//keep track of current window char\n\t\tint longest = 0;\n\t\t\n\t\tfor(int r = 0; r < s.length(); r++) {\n//\t\t\tif(set.contains(s.charAt(r))) {\n//\t\t\t\twhile(set.contains(s.charAt(r))) {\n//\t\t\t\t\tset.remove(s.charAt(l));\n//\t\t\t\t\tl++;\n//\t\t\t\t}\n//\t\t\t}\n\t\t\t\n\t\t\twhile(set.contains(s.charAt(r))) {//set == itself give distinct key: our requirement is all distinct \n\t\t\t\tset.remove(s.charAt(l));\n\t\t\t\tl++;\n\t\t\t}\n\t\t\t\n\t\t\tset.add(s.charAt(r));\n\t\t\tint currentWindowSize = r - l + 1;\n\t\t\tlongest = Math.max(longest, currentWindowSize);\n\t\t}\n\t\tSystem.out.println(longest);\n\t}",
"public static boolean isUnique(String str)\n\t{\n\t\tif(str.length()>128)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tboolean [] char_set= new boolean [128];\n\t\t\n\t\tfor(int i=0;i<str.length();i++)\n\t\t{\n\t\t\tint val = str.charAt(i);\n\t\t\tif(char_set[val])\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tchar_set[val]=true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public void question4(List<String> input){\n Set<String> s = new HashSet<>(input);\n }",
"public static boolean isAllUnique(String string) {\n\n // Let's create a new HashSet to cache the characters.\n HashSet<Character> set = new HashSet<>();\n\n for (char c : string.toCharArray()) {\n if (set.contains(c)) {\n return false;\n } else {\n set.add(c);\n }\n }\n\n return true;\n }",
"public static Collection<Character> union(String string1, String string2){\n\t\tCollection<Character> mergedVector = new TreeSet<Character>();\n\t\tmergedVector.addAll(stringToCharacterSet(string1));\n\t\tmergedVector.addAll(stringToCharacterSet(string2));\n\t\treturn uniqueCharacters(mergedVector);\n\t}",
"public static Set<String> createSet() {\n Set<String> set = new HashSet<>();\n set.add(\"lesson\");\n set.add(\"large\");\n set.add(\"link\");\n set.add(\"locale\");\n set.add(\"love\");\n set.add(\"light\");\n set.add(\"limitless\");\n set.add(\"lion\");\n set.add(\"line\");\n set.add(\"lunch\");\n set.add(\"level\");\n set.add(\"lamp\");\n set.add(\"luxurious\");\n set.add(\"loop\");\n set.add(\"last\");\n set.add(\"lie\");\n set.add(\"lose\");\n set.add(\"lecture\");\n set.add(\"little\");\n set.add(\"luck\");\n\n return set;\n }",
"void ifUnique(char inputCharArray[])\n\t{\n\t\tint count=0;\n\t\t\n\t\tfor(int i=0; i<inputCharArray.length; i++)\n\t\t{\n\t\t\t//int ab = (int)inputCharArray[i]; \n\t\t\tchar ab = inputCharArray[i];\n\t\t\tfor (int j=0; j<i; j++)\n\t\t\t{\n\t\t\t\tif(ab==inputCharArray[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"String not unique!\");\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tfor (int j=i+1; j<inputCharArray.length; j++)\n\t\t\t{\n\t\t\t\tif(ab==inputCharArray[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"String not unique!\");\n\t\t\t\t\tcount = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (count==1)\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tif (count==0)\n\t\t{\n\t\t\tSystem.out.print(\"String unique!\");\n\t\t}\n\t}",
"public Map<String, Integer> wordCount(String string) {\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\tString[] p = string.split(\"[\\\\W\\\\s]\");\n\t\tfor (String s : p) {\n\t\t\tif (!s.equals(\"\")) {\n\t\t\t\tif (map == null || !map.containsKey(s))\n\t\t\t\t\tmap.put(s, 1);\n\t\t\t\telse\n\t\t\t\t\tmap.replace(s, map.get(s) + 1);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}",
"public static String[] unique(String[] strArray) {\n List<String> unique = new ArrayList<String>();\n for (int i = 0; i < strArray.length; i++) {\n if (unique.contains(strArray[i])) continue;\n unique.add(strArray[i]);\n }\n return (String[]) unique.toArray(new String[0]);\n }",
"boolean hasUniqueCharactersTimeEfficient(String s) {\n Set<Character> characterSet = new HashSet<Character>();\n for(int i=0; i < s.length();i++) {\n if(characterSet.contains(s.charAt(i))) {\n return false;\n } else {\n characterSet.add(s.charAt(i));\n }\n }\n return true;\n }",
"public static List<Integer> allAnagrams(String s, String l) {\n List<Integer> ans = new ArrayList<Integer>();\n \n if(s == null || s.length() < 1 || l == null || l.length() < 1)\n return ans;\n StringBuilder sb = new StringBuilder();\n char[] sarray = s.toCharArray();\n permute(sarray,sb,0);\n for(int i = 0; i < l.length() - s.length()+1; i++){\n if(set.contains(l.substring(i,i+s.length()))){\n ans.add(i);\n }\n }\n return ans;\n }",
"public static Set<Integer> getSetFromString(String str) {\n SortedSet<Integer> aux = new TreeSet<>();\n String[] palabras = str.split(\" \");\n for (int i = 0; i < palabras.length; i++) {\n aux.add(Integer.parseInt(palabras[i]));\n }\n return aux;\n\n }",
"public List<String> validWords(int input) throws Exception {\n List<String> validStrings = new ArrayList<>();\n getValidStrings(validStrings, \"\", Integer.toString(input));\n return validStrings;\n }",
"public static boolean isUnique1(String str) {\n HashSet<Character> set = new HashSet<>();\n for (int i = 0; i < str.length(); i++) {\n if (set.contains(str.charAt(i)))\n return false;\n set.add(str.charAt(i));\n }\n return true;\n }",
"private List<String> getFilteredWords() {\r\n\t\tArrayList<String> filteredWords = new ArrayList<String>(16);\r\n\t\t\r\n\t\tfor (String word : allWords) {\r\n\t\t\tif (matchesFilter(word) == true) {\r\n\t\t\t\tfilteredWords.add(word);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn filteredWords;\r\n\t}",
"public static void main(String[] args){\n Scanner sc = new Scanner(System.in);\r\n\r\n System.out.println(\"Please enter a String\");\r\n String input = sc.nextLine();\r\n\r\n if (isUnique(input)) {\r\n System.out.println(\"All characters of String are unique\");\r\n } else {\r\n System.out.println(\"All characters of String are not unique\");\r\n }\r\n\r\n sc.close();\r\n}",
"public static String[] splitIntoWords(String s) {\n String[] words = s.split(\" \");\n return words;\n }",
"public char[] eliminateDuplicate(String str){\n\t\tTaskB taskB = new TaskB();\n\t\tchar[] sortArr = taskB.sortUnicodeCharacter(str);\t\n\t\tchar[] temp = new char[sortArr.length];\n\t\tint m = 0;\n\t\tint count = 0;\n\t\t\n\t\t// save unique char in temp array\n\t\tfor(int i = 0; i < sortArr.length; i++){\n\t\t\tif((i + 1) <= sortArr.length - 1){\n\t\t\t\tif(sortArr[i] != sortArr[i + 1]){\n\t\t\t\t\ttemp[m] = sortArr[i];\n\t\t\t\t\tm++;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\ttemp[m] = sortArr[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t// count actual char in temp array\n\t\tfor(int j = 0; j < temp.length; j++){\n\t\t\tif(temp[j] != 0){\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// save chars in temp array to temp2 array\n\t\tchar[] temp2 = new char[count];\n\t\tfor(int k = 0; k < temp2.length; k++){\n\t\t\ttemp2[k] = temp[k];\n\t\t}\n\t\t\n\t\treturn temp2;\n\t}",
"public static String [] splitwords(String s) {\n return splitwords(s, WHITESPACE);\n }",
"public Set<String> getWordsNotFoundByUser(){\n\n Set<String> validWordsOnBoardCopy = new HashSet<String>();\n validWordsOnBoardCopy.addAll(validWordsOnBoard);\n validWordsOnBoardCopy.removeAll(validWordsFoundByUser);\n\n return validWordsOnBoardCopy;\n }",
"public Set<String> hyponyms(String word) {\n HashSet<String> set = new HashSet<String>();\n for (Integer id: synsets.keySet()) {\n TreeSet<String> hs = synsets.get(id);\n if (hs.contains(word)) {\n for (String s: hs) {\n set.add(s);\n }\n TreeSet<Integer> ids = new TreeSet<Integer>();\n ids.add(id);\n Set<Integer> desc = GraphHelper.descendants(dg, ids);\n for (Integer i: desc) {\n for (String s: synsets.get(i)) {\n set.add(s);\n }\n }\n }\n }\n return set;\n }",
"public static void main(String[] args) {\n String s1 = \"ShivaniKashyap\";\n char[] chararray = s1.toCharArray();\n LinkedHashSet set = new LinkedHashSet();\n LinkedHashSet newset = new LinkedHashSet();\n for(int i=0;i<chararray.length;i++)\n {\n if( !set.add(chararray[i]))\n {\n newset.add(chararray[i]);\n\n }\n\n }\n System.out.println(newset);\n }",
"private List<String> help(String s, Set<String> wordDict) {\n\t\tList<String> ret = new ArrayList<>();\n\n\t\tif (wordDict.contains(s))\n\t\t\tret.add(s);\n\t\telse\n\t\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\t\tif (wordDict.contains(s.substring(0, i + 1))) {\n\n//\t\t\t\t\tSystem.out.println(s.substring(0, i + 1));\n\n\t\t\t\t\tList<String> tmp = help(s.substring(i + 1), wordDict);\n\t\t\t\t\tif (tmp.size() > 0) {\n\t\t\t\t\t\tret.add(s.substring(0, i + 1));\n\t\t\t\t\t\tret.addAll(tmp);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\treturn ret;\n\t}",
"public static void main(String[] args) {\n String[] strings = new String[100];\n for (int i = 0; i < strings.length; i++) {\n strings[i] = randomStrings(2);\n }\n// for (String s : strings) {\n// System.out.println(s);\n// }\n ArrayList<String> appeared = new ArrayList<>();\n for (String s : strings) {\n if (!appeared.contains(s)) {\n appeared.add(s);\n }\n }\n System.out.println(appeared.size());\n\n }",
"public Map<String, Integer> findUnicalWord(ArrayList<Word> text)\n {\n String[] words=new String[text.size()];\n for(int i=0; i<text.size(); i++){\n words[i]=text.get(i).toString();\n }\n HashMap<String, Integer> myWordsCount = new HashMap<>();\n for (String s : words){\n if (myWordsCount.containsKey(s)) myWordsCount.replace(s, myWordsCount.get(s) + 1);\n else myWordsCount.put(s, 1);\n }\n\n Map<String, Integer> newWordsCount = myWordsCount\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n\n return newWordsCount;\n\n }",
"public int getTotalUniqueWords(File file) throws Exception{\n\t\tBufferedReader br = new BufferedReader(new FileReader(file));\n\t\tString line;\n\t\tSet<String> set = new HashSet<>();\n\t\twhile((line=br.readLine())!=null){\n\t\t\tString[] tokens = line.split(\" \");\n\t\t\tfor(String token : tokens){\n\t\t\t\tif(!set.contains(token)){\n\t\t\t\t\tset.add(token);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tbr.close();\n\t\treturn set.size();\n\t}",
"public static final String[] removeCommonWords(String[] words) {\r\n if (commonWordsMap == null) {\r\n synchronized (initLock) {\r\n if (commonWordsMap == null) {\r\n commonWordsMap = new HashMap();\r\n for (int i = 0; i < commonWords.length; i++) {\r\n commonWordsMap.put(commonWords[i], commonWords[i]);\r\n }\r\n }\r\n }\r\n } \r\n ArrayList results = new ArrayList(words.length);\r\n for (int i = 0; i < words.length; i++) {\r\n if (!commonWordsMap.containsKey(words[i])) {\r\n results.add(words[i]);\r\n }\r\n }\r\n return (String[]) results.toArray(new String[results.size()]);\r\n }",
"public static void main(String[] args) {\nString s = \"Paypal\";\r\nString s1 = s.toLowerCase();\r\nchar[] c= s1.toCharArray();\r\n\r\nSet<Character> charset = new HashSet<Character>();\r\nSet<Character> dupcharset = new HashSet<Character>();\r\nfor(int i=0;i<c.length;i++) {\r\n\tBoolean t = charset.add(c[i]);\r\n\tif(!t) {\r\n\t\tdupcharset.add(c[i]);\r\n\t}\r\n\t\r\n}\r\nSystem.out.println(charset);\r\nSystem.out.println(dupcharset);\r\ndupcharset.removeAll(charset);\r\nSystem.out.println(charset);\r\nSystem.out.println(dupcharset);\r\nfor (Character character : charset) {\r\n\tif(character!=' ') {\r\n\t\tSystem.out.println(character);\r\n\t}\r\n}\r\n\t}",
"public static List<String> funWithAnagrams(List<String> s) {\n \tSet<String> dontRemove = new HashSet<String>();\n Set<String> removeMe = new HashSet<String>();\n for (String s1 : s) {\n char temp1[] = s1.toCharArray();\n Arrays.sort(temp1);\n String sort1 = new String(temp1);\n for (String s2 : s) {\n \tif (s1.equalsIgnoreCase(s2)) continue;\n \telse {\n\t // sort both strings\n\t char temp2[] = s2.toCharArray();\n\t Arrays.sort(temp2);\n\t String sort2 = new String(temp2);\n\t // compare sorted strings\n\t if (!dontRemove.contains(s1) && !dontRemove.contains(s2) && sort1.equalsIgnoreCase(sort2)) {\n\t// \tSystem.out.println(\"sort1 \" + sort1 + \" \\n\" + \"sort2 \" + sort2 );\n\t removeMe.add(s2);\n\t System.out.println(\"remove \" + s2);\n\t dontRemove.add(s1);\n\t System.out.println(\"dontRemove \" + s1);\n\t }\n \t}\n }\n }\n for (String s3 : removeMe) {\n \tSystem.out.println(\"remove : \" + s3);\n s.remove(s3);\n }\n System.out.println(\"\" + s);\n return s;\n }",
"private void exercise6() throws IOException {\n final Path resourcePath = retrieveResourcePath();\n List<String> result;\n try (BufferedReader reader = newBufferedReader(resourcePath)) {\n result = reader.lines()\n .flatMap(line -> of(line.split(WORD_REGEXP)))\n .distinct()\n .map(String::toLowerCase)\n .sorted()\n .collect(toList());\n }\n\n result.forEach(System.out::println);\n }",
"public void countWordsWithoutSplit(String str){\n\t\t\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\tint value = 0;\n\t\t//char[] charArray = str.toCharArray();\n\t\tList<String> list = new ArrayList<String>();\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor(int i=0;i<str.length();i++){\n\t\t\tif(str.trim().charAt(i)!=' '){\n\t\t\t\tsb.append(str.charAt(i));\n\t\t\t}\n\t\t\telse if(sb.length()>0 || i==str.length()){\n\t\t\t\tlist.add(sb.toString());\n\t\t\t\tsb.setLength(0);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(list);\n\t\t\n\t\tfor(String s:list){\n\t\t\tif(map.containsKey(s)){\n\t\t\t\tvalue = map.get(s);\n\t\t\t\tmap.put(s, ++value);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tmap.put(s, 1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(map);\n\t\t\n\t}"
] | [
"0.82271475",
"0.68564296",
"0.68379086",
"0.6660752",
"0.6584175",
"0.6494125",
"0.6471995",
"0.6424575",
"0.63898104",
"0.6294384",
"0.62777054",
"0.6239793",
"0.6189404",
"0.61723113",
"0.6165018",
"0.6147409",
"0.6110801",
"0.6103616",
"0.6010701",
"0.5985013",
"0.59444577",
"0.59082097",
"0.58803654",
"0.5845369",
"0.58439475",
"0.5780777",
"0.5765609",
"0.57357",
"0.5728732",
"0.57270336",
"0.5723846",
"0.57224655",
"0.57097095",
"0.5707733",
"0.5689235",
"0.56803554",
"0.56755084",
"0.56643045",
"0.565607",
"0.5655816",
"0.5653479",
"0.5651817",
"0.5643594",
"0.5635489",
"0.5618422",
"0.5616364",
"0.5602727",
"0.5601382",
"0.5595169",
"0.55909956",
"0.558866",
"0.5582234",
"0.5580906",
"0.55795074",
"0.5578591",
"0.5578142",
"0.55776286",
"0.5571322",
"0.55604535",
"0.55600244",
"0.55593246",
"0.5558262",
"0.55574155",
"0.5554563",
"0.553026",
"0.5529054",
"0.5520815",
"0.55147684",
"0.55143434",
"0.55111486",
"0.55093986",
"0.5507612",
"0.54820496",
"0.5480366",
"0.5476066",
"0.54711735",
"0.5463229",
"0.54595894",
"0.5452778",
"0.5450666",
"0.5448594",
"0.54473674",
"0.5446989",
"0.5443595",
"0.54345506",
"0.54333615",
"0.54285216",
"0.54272807",
"0.54267526",
"0.5422523",
"0.54216766",
"0.5411402",
"0.54110146",
"0.54042286",
"0.53983593",
"0.5394502",
"0.53941554",
"0.53912723",
"0.53868896",
"0.53766143",
"0.537427"
] | 0.0 | -1 |
Method to do the word count | public static void countWords(String text, HashMap<String, Integer> counts){
StringTokenizer st = new StringTokenizer(text);
String currWord = null;
while(st.hasMoreTokens()){
currWord = st.nextToken();
if(counts.containsKey(currWord)){
counts.put(currWord, counts.get(currWord)+1);
}
else{
counts.put(currWord, 1);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int count(String word);",
"public void countWord() {\n\t\tiniStorage();\n\t\tWordTokenizer token = new WordTokenizer(\"models/jvnsensegmenter\",\n\t\t\t\t\"data\", true);\n\t\t// String example =\n\t\t// \"Nếu bạn đang tìm kiếm một chiếc điện thoại Android? Đây là, những smartphone đáng để bạn cân nhắc nhất. Thử linh tinh!\";\n\t\t// token.setString(example);\n\t\t// System.out.println(token.getString());\n\n\t\tSet<Map.Entry<String, String>> crawlData = getCrawlData().entrySet();\n\t\tIterator<Map.Entry<String, String>> i = crawlData.iterator();\n\t\twhile (i.hasNext()) {\n\t\t\tMap.Entry<String, String> pageContent = i.next();\n\t\t\tSystem.out.println(pageContent.getKey());\n\t\t\tPageData pageData = gson.fromJson(pageContent.getValue(),\n\t\t\t\t\tPageData.class);\n\t\t\ttoken.setString(pageData.getContent().toUpperCase());\n\t\t\tString wordSegment = token.getString();\n\t\t\tString[] listWord = wordSegment.split(\" \");\n\t\t\tfor (String word : listWord) {\n\t\t\t\taddToDictionary(word, 1);\n\t\t\t\tDate date;\n\t\t\t\ttry {\n\t\t\t\t\tdate = simpleDateFormat.parse(pageData.getTime().substring(\n\t\t\t\t\t\t\t0, 10));\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\tcontinue;\n\t\t\t\t}\n\t\t\t\taddToStatByDay(date, word, 1);\n\t\t\t}\n\t\t}\n\t}",
"int totalWords();",
"WordCounter(){\r\n }",
"private void getWordCounts() {\n Map<String, List<String>> uniqueWordsInClass = new HashMap<>();\n List<String> uniqueWords = new ArrayList<>();\n\n for (ClassificationClass classificationClass : classificationClasses) {\n uniqueWordsInClass.put(classificationClass.getName(), new ArrayList<>());\n }\n\n for (Document document : documents) {\n String[] terms = document.getContent().split(\" \");\n\n for (String term : terms) {\n if (term.isEmpty()) {\n continue;\n }\n if (!uniqueWords.contains(term)) {\n uniqueWords.add(term);\n }\n\n for (ClassificationClass docClass : document.getClassificationClasses()) {\n if (!uniqueWordsInClass.get(docClass.getName()).contains(term)) {\n uniqueWordsInClass.get(docClass.getName()).add(term);\n }\n if (totalWordsInClass.containsKey(docClass.getName())) {\n this.totalWordsInClass.put(docClass.getName(), this.totalWordsInClass.get(docClass.getName()) + document.getFeatures().get(term));\n } else {\n this.totalWordsInClass.put(docClass.getName(), document.getFeatures().get(term));\n }\n }\n }\n }\n\n this.totalUniqueWords = uniqueWords.size();\n }",
"public static int countWords(String text) throws UIMAException { \n JCas jCas = JCasFactory.createJCas();\n jCas.setDocumentText(text);\n jCas.setDocumentLanguage(\"en\");\n initEngines();\n\n runPipeline(jCas, segmenter); \n \n int cnt = 0; \n for (Token tok : select(jCas, Token.class)) {\n String token = tok.getCoveredText();\n if (token.matches(\"\\\\p{Alpha}*\")) cnt++;\n }\n \n return cnt;\n }",
"private void countWords(String text, String ws) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8))));\n String line;\n\n // Get words and respective count\n while (true) {\n try {\n if ((line = reader.readLine()) == null)\n break;\n String[] words = line.split(\"[ ,;:.?!“”(){}\\\\[\\\\]<>']+\");\n for (String word : words) {\n word = word.toLowerCase();\n if (\"\".equals(word)) {\n continue;\n }\n if (lista.containsKey(word)){\n lista.get(word).add(ws);\n }else{\n HashSet<String> temp = new HashSet<>();\n temp.add(ws);\n lista.put(word, temp);\n }\n\n /*if (!countMap.containsKey(word)) {\n countMap.put(word, 1);\n }\n else {\n countMap.put(word, countMap.get(word) + 1);\n }*/\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n // Close reader\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Display words and counts\n /*for (String word : countMap.keySet()) {\n if (word.length() >= 3) { // Shall we ignore small words?\n //System.out.println(word + \"\\t\" + countMap.get(word));\n }\n }*/\n }",
"public int count(){\r\n\t\tint sum = 0;\r\n for(Integer value: words.values()){\r\n sum += value;\r\n }\r\n return sum;\r\n\t}",
"public int getWordCount(){\r\n\t\treturn wordCount;\r\n\t}",
"private WordCounting() {\r\n }",
"int count(String s) {\r\n\t\tif (m_words.containsKey(s)) {\r\n\t\t\treturn m_words.get(s);\r\n\t\t} else {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}",
"int countByExample(WdWordDictExample example);",
"public WordCount(String word, int count){\n this.word = word;\n this.count = count;\n }",
"int getWordCount() {\r\n return entrySet.size();\r\n }",
"public int getWordCount() {\n return totalWords;\n }",
"public int getWordCount() {\n return wordCount;\n }",
"WordCounter(String inputText){\r\n \r\n wordSource = inputText;\r\n }",
"private void simpleWordCount(SparkSession spark) {\n\n\t\tlog.info(\"*****simpleWordCount*****\");\n\n\t\tJavaRDD<String> lines = spark\n\t\t\t\t.read()\n\t\t\t\t.textFile(WORDS_PATH)\n\t\t\t\t.javaRDD();\n\n\t\tJavaRDD<String> words = lines.flatMap(s -> Arrays.asList(SPACE.split(s)).iterator());\n\n\t\tJavaPairRDD<String, Integer> ones = words.mapToPair(s -> new Tuple2<>(s, 1));\n\n\t\tJavaPairRDD<String, Integer> counts = ones.reduceByKey(Integer::sum);\n\n\t\tList<Tuple2<String, Integer>> output = counts.collect();\n\t\tfor (Tuple2<String,Integer> tuple : output) {\n\t\t\tSystem.out.println(tuple._1() + \" :: \" + tuple._2());\n\t\t}\n\t}",
"public int getWordCount() {\n\t\treturn 10;\n\t}",
"@Override\n public int getNumberOfWords(int count) {\n return restOfSentence.getNumberOfWords(count + 1);\n }",
"@Override\r\n\tpublic Long call() throws Exception {\r\n\t\tString line;\r\n\t\tchar [] wordArray;\r\n\t\tint i;\r\n\t\tchar c;\r\n\t\ttry {\r\n\t\t\tline = setOfLines.take();\r\n\t\t\tString[] words = line.replaceAll(\"\\\\s+\", \" \").split(\" \");\r\n\t\t\t\r\n\t\t\tfor(String word : words) {\r\n\t\t\t\twordArray = word.toCharArray();\r\n\t\t\t\tfor(i=0;i<wordArray.length;i++) {\r\n\t\t\t\t\tc = wordArray[i];\r\n\t\t\t\t\tif(countNumbers ? (!((c>64&&c<91)||(c>96 &&c<123)||(c>47&&c<58))) : (!((c>64&&c<91)||(c>96 &&c<123))) ) {\r\n\t\t\t\t\t\tword = word.replace(c+\"\",\"\" );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(word.isEmpty()) continue;\r\n\t\t\t\tsynchronized (this) {\r\n\t\t\t\t\tif(wordCount.containsKey(word)) {\r\n\t\t\t\t\t\twordCount.put(word, (wordCount.get(word)+1));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\twordCount.put(word, 1);\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} \r\n\t\tcatch (InterruptedException e) {\r\n\t\t\tcustomFile.setErrorString(\"An Error occurred while processing this file, word count may not\"\r\n\t\t\t\t\t+\"be accurate\");\r\n\t\t\t\r\n\t\t\tlogger.error(e);\r\n\t\t}\r\n\t\treturn new Long(0);\r\n\t}",
"public static void wordCount(String filename) {\n SparkConf conf = new SparkConf().setMaster(\"local\").setAppName(\"Word count App\");\n\n // create a java version of the spark context from the configuration\n JavaSparkContext sc = new JavaSparkContext(conf);\n\n // load input data, which is a text file read main\n // the repartition breaks up the document into 20 segments for parallelism\n JavaRDD<String> input = sc.textFile( filename ).repartition(20);\n // split input string into words\n JavaRDD<String> words = input.flatMap(s -> Arrays.asList(s.split(\" \")));\n\n // transform the collection of words into pairs (word and 1). We do not use a combiner here\n JavaPairRDD<String, Integer> counts = words\n // lowercase, remove apostrophes, grammar and lowercase\n .map(p -> p.replaceAll(\"(')|(\\\\W)\", \"$1\"))\n .map(r -> r.replaceAll(\"[^a-zA-Z ]\", \"\"))\n .map(q -> q.toLowerCase())\n\n .mapToPair(t -> new Tuple2( t, 1 ) )\n .partitionBy(new HashPartitioner(4))\n // this is reducing that parallelism back to one\n .reduceByKey( (x, y) -> (int)x + (int)y )\n .coalesce(1);\n\n counts.saveAsTextFile(\"src/main/java/resources/output\");\n }",
"public double getCount(String word1, String word2) {\n double count = 0;\n // YOUR CODE HERE\n if (KnownWord(word1) && KnownWord(word2)) {\n count = bi_grams[NDTokens.indexOf(word1)][NDTokens.indexOf(word2)];\n } else {\n count = smooth ? 1 : 0;\n }\n return count;\n }",
"public void addWordCount(){\r\n\t\twordCount = wordCount + 1;\r\n\t}",
"public void countWordLengthsWithIsLettermethod(FileResource resource, int[] counts) {\r\n for (String word : resource.words()) {\r\n String trim = word.trim();\r\n int wordSize = trim.length();\r\n char firstChar = trim.charAt(0);\r\n char endChar = trim.charAt(trim.length()-1);\r\n if (!Character.isLetter(firstChar) && !Character.isLetter(endChar)) {\r\n wordSize -= 2;\r\n } else \r\n if (!Character.isLetter(firstChar) || !Character.isLetter(endChar)) {\r\n wordSize -= 1;\r\n }\r\n if(wordSize>=counts.length) {\r\n counts[counts.length-1] += 1; \r\n } else\r\n //right algorithm\r\n if( wordSize> 0 && counts[wordSize] != 0 ) {\r\n counts[wordSize] += 1;\r\n \r\n } else if ( wordSize> 0) {\r\n counts[wordSize] = 1;\r\n }\r\n }\r\n \r\n //test\r\n for(int i : counts) {\r\n System.out.println(i);\r\n }\r\n }",
"public static void main (String [] args) {\n WordCount wordCount2 = new WordCount();\r\n \r\n int count = 0;\r\n //creates an new scanner\r\n Scanner input = new Scanner(System.in);\r\n //gets the sentence and splits it at the spaces into an array\r\n String sentence = getSentence (input);\r\n String [] words = sentence.split(\" \");\r\n //parsing through the array and changes the counter\r\n for (int i = 0; i < words.length; i++){\r\n if (words[i].charAt(0) == 'a' || words[i].charAt(0) == 'A') {\r\n count = wordCount2.decrementCounter(count);\r\n } else {\r\n count = wordCount2.incrementCounter(count);\r\n }\r\n \r\n \r\n }\r\n //outputs the results \r\n System.out.println (\"There are \" + count + \" words in this sentence.\"); \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }",
"public static void main(String[] args) {\n Scanner sc = new Scanner (System.in);\n System.out.println(\"Please enter a sentence:\");\n String sentence = sc.nextLine();\n System.out.println(numberOfWords(sentence));\n\n\n }",
"@Override\n public int getNumberOfWords() {\n return 0;\n }",
"public void countWords(String source) {\n Scanner wordScanner = new Scanner(source);\n// wordScanner.useDelimiter(\"[^A-Za-z]+\");\n wordScanner.useDelimiter(\"(?!')[^A-Za-z]+\");\n addWordToMap(wordScanner);\n }",
"public int getWordCount()\n {\n return m_iWordCount;\n }",
"public int getWordLength();",
"public int countOfKnownWord() {\n\t\tint count = 0;\t\t\n\t\ttry {\n \t\t\tClass.forName(DRIVER);\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te1.printStackTrace();\n \t\t}\t\t\n\t\ttry ( Connection con = DriverManager.getConnection(URL, USER, PW)) {\n\t\t\tStatement stmt = con.createStatement();\n\t\t\tString sql;\n\t\t\tsql = \"SELECT count(*) countWordLevel from \" + tbl_USER_DIC + \" WHERE \" + Constants.FLD_KNOW + \" = \" + Constants.WORD_KNOWN + \";\";\n\t\t\tResultSet rs = stmt.executeQuery(sql);\n\t\t\twhile (rs.next()) {\n\t\t\t\tcount = rs.getInt(\"countWordLevel\");\n\t\t\t}\n\t\t\t\n\t stmt.close();\n\t con.close();\n\t\t} catch(Exception e) {\n\t\t\tlogger.info(\"fail to open mysql\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn count;\t\n\t}",
"private int numEnglishWords(String str) {\n int numWords = 0;\n String[] strings = str.split(\" \");\n for (String word : strings) {\n if (english.contains(word)) {\n numWords ++;\n }\n }\n return numWords;\n }",
"public void count(String word) {\n if(word.equals(\"\")){\n return;\n }\n\n for (int i=0; i < counters.length; i++) {\n //TODO: If you find the word increment the count and return\n if (counters[i] != null){\n if (counters[i].wordMatches(word)){\n counters[i].incrementCount();\n break;\n }\n } else {\n counters[i] = new SingleWordCounter(word);\n counters[i].incrementCount();\n break;\n }\n }\n\n //TODO: You didn't find the word. Add a new word counter to the array.\n // Don't forget to increment the word's count to get it to 1!\n\n\t}",
"private static void wordCount(File fileEntry) throws FileNotFoundException {\n\t\tScanner sc = new Scanner(new FileInputStream(fileEntry));\n\t\t int count=0;\n\t\t while(sc.hasNext()){\n\t\t sc.next();\n\t\t count++;\n\t\t }\n\t\tSystem.out.println(\"Number of words: \" + count);\n\t\t\n\t\t\n\t}",
"public synchronized void process() \n\t{\n\t\t// for each word in a line, tally-up its frequency.\n\t\t// do sentence-segmentation first.\n\t\tCopyOnWriteArrayList<String> result = textProcessor.sentenceSegmementation(content.get());\n\t\t\n\t\t// then do tokenize each word and count the terms.\n\t\ttextProcessor.tokenizeAndCount(result);\n\t}",
"public int getNumWords() {\n // TODO: count the number of distinct words,\n // ie. the number of non-null counter objects.\n int count = 0;\n for (int i = 0; i < counters.length; i++){\n if (counters[i] != null) {\n count++;\n }\n }\n return count;\n }",
"@Override\n public void run() {\n long beginTime = System.currentTimeMillis();\n String[] words = text.split(\" \");\n long endTime = System.currentTimeMillis();\n System.out.printf(\"Regex time: %d;\\n\", endTime - beginTime);\n int count = 0;\n beginTime = System.currentTimeMillis();\n for (int i = 0; i < text.length(); i++) {\n char c = text.charAt(i);\n if (c == ' ' || c == '.' || c == '!' || c == '?') {\n count++;\n }\n }\n endTime = System.currentTimeMillis();\n System.out.printf(\"For time: %d;\\n\", endTime - beginTime);\n System.out.printf(\"Words: %d;\\n\", words.length);\n System.out.printf(\"Count word: %d;\\n\", count);\n }",
"public void testCountWordLengths() {\n FileResource fr = new FileResource(\"data/smallHamlet.txt\");\n int[] counts = new int[31];\n countWordLengths(fr, counts);\n }",
"public void countWords(String path) {\n\t\n//\t\tdeclaration and initialization\n\t\tFile file = new File(path);\n\t\tString str = \"\",word = \"\";\n\t\tBufferedReader br;\n\t\tint counter = 1;\n\t\t\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(file));\n\t\t\t\n//\t\t\tReads the file lines until eof\n\t\t\twhile ((str = br.readLine()) != null) {\n\t\t\t\tword = word.concat(str);\n\t\t\t}\n\t\t\t\n//\t\t\tReplace both comma and dot with whitespace\n\t\t\tword = word.replace(',',' ');\n\t\t\tword = word.replace('.',' ');\n\t\t\t\n//\t\t\tSplit the string using space\n\t\t\tString[] words = word.split(\"\\\\s+\");\n\t\n//\t\t\tCompare the words and if they are same words increase the counter\n\t\t\tfor (int i = 0; i < words.length; i++){\n\t\t\t\tfor(int j = i+1; j < words.length; j++){\n\t\t\t\t\tif(words[i] != null && words[i].equals(words[j]) ){\n\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\twords[j] = null; //replace the repeated word with null\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n//\t\t\t\tdisplays the count of the words\n\t\t\t\tif(words[i] != null)\n\t\t\t\tSystem.out.println(words[i]+\": \"+counter);\n\t\t\t\tcounter = 1;\n\t\t\t}\n\t\t\tbr.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception\");\n\t\t}\n\t}",
"public int getWordCount() {\n\t\treturn list.size();\n\t}",
"public void computeWords(){\n\n loadDictionary();\n\n CharacterGrid characterGrid = readCharacterGrid();\n\n Set<String> wordSet = characterGrid.findWordMatchingDictionary(dictionary);\n\n System.out.println(wordSet.size());\n for (String word : wordSet) {\n\t System.out.println(word);\n }\n\n // System.out.println(\"Finish scanning character grid in \" + (System.currentTimeMillis() - startTime) + \" ms\");\n }",
"public void countWords(File sourceFile) throws IOException {\n Scanner wordScanner = new Scanner(sourceFile);\n// wordScanner.useDelimiter(\"(?!')[^A-Za-z]+\");\n wordScanner.useDelimiter(\"(?!')[^A-Za-z]+\");\n addWordToMap(wordScanner);\n wordScanner.close(); // Close underlying file.\n }",
"public static void testWordCount(Configuration conf, DataStore<String,WebPage> inStore, DataStore<String,\n TokenDatum> outStore) throws Exception {\n ((DataStoreBase<String,WebPage>)inStore).setConf(conf);\n ((DataStoreBase<String,TokenDatum>)outStore).setConf(conf);\n \n //create input\n WebPageDataCreator.createWebPageData(inStore);\n \n //run the job\n WordCount wordCount = new WordCount(conf);\n wordCount.wordCount(inStore, outStore);\n \n //assert results\n HashMap<String, Integer> actualCounts = new HashMap<>();\n for(String content : WebPageDataCreator.CONTENTS) {\n if (content != null) {\n for(String token:content.split(\" \")) {\n Integer count = actualCounts.get(token);\n if(count == null) \n count = 0;\n actualCounts.put(token, ++count);\n }\n }\n }\n for(Map.Entry<String, Integer> entry:actualCounts.entrySet()) {\n assertTokenCount(outStore, entry.getKey(), entry.getValue()); \n }\n }",
"abstract public int docFreq(Term t) throws IOException;",
"public long getNumberOfWords() {\n return numberOfWords;\n }",
"public static String wordCounting(File file)\n {\n return null;\n }",
"public boolean count()\n {\n if(!textReaderWriter.initTextReader(fileName))\n return false;\n\n while(textReaderWriter.hasNextString()) {\n String temp = textReaderWriter.readOneString();\n String[] wordsTable = temp.split(\" \");\n for (int i = 0; i < wordsTable.length; i ++) // go throw words in a 1 line\n {\n for (StringPattern stringPattern : stringPatternList) { // go throw patterns\n if(containsPattern(stringPattern.getPattern(), wordsTable[i]))\n {\n stringPattern.incrementCountWords();\n }\n }\n }\n }\n return true;\n }",
"@Override\r\n public Integer numberOfWords(InputStream ins, boolean isWordModel) throws Exception {\n return null;\r\n }",
"public static void main(String[] args) {\n\t\t\n\t\tif (args.length != 1) {\n\t\t\tthrow new IllegalArgumentException(\"Usage: java WordCount <URL>\");\n\t\t}\n\t\tString site = args[0];\n\t\t\n\t\t// If efficiency becomes important, a BufferedInputStream could be used in place of Jsoup.\n\t\t// This would prevent multiple passes over the text, but would introduce the challenge of\n\t\t// reading between HTML tags.\n\t\tString text;\n\t\ttry {\n\t\t\ttext = Jsoup.connect(site).get().text();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t// Attempt to connect with https:// protocol prepended\n\t\t\ttry {\n\t\t\t\tsite = \"https://\" + site;\n\t\t\t\ttext = Jsoup.connect(site).get().text();\n\t\t\t} catch (IllegalArgumentException a) {\n\t\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded. \"\n\t\t\t\t\t\t+ \"Usage: java WordCount <URL>\");\n\t\t\t} catch (IOException m) {\n\t\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded. \"\n\t\t\t\t\t\t+ \"Usage: java WordCount <URL>\"); \n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded.\"\n\t\t\t\t\t+ \" Usage: java WordCount <URL>\");\n\t\t} \n\t\t\n\t\t// Split text into array using alphabetical (multiple languages) and \n\t\t// apostrophe characters\n\t\tString[] textArr = text.split(\"[^\\\\p{L}'’]+\");\n\t\tTree dictionary = new Tree();\n\t\tfor (int i = 0; i < textArr.length; i++) {\n\t\t\tdictionary.insert(textArr[i].toLowerCase());\n\t\t}\n\t\t\n\t\t// Build array using the dictionary. A more efficient solution would involve using a \n\t\t// sorted LinkedList of size 25, and only adding Nodes to the list if they are greater\n\t\t// than the current least Node, adding the new lowest value to the tail with \n\t\t// each insertion.\n\t\tNode[] arr = dictionary.toArray();\n\t\tArrays.sort(arr);\n\t\tfor (int i = 0; i < NUMBER_OF_WORDS; i++) {\n\t\t\tif (i < arr.length) {\n\t\t\t\tSystem.out.printf(\"%-12s%10d\\n\", arr[i].getWord(), arr[i].getCount());\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public int getNumWords() {\n return wordMap.get(\"TOTAL_WORDS\").intValue();\n }",
"public void increment(){\n\t\twordCount += 1;\n\t}",
"int getGrammarMatchCount();",
"public static void main(String[] args) {\n\t\tNumberOfWords obj=new NumberOfWords();\n\t\tint a=obj.wordnum(\"Today is java and i am very tried.\");\n\t\tSystem.out.println(\"Number of words in the string: \"+a);\n\t\n\t}",
"public int getWordsQuantity(){\n\t\treturn counter;\n\t}",
"public int size(){\n return words.size();\n }",
"public int numWords(int length) {\r\n return 0;\r\n }",
"public int countOfUnknownWord() {\n\t\tint count = 0;\t\t\n\t\ttry {\n \t\t\tClass.forName(DRIVER);\n \t\t} catch (ClassNotFoundException e1) {\n \t\t\t// TODO Auto-generated catch block\n \t\t\te1.printStackTrace();\n \t\t}\t\t\n\t\ttry ( Connection con = DriverManager.getConnection(URL, USER, PW)) {\n\t\t\tStatement stmt = con.createStatement();\n\t\t\tString sql;\n\t\t\tsql = \"SELECT count(*) countWordLevel from \" + tbl_USER_DIC + \" WHERE \" + Constants.FLD_KNOW + \" = \" + Constants.WORD_UNKNOWN + \";\";\n\t\t\tResultSet rs = stmt.executeQuery(sql);\n\t\t\twhile (rs.next()) {\n\t\t\t\tcount = rs.getInt(\"countWordLevel\");\n\t\t\t}\n\t\t\t\n\t stmt.close();\n\t con.close();\n\t\t} catch(Exception e) {\n\t\t\tlogger.info(\"fail to open mysql\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn count;\t\n\t}",
"public void count(String dataFile) {\n\t\tScanner fileReader;\n\t\ttry {\n\t\t\tfileReader= new Scanner(new File(dataFile));\n\t\t\twhile(fileReader.hasNextLine()) {\n\t\t\t\tString line= fileReader.nextLine().trim(); \n\t\t\t\tString[] data= line.split(\"[\\\\W]+\");\n\t\t\t\tfor(String word: data) {\n\t\t\t\t\tthis.wordCounter= map.get(word);\n\t\t\t\t\tthis.wordCounter= (this.wordCounter==null)?1: ++this.wordCounter;\n\t\t\t\t\tmap.put(word, this.wordCounter);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfileReader.close();\n\t\t}\n\t\tcatch(FileNotFoundException fnfe) {\n\t\t\tSystem.out.println(\"File\" +dataFile+ \"can not be found.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}",
"private void updateCount(String word) {\n\t\t\tthis.count += invertedIndex.get(word).get(this.location).size();\n\t\t\tthis.score = (double) this.count / counts.get(this.location);\n\t\t}",
"long tokenCount();",
"public int numWordsCurrent() {\r\n return 0;\r\n }",
"public int count( String hotWord ){\r\n String x = hotWord.toLowerCase();\r\n //If the word is a hotword then get the count and return it\r\n if(words.containsKey(x)){\r\n return words.get(x);\r\n }\r\n //If not, then return -1\r\n else{\r\n return -1;\r\n }\r\n\t}",
"long countByExample(WordSchoolExample example);",
"private double countWordFrequencyScore(Page page, String[] queryWords) {\n double score = 0;\n for (String word : queryWords) {\n int wordId = this.pb.getIdForWord(word);\n for (double pageWordId : page.getWords()) {\n if (wordId == pageWordId) score++;\n }\n }\n\n return score;\n }",
"public abstract void overallWords(long ms, int n);",
"public int countWords(String input) {\n if (input == null || input.isEmpty()) {\n return 0;\n }\n String[] words = input.split(\"\\\\s+\");\n return words.length;\n }",
"public WordCount(String _word, int lnNum)\n {\n //initializes common variables \n count = 1;\n lineNums = new CircularList();\n //initializes specific passed variables\n word = _word;\n addLineNum(lnNum);\n }",
"@Test\n public void countNumberOfCharactersInWords() {\n final long count = 0; //TODO\n\n assertEquals(105, count);\n }",
"public static int countWords(String str){\n int count=0; \n \n char ch[]= new char[str.length()]; \n for(int i=0;i<str.length();i++) \n { \n ch[i]= str.charAt(i); \n if( ((i>0)&&(ch[i]!=' ')&&(ch[i-1]==' ')) || ((ch[0]!=' ')&&(i==0)) ) \n count++; \n } \n return count; \n\n\t}",
"public static int countWords(String word, ArrayList<String> s){\n\t\tint n = 0;\n\t\tfor(String w : s){\n\t\t\tif(w.equals(word)){\n\t\t\t\tn++;\n\t\t\t}\n\t\t}\n\t\treturn n;\n\t}",
"@Override\r\n\tpublic int searchkuncCount(String text) {\n\t\treturn productRaw_StoreDao.searchCount(text);\r\n\t}",
"@Override\r\n\tpublic int queryAllCount(String keyWord) {\n\t\treturn mapper.queryAllCount(keyWord);\r\n\t}",
"int getDocumentCount();",
"public void countTerm() throws IOException {\n\n long countBody = reader.getSumDocFreq(\"body\");\n long countTitle = reader.getSumDocFreq(\"title\");\n\n System.out.println(\"Body: \" + countBody);\n System.out.println(\"Title: \" + countTitle);\n System.out.println(\"Total count Terms: \" + (countTitle + countBody));\n\n }",
"private static int numberOfWordsInFile(SimpleReader fileReader) {\r\n int numberOfWordsInFile = 0;\r\n Set<Character> separators = createSeparators();\r\n /*\r\n * Above: creates the set of characters used to determine what is and is\r\n * not a word\r\n */\r\n /*\r\n * Below: begin to read through the file and count the words\r\n */\r\n while (!fileReader.atEOS()) {\r\n String toRead = fileReader.nextLine();\r\n int position = 0;\r\n\r\n while (position < toRead.length()) {\r\n String nextWordOrSep = nextWordOrSeparator(toRead, position,\r\n separators);\r\n position += nextWordOrSep.length();\r\n if (!separators.contains(nextWordOrSep.charAt(0))\r\n && !nextWordOrSep.equals(\"\")) {\r\n numberOfWordsInFile++;\r\n }\r\n /*\r\n * if the word contains a separator then it's not a word, so\r\n * don't add to the word count.\r\n */\r\n }\r\n\r\n }\r\n return numberOfWordsInFile;\r\n }",
"private static Map<String, Integer> getWords(){\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\n\t\tfor(Status status : statusList){\n\t\t\tStringTokenizer tokens = new StringTokenizer(status.getText());\n\t\t\twhile(tokens.hasMoreTokens()){\n\t\t\t\tString token = tokens.nextToken();\n\t\t\t\tif(!token.equals(\"RT\")){\n\t\t\t\t\tif(map.containsKey(token)){\n\t\t\t\t\t\tint count = map.get(token);\n\t\t\t\t\t\tmap.put(token, ++count);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap.put(token, 1);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn map;\n\t}",
"public void setWordCount(int countIn) {\n this.wordCount = countIn;\n }",
"public WordCount()\n {\n //initializes common variables.\n lineNums = new CircularList();\n count = 1;\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\tScanner info = new Scanner(System.in);\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the phrase:\");\r\n\t\tString sentence = info.nextLine();\r\n\t\t\r\n\t\tsentence = sentence.trim().toUpperCase();\r\n\t\t\r\n\t\tfor (int i = 0; i < sentence.length(); i++) {\r\n\t\t\tif (sentence.charAt(i) <'A' || sentence.charAt(i) > 'Z' ) {\r\n\t\t\t\tsentence = sentence.replace(\"\"+sentence.charAt(i), \"/\");\r\n//\t\t\t\tSystem.out.println(sentence);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tString[] word = sentence.split(\"/\") ;\r\n\t\t\r\n\t\tint total = 0;\r\n\t\tif (word.length < 1) {\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\tHashMap hMap = new HashMap();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (word[0].length() > 0) {\r\n\t\t\t\thMap.put(word[0].length(), 1);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tfor (int i = 1; i < word.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < i; j++) {\r\n\t\t\t\t\tif (word[i].length() == word[j].length()) {\r\n\t\t\t\t\t\tint cnt = (int) hMap.get(word[i].length());\r\n\t//\t\t\t\t\tSystem.out.println(\"cnt==>\"+cnt);\r\n\t\t\t\t\t\thMap.put(word[i].length(),++cnt);\r\n\t\t\t\t\t\t\t\r\n\t//\t\t\t\t\tSystem.out.println(word[i].length()+\"==>\"+hMap.get(word[i].length()));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (j == (i-1)){\r\n\t\t\t\t\t\t\thMap.put(word[i].length(), 1);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSet<Integer> keys1 = hMap.keySet();\r\n\t\r\n\t\t\tfor(int key:keys1) {\r\n\t\t\t\tif (key !=0) {\r\n\t\t\t\t\tSystem.out.println(hMap.get(key)+\" \"+key +\" letter words\");\r\n\t\t\t\t\ttotal += (int)hMap.get(key);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(total+\" total words\");\r\n\t\t\r\n\t}",
"public int getCount(String word) {\n // TODO: pattern this after the count() function.\n // Make sure to return 0 for words you haven't seen before.\n if(word.equals(\"\")){\n return(0);\n }\n\n for (int i=0; i < counters.length; i++) {\n if (counters[i] != null) {\n if (counters[i].wordMatches(word)) {\n return (counters[i].getCount());\n }\n }\n }\n return(0);\n }",
"int size() {\r\n\t\treturn m_words.size();\r\n\t}",
"public int totalWordsTree() {\r\n\t\treturn count;\r\n\t}",
"public double getNormalizedCount(String word1, String word2) {\n// double normalizedCount = 0;\n// // YOUR CODE HERE\n// return normalizedCount;\n \n double normalizedCount = 0;\n // YOUR CODE HERE\n if (KnownWord(word1) && KnownWord(word2)) {\n normalizedCount = bi_grams_normalized[NDTokens.indexOf(word1)][NDTokens.indexOf(word2)];\n } else {\n if(smooth) {\n double temp = (!KnownWord(word1)) ? 0 : uni_grams[NDTokens.indexOf(word1)];\n double sum = temp+NDTokens_size;\n normalizedCount = 1/sum;\n }\n }\n return normalizedCount;\n \n }",
"static int countOccurrences(String str, String word) \r\n\t\t{\n\t\t String a[] = str.split(\" \");\r\n\t\t \r\n\t\t // search for pattern in a\r\n\t\t int count = 0;\r\n\t\t for (int i = 0; i < a.length; i++) \r\n\t\t {\r\n\t\t // if match found increase count\r\n\t\t if (word.equals(a[i]))\r\n\t\t count++;\r\n\t\t }\r\n\t\t \r\n\t\t return count;\r\n\t\t}",
"public Map<String, Integer> countWordsComputeIfPresent(String passage, String... strings) {\n\n Map<String, Integer> wordCounts = new HashMap<>();\n Arrays.stream(strings).forEach(s -> wordCounts.put(s, 0));\n Arrays.stream(passage.split(\" \")).forEach(word ->\n wordCounts.computeIfPresent(word, (key, val) -> val + 1));//word,\n return wordCounts;\n\n }",
"private void initiateWordCount(){\n for(String key: DataModel.bloomFilter.keySet()){\n WordCountHam.put(key, 0);\n WordCountSpam.put(key, 0);\n }\n }",
"public int getLength() { return this.words.size(); }",
"private static int countSyllables(String word) {\r\n\t\tint count = 0;\r\n\t\tword = word.toLowerCase();\r\n\r\n\t\tif (word.length()>0 && word.charAt(word.length() - 1) == 'e') {\r\n\t\t\tif (silente(word)) {\r\n\t\t\t\tString newword = word.substring(0, word.length()-1);\r\n\t\t\t\tcount = count + countit(newword);\r\n\t\t\t} else {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tcount = count + countit(word);\r\n\t\t}\r\n\t\treturn count;\r\n\t}",
"private static void wordCountWithMap() throws FileNotFoundException {\n Map<String, Integer> wordCounts = new HashMap<String, Integer>();\n\n Scanner input = new Scanner(new File(fileLocation));\n while (input.hasNext()) {\n String word = input.next();\n if (!wordCounts.containsKey(word)) {\n wordCounts.put(word, 1);\n } else {\n int oldValue = wordCounts.get(word);\n wordCounts.put(word, oldValue + 1);\n }\n }\n\n String term = \"test\";\n System.out.println(term + \" occurs \" + wordCounts.get(term));\n\n // loop over the map\n for (String word : wordCounts.keySet()) {\n int count = wordCounts.get(word);\n if (count >= 500) {\n System.out.println(word + \", \" + count + \" times\");\n }\n }\n\n }",
"public static int countWords(String str) {\r\n return str.split(\" \").length;\r\n }",
"public int countOccurrences(String word) {\n\t\tint i = 0;\n\t\tfor (int j = 0; j < wordList.size(); j++) {\n\t\t\tif (wordList.get(j).equals(word)) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\t\treturn i;\n\t\t// TODO Add your code here\n\t}",
"public static int countWords(final List<String> tokens) {\n\tint nWords = 0;\n\n\tfor (final String token : tokens) {\n\t if (!StringUtils.isComposedOf(token, ALL_DELIMS)) {\n\t\tnWords++;\n\t }\n\t}\n\n\treturn nWords;\n }",
"@Override\r\n\t\t\t\tpublic Tuple2<String, Integer> call(WordCount t) throws Exception {\n\t\t\t\t\treturn new Tuple2<>(t.getWord() , new Integer(t.getCount()));\r\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Test\n public void countNumberOfWords() {\n final long count = 0; //TODO\n\n assertEquals(20, count);\n }",
"public int countByTodoRichText(String todoRichText);",
"public static void testSparkWordCount(Configuration conf, DataStore<String,WebPage> inStore, DataStore<String,\n TokenDatum> outStore) throws Exception {\n ((DataStoreBase<String,WebPage>)inStore).setConf(conf);\n ((DataStoreBase<String,TokenDatum>)outStore).setConf(conf);\n\n //create input\n WebPageDataCreator.createWebPageData(inStore);\n\n //run Spark\n SparkWordCount wordCount = new SparkWordCount();\n wordCount.wordCount(inStore, outStore);\n \n //assert results\n HashMap<String, Integer> actualCounts = new HashMap<>();\n for(String content : WebPageDataCreator.CONTENTS) {\n if (content != null) {\n for(String token:content.split(\" \")) {\n Integer count = actualCounts.get(token);\n if(count == null)\n count = 0;\n actualCounts.put(token, ++count);\n }\n }\n }\n for(Map.Entry<String, Integer> entry:actualCounts.entrySet()) {\n assertTokenCount(outStore, entry.getKey(), entry.getValue());\n }\n }",
"public static void testFlinkWordCount(Configuration conf, DataStore<String, WebPage> inStore, DataStore<String,\n TokenDatum> outStore) throws Exception {\n ((DataStoreBase<String, WebPage>) inStore).setConf(conf);\n ((DataStoreBase<String, TokenDatum>) outStore).setConf(conf);\n\n //create input\n WebPageDataCreator.createWebPageData(inStore);\n\n //run Flink Job\n FlinkWordCount flinkWordCount = new FlinkWordCount();\n flinkWordCount.wordCount(inStore, outStore, conf);\n\n //assert results\n HashMap<String, Integer> actualCounts = new HashMap<>();\n for (String content : WebPageDataCreator.CONTENTS) {\n if (content != null) {\n for (String token : content.split(\" \")) {\n Integer count = actualCounts.get(token);\n if (count == null)\n count = 0;\n actualCounts.put(token, ++count);\n }\n }\n }\n for (Map.Entry<String, Integer> entry : actualCounts.entrySet()) {\n assertTokenCount(outStore, entry.getKey(), entry.getValue());\n }\n }",
"public void addWordCount(int increment){\r\n\t\twordCount = wordCount + increment;\r\n\t}",
"public static void main(String[] args) {\n\t\tString s = \"Sharma is a good player and he is so punctual\"; \n String words[] = s.split(\" \"); \n System.out.println(\"The Number of words present in the string are : \"+words.length);\n\n\t}"
] | [
"0.80648685",
"0.79115695",
"0.7571159",
"0.75099885",
"0.7335604",
"0.7173666",
"0.71345276",
"0.7133258",
"0.7042025",
"0.7041991",
"0.69530994",
"0.69379675",
"0.6937914",
"0.690043",
"0.6892914",
"0.6884723",
"0.6884296",
"0.6883676",
"0.6871576",
"0.6860492",
"0.6858372",
"0.6828925",
"0.6821357",
"0.6789166",
"0.67789745",
"0.6776435",
"0.6774807",
"0.67722934",
"0.67674696",
"0.6762933",
"0.67584246",
"0.67524153",
"0.674004",
"0.6723909",
"0.6710337",
"0.6697724",
"0.6696263",
"0.6693318",
"0.66865635",
"0.66695774",
"0.6668424",
"0.666818",
"0.6636707",
"0.66184705",
"0.65983",
"0.65979606",
"0.65974206",
"0.65750474",
"0.6566549",
"0.6563667",
"0.65577954",
"0.65521663",
"0.65382624",
"0.6530623",
"0.6522025",
"0.6519134",
"0.6517478",
"0.6493703",
"0.64843744",
"0.64790696",
"0.6470814",
"0.64696485",
"0.64640284",
"0.6463181",
"0.64548564",
"0.64509493",
"0.64319783",
"0.64280474",
"0.6419654",
"0.64122754",
"0.64080846",
"0.64000934",
"0.6396288",
"0.6395857",
"0.63896745",
"0.63884187",
"0.6387614",
"0.63861626",
"0.6378411",
"0.6366913",
"0.63559145",
"0.6346077",
"0.63454485",
"0.634487",
"0.63424915",
"0.63341033",
"0.6324782",
"0.63230705",
"0.63058084",
"0.629397",
"0.6291746",
"0.62792856",
"0.62756985",
"0.62704426",
"0.62645644",
"0.62461776",
"0.6244924",
"0.6243791",
"0.62388057",
"0.6232179"
] | 0.6822687 | 22 |
Method to put the words and their counts into priority queue for sorting purpose | public static PriorityQueue<WordCount> sortWords(HashMap<String, Integer> counts){
PriorityQueue<WordCount> words = new PriorityQueue<WordCount>(99999, new wordCountComparator());
WordCount wc = null;
for(Map.Entry<String, Integer> entry : counts.entrySet()){
wc = new WordCount(entry.getKey(), entry.getValue());
words.add(wc);
}
return words;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static ArrayList<sri.Pair<String,Integer>> mostFrequentWords(String path) throws IOException {\r\n PriorityQueue<Pair<String, Integer>> listOfWords = new PriorityQueue<>(10,(o1, o2) -> {\r\n return ((int) o2.getSecond() - (int) o1.getSecond());\r\n });\r\n\r\n HashMap<String,Integer> mapOfWords = new HashMap<>();\r\n\r\n BufferedReader br;\r\n String word;\r\n ArrayList outputList = new ArrayList();\r\n\r\n File file = new File(path);\r\n\r\n br = new BufferedReader(new FileReader(file));\r\n\r\n while ( (word = br.readLine()) != null) {\r\n if (mapOfWords.containsKey(word)) {\r\n mapOfWords.put(word, mapOfWords.get(word) + 1);\r\n } else {\r\n mapOfWords.put(word, 1);\r\n }\r\n }\r\n\r\n for (Map.Entry<String,Integer> entry: mapOfWords.entrySet()){\r\n sri.Pair<String,Integer> tuple = new sri.Pair<String,Integer>(entry.getKey(),entry.getValue());\r\n listOfWords.offer(tuple);\r\n }\r\n\r\n for (int i = 0; i < 5; i++){\r\n outputList.add(new sri.Pair<String,Integer>(listOfWords.peek().getFirst(),listOfWords.poll().getSecond()));\r\n }\r\n\r\n return outputList;\r\n\r\n\r\n }",
"static String[] sortWordsByScore(String[] words) {\n\n if(words.length == 0) return new String[0];\n String[] sorted = new String[words.length];\n\n int minScore = -1; //minScore(words[0]);\n int currentIndex = 1;\n int index = 0;\n\n getMinScoreWordIndex(words, minScore);\n\n System.out.println(tracker);\n while(currentIndex <= tracker.size()){\n\n\n System.out.println(tracker.get(index));\n \n sorted[index] = words[tracker.get(index)];\n\n index++;\n currentIndex++;\n// tracker.clear();\n }\n\n return sorted;\n }",
"public String[] topHotWords( int count ){\r\n //If the number put in the arguments is greater than the number of distinct hotwords\r\n //in the document, limit it to distinctCount\r\n if (count > distinctCount()){\r\n count = distinctCount();\r\n }\r\n //Creating the array that will hold all the hotwords in order of number of appearances \r\n String[] topWord = new String[words.size()];\r\n //This is the subset of the array above that will return the amount specified by the count argument\r\n String[] output = new String[count];\r\n //Fills the array with blank strings\r\n Arrays.fill(topWord, \"\");\r\n //Iterator for moving through topWord for assignment\r\n int iterator = 0;\r\n //Loop through every hotword in words and puts those words in topWord\r\n for(String key: words.keySet()){\r\n topWord[iterator] = key;\r\n iterator++;\r\n }\r\n //Sorts the words in topword\r\n for(int i = 0; i < words.size(); i++){\r\n for(int j = words.size()-1; j > 0; j-- ){\r\n \r\n if(count(topWord[j]) > count(topWord[i])){\r\n String temp = topWord[i];\r\n topWord[i] = topWord[j];\r\n topWord[j] = temp;\r\n }\r\n \r\n }\r\n }\r\n //Does a secondary check to be certain all words are in proper appearance number order\r\n for(int i = words.size()-1; i >0; i--){\r\n if(count(topWord[i]) > count(topWord[i-1])){\r\n String temp = topWord[i];\r\n topWord[i] = topWord[i-1];\r\n topWord[i-1] = temp;\r\n }\r\n }\r\n //Orders the words with the same number of appearances by order of appearance in the document\r\n for (int i = 0; i < words.size(); i++){\r\n for(int j = i+1; j < words.size(); j++){\r\n if (count(topWord[i]) == count(topWord[j])){\r\n if (consec.indexOf(topWord[j]) < consec.indexOf(topWord[i])){\r\n String temp = topWord[i];\r\n topWord[i] = topWord[j];\r\n topWord[j] = temp;\r\n }\r\n }\r\n }\r\n }\r\n //Gets the subset requested for return\r\n for (int i = 0; i < count; i++){\r\n output[i] = topWord[i];\r\n }\r\n return output;\r\n\t}",
"@Override\n public void execute(Tuple tuple) {\n\t String word = tuple.getStringByField(\"word\");\n\t Integer count = tuple.getIntegerByField(\"count\");\n\n\t if (_topNMap.size() < _n) {\n\t \t//add word and count if less than N elements in top N\n\t \t_topNMap.put(word, count);\n\t } else {//if (_topNMap.size() > _n) {\n\t\tfor (String w : _topNMap.keySet()) {\n\t\t\tInteger c = _topNMap.get(w);\n\t\t\tif (_topNTreeMap.get(c) == null || _topNTreeMap.get(c).compareTo(w) < 0) {\n\t\t\t\t_topNTreeMap.put(c, w);\n\t\t\t}\n\t\t}\n\t\tInteger minCount = _topNTreeMap.firstKey();\n\t\tString minWord = _topNTreeMap.get(minCount);\n\t \tif (count > minCount) {\n\t\t\t_topNMap.remove(minWord);\n\t\t\t_topNMap.put(word, count);\n\t\t} else if (count == minCount && word.compareTo(minWord) > 0) {\n\t\t\t_topNMap.remove(minWord);\n\t\t\t_topNMap.put(word, count);\n\t\t}\n\t\t_topNTreeMap.clear();\n\t\t \n\t\tString topNList = \"\";\n\t\tint c = 0;\n\t \tfor (String key : _topNMap.keySet()) {\n\t\t\ttopNList += key + \", \";\n\t\t\tc++;\n\t \t}\n\t \ttopNList = topNList.substring(0, topNList.length() - 2);\n\t \tif (c == _n) {\n\t \t\tcollector.emit(new Values(\"top-N\", topNList));\n\t \t}\n\t }\n }",
"public HashMap<String, Integer> getOrder(){\n\t\t\n\t\tHashMap<String, Integer> hm2 = getHashMap();\n\t\n\t\tArrayList fq = new ArrayList<>();\n\t\t\n\t\tHashMap<String, Integer> top10 = new HashMap<String, Integer>();\n\t\t\n\t\tfor(String key : hm2.keySet()){\n\t\t\t\n\t\t\tfq.add(hm2.get(key));\n\t\t}\n\t\t// use Collection to get the order of frequency\n\t\tCollections.sort(fq);\n \tCollections.reverse(fq);\n \t\n \tfor(int i = 0; i<11; i++){\n \t\t\n \t\tfor(String key : hm2.keySet()){\n \t\t// make sure the word not equals to balck space\n \t\tif(hm2.get(key) == fq.get(i) && !key.equals(\"\") ){\n \t\t\t\n \t\t top10.put(key, hm2.get(key));\n \t\t\t\t\n \t\t}\n \t}\t\n\t}\n\t\treturn top10;\n\t}",
"public void apply(GlobalWindow window, Iterable<String> values, \n Collector<Tuple2<String,Integer>> out) throws Exception {\n \t HashMap <String,Integer> countWord = new HashMap<String,Integer>();\n \n for (String value : values) {\n \t \n \t String[] tokens = value.toLowerCase().split(\"\\\\W+\");\n \t for (String token : tokens)\n \t {\t if (token.length() >0) {\n \t\t if (countWord.get(token) != null)\n { countWord.put(token, countWord.get(token)+1);}\n else\n {countWord.put(token, 1);}\n \t }\n \t\t \n \t }\n }\n \n \n //Comparator to sort in reverse\n \t\t\tComparator<String> comparator = new Comparator<String>() {\n \t\t\t public int compare(String o1, String o2) {\n \t\t\t return countWord.get(o1).compareTo(countWord.get(o2));\n \t\t\t }\n \t\t\t};\n\n \t\t\tArrayList<String> words = new ArrayList<String>();\n \t\t\twords.addAll(countWord.keySet());\n\n \t\t\tCollections.sort(words,comparator);\n \t\t\tCollections.reverse(words);\n \t\t\t\n// System.out.println(Arrays.asList(words));\n \t\t\tSystem.out.println(\"10 most frequent words per stream\");\n System.out.println(\"-----------\");\n \n for(int i = 0; i < 10; i++) {\n \tSystem.out.println(words.get(i) + \" : \" + countWord.get(words.get(i)));\n }\n \n \n System.out.println(\"\\n\");\n \n }",
"static List<String> topToys (int numToys, int topToys, List<String> toys, int numQuotes, List<String> quotes) {\n Map<String, List<Integer>> map = new HashMap<>();\n //Step 2: Put all the toys in hashmap with count 0\n for (String toy : toys) {\n map.put(toy, new ArrayList<>(Arrays.asList(0,0)));\n }\n //Collections.addAll(toys);\n //Step 3: split the quotes\n for (String quote :quotes) {\n //Step 3: Create a hashSet for all the toys\n Set<String> hashSet = new HashSet<>();//Fresh for each quote to count how many different quotes does the toy appear\n String[] splitQuote = quote.toLowerCase().split(\"\\\\W+\");//all non-word characters besides[a-z,0-9]\n for (String sq : splitQuote) {\n if (!map.containsKey(sq)) {//this is none of the toy\n //map.get(sq).set(0,1);\n continue;\n }\n else {\n map.get(sq).set(0,map.get(sq).get(0)+1);//increment the first element of list: this is total count of toys appearance\n if (!hashSet.contains(sq)) {\n map.get(sq).set(1,map.get(sq).get(1)+1);//increment the second element of the list: and then added to hash Set.\n //hashSet and index 1 will decide how many quotes the toys did appear\n }\n System.out.println(\"adding this to hashSet-->\"+sq);\n hashSet.add(sq);\n }\n }\n }\n map.forEach((key, value) -> System.out.println(\"Key=\" + key + \" and Value=\" + value));\n PriorityQueue<String> pq = new PriorityQueue<>((t1,t2) ->{\n if (!map.get(t1).get(0).equals(map.get(t2).get(0))) return map.get(t1).get(0)-map.get(t2).get(0);\n if (!map.get(t1).get(1).equals(map.get(t2).get(1))) return map.get(t1).get(1) - map.get(t2).get(1);\n return t1.compareTo(t2);\n });\n if (topToys > numToys) {\n for (String toy : map.keySet()) {\n if (map.get(toy).get(0)>0) pq.add(toy);\n }\n }\n else {\n for (String toy: toys) {\n pq.add(toy);\n if (pq.size() > topToys) pq.poll();\n }\n }\n List<String> output = new ArrayList<>();\n while (!pq.isEmpty()) {\n output.add(pq.poll());\n }\n Collections.reverse(output);\n return output;\n }",
"public int compareTo(WordCount other)\n {\n return word.compareTo(other.word);\n }",
"public void sortCount() {\n\t\tfor(Entry<String, TreeMap<String, Integer>> entry:map.entrySet()){\r\n\t\t\tTreeMap<String, Integer> tmap = entry.getValue();\r\n\t\t\tList<Entry<String, Integer>> sorttmap = MapSort.sortMapByIntegerValue(tmap);\r\n\t\t\t int flag=0;\r\n for(Entry<String, Integer> word:sorttmap){ \r\n \tflag++;\r\n \tkeyword.add(word.getKey());\r\n// System.out.println(mapping.getKey()+\":\"+mapping.getValue()); \r\n \tif(flag==5)\r\n \t\tbreak;\r\n } \r\n\t\t}\r\n\t\r\n\t}",
"@Override\n public int compareTo(Word other){\n int value = other.Count()-this.Count();\n if (value == 0) return 1;\n return value;\n }",
"public static WordFrq[] sort(WordFrq b[]){\n WordFrq temp;\n int i=0;\n while (i < 3) {\n for (i = 1; i < 3; i++) {\n if (b[i-1].count > b[i].count) {\n temp = b[i];\n b[i] = b[i-1];\n b[i-1] = temp;\n break;\n }\n }\n }\n\n\n return b;\n\n\n\n\n\n }",
"public static void main(String[] args) throws FileNotFoundException {\n\t\t\n\t\tint currentHash = 0; /* will be changed in the while loop to store the hash code for current word*/\n\t\tString currentWord; /* will be changed in the while loop to store the current word*/\n\t\t\n\t\tChainHashMap<myString, Integer> wordFrequency = new ChainHashMap<myString, Integer>(500); /* create the chain hash map with the size of 500; there is 500 buckets in the map*/\n\t\t\n\t\t\n\t\tFile file = new File(\"/Users/Jacob/Downloads/shakespeare.txt\");\n\t\t/*please notice that the file cannot be found on the address given above, change it to test if it works!*/\n\t\tScanner input = new Scanner(file); /* should be changed to file after debugging*/\n\t\t\n\t\t\n\t\twhile(input.hasNext()){\n\t\t\tcurrentWord = input.next();\n\t\t\t\n\t\t\twhile(currentWord.equals(\".\") || currentWord.equals(\",\") || currentWord.equals(\"!\") || currentWord.equals(\"?\") || currentWord.equals(\";\") || currentWord.equals(\":\")){\n\t\t\t\tif(input.hasNext()){\n\t\t\t\t\tcurrentWord = input.next();\n\t\t\t\t}else{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tmyString wordString = new myString(currentWord);\n\t\t\t\n\t\t\tif(wordFrequency.get(wordString) == null){\n\t\t\t\t\n\t\t\t\twordFrequency.put(wordString, 1); /* the key is the string and the value should be the word frequency*/\n\t\t\t}else{\n\n\t\t\t\twordFrequency.put(wordString, wordFrequency.get(wordString) + 1); /* if the key is already in the map, increment the word frequency by 1*/\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t/* till this point, all the work of Shakespeare have been stored in the chained hash map*/\n\t\t/* the heap is used to get the top 1000 frequent work*/\n\t\t/* it adds the element to the heap and when the size of the heap reaches 1000, the word with the lowest will be removed, which is the root of the heap*/\n\t\t/* the two element in the entry for the heap should be exchanged; the key should store the frequencies and the the value should be the string */\n\t\t\n\t\tHeapAdaptablePriorityQueue<Integer, String> frequencyHeap = new HeapAdaptablePriorityQueue<Integer, String>();\n\t\t\n\t\tfor(Entry<myString, Integer> word: wordFrequency.entrySet()){\n\t\t\tint currentFrequency = word.getValue(); /* store the value of the entry in the chain hash map, will be used as the key for the heap*/\n\t\t\tString currentString = word.getKey()._word; /* store the string in the key of the entry of the chain hash map, will be used as the value for the heap*/\n\t\t\t\n\t\t\tfrequencyHeap.insert(currentFrequency, currentString);\n\t\t\t\n\t\t\tif(frequencyHeap.size() > 1000){\t\t\t\t\n\t\t\t\tfrequencyHeap.removeMin(); /* keep the heap size fixed at 1000; remove the minimum in the heap if the size exceeds 1000*/\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* till now, all the entries has been stored in the heap*/\n\t\t/* get the minimum value and key (the frequency and the corresponding word), then remove the minimum from the heap*/\n\t\t/* the data is stored in the excel form; the screen shot is provided in the document*/\n\t\t\n\t\twhile(frequencyHeap.size() > 0){\n\t\t\tSystem.out.println(frequencyHeap.min().getValue()); /* get the word from the ascending order of the frequency*/\n\t\t\tSystem.out.println(frequencyHeap.min().getKey()); /* get the frequency of the word*/\n\t\t\t\n\t\t\tfrequencyHeap.removeMin();\n\t\t}\n\n\t\t\n\t}",
"@Override\n\tpublic int compare(Object arg0, Object arg1) {\n\t\tWordCount wc1 = (WordCount) arg0;\n\t\tWordCount wc2 = (WordCount) arg1;\n\t\t\n\t\tif(wc1.count > wc2.count){\n\t\t\treturn -1;\n\t\t}\n\t\telse if(wc1.count < wc2.count){\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}",
"private static String frequencySort(String s) {\n if (s == null || s.isEmpty()) { return s; }\n\n int[] freq = new int[256];\n for (char c : s.toCharArray()) {\n freq[c]++;\n }\n\n PriorityQueue<Pair<Character, Integer>> pq = new PriorityQueue<>((a, b) -> b.getValue() - a.getValue());\n for (int i = 0; i < freq.length; i++) {\n if (freq[i] == 0) { continue; }\n Pair<Character, Integer> pair = new Pair<>((char) (i), freq[i]);\n pq.offer(pair);\n }\n\n StringBuilder sb = new StringBuilder();\n while (!pq.isEmpty()) {\n Pair<Character, Integer> pair = pq.poll();\n for (int i = 0; i < pair.getValue(); i++) {\n sb.append(pair.getKey());\n }\n }\n return sb.toString();\n }",
"public static void main(String[] args) {\n\t\tint[] i = new int[100];\n\t\tint unique = 0;\n\t\tfloat ratio = 0;\n\t\tList<String> inputWords = new ArrayList<String>();\n\t\tMap<String,List<String>> wordcount = new HashMap<String,List<String>>();\n\t\ttry{\n\t\t\tBufferedReader in = new BufferedReader(new FileReader(\"/Users/huziyi/Documents/NLP file/Assignment1/Twitter messages.txt\"));\n\t\t\tString str;\n\t\t\twhile((str = in.readLine())!=null){\n\t\t\t\tstr = str.toLowerCase();\n\t\t\t\t\n\t\t\t\tString[] words = str.split(\"\\\\s+\");\n\t\t\t\t\n\t\t\t//\tSystem.out.println(words);\n\t\t\t//\tSystem.out.println(\"1\");\n\t\t\t\tfor(String word:words){\n\t\t\t\t\t\n\t\t\t//\t\tString word = new String();\n\t\t\t\t\t\n\t\t\t\t\tword = word.replaceAll(\"[^a-zA-Z]\", \"\");\n\t\t\t\t\tinputWords.add(word);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e){\n\t\t\tSystem.out.println(e);\n\t\t}\n\t\tfor(int k=0;k<inputWords.size()-1;k++){\n\t\t\tString thisWord = inputWords.get(k);\n\t\t\tString nextWord = inputWords.get(k+1);\n\t\t\tif(!wordcount.containsKey(thisWord)){\n\t\t\t\twordcount.put(thisWord, new ArrayList<String>());\n\t\t\t}\n\t\t\twordcount.get(thisWord).add(nextWord);\n\t\t}\n\t\t for(Entry e : wordcount.entrySet()){\n\t// System.out.println(e.getKey());\n\t\tMap<String, Integer>count = new HashMap<String, Integer>();\n List<String>words = (List)e.getValue();\n for(String s : words){\n if(!count.containsKey(s)){\n count.put(s, 1);\n }\n else{\n count.put(s, count.get(s) + 1);\n }\n }\n \t\n // for(Entry e1 : wordcount.entrySet()){\n for(Entry f : count.entrySet()){\n \n // \tint m = 0;\n //\tint[] i = new int[100];\n //\ti[m] = (Integer) f.getValue();\n \tint n = (Integer) f.getValue();\n \tn = (Integer) f.getValue();\n // \tList<String> values = new ArrayList<String>();\n \t\t// values.addAll(count.g());\n \tif(n>=120){\n \tif(!(e.getKey().equals(\"\"))&&!(f.getKey().equals(\"\"))){\n //\t\t int a = (Integer) f.getValue();\n //\t\t Arrays.sort(a);\n System.out.println(e.getKey()+\" \"+f.getKey() + \" : \" + f.getValue());\n \n \t}\n \t}\n //\tm++;\n \t }\n\t\t }\n\t\t \n\t\n\t\t \n\t\t// Arrays.sort(i);\n\t\t //System.out.println(i[0]+i[1]);\n/*\n\t\t ArrayList<String> values = new ArrayList<String>();\n\t\t values.addAll(count.values());\n\n\t\t Collections.sort(values, Collections.reverseOrder());\n\n\t\t int last_i = -1;\n\n\t\t for (Integer i : values.subList(0, 99)) { \n\t\t if (last_i == i) \n\t\t continue;\n\t\t last_i = i;\n\n\n\n\n\t\t for (String s : wordcount.keySet()) { \n\n\t\t if (wordcount.get(s) == i)\n\t\t \n\t\t \tSystem.out.println(s+ \" \" + i);\n\n\t\t }\n\t\t \n\t\t\t}*/\n\t}",
"public void sortWordTokens (String [] list, int count){\n \n String[] sortedWordsCopy = new String[count];\n \n \n //Makes a copy of list and stores it in sortedWordsCopy\n for (int i = 0; i < count; i++)\n sortedWordsCopy[i] = list[i];\n \n //Sorts sortedWordsCopy which is a copy of list\n Arrays.sort(sortedWordsCopy);\n \n //Copies the sorted list back out to list\n for (int i = 0; i < count; i++)\n list[i] = sortedWordsCopy[i];\n \n }",
"public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }",
"public void sort()\n {\n\tstrack.sort((Node n1, Node n2) ->\n\t{\n\t if (n1.getCost() < n2.getCost()) return -1;\n\t if (n1.getCost() > n2.getCost()) return 1;\n\t return 0;\n\t});\n }",
"public static List<String> topKFrequent_pq_opt(String[] words, int k) {\n Map<String, Integer> countMap = new HashMap<>();\n for (String word : words) {\n countMap.put(word, countMap.getOrDefault(word, 0) + 1);\n }\n\n PriorityQueue<String> pq = new PriorityQueue<String>((word1, word2) -> {\n if (countMap.get(word1).equals(countMap.get(word2))) {\n return word1.compareTo(word2);\n }\n return countMap.get(word2) - countMap.get(word1);\n });\n\n for (String word : countMap.keySet()) {\n pq.offer(word);\n }\n\n List<String> ans = new ArrayList<>();\n for (int i = 0; i < k; i++) {\n ans.add(pq.poll());\n }\n\n return ans;\n }",
"public List<DictionaryData> frequencyOrderedList() {\n List<DictionaryData> wordlist = alphabeticalList();\r\n\r\n //using insertion sort\r\n int j;\r\n DictionaryData k;\r\n for (int i = 1; i < wordlist.size(); i++) {\r\n j = i;\r\n\r\n while (j > 0 && compare_dictdata(wordlist.get(j), wordlist.get(j - 1))) {\r\n k = wordlist.get(j);\r\n wordlist.set(j, wordlist.get(j - 1));\r\n wordlist.set(j - 1, k);\r\n j--;\r\n\r\n }\r\n //i++;\r\n }\r\n return wordlist;\r\n }",
"public static List<String> topKFrequent_pq(String[] words, int k) {\n Map<String, Integer> countMap = new HashMap<>();\n for (String word : words) {\n countMap.put(word, countMap.getOrDefault(word, 0) + 1);\n }\n\n PriorityQueue<String> pq = new PriorityQueue<String>((word1, word2) -> {\n if (countMap.get(word1) == countMap.get(word2)) {\n return word2.compareTo(word1);\n }\n return countMap.get(word1) - countMap.get(word2);\n });\n\n for (String word : countMap.keySet()) {\n pq.offer(word);\n if (pq.size() > k) {\n pq.poll();\n }\n }\n\n List<String> ans = new ArrayList<>();\n while (!pq.isEmpty()) {\n ans.add(pq.poll());\n }\n Collections.reverse(ans);\n return ans;\n }",
"public static void main(String[] args) {\n\n\t\tList<String> list = Arrays.asList(\"I\", \"Love\", \"Word\", \"I\", \"Love\");\n\t\tMap<String, Long> map = list.stream()\n\t\t\t\t.collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));\n\t\t//map.entrySet().stream().sorted(Comparator.(Entry.comparingByValue()).thenComparing(Entry.comparingByKey()))\n\t\t// I - 2, \"Word\" -1, \"Love\"- 2\n\t\t\n\t}",
"private String getWordStatsFromList(List<String> wordList) {\n\t\tif (wordList != null && !wordList.isEmpty()) {\n\t\t\tList<String> wordsUsedCaps = new ArrayList<>(); \n\t\t\tList<String> wordsExcludedCaps = new ArrayList<>(); \n\t\t\tListIterator<String> iterator = wordList.listIterator();\n\t\t\tMap<String, Integer> wordToFreqMap = new HashMap<>();\n\t\t\t// iterate on word List using listIterator to enable edits and removals\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tString origWord = iterator.next();\n\t\t\t\t// remove quotes from word e.g. change parents' to parents; \n\t\t\t\t// change children's to children; change mark'd to mark\n\t\t\t\tString curWord = stripQuotes(origWord);\n\t\t\t\tif (!curWord.equals(origWord)) {\n\t\t\t\t\titerator.set(curWord);\n\t\t\t\t}\n\t\t\t\tString curWordCaps = curWord.toUpperCase();\n\t\t\t\t// remove words previously used (to prevent duplicates) or previously\n\t\t\t\t// excluded (compare capitalized version)\n\t\t\t\tif (wordsExcludedCaps.contains(curWordCaps)) {\n\t\t\t\t\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse if (wordsUsedCaps.contains(curWordCaps)) {\n\t\t\t\t\t// if word was previously used then update wordToFreqMap to increment\n\t\t\t\t\t// its usage frequency\n\t\t\t\t\tSet<String> wordKeys = wordToFreqMap.keySet();\n\t\t\t\t\tfor (String word : wordKeys) {\n\t\t\t\t\t\tif (curWord.equalsIgnoreCase(word)) {\n\t\t\t\t\t\t\twordToFreqMap.put(word, wordToFreqMap.get(word).intValue() + 1);\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\titerator.remove();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// invoke checkIfEligible() with algorithm described in Challenge 2 to see if word not\n\t\t\t\t\t// previously used/excluded should be kept. If kept in list \n\t\t\t\t\t// then add to wordsUsedCaps list; if not qualified then add to\n\t\t\t\t\t// wordsExcludedCaps list to prevent checkIfEligible() having to be \n\t\t\t\t\t// called again\n\t\t\t\t\tif (checkIfEligible(curWordCaps)) {\n\t\t\t\t\t\twordsUsedCaps.add(curWordCaps);\n\t\t\t\t\t\twordToFreqMap.put(curWord, 1);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\twordsExcludedCaps.add(curWordCaps);\n\t\t\t\t\t\titerator.remove();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// sort words in list in order of length\n\t\t\twordList.sort(Comparator.comparingInt(String::length));\n\t\t\t// sort wordToFreqMap by value (frequency) and choose the last sorted map element\n\t\t\t// to get most frequently used word\n\t\t\tList<Map.Entry<String, Integer>> mapEntryWtfList = new ArrayList<>(wordToFreqMap.entrySet());\n\t\t\tmapEntryWtfList.sort(Map.Entry.comparingByValue());\n\t\t\tMap<String, Integer> sortedWordToFreqMap = new LinkedHashMap<>();\n\t\t\tsortedWordToFreqMap.put(mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey(), mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\t\n\t\t\t// set up Json object to be returned as string\n\t\t\t// the code below is self-explaining\n\t\t\tJSONObject json = new JSONObject();\n\t\t\ttry {\n\t\t\t\tjson.put(\"remaining words ordered by length\", wordList);\n\t\t\t\tjson.put(\"most used word\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getKey());\n\t\t\t\tjson.put(\"number of uses\", mapEntryWtfList.get(mapEntryWtfList.size()-1).getValue());\n\t\t\t} catch(JSONException je) {\n\t\t\t\tje.printStackTrace();\n\t\t\t}\n\t\t\treturn json.toString();\n\t\t\t\n\t\t}\n\t\treturn \"\";\n\t}",
"@Override\n\tpublic int compareTo(PQueueNode arg) {\n\t\treturn this.word.compareTo(arg.getWord());\n\t}",
"private List<StringCountDto> getSortedStatistics() {\n return STRING_STATISTICS.entrySet()\n .stream()\n .sorted(Map.Entry.<String, CounterInfo>comparingByValue().reversed())\n .map(entry -> new StringCountDto(entry.getKey(), entry.getValue().getCount()))\n .collect(Collectors.toList());\n }",
"private static SortingMachine<Pair<String, Integer>> sortWords(\n Map<String, Integer> words, int numberOfWords) {\n AlphabeticalComparator stringComp = new AlphabeticalComparator();\n IntComparator intComp = new IntComparator();\n\n SortingMachine<Pair<String, Integer>> intMachine = new SortingMachine1L<>(\n intComp);\n SortingMachine<Pair<String, Integer>> stringMachine = new SortingMachine1L<>(\n stringComp);\n\n for (Map.Pair<String, Integer> pair : words) {\n intMachine.add(pair);\n }\n\n intMachine.changeToExtractionMode();\n\n for (int i = 0; i < numberOfWords; i++) {\n Pair<String, Integer> pair = intMachine.removeFirst();\n System.out.println(pair);\n stringMachine.add(pair);\n }\n\n stringMachine.changeToExtractionMode();\n\n return stringMachine;\n }",
"public static List<String> sortUniqueWords(HashMap<String, Integer> tracker, List<String> allWords) {\n List<Integer> frequency = new ArrayList<>(tracker.values());\n frequency.sort(Collections.reverseOrder());\n List<String> result = new ArrayList<>();\n\n while(!tracker.isEmpty()){\n for (String key : allWords) {\n if(frequency.size()!= 0 && frequency.get(0) == tracker.get(key)){\n frequency.remove(0);\n\n result.add(key + \" \" + tracker.get(key));\n tracker.remove(key);\n }\n\n }\n }\n return result;\n\n\n }",
"public static void main(String[] args){\n \tunsortedWords = new ArrayList<String>();\n sortedWords = new ArrayList<String>();\n \ttry{\n \t\tInputStreamReader in = new InputStreamReader(System.in);\n \t\tBufferedReader input = new BufferedReader(in);\n \t\talphabetString = input.readLine();\n \t\tif (alphabetString == null || alphabetString == \"\"){\n \t\t\tthrow new IllegalArgumentException();\n \t\t}\n\n \t\tstr = input.readLine();\n if (str == null || str == \"\"){\n throw new IllegalArgumentException();\n }\n \n \t\twhile (str != null){\n \t\t\tunsortedWords.add(str);\n \t\t\tstr = input.readLine();\n numberOfWords += 1;\n \t\t}\n\n\n\n \t}\n \tcatch (IOException io){\n \t\tSystem.out.println(\"There are no words given\");\n \t\tthrow new IllegalArgumentException();\n\n \t}\n\n alphabetMap = new HashMap<String, Integer>();\n String[] alphabetLetters = alphabetString.split(\"\");\n \tint j = 0;\n \tString letter;\n \t// String[] alphabetLetters = alphabetString.split(\"\");\n \twhile (j < alphabetLetters.length){\n letter = alphabetLetters[j];\n if (alphabetString.length() - alphabetString.replace(letter, \"\").length() > 1) {\n System.out.println(letter);\n throw new IllegalArgumentException();\n }\n alphabetMap.put(alphabetLetters[j], j);\n j += 1;\n }\n //for checking the last value something is in the outputed list. \n lastArrayIndex = 0;\n\n //sorts words\n int k = 0;\n String chosenWord;\n while (k < unsortedWords.size()){\n chosenWord = unsortedWords.get(k);\n sorting(chosenWord, sortedWords);\n k += 1; \n }\n\n //prints words\n int l = 0;\n String printedWord;\n while (l < sortedWords.size()){\n printedWord = sortedWords.get(l);\n System.out.println(printedWord);\n l += 1;\n }\n\n\n \t//making the trie\n // usedTrie = makeATrie(unsortedWords);\n\n //printing out the order\n // recursiveAlphabetSorting(usedTrie, \"\", alphabetString);\n\n\n }",
"public String frequencySort(String s) {\n\n\t\t// prepare a frequency map\n\t\tMap<Character, Integer> m = new HashMap<Character, Integer>();\n\t\tfor (char c : s.toCharArray())\n\t\t\tm.put(c, m.getOrDefault(c, 0) + 1);\n\n\t\tPriorityQueue<CKEntry1> pq = new PriorityQueue<>();\n\t\tfor (Entry<Character, Integer> e : m.entrySet()) {\n\t\t\tpq.add(new CKEntry1(e.getKey(), e.getValue()));\n\t\t}\n\t\t\n\t\t// prepare the output now\n\t\tStringBuilder sb = new StringBuilder();\n\t\twhile(!pq.isEmpty()) {\n\t\t\tCKEntry1 temp = pq.poll();\n\t\t\tchar[] tempC = new char[temp.count];\n\t\t\tArrays.fill(tempC, temp.c); // repeat c count' times\n\t\t\tsb.append(tempC);\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\n\t}",
"public void setPriorityQueue() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tif (leafEntries[i].getFrequency() > 0)\n\t\t\t\tpq.add(new BinaryTree<HuffmanData>(leafEntries[i]));\n\t\t}\n\t}",
"public void sortByTagCount() {\r\n this.addSortField(\"\", \"*\", SORT_DESCENDING, \"count\");\r\n }",
"public void updatePriority() {//determines todays suggestion and updats queue\n\t\t \n\t\t if(newUser == true) {\n\t\t\t System.out.println(\"NEW USER\");\n\t\t\t int count = 14;\n\t\t\t \n\t\t\t if(getLikesAmerican() == \"Yes\") {\n\t\t\t\t AmericanPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t AmericanPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesAsian() == \"Yes\") {\n\t\t\t\t AsianPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t AsianPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesBakery() == \"Yes\") {\n\t\t\t\t BakeryPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t BakeryPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesBar() == \"Yes\") {\n\t\t\t\t BarPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t BarPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesBreakfast() == \"Yes\") {\n\t\t\t\t BreakfastPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t BreakfastPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesCafe() == \"Yes\") {\n\t\t\t\t CafePriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t CafePriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesCaribbean() == \"Yes\") {\n\t\t\t\t CaribbeanPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t CaribbeanPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesChicken() == \"Yes\") {\n\t\t\t\t ChickenPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t ChickenPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesEuropean() == \"Yes\") {\n\t\t\t\t EuropeanPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t EuropeanPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesFastFood() == \"Yes\") {\n\t\t\t\t FastFoodPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t FastFoodPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesHealthFood() == \"Yes\") {\n\t\t\t\t HealthFoodPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t HealthFoodPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesLatinAmerican() == \"Yes\") {\n\t\t\t\t LatinAmericanPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t LatinAmericanPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesPizza() == \"Yes\") {\n\t\t\t\t PizzaPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t PizzaPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesSandwich() == \"Yes\") {\n\t\t\t\t SandwichPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t SandwichPriority = -99;\n\t\t\t }\n\t\t\t \n\t\t\t if(getLikesSeafood() == \"Yes\") {\n\t\t\t\t SeafoodPriority = count;\n\t\t\t\t count--;\n\t\t\t }else {\n\t\t\t\t SeafoodPriority = -99;\n\t\t\t }\n\t\t\t\n\t\t }\n\t\t else {\n\t\t\t System.out.println(\"CURRENT USER\");\n\t\t\t int i = GenerateRandom(12, 14);\n\t\t\t int min = 14-yesCount();\n\t\t\t \n\t\t\t if(AmericanPriority == i) {\n\t\t\t\t todaySuggestion = \"American\";\n\t\t\t\t AmericanPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(AsianPriority == i) {\n\t\t\t\t todaySuggestion = \"Asian\";\n\t\t\t\t AsianPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(BakeryPriority == i) {\n\t\t\t\t todaySuggestion = \"Bakery\";\n\t\t\t\t BakeryPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(BarPriority == i) {\n\t\t\t\t todaySuggestion = \"Bar\";\n\t\t\t\t BarPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(BreakfastPriority == i) {\n\t\t\t\t todaySuggestion = \"Breakfast\";\n\t\t\t\t BreakfastPriority = min;\n\t\t\t }\n\n\t\t\t if(CafePriority == i) {\n\t\t\t\t todaySuggestion = \"Cafe\";\n\t\t\t\t CafePriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(CaribbeanPriority == i) {\n\t\t\t\t todaySuggestion = \"Caribbean\";\n\t\t\t\t CaribbeanPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(ChickenPriority == i) {\n\t\t\t\t todaySuggestion = \"Chicken\";\n\t\t\t\t ChickenPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(EuropeanPriority == i) {\n\t\t\t\t todaySuggestion = \"European \";\n\t\t\t\t EuropeanPriority = min;\n\t\t\t }\n\n\t\t\t if(FastFoodPriority == i) {\n\t\t\t\t todaySuggestion = \"Fast Food\";\n\t\t\t\t FastFoodPriority = min;\n\t\t\t }\n\n\t\t\t if(HealthFoodPriority == i) {\n\t\t\t\t todaySuggestion = \"Health food\";\n\t\t\t\t HealthFoodPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(LatinAmericanPriority == i) {\n\t\t\t\t todaySuggestion = \"Latin American\";\n\t\t\t\t LatinAmericanPriority = min;\n\t\t\t }\n\n\t\t\t if(PizzaPriority == i) {\n\t\t\t\t todaySuggestion = \"Pizza\";\n\t\t\t\t PizzaPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(SandwichPriority == i) {\n\t\t\t\t todaySuggestion = \"Sandwich\";\n\t\t\t\t SandwichPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t if(SeafoodPriority == i) {\n\t\t\t\t todaySuggestion = \"Seafood\";\n\t\t\t\t SeafoodPriority = min;\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t if(i == 14) {//update everything -99<x +1\n\t\t\t\t if(AmericanPriority > -50) {\n\t\t\t\t\t AmericanPriority++;\n\t\t\t\t }\n\t\t\t\t if(AsianPriority > -50) {\n\t\t\t\t\t AsianPriority++;\n\t\t\t\t }\n\t\t\t\t if(BakeryPriority > -50) {\n\t\t\t\t\t BakeryPriority++;\n\t\t\t\t }\n\t\t\t\t if(BarPriority > -50) {\n\t\t\t\t\t BarPriority++;\n\t\t\t\t }\n\t\t\t\t if(BreakfastPriority > -50) {\n\t\t\t\t\t BreakfastPriority++;\n\t\t\t\t }\n\t\t\t\t if(CafePriority > -50) {\n\t\t\t\t\t CafePriority++;\n\t\t\t\t }\n\t\t\t\t if(CaribbeanPriority > -50) {\n\t\t\t\t\t CaribbeanPriority++;\n\t\t\t\t }\n\t\t\t\t if(ChickenPriority > -50) {\n\t\t\t\t\t ChickenPriority++;\n\t\t\t\t }\n\t\t\t\t if(EuropeanPriority > -50) {\n\t\t\t\t\t EuropeanPriority++;\n\t\t\t\t }\n\t\t\t\t if(FastFoodPriority > -50) {\n\t\t\t\t\t FastFoodPriority++;\n\t\t\t\t }\n\t\t\t\t if(HealthFoodPriority > -50) {\n\t\t\t\t\t HealthFoodPriority++;\n\t\t\t\t }\n\t\t\t\t if(LatinAmericanPriority > -50) {\n\t\t\t\t\t LatinAmericanPriority++;\n\t\t\t\t }\n\t\t\t\t if(PizzaPriority > -50) {\n\t\t\t\t\t PizzaPriority++;\n\t\t\t\t }\n\t\t\t\t if(SandwichPriority > -50) {\n\t\t\t\t\t SandwichPriority++;\n\t\t\t\t }\n\t\t\t\t if(SeafoodPriority > -50) {\n\t\t\t\t\t SeafoodPriority++;\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\tif(i == 13) {//update everything -99<x<13 +1\n\t\t\t\t if(AmericanPriority > -50 && AmericanPriority < 13) {\n\t\t\t\t\t AmericanPriority++;\n\t\t\t\t }\n if(AsianPriority > -50 && AsianPriority < 13) {\n\t\t\t\t\t AsianPriority++;\n\t\t\t\t }\n if(BakeryPriority > -50 && BakeryPriority < 13) {\n\t\t\t\t\t BakeryPriority++;\n\t\t\t\t }\n if(BarPriority > -50 && BarPriority < 13) {\n\t\t\t\t\t BarPriority++;\n\t\t\t\t }\n if(BreakfastPriority > -50 && BreakfastPriority < 13) {\n\t\t\t\t\t BreakfastPriority++;\n\t\t\t\t }\n if(CafePriority > -50 && CafePriority < 13) {\n\t\t\t\t\t CafePriority++;\n\t\t\t\t }\n if(CaribbeanPriority > -50 && CaribbeanPriority < 13) {\n\t\t\t\t\t CaribbeanPriority++;\n\t\t\t\t }\n if(ChickenPriority > -50 && ChickenPriority < 13) {\n\t\t\t\t\t ChickenPriority++;\n\t\t\t\t }\n if(EuropeanPriority > -50 && EuropeanPriority < 13) {\n\t\t\t\t\t EuropeanPriority++;\n\t\t\t\t }\n if(FastFoodPriority > -50 && FastFoodPriority < 13) {\n\t\t\t\t\t FastFoodPriority++;\n\t\t\t\t }\n if(HealthFoodPriority > -50 && HealthFoodPriority < 13) {\n\t\t\t\t\t HealthFoodPriority++;\n\t\t\t\t }\n if(LatinAmericanPriority > -50 && LatinAmericanPriority < 13) {\n\t\t\t\t\t LatinAmericanPriority++;\n\t\t\t\t }\n if(PizzaPriority > -50 && PizzaPriority < 13) {\n\t\t\t\t\t PizzaPriority++;\n\t\t\t\t }\n if(SandwichPriority > -50 && SandwichPriority < 13) {\n\t\t\t\t\t SandwichPriority++;\n\t\t\t\t }\n if(SeafoodPriority > -50 && SeafoodPriority < 13) {\n\t\t\t\t\t SeafoodPriority++;\n\t\t\t\t }\n\t\t\t }\n\n if(i == 12){//update everything -99<x<12 +1\n\t\t if(AmericanPriority > -50 && AmericanPriority < 12) {\n\t\t\t\t\t AmericanPriority++;\n\t\t\t\t }\n if(AsianPriority > -50 && AsianPriority < 12) {\n\t\t\t\t\t AsianPriority++;\n\t\t\t\t }\n if(BakeryPriority > -50 && BakeryPriority < 12) {\n\t\t\t\t\t BakeryPriority++;\n\t\t\t\t }\n if(BarPriority > -50 && BarPriority < 12) {\n\t\t\t\t\t BarPriority++;\n\t\t\t\t }\n if(BreakfastPriority > -50 && BreakfastPriority < 12) {\n\t\t\t\t\t BreakfastPriority++;\n\t\t\t\t }\n if(CafePriority > -50 && CafePriority < 12) {\n\t\t\t\t\t CafePriority++;\n\t\t\t\t }\n if(CaribbeanPriority > -50 && CaribbeanPriority < 12) {\n\t\t\t\t\t CaribbeanPriority++;\n\t\t\t\t }\n if(ChickenPriority > -50 && ChickenPriority < 12) {\n\t\t\t\t\t ChickenPriority++;\n\t\t\t\t }\n if(EuropeanPriority > -50 && EuropeanPriority < 12) {\n\t\t\t\t\t EuropeanPriority++;\n\t\t\t\t }\n if(FastFoodPriority > -50 && FastFoodPriority < 12) {\n\t\t\t\t\t FastFoodPriority++;\n\t\t\t\t }\n if(HealthFoodPriority > -50 && HealthFoodPriority < 12) {\n\t\t\t\t\t HealthFoodPriority++;\n\t\t\t\t }\n if(LatinAmericanPriority > -50 && LatinAmericanPriority < 12) {\n\t\t\t\t\t LatinAmericanPriority++;\n\t\t\t\t }\n if(PizzaPriority > -50 && PizzaPriority < 12) {\n\t\t\t\t\t PizzaPriority++;\n\t\t\t\t }\n if(SandwichPriority > -50 && SandwichPriority < 12) {\n\t\t\t\t\t SandwichPriority++;\n\t\t\t\t }\n if(SeafoodPriority > -50 && SeafoodPriority < 12) {\n\t\t\t\t\t SeafoodPriority++;\n\t\t\t\t }\n\t\t\t }\n\t\t\t \n\t\t }\n\t\t \n\t\t \n\t }",
"private static void printMostUsedWords(){\n\t\tMap<String, Integer> words = getWords();\n\t\t\n\t\tString max_count_string[] = new String[3];\n\t\tint max_counts[] = new int[3];\n\t\t\n\t\tfor(String str : words.keySet()){\n\t\t\tint count = words.get(str);\n\t\t\tint index = getMinIndex(max_counts);\n\t\t\t\n\t\t\tif(count > max_counts[index]){\n\t\t\t\tmax_counts[index] = count;\n\t\t\t\tmax_count_string[index] = str;\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* printing top 3 most frequently used words */\n\t\tSystem.out.println(\"top 3 most frequently used words : \");\n\t\tfor(int i=0; i<3; i++){\n\t\t\tSystem.out.println(\"Word : \\\"\" + max_count_string[i] + \"\\\" is used \"+ max_counts[i] +\" times\" );\n\t\t}\n\t\tSystem.out.println();\n\t}",
"IPriorityQueue add(Integer priority, String value);",
"public void score(){\n\t\tscores=new float[3];\n\t\ttop3=new String[3];\n\t\tfor(int i=0;i<3;i++){\n\t\t\ttop3[i]=new String();\n\t\t\tscores[i]=(float)0;\n\t\t}\n\t\t//System.out.println(doclist.size());\n\t\tfor(int i=0;i<doclist.size();i++){\n\t\t\ttry{\n\t\t\t\tDocProcessor dp=new DocProcessor(doclist.get(i));\n\t\t\t\tdp.tokenizing();\n\t\t\t\tdp.stem();\n\t\t\t\t//System.out.println(dp.getContent());\n\t\t\t\t/*for(int j=2;j>=0;j--){\n\t\t\t\t\tSystem.out.println(\"top\"+(3-j)+\": \"+scores[j]);\n\t\t\t\t\tSystem.out.println(top3[j]);\n\t\t\t\t}*/\n\t\t\t\tfloat score=dp.score(this.keywords);\n\t\t\t\tfor(int j=2;j>=0;j--){\n\t\t\t\t\tif(score>scores[j]){\n\t\t\t\t\t\tfor(int k=0;k<j;k++){\n\t\t\t\t\t\t\tscores[k]=scores[k+1];\n\t\t\t\t\t\t\ttop3[k]=top3[k+1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tscores[j]=score;\n\t\t\t\t\t\ttop3[j]=dp.getContent();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*for(int j=2;j>=0;j--){\n\t\t\t\t\tSystem.out.println(\"top\"+(3-j)+\": \"+scores[j]);\n\t\t\t\t\tSystem.out.println(top3[j]);\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"*******************************\");*/\n\t\t\t}catch(NullPointerException f){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t}",
"public void sortByWordLengthAsc() {\r\n\t\tcomparator = new WordLengthAsc();\r\n\t}",
"public static void main(String[] args)\n\t{\n\t\t// data added with the same priority value as already-preasent data, have less\n\t\t// priority than objects with the same priority value that were there before\n\t\t// being added.\n\t\tSystem.out.println(\"Data given all have equal priority so data\\nis ordered by the order it is provided in:\");\n\t\tPriorityQueue<String> q = new PriorityQueue<String>();\n\t\tq.add(\"highest\", 8);\n\t\tq.add(\"second highest\", 8);\n\t\tq.add(\"third highest\", 8);\n\t\tq.add(\"fourth highest\", 8);\n\t\tq.add(\"fifth highest\", 8);\n\t\tq.add(\"least\", 8);\n\t\tSystem.out.println(q.remove());\n\t\tSystem.out.println(q.remove());\n\t\tSystem.out.println(q.remove());\n\t\tSystem.out.println(q.remove());\n\t\tSystem.out.println(q.remove());\n\t\tSystem.out.println(q.remove());\n\n\t\t// sorting data provided in ascending order\n\t\tSystem.out.println(\"-------------\\nData given in ascending priority order:\");\n\t\tPriorityQueue<String> r = new PriorityQueue<String>();\n\t\tr.add(\"one\", 1);\n\t\tr.add(\"two\", 2);\n\t\tr.add(\"three\", 3);\n\t\tr.add(\"four\", 4);\n\t\tr.add(\"five\", 5);\n\t\tr.add(\"six\", 6);\n\t\tSystem.out.println(r.remove());\n\t\tSystem.out.println(r.remove());\n\t\tSystem.out.println(r.remove());\n\t\tSystem.out.println(r.remove());\n\t\tSystem.out.println(r.remove());\n\t\tSystem.out.println(r.remove());\n\n\t\t// sorting data provided in descending order\n\t\tSystem.out.println(\"-------------\\nData given in descending priority order:\");\n\t\tPriorityQueue<String> s = new PriorityQueue<String>();\n\t\ts.add(\"six\", 6);\n\t\ts.add(\"five\", 5);\n\t\ts.add(\"four\", 4);\n\t\ts.add(\"three\", 3);\n\t\ts.add(\"two\", 2);\n\t\ts.add(\"one\", 1);\n\t\tSystem.out.println(s.remove());\n\t\tSystem.out.println(s.remove());\n\t\tSystem.out.println(s.remove());\n\t\tSystem.out.println(s.remove());\n\t\tSystem.out.println(s.remove());\n\t\tSystem.out.println(s.remove());\n\n\t\t// sorting data provided in a mixed order\n\t\tSystem.out.println(\"-------------\\nData given in a mixed priority order:\");\n\t\tPriorityQueue<String> t = new PriorityQueue<String>();\n\t\tt.add(\"four\", 4);\n\t\tt.add(\"six\", 6);\n\t\tt.add(\"two\", 2);\n\t\tt.add(\"three\", 3);\n\t\tt.add(\"one\", 1);\n\t\tt.add(\"five\", 5);\n\t\tSystem.out.println(t.remove());\n\t\tSystem.out.println(t.remove());\n\t\tSystem.out.println(t.remove());\n\t\tSystem.out.println(t.remove());\n\t\tSystem.out.println(t.remove());\n\t\tSystem.out.println(t.remove());\n\n\t\t// sorting data provided in a mixed priority order including some repitition and\n\t\t// negative values\n\t\tSystem.out.println(\n\t\t\t\t\"-------------\\nData given in a mixed priority order\\nincluding repitition and negative priority:\");\n\t\tPriorityQueue<String> u = new PriorityQueue<String>();\n\t\tu.add(\"-two\", -2);\n\t\tu.add(\"two\", 2);\n\t\tu.add(\"zero\", 0);\n\t\tu.add(\"one\", 1);\n\t\tu.add(\"zero again\", 0);\n\t\tu.add(\"-one\", -1);\n\t\tSystem.out.println(u.remove());\n\t\tSystem.out.println(u.remove());\n\t\tSystem.out.println(u.remove());\n\t\tSystem.out.println(u.remove());\n\t\tSystem.out.println(u.remove());\n\t\tSystem.out.println(u.remove());\n\n\t\t// sorting data provided in a mixed priority order and is of type Double this\n\t\t// time\n\t\tSystem.out.println(\n\t\t\t\t\"-------------\\nData given in a mixed priority order\\nbut using double as the objects this time:\");\n\t\tPriorityQueue<Double> v = new PriorityQueue<Double>();\n\t\tv.add(.002, 2);\n\t\tv.add(.006, 6);\n\t\tv.add(.005, 5);\n\t\tv.add(.001, 1);\n\t\tv.add(.004, 4);\n\t\tv.add(.003, 3);\n\t\tSystem.out.println(v.remove());\n\t\tSystem.out.println(v.remove());\n\t\tSystem.out.println(v.remove());\n\t\tSystem.out.println(v.remove());\n\t\tSystem.out.println(v.remove());\n\t\tSystem.out.println(v.remove());\n\t}",
"public static void main(String[] args)\r\n {\r\n Map<Character, Integer> myMap = new TreeMap<>(); //initializes the map\r\n secondMap = new TreeMap<>(); //initializes the second map\r\n List<Character> myList = new ArrayList<>(); //creates the list\r\n\r\n //input validation loop to force the users to input an extension with .txt, also extracts the directoryPath\r\n //from the file path extension\r\n String filePath = \"\";\r\n String directoryPath = \"\";\r\n boolean keepRunning = true;\r\n Scanner myScanner = new Scanner(System.in);\r\n\r\n while (keepRunning)\r\n {\r\n System.out.println(\"Please provide the filepath to the file and make sure to include the '.txt' extension\");\r\n String z = myScanner.nextLine();\r\n\r\n //uses a substring to check the extension\r\n if (z.substring((z.length() - 4)).equalsIgnoreCase(\".txt\"))\r\n {\r\n filePath = z;\r\n\r\n for (int i = z.length()-1; i >= 0; i--)\r\n {\r\n if (z.charAt(i) == '\\\\')\r\n {\r\n directoryPath = z.substring(0, i);\r\n i = -1;\r\n }\r\n }\r\n\r\n //terminates the loop\r\n keepRunning = false;\r\n }\r\n else\r\n {\r\n System.out.print(\"Invalid Input! \");\r\n }\r\n }\r\n\r\n try\r\n {\r\n //makes the file\r\n File myFile = new File(filePath);\r\n FileInputStream x = new FileInputStream(myFile);\r\n\r\n //reads in from the file character by character\r\n while (x.available() > 0)\r\n {\r\n Character c = (char) x.read();\r\n myList.add(c);\r\n }\r\n\r\n } catch (IOException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n\r\n //loads all of the characters into a map with their respective frequency\r\n for (Character a : myList)\r\n {\r\n Integer value = myMap.get(a);\r\n\r\n if (!myMap.containsKey(a))\r\n {\r\n myMap.put(a, 1);\r\n }\r\n else\r\n {\r\n myMap.put(a, (value + 1));\r\n }\r\n }\r\n\r\n //prints out the map for debugging purposes\r\n System.out.println(myMap);\r\n\r\n PriorityQueue<Node> myQueue = new PriorityQueue<>();\r\n\r\n //creates a node for each Character/value in the map and puts it into the priority Queue\r\n for (Character a : myMap.keySet())\r\n {\r\n Node b = new Node(a, myMap.get(a));\r\n myQueue.add(b);\r\n }\r\n\r\n //removes and re-adds nodes to form the tree, remaining node is the root of the tree\r\n while (myQueue.size() > 1)\r\n {\r\n //removes first two nodes\r\n Node firstRemoved = myQueue.remove();\r\n Node secondRemoved = myQueue.remove();\r\n\r\n //the value for the new node being a sum of the first two removed node's respective frequencies\r\n int val = firstRemoved.frequency + secondRemoved.frequency;\r\n\r\n //creates the new node, set's its frequency to the value of the first two, then ties its left/right node values\r\n //to those originally removed nodes\r\n Node replacementNode = new Node();\r\n replacementNode.frequency = val;\r\n replacementNode.left = firstRemoved;\r\n replacementNode.right = secondRemoved;\r\n\r\n myQueue.add(replacementNode);\r\n }\r\n\r\n //does the recursion on the priorityQueue\r\n huffmanStringSplit(myQueue.peek(), \"\");\r\n\r\n //prints out the map for debugging purposes\r\n System.out.println(secondMap);\r\n\r\n //creates and writes to the .CODE file and the .HUFF file\r\n try\r\n {\r\n //PrintWriter for easily writing to a file\r\n String output = directoryPath + \"\\\\FILENAME.code\";\r\n PrintWriter myPrinter = new PrintWriter(output);\r\n\r\n //goes through the second map\r\n for (Character a : secondMap.keySet())\r\n {\r\n int ascii = (int) a;\r\n myPrinter.println(ascii);\r\n myPrinter.println(secondMap.get(a));\r\n }\r\n\r\n //closes printer\r\n myPrinter.close();\r\n\r\n //reopens the printer to the new file\r\n output = directoryPath + \"\\\\FILENAME.huff\";\r\n myPrinter = new PrintWriter(output);\r\n\r\n //outputs every value in the original list to the .huff file with the characters converted to huff code\r\n for (Character a : myList)\r\n {\r\n myPrinter.print(secondMap.get(a));\r\n myPrinter.flush();\r\n }\r\n\r\n //closes the printer after it's written\r\n myPrinter.close();\r\n\r\n } catch (IOException e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }",
"public Map<String, Integer> findUnicalWord(ArrayList<Word> text)\n {\n String[] words=new String[text.size()];\n for(int i=0; i<text.size(); i++){\n words[i]=text.get(i).toString();\n }\n HashMap<String, Integer> myWordsCount = new HashMap<>();\n for (String s : words){\n if (myWordsCount.containsKey(s)) myWordsCount.replace(s, myWordsCount.get(s) + 1);\n else myWordsCount.put(s, 1);\n }\n\n Map<String, Integer> newWordsCount = myWordsCount\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n\n return newWordsCount;\n\n }",
"public void sortByWordLengthDesc() {\r\n\t\tcomparator = new WordLengthDesc();\r\n\t}",
"void Create(){\n map = new TreeMap<>();\r\n\r\n // Now we split the words up using punction and spaces\r\n String wordArray[] = wordSource.split(\"[{ \\n\\r.,]}}?\");\r\n\r\n // Now we loop through the array\r\n for (String wordArray1 : wordArray) {\r\n String key = wordArray1.toLowerCase();\r\n // If this word is not present in the map then add it\r\n // and set the word count to 1\r\n if (key.length() > 0){\r\n if (!map.containsKey(map)){\r\n map.put(key, 1);\r\n }\r\n else {\r\n int wordCount = map.get(key);\r\n wordCount++;\r\n map.put(key, wordCount);\r\n }\r\n }\r\n } // end of for loop\r\n \r\n // Get all entries into a set\r\n // I think that before this we just have key-value pairs\r\n entrySet = map.entrySet();\r\n \r\n }",
"private static List<String> computeTwoGramFrequencies(List<String> words, int top_no, List<String> stopwordslist) {\n\t\t\t\n\t\tMap<String, Integer> tempstopmap= new HashMap<String, Integer>();\n\t\tfor (int i=0; i<stopwordslist.size(); i++){\n\t\t\tString tempword = stopwordslist.get(i);\n\t\t\ttempstopmap.put(tempword, 1);\n\t\t}//construct temp stopwordmap\n\t\t\n\t\tint i=0;\n\t\tMap<String, Integer> tempmap= new HashMap<String, Integer>();\n\t\twhile(i<words.size()){\n\t\t\tString temptwogram=\"\";\n\t\t\tString tempword1=\" \";\n\t\t\tString tempword2=\" \";\n\t\t\twhile(true){\n\t\t\t\tif(i>=words.size()-1)\n\t\t\t\t\tbreak;\n\t\t\t\ttempword1=words.get(i);\n\t\t\t\tif(!tempstopmap.containsKey(tempword1))\n\t\t\t\t\tbreak;\n\t\t\t\ti++;\n\t\t\t\ttempword1=\" \";\n\t\t\t}\n\t\t\ti++;\n\t\t\tSystem.out.println(\"b\"+i);\n\t\t\twhile(true){\n\t\t\t\tif(i>=words.size())\n\t\t\t\t\tbreak;\n\t\t\t\ttempword2=words.get(i);\n\t\t\t\tif(!tempstopmap.containsKey(tempword2))\n\t\t\t\t\tbreak;\n\t\t\t\ti++;\n\t\t\t\ttempword2=\" \";\n\t\t\t}//jump for the case that word + stopword +word\n\t\t\t\n\t\t\ttemptwogram = tempword1+\" \"+tempword2; //2-gram\n\t\t\tif (tempmap.containsKey(temptwogram))\n\t\t\t\ttempmap.put(temptwogram, tempmap.get(temptwogram)+1);\n\t\t\telse\n\t\t\t\ttempmap.put(temptwogram, 1);\n\t\t}//construct hashmap to count 2-gram words (key(word), value(frequency))\n\t\tList<Map.Entry<String, Integer>> templist = new ArrayList<Map.Entry<String, Integer>>();\n\t\tfor(Map.Entry<String, Integer> entry: tempmap.entrySet()){\n\t\t\t\n\t\t\t\n\t\t\ttemplist.add(entry);\n\t\t}//construct templist with entry containing word/frequency in map\n\t\t\n\t\tCollections.sort(templist, Collections.reverseOrder(new comparatorByFrequencyReverse()));//sort templist in decresing order\n\n\t\t /*change the templist into sortedlist*/\n\t\tList<String> sortedlist = new ArrayList<String> ();\n\t\tif(templist.size()>=top_no){\n\t\t\tfor (int j=0; j<top_no;j++){\n\t\t\t\tString word = templist.get(j).getKey();\n\t\t\t\tsortedlist.add(word);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tfor (int j=0; j<templist.size();j++){\n\t\t\t\tString word = templist.get(j).getKey();\n\t\t\t\tsortedlist.add(word);\n\t\t\t}\n\t\t}\n\t\treturn sortedlist;\n\t}",
"@Override\n\tpublic int compareTo(WordGram wg) {\n\t\tif(this.equals(wg)) {\n\t\t\treturn 0; \n\t\t}\n\t\t\n\t\tint output = 0; \n\t\t\n\t\tfor(int i=0; i<this.length() && i<wg.length(); i++) {\n\t\t\tif(this.myWords[i].compareTo(wg.myWords[i]) !=0) {\n\t\t\t\toutput=1;\n\t\t\t\treturn this.myWords[i].compareTo(wg.myWords[i]);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t}\n\t\tif(output == 0) {\n\t\t\tif(this.length()> wg.length()) {\n\t\t\treturn 1;\n\t\t}\n\t\t\telse {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\t}\n\t\treturn 0;\n\t\t}",
"@Override\n public int compareTo(WordAndScore o) {\n int i = getScore() < o.getScore() ? -1 : getScore() > o.getScore() ? +1 : 0;\n if (i == 0) {\n i = word.compareTo(o.word);\n }\n if (i == 0) {\n i = Long.valueOf(resultID).compareTo(o.resultID);\n }\n if (i == 0) {\n i = Integer.valueOf(wseq).compareTo(o.wseq);\n }\n return i;\n }",
"public void sortAndReduceVocab (Vocabulary v, int min_count) {\n\t\tint hash;\n\t\tv.vocab = v.vocab.stream().sorted((e1, e2) -> (int) (e2.cn - e1.cn)).collect(Collectors.toList());\n\t\tint size = v.vocabSize;\n\t\tv.wordCount = 0;\n\t\tfor (int index = 0; index < size; index++) {\n\t\t\tif (v.vocab.get(index).cn < min_count) {\n\t\t\t\tv.vocab = v.vocab.subList(0, index);\n\t\t\t\tv.vocabSize = v.vocab.size();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// initialize hash table\n\t\tfor (int a = 0; a < vocabHashSize; a++) {\n\t\t\tv.vocabHash[a] = -1;\n\t\t}\n\t\t// Hash will be recomputed, as after the sorting it is not actual\n\t\tfor (int a = 0; a < v.vocabSize; a++) {\n\t\t\thash = getWordHash(v.vocab.get(a).word);\n\t\t\twhile (v.vocabHash[hash] != -1) hash = (hash + 1) % vocabHashSize;\n\t\t\tv.vocabHash[hash] = a;\n\t\t\tv.wordCount = v.wordCount + v.vocab.get(a).cn;\n\t\t}\n\t}",
"public static void main(String[] args) {\n Timer timer = new Timer();\r\n timer.start();\r\n \r\n /*Integer[] a = new Integer[1000000];\r\n Random rand = new Random();\r\n double d;\r\n int in;\r\n for(int x = 0; x < 1000000; x++){\r\n d = Math.random()*50;\r\n in = (int) d;\r\n a[x] = in;\r\n }*/\r\n \r\n Integer[] a = new Integer[5];\r\n a[0] = new Integer(2);\r\n a[1] = new Integer(1);\r\n a[2] = new Integer(4);\r\n a[3] = new Integer(3);\r\n\ta[4] = new Integer(8);\r\n priorityqSort(a);\r\n /*Queue<Integer> pq1 = new PriorityQueue<Integer>();\r\n for (Integer x: a){\r\n pq1.add(x);\r\n }\r\n System.out.println(\"pq1: \" + pq1);*/\r\n \r\n /*Queue<String> pq2 = new PriorityQueue<>();\r\n pq2.add(\"4\");\r\n pq2.add(\"9\");\r\n pq2.add(\"2\");\r\n pq2.add(\"1\");\r\n pq2.add(\"5\");\r\n pq2.add(\"0\");\r\n System.out.println(\"pq: \" + pq2);*/\r\n \r\n timer.end();\r\n System.out.println(timer);\r\n }",
"public void getWordFrequency(ArrayList<String> out_words, ArrayList<Integer> out_counts) {\n //... Put in ArrayList so sort entries by frequency\n ArrayList<Map.Entry<String, MutableInteger>> entries =\n new ArrayList<Map.Entry<String, MutableInteger>>(wordFrequency.entrySet());\n Collections.sort(entries, new ComparatorFrequency());\n\n //... Add word and frequency to parallel output ArrayLists.\n for (Map.Entry<String, MutableInteger> ent : entries) {\n out_words.add(ent.getKey());\n out_counts.add(ent.getValue().getValue());\n }\n }",
"private void countWords(String text, String ws) {\n BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8))));\n String line;\n\n // Get words and respective count\n while (true) {\n try {\n if ((line = reader.readLine()) == null)\n break;\n String[] words = line.split(\"[ ,;:.?!“”(){}\\\\[\\\\]<>']+\");\n for (String word : words) {\n word = word.toLowerCase();\n if (\"\".equals(word)) {\n continue;\n }\n if (lista.containsKey(word)){\n lista.get(word).add(ws);\n }else{\n HashSet<String> temp = new HashSet<>();\n temp.add(ws);\n lista.put(word, temp);\n }\n\n /*if (!countMap.containsKey(word)) {\n countMap.put(word, 1);\n }\n else {\n countMap.put(word, countMap.get(word) + 1);\n }*/\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n // Close reader\n try {\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n // Display words and counts\n /*for (String word : countMap.keySet()) {\n if (word.length() >= 3) { // Shall we ignore small words?\n //System.out.println(word + \"\\t\" + countMap.get(word));\n }\n }*/\n }",
"public void loadInitQueue() {\n\t\t// go through every character\n\t\tfor (int i = 0; i < frequencyCount.length; i++) { \n\t\t\t// check to see if it has appeared at least once.\n\t\t\tif (frequencyCount[i] != 0) { \n\t\t\t\t// if so, make a tree for it and add it to the priority queue.\n\t\t\t\tCS232LinkedBinaryTree<Integer, Character> curTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\t\tcurTree.add(frequencyCount[i], (char) i);\n\t\t\t\thuffBuilder.add(curTree);\n\t\t\t}\n\t\t}\n\t}",
"private void getWordCounts() {\n Map<String, List<String>> uniqueWordsInClass = new HashMap<>();\n List<String> uniqueWords = new ArrayList<>();\n\n for (ClassificationClass classificationClass : classificationClasses) {\n uniqueWordsInClass.put(classificationClass.getName(), new ArrayList<>());\n }\n\n for (Document document : documents) {\n String[] terms = document.getContent().split(\" \");\n\n for (String term : terms) {\n if (term.isEmpty()) {\n continue;\n }\n if (!uniqueWords.contains(term)) {\n uniqueWords.add(term);\n }\n\n for (ClassificationClass docClass : document.getClassificationClasses()) {\n if (!uniqueWordsInClass.get(docClass.getName()).contains(term)) {\n uniqueWordsInClass.get(docClass.getName()).add(term);\n }\n if (totalWordsInClass.containsKey(docClass.getName())) {\n this.totalWordsInClass.put(docClass.getName(), this.totalWordsInClass.get(docClass.getName()) + document.getFeatures().get(term));\n } else {\n this.totalWordsInClass.put(docClass.getName(), document.getFeatures().get(term));\n }\n }\n }\n }\n\n this.totalUniqueWords = uniqueWords.size();\n }",
"private void heapSort() {\n\n\t\tint queueSize = priorityQueue.size();\n\n\t\tfor (int j = 0; j < queueSize; j++) {\n\n\t\t\theapified[j] = binaryHeap.top(priorityQueue);\n\t\t\tbinaryHeap.outHeap(priorityQueue);\n\n\t\t}\n\n\t}",
"public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static Map<String, Integer> getWords(){\n\t\tMap<String, Integer> map = new HashMap<String, Integer>();\n\t\t\n\t\tfor(Status status : statusList){\n\t\t\tStringTokenizer tokens = new StringTokenizer(status.getText());\n\t\t\twhile(tokens.hasMoreTokens()){\n\t\t\t\tString token = tokens.nextToken();\n\t\t\t\tif(!token.equals(\"RT\")){\n\t\t\t\t\tif(map.containsKey(token)){\n\t\t\t\t\t\tint count = map.get(token);\n\t\t\t\t\t\tmap.put(token, ++count);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmap.put(token, 1);\n\t\t\t\t\t}\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn map;\n\t}",
"private static List<String> getTopNCompetitors(int numCompetitors,\n int topNCompetitors, \n List<String> competitors,\n int numReviews,\n List<String> reviews) {\n\t\t\n\t\t HashMap<String, Integer> map = new HashMap<>();\n\t\t for(String comp : competitors){\n\t map.put(comp.toLowerCase(),0);\n\t }\n\t\t\n\t for(String sentence : reviews){\n\t String[] words = sentence.split(\" \"); // get all the words in one sentence and put them in a String array \n\t for(String word : words){\n\t if(map.containsKey(word.toLowerCase())) { // check if map has any of the words (competitor name). if yes increase its value\n\t map.put(word.toLowerCase(), map.get(word.toLowerCase()) + 1);\n\t }\n\t }\n\t }\n\t \n\t PriorityQueue<String> pq =new PriorityQueue<>((String i1,String i2)->{ \n\t return map.get(i1)-map.get(i2); \n\t });\n\t for(String key:map.keySet()){\n\t pq.add(key);\n\t if(pq.size()>topNCompetitors) pq.poll();\n\t }\n\t List<String> result=new ArrayList<>();\n\t while(!pq.isEmpty())\n\t result.add(pq.poll());\n\t \n\t Collections.reverse(result);\n\t \n\t return result; \n\t \n}",
"public static List<String> sortWords(List<String> words) {\n\t\tfor (int i = 0; i < words.size()-1; i++) {\n\t\tint worrds= \twords.get(i).compareTo(words.get(i+1));\n\t\t\tSystem.out.println(worrds);\n\t\t\tif (worrds<0) {\n\t\t\t\tString temp = words.get(i);\n\t\t\t\t\n\t\t\t\twords.set(i, words.get(i+1));\n\t\t\t\t\n\t\t\t\twords.set(i+1, temp);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\treturn words;\n\t}",
"public HotWordsAnalyzer (String hotWordsFileName, String docFileName){\r\n //Setting the filenames to the variables to make them easier to type\r\n doc = docFileName;\r\n hw = hotWordsFileName;\r\n \r\n //If opening of the file fails, an ioException will be thrown\r\n\t\ttry{\r\n hotword = new Scanner(Paths.get(hw));\r\n }\r\n catch (IOException ioException){\r\n System.err.println(\"Error opening file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n try{\r\n \r\n docs = new Scanner(Paths.get(doc));\r\n }\r\n catch (IOException ioException){\r\n System.err.println(\"Error opening file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n //Above opens both files\r\n \r\n //Goes through hotwords file and takes each word and pushes them to \r\n //the map words so they can be used to locate the hotwords in the document\r\n\t\ttry{\r\n while(hotword.hasNext()){\r\n String y;\r\n String x = hotword.next();\r\n y = x.toLowerCase();\r\n //sets hotword as key and 0 for the count of that hotword in the document\r\n words.put(y, 0);\r\n }\r\n }\r\n //The element doesn't exist- file must not be a file\r\n catch(NoSuchElementException elementException){\r\n System.err.println(\"Improper file. Terminating.\");\r\n System.exit(1);\r\n }\r\n //The file may not be readable or corrupt\r\n catch(IllegalStateException stateException){\r\n System.err.println(\"Error reading from file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n //Above gets words and puts them into the words map\r\n try{\r\n //reads the document and when it finds a hotword it increments the count in words\r\n while(docs.hasNext()){\r\n //gets next word\r\n String x = docs.next();\r\n String y = x.toLowerCase();\r\n //Gets rid of the commas and periods\r\n y = y.replace(\",\", \"\");\r\n y = y.replace(\".\", \"\");\r\n //If the word y is in the hotwords list\r\n if(words.containsKey(y)){\r\n //Adds to words map and increments count\r\n consec.add(y);\r\n int z;\r\n z = words.get(y);\r\n z++;\r\n words.put(y, z);\r\n }\r\n }\r\n }\r\n catch(NoSuchElementException elementException){\r\n System.err.println(\"Improper file. Terminating.\");\r\n System.exit(1);\r\n }\r\n catch(IllegalStateException stateException){\r\n System.err.println(\"Error reading from file. Terminating.\");\r\n System.exit(1);\r\n }\r\n \r\n \r\n\t\t\r\n\t}",
"public interface IWordFrequency {\n\n\t/**\n\t * \n\t * @param input\n\t * text string to process\n\t * @param wordNumber\n\t * max number of word in the returned list\n\t * @return for a given non null or empty input text, returns the list of\n\t * words ordered by word frequency, the most frequently occurring\n\t * word first, null otherwise.\n\t * \n\t */\n\tList<String> getWordFrequency(String input, int wordNumber);\n\n}",
"public float[][] getTopicWordProb() {\n SortedSet<WordPosition> sortedWords = new TreeSet<WordPosition>();\n Iterator it = dataAlphabet.iterator();\n int i = 0;\n while (it.hasNext()) {\n sortedWords.add(new WordPosition((String) it.next(), i++));\n }\n\n // re-sort the topicWords probability matrix with respect to the new order\n int newPos = 0;\n float[][] topicSortedWords = new float[topicWords.length][corpusVocabularySize];\n for (WordPosition wp : sortedWords) {\n\n for (int t = 0; t < topicWords.length; t++) {\n topicSortedWords[t][newPos] = (float) topicWords[t][wp.position];\n }\n\n newPos++;\n }\n\n return topicSortedWords;\n }",
"public void calculateScore() {\n for (Sequence seq: currentSeq) {\n double wordWeight = Retriever.getWeight(seq);\n String token = seq.getToken();\n int size = seq.getRight() - seq.getLeft() + 1;\n int titleCount = getCount(token.toLowerCase(), title.toLowerCase());\n if (titleCount != 0) {\n setMatch(size);\n setTitleContains(true);\n }\n int lowerCount = getCount(token.toLowerCase(), lowerContent);\n if (lowerCount == 0) {\n// scoreInfo += \"Token: \" + token + \" Original=0 Lower=0 WordWeight=\" + wordWeight + \" wordTotal=0\\n\";\n continue;\n }\n int originalCount = getCount(token, content);\n lowerCount = lowerCount - originalCount;\n if (lowerCount != 0 || originalCount != 0) {\n setMatch(size);\n }\n double originalScore = formula(wordWeight, originalCount);\n double lowerScore = formula(wordWeight, lowerCount);\n final double weight = 1.5;\n double addedScore = weight * originalScore + lowerScore;\n// scoreInfo += \"Token: \" + token + \" Original=\" + originalScore + \" Lower=\" + lowerScore +\n// \" WordWeight=\" + wordWeight + \" wordTotal=\" + addedScore + \"\\n\";\n dependencyScore += addedScore;\n }\n currentSeq.clear();\n }",
"public static void main(String[] args) {\n Queue<Integer> values=new PriorityQueue<>();\r\n values.add(87);\r\n\t values.add(97);\r\n\t values.add(34);\r\n\t values.add(92);\r\n\t System.out.println(values);\r\n\t}",
"private void processPhrases(final int n) {\n\t\tresult = new LinkedHashMap<String, Integer>();\n\n\t\tList<Entry<String, Integer>> list = new LinkedList<Entry<String, Integer>>(\n\t\t\t\tcounter.entrySet());\n\n\t\tCollections.sort(list, new Comparator<Entry<String, Integer>>() {\n\t\t\tpublic int compare(final Entry<String, Integer> o1, final Entry<String, Integer> o2) {\n\t\t\t\treturn o2.getValue().compareTo(o1.getValue());\n\t\t\t}\n\t\t});\n\n\t\tint count = 0;\n\t\tint last = 0;\n\t\t\n\t\tfor (Entry<String, Integer> entry : list) {\n\t\t\tif (count >= n) {\n\t\t\t\tif (entry.getValue() < last) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tresult.put(entry.getKey(), entry.getValue());\n\t\t\tlast = entry.getValue();\n\t\t\tcount++;\n\t\t}\n\t}",
"private void initiateWordCount(){\n for(String key: DataModel.bloomFilter.keySet()){\n WordCountHam.put(key, 0);\n WordCountSpam.put(key, 0);\n }\n }",
"@Override\n\tpublic int compareTo(word o) {\n\t\tif(this.text.compareTo(o.text)>=0)\n\t\t\treturn 1;\n\t\treturn -1;\n\t}",
"void countSortG(char[] str) {\n\t\tchar[] output = new char[str.length];\n\n\t\t// Create a count array to store count of inidividul characters and\n\t\t// initialize count array as 0\n\t\tint[] count = new int[RANGEG + 1];\n\t\t;\n\t\tint i = 0;\n\n\t\t// Store count of each character\n\t\tfor (i = 0; i < str.length; ++i)\n\t\t\t++count[str[i]];\n\n\t\t// Change count[i] so that count[i] now contains actual position of\n\t\t// this character in output array\n\t\tfor (i = 1; i <= RANGE; ++i)\n\t\t\tcount[i] += count[i - 1];\n\n\t\t// Build the output character array\n\t\tfor (i = 0; i < str.length; ++i) {\n\t\t\toutput[count[str[i]] - 1] = str[i];\n\t\t\t--count[str[i]];\n\t\t}\n\n\t\t// Copy the output array to str, so that str now\n\t\t// contains sorted characters\n\t\tfor (i = 0; i < str.length; ++i)\n\t\t\tstr[i] = output[i];\n\n\t\tSystem.out.println();\n\t}",
"public void sortByTopic() {\r\n\t\tfor (int i = 1; i < displayingList.size(); i++) {\r\n\t\t\tQuestion temp = displayingList.get(i);\r\n\t\t\tfor (int j = i - 1; j >= 0; j--) {\r\n\t\t\t\tif (String.CASE_INSENSITIVE_ORDER.compare(temp.getTopic(), displayingList.get(j).getTopic()) < 0) {\r\n\t\t\t\t\tdisplayingList.set(j + 1, displayingList.get(j));\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdisplayingList.set(j + 1, temp);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdisplayingList.set(j, temp);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static void sortNoun() throws Exception{\r\n\t\tBufferedReader[] brArray = new BufferedReader[ actionNumber ];\r\n\t\tBufferedWriter[] bwArray = new BufferedWriter[ actionNumber ];\r\n\t\tString line = null;\r\n\t\tfor(int i = 0; i < actionNameArray.length; ++i){\r\n\t\t\tSystem.out.println(\"sorting for \" + actionNameArray[ i ]);\r\n\t\t\tbrArray[ i ] = new BufferedReader( new FileReader(TFIDF_URL + actionNameArray[ i ] + \".tfidf\"));\r\n\t\t\tHashMap<String, Double> nounTFIDFMap = new HashMap<String, Double>();\r\n\t\t\tint k = 0;\r\n\t\t\t// 1. Read tfidf data\r\n\t\t\twhile((line = brArray[ i ].readLine())!=null){\r\n\t\t\t\tnounTFIDFMap.put(nounList.get(k), Double.parseDouble(line));\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t\tbrArray[ i ].close();\r\n\t\t\t// 2. Rank according to tfidf\r\n\t\t\tValueComparator bvc = new ValueComparator(nounTFIDFMap);\r\n\t\t\tTreeMap<String, Double> sortedMap = new TreeMap<String, Double>(bvc);\r\n\t\t\tsortedMap.putAll(nounTFIDFMap);\r\n\t\t\t\r\n\t\t\t// 3. Write to disk\r\n\t\t\tbwArray[ i ] = new BufferedWriter(new FileWriter( SORTED_URL + actionNameArray[ i ] + \".sorted\"));\r\n\t\t\tfor(String nounKey : sortedMap.keySet()){\r\n\t\t\t\tbwArray[ i ].append(nounKey + \"\\t\" + nounTFIDFMap.get(nounKey) + \"\\n\");\r\n\t\t\t}\r\n\t\t\tbwArray[ i ].close();\r\n\t\t}\r\n\t}",
"public void sortBasedPendingJobs();",
"public static void main(String... args) {\n try{ //this makes it so that all the console output will be printed to a file\n //PrintStream out = new PrintStream(new FileOutputStream(WORD_COUNT_TABLE_FILE.toString()));\n //System.setOut(out);\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n long start = System.currentTimeMillis();\n\n\n\n Map<String, List<Integer>> allWords = new ConcurrentHashMap<>(); //the HashMap that will contain all the words and list of occurrences\n List<String> listOfFiles = getFilesFromDirectory(); //the list of files from the given folder\n List<Thread> threadList = new LinkedList<>();\n\n runWithThreads(allWords, listOfFiles, NUMBER_OF_THREADS);\n\n TreeMap<String, List<Integer>> sortedMap = new TreeMap<>(allWords);\n Set<Entry<String, List<Integer>>> sortedEntries = sortedMap.entrySet();\n\n long end = System.currentTimeMillis();\n\n System.out.print(Table.makeTable(sortedEntries, listOfFiles));\n System.out.println(\"\\nTime: \" + (end-start));\n\n\n\n }",
"public static void main(String[] args)\n\t{\n\t\tdouble mine = (29 + 27 + 29 + /*24*/ 28 + 30 + 50 + 55 + 17 + 19 + 16 + 18 + 17 + 17 + 20 + 18 + 20 + 82 + 81 + 87 + 215);\n\t\t\n\t\tdouble pote = (30 + 30 + 30 + 30 + 30 + 60 + 30 + 30 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 20 + 100 + 100 + 100 + 250);\n\t\t\n\t\tdouble grade = (mine / pote) * 100;\n\t\tSystem.out.println(grade);\n\t\t\n\t\tPriorityQueue<String> pq = new PriorityQueue<String>();\n\t\tPriorityQueue<String> pq2 = new PriorityQueue<String>();\n\t\tPriorityQueue<Character> pq3 = new PriorityQueue<Character>();\n\t\t/*\n\t\tPriorityQueue pq4 = new PriorityQueue();\n\t\tpq4.enqueuePQ(2, \"F\");\n\t\tpq4.enqueuePQ(2, 32);\n\t\tSystem.out.println(pq4.toString());\n\t\t*/\n\t\t\n\t\t\n\t\tpq3.enqueuePQ(3, 'A');\n\t\tpq3.enqueuePQ(3, 'B');\n\t\tpq3.enqueuePQ(3, 'C');\n\t\tSystem.out.println(pq3.toString());\n\t\t\n\t\tSystem.out.println(pq3.dequeuePQ());\n\t\tSystem.out.println(pq3.peekPQ());\n\t\t\n\t\tpq2.enqueuePQ(2, \"two\");\n\t\tpq2.enqueuePQ(3, \"three\");\n\t\tpq2.enqueuePQ(1, \"one\");\n\t\t//pq2.enqueuePQ(-2, \"neg two\");\n\t\t//pq2.enqueuePQ(3, \"three 2\");\n\t\t//pq2.enqueuePQ(-2, \"neg two 2\");\n\t\t//pq2.enqueuePQ(1, \"one 2\");\n\t\tSystem.out.println(pq2.toString());\n\t\t\n\t\tSystem.out.println(pq2.dequeuePQ());\n\t\tSystem.out.println(pq2.peekPQ());\n\t\tSystem.out.println(pq2.toString());\n\t\t\n\t\tSystem.out.println(pq.isEmpty());\n\t\tpq.enqueuePQ(3, \"three\");\n\t\tSystem.out.println(pq.toString());\n\t\tpq.enqueuePQ(5, \"five\");\n\t\tSystem.out.println(pq.isEmpty());\n\t\tSystem.out.println(pq.toString());\n\t\tSystem.out.println(pq.dequeuePQ());\n\t\tSystem.out.println(pq.isEmpty());\n\t\tSystem.out.println(pq.dequeuePQ());\n\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(pq.peekPQ());\n\t\t}\n\t\tcatch (PQException ex)\n\t\t{\n\t\t\tSystem.out.println(\"PEEK EXCEPTION CAUGHT\");\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\tSystem.out.println(pq.dequeuePQ());\n\t\t}\n\t\tcatch (PQException ex)\n\t\t{\n\t\t\tSystem.out.println(\"Dequeue EXCEPTION CAUGHT\");\n\t\t\t\n\t\t}\n\t\t\n\t\tSystem.out.println(pq.isEmpty());\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tSystem.out.println(\"DONE\");\n\t\t\n\t\t\n\t\t\n\t}",
"private synchronized void freshSort(){\n Process[] newQueue = new Process[pros.proSize()];\n for(int i = 0; i <queue.length; i++){\n if(pros.isInList(queue[i])){\n newQueue[i] = queue[i];\n }\n }\n queue = new Process[pros.proSize()];\n queue = newQueue;\n }",
"int getPriorityOrder();",
"public String[] sortingwords(String p1)\n {\n String[] splitedword;\n splitedword = p1.split(\"\\\\s\");\n //splits the string\n\n for (int i = 0; i < splitedword.length; i++)\n {\n for (int j = i + 1; j < splitedword.length; j++)\n {\n if (splitedword[i].compareTo(splitedword[j]) > 0)\n {\n String temp = splitedword[i];\n splitedword[i] = splitedword[j];\n splitedword [j] = temp;\n }\n }\n }\n return splitedword;\n // return splited word\n }",
"public static void main(String[] args) throws IOException {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n String line = null;\n while (!(line = br.readLine()).equals(\"#\")){\n String[] l = line.split(\" \");\n register(Integer.parseInt(l[1]),Integer.parseInt(l[2]));\n }\n\n int K = Integer.parseInt(br.readLine());\n int size = K * s.size();\n pq = new PriorityQueue<pair<Long, Integer>>(size, new Comparator<pair<Long, Integer>>() {\n @Override\n public int compare(pair<Long, Integer> o1, pair<Long, Integer> o2) {\n return (int)(o1.x- o2.x);\n }\n });\n// System.out.println(K);\n List<Long> list = new ArrayList<Long>();\n for(pair<Integer, Integer> p: s){\n long idx = p.y;\n long limit = (K+1)* (p.y);\n// System.out.println(idx+\"-\"+K);\n while(idx < limit){\n// System.out.println(idx+\"--\"+p.x);\n pq.add(new pair<Long, Integer>(idx, p.x));\n idx += p.y;\n }\n }\n for(int ix = K; ix>0; ix--){\n System.out.println(pq.poll().y);\n }\n // print K times. each time may have differenet queue numbers\n\n// for(pair<Integer, Integer> p: pq){\n// System.out.println(p.toString());\n// }\n }",
"public static void main (String[] args) throws FileNotFoundException {\t\n\t\t// declare local variables\n\t\tInteger time = new Integer(0);\n\t\tFile infile = new File(args[0]);\n parser = new Scanner(infile);\n int intValue = 0;\n Double priority = 0.0;\n Integer val = 0;\n\n String result = \"\"; \n int count = 0;\n \n // add the first 5 jobs\n while (count<5) {\n\t\t\t\ttoken = parser.next();\n\t\t\t\ttime = Integer.parseInt(token);\n\t\t\t\tintValue = time.intValue();\n\t\t\t\tpriority = 1.0/intValue;\n\t\t\t\tentry = new Entry<>(priority, time, 0);\n\t\t\t\tdata.add(entry);\n\t\t\t\tcount ++;\n\t\t}\n\t\t// if there is still jobs in the queue\n\t\twhile (!data.isEmpty()) {\n\t\t\t// remove the 1st job in the queue\n\t\t\tresult = result +\" \"+ data.remove();\n\n\t\t\t// update the age and priority of the jobs left in the queue\t\n\t\t\tfor (int i =0; i < data.size(); i++){\n\t\t\t\tupdateAge();\n\t\t\t\tif (data.get(i).getAge()>3) {\n\t\t\t\t\tdata.get(i).setPriority(data.get(i).getPriority() + 0.2);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t// rearrange the queue\n\t\t\tdata.siftDown(data.size()/2);\n\n\t\t\t// add another job\n\t\t\tif (parser.hasNext()) {\n\t\t\t\ttoken = parser.next();\n\t\t\t\ttime = Integer.parseInt(token);\n\t\t\t\tintValue = time.intValue();\n\t\t\t\tpriority = 1.0/intValue;\n\t\t\t\tentry = new Entry<>(priority, time, 0);\n\t\t\t\tdata.add(entry);\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t// 12, 35, 75, 250, 400, 1000, 600, 378, 957\n\t\tSystem.out.print(result);\n\t\tSystem.out.println();\n\t\t\n\t}",
"public synchronized void process() \n\t{\n\t\t// for each word in a line, tally-up its frequency.\n\t\t// do sentence-segmentation first.\n\t\tCopyOnWriteArrayList<String> result = textProcessor.sentenceSegmementation(content.get());\n\t\t\n\t\t// then do tokenize each word and count the terms.\n\t\ttextProcessor.tokenizeAndCount(result);\n\t}",
"public void run() throws IOException {\n \n try {\n \n File file = new File(\"jobs.txt\");\n FileReader fileReader = new FileReader(file);\n \n BufferedReader bufferedReader = new BufferedReader(fileReader); \n StringBuffer stringBuffer = new StringBuffer();\n \n String line;\n \n // reading the first line = number of jobs and skipping it since\n // I do not need that information \n line = bufferedReader.readLine();\n \n //this.numOfjobs = Integer.parseInt(line);\n \n // read a line:\n while ((line = bufferedReader.readLine()) != null ) {\n \n int weight,length;\n \n String[] arr = line.split(\"\\\\s+\");\n \n // weight and length are\n weight = Integer.parseInt(arr[0]);\n length = Integer.parseInt(arr[1]);\n \n // putting into the priority queue\n this.putJob(weight, length);\n }\n \n // closing the fileReader:\n fileReader.close();\n \n }catch (IOException e) {\n e.printStackTrace();\n }\n }",
"private PQHeap makeQueue(){\n \tPQHeap queue = new PQHeap(frequency.length);\n \tfor (int i = 0; i < frequency.length; i++) {\n \t\tqueue.insert(new Element(frequency[i], new HuffmanTempTree(i)));\n \t}\n \treturn queue;\n \t}",
"protected void setup(Context context) throws IOException,InterruptedException{\n try {\n BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(\"/home/u2/hadoop_installs/hadoop-2.7.4/TrainingData_word_GR_sort/TrainingData_word_GR_sort.txt\")), \"UTF-8\"));\n String lineTxt = null;\n int get_line=0;\n while (((lineTxt = br.readLine()) != null)&&(get_line<1000)) {\n \t\n \tString[] getword = lineTxt.toString().split(\"\\t\");\n \ttop_ig_words[get_line] = new String(getword[1]);\n \tget_line++;\n }\n br.close();\n } catch (Exception e) {\n System.err.println(\"read errors :\" + e);\n }\n }",
"public void put(String word, int count) {\n if (wordToCount.values() != null && wordToCount.values().contains(count)) {\n this.countToWord.get(count).add(word);\n } else {\n Set<String> wordset = new HashSet<String>();\n wordset.add(word);\n this.countToWord.put(count, wordset);\n }\n this.wordToCount.put(word, count);\n this.wordNumber += 1;\n this.cached = false;\n }",
"@SuppressWarnings(\"unchecked\")\r\n public static HashMap<Integer,TreeMap<Integer,Double>> word_distribute(Corpus c, SparseBackoffTree [] sbtToOutput) throws Exception{\n @SuppressWarnings(\"rawtypes\")\r\n HashMap<Integer,HashMap<Integer,Double>> word_givenTopic = new HashMap();\r\n for(int i = 0; i < c._pWord.length; i++) {\r\n if(c._pWord[i] > 0.0) {\r\n TIntDoubleHashMap hm = sbtToOutput[i].getLeafCounts();\r\n TIntDoubleIterator it = hm.iterator();\r\n while(it.hasNext()) {\r\n it.advance();\r\n int sId = it.key();\r\n double val = it.value()/c._pWord[i];\r\n if(word_givenTopic.containsKey(sId)){\r\n HashMap<Integer,Double> sublist = word_givenTopic.get(sId);\r\n sublist.put(i,val);\r\n }else{\r\n @SuppressWarnings(\"rawtypes\")\r\n HashMap<Integer,Double> sublist = new HashMap();\r\n sublist.put(i,val);\r\n word_givenTopic.put(sId,sublist);\r\n }\r\n }\r\n }\r\n }\r\n\r\n //sort the hash map by value.\r\n @SuppressWarnings(\"rawtypes\")\r\n HashMap<Integer,TreeMap<Integer,Double>> final_result = new HashMap();\r\n for(Entry<Integer, HashMap<Integer, Double>> entry : word_givenTopic.entrySet()) {\r\n int key = entry.getKey();\r\n HashMap<Integer,Double> word_distribution = entry.getValue();\r\n ByValueComparator bvc = new ByValueComparator(word_distribution);\r\n TreeMap<Integer, Double> sorted_word_distribution = new TreeMap<Integer, Double>(bvc);\r\n sorted_word_distribution.putAll(word_distribution);\r\n final_result.put(key,sorted_word_distribution);\r\n } \r\n return final_result;\r\n}",
"public String findOrder(String [] words, int N, int K)\n {\n Graph g = new Graph(K);\n\t\t \n\t\t for(int i=0;i < words.length && i+1 < words.length;i++) {\n\t\t\t\tString w1 = words[i];\n\t\t\t\tString w2 = words[i+1];\n\t\t\t\tcompare(g,w1,w2);\t\n\t\t\t}\n\t\t \n\t\t return g.topologicalSort(); \n \n }",
"private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }",
"public static void sortStringsNumAs( ArrayList<String> lst )\n {\n PredicateStringPair p = (a, b) -> {\n String[] A = a.split(\"\");\n String[] B = b.split(\"\");\n int acount = 0;\n int bcount = 0;\n for (String i : A){\n if (i == \"a\" || i == \"A\"){\n acount += 1;\n }\n }\n for (String i : B){\n if (i == \"a\" || i == \"A\"){\n bcount += 1;\n }\n }\n\n if (acount > bcount) return true;\n else return false;\n };\n sortStrings(lst, p);\n \n }",
"public static void pageRankmain() {\n\t\t\t\n\t\t\tstopWordStore();\n\t\t\t//File[] file_read= dir.listFiles();\n\t\t\t//textProcessor(file_read);// Will be called from LinkCrawler\n\t\t\t//queryProcess();\n\t\t\t//System.out.println(\"docsave \"+ docsave);\n\t\t\t/*for ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t String key = entry.getKey();\n\t\t\t List<String> values = entry.getValue();\n\t\t\t System.out.print(\"Key = \" + key);\n\t\t\t System.out.println(\" , Values = \"+ values);\n\t\t\t}*/\n\t\t\t//########## RESPOINSIBLE FOR CREATING INVERTED INDEX OF TERMS ##########\n\t\t\tfor(int i=0;i<vocabulary.size();i++) {\n\t\t\t\tint count=1;\n\t\t\t\tMap<String, Integer> nestMap = new HashMap<String, Integer>();\n\t\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry : docsave.entrySet()) {\n\t\t\t\t String keyMain = entry.getKey();\n\t\t\t\t List<String> values = entry.getValue();\n\t\t\t\t if(values.contains(vocabulary.get(i)))\n\t\t\t\t \t{\n\t\t\t\t \tentryDf.put(vocabulary.get(i), count);//entryDf stores documents frequency of vocabulary word \\\\it increase the count value for specific key\n\t\t\t\t \tcount++;\n\t\t\t\t \t}\n\t\t\t\t \n\t\t\t\t nestMap.put(keyMain, Collections.frequency(values,vocabulary.get(i)));\n\t\t\t \t\n\t\t\t \t//System.out.println(\"VOC \"+ vocabulary.get(i)+ \" KeyMain \" +keyMain+ \" \"+ Collections.frequency(values,vocabulary.get(i)));\n\t\t\t\t\t}\n\t\t\t\t\ttfList.put(vocabulary.get(i), nestMap);\n\t\t\t}\n\t\t\t//########## RESPOINSIBLE FOR CREATING A MAP \"storeIdf\" TO STORE IDF VALUES OF TERMS ##########\n\t\t\tfor ( Map.Entry<String, Integer> endf : entryDf.entrySet()) {\n\t\t\t\tString keydf = endf.getKey();\n\t\t\t\tint valdf = endf.getValue();\n\t\t\t\t//System.out.print(\"Key = \" + \"'\"+keydf+ \"'\");\n\t\t\t //System.out.print(\" , Values = \"+ valdf);\n\t\t\t double Hudai = (double) (docsave.size())/valdf;\n\t\t\t //System.out.println(\"docsave size \"+docsave.size()+ \" valdf \"+ valdf + \" Hudai \"+ Hudai+ \" log Value1 \"+ Math.log(Hudai)+ \" log Value2 \"+ Math.log(2));\n\t\t\t double idf= Math.log(Hudai)/Math.log(2);\n\t\t\t storeIdf.put(keydf, idf);\n\t\t\t //System.out.print(\" idf-> \"+ idf);\n\t\t\t //System.out.println();\n\t\t\t} \n\t\t\t\n\t\t\t//############ Just for Printing ##########NO WORK HERE########\n\t\t\tfor (Map.Entry<String, Map<String, Integer>> tokTf : tfList.entrySet()) {\n\t\t\t\tString keyTf = tokTf.getKey();\n\t\t\t\tMap<String, Integer> valTF = tokTf.getValue();\n\t\t\t\tSystem.out.println(\"Inverted Indexing by Key Word = \" + \"'\"+keyTf+ \"'\");\n\t\t\t\tfor (Map.Entry<String, Integer> nesTf : valTF.entrySet()) {\n\t\t\t\t\tString keyTF = nesTf.getKey();\n\t\t\t\t\tInteger valTf = nesTf.getValue();\n\t\t\t\t\tSystem.out.print(\" Document Consists This Key Word = \" + \"'\"+ keyTF+ \"'\");\n\t\t\t\t\tSystem.out.println(\" , Term Frequencies in This Doc = \"+ valTf);\n\t\t\t\t} \n\t\t\t}\n\t\t\t//########### FOR CALCULATING DOCUMENT LENTH #############//\n\t\t\tfor ( Map.Entry<String, ArrayList<String>> entry_new : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t{\n\t\t\t\tString keyMain_new = entry_new.getKey();\n\t\t\t\t//int countStop=0;\n\t\t\t\tdouble sum=0;\n\t\t\t\t for(Map.Entry<String, Map<String, Integer>> tokTf_new : tfList.entrySet()) // Iterating through the vocabulary\n\t\t\t\t { \n\t\t\t\t\t Map<String, Integer> valTF_new = tokTf_new.getValue();\n\t\t\t\t\t for (Map.Entry<String, Integer> nesTf_new : valTF_new.entrySet()) // Iterating Through the Documents\n\t\t\t\t\t {\n\t\t\t\t\t\t if(keyMain_new.equals(nesTf_new.getKey())) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t double val = nesTf_new.getValue()* (Double) storeIdf.get(tokTf_new.getKey());\n\t\t\t\t\t\t\t sum = sum+ Math.pow(val, 2);\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 //countStop++;\n\t\t\t\t }\n\t\t\t\t docLength.put(keyMain_new, Math.sqrt(sum));\n\t\t\t\t sum=0;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Document Length \"+ docLength);\n\t\t\t//System.out.println(\"tfList \"+tfList);\n\t\t\t\n\t\t\t //########### FOR CALCULATING QUERY LENTH #############///\n\t\t\t\tdouble qrySum=0;\n\t\t\t\t for(String qryTerm: queryList) // Iterating through the vocabulary\n\t\t\t\t {\n\t\t\t\t\t//entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));// VUl ase\n\t\t\t\t\t \n\t\t\t\t\t\t if(storeIdf.get(qryTerm) != null) \n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t entryQf.put(qryTerm, Collections.frequency(queryList,qryTerm));\n\t\t\t\t\t\t\t double val = entryQf.get(qryTerm)* (Double) storeIdf.get(qryTerm);\n\t\t\t\t\t\t\t qrySum = qrySum+ Math.pow(val, 2);\n\t\t\t\t\t\t }\n\t\t\t\t\t System.out.println(qryTerm+\" \"+entryQf.get(qryTerm)+ \" \"+ (Double) storeIdf.get(qryTerm));\n\t\t\t\t }\n\t\t\t\t qrySum=Math.sqrt(qrySum);\n\t\t\t\t System.out.println(\"qrySum \" + qrySum);\n\t\t\t\t \n\t\t\t\t//########### FOR CALCULATING COSINE SIMILARITY #############///\n\t\t\t\t for ( Map.Entry<String, ArrayList<String>> entry_dotP : docsave.entrySet()) // Iterating Number of Documents\n\t\t\t\t\t{\n\t\t\t\t\t\tdouble sumProduct=0;\n\t\t\t\t\t\tdouble productTfIdf=0;\n\t\t\t\t\t\tString keyMain_new = entry_dotP.getKey(); //Geting Doc Name\n\t\t\t\t\t\t for(Map.Entry<String, Integer> qryTermItr : entryQf.entrySet()) // Iterating through the vocabulary\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Map<String, Integer> matchTerm = tfList.get(qryTermItr.getKey()); // Getting a map of doc Names by a Query Term as value of tfList\n\n\t\t\t\t\t\t\t\t if(matchTerm.containsKey(keyMain_new)) // Only doc name EQUAL with docsave name can enter here\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t //System.out.println(\"Test \"+ matchTerm.get(keyMain_new) +\" keyMain_new \" + keyMain_new);\n\t\t\t\t\t\t\t\t\t double docTfIdf= matchTerm.get(keyMain_new) * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t double qryTfIdf= qryTermItr.getValue() * storeIdf.get(qryTermItr.getKey());\n\t\t\t\t\t\t\t\t\t productTfIdf = docTfIdf * qryTfIdf;\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 sumProduct= sumProduct+productTfIdf;\n\t\t\t\t\t\t\t //System.out.println(\"productTfIdf \"+productTfIdf+\" sumProduct \"+ sumProduct);\n\t\t\t\t\t\t\t productTfIdf=0;\n\t\t\t\t\t\t }\n\t\t\t\t\t\t cosineProd.put(entry_dotP.getKey(), sumProduct/(docLength.get(entry_dotP.getKey())*qrySum));\n\t\t\t\t\t\t sumProduct=0;\n\t\t\t\t\t\t //System.out.println(entry_dotP.getKey()+ \" \" + docLength.get(entry_dotP.getKey()));\n\t\t\t\t\t}\n\t\t\t\t System.out.println(\"cosineProd \"+ cosineProd);\n\t\t\t\t \n\t\t\t\t System.out.println(\"Number of Top Pages you want to see\");\n\t\t\t\t int topRank = Integer.parseInt(scan.nextLine());\n\t\t\t\t Map<String, Double> result = cosineProd.entrySet().stream()\n\t\t\t .sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).limit(topRank)\n\t\t\t .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue,\n\t\t\t (oldValue, newValue) -> oldValue, LinkedHashMap::new));\n\n\t\t\t\t scan.close();\n\t\t\t //Alternative way\n\t\t\t //Map<String, Double> result2 = new LinkedHashMap<>();\n\t\t\t //cosineProd.entrySet().stream().sorted(Map.Entry.<String, Double>comparingByValue().reversed()).limit(2).forEachOrdered(x -> result2.put(x.getKey(), x.getValue()));\n\n\t\t\t System.out.println(\"Sorted...\");\n\t\t\t System.out.println(result);\n\t\t\t //System.out.println(result2);\n\t}",
"public String showSearchFrequency(WordCount wordCount, String order) {\n TreeMap<Integer, TreeMap<String, Word>> wordCountMap = wordCount.getWordCount(); //get map ordered by word count\n String returnedString = \"You have searched for these words \";\n if (order.equals(\n \"asc\") || order.equals(\"\")) { //list in ascending displayOrder\n returnedString += \"least:\\n\";\n for (Map.Entry<Integer, TreeMap<String, Word>> entry : wordCountMap.entrySet()) {\n returnedString += entry.getKey() + \" searches -\\n\";\n for (Map.Entry<String, Word> word : entry.getValue().entrySet()) {\n returnedString += word.getKey() + \"\\n\";\n }\n }\n } else { //list in descending displayOrder\n returnedString += \"most:\\n\";\n for (Integer searchCount : wordCountMap.descendingKeySet()) {\n returnedString += searchCount + \" searches -\\n\";\n for (Map.Entry<String, Word> word : wordCountMap.get(searchCount).entrySet()) {\n returnedString += word.getKey() + \"\\n\";\n }\n }\n }\n return returnedString;\n }",
"public static void main(String[] args) {\n\t\t\n\t\tif (args.length != 1) {\n\t\t\tthrow new IllegalArgumentException(\"Usage: java WordCount <URL>\");\n\t\t}\n\t\tString site = args[0];\n\t\t\n\t\t// If efficiency becomes important, a BufferedInputStream could be used in place of Jsoup.\n\t\t// This would prevent multiple passes over the text, but would introduce the challenge of\n\t\t// reading between HTML tags.\n\t\tString text;\n\t\ttry {\n\t\t\ttext = Jsoup.connect(site).get().text();\n\t\t} catch (IllegalArgumentException e) {\n\t\t\t// Attempt to connect with https:// protocol prepended\n\t\t\ttry {\n\t\t\t\tsite = \"https://\" + site;\n\t\t\t\ttext = Jsoup.connect(site).get().text();\n\t\t\t} catch (IllegalArgumentException a) {\n\t\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded. \"\n\t\t\t\t\t\t+ \"Usage: java WordCount <URL>\");\n\t\t\t} catch (IOException m) {\n\t\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded. \"\n\t\t\t\t\t\t+ \"Usage: java WordCount <URL>\"); \n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tthrow new IllegalArgumentException(\"Page cannot be loaded.\"\n\t\t\t\t\t+ \" Usage: java WordCount <URL>\");\n\t\t} \n\t\t\n\t\t// Split text into array using alphabetical (multiple languages) and \n\t\t// apostrophe characters\n\t\tString[] textArr = text.split(\"[^\\\\p{L}'’]+\");\n\t\tTree dictionary = new Tree();\n\t\tfor (int i = 0; i < textArr.length; i++) {\n\t\t\tdictionary.insert(textArr[i].toLowerCase());\n\t\t}\n\t\t\n\t\t// Build array using the dictionary. A more efficient solution would involve using a \n\t\t// sorted LinkedList of size 25, and only adding Nodes to the list if they are greater\n\t\t// than the current least Node, adding the new lowest value to the tail with \n\t\t// each insertion.\n\t\tNode[] arr = dictionary.toArray();\n\t\tArrays.sort(arr);\n\t\tfor (int i = 0; i < NUMBER_OF_WORDS; i++) {\n\t\t\tif (i < arr.length) {\n\t\t\t\tSystem.out.printf(\"%-12s%10d\\n\", arr[i].getWord(), arr[i].getCount());\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"WordCounter(){\r\n }",
"public void populateDataStructure() {\n\t\tfp.initiateFileProcessing();\r\n\t\tint length=0,i=0;\r\n\t\twhile(true)\r\n\t\t{\r\n\t\t\tstr=fp.readOneLine();\r\n\t\t\tif(str==null){\r\n\t\t\t\t//System.out.println(\"------\");\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//System.out.println(str);\r\n\t\t\t\tString[] line=str.split(\"\\\\s+\");\r\n\t\t\t\t\r\n\t\t\t\tfor(i=0;i<line.length;i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t//System.out.println(line[i]);\r\n\t\t\t\t\tif(line[i].length()>0){\r\n\t\t\t\t\t\tsbbst.insert(line[i]);\r\n\t\t\t\t\t\tcount++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//length--;\r\n\t\t\t\t\t//i++;\r\n\t\t\t\t}\r\n\t\t\t\t//System.out.println(line.length);\r\n\t\t\t\t//while((length=line.length)>0 & i<=length-1)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(line[i]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t//System.out.println(line[i]);\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*while(true)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(true){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tSystem.out.println(line[i]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t}*/\r\n\t\t\t\t\tlength--;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\t//System.out.println(length+\"\\n\"+i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//sbbst.inorder();\r\n\t\t//System.out.println(\"Total Words: \"+ count);\r\n\t\t//sbbst.inorder();\r\n\t\t//System.out.println(\"Distinct Words: \"+ sbbst.distinctCount);\r\n\t\tfp.closeFiles();\r\n\t}",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n \n \n File textBank = new File(\"textbank/\");\n Hashtable<Integer,Integer> frequency;\n Hashtable<Integer, String> table;\n table = new Hashtable<>();\n frequency = new Hashtable<>();\n Scanner input = new Scanner(new File(\"stoplist.txt\"));\n int max=0;\n while (input.hasNext()) {\n String next;\n next = input.next();\n if(next.length()>max)\n max=next.length();\n table.put(next.hashCode(), next); //to set up the hashmap with the wordsd\n \n }\n \n System.out.println(max);\n \n Pattern p0=Pattern.compile(\"[\\\\,\\\\=\\\\{\\\\}\\\\\\\\\\\\\\\"\\\\_\\\\+\\\\*\\\\#\\\\<\\\\>\\\\!\\\\`\\\\-\\\\?\\\\'\\\\:\\\\;\\\\~\\\\^\\\\&\\\\%\\\\$\\\\(\\\\)\\\\]\\\\[]\") \n ,p1=Pattern.compile(\"[\\\\.\\\\,\\\\@\\\\d]+(?=(?:\\\\s+|$))\");\n \n \n \n wor = new ConcurrentSkipListMap<>();\n \n ConcurrentMap<String , Map<String,Integer>> wordToDoc = new ConcurrentMap<String, Map<String, Integer>>() {\n @Override\n public Map<String, Integer> putIfAbsent(String key, Map<String, Integer> value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean remove(Object key, Object value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean replace(String key, Map<String, Integer> oldValue, Map<String, Integer> newValue) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> replace(String key, Map<String, Integer> value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int size() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean isEmpty() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean containsKey(Object key) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean containsValue(Object value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> get(Object key) {\n return wor.get((String)key);//To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> put(String key, Map<String, Integer> value) {\n wor.put(key, value); // this saving me n \n //if(frequency.get(key.hashCode())== null)\n \n //frequency.put(key.hashCode(), )\n return null;\n }\n\n @Override\n public Map<String, Integer> remove(Object key) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public void putAll(Map<? extends String, ? extends Map<String, Integer>> m) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public void clear() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Set<String> keySet() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Collection<Map<String, Integer>> values() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Set<Map.Entry<String, Map<String, Integer>>> entrySet() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n };\n totalFiles = textBank.listFiles().length;\n for (File textFile : textBank.listFiles()) {\n totalReadFiles++;\n //checking whether file has txt extension and file size is higher than 0\n if(textFile.getName().contains(\".txt\") && textFile.length() > 0){\n docName.add(textFile.getName().replace(\".txt\", \".stp\"));\n StopListHandler sp = new StopListHandler(textFile, table,System.currentTimeMillis(),p0,p1,wordToDoc);\n sp.setFinished(() -> {\n \n tmp++;\n \n if(tmp==counter)\n //printTable(counter);\n \n if(totalReadFiles == totalFiles)\n {\n printTable(counter);\n }\n \n });\n \n sp.start();\n counter ++;}\n \n \n }\n System.out.println(counter);\n //while(true){if(tmp==counter-1) break;}\n System.out.println(\"s\");\n \n }",
"private void buildFreqMap() {\n\t\toriginalFreq = new HashMap<String, WordOccurence>();\n\n\t\tfor (ListIterator<Caption> itr = original.captionIterator(0); itr\n\t\t\t\t.hasNext();) {\n\t\t\tfinal Caption currentCap = itr.next();\n\t\t\tfinal String[] words = currentCap.getCaption().split(\"\\\\s+\");\n\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\tfinal String lowerCasedWord = words[i].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(lowerCasedWord)) {\n\t\t\t\t\toriginalFreq.get(lowerCasedWord).addOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t} else {\n\t\t\t\t\tfinal WordOccurence occ = new WordOccurence(\n\t\t\t\t\t\t\t(int) currentCap.getTime());\n\t\t\t\t\toriginalFreq.put(lowerCasedWord, occ);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < identified.size(); i++) {\n\t\t\tResultChunk curretResult = identified.get(i);\n\t\t\tfinal String[] words = curretResult.getDetectedString().split(\n\t\t\t\t\t\"\\\\s+\");\n\t\t\tint identifiedAt = curretResult.getDetectedAt();\n\t\t\tfor (int j = 0; j < words.length; j++) {\n\t\t\t\tString currentWord = words[j].toLowerCase();\n\t\t\t\tif (originalFreq.containsKey(currentWord)) {\n\t\t\t\t\tint detectedAt = (int) (identifiedAt - (words.length - j)\n\t\t\t\t\t\t\t* AVG_WORD_TIME);\n\t\t\t\t\toriginalFreq.get(currentWord).addVoiceDetection(detectedAt);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\ttempS=scores[i];\r\n \t\t\tscores[i]=scores[i-1];\r\n \t\t\tscores[i-1]=tempS;\r\n \t\t\t\r\n \t\t\tString tempN;\r\n \t\t\ttempN=names[i];\r\n \t\t\tnames[i]=names[i-1];\r\n \t\t\tnames[i-1]=tempN;\r\n \t\t\tcount++;\r\n \t\t}\r\n \t}\r\n }",
"public void addWordCount(){\r\n\t\twordCount = wordCount + 1;\r\n\t}",
"public Pair[] top10Words(){\n Pair[] top10Words = new Pair[10];\n int top10LeastOccurrence = 9;\n\n for (String word : matchedSongs.keySet()){\n int currentSize = matchedSongs.get(word).size();\n //Array is sorted from greatest to least, just need to compare last value to current value.\n //Sorting after insertion will ensure it is in order for next time we perform a compare.\n if (top10Words[top10LeastOccurrence] == null || (int) top10Words[top10LeastOccurrence].getValue() < currentSize){\n top10Words[top10LeastOccurrence] = new Pair(word, currentSize);\n Arrays.sort(top10Words, new SortByHighestPair());\n }\n }\n return top10Words;\n }",
"private TreeMap<String, Integer> getWordsCount(TreeMap<String, ArrayList<String>> wordFamilies, ArrayList<String> allPatterns) {\r\n \t// get all the patterns first\r\n \tfor (int i = 0; i < allPatterns.size(); i++) {\r\n \t\twordFamilies.put(allPatterns.get(i), new ArrayList<String>());\r\n \t}\r\n \t// add the words into each pattern\r\n \tfor (String s : wordFamilies.keySet()) {\r\n \t\tfor (int i = 0; i < allPatterns.size(); i++) {\r\n \t\t\tif (s.equals(allPatterns.get(i))) {\r\n \t\t\t\tArrayList<String> curr = wordFamilies.get(s);\r\n \t\t\t\tcurr.add(this.activeWords.get(i));\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t// get the number of words in each pattern\r\n \tTreeMap<String, Integer> results = new TreeMap<String, Integer>();\r\n \tfor (String s : wordFamilies.keySet()) {\r\n \t\tresults.put(s, wordFamilies.get(s).size());\r\n \t}\r\n \treturn results;\r\n }",
"ThreadCountWords(String offer, String name) {\n super(name);\n this.offer = offer;\n }",
"public List<String> topKFrequent(String[] words, int k) {\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n\n for (String s : words) {\n map.put(s, map.getOrDefault(s, 0) + 1);\n }\n \n ArrayList<Integer> allFrequencies = new ArrayList<Integer>();\n\n \n map.forEach((key,v) -> allFrequencies.add(v));\n IO.printArrayList(allFrequencies);\n // Add all the frequencies into allFrequencies arraylist\n int totalAmountOfWords = map.keySet().size();\n \n // Find the k th largest number in the allFrequencies arraylist\n //System.out.println(\"total: \"+totalAmountOfWords);\n int newK = totalAmountOfWords - k;\n //System.out.println(\"newk: \"+ newK);\n int newkth = findKth(allFrequencies, newK);\n //System.out.println(\"new kth element:\"+newkth);\n int newKthElement = newK > 0 ? newkth : 0 ;\n \n TreeMap<Integer, TreeSet<String>> reverseSortedMap = new TreeMap<Integer, TreeSet<String>>(Collections.reverseOrder());\n map.forEach((key,v) -> {if (v >= newKthElement ) {\n if(!reverseSortedMap.containsKey(v)) reverseSortedMap.put(v, new TreeSet<String>());\n reverseSortedMap.get(v).add(key);}});\n \n List<String> result = new ArrayList<String>();\n reverseSortedMap.forEach((key,v) -> {result.addAll(v);});\n \n return result.size() > k? result.subList(0, k): result;\n }",
"@Override\r\n\t\t\t\tpublic Tuple2<String, Integer> call(WordCount t) throws Exception {\n\t\t\t\t\treturn new Tuple2<>(t.getWord() , new Integer(t.getCount()));\r\n\t\t\t\t\t\r\n\t\t\t\t}",
"public static void main(String[] args) {\n String s = \"9988777yyhhgfvvvvvvddsseeeeww3344\";\n System.out.println(frequencySort(s));\n }",
"public static void main(String[] arg) {\n\t\tMyPriorityQueue pq = new MyPriorityQueue();\n\n\t\tpq.enqueue(2, \"apple\");\t// medium priority\n\t\tpq.enqueue(3, \"candy\");\t// low priority\n\t\tpq.enqueue(1, \"milk\");\t// high priority\n\t\tpq.enqueue(1, \"cheese\");// high priority\n\t\tpq.enqueue(2, \"banana\");// medium priority\n\t\tpq.peek();\n\t\tpq.dequeue();\t\t\t// ----> milk come out first although it was not the first one enter the queue!\n\t\tpq.peek();\n\t\tpq.enqueue(3, \"gum\");\t// low priority\n\t\tpq.dequeue();\t\t\t// ----> cheese come out next\n\t\tpq.peek();\n\t\tpq.enqueue(2, \"kiwi\");\t// low priority\n\t\tpq.dequeue();\t\t\t// apple come out after ALL high priority items had dequeued.\n\t\tpq.dequeue();\t\t\t// ----> banana\n\t\tpq.dequeue();\t\t\t// ----> kiwi\n\t\tpq.peek();\n\t\tpq.enqueue(1, \"fish\");\t// high priority\n\t\tpq.enqueue(2, \"apple\");\t// medium priority\n\t\tpq.peek();\n\t\tpq.dequeue();\t\t\t// ----> fish\n\t\tpq.dequeue();\t\t\t// ----> apple\n\t\tpq.dequeue();\t\t\t// ----> kiwi\n\t\tpq.dequeue();\t\t\t// ----> candy\n\t\tpq.peek();\n\t\tpq.enqueue(2, \"kiwi\");\t// medium priority\n\t\tpq.enqueue(1, \"cheese\");// high priority\n\t\tpq.peek();\n\t\n\t}",
"public List<String> getSortedResults() {\r\n\t\tList<String> subset;\r\n\t\tif (filter == null) {\r\n\t\t\tsubset = allWords;\r\n\t\t} else {\r\n\t\t\tsubset = getFilteredWords();\r\n\t\t}\r\n\t\tsortResults(subset);\r\n\t\tint wordCount = Math.min(subset.size(), wordLimit);\r\n\t\tArrayList<String> result = new ArrayList<String>(wordCount);\t\r\n\t\tresult.addAll(subset.subList(0, wordCount));\r\n\t\treturn result;\r\n\t}"
] | [
"0.6658995",
"0.6466827",
"0.6426262",
"0.6313544",
"0.6032443",
"0.5942911",
"0.5939923",
"0.58262336",
"0.5818649",
"0.5815562",
"0.5813544",
"0.5748839",
"0.57404464",
"0.57371116",
"0.5718703",
"0.5718603",
"0.5718346",
"0.56544715",
"0.5615602",
"0.56124073",
"0.5607851",
"0.5606428",
"0.55771047",
"0.5574766",
"0.5569663",
"0.55129117",
"0.55100316",
"0.5504099",
"0.55024964",
"0.5465951",
"0.5389595",
"0.5386425",
"0.5386136",
"0.53861064",
"0.5379222",
"0.53775686",
"0.5361581",
"0.53417945",
"0.53279483",
"0.5287492",
"0.5282386",
"0.5276198",
"0.52720916",
"0.5269804",
"0.52655333",
"0.52535105",
"0.5241137",
"0.5229253",
"0.521812",
"0.52171284",
"0.52060443",
"0.5200153",
"0.51902735",
"0.51840436",
"0.5146779",
"0.5090962",
"0.508796",
"0.5081712",
"0.50706965",
"0.50706077",
"0.5066444",
"0.50650233",
"0.5059171",
"0.5057708",
"0.5057611",
"0.5051141",
"0.5051081",
"0.5040942",
"0.50370586",
"0.5035756",
"0.5031543",
"0.5029577",
"0.50236666",
"0.50146145",
"0.50072956",
"0.50021595",
"0.49976423",
"0.49850175",
"0.49816948",
"0.4976184",
"0.49750096",
"0.49705982",
"0.49694583",
"0.49506378",
"0.4946384",
"0.494184",
"0.49405393",
"0.4936265",
"0.4934176",
"0.4919535",
"0.4919118",
"0.49185616",
"0.4911913",
"0.49074578",
"0.49074396",
"0.49062806",
"0.49057987",
"0.48982704",
"0.48974138",
"0.48971567"
] | 0.72684574 | 0 |
TODO Autogenerated method stub | @Override
public int compare(Object arg0, Object arg1) {
WordCount wc1 = (WordCount) arg0;
WordCount wc2 = (WordCount) arg1;
if(wc1.count > wc2.count){
return -1;
}
else if(wc1.count < wc2.count){
return 1;
}
return 0;
} | {
"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 |
overloading when have same name with different arguments | public ChildOfInheritance(String name) {
super(name, 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean isMoreSpecific (MethodType type) throws OverloadingAmbiguous {\r\n boolean status = false;\r\n\r\n try {\r\n for (int i = 0, size = arguments.size (); i < size; i++) {\r\n\tIdentifier this_arg = (Identifier) arguments.elementAt (i);\r\n\tIdentifier target_arg = (Identifier) type.arguments.elementAt (i);\r\n\r\n\tint type_diff = this_arg.type.compare (target_arg.type);\r\n\tif (type_diff == 0)\r\n\t continue;\r\n\telse if (type_diff > 0) {\r\n\t if (status == true) throw new OverloadingAmbiguous ();\r\n\t} else {\r\n\t if (i != 0) throw new OverloadingAmbiguous ();\r\n\t status = true;\r\n\t}\r\n }\r\n } catch (OverloadingAmbiguous ex) {\r\n throw ex;\r\n } catch (TypeMismatch ex) {\r\n throw new OverloadingAmbiguous ();\r\n }\r\n\r\n return status;\r\n }",
"static void add() {\r\n\t\tSystem.out.println(\"Overloading Method\");\r\n\t}",
"public static void main(String[] args) {\n\t\tP92_Overloading_Sample obj=new P92_Overloading_Sample();\n\t\tSystem.out.println(obj.add());//30\n\t\tSystem.out.println(obj.add(500));//530\n\t\tSystem.out.println(obj.add(200, 300.9f));//500\n\t\tSystem.out.println(obj.add(55, 500));//555\n\t}",
"public static void main(String[] args) {\n methodOverloading();\n }",
"public static void main(String[] args) {\n\t\tOverloadingType1 ot1 = new OverloadingType1();\n\t\tshort a=3, b=6;\n\t\tot1.add(2, 3);\n\t\tot1.add(a, b);\n\t\tot1.add(a);\n\t\t\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tMethodOverloading7.add(1, 2, 3);\n\t\tMethodOverloading7.add(1, 2l, 3l);\n\t\tMethodOverloading7.add(1, 2, 3l);\n\t}",
"public void openen() {\n System.out.println(\"2.Overloaded methode zonder argument\");\n }",
"public interface a {\n void a(int i, O o, Object obj);\n\n void a(int i, String str);\n }",
"public void sum(int a, int b)\r\n\t{\r\n\t\tint c=a+b;\r\n\t\tSystem.out.println(\"Addition of 2 no [method overloading] : \" + c);\r\n\t\t\r\n\t}",
"public abstract void a(b paramb, int paramInt1, int paramInt2);",
"public static void main(String[] args) {\r\n\t\t\r\n\t\tMethodOverloading m = new MethodOverloading();\r\n\t\tm.sum();\r\n\t\tm.sum(15, 15);\r\n\t\t\r\n\t}",
"public static void main(String[] args) {\n\t\tOverloadingAdditionEx ad=new OverloadingAdditionEx();\n\t\tad.add(10, 20);\n\t\tad.add(10,20, 30);\n\t\tad.add(20.5f, 10.7f);\n\t\tad.add(10, 20.6f);\n\n\t}",
"public static void main(String[] args) {\n\t\t\r\n\t\tCompleOverloadDemo1 obj = new CompleOverloadDemo1();\r\n\t\t\r\n\t\tobj.add(1, 3); \t\t\t\t\t\t\t\t\t\t//Calling first function with 2 parameters\r\n\t\tobj.add(3.2, 3);\t\t\t\t\t\t\t\t\t//Calling second function with 2 different type of parameters\r\n\t\tobj.add(2, 3, 1);\t\t\t\t\t\t\t\t\t//Calling third function with 3 parameters\r\n\t\tobj.add(3, 3.4);\t\t\t\t\t\t\t\t\t//Calling Forth function with 2 different type of parameters in different order\r\n\r\n\t}",
"public interface xe {\n Object a(int i, Class cls);\n\n Object a(Class cls);\n\n void a();\n\n void a(int i);\n\n void a(Object obj);\n}",
"public void testOverloadedMethods(){\n System.out.printf(\"Square of integer 7 is %d\\n\", square(7));\n System.out.printf(\"Square of double 7.5 is %f\\n\", square(7.5));\n }",
"public interface IMostSpecificOverloadDecider\n{\n OverloadRankingDto inNormalMode(\n WorkItemDto workItemDto, List<OverloadRankingDto> applicableOverloads, List<ITypeSymbol> argumentTypes);\n\n //Warning! start code duplication, more or less the same as in inNormalMode\n List<OverloadRankingDto> inSoftTypingMode(\n WorkItemDto workItemDto, List<OverloadRankingDto> applicableOverloads);\n}",
"@Override\n\tpublic void javaMethodBaseWithTwoParams(long longParam, double doubleParam) {\n\t\t\n\t}",
"public AmbiguousMethodException() {\n super();\n }",
"public StringUnionFunc() {\n\t super.addLinkableParameter(\"str1\"); \n\t\t super.addLinkableParameter(\"str2\"); \n }",
"protected void a(int paramInt1, int paramInt2, boolean paramBoolean, yz paramyz) {}",
"ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}",
"public interface b {\n void a(int i, String str, String str2, String str3);\n\n void a(long j);\n }",
"public void b(int paramInt1, int paramInt2) {}",
"public void b(int paramInt1, int paramInt2) {}",
"S op(final S a, final S b);",
"public static void main(String[] args) {\n\n MethodOverloading mo = new MethodOverloading();\n mo.sum();\n int s1 = mo.sum(4,9,7);\n System.out.println(\"With three params sum is : \"+s1);\n int s2 = mo.sum(6,8);\n System.out.println(\"With two params sum is : \"+s2);\n\n }",
"public static void main(String[] args) {\n\t\t\r\n\t\t\r\n\t\toverload2 ov=new overload2();\r\n\t\tint i=88;\r\n\t\tov.test();\r\n\t\tov.test(10, 20);\r\n\t\tov.test(i);//test(double a) exacute \r\n\t\tov.test(123.2);\r\n\r\n\r\n\t}",
"private static void a(Object param0, Class<?> param1) {\n }",
"public static void main(String[] args) {\n\n Method();\n Method(10);\n Method(\"Hello\");\n Method(10, 20);\n // Multiple methods can have the same name as long as the number and/or type of parameters are different.\n \n }",
"public static void main(String[] args) {\n\t\t\n\t\tmethodoverloading mol = new methodoverloading();\n\t\toverriding ovr = new overriding();\n\t\t\n\t\tSystem.out.println(mol.sum(5, 7));\n\t\tSystem.out.println(mol.sum(10, 5, 8));\n\t\tmol.print();\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t}",
"OverloadedFunctionDescriptor() {\n super();\n this.overloads = new ArrayList<>();\n }",
"protected abstract void handle(Object... params);",
"@Override\n\tprotected void merge(Object in1, Object in2, Object out) {\n\t\t\n\t}",
"public AmbiguousMethodException(String s) {\n super(s);\n }",
"class_1069 method_104(int var1, int var2);",
"public abstract boolean a(e parame, b paramb, int paramInt1, int paramInt2);",
"public static void add(int a,int b){ }",
"interface A9 {\r\n void test(int i, String s1); //test method is taking some argument\r\n}",
"class_1069 method_105(int var1, int var2);",
"int foo(int a, int b);",
"public interface AbstractC2930hp1 {\n void a(String str, boolean z);\n\n void b(String str, long j);\n\n void c(String str, int i, int i2, int i3, int i4);\n\n void d(String str, int i);\n\n void e(String str, int i, int i2, int i3, int i4);\n}",
"@OOPMultipleInterface\npublic interface I7D {\n @OOPMultipleMethod\n default String f(Object p1, Object p2, Object p3) throws OOPMultipleException {return \"\";}\n @OOPMultipleMethod\n default String f(Integer p1, Object p2, E p3) throws OOPMultipleException {return \"\";}\n}",
"boolean method_107(boolean var1, class_81 var2);",
"public abstract void zza(zzk zzk, zzk zzk2);",
"public static void main(String[] args) throws ClassNotFoundException {\n\t\t\n\t\tFunctionOverloading func = new OverridingFunction();\n\t\tfunc.function();\n//\t\tfunc.functionOverloading(\"Sravan\");\n//\t\t\n//\t\tfunc.functionOverloading();\n//\t\t\n//\t\tfunc.funtionOver(32);\n//\t\tSystem.out.println(\"Data Member: \"+func.number);\n\t}",
"public getType_args(getType_args other) {\n }",
"protected void a(int paramInt1, int paramInt2, boolean paramBoolean, EntityPlayer paramahd) {}",
"public abstract void mo70711a(String str, String str2);",
"interface dmf {\n void a(int i, double d);\n\n void a(int i, float f);\n\n void a(int i, int i2);\n\n void a(int i, long j);\n\n void a(int i, dik dik);\n\n void a(int i, Object obj);\n\n void a(int i, Object obj, dkw dkw);\n\n void a(int i, boolean z);\n\n void b(int i, int i2);\n\n void b(int i, long j);\n\n @Deprecated\n void b(int i, Object obj, dkw dkw);\n\n void c(int i, int i2);\n\n void c(int i, long j);\n\n void d(int i, int i2);\n\n void d(int i, long j);\n\n void e(int i, int i2);\n\n void e(int i, long j);\n\n void f(int i, int i2);\n}",
"public interface i\n{\n\n public abstract void a(long l, a a1);\n}",
"public void a(int paramInt1, int paramInt2, float paramFloat)\r\n/* 23: */ {\r\n/* 24:22 */ a(0, 0, this.l, this.m, -12574688, -11530224);\r\n/* 25: */ \r\n/* 26:24 */ a(this.q, this.a, this.l / 2, 90, 16777215);\r\n/* 27:25 */ a(this.q, this.f, this.l / 2, 110, 16777215);\r\n/* 28: */ \r\n/* 29:27 */ super.a(paramInt1, paramInt2, paramFloat);\r\n/* 30: */ }",
"private static boolean isMoreSpecific(AccessibleObject more, Class<?>[] moreParams, boolean moreVarArgs, AccessibleObject less, Class<?>[] lessParams, boolean lessVarArgs) { // TODO clumsy arguments pending Executable in Java 8\n if (lessVarArgs && !moreVarArgs) {\n return true; // main() vs. main(String...) on []\n } else if (!lessVarArgs && moreVarArgs) {\n return false;\n }\n // TODO what about passing [arg] to log(String...) vs. log(String, String...)?\n if (moreParams.length != lessParams.length) {\n throw new IllegalStateException(\"cannot compare \" + more + \" to \" + less);\n }\n for (int i = 0; i < moreParams.length; i++) {\n Class<?> moreParam = Primitives.wrap(moreParams[i]);\n Class<?> lessParam = Primitives.wrap(lessParams[i]);\n if (moreParam.isAssignableFrom(lessParam)) {\n return false;\n } else if (lessParam.isAssignableFrom(moreParam)) {\n return true;\n }\n if (moreParam == Long.class && lessParam == Integer.class) {\n return false;\n } else if (moreParam == Integer.class && lessParam == Long.class) {\n return true;\n }\n }\n // Incomparable. Arbitrarily pick one of them.\n return more.toString().compareTo(less.toString()) > 0;\n }",
"ConstuctorOverloading(int num){\n\t\tSystem.out.println(\"I am contructor with 1 parameter\");\n\t}",
"public abstract void mo102900a(int i, int i2);",
"@Override\npublic void sub(int a, int b) {\n\t\n}",
"public interface b {\n void a(long j);\n\n void a(boolean z);\n\n void e();\n }",
"boolean overrides(MethodDeclaration sub, MethodDeclaration sup);",
"List method_111(class_922 var1, int var2, int var3, int var4);",
"void mo12652i(String str, String str2, Object... objArr);",
"private boolean methodEqueals(Method m1, Method m2) {\n\t\tif (m1.getName() == m2.getName()) {\n\t\t\tif (!m1.getReturnType().equals(m2.getReturnType()))\n\t\t\t\treturn false;\n\t\t\tClass<?>[] params1 = m1.getParameterTypes();\n\t\t\tClass<?>[] params2 = m2.getParameterTypes();\n\t\t\tif (params1.length == params2.length) {\n\t\t\t\tfor (int i = 0; i < params1.length; i++) {\n\t\t\t\t\tif (params1[i] != params2[i])\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"void mo12651e(String str, String str2, Object... objArr);",
"interface cl {\n void b(List<a> list, List<String> list2);\n}",
"public Method getMethodByParameters(String name, Class<?>... args) {\r\n \t\t\r\n \t\t// Find the correct method to call\r\n \t\tfor (Method method : getMethods()) {\r\n \t\t\tif (Arrays.equals(method.getParameterTypes(), args)) {\r\n \t\t\t\treturn method;\r\n \t\t\t}\r\n \t\t}\r\n \t\t\r\n \t\t// That sucks\r\n \t\tthrow new RuntimeException(\"Unable to find \" + name + \" in \" + source.getName());\r\n \t}",
"public static void main(String[] args) {\n\t\tMethodOverload m=new MethodOverload();\t\n\t\tint p=m.add(40,1);\n\t\t\t\tint q=m.add(10, 1);\n\t\tSystem.out.println(\"p=\" +p);\n\t\tSystem.out.println(\"q=\" +q);\n\t\t// TODO Auto-generated method stub\n\n\t}",
"private ContractMethod findMatchedInstance(List arguments) {\n List<ContractMethod> matchedMethod = new ArrayList<>();\n\n if(this.getInputs().size() != arguments.size()) {\n for(ContractMethod method : this.getNextContractMethods()) {\n if(method.getInputs().size() == arguments.size()) {\n matchedMethod.add(method);\n }\n }\n } else {\n matchedMethod.add(this);\n }\n\n if(matchedMethod.size() == 0) {\n throw new IllegalArgumentException(\"Cannot find method with passed parameters.\");\n }\n\n if(matchedMethod.size() != 1) {\n LOGGER.warn(\"It found a two or more overloaded function that has same parameter counts. It may be abnormally executed. Please use *withSolidityWrapper().\");\n }\n\n return matchedMethod.get(0);\n }",
"public abstract void mo70715b(String str, String str2);",
"public interface RestrictVatIdNumber<SELF extends Restrict<SELF>> extends Restrict<SELF>\n{\n\n default SELF vatIdNumber(String... numbers)\n {\n return restrict(\"vatIdNumber\", (Object[]) numbers);\n }\n\n default SELF vatIdNumbers(Collection<String> numbers)\n {\n return vatIdNumber(numbers.toArray(new String[numbers.size()]));\n }\n\n}",
"public abstract void m1(int a);",
"public interface ayt {\n /* renamed from: a */\n int mo1635a(long j, List list);\n\n /* renamed from: a */\n long mo1636a(long j, alb alb);\n\n /* renamed from: a */\n void mo1637a();\n\n /* renamed from: a */\n void mo1638a(long j, long j2, List list, ayp ayp);\n\n /* renamed from: a */\n void mo1639a(ayl ayl);\n\n /* renamed from: a */\n boolean mo1640a(ayl ayl, boolean z, Exception exc, long j);\n}",
"public interface HttpDriver {\n public <R,T> T execute(HttpMethod method, String uri, R entity, Type expected) throws HttpDriverException;\n}",
"protected void a(char paramChar, int paramInt) {}",
"void mo12654w(String str, String str2, Object... objArr);",
"public interface ad\n{\n\n public abstract void a(cs cs);\n\n public abstract void a(ds ds);\n}",
"@Test\n public void overloadingWorks() {\n assertThat(eval(\"10>5\"), equalTo(c(true)));\n assertThat(eval(\"10L>5L\"), equalTo(c(true)));\n assertThat(eval(\"TRUE>FALSE\"), equalTo(c(true)));\n assertThat(eval(\"'one' > 'zed'\"), equalTo(c(false)));\n }",
"public interface Product {\n\n void methodSame();\n\n void methodDiff();\n}",
"public interface s extends a {\n void a();\n\n void a(g gVar);\n\n void a(String str, boolean z);\n}",
"protected abstract Boolean applicable(Map<String, Object> parameters);",
"abstract void method();",
"public int a(String paramString, float paramFloat1, float paramFloat2, int paramInt)\r\n/* 234: */ {\r\n/* 235:243 */ return a(paramString, paramFloat1, paramFloat2, paramInt, true);\r\n/* 236: */ }",
"public interface tm<T, V> {\n void a(V v);\n\n void a(boolean z);\n}",
"Object isMatch(Object arg, String wantedType);",
"public interface dhd {\n InputStream a(Object obj);\n\n Object a(InputStream inputStream);\n}",
"public interface a {\n void a(int i, List<String> list, boolean z, long j, String str, String str2, String str3);\n }",
"@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FEnumerationType src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}",
"public static void add(float a,int b){ }",
"void id(int id, id id, int id) {}",
"public void a(Object obj) {\n }",
"public void a(long arg16, double arg18, double arg20) {\n }",
"public static void add(int a,float b){ }",
"abstract Function get(Object arg);",
"@Override\n public SubroutineDescriptor getOverload(List<ExpressionNode> actualParameters) throws LexicalException {\n for (SubroutineDescriptor descriptor : this.overloads) {\n if (this.compareActualWithFormatParameters(descriptor.getFormalParameters(), actualParameters)) {\n return descriptor;\n }\n }\n\n throw new LexicalException(\"Not existing overload for this subroutine\");\n }",
"public abstract interface QueryArgs {\n\n /** Return the catalog associated with this object */\n public Catalog getCatalog();\n\n /** Set the value for the ith parameter */\n public void setParamValue(int i, Object value);\n\n /** Set the value for the parameter with the given label */\n public void setParamValue(String label, Object value);\n\n /** Set the min and max values for the parameter with the given label */\n public void setParamValueRange(String label, Object minValue, Object maxValue);\n\n /** Set the int value for the parameter with the given label */\n public void setParamValue(String label, int value);\n\n /** Set the double value for the parameter with the given label */\n public void setParamValue(String label, double value);\n\n /** Set the double value for the parameter with the given label */\n public void setParamValueRange(String label, double minValue, double maxValue);\n\n /** Set the array of parameter values directly. */\n public void setParamValues(Object[] values);\n\n /** Get the value of the ith parameter */\n public Object getParamValue(int i);\n\n /** Get the value of the named parameter\n *\n * @param label the parameter name or id\n * @return the value of the parameter, or null if not specified\n */\n public Object getParamValue(String label);\n\n /**\n * Get the value of the named parameter as an integer.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public int getParamValueAsInt(String label, int defaultValue);\n\n /**\n * Get the value of the named parameter as a double.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public double getParamValueAsDouble(String label, double defaultValue);\n\n /**\n * Get the value of the named parameter as a String.\n *\n * @param label the parameter label\n * @param defaultValue the default value, if the parameter was not specified\n * @return the value of the parameter\n */\n public String getParamValueAsString(String label, String defaultValue);\n\n\n /**\n * Return the object id being searched for, or null if none was defined.\n */\n public String getId();\n\n /**\n * Set the object id to search for.\n */\n public void setId(String id);\n\n\n /**\n * Return an object describing the query region (center position and\n * radius range), or null if none was defined.\n */\n public CoordinateRadius getRegion();\n\n /**\n * Set the query region (center position and radius range) for\n * the search.\n */\n public void setRegion(CoordinateRadius region);\n\n\n /**\n * Return an array of SearchCondition objects indicating the\n * values or range of values to search for.\n */\n public SearchCondition[] getConditions();\n\n /** Returns the max number of rows to be returned from a table query */\n public int getMaxRows();\n\n /** Set the max number of rows to be returned from a table query */\n public void setMaxRows(int maxRows);\n\n\n /** Returns the query type (an optional string, which may be interpreted by some catalogs) */\n public String getQueryType();\n\n /** Set the query type (an optional string, which may be interpreted by some catalogs) */\n public void setQueryType(String queryType);\n\n /**\n * Returns a copy of this object\n */\n public QueryArgs copy();\n\n /**\n * Optional: If not null, use this object for displaying the progress of the background query\n */\n public StatusLogger getStatusLogger();\n}",
"public String overloadingMeth(int angka) { //contoh dari overloading method\n int x;\n x = angka % 10;\n valueword = \"\";\n if (angka == 0) {\n valueword = \"Nol\";\n\n } else if (angka == 100) {\n valueword = \"Seratus\";\n } else if (x == 0) {\n valueword += normalword[angka / 10] + \" Puluh\";\n\n } else if (angka < 12) {\n valueword += normalword[angka];\n } else if (angka < 20) {\n\n valueword += normalword[angka - 10] + \" Belas\";\n } else if (angka < 100) {\n valueword += normalword[angka / 10] + \" Puluh \" + normalword[angka % 10];\n } else if (angka > 100) {\n System.out.println(\"MASUKAN ERROR,ANGKA TIDAK BOLEH LEBIH DARI 100\");\n }\n return valueword;\n }",
"public abstract T zzg(T t, T t2);",
"@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FEnumerator src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}",
"public void a(String paramString, int paramInt1, int paramInt2, int paramInt3, int paramInt4)\r\n/* 569: */ {\r\n/* 570:573 */ e();\r\n/* 571:574 */ this.q = paramInt4;\r\n/* 572:575 */ paramString = d(paramString);\r\n/* 573: */ \r\n/* 574:577 */ a(paramString, paramInt1, paramInt2, paramInt3, false);\r\n/* 575: */ }",
"public int a(String paramString, int paramInt1, int paramInt2, int paramInt3)\r\n/* 239: */ {\r\n/* 240:247 */ return a(paramString, (float)paramInt1, (float)paramInt2, paramInt3, false);\r\n/* 241: */ }",
"void method_114(int var1, int var2);",
"@Override\n\t\t\t\t\tpublic Parameter handleParameter(Method parent,\n\t\t\t\t\t\t\tEParamType direction, FArgument src) {\n\t\t\t\t\t\treturn super.handleParameter(parent, direction, src);\n\t\t\t\t\t}",
"public static void mayAlias(Object a, Object b) {\n\t}",
"public static void method(Object obj){\n\t System.out.println(\"method with param type - Object\");\n\t }"
] | [
"0.66012186",
"0.64237267",
"0.6363478",
"0.63197464",
"0.6313164",
"0.6267364",
"0.62286645",
"0.6038884",
"0.5956919",
"0.5882475",
"0.5837548",
"0.5834295",
"0.5802394",
"0.57345563",
"0.5706043",
"0.5682415",
"0.56648356",
"0.56298393",
"0.56088305",
"0.5593512",
"0.5593223",
"0.55831105",
"0.55317277",
"0.55317277",
"0.5522621",
"0.550839",
"0.5493041",
"0.54917973",
"0.5449728",
"0.543985",
"0.5405428",
"0.53738254",
"0.53672",
"0.53612393",
"0.5350805",
"0.5307858",
"0.52544826",
"0.5249154",
"0.5235958",
"0.5226504",
"0.519162",
"0.5181441",
"0.51675874",
"0.5154756",
"0.5139907",
"0.5126415",
"0.51244146",
"0.5103536",
"0.5087908",
"0.50834745",
"0.5083145",
"0.50827086",
"0.5078414",
"0.5066498",
"0.5061988",
"0.5056611",
"0.505027",
"0.50469464",
"0.50436556",
"0.50429213",
"0.50404733",
"0.5038859",
"0.50239754",
"0.50124633",
"0.50019616",
"0.49909785",
"0.4990502",
"0.49656937",
"0.49633273",
"0.49607068",
"0.494431",
"0.49407554",
"0.492957",
"0.49277514",
"0.49146432",
"0.49092677",
"0.49022278",
"0.4883183",
"0.48743176",
"0.48726633",
"0.48608154",
"0.48563385",
"0.4853746",
"0.48514646",
"0.48486364",
"0.48449853",
"0.48449317",
"0.48448947",
"0.48420113",
"0.4838402",
"0.48369342",
"0.4833672",
"0.48263687",
"0.48234296",
"0.4813454",
"0.4812799",
"0.481156",
"0.48112032",
"0.48101932",
"0.480315",
"0.4802686"
] | 0.0 | -1 |
printSelf overrides parent's method of the same name. | public void printSelf() {
System.out.println("I am a child!");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tprotected void print() {\n\t\tSystem.out.println(\"-----------\"+this.getName()+\"\");\n\t}",
"@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}",
"public synchronized String print() {\r\n return super.print();\r\n }",
"@Override\n\t\tpublic void print() {\n\n\t\t}",
"@Override\r\n\tpublic void print() {\n\t}",
"@Override\n\tpublic void print() {\n\t\t\n\t}",
"public void print() {\n System.out.println(this.toString());\n }",
"@Override\n\tpublic void print() {\n\t\tInterfaceA.super.print();\n\t}",
"@Override\n\tpublic void print() {\n\n\t}",
"public void printYourself(){\n\t}",
"@Override\n public void print() {\n }",
"public void printYourself(){\n\t\tsuper.printYourself();\t// Invoke the superclass\n \t// (Animal) code\n \t// Then do Horse-specific\n \t// print work here\n\t}",
"@Override\n\tpublic void print() {\n\t\tSystem.out.print(\"\\nMSc. student:\\n\");\n\t\tsuper.print();\n\t}",
"public void print() {\n\t\tSystem.out.println(\\u000a);\n\t\tSystem.out.println(this.getClass().getName());\n\t\tClassB classB = new ClassB();\n\t\tclassB.print();\n\t}",
"@Override\n\tpublic void print() {\n\t\tSystem.out.println(\"print A\");\n\t}",
"public abstract void print();",
"@Override\n\tpublic void print() {\n\t\tdecoratedPrinter.print();\n\t}",
"@Override\n\tpublic void print() {\n\t\tsuper.print();\n\t\tSystem.out.println(\"ÎÒÊÇÒ»Ö»\"+this.getStrain()+\"È®.\");\n\t}",
"public void print() {\r\n\t\t System.out.println(toString());\r\n\t }",
"abstract void print();",
"public String toString() {\n return mySelf()+\"!\";\n }",
"public String toString() {\n return mySelf()+\"!\";\n }",
"public void print(){\r\n System.out.println(toString());\r\n }",
"public void print() {\n\t\tSystem.out.println(toString());\n\t}",
"public Inatnum print() {\n return this;}",
"@Override\n\tpublic void print() {\n\t\tSystem.out.print(\"MsgOwner\");\n\t}",
"public void print() {\n System.out.println(toString());\n }",
"public void print () {\n }",
"@Override\r\n\tprotected void prt(String str) {\n\t\tSystem.out.println(\"in child\");\r\n\t\t\r\n\t}",
"@VisibleForTesting\n void print();",
"@Override\n void show() {\n System.out.println(\"Child's show()\"); }",
"public void print() {\n\t\tPrinter.print(doPrint());\n\t}",
"public void print(){\n System.out.println(getBrain());//The value of brain passed in the main as parameter is rejected.\n super.print(); //However, if the same method is declared in Animal class, and called in main\n System.out.println(getBrain()); //the value of brain passed in main as parameter is printed.\n //It is basically a overridden method. The super.print() calls the superclass method\n }",
"private void printMe() {\n\t\tInnerClass inner = new InnerClass();\n\t\tinner.printMe();\n\t}",
"public void print() {\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\">> print()\");\n\t\t}\n\t\tSystem.out.println(p + \"/\" + q);\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\"<< print()\");\n\t\t}\n\t}",
"@Override\n\tpublic void print(int indent) {\n\t}",
"public void print(Object someObj) {\r\n this.print(someObj.toString());\r\n }",
"public static void printString(String print_this)\n {\n System.out.println(print_this);\n }",
"@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }",
"@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }",
"@Override\n protected void prettyPrintChildren(PrintStream s, String prefix) {\n }",
"public void println() { System.out.println( toString() ); }",
"abstract public void printInfo();",
"@Override\n public void print() {\n System.out.println(\"Hello World Old Style!!\");\n }",
"@Override\n\tpublic void printOne() {\n\t\tSystem.out.println(\"D's printOne\");\n\t}",
"public void print();",
"public void print();",
"public void print();",
"public void print();",
"public String print();",
"public void print(Object obj) {\n print(obj.toString());\n }",
"public void printDetails()\n {\n super.printDetails();\n System.out.println(\"The author is \" + author + \" and the isbn is \" + isbn); \n }",
"void printMsg(){\n\tdisplay();\n\t//This would call Overridden method\n\tsuper.display();\n }",
"public String print() {\n return print(new StringBuffer()).toString();\n }",
"public void print() {\n\t// Skriv ut en grafisk representation av kösituationen\n\t// med hjälp av klassernas toString-metoder\n System.out.println(\"A -> B\");\n System.out.println(r0);\n System.out.println(\"B -> C\");\n System.out.println(r1);\n System.out.println(\"turn\");\n System.out.println(r2);\n //System.out.println(\"light 1\");\n System.out.println(s1);\n //System.out.println(\"light 2\");\n System.out.println(s2);\n }",
"@Override\n\t\t\tpublic void print(String str) {\n\t\t\t\tSystem.out.println(str);\n\t\t\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}",
"@Override\n\tpublic void print() {\n System.out.println(\"Leaf [isbn=\"+number+\", title=\"+title+\"]\");\n\t}",
"public void print()\n {\n \tSystem.out.println(\"MOTO\");\n super.print();\n System.out.println(\"Tipo da partida: \" + tipoPartida);\n System.out.println(\"Cilindradas: \" + cilindradas);\n System.out.println();\n }",
"public void print() {\n System.out.println(\"Person of name \" + name);\n }",
"public void draw() {\r\n System.out.print(this);\r\n }",
"@Override\r\n\tpublic void print() {\n\t\tsuper.print();\r\n\t\tSystem.out.println(\"album=\" + album + \", year=\" + year);\r\n\t}",
"@Override\n\tpublic String print(CliPrinter printer) {\n\t\treturn printer.printTProductCards(this);\n\t}",
"@Override\r\n\tpublic String toString() {\r\n\t\treturn name + \": \" + super.toString();\r\n\t}",
"public void afficher() {\n System.out.println(this.toString());\n }",
"public void print() { /* FILL IN */ }",
"public String toDebugString() {\n StringBuffer str = new StringBuffer(mySelf()+\"\\n\");\n return super.toDebugString()+str.toString();\n }",
"public void print() {\n super.print();\r\n System.out.println(\"Hourly Wage: \" + hourlyWage);\r\n System.out.println(\"Hours Per Week: \" + hoursPerWeek);\r\n System.out.println(\"Weeks Per Year: \" + weeksPerYear);\r\n }",
"@Override\n public String print() {\n return this.text + \"\\n\" + \"1. \" + this.option1.text + \"\\n\" + \"2. \" + this.option2.text;\n }",
"public void printString() {\n\t\tSystem.out.println(name);\n\t\t\n\t\t\n\t}",
"public void print()\r\n\t{\r\n\t\tSystem.out.println(\"Method name: \" + name);\r\n\t\tSystem.out.println(\"Return type: \" + returnType);\r\n\t\tSystem.out.println(\"Modifiers: \" + modifiers);\r\n\r\n\t\tif(exceptions != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Exceptions: \" + exceptions[0]);\r\n\t\t\tfor(int i = 1; i < exceptions.length; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\", \" + exceptions[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exceptions: none\");\r\n\t\t}\r\n\r\n\t\tif(parameters != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Parameters: \" + parameters[0]);\r\n\t\t\tfor(int i = 1; i < parameters.length; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\", \" + parameters[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Parameters: none\");\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t}",
"public void print() {\n\t\tSystem.out.println(name + \" -- \" + rating + \" -- \" + phoneNumber);\n\t}",
"public void println(CardNode baseCardNode) {\r\n\t\tList<CardNode> cardNodeList = baseCardNode.getLighterNodeCollection();\r\n\t\t_logger.info(baseCardNode.getCard().toString());\r\n\r\n\t\tint i = 0;\r\n\t\tfor(CardNode cardNode:cardNodeList) {\r\n\t\t\tif(i != 0) {\r\n\t\t\t\t_logger.info(\"*****\");\r\n\t\t\t}\r\n\t\t\tprintln(cardNode);\r\n\t\t\ti++;\r\n\t\t}\r\n\t}",
"public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}",
"static void print (){\n \t\tSystem.out.println();\r\n \t}",
"public void print() {\n\t\tSystem.out.println(\"针式打印机打印了\");\n\t\t\n\t}",
"@Override\n\tpublic abstract String toString ();",
"@Override\n\tpublic void print() {\n\t\tSystem.out.print(amount + \" \" + currencyFrom + \" to \" + currencyTo + \" is \" + ans);\n\t}",
"void print(String s) {\n System.out.format(\"%s\", this.toString(s));\n }",
"@Override\n public void infixDisplay() {\n System.out.print(name);\n }",
"@Override\n public void carryChildInThePocket() {\n\n System.out.println(\"kangaroo with name \"+name+\" is carrying child in the pocket\");\n }",
"public PrintToStringSubscriber() {\n super(System.out::println);\n }",
"void print() {\n\t\n\t}",
"public void println() {\n\t\tprintln(\"\"); //$NON-NLS-1$\n\t}",
"public void print() {\n LinkedList i = this;\n\n System.out.print(\"LinkedList: \");\n while (i.next != null) {\n System.out.print(i.name + ' ');\n i = i.next;\n }\n System.out.print(i.name);\n }",
"public void printScreen() {\n\t\tBrowser.printScreen(this.getClass().getSimpleName());\n\t}",
"public static void print() {\r\n System.out.println();\r\n }",
"void print();",
"void print();",
"void print();",
"void print();",
"void print();",
"@Override\n public void print() {\n if (scoreData.getError() != null) {\n System.err.println(\"ERROR! \" + scoreData.getError());\n return;\n }\n\n // Frames\n printFrames();\n scoreData.getScores().forEach(score -> {\n // Player Names\n printNames(score);\n // Pinfalls\n printPinfalls(score);\n // Scores\n printScores(score);\n });\n }",
"@Override\n\tpublic void printInfo() {\n\t\tsuper.printInfo();\n\t\tmessage();\n\t\tdoInternet();\n\t\tmailing();\n\t\tcalling();\n\t\twatchingTV();\n\n\t}",
"public void printMessage() {\n printMessage(System.out::print);\n }",
"@Override\r\n public void dump ()\r\n {\r\n super.dump();\r\n System.out.println(\" line=\" + getLine());\r\n }",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();",
"@Override\n public abstract String toString();"
] | [
"0.77938217",
"0.75515604",
"0.7500201",
"0.7498214",
"0.7445468",
"0.74449265",
"0.74425524",
"0.74239635",
"0.74149203",
"0.74057454",
"0.73973215",
"0.7346974",
"0.73106647",
"0.72340083",
"0.715088",
"0.7099655",
"0.70496196",
"0.70436674",
"0.6988551",
"0.6976889",
"0.6971541",
"0.6965393",
"0.6965393",
"0.6915046",
"0.68864775",
"0.68766576",
"0.68515486",
"0.68160355",
"0.68130034",
"0.6757019",
"0.668589",
"0.6683778",
"0.66755223",
"0.66564935",
"0.66391784",
"0.6632518",
"0.66264164",
"0.6580715",
"0.65688497",
"0.65653956",
"0.65653956",
"0.65653956",
"0.65553033",
"0.65539336",
"0.6545144",
"0.65135086",
"0.65032274",
"0.65032274",
"0.65032274",
"0.65032274",
"0.6466526",
"0.6455641",
"0.6434816",
"0.64337283",
"0.6415621",
"0.641512",
"0.63943714",
"0.6393556",
"0.63756853",
"0.63595134",
"0.6346523",
"0.6341522",
"0.63143975",
"0.6312042",
"0.6297744",
"0.6253323",
"0.6242677",
"0.62424624",
"0.6232125",
"0.6227127",
"0.62247235",
"0.6208937",
"0.6207227",
"0.61951226",
"0.6194463",
"0.61891747",
"0.6182253",
"0.6178717",
"0.6168663",
"0.61677265",
"0.61591136",
"0.615864",
"0.6158356",
"0.6148926",
"0.61408913",
"0.613356",
"0.61278784",
"0.61275744",
"0.61269945",
"0.61269945",
"0.61269945",
"0.61269945",
"0.61269945",
"0.6124077",
"0.61204",
"0.61125726",
"0.6110022",
"0.6104025",
"0.6104025",
"0.6104025"
] | 0.75873446 | 1 |
Constructor for a leaf node. | public TreeNode(boolean alive) {
this.northWest = null;
this.northEast = null;
this.southWest = null;
this.southEast = null;
this.level = 0;
this.alive = alive;
this.population = alive ? 1 : 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Leaf(){}",
"public Leaf(T data) {\n this.data = data;\n this.progeny = 1;\n }",
"public LeafNode(Item item, ParentNode parent) {\n super(item, parent);\n }",
"public BinaryTreeLeaf(E value) {\n this.value = value;\n }",
"public Node()\n {\n \n name = new String();\n type = new String(\"internal\"); //Initial Node type set to internal\n length = new Double(0); //Set initial branch length to zero\n children = new ArrayList<Node>();\n level = 0;\n treesize = new Double(0);\n depth = 0;\n newicklength = 0;\n startycoord = -1;\n startxcoord = -1;\n endxcoord = -1;\n endycoord = -1;\n standardy = -1;\n selected = false;\n xmultiplier = 0;\n ymultiplier = 0;\n }",
"private LeafNode(Token newToken) {\r\n\t\tthis.token = newToken;\r\n\t}",
"public TreeNode(){ this(null, null, 0);}",
"public TreeRootNode() {\n super(\"root\");\n }",
"public Node(){}",
"public Tree(String label) {\n treeName = label;\n root = null;\n }",
"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 ContentLeaf(SequenceNumber branch, int startPosition, BeContentElement contentElement) {\n\tsuper(branch, startPosition);\n\tsetContentElement(contentElement);\n}",
"public Leaf(int value) {\n\t\t\tsuper();\n\t\t\tthis.value = value;\n\t\t}",
"Leaf(int size, Color color) {\n this.size = size;\n this.color = color;\n }",
"public BinaryNode() {\n\t\tthis(null);\t\t\t// Call next constructor\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 Node()\r\n {\r\n initialize(null);\r\n lbl = id;\r\n }",
"public void setLeaf(Integer leaf) {\n this.leaf = leaf;\n }",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public TrieNode() {\n map = new HashMap<Character, TrieNode>();\n isLeaf = false;\n }",
"public SimpleNodeLabel() {\n super();\n }",
"public BinaryTree(){}",
"@Override\n\tpublic boolean IsLeaf() {\n\t\treturn true;\n\t}",
"public Node(){\n\n\t\t}",
"public TreeNode() {\n }",
"public Tree()\n\t{\n\t\tsuper(\"Tree\", \"tree\", 0);\n\t}",
"public BinaryTree() {\n\t}",
"public TreeNode() {\n // do nothing\n }",
"public Tree() {\n // constructor. no nodes in tree yet\n root = null;\n }",
"public TDTree(TriangleShape root,int leafCapacity,StorageManager sm,JavaSparkContext sparkContext) {\n super(root,leafCapacity);\n triangleEncoder = new TriangleEncoder((TriangleShape)this.baseTriangle);\n storageManager=sm;\n leafInfos = new HashMap<>();\n\n emptyNodes = new ArrayList<String>();\n emptyNodes.add(\"1\");\n sparkRDD=null;\n constructedRDD= new AtomicBoolean(false);\n this.sparkContext=sparkContext;\n }",
"public Tree() // constructor\n\t{ root = null; }",
"public Node() {\r\n\t}",
"public Node() {\r\n\t}",
"public LinkedBinaryTree() { // constructs an empty binary tree\n\n }",
"private BinaryTree() {\n root = new Node(0);\n }",
"public Tree(){\n root = null;\n }",
"public AVLTree() \r\n\t{\r\n\t\tthis.root = new AVLNode(null);\r\n\t}",
"public TreeNode() { \n this.name = \"\"; \n this.rule = new ArrayList<String>(); \n this.child = new ArrayList<TreeNode>(); \n this.datas = null; \n this.candAttr = null; \n }",
"public BTNode(int value){ \r\n node = value; \r\n leftleaf = null;\r\n rightleaf = null;\r\n }",
"public Node() {\n\t}",
"public Node()\n {\n this.name=\"/\";\n this.type=0;\n this.stage=0;\n children=new ArrayList<Node>();\n }",
"public DLB(){\r\n\t\t//generate the root node with a terminating value\r\n\t\tnodes = new DLBNode('/');\r\n\t}",
"public FolderNode() {\n\t\t\tthis(null, 5);\n\t\t}",
"public SiteTreeLeaf(String rootId, String variableNode, int Node, PersistenceManager manager)\r\n\t\t\tthrows ClassNotFoundException, Exception {\r\n\t\tthis.sId = rootId;\r\n\t\tthis.moduleFunction = (ModuleFunction) manager.getById(ModuleFunction.class, rootId);\r\n\t\tthis.Node = Node;\r\n\t\tthis.variableNode = variableNode;\r\n\t\tthis.pm = manager;\r\n\t}",
"public BinaryTreeNode(T _data) {\n\t\t\t// Invoke the 2-parameter constructor with null parent\n\t\t\tthis(_data, null);\n\t\t}",
"public KdTree() \r\n\t{\r\n\t}",
"public Node() {\n }",
"public static final LeafNode build(Token token) {\r\n\t\tObjects.requireNonNull(token, \"Token value is null in LeafNode builder\");\r\n\t\treturn new LeafNode(token);\r\n\t}",
"public LinkedBinaryTree() {\n\t\t root = null;\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n public LeafNode(Key key, Value value) {\r\n keys = (Key[])new Comparable[3]; \r\n values = (Value[])new Object[3];\r\n setKeyValuePairs(key,value);\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}",
"private Node() {\n\n }",
"public TrieNode(){}",
"public Node(char myLetter, int myCount){\n\t\tletter = myLetter;\n\t\tcount = myCount;\n\t\tleftChild = null;\n\t\trightChild = null;\n\t}",
"public TreeNode(Object initValue)\r\n {\r\n this(initValue, null, null);\r\n }",
"public TrieNode() {\n this.children = new TrieNode[256];\n this.code = -1;\n }",
"public BLeafNode(E element, double xCoordinate, double yCoordinate)\n\t{\n\t\tsetX(xCoordinate);\n\t\tsetY(yCoordinate);\n\t\tcargo = element;\n\t}",
"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 boolean isLeaf()\n {\n return false;\n }",
"public BinaryTree() {\n root = null;\n }",
"public BinaryTree() {\n root = null;\n }",
"public KdTree() {\n }",
"public BinaryTree(){\r\n root = null;\r\n }",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"public AVLTree() {\n\t\tthis.root = null;\n\t}",
"public KdTree() \n\t {\n\t\t \n\t }",
"public Node() {\n\n }",
"public Integer getLeaf() {\n return leaf;\n }",
"public ChildNode() {\r\n\t\tsuper();\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}",
"boolean isLeaf() {\n return true;\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 HIRTree(){\r\n\t\t\r\n\t}",
"public BinaryTree() {\n count = 0;\n root = null;\n }",
"public Node(){\n }",
"public void setToLeaf() {\r\n isLeaf = true;\r\n }",
"public Node()\n\t{\n\t\toriginalValue = sumValue = 0;\n\t\tparent = -1;\n\t}",
"public TrieNode() {\n \n }",
"public MapNode()\n\t{\n\t\t// Call alternative constructor\n\t\tthis((AbstractNode)null);\n\t}",
"public TreeNode(Object e) {\n element = e;\n //this.parent = null;\n left = null;\n right = null;\n }",
"public void setLeaf(Commit c) {\n\t\tmyLeaf = c;\n\t}",
"public JdbTree() {\r\n this(new Object [] {});\r\n }",
"@Override\r\n\tpublic boolean isLeaf(Object node) {\r\n\t\r\n\t\treturn false;\r\n\t}",
"public TernaryTree() {\n root = null;\n\n }",
"FractalTree() {\r\n }",
"public Branch(E e) {\n\t\tinfo = e;\n\t\tisLeaf = true;\n\t}",
"public PiptDataLeaf(String name, Object value)\n {\n\tthis.name = name;\n\tthis.value = value;\n }",
"public Label() {\n\t\tthis(\"L\");\n\t}",
"public JdbTree(TreeNode root) {\r\n this(root, false);\r\n }",
"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 TrieNode() {\n children = new HashMap<>();\n isWord = false;\n }",
"public CassandraNode() {\r\n\t\tthis(null, 0);\r\n\t}",
"public ObjectBinaryTree() {\n root = null;\n }",
"public Branch() { }",
"public Node(){\n this(9);\n }",
"public TreeNode(Object value)\r\n\t{\r\n\t\tthis(null, value);\r\n\t}",
"public SegmentTree() {}",
"public FamilyTree(){\r\n super();\r\n }",
"public BinaryTree() {\r\n\t\troot = null;\r\n\t\tcount = 0;\r\n\t}"
] | [
"0.8661965",
"0.7345236",
"0.7112915",
"0.70672953",
"0.69933903",
"0.6970765",
"0.69457406",
"0.6897934",
"0.6838745",
"0.6834877",
"0.6824919",
"0.68143994",
"0.674789",
"0.67369926",
"0.67272466",
"0.6693137",
"0.66847456",
"0.6677386",
"0.66636056",
"0.66636056",
"0.66636056",
"0.66636056",
"0.66584307",
"0.66404307",
"0.6598024",
"0.65950125",
"0.65895766",
"0.6578336",
"0.65757775",
"0.655207",
"0.65506464",
"0.6521047",
"0.65124905",
"0.650179",
"0.6497607",
"0.6497607",
"0.64905536",
"0.64796746",
"0.6474122",
"0.6473866",
"0.64713496",
"0.6457187",
"0.6454579",
"0.64509684",
"0.6424225",
"0.64106226",
"0.6407068",
"0.6392658",
"0.63919336",
"0.63902783",
"0.63888294",
"0.63860714",
"0.6365759",
"0.6365441",
"0.63612",
"0.63575333",
"0.63564813",
"0.635065",
"0.6350167",
"0.633047",
"0.63177943",
"0.6317464",
"0.6282765",
"0.6282765",
"0.6280891",
"0.62765515",
"0.6275672",
"0.62677556",
"0.62666637",
"0.62665224",
"0.6262119",
"0.6262062",
"0.626154",
"0.62496156",
"0.62429076",
"0.6238607",
"0.623607",
"0.62296116",
"0.62293464",
"0.62259716",
"0.6224356",
"0.62205493",
"0.62181216",
"0.6215426",
"0.6211203",
"0.6205487",
"0.6199663",
"0.61842066",
"0.6182956",
"0.6176735",
"0.6164803",
"0.61631876",
"0.61616516",
"0.61513126",
"0.6149696",
"0.6145936",
"0.61296844",
"0.61291665",
"0.61166245",
"0.6112642",
"0.61055344"
] | 0.0 | -1 |
Constructor that constructs a node given its four quadrants (i.e., the node's children). | public TreeNode(TreeNode northWest, TreeNode northEast, TreeNode southWest, TreeNode southEast) {
this.northWest = northWest;
this.northEast = northEast;
this.southWest = southWest;
this.southEast = southEast;
this.level = northWest.level + 1;
this.population = northWest.population + northEast.population +
southWest.population + southEast.population;
this.alive = this.population > 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public QuadTree(int x, int y, int width, int height){\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }",
"QuadtreeNode(double x, double y, double w, double h) {\n this.w = w;\n this.h = h;\n this.x = x;\n this.y = y;\n }",
"public QuadTree (double llx, double lly, double urx, double ury) {\n\t\tthis.llx = llx; this.lly = lly; this.urx = urx; this.ury = ury;\n\t\troot = new RootNode(this);\n\t\tpoints = new Hashtable(128);\n\t}",
"public QuadTreeNode(int x, int y, int height, int width) {\n\t\tpoints = new HashMap<Point, E>();\n\t\tboundary = new Rectangle(x, y, width, height);\n\t\tdivided = false;\n\t}",
"Node(int d) {\n data = d;\n left = null;\n right = null;\n }",
"public Node(int numberChildren){\n board = new Board();\n children = new Node[numberChildren];\n }",
"public TreeNode(){ this(null, null, 0);}",
"public TwoFourTree()\r\n\t{\r\n\t\troot = new TreeNode(); //assign the root to a new tree node\r\n\t}",
"public Triangle() {\n this(0,0,0,0,0);\n }",
"public QuadtreeNode(Rectangle rect) {\n this.rectangle = rect;\n }",
"public Node()\n {\n \n name = new String();\n type = new String(\"internal\"); //Initial Node type set to internal\n length = new Double(0); //Set initial branch length to zero\n children = new ArrayList<Node>();\n level = 0;\n treesize = new Double(0);\n depth = 0;\n newicklength = 0;\n startycoord = -1;\n startxcoord = -1;\n endxcoord = -1;\n endycoord = -1;\n standardy = -1;\n selected = false;\n xmultiplier = 0;\n ymultiplier = 0;\n }",
"public Node(){}",
"public SegmentTree() {}",
"public static Node constructTree() {\n\n Node node2 = new Node(2, null, null);\n Node node8 = new Node(8, null, null);\n Node node12 = new Node(12, null, null);\n Node node17 = new Node(17, null, null);\n\n Node node6 = new Node(6, node2, node8);\n Node node15 = new Node(15, node12, node17);\n\n //Root Node\n Node node10 = new Node(10, node6, node15);\n\n return node10;\n }",
"public Node(){\n this(9);\n }",
"QuadTree(String name, double ullon, double ullat, double lrlon, double lrlat, int depth) {\n this.ullon = ullon;\n this.ullat = ullat;\n this.lrlon = lrlon;\n this.lrlat = lrlat;\n this.name = name;\n this.depth = depth;\n\n }",
"private Node(int c) {\n this.childNo = c; // Construct a node with c children.\n }",
"public QuadTreeFloat () {\n\t\tthis(16, 8);\n\t}",
"public Triangle() {\n\t\tsuper.addPoint(new java.awt.Point(0,1));\n\t\tsuper.addPoint(new java.awt.Point(1,0));\n\t\tsuper.addPoint(new java.awt.Point(2,1));\n\t}",
"public Triangle() { \n super(\"Triangle: \");\n this.setP1(new Point());\n this.setP2(new Point());\n this.setP3(new Point());\n }",
"public QuadTree(PointView<Point> view, int transitionSize) {\n super(view);\n _transitionSize = transitionSize;\n _nodeOrigin = new double[2];\n _elements = new ArrayList<Point>();\n _subdivided = false;\n _elementsSize = 0;\n _treeSize = 0;\n }",
"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 TrieNode(){}",
"public MyTreePretty(int x, int y) {\n this(x, y, Color.green);\n }",
"public Node()\n {\n this.name=\"/\";\n this.type=0;\n this.stage=0;\n children=new ArrayList<Node>();\n }",
"FractalTree() {\r\n }",
"public DoubleNode(){\r\n this( null, '\\0', null );\r\n }",
"public Node(Node parentNode, Position position, int g, int h) {\n this.parentNode = parentNode;\n this.position = position;\n this.g = g;\n this.h = h;\n this.f = g + h;\n\n }",
"public PMQuadtree() {\n\t\tvalidator = null;\n\t\troot = whiteSingleton;\n\t\t\n\t\tspatialOrigin = new Point2D.Float(0, 0);\n\t}",
"public Node(int x,int y, int size, String colour, String n)\n\t{\n\t\tdrawnNode = new Ball(x,y,size,colour);\n\t\tname = n;\n\t\tdouble textChange = (double)size/4.0;\n\t\tlabel = new Text(n,x-textChange,y+textChange,size,\"WHITE\");\n\t\t\n\t\toutArcs = new Arc[0];\n\t}",
"public Node(double x, double y, NodeType type) {\n this(new Coordinates(x, y), type);\n }",
"public TripsFragment() {\n }",
"public Tour(Point a, Point b, Point c, Point d) {\n Node second = new Node();\n Node third = new Node();\n Node fourth = new Node();\n first.p = a;\n first.next = second;\n second.p = b;\n second.next = third;\n third.p = c;\n third.next = fourth;\n fourth.p = d;\n fourth.next = first;\n }",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public Node() {}",
"public Triangle()\n {\n\n this(new Point(-0.5f, (float)-Math.tan(Math.PI / 6), 0f), new Point(\n 0.5f,\n (float)-Math.tan(Math.PI / 6),\n 0f), new Point(0f, (float)Math.sqrt(0.75)\n + (float)-Math.tan(Math.PI / 6), 0f));\n }",
"public Node(){\n\n\t\t}",
"public Triangle() {\n\t\tsuper();\n\t\tthis.base = 0;\n\t\tthis.height = 0;\n\t\t\n\t}",
"public Quadrat(Point a, Point b, Point c, Point d){\r\n\t\tsuper(a,b,c,d);\r\n\t}",
"private GridNode(Grid grid, GridCoord coord, float x, float y, float z) {\n this(grid, coord);\n point = new Point(x, y, z);\n }",
"public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }",
"public Node(Word d) {\n data = d;\n left = null;\n right = null;\n }",
"public Node(E e, Node<E> above, Node<E> leftChild, Node<E> rightChild) {\n element = e;\n parent = above;\n left = leftChild;\n right = rightChild;\n }",
"public TreeNode(Object e) {\n element = e;\n //this.parent = null;\n left = null;\n right = null;\n }",
"public Tree() {\n super.springPictureName = \"tree2.png\";\n super.summerPictureName = \"tree4.png\";\n super.autumnPictureName = \"tree5.png\";\n super.winterPictureName = \"tree7.png\";\n super.eachElementCapacity = 3;\n\n }",
"public Node() {\r\n\t}",
"public Node() {\r\n\t}",
"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 }",
"public static TreeNode generateBinaryTree3() {\n // Nodes\n TreeNode root = new TreeNode(1);\n TreeNode rootLeft = new TreeNode(2);\n TreeNode rootLeftLeft = new TreeNode(3);\n TreeNode rootLeftLeftLeft = new TreeNode(4);\n TreeNode rootRight = new TreeNode(5);\n TreeNode rootRightRight = new TreeNode(6);\n TreeNode rootRightRightRight = new TreeNode(7);\n // Edges\n root.left = rootLeft;\n rootLeft.left = rootLeftLeft;\n rootLeftLeft.left = rootLeftLeftLeft;\n root.right = rootRight;\n rootRight.right = rootRightRight;\n rootRightRight.right = rootRightRightRight;\n\n // Return root\n return root;\n }",
"private Node constructInternal(List<Node> children){\r\n\r\n // Base case: root found\r\n if(children.size() == 1){\r\n return children.get(0);\r\n }\r\n\r\n // Generate parents\r\n boolean odd = children.size() % 2 != 0;\r\n for(int i = 1; i < children.size(); i += 2){\r\n Node left = children.get(i-1);\r\n Node right = children.get(i);\r\n Node parent = new Node(Utility.SHA512(left.hash + right.hash), left, right);\r\n children.add(parent);\r\n }\r\n\r\n // If the number of nodes is odd, \"inherit\" the remaining child node (no hash needed)\r\n if(odd){\r\n children.add(children.get(children.size() - 1));\r\n }\r\n return constructInternal(children);\r\n }",
"public Node(T value) {\n this.value = value;\n this.height = 0;\n this.leftChild = null;\n this.rightChild = null;\n this.parent = null;\n }",
"public Node() {\n\t}",
"public void createNode()\r\n\t{\r\n\t\tTreeNode first=new TreeNode(1);\r\n\t\tTreeNode second=new TreeNode(2);\r\n\t\tTreeNode third=new TreeNode(3);\r\n\t\tTreeNode fourth=new TreeNode(4);\r\n\t\tTreeNode fifth=new TreeNode(5);\r\n\t\tTreeNode sixth=new TreeNode(6);\r\n\t\tTreeNode seventh=new TreeNode(7);\r\n\t\tTreeNode eight=new TreeNode(8);\r\n\t\tTreeNode nine=new TreeNode(9);\r\n\t\troot=first;\r\n\t\tfirst.left=second;\r\n\t\tfirst.right=third;\r\n\t\tsecond.left=fourth;\r\n\t\tthird.left=fifth;\r\n\t\tthird.right=sixth;\r\n\t\tfifth.left=seventh;\r\n\t\tseventh.right=eight;\r\n\t\teight.left=nine;\r\n\t\t\r\n\t}",
"public Square(int x, int y, int side)\n\t{\n\t\tsuper();\n\t\toneside = side;\n\t\tanchor = new Point(x, y);\n\t\tvertices.add(new Point(x, y));\n\t\tvertices.add(new Point(x + side, y)); // upper right\n\t\tvertices.add(new Point(x + side, y + side)); // lower right\n\t\tvertices.add(new Point(x, y + side)); // lower left\n\t}",
"Triangle(){\n side1 = 1.0;\n side2 = 1.0;\n side3 = 1.0;\n }",
"public JdbTree() {\r\n this(new Object [] {});\r\n }",
"public Node() \r\n\t{\r\n\t\tincludedNode = new ArrayList<Node>();\r\n\t\tin = false; \r\n\t\tout = false;\r\n\t}",
"public Leaf(){}",
"public Node(){\n }",
"public QuadTree (Set2D inSet, double llx, double lly, double urx, double ury) {\n\t\tthis(llx, lly, urx, ury);\n\t\tint id;\n\t\tSet2DIterator iterator = inSet.iterator(llx, lly, urx, ury);\n\t\twhile (iterator.hasNext()) {\n\t\t\tid = iterator.next();\n\t\t\tthis.add(id, inSet.x(id), inSet.y(id));\n\t\t}\n\t}",
"public Node(Board board){\n children = new ArrayList<>();\n counter = 0;\n this.board = board;\n parent = null;\n }",
"public DancingNode()\n {\n L=R=U=D=this;\n }",
"public Queen(int r, int c)\r\n {\r\n row = r;\r\n column = c;\r\n }",
"public Triangle(IPrimitive parent)\n {\n this(new Point(-0.5f, (float)-Math.tan(Math.PI / 6), 0f), new Point(\n 0.5f,\n (float)-Math.tan(Math.PI / 6),\n 0f), new Point(0f, (float)Math.sqrt(0.75)\n + (float)-Math.tan(Math.PI / 6), 0f), parent);\n\n }",
"public Node3() {\n initComponents();\n setSize(650, 550);\n }",
"protected Node(int xp, int yp) {\n\t\tx = xp;\n\t\ty = yp;\n\t\tEngine.getSingleton().addNode(this);\n\t}",
"public Node() {\n }",
"public Triangle(){\n\t\tside1=1.0;\n\t\tside2=1.0;\n\t\tside3=1.0;\n\t}",
"public Node()\n\t{\n\t\toriginalValue = sumValue = 0;\n\t\tparent = -1;\n\t}",
"public Node()\n\t{\n\t\ttitle = \" \";\n\t\tavail = 0;\n\t\trented = 0;\n\t\tleft = null;\n\t\tright = null;\n\t\t\n\t}",
"public Triangle() {}",
"public TrieNode() {\n \n }",
"public Triangle (int x, int y, int z){ \r\n \r\n \r\n }",
"public void createTree() {\n Node<String> nodeB = new Node<String>(\"B\", null, null);\n Node<String> nodeC = new Node<String>(\"C\", null, null);\n Node<String> nodeD = new Node<String>(\"D\", null, null);\n Node<String> nodeE = new Node<String>(\"E\", null, null);\n Node<String> nodeF = new Node<String>(\"F\", null, null);\n Node<String> nodeG = new Node<String>(\"G\", null, null);\n root.leftChild = nodeB;\n root.rightChild = nodeC;\n nodeB.leftChild = nodeD;\n nodeB.rightChild = nodeE;\n nodeC.leftChild = nodeF;\n nodeC.rightChild = nodeG;\n\n }",
"public Node(int id, double xCoord, double yCoord) {\n\t\tthis.id = id;\n\t\tthis.xCoord = xCoord;\n\t\tthis.yCoord = yCoord;\n\t\tthis.onRoute = false;\n\t\tthis.angle = 0;\n\t}",
"public Node() {\n\t\tsplithorizon = false;\n\t\troutingTable = new ArrayList<ArrayList<Integer>>();\n\t\troutingTable.add(new ArrayList<Integer>());\n\t\troutingTable.add(new ArrayList<Integer>());\n\t\troutingTable.add(new ArrayList<Integer>());\n\t}",
"public Node() {\n\n }",
"public SceneOctTree (\n Bounds bounds\n ) {\n\n this.bounds = bounds;\n\n }",
"private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}",
"public Triangle(\n IPoint firstPoint,\n IPoint secondPoint,\n IPoint thirdPoint,\n IPrimitive parent)\n {\n super(parent);\n this.addVertex(firstPoint);\n this.addVertex(secondPoint);\n this.addVertex(thirdPoint);\n\n }",
"Box(double len){\r\n Height = Width = Depth = len;\r\n\r\n }",
"public CassandraNode() {\r\n\t\tthis(null, 0);\r\n\t}",
"public TrieNode() {\n this.children = new TrieNode[256];\n this.code = -1;\n }",
"public AStarNode(double x_pos, double y_pos) {\n super(x_pos, y_pos);\n }",
"public static void main(String[] args) \n\t{\n\t\ttree x = new tree(0);\n\t\t\n\t\ttreenode r = x.root;\n\t\t\n//\t\ttreenode c = r;\n//\t\tfor(int i =1;i<=4;i++)\n//\t\t{\n//\t\t\tfor(int j=0;j<=8;j=j+4)\n//\t\t\t{\n//\t\t\t\ttreenode n = new treenode(i+j);\n//\t\t\t\tif(j==0)\n//\t\t\t\t{\n//\t\t\t\t\tr.child.add(n);\n//\t\t\t\t\tc = n;\n//\t\t\t\t}\n//\t\t\t\telse\n//\t\t\t\t{\n//\t\t\t\t\tc.child.add(n);\n//\t\t\t\t\tc = n;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n\t\ttreenode c1 = r;\n\t\ttreenode c2 = r;\n\t\ttreenode c3 = r;\n\t\ttreenode c4 = r;\n\t\tfor(int i=1;i<13;i++)\n\t\t{\n\t\t\ttreenode n = new treenode(i);\n\t\t\tif(i%4==1)\n\t\t\t{\n\t\t\t\tc1.child.add(n);\n\t\t\t\tc1 = n;\n\t\t\t}\n\t\t\tif(i%4==2)\n\t\t\t{\n\t\t\t\tc2.child.add(n);\n\t\t\t\tc2 = n;\n\t\t\t}\n\t\t\tif(i%4==3)\n\t\t\t{\n\t\t\t\tc3.child.add(n);\n\t\t\t\tc3 = n;\n\t\t\t}\n\t\t\tif(i%4==0)\n\t\t\t{\n\t\t\t\tc4.child.add(n);\n\t\t\t\tc4 = n;\n\t\t\t}\n\t\t}\n\t\tx.traverse(r);\n\t}",
"public Tree()\n\t{\n\t\tsuper(\"Tree\", \"tree\", 0);\n\t}",
"public Grid(int radius, int scale, ArrayList<Hexagon> gaps, ArrayList<Piece> board) {\n this.radius = radius;\n this.scale = scale;\n\n //Init derived node properties\n width = (int) (Math.sqrt(3) * scale);\n height = 2 * scale;\n centerOffsetX = width / 2;\n centerOffsetY = height / 2;\n\n //Init nodes\n generateHexagonalShape(radius, gaps, board);\n }",
"public QuadTree(int l, Rectangle2D b, boolean a){\n\t\tthis.a = a;\n\t\tif(a){\n\t\t\tMAX_OBJECTS = 5;\n\t\t\tMAX_LEVELS = 200;\n\t\t}\n\t\telse{\n\t\t\tMAX_OBJECTS = 20;\n\t\t\tMAX_LEVELS = 20;\n\t\t}\n\t\tlevel = l;\n\t\tbounds = b;\n\n\t\t//System.out.println(bounds);\n\t\t\n\t\telements = new ArrayList<Label>();\n\t\tnodes = new QuadTree[4];\n\t\t\n\t\t//drawPoint(new Vector2f(5,5), 3.1f, Color.GREEN);\n\t\t\n\t}",
"public Triangle(int n)\n {\n level = n;\n\n // Get the dimensions of the window\n height = TriangleViewer.getHeight() - 50;\n }",
"private Node() {\n\n }",
"public Quadrato (double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) {\n\t\tsuper(ax, ay, bx, by, cx, cy, dx, dy);\n\t\tif (!this.verificaValidita()) {\n\t\t\tthis.valido = false;\n\t\tfor (int i = 0 ; i < 4 ; i++) { \n\t\t\tthis.vertici[i].impostaX(Double.NaN);\n\t\t\tthis.vertici[i].impostaY(Double.NaN);\n\t\t\t}\n\t\t}\n\t}",
"public Node(char myLetter, int myCount){\n\t\tletter = myLetter;\n\t\tcount = myCount;\n\t\tleftChild = null;\n\t\trightChild = null;\n\t}",
"Box(double w, double h, double d) {\n\n widgh =w;\n height =h;\n depth =d;\n\n}",
"private SceneOctTree (\n Bounds bounds,\n int depth\n ) {\n\n this.bounds = bounds;\n this.depth = depth;\n\n }",
"public Node()\r\n {\r\n initialize(null);\r\n lbl = id;\r\n }",
"public static void main(String[] args) {\n MyBinaryTree tree = new MyBinaryTree();\n\n TreeNode n45 = new TreeNode(45);\n TreeNode n1 = new TreeNode(66);\n TreeNode n2 = new TreeNode(66);\n TreeNode n3 = new TreeNode(66);\n TreeNode n4 = new TreeNode(66);\n\n tree.root = n45;\n n45.left = n1;\n n45.right = n2;\n\n n1.right = n3;\n n2.left = n4;\n }",
"public Node(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\t\n\t\tthis.neighbors = new ArrayList<Edge>();\n\t}",
"public KDTree()\n\t{\n\t}"
] | [
"0.6540135",
"0.6441842",
"0.63514066",
"0.5977029",
"0.5970818",
"0.59555113",
"0.59433365",
"0.5926387",
"0.59118384",
"0.58987534",
"0.5798327",
"0.5796515",
"0.5786381",
"0.5781039",
"0.5765454",
"0.5764561",
"0.5762386",
"0.57054216",
"0.5696871",
"0.56968063",
"0.5687537",
"0.5678997",
"0.56578445",
"0.56476665",
"0.564315",
"0.56343764",
"0.5625184",
"0.5623429",
"0.5615494",
"0.5615258",
"0.56129545",
"0.56015384",
"0.55992323",
"0.55948746",
"0.55948746",
"0.55948746",
"0.55948746",
"0.55696166",
"0.5565633",
"0.5561377",
"0.55459785",
"0.5541116",
"0.5535499",
"0.5532197",
"0.5529325",
"0.5526323",
"0.55259603",
"0.55214894",
"0.55214894",
"0.5511061",
"0.55104643",
"0.5504181",
"0.5501841",
"0.5491269",
"0.54707605",
"0.54609555",
"0.54563826",
"0.54559445",
"0.54475945",
"0.5431787",
"0.5429058",
"0.5427315",
"0.5427029",
"0.54267174",
"0.5425571",
"0.54252195",
"0.5423517",
"0.5420145",
"0.5418904",
"0.5418872",
"0.54174453",
"0.5414913",
"0.5411061",
"0.5404134",
"0.53987056",
"0.53947103",
"0.5380044",
"0.5373592",
"0.5372679",
"0.536743",
"0.53657657",
"0.5364769",
"0.53575504",
"0.53569275",
"0.5350715",
"0.5350123",
"0.5344701",
"0.5344236",
"0.5341901",
"0.5330511",
"0.5325012",
"0.5322612",
"0.52965456",
"0.52935135",
"0.5283729",
"0.52818835",
"0.52794504",
"0.52774394",
"0.527587",
"0.5251957"
] | 0.52643484 | 99 |
constructor for a new instance of the encode class | public Encode(Path inputPath, Path outputPath) {
this.inputPath = inputPath;
this.outputPath = outputPath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Encoder() {}",
"public AsciiDataEncoder() {\n\t}",
"public MyEncodeableUsingEncoderDecoderClass() {}",
"private Encodings()\n {\n // nothing to do\n }",
"public EnScrypt() {}",
"public EncodingMap() {}",
"public mxCodec() {\n this(mxDomUtils.createDocument());\n }",
"private FormattedTextEncoder() {\r\n\t\tsuper();\r\n\t}",
"public Base64JavaUtilCodec() {\n this(Base64.getEncoder(), Base64.getMimeDecoder());\n }",
"public ObjectSerializationEncoder() {\n // Do nothing\n }",
"public URLCodec() {\n/* 104 */ this(\"UTF-8\");\n/* */ }",
"MyEncodeableWithoutPublicNoArgConstructor() {}",
"private Base64() {\r\n }",
"private RunLengthEncoder() {\r\n }",
"public PEASEncoder() {\n this(Charset.defaultCharset());\n }",
"public TemplateCodec() {\n this.documentCodec = new DocumentCodec();\n }",
"public Code() {\n\t}",
"public ByteEncoder()\n\t{\n\t\tencodeTargetList = Charset.availableCharsets().keySet();\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"public NYSIISCode(){\n }",
"public EncodeAndDecodeStrings() {}",
"public Constructor(){\n\t\t\n\t}",
"public MyEncodableUsingEncoderDecoderName() {}",
"private Base64(){\n\t}",
"private Base64(){}",
"protected ISO8859_1()\r\n {\r\n }",
"public Steganography() {}",
"public DebugEncoder(Encoder ec) {\n this.ec = ec;\n }",
"public EnsembleLettre() {\n\t\t\n\t}",
"private ByteTools(){}",
"public PIEBankPlatinumKey() {\n\tsuper();\n}",
"public EncodingAlgorithmAttributesImpl() {\n this(null, null);\n }",
"public URLCodec(String charset) {\n/* 114 */ this.charset = charset;\n/* */ }",
"protected JsonFactory(JsonFactory src, ObjectCodec codec)\n/* */ {\n/* 293 */ this._objectCodec = null;\n/* 294 */ this._factoryFeatures = src._factoryFeatures;\n/* 295 */ this._parserFeatures = src._parserFeatures;\n/* 296 */ this._generatorFeatures = src._generatorFeatures;\n/* 297 */ this._characterEscapes = src._characterEscapes;\n/* 298 */ this._inputDecorator = src._inputDecorator;\n/* 299 */ this._outputDecorator = src._outputDecorator;\n/* 300 */ this._rootValueSeparator = src._rootValueSeparator;\n/* */ }",
"public ServerCodeFactory() {\r\n\t\tthis(Charset.forName(\"UTF-8\"));\r\n\t\tLOG.debug(\"ServerCodeFactory()\");\r\n\t}",
"public PileSearchRecode() {\n }",
"public Achterbahn() {\n }",
"public PythXMLEncoder (String script) {\n delegate = encoderFromScript(script);\n }",
"public static void __init() {\r\n\t\t__name__ = new str(\"code\");\r\n\r\n\t\t/**\r\n\t\t copyright Sean McCarthy, license GPL v2 or later\r\n\t\t*/\r\n\t\tdefault_0 = null;\r\n\t\tcl_Code = new class_(\"Code\");\r\n\t}",
"public mapper3c() { super(); }",
"public ProductCode() {\n }",
"private EncryptionKey() {\n }",
"public Payload() {\n\t}",
"public void jsContructor() {\n }",
"public Ov_Chipkaart() {\n\t\t\n\t}",
"public AntrianPasien() {\r\n\r\n }",
"protected abstract void construct();",
"public Pasien() {\r\n }",
"public SourceCode() {\n }",
"public SgaexpedbultoImpl()\n {\n }",
"public JSFOla() {\n }",
"public OVChipkaart() {\n\n }",
"public abstract String construct();",
"public Genret() {\r\n }",
"public BitmapEncoder() {\n this((Bitmap.CompressFormat) null, 90);\n }",
"public CyanSus() {\n\n }",
"public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}",
"private CompressionTools() {}",
"public Chauffeur() {\r\n\t}",
"public GenEncryptionParams() {\n }",
"@Override\n\tpublic CharsetEncoder newEncoder() {\n\t\treturn null;\n\t}",
"public TransliterationManager()\n\t{\n\t\tmap = new HashMap<String, ITransliterator>();\n\t\tcodings = new HashSet<String>();\n\t}",
"public JS_IO() {\n init();\n }",
"public Almacen(){}",
"public ConvertToUTF8() {\n initComponents();\n }",
"public Payload() {}",
"public CardTrackKey() {\n\tsuper();\n}",
"public Encryptor(){\n\t\tSecurity.addProvider(new BouncyCastleProvider());\n\t}",
"public Hacker() {\r\n \r\n }",
"public AbstractBinaryInteraction() {\n\n\t}",
"public AISDecoder() {\n initComponents();\n }",
"public static void main(String[] args) {\n Integer[] num = {3,2,5,0,1};\r\n Character[] letter = {'P','I','V','C','D'};\r\n SpecialEncoding<Integer> a= new SpecialEncoding<>(num);\r\n SpecialEncoding<Character> b= new SpecialEncoding<>(letter);\r\n \r\n }",
"public ASNClassNumber() {\n }",
"public Anschrift() {\r\n }",
"public ConceptCodeManager()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tthis.initCoder();\r\n\t\t}\r\n\t\tcatch (final Exception ex)\r\n\t\t{\r\n\t\t\tConceptCodeManager.logger.error(\"Initialization of concept coding\" +\r\n\t\t\t\t\t\"process failed or error in main thread\" +\r\n\t\t\t\t\tex.getMessage(),ex);\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}",
"public HuffmanCompressor(){\n charList = new ArrayList<HuffmanNode>();\n }",
"public Secret() {\n\n\t}",
"public KeyEncryptionKeyInfo() {\n }",
"private ZipCodes() {}",
"private AES() {\r\n\r\n }",
"public AirAndPollen() {\n\n\t}",
"public JsonFactory setCodec(ObjectCodec oc)\n/* */ {\n/* 721 */ this._objectCodec = oc;\n/* 722 */ return this;\n/* */ }",
"public Clade() {}",
"protected AbstractReadablePacket() {\n this.constructor = createConstructor();\n }",
"public Translator() {\n\t\tdictionary = new Dictionary();\n\t}",
"public _355() {\n\n }",
"public GTFTranslator()\r\n {\r\n // do nothing - no variables to instantiate\r\n }",
"public Cgg_jur_anticipo(){}",
"public MessageTran() {\n\t}",
"public Register() {\n }",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"public Pitonyak_09_02() {\r\n }",
"public CMN() {\n\t}",
"public Code()\n\t{\n\t\tbits = new ArrayList<Boolean>();\n\t}",
"public Firma() {\n }",
"public PennCnvSeq() {\n }",
"public mxCodec(Document document) {\n if (document == null) {\n document = mxDomUtils.createDocument();\n }\n\n this.document = document;\n }",
"public Phl() {\n }",
"public CSSTidier() {\n\t}",
"public H263Reader() {\n this(null);\n }",
"public Encoder(String filename)\n\t{\n\t\ttry {\n\t\t\tFileReader reader = new FileReader(filename);\n\t\t\treader.read(words);\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}"
] | [
"0.8118136",
"0.7266817",
"0.72203195",
"0.70072424",
"0.6966271",
"0.69520354",
"0.6715473",
"0.669907",
"0.66564107",
"0.6645284",
"0.65705097",
"0.6555566",
"0.65199304",
"0.64969635",
"0.64942765",
"0.6491143",
"0.6466529",
"0.641414",
"0.6377718",
"0.63718",
"0.63329977",
"0.6265119",
"0.61784345",
"0.6157462",
"0.6156718",
"0.61503506",
"0.61105776",
"0.6097549",
"0.60935646",
"0.6077624",
"0.60519505",
"0.6045499",
"0.60056525",
"0.60019726",
"0.60018474",
"0.5994355",
"0.5961647",
"0.59577656",
"0.59380656",
"0.59231704",
"0.59230274",
"0.5918158",
"0.5883594",
"0.5876679",
"0.58665127",
"0.5866245",
"0.58445996",
"0.5836676",
"0.5822132",
"0.58217895",
"0.5817838",
"0.5807052",
"0.5796297",
"0.5792757",
"0.5779009",
"0.57783926",
"0.57772255",
"0.5775879",
"0.5773799",
"0.5773483",
"0.57597494",
"0.5756533",
"0.5751349",
"0.57495004",
"0.57491916",
"0.57484823",
"0.57387793",
"0.5719219",
"0.5717675",
"0.5717161",
"0.57157576",
"0.5710011",
"0.57066566",
"0.5700095",
"0.56950223",
"0.568991",
"0.56798035",
"0.56797814",
"0.5677607",
"0.5676879",
"0.56747365",
"0.5669869",
"0.56637734",
"0.56613797",
"0.56600505",
"0.5656912",
"0.56506157",
"0.5646337",
"0.564345",
"0.56399834",
"0.5638676",
"0.563693",
"0.56302947",
"0.5617684",
"0.56174296",
"0.56114316",
"0.56106627",
"0.5599918",
"0.5597116",
"0.559105",
"0.558937"
] | 0.0 | -1 |
creates the frequency table, huffman tree, and code table. Then encodes input message. Prints the input message, frequency table, code table, and the encode message. | public void encodeData() {
frequencyTable = new FrequencyTableBuilder(inputPath).buildFrequencyTable();
huffmanTree = new Tree(new HuffmanTreeBuilder(new FrequencyTableBuilder(inputPath).buildFrequencyTable()).buildTree());
codeTable = new CodeTableBuilder(huffmanTree).buildCodeTable();
encodeMessage();
print();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) {\n\n /** Reading a message from the keyboard **/\n // @SuppressWarnings(\"resource\")\n // Scanner scanner = new Scanner(System.in);\n // System.out.println(\"Please enter a message to be encoded: \");\n // String inputString = scanner.nextLine();\n //\n // System.out.println(\"Please enter the code length: \");\n // String codeLen = scanner.nextLine();\n // int num = Integer.parseInt(codeLen);\n // Encode encodeThis = new Encode(inputString, num);\n // encodeThis.createFrequencyTable();\n // encodeThis.createPriorityQueue();\n // while (encodeThis.stillEncoding()) {\n // encodeThis.build();\n // }\n // String codedMessage = encodeThis.getEncodedMessage();\n // /** Printing message to the screen **/\n // System.out.println(codedMessage);\n\n /** Reading message from a file **/\n ArrayList<String> info = new ArrayList<String>();\n try {\n File file = new File(\"/Users/ugoslight/Desktop/message.txt\");\n Scanner reader = new Scanner(file);\n\n while (reader.hasNextLine()) {\n String data = reader.nextLine();\n info.add(data);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"No file found.\");\n e.printStackTrace();\n }\n\n /** Encoding message from file **/\n Encode encodeThis = new Encode(info.get(0), Integer.parseInt(info.get(1)));\n encodeThis.createFrequencyTable();\n encodeThis.createPriorityQueue();\n while (encodeThis.stillEncoding()) {\n encodeThis.build();\n }\n String codedMessage = encodeThis.getEncodedMessage();\n /** Create new file **/\n try {\n File myObj = new File(\"/Users/ugoslight/Desktop/filename.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n /** Write to file **/\n try {\n FileWriter myWriter = new FileWriter(\"/Users/ugoslight/Desktop/filename.txt\");\n myWriter.write(codedMessage);\n myWriter.close();\n System.out.println(\"Successfully wrote to the file.\");\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n\n\n\n }",
"private void encodeMessage() {\n encodedMessage = \"\";\n try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {\n String inputLine;\n while((inputLine = inputBuffer.readLine()) != null) {\n //walks the input message and builds the encode message\n for(int i = 0; i < inputLine.length(); i++) {\n encodedMessage = encodedMessage + codeTable[inputLine.charAt(i)];\n }\n encodedMessage = encodedMessage + codeTable[10];\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n //writes to the output file\n try(BufferedWriter outputBuffer = Files.newBufferedWriter(outputPath)) {\n outputBuffer.write(encodedMessage, 0, encodedMessage.length());\n outputBuffer.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void HuffmanCode()\n {\n String text=message;\n /* Count the frequency of each character in the string */\n //if the character does not exist in the list add it\n for(int i=0;i<text.length();i++)\n {\n if(!(c.contains(text.charAt(i))))\n c.add(text.charAt(i));\n } \n int[] freq=new int[c.size()];\n //counting the frequency of each character in the text\n for(int i=0;i<c.size();i++)\n for(int j=0;j<text.length();j++)\n if(c.get(i)==text.charAt(j))\n freq[i]++;\n /* Build the huffman tree */\n \n root= buildTree(freq); \n \n }",
"public static String huffmanCoder(String inputFileName, String outputFileName){\n File inputFile = new File(inputFileName+\".txt\");\n File outputFile = new File(outputFileName+\".txt\");\n File encodedFile = new File(\"encodedTable.txt\");\n File savingFile = new File(\"Saving.txt\");\n HuffmanCompressor run = new HuffmanCompressor();\n \n run.buildHuffmanList(inputFile);\n run.makeTree();\n run.encodeTree();\n run.computeSaving(inputFile,outputFile);\n run.printEncodedTable(encodedFile);\n run.printSaving(savingFile);\n return \"Done!\";\n }",
"private static void generateHuffmanTree(){\n try (BufferedReader br = new BufferedReader(new FileReader(_codeTableFile))) {\n String line;\n while ((line = br.readLine()) != null) {\n // process the line.\n if(!line.isEmpty() && line!=null){\n int numberData = Integer.parseInt(line.split(\" \")[0]);\n String code = line.split(\" \")[1];\n Node traverser = root;\n for (int i = 0; i < code.length() - 1; i++){\n char c = code.charAt(i); \n if (c == '0'){\n //bit is 0\n if(traverser.getLeftPtr() == null){\n traverser.setLeftPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getLeftPtr();\n }\n else{\n //bit is 1\n if(traverser.getRightPtr() == null){\n traverser.setRightPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getRightPtr();\n }\n }\n //Put data in the last node by creating a new leafNode\n char c = code.charAt(code.length() - 1);\n if(c == '0'){\n traverser.setLeftPtr(new LeafNode(9999999, numberData, null, null));\n }\n else{\n traverser.setRightPtr(new LeafNode(9999999, numberData, null, null));\n }\n }\n }\n } \n catch (IOException ex) {\n Logger.getLogger(FrequencyTableBuilder.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public static void main(String[] args)\n {\n\t\t\tHuffman tree= new Huffman();\n \t \t Scanner sc=new Scanner(System.in);\n\t\t\tnoOfFrequencies=sc.nextInt();\n\t\t\t// It adds all the user input values in the tree.\n\t\t\tfor(int i=1;i<=noOfFrequencies;i++)\n\t\t\t{\n\t\t\t\tString temp=sc.next();\n\t\t\t\ttree.add(temp,sc.next());\n\t\t\t}\n\t\tint lengthToDecode=sc.nextInt();\n\t\tString encodedValue=sc.next();\n\t\t// This statement decodes the encoded values.\n\t\ttree.getDecodedMessage(encodedValue);\n\t\tSystem.out.println();\n\t\t}",
"public void run() {\n\n\t\tScanner s = new Scanner(System.in); // A scanner to scan the file per\n\t\t\t\t\t\t\t\t\t\t\t// character\n\t\ttype = s.next(); // The type specifies our wanted output\n\t\ts.nextLine(); \n\n\t\t// STEP 1: Count how many times each character appears.\n\t\tthis.charFrequencyCount(s);\n\n\t\t/*\n\t\t * Type F only wants the frequency. Display it, and we're done (so\n\t\t * return)\n\t\t */\n\t\tif (type.equals(\"F\")) {\n\t\t\tdisplayFrequency(frequencyCount);\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * STEP 2: we want to make our final tree (used to get the direction\n\t\t * values) This entails loading up the priority queue and using it to\n\t\t * build the tree.\n\t\t */\n\t\tloadInitQueue();\n\t\tthis.finalHuffmanTree = this.buildHuffTree();\n\t\t\n\t\t/*\n\t\t * Type T wants a level order display of the Tree. Do so, and we're done\n\t\t * (so return)\n\t\t */\n\t\tif (type.equals(\"T\")) {\n\t\t\tthis.finalHuffmanTree.visitLevelOrder(new HuffmanVisitorForTypeT());\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * STEP 3: We want the Huffman code values for the characters.\n\t\t * The Huffman codes are specified by the path (directions) from the root.\n\t\t * \n\t\t * Each node in the tree has a path to get to it from the root. The\n\t\t * leaves are especially important because they are the original\n\t\t * characters scanned. Load every node with it's special direction value\n\t\t * (the method saves the original character Huffman codes, the direction\n\t\t * vals).\n\t\t */\n\t\tthis.loadDirectionValues(this.finalHuffmanTree.root);\n\t\t// Type H simply wants the codes... display them and we're done (so\n\t\t// return)\n\t\tif (type.equals(\"H\")) {\n\t\t\tthis.displayHuffCodesTable();\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * STEP 4: The Type must be M (unless there was invalid input) since all other cases were exhausted, so now we simply display the file using\n\t\t * the Huffman codes.\n\t\t */\n\t\tthis.displayHuffCodefile();\n\t}",
"@Test\r\n public void testEncode() throws Exception {\r\n System.out.println(\"encode\");\r\n String message = \"furkan\";\r\n \r\n HuffmanTree Htree = new HuffmanTree();\r\n\r\n HuffmanTree.HuffData[] symbols = {\r\n new HuffmanTree.HuffData(186, '_'),\r\n new HuffmanTree.HuffData(103, 'e'),\r\n new HuffmanTree.HuffData(80, 't'),\r\n new HuffmanTree.HuffData(64, 'a'),\r\n new HuffmanTree.HuffData(63, 'o'),\r\n new HuffmanTree.HuffData(57, 'i'),\r\n new HuffmanTree.HuffData(57, 'n'),\r\n new HuffmanTree.HuffData(51, 's'),\r\n new HuffmanTree.HuffData(48, 'r'),\r\n new HuffmanTree.HuffData(47, 'h'),\r\n new HuffmanTree.HuffData(32, 'b'),\r\n new HuffmanTree.HuffData(32, 'l'),\r\n new HuffmanTree.HuffData(23, 'u'),\r\n new HuffmanTree.HuffData(22, 'c'),\r\n new HuffmanTree.HuffData(21, 'f'),\r\n new HuffmanTree.HuffData(20, 'm'),\r\n new HuffmanTree.HuffData(18, 'w'),\r\n new HuffmanTree.HuffData(16, 'y'),\r\n new HuffmanTree.HuffData(15, 'g'),\r\n new HuffmanTree.HuffData(15, 'p'),\r\n new HuffmanTree.HuffData(13, 'd'),\r\n new HuffmanTree.HuffData(8, 'v'),\r\n new HuffmanTree.HuffData(5, 'k'),\r\n new HuffmanTree.HuffData(1, 'j'),\r\n new HuffmanTree.HuffData(1, 'q'),\r\n new HuffmanTree.HuffData(1, 'x'),\r\n new HuffmanTree.HuffData(1, 'z')\r\n };\r\n\r\n Htree.buildTree(symbols);\r\n \r\n String expResult = \"1100110000100101100001110100111\";\r\n String result = Htree.encode(message, Htree.huffTree);\r\n \r\n assertEquals(expResult, result);\r\n \r\n }",
"public static void HuffmanTree(String input, String output) throws Exception {\n\t\tFileReader inputFile = new FileReader(input);\n\t\tArrayList<HuffmanNode> tree = new ArrayList<HuffmanNode>(200);\n\t\tchar current;\n\t\t\n\t\t// loops through the file and creates the nodes containing all present characters and frequencies\n\t\twhile((current = (char)(inputFile.read())) != (char)-1) {\n\t\t\tint search = 0;\n\t\t\tboolean found = false;\n\t\t\twhile(search < tree.size() && found != true) {\n\t\t\t\tif(tree.get(search).inChar == (char)current) {\n\t\t\t\t\ttree.get(search).frequency++; \n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tsearch++;\n\t\t\t}\n\t\t\tif(found == false) {\n\t\t\t\ttree.add(new HuffmanNode(current));\n\t\t\t}\n\t\t}\n\t\tinputFile.close();\n\t\t\n\t\t//creates the huffman tree\n\t\tcreateTree(tree);\n\t\t\n\t\t//the huffman tree\n\t\tHuffmanNode sortedTree = tree.get(0);\n\t\t\n\t\t//prints out the statistics of the input file and the space saved\n\t\tFileWriter newVersion = new FileWriter(\"C:\\\\Users\\\\Chris\\\\workspace\\\\P2\\\\src\\\\P2_cxt240_Tsuei_statistics.txt\");\n\t\tprintTree(sortedTree, \"\", newVersion);\n\t\tspaceSaver(newVersion);\n\t\tnewVersion.close();\n\t\t\n\t\t// codes the file using huffman encoding\n\t\tFileWriter outputFile = new FileWriter(output);\n\t\ttranslate(input, outputFile);\n\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tMap<Character, Integer> frequencyMap = new HashMap<>();\n\t\tint textLength = text.length();\n\n\t\tfor (int i = 0; i < textLength; i++) {\n\t\t\tchar character = text.charAt(i);\n\t\t\tif (!frequencyMap.containsKey(character)) {\n\t\t\t\tfrequencyMap.put(character, 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint newFreq = frequencyMap.get(character) + 1;\n\t\t\t\tfrequencyMap.replace(character, newFreq);\n\t\t\t}\n\t\t}\n\n\t\tPriorityQueue<Node> queue = new PriorityQueue<>();\n\n\t\tIterator iterator = frequencyMap.entrySet().iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry<Character, Integer> pair = (Map.Entry<Character, Integer>) iterator.next();\n\t\t\tNode node = new Node(null, null, pair.getKey(), pair.getValue());\n\t\t\tqueue.add(node);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tNode node1 = queue.poll();\n\t\t\tNode node2 = queue.poll();\n\t\t\tNode parent = new Node(node1, node2, '\\t', node1.getFrequency() + node2.getFrequency());\n\t\t\tqueue.add(parent);\n\t\t}\n\t\thuffmanTree = queue.poll();\n\t\tSystem.out.println(\"firstNode: \"+ huffmanTree);\n\t\tcodeTable(huffmanTree);\n\n\t\t//Iterator iterator1 = encodingTable.entrySet().iterator();\n\n\t\t/*\n\t\twhile (iterator1.hasNext()) {\n\t\t\tMap.Entry<Character, String> pair = (Map.Entry<Character, String>) iterator1.next();\n\t\t\tSystem.out.println(pair.getKey() + \" : \" + pair.getValue() + \"\\n\");\n\t\t}\n\t\t*/\n\n\t\t//System.out.println(\"Hashmap.size() : \" + frequencyMap.size());\n\n\t}",
"public static void main(String[] args) {\n int[] freqNums = scanFile(args[0]);\n HuffmanNode[] nodeArr = createNodes(freqNums);\n nodeArr = freqSort(nodeArr);\n HuffmanNode top = createTree(nodeArr);\n String empty = \"\";\n String[] encodings = new String[94];\n encodings = getCodes(top, empty, false, encodings, true);\n printEncoding(encodings, freqNums);\n writeFile(args[0], args[1], encodings);\n }",
"public Huffman(String input) {\n\t\t\n\t\tthis.input = input;\n\t\tmapping = new HashMap<>();\n\t\t\n\t\t//first, we create a map from the letters in our string to their frequencies\n\t\tMap<Character, Integer> freqMap = getFreqs(input);\n\n\t\t//we'll be using a priority queue to store each node with its frequency,\n\t\t//as we need to continually find and merge the nodes with smallest frequency\n\t\tPriorityQueue<Node> huffman = new PriorityQueue<>();\n\t\t\n\t\t/*\n\t\t * TODO:\n\t\t * 1) add all nodes to the priority queue\n\t\t * 2) continually merge the two lowest-frequency nodes until only one tree remains in the queue\n\t\t * 3) Use this tree to create a mapping from characters (the leaves)\n\t\t * to their binary strings (the path along the tree to that leaf)\n\t\t * \n\t\t * Remember to store the final tree as a global variable, as you will need it\n\t\t * to decode your encrypted string\n\t\t */\n\t\t\n\t\tfor (Character key: freqMap.keySet()) {\n\t\t\tNode thisNode = new Node(key, freqMap.get(key), null, null);\n\t\t\thuffman.add(thisNode);\n\t\t}\n\t\t\n\t\twhile (huffman.size() > 1) {\n\t\t\tNode leftNode = huffman.poll();\n\t\t\tNode rightNode = huffman.poll();\n\t\t\tint parentFreq = rightNode.freq + leftNode.freq;\n\t\t\tNode parent = new Node(null, parentFreq, leftNode, rightNode);\n\t\t\thuffman.add(parent);\n\t\t}\n\t\t\n\t\tthis.huffmanTree = huffman.poll();\n\t\twalkTree();\n\t}",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tString input = \"\";\r\n\r\n\t\t//읽어올 파일 경로\r\n\t\tString filePath = \"C:/Users/user/Desktop/data13_huffman.txt\";\r\n\r\n\t\t//파일에서 읽어옴\r\n\t\ttry(FileInputStream fStream = new FileInputStream(filePath);){\r\n\t\t\tbyte[] readByte = new byte[fStream.available()];\r\n\t\t\twhile(fStream.read(readByte) != -1);\r\n\t\t\tfStream.close();\r\n\t\t\tinput = new String(readByte);\r\n\t\t}\r\n\r\n\t\t//빈도수 측정 해시맵 생성\r\n\t\tHashMap<Character, Integer> frequency = new HashMap<>();\r\n\t\t//최소힙 생성\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t//테이블 생성 해시맵\r\n\t\tHashMap<Character, String> table = new HashMap<>();\r\n\r\n\t\t//노드와 빈도수 측정\r\n\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\tif(frequency.containsKey(input.charAt(i))) {\r\n\t\t\t\t//이미 있는 값일 경우 빈도수를 1 증가\r\n\t\t\t\tchar currentChar = input.charAt(i);\r\n\t\t\t\tfrequency.put(currentChar, frequency.get(currentChar) + 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//키를 생성해서 넣어줌\r\n\t\t\t\tfrequency.put(input.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//최소 힙에 저장\r\n\t\tfor(Character key : frequency.keySet()) \r\n\t\t\tnodes.add(new Node(key, frequency.get(key), null, null));\r\n\t\t\t\t\r\n\t\t//최소힙으로 정렬\r\n\t\tbuildMinHeap(nodes);\r\n\r\n\t\t//huffman tree를 만드는 함수 실행\r\n\t\tNode resultNode = huffman(nodes);\r\n\r\n\t\t//파일에 씀 (table)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_table.txt\")){\r\n\t\t\tmakeTable(table, resultNode, \"\");\r\n\t\t\tfor(Character key : table.keySet()) {\r\n\t\t\t\t//System.out.println(key + \" : \" + table.get(key));\r\n\t\t\t\tfw.write(key + \" : \" + table.get(key) + \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//파일에 씀 (encoded code)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_encoded.txt\")){\r\n\t\t\tString allString = \"\";\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < input.length(); i++)\r\n\t\t\t\tallString += table.get(input.charAt(i));\r\n\r\n\t\t\t//System.out.println(allString);\r\n\t\t\tfw.write(allString);\r\n\t\t}\r\n\t}",
"public static void main(String args[])\n {\n Scanner s = new Scanner(System.in).useDelimiter(\"\");\n List<node> freq = new SinglyLinkedList<node>();\n \n // read data from input\n while (s.hasNext())\n {\n // s.next() returns string; we're interested in first char\n char c = s.next().charAt(0);\n if (c == '\\n') continue;\n // look up character in frequency list\n node query = new node(c);\n node item = freq.remove(query);\n if (item == null)\n { // not found, add new node\n freq.addFirst(query);\n } else { // found, increment node\n item.frequency++;\n freq.addFirst(item);\n }\n }\n \n // insert each character into a Huffman tree\n OrderedList<huffmanTree> trees = new OrderedList<huffmanTree>();\n for (node n : freq)\n {\n trees.add(new huffmanTree(n));\n }\n \n // merge trees in pairs until one remains\n Iterator ti = trees.iterator();\n while (trees.size() > 1)\n {\n // construct a new iterator\n ti = trees.iterator();\n // grab two smallest values\n huffmanTree smallest = (huffmanTree)ti.next();\n huffmanTree small = (huffmanTree)ti.next();\n // remove them\n trees.remove(smallest);\n trees.remove(small);\n // add bigger tree containing both\n trees.add(new huffmanTree(smallest,small));\n }\n // print only tree in list\n ti = trees.iterator();\n Assert.condition(ti.hasNext(),\"Huffman tree exists.\");\n huffmanTree encoding = (huffmanTree)ti.next();\n encoding.print();\n }",
"private void buildOutput()\n\t{\n\t\tif(outIndex >= output.length)\n\t\t{\n\t\t\tbyte[] temp = output;\n\t\t\toutput = new byte[temp.length * 2];\n\t\t\tSystem.arraycopy(temp, 0, output, 0, temp.length);\n\t\t}\n\t\t\n\t\tif(sb.length() < 16 && aryIndex < fileArray.length)\n\t\t{\n\t\t\tbyte[] b = new byte[1];\n\t\t\tb[0] = fileArray[aryIndex++];\n\t\t\tsb.append(toBinary(b));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < prioQ.size(); i++)\n\t\t{\n\t\t\tif(sb.toString().startsWith(prioQ.get(i).getCode()))\n\t\t\t{\n\t\t\t\toutput[outIndex++] = (byte)prioQ.get(i).getByteData();\n\t\t\t\tsb = new StringBuilder(\n\t\t\t\t\t\tsb.substring(prioQ.get(i).getCode().length()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Can't find Huffman code.\");\n\t\tSystem.exit(1);\n\t\texit = true;\n\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tif (text.length() <= 1)\n\t\t\treturn;\n\n\t\t//Create a the frequency huffman table\n\t\tHashMap<Character, huffmanNode> countsMap = new HashMap<>();\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar c = text.charAt(i);\n\t\t\tif (countsMap.containsKey(c))\n\t\t\t\tcountsMap.get(c).huffmanFrequency++;\n\t\t\telse\n\t\t\t\tcountsMap.put(c, new huffmanNode(c, 1));\n\t\t}\n\n\t\t//Build the frequency tree\n\t\tPriorityQueue<huffmanNode> countQueue = new PriorityQueue<>(countsMap.values());\n\t\twhile (countQueue.size() > 1) {\n\t\t\thuffmanNode left = countQueue.poll();\n\t\t\thuffmanNode right = countQueue.poll();\n\t\t\thuffmanNode parent = new huffmanNode('\\0', left.huffmanFrequency + right.huffmanFrequency);\n\t\t\tparent.leftNode = left;\n\t\t\tparent.rightNode = right;\n\n\t\t\tcountQueue.offer(parent);\n\t\t}\n\n\t\thuffmanNode rootNode = countQueue.poll();\n\n\t\t//Assign the codes to each node in the tree\n\t\tStack<huffmanNode> huffmanNodeStack = new Stack<>();\n\t\thuffmanNodeStack.add(rootNode);\n\t\twhile (!huffmanNodeStack.empty()) {\n\t\t\thuffmanNode huffmanNode = huffmanNodeStack.pop();\n\n\t\t\tif (huffmanNode.huffmanValue != '\\0') {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\thuffmanNode.codeRecord.forEach(sb::append);\n\t\t\t\tString codeSb = sb.toString();\n\n\t\t\t\tencodingTable.put(huffmanNode.huffmanValue, codeSb);\n\t\t\t\tdecodingTable.put(codeSb, huffmanNode.huffmanValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\thuffmanNode.leftNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.leftNode.codeRecord.add('0');\n\t\t\t\thuffmanNode.rightNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.rightNode.codeRecord.add('1');\n\t\t\t}\n\n\t\t\tif (huffmanNode.leftNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.leftNode);\n\n\t\t\tif (huffmanNode.rightNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.rightNode);\n\t\t}\n\t}",
"@Override\r\n public void run() {\n File huffmanFolder = newDirectoryEncodedFiles(file, encodedFilesDirectoryName);\r\n File huffmanTextFile = new File(huffmanFolder.getPath() + \"\\\\text.huff\");\r\n File huffmanTreeFile = new File(huffmanFolder.getPath() + \"\\\\tree.huff\");\r\n\r\n\r\n try (FileOutputStream textCodeOS = new FileOutputStream(huffmanTextFile);\r\n FileOutputStream treeCodeOS = new FileOutputStream(huffmanTreeFile)) {\r\n\r\n\r\n// Writing text bits to file text.huff\r\n StringBuilder byteStr;\r\n while (boolQueue.size() > 0 | !boolRead) {\r\n while (boolQueue.size() > 8) {\r\n byteStr = new StringBuilder();\r\n\r\n for (int i = 0; i < 8; i++) {\r\n String s = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(s);\r\n }\r\n\r\n if (isInterrupted())\r\n break;\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n\r\n if (fileRead && boolQueue.size() > 0) {\r\n lastBitsCount = boolQueue.size();\r\n byteStr = new StringBuilder();\r\n for (int i = 0; i < lastBitsCount; i++) {\r\n String bitStr = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(bitStr);\r\n }\r\n\r\n for (int i = 0; i < 8 - lastBitsCount; i++) {\r\n byteStr.append(\"0\");\r\n }\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n }\r\n\r\n\r\n// Writing the info for decoding to tree.huff\r\n// Writing last bits count to tree.huff\r\n treeCodeOS.write((byte)lastBitsCount);\r\n\r\n// Writing info for Huffman tree to tree.huff\r\n StringBuilder treeBitsArray = new StringBuilder();\r\n treeBitsArray.append(\r\n parser.parseByteToBinaryString(\r\n (byte) codesMap.size()));\r\n\r\n codesMap.keySet().forEach(key -> {\r\n String keyBits = parser.parseByteToBinaryString((byte) (char) key);\r\n String valCountBits = parser.parseByteToBinaryString((byte) codesMap.get(key).length());\r\n\r\n treeBitsArray.append(keyBits);\r\n treeBitsArray.append(valCountBits);\r\n treeBitsArray.append(codesMap.get(key));\r\n });\r\n if ((treeBitsArray.length() / 8) != 0) {\r\n int lastBitsCount = boolQueue.size() / 8;\r\n for (int i = 0; i < 7 - lastBitsCount; i++) {\r\n treeBitsArray.append(\"0\");\r\n }\r\n }\r\n\r\n for (int i = 0; i < treeBitsArray.length() / 8; i++) {\r\n treeCodeOS.write(parser.parseStringToByte(\r\n treeBitsArray.substring(8 * i, 8 * (i + 1))));\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\ttextArray = text.toCharArray();\n\n\t\tPriorityQueue<Leaf> queue = new PriorityQueue<>(new Comparator<Leaf>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Leaf a, Leaf b) {\n\t\t\t\tif (a.frequency > b.frequency) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (a.frequency < b.frequency) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor (char c : textArray) {\n\t\t\tif (chars.containsKey(c)) {\n\t\t\t\tint freq = chars.get(c);\n\t\t\t\tfreq = freq + 1;\n\t\t\t\tchars.remove(c);\n\t\t\t\tchars.put(c, freq);\n\t\t\t} else {\n\t\t\t\tchars.put(c, 1);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"tree print\");\t\t\t\t\t\t\t\t// print method begin\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tint freq = chars.get(c);\n\t\t\tSystem.out.println(c + \" \" + freq);\n\t\t}\n\n\t\tint total = 0;\n\t\tfor(char c : chars.keySet()){\n\t\t\ttotal = total + chars.get(c);\n\t\t}\n\t\tSystem.out.println(\"total \" + total);\t\t\t\t\t\t\t// ends\n\n\t\tfor (char c : chars.keySet()) {\n\t\t\tLeaf l = new Leaf(c, chars.get(c), null, null);\n\t\t\tqueue.offer(l);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tLeaf a = queue.poll();\n\t\t\tLeaf b = queue.poll();\n\n\t\t\tint frequency = a.frequency + b.frequency;\n\n\t\t\tLeaf leaf = new Leaf('\\0', frequency, a, b);\n\n\t\t\tqueue.offer(leaf);\n\t\t}\n\n\t\tif(queue.size() == 1){\n\t\t\tthis.root = queue.peek();\n\t\t}\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tString fname;\n\t\tFile file;\n\t\tScanner keyboard = new Scanner(System.in);\n\t\tScanner inFile;\n\n\t\tString line, word;\n\t\tStringTokenizer token;\n\t\tint[] freqTable = new int[256];\n\n\t\tSystem.out.println (\"Enter the complete path of the file to read from: \");\n\n\t\tfname = keyboard.nextLine();\n\t\tfile = new File(fname);\n\t\tinFile = new Scanner(file);\n\n\t\twhile (inFile.hasNext()) {\n\t\t\tline = inFile.nextLine();\n\t\t\ttoken = new StringTokenizer(line, \" \");\n\t\t\twhile (token.hasMoreTokens()) {\n\t\t\t\tword = token.nextToken();\n\t\t\t\tfreqTable = updateFrequencyTable(freqTable, word);\n\t\t\t}\n\t\t}\n\n\t\t//print frequency table\n\n\t\tSystem.out.println(\"Table of frequencies\");\n\t\tSystem.out.println(\"Character \\t Frequency \\n\");\n\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (freqTable[i]>0)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + freqTable[i]);\n\t\t\t}\n\n\t\tQueue<BinaryTree<Pair>> S = buildQueue(freqTable);\n\n\t\tQueue<BinaryTree<Pair>> T = new Queue<BinaryTree<Pair>>();\n\n\t\tBinaryTree<Pair> huffmanTree = createTree(S, T);\n\n\t\tString[] encodingTable = findEncoding(huffmanTree);\n\n\t\tSystem.out.println(\"Encoding Table\");\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (encodingTable[i]!=null)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + encodingTable[i]);\n\t\t}\n\t\tinFile.close();\n\t}",
"public static void encode()\n {\n \n String s = BinaryStdIn.readString();\n //String s = \"ABRACADABRA!\";\n int len = s.length();\n int key = 0;\n \n // generating rotating string table\n String[] table = new String[len];\n for (int i = 0 ; i < len; i++)\n {\n table[i] = rotate(s, i, len);\n }\n \n // sort the table\n String[] sorted = new String[len];\n for(int i = 0 ; i < len; i++)\n {\n sorted[i] = table[i];\n }\n sort(sorted, len);\n \n //generating encoded string\n StringBuilder result = new StringBuilder();\n for(int i = 0 ; i < len; i++)\n result.append(sorted[i].charAt(len-1));\n \n //find the key index \n for(int i = 0 ; i < table.length; i++)\n {\n if(sorted[i].equals(s))\n {\n key = i;\n break;\n }\n }\n \n // output part\n \n BinaryStdOut.write(key);\n \n for(int i = 0 ; i < len; i++)\n BinaryStdOut.write(result.charAt(i)); // generate the output character by character\n \n BinaryStdOut.close();\n \n }",
"public static void main(String[] args) throws IOException {\n\n HuffmanTree huffman = null;\n int value;\n String inputString = null, codedString = null;\n\n while (true) {\n System.out.print(\"Enter first letter of \");\n System.out.print(\"enter, show, code, or decode: \");\n int choice = getChar();\n switch (choice) {\n case 'e':\n System.out.println(\"Enter text lines, terminate with $\");\n inputString = getText();\n printAdjustedInputString(inputString);\n huffman = new HuffmanTree(inputString);\n printFrequencyTable(huffman.frequencyTable);\n break;\n case 's':\n if (inputString == null)\n System.out.println(\"Please enter string first\");\n else\n huffman.encodingTree.displayTree();\n break;\n case 'c':\n if (inputString == null)\n System.out.println(\"Please enter string first\");\n else {\n codedString = huffman.encodeAll(inputString);\n System.out.println(\"Code:\\t\" + codedString);\n }\n break;\n case 'd':\n if (inputString == null)\n System.out.println(\"Please enter string first\");\n else if (codedString == null)\n System.out.println(\"Please enter 'c' for code first\");\n else {\n System.out.println(\"Decoded:\\t\" + huffman.decode(codedString));\n }\n break;\n default:\n System.out.print(\"Invalid entry\\n\");\n }\n }\n }",
"public static void main(String[] args) {\n TextFileGenerator textFileGenerator = new TextFileGenerator();\n HuffmanTree huffmanTree;\n Scanner keyboard = new Scanner(System.in);\n PrintWriter encodedOutputStream = null;\n PrintWriter decodedOutputStream = null;\n String url, originalString = \"\", encodedString, decodedString;\n boolean badURL = true;\n int originalBits, encodedBits, decodedBits;\n\n while(badURL) {\n System.out.println(\"Please enter a URL: \");\n url = keyboard.nextLine();\n\n try {\n originalString = textFileGenerator.makeCleanFile(url, \"original.txt\");\n badURL = false;\n }\n catch(IOException e) {\n System.out.println(\"Error: Please try again\");\n }\n }\n\n huffmanTree = new HuffmanTree(originalString);\n encodedString = huffmanTree.encode(originalString);\n decodedString = huffmanTree.decode(encodedString);\n // NOTE: TextFileGenerator.getNumChars() was not working for me. I copied the encoded text file (pure 0s and 1s)\n // into google docs and the character count is accurate with the String length and not the method\n originalBits = originalString.length() * 16;\n encodedBits = encodedString.length();\n decodedBits = decodedString.length() * 16;\n\n decodedString = fixPrintWriterNewLine(decodedString);\n\n try { // creating the encoded and decoded files\n encodedOutputStream = new PrintWriter(new FileOutputStream(\"src\\\\edu\\\\miracosta\\\\cs113\\\\encoded.txt\"));\n decodedOutputStream = new PrintWriter(new FileOutputStream(\"src\\\\edu\\\\miracosta\\\\cs113\\\\decoded.txt\"));\n encodedOutputStream.print(encodedString);\n decodedOutputStream.print(decodedString);\n }\n catch(IOException e) {\n System.out.println(\"Error: IOException!\");\n }\n\n encodedOutputStream.close();\n decodedOutputStream.close();\n\n System.out.println(\"Original file bit count: \" + originalBits);\n System.out.println(\"Encoded file bit count: \" + encodedBits);\n System.out.println(\"Decoded file bit count: \" + decodedBits);\n System.out.println(\"Compression ratio: \" + (double)originalBits/encodedBits);\n }",
"public void translate(BitInputStream input, PrintStream output) {\n HuffmanNode node = this.front;\n while (input.hasNextBit()) {\n while (node.left != null && node.right != null) {\n if (input.nextBit() == 0) {\n node = node.left;\n } else {\n node = node.right;\n }\n }\n output.print(node.getData());\n node = this.front;\n }\n }",
"public static void encode(File inFile, File outFile) throws IOException {\n\t\tif (inFile.length() == 0) {\n\t\t\tFileOutputStream os = new FileOutputStream(outFile);\n\t\t\tos.close();\n\t\t\treturn;\n\t\t}\n\n\t\t// Get prefix-free code\n\t\tint[][] S = getSymbols(inFile);\n\t\tint symbolCount = S.length;\n\t\tint[] depths = PrefixFreeCode.getDepths(S, symbolCount);\n\n\t\t// Build tree\n\t\tNode root = new Node();\n\t\tint bodySize = 0;\n\t\tfor (int i = 0; i < symbolCount; i++) {\n\t\t\tbodySize += depths[i] * S[i][1];\n\t\t\troot.add(depths[i], S[i][0]);\n\t\t}\n\n\t\t// Initialize output\n\t\tFileOutputBuffer ob = new FileOutputBuffer(new FileOutputStream(outFile));\n\n\t\t// Emit table information\n\t\tob.append(symbolCount - 1, 8);\n\t\tfor (int i = 0; i < symbolCount; i++) {\n\t\t\tob.append(S[i][0], 8);\n\t\t\tob.append(depths[i], 8);\n\t\t}\n\n\t\t// Emit padding\n\t\tint padding = (int) ((bodySize + 3) % 8);\n\t\tif (padding != 0) {\n\t\t\tpadding = 8 - padding;\n\t\t}\n\t\tob.append(padding, 3);\n\t\tob.append(0, padding);\n\n\t\t// Emit body\n\t\tencodeBody(new Table(root), inFile, ob);\n\t\tob.close();\n\t}",
"void decode(){\n int bit = -1; // next bit from compressed file: 0 or 1. no more bit: -1\r\n int k = 0; // index to the Huffman tree array; k = 0 is the root of tree\r\n int n = 0; // number of symbols decoded, stop the while loop when n == filesize\r\n int numBits = 0; // number of bits in the compressed file\r\n FileOutputStream file = null;\r\n try {\r\n file = new FileOutputStream(\"uncompressed.txt\");\r\n } catch (FileNotFoundException ex) {\r\n System.err.println(\"Could not open file to write to.\");\r\n }\r\n while ((bit = inputBit()) >= 0){\r\n k = codetree[k][bit];\r\n numBits++;\r\n if (codetree[k][0] == 0){ // leaf\r\n try {\r\n file.write(codetree[k][1]);\r\n } catch (IOException ex) {\r\n System.err.println(\"Failed to write to file.\");\r\n }\r\n System.out.write(codetree[k][1]);\r\n if (n++ == filesize) break; // ignore any additional bits\r\n k = 0;\r\n }\r\n }\r\n System.out.printf(\"\\n\\n------------------------------\\n\" +\r\n \"%d bytes in uncompressed file.\\n\", filesize);\r\n System.out.printf(\"%d bytes in compressed file.\\n\", numBits / 8);\r\n System.out.printf(\"Compression ratio of %f.\", (double)numBits / (double)filesize);\r\n System.out.flush();\r\n }",
"private void HuffmanPrinter(HuffmanNode node, String s, PrintStream output) {\n if (node.left == null) {\n output.println((byte) node.getData());\n output.println(s);\n } else {\n HuffmanPrinter(node.left, s + 0, output);\n HuffmanPrinter(node.right, s + 1, output);\n }\n }",
"public Hashtable<Character,Code> getHuffmanCodes(int numberOfCodes,Hashtable<String,Character> revCodes) throws IOException {\r\n\t\tbyte[] b;\r\n\t\tHashtable<Character,Code> codes = new Hashtable<>();\r\n\t\t for (int i = 0 ; i < numberOfCodes ; i++) {\r\n\t\t\t System.out.println(\"i = \" + i);\r\n\t\t\t // i create a stringBuilder that will hold the code for each character\r\n\t\t\t StringBuilder c = new StringBuilder();\r\n\t\t\t // read the integer (4 bytes)\r\n\t\t\t b = new byte[4];\r\n\t\t\t in.read(b);\r\n\t\t\t // will hold the 4 bytes\r\n\t\t\t int code = 0;\r\n\t\t\t \r\n\t\t\t /* beacuse we wrote the integer reversed in the head\r\n\t\t\t * so the first 2 bytes from the left will hold the huffman's code\r\n\t\t\t * we get the second one then stick it to the (code) value we shift it to the left \r\n\t\t\t * then we get the first one and stick it to the (code) without shifting it\r\n\t\t\t * so actually we swipe the first 2 bytes because they are reversed\r\n\t\t\t */\r\n\t\t\t code |= (b[1] & 0xFF);\r\n\t\t\t code <<= 8;\r\n\t\t\t code |= (b[0] & 0xFF);\r\n\t\t\t \r\n\t\t\t // this loop go throw the (code) n bits where n is the length of the huff code that stored in the 2nd index of the array\r\n\t\t\t for (int j = 0 ; j < (b[2] & 0xFF) ; j++) {\r\n\t\t\t\t /*\r\n\t\t\t\t * each loop we compare the first bit from the right using & operation ans if it 1 so insert 1 to he first of the (c) which hold the huff it self\r\n\t\t\t\t * and if it zero we will insert zero as a string for both zero or 1\r\n\t\t\t\t */\r\n\t\t\t\t if ((code & 1) == 1) {\r\n\t\t\t\t\t c.insert(0, \"1\");\r\n\t\t\t\t } else \r\n\t\t\t\t\t c.insert(0, \"0\");\r\n\t\t\t\t code >>>= 1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t// codes.put((char)(b[3] & 0xFF), new Code((char)(b[3] & 0xFF),c.toString(),rep2[b[0] & 0xFF]));\r\n\t\t\t System.out.println(\"c = \" + c);\r\n\t\t\t \r\n\t\t\t // we store the huff code as a key in the hash and its value will be the character that in the index 3\r\n\t\t\t revCodes.put(c.toString(), (char)(b[3] & 0xFF));\r\n\t\t\t \r\n\t\t }\r\n\t\t return codes;\r\n\t}",
"public void buildHuffmanList(File inputFile){\n try{\n Scanner sc = new Scanner(inputFile);\n while(sc.hasNextLine()){\n\n String line = sc.nextLine();\n for(int i =0;i<line.length();i++){\n \n if(freqTable.isEmpty())\n freqTable.put(line.charAt(i),1);\n else{\n if(freqTable.containsKey(line.charAt(i)) == false)\n freqTable.put(line.charAt(i),1);\n else{\n int oldValue = freqTable.get(line.charAt(i));\n freqTable.replace(line.charAt(i),oldValue+1);\n }\n }\n }\n }\n }\n catch(FileNotFoundException e){\n System.out.println(\"Can't find the file\");\n }\n }",
"private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }",
"public static void main(String[] args) {\n Huffman huffman=new Huffman(\"Shevchenko Vladimir Vladimirovich\");\n System.out.println(huffman.getCodeText());//\n //answer:110100001001101011000001001110111110110101100110110001001110101111100011101000011011000100111010111110001110100101110101111100000\n\n huffman.getSizeBits();//размер в битах\n ;//кол-во символов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*8)); //коэффициент сжатия относительно aski кодов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*\n (Math.pow(huffman.getValueOfCharactersOfText(),0.5)))); //коэффициент сжатия относительно равномерного кода. Не учитывается размер таблицы\n System.out.println(huffman.getMediumLenght());//средняя длина кодового слова\n System.out.println(huffman.getDisper());//дисперсия\n\n\n }",
"public HuffmanCode(int[] frequencies) {\n Queue<HuffmanNode> nodeFrequencies = new PriorityQueue<HuffmanNode>();\n for (int i = 0; i < frequencies.length; i++) {\n if (frequencies[i] > 0) {\n nodeFrequencies.add(new HuffmanNode(frequencies[i], (char) i));\n }\n }\n nodeFrequencies = ArrayHuffmanCodeCreator(nodeFrequencies);\n this.front = nodeFrequencies.peek();\n }",
"public static String encode(String input) {\n\t\tNode root = buildHufffmanTree(input);\n\t\t \n\t\t //4.Get the encoding table\n\t\t Map<Character,String> encodingTable = buildNewEncodingTable(root);\n\t\t \n\t\t //5.Build the encoded string\n\t\t StringBuffer sb = new StringBuffer();\n\t\tfor(char c: input.toCharArray()) {\n\t\t\tsb.append(encodingTable.get(c));\n\t\t}\n\t\t\n\t\treturn sb.toString();\n\n\t}",
"public void printCode(PrintStream out, String code, BinaryTree<HuffData> tree) {\n HuffData theData = tree.getData(); //Get the data of the tree\n if (theData.symbol != null) { //If the data's symbol is not null (as in a symbol and not a sum)\n if(theData.symbol.equals(\" \")) { //If the symbol is a space print out \"space: \"\n out.println(\"space: \" + code);\n } else { //Otherwise print out the symbol and the code\n out.println(theData.symbol + \" \" + code);\n //Then add the symbol and code to the EncodeData table\n this.encodings[encodingsTop++] = new EncodeData(code, theData.symbol);\n }\n } else {\n //If the data's symbol is null, that means it is a sum node\n //and so it needs to go farther down the tree\n \n //Go down the left tree and add a 0\n printCode(out, code + \"0\", tree.getLeftSubtree());\n //Go down the right tree and add a 1\n printCode(out, code + \"1\", tree.getRightSubtree());\n }\n }",
"public static void compress(String s, String fileName) throws IOException {\n File file = new File(fileName);\n if (file.exists()){\n file.delete();\n }\n file.createNewFile();\n BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));\n char[] input = s.toCharArray();\n\n // tabulate frequency counts\n int[] freq = new int[R];\n for (int i = 0; i < input.length; i++)\n freq[input[i]]++;\n\n Node root = buildTrie(freq, out);\n\n // build code table\n String[] st = new String[R];\n buildCode(st, root, \"\");\n\n writeTrie(root, file);\n\n // print number of bytes in original uncompressed message\n BinaryStdOut.write(input.length);\n\n // use Huffman code to encode input\n for (int i = 0; i < input.length; i++) {\n String code = st[input[i]];\n for (int j = 0; j < code.length(); j++) {\n if (code.charAt(j) == '0') {\n BinaryStdOut.write(false);\n }\n else if (code.charAt(j) == '1') {\n BinaryStdOut.write(true);\n }\n else throw new IllegalStateException(\"Illegal state\");\n }\n }\n\n BinaryStdOut.close();\n }",
"public String buildTreeFromMessage(){\n parseMsg();\n if(printOCCTable)printTable();\n constructTree();\n reconstructTree();\n if(printHuffTree)\n printTree();\n return printBFSTree();\n }",
"public static void printEncoding(String[] encodings, int[] freqNums){\n int saveSpace = 0;\n //loops through all characters to print encodings and calculate savings\n for(int i = 0; i < encodings.length; i++) {\n if (freqNums[i] != 0) {\n System.out.println(\"'\" + (char)(i+32) + \"'\" + \": \" + freqNums[i] + \": \" + encodings[i]);\n saveSpace = saveSpace + (8 - encodings[i].length())*freqNums[i];\n }\n }\n System.out.println();\n System.out.println(\"You will save \" + saveSpace + \" bits with the Huffman Compressor\");\n }",
"public static void encode() {\n char[] symbols = initializeSymbols();\n int position;\n while (!BinaryStdIn.isEmpty()) {\n char symbol = BinaryStdIn.readChar();\n position = 0;\n while (symbols[position] != symbol) {\n position++;\n }\n BinaryStdOut.write(position, BITS_PER_BYTE);\n System.arraycopy(symbols, 0, symbols, 1, position);\n symbols[0] = symbol;\n }\n BinaryStdOut.close();\n }",
"public void constructTree(){\n PriorityQueue<HCNode> queue=new PriorityQueue<HCNode>();\n \n for(int i=0;i<MAXSIZE;i++){\n if(NOZERO){\n if(occTable[i]!=0){\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }else{\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }\n //constructing the Huffman Tree\n HCNode n1=null,n2=null;\n while(((n2=queue.poll())!=null) && ((n1=queue.poll())!=null)){\n HCNode nnode=new HCNode(n1.str+n2.str,n1.occ+n2.occ, null);\n nnode.left=n1;nnode.right=n2;\n n1.parent=nnode;n2.parent=nnode;\n queue.add(nnode);\n }\n if(n1==null&&n2==null){\n System.out.println(\"oops\");\n }\n if(n1!=null)\n root=n1;\n else\n root=n2;\n }",
"public void makeTree(){\n //convert Hashmap into charList\n for(Map.Entry<Character,Integer> entry : freqTable.entrySet()){\n HuffmanNode newNode = new HuffmanNode(entry.getKey(),entry.getValue());\n charList.add(newNode);\n }\n \n if(charList.size()==0)\n return;\n \n if(charList.size()==1){\n HuffmanNode onlyNode = charList.get(0);\n root = new HuffmanNode(null,onlyNode.getFrequency());\n root.setLeft(onlyNode);\n return;\n }\n \n Sort heap = new Sort(charList);\n heap.heapSort();\n \n while(heap.size()>1){\n \n HuffmanNode leftNode = heap.remove(0);\n HuffmanNode rightNode = heap.remove(0);\n \n HuffmanNode newNode = merge(leftNode,rightNode);\n heap.insert(newNode);\n heap.heapSort();\n }\n \n charList = heap.getList();\n root = charList.get(0);\n }",
"public HuffmanCode(Scanner input) {\n this.front = new HuffmanNode();\n while (input.hasNextLine()) {\n int character = Integer.parseInt(input.nextLine());\n String location = input.nextLine();\n ScannerHuffmanCodeCreator(this.front, location, (char) character);\n }\n }",
"public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}",
"public Decode(String inputFileName, String outputFileName){\r\n try(\r\n BitInputStream in = new BitInputStream(new FileInputStream(inputFileName));\r\n OutputStream out = new FileOutputStream(outputFileName))\r\n {\r\n int[] characterFrequency = readCharacterFrequency(in);//\r\n int frequencySum = Arrays.stream(characterFrequency).sum();\r\n BinNode root = HoffmanTree.HoffmanTreeFactory(characterFrequency).rootNode;\r\n //Generate Hoffman tree and get root\r\n\r\n int bit;\r\n BinNode currentNode = root;\r\n int byteCounter = 0;\r\n\r\n while ((bit = in.readBit()) != -1 & frequencySum >= byteCounter){\r\n //Walk the tree based on the incoming bits\r\n if (bit == 0){\r\n currentNode = currentNode.leftLeg;\r\n } else {\r\n currentNode = currentNode.rightLeg;\r\n }\r\n\r\n //If at end of tree, treat node as leaf and consider key as character instead of weight\r\n if (currentNode.leftLeg == null){\r\n out.write(currentNode.k); //Write character\r\n currentNode = root; //Reset walk\r\n byteCounter++; //Increment byteCounter to protect from EOF 0 fill\r\n }\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public static void encode () {\n // read the input\n s = BinaryStdIn.readString();\n char[] input = s.toCharArray();\n\n int[] indices = new int[input.length];\n for (int i = 0; i < indices.length; i++) {\n indices[i] = i;\n }\n \n Quick.sort(indices, s);\n \n // create t[] and find where original ended up\n char[] t = new char[input.length]; // last column in suffix sorted list\n int inputPos = 0; // row number where original String ended up\n \n for (int i = 0; i < indices.length; i++) {\n int index = indices[i];\n \n // finds row number where original String ended up\n if (index == 0)\n inputPos = i;\n \n if (index > 0)\n t[i] = s.charAt(index-1);\n else\n t[i] = s.charAt(indices.length-1);\n }\n \n \n // write t[] preceded by the row number where orginal String ended up\n BinaryStdOut.write(inputPos);\n for (int i = 0; i < t.length; i++) {\n BinaryStdOut.write(t[i]);\n BinaryStdOut.flush();\n } \n }",
"public String encode(String input) {\n String encoded = \"\";\n char[] message = input.toCharArray();\n for (int j = 0; j < message.length; j++) { //takes input into a array of chars\n encodingQueue.enqueue(message[j]);\n }\n char lastvalue =0;\n boolean islastvaluenum= false;\n for(int i=0; i<message.length;i++) {\n char character = encodingQueue.dequeue();\n if(character != ' ') { //if not a space\n String alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n if(islastvaluenum ==false) { //if last value was not a num, then proceed normally with first set of numbers\n char encodedvalue=enumerate(character,1);\n if(encodedvalue !=0) {\n islastvaluenum = true;\n lastvalue = encodedvalue;\n encoded = encoded +encodedvalue;\n }\n else {\n islastvaluenum = false;\n int shiftvalue = 5+(2*i);\n boolean charfound = false;\n char[] chararray = (alphabet.toUpperCase()).toCharArray();\n char output = 'n';\n for (int j=0;j<chararray.length;j++) { // look through the alphabet and see if character matches, then shift accordingly to shiftby\n if (charfound==false) {\n if (character == chararray[j]) {\n output = chararray[(j+chararray.length+shiftvalue)% chararray.length];\n charfound = true;\n }\n }\n }\n character = output;\n lastvalue = character;\n encoded = encoded+ character;\n }\n }\n else {\n char encodedvalue=enumerate(character,2);//if last value was a num, then proceed with second set of numbers\n if(encodedvalue !=0) {\n islastvaluenum = true;\n lastvalue = encodedvalue;\n encoded = encoded +encodedvalue;\n }\n else {\n islastvaluenum = false;\n int shiftvalue = (5+(2*i))+((lastvalue-'0')*(-2));\n boolean charfound = false;\n char[] chararray = (alphabet.toUpperCase()).toCharArray();\n char output = 'n';\n for (int j=0;j<chararray.length;j++) {// look through the alphabet and see if character matches, then shift accordingly to shiftby\n if (charfound==false) {\n if (character == chararray[j]) {\n output = chararray[(j+chararray.length+shiftvalue)% chararray.length];\n charfound = true;\n }\n }\n }\n character = output;\n lastvalue = character;\n encoded = encoded+ character;\n }\n }\n\n }\n else{\n encoded = encoded + ' ';\n }\n }\n return encoded;\n }",
"public static void main(String[] args) {\n Scanner teclado = new Scanner(System.in);\r\n String mensajeUsuario;\r\n System.out.println(\"Ingrese su mensaje:\");\r\n mensajeUsuario = teclado.nextLine();\r\n \r\n ArrayList inicial = new ArrayList<Nodo>();\r\n \r\n boolean valido = true;\r\n int contador = 0;\r\n //Se convierte el mensaje a una array de chars\r\n char [] arrayMensaje = mensajeUsuario.toCharArray();\r\n //Se cuenta la frecuencia de cada elemento\r\n for(char i: arrayMensaje){\r\n valido = true;\r\n Iterator itr = inicial.iterator();\r\n //Si el elemento que le toca no fue contado ya, es valido contar su frecuencia\r\n while (itr.hasNext()&&valido){\r\n Nodo element = (Nodo) itr.next();\r\n if (i==element.getCh()){\r\n valido = false;\r\n }\r\n }\r\n //Contar la frecuencia del elemento\r\n if (valido== true){\r\n Nodo temp = new Nodo();\r\n temp.setCh(i);\r\n for (char j:arrayMensaje){\r\n if (j==i){\r\n contador++;\r\n }\r\n }\r\n temp.setFreq(contador);\r\n inicial.add(temp);\r\n contador = 0;\r\n \r\n }\r\n }\r\n //Se recorre la lista generada de nodos para mostrar la frecuencia de cada elemento ene el orden en que aparecen\r\n System.out.println(\"elemento | frecuencia\");\r\n Iterator itr = inicial.iterator();\r\n while (itr.hasNext()){\r\n Nodo element = (Nodo)itr.next();\r\n System.out.println(element.getCh() + \" \"+ element.getFreq());\r\n }\r\n \r\n HuffmanTree huff = new HuffmanTree();\r\n huff.createTree(inicial);\r\n //System.out.println(huff.getRoot().getCh()+\" \"+huff.getRoot().getFreq());\r\n \r\n huff.codificar();\r\n System.out.println(\"elemento | frecuencia | codigo\");\r\n Iterator itrf= huff.getListaH().iterator();\r\n while(itrf.hasNext()){\r\n Nodo pivotal = (Nodo)itrf.next();\r\n System.out.println(pivotal.getCh() + \" \"+ pivotal.getFreq()+ \" \"+ pivotal.getCadena()); \r\n }\r\n \r\n System.out.println(\"Ingrese un codigo en base a la tabla anterior, separando por espacios cada nuevo caracter\");\r\n mensajeUsuario = teclado.nextLine();\r\n mensajeUsuario.indexOf(\" \");\r\n String mensajeFinal = \"\";\r\n String letra = \" \";\r\n String[] arrayDecode = mensajeUsuario.split(\" \");\r\n boolean codigoValido = true;\r\n for (String i: arrayDecode){\r\n if (codigoValido){\r\n letra = huff.decodificar(i);\r\n }\r\n if (letra.length()>5){\r\n codigoValido = false;\r\n }\r\n else {\r\n mensajeFinal = mensajeFinal.concat(letra);\r\n }\r\n }\r\n \r\n if (codigoValido){\r\n System.out.println(mensajeFinal);\r\n }\r\n else {\r\n System.out.println(\"El codigo ingresado no es valido\");\r\n }\r\n \r\n \r\n }",
"public static void main(String args[]) {\n\t\t\r\n\t\tnew HuffmanEncode(\"book3.txt\", \"book3Comp.txt\");\r\n\t\t//do not add anything here\r\n\t}",
"private void outputBuildTableFunction(PrintWriter out) {\n\t\t\n\t\tout.println(\" private void buildTable() {\");\n\t\t\n\t\tout.println(\" GrammarState[] graph;\");\n\t\t\n\t\tfor (String rulename : grammardef.getTable().keySet()) {\n\t\t\t\n\t\t\tout.println(\" table.put(\\\"\" + rulename + \"\\\", new HashMap<String, GrammarRule>());\");\n\t\t\t\n\t\t\tfor (String tokname : grammardef.getTable().get(rulename).keySet()) {\n\t\t\t\t\n\t\t\t\tGrammarRule rule = grammardef.getTable().get(rulename).get(tokname);\n\t\t\t\t\n\t\t\t\tString multi = rule.isMultiChild() ? \"true\" : \"false\";\n\t\t\t\tString sub = rule.isSubrule() ? \"true\" : \"false\";\n\t\t\t\t\n\t\t\t\tint i = 0;\n\t\t\t\tout.println(\" graph = new GrammarState[\" + rule.getGraph().size() + \"];\");\n\t\t\t\tfor (GrammarState state : rule.getGraph()) {\n\t\t\t\t\tout.println(\" graph[\" + (i++) + \"] = new GrammarState(\\\"\" + state.name + \"\\\", \" + state.type + \");\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tout.println(\" table.get(\\\"\" + rulename + \"\\\").put(\\\"\" + tokname + \"\\\", new GrammarRule(\\\"\" + rule.getName() + \"\\\", \" + multi + \", \" + sub + \", graph));\");\n\t\t\t\tout.println();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tout.println(\" }\");\n\t\t\n\t}",
"public void displayHuffCodesTable() {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t\n\t\tfor (int i = 0; i < this.huffCodeVals.length; i++) {\n\t\t\t\n\t\t\tif (this.huffCodeVals[i] != null) {\n\t\t\t\tif (i == 9) {\n\t\t\t\t\ttoPrint.append(\"\\\\t\");\n\t\t\t\t\t\n\t\t\t\t} else if (i == 10) {\n\t\t\t\t\ttoPrint.append(\"\\\\n\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttoPrint.append((char) i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttoPrint.append(\":\" + this.huffCodeVals[i] + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(toPrint.toString());\n\t}",
"public void createHuffmanTree() {\n\t\twhile (pq.getSize() > 1) {\n\t\t\tBinaryTreeInterface<HuffmanData> b1 = pq.removeMin();\n\t\t\tBinaryTreeInterface<HuffmanData> b2 = pq.removeMin();\n\t\t\tHuffmanData newRootData =\n\t\t\t\t\t\t\tnew HuffmanData(b1.getRootData().getFrequency() +\n\t\t\t\t\t\t\t\t\t\t\tb2.getRootData().getFrequency());\n\t\t\tBinaryTreeInterface<HuffmanData> newB =\n\t\t\t\t\t\t\tnew BinaryTree<HuffmanData>(newRootData,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b1,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b2);\n\t\t\tpq.add(newB);\n\t\t}\n\t\thuffmanTree = pq.getMin();\n\t}",
"public void save(PrintStream output) {\n HuffmanPrinter(this.front, \"\", output);\n }",
"public void buildTree(HuffData[] symbols) {\n //Create a new priorityqueue of type BinaryTree<HuffData> the size of \n //the number of symbols passed in\n Queue<BinaryTree<HuffData>> theQueue = new PriorityQueue<BinaryTree<HuffData>>(symbols.length, new CompareHuffmanTrees());\n //For each symbol in the symbols array\n for (HuffData nextSymbol : symbols) {\n //Create a new binary tree with the symbol\n BinaryTree<HuffData> aBinaryTree = new BinaryTree<HuffData>(nextSymbol, null, null);\n //Offer the new binary tree to the queue\n theQueue.offer(aBinaryTree);\n }\n //While there are still more than one items in the queue\n while(theQueue.size() > 1) {\n BinaryTree<HuffData> left = theQueue.poll(); //Take the top off the queue\n BinaryTree<HuffData> right = theQueue.poll(); //Take the new top off the queue\n int wl = left.getData().weight; //Get the weight of the left BinaryTree\n int wr = left.getData().weight; //Get the weight of the right BinaryTree\n //Create a new HuffData object with the weight as the sum of the left\n //and right and a null symbol\n HuffData sum = new HuffData(wl + wr, null); \n //Create a new BinaryTree with the sum HuffData and the left and right\n //as the left and right children\n BinaryTree<HuffData> newTree = new BinaryTree<HuffData>(sum, left, right);\n //Offer the sum binarytree back to the queue\n theQueue.offer(newTree);\n }\n //Take the last item off the queue\n huffTree = theQueue.poll();\n \n //Initalize the EncodeData array to be the same length as the passed in symbols\n encodings = new EncodeData[symbols.length];\n }",
"public static void encode() {\r\n int[] index = new int[R + 1];\r\n char[] charAtIndex = new char[R + 1];\r\n for (int i = 0; i < R + 1; i++) { \r\n index[i] = i; \r\n charAtIndex[i] = (char) i;\r\n }\r\n while (!BinaryStdIn.isEmpty()) {\r\n char c = BinaryStdIn.readChar();\r\n BinaryStdOut.write((char)index[c]);\r\n for (int i = index[c] - 1; i >= 0; i--) {\r\n char temp = charAtIndex[i];\r\n int tempIndex = ++index[temp];\r\n charAtIndex[tempIndex] = temp;\r\n }\r\n charAtIndex[0] = c;\r\n index[c] = 0;\r\n }\r\n BinaryStdOut.close();\r\n }",
"private void buildBinaryTree() {\n log.info(\"Constructing priority queue\");\n Huffman huffman = new Huffman(cache.vocabWords());\n huffman.build();\n\n log.info(\"Built tree\");\n\n }",
"public static void encode()\n {\n String s = BinaryStdIn.readString();\n CircularSuffixArray myCsa = new CircularSuffixArray(s);\n int first = 0;\n while (first < myCsa.length() && myCsa.index(first) != 0) {\n first++;\n }\n BinaryStdOut.write(first);\n int i = 0;\n while (i < myCsa.length()) {\n BinaryStdOut.write(s.charAt((myCsa.index(i) + s.length() - 1) % s.length()));\n i++;\n }\n BinaryStdOut.close();\n }",
"public static void main(String[] args){\n huffmanCoder(args[0],args[1]);\n }",
"public static void main(String[] args)\n\t{\n\t\tSystem.out.println(\"Hash Table Testing\");\n\t\t\n\t\tMyHashTable table = new MyHashTable();\n\t\t\n\t\ttable.IncCount(\"hello\");\n\t\ttable.IncCount(\"hello\");\n\t\t\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\t\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\t\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\t\n\t\ttable.IncCount(\"cool\");\n\t\t\n\t\ttable.IncCount(\"Assignment due\");\n\t\ttable.IncCount(\"Assignment due\");\n\t\t\n\t\ttable.IncCount(\"Wednesday\");\n\t\t\n\t\ttable.IncCount(\"night\");\n\t\ttable.IncCount(\"night\");\n\t\t\n\t\ttable.IncCount(\"at\");\n\t\t\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\t\n\t\tStringCount[] counts = table.GetCounts();\n\t\tString output = \"\";\n\t\t\n\t\tfor(int i = 0; i < counts.length; i++)\n\t\t{\n\t\t\tif(counts[i] != null)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"[\" + counts[i].str +\",\" + counts[i].cnt + \"], \");\n\t\t\t\toutput += \"[\" + counts[i].str +\",\" + counts[i].cnt + \"], \";\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.print(\"NULL!!!!! \" + i);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tif(output.compareTo(\"[Assignment due,2], [Food,7], [Happy Thanksgiving!,3], [TWELVE!!!,5], [Wednesday,1], [at,1], [cool,1], [hello,2], [night,2], [world,4], \") == 0)\n\t\t\tSystem.out.println(\"Success! Output is correct.\");\n\t\telse\n\t\t\tSystem.out.println(\"Failure! The output wasn't correct. Output was: \\\"\" + output +\"\\\"\");\n\t}",
"public static void main(String[] args) throws IOException {\n char[][] key = new char[8][8];\n\n String[] lines = new String[8];\n\n File fileCardan = new File(\"cardan.txt\");\n\n Scanner fileScanner = new Scanner(fileCardan);\n\n for (int i = 0; i < 8; i++) {\n lines[i] = fileScanner.nextLine();\n }\n\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n key[i][j] = lines[i].charAt(j);\n }\n\n }\n\n // reading text from input.txt file and getting count of 64 char blocks\n String text = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\n int blocksCount = text.length() / 64 + 1;\n\n FileWriter fw = new FileWriter(\"encode.txt\");\n\n // encoding all 64 char blocks\n for (int i = 0; i < blocksCount; i++) {\n\n char[][] res;\n if(64+i*64 > text.length())\n res = encode(key, text.substring(i*64));\n else\n res = encode(key, text.substring(i*64,64+i*64));\n fileWrite(res,fw);\n\n }\n\n fw.close();\n\n text = new String(Files.readAllBytes(Paths.get(\"encode.txt\")));\n\n fw = new FileWriter(\"decode.txt\");\n\n for (int i = 0; i < blocksCount; i++) {\n\n fw.write(decode(text.substring(i*64,i*64+64),key));\n\n }\n\n fw.close();\n\n\n\n }",
"public void printEncodedTable(File encodedFile){\n clearFile(encodedFile);\n try{\n BufferedWriter output = new BufferedWriter(new FileWriter(encodedFile,true));\n for(Map.Entry<Character,String> entry : encodedTable.entrySet()){\n Character c = entry.getKey();\n if(c >= 32 && c < 127)\n output.write(entry.getKey()+\": \"+entry.getValue());\n else\n output.write(\" [0x\" + Integer.toOctalString(c) + \"]\"+\": \"+entry.getValue());\n output.write(\"\\n\");\n }\n output.close();\n }catch(IOException e){\n System.out.println(\"IOException\");\n }\n }",
"public static void main(String[] args) throws IOException {\n BufferedReader buffRead = new BufferedReader(new FileReader(\"/home/hsnavarro/IdeaProjects/Aula 1/src/input\"));\n FileOutputStream output = new FileOutputStream(\"src/output\", true);\n String s = \"\";\n s = buffRead.readLine().toLowerCase();\n System.out.println(s);\n CifraCesar c = new CifraCesar(0, s, true);\n c.getInfo();\n int[] freq = new int[26];\n for (int i = 0; i < 26; ++i) freq[i] = 0;\n for (int i = 0; i < c.criptografada.length(); i++) {\n freq[c.criptografada.charAt(i) - 97]++;\n }\n Huffman h = new Huffman(freq, c.criptografada);\n h.printHuffman();\n h.descriptografiaHuffman();\n System.out.println(\"huffman: \" + h.descriptoHuffman);\n CifraCesar d = new CifraCesar(h.criptoAnalisis(), h.descriptoHuffman, false);\n\n System.out.println(d.descriptografada);\n System.out.println(d.descriptografada);\n\n System.out.println(\"Comparando:\");\n System.out.println(\"Antes da compressão:\" + s.length());\n\n byte inp = 0;\n int cnt = 0;\n for (int i = 0; i < h.criptografada.length(); i++) {\n int idx = i % 8;\n if (h.criptografada.charAt(i) == '1') inp += (1 << (7 - idx));\n if (idx == 7) {\n cnt++;\n output.write(inp);\n inp = 0;\n }\n }\n if(h.criptografada.length() % 8 != 0){\n cnt++;\n output.write(inp);\n }\n System.out.println(\"Depois da compressão:\" + cnt);\n buffRead.close();\n output.close();\n }",
"private static void printTree(HuffmanNode tree, String direction, FileWriter newVersion) throws IOException {\n\t\tif(tree.inChar != null) {\n\t\t\tnewVersion.write(tree.inChar + \": \" + direction + \" | \" + tree.frequency + System.getProperty(\"line.separator\"));\n\t\t\tresults[resultIndex][0] = tree.inChar;\n\t\t\tresults[resultIndex][1] = direction;\n\t\t\tresults[resultIndex][2] = tree.frequency;\n\t\t\tresultIndex++;\n\t\t}\n\t\telse {\n\t\t\tprintTree(tree.right, direction + \"1\", newVersion);\n\t\t\tprintTree(tree.left, direction + \"0\", newVersion);\n\t\t}\n\t}",
"private static SysexMessage buildDump(byte function, int channel, byte hdrData[], byte inputData[]) {\r\n SysexMessage msg = new SysexMessage();\r\n byte[] msgData = new byte[hdrData.length + inputData.length + 6]; // 5 for header, 1 for\r\n // last F7\r\n \r\n int i = 0;\r\n msgData[i++] = (byte) 0xF0;\r\n msgData[i++] = (byte) 0x42; // Korg ID\r\n msgData[i++] = (byte) (0x30 | channel); // 0x3n Format ID, n = channel\r\n // number\r\n msgData[i++] = (byte) 0x50; // Triton series ID\r\n msgData[i++] = (byte) function;\r\n // Function header\r\n if (hdrData != null) {\r\n for (int j = 0; j < hdrData.length; ++j) {\r\n msgData[i++] = hdrData[j];\r\n }\r\n }\r\n // Data\r\n if (inputData != null) {\r\n for (int j = 0; j < inputData.length; ++j) {\r\n msgData[i++] = inputData[j];\r\n }\r\n }\r\n msgData[i++] = (byte) 0xF7; // end of exclusive\r\n \r\n try {\r\n msg.setMessage(msgData, msgData.length);\r\n }\r\n catch (InvalidMidiDataException e) {\r\n e.printStackTrace();\r\n return null;\r\n }\r\n return msg;\r\n }",
"private void generateBack() {\n\t\tCharacter[] encodeChar = (Character[]) map.values().toArray(new Character[map.size()]);\n\t\tCharacter[] trueChar = (Character[]) map.keySet().toArray(new Character[map.size()]);\n\n\t\tString allencode = \"\";\n\t\tString allTrue = \"\";\n\n\t\tfor (int i = 0; i < encodeChar.length; i++) {\n\t\t\tallencode += encodeChar[i];\n\t\t\tallTrue += trueChar[i];\n\t\t}\n\n\t\tString code = \"import java.util.HashMap;\\n\" + \"import java.util.Map;\\n\" + \"import java.util.Scanner;\\n\"\n\t\t\t\t+ \"public class MyKey {\\n\"\n\t\t\t\t+ \"private static Map<Character, Character> map = new HashMap<Character, Character>();\\n\"\n\t\t\t\t+ \"private static char[] encodeChar = \\\"\" + allencode + \"\\\".toCharArray();\\n\"\n\t\t\t\t+ \"private static char[] trueChar = \\\"\" + allTrue + \"\\\".toCharArray();\\n\"\n\t\t\t\t+ \"private static void mapSetUp() {\\n\" + \"for (int i = 0; i < encodeChar.length; i++) {\\n\"\n\t\t\t\t+ \"map.put(encodeChar[i], trueChar[i]);\\n\" + \"}\\n\" + \"}\\n\"\n\t\t\t\t+ \"private static String decodeMessage(String message) {\\n\" + \"String decode = \\\"\\\";\\n\"\n\t\t\t\t+ \"for (int i = 0; i < message.length(); i++) {\\n\" + \"decode += map.get(message.charAt(i));\\n\" + \"}\\n\"\n\t\t\t\t+ \"return decode;\\n\" + \"}\\n\" + \"public static void main(String[] args){\\n\"\n\t\t\t\t+ \"Scanner sc = new Scanner(System.in);\\n\" + \"System.out.print(\\\"Input your encrypted message : \\\");\"\n\t\t\t\t+ \"String enMessage = sc.nextLine();\" + \"mapSetUp();\\n\"\n\t\t\t\t+ \"System.out.println(\\\"Decrypted message : \\\"+decodeMessage(enMessage));\\n\" + \"}}\";\n\t\tFile f = new File(\"MyKey.java\");\n\t\ttry {\n\t\t\tFileWriter fw = new FileWriter(f);\n\t\t\tBufferedWriter bf = new BufferedWriter(fw);\n\t\t\tbf.write(code);\n\t\t\tbf.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error about IO.\");\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"private void buildTable(HuffmanNode root) {\r\n \tpostorder(root, \"\");\r\n }",
"public int preprocessCompress(InputStream in) throws IOException {\n try {\n // Count the characters\n int counted = CharCounter.countAll(in); \n int[] countedArray = CharCounter.countValues();\n // Build the huffman tree\n TreeBuilder countedTree = new TreeBuilder();\n countedTree.buildTree(countedArray);\n // Create the huffman character codes\n HuffEncoder.huffEncode(countedTree.getRoot());\n return counted;\n } catch (IOException e) {\n throw e;\n }\n }",
"public String decode(String codedMessage) {\n StringBuilder result = new StringBuilder(); //Create a new stringbuilder\n BinaryTree<HuffData> currentTree = huffTree; //Get the Huffman Tree\n for (int i = 0; i < codedMessage.length(); i++) { //Loop through the coded message\n //If the character is a 1, set currentTree to the right subtree\n if(codedMessage.charAt(i) == '1') { \n currentTree = currentTree.getRightSubtree();\n } else { //If the character is a 0, set currentTree to the left subtree\n currentTree = currentTree.getLeftSubtree();\n }\n if(currentTree.isLeaf()) { //Once you hit a leaf\n HuffData theData = currentTree.getData(); //Get the data of the leaf\n result.append(theData.symbol); //Append the symbol to the stringbuilder\n currentTree = huffTree; //Reset the currentTree to be the entire tree\n }\n }\n //Return the string of the stringbuilder\n return result.toString();\n }",
"public static Node make_huffmann_tree(List li){\n //Sorting list in increasing order of its letter frequency \n li.sort(new comp());\n Node temp=null;\n Iterator it=li.iterator();\n //System.out.println(li.size());\n //Loop for making huffman tree till only single node remains in list\n while(true){\n temp=new Node();\n //a and b are Node which are to be combine to make its parent\n Node a=new Node(),b=new Node();\n a=null;b=null;\n //checking if list is eligible for combining or not\n //here first assignment of it.next in a will always be true as list till end will\n //must have atleast one node\n a=(Node)it.next();\n //Below condition is to check either list has 2nd node or not to combine \n //If this condition will be false, then it means construction of huffman tree is completed\n if(it.hasNext()){b=(Node)it.next();}\n //Combining first two smallest nodes in list to make its parent whose frequncy \n //will be equals to sum of frequency of these two nodes \n if(b!=null){\n temp.freq=a.freq+b.freq;a.data=0;b.data=1;//assigining 0 and 1 to left and right nodes\n temp.left=a;temp.right=b;\n //after combing, removing first two nodes in list which are already combined\n li.remove(0);//removes first element which is now combined -step1\n li.remove(0);//removes 2nd element which comes on 1st position after deleting first in step1\n li.add(temp);//adding new combined node to list\n //print_list(li); //For visualizing each combination step\n }\n //Sorting after combining to again repeat above on sorted frequency list\n li.sort(new comp()); \n it=li.iterator();//resetting list pointer to first node (head/root of tree)\n if(li.size()==1){return (Node)it.next();} //base condition ,returning root of huffman tree \n }\n}",
"public int compress(InputStream in, OutputStream out, boolean force) throws IOException {\n int walk = 0; // Temp storage for incoming byte from read file\n int walkCount = 0; // Number of total bits read\n char codeCheck = ' '; // Used as a key to find the code in the code map\n String[] codeMap = HuffEncoder.encoding(); // Stores the character codes, copied from HuffEncode\n String s2b = \"\"; // Temp string storage \n int codeLen = 0; // Temp storage for code length (array storage)\n BitInputStream bitIn = new BitInputStream(in); \n BitOutputStream bitOut = new BitOutputStream(out);\n\n // Writes the code array at the top of the file. It first writes the number of bits in the code, then \n // the code itself. In the decode proccess, the code length is first read, then the code is read using the length\n // as a guide.\n // A space at top of file ensures the following is the array, and the file will correctly decompress\n out.write(32);\n for (int i = 0; i < codeMap.length; i++) {\n // Value of the character\n s2b = codeMap[i];\n // If null, make it zero\n if(s2b == null){\n s2b = \"0\";\n }\n // Record length of code\n codeLen = s2b.length();\n // Write the length of the code, to use for decoding\n bitOut.writeBits(8, codeLen);\n // Write the value of the character\n for (int j = 0; j < s2b.length(); j++) {\n bitOut.writeBits(1, Integer.valueOf(s2b.charAt(j)));\n }\n }\n\n // Reads in a byte from the file, converts it to a character, then uses that \n // caracter to look up the huffman code. The huffman code is writen to the new \n // file.\n try {\n while(true){\n // Read first eight bits\n walk = bitIn.read();\n // -1 means the stream has reached the end\n if(walk == -1){break;}\n // convert the binary to a character\n codeCheck = (char) walk;\n // find the huff code for the character\n s2b = codeMap[codeCheck];\n // write the code to new file\n for (int i = 0; i < s2b.length(); i++) {\n bitOut.writeBits(1, Integer.valueOf(s2b.charAt(i)));\n }\n walkCount += 8; // Number of bits read\n }\n bitIn.close();\n bitOut.close();\n return walkCount; \n } catch (IOException e) {\n bitIn.close();\n bitOut.close();\n throw e;\n }\n }",
"public static void main(String [] args) throws IOException\n {\n System.out.println(\"PLAINTEXT FREQUENCY\");\n \n FrequencyAnalysis fa = new FrequencyAnalysis(); \n PrintWriter outFile1 = new PrintWriter (new File(\"plaintextfreq.txt\")); \n fa.readFile(\"plaintext.txt\"); \n int total1 = fa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile1.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n int l = 0;\n for (int k : fa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n outFile1.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n l++;\n }\n outFile1.close();\n \n System.out.println();\n System.out.println();\n System.out.println(\"CIPHER FREQUENCY\");\n \n FrequencyAnalysis cfa = new FrequencyAnalysis(); \n PrintWriter outFile2 = new PrintWriter (new File(\"ciphertextfreq.txt\")); \n cfa.readFile(\"ciphertext.txt\"); \n int total2 = cfa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile2.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n l = 0;\n for (int k : cfa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n outFile2.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n l++;\n }\n outFile2.close();\n \n \n }",
"public static void expand() {\n Node root = readTrie();\n\n // number of bytes to write\n int length = BinaryStdIn.readInt();\n\n // decode using the Huffman trie\n for (int i = 0; i < length; i++) {\n Node x = root;\n while (!x.isLeaf()) {\n boolean bit = BinaryStdIn.readBoolean();\n if (bit) x = x.right;\n else x = x.left;\n }\n BinaryStdOut.write(x.ch, 8);\n }\n BinaryStdOut.close();\n }",
"private Queue<HuffmanNode> ArrayHuffmanCodeCreator(Queue<HuffmanNode> frequencies) {\n while (frequencies.size() > 1) {\n HuffmanNode first = frequencies.poll();\n HuffmanNode second = frequencies.poll();\n HuffmanNode tempNode = new \n HuffmanNode(first.getFrequency() + second.getFrequency());\n tempNode.left = first;\n tempNode.right = second;\n frequencies.add(tempNode);\n }\n return frequencies;\n }",
"public static void main(String[] args) {\n System.out.println(\"din => \"+encode(\"din\"));\n System.out.println(\"recede => \"+encode(\"recede\"));\n System.out.println(\"Success => \"+encode(\"Success\"));\n System.out.println(\"(( @ => \"+encode(\"(( @\"));\n }",
"public static void main(String[] args)\n { \n Scanner in = new Scanner(System.in);\n String Another;\n do\n {\n int[] key ={};\n int keysize;\n Integer keyValue;\n String encoded = \"\", decoded = \"\", message=\"\";\n \n System.out.println(\"Please enter the message that you wish to encrypt: \");\n\t\t message = in.nextLine();\n System.out.println(\"Please enter the length of the key that you wish to use\");\n\t\t keysize = in.nextInt();\n key = new int[keysize];\n for (int index = 0; index < keysize; index++)\n\t\t\t {\n\t\t\t\tSystem.out.println(\"Please enter key index \" + (index + 1)\n\t\t\t\t\t\t+ \": \");\n\t\t\t\tkey[index] = in.nextInt();\n\t\t\t }\n \n /*String message = \"All programmers are playwrights and all \" +\n \"computers are lousy actors.\";*/\n \n System.out.println(\"\\nOriginal Message: \\n\" + message + \"\\n\");\n \n LinkedQueue<Integer> encodingQueue = new LinkedQueue<Integer>();\n\t\t LinkedQueue<Integer> decodingQueue = new LinkedQueue<Integer>();\n \n // load key queues \n for (int scan = 0; scan < key.length; scan++)\n {\n encodingQueue.enqueue(key[scan]);\n decodingQueue.enqueue(key[scan]);\n\t\t }\n \n // encode message \n for (int scan = 0; scan < message.length(); scan++)\n {\n keyValue = encodingQueue.dequeue();\n encoded += (char) (message.charAt(scan) + keyValue);\n encodingQueue.enqueue(keyValue);\n }\n \n System.out.println (\"Encoded Message:\\n\" + encoded + \"\\n\");\n \n // decode message \n for (int scan = 0; scan < encoded.length(); scan++)\n {\n keyValue = decodingQueue.dequeue();\n decoded += (char) (encoded.charAt(scan) - keyValue);\n decodingQueue.enqueue(keyValue);\n }\n \n System.out.println (\"Decoded Message:\\n\" + decoded);\n System.out.println();\n in = new Scanner(System.in);//clears the scanner buffer\n System.out.println(\"Please enter 'y' to run again, or any other character to exit: \");\n Another = in.nextLine();\n \n }\n while(Another.equalsIgnoreCase(\"Y\"));\n \n System.out.println(\"Thank you!\");\n }",
"public void setFrequencies() {\n\t\tleafEntries[0] = new HuffmanData(5000, 'a');\n\t\tleafEntries[1] = new HuffmanData(2000, 'b');\n\t\tleafEntries[2] = new HuffmanData(10000, 'c');\n\t\tleafEntries[3] = new HuffmanData(8000, 'd');\n\t\tleafEntries[4] = new HuffmanData(22000, 'e');\n\t\tleafEntries[5] = new HuffmanData(49000, 'f');\n\t\tleafEntries[6] = new HuffmanData(4000, 'g');\n\t}",
"private void printEncodedMessage() {\n System.out.print(\"\\nPrinting the encoded message\");\n System.out.print(\"\\n\" + encodedMessage + \"\\n\");\n System.out.println();\n }",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"private static void buildNewEncodingTableUtil(Node root , Map<Character,String> newTable , List<Character> path) {\n\t\t\n\t\tif(root!=null) {\n\t\t\t\n\t\t\tif(root.left==null && root.right==null) {//Leaf.. Put the sequence into the map.\n\t\t\t\t\n\t\t\t\tString encoding = path.stream().map(e->e.toString()).collect(Collectors.joining()); //Good stuff\n//\t\t\t\tSystem.out.println(\"--encoding : \" + encoding);\n\t\t\t\tnewTable.put(root.data, encoding);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tpath.add('0');\n\t\t\t\tbuildNewEncodingTableUtil(root.left, newTable, path);\n\t\t\t\tpath.remove(path.size()-1);\n\t\t\t\tpath.add('1');\n\t\t\t\tbuildNewEncodingTableUtil(root.right, newTable, path);\n\t\t\t\tpath.remove(path.size()-1);\n\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t}",
"public static void main(String[] args){\n //a\n /*HCTree hct=new HCTree(\"../HCT/huff_test_mssg.txt\",\"../HCT/test_key.txt\");\n hct.buildTreeFromMessage();*/\n //b\n HCTree hct=new HCTree(\"../HCT/huff_test_mssg.txt\",\"../HCT/test_key.txt\",\"../HCT/huff_test_tree_clean.txt\");\n hct.verify();\n }",
"public void encode(File file) throws FileNotFoundException {\r\n HuffmanTreeCreator huffmanTreeCreator = new HuffmanTreeCreator();\r\n this.file = file;\r\n this.codesMap = huffmanTreeCreator.createCodesMap(huffmanTreeCreator.createHuffmanTree(file));\r\n this.charsQueue = new BlockingCharQueue(charQueueMaxLength);\r\n this.boolQueue = new BlockingBoolQueue(boolQueueMaxLength);\r\n\r\n fileRead = false;\r\n boolRead = false;\r\n charsQueue.setStopThread(false);\r\n boolQueue.setStopThread(false);\r\n\r\n\r\n CharReader charWriter = new CharReader();\r\n BoolReader bollWriter = new BoolReader();\r\n BitWriter bitWriter = new BitWriter();\r\n charWriter.start();\r\n bollWriter.start();\r\n bitWriter.start();\r\n\r\n// try {\r\n// Thread.sleep(4000);\r\n// } catch (InterruptedException e) {\r\n// e.printStackTrace();\r\n// }\r\n// System.out.println(\"Char writer is alive: \" + charWriter.isAlive());\r\n// System.out.println(\"Bool writer is alive: \" + bollWriter.isAlive());\r\n// System.out.println(\"Bit writer is alive: \" + bitWriter.isAlive());\r\n// System.out.println(codesMap);\r\n\r\n try {\r\n charWriter.join();\r\n bollWriter.join();\r\n bitWriter.join();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }",
"private void printFrequencyTable() {\n System.out.println(\"\\nPrinting the frequency table:\");\n while(!frequencyTable.isEmpty()) {\n frequencyTable.remove().printNode();\n }\n }",
"public static void decode () {\n // read the input\n int firstThing = BinaryStdIn.readInt();\n s = BinaryStdIn.readString();\n char[] t = s.toCharArray();\n char[] firstColumn = new char[t.length];\n int [] next = new int[t.length];\n \n // copy array and sort\n for (int i = 0; i < t.length; i++) {\n firstColumn[i] = t[i];\n }\n Arrays.sort(firstColumn);\n \n // decode\n int N = t.length;\n int [] count = new int[256];\n \n // counts frequency of each letter\n for (int i = 0; i < N; i++) {\n count[t[i]]++;\n }\n \n int m = 0, j = 0;\n \n // fills the next[] array with appropriate values\n while (m < N) {\n int _count = count[firstColumn[m]];\n while (_count > 0) {\n if (t[j] == firstColumn[m]) {\n next[m++] = j;\n _count--;\n }\n j++;\n }\n j = 0;\n }\n \n // decode the String\n int _next = next.length;\n int _i = firstThing;\n for (int i = 0; i < _next; i++) {\n _i = next[_i];\n System.out.print(t[_i]);\n } \n System.out.println();\n }",
"@Override\n protected void doEncode(ByteArrayEncodingState encodingState) {\n CoderUtil.resetOutputBuffers(encodingState.outputs,\n encodingState.outputOffsets,\n encodingState.encodeLength);\n\n // MSREncodeData(encodeMatrix, encodingState.encodeLength, encodingState.inputs, encodingState.outputs);\n RSUtil.encodeData(gfTables, encodingState.encodeLength,\n encodingState.inputs,\n encodingState.inputOffsets, encodingState.outputs,\n encodingState.outputOffsets);\n }",
"public void encode (String input){\n\t\tfor (int j=rotors.length-1;j>=1; --j)\n\t\t{\n\t\t\trotors[j].setNeighbour1(rotors[j-1]);\n\t\t}\n\t\ttry{\n\t\t\tfor (int i = 0; i <= input.length() - 1; ++i){\n\t\t\t\tString type = new String(\"direct\");\n\t\t\t\tchar in = input.charAt(i);\n\t\t\t\tfor (int j = 0; j <= elements.size() - 1; ++j){\n\t\t\t\t\telements.get(j).transmitInput(in, type);\n\t\t\t\t\tin = elements.get(j).receiveOutput();\n\t\t\t\t\tif (in == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (in == 0) \n\t\t\t\t\tbreak;\n\t\t\t\ttype = \"inverse\";\n\t\t\t\tfor (int j = elements.size() - 2; j >= 0; --j){\n\t\t\t\t\telements.get(j).transmitInput(in, type);\n\t\t\t\t\tin = elements.get(j).receiveOutput();\n\t\t\t\t\tif (in == 0) break;\n\t\t\t\t}\n\t\t\t\tif (in == 0) continue;\n\t\t\t\tSystem.out.print(in);\n\t\t\t}\n\t\t}catch (NullPointerException e){\n\t\t\treturn;\n\t\t}\n\t}",
"public void loadInitQueue() {\n\t\t// go through every character\n\t\tfor (int i = 0; i < frequencyCount.length; i++) { \n\t\t\t// check to see if it has appeared at least once.\n\t\t\tif (frequencyCount[i] != 0) { \n\t\t\t\t// if so, make a tree for it and add it to the priority queue.\n\t\t\t\tCS232LinkedBinaryTree<Integer, Character> curTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\t\tcurTree.add(frequencyCount[i], (char) i);\n\t\t\t\thuffBuilder.add(curTree);\n\t\t\t}\n\t\t}\n\t}",
"public void encodeTreeHelper(HuffmanNode node, StringBuilder builder){\n if(node.getLeft() == null && node.getRight()== null && !node.getCharAt().equals(null))\n encodedTable.put(node.getCharAt(),builder.toString());\n else{\n encodeTreeHelper(node.getLeft(), builder.append(\"0\"));\n encodeTreeHelper(node.getRight(), builder.append(\"1\"));\n }\n \n if(builder.length()>0)\n builder.deleteCharAt(builder.length()-1);\n }",
"public static void encode() {\n char[] seq = new char[R];\n\n for (int i = 0; i < R; i++)\n seq[i] = (char) i;\n\n while (!BinaryStdIn.isEmpty()) {\n char c = BinaryStdIn.readChar();\n char t = seq[0];\n int i;\n for (i = 0; i < R - 1; i++) {\n char tmp;\n if (t == c) break;\n tmp = t;\n t = seq[i + 1];\n seq[i + 1] = tmp;\n }\n seq[0] = t;\n BinaryStdOut.write((char) i);\n }\n BinaryStdOut.close();\n }",
"private int Huffmancodebits( int [] ix, EChannel gi ) {\n\t\tint region1Start;\n\t\tint region2Start;\n\t\tint count1End;\n\t\tint bits, stuffingBits;\n\t\tint bvbits, c1bits, tablezeros, r0, r1, r2;//, rt, pr;\n\t\tint bitsWritten = 0;\n\t\tint idx = 0;\n\t\ttablezeros = 0;\n\t\tr0 = r1 = r2 = 0;\n\n\t\tint bigv = gi.big_values * 2;\n\t\tint count1 = gi.count1 * 4;\n\n\n\t\t/* 1: Write the bigvalues */\n\n\t\tif ( bigv!= 0 ) {\n\t\t\tif ( (gi.mixed_block_flag) == 0 && gi.window_switching_flag != 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t// if ( (gi.mixed_block_flag) == 0 && (gi.block_type == 2) ) { /* Three short blocks */\n\t\t\t\t/*\n Within each scalefactor band, data is given for successive\n time windows, beginning with window 0 and ending with window 2.\n Within each window, the quantized values are then arranged in\n order of increasing frequency...\n\t\t\t\t */\n\n\t\t\t\tint sfb, window, line, start, end;\n\n\t\t\t\t//int [] scalefac = scalefac_band_short; //da modificare nel caso si convertano mp3 con fs diversi\n\n\t\t\t\tregion1Start = 12;\n\t\t\t\tregion2Start = 576;\n\n\t\t\t\tfor ( sfb = 0; sfb < 13; sfb++ ) {\n\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\tstart = scalefac_band_short[ sfb ];\n\t\t\t\t\tend = scalefac_band_short[ sfb+1 ];\n\n\t\t\t\t\tif ( start < region1Start )\n\t\t\t\t\t\ttableindex = gi.table_select[ 0 ];\n\t\t\t\t\telse\n\t\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\tif ( gi.mixed_block_flag!= 0 && gi.block_type == 2 ) { /* Mixed blocks long, short */\n\t\t\t\t\tint sfb, window, line, start, end;\n\t\t\t\t\tint tableindex;\n\t\t\t\t\t//scalefac_band_long;\n\n\t\t\t\t\t/* Write the long block region */\n\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\tif ( tableindex != 0 )\n\t\t\t\t\t\tfor (int i = 0; i < 36; i += 2 ) {\n\t\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t}\n\t\t\t\t\t/* Write the short block region */\n\t\t\t\t\ttableindex = gi.table_select[ 1 ];\n\n\t\t\t\t\tfor ( sfb = 3; sfb < 13; sfb++ ) {\n\t\t\t\t\t\tstart = scalefac_band_long[ sfb ];\n\t\t\t\t\t\tend = scalefac_band_long[ sfb+1 ];\n\n\t\t\t\t\t\tfor ( window = 0; window < 3; window++ )\n\t\t\t\t\t\t\tfor ( line = start; line < end; line += 2 ) {\n\t\t\t\t\t\t\t\tx = ix[ line * 3 + window ];\n\t\t\t\t\t\t\t\ty = ix[ (line + 1) * 3 + window ];\n\t\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else { /* Long blocks */\n\t\t\t\t\tint scalefac_index = 100;\n\n\t\t\t\t\tif ( gi.mixed_block_flag != 0 ) {\n\t\t\t\t\t\tregion1Start = 36;\n\t\t\t\t\t\tregion2Start = 576;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tscalefac_index = gi.region0_count + 1;\n\t\t\t\t\t\tregion1Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t\tscalefac_index += gi.region1_count + 1;\n\t\t\t\t\t\tregion2Start = scalefac_band_long[ scalefac_index ];\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < bigv; i += 2 ) {\n\t\t\t\t\t\tint tableindex = 100;\n\t\t\t\t\t\tif ( i < region1Start ) {\n\t\t\t\t\t\t\ttableindex = gi.table_select[0];\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tif ( i < region2Start ) {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[1];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttableindex = gi.table_select[2];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t/* get huffman code */\n\t\t\t\t\t\tx = ix[i];\n\t\t\t\t\t\ty = ix[i + 1];\n\t\t\t\t\t\tif ( tableindex!= 0 ) {\n\t\t\t\t\t\t\tbits = HuffmanCode( tableindex, x, y );\n\t\t\t\t\t\t\tmn.add_entry( code, cbits );\n\t\t\t\t\t\t\tmn.add_entry( ext, xbits );\n\t\t\t\t\t\t\tbitsWritten += bits;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttablezeros += 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t}\n\t\tbvbits = bitsWritten;\n\n\t\t/* 2: Write count1 area */\n\t\tint tableindex = gi.count1table_select + 32;\n\n\t\tcount1End = bigv + count1;\n\t\tfor (int i = bigv; i < count1End; i += 4 ) {\n\t\t\tv = ix[i];\n\t\t\tw = ix[i+1];\n\t\t\tx = ix[i+2];\n\t\t\ty = ix[i+3];\n\t\t\tbitsWritten += huffman_coder_count1(tableindex);\n\t\t}\n\n\t\t// c1bits = bitsWritten - bvbits;\n\t\t// if ( (stuffingBits = gi.part2_3_length - gi.part2_length - bitsWritten) != 0 ) {\n\t\t// int stuffingWords = stuffingBits / 32;\n\t\t// int remainingBits = stuffingBits % 32;\n\t\t//\n\t\t// /*\n\t\t// Due to the nature of the Huffman code\n\t\t// tables, we will pad with ones\n\t\t// */\n\t\t// while ( stuffingWords-- != 0){\n\t\t// mn.add_entry( -1, 32 );\n\t\t// }\n\t\t// if ( remainingBits!=0 )\n\t\t// mn.add_entry( -1, remainingBits );\n\t\t// bitsWritten += stuffingBits;\n\t\t//\n\t\t// }\n\t\treturn bitsWritten;\n\t}",
"public String cipher() {\n int[] r1taps = {13, 16, 17, 18};\n int[] r2taps = {20, 21};\n int[] r3taps = {7, 20, 21, 22};\n\n // Set register size and majority bits\n final int R1 = 19;\n final int R1M = 8;\n final int R2 = 22;\n final int R2M = 10;\n final int R3 = 23;\n final int R3M = 10;\n\n // Initialize variables\n String bs = \"\";\n byte[] key = HexStringToBytes(symKey);\n BitSet keySet = new BitSet();\n BitSet keyStream = new BitSet();\n BitSet messageSet = new BitSet();\n\n // Create a byte array length of sample message\n byte[] messageArray = new byte[message.length()];\n\n // Convert the sample message to a byte array\n try {\n messageArray = message.getBytes(\"ISO-8859-1\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n\n // Convert message sample byte array to string\n String as = \"\";\n for (int i = 0; i < messageArray.length; i++) {\n byte b1 = messageArray[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n as += s;\n }\n\n // Convert string of bits to a BitSet\n messageSet = BitStringToBitSet(as);\n\n // Creates string from key byte array\n for (int i = 0; i < 8; i++) {\n byte b1 = key[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n bs += s;\n }\n\n // Convert string of bits to a BitSet\n keySet = BitStringToBitSet(bs);\n\n // Initialize registers\n BitSet r1 = new BitSet();\n BitSet r2 = new BitSet();\n BitSet r3 = new BitSet();\n\n // Process key into registers\n for (int i = 0; i < 64; i++) {\n r1 = ShiftSet(r1, R1, keySet.get(i) ^ Tap(r1, r1taps));\n r2 = ShiftSet(r2, R2, keySet.get(i) ^ Tap(r2, r2taps));\n r3 = ShiftSet(r3, R3, keySet.get(i) ^ Tap(r3, r3taps));\n }\n\n // Clock additional 100 times for additional security (GSM standard)\n for (int i = 0; i < 100; i++) {\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n }\n\n // Create keystream as long as the sample message\n for (int i = 0; i < message.length() * 8; i++) {\n\n // Get keystream bit\n keyStream.set(i, r1.get(R1 - 1) ^ r2.get(R2 - 1) ^ r3.get(R3 - 1));\n\n // Shift majority registers\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n\n }\n\n // XOR the message with the created keystream and return as string\n messageSet.xor(keyStream);\n return BitStringToText(ReturnSet(messageSet, message.length() * 8));\n }",
"public static void main(String[] args) { //modified from TextScan.Java\r\n\r\n //finds tokens, add h.add/h.display\r\n HashTable newHash1 = new HashTable();\r\n HashTable newHash2 = new HashTable();\r\n HashTable newHash3 = new HashTable();\r\n //^^hash 1-3\r\n args = new String[1];\r\n args[0] = \"keywords.txt\"; //enter file name here\r\n\r\n Scanner readFile = null;\r\n String s;\r\n int count = 0;\r\n\r\n System.out.println();\r\n System.out.println(\"Attempting to read from file: \" + args[0]);\r\n try {\r\n readFile = new Scanner(new File(args[0]));\r\n }\r\n catch (FileNotFoundException e) {\r\n System.out.println(\"File: \" + args[0] + \" not found\");\r\n System.exit(1);\r\n }\r\n\r\n System.out.println(\"Connection to file: \" + args[0] + \" successful\");\r\n System.out.println();\r\n\r\n while (readFile.hasNext()) {\r\n s = readFile.next();\r\n newHash1.add(s, 1);\r\n newHash2.add(s, 2);\r\n newHash3.add(s, 3);\r\n count++;\r\n }\r\n System.out.println(\"HASH FUNCTION 1\");\r\n newHash1.display();\r\n System.out.println();\r\n System.out.println(\"HASH FUNCTION 2\");\r\n newHash2.display();\r\n System.out.println();\r\n System.out.println(\"HASH FUNCTION 3\");\r\n newHash3.display();\r\n\r\n System.out.println();\r\n System.out.println(count + \" Tokens found\");\r\n System.out.println();\r\n//dabble:\r\n// String key = \"+\";\r\n// char newc = key.toString().charAt(0);\r\n// int a = newc;\r\n// System.out.println(\"KEY: \"+(key.toString().charAt(0)+1)+ \"WACK: \"+ a);\r\n\r\n\r\n\r\n }",
"public PacketAssembler()\n {\n \tthis.theTreeMaps = new TreeMap<Integer, TreeMap<Integer,String>>();\n \tthis.countPerMessage = new TreeMap<Integer,Integer>();\n }",
"private String encodeMessage() {\n\t\tString encode = \"\";\n\t\tfor (int i = 0; i < message.length(); i++) {\n\t\t\tencode += map.get(message.charAt(i));\n\t\t}\n\t\tgenerateBack();\n\t\treturn encode;\n\t}",
"public static void main(String[] args) {\n\n\n\t\tArrayList<Node> N = new ArrayList<Node>();\n\t\t\n\t\t/*\n\t\t * ##### Encoding Model 2 ###### \n\t\t */\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the privilege nodes\n\t\t */\n\t\tfor(int i=1; i<7; i++)\n\t\t{\n\t\t\tN.add(new Node(\"p\"+i, 1));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the exploit nodes\t\t \n\t\t */\n\t\tfor(int i=1; i<8; i++)\n\t\t{\n\t\t\tN.add(new Node(\"e\"+i, 2));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Encoding the child nodes\n\t\t */\n\t\tfor(int i=1; i<12; i++)\n\t\t{\n\t\t\tN.add(new Node(\"c\"+i, 0));\n\t\t}\n\t\t\n\t\t/*\n\t\t * Assigning the children and parent(s) for each node according to model 2\n\t\t */\n\t\t\n\t\tArrayList<Node> nil = new ArrayList<Node>();\n\t\t\n\t\tN.get(0).setParents(nil);\n\t\tN.get(0).addChild(N.get(6));\n\t\t\n\t\tN.get(6).addParent(N.get(0));\n\t\tN.get(6).addChild(N.get(1));\n\t\tN.get(6).addChild(N.get(13));\n\t\tN.get(6).addChild(N.get(14));\n\t\t\n\t\tN.get(1).addParent(N.get(6));\n\t\tN.get(1).addChild(N.get(7));\n\t\tN.get(1).addChild(N.get(8));\n\t\t\n\t\tN.get(7).addParent(N.get(1));\n\t\tN.get(7).addChild(N.get(15));\n\t\tN.get(7).addChild(N.get(2));\n\t\t\n\t\tN.get(2).addParent(N.get(7));\n\t\tN.get(2).addChild(N.get(10));\t\t\n\t\t\n\t\tN.get(8).addParent(N.get(1));\n\t\tN.get(8).addChild(N.get(16));\n\t\tN.get(8).addChild(N.get(3));\n\t\t\n\t\tN.get(3).addParent(N.get(8));\n\t\tN.get(3).addChild(N.get(9));\n\t\t\n\t\tN.get(10).addParent(N.get(2));\n\t\tN.get(10).addChild(N.get(5));\n\t\tN.get(10).addChild(N.get(19));\n\t\tN.get(10).addChild(N.get(20));\n\t\t\n\t\tN.get(9).addParent(N.get(3));\n\t\tN.get(9).addChild(N.get(4));\n\t\tN.get(9).addChild(N.get(17));\n\t\tN.get(9).addChild(N.get(18));\n\t\t\n\t\tN.get(4).addParent(N.get(9));\n\t\tN.get(4).addChild(N.get(12));\n\t\t\n\t\tN.get(5).addParent(N.get(10));\n\t\tN.get(5).addChild(N.get(11));\n\t\t\n\t\tN.get(12).addParent(N.get(4));\n\t\tN.get(12).addChild(N.get(22));\n\t\tN.get(12).addChild(N.get(23));\n\t\t\n\t\tN.get(11).addParent(N.get(5));\n\t\tN.get(11).addChild(N.get(21));\n\t\tN.get(11).addChild(N.get(23));\n\t\t\n\t\tN.get(13).addParent(N.get(6));\n\t\tN.get(14).addParent(N.get(6));\n\t\tN.get(15).addParent(N.get(7));\n\t\tN.get(16).addParent(N.get(8));\n\t\tN.get(17).addParent(N.get(9));\n\t\tN.get(18).addParent(N.get(9));\n\t\tN.get(19).addParent(N.get(10));\n\t\tN.get(20).addParent(N.get(10));\n\t\tN.get(21).addParent(N.get(11));\n\t\tN.get(22).addParent(N.get(12));\n\t\tN.get(23).addParent(N.get(11));\n\t\tN.get(23).addParent(N.get(12));\n\t\t\n\t\t\n\t\t/*\n\t\t * Encoding the C,I,A values for each node\n\t\t */\n\t\t\n\t\tN.get(0).setImpacts(4, 4, 4);\n\t\tN.get(1).setImpacts(1, 2, 3);\n\t\tN.get(2).setImpacts(2, 2, 1);\n\t\tN.get(3).setImpacts(1, 2, 1);\n\t\tN.get(4).setImpacts(1, 1, 1);\n\t\tN.get(5).setImpacts(3, 2, 3);\n\t\tN.get(13).setImpacts(3,3,3);\n\t\tN.get(14).setImpacts(3,3,3);\n\t\tN.get(15).setImpacts(3,3,3);\n\t\tN.get(16).setImpacts(3,3,3);\n\t\tN.get(17).setImpacts(3,3,3);\n\t\tN.get(18).setImpacts(3,3,3);\n\t\tN.get(19).setImpacts(3,3,3);\n\t\tN.get(20).setImpacts(3,3,3);\n\t\tN.get(21).setImpacts(3,3,3);\n\t\tN.get(22).setImpacts(3,3,3);\n\t\tN.get(23).setImpacts(2,2,1);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\n\t\t * This block helps see the setup of the whole tree. \n\t\t * Comment out if not required to see the parent children relationship of each node.\n\t\t */\n\t\t\n\t\tfor(int i=0; i<24; i++)\n\t\t{\n\t\t\tSystem.out.println(\"\\n\\n\" + N.get(i).getName() + \" < C=\" + N.get(i).getImpactC() + \", I=\" + N.get(i).getImpactI() + \", A=\" + N.get(i).getImpactA() + \" >\" );\n\t\t\tSystem.out.println(\"Parents: \");\n\t\t\tfor(int j=0; j<N.get(i).getParents().size(); j++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getParents().get(j).getName() + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nChildren: \");\n\t\t\tfor(int k=0; k<N.get(i).getChildren().size(); k++)\n\t\t\t{\n\t\t\t\tSystem.out.print(N.get(i).getChildren().get(k).getName() + \" \");\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t/*\n\t\t * Calling the method which will perform the C,I,A impact analysis \n\t\t */\n\t\t\n\t\t//Node n = new Node(); //Commented out as extended Main to Node and declared impactAnalysis() as static \n\t\t\n\t\tImpactAnalyzer ia = new ImpactAnalyzer();\n\t\tia.analyze(2, 2, 1, N);\n\t\t\n\t\t\n\t\t\n\t}",
"private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}",
"public static void main(String[] args) throws IOException {\r\n ObjectInputStream in = null; // reads in the compressed file\r\n FileWriter out = null; // writes out the decompressed file\r\n\r\n // Check for the file names on the command line.\r\n if (args.length != 2) {\r\n System.out.println(\"Usage: java Puff <in fname> <out fname>\");\r\n System.exit(1);\r\n }\r\n\r\n // Open the input file.\r\n try {\r\n in = new ObjectInputStream(new FileInputStream(args[0]));\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Can't open file \" + args[0]);\r\n System.exit(1);\r\n }\r\n\r\n // Open the output file.\r\n try {\r\n out = new FileWriter(args[1]);\r\n } catch (FileNotFoundException e) {\r\n System.out.println(\"Can't open file \" + args[1]);\r\n System.exit(1);\r\n }\r\n \r\n Puff pf = new Puff();\r\n pf.getFrequencies(in);\r\n // Create a BitReader that is able to read the compressed file.\r\n BitReader reader = new BitReader(in);\r\n\r\n\r\n /****** Add your code here. ******/\r\n pf.createTree();\r\n pf.unCompress(reader,out);\r\n \r\n /* Leave these lines at the end of the method. */\r\n in.close();\r\n out.close();\r\n }",
"int HuffmanCode(int table_select, int x, int y ) {\n\t\tint signx = 0, signy = 0, linbitsx, linbitsy, linbits, xlen, ylen, idx;\n\n\t\tcbits = 0;\n\t\txbits = 0;\n\t\tcode = 0;\n\t\text = 0;\n\n\t\tif(table_select==0) return 0;\n\n\t\t// signx = (x > 0)? 0: 1;\n\t\t// signy = (y > 0)? 0: 1;\n\t\t//x = Math.abs( x );\n\t\t//y = Math.abs( y );\n\n\t\tif(x < 0) {x = -x; signx = 1;}\n\t\tif(y < 0) {y = -y; signy = 1;}\n\n\t\txlen = this.xlen[table_select];\n\t\tylen = this.ylen[table_select];\n\t\tlinbits = this.linbits[table_select];\n\t\tlinbitsx = linbitsy = 0;\n\n\t\tif ( table_select > 15 ) { /* ESC-table is used */\n\t\t\tif ( x > 14 ) {\n\t\t\t\tlinbitsx = x - 15;\n\t\t\t\tx = 15;\n\t\t\t}\n\t\t\tif ( y > 14 ) {\n\t\t\t\tlinbitsy = y - 15;\n\t\t\t\ty = 15;\n\t\t\t}\n\n\t\t\tidx = (x * ylen) + y;\n\t\t\tcode = table[table_select][idx];\n\t\t\tcbits = hlen [table_select][idx];\n\t\t\tif ( x > 14 ) {\n\t\t\t\text |= linbitsx;\n\t\t\t\txbits += linbits;\n\t\t\t}\n\t\t\tif ( x != 0 ) {\n\t\t\t\text <<= 1;\n\t\t\t\text |= signx;\n\t\t\t\txbits += 1;\n\t\t\t}\n\t\t\tif ( y > 14 ) {\n\t\t\t\text <<= linbits;\n\t\t\t\text |= linbitsy;\n\t\t\t\txbits += linbits;\n\t\t\t}\n\t\t\tif ( y != 0 ) {\n\t\t\t\text <<= 1;\n\t\t\t\text |= signy;\n\t\t\t\txbits += 1;\n\t\t\t}\n\t\t} else { /* No ESC-words */\n\t\t\tidx = (x * ylen) + y;\n\t\t\tcode = table[table_select][idx];\n\t\t\tcbits += hlen[table_select][ idx ];\n\n\t\t\tif ( x != 0 ) {\n\t\t\t\tcode <<= 1;\n\t\t\t\tcode |= signx;\n\t\t\t\tcbits ++;\n\t\t\t}\n\t\t\tif ( y != 0 ) {\n\t\t\t\tcode <<= 1;\n\t\t\t\tcode |= signy;\n\t\t\t\tcbits ++;\n\t\t\t}\n\t\t}\n\n\t\treturn cbits + xbits;\n\t}",
"public void compress(BitInputStream in, BitOutputStream out){\n\n\t\t\tint[] counts = readForCounts(in);\n\t\t\tHuffNode root = makeTree(counts);\n\t\t\tMap<Integer, String> codings = makeCodingsFromTree(root);\n\t\t\twriter(root, out);\n\t\t\tin.reset();\n\t\t\twriteCompressedBits(in, codings, out);\n\t\t\tout.close();\n\t\t}",
"public static void main(String[] args) throws Exception {\n\t\ttry {\n\t\t\tHuffmanCompressor.HuffmanTree(args[0], args[1]);\n\t\t}\n\t\tcatch (IndexOutOfBoundsException c){\n\t\t\tSystem.out.println(\"Please input valid files\");\n\t\t}\n\t}",
"public String encode(String text) {\n\t\t// TODO fill this in.\n\n\t\tString encodedText = \"\";\n\t\tSystem.out.println(\"text.length(): \" + text.length());\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tString characterCode = encodingTable.get(text.charAt(i));\n\t\t\tSystem.out.println(text.charAt(i));\n\t\t\tencodedText = encodedText.concat(characterCode);\n\t\t}\n\t\tSystem.out.println(\"THISHERE: \\n\" + encodedText + \"\\nTHISEND\");\n\n\t\treturn encodedText;\n\t}",
"private HuffmanNode buildTree(int n) {\r\n \tfor (int i = 1; i <= n; i++) {\r\n \t\tHuffmanNode node = new HuffmanNode();\r\n \t\tnode.left = pQueue.poll();\r\n \t\tnode.right = pQueue.poll();\r\n \t\tnode.frequency = node.left.frequency + node.right.frequency;\r\n \t\tpQueue.add(node);\r\n \t}\r\n return pQueue.poll();\r\n }",
"public void getDecodedMessage(String encoding){\n\n String output = \"\";\n Node temp = this.root;\n for(int i = 0;i<encoding.length();i++){\n\n if(encoding.charAt(i) == '0'){\n temp = temp.left;\n\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root;\n }\n }\n else\n {\n temp = temp.right;\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root; \n }\n\n }\n }\n }",
"private void printCodeProcedure(String code, BinaryTreeInterface<HuffmanData> tree) {\n\t\t\t\tif (tree == null) {\n\n\t\t\t\t} else {\n\t\t\t\t\tprintCodeProcedure(code + \"0\", tree.getLeftSubtree());\n\t\t\t\t\tprintCodeProcedure(code + \"1\", tree.getRightSubtree());\n\t\t\t\t\tif (tree.getRootData().getSymbol() != '\\u0000') {\n\t\t\t\t\t\tSystem.out.println(tree.getRootData().getSymbol() + \": \" + code);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t}"
] | [
"0.6831677",
"0.6649164",
"0.66419405",
"0.6421441",
"0.6336391",
"0.62706536",
"0.6172938",
"0.61636055",
"0.61629236",
"0.61523366",
"0.6098605",
"0.60310525",
"0.600975",
"0.59904176",
"0.59352285",
"0.58983076",
"0.5867297",
"0.5865825",
"0.5865533",
"0.57969016",
"0.57327026",
"0.57306373",
"0.57256234",
"0.57211524",
"0.5658335",
"0.5653336",
"0.5652925",
"0.56475866",
"0.5633653",
"0.5567579",
"0.55634046",
"0.5525395",
"0.55213004",
"0.5487854",
"0.548661",
"0.5475101",
"0.5470721",
"0.5468247",
"0.5459302",
"0.54556614",
"0.53912634",
"0.5385957",
"0.5381617",
"0.53614736",
"0.53530043",
"0.53408605",
"0.5317476",
"0.52766603",
"0.5271668",
"0.52387667",
"0.5212971",
"0.5191632",
"0.517034",
"0.5120504",
"0.51143044",
"0.510329",
"0.5096022",
"0.5067604",
"0.50602895",
"0.5056815",
"0.5051166",
"0.5043291",
"0.502862",
"0.5023911",
"0.502106",
"0.50188774",
"0.50131065",
"0.49950376",
"0.49941382",
"0.4972999",
"0.49678484",
"0.49561888",
"0.49558955",
"0.49437413",
"0.49434358",
"0.49414012",
"0.49342877",
"0.49226668",
"0.4872063",
"0.48601174",
"0.48267567",
"0.48235407",
"0.4820721",
"0.4818816",
"0.47987008",
"0.4793108",
"0.4782038",
"0.4778501",
"0.4767403",
"0.47669452",
"0.47574362",
"0.47521344",
"0.4740177",
"0.47281495",
"0.47067535",
"0.47048533",
"0.46817657",
"0.46815887",
"0.46676674",
"0.46499327"
] | 0.80314964 | 0 |
encodes the data and writes the encoded message into the output file | private void encodeMessage() {
encodedMessage = "";
try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {
String inputLine;
while((inputLine = inputBuffer.readLine()) != null) {
//walks the input message and builds the encode message
for(int i = 0; i < inputLine.length(); i++) {
encodedMessage = encodedMessage + codeTable[inputLine.charAt(i)];
}
encodedMessage = encodedMessage + codeTable[10];
}
} catch (IOException e) {
e.printStackTrace();
}
//writes to the output file
try(BufferedWriter outputBuffer = Files.newBufferedWriter(outputPath)) {
outputBuffer.write(encodedMessage, 0, encodedMessage.length());
outputBuffer.newLine();
} catch (IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void encodeData() {\n frequencyTable = new FrequencyTableBuilder(inputPath).buildFrequencyTable();\n huffmanTree = new Tree(new HuffmanTreeBuilder(new FrequencyTableBuilder(inputPath).buildFrequencyTable()).buildTree());\n codeTable = new CodeTableBuilder(huffmanTree).buildCodeTable();\n encodeMessage();\n print();\n }",
"void notifyEncoderOutput(EncodingProfile format, String message, File... file);",
"public static void main(String[] args) {\n\n /** Reading a message from the keyboard **/\n // @SuppressWarnings(\"resource\")\n // Scanner scanner = new Scanner(System.in);\n // System.out.println(\"Please enter a message to be encoded: \");\n // String inputString = scanner.nextLine();\n //\n // System.out.println(\"Please enter the code length: \");\n // String codeLen = scanner.nextLine();\n // int num = Integer.parseInt(codeLen);\n // Encode encodeThis = new Encode(inputString, num);\n // encodeThis.createFrequencyTable();\n // encodeThis.createPriorityQueue();\n // while (encodeThis.stillEncoding()) {\n // encodeThis.build();\n // }\n // String codedMessage = encodeThis.getEncodedMessage();\n // /** Printing message to the screen **/\n // System.out.println(codedMessage);\n\n /** Reading message from a file **/\n ArrayList<String> info = new ArrayList<String>();\n try {\n File file = new File(\"/Users/ugoslight/Desktop/message.txt\");\n Scanner reader = new Scanner(file);\n\n while (reader.hasNextLine()) {\n String data = reader.nextLine();\n info.add(data);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"No file found.\");\n e.printStackTrace();\n }\n\n /** Encoding message from file **/\n Encode encodeThis = new Encode(info.get(0), Integer.parseInt(info.get(1)));\n encodeThis.createFrequencyTable();\n encodeThis.createPriorityQueue();\n while (encodeThis.stillEncoding()) {\n encodeThis.build();\n }\n String codedMessage = encodeThis.getEncodedMessage();\n /** Create new file **/\n try {\n File myObj = new File(\"/Users/ugoslight/Desktop/filename.txt\");\n if (myObj.createNewFile()) {\n System.out.println(\"File created: \" + myObj.getName());\n } else {\n System.out.println(\"File already exists.\");\n }\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n /** Write to file **/\n try {\n FileWriter myWriter = new FileWriter(\"/Users/ugoslight/Desktop/filename.txt\");\n myWriter.write(codedMessage);\n myWriter.close();\n System.out.println(\"Successfully wrote to the file.\");\n } catch (IOException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n\n\n\n }",
"public abstract byte[] encode () throws IOException;",
"void encode(StreamingContent content, OutputStream out) throws IOException;",
"@Override\n\tpublic void encode() {\n\t\tbyte[] messageData = encodeStarsMessage(message);\n\t\t\n\t\t// Allocate\n byte[] res = new byte[10 + messageData.length];\n\n // Write members\n Util.write16(res, 0, unknownWord0);\n Util.write16(res, 2, unknownWord2);\n Util.write16(res, 4, senderId);\n Util.write16(res, 6, receiverId);\n Util.write16(res, 8, unknownWord8);\n \n // Copy in message data\n System.arraycopy(messageData, 0, res, 10, messageData.length);\n \n // Save as decrypted data\n setDecryptedData(res, res.length);\n\t}",
"String encode(File message, File key,File crypted);",
"public static void encode() {\r\n int[] index = new int[R + 1];\r\n char[] charAtIndex = new char[R + 1];\r\n for (int i = 0; i < R + 1; i++) { \r\n index[i] = i; \r\n charAtIndex[i] = (char) i;\r\n }\r\n while (!BinaryStdIn.isEmpty()) {\r\n char c = BinaryStdIn.readChar();\r\n BinaryStdOut.write((char)index[c]);\r\n for (int i = index[c] - 1; i >= 0; i--) {\r\n char temp = charAtIndex[i];\r\n int tempIndex = ++index[temp];\r\n charAtIndex[tempIndex] = temp;\r\n }\r\n charAtIndex[0] = c;\r\n index[c] = 0;\r\n }\r\n BinaryStdOut.close();\r\n }",
"public void encodeAndSend(String msg)\n\t{\n\t\tif (isClosed())\n\t\t\treturn;\n\t\ttry\n\t\t{\n\t\t\tCharset charset = Charset.forName(\"ISO-8859-1\");\n\t\t\tCharsetEncoder encoder = charset.newEncoder();\n\t\t\tByteBuffer bbuf = encoder.encode(CharBuffer.wrap(msg));\n\t\t\toutToClient.write(bbuf.array());\n\t\t\toutToClient.flush();\n\t\t\tlastOutput = 0;\n\t\t\t\n\t\t\t// Copy output to anyone snooping this connection.\n\t\t\tfor (UserCon c : conns)\n\t\t\t\tif (c.snoop == this)\n\t\t\t\t\tc.encodeAndSend(\"} \"+msg);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tif (!e.getMessage().equals(\"Broken pipe\"))\n\t\t\t{\n\t\t\t\tsysLog(\"bugs\", \"Error in encodeAndSend: \"+e.getMessage());\n\t\t\t\tlogException(e);\n\t\t\t}\n\t\t\telse\n\t\t\t\tcloseSocket();\n\t\t}\n\t}",
"static void Output(String filename, String message){\n FileOutputStream out;\n DataOutputStream data;\n try {\n out = new FileOutputStream(filename);\n data = new DataOutputStream(out);\n data.writeBytes(message);\n data.close();\n }\n catch (FileNotFoundException ex){\n System.out.println(\"File to open file for writing\");\n }\n catch (IOException ex) {\n System.out.println(\"RuntimeException on writing/closing file\");\n }\n }",
"private void EnviarDatos(String data) \n {\n\n try \n {\n Output.write(data.getBytes());\n\n } catch (IOException e) {\n\n System.exit(ERROR);\n }\n }",
"public static void encode()\n {\n \n String s = BinaryStdIn.readString();\n //String s = \"ABRACADABRA!\";\n int len = s.length();\n int key = 0;\n \n // generating rotating string table\n String[] table = new String[len];\n for (int i = 0 ; i < len; i++)\n {\n table[i] = rotate(s, i, len);\n }\n \n // sort the table\n String[] sorted = new String[len];\n for(int i = 0 ; i < len; i++)\n {\n sorted[i] = table[i];\n }\n sort(sorted, len);\n \n //generating encoded string\n StringBuilder result = new StringBuilder();\n for(int i = 0 ; i < len; i++)\n result.append(sorted[i].charAt(len-1));\n \n //find the key index \n for(int i = 0 ; i < table.length; i++)\n {\n if(sorted[i].equals(s))\n {\n key = i;\n break;\n }\n }\n \n // output part\n \n BinaryStdOut.write(key);\n \n for(int i = 0 ; i < len; i++)\n BinaryStdOut.write(result.charAt(i)); // generate the output character by character\n \n BinaryStdOut.close();\n \n }",
"public static void encode(File fIn, File fOut) throws IOException {\n\t\tencode(fIn, fOut, true);\n\t}",
"private void createDecodedFile(String decodedValues, String encodedFileName) throws Exception {\r\n\r\n\r\n\t\tString decodedFileName = encodedFileName.substring(0, encodedFileName.lastIndexOf(\".\")) + \"_decoded.txt\";\r\n\t\t//FileWriter and BufferedWriter to write and it overwrites into the file.\r\n\t\tFileWriter fileWriter = new FileWriter(decodedFileName, false);\r\n\t\tBufferedWriter bufferedWriter = new BufferedWriter(fileWriter);\r\n\r\n\t\tbufferedWriter.write(decodedValues);\r\n\t\t//Flush and Close the bufferedWriter\r\n\t\tbufferedWriter.flush();\r\n\t\tbufferedWriter.close();\t\r\n\t}",
"public static void encode()\n {\n String s = BinaryStdIn.readString();\n CircularSuffixArray myCsa = new CircularSuffixArray(s);\n int first = 0;\n while (first < myCsa.length() && myCsa.index(first) != 0) {\n first++;\n }\n BinaryStdOut.write(first);\n int i = 0;\n while (i < myCsa.length()) {\n BinaryStdOut.write(s.charAt((myCsa.index(i) + s.length() - 1) % s.length()));\n i++;\n }\n BinaryStdOut.close();\n }",
"public static void main(String[] args) throws IOException {\n char[][] key = new char[8][8];\n\n String[] lines = new String[8];\n\n File fileCardan = new File(\"cardan.txt\");\n\n Scanner fileScanner = new Scanner(fileCardan);\n\n for (int i = 0; i < 8; i++) {\n lines[i] = fileScanner.nextLine();\n }\n\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n key[i][j] = lines[i].charAt(j);\n }\n\n }\n\n // reading text from input.txt file and getting count of 64 char blocks\n String text = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\n int blocksCount = text.length() / 64 + 1;\n\n FileWriter fw = new FileWriter(\"encode.txt\");\n\n // encoding all 64 char blocks\n for (int i = 0; i < blocksCount; i++) {\n\n char[][] res;\n if(64+i*64 > text.length())\n res = encode(key, text.substring(i*64));\n else\n res = encode(key, text.substring(i*64,64+i*64));\n fileWrite(res,fw);\n\n }\n\n fw.close();\n\n text = new String(Files.readAllBytes(Paths.get(\"encode.txt\")));\n\n fw = new FileWriter(\"decode.txt\");\n\n for (int i = 0; i < blocksCount; i++) {\n\n fw.write(decode(text.substring(i*64,i*64+64),key));\n\n }\n\n fw.close();\n\n\n\n }",
"private void toFile(OutputData data) {\n if(data == null) {\r\n JOptionPane.showMessageDialog(this, \"Dane wynikowe nie zostały jeszcze umieszczone w pamieci\");\r\n return;\r\n }\r\n\r\n // Sprawdzenie sciezki zapisu\r\n String filePath = this.outputFileSelector.getPath();\r\n if(filePath.length() <= 5) {\r\n JOptionPane.showMessageDialog(this, \"Nie można zapisać wyniku w wybranej lokacji!\");\r\n return;\r\n }\r\n\r\n // Zapisujemy plik na dysk\r\n try{\r\n PrintWriter writer = new PrintWriter(filePath, \"UTF-8\");\r\n OutputDataFormatter odf = new OutputDataFormatter(this.outputData);\r\n\r\n String userPattern = this.outputFormatPanel.getPattern();\r\n writer.write(odf.getParsedString(userPattern.length() < 2 ? defaultFormatting : userPattern));\r\n\r\n writer.close();\r\n } catch (IOException e) {\r\n JOptionPane.showMessageDialog(this, \"Wystąpił błąd IO podczas zapisu.\");\r\n }\r\n\r\n }",
"public static void encode(File fIn) throws IOException {\n\t\tencode(fIn, fIn, true);\n\t}",
"protected void encode() {\t\n\t\tsuper.rawPkt = new byte[12 + this.pktData.length];\n\t\tbyte[] tmp = StaticProcs.uIntLongToByteWord(super.ssrc);\n\t\tSystem.arraycopy(tmp, 0, super.rawPkt, 4, 4);\n\t\tSystem.arraycopy(this.pktName, 0, super.rawPkt, 8, 4);\n\t\tSystem.arraycopy(this.pktData, 0, super.rawPkt, 12, this.pktData.length);\n\t\twriteHeaders();\n\t\t//System.out.println(\"ENCODE: \" + super.length + \" \" + rawPkt.length + \" \" + pktData.length);\n\t}",
"public DataBuffer encode() {\n try {\n\n DataBuffer buffer = new DataBuffer();\n // length\n int length = Header.PROTOCOL_HEADER_LENGTH;\n if (mData != null) {\n length += mData.readableBytes();\n }\n buffer.writeInt(length);\n // header\n mHeader.setLength(length);\n buffer.writeDataBuffer(mHeader.encode(mHeader.getVersion()));\n // data\n buffer.writeDataBuffer(mData);\n\n return buffer;\n } catch (Exception e) {\n //logger.error(\"encode error!!!\", e);\n System.out.println(\"encode error!!\");\n throw new RuntimeException(\"encode error!!!\");\n }\n }",
"OutputFile encryptingOutputFile();",
"void encode(ByteBuffer buffer, Message message);",
"protected void encode() {\n\t\tsuper.rawPkt = new byte[12 + this.PID.length*4];\n\t\t\n\t\tbyte[] someBytes = StaticProcs.uIntLongToByteWord(super.ssrc);\n\t\tSystem.arraycopy(someBytes, 0, super.rawPkt, 4, 4);\n\t\tsomeBytes = StaticProcs.uIntLongToByteWord(this.ssrcMediaSource);\n\t\tSystem.arraycopy(someBytes, 0, super.rawPkt, 8, 4);\n\t\t\n\t\t// Loop over Feedback Control Information (FCI) fields\n\t\tint curStart = 12;\n\t\tfor(int i=0; i < this.PID.length; i++ ) {\n\t\t\tsomeBytes = StaticProcs.uIntIntToByteWord(PID[i]);\n\t\t\tsuper.rawPkt[curStart++] = someBytes[0];\n\t\t\tsuper.rawPkt[curStart++] = someBytes[1];\n\t\t\tsomeBytes = StaticProcs.uIntIntToByteWord(BLP[i]);\n\t\t\tsuper.rawPkt[curStart++] = someBytes[0];\n\t\t\tsuper.rawPkt[curStart++] = someBytes[1];\n\t\t}\n\t\twriteHeaders();\n\t}",
"@Override\n\tprotected void encode(ChannelHandlerContext ctx, Envelope env, ByteBuf out) throws Exception {\n\t\t// (1) header (48 bytes)\n\t\t// --------------------------------------------------------------------\n\t\tout.writeInt(MAGIC_NUMBER); // 4 bytes\n\n\t\tif (out.getInt(out.writerIndex()-4) != MAGIC_NUMBER) {\n\t\t\tthrow new RuntimeException();\n\t\t}\n\n\t\tout.writeInt(env.getSequenceNumber()); // 4 bytes\n\t\tenv.getJobID().writeTo(out); // 16 bytes\n\t\tenv.getSource().writeTo(out); // 16 bytes\n\t\tout.writeInt(env.getEventsSerialized() != null ? env.getEventsSerialized().remaining() : 0); // 4 bytes\n\t\tout.writeInt(env.getBuffer() != null ? env.getBuffer().size() : 0); // 4 bytes\n\t\t// --------------------------------------------------------------------\n\t\t// (2) events (var length)\n\t\t// --------------------------------------------------------------------\n\t\tif (env.getEventsSerialized() != null) {\n\t\t\tout.writeBytes(env.getEventsSerialized());\n\t\t}\n\n\t\t// --------------------------------------------------------------------\n\t\t// (3) buffer (var length)\n\t\t// --------------------------------------------------------------------\n\t\tif (env.getBuffer() != null) {\n\t\t\tBuffer buffer = env.getBuffer();\n\t\t\tout.writeBytes(buffer.getMemorySegment().wrap(0, buffer.size()));\n\n\t\t\t// Recycle the buffer from OUR buffer pool after everything has been\n\t\t\t// copied to Nettys buffer space.\n\t\t\tbuffer.recycleBuffer();\n\t\t}\n\t}",
"public static void encode() {\n char[] seq = new char[R];\n\n for (int i = 0; i < R; i++)\n seq[i] = (char) i;\n\n while (!BinaryStdIn.isEmpty()) {\n char c = BinaryStdIn.readChar();\n char t = seq[0];\n int i;\n for (i = 0; i < R - 1; i++) {\n char tmp;\n if (t == c) break;\n tmp = t;\n t = seq[i + 1];\n seq[i + 1] = tmp;\n }\n seq[0] = t;\n BinaryStdOut.write((char) i);\n }\n BinaryStdOut.close();\n }",
"byte[] encode(IMessage message) throws IOException;",
"public String readNwrite() {\n if (encoded) {\n try {\n msgEncoded = Files.readAllLines(msgEncodedPath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n for (String line : msgEncoded) {\n try {\n Files.writeString(msgClearPath, transCoder.decodeMsg(line) + System.lineSeparator(), StandardOpenOption.CREATE, StandardOpenOption.APPEND);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return \"Votre message à bien été décodé, retrouvez le ici : \" + msgClearPath;\n } else {\n try {\n msgClear = Files.readAllLines(msgClearPath);\n } catch (IOException e) {\n e.printStackTrace();\n }\n for (String line : msgClear) {\n try {\n Files.writeString(msgEncodedPath, transCoder.encodeMsg(line) + System.lineSeparator(), StandardOpenOption.CREATE, StandardOpenOption.APPEND);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return \"Votre message à bien été codé, retrouvez le ici : \" + msgEncodedPath;\n }\n }",
"public void write(String plaintext)\n\t{\n\t\ttry {\n\t\t\tFileWriter writer = new FileWriter(thisFile);\n\t\t\t//encoder?\n\t\t\twriter.write(words, 0, words.length);\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}",
"void generateContent(OutputStream output) throws Exception;",
"public static void encode() {\n char[] symbols = initializeSymbols();\n int position;\n while (!BinaryStdIn.isEmpty()) {\n char symbol = BinaryStdIn.readChar();\n position = 0;\n while (symbols[position] != symbol) {\n position++;\n }\n BinaryStdOut.write(position, BITS_PER_BYTE);\n System.arraycopy(symbols, 0, symbols, 1, position);\n symbols[0] = symbol;\n }\n BinaryStdOut.close();\n }",
"@Override\n\tprotected void encode(ChannelHandlerContext ctx, Packet msg, ByteBuf out) throws Exception\n\t{\n\t\tout.writeShort(msg.getPacketID()); // Packet ID\n\t\t\n\t\ttry\n\t\t{\n\t\t\tmsg.encodePayload(out);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tctx.fireExceptionCaught(e);\n\t\t}\n\t}",
"private void encode(){\r\n \r\n StringBuilder sb = new StringBuilder();\r\n \r\n /*\r\n *if a character code is >126 after adding the encryption key, subtract \r\n *95 to wrap\r\n */\r\n for(int i = 0; i < message.length(); i++){\r\n if(message.charAt(i) + key > 126){\r\n int wrappedKey = message.charAt(i) + key - 95;\r\n \r\n sb.append((char) wrappedKey);\r\n \r\n /*\r\n *if a character code ins't > 126 after adding the encryption key\r\n */\r\n } else{\r\n int wrappedKey = message.charAt(i) + key;\r\n sb.append( (char) wrappedKey);\r\n }\r\n }\r\n /*\r\n *case coded message to a string\r\n */\r\n codedMessage = sb.toString();\r\n }",
"public static String encode(byte[] data) {\t\t\n\t\tif (data == null || data.length == 0) {\n\t\t\treturn \"\";\n\t\t}\n\t\t\n\t\tStringBuilder resultBuffer = new StringBuilder();\n\t\t//mod\n\t\tint m = data.length % 3;\n\t\t//amount of data group with 3 byte\n\t\tint g = (m == 0) ? (data.length / 3) : (data.length / 3 + 1);\n\t\tfinal byte[] _clear_buff = {0, 0, 0};\n\t\tbyte[] dataBuffer = new byte[3];\n\t\tchar[] codeBuffer = new char[4];\n\t\tint offset = 0;\n\t\tfor (int i = 0; i < g; ++i) {\n\t\t\t//clear buffer\n\t\t\tSystem.arraycopy(_clear_buff, 0, dataBuffer, 0, 3);\n\t\t\t//copy data for handling\n\t\t\tint copySize = (m != 0 && i == g - 1) ? m : 3;\n\t\t\tSystem.arraycopy(data, offset, dataBuffer, 0, copySize);\n\t\t\t//concatenate the byte data buffer as an integer\n\t\t\tint tmp = 0x00000000;\n\t\t\tfor (int j = 0, z = 2; j < 3; ++j, --z) {\n\t\t\t\tint tt = ((dataBuffer[j] & 0xff) << (z * 8));\n\t\t\t\ttmp ^= tt;\n\t\t\t}\n\t\t\t//encode current data buffer with base64\n\t\t\tfor (int k = 0; k < 4; ++k) {\n\t\t\t\tint p = (tmp >> (k * 6)) & 0x0000003F;\n\t\t\t\tcodeBuffer[3 - k] = _dict_[p];\n\t\t\t}\n\t\t\t\n\t\t\tif (copySize != 3) {\n\t\t\t\tfor (int e = 0; e < 3 - copySize; ++e) {\n\t\t\t\t\tcodeBuffer[3 - e] = '=';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tresultBuffer.append(codeBuffer);\n\t\t\toffset += 3;\n\t\t}\n\t\t\n\t\tString encodeText = resultBuffer.toString();\n\t\tresultBuffer.delete(0, resultBuffer.length());\n\t\treturn encodeText;\n\t}",
"@Override\n public int writeData(OutputStream out, T data) throws Exception\n {\n OutputStreamWriter w = new OutputStreamWriter(out, \"UTF-8\");\n w.write(_serializer.deepSerialize(data));\n w.close();\n return -1;\n }",
"private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}",
"private static void writer(String filename, char[] chars) {\n BinaryOut binaryOut = new BinaryOut(filename);\n\n for (char c : chars) {\n binaryOut.write(c);\n }\n\n binaryOut.close();\n }",
"private void writeDataToFile(char[] charArr, String filePath) {\n try {\n\n File outputFile = new File(filePath);\n\n if (sentencesProcessed == 1 || isMetricsFilePath) {\n outputFile.delete();\n outputFile.createNewFile();\n }\n\n FileWriter outputFileWrtrObj = new FileWriter(outputFile, true);\n\n for (char ch : charArr) {\n outputFileWrtrObj.write(ch);\n }\n\n outputFileWrtrObj.close();\n\n } catch (Exception e) {\n System.out.println(utilityConstants.LINE_SEPARATOR);\n System.err.println(utilityConstants.FILE_WRITING_ERROR_MSG);\n e.printStackTrace();\n System.exit(0);\n\n }\n }",
"protected void writeData(OutputStream out) throws IOException {\r\n out.write(content);\r\n }",
"@Override\n\tprotected void encode(ChannelHandlerContext ctx, RPCResponse msg, ByteBuf out) throws Exception {\n\t\tbyte[] data = SerializationUtils.serialize(msg);\n\t\tout.writeInt(data.length);\n\t\tout.writeBytes( data );\n\t}",
"public void writeFile() \r\n\t{\r\n\t\tStringBuilder builder = new StringBuilder();\r\n\t\tfor(String str : scorers)\r\n\t\t\tbuilder.append(str).append(\",\");\r\n\t\tbuilder.deleteCharAt(builder.length() - 1);\r\n\t\t\r\n\t\ttry(DataOutputStream output = new DataOutputStream(new FileOutputStream(HIGHSCORERS_FILE)))\r\n\t\t{\r\n\t\t\toutput.writeChars(builder.toString());\r\n\t\t} \r\n\t\tcatch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.err.println(\"[ERROR]:[FileManager] File \" + HIGHSCORERS_FILE + \" was not found \" \r\n\t\t\t\t\t+ \"while writing.\");\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t\tSystem.err.println(\"[ERROR]:[FileManager] Error while reading the file \" + HIGHSCORERS_FILE);\r\n\t\t}\r\n\t}",
"@Override\n protected void doEncode(ByteArrayEncodingState encodingState) {\n CoderUtil.resetOutputBuffers(encodingState.outputs,\n encodingState.outputOffsets,\n encodingState.encodeLength);\n\n // MSREncodeData(encodeMatrix, encodingState.encodeLength, encodingState.inputs, encodingState.outputs);\n RSUtil.encodeData(gfTables, encodingState.encodeLength,\n encodingState.inputs,\n encodingState.inputOffsets, encodingState.outputs,\n encodingState.outputOffsets);\n }",
"public static void writeFile(String inputFile, String outputFile, String[] encodings){\n File iFile = new File(inputFile);\n File oFile = new File(outputFile);\n //try catch for creating the output file\n try {\n //if it doesn't exist it creates the file. else if clears the output file\n\t if (oFile.createNewFile()){\n System.out.println(\"File is created!\");\n\t } else{\n PrintWriter writer = new PrintWriter(oFile);\n writer.print(\"\");\n writer.close();\n System.out.println(\"File cleared.\");\n\t }\n }\n catch(IOException e){\n e.printStackTrace();\n }\n //try catch to scan the input file\n try {\n Scanner scan = new Scanner(iFile);\n PrintWriter writer = new PrintWriter(oFile);\n //loop to look at each word in the file\n while (scan.hasNext()) {\n String s = scan.next();\n //loop to look at each character in the word\n for(int i = 0; i < s.length(); i++){\n if((int)s.charAt(i)-32 <= 94) {\n writer.print(encodings[(int)s.charAt(i)-32]);\n }\n }\n //gives the space between words\n writer.print(encodings[0]);\n }\n scan.close();\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }",
"public abstract void writeToStream(java.io.DataOutputStream output) throws java.io.IOException;",
"@Override\n\tpublic byte[] encodeMsg() {\n\t\tIoBuffer buf = IoBuffer.allocate(2048).setAutoExpand(true);\n\t\t\n\t\tbuf.put(slaveId);\n\t\tbuf.put(code);\n\t\tbuf.putShort(offset);\n\t\tbuf.putShort(data);\n\t\tbuf.flip();\n\t\t\n \tbyte[] bytes = new byte[buf.remaining()];\n \tbuf.get(bytes);\n \t\n\t\treturn bytes;\n\t}",
"private void writeToFile(final String data, final File outFile) {\n try {\n FileOutputStream foutStream = new FileOutputStream(outFile);\n OutputStreamWriter outputStreamWriter = new OutputStreamWriter(foutStream);\n outputStreamWriter.write(data);\n outputStreamWriter.close();\n foutStream.close();\n } catch (IOException e) {\n Log.e(\"Exception\", \"File write failed: \" + e.toString());\n }\n }",
"private static void writeToOutput() {\r\n FileWriter salida = null;\r\n String archivo;\r\n JFileChooser jFC = new JFileChooser();\r\n jFC.setDialogTitle(\"KWIC - Seleccione el archivo de salida\");\r\n jFC.setCurrentDirectory(new File(\"src\"));\r\n int res = jFC.showSaveDialog(null);\r\n if (res == JFileChooser.APPROVE_OPTION) {\r\n archivo = jFC.getSelectedFile().getPath();\r\n } else {\r\n archivo = \"src/output.txt\";\r\n }\r\n try {\r\n salida = new FileWriter(archivo);\r\n PrintWriter bfw = new PrintWriter(salida);\r\n System.out.println(\"Índice-KWIC:\");\r\n for (String sentence : kwicIndex) {\r\n bfw.println(sentence);\r\n System.out.println(sentence);\r\n }\r\n bfw.close();\r\n System.out.println(\"Se ha creado satisfactoriamente el archivo de texto\");\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }",
"protected abstract void _write(DataOutput output) throws IOException;",
"public byte[] encode() throws IOException {\n byte[] buffer = new byte[12+193];\n LittleEndianDataOutputStream dos = new LittleEndianDataOutputStream(new ByteArrayOutputStream());\n dos.writeByte((byte)0xFD);\n dos.writeByte(payload_length & 0x00FF);\n dos.writeByte(incompat & 0x00FF);\n dos.writeByte(compat & 0x00FF);\n dos.writeByte(packet & 0x00FF);\n dos.writeByte(sysId & 0x00FF);\n dos.writeByte(componentId & 0x00FF);\n dos.writeByte(messageType & 0x00FF);\n dos.writeByte((messageType >> 8) & 0x00FF);\n dos.writeByte((messageType >> 16) & 0x00FF);\n dos.writeLong(tms);\n for (int i=0; i<40; i++) {\n dos.writeInt((int)(data[i]&0x00FFFFFFFF));\n }\n dos.writeFloat(cx);\n dos.writeFloat(cy);\n dos.writeFloat(cz);\n dos.writeFloat(resolution);\n dos.writeFloat(extension);\n dos.writeInt((int)(count&0x00FFFFFFFF));\n dos.writeByte(status&0x00FF);\n dos.flush();\n byte[] tmp = dos.toByteArray();\n for (int b=0; b<tmp.length; b++) buffer[b]=tmp[b];\n int crc = MAVLinkCRC.crc_calculate_encode(buffer, 193);\n crc = MAVLinkCRC.crc_accumulate((byte) IMAVLinkCRC.MAVLINK_MESSAGE_CRCS[messageType], crc);\n byte crcl = (byte) (crc & 0x00FF);\n byte crch = (byte) ((crc >> 8) & 0x00FF);\n buffer[203] = crcl;\n buffer[204] = crch;\n dos.close();\n return buffer;\n}",
"@Override // ohos.com.sun.xml.internal.stream.events.DummyEvent\r\n public void writeAsEncodedUnicodeEx(Writer writer) throws IOException {\r\n if (this.fIsCData) {\r\n writer.write(\"<![CDATA[\" + getData() + \"]]>\");\r\n return;\r\n }\r\n charEncode(writer, this.fData);\r\n }",
"@Override\n public void write(byte[] data) throws IOException {\n for (int i = 0; i < data.length; i++) {\n write(data[i]);\n }\n }",
"public void onEncodeSerialData(StreamWriter streamWriter) {\n }",
"void serialize(GeneratedMessage msg, OutputStream out) throws IOException;",
"@Override\r\n\tpublic void write() {\n\t\t\r\n\t}",
"public abstract void write(DataOutput out) throws IOException;",
"public void encode(int c, Writer out)\n throws IOException {\n out.write(c);\n }",
"public void writeFile(String data){\n\t\t\n\t\tcurrentLine = data;\n\t\t\n\t\t\ttry{ \n\t\t\t\tFile file = new File(\"/Users/bpfruin/Documents/CSPP51036/hw3-bpfruin/src/phfmm/output.txt\");\n \n\t\t\t\t//if file doesnt exists, then create it\n\t\t\t\tif(!file.exists()){\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t}\n \n\t\t\t\t//true = append file\n\t\t\t\tFileWriter fileWriter = new FileWriter(file,true);\n \t \tBufferedWriter bufferWriter = new BufferedWriter(fileWriter);\n \t \tbufferWriter.write(data);\n \t \tbufferWriter.close();\n \n \n\t\t\t}catch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\n\t\t\n\t}",
"void saveSimpleCodesToFile() {\n\t\tPrintWriter writer;\r\n\t\ttry {\r\n\t\t\t//writer = new PrintWriter(pathStr + \"/../pt.iscte.pidesco.codegenerator/Settings/Code.cg\", \"UTF-8\");\r\n\t\t\twriter = new PrintWriter(\"Code.cg\", \"UTF-8\");\r\n\t\t\tfor (SimpleCode sc : SimpleCodeMap.values()) {\r\n\t\t\t\twriter.print(sc.getCodeName() + \"-CGSeparator-\" + sc.resultCodeToWrite());\r\n\t\t\t\twriter.print(\"-CGCodeSeparator-\");\r\n\t\t\t}\r\n\t\t\twriter.close();\r\n\t\t} catch (FileNotFoundException | UnsupportedEncodingException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public synchronized void write(String data){\n\t\tlog.debug(\"[SC] Writing \"+data, 4);\n\t\twriteBuffer.add(data.getBytes());\n\t}",
"@Override\n public void write(final byte[] data) throws IOException {\n write(data, 0, data.length);\n }",
"@Override\n public void write() {\n\n }",
"private void writeToFile() {\n try {\n FileOutputStream fos = new FileOutputStream(f);\n String toWrite = myJSON.toString(4);\n byte[] b = toWrite.getBytes();\n fos.write(b);\n fos.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public static void encode () {\n // read the input\n s = BinaryStdIn.readString();\n char[] input = s.toCharArray();\n\n int[] indices = new int[input.length];\n for (int i = 0; i < indices.length; i++) {\n indices[i] = i;\n }\n \n Quick.sort(indices, s);\n \n // create t[] and find where original ended up\n char[] t = new char[input.length]; // last column in suffix sorted list\n int inputPos = 0; // row number where original String ended up\n \n for (int i = 0; i < indices.length; i++) {\n int index = indices[i];\n \n // finds row number where original String ended up\n if (index == 0)\n inputPos = i;\n \n if (index > 0)\n t[i] = s.charAt(index-1);\n else\n t[i] = s.charAt(indices.length-1);\n }\n \n \n // write t[] preceded by the row number where orginal String ended up\n BinaryStdOut.write(inputPos);\n for (int i = 0; i < t.length; i++) {\n BinaryStdOut.write(t[i]);\n BinaryStdOut.flush();\n } \n }",
"public void Write_data() {\n // add-write text into file\n try {\n FileOutputStream fileout=openFileOutput(\"savedata11.txt\", MODE_PRIVATE);\n OutputStreamWriter outputWriter=new OutputStreamWriter(fileout);\n outputWriter.write(Integer.toString(_cnt));\n outputWriter.close();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public byte[] encode(byte[] data) throws EncodingException {\n\t\tif (data == null) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\tint length = data.length;\n\t\tint maxGrouping = length / 5;\n\t\tint fullGroupings = 5 * maxGrouping;\n\t\tint remainderBytes = length - fullGroupings;\n\t\t\n\t\tint c, c0, c1, c2, c3, c4, c5, c6, c7, cursor = 0;\n\t\tint maxPadding = REMAINDER_PADDING_COUNT[remainderBytes];\n\t\tbyte[] result = new byte[8*(maxGrouping + 1)];\n\t\t\n//\t\tdata = Arrays.copyOf(data, length + maxPadding);\n\t\tfor (c = 0; c < fullGroupings; c+= 5) {\n\t\t\t\n\t\t\tc0 = ((data[c] & 0xF8) >> 3);\n\t\t\tc1 = ((data[c] & 0x07) << 2) | ((data[c + 1] & 0xC0) >> 6);\n\t\t\tc2 = ((data[c + 1] & 0x3E) >> 1);\n\t\t\tc3 = ((data[c + 1] & 0x01) << 4) | ((data[c + 2] & 0xF0) >> 4);\n\t\t\tc4 = ((data[c + 2] & 0x0F) << 1) | ((data[c + 3] & 0x80) >> 7);\n\t\t\tc5 = ((data[c + 3] & 0x7C) >> 2);\n\t\t\tc6 = ((data[c + 3] & 0x03) << 3) | ((data[c + 4] & 0xE0) >> 5);\n\t\t\tc7 = (data[c + 4] & 0x1F);\n\t\t\t\n\t\t\t//write\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c0];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c1];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c2];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c3];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c4];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c5];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c6];\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c7];\n\t\t}\n\t\t\n\t\t//Padding\n\t\tif (maxPadding > 0) {\n\t\t\tc0 = ((data[c] & 0xF8) >> 3);\n\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c0];\n\t\t\t\n\t\t\tif (remainderBytes == 1) {\n\t\t\t\tc1 = ((data[c] & 0x07) << 2);\n\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c1];\n\t\t\t} else {\n\t\t\t\tc1 = ((data[c] & 0x07) << 2) | ((data[c + 1] & 0xC0) >> 6);\n\t\t\t\tc2 = ((data[c + 1] & 0x3E) >> 1);\n\t\t\t\t\n\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c1];\n\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c2];\n\t\t\t\t\n\t\t\t\tif (remainderBytes == 2) {\n\t\t\t\t\tc3 = ((data[c + 1] & 0x01) << 4);\n\t\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c3];\n\t\t\t\t} else {\n\t\t\t\t\tc3 = ((data[c + 1] & 0x01) << 4) | ((data[c + 2] & 0xF0) >> 4);\n\t\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c3];\n\t\t\t\t\t\n\t\t\t\t\tif (remainderBytes == 3) {\n\t\t\t\t\t\tc4 = ((data[c + 2] & 0x0F) << 1);\n\t\t\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c4];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tc4 = ((data[c + 2] & 0x0F) << 1) | ((data[c + 3] & 0x80) >> 7);\n\t\t\t\t\t\tc5 = ((data[c + 3] & 0x7C) >> 2);\n\t\t\t\t\t\tc6 = ((data[c + 3] & 0x03) << 3);\n\t\t\t\t\t\t\n\t\t\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c4];\n\t\t\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c5];\n\t\t\t\t\t\tresult[cursor++] = BASE_32_CHARACTERS[c6];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Finally...\n\t\t\tfor (c = 0; c < maxPadding; c++) {\n\t\t\t\tresult[cursor++] = PADDING;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"private static void writeToFile(String[] data) {\n\t\t// Regatta hasn't been calculated.\n\t\tif(r == null) {\n\t\t\tSystem.out.println(\"\\nYou haven't processed a regatta yet! \\nUse regatta to begin processing.\\n\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Just the command was specified, we need to get the filename.\n\t\tif(data.length == 1) {\n\t\t\tSystem.out.println(\"Oops, looks like you didn't specify an output file.\\n\");\n\t\t\tinitializeOutput(getFilename());\n\t\t}\n\n\t\t// Filename was specified but is invalid. Need to get another one.\n\t\tif(!isValidFileName(data[1])) {\n\t\t\tSystem.out.println(\"Looks like your filename is incorrect.\\n\");\n\t\t\tinitializeOutput(getFilename());\n\t\t}\n\n\t\tinitializeOutput(data[1]);\n\n\t\t// Write out.\n\t\tfileOutput.print(r.podium());\n\t\tfileOutput.close();\n\t}",
"public static final void transcodeAndWrite(byte[] input, \r\n java.io.OutputStream os,\r\n int offset, int length, int input_encoding, int output_encoding)\r\n throws TranscodeException,\r\n IOException {\n int k = offset;\r\n int c;\r\n while (k < offset + length) {\r\n long l = decode(input, k, input_encoding);\r\n k = (int) (l >> 32);\r\n c = (int) l;\r\n encodeAndWrite(os, c, output_encoding);\r\n }\r\n }",
"public void writeOutput() {\n // Create json object to be written\n Map<String, Object> jsonOutput = new LinkedHashMap<>();\n // Get array of json output objects for consumers\n List<Map<String, Object>> jsonConsumers = writeConsumers();\n // Add array for consumers to output object\n jsonOutput.put(Constants.CONSUMERS, jsonConsumers);\n // Get array of json output objects for distributors\n List<Map<String, Object>> jsonDistributors = writeDistributors();\n // Add array for distributors to output objects\n jsonOutput.put(Constants.DISTRIBUTORS, jsonDistributors);\n // Get array of json output objects for producers\n List<Map<String, Object>> jsonProducers = writeProducers();\n // Add array for producers to output objects\n jsonOutput.put(Constants.ENERGYPRODUCERS, jsonProducers);\n // Write to output file and close\n try {\n ObjectMapper mapper = new ObjectMapper();\n ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter());\n writer.writeValue(Paths.get(outFile).toFile(), jsonOutput);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public void writeToFile(byte[] output) {\r\n try {\r\n file.seek(currOffset);\r\n file.write(output);\r\n currOffset += output.length;\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public void writeTo(OutputStream arg0) throws IOException {\n\t\t\r\n\t}",
"public static void main(String[] args) {\n TextFileGenerator textFileGenerator = new TextFileGenerator();\n HuffmanTree huffmanTree;\n Scanner keyboard = new Scanner(System.in);\n PrintWriter encodedOutputStream = null;\n PrintWriter decodedOutputStream = null;\n String url, originalString = \"\", encodedString, decodedString;\n boolean badURL = true;\n int originalBits, encodedBits, decodedBits;\n\n while(badURL) {\n System.out.println(\"Please enter a URL: \");\n url = keyboard.nextLine();\n\n try {\n originalString = textFileGenerator.makeCleanFile(url, \"original.txt\");\n badURL = false;\n }\n catch(IOException e) {\n System.out.println(\"Error: Please try again\");\n }\n }\n\n huffmanTree = new HuffmanTree(originalString);\n encodedString = huffmanTree.encode(originalString);\n decodedString = huffmanTree.decode(encodedString);\n // NOTE: TextFileGenerator.getNumChars() was not working for me. I copied the encoded text file (pure 0s and 1s)\n // into google docs and the character count is accurate with the String length and not the method\n originalBits = originalString.length() * 16;\n encodedBits = encodedString.length();\n decodedBits = decodedString.length() * 16;\n\n decodedString = fixPrintWriterNewLine(decodedString);\n\n try { // creating the encoded and decoded files\n encodedOutputStream = new PrintWriter(new FileOutputStream(\"src\\\\edu\\\\miracosta\\\\cs113\\\\encoded.txt\"));\n decodedOutputStream = new PrintWriter(new FileOutputStream(\"src\\\\edu\\\\miracosta\\\\cs113\\\\decoded.txt\"));\n encodedOutputStream.print(encodedString);\n decodedOutputStream.print(decodedString);\n }\n catch(IOException e) {\n System.out.println(\"Error: IOException!\");\n }\n\n encodedOutputStream.close();\n decodedOutputStream.close();\n\n System.out.println(\"Original file bit count: \" + originalBits);\n System.out.println(\"Encoded file bit count: \" + encodedBits);\n System.out.println(\"Decoded file bit count: \" + decodedBits);\n System.out.println(\"Compression ratio: \" + (double)originalBits/encodedBits);\n }",
"private void flush() {\n try {\n final int flushResult = Mp3EncoderWrap.newInstance().encodeFlush(mp3Buffer);\n Log.d(TAG, \"===zhongjihao====flush mp3Buffer: \"+mp3Buffer+\" flush size: \"+flushResult);\n if (flushResult > 0) {\n mp3File.write(mp3Buffer, 0, flushResult);\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n mp3File.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n Log.d(TAG, \"===zhongjihao====destroy===mp3 encoder====\");\n Mp3EncoderWrap.newInstance().destroyMp3Encoder();\n }\n }",
"public Encode(Path inputPath, Path outputPath) {\n this.inputPath = inputPath;\n this.outputPath = outputPath;\n }",
"public void write(DataOutput output) throws IOException {\n output.writeUTF(this.data);\n }",
"protected void encodeAtom(OutputStream outStream, byte data[], int offset, int len) throws IOException\n {\n int i;\n int p1, p2; // parity bits\n byte a, b;\n\n a = data[offset];\n if (len == 2) {\n b = data[offset+1];\n } else {\n b = 0;\n }\n crc.update(a);\n if (len == 2) {\n crc.update(b);\n }\n outStream.write(map_array[((a >>> 2) & 0x38) + ((b >>> 5) & 0x7)]);\n p1 = 0; p2 = 0;\n for (i = 1; i < 256; i = i * 2) {\n if ((a & i) != 0) {\n p1++;\n }\n if ((b & i) != 0) {\n p2++;\n }\n }\n p1 = (p1 & 1) * 32;\n p2 = (p2 & 1) * 32;\n outStream.write(map_array[(a & 31) + p1]);\n outStream.write(map_array[(b & 31) + p2]);\n return;\n }",
"public final void encode(ASN1Encoder enc, OutputStream out)\n throws IOException\n {\n content.encode(enc, out);\n return;\n }",
"@Override\n public void writeDataToTxtFile() {\n\n }",
"void write();",
"private void writeData(String data) throws IOException\n {\n this.writer.println(data);\n this.writer.flush();\n }",
"@Override\n public String toFile() {\n String isDoneString = (isDone) ? \"1\" : \"0\";\n return getDescription() + \" | \" + getGrade() + \" | \" + getMc() + \" | \" + getSemester() + \" | \" + isDoneString;\n }",
"private static void encodeString(String in){\n\n\t\tString officalEncodedTxt = officallyEncrypt(in);\n\t\tSystem.out.println(\"Encoded message: \" + officalEncodedTxt);\n\t}",
"private static void writeOutput (int[][] outData) {\r\n\t\tString outFile = \"Input_\" + outData.length + \".txt\";\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFile fileLocation = new File(outFile);\t\t\r\n\t\t\tPrintWriter Writer = new PrintWriter(fileLocation, \"UTF-8\");\t\r\n\t\t\tfor (int i = 0; i < outData.length; i++) {\r\n\t\t\t\tfor (int j = 0; j < outData[i].length; j++) {\r\n\t\t\t\t\tif (outData[i][j] == INFINITY) {\r\n\t\t\t\t\t\tWriter.print(\"NA\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tWriter.print(outData[i][j]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (j != outData[i].length - 1) {\r\n\t\t\t\t\t\tWriter.print(\"\\t\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tWriter.println();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tWriter.close();\r\n\t\t} catch (Exception ex) {\r\n System.out.println(ex.toString()); \r\n\t\t}\r\n\t}",
"@Override\n protected void doWriteTo(StreamOutput out) throws IOException {\n }",
"private byte[] encode(byte[] msg) {\r\n\t\treturn Base64.encode(msg);\r\n\t}",
"int writeTo(OutputStream out) throws IOException;",
"private static void writeBinaryData(int id, InputStream data, File f) throws IOException {\n \n XMLOutputFactory factory = XMLOutputFactory.newInstance();\n try {\n XMLStreamWriter writer = factory.createXMLStreamWriter(new FileWriter(f));\n\n writer.writeStartDocument(PlanXMLConstants.ENCODING,\"1.0\");\n writer.writeStartElement(\"data\");\n writer.writeAttribute(\"id\", \"\" + id);\n\n Base64InputStream base64EncodingIn = new Base64InputStream( data, true, PlanXMLConstants.BASE64_LINE_LENGTH, PlanXMLConstants.BASE64_LINE_BREAK);\n \n OutputStream out = new WriterOutputStream(new XMLStreamContentWriter(writer) , PlanXMLConstants.ENCODING);\n // read the binary data and encode it on the fly\n IOUtils.copy(base64EncodingIn, out);\n out.flush();\n \n // all data is written - end \n writer.writeEndElement();\n writer.writeEndDocument();\n\n writer.flush();\n writer.close();\n\n } catch (XMLStreamException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } \n }",
"@Override\n protected void encode(ChannelHandlerContext ctx, FoscamTextByteBufDTO msg, List<Object> out) {\n final ByteBuf buf = FoscamTextByteBufDTOEncoder.allocateBuf(ctx, msg);\n new FoscamTextByteBufDTOEncoder().encode(ctx, msg, buf);\n final DatagramPacket datagramPacket = new DatagramPacket(buf, new InetSocketAddress(BROADCAST_ADDRESS, BROADCAST_PORT));\n out.add(datagramPacket);\n }",
"private void writeTree() throws IOException {\n\t\ttry (final BufferedWriter writer = Files.newBufferedWriter(destinationFile, CHARSET)) {\n\t\t\tfinal char[] treeString = new char[512];\n\t\t\tint treeStringLength = 0;\n\t\t\tfor (final CharacterCode cur : sortedCodes) {\n\t\t\t\ttreeString[treeStringLength++] = cur.getChar();\n\t\t\t\ttreeString[treeStringLength++] = (char) cur.getCode().length();\n\t\t\t}\n\t\t\tif (treeStringLength > 0xff) { //tree length will not always be less than 255, we have to write it on two bytes\n\t\t\t\tfinal int msb = (treeStringLength & 0xff00) >> Byte.SIZE;\n\t\t\t\ttreeStringLength &= 0x00ff;\n\t\t\t\twriter.write(msb);\n\t\t\t} else {\n\t\t\t\twriter.write(0);\n\t\t\t}\n\t\t\twriter.write(treeStringLength);\n\t\t\twriter.write(treeString, 0, treeStringLength);\n\t\t}\n\t}",
"private String encodeMessage() {\n\t\tString encode = \"\";\n\t\tfor (int i = 0; i < message.length(); i++) {\n\t\t\tencode += map.get(message.charAt(i));\n\t\t}\n\t\tgenerateBack();\n\t\treturn encode;\n\t}",
"protected void writeCipherAndIVToFileBase64(CipherIV data, String filename) throws IOException {\n super.saveBytesToFileBase64(filename + CIPHER_PART, data.getCipher());\n super.saveBytesToFileBase64(filename + IV_PART, data.getIv());\n }",
"public static void encode(InputStream in, OutputStream out, int len) \n throws IOException {\n if(len%4!=0)\n throw new IllegalArgumentException(\"Length must be a multiple of 4\");\n\n // Read input stream until end of file\n int bits=0;\n int nbits=0;\n int nbytes=0;\n int b;\n\n while( (b=in.read()) != -1) {\n bits=(bits<<8)|b;\n nbits+=8;\n while(nbits>=6) {\n\tnbits-=6;\n\tout.write(encTab[0x3f&(bits>>nbits)]);\n\tnbytes ++;\n\t// New line\n\tif (len !=0 && nbytes>=len) {\n\t out.write(0x0d);\n\t out.write(0x0a);\n\t nbytes -= len;\n\t}\n }\n }\n\n switch(nbits) {\n case 2:\n out.write(encTab[0x3f&(bits<<4)]);\n out.write(0x3d); // 0x3d = '='\n out.write(0x3d);\n break;\n case 4:\n out.write(encTab[0x3f&(bits<<2)]);\n out.write(0x3d);\n break;\n }\n\n if (len != 0) {\n if (nbytes != 0) {\n\tout.write(0x0d);\n\tout.write(0x0a);\n }\n out.write(0x0d);\n out.write(0x0a);\n }\n }",
"private void sendData(String message) {\n\t\t\ttry {\n\t\t\t\toutput.writeObject(message);\n\t\t\t\toutput.flush(); // flush output to client\n\t\t\t} catch (IOException ioException) {\n\t\t\t\tSystem.out.println(\"\\nError writing object\");\n\t\t\t}\n\t\t}",
"public void WriteMessage(byte[] message)\r\n {\r\n try {\r\n out.write(new Integer(message.length).byteValue());\r\n out.write(message);\r\n out.flush();\r\n }catch (Exception e){\r\n System.out.println(e);\r\n }\r\n }",
"private void insertIntoFile(String data){\n\t\tOutputStream os = null;\n try {\n os = new FileOutputStream(file);\n os.write(data.getBytes(), 0, data.length());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\t}",
"public synchronized void writeNow(String data){\n\t\tlog.debug(\"[SC] Writing now unencrypted - \"+data, 4);\n\t\tif(out!=null){\n\t\t\ttry {\n\t\t\t\tif(!data.endsWith(\"\\n\")){\n\t\t\t\t\tdata = data + \"\\n\";\n\t\t\t\t}\n\t\t\t\tout.write(data.getBytes());\n\t\t\t\tout.flush();\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog.error(\"[SC] Could not write to socket\");\n\t\t\t}\t\n\t\t}else{\n\t\t\tlog.error(\"[SC] Could not write to socket\");\n\t\t}\n\t}",
"public void write(String wholeMessage) {\n byte[] hash = createHash(wholeMessage);\n byte[] hashBase64 = Base64.encode(hash);\n String hashBase64String = new String(hashBase64);\n writer.println(hashBase64String + \" \" + wholeMessage);\n }",
"public void SerialWriteFile() {\r\n\r\n PrintWriter pwrite = null;\r\n File fileObject = new File(getName());\r\n QuizPlayer q = new QuizPlayer(getName(), getNickname(), getTotalScore());\r\n\r\n try {\r\n ObjectOutputStream outputStream =\r\n new ObjectOutputStream(new FileOutputStream(fileObject));\r\n\r\n outputStream.writeObject(q); //Writes the object to the serialized file.\r\n outputStream.close();\r\n\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Problem with file output.\");\r\n }\r\n\r\n }",
"protected synchronized void writeOut(String data) {\n\t\t\n\t\tif(output != null)\n\t\t\toutput.println(data);\n\t\telse\n\t\t\tSystem.out.println(this.name + \" output not initialized\");\n\t}",
"private void export() {\n print(\"Outputting Instructions to file ... \");\n\n // Generate instructions right now\n List<Instruction> instructions = new ArrayList<Instruction>();\n convertToInstructions(instructions, shape);\n\n // Verify Instructions\n if (instructions == null || instructions.size() == 0) {\n println(\"failed\\nNo instructions!\");\n return;\n }\n\n // Prepare the output file\n output = createWriter(\"output/instructions.txt\");\n \n // TODO: Write configuration information to the file\n \n\n // Write all the Instructions to the file\n for (int i = 0; i < instructions.size(); i++) {\n Instruction instruction = instructions.get(i);\n output.println(instruction.toString());\n }\n\n // Finish the file\n output.flush();\n output.close();\n\n println(\"done\");\n }",
"private void writeInfoToFile() {\n createInfoFile(\"infoList.txt\", fwExMessage);\n outFile.println(\"منشی\");\n outFile.println(username);\n outFile.println(password);\n outFile.println(\" \");\n outFile.close();\n }",
"private void buildOutput()\n\t{\n\t\tif(outIndex >= output.length)\n\t\t{\n\t\t\tbyte[] temp = output;\n\t\t\toutput = new byte[temp.length * 2];\n\t\t\tSystem.arraycopy(temp, 0, output, 0, temp.length);\n\t\t}\n\t\t\n\t\tif(sb.length() < 16 && aryIndex < fileArray.length)\n\t\t{\n\t\t\tbyte[] b = new byte[1];\n\t\t\tb[0] = fileArray[aryIndex++];\n\t\t\tsb.append(toBinary(b));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < prioQ.size(); i++)\n\t\t{\n\t\t\tif(sb.toString().startsWith(prioQ.get(i).getCode()))\n\t\t\t{\n\t\t\t\toutput[outIndex++] = (byte)prioQ.get(i).getByteData();\n\t\t\t\tsb = new StringBuilder(\n\t\t\t\t\t\tsb.substring(prioQ.get(i).getCode().length()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Can't find Huffman code.\");\n\t\tSystem.exit(1);\n\t\texit = true;\n\t}"
] | [
"0.70871645",
"0.65894926",
"0.6448885",
"0.6075776",
"0.59998",
"0.59262127",
"0.5909286",
"0.58512884",
"0.58460385",
"0.5822978",
"0.58050525",
"0.5801768",
"0.57790756",
"0.5753695",
"0.5701016",
"0.56788224",
"0.56718105",
"0.56687605",
"0.5656437",
"0.56407565",
"0.56284755",
"0.56227005",
"0.5599518",
"0.5551617",
"0.5527301",
"0.54784703",
"0.5474365",
"0.5472698",
"0.54715586",
"0.5445276",
"0.54247874",
"0.54207003",
"0.5412271",
"0.54072106",
"0.53953946",
"0.5389094",
"0.5387263",
"0.53797734",
"0.5375367",
"0.5371398",
"0.53570366",
"0.53533727",
"0.5350998",
"0.53493994",
"0.5344697",
"0.5339666",
"0.53356326",
"0.5326793",
"0.53186125",
"0.5314943",
"0.5306395",
"0.5306226",
"0.53052205",
"0.53045964",
"0.5302329",
"0.5296247",
"0.5294666",
"0.529073",
"0.5271868",
"0.52689904",
"0.52679896",
"0.52642506",
"0.52594596",
"0.5257302",
"0.52528304",
"0.52461225",
"0.52421945",
"0.524132",
"0.5240138",
"0.5239815",
"0.523718",
"0.5213467",
"0.52132636",
"0.52074486",
"0.5200652",
"0.5199358",
"0.51935273",
"0.51925856",
"0.5178707",
"0.51699185",
"0.51694715",
"0.516781",
"0.5166435",
"0.51508695",
"0.5148078",
"0.51383585",
"0.5137955",
"0.5134055",
"0.5130854",
"0.51295674",
"0.5127503",
"0.51233846",
"0.51205784",
"0.51159984",
"0.510713",
"0.5105724",
"0.5099976",
"0.5099284",
"0.50975335",
"0.5096842"
] | 0.753539 | 0 |
prints the contents of the input.txt file | private void printInputMessage() {
System.out.println("Printing the input message:");
try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {
String inputLine;
while((inputLine = inputBuffer.readLine()) != null) {
System.out.print(inputLine+"\n");
}
} catch (IOException e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static void main(String[] args) throws IOException {\n\t\t FileInputStream file=new FileInputStream(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\test.txt\");\r\n Scanner scan=new Scanner(file);\r\n while(scan.hasNextLine()){\r\n \t System.out.println(scan.nextLine());\r\n }\r\n \r\n file.close();\r\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n\n\t\tFile file = new File(\"B:\\\\output.txt\");\n\t\t\n\t\tScanner input = new Scanner(file);\n\t\t\n\t\twhile(input.hasNextLine()) {\n\t\t\tString tmp = input.nextLine();\n\t\t\t\n\t\t\tSystem.out.println(tmp);\n\t\t}\n\t\tinput.close();\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n\t\tFile inFile = new File(\"result/in.txt\");\n\t\tFile outFile = new File(\"result/out.txt\");\n\t\tint begin = 4;\n\t\t\n\t\tScanner cs = new Scanner(inFile);\n\t\tPrintWriter out = new PrintWriter(outFile);\n\t\t\n\t\twhile(cs.hasNextLine())\n\t\t{\n\t\t\tString line = cs.nextLine();\n\t\t\tline = line.substring(begin);\n\t\t\tout.println(line);\n\t\t}\n\t\tcs.close();\n\t\tout.close();\n\t\t\n\t}",
"public void fileRead() {\n\t\tString a, b;\n\t\t\n\t\twhile (input.hasNext()) {\n\t\t\ta = input.next();\n\t\t\tb = input.next();\n\t\t\tSystem.out.printf(\"%s %s\\n\", a, b);\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\ttry {\r\n\t\t\tFileInputStream inputFile = new FileInputStream(\"C:\\\\Users\\\\lenovo\\\\Desktop\\\\input.txt.txt\");\r\n\r\n\t\t\twhile (inputFile.available() > 0) {\r\n\t\t\t\tint i = inputFile.read();\r\n\t\t\t\tSystem.out.println((char) i);\r\n\t\t\t\tinputFile.close();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n Path file = Paths.get (\"courses.txt\");\n// line n1\n /* Assume the courses.txt is accessible.\n Which code fragment can be inserted at line n1 to enable the code to print the content of the*/\n //courses.txt file?\n /* A. List<String> fc = Files.list(file);\n fc.stream().forEach (s - > System.out.println(s));\n B. Stream<String> fc = Files.readAllLines (file);\n fc.forEach (s - > System.out.println(s));\n // C. List<String> fc = readAllLines(file);\n //fc.stream().forEach (s - > System.out.println(s));\n D. Stream<String> fc = Files.lines (file);///answer\n fc.forEach (s - > System.out.println(s));*/\n }",
"public void openFile(){\n\t\ttry{\n\t\t\t//input = new Scanner (new File(\"input.txt\")); // creates file \"input.txt\" or will rewrite existing file\n\t\t\tFile inFile = new File(\"input.txt\");\n\t\t\tinput = new Scanner(inFile);\n\t\t\t//for (int i = 0; i < 25; i ++){\n\t\t\t\t//s = input.nextLine();\n\t\t\t\t//System.out.println(s);\n\t\t\t//}\n\t\t}catch (SecurityException securityException){ // catch errors\n\t\t\tSystem.err.println (\"You do not have the write access to this file.\");\n\t\t\tSystem.exit(1);\n\t\t}catch (FileNotFoundException fnf){// catch errors\n\t\t\tSystem.err.println (\"Trouble opening file\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t}",
"public static void main(String[] args) throws Exception {\n FileReader fr = new FileReader(\"data/text.txt\");\n\n int i;\n while ((i=fr.read()) != -1)\n System.out.print((char)i);\n\n }",
"public void readFile()\r\n\t{\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\tx = new Scanner(new File(\"clean vipr measles results.txt\"));\r\n\t\t\t\r\n\t\t\twhile (x.hasNext())\r\n\t\t\t{\r\n\t\t\t\tString a = x.next();\r\n\t\t\t\tString b = x.next();\r\n\t\t\t\tString c = x.next();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.printf(\"%s %s %s \\n\\n\", a,b,c);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tx.close();\r\n\t\t}\r\n\t\tcatch (Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"file not found\");\r\n\t\t}\r\n\t\r\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n Scanner scanner = new Scanner(new FileInputStream(\"/Users/guoziren/IdeaProjects/剑指offer for Java/src/main/java/com/ustc/leetcode/algorithmidea/dynamicprogramming/input.txt\"));\n }",
"public static void main (String arg[]) throws FileNotFoundException {\n\t\t\n \tScanner fin = new Scanner(new FileReader(\"input.txt\"));\n \tPrintWriter writer = new PrintWriter(\"output.txt\");\n\t\t\n\t\twhile (true) {\n\t\t\t\n\t\t\tString input = fin.nextLine();\n\t\t\tif (input.compareTo(\"0\") == 0) break;\n\t\t\t\n\t\t\tboolean[] array = new boolean[input.length()];\n\t\t\tfor (int i = 1; i < input.length(); i++) {\n\t\t\t\tarray[i] = (input.substring(i, i+1).compareTo(\"1\") == 0) ? true : false;\n\t\t\t}\n\t\t\t\n\t\t\tQueue<Integer> answer = new LinkedList<Integer>();\n\t\t\t\n\t\t\tfor (int i = 1; i < input.length(); i++) {\n\t\t\t\t\n\t\t\t\tif (array[i] == false) continue;\n\t\t\t\t\n\t\t\t\tanswer.add(i);\n\t\t\t\t\n\t\t\t\tfor (int j = i; j < input.length(); j += i) {\n\t\t\t\t\tarray[j] = !array[j];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\twhile (answer.peek() != null) {\n\t\t\t\t\n\t\t\t\tint out = answer.poll();\n\t\t\t\tSystem.out.println(out);\n\t\t\t\twriter.print(out);\n\t\t\t\tif (answer.peek() != null) writer.print(\" \");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\twriter.println();\n\t\t\t\n\t\t}\n\t\t\n\t\tfin.close();\n\t\twriter.close();\n\t\t\n\t}",
"public static void main(String[] args) throws IOException{\n\t\t\t\n\t\t\t FileReader fs = new FileReader(\"C:\\\\Users\\\\rk\\\\Desktop\\\\Test1.txt\");\n\t\t\t BufferedReader br = new BufferedReader(fs);\n\t\t\t \n\t\t\t String i=null;\n\t\t\t while((i=br.readLine())!=null){\n\t\t\t\t System.out.println(i);\n\t\t\t }\n\t\t\t \n \n\t\t}",
"public static void main(String[] args) {\n String s = \"\";\n try {\n File file = new File(\"C:\\\\Users\\\\DELL\\\\Desktop\\\\bridgelabz\\\\example\\\\sample.txt\");\n Scanner sc = new Scanner(file);\n while (sc.hasNextLine()) {\n s = sc.nextLine();\n }\n System.out.println(s);\n String[] splt = s.split(\"\");\n for (int i = 0; i < splt.length; i++) {\n System.out.println(splt[i]);\n }\n } catch(Exception e) {\n System.out.println(\"Not Found\");\n }\n\n }",
"public static void main(String[] args) throws IOException {\n\t\tBufferedReader br = null;\n\t\tPrintWriter pw = null;\n\n\t\ttry {\n\t\t\tbr = new BufferedReader(new FileReader(\"Input.txt\"));\n\t\t\tpw = new PrintWriter(new FileWriter(\"Output.txt\"));\n\t\t\tString str;\n\t\t\twhile ((str = br.readLine()) != null) {\n\t\t\t\t\n\t\t\t\tpw.println(str+\"|\");\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.toString());\n\t\t} finally {\n\t\t\tbr.close();\n\t\t\tpw.close();\n\t\t}\n\t}",
"public static void main(String[] args)throws IOException {\n\t\tFileReader fr= new FileReader(\"D:\\\\Test1.txt\");\r\n\t\tBufferedReader br= new BufferedReader(fr);\r\n\t\tString line=null;\r\n\t\twhile((line=br.readLine())!=null) {\r\n\t\t\tSystem.out.println(line);\r\n\t\t}\r\n//\t\tint ch=0;\r\n//\t\twhile( (ch=fr.read())!=-1) {\r\n//\t\t\tSystem.out.print((char)ch);\r\n//\t\t}\r\n\t\tfr.close();\r\n\t\t}",
"public static void main(String[] args) throws IOException {\n if(args.length == 0 || args.length == 1 || args.length > 2) {\n\n System.err.println(\" Usage: Lex <inputfile> <outputfile>\");\n \n System.exit(1);\n }\n\n\n // variable declarations\n Scanner input = null;\n \n PrintWriter output = null;\n \n String[] n = null;\n \n String line = null;\n \n int lines = -1;\n \n int lineNumber = 0; \n \n\n // Count the total lines of file\n input = new Scanner(new File (args [0] ));\n \n while( input.hasNextLine () ) {\n \n input.nextLine ();\n \n ++lineNumber;\n }\n\n input.close ();\n \n input = null;\n\n // Recreate Scanner\n input = new Scanner(new File(args[0]));\n\n // creates String array\n n = new String[lineNumber];\n\n // Place all inputs in a String array\n while(input.hasNextLine()) {\n \n n[++lines] = input.nextLine();\n }\n\t \n // Recreate PrintWriter\n output = new PrintWriter(new FileWriter(args[1]));\n \n // create List\n\t List l = new List();\t \n \n \n l.append(0);\n\n // Insertion Sort\n for(int j = 1; j < n.length; ++j) {\n \n String type = n[j];\n\n int i = j - 1;\n \n // move Index to the back of list\n l.moveBack();\n\n // comparing the current line and each line of List\n while(i > -1 && type.compareTo(n[l.get()]) <= 0) {\n \n --i;\n \n l.movePrev();\n }\n \n if(l.index() > -1){\n \n l.insertAfter(j);\n \n }else{\n \n l.prepend(j);\n } \n }\n\n // move Index to front of the list\n l.moveFront();\n\n // Loop control for List for the correct order of output\n while(l.index() > -1) {\n \n output.println(n[l.get()]);\n \n l.moveNext();\n }\n \n // Close input and output\n input.close();\n \n output.close();\n }",
"void readFile()\n {\n Scanner sc2 = new Scanner(System.in);\n try {\n sc2 = new Scanner(new File(\"src/main/java/ex45/exercise45_input.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n while (sc2.hasNextLine()) {\n Scanner s2 = new Scanner(sc2.nextLine());\n while (s2.hasNext()) {\n //s is the next word\n String s = s2.next();\n this.readFile.add(s);\n }\n }\n }",
"public static void main(String[] args) throws IOException {\n\t\tString line = new String(Files.readAllBytes(Paths.get(\"input.txt\")));\n\t\t\n\t\tFiles.write(Paths.get(\"outputh.txt\"), getOutput(line).getBytes(), StandardOpenOption.CREATE);\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\ttry{\r\n\t\t\tInputStreamReader isr=new InputStreamReader\r\n\t\t\t\t\t(new FileInputStream(\"FileToScr.txt\"));\r\n\t\t\tchar c[]=new char[512];\r\n\t\t\tint n=isr.read(c);\r\n\t\t\tSystem.out.println(new String(c,0,n));\r\n\t\t isr.close();\r\n\t\t}catch(IOException e){\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tInputStream fileInput = System.in;\n\t\tReader inputReader = new InputStreamReader(fileInput);\n\t\tBufferedReader bufferedReader = new BufferedReader(inputReader);\n\n//\t\tOutputStream outputStream = new FileOutputStream(\"text-example-test.txt\");\n\t\tOutputStream outputStream = System.out;\n\t\tWriter writer = new OutputStreamWriter(outputStream);\n\t\tBufferedWriter bufferedWriter = new BufferedWriter(writer);\n\n\t\tString row = bufferedReader.readLine();\n\n\t\twhile (row != null && !row.isEmpty()) {\n\t\t\tbufferedWriter.write(row);\n\t\t\tbufferedWriter.newLine();\n\t\t\tbufferedWriter.flush();\n\t\t\trow = bufferedReader.readLine();\n\t\t}\n\n\t\tbufferedReader.close();\n\t\tbufferedWriter.close();\n\t}",
"public static void main(String[] args) {\n try(Scanner scanner = new Scanner(Paths.get(\"data.txt\"))){\n \n // read the file until all lines have been read \n while(scanner.hasNextLine()){\n // read one line\n String row = scanner.nextLine();\n \n // print the line\n System.out.println(row);\n }\n }catch(Exception e){\n System.out.println(\"Error: \" + e.getMessage());\n }\n\n }",
"public static void Print(String fileName)\r\n {\n File file = new File(System.getProperty(\"user.dir\")+\"\\\\\"+fileName+\".txt\"); \r\n \r\n try \r\n {\r\n Scanner sc = new Scanner(file);\r\n \r\n while (sc.hasNextLine()) \r\n {\r\n System.out.println(sc.nextLine());\r\n }\r\n }\r\n catch (FileNotFoundException ex) \r\n {\r\n Logger.getLogger(TxtReader.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }",
"public static void main(String[] args) {\n\t\ttry {\n\t\t\tFileInputStream fileInputStream=new FileInputStream(\"src/test.txt\");\n\t\t\tInputStreamReader inputStreamReader=new InputStreamReader(fileInputStream);\n\t\t\tchar[] chars=new char[97];\n\t\t\tString str=\"\";\n//\t\t\tint i;\n\t\t\twhile (inputStreamReader.read(chars)!=-1) {\n\t\t\t\tstr+=new String(chars);\n\t\t\t}\n\t\t\tSystem.out.println(str);\n\t\t} catch (FileNotFoundException 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}",
"void printFile(String path) {\n try {\n String[] readFileOutPut = readFile(path);\n for (int i = 0; i < readFileOutPut.length;i++) System.out.println(readFileOutPut[i]);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] arg) {\n\t\tBufferedReader br = new BufferedReader(\r\n\t\t new FileReader(\"input.in\"));\r\n\r\n\t\t// PrintWriter class prints formatted representations\r\n\t\t// of objects to a text-output stream.\r\n\t\tPrintWriter pw = new PrintWriter(new\r\n\t\t BufferedWriter(new FileWriter(\"output.in\")));\r\n\r\n\t\t// Your code goes Here\r\n\r\n\t\tpw.flush();\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tString x = sc.nextLine();\r\n\r\n\t\tSystem.out.println(\"hello world \" + x);\r\n\t}",
"public static void main(String args[]) throws FileNotFoundException{\n\t\tFile file = new File(\"input.txt\");\r\n\t\tScanner scan = new Scanner(file);\r\n\t\twhile (scan.hasNext()) {\r\n\t\t\tString fName = scan.next();\r\n\t\t\tString lName = scan.next();\r\n\t\t\tSystem.out.println(\"Full name is: \" + fName + \" \" + lName);\r\n\t\t}\r\n\t\t\tscan.close();\r\n\t\t\r\n\t}",
"public static void main(String[] args) throws FileNotFoundException,IOException {\n\t\tFileReader fr=new FileReader(\"E:\\\\iostreams\\\\question.txt\");\n\n\t\tBufferedReader br=new BufferedReader(fr);\n\n\t\tStreamTokenizer st=new StreamTokenizer(br);\n\n\t\tint token=0;\n\t\tdouble sum=0;\n\t\twhile((token=st.nextToken())!=StreamTokenizer.TT_EOF) {\n\n\t\t\tswitch(token) {\n\t\t\t\tcase StreamTokenizer. TT_NUMBER:\n\t\t\t\t{\n\t\t\t\t\t//System.out.println(st.nval);\n\t\t\t\t\tsum+=st.nval;\n\t\t\t\t\t//System.out.println(sum);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase StreamTokenizer. TT_WORD:\n\t\t\t\t{\n\t\t\t\t\tif(sum!=0) {\n\t\t\t\t\t\tSystem.out.println((int)sum);\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.print(st.sval+\" \");\n\t\t\t\t\tsum=0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println((int)sum);\n\n\t}",
"public static void main(String[] args) {\n byte[] content = null;\n try {\n content = Files.readAllBytes(new File(\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\diemkhang\\\\test reader\\\\introduce.txt\").toPath());\n } catch (IOException e) {\n e.printStackTrace();\n }\n System.out.println(new String(content));\n }",
"public static void main(String[] args) throws IOException {\r\n\t\t\r\n\t\tSystem.out.println(parseInputFile());\r\n\t\t\r\n\t}",
"public static void main(String[] args){\n\t\tBufferedReader indata = new BufferedReader(new InputStreamReader(System.in));\r\n\t\tString input=null;\r\n\t\ttry {\r\n\t\t\tinput=indata.readLine();\r\n\t\t} catch (IOException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tFile file = new File(\"d:/addfile.txt\"); \r\n try { \r\n file.createNewFile();\r\n } catch (IOException e) { \r\n // TODO Auto-generated catch block \r\n e.printStackTrace(); \r\n }\r\n \r\n byte writebyte[] = new byte[1024];\r\n writebyte=input.getBytes();\r\n try{\r\n \tFileOutputStream in = new FileOutputStream(file);\r\n \ttry{\r\n \t\tin.write(writebyte, 0, writebyte.length); \r\n in.close();\r\n \t} catch (IOException e) { \r\n // TODO Auto-generated catch block \r\n e.printStackTrace(); \r\n } \r\n } catch (FileNotFoundException e) { \r\n // TODO Auto-generated catch block \r\n e.printStackTrace(); \r\n }\r\n \r\n if(input.equals(\"print\")){\r\n \ttry{\r\n \t\tFileInputStream out = new FileInputStream(file); \r\n \t\tInputStreamReader outreader = new InputStreamReader(out);\r\n \t\tint ch = 0;\r\n \t\twhile((ch=outreader.read())!=-1){\r\n \t\t\tSystem.out.print((char) ch);\r\n \t\t}\r\n \t\toutreader.close();\r\n \t}catch (Exception e) { \r\n \t\t// TODO: handle exception \r\n \t} \r\n }\r\n\t}",
"public void printFile() {\n\t\t\n\t\tfor(String[] line_i: linesArray) {\n\t\t\tSystem.out.println( Arrays.toString(line_i) );\n\t\t}\n\t}",
"public void inputForAnalysis() throws IOException\n {\n ArrayList<String> words = new ArrayList<String>(0);\n \n File fileName = new File(\"ciphertext.txt\");\n Scanner inFile = new Scanner(fileName);\n \n int index = 0;\n while(inFile.hasNext())\n {\n words.add(inFile.next());\n index++;\n }\n inFile.close();\n analyze(words);\n }",
"public static void main(String[] args) {\n\t\ttry {\n\t\t\tFile f11 = new File(\"Usama's 1st file.txt\");\n\t\t\tScanner myReader = new Scanner(f11);\n\t\t\t\n\t\t\twhile(myReader.hasNextLine())\n\t\t\t{\n\t\t\t\tString data = myReader.nextLine();\n\t\t\t\tSystem.out.println(data);\n\t\t\t}\n\t\t\tmyReader.close();\n\t\t} catch(FileNotFoundException e) {\n\t\t\tSystem.out.println(\"An unexpected error has been occured! :(\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n\t\t\t\n\t\tScanner scan = new Scanner(new File(\"input.txt\"));\n\t\t\n\t\tParser parse;\n\t\tCode code = new Code();\n\t\tSymbolTable st = new SymbolTable();\n\t\t\n\t\twhile(scan.hasNextLine()) {\n\t\t\tString inCode = scan.nextLine();\t\n\t\t\tparse = new Parser(inCode);\n\t\t}\n\t\t\n\t}",
"public static void main (String[] args) throws IOException\n {\n Scanner fileScan, lineScan;\n String fileName;\n\n Scanner scan = new Scanner(System.in);\n\n System.out.print (\"Enter the name of the input file: \");\n fileName = scan.nextLine();\n fileScan = new Scanner(new File(fileName));\n\n // Read and process each line of the file\n\n\n\n\n }",
"public void printToFile(AI input) {\n\t\ttry {\n\t\t\t// Create file\n\t\t\tFileWriter fstream = new FileWriter(FILENAME);\n\t\t\tBufferedWriter out = new BufferedWriter(fstream);\n\t\t\tout.write(input.toString() + \"\\n\");\n\t\t\t// Close the output stream\n\t\t\tout.close();\n\t\t} catch (Exception e) { // Catch exception if any\n\t\t\tSystem.err.println(\"Error: \" + e.getMessage());\n\t\t}\n\t}",
"public static void main(String[] args)throws IOException \n\t{\n\t\tFileReader fr = new FileReader(\"test.txt\");\n\t\tBufferedReader br = new BufferedReader (fr);\n\t\t\n\t\t//Declare variables\n\t\tchar[][] matrix = new char[20][45];\n\t\tString text = \"\";\n\t\t\n\t\t//Create Scanner\n\t\tScanner input = new Scanner(br);\n\t\t\t\n\t\t//Row-major ordered array\n\t\tfor (int row = 0; row < matrix.length; row++) \n\t\t{\n\t\t\tfor (int column = 0; column < matrix[row].length; column++) \n\t\t\t{ \n\t\t\t\tmatrix[row][column] = (char) br.read(); \t\n\t\t\t\tSystem.out.print(matrix[row][column]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t//Column-major ordered String\n\t\tfor (int column = 0; column < matrix[0].length; column++) \n\t\t{\n\t\t\tfor (int row = 0; row < matrix.length; row++) \n\t\t\t{\n\t\t\t\ttext = (text + matrix[row][column]); \n\t\t\t} \t\n\t\t}\n\t\tSystem.out.print(text);\n\t\tinput.close();\n}",
"public static void main(String[] args) throws IOException {\n\t\t\n\t\tString path=\"D:\\\\Users\\\\testfile.txt\";\n\t\tString content = new String(Files.readAllBytes(Paths.get(path)));\n\t\tSystem.out.println(content);\n\n\t}",
"public static void main(String[] args) throws IOException {\n br = new BufferedReader(new FileReader(\"input.txt\"));\r\n\r\n int T = nextInt();\r\n for (int t = 1; t <= T; t++) {\r\n nextInt();\r\n int X = nextInt();\r\n String lString = nextToken();\r\n\r\n StringBuilder s = new StringBuilder();\r\n for (; X > 0; X--) s.append(lString);\r\n char[] arr = s.toString().toCharArray();\r\n String soln = solve(arr) ? \"YES\" : \"NO\";\r\n\r\n System.out.printf(\"Case #%d: %s%n\", t, soln);\r\n }\r\n }",
"public static void files(Scanner input) throws FileNotFoundException { \n File inputName = inputVerify(input); // call inputVerify method to get the name of the input file \n\n System.out.print(\"Output file name: \"); // ask user for output file name and save it to outputFile variable \n\t\tString outputName = input.next();\n\n Scanner inputFile = new Scanner(inputName); // reads input file\n\n // creates a new PrintStream object to print to the output file\n PrintStream output = new PrintStream(new File(outputName)); \n\n // while loop that runs as long as the input file has another line\n while (input.hasNextLine()){\n String line = inputFile.nextLine(); // reads entire line\n output.println(line + \":\"); // prints name to file\n String scoreLine = inputFile.nextLine(); // reads next line\n abCount(scoreLine, output); // call abCount method\n }\n }",
"public static void readfile() {\r\n\t\t// read input file\r\n\t\ttry {\r\n\t\t File inputObj = new File(\"input.txt\");\r\n\t\t Scanner inputReader = new Scanner(inputObj);\r\n\t\t int i = 0;\r\n\t\t while (inputReader.hasNextLine()) {\r\n\t\t String str = inputReader.nextLine();\r\n\t\t str = str.trim();\r\n\t\t if(i == 0) {\r\n\t\t \tnumQ = Integer.parseInt(str);\r\n\t\t \torign_queries = new String[numQ];\r\n\t\t \t//queries = new ArrayList<ArrayList<String>>();\r\n\t\t }\r\n\t\t else if(i == numQ + 1) {\r\n\t\t \tnumKB = Integer.parseInt(str);\r\n\t\t \torign_sentences = new String[numKB];\r\n\t\t \t//sentences = new ArrayList<ArrayList<String>>();\r\n\t\t }\r\n\t\t else if(0 < i && i< numQ + 1) {\t\r\n\t\t \torign_queries[i-1] = str;\r\n\t\t \t//queries.add(toCNF(str));\r\n\t\t }\r\n\t\t else {\r\n\t\t \torign_sentences[i-2-numQ] = str;\r\n\t\t \t//sentences.add(toCNF(str));\r\n\t\t }\t\t \r\n\t\t i++;\r\n\t\t }\r\n\t\t inputReader.close();\r\n\t\t } catch (FileNotFoundException e) {\r\n\t\t System.out.println(\"An error occurred when opening the input file.\");\r\n\t\t }\r\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tFile file = new File(\"fileAAA.txt\");\r\n\t\tPrintWriter output = new PrintWriter(file);\r\n\t\t\r\n\t\t//write name and age to file\r\n\t\toutput.println(\"Homer Akin\");\r\n\t\toutput.println(49);\r\n\t\toutput.close();\r\n\t\t\r\n\t\tScanner input = new Scanner(file);\r\n\t\tString name = input.nextLine();\r\n\t\tint age = input.nextInt();\r\n\t\t\r\n\t\tSystem.out.printf(\"Name: %s \\nAge : %d\",name, age);\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public void readAndPrint(String fileName)\n\t{\n\t\tString[] names = null;\n\t\tFile file = new File(fileName);\n\t\tScanner sc;\n\t\ttry {\n\t\t\tsc = new Scanner(file);\n\t\t\twhile (sc.hasNextLine()) {\n\t\t\t\tString line = sc.nextLine();\n\t\t\t\tString[] tokens = line.split(\" \");\n\t\t\t\tSystem.out.println(\"Person: \" + tokens[0] + \", \" + \n\t\t\t\t\"Age: \" + tokens[1] + \" \");\n\t\t\t\tSystem.out.print(tokens[0] + \",\");\n\t\t\t}\n\t\t} \n\t\tcatch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\n\t\t\t//process the information\n\t\t}\n\n\t\t//System.out.println(\"readAndPrint NOT IMPLEMENTED\");\n\t}",
"public static void main(String[] args) throws FileNotFoundException\r\n {\r\n introduction();\r\n\r\n String fileName = getInput(); // input the name of the file\r\n\r\n File file = new File(fileName); // create file object for input\r\n\r\n checkExist(file); // check if the file exist\r\n\r\n String[] words = loadword(file); // string array for storing words in the file\r\n\r\n sort(words); // storing the words in order\r\n\r\n File outputFile = new File(\"output.txt\"); // create file for result\r\n\r\n writeFile(outputFile, words); // write result into the output file\r\n\r\n System.out.println(\"Finish!\");\r\n }",
"public static void main( String[] args ) throws Exception\n {\n ArrayList<String> sortedNames = new ArrayList<>();\n\n //accessing the input file\n File file = new File(\"src\\\\main\\\\java\\\\ex41\\\\exercise41_input.txt\");\n\n //directing scanner to read from input file\n Scanner input = new Scanner(file);\n\n\n //creating an output file\n File orderedNamesFile = new File(\"exercise41_output.txt\");\n\n //accessing the ability to write in output file\n FileWriter outputFile = new FileWriter(orderedNamesFile);\n\n\n /*using a while loop to read each line from input file and then add it to the arraylist sortedNames\n until there are no more lines*/\n while (input.hasNextLine()) {\n String name = input.nextLine();\n sortedNames.add(name);\n }\n\n //using collections function to sort the names in the arraylist\n Collections.sort(sortedNames);\n\n\n //writing in output file\n outputFile.write(\"\\nTotal of \" + sortedNames.size() + \" names: \\n\");\n outputFile.write(\"------------------------\\n\");\n\n\n //adding in the sorted names in arraylist to the output file\n for(String n : sortedNames)\n {\n outputFile.write(n + \"\\n\");\n }\n\n\n }",
"public static void main(String[] args)throws IOException {\n\t\tFileReader file = new FileReader(\"D:\\\\stream\\\\hello.txt\");\n\t\tBufferedReader buffer = new BufferedReader(file);\n\t//\tint k =buffer.read();\n\t//\tSystem.out.println(k);\n\t//\tString s = buffer.readLine();\n\t//\tSystem.out.println(s);\n\t\tint k;\n\t\twhile((k=buffer.read())!=-1) {\n\t\t\t\n\t\t\tSystem.out.print((char)k);\n\t\t}\n\t\tbuffer.close();\n\t\tfile.close();\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\ttry {\n\t\t\tFileInputStream fin = new FileInputStream(\"src/fileIO/bufferedFile.txt\");\n\t\t\tint i = 0;\n\t\t\twhile(i != -1) {\n\t\t\t\tSystem.out.print((char) fin.read());\n\t\t\t\t\n\t\t\t}\n\t\t\tfin.close();\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public static void main(String[] args) {\n\t\t\ttry(FileReader fr = new FileReader(\"Numbers2.txt\");\n\t\t\t\tBufferedReader br= new BufferedReader(fr); )\n\t\t\t{\n\t\t\t\t\n\t\t\t\tint index=0;\n//\t\t\t\tThis is one way to read code from txt file\n\t\t\t\twhile(br.ready()) {\n\t\t\t\t\tSystem.out.print(++index+\":\");\n\t\t\t\t\tSystem.out.println(br.readLine());\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch(FileNotFoundException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tcatch(IOException e){\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\t\n\t\t\tfinally {\n\t\t\tSystem.out.println(\"Ended..\");\n\t\t\t\t\n\t\t\t}\n\t\t}",
"public static void main(String[] args) throws IOException {\n\t\tInput in = new Input(\"input.txt\", 2 * 1024);\r\n\t\tPrintWriter out = new PrintWriter(\"output.txt\");\r\n\r\n\t\tl = in.nextInt();\r\n\t\tint m = in.nextInt();\r\n\t\tint n = in.nextInt();\r\n\t\t\r\n\t\tpattern = new int[m + 1][l + 1];\r\n\t\t\r\n\t\tfor (int i = 0; i < m; ++i) { \r\n\t\t\tpattern[i][l] = in.nextInt();\r\n\t\t\tfor (int j = 0; j < l; ++j) pattern[i][j] = in.nextInt();\r\n\t\t}\r\n\t\t\r\n\t\trand = new Random();\r\n\t\tsort(0, m - 1);\r\n\t\t\r\n\t\tint ok = 0, bad = 0, pos;\r\n\t\tbuf = new int[l];\r\n\t\t\r\n\t\tfor (int i = 0; i < l; ++i) pattern[m][i] = Integer.MAX_VALUE;\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i) {\r\n\t\t\tfor (int j = 0; j < l; ++j) buf[j] = in.nextInt();\r\n\t\t\tpos = offer(0, m);\r\n\t\t\tif (pos >= 0) {\r\n\t\t\t\tout.println(pattern[pos][l]);\r\n\t\t\t\t++ok;\r\n\t\t\t} else {\r\n\t\t\t\tout.println(\"-\");\r\n\t\t\t\t++bad;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tout.println(\"OK=\" + ok + \" BAD=\" + bad);\r\n\t\tout.close();\r\n\t}",
"private void readFile() {\r\n\t\tScanner sc = null; \r\n\t\ttry {\r\n\t\t\tsc = new Scanner(inputFile);\t\r\n\t\t\twhile(sc.hasNextLine()){\r\n\t\t\t\tgrade.add(sc.nextLine());\r\n\t } \r\n\t\t}\r\n\t\tcatch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tsc.close();\r\n\t\t}\t\t\r\n\t}",
"public void input(File inputFile){\n instantiateTable();\n try{\n String line = \"\";\n //method to scan certain words between 2 delimiting characters, usually blank lines or white spaces or tabs.\n Scanner read = new Scanner(inputFile).useDelimiter(\"\\\\W+|\\\\n|\\\\r|\\\\t|, \");\n //while there is a next word, keeps reading the file \n while (read.hasNext()){\n line = read.next().toLowerCase();\n LLNodeHash words = new LLNodeHash(line, 1, null);\n add(words);\n }\n read.close();\n }\n catch (FileNotFoundException e){\n System.out.print(\"Not found\");\n e.printStackTrace();\n }\n System.out.println(hashTable.length);\n System.out.println(space());\n System.out.println(loadFactor);\n System.out.println(collisionLength());\n print();\n }",
"public static void main(String[] args) throws IOException {\n\n\t\tFileReader r = new FileReader(\"D:\\\\SUREN\\\\Common\\\\DATA\\\\data.txt\");\n\t\tBufferedReader bfr= new BufferedReader(r);\n\t\tString x=\"\";\n\t\tSystem.out.println(bfr.readLine());\n\t\t\n\t\twhile((x=bfr.readLine())!=null)\n\t\t{\n\t\t\tSystem.out.println(x);\n\t\t}\n\t\tbfr.close();\n\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tInput in = new Input(\"input.txt\", 2 * 1024);\r\n\t\tPrintWriter out = new PrintWriter(\"output.txt\");\r\n\r\n\t\tint n = in.nextInt();\r\n\t\t\r\n\t\tfVal = new int[n];\r\n\t\tfPos = new int[n];\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i) {\r\n\t\t\tfVal[i] = in.nextInt();\r\n\t\t\tfPos[i] = i;\r\n\t\t}\r\n\t\t\r\n\t\tsVal = new int[n];\r\n\t\tsPos = new int[n];\r\n\r\n\t\tfor (int i = 0; i < n; ++i) {\r\n\t\t\tsVal[i] = in.nextInt();\r\n\t\t\tsPos[i] = i;\r\n\t\t}\r\n\t\t\r\n\t\tbuf = new int[n / 2 + 1];\r\n\t\ttmp = new int[n / 2 + 1];\r\n\t\t\r\n\t\tsortsVal(0, n - 1);\r\n\t\tsortfVal(0, n - 1);\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i)\r\n\t\t\tif (fVal[i] != sVal[i]) {\r\n\t\t\t\tout.println(-1);\r\n\t\t\t\tout.close();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < n; ++i)\r\n\t\t\tfVal[i] = sPos[i];\r\n\t\t\t\r\n\t\tsortfPos(0, n - 1);\r\n\t\t\r\n\t\tanswer = 0;\r\n\t\t\r\n\t\tmerge(fVal, 0, n - 1);\r\n\t\t\t\r\n\t\tout.println(answer);\t\r\n\t\t\r\n\t\tout.close();\r\n\t}",
"public static void main(String[] args) {\n\n try {\n FileInputStream inputStream = new FileInputStream(\"fichier1.txt\");\n\n int data = inputStream.read();\n\n while(data != -1) {\n System.out.print((char)data);\n\n data = inputStream.read();\n }\n\n inputStream.close();\n\n }catch(Exception e) {\n System.out.println(e.toString());\n }\n\n }",
"public static void main(String[] args) throws IOException{\n\t\tBufferedReader in =new BufferedReader(new FileReader(input));\r\n\tPrintWriter out = new PrintWriter(new FileWriter(output));\r\n\t\t\r\n\t\tint t = Integer.parseInt(in.readLine());\r\n\t\t\r\n\t\tfor(int i=1; i<=t; i++){\r\n\t\t\tout.print(\"Case #\"+i+\": \");\r\n\t\t\tint n = Integer.parseInt(in.readLine());\r\n\t\t\toneTest(n, in, out);\r\n\t\t\tout.println();\r\n\t\t}\r\n\t\tout.flush();\r\n\t}",
"String input() {\n\n try {\n\n FileReader reader = new FileReader(\"the text.txt\");\n BufferedReader bufferedReader = new BufferedReader(reader);\n StringBuilder builder = new StringBuilder();\n String line;\n\n while ((line = bufferedReader.readLine()) != null)\n builder.append(line);\n\n return builder.toString();\n\n } catch (IOException e) {\n\n System.out.println(\"Input Failure\");\n return null;\n }\n }",
"public static void main(String[] args){\n\n\n String fileName = \"allChar.txt\";\n FileReader file;\n BufferedReader buffer;\n String input;\n\n try {\n file = new FileReader(fileName);\n buffer = new BufferedReader(file);\n\n while((input = buffer.readLine()) != null){\n\n //remove all instances of spaces\n input = input.replaceAll(\"\\\\s+\", \"\");\n\n //remove \\n and \\r\n input = input.replace(\"\\n\", \"\");\n input = input.replace(\"\\r\", \"\");\n\n\n for(String word : input.split(\"\")){\n \n System.out.println(word);\n\n }\n\n }\n\n } catch (IOException error){\n System.out.println(error);\n }\n\n\n }",
"public static void main(String[] args) throws IOException {\n File file = new File(\"input.txt\");\n BufferedReader buffer = new BufferedReader(new FileReader(file));\n String line;\n\n while ((line = buffer.readLine()) != null) {\n line = line.trim();\n\n char[] chars = line.toCharArray();\n boolean isSpaceAdded = false;\n\n StringBuilder sb = new StringBuilder();\n for (int i = 0, len = chars.length; i < len; i++) {\n if (Character.isLetter(chars[i])) {\n sb.append(chars[i]);\n isSpaceAdded = false;\n } else {\n if (!isSpaceAdded) {\n sb.append(\" \");\n isSpaceAdded = true;\n }\n }\n }\n System.out.println(sb.toString().trim().toLowerCase());\n }\n }",
"static void echoFile() {\n BufferedReader echo = new BufferedReader(fileIn);\n String curr_char = \"\";\n try {\n while((curr_char = echo.readLine()) != null) {\n System.out.println(curr_char);\n }\n cout.println();\n }\n catch(IOException e) {\n System.out.println(\"echofile error\");\n }\n }",
"public static void main(String[] args) throws FileNotFoundException {\n\n\t\t// define a file object for the file on our computer we want to read\n\t\t// provide a path to the file when defining a File object\n\t\t//\n\t\t// paths can be: absolute - code all the parts from the root folder of your OS (Windows)\n\t\t//\n\t\t// paths can be: relative - code the part from the assumed current position to the file\n\t\t//\n\t\t// absolute paths should be avoided - they tightly couple the program to the directory structure it was created on\n\t\t//\t\t\t\t\t\t\t\t\t\t\tif the program is run on a machine with a different directory structure it won't work\n\t\t//\t\t\t\t\t\t\t\t\t\t\t\tbecause the absolute path doesn't exist in a different directory structure\n\t\t//\n\t\t// relative paths are preferred because you have loosely coupled the file to the directory structure\n\t\t//\t\t\tit is more likely that the relative paths will be the same from machine to machine\n\t\t//\n\t\t// path: . = current directory\n\t\t//\t\t/ = then (sub-directory or file follows)\n\t\t//\t\tnumbers.txt - file name\n\n\t\tFile theFile = new File(\"./data/numbers.txt\"); // give the File object the path to our file\n\n\t\t// define a scanner for the File object we created for the file on our computer\n\t\tScanner scannerForFile = new Scanner(theFile); // give Scanner the file object we created\n\n\t\tString aLine = \"\"; // hold a line of input from the file\n\n\n\t\tint sum = 0; // hold the sum of the numbers in a line\n\n\t\t// if we want to get all the lines in the file\n\t\t// we need to go through and get each line in the file one at a time\n\t\t// but we can't get a line from the file if there are no more lines in the file\n\t\t// we can use the Scanner class hasNextLine() method to see if there is another line in the file\n\t\t// we can set a loop to get a line from the file and process it as long as there are lines in the file\n\t\t// we will use while loop since we want loop based on a condition (as long as there are line in the file)\n\t\t// \t\t\tand not a count of lines in the file, in which case we would use a for-loop\n\t\t//\t\t\t\tfor-each-loops only work for collection classes\n\n\t\t// add up each line from my file\n\t\t// the file has one or more numbers separated by a single space in each line\n\n\t\twhile (scannerForFile.hasNextLine()) { // loop while there ia a line in the file\n\n\t\t\taLine = scannerForFile.nextLine(); // get a line from the file and store it in aLine\n\n\t\t\t// break apart the numbers in the line based on spaces\n\t\t\t// String .split() will create an array of Strings of the values separated by the delimiter\n\n\t\t\tString[] theNumbers = aLine.split(\" \"); // break apart the numbers in the line based on spaces\n\n\t\t\tSystem.out.println(\"Line from the file: \" + aLine); // display the line from the file\n\n\t\t\t// reset teh sum to 0 to clear it of the value from the last time through the loop\n\t\t\tsum = 0;\n\n\t\t\t// loop through the array of Strings holding the numbers from the line in the file\n\n\t\t\tfor (String aNumber : theNumbers) { // aNumber will hold the current element that is in the array\n\t\t\t\t\tsum = sum + Integer.parseInt(aNumber); // add the number to a sum after converting the String to an int\n\t\t\t}\n\n\t\t\t// now that we have the sum, we can display it\n\n\t\t\tSystem.out.println(\"Sum of the numbers is: \" + sum);\n\t\t\tSystem.out.println(\"Average of the numbers is: \" + sum / theNumbers.length);\n\n\t\t} // end of while loop\n\n\n\t\t\n}",
"public static void main(String[] args) throws IOException {\n\n FileInputStream in = new FileInputStream(\"d:\\\\cztst.txt\");\n BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n String s = reader.readLine();\n System.out.println(s);\n }",
"public static void main(String[] args) // FileNotFoundException caught by this application\n {\n\n Scanner console = new Scanner(System.in);\n System.out.print(\"Input file: \");\n String inputFileName = console.next();\n System.out.print(\"Output file: \");\n String outputFileName = console.next();\n\n Scanner in = null;\n PrintWriter out =null;\n\n File inputFile = new File(inputFileName);\n try\n {\n in = new Scanner(inputFile);\n out = new PrintWriter(outputFileName);\n\n double total = 0;\n\n while (in.hasNextDouble())\n {\n double value = in.nextDouble();\n int x = in.nextInt();\n out.printf(\"%15.2f\\n\", value);\n total = total + value;\n }\n\n out.printf(\"Total: %8.2f\\n\", total);\n\n\n } catch (FileNotFoundException exception)\n {\n System.out.println(\"FileNotFoundException caught.\" + exception);\n exception.printStackTrace();\n }\n catch (InputMismatchException exception)\n {\n System.out.println(\"InputMismatchexception caught.\" + exception);\n }\n finally\n {\n\n in.close();\n out.close();\n }\n\n }",
"public static void main(String[] args) throws IOException, ScannerException{\n Scanner scan = new Scanner(\"test_input/ex1.tiger\");\n List<Token> tokens = scan.getTokens();\n for (Token tok : tokens) {\n System.out.println(tok.allDetails());\n }\n }",
"public void readDataFromFile() {\n System.out.println(\"Enter address book name: \");\n String addressBookFile = sc.nextLine();\n Path filePath = Paths.get(\"C:\\\\Users\\\\Muthyala Aishwarya\\\\git\" + addressBookFile + \".txt\");\n try {\n Files.lines(filePath).map(line -> line.trim()).forEach(line -> System.out.println(line));\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public static void main(String[] args) {\n\t\tString filePath = \"J:\\\\\\\\GCU\\\\\\\\Programming 1(CST-105)\\\\\\\\Assignments\\\\\\\\Week3CHyde\\\\\\\\week3_workspace\\\\\\\\ProgrammingExercise4\\\\\\\\src\\\\\\\\Exercise4_Text.txt\";\n\t\tString entireText = \"\";\n\t\t\n\t\t// Try-Catch to make sure file is present. \n\t\ttry {\n\t\t\tBufferedReader bufferedReader = new BufferedReader(new FileReader(filePath));\n\n\t\t\tString readLine = \"\";\n\n\t\t\t// Start while loop\n\t\t\twhile ((readLine = bufferedReader.readLine()) != null) {\n\t\t\t\tentireText += readLine; // Set each line that is read to the entireText String variable.\n\t\t\t} \n\t\t\t// End while loop\n\n\t\t\tbufferedReader.close(); // Close the Buffered Reader\n\t\t}\n\t\tcatch (IOException e) { // Catch starts\n\t\t\te.printStackTrace();\n\t\t} // Catch ends. \n\n\t\t//Run the method printTranslation\n\t\tprintTranslation(entireText);\n\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n\t\tFile file = new File(\"input.txt\");\n\t\t@SuppressWarnings(\"resource\")\n Scanner scan = new Scanner(file);\n\t\t\n\t\tint caseNumber = scan.nextInt();\n for (int i = 1; i <= caseNumber; i++){\n Long N = scan.nextLong();\n Long L = scan.nextLong();\n List<Long> list = new ArrayList<Long>();\n for(int j = 0; j < L; j++) {\n \tlist.add(scan.nextLong());\n }\n String result = cryptopangrams(N,L,list);\n System.out.println(\"Case #\" + i + \":\" + \" \" + result);\n }\n\t}",
"public static void main(String[] args) {\n\t\tBufferedReader br =null;\n\t\ttry {\n\t\t\tbr =new BufferedReader(new FileReader(\"test.txt\"));\n\t\t\tString l;\n\t\t\twhile((l=br.readLine())!=null) {\n\t\t\t\tSystem.out.println(l);\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"print catch\");\n\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tbr.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\t}\n}",
"public static void Load() {\n System.out.println(\"LOADED DATA:\");\n try {\n File object = new File(\"Output.txt\");\n Scanner reader = new Scanner(object);\n while (reader.hasNextLine()) {\n String info = reader.nextLine();\n System.out.println(info);\n }\n reader.close();\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred\");\n e.printStackTrace();\n }\n System.out.println(\"|--------------------------------------------------------------| \");\n\n }",
"public static void readInFile(Scanner inFile) {\n\t\twhile(inFile.hasNext()) {\n\t\t\tString strIn = inFile.nextLine();\n\t\t\tSystem.out.println(strIn);\n\t\t}\n\t\tinFile.close();\n\t}",
"public static void main(String[] args) throws FileNotFoundException {\n\t\tFile file = new File(\"src/input.txt\");\n\t\tScanner scan = new Scanner(file);\n\t\tint N = scan.nextInt();\n\t\tscan.nextLine(); // clear buffer\n\t\tint[] arr = new int[N];\n\t\tfor (int i=0; i<N; i++) {\n\t\t\tarr[i] = scan.nextInt();\n\t\t}\n\t\tSystem.out.print(\"Before: \");\n\t\tfor (int el : arr) System.out.print(el + \" \");\n\t\tSystem.out.println();\n\t\tcountSwaps(arr);\n\t\tscan.close();\n\t\t\n\n\t}",
"private void traceInput() {\r\n int line = 1, start = 0, stop = input.length();\r\n for (int i = 0; i < in; i++) {\r\n if (input.charAt(i) != '\\n') continue;\r\n line++;\r\n start = i + 1;\r\n }\r\n for (int i = in; i < input.length(); i++) {\r\n if (input.charAt(i) != '\\n') continue;\r\n stop = i;\r\n break;\r\n }\r\n System.out.print(\"I\" + line + \": \");\r\n System.out.print(input.substring(start, in));\r\n System.out.print(\"|\");\r\n System.out.println(input.substring(in, stop));\r\n }",
"public static void main(String[] args) throws IOException {\n FileReader fr = null;\n try {\n fr = new FileReader(\"/home/cgi/IdeaProjects/PE3_SOLUTIONS/fileInputToUpperCase/src/com/company/Input.txt\");\n } catch (FileNotFoundException fe) {\n System.out.println(\"File not found\");\n }\n int ch;\n while((ch=fr.read())!=-1){\n char out= Character.toUpperCase((char)ch);\n System.out.print(out);\n }\n\n }",
"public static void main(String[] args) {\n\t\tScanner inFile = new Scanner(System.in);\n\t\tString statement = \"\";\n\t\t\n\t\twhile (inFile.hasNextLine()){\n\t\t\tif (statement.equals(\"\"))\n\t\t\t\tstatement = inFile.nextLine() + \"\\n\";\n\t\t\telse\n\t\t\tstatement = statement + inFile.nextLine() + \"\\n\";\n\t\t}\n\t\t\tSystem.out.print(statement);\n\t\t\tManipulateString modify = new ManipulateString(statement);\n\t\t\tSystem.out.println(\"Length: \" + modify.getLength());\n\t\t\tSystem.out.println(\"1st Char: \" + modify.getFirstChar());\n\t\t\tSystem.out.println(\"Last Char: \" + modify.getLastChar());\n\t\t\tSystem.out.println(modify.getUpperString());\n\t\t\tmodify.addToString();\n\t\t\tmodify.replaceString();\n\t\t\tmodify.removeNewLine();\n\t\t\tSystem.out.println(modify.getString());\n\t\t\tSystem.out.println(\"Last Index of SVSU: \" + modify.getLastIndexOfUniversity());\n\t\t\tSystem.out.println(\"Word Count: \" + modify.wordCount());\n\t\t\tmodify.reverseString();\n\t\t\tSystem.out.println(\"Reverse: \" + modify.getString());\n\t\t\tSystem.out.println(\"Length: \" + modify.getLength());\n\t \n\t}",
"public static void main(String[] args) throws java.io.IOException {\n\t\tPrintWriter pw = new PrintWriter (new FileWriter(\"writefile\"));\r\n\t\tSystem.out.print(\"Please enter Phone Number: \");\r\n\t\tphoneNumber=input.next();\r\n\t\tSystem.out.print(\"Please enter Contact Name: \");\r\n\t\tcontactName=input.next();\r\n\t\tSystem.out.println(\"Name: \" + contactName + \"\\tNumber: \" + phoneNumber);\r\n\t\tSystem.out.println(\"Starting printing to text file...\");\r\n\t\tpw.println(\"Name: \" + contactName + \" <Number: \" + phoneNumber);\r\n\t\tpw.close();\r\n\t\t\r\n\r\n\t}",
"public static void readRecords() {\n\t\t\n\t\tSystem.out.printf(\"%-10s%-12s%-12s%10s%n\", \"Account\", \"First Name\", \"Last Name\", \"Balance\");\n\t\t\n\t\ttry {\n\t\t\twhile (input.hasNext()) {\n\t\t\t\tSystem.out.printf(\"%-10s%-12s%-12s%10.2f%n\", input.nextInt(), input.next(), input.next(), input.nextDouble());\n\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch (NoSuchElementException elementException) {\n\t\t\tSystem.out.println(elementException);\n\t\t\tSystem.err.println(\"File improperly formed. Terminating.\");\n\t\t}\n\t\tcatch (IllegalStateException stateException)\n\t\t{\n\t\t\tSystem.err.println(\"Error reading from file. Terminating.\");\n\t\t}\n\t\t\t\n\t\t}",
"public static void main(String[] args) throws IOException {\n Scanner in = new Scanner(new File(args[0]));\n int lineCount = 0;\n while( in.hasNextLine() ){\n in.nextLine();\n lineCount++;\n }\n in.close();\n\n //Creat an array and read all the line from the file to the array\n String[] lines = new String[lineCount];\n int index = 0;\n \n // count the number of lines in file\n Scanner input = new Scanner(new File(args[0]));\n while( input.hasNextLine() ){\n lines[index] = input.nextLine();\n index++;\n }\n input.close();\n \n //Creat an array and assign the unmber to the array\n int[] listOfNum = new int[lineCount];\n for (int i = 0; i< listOfNum.length; i++){\n listOfNum[i] = i+1;\n }\n /*for (int i =0; i<listOfNum.length; i++){\n System.out.println(listOfNum[i]);\n }*/\n\n //Sort the String array and int array\n mergeSort(lines, listOfNum, 0, lines.length-1);\n\n for(int i = 1; i<args.length; i++){\n //check the word is found or not\n int checker = binarySearch(lines, 0, lines.length-1,args[i]);\n if( checker >= 0){\n System.out.println(args[i] +\" found on line \"+ listOfNum[checker]);\n }else{\n System.out.println(args[i] +\" not found\");\n }\n } \n }",
"public static void main(String[] args) {\n File data = new File(\"C:\" + File.separatorChar + \"temp\" + File.separatorChar \r\n + \"labFile.txt\");\r\n \r\n BufferedReader in = null;\r\n int count = 0;\r\n int recordCount = 0;\r\n try {\r\n //FileReader is being decorated by BufferedReader to make it read faster\r\n //buffered allows us to talk to file\r\n //open the stream\r\n in = new BufferedReader(new FileReader(data));\r\n //read the first line\r\n String line = in.readLine();\r\n //so long as line we just read is not null then continue reading file\r\n //if line is null it's end of file\r\n while (line != null) {\r\n \r\n \r\n if (count == 0) {\r\n String[] myStringArray = line.split(\" \");\r\n \r\n System.out.println(\"First Name: \" + myStringArray[0]);\r\n System.out.println(\"Last Name: \" + myStringArray[1]); \r\n } else if (count == 1) {\r\n \r\n System.out.println(\"Street Address: \" + line); \r\n } else if (count == 2) {\r\n \r\n String[] myStringArray = line.split(\" \");\r\n System.out.println(\"City: \" + myStringArray[0].replace(\",\", \" \"));\r\n System.out.println(\"State: \" + myStringArray[1]);\r\n System.out.println(\"Zip: \" + myStringArray[2]);\r\n \r\n count = -1;\r\n recordCount++;\r\n System.out.println(\"\");\r\n System.out.println(\"Number of records read: \" + recordCount);\r\n System.out.println(\"\");\r\n } \r\n count++;\r\n \r\n //reads next line\r\n line = in.readLine(); // strips out any carriage return chars\r\n \r\n }\r\n\r\n } catch (IOException ioe) {\r\n System.out.println(\"Houston, we have a problem! reading this file\");\r\n //want to close regardless if there is an error or not\r\n } finally {\r\n try {\r\n //close the stream\r\n //closing the file throws a checked exception that has to be surrounded by try catch\r\n in.close();\r\n } catch (Exception e) {\r\n\r\n }\r\n }\r\n }",
"static void experiment2Day1Part1() {\n\n File file = new File(\"src/main/java/weekone/input01.txt\");\n FileInputStream fis = null;\n\n try {\n fis = new FileInputStream(file);\n\n System.out.println(\"Total file size to read (in bytes) : \"\n + fis.available());\n\n int content;\n while ((content = fis.read()) != -1) {\n // convert to char and display it\n char converted = (char) content;\n System.out.print(converted);\n\n\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (fis != null)\n fis.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n\n }",
"public static void main(String[] args)\r\n\t{\n\t\tacceptConfig();\r\n\t\treadDictionary();\r\n\t\t//Then, it reads the input file and it prints the word (if contained on the file) or the suggestions\r\n\t\t//(if not contained) in the output file. These files are given by command line arguments\r\n\t\tprocessFile(args[0], args[1]);\r\n\t\t\r\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tString fname;\n\t\tFile file;\n\t\tScanner keyboard = new Scanner(System.in);\n\t\tScanner inFile;\n\n\t\tString line, word;\n\t\tStringTokenizer token;\n\t\tint[] freqTable = new int[256];\n\n\t\tSystem.out.println (\"Enter the complete path of the file to read from: \");\n\n\t\tfname = keyboard.nextLine();\n\t\tfile = new File(fname);\n\t\tinFile = new Scanner(file);\n\n\t\twhile (inFile.hasNext()) {\n\t\t\tline = inFile.nextLine();\n\t\t\ttoken = new StringTokenizer(line, \" \");\n\t\t\twhile (token.hasMoreTokens()) {\n\t\t\t\tword = token.nextToken();\n\t\t\t\tfreqTable = updateFrequencyTable(freqTable, word);\n\t\t\t}\n\t\t}\n\n\t\t//print frequency table\n\n\t\tSystem.out.println(\"Table of frequencies\");\n\t\tSystem.out.println(\"Character \\t Frequency \\n\");\n\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (freqTable[i]>0)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + freqTable[i]);\n\t\t\t}\n\n\t\tQueue<BinaryTree<Pair>> S = buildQueue(freqTable);\n\n\t\tQueue<BinaryTree<Pair>> T = new Queue<BinaryTree<Pair>>();\n\n\t\tBinaryTree<Pair> huffmanTree = createTree(S, T);\n\n\t\tString[] encodingTable = findEncoding(huffmanTree);\n\n\t\tSystem.out.println(\"Encoding Table\");\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (encodingTable[i]!=null)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + encodingTable[i]);\n\t\t}\n\t\tinFile.close();\n\t}",
"public static void main(String[] args)throws IOException {\n\t\tint small = 0;\r\n\t\tint big = 0;\r\n\t\tint whitespace = 0;\r\n\t\tint other = 0;\r\n\t\t\r\n\t\tStringBuilder contents = new StringBuilder();\r\n\t\tBufferedReader input = new BufferedReader(new FileReader(\"C:/Users/khalid/workspace/1DV506/src/ko222gj_assign4/second_file\"));\r\n\t\tString line = null;\r\n\t\ttry {\r\n\t\t\twhile ((line = input.readLine()) != null) {\r\n\t\t\t\tcontents.append(line);\r\n\t\t\t}\r\n\t\t//System.out.println(contents);\r\n\t\t}\r\n\t\tcatch (UnsupportedEncodingException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tcatch (IOException e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tinput.close();\r\n\t\t}\r\n\t\tString text = contents.toString();\r\n\t\t\r\n\t\t//System.out.println(text);\r\n\r\n\t\tint sblen = text.length();\r\n\t\tfor (int i = 0; i < sblen; i++) {\r\n\t\t\t//System.out.println(sb.charAt(i));\r\n\t\t\tchar x = text.charAt(i);\r\n\t\t\t//System.out.println(x);\r\n\t\t\tif (Character.isLetter(x)) {\r\n\t\t\t\tif (Character.isUpperCase(x)) {\r\n\t\t\t\t\tbig++;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tsmall++;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse if (Character.isSpaceChar(x)) {\r\n\t\t\t\twhitespace = whitespace + 1;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tother++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"Number of lower case letters: \"+ small);\r\n\t\tSystem.out.println(\"Number of upper case letters: \" + big);\r\n\t\tSystem.out.println(\"Number of whitespace: \" + whitespace);\r\n\t\tSystem.out.println(\"Number of other: \" + other);\r\n\t}",
"public static void main (String[] args) throws IOException {\n File inFile = new File(\"/Users/kbye10/Documents/CS 250 test files/sample1.data\");\r\n FileInputStream inStream = new FileInputStream(inFile);\r\n\r\n //set up an array to read data in\r\n int fileSize = (int)inFile.length();\r\n byte[] byteArray = new byte[fileSize];\r\n\r\n //read data in and display them\r\n inStream.read(byteArray);\r\n for (int i = 0; i < fileSize; i++) {\r\n System.out.println(byteArray[i]);\r\n }\r\n\r\n inStream.close();\r\n }",
"public static void main(String[] args) throws IOException{\n\t\tPrintWriter fw = new PrintWriter(new File(\"C:/Users/odae/workspace/app/src/day0718IOEx5_sample.txt\"));\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(System.in));\n\t\t\n\t\tSystem.out.print(\"입력 :\");\n\t\tString str = \"\";\n\t\twhile(!str.equals(\"end\")) {\n\t\t\tstr = in.readLine();\n\t\t\t//fw.write(str);\n\t\t\tfw.println(str);\n\t\t}\n\t\tfw.close();\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tFileWriter fw = new FileWriter(\"Names.txt\");\n\t\tPrintWriter outputFile = new PrintWriter(fw);\n\t\toutputFile.println(\"Matthew\");\n\t\toutputFile.println(\"Mark\");\n\t\toutputFile.println(\"Luke\");\n\t\toutputFile.close();\n\t\t\n\t\t//read from a file\n\t\tFile file = new File(\"Names.txt\");\n\t\tScanner inputFile = new Scanner(file);\n\t\t\n\t\twhile(inputFile.hasNext()) {\n\t\t\tString name = inputFile.nextLine();\n\t\t\tSystem.out.println(name);\n\t\t}\n\t\tinputFile.close();\n\t\t\n\t}",
"public static void main(String[] args) throws IOException {\n\n // reading a file is one line of code as below\n // it return List of String as each line as element\n try {\n List<String> allLines = Files.readAllLines(Paths.get(\"src/day60/note.txt\"));\n System.out.println(\"allLines = \" + allLines);\n\n for (String eachLine : allLines) {\n System.out.println(eachLine);\n }\n } catch (Exception e) {\n System.out.println(\"BOOM!!\");\n System.out.println(e.getMessage());\n }\n\n }",
"public void readFile();",
"public static void main(String[] args) {\n\r\n\t\ttry {\r\n\t\t\tInputStream is = new FileInputStream(\"C:\\\\Users\\\\John\\\\eclipse-workspace\\\\Java_Seoul_Wiz\\\\bin\\\\InputStream\\\\jain.txt\");\r\n\t\t\twhile(true) {\r\n\t\t\t\tint i = is.read();\r\n\t\t\t\tSystem.out.println(\"Data: \" + i);\r\n\t\t\t\tif(i==-1) break;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tis.close();\r\n\t\t\t\r\n\t\t} catch(Exception e) {\r\n\t\t\tSystem.out.println(e.getMessage());\r\n\t\t}\r\n\t}",
"public static void main(String[] args) throws IOException {\n FileInputStream fis = new FileInputStream(\"out/cities.txt\");\r\n \r\n // Create DataInputStream object wrap 'fis'.\r\n DataInputStream dis = new DataInputStream(fis);\r\n \r\n //\r\n // Read data.\r\n //\r\n int cityId1 = dis.readInt();\r\n System.out.println(\"Id: \" + cityId1);\r\n String cityName1 = dis.readUTF();\r\n System.out.println(\"Name: \" + cityName1);\r\n int cityPopulation1 = dis.readInt();\r\n System.out.println(\"Population: \" + cityPopulation1);\r\n float cityTemperature1 = dis.readFloat();\r\n System.out.println(\"Temperature: \" + cityTemperature1);\r\n \r\n //\r\n // Read data.\r\n //\r\n int cityId2 = dis.readInt();\r\n System.out.println(\"Id: \" + cityId2);\r\n String cityName2 = dis.readUTF();\r\n System.out.println(\"Name: \" + cityName2);\r\n int cityPopulation2 = dis.readInt();\r\n System.out.println(\"Population: \" + cityPopulation2);\r\n float cityTemperature2 = dis.readFloat();\r\n System.out.println(\"Temperature: \" + cityTemperature2);\r\n \r\n dis.close();\r\n }",
"public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"test.in\"));\n // input file name goes above\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"test.out\")));\n // Use StringTokenizer vs. readLine/split -- lots faster\n StringTokenizer st = new StringTokenizer(f.readLine());\n\t\t\t\t\t\t // Get line, break into tokens\n int i1 = Integer.parseInt(st.nextToken()); // first integer\n int i2 = Integer.parseInt(st.nextToken()); // second integer\n out.println(i1+i2); // output result\n out.close(); // close the output file\n}",
"public static void main(String[] args) throws FileNotFoundException\n {\n\n Scanner sc = new Scanner(new File(\"example.in\"));\n\n // Read the number of testcases to follow\n int t = sc.nextInt();\n\n //Iterate over the testcases and solve the problem\n for (int i = 0; i < t; i++) {\n int n = sc.nextInt();\n int m = sc.nextInt();\n\n AdjacencyList adj = new AdjacencyList(n);\n\n for (int j = 0; j < m; j++)\n {\n int v = sc.nextInt();\n int u = sc.nextInt();\n\n adj.addEdge(v, u);\n }\n\n System.out.println();\n System.out.println(\"testcase \" + i);\n testcase(adj);\n System.out.println();\n\n }\n }",
"public static void main(String[] args) throws IOException {\n\t\tlianxi.print (\"D:\\\\test.txt\");\n\t}",
"public static void main(String[] args) {\n try {\n readHouseTxt();\n } catch (ParseException e) {\n e.printStackTrace();\n }\n\n\n\n\n }",
"public static void main(String[] args) throws IOException {\n\t\tFiles.lines(Paths.get(\"src/file.txt\"))\n\t\t\t\t.map(str->str.split(\" \"))\n\t\t\t\t.flatMap(Arrays::stream)\n\t\t\t\t.distinct()\n\t\t\t\t.sorted()\n\t\t\t\t.forEach(System.out::println);\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tFiles.list(Paths.get(\".\"))\n\t\t\t.filter(Files::isDirectory)\n\t\t\t.forEach(System.out::println);\n//\t\t./.settings\n//\t\t./bin\n//\t\t./src\n\n\t}",
"public static void main(String[] args) throws IOException {\n File file = new File(\"Noten.txt\");\n FileInputStream fileInputStream = new FileInputStream(file);\n\n int byteRead;\n int count = 0;\n while ((byteRead = fileInputStream.read())!= -1) {\n char[] ch = Character.toChars(byteRead);\n System.out.println(ch[0]);\n count++;\n }\n System.out.println(count);\n fileInputStream.close();\n }",
"public void readFile(String name) {\n\t\tString filename = this.path + name;\n\t\tFile file = new File(filename);\n\t\t\n\t\t\n\t\ttry {\t\t \n\t\t\tScanner reader = new Scanner(file);\n\t\t\t\n\t\t\twhile (reader.hasNextLine()) {\n\t\t\t\tString data = reader.nextLine();\n\t\t System.out.println(data);\n\t\t\t}\n\t\t reader.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t System.out.println(\"File not found!\");\n\t\t} \n\t}",
"public static void main(String[] args) throws Exception\n\t{\n\t\tBufferedReader br = new BufferedReader(new FileReader(\"input6.txt\"));\tSystem.setOut(new PrintStream(new File(\"output.txt\")));\n\t\t\n\t\tint t = Integer.parseInt(br.readLine());\n\t\tfor(int i = 1; i <= t; i++)\n\t\t\tSystem.out.println(\"Case #\"+i+\": \"+solve(br));\n\t}",
"public static void main(String[] args) throws IOException {\n\t\tScanner input= new Scanner(new File(\"input.txt\"));\n\t\tFile analysis = new File(\"analysis.txt\");\n\t\tanalysis.createNewFile();\n\t\tFileWriter wrt = new FileWriter(\"analysis.txt\");\n\t\t\n\t\t\n\t\tString line =new String();\n\t\tString arg =new String();\n\t\t\n\t\twhile(input.hasNextLine()){\n\t\t\tChessList list = new ChessList();\n\t\t\t//pulls arguments from input.txt\n\t\t\tline=input.nextLine();\n\t\t\targ=input.nextLine();\n\t\t\t\n\t\t\tString[] data=line.split(\"\\\\s+\");\n\t\t\tString[] ar = arg.split(\"\\\\s+\");\n\t\t\t\n\t\t\tint xarg = Integer.parseInt(ar[0]);\n\t\t\tint yarg = Integer.parseInt(ar[1]);\n\t\t\tint size = Integer.parseInt(data[0]);\n\t\t\tfor(int i=1;i<data.length;i+=3){\n\t\t\t\tString name=data[i];\n\t\t\t\tint x=Integer.parseInt(data[i+1]);\n\t\t\t\tint y=Integer.parseInt(data[i+2]);\n\t\t\t\tNode temp=new Node(createPiece(name,x,y,size));\n\t\t\t\tlist.add(temp);\n\t\t\t}\n\t\t\t\t\n\t\t\t\t//checks validity and writes it into analysis.txt\n\t\t\t\tif (list.checkValid()==false){\n\t\t\t\t\twrt.write(\"Invalid\");\n\t\t\t\t}\n\t\t\t\t//if valid, finds the argument and returns an attack if possible\n\t\t\t\telse{\n\t\t\t\t\tif(list.checkSpace(xarg, yarg)==null){\n\t\t\t\t\t\twrt.write(\"- \");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\twrt.write(list.checkSpace(xarg, yarg).name()+\" \");\n\t\t\t\t\t}\n\t\t\t\t\tif(!list.checkAttack()){\n\t\t\t\t\t\twrt.write(\"-\");\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\twrt.write(list.firstAttack());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\twrt.write(\"\\n\");\n\t\t}\n\t\tinput.close();\n\t\twrt.close();\n\t}",
"public static void main(String[] args) {\n\t\ttry {\n\t\t\t// Instantiates a InputStreamReader that connects to the file passed in by input redirection,\n\t\t\t// which is then thrown into a BufferedReader enabling the lines to be read. The BufferedReader\n\t\t\t// is then passed into the fetchEvents method, which will create Event objects based on the file contents\n\t\t\t// and return it as a SortedEventList.\n\t\t\tSortedEventList events = fetchEvents(new BufferedReader(new InputStreamReader(System.in), 1));\n\t\t\tint place = 1; // A place counter.\n\t\t\t// Iterates foreach Event object.\n\t\t\t// Since the LinkedList implements Iterable it can be used in an enchanced for.\n\t\t\tfor (Event event : events) { \n\t\t\t\t// It will output the event based on it's toString() with the place appended after.\n\t\t\t\tSystem.out.println(event + ((place == 1) ? GOLD : (place == 2) ? SILVER : (place == 3) ? BRONZE : EMPTY_STRING));\n\t\t\t\tplace++; // Increments place.\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\t// Somethings wrong. It outputs the thrown exception message.\n\t\t\tSystem.out.println(ex.getMessage()); \n\t\t}\n\t}",
"public static void main(String[] args){\n\t\ttry{\n\t\t\tFileReader fr=new FileReader(\"C:\\\\Users\\\\bharathi\\\\Desktop\\\\Hello\\\\new.txt\");\n\t\t\tbr = new BufferedReader(fr);\n\t\t\tSystem.out.println(\"reading lins from the file.... \"+br.readLine());\n\t\t}catch(Exception e){}\n\t}",
"public static void main(String[] args) throws Exception {\n\t\tFile file = new File(\"Lincoln.txt\");\r\n\t\tScanner i = new Scanner(file);\r\n\t\tString fulladd = file.getCanonicalPath();\r\n\t\tint chars = 0;\r\n\t\tint words = 0;\r\n\t\tint lines = 0;\r\n\t\twhile (i.hasNext()) {\r\n\t\t\tString word = i.next();\r\n\t\t\tboolean bool = false;\r\n\t\t\tfor (char c: word.toCharArray()) {\r\n\t\t\t\tif (Character.isLetter(c))\r\n\t\t\t\t\tbool = true;\r\n\t\t\t}\r\n\t\t\tif (bool)\r\n\t\t\t\twords ++;\r\n\t\t}\r\n\t\ti.close();\r\n\t\tScanner p = new Scanner(file);\r\n\t\twhile (p.hasNext()) {\r\n\t\t\tString line = p.nextLine();\r\n\t\t\tfor (char c: line.toCharArray())\r\n\t\t\t\tchars++;\r\n\t\t\tlines++;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(fulladd + \" contains:\");\r\n\t\tSystem.out.println(\"Characters: \" + chars);\r\n\t\tSystem.out.println(\"Words: \" + words);\r\n\t\tSystem.out.println(\"Lines: \" + lines);\r\n\t\ti.close();\r\n\t}"
] | [
"0.68902856",
"0.66974586",
"0.6642187",
"0.65707594",
"0.6393429",
"0.6365362",
"0.6309006",
"0.62786967",
"0.62221074",
"0.6196183",
"0.6176035",
"0.613583",
"0.6111808",
"0.6098057",
"0.6061811",
"0.6054772",
"0.60417163",
"0.6040401",
"0.60397273",
"0.60301685",
"0.60212415",
"0.6018179",
"0.60146105",
"0.60068357",
"0.60048556",
"0.5988536",
"0.5982855",
"0.597298",
"0.597098",
"0.596564",
"0.59354496",
"0.5925896",
"0.5918588",
"0.5904937",
"0.58805966",
"0.5875165",
"0.58733773",
"0.58703345",
"0.58670616",
"0.5836002",
"0.58336484",
"0.58258176",
"0.5817372",
"0.5813445",
"0.5801978",
"0.5797976",
"0.57829446",
"0.578149",
"0.57781243",
"0.5746488",
"0.57126796",
"0.5704746",
"0.5694072",
"0.56827915",
"0.5677728",
"0.5673992",
"0.56736153",
"0.56703824",
"0.56660825",
"0.566563",
"0.56526124",
"0.5649675",
"0.5640002",
"0.5637616",
"0.56359905",
"0.5604552",
"0.5595224",
"0.5590524",
"0.5587698",
"0.55836934",
"0.5568791",
"0.5564604",
"0.5561358",
"0.55595714",
"0.5549934",
"0.5547311",
"0.55451053",
"0.5544192",
"0.5543486",
"0.55406755",
"0.5538212",
"0.5535753",
"0.55306387",
"0.55250365",
"0.55224556",
"0.55213886",
"0.55162597",
"0.5515307",
"0.5508211",
"0.550371",
"0.55033016",
"0.5502212",
"0.5494258",
"0.5490211",
"0.54899573",
"0.5479441",
"0.5477133",
"0.5473271",
"0.54645157",
"0.5451756"
] | 0.6773283 | 1 |
prints the frequency table | private void printFrequencyTable() {
System.out.println("\nPrinting the frequency table:");
while(!frequencyTable.isEmpty()) {
frequencyTable.remove().printNode();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void print(){\n for (int i = 0; i < hashTable.length; i++){\n if (hashTable[i] != null){\n LLNodeHash ptr = hashTable[i];\n while (ptr.getNext() != null){\n System.out.print(\"(\" + ptr.getKey() + \", \" + ptr.getFreq() + \")\");\n ptr = ptr.getNext();\n }\n System.out.print(\"(\" + ptr.getKey() + \", \" + ptr.getFreq() + \")\");\n }\n }\n }",
"public void displayFrequency(int[] frequencyCount) {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t// For every character...\n\t\tfor (int i = 0; i < frequencyCount.length; i++) {\n\t\t\tif (frequencyCount[i] > 0) { // if it appears at least once..\n\t\t\t\t// tabs have a char value of 9\n\t\t\t\tif (i == 9) {\n\t\t\t\t\ttoPrint.append(\"\\\\t\");\n\t\t\t\t\t// new lines have a char value of 10\n\t\t\t\t} else if (i == 10) {\n\t\t\t\t\ttoPrint.append(\"\\\\n\");\n\t\t\t\t} else {\n\t\t\t\t\t// everything else is simply the same but as a char.\n\t\t\t\t\t// the index i is the char values\n\t\t\t\t\ttoPrint.append((char) i);\n\t\t\t\t}\n\t\t\t\t// the values at i is (char)i's frequency.\n\t\t\t\ttoPrint.append(\":\" + frequencyCount[i] + \"\\n\");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(toPrint.toString());\n\t}",
"private void showWordFrequency() {\n\t\tWordFrequencyProcessor wordFreqProcessor = new WordFrequencyProcessor();\n\t\ttry {\n\t\t\twordFreqProcessor.readFile(FILE_NAME);\n\t\t} catch (IOException e) {\n\t\t\tshowErrorAlert(\"Error\", \"Error Reading File: \", FILE_NAME);\n\t\t\tSystem.exit(0);\n\t\t\treturn;\n\t\t}\n\n\t\tList<WordFrequency> list = wordFreqProcessor.getFrequency();\n\t\tint size = list.size();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tWordFrequency wordFreq = (WordFrequency) list.get(i);\n\t\t\tfreqTable.getItems().add(wordFreq);\n\t\t} // for\n\t}",
"public static void main(String[] args) {\n int [] numbers= {23,45,66,45,78,34,201,88,66,34,7,9,3,603,7,301,7,8,7};\n\n LearnHashMapTravers.printFrequency(numbers);\n }",
"public void printStats() {\n\t\tSystem.out.println(\"========== LCMFreq v0.96r18 - STATS ============\");\n\t\tSystem.out.println(\" Freq. itemsets count: \" + frequentCount);\n\t\tSystem.out.println(\" Total time ~: \" + (endTimestamp - startTimestamp)\n\t\t\t\t+ \" ms\");\n\t\tSystem.out.println(\" Max memory:\" + MemoryLogger.getInstance().getMaxMemory());\n\t\tSystem.out.println(\"=====================================\");\n\t}",
"private static void printTable(int numberOfDocs) {\n \n Gson gs = new Gson();\n String json = gs.toJson(wor);\n // System.out.println(json);\n \n List<String> queryWords = new ArrayList();\n //to test it for other query word you can change the following two words\n //queryWords.add(\"carpet\");\n //queryWords.add(\"hous\");\n queryWords.add(\"the\");\n queryWords.add(\"crystallin\");\n queryWords.add(\"len\");\n queryWords.add(\"vertebr\");\n queryWords.add(\"includ\");\n \n \n FrequencySummary frequencySummary = new FrequencySummary();\n frequencySummary.getSummary(json,docName, queryWords);\n \n System.exit(0);\n \n Hashtable<Integer,Integer> g = new Hashtable<>();\n \n /* wor.entrySet().forEach((wordToDocument) -> {\n String currentWord = wordToDocument.getKey();\n Map<String, Integer> documentToWordCount = wordToDocument.getValue();\n freq.set(0);\n df.set(0);\n documentToWordCount.entrySet().forEach((documentToFrequency) -> {\n String document = documentToFrequency.getKey();\n Integer wordCount = documentToFrequency.getValue();\n freq.addAndGet(wordCount);\n System.out.println(\"Word \" + currentWord + \" found \" + wordCount +\n \" times in document \" + document);\n \n if(g.getOrDefault(currentWord.hashCode(), null)==null){\n g.put(currentWord.hashCode(),1);\n \n }else {\n System.out.println(\"Hello\");\n \n int i = g.get(currentWord.hashCode());\n System.out.println(\"i \"+i);\n g.put(currentWord.hashCode(), i++);\n }\n // System.out.println(currentWord+\" \"+ g.get(currentWord.hashCode()));\n // g.put(currentWord.hashCode(), g.getOrDefault(currentWord.hashCode(), 0)+wordCount);\n \n });\n // System.out.println(freq.doubleValue());\n \n // System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/freq.doubleValue())));\n });\n // System.out.println(g.get(\"plai\".hashCode()));\n //System.out.println(\"IDF for this word: \"+Math.log10( (double)(counter/(double)g.get(\"plai\".hashCode()))));\n */\n }",
"java.lang.String getFrequency();",
"public static String histogram(ArrayList<Integer> frequency)\r\n {\r\n int maxFrequency;\r\n int starRepresent;\r\n maxFrequency = 0;\r\n \r\n for (int i = 0; i < frequency.size() -1; i++)\r\n {\r\n if (frequency.get(i) > maxFrequency)\r\n maxFrequency = frequency.get(i);\r\n }\r\n \r\n starRepresent = maxFrequency / 10;\r\n \r\n System.out.printf(\"%10s\", \"Frequency Distrubution\");\r\n System.out.println();\r\n System.out.printf(\"%10s\", \"( max freq is \" + maxFrequency + \")\");\r\n System.out.println();\r\n \r\n for (int i = 10; i > 0; i--)\r\n {\r\n for (int index = 0; index <= frequency.size() - 1; index++)\r\n {\r\n if (frequency.get(index) / starRepresent >= i)\r\n System.out.print(\"* \");\r\n else\r\n System.out.print(\" \");\r\n }\r\n System.out.print(\"\\n\");\r\n }\r\n return \"\";\r\n }",
"public void print() {\n for (int i = 0; i < table.length; i++) {\n System.out.printf(\"%d: \", i);\n \n HashMapEntry<K, V> temp = table[i];\n while (temp != null) {\n System.out.print(\"(\" + temp.key + \", \" + temp.value + \")\");\n \n if (temp.next != null) {\n System.out.print(\" --> \");\n }\n temp = temp.next;\n }\n \n System.out.println();\n }\n }",
"@Override\n\tpublic int showFrequency(String key) {\n\t\tint hashVal = hashFunc(key);\n\t\twhile (hashArray[hashVal] != null) {\n\t\t\tif (hashArray[hashVal].value.equals(key))\n\t\t\t\treturn hashArray[hashVal].frequency;\n\t\t\telse {\n\t\t\t\thashVal++;\n\t\t\t\thashVal = hashVal % size;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}",
"public void printTable() {\r\n System.out.println(frame+\") \");\r\n for (int y = 0; y < table.length; y++) {\r\n System.out.println(Arrays.toString(table[y]));\r\n }\r\n frame++;\r\n }",
"public static void main(String[] args)\n\t{\n\t\tSystem.out.println(\"Hash Table Testing\");\n\t\t\n\t\tMyHashTable table = new MyHashTable();\n\t\t\n\t\ttable.IncCount(\"hello\");\n\t\ttable.IncCount(\"hello\");\n\t\t\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\t\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\t\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\t\n\t\ttable.IncCount(\"cool\");\n\t\t\n\t\ttable.IncCount(\"Assignment due\");\n\t\ttable.IncCount(\"Assignment due\");\n\t\t\n\t\ttable.IncCount(\"Wednesday\");\n\t\t\n\t\ttable.IncCount(\"night\");\n\t\ttable.IncCount(\"night\");\n\t\t\n\t\ttable.IncCount(\"at\");\n\t\t\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\t\n\t\tStringCount[] counts = table.GetCounts();\n\t\tString output = \"\";\n\t\t\n\t\tfor(int i = 0; i < counts.length; i++)\n\t\t{\n\t\t\tif(counts[i] != null)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"[\" + counts[i].str +\",\" + counts[i].cnt + \"], \");\n\t\t\t\toutput += \"[\" + counts[i].str +\",\" + counts[i].cnt + \"], \";\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.print(\"NULL!!!!! \" + i);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tif(output.compareTo(\"[Assignment due,2], [Food,7], [Happy Thanksgiving!,3], [TWELVE!!!,5], [Wednesday,1], [at,1], [cool,1], [hello,2], [night,2], [world,4], \") == 0)\n\t\t\tSystem.out.println(\"Success! Output is correct.\");\n\t\telse\n\t\t\tSystem.out.println(\"Failure! The output wasn't correct. Output was: \\\"\" + output +\"\\\"\");\n\t}",
"@Override\n\tpublic void display() {\n\t\tStringBuilder string = new StringBuilder();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hashArray[i] == null)\n\t\t\t\tstring.append(\"** \");\n\t\t\telse if (hashArray[i] == deleted)\n\t\t\t\tstring.append(hashArray[i].value + \" \");\n\t\t\telse\n\t\t\t\tstring.append(\"[\" + hashArray[i].value + \", \"\n\t\t\t\t\t\t+ hashArray[i].frequency + \"] \");\n\t\t}\n\t\tSystem.out.println(string.toString());\n\t}",
"public void displayHuffCodesTable() {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t\n\t\tfor (int i = 0; i < this.huffCodeVals.length; i++) {\n\t\t\t\n\t\t\tif (this.huffCodeVals[i] != null) {\n\t\t\t\tif (i == 9) {\n\t\t\t\t\ttoPrint.append(\"\\\\t\");\n\t\t\t\t\t\n\t\t\t\t} else if (i == 10) {\n\t\t\t\t\ttoPrint.append(\"\\\\n\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttoPrint.append((char) i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttoPrint.append(\":\" + this.huffCodeVals[i] + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(toPrint.toString());\n\t}",
"private void output(double[] freqPerc, String type){\n\t\tfor (int i = 0; i < 36; i++) { // Output percentage values\r\n\t\t\tif(i%3 == 0 && i != 0) System.out.print(\"\\n\"); // newline\r\n\t\t\tif (i < 26) System.out.printf((char)(i+65) + \":%05.2f%s\" + \" \", freqPerc[i], \"%\"); // output\r\n\t\t\telse System.out.printf(\"\" + (i-26) + \":%05.2f%s\" + \" \", freqPerc[i], \"%\");\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Highest chance of E (\" + type + \"): \" + mostFreq(freqPerc));\r\n\t\tSystem.out.println();\r\n\t}",
"void print() {\n\n\t\t// Print \"Sym Table\"\n\t\tSystem.out.print(\"\\nSym Table\\n\");\n\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tHashMap<String, Sym> M = list.get(i);\n\t\t\t// Print each HashMap in list\n\t\t\tSystem.out.print(String.format(M.toString() + \"\\n\"));\n\t\t}\n\n\t\t// Print New Line\n\t\tSystem.out.println();\n\t}",
"public void displayStats(PrintStream out) \r\n {\r\n \t// The current load factor\r\n \tdouble currLoadFactor = ((double)numItems)/((double)size);\r\n \t\r\n out.println(\"Current table size: \" + size);\r\n out.println(\"The number of items currently in the table: \" + numItems);\r\n out.println(\"The current load factor: \" + currLoadFactor);\r\n \r\n int largestChain = 0; // The largest chain\r\n int numZeroes = 0; // Number of LinkedList chains or \"buckets\" with size 0\r\n double averageLength = 0; // The average length of the buckets\r\n double average = 0; // The number of buckets\r\n \r\n for(int i = 0; i < hashTable.length; i++)\r\n {\r\n \tif(hashTable[i].size() > largestChain)\r\n \t{\r\n \t\tlargestChain = hashTable[i].size();\r\n \t}\r\n \tif(hashTable[i].isEmpty())\r\n \t{\r\n \t\tnumZeroes++;\r\n \t}\r\n \tif(hashTable[i].size() != 0)\r\n \t{\r\n \t\taverageLength += hashTable[i].size();\r\n \t\taverage++;\r\n \t}\r\n }\r\n \r\n // Retrieve the average length of a bucket\r\n averageLength = averageLength / average;\r\n \r\n out.println(\"The length of the largest chain: \" + largestChain);\r\n out.println(\"The number of chains of length 0: \" + numZeroes);\r\n out.println(\"The average of the chains of length > 0: \" + averageLength);\r\n }",
"public static void main(String[] args) {\n\n int response [] = {1, 2, 5, 4, 3, 5, 2, 1, 3, 3, 1, 4, 3, 3, 3, 1 ,2, 3, 3, 2, 2};\n int frequency []=new int [6];\n\n for(int counter = 1; counter < response.length; counter++)\n {\n try\n {\n ++frequency[response[counter]];\n }\n catch (ArrayIndexOutOfBoundsException e)\n {\n System.out.println(e);\n\n System.out.printf(\" response[%d] = %d\\n\", counter, response[counter]);\n }\n }\n\n System.out.printf(\"%s%10s\\n\", \"Rating\", \"Frequency\");\n\n for(int rating = 1; rating < frequency.length; rating++)\n System.out.printf(\"%5d%10d\\n\", rating, frequency[rating]);\n }",
"int getFreq();",
"public void printTable(){\n \tfor (int i = 0; i < Table.size(); i++) {\n \t\tList<T> data = Table.get(i);\n \t\ttry {\n \t\t\tSystem.out.println(\"Bucket: \" + i);\n \t\t\tSystem.out.println(data.getFirst());\n \t\t\tSystem.out.println(\"+ \" + (data.getLength() - 1) + \" more at this bucket\\n\\n\");\n \t\t} catch (NoSuchElementException e) {\n \t\t\tSystem.out.println(\"This bucket is empty.\\n\\n\");\n \t\t}\n \t}\n }",
"public void printHashTable()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < bucketSize; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.print(\"Hash Bucket: \" + i + \": \");\n\n\t\t\t\t\t\tNode current = bucketList[i];\n\n\t\t\t\t\t\twhile (current.getNext() != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.print(current.getData() + \" \");\n\t\t\t\t\t\t\t\tcurrent = current.getNext();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSystem.out.println(current.getData());\n\t\t\t\t\t}\n\t\t\t}",
"public void analyze(ArrayList<String> words) throws IOException\n {\n int[] letterOccurences = new int[regularAlphabet.length];\n double[] percentOccurence = new double[letterOccurences.length];\n int numberOfLetters = 0;\n \n //Loops to calculate number of occurences per letter.\n for(int wordCount = 0; wordCount<words.size(); wordCount++)\n {\n for(int letterCount = 0; letterCount<words.get(wordCount).length(); letterCount++)\n {\n for(int alphabetCharacter = 0; alphabetCharacter<regularAlphabet.length; alphabetCharacter++)\n {\n if(regularAlphabet[alphabetCharacter].equalsIgnoreCase(words.get(wordCount).substring(letterCount, letterCount+1)))\n {\n letterOccurences[alphabetCharacter]++;\n numberOfLetters++;\n }\n }\n }\n }\n \n //Loop to calculate percent occurences of letters.\n for(int index = 0; index<percentOccurence.length; index++)\n {\n percentOccurence[index] = (letterOccurences[index]/(double)numberOfLetters)*100;\n }\n \n PrintWriter outFile = new PrintWriter (new File(\"ciphertextfreq.txt\"));\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.printf(\"|%6s | %12s | %11s|\",\"Letter\",\"Frequency\",\"Percent\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.printf(\"|%6s | %12s | %11s|\\n\",\"Letter\",\"Frequency\",\"Percent\");\n System.out.println(\"-------------------------------------------\");\n for(int printIndex = 0; printIndex<regularAlphabet.length; printIndex++)\n {\n outFile.printf(\"|\\\"%S\\\" | %10d | %10.1f%s|\",regularAlphabet[printIndex],letterOccurences[printIndex],percentOccurence[printIndex],\"%\");\n System.out.printf(\"|\\\"%S\\\" | %10d | %10.1f%s|\\n\",regularAlphabet[printIndex],letterOccurences[printIndex],percentOccurence[printIndex],\"%\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n }\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.printf(\"|%5s | %10d | %10d%s|\",\"Total\",numberOfLetters,100,\"%\");\n System.out.printf(\"|%5s | %10d | %10d%s|\\n\",\"Total\",numberOfLetters,100,\"%\");\n outFile.println();\n outFile.println(\"-------------------------------------------\");\n System.out.println(\"-------------------------------------------\");\n outFile.close();\n }",
"public void stats() {\n\t\tSystem.out.println(\"Hash Table Stats\");\n\t\tSystem.out.println(\"=================\");\n\t\tSystem.out.println(\"Number of Entries: \" + numEntries);\n\t\tSystem.out.println(\"Number of Buckets: \" + myBuckets.size());\n\t\tSystem.out.println(\"Histogram of Bucket Sizes: \" + histogram());\n\t\tSystem.out.printf(\"Fill Percentage: %.5f%%\\n\", fillPercent());\n\t\tSystem.out.printf(\"Average Non-Empty Bucket: %.7f\\n\\n\", avgNonEmpty());\t\t\n\t}",
"public void print(){\n\t\tfor (int i = 0; i < numRows; i++) {\n\t\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void Report() throws IOException {\n\t\tFile outputFile = new File(outputPath);\n\n\t\tif(!outputFile.exists()) {\n\t\t\toutputFile.createNewFile();\n\t\t}\n\t\t\n\t\tFileWriter writer = new FileWriter(outputPath);\n\t\tLinkedHashMap<Word, Integer> sortedResult = sortByValue();\n\t\tfloat frequency;\n\t\tStringBuilder sb = new StringBuilder();\n\t\t\n\t\tfor(Map.Entry<Word, Integer> entry: sortedResult.entrySet()) {\n\t\t\tsb.setLength(0);\n\t\t\t\n\t\t\tfor(char c: entry.getKey().getCharacters()) {\n\t\t\t\tsb.append(c + \", \");\n\t\t\t}\n\t\t\t\n\t\t\tsb.delete(sb.length()-2, sb.length());\n\t\t\tfrequency = (float)entry.getValue()/(float)total_targets;\n\t\t\twriter.write(\"{(\" + sb.toString() + \"), \" + entry.getKey().getLength() +\n\t\t\t\t\t\t\t\"} = \" + String.format(\"%.2f\",Math.round(frequency * 100.0) / 100.0) +\n\t\t\t\t\t\t\t\" (\" + entry.getValue() + \"/\" + total_targets + \")\\n\");\n\t\t\t\n\t\t\tSystem.out.println(\"{(\" + sb.toString() + \"), \" + entry.getKey().getLength() +\n\t\t\t\t\t\t\t\t\"} = \" + String.format(\"%.2f\",Math.round(frequency * 100.0) / 100.0) +\n\t\t\t\t\t\t\t\t\" (\" + entry.getValue() + \"/\" + total_targets + \")\");\n\t\t}\n\t\tfrequency = (float)total_targets/(float)total;\n\t\t\n\t\tSystem.out.println(\"TOTAL Frequency: \" + Math.round(frequency * 100.0) / 100.0 + \"(\" + total_targets + \"/\" + total + \")\");\n\t\twriter.write(\"TOTAL Frequency: \" + Math.round(frequency * 100.0) / 100.0 + \"(\" + total_targets + \"/\" + total + \")\\n\");\n\t\t\n\t\twriter.close();\n\t}",
"static void outputComparisonTable(double [][]satisfactionRate) {\n \tSystem.out.print(\"\\t\");\n \tfor (int i = 0; i < satisfactionRate[0].length; i++) {\n\t\t\tSystem.out.print(\"run \" + (i+1) + \"\\t \");\n\t\t}\n \tSystem.out.println();\n \tfor (int i = 0; i < satisfactionRate.length; i++) {\n \t\tSystem.out.print((i+1) + \" vans\\t \");\n\t\t\tfor (int j = 0; j < satisfactionRate[i].length; j++) {\n\t\t\t\tSystem.out.print(((int)satisfactionRate[i][j]) + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n }",
"public static void displayHashTable() {\n\t\t\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------\");\n\t\t\n\t\t// Traverse hash table and print out values by index\n\t\tfor (int i = 0; i < sizeHashTable; i++) {\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Index \" + i + \"---> \");\n\t\t\tbst.inorderTraversalPrint(hashTable[i]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Here is a list of all the elements, sorted by index and inorder traversal: \");\n\n\t\t// Print out all of the values in one line\n\t\tfor (int i = 0; i < sizeHashTable; i++) {\n\t\t\tbst.inorderTraversalPrint(hashTable[i]);\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t}",
"void printStats();",
"float getFrequency();",
"private void printTable(String type){\n\t\tSystem.out.println(\"\\n\\t\\t\\t\\t \" + type + \" Probing Analysis (Table size = \" + tableSize + \")\");\n\t\tSystem.out.println(\"\\t\\t ----- Inserts ------ ----------- Probes ---------- --------- Clusters ---------\");\n\t\tSystem.out.printf(\"%5s %10s %10s %10s %10s %10s %10s %10s %10s %10s\\n\", \n\t\t\t\t\"N\", \"lambda\", \"success\", \"failed\", \"total\", \"avg\", \"max\", \"number\", \"avg\", \"max\");\n\t}",
"public void outDisTable()\n\t{\n\t\tfor(int i = 0; i < sqNum; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < sqNum; j++)\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"%-18s\", \"[\" + i + \",\" + j + \"]:\" + String.format(\" %.8f\", dm[i][j]));\n\t\t\t}\n\t\t\tSystem.out.print(\"\\r\\n\");\n\t\t}\n\t}",
"@Override\n\tpublic String toString() {\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(\"Index: \" + getIndex() + \"\\n\");\n\t\tsb.append(\"Freq : \" + getFreq() + \"\\n\");\n\t\treturn sb.toString();\n\t}",
"public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}",
"static public void printTable(int list[][])\r\n\t{\r\n\t\tfor(int i = 0; i < h; i++)\r\n\t\t{\r\n\t\t\tfor(int j = 0; j < w; j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(list[i][j] + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t}",
"public void print_documents_per_label_count() {\n\t\tSystem.out.println(\"SPORTS=\" + m_sports_count);\n\t\tSystem.out.println(\"BUSINESS=\" + m_business_count);\n\t}",
"public static void print_list(List li){\n Iterator<Node> it=li.iterator();\n while(it.hasNext()){Node n=it.next();System.out.print(n.freq+\" \");}System.out.println();\n }",
"public static void printTerminationFrequencies (ParameterSet pset) {\n System.out.println(pset);\n System.out.println(\"TERMINATION FREQUENCIES IN BINS\");\n System.out.println(\"midpoint\\tfrequency\");\n List<Double> popTerminationsList = population.getPopulationAveTerminationFrequencyInBins();\n for (int i = 0; i < ParameterSet.NUMBER_BINS; i++) {\n System.out.println(i * ParameterSet.PU_BIN_SIZE + ParameterSet.PU_BIN_SIZE / 2 + \"\\t\" + popTerminationsList.get(i));\n }\n }",
"public static void main(String[] args) {\n\t\tKingDataset king = KingDataset.instance();\r\n\t\tint interval=50;\r\n\t\tFrequencyTable table = new FrequencyTable(interval);\r\n\t\tfor (int i=0; i<10000; i++) {\r\n\t\t\tint point = king.next() / 2; // IMPORTANT - King is RTT\r\n\t\t\tSystem.out.print(point + \" \");\r\n\t\t\ttable.addDataPoint(point);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tfor (int i=0; i<1000; i+=interval) {\r\n\t\t\tSystem.out.println(\"[\" + i + \"-\" + (i+interval) + \"[ : \" + table.getFrequency(i));\r\n\t\t}\r\n\t}",
"public static void getFreq(){\n\t\t\tint mutTotalcounter=0;\n\t\t\t\n\t\t\tfor(int i=0; i<numOfMutations.length-1; i++){\n\t\t\t\t\n\t\t\t\tif(numOfMutations[i]==numOfMutations[i+1]){\n\t\t\t\t\tfrequency[mutTotalcounter]+=1; //if number of mutation is repeated in original array, frequency is incremented\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(numOfMutations[i]!=numOfMutations[i+1])\n\t\t\t\t{\n\t\t\t\t\tmutTotal[mutTotalcounter++]=numOfMutations[i]; //if number is not repeated in array, the next element in array\n\t\t\t\t\t//becomes the next number of mutations that occurred\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif((i+1)==numOfMutations.length-1){\n\t\t\t\t\t//used to get the last element in original array since for loop will go out of bounds\n\t\t\t\t\tmutTotal[mutTotalcounter]=numOfMutations[i+1];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"XMut : YFreq\");\n\t\t\t//console display of mutation and frequency values\n\t\t\tfor (int i=0; i<=mutTotal.length-1;i++){\n\t\t\t\tif(mutTotal[i]==0 && frequency[i]==0) continue;\n\t\t\t\tfrequency[i]+=1;\n\t\t\t\tSystem.out.print(mutTotal[i]+\" : \");\n\t\t\t\tSystem.out.print(frequency[i]);\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t}",
"@Override\r\n\tpublic void displayHashTable()\r\n\t{\r\n\t\tSystem.out.println(hm.toString());\r\n\t}",
"public void printStatistics() {\r\n\t\tLog.info(\"*** Statistics of Sequence Selector ***\");\r\n\r\n\t\t// chains\r\n\t\tLog.info(String.format(\"Chains: %d\", chains.size()));\r\n\t\tLog.info(String.format(\"Executable Chains: %d\", execChains.size()));\r\n\t\tLog.info(String.format(\"Causal Executable Chains: %d\",\r\n\t\t\t\tcausalExecChains.size()));\r\n\r\n\t\t// bushes\r\n\t\tLog.info(String.format(\"Bushes: %d\", bushes.size()));\r\n\t\tLog.info(String.format(\"Executable Bushes: %d\", execBushes.size()));\r\n\t\tLog.info(String.format(\"Required Bushes: %d\", requiredExecBushes.size()));\r\n\t\tLog.info(String.format(\"Redundant Bushes: %d\",\r\n\t\t\t\tredundantExecBushes.size()));\r\n\r\n\t\t// total\r\n\t\tLog.info(String.format(\"Bushes in Chains: %d\", bushesInChains.size()));\r\n\t\tLog.info(String.format(\"Total Sequences: %d\", totalSequences.size()));\r\n\r\n\t\t// time\r\n\t\tLog.info(String.format(\"Total Time: %d ms\", stopWatch.getTime()));\r\n\t\tLog.info(String.format(\"Time per Event: %d ms\", stopWatch.getTime()\r\n\t\t\t\t/ events.size()));\r\n\t}",
"public static void main(String[] args) {\n\t\tScanner s = new Scanner(System.in);\n\t\tString S = s.nextLine();\n\t\tint[] freq = new int[26]; // 빈도수 저장\n\t\tfor (int i = 0; i < S.length(); i++) {\n\t\t\tfreq[S.charAt(i) - 97]++;\n\t\t}\n\t\tfor (int i = 0; i < freq.length; i++) {\n\t\t\tif (i == freq.length - 1)\n\t\t\t\tSystem.out.println(freq[i]);\n\t\t\telse\n\t\t\t\tSystem.out.print(freq[i] + \" \");\n\t\t}\n\t}",
"public void displayTimesTable() {\n if (table >= TABLE_MIN && table <= TABLE_MAX) {\n System.out.println(table + \" times table:\");\n for (int i=1; i <= TABLE_MAX; ++i) {\n System.out.printf(\"%2d X %2d = %3d\\n\",\n i, table, timesTables[table][i]);\n } // close for\n }\n else\n System.out.println(table + \" is not between \" +\n TABLE_MIN + \" and \" + TABLE_MAX);\n }",
"public static void printAll() {\n // Print all the data in the hashtable\n RocksIterator iter = db.newIterator();\n\n for (iter.seekToFirst(); iter.isValid(); iter.next()) {\n System.out.println(new String(iter.key()) + \"\\t=\\t\" + ByteIntUtilities.convertByteArrayToDouble(iter.value()));\n }\n\n iter.close();\n }",
"public static void main(String[] args) throws IOException {\n\t\tString fname;\n\t\tFile file;\n\t\tScanner keyboard = new Scanner(System.in);\n\t\tScanner inFile;\n\n\t\tString line, word;\n\t\tStringTokenizer token;\n\t\tint[] freqTable = new int[256];\n\n\t\tSystem.out.println (\"Enter the complete path of the file to read from: \");\n\n\t\tfname = keyboard.nextLine();\n\t\tfile = new File(fname);\n\t\tinFile = new Scanner(file);\n\n\t\twhile (inFile.hasNext()) {\n\t\t\tline = inFile.nextLine();\n\t\t\ttoken = new StringTokenizer(line, \" \");\n\t\t\twhile (token.hasMoreTokens()) {\n\t\t\t\tword = token.nextToken();\n\t\t\t\tfreqTable = updateFrequencyTable(freqTable, word);\n\t\t\t}\n\t\t}\n\n\t\t//print frequency table\n\n\t\tSystem.out.println(\"Table of frequencies\");\n\t\tSystem.out.println(\"Character \\t Frequency \\n\");\n\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (freqTable[i]>0)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + freqTable[i]);\n\t\t\t}\n\n\t\tQueue<BinaryTree<Pair>> S = buildQueue(freqTable);\n\n\t\tQueue<BinaryTree<Pair>> T = new Queue<BinaryTree<Pair>>();\n\n\t\tBinaryTree<Pair> huffmanTree = createTree(S, T);\n\n\t\tString[] encodingTable = findEncoding(huffmanTree);\n\n\t\tSystem.out.println(\"Encoding Table\");\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (encodingTable[i]!=null)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + encodingTable[i]);\n\t\t}\n\t\tinFile.close();\n\t}",
"private void outputResults()\n{\n try {\n PrintWriter pw = new PrintWriter(new FileWriter(output_file));\n pw.println(total_documents);\n for (Map.Entry<String,Integer> ent : document_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n }\n pw.println(START_KGRAMS);\n pw.println(total_kdocuments);\n for (Map.Entry<String,Integer> ent : kgram_counts.entrySet()) {\n String wd = ent.getKey();\n int ct = ent.getValue();\n pw.println(ct + \" \" + wd);\n } \n pw.close();\n }\n catch (IOException e) {\n IvyLog.logE(\"SWIFT\",\"Problem generating output\",e);\n }\n}",
"public void printTable() {\n System.out.print(\"\\033[H\\033[2J\"); // Clear the text in console\n System.out.println(getCell(0, 0) + \"|\" + getCell(0, 1) + \"|\" + getCell(0, 2));\n System.out.println(\"-+-+-\");\n System.out.println(getCell(1, 0) + \"|\" + getCell(1, 1) + \"|\" + getCell(1, 2));\n System.out.println(\"-+-+-\");\n System.out.println(getCell(2, 0) + \"|\" + getCell(2, 1) + \"|\" + getCell(2, 2));\n }",
"public void printHourlyCounts()\n {\n System.out.println(\"Hr: Count\");\n for(int hour = 0; hour < hourCounts.length; hour++) {\n System.out.println(hour + \": \" + hourCounts[hour]);\n }\n }",
"public static void main(String [] args) throws IOException\n {\n System.out.println(\"PLAINTEXT FREQUENCY\");\n \n FrequencyAnalysis fa = new FrequencyAnalysis(); \n PrintWriter outFile1 = new PrintWriter (new File(\"plaintextfreq.txt\")); \n fa.readFile(\"plaintext.txt\"); \n int total1 = fa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile1.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n int l = 0;\n for (int k : fa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n outFile1.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total1) * 100));\n l++;\n }\n outFile1.close();\n \n System.out.println();\n System.out.println();\n System.out.println(\"CIPHER FREQUENCY\");\n \n FrequencyAnalysis cfa = new FrequencyAnalysis(); \n PrintWriter outFile2 = new PrintWriter (new File(\"ciphertextfreq.txt\")); \n cfa.readFile(\"ciphertext.txt\"); \n int total2 = cfa.getTotal();\n System.out.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n outFile2.printf(\"%-10s%11s%16s%n\", \"Letter\", \"Count\", \"Frequency\");\n l = 0;\n for (int k : cfa.getFrequency())\n {\n System.out.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n outFile2.printf(\"%-10s%10d%16.2f%n\", (char) (65 + l), k, (((double) k / total2) * 100));\n l++;\n }\n outFile2.close();\n \n \n }",
"public void printReport() {\n System.out.println(\"=== Product Report ===\");\n productNames.keySet().forEach(k -> {\n System.out.println(\"Name: \" + k + \"\\t\\tCount: \" + productCountMap.get(productNames.get(k)));\n });\n\n }",
"public static void main(String args[]) {\n int a = 0;\r\n int b = 0;\r\n int u = 0;\r\n\r\n //Declaring scanner object\r\n Scanner capture = new Scanner(System.in);\r\n System.out.println(\"How many input values [MAX: 30]?\");\r\n\r\n //Taking input\r\n int x = capture.nextInt();\r\n ArrayList<Integer> Digits = new ArrayList<>();\r\n System.out.println(\"Enter \" + x + \" numbers.\");\r\n\r\n //Declaring and initializing HashMap object\r\n HashMap<Integer, Integer> Occur = new HashMap<>();\r\n\r\n // Initialize Hashmap\r\n for(int i=0;i<10;i++){\r\n Occur.put(i,0);\r\n }\r\n\r\n\r\n\r\n\r\n int tmp = x;\r\n // Initialize ArrayList\r\n while(tmp>0){\r\n Digits.add(capture.nextInt());\r\n tmp--;\r\n }\r\n\r\n\r\n\r\n // ----------------------------\r\n while (b < x) {\r\n if (Occur.get(Digits.get(b)) != null) {\r\n int cnt = Occur.get(Digits.get(b)) + 1;\r\n Occur.put(Digits.get(b), cnt);\r\n }\r\n else {\r\n Occur.put(Digits.get(b), 1);\r\n }\r\n b++;\r\n }\r\n\r\n int height = 0;\r\n System.out.println(\"\\nNumber Occurrence\");\r\n\r\n height = 0;\r\n for(Map.Entry<Integer,Integer> entry : Occur.entrySet()){\r\n if(entry.getValue()>0){\r\n System.out.println(entry.getKey() + \" \" + entry.getValue());\r\n }\r\n if(entry.getValue()>height){\r\n height = entry.getValue();\r\n }\r\n }\r\n\r\n System.out.println(\"================= Vertical bar =================\");\r\n\r\n //Printing histogram\r\n int h = height;\r\n while ( h > 0) {\r\n\r\n System.out.print(\"| \"+h+\" | \");\r\n\r\n int g = 0;\r\n while (g < 10) {\r\n if(Occur.get(g) != null) {\r\n int kallen = Occur.get(g);\r\n if(kallen >= h)\r\n {\r\n System.out.print(\"* \");\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n }\r\n else\r\n {\r\n System.out.print(\" \");\r\n }\r\n g++;\r\n }\r\n System.out.print(\"\\n\");\r\n h--;\r\n }\r\n System.out.println(\"================================================\");\r\n System.out.print(\"| N |\");\r\n while ( u < 10 ) {\r\n System.out.print(\" \"+ u );\r\n u++;\r\n }\r\n System.out.println(\"\\n================================================\");\r\n }",
"private void printCfaStatistics(PrintStream out) {\n if (cfa != null) {\n int edges = 0;\n for (CFANode n : cfa.getAllNodes()) {\n edges += n.getNumEnteringEdges();\n }\n\n out.println(\"Number of program locations: \" + cfa.getAllNodes().size());\n out.println(\"Number of CFA edges: \" + edges);\n if (cfa.getVarClassification().isPresent()) {\n out.println(\"Number of relevant variables: \" + cfa.getVarClassification().get()\n .getRelevantVariables().size());\n }\n out.println(\"Number of functions: \" + cfa.getNumberOfFunctions());\n\n if (cfa.getLoopStructure().isPresent()) {\n int loops = cfa.getLoopStructure().get().getCount();\n out.println(\"Number of loops: \" + loops);\n }\n }\n }",
"public void printStatistics() {\n\t// Skriv statistiken samlad så här långt\n stats.print();\n }",
"public void display() {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(a[i] + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"private void print() {\n\t\tList<Entry<String, Double>> entries = sort();\n\t\tfor (Entry<String, Double> entry: entries) {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}",
"public static void printTimesTable(int tableSize) {\n System.out.format(\" \");\n for(int i = 1; i<=tableSize;i++ ) {\n System.out.format(\"%4d\",i);\n }\n System.out.println();\n System.out.println(\"--------------------------------------------------------\");\n\n for (int row = 1; row<=tableSize; row++){\n \n System.out.format(\"%4d\",row);\n System.out.print(\" |\");\n \n for (int column = 1; column<=tableSize; column++){\n System.out.format(\"%4d\",column*row);\n }\n System.out.print(\"\\n\");\n }\n\n }",
"private static void printFinedStudents(){\n\t\tSet<Integer> keys = FINED_STUDENTS.keySet(); //returns list of all keys in FINED_STUDENTS\n\t\tint count = 0;\n\t\tSystem.out.println(\"Fined Students are: \");\n\t\tfor(int k : keys){\n\t\t\tcount ++;\n\t\t\tSystem.out.println(count + \". \" + FINED_STUDENTS.get(k));\n\t\t}\n\t\t\n\t\tif(keys.size() == 0)\n\t\t\tSystem.out.println(\"Empty! No Students have been fined\");\n\t}",
"boolean hasFreq();",
"public void print_metrics(){\n\t\tHashMap<Integer, HashSet<Integer>> pairs=return_pairs();\n\t\tint total=gold.data.getTuples().size();\n\t\ttotal=total*(total-1)/2;\n\t\tSystem.out.println(\"Reduction Ratio is: \"+(1.0-(double) countHashMap(pairs)/total));\n\t\tint count=0;\n\t\tfor(int i:pairs.keySet())\n\t\t\tfor(int j:pairs.get(i))\n\t\t\tif(goldContains(i,j))\n\t\t\t\tcount++;\n\t\tSystem.out.println(\"Pairs Completeness is: \"+(double) count/gold.num_dups);\n\t}",
"public void print() {\n for (int i = 0; i < headers.length; i++) {\n System.out.printf(headers[i] + \", \"); // Print column headers.\n }\n System.out.printf(\"\\n\");\n for (int i = 0; i < (data.length - 1); i++) {\n for (int j = 0; j < data[i].length; j++) {\n System.out.printf(data[i][j] + \" \"); // Print value at i,j.\n }\n System.out.printf(\"\\n\");\n }\n }",
"@Override\n\tpublic String toString()\n\t{\n\t\tString sTr = this.str + \":\" + this.freq;\n\t\treturn sTr;\n\t}",
"public static void printTable(HashMap<String, ArrayList<double[]>> table) {\n for(String category: table.keySet()) {\n System.out.println(\"== Category: \" + category + \" ==\");\n\n for(double[] row: table.get(category)) {\n System.out.println(\" \" + category + \"_\" + table.get(category).indexOf(row) + \" \" + Arrays.toString(row));\n }\n }\n }",
"private void printTable() {\n System.out.println(\"COMPLETED SLR PARSE TABLE\");\n System.out.println(\"_________________________\");\n System.out.print(\"\\t|\");\n // print header\n for(int i = 0; i < pHeader.size(); i++) {\n pHeader.get(i);\n System.out.print(\"\\t\" + i + \"\\t|\");\n }\n System.out.println();\n // print body\n for(int i = 0; i < parseTable.size(); i++) {\n System.out.print(i + \"\\t|\");\n for(int j = 0; j < parseTable.get(i).size(); j++) {\n System.out.print(\"\\t\" + parseTable.get(i).get(j) + \"\\t|\");\n }\n System.out.println();\n }\n System.out.println();\n System.out.println(\"END OF SLR PARSE TABLE\");\n System.out.println();\n }",
"public void displayTimesTable(int table) {\n if (table >= TABLE_MIN && table <= TABLE_MAX) {\n System.out.println(table + \" times table:\");\n for (int i=1; i<=TABLE_MAX; ++i) {\n System.out.printf(\"%2d X %2d = %3d\\n\",\n i, table, timesTables[table][i]);\n } // close for\n } else\n System.out.println(table + \" is not between 1 and 12\");\n }",
"public void printTable(){ \r\n System.out.println( \"Auction ID | Bid | Seller | Buyer \"\r\n + \" | Time | Item Info\");\r\n System.out.println(\"===========================================\"\r\n + \"========================================================================\"\r\n + \"========================\");\r\n for(Auction auctions : values()){\r\n System.out.println(auctions.toString());\r\n } \r\n }",
"public String showHashTableStatus()\n\t {\n\t \t int index;\n\t \t int Empty = 0;\n\t \t int contCount = 0;\n\t \t int Min = tableSize;\n\t \t int Max = 0;\n\t \t String binOut = \"\";\n\t \t \n\t \t for(index = 0; index < tableSize; index++) \n\t \t {\n\t \t\t if(tableArray[index] == null) \n\t \t\t {\n\t \t\t\t binOut += \"N\";\n\t \t\t }\n\t \t\t else \n\t \t\t {\n\t \t\t\t binOut += \"D\";\n\t \t\t }\n\t \t }\n\t \t for(index = 0; index < tableSize; index++) \n\t \t {\n\t \t\t if(tableArray[index] != null) \n\t \t\t {\n\t \t\t\t contCount++;\n\t \t\t\t if(contCount > 0) \n\t \t\t\t {\n\t \t\t\t\t if(Max < contCount) \n\t \t\t\t\t {\n\t \t\t\t\t\t Max = contCount;\n\t \t\t\t\t }\n\t \t\t\t\t if(Min > contCount) \n\t \t\t\t\t {\n\t \t\t\t\t\t Min = contCount;\n\t \t\t\t\t }\n\t \t\t\t }\n\t \t\t }\n\t \t\t else \n\t \t\t {\n\t \t\t\t Empty++;\n\t \t\t\t contCount = 0;\n\t \t\t }\n\t \t }\t\t\t \n\t\t\t System.out.println(\"\\n\");\t\t\t \n\t\t\t System.out.println(\"Hash Table Status: \" + binOut);\n\t\t\t System.out.println(\"\\n\");\n\t\t\t System.out.println(\"\tMinimum Contiguous Bins: \" + Min);\t\t\t \n\t\t\t System.out.println(\"\tMaximum Contiguous Bins: \" + Max);\t\t\t \n\t\t\t System.out.println(\"\t\tNumber of empty bins: \" + Empty);\t\t \n\t\t\t System.out.println(\"\\n\");\n\t\t\t System.out.println(\"Array Dump:\");\n\t\t\t \n\t\t\t for(index = 0; index < tableSize; index++) \n\t\t\t {\n\t\t\t\t if(tableArray[index] == null) \n\t\t\t\t {\n\t\t\t\t\t System.out.println(\"null\");\n\t\t\t\t }\n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t\t System.out.println(tableArray[index].toString());\n\t\t\t\t }\n\t\t\t }\n\t\t\t return null;\t \n\t }",
"private static void drawHistogram(HashMap<String, Double> map) {\n\tdouble maximumRelativeFrequency = 0;\n\n\t//Find maximum relative frequency.\n\tfor (Entry<String, Double> entry : map.entrySet()) {\n\t if (maximumRelativeFrequency < entry.getValue()) {\n\t\tmaximumRelativeFrequency = entry.getValue();\n\t }\n\t}\n\n\tfor (Entry<String, Double> entry : map.entrySet()) {\n\t System.out.print(entry.getKey() + \": \");\n\t \n\t System.out.printf(\"%5.2f%% : \", entry.getValue()*100);\n\t \n\t //Scale histogram to largest relative frequency.\n\t int stars = (int)((entry.getValue() / maximumRelativeFrequency) * 70.0);\n\t for (int i = 0; i < stars; i++)\n\t {\n\t\tSystem.out.print(\"*\");\n\t }\n\t System.out.println();\n\t}\n }",
"public void outputBarChart() {\n System.out.println(\"Grade distribution\");\n\n // storage frequency of the grades in each interval 10 grades\n int[] frequency = new int[11];\n\n // for each grade, increment the frequency appropriates\n for (int grade : grades)\n ++frequency[grade / 10];\n\n // for each frequency of the grade, print bar on the chart\n for (int count =0; count < frequency.length; count++) {\n // generates output of the bar label (\"00-99: \", ..., \"90-99: \", \"100: \")\n if (count == 10)\n System.out.printf(\"%5d: \", 100);\n else\n System.out.printf(\"%02d-%02d: \", count * 10, count * 10 + 9);\n\n // prints the asterisk bar\n for (int stars =0; stars < frequency[count]; stars++)\n System.out.print(\"*\");\n\n System.out.println();\n }\n }",
"public static void printIDTable () {\n System.out.println(); \n System.out.println(\"Identifier Cross Reference Table\");\n System.out.println(\"--------------------------------\"); \n for(String key : idCRT.keySet()) {\n // if id string length is > 30,\n // replace excess characters with a '+' character\n if(key.length() > 30) {\n String temp = key.substring(0, 30);\n temp += \"+\";\n System.out.printf(\"%-30s\",temp); \n } else {\n System.out.printf(\"%-30s\",key);\n }\n // prints the line numbers, creating a new line\n // if number of line numbers exceeds 7\n int count = 0;\n for(Integer lno : idCRT.get(key)) {\n if(count == 7) {\n System.out.printf(\"\\n%30s\", \" \");\n count = 0;\n }\n System.out.printf(\"%6d\",lno);\n count++;\n }\n System.out.println();\n }\n }",
"public void printAll(){\n\t\tSystem.out.println(\"Single hits: \" + sin);\n\t\tSystem.out.println(\"Double hits: \" + doub);\n\t\tSystem.out.println(\"Triple hits: \" + trip);\n\t\tSystem.out.println(\"Homerun: \" + home);\n\t\tSystem.out.println(\"Times at bat: \" + atbat);\n\t\tSystem.out.println(\"Total hits: \" + hits);\n\t\tSystem.out.println(\"Baseball average: \" + average);\n\t}",
"private void printStatistics() throws IOException {\n\n\t\tSystem.out.println(\"*********************** \" + analyzer\n\t\t\t\t+ \" *********************************\");\n\n\t\tidxReader = DirectoryReader\n\t\t\t\t.open(FSDirectory.open(Paths.get(indexPath)));\n\n\t\tSystem.out.println(\"Total no. of document in the corpus: \"\n\t\t\t\t+ idxReader.maxDoc());\n\n\t\tTerms vocabulary = MultiFields.getTerms(idxReader, \"TEXT\");\n\n\t\tSystem.out.println(\"Number of terms in dictionary for TEXT field:\"\n\t\t\t\t+ vocabulary.size());\n\n\t\tSystem.out.println(\"Number of tokens for TEXT field:\"\n\t\t\t\t+ vocabulary.getSumTotalTermFreq());\n\n\t\tidxReader.close();\n\t}",
"private static void printStats()\r\n\t{\r\n\t\tSystem.out.println(\"Keywords found: \" + keywordHits);\r\n\t\tSystem.out.println(\"Links found: \" + SharedLink.getLinksFound());\r\n\t\tSystem.out.println(\"Pages found: \" + SharedPage.getPagesDownloaded());\r\n\t\tSystem.out.println(\"Failed downloads: \" + SharedPage.getFailedDownloads());\r\n\t\tSystem.out.println(\"Producers: \" + fetchers);\r\n\t\tSystem.out.println(\"Consumers: \" + parsers);\r\n\t}",
"public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }",
"public void print () \r\n\t{\r\n\t\tfor (int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\tif (index % 5 == 0) // print 5 columns\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\tSystem.out.print(array[index] + \"\\t\");\t// print next element\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"public void print() {\r\n this.table.printTable();\r\n }",
"public void printAll() {\n \tfor (int i = 0; i < Table.size(); i++) {\n \t\tList<T> data = Table.get(i);\n \t\tdata.placeIterator();\n \t\twhile (!data.offEnd()) {\n \t\t\tSystem.out.print(data.getIterator() + \"\\n\");\n \t\t\tdata.advanceIterator();\n \t\t}\n \t\t\n \t}\n }",
"public static void displayCount1(HashMap<String, Integer> bigramCount) throws IOException{\n\t\tString str=\"\";\n\n\t\t//display bigram Counts\n\t\tfor(String s:bigramCount.keySet()){\n\t\t\tstr+=s + \" \"+ String.valueOf(bigramCount.get(s))+\"\\n\";\n\t\t}\n\t\tstr+=\"\\n\";\n\t\twriter1.write(str);\n\t}",
"@Override\r\n\tpublic String toString() {\r\n\r\n\t\treturn String.format(\"%s (%d)\", getTagName(), getFreq());\r\n\t}",
"@Override\n\tpublic String toString() {\n\t\tStringBuilder buf = new StringBuilder();\n\t\t\n\t\tCIntMap termsFrequencies = null;\n\t\tfor( String tag : keySet()) {\n\t\t\tbuf.append(tag);\n\t\t\tbuf.append(\"\\n\");\n\t\t\ttermsFrequencies = get(tag);\n\t\t\tbuf.append(termsFrequencies);\n\t\t}\n\t\t\n\t\treturn buf.toString();\n\t}",
"public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}",
"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 printf(Output out) {\n\n for (int k=0; k<3; k++) {\n out.println(\"F[\" + k + \"]:\");\n for (int j=0; j<=m; j++) {\n for (int i=0; i<F[k].length; i++) {\n out.print(padLeft(formatScore(F[k][i][j]), 5));\n }\n out.println();\n }\n }\n }",
"public String toString() {\n\t\treturn this.getData().toLowerCase() + \": \" + this.frequency;\n\t}",
"public ComputeTermFrequencies() { super(); }",
"public void printString()\r\n\t{\r\n\t\t//print the column labels\r\n\t\tSystem.out.printf(\"%-20s %s\\n\", \"Word\", \"Occurrences [form: (Paragraph#, Line#)]\");\r\n\t\tSystem.out.printf(\"%-20s %s\\n\", \"----\", \"-----------\");\r\n\t\troot.printString();\r\n\t}",
"public void print_words_per_label_count() {\n\t\tSystem.out.println(\"SPORTS=\" + m_sports_word_count);\n\t\tSystem.out.println(\"BUSINESS=\" + m_business_word_count);\n\t}",
"public static void showFrequency(int[]ASCIIarray) {\n char letter = ' ';\n for(int i = 0; i < ASCIIarray.length;i++){\n if(ASCIIarray[i]>0){\n letter = (char)(i);\n System.out.println(\"The letter '\" + letter + \"' appeared \" + ASCIIarray[i] + \" times\");\n }\n }\n }",
"public void print() {\n\t\tint l = 0;\n\t\tSystem.out.println();\n\t\tfor (int v = 0; v < vertexList.length; v++) {\n\t\t\tSystem.out.print(vertexList[v].id);\n\t\t\tfor (Neighbor nbr = vertexList[v].adjList; nbr != null; nbr = nbr.next) {\n\t\t\t\tSystem.out.print(\" -> \" + vertexList[nbr.vertexNumber].id + \"(\"\n\t\t\t\t\t\t+ nbr.weight + \")\");\n\t\t\t\tl++;\n\t\t\t}\n\t\t\tSystem.out.println(\"\\n\");\n\t\t}\n\t\tSystem.out.println(\"Number of edges = \" + l / 2);\n\t}",
"@Override\n public String toString() {\n StringBuilder buf = new StringBuilder();\n for (int x = 0; x < numTopics; x++) {\n String v = dictionary != null\n ? vectorToSortedString(topicTermCounts.viewRow(x).normalize(1), dictionary)\n : topicTermCounts.viewRow(x).asFormatString();\n buf.append(v).append('\\n');\n }\n return buf.toString();\n }",
"public static void main(String[] args) throws IOException {\n\t\tint n = readInt(), m = readInt();\n\t\tint[] freq = new int[m+1];\n\t\tint total = 0;\n\t\tint count = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tint x = readInt();\n\t\t\tfreq[x]++;\n\t\t\tif (freq[x] == 1) {\n\t\t\t\ttotal++;\n\t\t\t}\n\t\t\tif (total == m) {\n\t\t\t\tcount++;\n\t\t\t\ttotal = 0;\n\t\t\t\tArrays.fill(freq, 0);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(count+1);\n\t}",
"@Override\r\n public String toString() {\n return this.name + \":\" + this.score + \":\" + this.freq;\r\n }",
"public static void printTable() {\n System.out.println(\"\\nMenu:\");\n System.out.println(\"(LR) - List All Recipients\");\n System.out.println(\"(LO) - List All Donors\");\n System.out.println(\"(AO) - Add New Donor\");\n System.out.println(\"(AR) - Add New Recipient\");\n System.out.println(\"(RO) - Remove Donor\");\n System.out.println(\"(RR) - Remove Recipient\");\n System.out.println(\"(SR) - Sort Recipients\");\n System.out.println(\"(SO) - Sort Donors\");\n System.out.println(\"(Q) - Quit\");\n }",
"boolean hasFrequency();",
"public void print(){\n\t\tfor (int i=0; i<_size; i++){\n\t\t\tSystem.out.print(_a[i].getKey()+\"; \");\n\t\t}\n\t\tSystem.out.println();\n\t}",
"private static void afftabSymb() { \r\n\t\tSystem.out.println(\" code categorie type info\");\r\n\t\tSystem.out.println(\" |--------------|--------------|-------|----\");\r\n\t\tfor (int i = 1; i <= it; i++) {\r\n\t\t\tif (i == bc) {\r\n\t\t\t\tSystem.out.print(\"bc=\");\r\n\t\t\t\tEcriture.ecrireInt(i, 3);\r\n\t\t\t} else if (i == it) {\r\n\t\t\t\tSystem.out.print(\"it=\");\r\n\t\t\t\tEcriture.ecrireInt(i, 3);\r\n\t\t\t} else\r\n\t\t\t\tEcriture.ecrireInt(i, 6);\r\n\t\t\tif (tabSymb[i] == null)\r\n\t\t\t\tSystem.out.println(\" référence NULL\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\" \" + tabSymb[i]);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"public void affichageGrille(){ \r\n for (int i = 0; i<N; i++){ \r\n for (int j = 0; j<N; j++) \r\n System.out.print(tab[i][j] + \" \"); \r\n System.out.println(); \r\n } \r\n System.out.println(); \r\n }",
"public static void main(String... args) {\n try{ //this makes it so that all the console output will be printed to a file\n //PrintStream out = new PrintStream(new FileOutputStream(WORD_COUNT_TABLE_FILE.toString()));\n //System.setOut(out);\n }\n catch (Exception e){\n e.printStackTrace();\n }\n\n long start = System.currentTimeMillis();\n\n\n\n Map<String, List<Integer>> allWords = new ConcurrentHashMap<>(); //the HashMap that will contain all the words and list of occurrences\n List<String> listOfFiles = getFilesFromDirectory(); //the list of files from the given folder\n List<Thread> threadList = new LinkedList<>();\n\n runWithThreads(allWords, listOfFiles, NUMBER_OF_THREADS);\n\n TreeMap<String, List<Integer>> sortedMap = new TreeMap<>(allWords);\n Set<Entry<String, List<Integer>>> sortedEntries = sortedMap.entrySet();\n\n long end = System.currentTimeMillis();\n\n System.out.print(Table.makeTable(sortedEntries, listOfFiles));\n System.out.println(\"\\nTime: \" + (end-start));\n\n\n\n }",
"private void printReport() {\n\t\t\tSystem.out.println(\"Processed \" + this.countItems + \" items:\");\n\t\t\tSystem.out.println(\" * Labels: \" + this.countLabels);\n\t\t\tSystem.out.println(\" * Descriptions: \" + this.countDescriptions);\n\t\t\tSystem.out.println(\" * Aliases: \" + this.countAliases);\n\t\t\tSystem.out.println(\" * Statements: \" + this.countStatements);\n\t\t\tSystem.out.println(\" * Site links: \" + this.countSiteLinks);\n\t\t}",
"private static void printTable(Game game) {\r\n\t\tint[][] table = game.getTable();\r\n\t\tint length = table.length;\r\n\t\tSystem.out.println(\"Current table:\");\r\n\t\tfor (int i = 0; i < length; i++) {\r\n\t\t\tfor (int j = 0; j < length - 1; j++)\r\n\t\t\t\tSystem.out.print(table[i][j] + \" \\t\");\r\n\t\t\tSystem.out.println(table[i][length - 1]);\r\n\t\t}\r\n\t}",
"private String histogram() {\n\t\tStringBuilder sb = new StringBuilder(\"[\");\n\t\t\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tint size = 0;\n\t\t\tfor (int j = 0; j < myBuckets.size(); j++) {\n\t\t\t\tif (myBuckets.get(j).size() == i) size++;\n\t\t\t}\n\t\t\tsb.append(size + \", \");\n\t\t}\n\t\tsb.replace(sb.length() - 2, sb.length(), \"]\");\n\t\treturn sb.toString();\n\t}"
] | [
"0.7427598",
"0.69193053",
"0.68235016",
"0.677892",
"0.67256546",
"0.6698665",
"0.66824526",
"0.6642107",
"0.65654916",
"0.6532455",
"0.65062106",
"0.64370567",
"0.6390312",
"0.6385118",
"0.63840544",
"0.6311059",
"0.6309815",
"0.62875915",
"0.6279179",
"0.62759227",
"0.6251656",
"0.6238529",
"0.6186852",
"0.6184246",
"0.6170461",
"0.6161342",
"0.61608183",
"0.6150498",
"0.6131035",
"0.6130531",
"0.6122328",
"0.6101765",
"0.609793",
"0.6060791",
"0.60548294",
"0.60316586",
"0.6029859",
"0.60214645",
"0.601493",
"0.60122496",
"0.6010562",
"0.600936",
"0.6006368",
"0.60023564",
"0.59970456",
"0.599054",
"0.59789944",
"0.5964421",
"0.5961267",
"0.5939622",
"0.59317243",
"0.5930347",
"0.59137714",
"0.5913395",
"0.5907833",
"0.5879738",
"0.58795524",
"0.58755785",
"0.58747995",
"0.5861385",
"0.5858066",
"0.58573824",
"0.585598",
"0.5851165",
"0.5844241",
"0.5821584",
"0.5819588",
"0.58176404",
"0.5811884",
"0.5798176",
"0.57965183",
"0.5787204",
"0.5779718",
"0.57787234",
"0.577686",
"0.57669735",
"0.5766333",
"0.57656497",
"0.5760466",
"0.5755765",
"0.57440543",
"0.5731812",
"0.573109",
"0.5729432",
"0.57291746",
"0.5726034",
"0.5714604",
"0.5708031",
"0.56986785",
"0.5697669",
"0.5697291",
"0.5695213",
"0.5692184",
"0.5687929",
"0.5686938",
"0.5683433",
"0.5677943",
"0.56770504",
"0.5675839",
"0.56747603"
] | 0.8124313 | 0 |
prints out the huffman code table | private void printCodeTable() {
System.out.println("\nPrinting the code table:");
for(int i = 0; i < codeTable.length; i++) {
if(codeTable[i] != null) {
if(i == 10) {
System.out.println("\\n " + codeTable[i]);
} else {
System.out.println(((char) i) + " " + codeTable[i]);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void displayHuffCodesTable() {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t\n\t\tfor (int i = 0; i < this.huffCodeVals.length; i++) {\n\t\t\t\n\t\t\tif (this.huffCodeVals[i] != null) {\n\t\t\t\tif (i == 9) {\n\t\t\t\t\ttoPrint.append(\"\\\\t\");\n\t\t\t\t\t\n\t\t\t\t} else if (i == 10) {\n\t\t\t\t\ttoPrint.append(\"\\\\n\");\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\ttoPrint.append((char) i);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttoPrint.append(\":\" + this.huffCodeVals[i] + \"\\n\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tSystem.out.println(toPrint.toString());\n\t}",
"private void HuffmanPrinter(HuffmanNode node, String s, PrintStream output) {\n if (node.left == null) {\n output.println((byte) node.getData());\n output.println(s);\n } else {\n HuffmanPrinter(node.left, s + 0, output);\n HuffmanPrinter(node.right, s + 1, output);\n }\n }",
"private static void generateHuffmanTree(){\n try (BufferedReader br = new BufferedReader(new FileReader(_codeTableFile))) {\n String line;\n while ((line = br.readLine()) != null) {\n // process the line.\n if(!line.isEmpty() && line!=null){\n int numberData = Integer.parseInt(line.split(\" \")[0]);\n String code = line.split(\" \")[1];\n Node traverser = root;\n for (int i = 0; i < code.length() - 1; i++){\n char c = code.charAt(i); \n if (c == '0'){\n //bit is 0\n if(traverser.getLeftPtr() == null){\n traverser.setLeftPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getLeftPtr();\n }\n else{\n //bit is 1\n if(traverser.getRightPtr() == null){\n traverser.setRightPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getRightPtr();\n }\n }\n //Put data in the last node by creating a new leafNode\n char c = code.charAt(code.length() - 1);\n if(c == '0'){\n traverser.setLeftPtr(new LeafNode(9999999, numberData, null, null));\n }\n else{\n traverser.setRightPtr(new LeafNode(9999999, numberData, null, null));\n }\n }\n }\n } \n catch (IOException ex) {\n Logger.getLogger(FrequencyTableBuilder.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public Hashtable<Character,Code> getHuffmanCodes(int numberOfCodes,Hashtable<String,Character> revCodes) throws IOException {\r\n\t\tbyte[] b;\r\n\t\tHashtable<Character,Code> codes = new Hashtable<>();\r\n\t\t for (int i = 0 ; i < numberOfCodes ; i++) {\r\n\t\t\t System.out.println(\"i = \" + i);\r\n\t\t\t // i create a stringBuilder that will hold the code for each character\r\n\t\t\t StringBuilder c = new StringBuilder();\r\n\t\t\t // read the integer (4 bytes)\r\n\t\t\t b = new byte[4];\r\n\t\t\t in.read(b);\r\n\t\t\t // will hold the 4 bytes\r\n\t\t\t int code = 0;\r\n\t\t\t \r\n\t\t\t /* beacuse we wrote the integer reversed in the head\r\n\t\t\t * so the first 2 bytes from the left will hold the huffman's code\r\n\t\t\t * we get the second one then stick it to the (code) value we shift it to the left \r\n\t\t\t * then we get the first one and stick it to the (code) without shifting it\r\n\t\t\t * so actually we swipe the first 2 bytes because they are reversed\r\n\t\t\t */\r\n\t\t\t code |= (b[1] & 0xFF);\r\n\t\t\t code <<= 8;\r\n\t\t\t code |= (b[0] & 0xFF);\r\n\t\t\t \r\n\t\t\t // this loop go throw the (code) n bits where n is the length of the huff code that stored in the 2nd index of the array\r\n\t\t\t for (int j = 0 ; j < (b[2] & 0xFF) ; j++) {\r\n\t\t\t\t /*\r\n\t\t\t\t * each loop we compare the first bit from the right using & operation ans if it 1 so insert 1 to he first of the (c) which hold the huff it self\r\n\t\t\t\t * and if it zero we will insert zero as a string for both zero or 1\r\n\t\t\t\t */\r\n\t\t\t\t if ((code & 1) == 1) {\r\n\t\t\t\t\t c.insert(0, \"1\");\r\n\t\t\t\t } else \r\n\t\t\t\t\t c.insert(0, \"0\");\r\n\t\t\t\t code >>>= 1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t// codes.put((char)(b[3] & 0xFF), new Code((char)(b[3] & 0xFF),c.toString(),rep2[b[0] & 0xFF]));\r\n\t\t\t System.out.println(\"c = \" + c);\r\n\t\t\t \r\n\t\t\t // we store the huff code as a key in the hash and its value will be the character that in the index 3\r\n\t\t\t revCodes.put(c.toString(), (char)(b[3] & 0xFF));\r\n\t\t\t \r\n\t\t }\r\n\t\t return codes;\r\n\t}",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tString input = \"\";\r\n\r\n\t\t//읽어올 파일 경로\r\n\t\tString filePath = \"C:/Users/user/Desktop/data13_huffman.txt\";\r\n\r\n\t\t//파일에서 읽어옴\r\n\t\ttry(FileInputStream fStream = new FileInputStream(filePath);){\r\n\t\t\tbyte[] readByte = new byte[fStream.available()];\r\n\t\t\twhile(fStream.read(readByte) != -1);\r\n\t\t\tfStream.close();\r\n\t\t\tinput = new String(readByte);\r\n\t\t}\r\n\r\n\t\t//빈도수 측정 해시맵 생성\r\n\t\tHashMap<Character, Integer> frequency = new HashMap<>();\r\n\t\t//최소힙 생성\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t//테이블 생성 해시맵\r\n\t\tHashMap<Character, String> table = new HashMap<>();\r\n\r\n\t\t//노드와 빈도수 측정\r\n\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\tif(frequency.containsKey(input.charAt(i))) {\r\n\t\t\t\t//이미 있는 값일 경우 빈도수를 1 증가\r\n\t\t\t\tchar currentChar = input.charAt(i);\r\n\t\t\t\tfrequency.put(currentChar, frequency.get(currentChar) + 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//키를 생성해서 넣어줌\r\n\t\t\t\tfrequency.put(input.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//최소 힙에 저장\r\n\t\tfor(Character key : frequency.keySet()) \r\n\t\t\tnodes.add(new Node(key, frequency.get(key), null, null));\r\n\t\t\t\t\r\n\t\t//최소힙으로 정렬\r\n\t\tbuildMinHeap(nodes);\r\n\r\n\t\t//huffman tree를 만드는 함수 실행\r\n\t\tNode resultNode = huffman(nodes);\r\n\r\n\t\t//파일에 씀 (table)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_table.txt\")){\r\n\t\t\tmakeTable(table, resultNode, \"\");\r\n\t\t\tfor(Character key : table.keySet()) {\r\n\t\t\t\t//System.out.println(key + \" : \" + table.get(key));\r\n\t\t\t\tfw.write(key + \" : \" + table.get(key) + \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//파일에 씀 (encoded code)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_encoded.txt\")){\r\n\t\t\tString allString = \"\";\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < input.length(); i++)\r\n\t\t\t\tallString += table.get(input.charAt(i));\r\n\r\n\t\t\t//System.out.println(allString);\r\n\t\t\tfw.write(allString);\r\n\t\t}\r\n\t}",
"public static void main(String[] args) {\n Huffman huffman=new Huffman(\"Shevchenko Vladimir Vladimirovich\");\n System.out.println(huffman.getCodeText());//\n //answer:110100001001101011000001001110111110110101100110110001001110101111100011101000011011000100111010111110001110100101110101111100000\n\n huffman.getSizeBits();//размер в битах\n ;//кол-во символов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*8)); //коэффициент сжатия относительно aski кодов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*\n (Math.pow(huffman.getValueOfCharactersOfText(),0.5)))); //коэффициент сжатия относительно равномерного кода. Не учитывается размер таблицы\n System.out.println(huffman.getMediumLenght());//средняя длина кодового слова\n System.out.println(huffman.getDisper());//дисперсия\n\n\n }",
"public void displayHuffCodefile() {\n\t\tStringBuffer toPrint = new StringBuffer();\n\t\t/*\n\t\t * Go through every line and print them with the codes\n\t\t */\n\t\tfor (char[] curLine : this.fileData) {\n\t\t\tfor (char c : curLine) {\n\t\t\t\ttoPrint.append(this.huffCodeVals[c]);\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * Keep taps on the number of newLines displayed. This ensures that we don't print a new\n\t\t\t * line code for the last line\n\t\t\t */\n\t\t\tif (this.frequencyCount[10] > 0) {\n\t\t\t\ttoPrint.append(huffCodeVals[10]);\n\t\t\t\tthis.frequencyCount[10]--;\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(toPrint.toString());\n\t}",
"void decode(){\n int bit = -1; // next bit from compressed file: 0 or 1. no more bit: -1\r\n int k = 0; // index to the Huffman tree array; k = 0 is the root of tree\r\n int n = 0; // number of symbols decoded, stop the while loop when n == filesize\r\n int numBits = 0; // number of bits in the compressed file\r\n FileOutputStream file = null;\r\n try {\r\n file = new FileOutputStream(\"uncompressed.txt\");\r\n } catch (FileNotFoundException ex) {\r\n System.err.println(\"Could not open file to write to.\");\r\n }\r\n while ((bit = inputBit()) >= 0){\r\n k = codetree[k][bit];\r\n numBits++;\r\n if (codetree[k][0] == 0){ // leaf\r\n try {\r\n file.write(codetree[k][1]);\r\n } catch (IOException ex) {\r\n System.err.println(\"Failed to write to file.\");\r\n }\r\n System.out.write(codetree[k][1]);\r\n if (n++ == filesize) break; // ignore any additional bits\r\n k = 0;\r\n }\r\n }\r\n System.out.printf(\"\\n\\n------------------------------\\n\" +\r\n \"%d bytes in uncompressed file.\\n\", filesize);\r\n System.out.printf(\"%d bytes in compressed file.\\n\", numBits / 8);\r\n System.out.printf(\"Compression ratio of %f.\", (double)numBits / (double)filesize);\r\n System.out.flush();\r\n }",
"@Override\r\n\tpublic void displayHashTable()\r\n\t{\r\n\t\tSystem.out.println(hm.toString());\r\n\t}",
"public int[] headCode(Hashtable<Character,Code> codes,int[] rep) {\r\n\t\t\r\n\t\tint count = 0;\r\n\t\tint counter = 0;\r\n\t\tfor (int i = 0 ; i < rep.length ; i++) \r\n\t\t\tif (rep[i] > 0)\r\n\t\t\t\tcount++;\r\n\t\tint[] headArr = new int[count]; // create integer array that will hold the integer value for the every character information \r\n\t\t\r\n\t\tfor (int i = 0 ; i < rep.length ; i++) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif (rep[i] > 0) {\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t\t\tint num = 0;\r\n\t\t\t\t\r\n\t\t\t\t//num |= codes.get((char)i).code.length();\r\n\t\t\t\t\r\n\t\t\t\tString c = codes.get((char)i).code; // get huffman code for the character from hash table which is O(1)\r\n\t\t\t\tSystem.out.println(c + \" \" + c.length());\r\n\t\t\t\tfor (int j = 0 ; j < c.length() ; j++) {\r\n\t\t\t\t\tnum <<= 1; // shift the integer by 1 bit to the left\r\n\t\t\t\t\tif (c.charAt(j) == '1') {\r\n\t\t\t\t\t\tnum |= 1; // make or operation for each digit of the huffman code with num that will contains the information\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnum |= 0; \r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tint ch = i; \r\n\t\t\t\tch <<= 24; // shift character value 24 bit to the left so that it will be in the first byte to the left of the integer\r\n\t\t\t\tint l = c.length();\r\n\t\t\t\tl <<= 16; // shift the length of huffman code 16 bit to the left so that it will be in the second byte to the left of the integer\r\n\t\t\t\tnum |= ch; // make or operation that will put the value of character to the fisrt byte of the integer\r\n\t\t\t\tnum |= l; // make of operation that will put the calue of huffman code to the second byte of the integer\r\n\t\t\t\t\r\n\t\t\t\t/*\r\n\t\t\t\t * integer representation >> 00000000000000000000000000000000\r\n\t\t\t\t * my representation >>\t ccccccccllllllllhhhhhhhhhhhhhhhh\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(num);\r\n\t\t\t\theadArr[counter++] = num;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn headArr;\r\n\t\t\r\n\t}",
"public void encodeData() {\n frequencyTable = new FrequencyTableBuilder(inputPath).buildFrequencyTable();\n huffmanTree = new Tree(new HuffmanTreeBuilder(new FrequencyTableBuilder(inputPath).buildFrequencyTable()).buildTree());\n codeTable = new CodeTableBuilder(huffmanTree).buildCodeTable();\n encodeMessage();\n print();\n }",
"public static void displayHashTable() {\n\t\t\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------\");\n\t\t\n\t\t// Traverse hash table and print out values by index\n\t\tfor (int i = 0; i < sizeHashTable; i++) {\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(\"Index \" + i + \"---> \");\n\t\t\tbst.inorderTraversalPrint(hashTable[i]);\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.print(\"Here is a list of all the elements, sorted by index and inorder traversal: \");\n\n\t\t// Print out all of the values in one line\n\t\tfor (int i = 0; i < sizeHashTable; i++) {\n\t\t\tbst.inorderTraversalPrint(hashTable[i]);\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println();\n\t}",
"public void HuffmanCode()\n {\n String text=message;\n /* Count the frequency of each character in the string */\n //if the character does not exist in the list add it\n for(int i=0;i<text.length();i++)\n {\n if(!(c.contains(text.charAt(i))))\n c.add(text.charAt(i));\n } \n int[] freq=new int[c.size()];\n //counting the frequency of each character in the text\n for(int i=0;i<c.size();i++)\n for(int j=0;j<text.length();j++)\n if(c.get(i)==text.charAt(j))\n freq[i]++;\n /* Build the huffman tree */\n \n root= buildTree(freq); \n \n }",
"public static String huffmanCoder(String inputFileName, String outputFileName){\n File inputFile = new File(inputFileName+\".txt\");\n File outputFile = new File(outputFileName+\".txt\");\n File encodedFile = new File(\"encodedTable.txt\");\n File savingFile = new File(\"Saving.txt\");\n HuffmanCompressor run = new HuffmanCompressor();\n \n run.buildHuffmanList(inputFile);\n run.makeTree();\n run.encodeTree();\n run.computeSaving(inputFile,outputFile);\n run.printEncodedTable(encodedFile);\n run.printSaving(savingFile);\n return \"Done!\";\n }",
"public void printCode(PrintStream out, String code, BinaryTree<HuffData> tree) {\n HuffData theData = tree.getData(); //Get the data of the tree\n if (theData.symbol != null) { //If the data's symbol is not null (as in a symbol and not a sum)\n if(theData.symbol.equals(\" \")) { //If the symbol is a space print out \"space: \"\n out.println(\"space: \" + code);\n } else { //Otherwise print out the symbol and the code\n out.println(theData.symbol + \" \" + code);\n //Then add the symbol and code to the EncodeData table\n this.encodings[encodingsTop++] = new EncodeData(code, theData.symbol);\n }\n } else {\n //If the data's symbol is null, that means it is a sum node\n //and so it needs to go farther down the tree\n \n //Go down the left tree and add a 0\n printCode(out, code + \"0\", tree.getLeftSubtree());\n //Go down the right tree and add a 1\n printCode(out, code + \"1\", tree.getRightSubtree());\n }\n }",
"public void print(){\n for (int i = 0; i < hashTable.length; i++){\n if (hashTable[i] != null){\n LLNodeHash ptr = hashTable[i];\n while (ptr.getNext() != null){\n System.out.print(\"(\" + ptr.getKey() + \", \" + ptr.getFreq() + \")\");\n ptr = ptr.getNext();\n }\n System.out.print(\"(\" + ptr.getKey() + \", \" + ptr.getFreq() + \")\");\n }\n }\n }",
"private void printFrequencyTable() {\n System.out.println(\"\\nPrinting the frequency table:\");\n while(!frequencyTable.isEmpty()) {\n frequencyTable.remove().printNode();\n }\n }",
"public void printEncodedTable(File encodedFile){\n clearFile(encodedFile);\n try{\n BufferedWriter output = new BufferedWriter(new FileWriter(encodedFile,true));\n for(Map.Entry<Character,String> entry : encodedTable.entrySet()){\n Character c = entry.getKey();\n if(c >= 32 && c < 127)\n output.write(entry.getKey()+\": \"+entry.getValue());\n else\n output.write(\" [0x\" + Integer.toOctalString(c) + \"]\"+\": \"+entry.getValue());\n output.write(\"\\n\");\n }\n output.close();\n }catch(IOException e){\n System.out.println(\"IOException\");\n }\n }",
"public static void HuffmanTree(String input, String output) throws Exception {\n\t\tFileReader inputFile = new FileReader(input);\n\t\tArrayList<HuffmanNode> tree = new ArrayList<HuffmanNode>(200);\n\t\tchar current;\n\t\t\n\t\t// loops through the file and creates the nodes containing all present characters and frequencies\n\t\twhile((current = (char)(inputFile.read())) != (char)-1) {\n\t\t\tint search = 0;\n\t\t\tboolean found = false;\n\t\t\twhile(search < tree.size() && found != true) {\n\t\t\t\tif(tree.get(search).inChar == (char)current) {\n\t\t\t\t\ttree.get(search).frequency++; \n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tsearch++;\n\t\t\t}\n\t\t\tif(found == false) {\n\t\t\t\ttree.add(new HuffmanNode(current));\n\t\t\t}\n\t\t}\n\t\tinputFile.close();\n\t\t\n\t\t//creates the huffman tree\n\t\tcreateTree(tree);\n\t\t\n\t\t//the huffman tree\n\t\tHuffmanNode sortedTree = tree.get(0);\n\t\t\n\t\t//prints out the statistics of the input file and the space saved\n\t\tFileWriter newVersion = new FileWriter(\"C:\\\\Users\\\\Chris\\\\workspace\\\\P2\\\\src\\\\P2_cxt240_Tsuei_statistics.txt\");\n\t\tprintTree(sortedTree, \"\", newVersion);\n\t\tspaceSaver(newVersion);\n\t\tnewVersion.close();\n\t\t\n\t\t// codes the file using huffman encoding\n\t\tFileWriter outputFile = new FileWriter(output);\n\t\ttranslate(input, outputFile);\n\t}",
"public String showHashTableStatus()\n\t {\n\t \t int index;\n\t \t int Empty = 0;\n\t \t int contCount = 0;\n\t \t int Min = tableSize;\n\t \t int Max = 0;\n\t \t String binOut = \"\";\n\t \t \n\t \t for(index = 0; index < tableSize; index++) \n\t \t {\n\t \t\t if(tableArray[index] == null) \n\t \t\t {\n\t \t\t\t binOut += \"N\";\n\t \t\t }\n\t \t\t else \n\t \t\t {\n\t \t\t\t binOut += \"D\";\n\t \t\t }\n\t \t }\n\t \t for(index = 0; index < tableSize; index++) \n\t \t {\n\t \t\t if(tableArray[index] != null) \n\t \t\t {\n\t \t\t\t contCount++;\n\t \t\t\t if(contCount > 0) \n\t \t\t\t {\n\t \t\t\t\t if(Max < contCount) \n\t \t\t\t\t {\n\t \t\t\t\t\t Max = contCount;\n\t \t\t\t\t }\n\t \t\t\t\t if(Min > contCount) \n\t \t\t\t\t {\n\t \t\t\t\t\t Min = contCount;\n\t \t\t\t\t }\n\t \t\t\t }\n\t \t\t }\n\t \t\t else \n\t \t\t {\n\t \t\t\t Empty++;\n\t \t\t\t contCount = 0;\n\t \t\t }\n\t \t }\t\t\t \n\t\t\t System.out.println(\"\\n\");\t\t\t \n\t\t\t System.out.println(\"Hash Table Status: \" + binOut);\n\t\t\t System.out.println(\"\\n\");\n\t\t\t System.out.println(\"\tMinimum Contiguous Bins: \" + Min);\t\t\t \n\t\t\t System.out.println(\"\tMaximum Contiguous Bins: \" + Max);\t\t\t \n\t\t\t System.out.println(\"\t\tNumber of empty bins: \" + Empty);\t\t \n\t\t\t System.out.println(\"\\n\");\n\t\t\t System.out.println(\"Array Dump:\");\n\t\t\t \n\t\t\t for(index = 0; index < tableSize; index++) \n\t\t\t {\n\t\t\t\t if(tableArray[index] == null) \n\t\t\t\t {\n\t\t\t\t\t System.out.println(\"null\");\n\t\t\t\t }\n\t\t\t\t else \n\t\t\t\t {\n\t\t\t\t\t System.out.println(tableArray[index].toString());\n\t\t\t\t }\n\t\t\t }\n\t\t\t return null;\t \n\t }",
"public void printTable() {\r\n System.out.println(frame+\") \");\r\n for (int y = 0; y < table.length; y++) {\r\n System.out.println(Arrays.toString(table[y]));\r\n }\r\n frame++;\r\n }",
"private void buildOutput()\n\t{\n\t\tif(outIndex >= output.length)\n\t\t{\n\t\t\tbyte[] temp = output;\n\t\t\toutput = new byte[temp.length * 2];\n\t\t\tSystem.arraycopy(temp, 0, output, 0, temp.length);\n\t\t}\n\t\t\n\t\tif(sb.length() < 16 && aryIndex < fileArray.length)\n\t\t{\n\t\t\tbyte[] b = new byte[1];\n\t\t\tb[0] = fileArray[aryIndex++];\n\t\t\tsb.append(toBinary(b));\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < prioQ.size(); i++)\n\t\t{\n\t\t\tif(sb.toString().startsWith(prioQ.get(i).getCode()))\n\t\t\t{\n\t\t\t\toutput[outIndex++] = (byte)prioQ.get(i).getByteData();\n\t\t\t\tsb = new StringBuilder(\n\t\t\t\t\t\tsb.substring(prioQ.get(i).getCode().length()));\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Can't find Huffman code.\");\n\t\tSystem.exit(1);\n\t\texit = true;\n\t}",
"public void buildHuffmanList(File inputFile){\n try{\n Scanner sc = new Scanner(inputFile);\n while(sc.hasNextLine()){\n\n String line = sc.nextLine();\n for(int i =0;i<line.length();i++){\n \n if(freqTable.isEmpty())\n freqTable.put(line.charAt(i),1);\n else{\n if(freqTable.containsKey(line.charAt(i)) == false)\n freqTable.put(line.charAt(i),1);\n else{\n int oldValue = freqTable.get(line.charAt(i));\n freqTable.replace(line.charAt(i),oldValue+1);\n }\n }\n }\n }\n }\n catch(FileNotFoundException e){\n System.out.println(\"Can't find the file\");\n }\n }",
"public void run() {\n\n\t\tScanner s = new Scanner(System.in); // A scanner to scan the file per\n\t\t\t\t\t\t\t\t\t\t\t// character\n\t\ttype = s.next(); // The type specifies our wanted output\n\t\ts.nextLine(); \n\n\t\t// STEP 1: Count how many times each character appears.\n\t\tthis.charFrequencyCount(s);\n\n\t\t/*\n\t\t * Type F only wants the frequency. Display it, and we're done (so\n\t\t * return)\n\t\t */\n\t\tif (type.equals(\"F\")) {\n\t\t\tdisplayFrequency(frequencyCount);\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * STEP 2: we want to make our final tree (used to get the direction\n\t\t * values) This entails loading up the priority queue and using it to\n\t\t * build the tree.\n\t\t */\n\t\tloadInitQueue();\n\t\tthis.finalHuffmanTree = this.buildHuffTree();\n\t\t\n\t\t/*\n\t\t * Type T wants a level order display of the Tree. Do so, and we're done\n\t\t * (so return)\n\t\t */\n\t\tif (type.equals(\"T\")) {\n\t\t\tthis.finalHuffmanTree.visitLevelOrder(new HuffmanVisitorForTypeT());\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * STEP 3: We want the Huffman code values for the characters.\n\t\t * The Huffman codes are specified by the path (directions) from the root.\n\t\t * \n\t\t * Each node in the tree has a path to get to it from the root. The\n\t\t * leaves are especially important because they are the original\n\t\t * characters scanned. Load every node with it's special direction value\n\t\t * (the method saves the original character Huffman codes, the direction\n\t\t * vals).\n\t\t */\n\t\tthis.loadDirectionValues(this.finalHuffmanTree.root);\n\t\t// Type H simply wants the codes... display them and we're done (so\n\t\t// return)\n\t\tif (type.equals(\"H\")) {\n\t\t\tthis.displayHuffCodesTable();\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * STEP 4: The Type must be M (unless there was invalid input) since all other cases were exhausted, so now we simply display the file using\n\t\t * the Huffman codes.\n\t\t */\n\t\tthis.displayHuffCodefile();\n\t}",
"private void outputBuildTableFunction(PrintWriter out) {\n\t\t\n\t\tout.println(\" private void buildTable() {\");\n\t\t\n\t\tout.println(\" GrammarState[] graph;\");\n\t\t\n\t\tfor (String rulename : grammardef.getTable().keySet()) {\n\t\t\t\n\t\t\tout.println(\" table.put(\\\"\" + rulename + \"\\\", new HashMap<String, GrammarRule>());\");\n\t\t\t\n\t\t\tfor (String tokname : grammardef.getTable().get(rulename).keySet()) {\n\t\t\t\t\n\t\t\t\tGrammarRule rule = grammardef.getTable().get(rulename).get(tokname);\n\t\t\t\t\n\t\t\t\tString multi = rule.isMultiChild() ? \"true\" : \"false\";\n\t\t\t\tString sub = rule.isSubrule() ? \"true\" : \"false\";\n\t\t\t\t\n\t\t\t\tint i = 0;\n\t\t\t\tout.println(\" graph = new GrammarState[\" + rule.getGraph().size() + \"];\");\n\t\t\t\tfor (GrammarState state : rule.getGraph()) {\n\t\t\t\t\tout.println(\" graph[\" + (i++) + \"] = new GrammarState(\\\"\" + state.name + \"\\\", \" + state.type + \");\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tout.println(\" table.get(\\\"\" + rulename + \"\\\").put(\\\"\" + tokname + \"\\\", new GrammarRule(\\\"\" + rule.getName() + \"\\\", \" + multi + \", \" + sub + \", graph));\");\n\t\t\t\tout.println();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tout.println(\" }\");\n\t\t\n\t}",
"public void print() {\n \tfor (int i=0; i < this.table.height; i++) {\n \t\tfor (int j=0; j < this.table.width; j++) {\n \t\t\tString tmp = \"e\";\n \t\t\tif(this.table.field[i][j].head != null) {\n \t\t\t\ttmp = \"\";\n \t\t\t\tswitch (this.table.field[i][j].head.direction) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ttmp+=\"^\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ttmp+=\">\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ttmp+=\"V\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\ttmp+=\"<\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\telse if(this.table.field[i][j].obj != null) {\n \t\t\t\ttmp = this.table.field[i][j].obj.name;\n \t\t\t}\n \t\t\tSystem.out.print(\" \" + tmp);\n \t\t}\n \t\t\tSystem.out.println(\"\");\n \t}\n }",
"@Override\r\n\tpublic String toString() {\r\n\t\tIterator<HuffmanPair> temp;\r\n\t\tString result = \"\";\r\n\t\ttemp = super.iteratorPreOrder();\r\n\t\twhile (temp.hasNext()) {\r\n\t\t\tresult += temp.next().toString();\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public void translate(BitInputStream input, PrintStream output) {\n HuffmanNode node = this.front;\n while (input.hasNextBit()) {\n while (node.left != null && node.right != null) {\n if (input.nextBit() == 0) {\n node = node.left;\n } else {\n node = node.right;\n }\n }\n output.print(node.getData());\n node = this.front;\n }\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tMap<Character, Integer> frequencyMap = new HashMap<>();\n\t\tint textLength = text.length();\n\n\t\tfor (int i = 0; i < textLength; i++) {\n\t\t\tchar character = text.charAt(i);\n\t\t\tif (!frequencyMap.containsKey(character)) {\n\t\t\t\tfrequencyMap.put(character, 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint newFreq = frequencyMap.get(character) + 1;\n\t\t\t\tfrequencyMap.replace(character, newFreq);\n\t\t\t}\n\t\t}\n\n\t\tPriorityQueue<Node> queue = new PriorityQueue<>();\n\n\t\tIterator iterator = frequencyMap.entrySet().iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry<Character, Integer> pair = (Map.Entry<Character, Integer>) iterator.next();\n\t\t\tNode node = new Node(null, null, pair.getKey(), pair.getValue());\n\t\t\tqueue.add(node);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tNode node1 = queue.poll();\n\t\t\tNode node2 = queue.poll();\n\t\t\tNode parent = new Node(node1, node2, '\\t', node1.getFrequency() + node2.getFrequency());\n\t\t\tqueue.add(parent);\n\t\t}\n\t\thuffmanTree = queue.poll();\n\t\tSystem.out.println(\"firstNode: \"+ huffmanTree);\n\t\tcodeTable(huffmanTree);\n\n\t\t//Iterator iterator1 = encodingTable.entrySet().iterator();\n\n\t\t/*\n\t\twhile (iterator1.hasNext()) {\n\t\t\tMap.Entry<Character, String> pair = (Map.Entry<Character, String>) iterator1.next();\n\t\t\tSystem.out.println(pair.getKey() + \" : \" + pair.getValue() + \"\\n\");\n\t\t}\n\t\t*/\n\n\t\t//System.out.println(\"Hashmap.size() : \" + frequencyMap.size());\n\n\t}",
"public static void main(String args[])\n {\n Scanner s = new Scanner(System.in).useDelimiter(\"\");\n List<node> freq = new SinglyLinkedList<node>();\n \n // read data from input\n while (s.hasNext())\n {\n // s.next() returns string; we're interested in first char\n char c = s.next().charAt(0);\n if (c == '\\n') continue;\n // look up character in frequency list\n node query = new node(c);\n node item = freq.remove(query);\n if (item == null)\n { // not found, add new node\n freq.addFirst(query);\n } else { // found, increment node\n item.frequency++;\n freq.addFirst(item);\n }\n }\n \n // insert each character into a Huffman tree\n OrderedList<huffmanTree> trees = new OrderedList<huffmanTree>();\n for (node n : freq)\n {\n trees.add(new huffmanTree(n));\n }\n \n // merge trees in pairs until one remains\n Iterator ti = trees.iterator();\n while (trees.size() > 1)\n {\n // construct a new iterator\n ti = trees.iterator();\n // grab two smallest values\n huffmanTree smallest = (huffmanTree)ti.next();\n huffmanTree small = (huffmanTree)ti.next();\n // remove them\n trees.remove(smallest);\n trees.remove(small);\n // add bigger tree containing both\n trees.add(new huffmanTree(smallest,small));\n }\n // print only tree in list\n ti = trees.iterator();\n Assert.condition(ti.hasNext(),\"Huffman tree exists.\");\n huffmanTree encoding = (huffmanTree)ti.next();\n encoding.print();\n }",
"public void printTable() {\n System.out.print(\"\\033[H\\033[2J\"); // Clear the text in console\n System.out.println(getCell(0, 0) + \"|\" + getCell(0, 1) + \"|\" + getCell(0, 2));\n System.out.println(\"-+-+-\");\n System.out.println(getCell(1, 0) + \"|\" + getCell(1, 1) + \"|\" + getCell(1, 2));\n System.out.println(\"-+-+-\");\n System.out.println(getCell(2, 0) + \"|\" + getCell(2, 1) + \"|\" + getCell(2, 2));\n }",
"public void printHashTable()\n\t\t\t{\n\t\t\t\tfor (int i = 0; i < bucketSize; i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.print(\"Hash Bucket: \" + i + \": \");\n\n\t\t\t\t\t\tNode current = bucketList[i];\n\n\t\t\t\t\t\twhile (current.getNext() != null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tSystem.out.print(current.getData() + \" \");\n\t\t\t\t\t\t\t\tcurrent = current.getNext();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSystem.out.println(current.getData());\n\t\t\t\t\t}\n\t\t\t}",
"public static void main(String[] args){\n huffmanCoder(args[0],args[1]);\n }",
"static void printTable(int pow) {\n\t\tint res = 1;\n\t\tfor (int i=1; i<=pow; i++) {\n\t\t\tres = res * 2; // 2 is the base\n\t\t\tSystem.out.println(res);\n\t\t}\n\t}",
"private static void printTree(HuffmanNode tree, String direction, FileWriter newVersion) throws IOException {\n\t\tif(tree.inChar != null) {\n\t\t\tnewVersion.write(tree.inChar + \": \" + direction + \" | \" + tree.frequency + System.getProperty(\"line.separator\"));\n\t\t\tresults[resultIndex][0] = tree.inChar;\n\t\t\tresults[resultIndex][1] = direction;\n\t\t\tresults[resultIndex][2] = tree.frequency;\n\t\t\tresultIndex++;\n\t\t}\n\t\telse {\n\t\t\tprintTree(tree.right, direction + \"1\", newVersion);\n\t\t\tprintTree(tree.left, direction + \"0\", newVersion);\n\t\t}\n\t}",
"public void makeTree(){\n //convert Hashmap into charList\n for(Map.Entry<Character,Integer> entry : freqTable.entrySet()){\n HuffmanNode newNode = new HuffmanNode(entry.getKey(),entry.getValue());\n charList.add(newNode);\n }\n \n if(charList.size()==0)\n return;\n \n if(charList.size()==1){\n HuffmanNode onlyNode = charList.get(0);\n root = new HuffmanNode(null,onlyNode.getFrequency());\n root.setLeft(onlyNode);\n return;\n }\n \n Sort heap = new Sort(charList);\n heap.heapSort();\n \n while(heap.size()>1){\n \n HuffmanNode leftNode = heap.remove(0);\n HuffmanNode rightNode = heap.remove(0);\n \n HuffmanNode newNode = merge(leftNode,rightNode);\n heap.insert(newNode);\n heap.heapSort();\n }\n \n charList = heap.getList();\n root = charList.get(0);\n }",
"@Override\n public void display(boolean ascending) {\n Node temp;\n\n for (int x = 0; x < hashTable.length; x++) {\n System.out.println(\"Index: \" + x);\n if ((temp = hashTable[x]) == null) {\n System.out.println(\"This index is empty\");\n } else {\n while (temp != null) {\n System.out.println(temp.getState().toString());\n temp = temp.getNext();\n }\n }\n System.out.println(\" \");\n }\n }",
"private void printTable() {\n System.out.println(\"COMPLETED SLR PARSE TABLE\");\n System.out.println(\"_________________________\");\n System.out.print(\"\\t|\");\n // print header\n for(int i = 0; i < pHeader.size(); i++) {\n pHeader.get(i);\n System.out.print(\"\\t\" + i + \"\\t|\");\n }\n System.out.println();\n // print body\n for(int i = 0; i < parseTable.size(); i++) {\n System.out.print(i + \"\\t|\");\n for(int j = 0; j < parseTable.get(i).size(); j++) {\n System.out.print(\"\\t\" + parseTable.get(i).get(j) + \"\\t|\");\n }\n System.out.println();\n }\n System.out.println();\n System.out.println(\"END OF SLR PARSE TABLE\");\n System.out.println();\n }",
"void print() {\n\n\t\t// Print \"Sym Table\"\n\t\tSystem.out.print(\"\\nSym Table\\n\");\n\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tHashMap<String, Sym> M = list.get(i);\n\t\t\t// Print each HashMap in list\n\t\t\tSystem.out.print(String.format(M.toString() + \"\\n\"));\n\t\t}\n\n\t\t// Print New Line\n\t\tSystem.out.println();\n\t}",
"public static Node make_huffmann_tree(List li){\n //Sorting list in increasing order of its letter frequency \n li.sort(new comp());\n Node temp=null;\n Iterator it=li.iterator();\n //System.out.println(li.size());\n //Loop for making huffman tree till only single node remains in list\n while(true){\n temp=new Node();\n //a and b are Node which are to be combine to make its parent\n Node a=new Node(),b=new Node();\n a=null;b=null;\n //checking if list is eligible for combining or not\n //here first assignment of it.next in a will always be true as list till end will\n //must have atleast one node\n a=(Node)it.next();\n //Below condition is to check either list has 2nd node or not to combine \n //If this condition will be false, then it means construction of huffman tree is completed\n if(it.hasNext()){b=(Node)it.next();}\n //Combining first two smallest nodes in list to make its parent whose frequncy \n //will be equals to sum of frequency of these two nodes \n if(b!=null){\n temp.freq=a.freq+b.freq;a.data=0;b.data=1;//assigining 0 and 1 to left and right nodes\n temp.left=a;temp.right=b;\n //after combing, removing first two nodes in list which are already combined\n li.remove(0);//removes first element which is now combined -step1\n li.remove(0);//removes 2nd element which comes on 1st position after deleting first in step1\n li.add(temp);//adding new combined node to list\n //print_list(li); //For visualizing each combination step\n }\n //Sorting after combining to again repeat above on sorted frequency list\n li.sort(new comp()); \n it=li.iterator();//resetting list pointer to first node (head/root of tree)\n if(li.size()==1){return (Node)it.next();} //base condition ,returning root of huffman tree \n }\n}",
"public static void main(String[] args) throws IOException {\n\t\tString fname;\n\t\tFile file;\n\t\tScanner keyboard = new Scanner(System.in);\n\t\tScanner inFile;\n\n\t\tString line, word;\n\t\tStringTokenizer token;\n\t\tint[] freqTable = new int[256];\n\n\t\tSystem.out.println (\"Enter the complete path of the file to read from: \");\n\n\t\tfname = keyboard.nextLine();\n\t\tfile = new File(fname);\n\t\tinFile = new Scanner(file);\n\n\t\twhile (inFile.hasNext()) {\n\t\t\tline = inFile.nextLine();\n\t\t\ttoken = new StringTokenizer(line, \" \");\n\t\t\twhile (token.hasMoreTokens()) {\n\t\t\t\tword = token.nextToken();\n\t\t\t\tfreqTable = updateFrequencyTable(freqTable, word);\n\t\t\t}\n\t\t}\n\n\t\t//print frequency table\n\n\t\tSystem.out.println(\"Table of frequencies\");\n\t\tSystem.out.println(\"Character \\t Frequency \\n\");\n\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (freqTable[i]>0)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + freqTable[i]);\n\t\t\t}\n\n\t\tQueue<BinaryTree<Pair>> S = buildQueue(freqTable);\n\n\t\tQueue<BinaryTree<Pair>> T = new Queue<BinaryTree<Pair>>();\n\n\t\tBinaryTree<Pair> huffmanTree = createTree(S, T);\n\n\t\tString[] encodingTable = findEncoding(huffmanTree);\n\n\t\tSystem.out.println(\"Encoding Table\");\n\t\tfor(int i=0; i<256; i++) {\n\t\t\tif (encodingTable[i]!=null)\n\t\t\t\tSystem.out.println(((char)i) + \"\\t\" + encodingTable[i]);\n\t\t}\n\t\tinFile.close();\n\t}",
"public String printBFSTree(){\n if(root==null)return \"\";\n String binstr=\"\";\n String valuestr=\"\";\n String codestr=\"\";\n LinkedList<HCNode> list=new LinkedList<HCNode>();\n root.code=\"\";\n list.add(root);\n HCNode node;\n while(list.size()>0){\n node=list.getFirst();\n if(node.left==null && node.right==null){\n binstr=binstr+\"0\";\n valuestr=valuestr+((byte)node.str.charAt(0))+\"\\n\";\n codestr=codestr+node.code;\n }else{\n binstr=binstr+\"1\";\n }\n if(node.left!=null){node.left.code=node.left.parent.code+\"0\";list.addLast(node.left);}\n if(node.right!=null){node.right.code=node.right.parent.code+\"1\";list.addLast(node.right);}\n list.removeFirst();\n }\n String res=binstr+\"\\n\"+valuestr+codestr+\"\\n\";\n System.out.println(binstr);\n System.out.print(valuestr);\n System.out.println(codestr);\n return res;\n }",
"public static void printEncoding(String[] encodings, int[] freqNums){\n int saveSpace = 0;\n //loops through all characters to print encodings and calculate savings\n for(int i = 0; i < encodings.length; i++) {\n if (freqNums[i] != 0) {\n System.out.println(\"'\" + (char)(i+32) + \"'\" + \": \" + freqNums[i] + \": \" + encodings[i]);\n saveSpace = saveSpace + (8 - encodings[i].length())*freqNums[i];\n }\n }\n System.out.println();\n System.out.println(\"You will save \" + saveSpace + \" bits with the Huffman Compressor\");\n }",
"public void print() {\n for (int i = 0; i < table.length; i++) {\n System.out.printf(\"%d: \", i);\n \n HashMapEntry<K, V> temp = table[i];\n while (temp != null) {\n System.out.print(\"(\" + temp.key + \", \" + temp.value + \")\");\n \n if (temp.next != null) {\n System.out.print(\" --> \");\n }\n temp = temp.next;\n }\n \n System.out.println();\n }\n }",
"public void print() {\n System.out.println();\n for (int level = 0; level < 4; level++) {\n System.out.print(\" Z = \" + level + \" \");\n }\n System.out.println();\n for (int row = 3; row >= 0; row--) {\n for (int level = 0; level < 4; level++) {\n for (int column = 0; column < 4; column++) {\n System.out.print(get(column, row, level));\n System.out.print(\" \");\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n System.out.println();\n }",
"public static void main(String[] args) {\n int[] freqNums = scanFile(args[0]);\n HuffmanNode[] nodeArr = createNodes(freqNums);\n nodeArr = freqSort(nodeArr);\n HuffmanNode top = createTree(nodeArr);\n String empty = \"\";\n String[] encodings = new String[94];\n encodings = getCodes(top, empty, false, encodings, true);\n printEncoding(encodings, freqNums);\n writeFile(args[0], args[1], encodings);\n }",
"public void save(PrintStream output) {\n HuffmanPrinter(this.front, \"\", output);\n }",
"private void printCodeProcedure(String code, BinaryTreeInterface<HuffmanData> tree) {\n\t\t\t\tif (tree == null) {\n\n\t\t\t\t} else {\n\t\t\t\t\tprintCodeProcedure(code + \"0\", tree.getLeftSubtree());\n\t\t\t\t\tprintCodeProcedure(code + \"1\", tree.getRightSubtree());\n\t\t\t\t\tif (tree.getRootData().getSymbol() != '\\u0000') {\n\t\t\t\t\t\tSystem.out.println(tree.getRootData().getSymbol() + \": \" + code);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t}",
"public void dumpTable() {\n Enumeration elements = table.elements();\n while (elements.hasMoreElements()){\n SymbolTableEntry printEntry = (SymbolTableEntry) elements.nextElement();\n printName(printEntry);\n }\n }",
"private static void printTable(Game game) {\r\n\t\tint[][] table = game.getTable();\r\n\t\tint length = table.length;\r\n\t\tSystem.out.println(\"Current table:\");\r\n\t\tfor (int i = 0; i < length; i++) {\r\n\t\t\tfor (int j = 0; j < length - 1; j++)\r\n\t\t\t\tSystem.out.print(table[i][j] + \" \\t\");\r\n\t\t\tSystem.out.println(table[i][length - 1]);\r\n\t\t}\r\n\t}",
"static public void printTable(int list[][])\r\n\t{\r\n\t\tfor(int i = 0; i < h; i++)\r\n\t\t{\r\n\t\t\tfor(int j = 0; j < w; j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(list[i][j] + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t}\r\n\t}",
"private void buildTable(HuffmanNode root) {\r\n \tpostorder(root, \"\");\r\n }",
"@Override\r\n public void run() {\n File huffmanFolder = newDirectoryEncodedFiles(file, encodedFilesDirectoryName);\r\n File huffmanTextFile = new File(huffmanFolder.getPath() + \"\\\\text.huff\");\r\n File huffmanTreeFile = new File(huffmanFolder.getPath() + \"\\\\tree.huff\");\r\n\r\n\r\n try (FileOutputStream textCodeOS = new FileOutputStream(huffmanTextFile);\r\n FileOutputStream treeCodeOS = new FileOutputStream(huffmanTreeFile)) {\r\n\r\n\r\n// Writing text bits to file text.huff\r\n StringBuilder byteStr;\r\n while (boolQueue.size() > 0 | !boolRead) {\r\n while (boolQueue.size() > 8) {\r\n byteStr = new StringBuilder();\r\n\r\n for (int i = 0; i < 8; i++) {\r\n String s = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(s);\r\n }\r\n\r\n if (isInterrupted())\r\n break;\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n\r\n if (fileRead && boolQueue.size() > 0) {\r\n lastBitsCount = boolQueue.size();\r\n byteStr = new StringBuilder();\r\n for (int i = 0; i < lastBitsCount; i++) {\r\n String bitStr = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(bitStr);\r\n }\r\n\r\n for (int i = 0; i < 8 - lastBitsCount; i++) {\r\n byteStr.append(\"0\");\r\n }\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n }\r\n\r\n\r\n// Writing the info for decoding to tree.huff\r\n// Writing last bits count to tree.huff\r\n treeCodeOS.write((byte)lastBitsCount);\r\n\r\n// Writing info for Huffman tree to tree.huff\r\n StringBuilder treeBitsArray = new StringBuilder();\r\n treeBitsArray.append(\r\n parser.parseByteToBinaryString(\r\n (byte) codesMap.size()));\r\n\r\n codesMap.keySet().forEach(key -> {\r\n String keyBits = parser.parseByteToBinaryString((byte) (char) key);\r\n String valCountBits = parser.parseByteToBinaryString((byte) codesMap.get(key).length());\r\n\r\n treeBitsArray.append(keyBits);\r\n treeBitsArray.append(valCountBits);\r\n treeBitsArray.append(codesMap.get(key));\r\n });\r\n if ((treeBitsArray.length() / 8) != 0) {\r\n int lastBitsCount = boolQueue.size() / 8;\r\n for (int i = 0; i < 7 - lastBitsCount; i++) {\r\n treeBitsArray.append(\"0\");\r\n }\r\n }\r\n\r\n for (int i = 0; i < treeBitsArray.length() / 8; i++) {\r\n treeCodeOS.write(parser.parseStringToByte(\r\n treeBitsArray.substring(8 * i, 8 * (i + 1))));\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"private static void afftabSymb() { \r\n\t\tSystem.out.println(\" code categorie type info\");\r\n\t\tSystem.out.println(\" |--------------|--------------|-------|----\");\r\n\t\tfor (int i = 1; i <= it; i++) {\r\n\t\t\tif (i == bc) {\r\n\t\t\t\tSystem.out.print(\"bc=\");\r\n\t\t\t\tEcriture.ecrireInt(i, 3);\r\n\t\t\t} else if (i == it) {\r\n\t\t\t\tSystem.out.print(\"it=\");\r\n\t\t\t\tEcriture.ecrireInt(i, 3);\r\n\t\t\t} else\r\n\t\t\t\tEcriture.ecrireInt(i, 6);\r\n\t\t\tif (tabSymb[i] == null)\r\n\t\t\t\tSystem.out.println(\" référence NULL\");\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\" \" + tabSymb[i]);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}",
"@Test\n public void testGetTabla() {\n System.out.println(\"getTabla\");\n Huffman instance = null;\n byte[][] expResult = null;\n byte[][] result = instance.getTabla();\n \n // TODO review the generated test code and remove the default call to fail.\n \n }",
"public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}",
"public static void main(String[] args)\n {\n\t\t\tHuffman tree= new Huffman();\n \t \t Scanner sc=new Scanner(System.in);\n\t\t\tnoOfFrequencies=sc.nextInt();\n\t\t\t// It adds all the user input values in the tree.\n\t\t\tfor(int i=1;i<=noOfFrequencies;i++)\n\t\t\t{\n\t\t\t\tString temp=sc.next();\n\t\t\t\ttree.add(temp,sc.next());\n\t\t\t}\n\t\tint lengthToDecode=sc.nextInt();\n\t\tString encodedValue=sc.next();\n\t\t// This statement decodes the encoded values.\n\t\ttree.getDecodedMessage(encodedValue);\n\t\tSystem.out.println();\n\t\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\ttextArray = text.toCharArray();\n\n\t\tPriorityQueue<Leaf> queue = new PriorityQueue<>(new Comparator<Leaf>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Leaf a, Leaf b) {\n\t\t\t\tif (a.frequency > b.frequency) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (a.frequency < b.frequency) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor (char c : textArray) {\n\t\t\tif (chars.containsKey(c)) {\n\t\t\t\tint freq = chars.get(c);\n\t\t\t\tfreq = freq + 1;\n\t\t\t\tchars.remove(c);\n\t\t\t\tchars.put(c, freq);\n\t\t\t} else {\n\t\t\t\tchars.put(c, 1);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"tree print\");\t\t\t\t\t\t\t\t// print method begin\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tint freq = chars.get(c);\n\t\t\tSystem.out.println(c + \" \" + freq);\n\t\t}\n\n\t\tint total = 0;\n\t\tfor(char c : chars.keySet()){\n\t\t\ttotal = total + chars.get(c);\n\t\t}\n\t\tSystem.out.println(\"total \" + total);\t\t\t\t\t\t\t// ends\n\n\t\tfor (char c : chars.keySet()) {\n\t\t\tLeaf l = new Leaf(c, chars.get(c), null, null);\n\t\t\tqueue.offer(l);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tLeaf a = queue.poll();\n\t\t\tLeaf b = queue.poll();\n\n\t\t\tint frequency = a.frequency + b.frequency;\n\n\t\t\tLeaf leaf = new Leaf('\\0', frequency, a, b);\n\n\t\t\tqueue.offer(leaf);\n\t\t}\n\n\t\tif(queue.size() == 1){\n\t\t\tthis.root = queue.peek();\n\t\t}\n\t}",
"public LinkedList<BST> readHeader() {\n\t\tLinkedList<BST> leaves = new LinkedList<>();\n\t\n\t\tint codesProcessed;\t\t//Number of look-up items added to tree\n\n\t\t/*\n\t\t * Basic check: does header start with SOH byte?\n\t\t */\n\t\tgrabBits(8);\n\t\tif (!proc.equals(\"00000001\")) {\n\t\t\tSystem.out.println(\"File is corrupted or not compressed\");\n\t\t\treturn null;\n\t\t}\n\t\tSystem.out.println(proc);\n\t\tclear();\n\n\t\t/*\n\t\t * Determine number of codes to process.\n\t\t * Offset by +2 to allow for 257 unique codes.\n\t\t */\n\t\tgrabBits(8);\n\t\tint numCodes = Integer.parseInt(proc, 2) + 2;\n\t\tSystem.out.println(proc);\n\t\tclear();\n\n\t\t/*\n\t\t * Process look-up codes, reading NULL byte first\n\t\t */\n\t\tfor (int i = 0; i < numCodes; i++) {\n\t\t\t/* Get bitstring character code */\n\t\t\tif (i == 0) {\n\t\t\t\tgrabBits(4);\t//Null byte\n\t\t\t} else {\n\t\t\t\tgrabBits(8);\t//Regular byte\n\t\t\t}\n\t\t\tString bitstring = proc;\n\t\t\tSystem.out.print(bitstring + \"\\t\");\n\t\t\tclear();\n\n\t\t\t/* Get Huffman code length */\n\t\t\tgrabBits(8);\n\t\t\tint length = Integer.parseInt(proc, 2);\n\t\t\tSystem.out.print(length + \"\\t\");\n\t\t\tclear();\n\n\t\t\t/* Get Huffman code */\n\t\t\tgrabBits(length);\n\t\t\tString code = proc;\n\t\t\tSystem.out.println(code);\n\t\t\tclear();\n\n\t\t\t/* Build BST leaf for letter */\n\t\t\tBST leaf = new BST();\n\t\t\tBits symbol = new Bits(bitstring);\n\t\t\tsymbol.setCode(code);\n\t\t\tleaf.update(symbol);\n\t\t\tleaves.add(leaf);\n\t\t}\n\n\t\t/*\n\t\t * Does header end with STX byte?\n\t\t */\n\t\tgrabBits(8);\n\t\tif (!proc.equals(\"00000010\")) {\n\t\t\tSystem.out.println(\"Header corrupt: end of header without STX\");\n\t\t\treturn null;\n\t\t}\n\t\tclear();\n\n\t\treturn leaves;\n\t}",
"public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}",
"public void printBoard() {\nString xAxis[] = {\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\"};\n\t\tfor(int k = 0; k <8; k++) {\n\t\t\tSystem.out.print(\"\\t\" + xAxis[k]);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\tfor(int i = 0; i<8;i++) {\n\t\t\tSystem.out.print((i + 1) + \"\\t\");\n\t\t\tfor(int j = 0; j<8;j++) {\n\t\t\t\tSystem.out.print(board.getBoard()[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tfor(int k = 0; k <8; k++) {\n\t\t\tSystem.out.print(\"\\t\" + xAxis[k]);\n\t\t}\n\t\tSystem.out.println();\n\t}",
"public void print(){\n\t\tfor (int i = 0; i < numRows; i++) {\n\t\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"private static void printMenu() {\n\t\tchar select, select1;\n\t\tBinaryTree tree = null, upDated = null;\n\t\tString data;\n\t\tString haku;\n\t\t\n\t\ttree = new BinaryTree(\"juurisolmu\");\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehti\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehti1\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehti2\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehti3\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"l1\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"l12\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"l123\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"l1234\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehtipuuuuuuuu\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehtipuuuuuuuuu\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehtipuuuuuuuuuu\"));\n\t\ttree.findWithPreOrder(new BinaryTree(\"lehtipuuuuuuuuuuu\"));\n\t\tdo {\n\n\t\t\tSystem.out.println(\"\\n\\t\\t\\t1. Luo juurisolmu.\");\n\t\t\tSystem.out.println(\"\\t\\t\\t2. Päivitä uusi solmu.\");\n\t\t\tSystem.out.println(\"\\t\\t\\t3. Käy puu läpi esijärjestyksessä.\");\n\t\t\tSystem.out.println(\"\\t\\t\\t4. Etsi solmu.\");\n\t\t\tSystem.out.println(\"\\t\\t\\t5. Poista solmu.\");\n\t\t\tSystem.out.println(\"\\t\\t\\t6. Jaoittelu haku.\");\n\t\t\tSystem.out.println(\"\\t\\t\\t7. lopetus \");\n\t\t\tSystem.out.print(\"\\n\\n\"); // tehdään tyhjiä rivejä\n\t\t\tselect = Lue.merkki();\n\t\t\tswitch (select) {\n\t\t\tcase '1':\n\t\t\t\tSystem.out.println(\"Anna juuren sisältö (merkkijono)\");\n\t\t\t\tdata = new String(Lue.rivi());\n\t\t\t\ttree = new BinaryTree(data);\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\tif (tree == null)\n\t\t\t\t\tSystem.out.println(\"Et ole muodostanut juurisolmua.\");\n\t\t\t\telse {\n\t\t\t\t\tSystem.out.println(\"Anna solmun sisältö (merkkijono)\");\n\t\t\t\t\tBinaryTree newTree = new BinaryTree(new String(Lue.rivi()));\n\t\t\t\t\ttree.findWithPreOrder(newTree);\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t\ttree.preOrder();\n\t\t\t\tchar h = Lue.merkki(); // pysäytetään kontrolli\n\t\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\tSystem.out.println(\"Anna haettavan solmun sisältö (merkkijono)\");\n\t\t\t\thaku = Lue.rivi();\n\t\t\t\ttree.setNotFound();\n\t\t\t\tif (tree.findOrder(haku)) {\n\t\t\t\t\tSystem.out.println(tree.getFound());\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Ei löydy.\");\n\t\t\t\t\tSystem.out.println(tree.getFound());\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t\tSystem.out.println(\"Anna poistettavan solmun sisältö (merkkijono)\");\n\t\t\t\tString poisto = Lue.rivi();\n\t\t\t\tupDated = tree.findOrderDelete(poisto);\n\t\t\t\tif (upDated != null) {\n\t\t\t\t\tSystem.out.println(\"Solu poistettu.\");\n\t\t\t\t\tif (upDated.getRoot().left() != null) {\n\t\t\t\t\t\ttree.findWithPreOrder(upDated.getRoot().left());\n\t\t\t\t\t}\n\n\t\t\t\t\tif (upDated.getRoot().right() != null) {\n\t\t\t\t\t\ttree.findWithPreOrder(upDated.getRoot().right());\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Solua ei löydy.\");\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t\tSystem.out.println(\"Anna haettavan solmun sisältö (merkkijono)\");\n\t\t\t\thaku = Lue.rivi();\n\t\t\t\ttree.setNotFound();\n\t\t\t\tif (tree.searchWithPreOrder(haku)) {\n\t\t\t\t\tSystem.out.println(tree.getFound());\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Ei löydy.\");\n\t\t\t\t\tSystem.out.println(tree.getFound());\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase '7':\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} while (select != '7');\n\t}",
"public static void main(String[] args) throws IOException {\n\n HuffmanTree huffman = null;\n int value;\n String inputString = null, codedString = null;\n\n while (true) {\n System.out.print(\"Enter first letter of \");\n System.out.print(\"enter, show, code, or decode: \");\n int choice = getChar();\n switch (choice) {\n case 'e':\n System.out.println(\"Enter text lines, terminate with $\");\n inputString = getText();\n printAdjustedInputString(inputString);\n huffman = new HuffmanTree(inputString);\n printFrequencyTable(huffman.frequencyTable);\n break;\n case 's':\n if (inputString == null)\n System.out.println(\"Please enter string first\");\n else\n huffman.encodingTree.displayTree();\n break;\n case 'c':\n if (inputString == null)\n System.out.println(\"Please enter string first\");\n else {\n codedString = huffman.encodeAll(inputString);\n System.out.println(\"Code:\\t\" + codedString);\n }\n break;\n case 'd':\n if (inputString == null)\n System.out.println(\"Please enter string first\");\n else if (codedString == null)\n System.out.println(\"Please enter 'c' for code first\");\n else {\n System.out.println(\"Decoded:\\t\" + huffman.decode(codedString));\n }\n break;\n default:\n System.out.print(\"Invalid entry\\n\");\n }\n }\n }",
"public static void main(String[] args) throws IOException {\n BufferedReader buffRead = new BufferedReader(new FileReader(\"/home/hsnavarro/IdeaProjects/Aula 1/src/input\"));\n FileOutputStream output = new FileOutputStream(\"src/output\", true);\n String s = \"\";\n s = buffRead.readLine().toLowerCase();\n System.out.println(s);\n CifraCesar c = new CifraCesar(0, s, true);\n c.getInfo();\n int[] freq = new int[26];\n for (int i = 0; i < 26; ++i) freq[i] = 0;\n for (int i = 0; i < c.criptografada.length(); i++) {\n freq[c.criptografada.charAt(i) - 97]++;\n }\n Huffman h = new Huffman(freq, c.criptografada);\n h.printHuffman();\n h.descriptografiaHuffman();\n System.out.println(\"huffman: \" + h.descriptoHuffman);\n CifraCesar d = new CifraCesar(h.criptoAnalisis(), h.descriptoHuffman, false);\n\n System.out.println(d.descriptografada);\n System.out.println(d.descriptografada);\n\n System.out.println(\"Comparando:\");\n System.out.println(\"Antes da compressão:\" + s.length());\n\n byte inp = 0;\n int cnt = 0;\n for (int i = 0; i < h.criptografada.length(); i++) {\n int idx = i % 8;\n if (h.criptografada.charAt(i) == '1') inp += (1 << (7 - idx));\n if (idx == 7) {\n cnt++;\n output.write(inp);\n inp = 0;\n }\n }\n if(h.criptografada.length() % 8 != 0){\n cnt++;\n output.write(inp);\n }\n System.out.println(\"Depois da compressão:\" + cnt);\n buffRead.close();\n output.close();\n }",
"public void display() {\n\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t\n\t\tfor (byte r = (byte) (b.length - 1); r >= 0; r--) {\n\t\t\tSystem.out.print(r + 1);\n\t\t\t\n\t\t\tfor (byte c = 0; c < b[r].length; c++) {\n\t\t\t\tSystem.out.print(\" | \" + b[r][c]);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\" |\");\n\t\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" a b c d e f g h\");\n\t}",
"public void outDisTable()\n\t{\n\t\tfor(int i = 0; i < sqNum; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < sqNum; j++)\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"%-18s\", \"[\" + i + \",\" + j + \"]:\" + String.format(\" %.8f\", dm[i][j]));\n\t\t\t}\n\t\t\tSystem.out.print(\"\\r\\n\");\n\t\t}\n\t}",
"public void printHand(){\n System.out.println();\n for(int i = 1 ; i <= 6; i++){\n for(int j = 0 ; j < hand.size(); j++){\n if(j == hand.size()-1){\n System.out.print(hand.get(j).fullRowString(i));\n }\n else{\n System.out.print(hand.get(j).halfRowString(i));\n }\n }\n System.out.println();\n }\n System.out.println();\n for(int k = 0; k < hand.size() ; k++){\n if(k >= 10){\n System.out.print(\" \" + (k+1) + \" \");\n }\n else{\n System.out.print(\" \" + (k+1) + \" \");\n }\n }\n System.out.println();\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tif (text.length() <= 1)\n\t\t\treturn;\n\n\t\t//Create a the frequency huffman table\n\t\tHashMap<Character, huffmanNode> countsMap = new HashMap<>();\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar c = text.charAt(i);\n\t\t\tif (countsMap.containsKey(c))\n\t\t\t\tcountsMap.get(c).huffmanFrequency++;\n\t\t\telse\n\t\t\t\tcountsMap.put(c, new huffmanNode(c, 1));\n\t\t}\n\n\t\t//Build the frequency tree\n\t\tPriorityQueue<huffmanNode> countQueue = new PriorityQueue<>(countsMap.values());\n\t\twhile (countQueue.size() > 1) {\n\t\t\thuffmanNode left = countQueue.poll();\n\t\t\thuffmanNode right = countQueue.poll();\n\t\t\thuffmanNode parent = new huffmanNode('\\0', left.huffmanFrequency + right.huffmanFrequency);\n\t\t\tparent.leftNode = left;\n\t\t\tparent.rightNode = right;\n\n\t\t\tcountQueue.offer(parent);\n\t\t}\n\n\t\thuffmanNode rootNode = countQueue.poll();\n\n\t\t//Assign the codes to each node in the tree\n\t\tStack<huffmanNode> huffmanNodeStack = new Stack<>();\n\t\thuffmanNodeStack.add(rootNode);\n\t\twhile (!huffmanNodeStack.empty()) {\n\t\t\thuffmanNode huffmanNode = huffmanNodeStack.pop();\n\n\t\t\tif (huffmanNode.huffmanValue != '\\0') {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\thuffmanNode.codeRecord.forEach(sb::append);\n\t\t\t\tString codeSb = sb.toString();\n\n\t\t\t\tencodingTable.put(huffmanNode.huffmanValue, codeSb);\n\t\t\t\tdecodingTable.put(codeSb, huffmanNode.huffmanValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\thuffmanNode.leftNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.leftNode.codeRecord.add('0');\n\t\t\t\thuffmanNode.rightNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.rightNode.codeRecord.add('1');\n\t\t\t}\n\n\t\t\tif (huffmanNode.leftNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.leftNode);\n\n\t\t\tif (huffmanNode.rightNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.rightNode);\n\t\t}\n\t}",
"public static void printTree(Node head) {\r\n System.out.println(\"Binary Tree:\");\r\n printInOrder(head, 0, \"H\", 17);\r\n System.out.println();\r\n }",
"int HuffmanCode(int table_select, int x, int y ) {\n\t\tint signx = 0, signy = 0, linbitsx, linbitsy, linbits, xlen, ylen, idx;\n\n\t\tcbits = 0;\n\t\txbits = 0;\n\t\tcode = 0;\n\t\text = 0;\n\n\t\tif(table_select==0) return 0;\n\n\t\t// signx = (x > 0)? 0: 1;\n\t\t// signy = (y > 0)? 0: 1;\n\t\t//x = Math.abs( x );\n\t\t//y = Math.abs( y );\n\n\t\tif(x < 0) {x = -x; signx = 1;}\n\t\tif(y < 0) {y = -y; signy = 1;}\n\n\t\txlen = this.xlen[table_select];\n\t\tylen = this.ylen[table_select];\n\t\tlinbits = this.linbits[table_select];\n\t\tlinbitsx = linbitsy = 0;\n\n\t\tif ( table_select > 15 ) { /* ESC-table is used */\n\t\t\tif ( x > 14 ) {\n\t\t\t\tlinbitsx = x - 15;\n\t\t\t\tx = 15;\n\t\t\t}\n\t\t\tif ( y > 14 ) {\n\t\t\t\tlinbitsy = y - 15;\n\t\t\t\ty = 15;\n\t\t\t}\n\n\t\t\tidx = (x * ylen) + y;\n\t\t\tcode = table[table_select][idx];\n\t\t\tcbits = hlen [table_select][idx];\n\t\t\tif ( x > 14 ) {\n\t\t\t\text |= linbitsx;\n\t\t\t\txbits += linbits;\n\t\t\t}\n\t\t\tif ( x != 0 ) {\n\t\t\t\text <<= 1;\n\t\t\t\text |= signx;\n\t\t\t\txbits += 1;\n\t\t\t}\n\t\t\tif ( y > 14 ) {\n\t\t\t\text <<= linbits;\n\t\t\t\text |= linbitsy;\n\t\t\t\txbits += linbits;\n\t\t\t}\n\t\t\tif ( y != 0 ) {\n\t\t\t\text <<= 1;\n\t\t\t\text |= signy;\n\t\t\t\txbits += 1;\n\t\t\t}\n\t\t} else { /* No ESC-words */\n\t\t\tidx = (x * ylen) + y;\n\t\t\tcode = table[table_select][idx];\n\t\t\tcbits += hlen[table_select][ idx ];\n\n\t\t\tif ( x != 0 ) {\n\t\t\t\tcode <<= 1;\n\t\t\t\tcode |= signx;\n\t\t\t\tcbits ++;\n\t\t\t}\n\t\t\tif ( y != 0 ) {\n\t\t\t\tcode <<= 1;\n\t\t\t\tcode |= signy;\n\t\t\t\tcbits ++;\n\t\t\t}\n\t\t}\n\n\t\treturn cbits + xbits;\n\t}",
"@Test\r\n public void testEncode() throws Exception {\r\n System.out.println(\"encode\");\r\n String message = \"furkan\";\r\n \r\n HuffmanTree Htree = new HuffmanTree();\r\n\r\n HuffmanTree.HuffData[] symbols = {\r\n new HuffmanTree.HuffData(186, '_'),\r\n new HuffmanTree.HuffData(103, 'e'),\r\n new HuffmanTree.HuffData(80, 't'),\r\n new HuffmanTree.HuffData(64, 'a'),\r\n new HuffmanTree.HuffData(63, 'o'),\r\n new HuffmanTree.HuffData(57, 'i'),\r\n new HuffmanTree.HuffData(57, 'n'),\r\n new HuffmanTree.HuffData(51, 's'),\r\n new HuffmanTree.HuffData(48, 'r'),\r\n new HuffmanTree.HuffData(47, 'h'),\r\n new HuffmanTree.HuffData(32, 'b'),\r\n new HuffmanTree.HuffData(32, 'l'),\r\n new HuffmanTree.HuffData(23, 'u'),\r\n new HuffmanTree.HuffData(22, 'c'),\r\n new HuffmanTree.HuffData(21, 'f'),\r\n new HuffmanTree.HuffData(20, 'm'),\r\n new HuffmanTree.HuffData(18, 'w'),\r\n new HuffmanTree.HuffData(16, 'y'),\r\n new HuffmanTree.HuffData(15, 'g'),\r\n new HuffmanTree.HuffData(15, 'p'),\r\n new HuffmanTree.HuffData(13, 'd'),\r\n new HuffmanTree.HuffData(8, 'v'),\r\n new HuffmanTree.HuffData(5, 'k'),\r\n new HuffmanTree.HuffData(1, 'j'),\r\n new HuffmanTree.HuffData(1, 'q'),\r\n new HuffmanTree.HuffData(1, 'x'),\r\n new HuffmanTree.HuffData(1, 'z')\r\n };\r\n\r\n Htree.buildTree(symbols);\r\n \r\n String expResult = \"1100110000100101100001110100111\";\r\n String result = Htree.encode(message, Htree.huffTree);\r\n \r\n assertEquals(expResult, result);\r\n \r\n }",
"public void displayHashTable(HashTable2 hTable){\n\t\t\n\t\tSystem.out.println(\"Index \" + \"Value\");\n\t\tfor(int i=0; i < hTable.theArray.length; i++){\n\t\t\t\n\t\t\tSystem.out.println(\" \" + i + \" ==> \" + hTable.theArray[i] );\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void\nprintHir( String pHeader );",
"public static void main(String[] args)\n\t{\n\t\tSystem.out.println(\"Hash Table Testing\");\n\t\t\n\t\tMyHashTable table = new MyHashTable();\n\t\t\n\t\ttable.IncCount(\"hello\");\n\t\ttable.IncCount(\"hello\");\n\t\t\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\ttable.IncCount(\"world\");\n\t\t\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\ttable.IncCount(\"Happy Thanksgiving!\");\n\t\t\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\ttable.IncCount(\"Food\");\n\t\t\n\t\ttable.IncCount(\"cool\");\n\t\t\n\t\ttable.IncCount(\"Assignment due\");\n\t\ttable.IncCount(\"Assignment due\");\n\t\t\n\t\ttable.IncCount(\"Wednesday\");\n\t\t\n\t\ttable.IncCount(\"night\");\n\t\ttable.IncCount(\"night\");\n\t\t\n\t\ttable.IncCount(\"at\");\n\t\t\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\ttable.IncCount(\"TWELVE!!!\");\n\t\t\n\t\tStringCount[] counts = table.GetCounts();\n\t\tString output = \"\";\n\t\t\n\t\tfor(int i = 0; i < counts.length; i++)\n\t\t{\n\t\t\tif(counts[i] != null)\n\t\t\t{\n\t\t\t\tSystem.out.print(\"[\" + counts[i].str +\",\" + counts[i].cnt + \"], \");\n\t\t\t\toutput += \"[\" + counts[i].str +\",\" + counts[i].cnt + \"], \";\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.print(\"NULL!!!!! \" + i);\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\tif(output.compareTo(\"[Assignment due,2], [Food,7], [Happy Thanksgiving!,3], [TWELVE!!!,5], [Wednesday,1], [at,1], [cool,1], [hello,2], [night,2], [world,4], \") == 0)\n\t\t\tSystem.out.println(\"Success! Output is correct.\");\n\t\telse\n\t\t\tSystem.out.println(\"Failure! The output wasn't correct. Output was: \\\"\" + output +\"\\\"\");\n\t}",
"public static void printIDTable () {\n System.out.println(); \n System.out.println(\"Identifier Cross Reference Table\");\n System.out.println(\"--------------------------------\"); \n for(String key : idCRT.keySet()) {\n // if id string length is > 30,\n // replace excess characters with a '+' character\n if(key.length() > 30) {\n String temp = key.substring(0, 30);\n temp += \"+\";\n System.out.printf(\"%-30s\",temp); \n } else {\n System.out.printf(\"%-30s\",key);\n }\n // prints the line numbers, creating a new line\n // if number of line numbers exceeds 7\n int count = 0;\n for(Integer lno : idCRT.get(key)) {\n if(count == 7) {\n System.out.printf(\"\\n%30s\", \" \");\n count = 0;\n }\n System.out.printf(\"%6d\",lno);\n count++;\n }\n System.out.println();\n }\n }",
"public Tree getHuffmanTree() {\n return huffmanTree;\n }",
"public HuffmanCode(int[] frequencies) {\n Queue<HuffmanNode> nodeFrequencies = new PriorityQueue<HuffmanNode>();\n for (int i = 0; i < frequencies.length; i++) {\n if (frequencies[i] > 0) {\n nodeFrequencies.add(new HuffmanNode(frequencies[i], (char) i));\n }\n }\n nodeFrequencies = ArrayHuffmanCodeCreator(nodeFrequencies);\n this.front = nodeFrequencies.peek();\n }",
"private void printMyRoutingTable()\n {\n\tString str;\n\tmyGUI.println(\"My Distance table and routes\");\n str = F.format(\"dst |\", 15);\n for (int i = 0; i < RouterSimulator.NUM_NODES; i++) {\n str += (F.format(i, 15));\n }\n myGUI.println(str);\n for (int i = 0; i < str.length(); i++) {\n myGUI.print(\"-\");\n }\n str = F.format(\"cost |\", 15);\n for (int i = 0; i < RouterSimulator.NUM_NODES; i++) {\n str += F.format(myDistTable[i], 15);\n }\n myGUI.println();\n myGUI.println(str);\n str = F.format(\"route |\", 15);\n for (int i = 0; i < RouterSimulator.NUM_NODES; i++) {\n str += F.format(route[i], 15);\n }\n myGUI.println(str);\n myGUI.println();\n myGUI.println(\"--------------------------------------------\");\n myGUI.println();\n\n }",
"public void print()\n {\n System.out.println(\"------------------------------------------------------------------\");\n System.out.println(this.letters);\n System.out.println();\n for(int row=0; row<8; row++)\n {\n System.out.print((row)+\"\t\");\n for(int col=0; col<8; col++)\n {\n switch (gameboard[row][col])\n {\n case B:\n System.out.print(\"B \");\n break;\n case W:\n System.out.print(\"W \");\n break;\n case EMPTY:\n System.out.print(\"- \");\n break;\n default:\n break;\n }\n if(col < 7)\n {\n System.out.print('\\t');\n }\n\n }\n System.out.println();\n }\n System.out.println(\"------------------------------------------------------------------\");\n }",
"@Override\n\tpublic void display() {\n\t\tStringBuilder string = new StringBuilder();\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (hashArray[i] == null)\n\t\t\t\tstring.append(\"** \");\n\t\t\telse if (hashArray[i] == deleted)\n\t\t\t\tstring.append(hashArray[i].value + \" \");\n\t\t\telse\n\t\t\t\tstring.append(\"[\" + hashArray[i].value + \", \"\n\t\t\t\t\t\t+ hashArray[i].frequency + \"] \");\n\t\t}\n\t\tSystem.out.println(string.toString());\n\t}",
"public String getTable() {\n StringBuilder table = new StringBuilder();\n\n table.append(\" \");\n for (int i = 0; i < matrix.length; i++) {\n table.append(\" \");\n table.append(i + 1);\n }\n table.append(\"\\n\");\n\n for (int i = 0; i < matrix.length; i++) {\n table.append(i + 1);\n table.append(\" \");\n\n for (int j = 0; j < matrix.length; j++) {\n table.append(matrix[i][j] ? 1 : 0);\n table.append(\" \");\n }\n table.append(\"\\n\");\n }\n table.append(\"\\n\");\n\n return table.toString();\n }",
"public void printTable() {\n\t\tString s = String.format(\"Routing table (%.3f)\\n\"\n\t\t\t\t+ \"%10s %10s %8s %5s %10s \\t path\\n\", now, \"prefix\", \n\t\t\t\t\"timestamp\", \"cost\",\"link\", \"VLD/INVLD\");\n\t\tfor (Route rte : rteTbl) {\n\t\t\ts += String.format(\"%10s %10.3f %8.3f\",\n\t\t\t\t\trte.pfx.toString(), rte.timestamp, rte.cost);\n\n\t\t\ts += String.format(\" %5d\", rte.outLink);\n\n\t\t\tif (rte.valid == true)\n\t\t\t\ts+= String.format(\" %10s\", \"valid\");\n\t\t\telse\n\t\t\t\ts+= String.format(\" %10s \\t\", \"invalid\");\n\n\t\t\tfor (int r :rte.path)\n\t\t\t\ts += String.format (\" %s\",Util.ip2string(r));\n\n\t\t\tif (lnkVec.get(rte.outLink).helloState == 0)\n\t\t\t\ts += String.format(\"\\t ** disabled link\");\n\t\t\ts += \"\\n\";\n\t\t}\n\t\tSystem.out.println(s);\n\t}",
"@Override\n public void printTree() {\n System.out.println(\"node with char: \" + this.getChar() + \" and key: \" + this.getKey());\n int i = 0;\n for(IABTNode node : this.sons) {\n if(!node.isNull()) {\n System.out.print(\"Son \" + i + \" :\");\n node.printTree();\n }\n i++;\n }\n }",
"private void printHeader () {\n System.out.println(\"COMPLETED HEADER PARSING\");\n System.out.println(\"________________________\");\n for(String header : parseTableHeader.keySet()) {\n System.out.print(header);\n System.out.println(parseTableHeader.get(header));\n }\n }",
"public void print(){\n if (isLeaf){\n for(int i =0; i<n;i++)\n System.out.print(key[i]+\" \");\n System.out.println();\n }\n else{\n for(int i =0; i<n;i++){\n c[i].print();\n System.out.print(key[i]+\" \");\n }\n c[n].print();\n }\n }",
"public void displayTree()\r\n {\r\n Stack globalStack = new Stack();\r\n globalStack.push(root);\r\n int nBlanks = 32;\r\n boolean isRowEmpty = false;\r\n System.out.println(\r\n \"......................................................\");\r\n while(isRowEmpty==false)\r\n {\r\n Stack localStack = new Stack();\r\n isRowEmpty = true;\r\n\r\n for(int j=0; j<nBlanks; j++)\r\n System.out.print(' ');\r\n\r\n while(globalStack.isEmpty()==false)\r\n {\r\n Node temp = (Node)globalStack.pop();\r\n if(temp != null)\r\n {\r\n if((temp.getStoredChar()) != '\\u0000'){\r\n System.out.print(\"{\"+temp.getStoredChar() + \",\" + temp.getFrequency()+\"}\");\r\n \r\n }\r\n else{\r\n System.out.print(\"{_,\"+ temp.getFrequency()+\"}\");\r\n \r\n }\r\n localStack.push(temp.getLeftChild());\r\n localStack.push(temp.getRightChild());\r\n\r\n if(temp.getLeftChild() != null ||\r\n temp.getRightChild() != null)\r\n isRowEmpty = false;\r\n }\r\n else\r\n {\r\n System.out.print(\"-\");\r\n localStack.push(null);\r\n localStack.push(null);\r\n }\r\n for(int j=0; j<nBlanks*2-2; j++)\r\n System.out.print(' ');\r\n } // end while globalStack not empty\r\n System.out.println();\r\n nBlanks /= 2;\r\n while(localStack.isEmpty()==false)\r\n globalStack.push( localStack.pop() );\r\n } // end while isRowEmpty is false\r\n System.out.println(\r\n \"......................................................\");\r\n System.out.println(\"\");\r\n }",
"void print() {\n for (int i = 0; i < 8; i--) {\n System.out.print(\" \");\n for (int j = 0; j < 8; j++) {\n System.out.print(_pieces[i][j].textName());\n }\n System.out.print(\"\\n\");\n }\n }",
"public String toString() {\n String res = String.format(\"(%2d,%2d):\", n, H.length);\n for (int i = 0; i < n; ++i)\n res += String.format(\" %3d\", H[i]);\n if (n != 0) res += \";\"; else res += \" \";\n if (n < H.length) {\n res += String.format(\"%3d\", H[n]);\n for (int i = n+1; i < H.length; ++i)\n res += String.format(\" %3d\", H[i]);\n }\n return res;\n }",
"public void printHeap() {\n \tSystem.out.println(\"Binomial heap Representation:\");\n \tNode x = this.head;\n if (x != null)\n x.print(0);\n }",
"protected void write_output_header() {\t\t\n\t\tSystem.out.println(\" H Lennard-Jones lattice-switch monte carlo code: hcp v fcc:\");\n\t\tSystem.out.println(\" H \");\n\t\t// Write out the standard parts of the LSMC header:\n\t\tsuper.write_output_header();\n\t\t// Write out LJLS-specific section:\n\t\tSystem.out.println(\" H For the Lennard-Jones Lattice-Switch: \");\n\t\tSystem.out.print(\" H lj_eta = 4*beta = +\"+lj_eta+\"\\n\");\n\t\tif( VIRT_NSWC == 1 ) {\n\t\t\tSystem.out.println(\" H VIRTUAL n-switch, structure \"+INIT_PHASE+\", en_shift = \"+EN_SHIFT);\n\t\t}\n\t\t\n\t\t// Optionally output E v. density:\n\t\tif( OUTPUT_E_V_DENSITY ) calc_e_v_dens();\n\n\t}",
"private void ReadHuffman(String aux) {\n\n Huffman DY = new Huffman();\n Huffman DCB = new Huffman();\n Huffman DCR = new Huffman();\n DY.setFrequencies(FreqY);\n DCB.setFrequencies(FreqCB);\n DCR.setFrequencies(FreqCR);\n\n StringBuilder encoding = new StringBuilder();\n int iteradorMatrix = aux.length() - sizeYc - sizeCBc - sizeCRc;\n for (int x = 0; x < sizeYc; ++x) {\n encoding.append(aux.charAt(iteradorMatrix));\n ++iteradorMatrix;\n }\n Ydes = DY.decompressHuffman(encoding.toString());\n encoding = new StringBuilder();\n for (int x = 0; x < sizeCBc; ++x) {\n encoding.append(aux.charAt(iteradorMatrix));\n ++iteradorMatrix;\n }\n CBdes = DCB.decompressHuffman(encoding.toString());\n encoding = new StringBuilder();\n for (int x = 0; x < sizeCRc; ++x) {\n encoding.append(aux.charAt(iteradorMatrix));\n ++iteradorMatrix;\n }\n CRdes = DCR.decompressHuffman(encoding.toString());\n }",
"public void constructTree(){\n PriorityQueue<HCNode> queue=new PriorityQueue<HCNode>();\n \n for(int i=0;i<MAXSIZE;i++){\n if(NOZERO){\n if(occTable[i]!=0){\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }else{\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }\n //constructing the Huffman Tree\n HCNode n1=null,n2=null;\n while(((n2=queue.poll())!=null) && ((n1=queue.poll())!=null)){\n HCNode nnode=new HCNode(n1.str+n2.str,n1.occ+n2.occ, null);\n nnode.left=n1;nnode.right=n2;\n n1.parent=nnode;n2.parent=nnode;\n queue.add(nnode);\n }\n if(n1==null&&n2==null){\n System.out.println(\"oops\");\n }\n if(n1!=null)\n root=n1;\n else\n root=n2;\n }",
"public void encodeTreeHelper(HuffmanNode node, StringBuilder builder){\n if(node.getLeft() == null && node.getRight()== null && !node.getCharAt().equals(null))\n encodedTable.put(node.getCharAt(),builder.toString());\n else{\n encodeTreeHelper(node.getLeft(), builder.append(\"0\"));\n encodeTreeHelper(node.getRight(), builder.append(\"1\"));\n }\n \n if(builder.length()>0)\n builder.deleteCharAt(builder.length()-1);\n }",
"public static void printCategoryTable() throws SQLException {\n\t\tPreparedStatement stmtGetLengthOfColumns = dbconn\n\t\t\t\t.prepareStatement(\"SELECT max(character_length((cast(categoryid as text)))) as lenid, max(character_length(trim(both ' ' from categoryname))) as lenname,max(character_length(trim(both ' ' from description))) as lendes FROM nw_category\");\n\t\tResultSet rsGetLengthOfColumns = stmtGetLengthOfColumns.executeQuery();\n\n\t\tint[] columnLengths = new int[3];\n\n\t\trsGetLengthOfColumns.next();\n\n\t\tfor (int i = 0; 3 > i; i++) {\n\t\t\tcolumnLengths[i] = rsGetLengthOfColumns.getInt(i + 1) + 10;\n\t\t}\n\n\t\t/*\n\t\t * Executing the query to get the categories and resturnning data and\n\t\t * metadata to resultsets.\n\t\t */\n\t\tPreparedStatement pstmt = dbconn\n\t\t\t\t.prepareStatement(\"SELECT categoryid,categoryname,description from nw_category\");\n\t\tResultSet rs = pstmt.executeQuery();\n\t\tResultSetMetaData rsmd = rs.getMetaData();\n\n\t\t/*\n\t\t * Printf ColumnLabels\n\t\t */\n\t\tfor (int i = 0; rsmd.getColumnCount() > i; i++) {\n\t\t\tSystem.out.printf(\"|%-\" + columnLengths[i] + \"S\",\n\t\t\t\t\trsmd.getColumnLabel(i + 1));\n\t\t}\n\t\tSystem.out.print(\"|\\n\");\n\n\t\t/*\n\t\t * Printf seperator for data and metadata\n\t\t */\n\t\tfor (int i = 0; (rsmd.getColumnCount()) > i; i++) {\n\n\t\t\tString sep = \"\";\n\n\t\t\tfor (int j = 0; j < columnLengths[i]; j++) {\n\t\t\t\tsep = sep + \"-\";\n\t\t\t}\n\t\t\tSystem.out.print(\"+\" + sep);\n\t\t}\n\t\tSystem.out.print(\"+\\n\");\n\n\t\t/*\n\t\t * Printf data;\n\t\t */\n\n\t\twhile (rs.next()) {\n\n\t\t\tfor (int i = 0; rsmd.getColumnCount() > i; i++) {\n\t\t\t\tSystem.out.printf(\"|%-\" + columnLengths[i] + \"s\",\n\t\t\t\t\t\trs.getString(i + 1));\n\t\t\t}\n\t\t\tSystem.out.print(\"|\\n\");\n\t\t}\n\t}",
"public void createHuffmanTree() {\n\t\twhile (pq.getSize() > 1) {\n\t\t\tBinaryTreeInterface<HuffmanData> b1 = pq.removeMin();\n\t\t\tBinaryTreeInterface<HuffmanData> b2 = pq.removeMin();\n\t\t\tHuffmanData newRootData =\n\t\t\t\t\t\t\tnew HuffmanData(b1.getRootData().getFrequency() +\n\t\t\t\t\t\t\t\t\t\t\tb2.getRootData().getFrequency());\n\t\t\tBinaryTreeInterface<HuffmanData> newB =\n\t\t\t\t\t\t\tnew BinaryTree<HuffmanData>(newRootData,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b1,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b2);\n\t\t\tpq.add(newB);\n\t\t}\n\t\thuffmanTree = pq.getMin();\n\t}",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"public static void expand() {\n Node root = readTrie();\n\n // number of bytes to write\n int length = BinaryStdIn.readInt();\n\n // decode using the Huffman trie\n for (int i = 0; i < length; i++) {\n Node x = root;\n while (!x.isLeaf()) {\n boolean bit = BinaryStdIn.readBoolean();\n if (bit) x = x.right;\n else x = x.left;\n }\n BinaryStdOut.write(x.ch, 8);\n }\n BinaryStdOut.close();\n }",
"private static String printH(Tuple[] h){\n\t\tString answer = \"ISOMORPHISM:\\t{\";\n\t\tfor(int i = 0; i < h.length; i++){\n\t\t\tanswer = answer + h[i] + (i < h.length-1? \",\": \"\");\n\t\t}\n\t\t\n\t\tanswer = answer + \"}\";\n\t\treturn answer;\n\t}",
"public void printTable(){\n \tfor (int i = 0; i < Table.size(); i++) {\n \t\tList<T> data = Table.get(i);\n \t\ttry {\n \t\t\tSystem.out.println(\"Bucket: \" + i);\n \t\t\tSystem.out.println(data.getFirst());\n \t\t\tSystem.out.println(\"+ \" + (data.getLength() - 1) + \" more at this bucket\\n\\n\");\n \t\t} catch (NoSuchElementException e) {\n \t\t\tSystem.out.println(\"This bucket is empty.\\n\\n\");\n \t\t}\n \t}\n }"
] | [
"0.7987684",
"0.69765615",
"0.69589424",
"0.68441194",
"0.672341",
"0.66676295",
"0.64353836",
"0.6348013",
"0.62532854",
"0.6252368",
"0.6225393",
"0.62115747",
"0.6190496",
"0.6133633",
"0.6128984",
"0.6118769",
"0.608199",
"0.60687995",
"0.6039022",
"0.60002154",
"0.5977405",
"0.5966715",
"0.59064895",
"0.59032404",
"0.5881169",
"0.5870941",
"0.5828648",
"0.5812676",
"0.58104885",
"0.5810407",
"0.57893395",
"0.57841086",
"0.57691205",
"0.57665575",
"0.57618153",
"0.5724281",
"0.5720821",
"0.57199425",
"0.5716728",
"0.5686487",
"0.56859595",
"0.5667205",
"0.56669366",
"0.5649689",
"0.5647423",
"0.564608",
"0.56327593",
"0.56175405",
"0.5612955",
"0.5611909",
"0.560709",
"0.56037474",
"0.5603279",
"0.5603224",
"0.55997515",
"0.5590143",
"0.5583395",
"0.55816936",
"0.55735785",
"0.5567882",
"0.5536822",
"0.5533012",
"0.55315757",
"0.55283195",
"0.55237883",
"0.54794157",
"0.54739827",
"0.5458357",
"0.54573005",
"0.54544693",
"0.54541665",
"0.54539853",
"0.5453083",
"0.5438486",
"0.54348135",
"0.54317594",
"0.542746",
"0.54232347",
"0.5407054",
"0.5407052",
"0.5400781",
"0.53991",
"0.5389489",
"0.5388959",
"0.5387997",
"0.5368774",
"0.5351803",
"0.5339521",
"0.53357834",
"0.53345436",
"0.5323788",
"0.53223103",
"0.53206885",
"0.5318588",
"0.53151816",
"0.53147995",
"0.53147304",
"0.5302748",
"0.5292103",
"0.5289989"
] | 0.6626751 | 6 |
prints the encoded message | private void printEncodedMessage() {
System.out.print("\nPrinting the encoded message");
System.out.print("\n" + encodedMessage + "\n");
System.out.println();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }",
"public void printMessages(){\n for(int i =0; i<msgCount;++i){\n System.out.printf(\"%s %s\\n\",messages[i].getRecipient()+\":\",messages[i].getDecodedMessage());\n }\n }",
"@Override\r\n\tpublic void printPlain(String message) {\n\t\tSystem.out.println(message);\r\n\t}",
"@Override\n public String toString()\n {\n return String.format(\"%s^%s\", fCode, fMessage);\n }",
"public String printMessage() {\r\n\t\tSystem.out.println(message);\r\n\t\treturn message;\r\n\t}",
"protected void displayMessage() {\n \n System.out.print (\"Message:\\n\");\n userMessage = message.toString();\n\n for(int i = 0; i < userMessage.length(); i++) \n System.out.format (\"%3d\", i);\n System.out.format (\"\\n\");\n for (char c : userMessage.toCharArray()) \n System.out.format(\"%3c\",c);\n System.out.format (\"\\n\");\n }",
"private static void print(Object msg){\n if (WAMClient.Debug){\n System.out.println(msg);\n }\n\n }",
"private String encodeMessage() {\n\t\tString encode = \"\";\n\t\tfor (int i = 0; i < message.length(); i++) {\n\t\t\tencode += map.get(message.charAt(i));\n\t\t}\n\t\tgenerateBack();\n\t\treturn encode;\n\t}",
"public String debugDump() {\n stringRepresentation = \"\";\n sprint(\"SIPMessage:\");\n sprint(\"{\");\n try {\n \n Field[] fields = this.getClass().getDeclaredFields();\n for (int i = 0; i < fields.length; i++) {\n Field f = fields [i];\n Class fieldType = f.getType();\n String fieldName = f.getName();\n if (f.get(this) != null &&\n Class.forName(SIPHEADERS_PACKAGE + \".SIPHeader\").\n isAssignableFrom(fieldType) &&\n fieldName.compareTo(\"headers\") != 0 ) {\n sprint(fieldName + \"=\");\n sprint(((SIPHeader)f.get(this)).debugDump());\n }\n }\n } catch ( Exception ex ) {\n InternalErrorHandler.handleException(ex);\n }\n \n \n sprint(\"List of headers : \");\n sprint(headers.toString());\n sprint(\"messageContent = \");\n sprint(\"{\");\n sprint(messageContent);\n sprint(\"}\");\n if (this.getContent() != null) {\n sprint(this.getContent().toString());\n }\n sprint(\"}\");\n return stringRepresentation;\n }",
"public void print(){\t\t\r\n\t\tSystem.out.println(\"===\\nCommit \" + id +\"\\n\"+ Time + \"\\n\" + message + \"\\n\");\r\n\t}",
"public String printMsg() {\n System.out.println(MESSAGE);\n return MESSAGE;\n }",
"void message(){\n\t\tSystem.out.println(\"Hello dude as e dey go \\\\ we go see for that side\");\n\t\tSystem.out.print (\" \\\"So it is what it is\\\" \");\n\n\t}",
"private String prettyMessage() {\n Map<String, Object> map = new LinkedHashMap<>(4);\n map.put(\"type\", getType());\n map.put(\"message\", this.message);\n map.put(\"code\", getCode());\n // TODO(\"need to optimize\")\n map.put(\"data\", getData().toString());\n return JsonUtils.getGson().toJson(map);\n }",
"public static String encode(Command msg)\n\t{\n\t\tString type = msg.getType();\n\t\tString sender = msg.getSender();\n\t\tString recipient = msg.getReciever()!=null ? msg.getReciever() : \" \";\n\t\tString message = msg.getMessage()!=null? msg.getMessage() : \" \";\n\t\tSystem.out.println(type + \";\" + sender + \";\" + recipient + \";\" + message);\n\t\treturn (type + \";\" + sender + \";\" + recipient + \";\" + message);\n\t}",
"@Override\n\tpublic void onMessage(Message message) {\n\t\tSystem.out.println(message.getBody());\n\t}",
"public void print()\r\n {\r\n System.out.println(\"From: \" + from);\r\n System.out.println(\"To: \" + to);\r\n System.out.println(\"Subject: \" + subject);\r\n System.out.println(\"Message: \" + message);\r\n }",
"protected void print(Object s) throws IOException {\n out.write(Convert.escapeUnicode(s.toString()));\n }",
"public static void printInstruction(String msg) {\n out.println(msg);\n }",
"public static void main(String[] args) {\n System.out.println(\"din => \"+encode(\"din\"));\n System.out.println(\"recede => \"+encode(\"recede\"));\n System.out.println(\"Success => \"+encode(\"Success\"));\n System.out.println(\"(( @ => \"+encode(\"(( @\"));\n }",
"public String getMessage() {\n String message = super.getMessage();\n\n if (message == null) {\n message = \"\";\n }\n\n if (buffer != null) {\n return message + ((message.length() > 0) ? \" \" : \"\")\n + \"(Hexdump: \" + ByteBuffers.getHexdump(buffer) + ')';\n } else {\n return message;\n }\n }",
"public void printMsg(String msg) {\n\t\tSystem.out.println(msg);\n\t}",
"public void printMessage() {\n\t\tSystem.out.println(this.greeting + \" \" + this.message);\n\t}",
"public String print() {\r\n System.out.println(\"TEST_MESSAGE: \" + message);\r\n return this.message;\r\n }",
"@Override\n public String toString() {\n return message;\n }",
"public void print(String message){\n if (this.okToPrint){\n System.out.print(message);\n }\n }",
"@Override\n\tpublic void print() {\n\t\tSystem.out.print(\"MsgOwner\");\n\t}",
"private static void print(String message)\n {\n System.out.println(message);\n }",
"public void print(String msg) {\n this.print(msg, false);\n }",
"@Override\n public String toString()\n {\n String str = getType() + \": \";\n if (code != 0)\n {\n str += String.valueOf(code) + \": \";\n }\n return str + message;\n }",
"public void printMessage(String message) {\n\r\n\t}",
"public void encodeMessage() {\n for (int i = message.length() - 1; i >= 0; i--) {\n message.insert(i, String.valueOf(message.charAt(i)).repeat(2));\n }\n }",
"@Override\n\t\tpublic void print() {\n\n\t\t}",
"private void print(String message) {\n\n //System.out.println(LocalDateTime.now() + \" \" + message);\n System.out.println(message);\n }",
"@Override\n\tpublic void print() {\n\t\tsuper.print();\n\t\tSystem.out.println(\"ÎÒÊÇÒ»Ö»\"+this.getStrain()+\"È®.\");\n\t}",
"@Override\n\tpublic String toString(){\n\t\treturn this.message;\n\t}",
"public void print(Object msg)\n {\n print(msg, 1);\n }",
"private void display(String msg) {\n\t\tString msgF = \"\\tClient- \" + msg + \"\\n\\n >> \";\n System.out.print(msgF);\n }",
"@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}",
"public void dumpTree(String msg) {\n\t\tSystem.out.println(msg);\n\t\tSystem.out.println(((org.eclipse.etrice.runtime.java.messaging.RTObject)getRoot()).toStringRecursive());\n\t}",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }",
"public String toString()\r\n\t{\r\n\t\treturn message;\r\n\t}",
"public void displayMessage(){//displayMessage body start\n\t\tSystem.out.printf(\"course name = %s\\n\", getCourseName());\n\t}",
"public void print(String message);",
"@Override\n public String dump(ConversationData conversationData) {\n return \"\";\n }",
"@Override\r\n\tvoid updateMessage(String msg) {\n\t\tSystem.out.println(msg);\r\n\t}",
"public void printProtocol()\n\t{\n\t\tString commands[] = {\"A\", \"UID\", \"S\", \"F\"};\n\t\t\n\t\tHashtable<String, String> commandDescription = new Hashtable<String, String>();\n\t\tHashtable<String, String> subStringCommands = new Hashtable<String, String>();\n\t\tcommandDescription.put(\"A\", \"Sends audio data using _ as a regex\");\n\t\tcommandDescription.put(\"UID\", \"Specifies the user's id so that the Network.Server may verify it\");\n\t\tcommandDescription.put(\"S\", \"Specifies server commands.\");\n\t\tcommandDescription.put(\"F\", \"Specifies audio format.\");\n\t\tsubStringCommands.put(\"A\", \"No commands\");\n\t\tsubStringCommands.put(\"UID\", \"No sub commands\");\n\t\tsubStringCommands.put(\"S\", \"Sub commands are: \\nclose - Closes the server.\\ndisconnect - Disconnects the client from the server.\\nclumpSize {int}\");\n\t\tsubStringCommands.put(\"F\", \"Split Audio specifications between spaces. The ordering is {float SampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate\");\n\t\t\n\t\tfor (String str: commands)\n\t\t{\n\t\t\tSystem.out.printf(\"Command format:\\n %s.xxxxxxx\\n\", str);\n\t\t\tSystem.out.printf(\"Command %s\\n Description: %s \\n sub commands %s\\n\", str, commandDescription.get(str),subStringCommands.get(str));\n\t\t\t\n\t\t}\n\t}",
"@Override\n public String toString() {\n System.out.print(super.toString());\n System.out.print(\"This form was encrypted using: \" + encryption);\n return \"\";\n }",
"public String toString() {\n\t\treturn message;\n\t}",
"private void printMessage(String s) {\n if (PRINTTRACE) {\r\n System.out.println(s);\r\n }\r\n }",
"private void encodeMessage() {\n encodedMessage = \"\";\n try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {\n String inputLine;\n while((inputLine = inputBuffer.readLine()) != null) {\n //walks the input message and builds the encode message\n for(int i = 0; i < inputLine.length(); i++) {\n encodedMessage = encodedMessage + codeTable[inputLine.charAt(i)];\n }\n encodedMessage = encodedMessage + codeTable[10];\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n //writes to the output file\n try(BufferedWriter outputBuffer = Files.newBufferedWriter(outputPath)) {\n outputBuffer.write(encodedMessage, 0, encodedMessage.length());\n outputBuffer.newLine();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void print()\n {\n System.out.println();\n System.out.println(\"Ticket to \" + destination +\n \" Price : \" + price + \" pence \" + \n \" Issued \" + issueDateTime);\n System.out.println();\n }",
"public String toString() {\n return message;\n }",
"protected void output(String message) {\n \t\tSystem.out.print(message);\n \t}",
"@Override\n\tpublic void message() {\n\t\tSystem.out.println(\"스마트폰으로 문자하기\");\n\t}",
"private void outHex(){\n\t\tSystem.out.println(binary);\n\t\tpw.println(binary);\n\t\t\n\t}",
"private void displayMsg(Object o) {\n Message msg = ((Datapacket)o).getMsg();\n client.printMessage(msg);\n }",
"public void printMessage() {\n printMessage(System.out::print);\n }",
"public void getDecodedMessage(String encoding){\n\n String output = \"\";\n Node temp = this.root;\n for(int i = 0;i<encoding.length();i++){\n\n if(encoding.charAt(i) == '0'){\n temp = temp.left;\n\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root;\n }\n }\n else\n {\n temp = temp.right;\n if(temp.left == null && temp.right == null){\n System.out.print(temp.getData());\n temp = this.root; \n }\n\n }\n }\n }",
"String getRawMessage();",
"public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }",
"public void outputMessage(String gameMessage){\n System.out.println(gameMessage);\n }",
"private void display(String msg) {\n cg.append(msg + \"\\n\");\n }",
"@Override\r\n public void writeMessage(Message msg) throws IOException {\n final StringBuilder buf = new StringBuilder();\r\n msg.accept(new DefaultVisitor() {\r\n\r\n @Override\r\n public void visitNonlocalizableTextFragment(VisitorContext ctx,\r\n NonlocalizableTextFragment fragment) {\r\n buf.append(fragment.getText());\r\n }\r\n\r\n @Override\r\n public void visitPlaceholder(VisitorContext ctx, Placeholder placeholder) {\r\n buf.append(placeholder.getTextRepresentation());\r\n }\r\n\r\n @Override\r\n public void visitTextFragment(VisitorContext ctx, TextFragment fragment) {\r\n buf.append(fragment.getText());\r\n }\r\n });\r\n out.write(buf.toString().getBytes(UTF8));\r\n }",
"public void print(String message) {\n System.out.println(message);\n }",
"public void print(String message) {\n System.out.println(message);\n }",
"public String toString(String message){\n\t\treturn desc + \": \" + message + \" (\" + code + \")\";\n\t}",
"public void print() {\r\n\t\t System.out.println(toString());\r\n\t }",
"@Override\n public String getMessage() {\n String result =\"Audio Message {\\n\";\n result +=\"\\tID: \"+ID+\"\\n\";\n result +=\"\\tBuffer Size: \"+bufferSize+\"\\n\";\n result +=\"}\";\n \n return result;\n }",
"private static void encodeString(String in){\n\n\t\tString officalEncodedTxt = officallyEncrypt(in);\n\t\tSystem.out.println(\"Encoded message: \" + officalEncodedTxt);\n\t}",
"public void print()\n {\n chatarea.append(\"Sender:(\"+port.getText()+\")\"+System.lineSeparator()+msgarea.getText()+System.lineSeparator());\n }",
"public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"@Override\n\tpublic void encode() {\n\t\tbyte[] messageData = encodeStarsMessage(message);\n\t\t\n\t\t// Allocate\n byte[] res = new byte[10 + messageData.length];\n\n // Write members\n Util.write16(res, 0, unknownWord0);\n Util.write16(res, 2, unknownWord2);\n Util.write16(res, 4, senderId);\n Util.write16(res, 6, receiverId);\n Util.write16(res, 8, unknownWord8);\n \n // Copy in message data\n System.arraycopy(messageData, 0, res, 10, messageData.length);\n \n // Save as decrypted data\n setDecryptedData(res, res.length);\n\t}",
"@Override\n public String toString() {\n return \"\\r\\nUser: \" + user + \" Message: \" + message +\" \\r\\n\" ;\n }",
"public String toString() {\n\t\treturn getMessage();\n\t}",
"public void print() {\n \tfor (int i=0; i < this.table.height; i++) {\n \t\tfor (int j=0; j < this.table.width; j++) {\n \t\t\tString tmp = \"e\";\n \t\t\tif(this.table.field[i][j].head != null) {\n \t\t\t\ttmp = \"\";\n \t\t\t\tswitch (this.table.field[i][j].head.direction) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ttmp+=\"^\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ttmp+=\">\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ttmp+=\"V\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\ttmp+=\"<\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\telse if(this.table.field[i][j].obj != null) {\n \t\t\t\ttmp = this.table.field[i][j].obj.name;\n \t\t\t}\n \t\t\tSystem.out.print(\" \" + tmp);\n \t\t}\n \t\t\tSystem.out.println(\"\");\n \t}\n }",
"public void print() {\n\t\tSystem.out.println(toString());\n\t}",
"public void printMsg(String msg)\n\t{\n\t\tmsgArea.append(msg);\n\t}",
"public static void info(Object message) {\n\t\tSystem.out.print(message);\n\t}",
"private void printSpecialThanks() {\n System.out.println(AraraUtils.wrap(localization.getMessage(\"Msg_SpecialThanks\")));\n }",
"public void print(){\r\n System.out.println(toString());\r\n }",
"public void println(String message){\n if (this.okToPrint){\n System.out.println(message);\n }\n }",
"public String print(){\r\n\t\t\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.companyName, \r\n\t\t\t\tthis.numberOfRailCars, \r\n\t\t\t\tthis.destinationCity);\r\n\t}",
"private void viewMessage()\n {\n System.out.println( inbox );\n inbox = \"\";\n }",
"public static void print(String message) {\n if (outputEnabled)\n out.print(message);\n }",
"@Override\n\tpublic void show() {\n\t\tSystem.out.println(\"´ó¿ãñÃ\");\n\t}",
"public String print() {\n\t\tString offID = getID();\n\t\tString offName = getName();\n\t\tint offAge = getAge();\n\t\tString offState = getState();\n\t\tString data = String.format(\"ID: %-15s \\t Name: %-35s \\t Age: %-15s \\t State: %s\", offID, offName, offAge, offState);\n\t\treturn data;\n\t}",
"public String getCodedMessage(){\r\n return codedMessage;\r\n }",
"public static void printBytes(byte[] data) {\n\t\tint rowCount = 0;\n\t\tfor (int i = 0; i < data.length; i++) {\n\t\t\tString res = \"\";\n\t\t\tres += Integer.toHexString((data[i] < 0 ? 256 + data[i]\t: data[i]));\n\t\t\tif (res.length() < 2) {\n\t\t\t\tres = res + \" \";\n\t\t\t\t//res = \"0\" + res;\n\t\t\t}\n\t\t\tSystem.out.print(res);\n\t\t\tSystem.out.print(\" (\");\n\t\t\tSystem.out.print((char) data[i]);\n\t\t\tSystem.out.print(\") \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tif (rowCount++ >= 3) {\n\t\t\t\tSystem.out.println();\n\t\t\t\trowCount = 0;\n\t\t\t}\n\t\t}\n\t}",
"public void print() {\n System.out.println(\"Scheme print:\");\n System.out.println(\" Blocks:\");\n for (Block block : this.blocks) {\n // System.out.println(\" \" + block.getName() + \" (\" + block.getID() + \")\");\n for (Integer id : block.getConnections()) {\n System.out.println(\" \" + id);\n }\n //System.out.println(\" \" + block.outputs.getFirst().getDstID());\n }\n /*System.out.println(\" Connections:\");\n for (Con connection : this.connections) {\n System.out.println(\" [\" + connection.src + \"]---[\" + connection.dst + \"]\");\n }*/\n if(this.queue_set){\n System.out.println(\" Queue: \" + this.queue);\n }\n else{\n System.out.println(\" Queue not loaded\");\n }\n }",
"public void dump()\n {\n System.out.println(toString());\n }",
"public synchronized String print() {\r\n return super.print();\r\n }"
] | [
"0.71789056",
"0.6629758",
"0.65780497",
"0.65674394",
"0.65268093",
"0.6457404",
"0.6428057",
"0.6404633",
"0.6363225",
"0.62944895",
"0.61981225",
"0.6197933",
"0.6185193",
"0.6102227",
"0.60956395",
"0.6069125",
"0.60682327",
"0.60544825",
"0.60484684",
"0.6046678",
"0.6030513",
"0.60248995",
"0.6021774",
"0.6019782",
"0.60090506",
"0.5969619",
"0.5968555",
"0.5963686",
"0.59457946",
"0.59425956",
"0.5941318",
"0.59384197",
"0.5914796",
"0.5914198",
"0.59052014",
"0.5898907",
"0.5894072",
"0.58916867",
"0.5886399",
"0.5878657",
"0.587452",
"0.587452",
"0.587452",
"0.587452",
"0.587452",
"0.587452",
"0.587452",
"0.587452",
"0.587452",
"0.585958",
"0.5832457",
"0.5819554",
"0.5813924",
"0.5805342",
"0.5797028",
"0.5783896",
"0.57818156",
"0.57785934",
"0.5775529",
"0.5769246",
"0.5768925",
"0.57684654",
"0.5761313",
"0.5756284",
"0.5752487",
"0.5747593",
"0.574522",
"0.5723034",
"0.57179445",
"0.57163113",
"0.570772",
"0.57011884",
"0.5696534",
"0.5696534",
"0.5686314",
"0.5681606",
"0.5676054",
"0.56629694",
"0.5662607",
"0.5655846",
"0.56551105",
"0.56544256",
"0.56537914",
"0.5653549",
"0.56507033",
"0.565014",
"0.5643951",
"0.564241",
"0.56388533",
"0.56319135",
"0.5627158",
"0.5618744",
"0.56166387",
"0.5615645",
"0.56130934",
"0.56102735",
"0.56082654",
"0.5601353",
"0.5601127",
"0.55970544"
] | 0.8717763 | 0 |
calls the four print methods above | private void print() {
printInputMessage();
printFrequencyTable();
printCodeTable();
printEncodedMessage();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}",
"public void print();",
"public void print();",
"public void print();",
"public void print();",
"public static void print() {\r\n\t\tSystem.out.println(\"1: Push\");\r\n\t\tSystem.out.println(\"2: Pop\");\r\n\t\tSystem.out.println(\"3: Peek\");\r\n\t\tSystem.out.println(\"4: Get size\");\r\n\t\tSystem.out.println(\"5: Check if empty\");\r\n\t\tSystem.out.println(\"6: Exit\");\r\n\t\tSystem.out.println(\"====================================================================\");\r\n\t}",
"@Override\r\n\t\t\tpublic void print() {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\tpublic void print() {\n\t\t\n\t}",
"@VisibleForTesting\n void print();",
"@Override\n\t\tpublic void print() {\n\n\t\t}",
"@Override\r\n\tpublic void print() {\n\t}",
"void print();",
"void print();",
"void print();",
"void print();",
"void print();",
"@Override\n\tpublic void print() {\n\n\t}",
"void print() {\r\n\t\tOperations.print(lexemes, tokens);\r\n\t}",
"public void print () {\n }",
"public void print() {\n int n = getSeq().size();\n int m = n / printLength;\n for (int i = 0; i < m; i++) {\n printLine(i * printLength, printLength);\n }\n printLine(n - n % printLength, n % printLength);\n System.out.println();\n }",
"public void print()\r\n\t{\r\n\t\tSystem.out.println(\"Method name: \" + name);\r\n\t\tSystem.out.println(\"Return type: \" + returnType);\r\n\t\tSystem.out.println(\"Modifiers: \" + modifiers);\r\n\r\n\t\tif(exceptions != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Exceptions: \" + exceptions[0]);\r\n\t\t\tfor(int i = 1; i < exceptions.length; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\", \" + exceptions[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Exceptions: none\");\r\n\t\t}\r\n\r\n\t\tif(parameters != null)\r\n\t\t{\r\n\t\t\tSystem.out.print(\"Parameters: \" + parameters[0]);\r\n\t\t\tfor(int i = 1; i < parameters.length; i++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\", \" + parameters[i]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Parameters: none\");\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t}",
"public void print() {\r\n\t\tSystem.out.print(getUID());\r\n\t\tSystem.out.print(getTITLE());\r\n\t\tSystem.out.print(getNOOFCOPIES());\r\n\t}",
"public void print() {\n\t\tPrinter.print(doPrint());\n\t}",
"static void print (){\n \t\tSystem.out.println();\r\n \t}",
"public String print();",
"public void print() {\r\n\t\t System.out.println(toString());\r\n\t }",
"public void print() {\n\t// Skriv ut en grafisk representation av kösituationen\n\t// med hjälp av klassernas toString-metoder\n System.out.println(\"A -> B\");\n System.out.println(r0);\n System.out.println(\"B -> C\");\n System.out.println(r1);\n System.out.println(\"turn\");\n System.out.println(r2);\n //System.out.println(\"light 1\");\n System.out.println(s1);\n //System.out.println(\"light 2\");\n System.out.println(s2);\n }",
"public abstract void print();",
"void print() {\n\t\n\t}",
"public void print() {\n\t\tSystem.out.println(name + \" -- \" + rating + \" -- \" + phoneNumber);\n\t}",
"public void print() {\n\t\tSystem.out.println(toString());\n\t}",
"abstract void print();",
"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 print(){\r\n System.out.println(toString());\r\n }",
"public void print() {\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\">> print()\");\n\t\t}\n\t\tSystem.out.println(p + \"/\" + q);\n\t\tif(log.isTraceEnabled()) {\n\t\t\tlog.info(\"<< print()\");\n\t\t}\n\t}",
"public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public void print()\n {\n System.out.println();\n System.out.println(\"Ticket to \" + destination +\n \" Price : \" + price + \" pence \" + \n \" Issued \" + issueDateTime);\n System.out.println();\n }",
"@Override\n public void print() {\n }",
"public void print() {\n System.out.println(toString());\n }",
"public void printYourself(){\n\t}",
"private void print() {\n\t\t// reorganize a wraparound queue and print\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(bq[(head + i) % bq.length] + \" \");\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t}",
"public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }",
"public void print() {\n for (int i=0; i<lines.size(); i++)\n {\n System.out.println(lines.get(i));\n }\n }",
"void print() {\t\r\n\t\tIterator<Elemento> e = t.iterator();\r\n\t\twhile(e.hasNext())\r\n\t\t\te.next().print();\r\n\t}",
"public void print(){\n System.out.println(\"(\"+a.getAbsis()+\"_a,\"+a.getOrdinat()+\"_a)\");\n System.out.println(\"(\"+b.getAbsis()+\"_b,\"+b.getOrdinat()+\"_b)\");\n System.out.println(\"(\"+c.getAbsis()+\"_b,\"+c.getOrdinat()+\"_c)\");\n }",
"public void printAll() {\n\t\tfor(int i = 0; i<r.length; i++)\n\t\t\tprintReg(i);\n\t\tprintReg(\"hi\");\n\t\tprintReg(\"lo\");\n\t\tprintReg(\"pc\");\n\t}",
"@Override\n public void print() {\n if (scoreData.getError() != null) {\n System.err.println(\"ERROR! \" + scoreData.getError());\n return;\n }\n\n // Frames\n printFrames();\n scoreData.getScores().forEach(score -> {\n // Player Names\n printNames(score);\n // Pinfalls\n printPinfalls(score);\n // Scores\n printScores(score);\n });\n }",
"public void print() {\n System.out.print(\"[ \" + value + \":\" + numSides + \" ]\");\n }",
"public void print() {\n System.out.println();\n for (int level = 0; level < 4; level++) {\n System.out.print(\" Z = \" + level + \" \");\n }\n System.out.println();\n for (int row = 3; row >= 0; row--) {\n for (int level = 0; level < 4; level++) {\n for (int column = 0; column < 4; column++) {\n System.out.print(get(column, row, level));\n System.out.print(\" \");\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n System.out.println();\n }",
"void print() {\n for (int i = 0; i < 8; i--) {\n System.out.print(\" \");\n for (int j = 0; j < 8; j++) {\n System.out.print(_pieces[i][j].textName());\n }\n System.out.print(\"\\n\");\n }\n }",
"public void print()\r\n {\n if (getOccupants().length != 0)\r\n {\r\n \t// will use the print method in the person class\r\n getOccupants()[0].print();\r\n }\r\n else if (this.explored)\r\n {\r\n System.out.print(\"[ H ]\");\r\n }\r\n else\r\n {\r\n System.out.print(\"[ ]\");\r\n }\r\n\r\n }",
"public void println();",
"private void print(byte[] buffer, int level) {\n for (int i = 0; i < level; i++) {\n System.out.print(' ');\n }\n\n if (child == null) {\n System.out.print(\"Type: 0x\" + Integer.toHexString(type) +\n \" length: \" + length + \" value: \");\n if (type == PRINTSTR_TYPE ||\n type == TELETEXSTR_TYPE ||\n type == UTF8STR_TYPE ||\n type == IA5STR_TYPE ||\n type == UNIVSTR_TYPE) {\n try {\n System.out.print(new String(buffer, valueOffset, length,\n \"UTF-8\"));\n } catch (UnsupportedEncodingException e) {\n // ignore\n }\n } else if (type == OID_TYPE) {\n System.out.print(OIDtoString(buffer, valueOffset, length));\n } else {\n System.out.print(hexEncode(buffer, valueOffset, length, 14));\n }\n\n System.out.println(\"\");\n } else {\n if (type == SET_TYPE) {\n System.out.println(\"Set:\");\n } else if (type == VERSION_TYPE) {\n System.out.println(\"Version (explicit):\");\n } else if (type == EXTENSIONS_TYPE) {\n System.out.println(\"Extensions (explicit):\");\n } else {\n System.out.println(\"Sequence:\");\n }\n\n child.print(buffer, level + 1);\n }\n\n if (next != null) {\n next.print(buffer, level);\n }\n }",
"public void println() { System.out.println( toString() ); }",
"abstract public void printInfo();",
"public void print() {\n System.out.println(this.toString());\n }",
"public void print() {\r\n System.out.println(c() + \"(\" + x + \", \" + y + \")\");\r\n }",
"public static void print() {\r\n System.out.println();\r\n }",
"public void print() {\r\n\r\n\t\tfor (int row=0; row<10; row++) \r\n\t\t{\r\n\t\t\tfor (int col=0; col<10; col++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"\\t\"+nums[row][col]); //separated by tabs\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}",
"public void print()\n {\n System.out.println(\"Course: \" + title + \" \" + codeNumber);\n \n module1.print();\n module2.print();\n module3.print();\n module4.print();\n \n System.out.println(\"Final mark: \" + finalMark + \".\");\n }",
"public void printInfo(){\n\t}",
"public void printInfo(){\n\t}",
"@Override\n\tpublic void print() {\n\t\tSystem.out.print(\"\\nMSc. student:\\n\");\n\t\tsuper.print();\n\t}",
"@FormatMethod\n void print(String format, Object... args);",
"public void print() {\n btprint(c);\n }",
"@Override\n\tpublic void printInfo() {\n\t\tsuper.printInfo();\n\t\tmessage();\n\t\tdoInternet();\n\t\tmailing();\n\t\tcalling();\n\t\twatchingTV();\n\n\t}",
"public void print(){\r\n\t\tSystem.out.println(\"Size of each block:\\t\\t\" + this.blockSize);\r\n\t\tSystem.out.println(\"Total Number of Inodes:\\t\\t\" + this.inodeCount);\r\n\t\tSystem.out.println(\"Total Number of Blocks:\\t\\t\" + this.blocksCount);\r\n\t\tSystem.out.println(\"Number of Free Blocks:\\t\\t\" + this.freeBlocksCount);\r\n\t\tSystem.out.println(\"Number of Free Inodes:\\t\\t\" + this.freeInodesCount);\r\n\t\tSystem.out.println(\"First Data Block:\\t\\t\" + this.firstDataBlock);\r\n\t\tSystem.out.println(\"Last Written Date and Time:\\t\" + GeneralUtils.getDateFromLong(this.wTime));\r\n\t\tSystem.out.println(\"First Inode:\\t\\t\\t\" + this.firstInode);\r\n\t\tSystem.out.println(\"Inode Size:\\t\\t\\t\" + this.inodeSize);\r\n\t}",
"public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}",
"public void print() {\n\t\tSystem.out.println(\"针式打印机打印了\");\n\t\t\n\t}",
"void format(Printer printer);",
"@Override\n\tprotected void print() {\n\t\tSystem.out.println(\"-----------\"+this.getName()+\"\");\n\t}",
"void Print()\n {\n int quadLabel = 1;\n String separator;\n\n System.out.println(\"CODE\");\n\n Enumeration<Quadruple> e = this.Quadruple.elements();\n e.nextElement();\n\n while (e.hasMoreElements())\n {\n Quadruple nextQuad = e.nextElement();\n String[] quadOps = nextQuad.GetOps();\n System.out.print(quadLabel + \": \" + quadOps[0]);\n for (int i = 1; i < nextQuad.GetQuadSize(); i++)\n {\n System.out.print(\" \" + quadOps[i]);\n if (i != nextQuad.GetQuadSize() - 1)\n {\n System.out.print(\",\");\n } else System.out.print(\"\");\n }\n System.out.println(\"\");\n quadLabel++;\n }\n }",
"public void print()\n {\n for (int i=0; i<list.length; i++)\n System.out.println(i + \":\\t\" + list[i]);\n }",
"public void print() {\n int rows = this.getNumRows();\n int cols = this.getNumColumns();\n\n for (int r = 0; r < rows; r++) {\n\n for (int c = 0; c < cols; c++) {\n System.out.print(this.getString(r, c) + \", \");\n }\n\n System.out.println(\" \");\n }\n }",
"@Override\n\tpublic void print(int indent) {\n\t}",
"public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}",
"private void print() {\r\n // Print number of survivors and zombies\r\n System.out.println(\"We have \" + survivors.length + \" survivors trying to make it to safety (\" + childNum\r\n + \" children, \" + teacherNum + \" teachers, \" + soldierNum + \" soldiers)\");\r\n System.out.println(\"But there are \" + zombies.length + \" zombies waiting for them (\" + cInfectedNum\r\n + \" common infected, \" + tankNum + \" tanks)\");\r\n }",
"public void print() {\n System.out.println(\"Nome: \" + nome);\n System.out.println(\"Telefone: \" + telefone);\n }",
"private void print(String text) {\n\t\tSystem.out.println(text);\n\t}",
"static void print (Object output){\r\n \t\tSystem.out.println(output);\r\n \t}",
"public void formatPrint() {\n\t\tSystem.out.printf(\"%8d \", codigo);\n\t\tSystem.out.printf(\"%5.5s \", clase);\n\t\tSystem.out.printf(\"%5.5s \", par);\n\t\tSystem.out.printf(\"%5.5s \", nombre);\n\t\tSystem.out.printf(\"%8d \", comienza);\n\t\tSystem.out.printf(\"%8d\", termina);\n\t}",
"private void print(String... toPrint) {for (String print : toPrint) System.out.println(print);}",
"public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }",
"void printout() {\n\t\tprintstatus = idle;\n\t\tanyprinted = false;\n\t\tfor (printoldline = printnewline = 1;;) {\n\t\t\tif (printoldline > oldinfo.maxLine) {\n\t\t\t\tnewconsume();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (printnewline > newinfo.maxLine) {\n\t\t\t\toldconsume();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (newinfo.other[printnewline] < 0) {\n\t\t\t\tif (oldinfo.other[printoldline] < 0)\n\t\t\t\t\tshowchange();\n\t\t\t\telse\n\t\t\t\t\tshowinsert();\n\t\t\t} else if (oldinfo.other[printoldline] < 0)\n\t\t\t\tshowdelete();\n\t\t\telse if (blocklen[printoldline] < 0)\n\t\t\t\tskipold();\n\t\t\telse if (oldinfo.other[printoldline] == printnewline)\n\t\t\t\tshowsame();\n\t\t\telse\n\t\t\t\tshowmove();\n\t\t}\n\t\tif (anyprinted == true)\n\t\t\tprintln(\">>>> End of differences.\");\n\t\telse\n\t\t\tprintln(\">>>> Files are identical.\");\n\t}",
"public void print() {\n super.print();\r\n System.out.println(\"Hourly Wage: \" + hourlyWage);\r\n System.out.println(\"Hours Per Week: \" + hoursPerWeek);\r\n System.out.println(\"Weeks Per Year: \" + weeksPerYear);\r\n }",
"void printInfo();",
"public void print() {\n System.out.println(\"Code: \"+this.productCode);\n System.out.println(\"Name: \"+ this.productName);\n System.out.println(\"Price: \"+this.price);\n System.out.println(\"Discount: \"+this.discount+\"%\");\n }",
"public void print()\n {\n \tSystem.out.println(\"MOTO\");\n super.print();\n System.out.println(\"Tipo da partida: \" + tipoPartida);\n System.out.println(\"Cilindradas: \" + cilindradas);\n System.out.println();\n }",
"public void print() {\n System.out.print(datum+\" \");\n if (next != null) {\n next.print();\n }\n }",
"@Override\n\tpublic void print() {\n\t\tSystem.out.println(\"print A\");\n\t}",
"public void printAll(){\n for (Triangle triangle : triangles) {\n System.out.println(triangle.toString());\n }\n for (Circle circle : circles) {\n System.out.println(circle.toString());\n }\n for (Rectangle rectangle : rectangles) {\n System.out.println(rectangle.toString());\n }\n }",
"public String print(int format);",
"public void println()\n\t{\n\t\tSystem.out.println();\n\t}",
"public void print() {\n\t\t\tfor (int i = 0; i < nowLength; i++) {\n\t\t\t\tSystem.out.print(ray[i] + \" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}",
"public void printRecipt(){\n\n }",
"public void print() { /* FILL IN */ }",
"public void print(){\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" ~ THREE ROOM DUNGEON GAME ~ \");\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\n\t}",
"public void print() {\r\n\t\tint size = list.size();\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"┌───────────────────────────┐\");\r\n\t\tSystem.out.println(\"│ \t\t\t성적 출력 \t\t │\");\r\n\t\tSystem.out.println(\"└───────────────────────────┘\");\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\r\n\t\t\tExam exam = list.get(i);\r\n\t\t\tint kor = exam.getKor();\r\n\t\t\tint eng = exam.getEng();\r\n\t\t\tint math = exam.getMath();\r\n\r\n\t\t\tint total = exam.total();// kor + eng + math;\r\n\t\t\tfloat avg = exam.avg();// total / 3.0f;\r\n\t\t\tSystem.out.printf(\"성적%d > 국어:%d, 영어:%d, 수학:%d\", i + 1, kor, eng, math);\r\n\t\t\tonPrint(exam);\r\n\t\t\tSystem.out.printf(\"총점:%d, 평균:%.4f\\n\", total, avg);\r\n\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"─────────────────────────────\");\r\n\r\n\t}",
"public void print()\n {\n System.out.println(name + \"\\n\");\n for(int iterator = 0; iterator < bookList.size() ; iterator++)\n {\n System.out.println((iterator+1) +\". \" + bookList.get(iterator).getTitle()+\" by \" +bookList.get(iterator).getAuthor()); \n }\n }",
"public static void printInfo(){\n }"
] | [
"0.78027755",
"0.7780259",
"0.7780259",
"0.7780259",
"0.7780259",
"0.7727353",
"0.7683795",
"0.7648552",
"0.76403797",
"0.7638599",
"0.7631881",
"0.76214594",
"0.76214594",
"0.76214594",
"0.76214594",
"0.76214594",
"0.7578312",
"0.75771785",
"0.7492461",
"0.7489419",
"0.7464518",
"0.7464386",
"0.74466795",
"0.74446005",
"0.74229366",
"0.74187505",
"0.74017745",
"0.7331861",
"0.73055845",
"0.7305377",
"0.7302625",
"0.72994304",
"0.72665685",
"0.7250988",
"0.72207874",
"0.72107035",
"0.720664",
"0.72063506",
"0.71862996",
"0.71541977",
"0.71486545",
"0.7148342",
"0.7124848",
"0.7115821",
"0.70969427",
"0.70960045",
"0.7093429",
"0.708207",
"0.7080386",
"0.70703995",
"0.7064561",
"0.7062853",
"0.70411915",
"0.7039585",
"0.70191354",
"0.7013721",
"0.7012278",
"0.70096153",
"0.70087194",
"0.6997595",
"0.69879",
"0.69879",
"0.698087",
"0.69706076",
"0.6958969",
"0.6957702",
"0.6950749",
"0.6935623",
"0.69254667",
"0.6924207",
"0.6921373",
"0.69067186",
"0.6905442",
"0.69050205",
"0.6897608",
"0.6896347",
"0.68915534",
"0.6891113",
"0.6875982",
"0.6867351",
"0.6856385",
"0.68368095",
"0.68358684",
"0.6834146",
"0.6820187",
"0.68176043",
"0.68153805",
"0.68066436",
"0.6806127",
"0.6790473",
"0.67894113",
"0.6787336",
"0.6785227",
"0.6783174",
"0.67803806",
"0.6780211",
"0.6780171",
"0.6767928",
"0.6759358",
"0.6753951"
] | 0.758643 | 16 |
returns the Huffman tree | public Tree getHuffmanTree() {
return huffmanTree;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void makeTree(){\n //convert Hashmap into charList\n for(Map.Entry<Character,Integer> entry : freqTable.entrySet()){\n HuffmanNode newNode = new HuffmanNode(entry.getKey(),entry.getValue());\n charList.add(newNode);\n }\n \n if(charList.size()==0)\n return;\n \n if(charList.size()==1){\n HuffmanNode onlyNode = charList.get(0);\n root = new HuffmanNode(null,onlyNode.getFrequency());\n root.setLeft(onlyNode);\n return;\n }\n \n Sort heap = new Sort(charList);\n heap.heapSort();\n \n while(heap.size()>1){\n \n HuffmanNode leftNode = heap.remove(0);\n HuffmanNode rightNode = heap.remove(0);\n \n HuffmanNode newNode = merge(leftNode,rightNode);\n heap.insert(newNode);\n heap.heapSort();\n }\n \n charList = heap.getList();\n root = charList.get(0);\n }",
"private void buildTree() {\n\t\tfinal TreeSet<Tree> treeSet = new TreeSet<Tree>();\n\t\tfor (char i = 0; i < 256; i++) {\n\t\t\tif (characterCount[i] > 0) {\n\t\t\t\ttreeSet.add(new Tree(i, characterCount[i]));\n\t\t\t}\n\t\t}\n\n\t\t// Merge the trees to one Tree\n\t\tTree left;\n\t\tTree right;\n\t\twhile (treeSet.size() > 1) {\n\t\t\tleft = treeSet.pollFirst();\n\t\t\tright = treeSet.pollFirst();\n\t\t\ttreeSet.add(new Tree(left, right));\n\t\t}\n\n\t\t// There is only our final tree left\n\t\thuffmanTree = treeSet.pollFirst();\n\t}",
"private static void generateHuffmanTree(){\n try (BufferedReader br = new BufferedReader(new FileReader(_codeTableFile))) {\n String line;\n while ((line = br.readLine()) != null) {\n // process the line.\n if(!line.isEmpty() && line!=null){\n int numberData = Integer.parseInt(line.split(\" \")[0]);\n String code = line.split(\" \")[1];\n Node traverser = root;\n for (int i = 0; i < code.length() - 1; i++){\n char c = code.charAt(i); \n if (c == '0'){\n //bit is 0\n if(traverser.getLeftPtr() == null){\n traverser.setLeftPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getLeftPtr();\n }\n else{\n //bit is 1\n if(traverser.getRightPtr() == null){\n traverser.setRightPtr(new BranchNode(999999, null, null));\n }\n traverser = traverser.getRightPtr();\n }\n }\n //Put data in the last node by creating a new leafNode\n char c = code.charAt(code.length() - 1);\n if(c == '0'){\n traverser.setLeftPtr(new LeafNode(9999999, numberData, null, null));\n }\n else{\n traverser.setRightPtr(new LeafNode(9999999, numberData, null, null));\n }\n }\n }\n } \n catch (IOException ex) {\n Logger.getLogger(FrequencyTableBuilder.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public void createHuffmanTree() {\n\t\twhile (pq.getSize() > 1) {\n\t\t\tBinaryTreeInterface<HuffmanData> b1 = pq.removeMin();\n\t\t\tBinaryTreeInterface<HuffmanData> b2 = pq.removeMin();\n\t\t\tHuffmanData newRootData =\n\t\t\t\t\t\t\tnew HuffmanData(b1.getRootData().getFrequency() +\n\t\t\t\t\t\t\t\t\t\t\tb2.getRootData().getFrequency());\n\t\t\tBinaryTreeInterface<HuffmanData> newB =\n\t\t\t\t\t\t\tnew BinaryTree<HuffmanData>(newRootData,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b1,\n\t\t\t\t\t\t\t\t\t\t\t(BinaryTree) b2);\n\t\t\tpq.add(newB);\n\t\t}\n\t\thuffmanTree = pq.getMin();\n\t}",
"public HuffmanTree() {\r\n\t\tsuper();\r\n\t}",
"public CS232LinkedBinaryTree<Integer, Character> buildHuffTree() {\n\n\t\twhile (huffBuilder.size() > 1) {// Until one tree is left...\n\n\t\t\t// Make references to the important trees\n\t\t\tCS232LinkedBinaryTree<Integer, Character> newTree = new CS232LinkedBinaryTree<Integer, Character>();\n\t\t\tCS232LinkedBinaryTree<Integer, Character> firstSubTree = huffBuilder.remove();\n\t\t\tCS232LinkedBinaryTree<Integer, Character> secondSubTree = huffBuilder.remove();\n\n\t\t\t// Create the new root on the new joined tree. Use the character of higher priority.\n\t\t\tCharacter newTreeRootValue = this.getPriorityCharacter(firstSubTree.root.value, secondSubTree.root.value);\n\t\t\tnewTree.add(firstSubTree.root.key + secondSubTree.root.key, newTreeRootValue);\n\n\t\t\t// Join the new root's right side with the first tree\n\t\t\tnewTree.root.right = firstSubTree.root;\n\t\t\tfirstSubTree.root.parent = newTree.root;\n\n\t\t\t// Join the new root's left side with the second tree\n\t\t\tnewTree.root.left = secondSubTree.root;\n\t\t\tsecondSubTree.root.parent = newTree.root;\n\n\t\t\t// put the newly created tree back into the priority queue\n\t\t\thuffBuilder.add(newTree); \n\t\t}\n\t\t/*\n\t\t * At the end of the whole process, we have one final mega-tree. return\n\t\t * it and finally empty the queue!\n\t\t */\n\t\treturn huffBuilder.remove();\n\t}",
"public void constructTree(){\n PriorityQueue<HCNode> queue=new PriorityQueue<HCNode>();\n \n for(int i=0;i<MAXSIZE;i++){\n if(NOZERO){\n if(occTable[i]!=0){\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }else{\n HCNode nnode=new HCNode(\"\"+(char)(i-DIFF),occTable[i], null);\n queue.add(nnode);\n }\n }\n //constructing the Huffman Tree\n HCNode n1=null,n2=null;\n while(((n2=queue.poll())!=null) && ((n1=queue.poll())!=null)){\n HCNode nnode=new HCNode(n1.str+n2.str,n1.occ+n2.occ, null);\n nnode.left=n1;nnode.right=n2;\n n1.parent=nnode;n2.parent=nnode;\n queue.add(nnode);\n }\n if(n1==null&&n2==null){\n System.out.println(\"oops\");\n }\n if(n1!=null)\n root=n1;\n else\n root=n2;\n }",
"public static Node make_huffmann_tree(List li){\n //Sorting list in increasing order of its letter frequency \n li.sort(new comp());\n Node temp=null;\n Iterator it=li.iterator();\n //System.out.println(li.size());\n //Loop for making huffman tree till only single node remains in list\n while(true){\n temp=new Node();\n //a and b are Node which are to be combine to make its parent\n Node a=new Node(),b=new Node();\n a=null;b=null;\n //checking if list is eligible for combining or not\n //here first assignment of it.next in a will always be true as list till end will\n //must have atleast one node\n a=(Node)it.next();\n //Below condition is to check either list has 2nd node or not to combine \n //If this condition will be false, then it means construction of huffman tree is completed\n if(it.hasNext()){b=(Node)it.next();}\n //Combining first two smallest nodes in list to make its parent whose frequncy \n //will be equals to sum of frequency of these two nodes \n if(b!=null){\n temp.freq=a.freq+b.freq;a.data=0;b.data=1;//assigining 0 and 1 to left and right nodes\n temp.left=a;temp.right=b;\n //after combing, removing first two nodes in list which are already combined\n li.remove(0);//removes first element which is now combined -step1\n li.remove(0);//removes 2nd element which comes on 1st position after deleting first in step1\n li.add(temp);//adding new combined node to list\n //print_list(li); //For visualizing each combination step\n }\n //Sorting after combining to again repeat above on sorted frequency list\n li.sort(new comp()); \n it=li.iterator();//resetting list pointer to first node (head/root of tree)\n if(li.size()==1){return (Node)it.next();} //base condition ,returning root of huffman tree \n }\n}",
"private HuffmanNode buildTree(int n) {\r\n \tfor (int i = 1; i <= n; i++) {\r\n \t\tHuffmanNode node = new HuffmanNode();\r\n \t\tnode.left = pQueue.poll();\r\n \t\tnode.right = pQueue.poll();\r\n \t\tnode.frequency = node.left.frequency + node.right.frequency;\r\n \t\tpQueue.add(node);\r\n \t}\r\n return pQueue.poll();\r\n }",
"public void HuffmanCode()\n {\n String text=message;\n /* Count the frequency of each character in the string */\n //if the character does not exist in the list add it\n for(int i=0;i<text.length();i++)\n {\n if(!(c.contains(text.charAt(i))))\n c.add(text.charAt(i));\n } \n int[] freq=new int[c.size()];\n //counting the frequency of each character in the text\n for(int i=0;i<c.size();i++)\n for(int j=0;j<text.length();j++)\n if(c.get(i)==text.charAt(j))\n freq[i]++;\n /* Build the huffman tree */\n \n root= buildTree(freq); \n \n }",
"public Node createHuffmanTree(File f) throws FileNotFoundException {\r\n File file = f;\r\n FileInputStream fi = new FileInputStream(file);\r\n List<Node> nodes = new LinkedList<>();\r\n\r\n// Creating a map, where the key is characters and the values are the number of characters in the file\r\n Map<Character, Integer> charsMap = new LinkedHashMap<>();\r\n try (Reader reader = new InputStreamReader(fi);) {\r\n int r;\r\n while ((r = reader.read()) != -1) {\r\n char nextChar = (char) r;\r\n\r\n if (charsMap.containsKey(nextChar))\r\n charsMap.compute(nextChar, (k, v) -> v + 1);\r\n else\r\n charsMap.put(nextChar, 1);\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n//// Sort the map by value and create a list\r\n// charsMap = charsMap.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));\r\n\r\n// Creating a list of Nodes from a map\r\n for (Character ch : charsMap.keySet()) {\r\n nodes.add(new Node(ch, charsMap.get(ch), null, null));\r\n }\r\n\r\n// Creating a Huffman tree\r\n while (nodes.size() > 1) {\r\n Node firstMin = nodes.stream().min(Comparator.comparingInt(n -> n.count)).get();\r\n nodes.remove(firstMin);\r\n Node secondMin = nodes.stream().min(Comparator.comparingInt(n -> n.count)).get();\r\n nodes.remove(secondMin);\r\n\r\n Node newNode = new Node(null, firstMin.count + secondMin.count, firstMin, secondMin);\r\n newNode.left.count = null;\r\n newNode.right.count = null;\r\n nodes.add(newNode);\r\n nodes.remove(firstMin);\r\n nodes.remove(secondMin);\r\n }\r\n\r\n// Why first? See algorithm!\r\n nodes.get(0).count = null;\r\n return nodes.get(0);\r\n }",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\ttextArray = text.toCharArray();\n\n\t\tPriorityQueue<Leaf> queue = new PriorityQueue<>(new Comparator<Leaf>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Leaf a, Leaf b) {\n\t\t\t\tif (a.frequency > b.frequency) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else if (a.frequency < b.frequency) {\n\t\t\t\t\treturn -1;\n\t\t\t\t} else {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tfor (char c : textArray) {\n\t\t\tif (chars.containsKey(c)) {\n\t\t\t\tint freq = chars.get(c);\n\t\t\t\tfreq = freq + 1;\n\t\t\t\tchars.remove(c);\n\t\t\t\tchars.put(c, freq);\n\t\t\t} else {\n\t\t\t\tchars.put(c, 1);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"tree print\");\t\t\t\t\t\t\t\t// print method begin\n\n\t\tfor(char c : chars.keySet()){\n\t\t\tint freq = chars.get(c);\n\t\t\tSystem.out.println(c + \" \" + freq);\n\t\t}\n\n\t\tint total = 0;\n\t\tfor(char c : chars.keySet()){\n\t\t\ttotal = total + chars.get(c);\n\t\t}\n\t\tSystem.out.println(\"total \" + total);\t\t\t\t\t\t\t// ends\n\n\t\tfor (char c : chars.keySet()) {\n\t\t\tLeaf l = new Leaf(c, chars.get(c), null, null);\n\t\t\tqueue.offer(l);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tLeaf a = queue.poll();\n\t\t\tLeaf b = queue.poll();\n\n\t\t\tint frequency = a.frequency + b.frequency;\n\n\t\t\tLeaf leaf = new Leaf('\\0', frequency, a, b);\n\n\t\t\tqueue.offer(leaf);\n\t\t}\n\n\t\tif(queue.size() == 1){\n\t\t\tthis.root = queue.peek();\n\t\t}\n\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tMap<Character, Integer> frequencyMap = new HashMap<>();\n\t\tint textLength = text.length();\n\n\t\tfor (int i = 0; i < textLength; i++) {\n\t\t\tchar character = text.charAt(i);\n\t\t\tif (!frequencyMap.containsKey(character)) {\n\t\t\t\tfrequencyMap.put(character, 1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tint newFreq = frequencyMap.get(character) + 1;\n\t\t\t\tfrequencyMap.replace(character, newFreq);\n\t\t\t}\n\t\t}\n\n\t\tPriorityQueue<Node> queue = new PriorityQueue<>();\n\n\t\tIterator iterator = frequencyMap.entrySet().iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMap.Entry<Character, Integer> pair = (Map.Entry<Character, Integer>) iterator.next();\n\t\t\tNode node = new Node(null, null, pair.getKey(), pair.getValue());\n\t\t\tqueue.add(node);\n\t\t}\n\n\t\twhile (queue.size() > 1) {\n\t\t\tNode node1 = queue.poll();\n\t\t\tNode node2 = queue.poll();\n\t\t\tNode parent = new Node(node1, node2, '\\t', node1.getFrequency() + node2.getFrequency());\n\t\t\tqueue.add(parent);\n\t\t}\n\t\thuffmanTree = queue.poll();\n\t\tSystem.out.println(\"firstNode: \"+ huffmanTree);\n\t\tcodeTable(huffmanTree);\n\n\t\t//Iterator iterator1 = encodingTable.entrySet().iterator();\n\n\t\t/*\n\t\twhile (iterator1.hasNext()) {\n\t\t\tMap.Entry<Character, String> pair = (Map.Entry<Character, String>) iterator1.next();\n\t\t\tSystem.out.println(pair.getKey() + \" : \" + pair.getValue() + \"\\n\");\n\t\t}\n\t\t*/\n\n\t\t//System.out.println(\"Hashmap.size() : \" + frequencyMap.size());\n\n\t}",
"private HuffmanTempTree makeTree() {\n \tPQHeap queue = makeQueue();\n \tfor (int i = 0; i < frequency.length - 1; i++) {\n \t\tHuffmanTempTree zTree = new HuffmanTempTree(0);\n \t\tElement x = queue.extractMin();\n \t\tElement y = queue.extractMin();\n \t\tint zFreq = x.key + y.key;\n \t\tzTree.merge((HuffmanTempTree) x.data, (HuffmanTempTree) y.data);\n \t\tqueue.insert(new Element(zFreq, zTree));\n \t}\n \treturn (HuffmanTempTree) queue.extractMin().data;\n \t}",
"public Huffman(String input) {\n\t\t\n\t\tthis.input = input;\n\t\tmapping = new HashMap<>();\n\t\t\n\t\t//first, we create a map from the letters in our string to their frequencies\n\t\tMap<Character, Integer> freqMap = getFreqs(input);\n\n\t\t//we'll be using a priority queue to store each node with its frequency,\n\t\t//as we need to continually find and merge the nodes with smallest frequency\n\t\tPriorityQueue<Node> huffman = new PriorityQueue<>();\n\t\t\n\t\t/*\n\t\t * TODO:\n\t\t * 1) add all nodes to the priority queue\n\t\t * 2) continually merge the two lowest-frequency nodes until only one tree remains in the queue\n\t\t * 3) Use this tree to create a mapping from characters (the leaves)\n\t\t * to their binary strings (the path along the tree to that leaf)\n\t\t * \n\t\t * Remember to store the final tree as a global variable, as you will need it\n\t\t * to decode your encrypted string\n\t\t */\n\t\t\n\t\tfor (Character key: freqMap.keySet()) {\n\t\t\tNode thisNode = new Node(key, freqMap.get(key), null, null);\n\t\t\thuffman.add(thisNode);\n\t\t}\n\t\t\n\t\twhile (huffman.size() > 1) {\n\t\t\tNode leftNode = huffman.poll();\n\t\t\tNode rightNode = huffman.poll();\n\t\t\tint parentFreq = rightNode.freq + leftNode.freq;\n\t\t\tNode parent = new Node(null, parentFreq, leftNode, rightNode);\n\t\t\thuffman.add(parent);\n\t\t}\n\t\t\n\t\tthis.huffmanTree = huffman.poll();\n\t\twalkTree();\n\t}",
"private void buildBinaryTree() {\n log.info(\"Constructing priority queue\");\n Huffman huffman = new Huffman(cache.vocabWords());\n huffman.build();\n\n log.info(\"Built tree\");\n\n }",
"public static HuffmanNode huffmanAlgo() {\r\n\t\tHuffmanNode root;\r\n\t\t\r\n\t\twhile(nodeArrList.size() > 1) {\r\n\t\t\tif(nodeArrList.get(0).frequency == 0) {\r\n\t\t\t\tnodeArrList.remove(0);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tHuffmanNode left = nodeArrList.remove(0);\r\n\t\t\t\tHuffmanNode right = nodeArrList.remove(0);\r\n\t\t\t\tHuffmanNode replacement = new HuffmanNode(null, left.frequency + right.frequency);\r\n\t\t\t\treplacement.left = left;\r\n\t\t\t\treplacement.right = right;\r\n\t\t\t\tnodeArrList.add(replacement);\r\n\t\t\t}\r\n\t\t}\r\n\t\troot = nodeArrList.get(0);\r\n\t\treturn root;\r\n\t}",
"public HuffmanCoding(String text) {\n\t\t// TODO fill this in.\n\t\tif (text.length() <= 1)\n\t\t\treturn;\n\n\t\t//Create a the frequency huffman table\n\t\tHashMap<Character, huffmanNode> countsMap = new HashMap<>();\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tchar c = text.charAt(i);\n\t\t\tif (countsMap.containsKey(c))\n\t\t\t\tcountsMap.get(c).huffmanFrequency++;\n\t\t\telse\n\t\t\t\tcountsMap.put(c, new huffmanNode(c, 1));\n\t\t}\n\n\t\t//Build the frequency tree\n\t\tPriorityQueue<huffmanNode> countQueue = new PriorityQueue<>(countsMap.values());\n\t\twhile (countQueue.size() > 1) {\n\t\t\thuffmanNode left = countQueue.poll();\n\t\t\thuffmanNode right = countQueue.poll();\n\t\t\thuffmanNode parent = new huffmanNode('\\0', left.huffmanFrequency + right.huffmanFrequency);\n\t\t\tparent.leftNode = left;\n\t\t\tparent.rightNode = right;\n\n\t\t\tcountQueue.offer(parent);\n\t\t}\n\n\t\thuffmanNode rootNode = countQueue.poll();\n\n\t\t//Assign the codes to each node in the tree\n\t\tStack<huffmanNode> huffmanNodeStack = new Stack<>();\n\t\thuffmanNodeStack.add(rootNode);\n\t\twhile (!huffmanNodeStack.empty()) {\n\t\t\thuffmanNode huffmanNode = huffmanNodeStack.pop();\n\n\t\t\tif (huffmanNode.huffmanValue != '\\0') {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\thuffmanNode.codeRecord.forEach(sb::append);\n\t\t\t\tString codeSb = sb.toString();\n\n\t\t\t\tencodingTable.put(huffmanNode.huffmanValue, codeSb);\n\t\t\t\tdecodingTable.put(codeSb, huffmanNode.huffmanValue);\n\t\t\t}\n\t\t\telse {\n\t\t\t\thuffmanNode.leftNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.leftNode.codeRecord.add('0');\n\t\t\t\thuffmanNode.rightNode.codeRecord.addAll(huffmanNode.codeRecord);\n\t\t\t\thuffmanNode.rightNode.codeRecord.add('1');\n\t\t\t}\n\n\t\t\tif (huffmanNode.leftNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.leftNode);\n\n\t\t\tif (huffmanNode.rightNode != null)\n\t\t\t\thuffmanNodeStack.add(huffmanNode.rightNode);\n\t\t}\n\t}",
"public Node buildTree(int[] frequency)\n {\n /* Initialize the priority queue */\n pq=new PriorityQueue<Node>(c.size(),comp); \n p=new PriorityQueue<Node>(c.size(),comp); \n /* Create leaf node for each unique character in the string */\n for(int i = 0; i < c.size(); i++)\n { \n pq.offer(new Node(c.get(i), frequency[i], null, null));\n } \n createCopy(pq); \n /* Until there is only one node in the priority queue */\n while(pq.size() > 1)\n { \n /* Minimum frequency is kept in the left */\n Node left = pq.poll();\n /* Next minimum frequency is kept in the right */\n Node right = pq.poll();\n /* Create a new internal node as the parent of left and right */\n pq.offer(new Node('\\0', left.frequency+right.frequency, left, right)); \n } \n /* Return the only node which is the root */\n return pq.poll();\n }",
"public static HuffmanNode createTree(HuffmanNode[] nodeArr){\n HuffmanNode[] garbageArr = nodeArr;\n while(garbageArr.length != 1){\n HuffmanNode[] tempArr = new HuffmanNode[garbageArr.length-1];\n tempArr[0] = combineNodes(garbageArr[0], garbageArr[1]);\n for(int i = 1; i < garbageArr.length-1; i++){\n tempArr[i] = garbageArr[i+1];\n }\n garbageArr = freqSort(tempArr);\n }\n return garbageArr[0];\n }",
"public BinaryTree<HuffData> getHuffTree() {\n return huffTree;\n }",
"public static void HuffmanTree(String input, String output) throws Exception {\n\t\tFileReader inputFile = new FileReader(input);\n\t\tArrayList<HuffmanNode> tree = new ArrayList<HuffmanNode>(200);\n\t\tchar current;\n\t\t\n\t\t// loops through the file and creates the nodes containing all present characters and frequencies\n\t\twhile((current = (char)(inputFile.read())) != (char)-1) {\n\t\t\tint search = 0;\n\t\t\tboolean found = false;\n\t\t\twhile(search < tree.size() && found != true) {\n\t\t\t\tif(tree.get(search).inChar == (char)current) {\n\t\t\t\t\ttree.get(search).frequency++; \n\t\t\t\t\tfound = true;\n\t\t\t\t}\n\t\t\t\tsearch++;\n\t\t\t}\n\t\t\tif(found == false) {\n\t\t\t\ttree.add(new HuffmanNode(current));\n\t\t\t}\n\t\t}\n\t\tinputFile.close();\n\t\t\n\t\t//creates the huffman tree\n\t\tcreateTree(tree);\n\t\t\n\t\t//the huffman tree\n\t\tHuffmanNode sortedTree = tree.get(0);\n\t\t\n\t\t//prints out the statistics of the input file and the space saved\n\t\tFileWriter newVersion = new FileWriter(\"C:\\\\Users\\\\Chris\\\\workspace\\\\P2\\\\src\\\\P2_cxt240_Tsuei_statistics.txt\");\n\t\tprintTree(sortedTree, \"\", newVersion);\n\t\tspaceSaver(newVersion);\n\t\tnewVersion.close();\n\t\t\n\t\t// codes the file using huffman encoding\n\t\tFileWriter outputFile = new FileWriter(output);\n\t\ttranslate(input, outputFile);\n\t}",
"private static TreeNode<Character> buildTree () {\n // build left half\n TreeNode<Character> s = new TreeNode<Character>('S', \n new TreeNode<Character>('H'),\n new TreeNode<Character>('V'));\n\n TreeNode<Character> u = new TreeNode<Character>('U', \n new TreeNode<Character>('F'),\n null);\n \n TreeNode<Character> i = new TreeNode<Character>('I', s, u);\n\n TreeNode<Character> r = new TreeNode<Character>('R', \n new TreeNode<Character>('L'), \n null);\n\n TreeNode<Character> w = new TreeNode<Character>('W', \n new TreeNode<Character>('P'),\n new TreeNode<Character>('J'));\n\n TreeNode<Character> a = new TreeNode<Character>('A', r, w);\n\n TreeNode<Character> e = new TreeNode<Character>('E', i, a);\n\n // build right half\n TreeNode<Character> d = new TreeNode<Character>('D', \n new TreeNode<Character>('B'),\n new TreeNode<Character>('X'));\n\n TreeNode<Character> k = new TreeNode<Character>('K', \n new TreeNode<Character>('C'),\n new TreeNode<Character>('Y'));\n\n TreeNode<Character> n = new TreeNode<Character>('N', d, k);\n\n\n TreeNode<Character> g = new TreeNode<Character>('G', \n new TreeNode<Character>('Z'),\n new TreeNode<Character>('Q'));\n\n TreeNode<Character> o = new TreeNode<Character>('O');\n\n TreeNode<Character> m = new TreeNode<Character>('M', g, o);\n\n TreeNode<Character> t = new TreeNode<Character>('T', n, m);\n\n // build the root\n TreeNode<Character> root = new TreeNode<Character>(null, e, t);\n return root;\n }",
"public static TreeNode getTree() {\n\t\tTreeNode a = new TreeNode(\"a\", 314);\n\t\tTreeNode b = new TreeNode(\"b\", 6);\n\t\tTreeNode c = new TreeNode(\"c\", 271);\n\t\tTreeNode d = new TreeNode(\"d\", 28);\n\t\tTreeNode e = new TreeNode(\"e\", 0);\n\t\tTreeNode f = new TreeNode(\"f\", 561);\n\t\tTreeNode g = new TreeNode(\"g\", 3);\n\t\tTreeNode h = new TreeNode(\"h\", 17);\n\t\tTreeNode i = new TreeNode(\"i\", 6);\n\t\tTreeNode j = new TreeNode(\"j\", 2);\n\t\tTreeNode k = new TreeNode(\"k\", 1);\n\t\tTreeNode l = new TreeNode(\"l\", 401);\n\t\tTreeNode m = new TreeNode(\"m\", 641);\n\t\tTreeNode n = new TreeNode(\"n\", 257);\n\t\tTreeNode o = new TreeNode(\"o\", 271);\n\t\tTreeNode p = new TreeNode(\"p\", 28);\n\t\t\n\t\ta.left = b; b.parent = a;\n\t\tb.left = c; c.parent = b;\n\t\tc.left = d;\t d.parent = c;\n\t\tc.right = e; e.parent = c;\n\t\tb.right = f; f.parent = b;\n\t\tf.right = g; g.parent = f;\n\t\tg.left = h; h.parent = g;\n\t\ta.right = i; i.parent = a;\n\t\ti.left = j; j.parent = i;\n\t\ti.right = o; o.parent = i;\n\t\tj.right = k; k.parent = j;\n\t\to.right = p; p.parent = o;\n\t\tk.right = n; n.parent = k;\n\t\tk.left = l; l.parent = k;\n\t\tl.right = m; m.parent = l;\n\t\t\n\t\td.childrenCount = 0;\n\t\te.childrenCount = 0;\n\t\tc.childrenCount = 2;\n\t\tb.childrenCount = 6;\n\t\tf.childrenCount = 2;\n\t\tg.childrenCount = 1;\n\t\th.childrenCount = 0;\n\t\tl.childrenCount = 1;\n\t\tm.childrenCount = 0;\n\t\tn.childrenCount = 0;\n\t\tk.childrenCount = 3;\n\t\tj.childrenCount = 4;\n\t\to.childrenCount = 1;\n\t\tp.childrenCount = 0;\n\t\ti.childrenCount = 7;\n\t\ta.childrenCount = 15;\n\t\t\n\t\treturn a;\n\t}",
"public HuffmanTree(ArrayOrderedList<HuffmanPair> pairsList) {\r\n\r\n\t\t\t\r\n\t\tArrayOrderedList<HuffmanTree> buildList = new ArrayOrderedList<HuffmanTree>();\r\n\t\tIterator<HuffmanPair> iterator = pairsList.iterator();\r\n\t\t\twhile (iterator.hasNext()) {\r\n\t\t\t\tbuildList.add(new HuffmanTree(iterator.next()));\r\n//\t\t\t\tif(buildList.first().getRoot().getElement().getCharacter() == iterator.next().getCharacter())i++;\r\n\t\t\t}\r\n//\t\t\tif (i == buildList.size()) {\r\n//\t\t\t\tArrayOrderedList<HuffmanTree> new_buildList = new ArrayOrderedList<HuffmanTree>();\r\n//\t\t\t\tnew_buildList.add(buildList.first());\r\n//\t\t\t\tbuildList = new_buildList;\r\n//\t\t\t}\r\n//\t\t\telse {\t\r\n\t\t\twhile (buildList.size() > 1) {\r\n\t\t\t\tHuffmanTree lefttree = buildList.removeFirst(); HuffmanTree righttree = buildList.removeFirst();\r\n\t\t\t\t//totalFre = the total weights of both trees.\r\n\t\t\t\tint totalFre = lefttree.getRoot().getElement().getFrequency() + righttree.getRoot().getElement().getFrequency();\r\n\t\t\t\tHuffmanPair root = new HuffmanPair(totalFre);\r\n\t\t\t\tbuildList.add(new HuffmanTree(root, lefttree, righttree));\r\n\t\t\t}\r\n\t\tthis.setRoot(buildList.first().getRoot());\r\n\t}",
"public void encodeTreeHelper(HuffmanNode node, StringBuilder builder){\n if(node.getLeft() == null && node.getRight()== null && !node.getCharAt().equals(null))\n encodedTable.put(node.getCharAt(),builder.toString());\n else{\n encodeTreeHelper(node.getLeft(), builder.append(\"0\"));\n encodeTreeHelper(node.getRight(), builder.append(\"1\"));\n }\n \n if(builder.length()>0)\n builder.deleteCharAt(builder.length()-1);\n }",
"public static Node buildHuffManTree(PriorityQueue<Node> queue) {\n\t\t\n\t\twhile(queue.size()>1) {\n\t\t\t\n\t\t\tNode left = queue.poll();\n\t\t\tNode right = queue.poll();\n\t\t\t\n\t\t\tNode root = new Node(left.frequency + right.frequency);\n\t\t\troot.left = left;\n\t\t\troot.right = right;\n\t\t\t\n\t\t\tqueue.add(root);\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\treturn queue.poll();\n\t\t\n\t}",
"public interface ITreeMaker {\n /**\n * Return the Huffman/coding tree.\n * @return the Huffman tree\n */\n public HuffTree makeHuffTree(InputStream stream) throws IOException;\n}",
"public static void main(String[] args) throws FileNotFoundException, IOException {\n\t\tString input = \"\";\r\n\r\n\t\t//읽어올 파일 경로\r\n\t\tString filePath = \"C:/Users/user/Desktop/data13_huffman.txt\";\r\n\r\n\t\t//파일에서 읽어옴\r\n\t\ttry(FileInputStream fStream = new FileInputStream(filePath);){\r\n\t\t\tbyte[] readByte = new byte[fStream.available()];\r\n\t\t\twhile(fStream.read(readByte) != -1);\r\n\t\t\tfStream.close();\r\n\t\t\tinput = new String(readByte);\r\n\t\t}\r\n\r\n\t\t//빈도수 측정 해시맵 생성\r\n\t\tHashMap<Character, Integer> frequency = new HashMap<>();\r\n\t\t//최소힙 생성\r\n\t\tList<Node> nodes = new ArrayList<>();\r\n\t\t//테이블 생성 해시맵\r\n\t\tHashMap<Character, String> table = new HashMap<>();\r\n\r\n\t\t//노드와 빈도수 측정\r\n\t\tfor(int i = 0; i < input.length(); i++) {\r\n\t\t\tif(frequency.containsKey(input.charAt(i))) {\r\n\t\t\t\t//이미 있는 값일 경우 빈도수를 1 증가\r\n\t\t\t\tchar currentChar = input.charAt(i);\r\n\t\t\t\tfrequency.put(currentChar, frequency.get(currentChar) + 1);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t//키를 생성해서 넣어줌\r\n\t\t\t\tfrequency.put(input.charAt(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//최소 힙에 저장\r\n\t\tfor(Character key : frequency.keySet()) \r\n\t\t\tnodes.add(new Node(key, frequency.get(key), null, null));\r\n\t\t\t\t\r\n\t\t//최소힙으로 정렬\r\n\t\tbuildMinHeap(nodes);\r\n\r\n\t\t//huffman tree를 만드는 함수 실행\r\n\t\tNode resultNode = huffman(nodes);\r\n\r\n\t\t//파일에 씀 (table)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_table.txt\")){\r\n\t\t\tmakeTable(table, resultNode, \"\");\r\n\t\t\tfor(Character key : table.keySet()) {\r\n\t\t\t\t//System.out.println(key + \" : \" + table.get(key));\r\n\t\t\t\tfw.write(key + \" : \" + table.get(key) + \"\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//파일에 씀 (encoded code)\r\n\t\ttry(FileWriter fw = new FileWriter(\"201702034_encoded.txt\")){\r\n\t\t\tString allString = \"\";\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < input.length(); i++)\r\n\t\t\t\tallString += table.get(input.charAt(i));\r\n\r\n\t\t\t//System.out.println(allString);\r\n\t\t\tfw.write(allString);\r\n\t\t}\r\n\t}",
"public HuffmanCompressor(){\n charList = new ArrayList<HuffmanNode>();\n }",
"public static void main(String[] args) {\n Huffman huffman=new Huffman(\"Shevchenko Vladimir Vladimirovich\");\n System.out.println(huffman.getCodeText());//\n //answer:110100001001101011000001001110111110110101100110110001001110101111100011101000011011000100111010111110001110100101110101111100000\n\n huffman.getSizeBits();//размер в битах\n ;//кол-во символов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*8)); //коэффициент сжатия относительно aski кодов\n System.out.println((double) huffman.getSizeBits()/(huffman.getValueOfCharactersOfText()*\n (Math.pow(huffman.getValueOfCharactersOfText(),0.5)))); //коэффициент сжатия относительно равномерного кода. Не учитывается размер таблицы\n System.out.println(huffman.getMediumLenght());//средняя длина кодового слова\n System.out.println(huffman.getDisper());//дисперсия\n\n\n }",
"@Test\r\n public void testEncode() throws Exception {\r\n System.out.println(\"encode\");\r\n String message = \"furkan\";\r\n \r\n HuffmanTree Htree = new HuffmanTree();\r\n\r\n HuffmanTree.HuffData[] symbols = {\r\n new HuffmanTree.HuffData(186, '_'),\r\n new HuffmanTree.HuffData(103, 'e'),\r\n new HuffmanTree.HuffData(80, 't'),\r\n new HuffmanTree.HuffData(64, 'a'),\r\n new HuffmanTree.HuffData(63, 'o'),\r\n new HuffmanTree.HuffData(57, 'i'),\r\n new HuffmanTree.HuffData(57, 'n'),\r\n new HuffmanTree.HuffData(51, 's'),\r\n new HuffmanTree.HuffData(48, 'r'),\r\n new HuffmanTree.HuffData(47, 'h'),\r\n new HuffmanTree.HuffData(32, 'b'),\r\n new HuffmanTree.HuffData(32, 'l'),\r\n new HuffmanTree.HuffData(23, 'u'),\r\n new HuffmanTree.HuffData(22, 'c'),\r\n new HuffmanTree.HuffData(21, 'f'),\r\n new HuffmanTree.HuffData(20, 'm'),\r\n new HuffmanTree.HuffData(18, 'w'),\r\n new HuffmanTree.HuffData(16, 'y'),\r\n new HuffmanTree.HuffData(15, 'g'),\r\n new HuffmanTree.HuffData(15, 'p'),\r\n new HuffmanTree.HuffData(13, 'd'),\r\n new HuffmanTree.HuffData(8, 'v'),\r\n new HuffmanTree.HuffData(5, 'k'),\r\n new HuffmanTree.HuffData(1, 'j'),\r\n new HuffmanTree.HuffData(1, 'q'),\r\n new HuffmanTree.HuffData(1, 'x'),\r\n new HuffmanTree.HuffData(1, 'z')\r\n };\r\n\r\n Htree.buildTree(symbols);\r\n \r\n String expResult = \"1100110000100101100001110100111\";\r\n String result = Htree.encode(message, Htree.huffTree);\r\n \r\n assertEquals(expResult, result);\r\n \r\n }",
"public HuffmanNode(String key, int value)\n\t{\n\t\tcharacters = key;\n\t\tfrequency = value;\n\t\t\n\t\tleft = null;\n\t\tright = null;\n\t\tparent = null;\n\t\tchecked = false;\n\t}",
"public HuffmanNode(int freq, HuffmanNode left, HuffmanNode right){\r\n this.freq = freq;\r\n this.left = left;\r\n this.right = right;\r\n }",
"public void buildTree(HuffData[] symbols) {\n //Create a new priorityqueue of type BinaryTree<HuffData> the size of \n //the number of symbols passed in\n Queue<BinaryTree<HuffData>> theQueue = new PriorityQueue<BinaryTree<HuffData>>(symbols.length, new CompareHuffmanTrees());\n //For each symbol in the symbols array\n for (HuffData nextSymbol : symbols) {\n //Create a new binary tree with the symbol\n BinaryTree<HuffData> aBinaryTree = new BinaryTree<HuffData>(nextSymbol, null, null);\n //Offer the new binary tree to the queue\n theQueue.offer(aBinaryTree);\n }\n //While there are still more than one items in the queue\n while(theQueue.size() > 1) {\n BinaryTree<HuffData> left = theQueue.poll(); //Take the top off the queue\n BinaryTree<HuffData> right = theQueue.poll(); //Take the new top off the queue\n int wl = left.getData().weight; //Get the weight of the left BinaryTree\n int wr = left.getData().weight; //Get the weight of the right BinaryTree\n //Create a new HuffData object with the weight as the sum of the left\n //and right and a null symbol\n HuffData sum = new HuffData(wl + wr, null); \n //Create a new BinaryTree with the sum HuffData and the left and right\n //as the left and right children\n BinaryTree<HuffData> newTree = new BinaryTree<HuffData>(sum, left, right);\n //Offer the sum binarytree back to the queue\n theQueue.offer(newTree);\n }\n //Take the last item off the queue\n huffTree = theQueue.poll();\n \n //Initalize the EncodeData array to be the same length as the passed in symbols\n encodings = new EncodeData[symbols.length];\n }",
"private BinaryTree<Character> constructTree(){\n if(pq.size() == 1) return pq.poll().data;\n if(pq.size() == 0) return null;\n // Poll the lowest two trees, combine them, then stick them back in the queue.\n Helper<BinaryTree<Character>> temp0 = pq.poll(), temp1 = pq.poll(),\n result = new Helper<>(temp0.priority + temp1.priority, new BinaryTree<>(temp0.data, null , temp1.data));\n pq.add(result);\n // Call again to keep constructing.\n return constructTree();\n }",
"public HuffmanNode(int freq){\r\n this(freq, null, null);\r\n }",
"public static void createTree(ArrayList<HuffmanNode> tree) {\n\t\n\t\t//loops through until the tree.\n\t\twhile(tree.size() > 1) {\n\t\t\tCollections.sort(tree);\n\t\t\tHuffmanNode left = tree.get(0);\n\t\t\tHuffmanNode right = tree.get(1);\n\t\t\t\n\t\t\t/*creates the new node and adds it to the arrayList, and removes the two lowest frequency nodes\n\t\t\t * then recursively calls the create method again\n\t\t\t */\n\t\t\ttree.add(new HuffmanNode((right.frequency + left.frequency), left, right));\n\t\t\ttree.remove(0);\n\t\t\ttree.remove(0);\n\t\t\tcreateTree(tree);\n\t\t}\n\t}",
"public HuffmanNode(int freq, int ascii){\r\n this.freq = freq;\r\n this.ascii = ascii;\r\n }",
"public static String huffmanCoder(String inputFileName, String outputFileName){\n File inputFile = new File(inputFileName+\".txt\");\n File outputFile = new File(outputFileName+\".txt\");\n File encodedFile = new File(\"encodedTable.txt\");\n File savingFile = new File(\"Saving.txt\");\n HuffmanCompressor run = new HuffmanCompressor();\n \n run.buildHuffmanList(inputFile);\n run.makeTree();\n run.encodeTree();\n run.computeSaving(inputFile,outputFile);\n run.printEncodedTable(encodedFile);\n run.printSaving(savingFile);\n return \"Done!\";\n }",
"public CodeTree toCodeTree() {\n List<Node> nodes = new ArrayList<Node>();\n for (int i = max(codeLengths); i >= 0; i--) { // Descend through code lengths\n List<Node> newNodes = new ArrayList<Node>();\n\n // Add leaves for symbols with positive code length i\n if (i > 0) {\n for (int j = 0; j < codeLengths.length; j++) {\n if (codeLengths[j] == i)\n newNodes.add(new Leaf(j)); //Isidedame ASCII reiksmes ilgiausio kodo\n }\n }\n\n // Merge pairs of nodes from the previous deeper layer\n for (int j = 0; j < nodes.size(); j += 2) {\n newNodes.add(new InternalNode(nodes.get(j), nodes.get(j + 1))); //Sujungia lapus i InternalNodes\n }\n nodes = newNodes;\n }\n return new CodeTree((InternalNode)nodes.get(0), codeLengths.length);\n }",
"public HuffmanNode getLeftSubtree () {\n \treturn left;\n }",
"public HuffmanTree(HuffmanPair element) {\r\n\t\tsuper(element);\r\n\t}",
"private TreeNode createTree() {\n // Map<String, String> map = new HashMap<>();\n // map.put(\"dd\", \"qq\");\n // 叶子节点\n TreeNode G = new TreeNode(\"G\");\n TreeNode D = new TreeNode(\"D\");\n TreeNode E = new TreeNode(\"E\", G, null);\n TreeNode B = new TreeNode(\"B\", D, E);\n TreeNode H = new TreeNode(\"H\");\n TreeNode I = new TreeNode(\"I\");\n TreeNode F = new TreeNode(\"F\", H, I);\n TreeNode C = new TreeNode(\"C\", null, F);\n // 构造根节点\n TreeNode root = new TreeNode(\"A\", B, C);\n return root;\n }",
"public Hashtable<Character,Code> getHuffmanCodes(int numberOfCodes,Hashtable<String,Character> revCodes) throws IOException {\r\n\t\tbyte[] b;\r\n\t\tHashtable<Character,Code> codes = new Hashtable<>();\r\n\t\t for (int i = 0 ; i < numberOfCodes ; i++) {\r\n\t\t\t System.out.println(\"i = \" + i);\r\n\t\t\t // i create a stringBuilder that will hold the code for each character\r\n\t\t\t StringBuilder c = new StringBuilder();\r\n\t\t\t // read the integer (4 bytes)\r\n\t\t\t b = new byte[4];\r\n\t\t\t in.read(b);\r\n\t\t\t // will hold the 4 bytes\r\n\t\t\t int code = 0;\r\n\t\t\t \r\n\t\t\t /* beacuse we wrote the integer reversed in the head\r\n\t\t\t * so the first 2 bytes from the left will hold the huffman's code\r\n\t\t\t * we get the second one then stick it to the (code) value we shift it to the left \r\n\t\t\t * then we get the first one and stick it to the (code) without shifting it\r\n\t\t\t * so actually we swipe the first 2 bytes because they are reversed\r\n\t\t\t */\r\n\t\t\t code |= (b[1] & 0xFF);\r\n\t\t\t code <<= 8;\r\n\t\t\t code |= (b[0] & 0xFF);\r\n\t\t\t \r\n\t\t\t // this loop go throw the (code) n bits where n is the length of the huff code that stored in the 2nd index of the array\r\n\t\t\t for (int j = 0 ; j < (b[2] & 0xFF) ; j++) {\r\n\t\t\t\t /*\r\n\t\t\t\t * each loop we compare the first bit from the right using & operation ans if it 1 so insert 1 to he first of the (c) which hold the huff it self\r\n\t\t\t\t * and if it zero we will insert zero as a string for both zero or 1\r\n\t\t\t\t */\r\n\t\t\t\t if ((code & 1) == 1) {\r\n\t\t\t\t\t c.insert(0, \"1\");\r\n\t\t\t\t } else \r\n\t\t\t\t\t c.insert(0, \"0\");\r\n\t\t\t\t code >>>= 1;\r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t// codes.put((char)(b[3] & 0xFF), new Code((char)(b[3] & 0xFF),c.toString(),rep2[b[0] & 0xFF]));\r\n\t\t\t System.out.println(\"c = \" + c);\r\n\t\t\t \r\n\t\t\t // we store the huff code as a key in the hash and its value will be the character that in the index 3\r\n\t\t\t revCodes.put(c.toString(), (char)(b[3] & 0xFF));\r\n\t\t\t \r\n\t\t }\r\n\t\t return codes;\r\n\t}",
"public HuffmanCodes() {\n\t\thuffBuilder = new PriorityQueue<CS232LinkedBinaryTree<Integer, Character>>();\n\t\tfileData = new ArrayList<char[]>();\n\t\tfrequencyCount = new int[127];\n\t\thuffCodeVals = new String[127];\n\t}",
"public HuffmanNode(String v, int f)\n\t{\n\t\tfrequency = f;\n\t\tvalue = v;\n\t\tleft = null;\n\t\tright = null;\n\t}",
"public HuffmanTree(Queue<Node> queue) {\r\n while (queue.size() > 1) {\r\n Node left = queue.poll();\r\n Node right = queue.poll();\r\n Node node = new Node('-', left.f + right.f, left, right);\r\n queue.add(node);\r\n }\r\n this.root = queue.peek();\r\n\r\n //initial two maps\r\n this.initialTable(this.root, \"\");\r\n\r\n }",
"public TreeNode encode(Node root) {\n if (root == null) {\n return null;\n }\n TreeNode head = new TreeNode(root.val);\n head.left = en(root.children);\n return head;\n }",
"public HuffTree makeHuffTree(InputStream stream) throws IOException;",
"public LinkedList<BST> readHeader() {\n\t\tLinkedList<BST> leaves = new LinkedList<>();\n\t\n\t\tint codesProcessed;\t\t//Number of look-up items added to tree\n\n\t\t/*\n\t\t * Basic check: does header start with SOH byte?\n\t\t */\n\t\tgrabBits(8);\n\t\tif (!proc.equals(\"00000001\")) {\n\t\t\tSystem.out.println(\"File is corrupted or not compressed\");\n\t\t\treturn null;\n\t\t}\n\t\tSystem.out.println(proc);\n\t\tclear();\n\n\t\t/*\n\t\t * Determine number of codes to process.\n\t\t * Offset by +2 to allow for 257 unique codes.\n\t\t */\n\t\tgrabBits(8);\n\t\tint numCodes = Integer.parseInt(proc, 2) + 2;\n\t\tSystem.out.println(proc);\n\t\tclear();\n\n\t\t/*\n\t\t * Process look-up codes, reading NULL byte first\n\t\t */\n\t\tfor (int i = 0; i < numCodes; i++) {\n\t\t\t/* Get bitstring character code */\n\t\t\tif (i == 0) {\n\t\t\t\tgrabBits(4);\t//Null byte\n\t\t\t} else {\n\t\t\t\tgrabBits(8);\t//Regular byte\n\t\t\t}\n\t\t\tString bitstring = proc;\n\t\t\tSystem.out.print(bitstring + \"\\t\");\n\t\t\tclear();\n\n\t\t\t/* Get Huffman code length */\n\t\t\tgrabBits(8);\n\t\t\tint length = Integer.parseInt(proc, 2);\n\t\t\tSystem.out.print(length + \"\\t\");\n\t\t\tclear();\n\n\t\t\t/* Get Huffman code */\n\t\t\tgrabBits(length);\n\t\t\tString code = proc;\n\t\t\tSystem.out.println(code);\n\t\t\tclear();\n\n\t\t\t/* Build BST leaf for letter */\n\t\t\tBST leaf = new BST();\n\t\t\tBits symbol = new Bits(bitstring);\n\t\t\tsymbol.setCode(code);\n\t\t\tleaf.update(symbol);\n\t\t\tleaves.add(leaf);\n\t\t}\n\n\t\t/*\n\t\t * Does header end with STX byte?\n\t\t */\n\t\tgrabBits(8);\n\t\tif (!proc.equals(\"00000010\")) {\n\t\t\tSystem.out.println(\"Header corrupt: end of header without STX\");\n\t\t\treturn null;\n\t\t}\n\t\tclear();\n\n\t\treturn leaves;\n\t}",
"private Queue<HuffmanNode> ArrayHuffmanCodeCreator(Queue<HuffmanNode> frequencies) {\n while (frequencies.size() > 1) {\n HuffmanNode first = frequencies.poll();\n HuffmanNode second = frequencies.poll();\n HuffmanNode tempNode = new \n HuffmanNode(first.getFrequency() + second.getFrequency());\n tempNode.left = first;\n tempNode.right = second;\n frequencies.add(tempNode);\n }\n return frequencies;\n }",
"public String printBFSTree(){\n if(root==null)return \"\";\n String binstr=\"\";\n String valuestr=\"\";\n String codestr=\"\";\n LinkedList<HCNode> list=new LinkedList<HCNode>();\n root.code=\"\";\n list.add(root);\n HCNode node;\n while(list.size()>0){\n node=list.getFirst();\n if(node.left==null && node.right==null){\n binstr=binstr+\"0\";\n valuestr=valuestr+((byte)node.str.charAt(0))+\"\\n\";\n codestr=codestr+node.code;\n }else{\n binstr=binstr+\"1\";\n }\n if(node.left!=null){node.left.code=node.left.parent.code+\"0\";list.addLast(node.left);}\n if(node.right!=null){node.right.code=node.right.parent.code+\"1\";list.addLast(node.right);}\n list.removeFirst();\n }\n String res=binstr+\"\\n\"+valuestr+codestr+\"\\n\";\n System.out.println(binstr);\n System.out.print(valuestr);\n System.out.println(codestr);\n return res;\n }",
"public Node readTree() {\n boolean totuusarvo = b.readBoolean();\n if (totuusarvo == true) {\n return new Node(b.readShort(), -1, null, null);\n } else {\n return new Node(\"9000\", -1, readTree(), readTree());\n }\n }",
"public HuffmanCode(int[] frequencies) {\n Queue<HuffmanNode> nodeFrequencies = new PriorityQueue<HuffmanNode>();\n for (int i = 0; i < frequencies.length; i++) {\n if (frequencies[i] > 0) {\n nodeFrequencies.add(new HuffmanNode(frequencies[i], (char) i));\n }\n }\n nodeFrequencies = ArrayHuffmanCodeCreator(nodeFrequencies);\n this.front = nodeFrequencies.peek();\n }",
"public HuffmanNode getRightSubtree () {\n \treturn right;\n }",
"@Override\r\n\tpublic void buildTree() {\r\n\t\t\r\n\t\t// root level \r\n\t\trootNode = new TreeNode<String>(\"\");\r\n\t\t\r\n\t\t//first level\r\n\t\tinsert(\".\", \"e\");\r\n\t\tinsert(\"-\", \"t\");\r\n\t\t\r\n\t\t//second level\r\n\t\t\r\n\t\tinsert(\". .\", \"i\");\r\n\t\tinsert(\".-\", \"a\");\r\n\t\tinsert(\"-.\", \"n\"); \r\n\t\tinsert(\"--\", \"m\");\r\n\t\t\r\n\t\t//third level\r\n\t\tinsert(\"...\", \"s\");\r\n\t\tinsert(\"..-\", \"u\");\r\n\t\tinsert(\".-.\", \"r\");\r\n\t\tinsert(\".--\", \"w\");\r\n\t\tinsert(\"-..\", \"d\");\r\n\t\tinsert(\"-.-\", \"k\");\r\n\t\tinsert(\"--.\", \"g\");\r\n\t\tinsert(\"---\", \"o\");\r\n\t\t\r\n\t\t//fourth level\r\n\t\tinsert(\"....\", \"h\");\r\n\t\tinsert(\"...-\", \"v\");\r\n\t\tinsert(\"..-.\", \"f\");\r\n\t\tinsert(\".-..\", \"l\");\r\n\t\tinsert(\".--.\", \"p\");\r\n\t\tinsert(\".---\", \"j\");\r\n\t\tinsert(\"-...\", \"b\");\r\n\t\tinsert(\"-..-\", \"x\");\r\n\t\tinsert(\"-.-.\", \"c\");\r\n\t\tinsert(\"-.--\", \"y\");\r\n\t\tinsert(\"--..\", \"z\");\r\n\t\tinsert(\"--.-\", \"q\");\r\n\t\t\r\n\t}",
"public static void expand() {\n Node root = readTrie();\n\n // number of bytes to write\n int length = BinaryStdIn.readInt();\n\n // decode using the Huffman trie\n for (int i = 0; i < length; i++) {\n Node x = root;\n while (!x.isLeaf()) {\n boolean bit = BinaryStdIn.readBoolean();\n if (bit) x = x.right;\n else x = x.left;\n }\n BinaryStdOut.write(x.ch, 8);\n }\n BinaryStdOut.close();\n }",
"@Override\r\n public void run() {\n File huffmanFolder = newDirectoryEncodedFiles(file, encodedFilesDirectoryName);\r\n File huffmanTextFile = new File(huffmanFolder.getPath() + \"\\\\text.huff\");\r\n File huffmanTreeFile = new File(huffmanFolder.getPath() + \"\\\\tree.huff\");\r\n\r\n\r\n try (FileOutputStream textCodeOS = new FileOutputStream(huffmanTextFile);\r\n FileOutputStream treeCodeOS = new FileOutputStream(huffmanTreeFile)) {\r\n\r\n\r\n// Writing text bits to file text.huff\r\n StringBuilder byteStr;\r\n while (boolQueue.size() > 0 | !boolRead) {\r\n while (boolQueue.size() > 8) {\r\n byteStr = new StringBuilder();\r\n\r\n for (int i = 0; i < 8; i++) {\r\n String s = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(s);\r\n }\r\n\r\n if (isInterrupted())\r\n break;\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n\r\n if (fileRead && boolQueue.size() > 0) {\r\n lastBitsCount = boolQueue.size();\r\n byteStr = new StringBuilder();\r\n for (int i = 0; i < lastBitsCount; i++) {\r\n String bitStr = boolQueue.get() ? \"1\" : \"0\";\r\n byteStr.append(bitStr);\r\n }\r\n\r\n for (int i = 0; i < 8 - lastBitsCount; i++) {\r\n byteStr.append(\"0\");\r\n }\r\n\r\n byte b = parser.parseStringToByte(byteStr.toString());\r\n textCodeOS.write(b);\r\n }\r\n }\r\n\r\n\r\n// Writing the info for decoding to tree.huff\r\n// Writing last bits count to tree.huff\r\n treeCodeOS.write((byte)lastBitsCount);\r\n\r\n// Writing info for Huffman tree to tree.huff\r\n StringBuilder treeBitsArray = new StringBuilder();\r\n treeBitsArray.append(\r\n parser.parseByteToBinaryString(\r\n (byte) codesMap.size()));\r\n\r\n codesMap.keySet().forEach(key -> {\r\n String keyBits = parser.parseByteToBinaryString((byte) (char) key);\r\n String valCountBits = parser.parseByteToBinaryString((byte) codesMap.get(key).length());\r\n\r\n treeBitsArray.append(keyBits);\r\n treeBitsArray.append(valCountBits);\r\n treeBitsArray.append(codesMap.get(key));\r\n });\r\n if ((treeBitsArray.length() / 8) != 0) {\r\n int lastBitsCount = boolQueue.size() / 8;\r\n for (int i = 0; i < 7 - lastBitsCount; i++) {\r\n treeBitsArray.append(\"0\");\r\n }\r\n }\r\n\r\n for (int i = 0; i < treeBitsArray.length() / 8; i++) {\r\n treeCodeOS.write(parser.parseStringToByte(\r\n treeBitsArray.substring(8 * i, 8 * (i + 1))));\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"private static Node getTree()\r\n {\r\n Node node1 = new Node( 1 );\r\n Node node2 = new Node( 2 );\r\n Node node3 = new Node( 3 );\r\n Node node4 = new Node( 4 );\r\n Node node5 = new Node( 5 );\r\n Node node6 = new Node( 6 );\r\n Node node7 = new Node( 7 );\r\n\r\n node1.left = node2;\r\n node1.right = node3;\r\n\r\n node2.left = node4;\r\n node2.right = node5;\r\n\r\n node3.left = node6;\r\n node3.right = node7;\r\n return node1;\r\n }",
"public static void main(String args[])\n {\n Scanner s = new Scanner(System.in).useDelimiter(\"\");\n List<node> freq = new SinglyLinkedList<node>();\n \n // read data from input\n while (s.hasNext())\n {\n // s.next() returns string; we're interested in first char\n char c = s.next().charAt(0);\n if (c == '\\n') continue;\n // look up character in frequency list\n node query = new node(c);\n node item = freq.remove(query);\n if (item == null)\n { // not found, add new node\n freq.addFirst(query);\n } else { // found, increment node\n item.frequency++;\n freq.addFirst(item);\n }\n }\n \n // insert each character into a Huffman tree\n OrderedList<huffmanTree> trees = new OrderedList<huffmanTree>();\n for (node n : freq)\n {\n trees.add(new huffmanTree(n));\n }\n \n // merge trees in pairs until one remains\n Iterator ti = trees.iterator();\n while (trees.size() > 1)\n {\n // construct a new iterator\n ti = trees.iterator();\n // grab two smallest values\n huffmanTree smallest = (huffmanTree)ti.next();\n huffmanTree small = (huffmanTree)ti.next();\n // remove them\n trees.remove(smallest);\n trees.remove(small);\n // add bigger tree containing both\n trees.add(new huffmanTree(smallest,small));\n }\n // print only tree in list\n ti = trees.iterator();\n Assert.condition(ti.hasNext(),\"Huffman tree exists.\");\n huffmanTree encoding = (huffmanTree)ti.next();\n encoding.print();\n }",
"public TreeNode encode(Node root) {\n\t\t\tif (root == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tTreeNode head = new TreeNode(root.val);\n\t\t\thead.left = en(root.children);\n\t\t\treturn head;\n\t\t}",
"public HIRTree(){\r\n\t\t\r\n\t}",
"public HuffmanNode (HuffmanToken token) {\n \ttotalFrequency = token.getFrequency();\n \ttokens = new ArrayList<HuffmanToken>();\n \ttokens.add(token);\n \tleft = null;\n \tright = null;\n }",
"public MorseCodeTree()\r\n\t{\r\n\t\tbuildTree();\r\n\t}",
"public static TreeNode buildTree() {\n\t\t\n\t\tTreeNode root = new TreeNode(1);\n\t\t\n\t\tTreeNode left = new TreeNode(2);\n\t\tleft.left = new TreeNode(4);\n\t\tleft.right = new TreeNode(5);\n\t\tleft.right.right = new TreeNode(8);\n\t\t\n\t\tTreeNode right = new TreeNode(3);\n\t\tright.left = new TreeNode(6);\n\t\tright.right = new TreeNode(7);\n\t\tright.right.left = new TreeNode(9);\n\t\t\n\t\troot.left = left;\n\t\troot.right = right;\n\t\t\n\t\treturn root;\n\t}",
"public static TreeNode buildTree01() {\n\t\t\n\t\tTreeNode root = new TreeNode(5);\n\t\t\n\t\troot.left = new TreeNode(4);\n\t\troot.left.left = new TreeNode(11);\n\t\troot.left.left.left = new TreeNode(7);\n\t\troot.left.left.right = new TreeNode(2);\n\t\t\n\t\troot.right = new TreeNode(8);\n\t\troot.right.left = new TreeNode(13);\n\t\troot.right.right = new TreeNode(4);\n\t\troot.right.right.right = new TreeNode(1);\n\t\t\n\t\treturn root;\n\t}",
"public String treeType();",
"public void encodeTree(){\n StringBuilder builder = new StringBuilder();\n encodeTreeHelper(root,builder);\n }",
"public static ResolutionNode generateResolutionTree(){\n\t\tConnection con = null;\n\t\ttry {\n\t\t\tcon = getConnection();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t};\n\t\tResolutionNode tree = new ResolutionNode();\n\t\ttree.setAc_id(0);\n\t\ttree.setName(\"root\");\n\t\ttree.setPath(\"\");\n\t\ttree.setSupertype(tree);\n\t\tResolutionNode r = generateResolutionTree(0, tree, new ArrayList<ContextParameterType>(), new ArrayList<QualityParameterType>(), new ArrayList<CostParameterType>(), new ArrayList<RankingParameterType>(), \"root\");\n\t\tcloseConnnection(con);\n\t\treturn r;\n\t}",
"private void encodeTree(BitOutputStore output, SymbolNode root) {\n output.appendBits(8, nLeafNodes - 1);\n SymbolNode[] path = new SymbolNode[256];\n int[] pathBranch = new int[256];\n path[0] = root;\n pathBranch[0] = 0;\n int depth = 1;\n while (depth > 0) {\n int index = depth - 1;\n SymbolNode pNode = path[index];\n int pBranch = pathBranch[index];\n // pBranch is set as follows:\n // 0 we've just arrived at the node and have not yet\n // identified whether it is a branch or a leaf.\n // we have not yet traversed any of its children\n //\n // 1 we traversed down the left branch and need to traverse\n // down the right\n //\n // 2 we have traversed both branches and are on our way up\n\n switch (pBranch) {\n case 0:\n // we've just pushed the node on the stack and have not yet\n // identified whether it is a leaf or a branch.\n if (pNode.isLeaf) {\n output.appendBit(1); // terminal\n output.appendBits(8, pNode.symbol);\n BitOutputStore bitpath = encodePath(depth, path);\n pNode.nBitsInCode = bitpath.getEncodedTextLength();\n pNode.code = bitpath.getEncodedText();\n // pop the stack\n depth--;\n index--;\n // pro-forma, clear the stack variables\n pathBranch[depth] = 0;\n path[depth] = null;\n\n } else {\n output.appendBit(0); // non-terminal\n pathBranch[index] = 1;\n pathBranch[depth] = 0;\n path[depth] = pNode.left;\n depth++;\n }\n break;\n case 1:\n pathBranch[index] = 2;\n pathBranch[depth] = 0;\n path[depth] = pNode.right;\n depth++;\n break;\n case 2:\n // we're on our way up\n pathBranch[index] = 0;\n path[index] = null;\n depth--;\n break;\n default:\n // error condition, won't happen\n throw new IllegalStateException(\"Internal error encoding tree\");\n }\n }\n }",
"private void writeTree() throws IOException {\n\t\ttry (final BufferedWriter writer = Files.newBufferedWriter(destinationFile, CHARSET)) {\n\t\t\tfinal char[] treeString = new char[512];\n\t\t\tint treeStringLength = 0;\n\t\t\tfor (final CharacterCode cur : sortedCodes) {\n\t\t\t\ttreeString[treeStringLength++] = cur.getChar();\n\t\t\t\ttreeString[treeStringLength++] = (char) cur.getCode().length();\n\t\t\t}\n\t\t\tif (treeStringLength > 0xff) { //tree length will not always be less than 255, we have to write it on two bytes\n\t\t\t\tfinal int msb = (treeStringLength & 0xff00) >> Byte.SIZE;\n\t\t\t\ttreeStringLength &= 0x00ff;\n\t\t\t\twriter.write(msb);\n\t\t\t} else {\n\t\t\t\twriter.write(0);\n\t\t\t}\n\t\t\twriter.write(treeStringLength);\n\t\t\twriter.write(treeString, 0, treeStringLength);\n\t\t}\n\t}",
"public void insert(HuffmanTree node);",
"private Node makeTree(Node currentNode, DataNode dataNode,\r\n\t\t\tint featureSubsetSize, int height) {\n\r\n\t\tif (dataNode.labels.size() < this.traineeDataSize / 25 || height > 7) {\r\n\t\t\treturn new Node(majority(dataNode));\r\n\t\t}\r\n\t\telse{\r\n\r\n\t\t\tEntropyCalculation e1 = new EntropyCalculation();\r\n\r\n\t\t\tNode n = e1.maxGainedElement(dataNode.features, dataNode.labels, featureSubsetSize); //new\r\n\r\n\r\n\t\t\tif(e1.zeroEntropy){\r\n\r\n\t\t\t\tcurrentNode = new Node(dataNode.labels.get(0));\r\n\r\n\t\t\t\t/*currentNode.attribute = dataNode.features;\r\n\t\t\t\tcurrentNode.decision = dataNode.labels;\r\n\t\t\t\tcurrentNode.nodeValue = dataNode.labels.get(0);*/\r\n\r\n\t\t\t\treturn currentNode;\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\tcurrentNode = new Node();\r\n\r\n\t\t\t\tcurrentNode.featureIndexColumn = n.featureIndexColumn;\r\n\t\t\t\tcurrentNode.featureIndexRow = n.featureIndexRow;\r\n\r\n\t\t\t\tcurrentNode.attribute = dataNode.features;\r\n\t\t\t\tcurrentNode.decision = dataNode.labels;\r\n\r\n\t\t\t\tcurrentNode.nodeValue = dataNode.features.get(currentNode.featureIndexRow).get(currentNode.featureIndexColumn);\r\n\r\n\t\t\t\tcurrentNode.leftChild = new Node();\r\n\t\t\t\tcurrentNode.rightChild = new Node();\r\n\r\n\t\t\t\tDataNode leftNode = new DataNode();\r\n\t\t\t\tDataNode rightNode = new DataNode();\r\n\r\n\t\t\t\tfor (int i = 0; i < dataNode.features.size(); i++) {\r\n\r\n\t\t\t\t\tif(currentNode.nodeValue >= dataNode.features.get(i).get(currentNode.featureIndexColumn)) {\r\n\r\n\t\t\t\t\t\tleftNode.features.add(dataNode.features.get(i));\r\n\t\t\t\t\t\tleftNode.labels.add(dataNode.labels.get(i));\r\n\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\r\n\t\t\t\t\t\trightNode.features.add(dataNode.features.get(i));\r\n\t\t\t\t\t\trightNode.labels.add(dataNode.labels.get(i));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif((leftNode.labels.isEmpty() || rightNode.labels.isEmpty()) && height == 0){\r\n\t\t\t\t\tSystem.out.println(\"Ghapla\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tcurrentNode.leftChild = makeTree(currentNode.leftChild, leftNode, featureSubsetSize, height+1);\r\n\r\n\t\t\t\tcurrentNode.rightChild = makeTree(currentNode.rightChild, rightNode, featureSubsetSize, height+1);\r\n\r\n\t\t\t\treturn currentNode;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private void HuffmanPrinter(HuffmanNode node, String s, PrintStream output) {\n if (node.left == null) {\n output.println((byte) node.getData());\n output.println(s);\n } else {\n HuffmanPrinter(node.left, s + 0, output);\n HuffmanPrinter(node.right, s + 1, output);\n }\n }",
"private void getTreeShape() {\n int treeSizeInBytes = (int) (Math.ceil(treeSize / (double) Byte.SIZE));\n // converting tree shape in bytes to the bitset;\n BitSet bs = BitSet.valueOf(Arrays.copyOfRange(buffer.array(), bufferPosition, bufferPosition + treeSizeInBytes));\n bufferPosition += treeSizeInBytes;\n\n int treeLeavesAmount = 0;\n for (int i = 0; i < treeSize; i++) {\n boolean bit = bs.get(i);\n if (!bit) {\n treeLeavesAmount += 1;\n }\n treeShape.add(bit);\n }\n\n // adding tree leaves to the linked list;\n for (int i = bufferPosition; i < bufferPosition + treeLeavesAmount; i++) {\n treeLeaves.add(buffer.get(i));\n }\n // increasing buffer position for the amount of leaves(unique bytes);\n bufferPosition = bufferPosition + treeLeavesAmount;\n }",
"public HuffmanCode(Scanner input) {\n this.front = new HuffmanNode();\n while (input.hasNextLine()) {\n int character = Integer.parseInt(input.nextLine());\n String location = input.nextLine();\n ScannerHuffmanCodeCreator(this.front, location, (char) character);\n }\n }",
"private HuffmanTreeNode[] heapify(int freq[][]) {\n\t\tHuffmanTreeNode[] heap = new HuffmanTreeNode[freq.length];\n\t\tfor (int i = 0; i < freq.length; i++)\n\t\t{\n\t\t\theap[i] = new HuffmanTreeNode(freq[i][1], freq[i][0], null, null);\n\t\t}\n\t\t\n\t\theap = heapSort(heap);\n\n\t\treturn heap;\n\t}",
"public HuffmanNode getLeftNode()\n\t{\n\t\treturn left;\n\t}",
"public nodeTree getHijoDer (){\n return this._hDer;\n }",
"void decode(){\n int bit = -1; // next bit from compressed file: 0 or 1. no more bit: -1\r\n int k = 0; // index to the Huffman tree array; k = 0 is the root of tree\r\n int n = 0; // number of symbols decoded, stop the while loop when n == filesize\r\n int numBits = 0; // number of bits in the compressed file\r\n FileOutputStream file = null;\r\n try {\r\n file = new FileOutputStream(\"uncompressed.txt\");\r\n } catch (FileNotFoundException ex) {\r\n System.err.println(\"Could not open file to write to.\");\r\n }\r\n while ((bit = inputBit()) >= 0){\r\n k = codetree[k][bit];\r\n numBits++;\r\n if (codetree[k][0] == 0){ // leaf\r\n try {\r\n file.write(codetree[k][1]);\r\n } catch (IOException ex) {\r\n System.err.println(\"Failed to write to file.\");\r\n }\r\n System.out.write(codetree[k][1]);\r\n if (n++ == filesize) break; // ignore any additional bits\r\n k = 0;\r\n }\r\n }\r\n System.out.printf(\"\\n\\n------------------------------\\n\" +\r\n \"%d bytes in uncompressed file.\\n\", filesize);\r\n System.out.printf(\"%d bytes in compressed file.\\n\", numBits / 8);\r\n System.out.printf(\"Compression ratio of %f.\", (double)numBits / (double)filesize);\r\n System.out.flush();\r\n }",
"private void ScannerHuffmanCodeCreator(HuffmanNode node, String s, char c) {\n if (s.length() == 1) {\n if (s.charAt(0) == '0') {\n node.left = new HuffmanNode(c);\n } else {\n node.right = new HuffmanNode(c);\n }\n } else {\n if (s.charAt(0) == '0') {\n if (node.left == null && node.right == null) {\n node.left = new HuffmanNode();\n }\n ScannerHuffmanCodeCreator(node.left, s.substring(1), c);\n } else {\n if (node.right == null && node.right == null) {\n node.right = new HuffmanNode();\n }\n ScannerHuffmanCodeCreator(node.right, s.substring(1), c);\n }\n }\n }",
"@Override\n public String decode(File fileName) throws IOException\n {\n HuffmanEncodedResult result = readFromFile(fileName);\n StringBuilder stringBuilder = new StringBuilder();\n\n BitSet bitSet = result.getEncodedData();\n\n for (int i = 0; bitSet.length() - 1 > i; )\n {\n Node currentNode = result.getRoot();\n while (!currentNode.isLeaf())\n {\n if (bitSet.get(i))\n {\n currentNode = currentNode.getLeftChild();\n }\n else\n {\n currentNode = currentNode.getRightChild();\n }\n i++;\n }\n stringBuilder.append(currentNode.getCharacter());\n }\n return stringBuilder.toString();\n }",
"public CodeBook getOptimalCodificacion(){\n ArrayList<ArbolCod> listaA=new ArrayList<ArbolCod>();\n \n // Se inicializan los árboles con las probabilidades.\n for (int i=0;i<probabilidades.size();i++)\n listaA.add(new ArbolCod(alfabeto.getI(i),probabilidades.get(i)));\n \n return codHuffman(listaA);\n }",
"public TreeNode encode(Node root) {\n if (root == null) return null;\n TreeNode node = new TreeNode(root.val);\n List<Node> children = root.children;\n TreeNode tmp = node;\n if (!children.isEmpty()) {\n for (int i = 0; i < children.size(); i++) {\n if (i == 0) {\n node.left = encode(children.get(0));\n tmp = node.left;\n } else {\n tmp.right = encode(children.get(i));\n tmp = tmp.right;\n }\n }\n }\n return node;\n }",
"public String[] makeCodes(){\n \tHuffmanTempTree tree = makeTree();\n\t\treturn tree.inOrderTreeWalkPath(tree.root, \"\", codes);\n \t}",
"public HuffmanNode getParentNode()\n\t{\n\t\treturn parent;\n\t}",
"public static TreeNode getBasicTree(){\n TreeNode one = new TreeNode(1);\n TreeNode two = new TreeNode(2);\n TreeNode three = new TreeNode(3);\n TreeNode four = new TreeNode(4);\n TreeNode five = new TreeNode(5);\n TreeNode six = new TreeNode(6);\n TreeNode seven = new TreeNode(7);\n\n one.left = two;\n one.right = three;\n two.left = four;\n two.right = five;\n four.left = six;\n four.right = seven;\n\n return one;\n }",
"node GrowthTreeGen(int maxdepth){\n\t\tint i;\n\t\tbyte a;\n\t\tnode t, p;\n\t\tif(maxdepth == 0) // to the limit then choose a terminal\n\t\t{\n\t\t\ti = IRandom(0, gltcard - 1);\n\t\t\tt = new node(glterminal[i].name, VOIDVALUE);\n\t\t\treturn t;\n\t\t} \n\t\telse // choosing from function and terminal\n\t\t {\n\t\t\ti = IRandom(0, gltermcard - 1);\n\t\t\tt = new node(glterm[i].name, VOIDVALUE);\n\t\t\tif(glterm[i].arity > 0) // if it is function\n\t\t\t{\n\t\t\t\tt.children = GrowthTreeGen(maxdepth - 1);\n\t\t\t\tp = t.children;\n\t\t\t\tfor(a = 1; a < glterm[i].arity; a++) {\n\t\t\t\t\tp.sibling = GrowthTreeGen(maxdepth - 1);\n\t\t\t\t\tp = p.sibling;\n\t\t\t\t}\n\t\t\t\tp.sibling = null;\n\t\t\t}\n\t\t\treturn t;\n\t\t}\n\t}",
"private void constructTree() {\r\n\t\tsortLeaves();\r\n\t\tNode currentNode;\r\n\t\tint index = 0;\r\n\t\t\tdo{\r\n\t\t\t\t// Create a new node with the next two least frequent nodes as its children\r\n\t\t\t\tcurrentNode = new Node(this.treeNodes[0], this.treeNodes[1]); \r\n\t\t\t\taddNewNode(currentNode);\r\n\t\t\t}\r\n\t\t\twhile (this.treeNodes.length > 1); // Until there is only one root node\r\n\t\t\tthis.rootNode = currentNode;\r\n\t\t\tindex++;\r\n\t}",
"TrieNode root();",
"public static TreeNode buildTree02() {\n\t\t\n\t\tTreeNode root = new TreeNode(5);\n\t\t/*\n\t\troot.left = new TreeNode(4);\n\t\troot.left.left = new TreeNode(11);\n\t\troot.left.left.left = new TreeNode(7);\n\t\troot.left.left.right = new TreeNode(2);\n\t\t\n\t\troot.right = new TreeNode(8);\n\t\troot.right.left = new TreeNode(13);\n\t\troot.right.right = new TreeNode(4);\n\t\troot.right.right.left = new TreeNode(5);\n\t\troot.right.right.right = new TreeNode(1);\n\t\t*/\n\t\treturn root;\n\t}",
"public Decode(String inputFileName, String outputFileName){\r\n try(\r\n BitInputStream in = new BitInputStream(new FileInputStream(inputFileName));\r\n OutputStream out = new FileOutputStream(outputFileName))\r\n {\r\n int[] characterFrequency = readCharacterFrequency(in);//\r\n int frequencySum = Arrays.stream(characterFrequency).sum();\r\n BinNode root = HoffmanTree.HoffmanTreeFactory(characterFrequency).rootNode;\r\n //Generate Hoffman tree and get root\r\n\r\n int bit;\r\n BinNode currentNode = root;\r\n int byteCounter = 0;\r\n\r\n while ((bit = in.readBit()) != -1 & frequencySum >= byteCounter){\r\n //Walk the tree based on the incoming bits\r\n if (bit == 0){\r\n currentNode = currentNode.leftLeg;\r\n } else {\r\n currentNode = currentNode.rightLeg;\r\n }\r\n\r\n //If at end of tree, treat node as leaf and consider key as character instead of weight\r\n if (currentNode.leftLeg == null){\r\n out.write(currentNode.k); //Write character\r\n currentNode = root; //Reset walk\r\n byteCounter++; //Increment byteCounter to protect from EOF 0 fill\r\n }\r\n }\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public HuffmanNode(String key, int value, HuffmanNode leftNode, HuffmanNode rightNode)\n\t{\n\t\tthis(key,value);\n\t\tleft = leftNode;\n\t\tright = rightNode;\n\t}",
"private void ReadHuffman(String aux) {\n\n Huffman DY = new Huffman();\n Huffman DCB = new Huffman();\n Huffman DCR = new Huffman();\n DY.setFrequencies(FreqY);\n DCB.setFrequencies(FreqCB);\n DCR.setFrequencies(FreqCR);\n\n StringBuilder encoding = new StringBuilder();\n int iteradorMatrix = aux.length() - sizeYc - sizeCBc - sizeCRc;\n for (int x = 0; x < sizeYc; ++x) {\n encoding.append(aux.charAt(iteradorMatrix));\n ++iteradorMatrix;\n }\n Ydes = DY.decompressHuffman(encoding.toString());\n encoding = new StringBuilder();\n for (int x = 0; x < sizeCBc; ++x) {\n encoding.append(aux.charAt(iteradorMatrix));\n ++iteradorMatrix;\n }\n CBdes = DCB.decompressHuffman(encoding.toString());\n encoding = new StringBuilder();\n for (int x = 0; x < sizeCRc; ++x) {\n encoding.append(aux.charAt(iteradorMatrix));\n ++iteradorMatrix;\n }\n CRdes = DCR.decompressHuffman(encoding.toString());\n }",
"public Git.Tree displayTree(String h) {\n return displayTree(h, \"root\", null); \n }",
"@Override\n\tpublic TreeNode buildTree(String[] exp) {\n\t\tStack<TreeNode> stk = new Stack<TreeNode>();\n\t\tTreeNode tmpL, tmpR, tmpRoot;\n\t\tint i;\n\n\t\tfor(String s: exp) {\n\t\t\tif(s.equals(EMPTY))\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\ttry {\n\t\t\t\ti = Integer.parseInt(s);\n\t\t\t\tstk.push(new TreeNode(EMPTY + i));\n\t\t\t}\n\t\t\tcatch (NumberFormatException n) {\n\t\t\t\ttmpR = stk.pop();\n\t\t\t\ttmpL = stk.pop();\n\t\t\t\ttmpRoot = new TreeNode(s, tmpL, tmpR);\n\t\t\t\tstk.push(tmpRoot);\n\t\t\t}\n\t\t}\n\n\t\treturn stk.pop();\n\n\t}",
"void makeTree()\n \t{\n \t\t\t \n \t\tobj.insert(5,\"spandu\");\n \tobj.insert(4,\"anshu\");\n \tobj.insert(3,\"anu\");\n \tobj.insert(6,\"himani\");\n \t\t\n \t}",
"public HuffmanNode getRightNode()\n\t{\n\t\treturn right;\n\t}",
"public TreeNode encode(Node root) {\n return en(root);\n }"
] | [
"0.7677704",
"0.75913614",
"0.75264025",
"0.75191957",
"0.74902344",
"0.7362456",
"0.7333053",
"0.7292674",
"0.72356385",
"0.72318995",
"0.7116853",
"0.707902",
"0.707173",
"0.70350087",
"0.7023468",
"0.70086926",
"0.6914907",
"0.68913364",
"0.68797475",
"0.6751893",
"0.6630523",
"0.66270155",
"0.6542421",
"0.65197676",
"0.64241856",
"0.63943887",
"0.63491243",
"0.6346921",
"0.6341469",
"0.63259774",
"0.6290929",
"0.62826943",
"0.6276366",
"0.6227924",
"0.62182194",
"0.62061375",
"0.615493",
"0.61410105",
"0.613663",
"0.61256874",
"0.612292",
"0.60901636",
"0.6080532",
"0.6074339",
"0.60640556",
"0.604641",
"0.6045037",
"0.6017055",
"0.6014026",
"0.5991126",
"0.5967882",
"0.59621423",
"0.5960234",
"0.5951096",
"0.5930614",
"0.5914827",
"0.5898921",
"0.5863618",
"0.5862948",
"0.5848806",
"0.584863",
"0.58442634",
"0.58285636",
"0.5814311",
"0.58108985",
"0.5783852",
"0.5757667",
"0.57351094",
"0.57333785",
"0.57256293",
"0.57090175",
"0.56832147",
"0.56771266",
"0.5674109",
"0.5671403",
"0.56680834",
"0.565072",
"0.56386733",
"0.56384593",
"0.5633389",
"0.5623441",
"0.561724",
"0.55979836",
"0.55917853",
"0.5567416",
"0.55668885",
"0.5559372",
"0.55450976",
"0.5533037",
"0.55318785",
"0.55292785",
"0.55194765",
"0.55165815",
"0.55118066",
"0.5503869",
"0.54986787",
"0.548938",
"0.5483383",
"0.54742235",
"0.546674"
] | 0.80382514 | 0 |
constraint: 1. node.val is unique 2. no repeated edges and no selfloops in the graph. a > b, c, d b > a, c, d | public static Node cloneGraph2(Node node) {
if (node == null) {
return null;
}
Map<Integer, Node> map = new HashMap<>();
return cloneGraphDFS(node, map);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Test\n public void tr3()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(1,0);\n assertFalse(graph.reachable(sources, targets));\n }",
"@Test\n public void tr1()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n assertFalse(graph.reachable(sources, targets));\n }",
"private ScheduleGrph initializeIdenticalTaskEdges(ScheduleGrph input) {\n\n\t\tScheduleGrph correctedInput = (ScheduleGrph) SerializationUtils.clone(input);\n\t\t// FORKS AND TODO JOINS\n\t\t/*\n\t\t * for (int vert : input.getVertices()) { TreeMap<Integer, List<Integer>> sorted\n\t\t * = new TreeMap<Integer, List<Integer>>(); for (int depend :\n\t\t * input.getOutNeighbors(vert)) { int edge = input.getSomeEdgeConnecting(vert,\n\t\t * depend); int weight = input.getEdgeWeightProperty().getValueAsInt(edge); if\n\t\t * (sorted.get(weight) != null) { sorted.get(weight).add(depend); } else {\n\t\t * ArrayList<Integer> a = new ArrayList(); a.add(depend); sorted.put(weight, a);\n\t\t * }\n\t\t * \n\t\t * } int curr = -1; for (List<Integer> l : sorted.values()) { for (int head : l)\n\t\t * {\n\t\t * \n\t\t * if (curr != -1) { correctedInput.addDirectedSimpleEdge(curr, head); } curr =\n\t\t * head; }\n\t\t * \n\t\t * } }\n\t\t */\n\n\t\tfor (int vert : input.getVertices()) {\n\t\t\tfor (int vert2 : input.getVertices()) {\n\t\t\t\tint vertWeight = input.getVertexWeightProperty().getValueAsInt(vert);\n\t\t\t\tint vert2Weight = input.getVertexWeightProperty().getValueAsInt(vert2);\n\n\t\t\t\tIntSet vertParents = input.getInNeighbors(vert);\n\t\t\t\tIntSet vert2Parents = input.getInNeighbors(vert2);\n\n\t\t\t\tIntSet vertChildren = input.getOutNeighbors(vert);\n\t\t\t\tIntSet vert2Children = input.getOutNeighbors(vert2);\n\n\t\t\t\tboolean childrenEqual = vertChildren.containsAll(vert2Children)\n\t\t\t\t\t\t&& vert2Children.containsAll(vertChildren);\n\n\t\t\t\tboolean parentEqual = vertParents.containsAll(vert2Parents) && vert2Parents.containsAll(vertParents);\n\n\t\t\t\tboolean inWeightsSame = true;\n\t\t\t\tfor (int parent : vertParents) {\n\t\t\t\t\tfor (int parent2 : vert2Parents) {\n\t\t\t\t\t\tif (parent == parent2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent, vert)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(parent2, vert2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!inWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tboolean outWeightsSame = true;\n\t\t\t\tfor (int child : vertChildren) {\n\t\t\t\t\tfor (int child2 : vert2Children) {\n\t\t\t\t\t\tif (child == child2 && input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert, child)) == input.getEdgeWeightProperty()\n\t\t\t\t\t\t\t\t.getValue(input.getSomeEdgeConnecting(vert2, child2))) {\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\toutWeightsSame = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!outWeightsSame) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tboolean alreadyEdge = correctedInput.areVerticesAdjacent(vert, vert2)\n\t\t\t\t\t\t|| correctedInput.areVerticesAdjacent(vert2, vert);\n\n\t\t\t\tif (vert != vert2 && vertWeight == vert2Weight && parentEqual && childrenEqual && inWeightsSame\n\t\t\t\t\t\t&& outWeightsSame && !alreadyEdge) {\n\t\t\t\t\tint edge = correctedInput.addDirectedSimpleEdge(vert, vert2);\n\t\t\t\t\tcorrectedInput.getEdgeWeightProperty().setValue(edge, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn correctedInput;\n\t}",
"public ArrayList<Edge> Prim (String s){\n Node Start = nodeMap.get(s);\n mst = new ArrayList<>();\n HashMap<String, String> inserted = new HashMap<String, String>();\n ArrayList<Edge> failed = new ArrayList<Edge>();\n PriorityQueue<Edge> pq = new PriorityQueue<Edge>();\n ArrayList<Edge> ed = new ArrayList<Edge>(edgeMap.values());\n Edge first = ed.get(0);\n mst.add(first);\n inserted.put(first.w, first.w);\n inserted.put(first.v, first.v);\n\n priorityEdgeInsert(pq, first);\n\n while (inserted.size() <= edges() && pq.size() != 0){ //O(E log(V))\n //runs for E checking the possible V, where the number of V is devided each time, or log(V), giving ELog(V)\n Edge e = pq.poll();\n String w = inserted.get(e.w);\n String v = inserted.get(e.v);\n\n if ((w == null) ^ (v == null)){\n priorityEdgeInsert(pq, e);\n for(Edge f : failed){\n if(f.v == e.v || f.v == e.w || f.w == e.v || f.w == e.w){\n\n }\n else{\n pq.add(f);\n }\n }\n failed.clear();\n mst.add(e);\n inserted.put(e.w, e.w); //only puts one, the null one is hashed to a meaningless spot\n inserted.put(e.v, e.v);\n }\n else if ((w == null) && (v == null) ){\n failed.add(e);\n }\n else if (!(w == null) && !(v == null) ){\n failed.remove(e);\n pq.remove(e);\n }\n else if (e == null){\n System.out.println(\"HOW?\"); //should never happen.\n }\n }\n return mst;\n }",
"@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }",
"private void computeSat(){\n addVertexVisitConstraint();\n //add clause for each vertex must be visited only once/ all vertices must be on path\n addVertexPositionConstraint();\n //add clause for every edge in graph to satisfy constraint of vertices not belonging to edge not part of successive positions\n addVertexNonEdgeConstraint();\n }",
"@Test\n public void shouldNotAddDuplicateDependents() {\n String currentPipeline = \"p5\";\n ValueStreamMap graph = new ValueStreamMap(currentPipeline, null);\n Node p4 = graph.addUpstreamNode(new PipelineDependencyNode(\"p4\", \"p4\"), null, currentPipeline);\n graph.addUpstreamNode(new PipelineDependencyNode(\"p4\", \"p4\"), null, currentPipeline);\n\n assertThat(p4.getChildren().size(), is(1));\n VSMTestHelper.assertThatNodeHasChildren(graph, \"p4\", 0, \"p5\");\n }",
"void pairwiseCombine(){\n\t\t\n\t\tmin.Left.Right = min.Right;\n\t\tmin.Right.Left = min.Left;\n\t\t/**\n\t\tPairwise combine differentiates itself in operation of depending on the presence of a child node\n\t\t*/\n\t\t\n\t\tif(min.Child==null){\n\t\t/*map acts as the table to store similar degree nodes*/\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Right;\n\t\t\tmin = null;\n\t\t\tmin = current;\n\t\t\tlast = current.Left;\n\t\t\twhile(current!=last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\t\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\t\n\t\t\t\t\t/*Since a parent node can have only one child node a condition is checked to update its child node*/\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t/*If the node stored is less than the incoming node*/\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\tif(temp.Child == temp.Child.Right){\n\t\t\t\t\t\t\t\ttemp.Child.Right = current;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t/*If the incoming node is lower*/\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\t\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\t/*Since our condition is used only till last node and exits during last node the iteration is repeated for the last node*/\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\n\t\t}\n\t\telse{\n\t\t\tHashMap<Integer, Nodefh> map = new HashMap<Integer, Nodefh>();\n\t\t\tcurrent = min.Child;\n\t\t\tcurrent.Parent = null;\n\t\t\tif(min!=min.Right){\n\t\t\t\tcurrent.Right.Left = min.Left;\n\t\t\t\tmin.Left.Right = current.Right;\n\t\t\t\tcurrent.Right = min.Right;\n\t\t\t\tmin.Right.Left = current;\n\t\t\t\tlast = current.Left;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tlast = current.Left;\n\n\t\t\t}\n\t\t\tmin =null;\n\t\t\tmin = current;\n\t\t\t/*In the presence of a child the child has to be inserted at the top level*/\n\t\t\twhile(current != last){\n\t\t\t\tNodefh check = new Nodefh();\n\t\t\t\tcheck = current.Right;\n\n\t\t\t\twhile(map.containsKey(current.degree)){\n\n\t\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\t\tif(temp.dist < current.dist){\n\t\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\t\tif(temp.isChildEmpty()){\n\n\t\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrent = temp;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(min.dist >= current.dist){\n\t\t\t\t\tmin = current;\n\n\t\t\t\t}\n\t\t\t\tmap.put(current.degree, current);\n\t\t\t\tcurrent = check;\n\t\t\t}\n\t\t\tlast = min.Left;\n\t\t\twhile(map.containsKey(current.degree)){\n\t\t\t\tNodefh temp = map.remove(current.degree);\n\t\t\t\tif(temp.dist < current.dist && temp.dist!=0){\n\t\t\t\t\tcurrent.Right.Left = current.Left;\n\t\t\t\t\tcurrent.Left.Right = current.Right;\n\t\t\t\t\ttemp.ChildCut = false;\n\t\t\t\t\tif(temp.isChildEmpty()){\n\t\t\t\t\t\ttemp.Child = current;\n\t\t\t\t\t\tcurrent.Left = current.Right = current;\n\t\t\t\t\t\ttemp.Child.Parent = temp;\n\t\t\t\t\t\ttemp.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tcurrent.Right = temp.Child;\n\t\t\t\t\t\tcurrent.Left = temp.Child.Left;\n\t\t\t\t\t\ttemp.Child.Left.Right = current;\n\t\t\t\t\t\ttemp.Child.Left = current;\n\t\t\t\t\t\tcurrent.Parent = temp;\n\t\t\t\t\t\ttemp.degree +=1;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent = temp;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp.Right.Left = temp.Left;\n\t\t\t\t\ttemp.Left.Right = temp.Right;\n\t\t\t\t\tcurrent.ChildCut = false;\n\t\t\t\t\tif(current.isChildEmpty()){\n\t\t\t\t\t\tcurrent.Child = temp;\n\t\t\t\t\t\ttemp.Left = temp.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Parent = current;\n\t\t\t\t\t\tcurrent.degree = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttemp.Right = current.Child;\n\t\t\t\t\t\ttemp.Left = current.Child.Left;\n\t\t\t\t\t\tcurrent.Child.Left.Right = temp;\n\t\t\t\t\t\tcurrent.Child.Left = temp;\n\t\t\t\t\t\ttemp.Parent = current;\n\t\t\t\t\t\tcurrent.degree +=1;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(min.dist >= current.dist){\n\t\t\t\tmin = current;\n\n\t\t\t}\n\t\t\tcurrent = min;\n\t\t\tlast = min.Left;\n\t\t}\n\n\t}",
"@Override\n\tpublic boolean isConnected() {\n\t\tif(this.GA.nodeSize() ==1 || this.GA.nodeSize()==0) return true;\n\t\tgraph copied = this.copy();\n\t\ttagZero(copied);\n\t\tCollection<node_data> s = copied.getV();\n\t\tIterator it = s.iterator();\n\t\tnode_data temp = (node_data) it.next();\n\t\tDFSUtil(copied,temp);\n\t\tfor (node_data node : s) {\n\t\t\tif (node.getTag() == 0) return false;\n\t\t}\n\t\ttransPose(copied);\n\t\ttagZero(copied);\n\t Collection<node_data> s1 = copied.getV();\n\t\tIterator it1 = s1.iterator();\n\t\tnode_data temp1 = (node_data) it1.next();\n\t\tDFSUtil(copied,temp1);\n\t\tfor (node_data node1 : s1) {\n\t\t\tif (node1.getTag() == 0) return false;\n\t\t}\n\n\t\treturn true;\n\t}",
"@Test \r\n void add_mutiple_edges_check_size(){\r\n for(int i = 0; i < 20; i++) {\r\n graph.addEdge(\"\" + i, \"\" + (i + 1));\r\n } \r\n List<String> adjacent;\r\n for(int i = 0; i < 20; i++) {\r\n adjacent = graph.getAdjacentVerticesOf(\"\"+i);\r\n if(!adjacent.contains(\"\" + (i+1))) {\r\n fail();\r\n }\r\n }\r\n if(graph.size() != 20 | graph.order() != 21) {\r\n fail();\r\n }\r\n \r\n }",
"@Override\n public boolean isConnected() { //i got help from the site https://www.geeksforgeeks.org/shortest-path-unweighted-graph/\n if(this.ga.edgeSize()<this.ga.nodeSize()-1) return false;\n initializeInfo();//initialize all the info fields to be null for the algorithm to work\n if(this.ga.nodeSize()==0||this.ga.nodeSize()==1) return true;//if there is not node or one its connected\n WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n LinkedList<node_info> qValues = new LinkedList<>();//create linked list that will storage all nodes that we didn't visit yet\n int firstNodeKey = copy.getV().iterator().next().getKey();//first key for get the first node(its doesnt matter which node\n node_info first = copy.getNode(firstNodeKey);//get the node\n qValues.add(first);//without limiting generality taking the last node added to graph\n int counterVisitedNodes = 0;//counter the times we change info of node to \"visited\"\n while (qValues.size() != 0) {\n node_info current = qValues.removeFirst();\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n counterVisitedNodes++;\n\n Collection<node_info> listNeighbors = copy.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for (node_info n : Neighbors) {\n if (n.getInfo() == null) {//if there is a node we didn't visited it yet, we will insert it to the linkedList\n qValues.add(n);\n }\n }\n }\n if (this.ga.nodeSize() != counterVisitedNodes) return false;//check that we visited all of the nodes\n\n return true;\n }",
"@Test\n public void tr0()\n {\n Graph g = new Graph(1);\n Set<Integer> nodes = new TreeSet<Integer>();\n nodes.add(0);\n assertTrue(g.reachable(nodes, nodes));\n }",
"public static boolean Util(Graph<V, DefaultEdge> g, ArrayList<V> set, int colors, HashMap<String, Integer> coloring, int i, ArrayList<arc> arcs, Queue<arc> agenda)\n {\n /*if (i == set.size())\n {\n System.out.println(\"reached max size\");\n return true;\n }*/\n if (set.isEmpty())\n {\n System.out.println(\"Set empty\");\n return true;\n }\n //V currentVertex = set.get(i);\n\n /*System.out.println(\"vertices and mrv:\");\n V start = g.vertexSet().stream().filter(V -> V.getID().equals(\"0\")).findAny().orElse(null);\n Iterator<V> iterator = new DepthFirstIterator<>(g, start);\n while (iterator.hasNext()) {\n V v = iterator.next();\n System.out.println(\"vertex \" + v.getID() + \" has mrv of \" + v.mrv);\n }*/\n\n // Find vertex with mrv\n V currentVertex;\n int index = -1;\n int mrv = colors + 10;\n for (int it = 0; it < set.size(); it++)\n {\n if (set.get(it).mrv < mrv)\n {\n mrv = set.get(it).mrv;\n index = it;\n }\n }\n currentVertex = set.remove(index);\n\n //System.out.println(\"Got vertex: \" + currentVertex.getID());\n\n\n // Try to assign that vertex a color\n for (int c = 0; c < colors; c++)\n {\n currentVertex.color = c;\n if (verifyColor(g, currentVertex))\n {\n\n // We can assign color c to vertex v\n // See if AC3 is satisfied\n /*currentVertex.domain.clear();\n currentVertex.domain.add(c);*/\n if (!agenda.isEmpty()) numAgenda++;\n while(!agenda.isEmpty())\n {\n arc temp = agenda.remove();\n\n // Make sure there exists v1, v2, in V1, V2, such that v1 != v2\n V v1 = g.vertexSet().stream().filter(V -> V.getID().equals(temp.x)).findAny().orElse(null);\n V v2 = g.vertexSet().stream().filter(V -> V.getID().equals(temp.y)).findAny().orElse(null);\n\n\n\n // No solution exists in this branch if a domain is empty\n //if ((v1.domain.isEmpty()) || (v2.domain.isEmpty())) return false;\n\n if (v2.color == -1) continue;\n else\n {\n Boolean[] toRemove = new Boolean[colors];\n Boolean domainChanged = false;\n for (Integer it : v1.domain)\n {\n if (it == v2.color)\n {\n toRemove[it] = true;\n }\n }\n for (int j = 0; j < toRemove.length; j++)\n {\n if ((toRemove[j] != null))\n {\n v1.domain.remove(j);\n domainChanged = true;\n }\n }\n // Need to check constraints with v1 on the right hand side\n if (domainChanged)\n {\n for (arc it : arcs)\n {\n // Add arc back to agenda to check constraints again\n if (it.y.equals(v1.getID()))\n {\n agenda.add(it);\n }\n }\n }\n }\n if ((v1.domain.isEmpty()) || (v2.domain.isEmpty()))\n {\n System.out.println(\"returning gfalse here\");\n return false;\n }\n }\n\n // Reset agenda to check arc consistency on next iteration\n for (int j = 0; j < arcs.size(); j++)\n {\n agenda.add(arcs.get(i));\n }\n\n\n //System.out.println(\"Checking if vertex \" + currentVertex.getID() + \" can be assigned color \" + c);\n coloring.put(currentVertex.getID(), c);\n updateMRV(g, currentVertex);\n if (Util(g, set, colors, coloring, i + 1, arcs, agenda))\n {\n\n return true;\n }\n\n //System.out.println(\"Assigning vertex \" + currentVertex.getID() + \" to color \" + currentVertex.color + \" did not work\");\n coloring.remove(currentVertex.getID());\n currentVertex.color = -1;\n }\n }\n return false;\n }",
"static private ArrayList<Node> addViableConstraints(Node node, int v) {\r\n\r\n\t\t// for building list of neighbors\r\n\t\tArrayList<Node> changedNodes = new ArrayList<Node>(dimensions);\r\n\r\n\t\t// Check columns, similar to logic in viable()\r\n\t\tfor (int i = 0; i < dimensions; i++) {\r\n\t\t\tNode cNode = puzzle[i][node.getColumn()];\r\n\t\t\tif (cNode.getValue() == 0 && node.getRow() != i && !cNode.getConstraints().contains(v)) {\r\n\t\t\t\tcNode.getConstraints().add(v);\r\n\t\t\t\tif (!changedNodes.contains(cNode))\r\n\t\t\t\t\tchangedNodes.add(cNode);\r\n\t\t\t}\r\n\t\t\tNode rNode = puzzle[node.getRow()][i];\r\n\t\t\tif (rNode.getValue() == 0 && node.getColumn() != i && !rNode.getConstraints().contains(v)) {\r\n\t\t\t\trNode.getConstraints().add(v);\r\n\t\t\t\tif (!changedNodes.contains(rNode))\r\n\t\t\t\t\tchangedNodes.add(rNode);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Now to manipulate the boxes/subGrids...\r\n\t\tint rOffset = (node.getRow() / subGrids) * subGrids;\r\n\t\tint cOffset = (node.getColumn() / subGrids) * subGrids;\r\n\t\tfor (int x = rOffset; x < rOffset + subGrids; x++)\r\n\t\t\tfor (int y = cOffset; y < cOffset + subGrids; y++) {\r\n\t\t\t\tif (puzzle[x][y].getValue() != 0 || (x == node.getRow() && y == node.getColumn())) {\r\n\t\t\t\t\t// break; - this doesn't work as it exits the entire\r\n\t\t\t\t\t// function!\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNode boxNode = puzzle[x][y];\r\n\t\t\t\tif (!boxNode.getConstraints().contains(v)) {\r\n\t\t\t\t\tboxNode.getConstraints().add(v); // add value if value not\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// present\r\n\t\t\t\t\tif (!changedNodes.contains(boxNode)) {\r\n\t\t\t\t\t\tchangedNodes.add(boxNode);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn changedNodes;\r\n\t}",
"public static void main(String[] args) throws IOException {\n\n // read in graph\n Scanner scanner = new Scanner(System.in);\n int n = scanner.nextInt(), m = scanner.nextInt();\n ArrayList<Integer>[] graph = new ArrayList[n];\n for (int i = 0; i < n; i++)\n graph[i] = new ArrayList<>();\n\n for (int i = 0; i < m; i++) {\n scanner.nextLine();\n int u = scanner.nextInt() - 1, v = scanner.nextInt() - 1; // convert to 0 based index\n graph[u].add(v);\n graph[v].add(u);\n }\n\n int[] dist = new int[n];\n Arrays.fill(dist, -1);\n // partition the vertices in each of the components of the graph\n for (int u = 0; u < n; u++) {\n if (dist[u] == -1) {\n // bfs\n Queue<Integer> queue = new LinkedList<>();\n queue.add(u);\n dist[u] = 0;\n while (!queue.isEmpty()) {\n int w = queue.poll();\n for (int v : graph[w]) {\n if (dist[v] == -1) { // unvisited\n dist[v] = (dist[w] + 1) % 2;\n queue.add(v);\n } else if (dist[w] == dist[v]) { // visited and form a odd cycle\n System.out.println(-1);\n return;\n } // otherwise the dist will not change\n }\n }\n }\n\n }\n\n BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));\n // vertices with the same dist are in the same group\n List<Integer>[] groups = new ArrayList[2];\n groups[0] = new ArrayList<>();\n groups[1] = new ArrayList<>();\n for (int u = 0; u < n; u++) {\n groups[dist[u]].add(u + 1);\n }\n for (List<Integer> g: groups) {\n writer.write(String.valueOf(g.size()));\n writer.newLine();\n for (int u: g) {\n writer.write(String.valueOf(u));\n writer.write(' ');\n }\n writer.newLine();\n }\n\n writer.close();\n\n\n }",
"@Test \r\n void create_edge_between_to_nonexisted_vertexes() {\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }",
"public boolean validTree(int n, int[][] edges) {\n HashMap<Integer,HashSet<Integer>> graph = new HashMap<>();\n for (int i=0;i<n;i++){\n graph.put(i,new HashSet<>());\n }\n for(int []edge:edges){\n // since undirected graph\n graph.get(edge[0]).add(edge[1]);\n graph.get(edge[1]).add(edge[0]);\n }\n Queue<Integer> queue = new LinkedList<Integer>();\n\n boolean [] visited = new boolean[n];\n queue.add(0);\n while (!queue.isEmpty()){\n Integer v = queue.poll();\n if(visited[v]){ // means cycle is present\n return false;\n }\n for(Integer w:graph.get(v)){\n graph.get(w).remove(v); // whatttta clasic approach\n queue.add(w);\n visited[w] = true;\n }\n }\n // all nodes should have visited ..\n for(int i=0;i<n;i++){\n if(visited[i] == false){\n return false;\n }\n }\n return true;\n }",
"public static void main(String[] args) {\n \tScanner sc = new Scanner(System.in);\n \n\t\tint t=sc.nextInt();\n\t\twhile(t-->0) {\n\t\t\t\n int n=sc.nextInt();\n\t\t\tint k=sc.nextInt();\n\t\t\tcurr_cc=0;\n\t\t\t\n\t\t\tadj=new ArrayList<>();\n\t\t\tfor(int i=0;i<=n;i++){\n adj.add(new ArrayList<Integer>());\n vis[i]=0;\n\t\t\t\tcc[i]=0;\n } \n\t\t\t\n ArrayList<Pair<Integer,Integer>> edgeList=new ArrayList<>();\n\t\t\t\n\t\t\twhile(k-->0) {\n\t\t\t\tint a=sc.nextInt();\n\t\t\t\tString op=sc.next();\n\t\t\t\tint b=sc.nextInt();\n\t\t\t\tif(op.equals(\"=\")) {\n\t\t\t\t\tadj.get(a).add(b);\n\t\t\t\t\tadj.get(b).add(a);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t edgeList.add(new Pair<Integer,Integer>(a,b));\n \n\t\t\t}\n\t\t\t\n\t\t\tfor(int i=1;i<=n;i++) {\n\t\t\t\tif(vis[i]==0) {\n\t\t\t\t\tcurr_cc++;\n\t\t\t\t\tdfs(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tboolean flag=true;\n\t\t\tfor(int i=0;i<edgeList.size();i++) {\n\t\t\t\tint a=edgeList.get(i).getKey();\n\t\t\t\tint b=edgeList.get(i).getValue();\n\t\t\t\tif(cc[a] == cc[b])\n\t\t\t\t{ flag=false;\n\t\t\t\t break;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n if(flag) System.out.println(\"YES\");\n\t\t\telse System.out.println(\"NO\");\n\t\t\t\n }\n\n\t}",
"public FixedGraph(int numOfVertices, int b, int seed) {\r\n super(numOfVertices);\r\n int adjVertex;\r\n double x = 0;\r\n int[] numOfEdges = new int[numOfVertices];\r\n Vector<Integer> graphVector = new Vector<Integer>();\r\n connectivity = b;\r\n\r\n\r\n Random random = new Random(seed);\r\n graphSeed = seed;\r\n\r\n for (int v = 0; v < numOfVertices; v++) {\r\n graphVector.add(new Integer(v));\r\n }\r\n\r\n for (int i = 0; i < numOfVertices; i++) {\r\n\r\n while ((numOfEdges[i] < b) && (graphVector.isEmpty() == false)) {\r\n x = random.nextDouble();\r\n do {\r\n adjVertex = (int) (x * numOfVertices);\r\n\r\n } while (adjVertex >= numOfVertices);\r\n\r\n\r\n if ((i == adjVertex) || (numOfEdges[adjVertex] >= b)) {\r\n if (numOfEdges[adjVertex] >= b) {\r\n for (int v = 0; v < graphVector.size(); v++) {\r\n\r\n int compInt = ((Integer) graphVector.elementAt(v)).intValue();\r\n if (adjVertex == compInt) {\r\n graphVector.removeElementAt(v);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n if ((i != adjVertex) && (adjVertex < numOfVertices) && (numOfEdges[adjVertex] < b) && (super.isAdjacent(i, adjVertex) == false) && (numOfEdges[i] < b)) {\r\n super.addEdge(i, adjVertex);\r\n if (super.isAdjacent(i, adjVertex)) {\r\n numOfEdges[i] = numOfEdges[i] + 1;\r\n numOfEdges[adjVertex] = numOfEdges[adjVertex] + 1;\r\n }\r\n System.out.print(\"*\");\r\n\r\n }\r\n\r\n if (numOfEdges[i] >= b) {\r\n for (int v = 0; v < graphVector.size(); v++) {\r\n\r\n int compInt = ((Integer) graphVector.elementAt(v)).intValue();\r\n if (i == compInt) {\r\n graphVector.removeElementAt(v);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n break;\r\n }\r\n if (graphVector.size() < b) {\r\n //boolean deadlock = false;\r\n System.out.println(\"Graph size= \" + graphVector.size());\r\n\r\n for (int v = 0; v < graphVector.size(); v++) {\r\n\r\n int compInt = ((Integer) graphVector.elementAt(v)).intValue();\r\n //System.out.println(\"i:= \" + i + \" and compInt:= \" + compInt);\r\n if (super.isAdjacent(i, compInt) || (i == compInt)) {\r\n //System.out.println(\"\" + i + \" adjacent to \" + compInt + \" \" + super.isAdjacent(i, compInt));\r\n // deadlock = false;\r\n } else {\r\n if ((numOfEdges[compInt] < b) && (numOfEdges[i] < b) && (i != compInt)) {\r\n super.addEdge(i, compInt);\r\n numOfEdges[i] = numOfEdges[i] + 1;\r\n numOfEdges[compInt] = numOfEdges[compInt] + 1;\r\n if (numOfEdges[i] >= b) {\r\n for (int w = 0; w < graphVector.size(); w++) {\r\n\r\n int compW = ((Integer) graphVector.elementAt(w)).intValue();\r\n if (i == compW) {\r\n graphVector.removeElementAt(w);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n break;\r\n }\r\n if (numOfEdges[compInt] >= b) {\r\n for (int w = 0; w < graphVector.size(); w++) {\r\n\r\n int compW = ((Integer) graphVector.elementAt(w)).intValue();\r\n if (compInt == compW) {\r\n graphVector.removeElementAt(w);\r\n }\r\n if (graphVector.isEmpty() == true) {\r\n System.out.println(\"Graph Vector Empty\");\r\n }\r\n }\r\n\r\n }\r\n // deadlock = true;\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n\r\n System.out.println();\r\n }\r\n\r\n }",
"private void addVertexNonEdgeConstraint(){\n for (int i=0; i < g.nonEdges.size(); i++){\n Edge edge = g.nonEdges.get(i);\n int vertex1 = edge.from;\n int vertex2 = edge.to;\n for (int pCount =0; pCount < positionCount-1; pCount++){\n ArrayList<Integer> values = new ArrayList<>();\n values.add((variables[vertex1][pCount] * -1));\n values.add((variables[vertex2][pCount+1] * -1));\n clauses.add(values);\n values = new ArrayList<>();\n values.add((variables[vertex1][pCount+1] * -1));\n values.add((variables[vertex2][pCount] * -1));\n clauses.add(values);\n }\n\n }\n }",
"private void changeVlaue(int p1, int p2, int value) {\n if (p1 > count() || p1 < 1) { // range exception\n throw new IllegalArgumentException(\"out of N range\");\n }\n if (p2 > count() || p2 < 1) { // range exception\n throw new IllegalArgumentException(\"out of N range\");\n }\n if (value > 1 || value < 0) { // range exception\n throw new IllegalArgumentException(\"out of N range\");\n }\n\n id[p1 - 1][p2 - 1] = value; // set a node to 1 or 0\n }",
"public boolean validTree(int n, int[][] edges) {\n int[] nums = new int[n];\r\n Arrays.fill(nums, -1);\r\n\r\n // perform union find\r\n for (int i = 0; i < edges.length; i++) {\r\n int x = find(nums, edges[i][0]);\r\n int y = find(nums, edges[i][1]);\r\n\r\n // if two vertices happen to be in the same set\r\n // then there's a cycle\r\n if (x == y) return false;\r\n\r\n // union\r\n nums[x] = y;\r\n }\r\n\r\n return edges.length == n - 1;\r\n }",
"@Override\n public boolean isConnected() {\n for (node_data n : G.getV()) {\n bfs(n.getKey());\n for (node_data node : G.getV()) {\n if (node.getTag() == 0)\n return false;\n }\n }\n return true;\n }",
"@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }",
"int isCycle( Graph graph){\n int parent[] = new int[graph.V]; \n \n // Initialize all subsets as single element sets \n for (int i=0; i<graph.V; ++i) \n parent[i]=-1; \n \n // Iterate through all edges of graph, find subset of both vertices of every edge, if both subsets are same, then there is cycle in graph. \n for (int i = 0; i < graph.E; ++i){ \n int x = graph.find(parent, graph.edge[i].src); \n int y = graph.find(parent, graph.edge[i].dest); \n \n if (x == y) \n return 1; \n \n graph.Union(parent, x, y); \n } \n return 0; \n }",
"private boolean isFeasible(Set active) throws ParallelException {\r\n if (_k==2) {\r\n\t\t\t_g.makeNNbors(); // re-establish nnbors\r\n\t final int gsz = _g.getNumNodes();\r\n\t\t for (int i=0; i<gsz; i++) {\r\n\t\t\t Node nn = _g.getNode(i);\r\n\t\t\t\tSet nnbors = nn.getNbors(); // Set<Node>\r\n\t int count=0;\r\n\t\t if (active.contains(nn)) count=1;\r\n\t\t\t Iterator it2 = active.iterator();\r\n\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\tNode n2 = (Node) it2.next();\r\n\t if (nnbors.contains(n2)) {\r\n\t\t ++count;\r\n\t\t\t if (count>1) return false;\r\n\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}\r\n\t\telse { // _k==1\r\n\t\t\t// _g.makeNbors(true); // no need to re-establish nbors: never modified\r\n\t\t\tIterator it = active.iterator();\r\n\t\t\twhile (it.hasNext()) {\r\n\t\t\t\tNode n1 = (Node) it.next();\r\n\t\t\t\tSet n1bors = n1.getNborsUnsynchronized();\r\n\t\t\t\tIterator it2 = n1bors.iterator();\r\n\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\tNode n1nbor = (Node) it2.next();\r\n\t\t\t\t\tif (active.contains(n1nbor)) return false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n }",
"private void checkConnection( SquareNode a , SquareNode b ) {\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tSquareEdge edgeA = a.edges[i];\n\t\t\tif( edgeA == null )\n\t\t\t\tcontinue;\n\n\t\t\tSquareNode common = edgeA.destination(a);\n\t\t\tint commonToA = edgeA.destinationSide(a);\n\t\t\tint commonToB = CircularIndex.addOffset(commonToA,1,4);\n\n\t\t\tSquareEdge edgeB = common.edges[commonToB];\n\t\t\tif( edgeB != null && edgeB.destination(common) == b ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tfail(\"Failed\");\n\t}",
"@Test\r\n void test_remove_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"B\");\r\n graph.removeEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n } \r\n }",
"private static Set<Integer> approxVertexCover(Set<Pair<Integer>> edges, Set<Integer> nodes, Set<Integer> currCover){\r\n\t\t/*\r\n\t\t * 1. Sort mutation groups by size.\r\n\t\t * 2. Find largest mutation (that hasn't been removed).\r\n\t\t * -> Find all edges with this group.\r\n\t\t * -> Store connecting nodes in currCover\r\n\t\t * -> Remove the node's connecting edges and corresponding nodes\r\n\t\t * 3. Repeat 2 until no edges left \r\n\t\t */\r\n\t\t//Initialize edges and nodes\r\n\t\tSet<Pair<Integer>> allEdges = new HashSet<Pair<Integer>>(edges);\r\n\t\tSet<Integer> allNodes = new HashSet<Integer>(nodes);\r\n\t\t\r\n\t\tint numEdgesInTree = getNumTotalEdges();\r\n\t\tint totalMut = (int) getTotalMutations();\r\n\t\t/**\r\n\t\t * Taken out for time testing\r\n\t\t */\r\n//\t\tSystem.out.println(\"Total Mutations: \" + totalMut);\r\n\t\tint conflictThreshold = getConflictThreshold(totalMut, numEdgesInTree);\r\n\t\t//System.out.println(\"Conflict Threshold: \" + conflictThreshold);\r\n\t\t//while there are still conflicting edges\r\n\t\twhile (!allEdges.isEmpty()){\r\n\t\t\t//find largest node\r\n\t\t\tint maxNode = -1;\r\n\t\t\tdouble maxMutRate = 0.0;\r\n\t\t\tfor (Integer node: allNodes){\r\n\t\t\t\tdouble currMutRate = rowToMutRateMap.get(node+1);\r\n\t\t\t\tif (currMutRate > maxMutRate){\r\n\t\t\t\t\tmaxMutRate = currMutRate;\r\n\t\t\t\t\tmaxNode = node;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/* recalculate threshold */\r\n\t\t\tif (maxNode == 113){\r\n\t\t\t}\r\n\t\t\tconflictThreshold = getConflictThreshold(totalMut, numEdgesInTree);\r\n\t\t\t/**\r\n\t\t\t * Taken out for time testing\r\n\t\t\t */\r\n//\t\t\tSystem.out.println(\"Conflict Threshold: \" + conflictThreshold);\r\n\t\t\t/*\r\n\t\t\t * if the highest mut rate is less than\r\n\t\t\t * conflictThreshold, no more nodes\r\n\t\t\t * can be added to maximal independent set,\r\n\t\t\t * meaning remaining nodes should be put\r\n\t\t\t * in vertex cover\r\n\t\t\t */\r\n\t\t\tif (maxMutRate < conflictThreshold) {\r\n\t\t\t\tcurrCover.addAll(allNodes);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t//remove largest node\r\n\t\t\tallNodes.remove(maxNode);\r\n\t\t\tnumEdgesInTree++;\r\n\t\t\t//find all nodes which conflict with largest\r\n\t\t\tfor (Pair<Integer> edge: allEdges){\r\n\t\t\t\tif (edge.getFirst().equals(maxNode)){\r\n\t\t\t\t\tint conflictNode = edge.getSecond().intValue();\r\n\t\t\t\t\tcurrCover.add(conflictNode);\r\n\t\t\t\t\t//allEdges.remove(edge);\r\n\t\t\t\t} else if (edge.getSecond().equals(maxNode)){\r\n\t\t\t\t\tint conflictNode = edge.getFirst().intValue();\r\n\t\t\t\t\tcurrCover.add(conflictNode);\r\n\t\t\t\t\t//allEdges.remove(edge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//System.out.println(\"Edges left after initial trimming: \" + allEdges.toString());\r\n\t\t\t//Remove these nodes\r\n\t\t\tallNodes.removeAll(currCover);\r\n\t\t\t//System.out.println(\"Remaining Nodes: \" + allNodes.toString());\r\n\t\t\t//Remove any edges \r\n\t\t\tSet<Pair<Integer>> edgesToRemove = new HashSet<Pair<Integer>>();\r\n\t\t\tfor (Pair<Integer> edge: allEdges){\r\n\t\t\t\tint first = edge.getFirst().intValue();\r\n\t\t\t\tint second = edge.getSecond().intValue();\r\n\t\t\t\tif (currCover.contains(first) || currCover.contains(second)){\r\n\t\t\t\t\t//allEdges.remove(edge);\r\n\t\t\t\t\tedgesToRemove.add(edge);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tallEdges.removeAll(edgesToRemove);\r\n\t\t\t//System.out.println(\"Edges left after final cuts: \" + allEdges.toString());\r\n\t\t}\r\n\t\treturn currCover;\r\n\t}",
"@Test\n public void baseCaseTriviallyIdenticalGraphsTest() {\n Event a1 = new Event(\"label1\");\n Event a2 = new Event(\"label1\");\n\n EventNode e1 = new EventNode(a1);\n EventNode e2 = new EventNode(a2);\n // If k exceeds the depth of the graph, if they are equivalent to max\n // existing depth then they are equal. Regardless of subsumption.\n testKEqual(e1, e2, 100);\n // A node should always be k-equivalent to itself.\n testKEqual(e1, e1, 100);\n }",
"@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }",
"private static BigInteger connectedGraphs(\n final int v, final int e) {\n if (v == 0) {\n return ZERO;\n }\n if (v == 1) {\n // Fast exit #1: single-vertex\n return e == 0 ? ONE : ZERO;\n }\n final int allE = v * (v - 1) >> 1;\n if (e == allE) {\n // Fast exit #2: complete graph (the only result)\n return ONE;\n }\n final int key = v << 16 | e;\n if (CONN_GRAPHS_CACHE.containsKey(key)) {\n return CONN_GRAPHS_CACHE.get(key);\n }\n BigInteger result;\n if (e == v - 1) {\n // Fast exit #3: trees -> apply Cayley's formula\n result = BigInteger.valueOf(v).pow(v - 2);\n } else if (e > allE - (v - 1)) {\n // Fast exit #4: e > edges required to build a (v-1)-vertex\n // complete graph -> will definitely form connected graphs\n // in all cases, so just calculate allGraphs()\n result = allGraphs(v, e);\n } else {\n /*\n * In all other cases, we'll have to remove\n * partially-connected graphs from all graphs.\n *\n * We can define a partially-connected graph as a graph\n * with 2 sub-graphs A and B with no edges between them.\n * In addition, we require one of the sub-graphs (say, A)\n * to hold the following properties:\n * 1. A must be connected: this implies that the number\n * of possible patterns for A could be counted\n * by calling connectedGraphs().\n * 2. A must contain at least one fixed vertex:\n * this property - combined with 1. -\n * implies that A would not be over-counted.\n *\n * Under the definitions above, the number of\n * partially-connected graphs to be removed will be:\n *\n * (Combinations of vertices to be added from B to A) *\n * (number of possible A's, by connectedGraphs()) *\n * (number of possible B's, by allGraphs())\n * added up iteratively through v - 1 vertices\n * (one must be fixed in A) and all possible distributions\n * of the e edges through A and B\n */\n result = allGraphs(v, e);\n for (int vA = 1; vA < v; vA++) {\n // Combinations of vertices to be added from B to A\n final BigInteger aComb = nChooseR(v - 1, vA - 1);\n final int allEA = vA * (vA - 1) >> 1;\n // Maximum number of edges which could be added to A\n final int maxEA = allEA < e ? allEA : e;\n for (int eA = vA - 1; eA < maxEA + 1; eA++) {\n result = result.subtract(aComb\n // Number of possible A's\n .multiply(connectedGraphs(vA, eA))\n // Number of possible B's\n .multiply(allGraphs(v - vA, e - eA)));\n }\n }\n }\n CONN_GRAPHS_CACHE.put(key, result);\n return result;\n }",
"private boolean hasNoCycle(int node, int[] color, int[][] graph) {\n if (color[node] > 0)\n return color[node] == 2;\n\n color[node] = 1;\n for (int nei : graph[node]) {\n if (color[nei] == 2)\n continue;\n if (color[nei] == 1 || !hasNoCycle(nei, color, graph))\n return false;\n }\n\n color[node] = 2;\n return true;\n }",
"@Override\r\n\tpublic boolean isEqual(Node node) {\n\t\treturn false;\r\n\t}",
"private void addVertexVisitConstraint(){\n\n for (int vertex=0; vertex < vertexCount; vertex++){\n Integer[] pos = new Integer[variables.length];\n for (int position =0; position < positionCount; position++){\n pos[position] = variables[position][vertex];\n }\n addExactlyOne(pos);\n }\n }",
"private static void checkRecurseUnordered(Vector<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, Vector<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException {\n/* 1306 */ if (!checkOccurrenceRange(min1, max1, min2, max2)) {\n/* 1307 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.1\", new Object[] {\n/* 1308 */ Integer.toString(min1), (max1 == -1) ? \"unbounded\" : \n/* 1309 */ Integer.toString(max1), \n/* 1310 */ Integer.toString(min2), (max2 == -1) ? \"unbounded\" : \n/* 1311 */ Integer.toString(max2)\n/* */ });\n/* */ }\n/* 1314 */ int count1 = dChildren.size();\n/* 1315 */ int count2 = bChildren.size();\n/* */ \n/* 1317 */ boolean[] foundIt = new boolean[count2];\n/* */ \n/* 1319 */ for (int i = 0; i < count1; i++) {\n/* 1320 */ XSParticleDecl particle1 = dChildren.elementAt(i);\n/* */ \n/* 1322 */ int k = 0; while (true) { if (k < count2) {\n/* 1323 */ XSParticleDecl particle2 = bChildren.elementAt(k);\n/* */ try {\n/* 1325 */ particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);\n/* 1326 */ if (foundIt[k]) {\n/* 1327 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.2\", null);\n/* */ }\n/* 1329 */ foundIt[k] = true;\n/* */ \n/* */ \n/* */ break;\n/* 1333 */ } catch (XMLSchemaException xMLSchemaException) {}\n/* */ k++;\n/* */ continue;\n/* */ } \n/* 1337 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.2\", null); }\n/* */ \n/* */ } \n/* */ \n/* 1341 */ for (int j = 0; j < count2; j++) {\n/* 1342 */ XSParticleDecl particle2 = bChildren.elementAt(j);\n/* 1343 */ if (!foundIt[j] && !particle2.emptiable()) {\n/* 1344 */ throw new XMLSchemaException(\"rcase-RecurseUnordered.2\", null);\n/* */ }\n/* */ } \n/* */ }",
"@Override\n\tpublic boolean isConnected() {\n\t\tif(dwg.getV().size()==0) return true;\n\n\t\tIterator<node_data> temp = dwg.getV().iterator();\n\t\twhile(temp.hasNext()) {\n\t\t\tfor(node_data w : dwg.getV()) {\n\t\t\t\tw.setTag(0);\n\t\t\t}\n\t\t\tnode_data n = temp.next();\n\t\t\tQueue<node_data> q = new LinkedBlockingQueue<node_data>();\n\t\t\tn.setTag(1);\n\t\t\tq.add(n);\n\t\t\twhile(!q.isEmpty()) {\n\t\t\t\tnode_data v = q.poll();\n\t\t\t\tCollection<edge_data> arrE = dwg.getE(v.getKey());\n\t\t\t\tfor(edge_data e : arrE) {\n\t\t\t\t\tint keyU = e.getDest();\n\t\t\t\t\tnode_data u = dwg.getNode(keyU);\n\t\t\t\t\tif(u.getTag() == 0) {\n\t\t\t\t\t\tu.setTag(1);\n\t\t\t\t\t\tq.add(u);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tv.setTag(2);\n\t\t\t}\n\t\t\tCollection<node_data> col = dwg.getV();\n\t\t\tfor(node_data n1 : col) {\n\t\t\t\tif(n1.getTag() != 2) {\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}",
"@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }",
"private static boolean isItVisted(Node node) {\n\t\t\n\t\tboolean areNodesEqual = false;\n\t\tfor (Node temp : nodesCovered) {\n\t\t\tif(choice==1){\n\t\t\t\tif (node.count == temp.count) \t\t\t\t{\n\t\t\t\t\tif (areTheyEqual(temp.stateSpace, node.stateSpace)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t }\n\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tif (node.manhattanDist == temp.manhattanDist) {\n\t\t\t\t\t\tif (areTheyEqual(temp.stateSpace, node.stateSpace)) {\n\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\treturn areNodesEqual;\n\t}",
"public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }",
"private static void bfs(int idx) {\n\t\t\n\t\tQueue<node> q =new LinkedList<node>();\n\t\tq.add(new node(idx,0,\"\"));\n\t\twhile (!q.isEmpty()) {\n\t\t\tnode tmp = q.poll();\n\t\t\tif(tmp.idx<0 ||tmp.idx > 200000) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif(tmp.cnt> min) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tmp.idx == k) {\n\t\t\t\tif(tmp.cnt < min) {\n\t\t\t\t\tmin = tmp.cnt;\n\t\t\t\t\tminnode = tmp;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(!visit[tmp.idx] && tmp.idx<=100000) {\n\t\t\t\tvisit[tmp.idx]= true;\n\t\t\t\tq.add(new node(tmp.idx*2, tmp.cnt+1,tmp.s));\n\t\t\t\tq.add(new node(tmp.idx-1, tmp.cnt+1,tmp.s));\n\t\t\t\tq.add(new node(tmp.idx+1, tmp.cnt+1,tmp.s));\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public static <V> Graph<V> getMinimumSpanningTreePrim(Graph<V> graph) {\n V[] array = graph.getValuesAsArray();\n double[][] matriz = graph.getGraphStructureAsMatrix();\n\n double[][] matrizCopia = new double[array.length][array.length]; //Se hace una copia del array. Sino, se modificaria en el grafo original.\n for (int x = 0; x < array.length; x++) {\n for (int y = 0; y < array.length; y++) {\n matrizCopia[x][y] = matriz[x][y];\n }\n }\n\n boolean[] revisados = new boolean[array.length]; // Arreglo de booleanos que marca los valores por donde ya se paso.\n Set<V> conjuntoRevisados = new LinkedListSet<>(); //Conjunto donde se guardan los vertices por donde ya se paso\n Graph<V> nuevo = new AdjacencyMatrix<>(graph.isDirected(), true);\n\n if (array.length > 0) { // Grafo no vacio\n\n revisados[0] = true;\n conjuntoRevisados.put(array[0]);\n nuevo.addNode(array[0]);\n\n double menorArista = 50000;\n V verticeOrigen = null;\n V verticeDestino = null;\n\n while (conjuntoRevisados.size() != array.length) { // mientras hayan vertices sin revisar\n\n Iterator<V> it1 = conjuntoRevisados.iterator(); //Se recorren todos los vertices guardados\n while (it1.hasNext()) {\n\n V aux = it1.next();\n int posArray = buscarPosicion(aux, array);\n for (int x = 0; x < array.length; x++) {\n\n if (matrizCopia[posArray][x] != -1) { //Si existe arista\n //Si los 2 vertices no estan en el arbol, para evitar un ciclo\n if (!(conjuntoRevisados.isMember(aux) && conjuntoRevisados.isMember(array[x]))) {\n if (matrizCopia[posArray][x] < menorArista) {\n menorArista = matrizCopia[posArray][x];\n if (!graph.isDirected()) {\n matrizCopia[x][posArray] = -1;\n }\n verticeOrigen = aux;\n verticeDestino = array[x];\n }\n }\n }\n }\n }\n\n if (verticeOrigen != null) {\n if (!nuevo.contains(verticeDestino)) {\n nuevo.addNode(verticeDestino);\n if (!conjuntoRevisados.isMember(verticeDestino)) {\n conjuntoRevisados.put(verticeDestino);\n }\n revisados[buscarPosicion(verticeDestino, array)] = true;\n }\n nuevo.addEdge(verticeOrigen, verticeDestino, menorArista);\n\n verticeOrigen = null;\n menorArista = 50000;\n } else {\n for (int x = 0; x < array.length; x++) {\n if (revisados[x] == false) {\n conjuntoRevisados.put(array[x]);\n nuevo.addNode(array[x]);\n }\n }\n }\n }\n }\n return nuevo;\n }",
"void bellford(ArrayList<Integer> nlist){\n\n int stval = nlist.get(0);\n dlist.get(stval).setval(stval);\n dlist.get(stval).setDist(0);\n\n for(int i = 0; i < nlist.size()-1; i++){\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(key);\n dlist.get(val).setDist(odist+we);\n }\n }\n }\n }\n }\n for(int key: dlist.keySet()){\n System.out.println(key+\" dist:\"+dlist.get(key).getDist()+\" prev:\"+dlist.get(key).getval());\n }\n System.out.println(\"Negative cycles at:\");\n //iisue should run n-1 times:\n for(int key: nlist){\n LinkedList<Node> alist = grp.getOrDefault(key, null);\n if(alist != null){\n for(Node node: alist){\n int val = node.getval();\n int we = node.getDist();\n int ddist = dlist.get(val).getDist();\n int odist = dlist.get(key).getDist();\n if(odist != Integer.MAX_VALUE && ddist > odist+we){\n dlist.get(val).setval(-999);\n dlist.get(val).setDist(odist+we);\n System.out.println(val);\n }\n }\n }\n }\n }",
"public boolean insert(int u, int v) {\n\n forward.addEdge(u, v);\n backward.addEdge(v, u);\n\n // classify the insertion of the edge\n int type = T.classifyInsertion(u, v);\n\n // type 1 insertion: do nothing\n if (type == 1) return true;\n\n //type 3 insertion: absorb free nodes\n if (type == 3) {\n\n MetaNode x = T.getMetaNode(u);\n MetaNode y = T.getMetaNode(v);\n\n // least common ancestor of x and y\n MetaNode z = T.leastCommonAncestor(x, y);\n\n HashSet<Integer> F = z.getMid().getSet();\n ArrayList<Integer> orderF = z.getMid().getOrder();\n\n HashSet<Integer> A = new HashSet<Integer>();\n HashSet<Integer> B = new HashSet<Integer>();\n\n int recourse = 0;\n\n if (F.contains(v)) {\n forward.restrictedDFS(v, F, A);\n ArrayList<Integer> orderA = new ArrayList<Integer>();\n orderA.addAll(orderF);\n orderA.retainAll(A);\n z.getMid().removeFromSet(A);\n recourse = T.ADD(z.getRight(), A, B, orderA, new ArrayList<Integer>(), forward, backward);\n }\n if (F.contains(u)) {\n backward.restrictedDFS(u, F, B);\n ArrayList<Integer> orderB = new ArrayList<Integer>();\n orderB.addAll(orderF);\n orderB.retainAll(B);\n z.getMid().removeFromSet(B);\n recourse = T.ADD(z.getLeft(), A, B, new ArrayList<Integer>(), orderB, forward, backward);\n }\n\n totalRecourse += recourse;\n\n // break it down into an STP after if they are in same set\n if (T.getMetaNode(u).equals(T.getMetaNode(v)))\n type = 2;\n }\n\n //type 2 insertion: break down into further STP\n if (type == 2) {\n\n // the set containing both u and v\n MetaNode x = T.getMetaNode(u);\n\n // nodes we wants to search\n HashSet<Integer> S = x.getSet();\n\n // nodes found in forward search\n HashSet<Integer> R = new HashSet<Integer>();\n\n // nodes found in backward search\n HashSet<Integer> L = new HashSet<Integer>();\n\n forward.restrictedDFS(v, S, R);\n backward.restrictedDFS(u, S, L);\n\n int recourse = 0;\n\n recourse += L.size(); // CAN BE IMPROVED\n recourse += R.size();\n\n totalRecourse += recourse;\n\n // break down x into 3 children\n ArrayList<Integer> orderL = new ArrayList<Integer>();\n orderL.addAll(x.getOrder());\n orderL.retainAll(L);\n\n MetaNode xL = new MetaNode(L, orderL);\n\n ArrayList<Integer> orderR = new ArrayList<Integer>();\n orderR.addAll(x.getOrder());\n orderR.retainAll(R);\n\n MetaNode xR = new MetaNode(R, orderR);\n\n HashSet<Integer> F = new HashSet<Integer>();\n F.addAll(S);\n F.removeAll(L);\n F.removeAll(R);\n\n ArrayList<Integer> orderF = new ArrayList<Integer>();\n orderF.addAll(x.getOrder());\n orderF.retainAll(F);\n\n MetaNode xF = new MetaNode(F, orderF);\n\n x.breakDown(xL, xF, xR);\n }\n\n return false;\n }",
"@Test\n public void shouldNotConsiderTriangleDependencyAsCyclic(){\n\n String a = \"A\";\n String b = \"B\";\n String c = \"C\";\n String d = \"D\";\n ValueStreamMap valueStreamMap = new ValueStreamMap(c, null);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(a, a), null, c);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(b, b), null, c);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(d, d), null, b);\n valueStreamMap.addUpstreamNode(new PipelineDependencyNode(a, a), null, d);\n valueStreamMap.addUpstreamMaterialNode(new SCMDependencyNode(\"g\", \"g\", \"git\"), null, a, new MaterialRevision(null));\n\n assertThat(valueStreamMap.hasCycle(), is(false));\n }",
"@SuppressWarnings(\"unused\")\n private boolean checkIds(CFANode node) {\n\n if (!visited.add(node)) {\n // already handled, do nothing\n return true;\n }\n\n for (CFANode successor : CFAUtils.successorsOf(node)) {\n checkIds(successor);\n }\n\n //node.setReversePostorderId(reversePostorderId2++);\n assert node.getReversePostorderId() == reversePostorderId2++ : \"Node \" + node + \" got \" + node.getReversePostorderId() + \", but should get \" + (reversePostorderId2-1);\n return true;\n }",
"static int findShortest(int graphNodes, int[] graphFrom, int[] graphTo, long[] ids, int val) {\n // build a tree\n HashMap<Integer, List<Integer>> t = new HashMap<>();\n // graphFrom和To,length一样长,是一对\n for (int i = 0; i < graphFrom.length; i++) {\n int from = graphFrom[i];\n int to = graphTo[i];\n if (!t.containsKey(from)) {\n t.put(from, new ArrayList<Integer>());\n }\n if (!t.containsKey(to)) {\n t.put(to, new ArrayList<Integer>());\n }\n List<Integer> l1 = t.get(from);\n l1.add(to);\n List<Integer> l2 = t.get(to);\n l2.add(from);\n }\n\n // find the same colour, i + 1 = 那个node\n List<Integer> findId = new ArrayList<>();\n for (int i = 0; i < ids.length; i++) {\n // val是要找的colour,ids是colour ids\n if (val == ids[i]) {\n findId.add(i + 1);\n }\n }\n\n if (findId.size() <= 1) {\n return -1;\n }\n\n // 1 2 3\n // 只需要loop 2\n int times = findId.size() - 2;\n\n // 可能是数字,或者-1\n int minLength = helper(t, findId, graphNodes);\n for (int i = 0; i < times; i++) {\n int min = helper(t, findId, graphNodes);\n // 假如minLength是数字,min < minLength && min != -1\n // 假如minLength是-1,replace它\n boolean number = min < minLength && min != -1;\n if (minLength == -1 || number) {\n minLength = min;\n }\n }\n\n return minLength;\n }",
"public static void main(String[] args) {\n\t\tNode n = new Node(0);\r\n\t\tNode dummy = n;\r\n\t\tn.next = new Node(1);\r\n\t\tn = n.next;\r\n\t\tn.next = new Node(1);\r\n\t\tn = n.next;\r\n\t\tfor (int i = 1; i < 10; i ++) {\r\n\t\t\tn.next = new Node(i);\r\n\t\t\tn = n.next;\r\n\t\t}\r\n\t\tremoveDuplicate(dummy);\r\n\t\twhile(dummy != null) {\r\n\t\t\tSystem.out.println(dummy.val);\r\n\t\t\tdummy = dummy.next;\r\n\t\t}\r\n\t\t\r\n\t}",
"private void keepRangeRecur(BinaryNode node, E a, E b) {\n\n if (node == null) return;\n\n //node is within a-b bounds so keep it\n if (a.compareTo((E)node.element) <= 0 && b.compareTo((E)node.element) >= 0) {\n keepRangeRecur(node.left, a, b);\n keepRangeRecur(node.right, a, b);\n\n //node is to the left of boundaries\n } else if (a.compareTo((E)node.element) > 0) {\n if (node == root) {\n root = node.right;\n node.right.parent = null;\n } else if (node.parent.right == node) { //node and its parent are out\n root = node;\n node.parent = null;\n keepRangeRecur(node.left, a, b);\n } else { //node is out but its parent is in\n node.parent.left = node.right;\n if (node.right != null) node.right.parent = node.parent; // checking if child exists\n }\n keepRangeRecur(node.right, a, b);\n\n // node is to the right of boundaries\n } else if (b.compareTo((E)node.element) < 0) {\n if (node == root) {\n root = node.left;\n node.left.parent = null;\n } else if (node.parent.left == node) { //node and its parent are out\n root = node;\n node.parent = null;\n keepRangeRecur(node.right, a, b);\n } else { //node is out but its parent is in\n node.parent.right = node.left;\n if (node.left != null) node.left.parent = node.parent; // checking if child exists\n }\n keepRangeRecur(node.left, a, b);\n }\n }",
"@Test\r\n void test_check_order_properly_increased_and_decreased() {\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"C\");\r\n graph.addVertex(\"D\");\r\n graph.addVertex(\"C\");\r\n if(graph.order() != 3) {\r\n fail();\r\n } \r\n graph.removeVertex(\"A\");\r\n graph.removeVertex(\"B\");\r\n graph.removeVertex(\"C\");\r\n if(graph.order() != 1) {\r\n fail();\r\n }\r\n \r\n }",
"static void graphCheck(int u) {\n\t\tdfs_num[u] = DFS_GRAY; // color this as DFS_GRAY (temp)\r\n\t\tfor (int j = 0; j < (int) AdjList[u].size(); j++) {\r\n\t\t\tEdge v = AdjList[u].get(j);\r\n\t\t\tif (dfs_num[v.to] == DFS_WHITE) { // Tree Edge, DFS_GRAY to\r\n\t\t\t\t\t\t\t\t\t\t\t\t// DFS_WHITE\r\n\t\t\t\tdfs_parent[v.to] = u; // parent of this children is me\r\n\t\t\t\tgraphCheck(v.to);\r\n\t\t\t} else if (dfs_num[v.to] == DFS_GRAY) { // DFS_GRAY to DFS_GRAY\r\n\t\t\t\tif (v.to == dfs_parent[u]) // to differentiate these two\r\n\t\t\t\t\t\t\t\t\t\t\t// cases\r\n\t\t\t\t\tSystem.out.printf(\" Bidirectional (%d, %d) - (%d, %d)\\n\",\r\n\t\t\t\t\t\t\tu, v.to, v.to, u);\r\n\t\t\t\telse\r\n\t\t\t\t\t// la mas usada pillar si tiene un ciclo\r\n\t\t\t\t\tSystem.out.printf(\" Back Edge (%d, %d) (Cycle)\\n\", u, v.to);\r\n\t\t\t} else if (dfs_num[v.to] == DFS_BLACK) // DFS_GRAY to DFS_BLACK\r\n\t\t\t\tSystem.out.printf(\" Forward/Cross Edge (%d, %d)\\n\", u, v.to);\r\n\t\t}\r\n\t\tdfs_num[u] = DFS_BLACK; // despues de la recursion DFS_BLACK (DONE)\r\n\t}",
"@Override\n protected boolean removeChanceNode() {\n\n Node candidateToReduce;\n Node candidateToRemove;\n Node nodeToRemove;\n String operation;\n int i;\n NodeList children;\n Node valueNodeToReduce;\n\n NodeList chancesID;\n boolean removed = false;\n Node nodeUtil = null;\n\n\n\n\n // Obtain the value node \n\n //sv = ((IDWithSVNodes) diag).getTerminalValueNode();\n\n //diag.save(\"debug-mediastinet.elv\");\n\n //List of chance nodes in the diagram\n chancesID = diag.getNodesOfKind(Node.CHANCE);\n\n for (i = 0; (i < chancesID.size()) && removed == false; i++) {\n\n candidateToRemove = chancesID.elementAt(i);\n\n //Check if the candidaToRemove can be removed\n if (isRemovableChance(candidateToRemove)) {\n\n nodeToRemove = candidateToRemove;\n children = nodeToRemove.getChildrenNodes();\n //Reduce value nodes if it's necessary\n\n if (children.size() > 1) {\n //We have to reduce\n candidateToReduce = getCandidateValueNodeToReduceForChanceNode(nodeToRemove);\n\n //valueNodeToReduce =\tobtainValueNodeToReduce(reachableParents);\n valueNodeToReduce = obtainValueNodeToReduce(nodeToRemove, candidateToReduce);\n ReductionAndEvalID.reduceNode(\n (IDWithSVNodes) diag,\n valueNodeToReduce);\n nodeUtil = valueNodeToReduce;\n operation = \"Reduce: \" + nodeUtil.getName() + \" to eliminate: \" + nodeToRemove.getName();\n System.out.println(operation);\n statistics.addOperation(operation);\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n //The chance has only one child (utility)\n nodeUtil = children.elementAt(0);\n\n }\n\n\n String auxName = candidateToRemove.getName();\n operation = \"Chance node removal: \" + auxName;\n System.out.println(operation);\n statistics.addOperation(operation);\n\n //Add the name of the node to 'orderOfElimination'\n ((PropagationStatisticsID) statistics).addNameToOrderOfElimination(auxName);\n\n // The relation of the utility node is modified. In this \n // case the parents of the node to remove will be parents \n // of the utility node \n\n modifyUtilityRelation(nodeUtil, nodeToRemove, true);\n\n // Calculate the new expected utility \n getExpectedUtility(nodeUtil, nodeToRemove);\n\n // The node is deleted \n\n diag.removeNodeOnly(nodeToRemove);\n\n//\t\t\t\tStore the size of the diagram\n\n statistics.addSize(diag.calculateSizeOfPotentials());\n\n statistics.addTime(crono.getTime());\n\n indexOperation++;\n try {\n diag.save(\"debug-operation-\" + indexOperation + \".elv\");\n } catch (IOException ex) {\n Logger.getLogger(ArcReversalSV.class.getName()).log(Level.SEVERE, null, ex);\n }\n // Set removed \n removed = true;\n\n }\n }//for\n return removed;\n }",
"@Test\n public void testComplex() {\n\n Map<Integer, String> dict = new HashMap<>();\n dict.put(0, \"x1\");\n dict.put(1, \"x3\");\n dict.put(2, \"x5\");\n dict.put(3, \"x2\");\n dict.put(4, \"x4\");\n dict.put(5, \"x6\");\n\n Map<String, Integer> rdict = new HashMap<>();\n rdict.put(\"x1\", 0);\n rdict.put(\"x3\", 1);\n rdict.put(\"x5\", 2);\n rdict.put(\"x2\", 3);\n rdict.put(\"x4\", 4);\n rdict.put(\"x6\", 5);\n\n BddManager manager = new BddManager(6);\n manager.variableString((x) -> x < 6 ? dict.get(x) : \"sink\");\n\n BddNode a13 = manager.create(rdict.get(\"x6\"), manager.One, manager.Zero);\n BddNode a12 = manager.create(rdict.get(\"x4\"), manager.One, a13);\n BddNode a11 = manager.create(rdict.get(\"x4\"), manager.One, manager.Zero);\n BddNode a10 = manager.create(rdict.get(\"x2\"), manager.One, manager.Zero);\n BddNode a9 = manager.create(rdict.get(\"x2\"), manager.One, a13);\n BddNode a8 = manager.create(rdict.get(\"x2\"), manager.One, a11);\n BddNode a7 = manager.create(rdict.get(\"x2\"), manager.One, a12);\n BddNode a6 = manager.create(rdict.get(\"x5\"), a13, manager.Zero);\n BddNode a5 = manager.create(rdict.get(\"x5\"), a12, a11);\n BddNode a4 = manager.create(rdict.get(\"x5\"), a9, a10);\n BddNode a3 = manager.create(rdict.get(\"x5\"), a7, a8);\n BddNode a2 = manager.create(rdict.get(\"x3\"), a5, a6);\n BddNode a1 = manager.create(rdict.get(\"x3\"), a3, a4);\n BddNode a0 = manager.create(rdict.get(\"x1\"), a1, a2);\n\n Map<String, Boolean> truth = buildThruthTable(manager, a0);\n\n System.out.println(manager.toDot(a0, (x) -> \"x\" + x.index() + \" (\" + x.refCount() + \")\", true));\n\n BddNode res = manager.sifting(a0);\n\n System.out.println(manager.toDot(res, (x) -> \"x\" + x.index() + \" (\" + x.refCount() + \")\", true));\n\n checkThruthTable(truth, res);\n\n int size = manager.size(res);\n Assert.assertEquals(8, size);\n }",
"private int BFS() {\n adjList.cleanNodeFields();\n\n //Queue for storing current shortest path\n Queue<Node<Integer, Integer>> q = new LinkedList<>();\n\n //Set source node value to 0\n q.add(adjList.getNode(startNode));\n q.peek().key = 0;\n q.peek().d = 0;\n q.peek().visited = true;\n\n //Helper variables\n LinkedList<Pair<Node<Integer, Integer>, Integer>> neighbors;//Array of pairs <neighborKey, edgeWeight>\n Node<Integer, Integer> neighbor, u;\n long speed = (long) (cellSideLength * 1.20);\n\n while (!isCancelled() && q.size() != 0) {\n u = q.poll();\n\n //Marks node as checked\n checkedNodesGC.fillRect((u.value >> 16) * cellSideLength + 0.5f,\n (u.value & 0x0000FFFF) * cellSideLength + 0.5f,\n (int) cellSideLength - 1, (int) cellSideLength - 1);\n\n //endNode found\n if (u.value == endNode) {\n //Draws shortest path\n Node<Integer, Integer> current = u, prev = u;\n\n while ((current = current.prev) != null) {\n shortestPathGC.strokeLine((prev.value >> 16) * cellSideLength + cellSideLength / 2,\n (prev.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2,\n (current.value >> 16) * cellSideLength + cellSideLength / 2,\n (current.value & 0x0000FFFF) * cellSideLength + cellSideLength / 2);\n prev = current;\n }\n return u.d;\n }\n\n //Wait after checking node\n try {\n Thread.sleep(speed);\n } catch (InterruptedException interrupted) {\n if (isCancelled())\n break;\n }\n\n //Checking Neighbors\n neighbors = adjList.getNeighbors(u.value);\n for (Pair<Node<Integer, Integer>, Integer> neighborKeyValuePair : neighbors) {\n neighbor = neighborKeyValuePair.getKey();\n //Relaxation step\n //Checks if neighbor hasn't been checked, if so the assign the shortest path\n if (!neighbor.visited) {\n //Adds checked neighbor to queue\n neighbor.key = u.d + 1;\n neighbor.d = u.d + 1; //Assign shorter path found to neighbor\n neighbor.prev = u;\n neighbor.visited = true;\n q.add(neighbor);\n }\n }\n }\n return Integer.MAX_VALUE;\n }",
"@Test\n public void shouldUpdateDependentIfNodeAlreadyPresent() {\n String dependent = \"P1\";\n ValueStreamMap graph = new ValueStreamMap(dependent, null);\n graph.addUpstreamNode(new PipelineDependencyNode(\"d1\", \"d1\"), null, dependent);\n graph.addUpstreamNode(new PipelineDependencyNode(\"d2\", \"d2\"), null, dependent);\n graph.addUpstreamNode(new PipelineDependencyNode(\"d3\", \"d3\"), null, \"d1\");\n graph.addUpstreamNode(new PipelineDependencyNode(\"d3\", \"d3\"), null, \"d2\");\n\n VSMTestHelper.assertThatNodeHasChildren(graph, \"d3\", 0, \"d1\", \"d2\");\n }",
"@Override\n\tpublic boolean add(T elem) {\n\t\tif (this.contains(elem)) { // no duplicates\n\t\t\treturn false;\n\t\t} else if (valCount < 3) { // if has space for more\n\t\t\tif (childCount == 0) { // add elem as direct descendant\n\t\t\t\tfor (int i = 0; i < valCount; ++i) {\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\tfor (int j = 2; j > i; --j) { // shifts all other elements by 1\n\t\t\t\t\t\t\tvalues[j] = values[j - 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvalues[i] = elem;\n\t\t\t\t\t++valCount;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else { // add elem as indirect descendant\n\t\t\t\tfor (int i = 0; i < childCount; ++i) { // searching with which child elem belongs\n\t\t\t\t\tif (comp.compare(elem,values[i]) < 0) {\n\t\t\t\t\t\treturn children[i].add(elem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn children[childCount].add(elem); // elem is greater than all other children and should be put rightmost\n\t\t\t}\n\t\t} else { // node is 4-tree and should be reduced\n\t\t\tTwoThreeFourTreeSet<T> tempLeft = new TwoThreeFourTreeSet<T>(); // generating new left and right children of reduced node\n\t\t\tTwoThreeFourTreeSet<T> tempRight = new TwoThreeFourTreeSet<T>();\n\t\t\t\n\t\t\ttempLeft.values[0] = values[0];\n\t\t\ttempLeft.valCount = 1;\n\t\t\ttempLeft.children[0] = this.children[0];\n\t\t\ttempLeft.children[1] = this.children[1];\n\t\t\ttempLeft.childCount = 2;\n\t\t\t\n\t\t\ttempRight.values[0] = values[2];\n\t\t\ttempRight.valCount = 1;\n\t\t\ttempRight.children[0] = this.children[2];\n\t\t\ttempRight.children[1] = this.children[3];\n\t\t\ttempRight.childCount = 2;\n\t\t\t\n\t\t\tif (parent == null) { // if no parent, create new node with middle value\n\t\t\t\tTwoThreeFourTreeSet<T> tempParent = new TwoThreeFourTreeSet<T>();\n\t\t\t\ttempParent.values[0] = values[1];\n\t\t\t\t\t\n\t\t\t\ttempParent.children[0] = tempLeft;\n\t\t\t\ttempParent.children[1] = tempRight;\n\t\t\t\ttempParent.childCount = 2;\n\t\t\t\tthis.parent = tempParent;\n\t\t\t} else { // else parent exists, and current node should be added\n\t\t\t\tif (comp.compare(parent.values[0],values[1]) < 0) { // if node belongs leftmost\n\t\t\t\t\tif (parent.valCount > 1) {\n\t\t\t\t\t\t// shift right element by 1\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// shift left element by 1\n\t\t\t\t\tparent.values[1] = parent.values[0];\n\t\t\t\t\tparent.children[2] = parent.children[1];\n\t\t\t\t\t\n\t\t\t\t\t// push left;\n\t\t\t\t\tparent.values[0] = values[1];\n\t\t\t\t\tparent.children[0] = tempLeft;\n\t\t\t\t\tparent.children[1] = tempRight;\n\t\t\t\t} else if (parent.valCount < 2 || comp.compare(parent.values[1],values[1]) < 0) { // if node belongs in center\n\t\t\t\t\tif (parent.valCount > 1) { // should we shift?\n\t\t\t\t\t\tparent.values[2] = parent.values[1];\n\t\t\t\t\t\tparent.children[3] = parent.children[2];\n\t\t\t\t\t}\n\t\t\t\t\t// push center\n\t\t\t\t\tparent.values[1] = values[1];\n\t\t\t\t\tparent.children[1] = tempLeft;\n\t\t\t\t\tparent.children[2] = tempRight;\n\t\t\t\t} else { // if node belongs rightmost\n\t\t\t\t\t// push right\n\t\t\t\t\tparent.values[2] = values[1];\n\t\t\t\t\tparent.children[2] = tempLeft;\n\t\t\t\t\tparent.children[3] = tempRight;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tTwoThreeFourTreeSet<T> newTree = this;\n\t\t\tnewTree = newTree.parent; // changing this indirectly\n\t\t\t++newTree.valCount;\n\t\t\treturn newTree.add(elem);\n\t\t}\n\t\treturn false;\n\t}",
"private void updateTopologyGraph(ExecNode<?> node) {\n TreeMap<Integer, List<Integer>> inputPriorityGroupMap = new TreeMap<>();\n Preconditions.checkState(\n node.getInputEdges().size() == node.getInputProperties().size(),\n \"Number of inputs nodes does not equal to number of input edges for node \"\n + node.getClass().getName()\n + \". This is a bug.\");\n for (int i = 0; i < node.getInputProperties().size(); i++) {\n int priority = node.getInputProperties().get(i).getPriority();\n inputPriorityGroupMap.computeIfAbsent(priority, k -> new ArrayList<>()).add(i);\n }\n\n // add edges between neighboring priority groups\n List<List<Integer>> inputPriorityGroups = new ArrayList<>(inputPriorityGroupMap.values());\n for (int i = 0; i + 1 < inputPriorityGroups.size(); i++) {\n List<Integer> higherGroup = inputPriorityGroups.get(i);\n List<Integer> lowerGroup = inputPriorityGroups.get(i + 1);\n\n for (int higher : higherGroup) {\n for (int lower : lowerGroup) {\n addTopologyEdges(node, higher, lower);\n }\n }\n }\n }",
"public MutableNodeSet(Graph graph) {\n\t\tsuper(graph);\n\t\tthis.members = new TreeSet<Integer>();\n\t\tinitializeInOutWeights();\n\t}",
"private static void checkNSRecurseCheckCardinality(Vector<XSParticleDecl> children, int min1, int max1, SubstitutionGroupHandler dSGHandler, XSParticleDecl wildcard, int min2, int max2, boolean checkWCOccurrence) throws XMLSchemaException {\n/* 1226 */ if (checkWCOccurrence && !checkOccurrenceRange(min1, max1, min2, max2)) {\n/* 1227 */ throw new XMLSchemaException(\"rcase-NSRecurseCheckCardinality.2\", new Object[] {\n/* 1228 */ Integer.toString(min1), (max1 == -1) ? \"unbounded\" : \n/* 1229 */ Integer.toString(max1), \n/* 1230 */ Integer.toString(min2), (max2 == -1) ? \"unbounded\" : \n/* 1231 */ Integer.toString(max2)\n/* */ });\n/* */ }\n/* */ \n/* 1235 */ int count = children.size();\n/* */ try {\n/* 1237 */ for (int i = 0; i < count; i++) {\n/* 1238 */ XSParticleDecl particle1 = children.elementAt(i);\n/* 1239 */ particleValidRestriction(particle1, dSGHandler, wildcard, null, false);\n/* */ \n/* */ }\n/* */ \n/* */ \n/* */ }\n/* 1245 */ catch (XMLSchemaException e) {\n/* 1246 */ throw new XMLSchemaException(\"rcase-NSRecurseCheckCardinality.1\", null);\n/* */ } \n/* */ }",
"@Test\n public void restrictedEdges() {\n int costlySource = graph.edge(0, 1).setDistance(5).set(speedEnc, 10, 10).getEdge();\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(2, 3).setDistance(1).set(speedEnc, 10, 10);\n int costlyTarget = graph.edge(3, 4).setDistance(5).set(speedEnc, 10, 10).getEdge();\n int cheapSource = graph.edge(0, 5).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(5, 6).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(6, 7).setDistance(1).set(speedEnc, 10, 10);\n int cheapTarget = graph.edge(7, 4).setDistance(1).set(speedEnc, 10, 10).getEdge();\n graph.edge(2, 6).setDistance(1).set(speedEnc, 10, 10);\n\n assertPath(calcPath(0, 4, cheapSource, cheapTarget), 0.4, 4, 400, nodes(0, 5, 6, 7, 4));\n assertPath(calcPath(0, 4, cheapSource, costlyTarget), 0.9, 9, 900, nodes(0, 5, 6, 2, 3, 4));\n assertPath(calcPath(0, 4, costlySource, cheapTarget), 0.9, 9, 900, nodes(0, 1, 2, 6, 7, 4));\n assertPath(calcPath(0, 4, costlySource, costlyTarget), 1.2, 12, 1200, nodes(0, 1, 2, 3, 4));\n }",
"@Override\r\n\t\tpublic boolean isEqualNode(Node arg)\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}",
"@Override\r\n\tpublic void generateNodeRule(int step) throws IOException {\n\t\t\r\n\t\tgenerateNetNode.setSeedNodes(step, numberMaxSeed, setLayoutSeed);\r\n\t\t\r\n\t\tgenerateNetNodeVectorField.handleCreateSeedGraph(createSeedGraph, step); \r\n\t\r\n\t\t// list node element\r\n\t\tArrayList <Node> listNodeSeed = new ArrayList<Node> ( graphToolkit.getListElement(seedGraph, element.node, elementTypeToReturn.element));\t//\tSystem.out.println(listNodeSeed);\t\r\n\t\tArrayList<Integer> listIdSeedInt = new ArrayList<Integer>( graphToolkit.getListElement(seedGraph, element.node, elementTypeToReturn.integer)) ;\t\t\t\r\n\t\tArrayList<Integer> listIdNetInt = new ArrayList<Integer>( graphToolkit.getListElement(netGraph, element.node, elementTypeToReturn.integer)) ;\t\r\n\t\t\r\n\t\tint idNodeInt = Math.max(graphToolkit.getMaxIdIntElement(netGraph, element.node) , graphToolkit.getMaxIdIntElement(seedGraph, element.node) ) ;\r\n\t\t\r\n\t\t// map to update\r\n\t\tMap< Integer , double[] > mapIdNewSeedCoord = new HashMap< Integer , double[] > ();\r\n\t\tMap< Integer , String > mapIdNewSeedFather = new HashMap< Integer , String > ();\r\n\t\t\r\n\t\t// print\r\n\t\tSystem.out.println(seedGraph + \" \" + listIdSeedInt.size() /* + \" \" + listIdSeedInt */ );//\t\tSystem.out.println(netGraph + \" \" + listIdNetInt.size() + \" \" + listIdNetInt );\r\n\t\r\n\t\tint idLocal = 0 ;\r\n\r\n\t\tfor ( Node nodeSeed : listNodeSeed ) {\r\n\t\t\r\n\t\t\tString idSeed = nodeSeed.getId() ;\r\n\t\t\t\r\n\t\t//\tbucketSet.putNode(netGraph.getNode(idSeed)) ;\r\n\t\t\t\r\n\t\t\tdouble[] \tnodeCoord = GraphPosLengthUtils.nodePosition(nodeSeed) ,\r\n\t\t\t\t\t\tvector = getVector(vecGraph, nodeCoord, typeInterpolation ) ;\t\t\r\n\t\t\t\r\n\t\t\t// check vector\r\n\t\t\tdouble vectorInten = Math.pow( Math.pow(vector[0], 2) + Math.pow(vector[1], 2) , 0.5 ) ;\r\n\t\t\t\r\n\t\t\tif ( vectorInten > maxInten) {\r\n\t\t\t\tvector[0] = vector[0] / vectorInten * maxInten ; \r\n\t\t\t\tvector[1] = vector[1] / vectorInten * maxInten ;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// check vector in grid\r\n\t\t\tdouble \txTopVector = generateNetNode.checkCoordInGrid ( gsGraph , nodeCoord[0] + vector[0] ) ,\r\n\t\t\t\t\tyTopVector = generateNetNode.checkCoordInGrid ( gsGraph , nodeCoord[1] + vector[1] ) ;\t\t\t\t\t\t// \tSystem.out.println(idSeed + \" \" + vector[0] + \" \" + vector[1]);\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\tdouble [] newNodeSeedCoord = new double[2] ;\r\n\t\t\t\t\t\t\r\n\t\t\tnewNodeSeedCoord[0] = xTopVector ;\r\n\t\t\tnewNodeSeedCoord[1] = yTopVector ;\r\n\t\t\t\r\n\t\t\tif ( dieBord ) {\t\t\r\n\t\t\t\tif ( newNodeSeedCoord[0] < 1 || newNodeSeedCoord[1] < 1 || newNodeSeedCoord[0] > sizeGridEdge -1 || newNodeSeedCoord[1] > sizeGridEdge - 1 )\r\n\t\t\t\t\tcontinue ;\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tArrayList<Integer> listIdNetIntLocal = new ArrayList<Integer> ( graphToolkit.getListElement(netGraph, element.node, elementTypeToReturn.integer)) ;\t\t//\tSystem.out.println(listIdNetIntLocal);\r\n\t\t\tArrayList<Integer> listIdSeedIntLocal = new ArrayList<Integer> ( graphToolkit.getListElement(seedGraph, element.node, elementTypeToReturn.integer)) ;\t\t//\tSystem.out.println(listIdNetIntLocal);\r\n\t\t\t\r\n\t\t\tint idInt = Collections.max(listIdNetIntLocal) ; //Math.max(listIdNetIntLocal, b) ;\r\n\t\t\twhile ( listIdNetIntLocal.contains(idInt) && listIdSeedIntLocal.contains(idInt) ) \r\n\t\t\t\tidInt ++ ;\r\n\t\t\t\r\n\t\t\tString id = Integer.toString(idInt) ;\t\t\t//\tSystem.out.println(idInt);\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tnetGraph.addNode(id);\r\n\t\t\t\tseedGraph.addNode(id);\r\n\t\t\t\tbucketSet.putNode(netGraph.getNode(id));\r\n\t\t\t}\r\n\t\t\tcatch (org.graphstream.graph.IdAlreadyInUseException e) {\r\n\t\t\t\t\r\n\t\t\t\tlistIdSeedIntLocal = new ArrayList<Integer> ( graphToolkit.getListElement(seedGraph, element.node, elementTypeToReturn.integer)) ;\r\n\t\t\t\tlistIdNetIntLocal = new ArrayList<Integer> ( graphToolkit.getListElement(netGraph, element.node, elementTypeToReturn.integer)) ;\r\n\t\t\t\t\r\n\t\t\t\tidInt = Math.max(Collections.max(listIdNetIntLocal) , Collections.max(listIdSeedIntLocal) ) ;\r\n\t\t\t\tidInt ++ ; \r\n\t\t\t\twhile ( listIdNetIntLocal.contains(idInt) && listIdSeedIntLocal.contains(idInt))\r\n\t\t\t\t\tidInt ++ ;\r\n\t\t\t\t\r\n\t\t\t\tid = Integer.toString(idInt) ;\t\t\t//\tSystem.out.println(idInt);\r\n\t\t\t\t\r\n\t\t\t\tnetGraph.addNode(id);\r\n\t\t\t\tseedGraph.addNode(id);\r\n\t\t\t\tbucketSet.putNode(netGraph.getNode(id));\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tNode nodeNewNet = netGraph.getNode(id);\r\n\t\t\tNode nodeNewSeed = seedGraph.getNode(id);\r\n\t\t\t\t\t\t\r\n\t\t\tnodeNewSeed.addAttribute(\"xyz\", newNodeSeedCoord[0] , newNodeSeedCoord[1] , 0 );\r\n\t\t\tnodeNewSeed.addAttribute(\"father\", idSeed );\r\n\t\t\t\r\n\t\t\tnodeNewNet.addAttribute(\"xyz\", newNodeSeedCoord[0] , newNodeSeedCoord[1] , 0 );\r\n\t\t\tnodeNewNet.addAttribute(\"father\", idSeed );\t\r\n\t\t\t\r\n\t\t\tnodeNewNet.setAttribute(\"seedGrad\", 1);\r\n\t\t}\r\n\t\t\r\n\t\t// remove old seed\r\n\t\tfor ( int i : listIdSeedInt) //\tSystem.out.println(i);\r\n\t\t\tseedGraph.removeNode(Integer.toString(i));\t\r\n\t}",
"private final void pruneParallelSkipEdges() {\n // TODO: IF THERE ARE MULTIPLE EDGES WITH THE SAME EDGE WEIGHT, WE ARBITRARILY PICK THE FIRST EDGE TO KEEP\n // THE ORDERING MAY BE DIFFERENT FROM BOTH SIDES OF THE EDGE, WHICH CAN LEAD TO A NONSYMMETRIC GRAPH\n // However, no issues have cropped up yet. Perhaps the ordering happens to be the same for both sides,\n // due to how the graph is constructed. This is not good to rely upon, however.\n Memory.initialise(maxSize, Float.POSITIVE_INFINITY, -1, false);\n \n int maxDegree = 0;\n for (int i=0;i<nNodes;++i) {\n maxDegree = Math.max(maxDegree, nSkipEdgess[i]);\n }\n \n int[] neighbourIndexes = new int[maxDegree];\n int[] lowestCostEdgeIndex = new int[maxDegree];\n float[] lowestCost = new float[maxDegree];\n int nUsed = 0;\n \n for (int i=0;i<nNodes;++i) {\n nUsed = 0;\n int degree = nSkipEdgess[i];\n int[] sEdges = outgoingSkipEdgess[i];\n float[] sWeights = outgoingSkipEdgeWeightss[i];\n \n for (int j=0;j<degree;++j) {\n int dest = sEdges[j];\n float weight = sWeights[j];\n \n int p = Memory.parent(dest);\n int index = -1;\n \n if (p == -1) {\n index = nUsed;\n ++nUsed;\n \n Memory.setParent(dest, index);\n neighbourIndexes[index] = dest;\n \n lowestCostEdgeIndex[index] = j;\n lowestCost[index] = weight;\n } else {\n index = p;\n if (weight < lowestCost[index]) {\n // Remove existing\n \n /* ________________________________\n * |______E__________C____________L_|\n * ________________________________\n * |______C__________L____________E_|\n * ^\n * |\n * nSkipEdges--\n */\n swapSkipEdges(i, lowestCostEdgeIndex[index], j);\n swapSkipEdges(i, j, degree-1);\n --j; --degree;\n \n // lowestCostEdgeIndex[index] happens to be the same as before.\n lowestCost[index] = weight;\n } else {\n // Remove this.\n \n /* ________________________________\n * |______E__________C____________L_|\n * ________________________________\n * |______E__________L____________C_|\n * ^\n * |\n * nSkipEdges--\n */\n swapSkipEdges(i, j, degree-1);\n --j; --degree;\n }\n }\n \n }\n nSkipEdgess[i] = degree;\n \n // Cleanup\n for (int j=0;j<nUsed;++j) {\n Memory.setParent(neighbourIndexes[j], -1); \n }\n }\n }",
"private Collection<Node> keepOnlySetElement(Collection<Node> nodes) {\n Set<Node> elements = new HashSet<>();\n for (Node node : nodes) {\n Edge originalEdge = synchronizer().getOriginalEdge(node);\n if ((originalEdge != null && !boundaries.edges.contains(originalEdge))\n || !boundaries.nodes.contains(node)) {\n elements.add(node);\n }\n }\n return elements;\n }",
"public boolean dealCornerCase(Graph g) {\n\t\tif (g == null) {\n\t\t\tthis.minSequence = null;\n\t\t\treturn false;\n\t\t} else if (g.getNodeCount() == 0) {\n\t\t\tthis.minSequence = null;\n\t\t\treturn false;\n\t\t} else if (g.getEdgeCount() == 0)// No edge At all\n\t\t{\n\t\t\tif (g.getNodeCount() > 1) {\n\t\t\t\tSystem.out\n\t\t\t\t\t\t.println(\"YDY: Exception in serialize of CanonicalDFS: not connected\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.minSequence = new int[1][5];\n\t\t\tminSequence[0][0] = 0;\n\t\t\tminSequence[0][1] = -1;\n\t\t\tminSequence[0][2] = g.getNodeLabel(0);\n\t\t\tminSequence[0][3] = -1;\n\t\t\tminSequence[0][4] = -1;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"@Test\n\tvoid testEdgesNotNull() {\n\t\tmap.put(\"Boston\", new LinkedHashSet<String>());\n\t\tAssertions.assertNotNull(map.get(\"Boston\"));\n\n\t}",
"private static void checkRecurse(Vector<XSParticleDecl> dChildren, int min1, int max1, SubstitutionGroupHandler dSGHandler, Vector<XSParticleDecl> bChildren, int min2, int max2, SubstitutionGroupHandler bSGHandler) throws XMLSchemaException {\n/* 1258 */ if (!checkOccurrenceRange(min1, max1, min2, max2)) {\n/* 1259 */ throw new XMLSchemaException(\"rcase-Recurse.1\", new Object[] {\n/* 1260 */ Integer.toString(min1), (max1 == -1) ? \"unbounded\" : \n/* 1261 */ Integer.toString(max1), \n/* 1262 */ Integer.toString(min2), (max2 == -1) ? \"unbounded\" : \n/* 1263 */ Integer.toString(max2)\n/* */ });\n/* */ }\n/* 1266 */ int count1 = dChildren.size();\n/* 1267 */ int count2 = bChildren.size();\n/* */ \n/* 1269 */ int current = 0;\n/* 1270 */ for (int i = 0; i < count1; i++) {\n/* */ \n/* 1272 */ XSParticleDecl particle1 = dChildren.elementAt(i);\n/* 1273 */ int k = current; while (true) { if (k < count2) {\n/* 1274 */ XSParticleDecl particle2 = bChildren.elementAt(k);\n/* 1275 */ current++;\n/* */ try {\n/* 1277 */ particleValidRestriction(particle1, dSGHandler, particle2, bSGHandler);\n/* */ \n/* */ break;\n/* 1280 */ } catch (XMLSchemaException e) {\n/* 1281 */ if (!particle2.emptiable())\n/* 1282 */ throw new XMLSchemaException(\"rcase-Recurse.2\", null); \n/* */ } k++; continue;\n/* */ } \n/* 1285 */ throw new XMLSchemaException(\"rcase-Recurse.2\", null); }\n/* */ \n/* */ } \n/* */ \n/* 1289 */ for (int j = current; j < count2; j++) {\n/* 1290 */ XSParticleDecl particle2 = bChildren.elementAt(j);\n/* 1291 */ if (!particle2.emptiable()) {\n/* 1292 */ throw new XMLSchemaException(\"rcase-Recurse.2\", null);\n/* */ }\n/* */ } \n/* */ }",
"@Override public int set(L source, L target, int weight) {\r\n \r\n \tif(weight>0) {\r\n \t\tboolean flag=false;\r\n \t\tif(!vertices.contains(source)) {\r\n \t\t\tvertices.add(source);\r\n \t\t\tflag=true;\r\n \t\t}\r\n \tif(!vertices.contains(target)) {\r\n \t\tvertices.add(target);\r\n \t\tflag=true;\r\n \t}\r\n \tEdge<L> e=new Edge<L>(source,target,weight);\r\n \tif(flag==true) {//加点,直接把新边写入,\r\n \t\t\r\n \tedges.add(e);\r\n \tcheckRep();\r\n \treturn 0;\r\n \t}\r\n \telse {//点已经在了,可能边已经在了,考虑重复问题\r\n \t\tint n=edges.size();\r\n \t\tif(n==0) {\r\n \t\t\t\r\n \tedges.add(e);\r\n \tcheckRep();\r\n \treturn 0;\r\n \t\t}\r\n \t\telse {\r\n \t\t\tboolean tag=false;\t\r\n \t\t\tfor(int i=0;i<n;i++) {\r\n \t\t\t\t//这一步太关键了,之前一直判断是false\r\n \t\t\t\tif(edges.get(i).getSource().equals(source) && edges.get(i).getTarget().equals(target)) {\r\n \t\t\t//\tif(edges.get(i).getSource()==source && edges.get(i).getTarget()==target) {\r\n \t\t\t\t\tint res=edges.get(i).getWeight();\r\n \t\t\t\t\tedges.set(i,e);\r\n \t\t\t\t\tcheckRep();\r\n \t\t\t\t\ttag=true;\r\n \t\t\t\t\treturn res;//边已经在了,重新写权重\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\t//边不在里面,直接写入\r\n \t\t\tif(tag==false) {\r\n \t\t\t\tedges.add(e);\r\n \t\t\t\tcheckRep();\r\n \t\t\t\treturn 0;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n \t\r\n \t}\r\n \telse if(weight==0) {\r\n \t\tif(!vertices.contains(source)||!vertices.contains(target)) return 0;\r\n \t\tint n=edges.size();\r\n \t\tfor(int i=0;i<n;i++) {\r\n \t\t\t//改了\r\n\t\t\t\tif(edges.get(i).getSource().equals(source) && edges.get(i).getTarget().equals(target)) {\r\n \t\t\t//if(edges.get(i).getSource()==source && edges.get(i).getTarget()==target) {\t\r\n \t\t\t//把已经在的边移除\r\n\t\t\t\t\tint res=edges.get(i).getWeight();\r\n\t\t\t\t\tedges.remove(i);\r\n\t\t\t\t\tcheckRep();\r\n\t\t\t\t\treturn res;\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t\treturn 0;\r\n \t}\r\n \tcheckRep();\r\n \treturn 0;\r\n \t\r\n }",
"boolean hasPathTo(int v)\n\t{\n\t\treturn edgeTo[v].weight()!=Double.POSITIVE_INFINITY;\n\t}",
"@Test\n public void testAdaptivePruningWithAdjacentBadEdges() {\n final int goodMultiplicity = 1000;\n final int variantMultiplicity = 50;\n final int badMultiplicity = 5;\n\n final SeqVertex source = new SeqVertex(\"source\");\n final SeqVertex sink = new SeqVertex(\"sink\");\n final SeqVertex A = new SeqVertex(\"A\");\n final SeqVertex B = new SeqVertex(\"B\");\n final SeqVertex C = new SeqVertex(\"C\");\n final SeqVertex D = new SeqVertex(\"D\");\n final SeqVertex E = new SeqVertex(\"E\");\n\n\n for (boolean variantPresent : new boolean[] {false, true}) {\n final SeqGraph graph = new SeqGraph(20);\n\n graph.addVertices(source, A, B, C, D, sink);\n graph.addEdges(() -> new BaseEdge(true, goodMultiplicity), source, A, B, C, sink);\n graph.addEdges(() -> new BaseEdge(false, badMultiplicity), A, D, C);\n graph.addEdges(() -> new BaseEdge(false, badMultiplicity), D, B);\n\n if (variantPresent) {\n graph.addVertices(E);\n graph.addEdges(() -> new BaseEdge(false, variantMultiplicity), A, E, C);\n }\n\n final ChainPruner<SeqVertex, BaseEdge> pruner = new AdaptiveChainPruner<>(0.01, 2.0,\n ReadThreadingAssemblerArgumentCollection.DEFAULT_PRUNING_SEEDING_LOG_ODDS_THRESHOLD, 50);\n pruner.pruneLowWeightChains(graph);\n\n Assert.assertFalse(graph.containsVertex(D));\n if (variantPresent) {\n Assert.assertTrue(graph.containsVertex(E));\n }\n }\n }",
"public void deleteNodeAboveValue2(int val) {\n\t\tNode helper = new Node(0);\n\t helper.next = head;\n\t Node p = helper;\n\t \n\t while(p.next != null){\n\t if(p.next.value > val){\n\t \tNode next = p.next;\n\t p.next = next.next; \n\t }else{\n\t p = p.next;\n\t }\n\t }\n\t \n\t head = helper.next;\n\t \n\t}",
"static boolean isFeasible(Graph g, Set active, int k) {\r\n\t\tif (active==null) return true;\r\n\t\tif (k==1) {\r\n\t\t\tIterator it = active.iterator();\r\n\t\t\twhile (it.hasNext()) {\r\n\t\t\t\tInteger nid = (Integer) it.next();\r\n\t\t\t\tNode n = g.getNodeUnsynchronized(nid.intValue());\r\n\t\t\t\tSet nbors = n.getNborsUnsynchronized(); // used to be n.getNbors();\r\n\t\t\t\tIterator it2 = nbors.iterator();\r\n\t\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\t\tNode n2 = (Node) it2.next();\r\n\t\t\t\t\tif (active.contains(new Integer(n2.getId()))) return false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tfinal int gsz = g.getNumNodes();\r\n for (int i=0; i<gsz; i++) {\r\n Node nn = g.getNode(i);\r\n\t\t\tSet nnbors = nn.getNbors(); // Set<Node>\r\n\t\t\tint count=0;\r\n\t\t\tif (active.contains(new Integer(i))) count=1;\r\n\t\t\tIterator it2 = active.iterator();\r\n\t\t\twhile (it2.hasNext()) {\r\n\t\t\t\tInteger nid2 = (Integer) it2.next();\r\n\t\t\t\tNode n2 = g.getNode(nid2.intValue());\r\n\t\t\t\tif (nnbors.contains(n2)) {\r\n\t\t\t\t\t++count;\r\n\t\t\t\t\tif (count>1) return false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n return true;\r\n }",
"public boolean hasCycle(ListNode head) {\n if(head == null || head.next == null){\n return false;\n }\n Set<ListNode> nodes = new HashSet<ListNode>();\n ListNode cur = head;\n while(cur != null){\n if(nodes.contains(cur)){\n return true;\n }\n nodes.add(cur);\n cur = cur.next;\n }\n return false;\n }",
"@Test\n void findCycle() {\n Map<String, Set<String>> nonCyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\")\n );\n assertThat(solution.findCycle(nonCyclicGraph)).isFalse();\n\n // 0\n // / | \\\n // a b c\n // /\\ | /\n // a2 a3 b2\n Map<String, Set<String>> cyclicGraph = Map.of(\n \"0\", Set.of(\"a\", \"b\", \"c\"),\n \"a\", Set.of(\"0\", \"a2\", \"a3\"),\n \"a2\", Set.of(\"a\"),\n \"a3\", Set.of(\"a\"),\n \"b\", Set.of(\"0\", \"b2\"),\n \"b2\", Set.of(\"b\"),\n \"c\", Set.of(\"0\", \"b2\")\n );\n assertThat(solution.findCycle(cyclicGraph)).isTrue();\n }",
"private Set<String> validateNodeNames(Condition c, Set<String> vars) {\n if (c instanceof LaxCondition) {\n vars.addAll(graphNodeMap.get(((LaxCondition) c).getGraph()).keySet());\n if (((LaxCondition) c).getCondition() != null) {\n Set<String> val = validateNodeNames(((LaxCondition) c).getCondition(), new HashSet<>(vars));\n vars.addAll(val);\n }\n return vars;\n } else if (c instanceof OperatorCondition){\n Set<String> val1 = validateNodeNames(((OperatorCondition) c).getExpr1(), new HashSet<>(vars));\n Set<String> val2 = validateNodeNames(((OperatorCondition) c).getExpr2(), new HashSet<>(vars));\n Set<String> intersection = intersection(val1, val2);\n intersection.removeAll(vars);\n if (!intersection.isEmpty()) {\n // there are nodes that exist in both expr1 and expr2 but not in its parents;\n // so rename those nodes in expr2 such that the laxCondition can be transformed to one graph\n for (String i : intersection) {\n renameVar(((OperatorCondition) c).getExpr2(), i, getUniqueNodeName());\n }\n // reset val2 since node names are renamed\n val2 = validateNodeNames(((OperatorCondition) c).getExpr2(), new HashSet<>(vars));\n }\n vars.addAll(val1);\n vars.addAll(val2);\n return vars;\n } else {\n assert false; //shouldn't happen\n }\n return vars;\n }",
"public void minCut(){\n QueueMaxHeap<GraphNode> queue = new QueueMaxHeap<>();\n setNodesToUnvisited();\n queue.add(graphNode[0]);\n graphNode[0].visited = true;\n while(!queue.isEmpty()){//if queue is empty it means that we have made all the cuts that need to be cut and we cant get anywhere else\n GraphNode node = queue.get();\n int from = node.nodeID;\n for(int i = 0; i < node.succ.size(); i++){//get the successor of each node and then checks each of the edges between the node and that successor\n GraphNode.EdgeInfo info = node.succ.get(i);\n int to = info.to;\n if(graph.flow[from][to][1] == 0){//if it has no flow then it prints out that line\n System.out.printf(\"Edge (%d, %d) transports %d cases\\n\", from, to, graph.flow[from][to][0]);\n } else {//adds it to the queue if it still has flow to it and if we haven't gone there yet\n if(!graphNode[to].visited){\n graphNode[to].visited = true;\n queue.add(graphNode[to]);\n }\n }\n }\n }\n }",
"private void e_Neighbours(int u){ \n int edgeDistance = -1; \n int newDistance = -1; \n \n // All the neighbors of v \n for (int i = 0; i < adj.get(u).size(); i++) { \n Node v = adj.get(u).get(i); \n \n // If current node hasn't already been processed \n if (!settled.contains(v.node)) { \n edgeDistance = v.cost; \n newDistance = dist[u] + edgeDistance; \n \n // If new distance is cheaper in cost \n if (newDistance < dist[v.node]) \n dist[v.node] = newDistance; \n \n // Add the current node to the queue \n pq.add(new Node(v.node, dist[v.node])); \n } \n } \n }",
"public static void main(String[] args) {\n \r\n int graphSize = Integer.parseInt(args[0]);\r\n HashMap<Integer, List<Integer>> hash = new HashMap<Integer, List<Integer>>();\r\n Random rand = new Random();\r\n for(int i = 0; i < graphSize; i++){\r\n int neighbours = rand.nextInt(5);\r\n \r\n List<Integer> list = hash.get(i);\r\n if(list == null){\r\n hash.put(i, new ArrayList<Integer>());\r\n }\r\n neighbours = neighbours - hash.get(i).size(); \r\n while(neighbours > 0){\r\n \r\n int no = rand.nextInt(graphSize);\r\n \r\n //System.out.println(\"neighbours\");\r\n //System.out.println(i);\r\n //System.out.println(neighbours);\r\n //System.out.println(no);\r\n if(checkPresent(hash.get(i), no) || no == i){\r\n continue;\r\n }\r\n hash.get(i).add(no);\r\n if(hash.get(no) == null){\r\n hash.put(no, new ArrayList<Integer>());\r\n }\r\n hash.get(no).add(i);\r\n neighbours--;\r\n \r\n }\r\n }\r\n try{\r\n PrintWriter writer = new PrintWriter(\"/home/constantine/Desktop/graph.txt\", \"UTF-8\");\r\n for(int i: hash.keySet()){\r\n String toWrite = Integer.toString(i);\r\n List<Integer> list = hash.get(i);\r\n if(list.size() != 0){\r\n toWrite = toWrite + \",\";\r\n }\r\n for(int j = 0; j < list.size(); j++){\r\n if(j == list.size() - 1){\r\n toWrite = toWrite + list.get(j);\r\n } else{\r\n toWrite = toWrite + list.get(j) + \",\";\r\n }\r\n \r\n }\r\n writer.println(toWrite);\r\n }\r\n writer.close();\r\n \r\n } catch (IOException e) {\r\n // do something\r\n }\r\n }",
"public void sync(){\n\t\tDHTNode myNode = dynamoRing.getNode(MY_ADDRESS);\n\t\tArrayList<DHTNode> dependentNodes = dynamoRing.getNPredecessors(myNode, REPLICATION_COUNT-1);\n\t\tdependentNodes.add(myNode);\n\t\tSparseArray<String> dependentNodeMap = new SparseArray<String>();\n\t\tHashMap<String, KeyVal> resultMap = new HashMap<String, KeyVal>();\n\t\tfor(int i=0;i<dependentNodes.size();i++)\t// Ideally it should contact only N-1 successors and N-1 predecessors\n\t\t\t\t\t\t\t\t\t\t\t\t\t// but for total node count = 5 and replica count = 2, this\n\t\t\t\t\t\t\t\t\t\t\t\t\t// number spans through all the nodes\n\t\t\tdependentNodeMap.put(dependentNodes.get(i).getAddress(), dependentNodes.get(i).getId());\n\t\t\n\t\tArrayList<DHTNode> nodeList = dynamoRing.getAllNodes();\n\t\tfor(int i=0;i<nodeList.size();i++){\n\t\t\tif(nodeList.get(i)==myNode)\n\t\t\t\tcontinue;\n\t\t\tArrayList<KeyVal> keyValList = readDHTAllFromNode(nodeList.get(i));\n\t\t\tfor(int j=0;j<keyValList.size();j++){\n\t\t\t\tKeyVal keyVal = keyValList.get(j);\n\t\t\t\tint responsibleNodeAddress = dynamoRing.getResponsibleNode(keyVal.getKey()).getAddress();\n\t\t\t\tif(dependentNodeMap.get(responsibleNodeAddress)==null)\n\t\t\t\t\tcontinue;\n\t\t\t\telse{\n\t\t\t\t\tif(resultMap.get(keyVal.getKey())==null){\n\t\t\t\t\t\tresultMap.put(keyVal.getKey(), keyVal);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tint oldVersion = Integer.parseInt(resultMap.get(keyVal.getKey()).getVersion());\n\t\t\t\t\t\tint newVersion = Integer.parseInt(keyVal.getVersion());\n\t\t\t\t\t\tif(newVersion > oldVersion)\n\t\t\t\t\t\t\tresultMap.put(keyVal.getKey(), keyVal);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tIterator<Entry<String, KeyVal>> resultIterator = resultMap.entrySet().iterator();\n\t\twhile(resultIterator.hasNext()){\n\t\t\tEntry<String, KeyVal> nextEntry = resultIterator.next();\n\t\t\tKeyVal keyVal = nextEntry.getValue();\n\t\t\twriteLocalKeyVal(keyVal.getKey(), keyVal.getVal(), keyVal.getVersion());\n\t\t}\n\t\t\n\t}",
"public static strictfp void main(String... args) {\n\t\tArrayList<Vertex> graph = new ArrayList<>();\r\n\t\tHashMap<Character, Vertex> map = new HashMap<>();\r\n\t\t// add vertices\r\n\t\tfor (char c = 'a'; c <= 'i'; c++) {\r\n\t\t\tVertex v = new Vertex(c);\r\n\t\t\tgraph.add(v);\r\n\t\t\tmap.put(c, v);\r\n\t\t}\r\n\t\t// add edges\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tif (v.getNodeId() == 'a') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'b') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t} else if (v.getNodeId() == 'c') {\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'd') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'e') {\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t} else if (v.getNodeId() == 'f') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('d'));\r\n\t\t\t\tv.getAdjacents().add(map.get('e'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t} else if (v.getNodeId() == 'g') {\r\n\t\t\t\tv.getAdjacents().add(map.get('f'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'h') {\r\n\t\t\t\tv.getAdjacents().add(map.get('a'));\r\n\t\t\t\tv.getAdjacents().add(map.get('b'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('i'));\r\n\t\t\t} else if (v.getNodeId() == 'i') {\r\n\t\t\t\tv.getAdjacents().add(map.get('c'));\r\n\t\t\t\tv.getAdjacents().add(map.get('g'));\r\n\t\t\t\tv.getAdjacents().add(map.get('h'));\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t// graph created\r\n\t\t// create disjoint sets\r\n\t\tDisjointSet S = null, V_S = null;\r\n\t\tfor (Vertex v: graph) {\r\n\t\t\tchar c = v.getNodeId();\r\n\t\t\tif (c == 'a' || c == 'b' || c == 'd' || c == 'e') {\r\n\t\t\t\tif (S == null) {\r\n\t\t\t\t\tS = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (V_S == null) {\r\n\t\t\t\t\tV_S = v.getDisjointSet();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tDisjointSet set = DisjointSet.union(V_S, v.getDisjointSet());\r\n\t\t\t\t\tv.setDisjointSet(set);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Disjoint sets created\r\n\t\tfor (Vertex u: graph) {\r\n\t\t\tfor (Vertex v: u.getAdjacents()) {\r\n\t\t\t\tif (DisjointSet.findSet((DisjointSet) u.getDisjointSet()) == \r\n\t\t\t\t DisjointSet.findSet((DisjointSet) v.getDisjointSet())) {\r\n\t\t\t\t\tSystem.out.println(\"The cut respects (\" + u.getNodeId() + \", \" + v.getNodeId() + \").\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private static void spreadVirus(int v){\n Queue<Integer> queue = new LinkedList<>();\n queue.add(v);\n while(!queue.isEmpty()){\n int temp = queue.poll();\n isVisited[temp]=true;\n for(int i = 1; i<adj[temp].length;i++){\n if(isVisited[i]==false && adj[temp][i]==1){\n queue.add(i);\n isVisited[i]=true;\n maxContamination++;\n }\n }\n }\n }",
"private void phaseOne(){\r\n\r\n\t\twhile (allNodes.size() < endSize){\r\n\r\n\t\t\ttry (Transaction tx = graphDb.beginTx()){\r\n\t\t\t\t//Pick a random node from allNodes\r\n\t\t\t\tint idx = random.nextInt(allNodes.size());\r\n\t\t\t\tNode node = allNodes.get(idx);\r\n\r\n\t\t\t\t//Get all relationships of node\t\t\t\t\r\n\t\t\t\tIterable<Relationship> ite = node.getRelationships(Direction.BOTH);\r\n\t\t\t\tList<Relationship> tempRels = new ArrayList<Relationship>();\r\n\r\n\t\t\t\t//Pick one of the relationships uniformly at random.\r\n\t\t\t\tfor (Relationship rel : ite){\r\n\t\t\t\t\ttempRels.add(rel);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tidx = random.nextInt(tempRels.size());\r\n\t\t\t\tRelationship rel = tempRels.get(idx);\r\n\t\t\t\tNode neighbour = rel.getOtherNode(node);\r\n\r\n\t\t\t\t//Add the neighbour to allNodes\r\n\t\t\t\tif (!allNodes.contains(neighbour)){\r\n\t\t\t\t\tallNodes.add(neighbour);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttx.success();\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\t//If reached here, then phase one completed successfully.\r\n\t\treturn;\r\n\t}",
"private static boolean isUnivalNode(Node x, Set<Node> set) {\n if (x == null) { return true; }\n boolean left = isUnivalNode(x.left, set);\n boolean right = isUnivalNode(x.right, set);\n\n if (left && right) {\n boolean leftSubTree = x.left == null || x.left.val == x.val;\n boolean rightSubTree = x.right == null || x.right.val == x.val;\n if (leftSubTree && rightSubTree) {\n set.add(x);\n return true;\n }\n }\n return false;\n }",
"public List<Integer> eventualSafeNodes(int[][] graph) {\n int N = graph.length;\n int[] color = new int[N];\n List<Integer> ans = new ArrayList<>();\n\n for (int i = 0; i < N; i++) {\n if (hasNoCycle(i, color, graph))\n ans.add(i);\n }\n\n return ans;\n }",
"boolean containsJewel(Graph<V, E> g)\n {\n for (V v2 : g.vertexSet()) {\n for (V v3 : g.vertexSet()) {\n if (v2 == v3 || !g.containsEdge(v2, v3))\n continue;\n for (V v5 : g.vertexSet()) {\n if (v2 == v5 || v3 == v5)\n continue;\n\n Set<V> F = new HashSet<>();\n for (V f : g.vertexSet()) {\n if (f == v2 || f == v3 || f == v5 || g.containsEdge(f, v2)\n || g.containsEdge(f, v3) || g.containsEdge(f, v5))\n continue;\n F.add(f);\n }\n\n List<Set<V>> componentsOfF = findAllComponents(g, F);\n\n Set<V> X1 = new HashSet<>();\n for (V x1 : g.vertexSet()) {\n if (x1 == v2 || x1 == v3 || x1 == v5 || !g.containsEdge(x1, v2)\n || !g.containsEdge(x1, v5) || g.containsEdge(x1, v3))\n continue;\n X1.add(x1);\n }\n Set<V> X2 = new HashSet<>();\n for (V x2 : g.vertexSet()) {\n if (x2 == v2 || x2 == v3 || x2 == v5 || g.containsEdge(x2, v2)\n || !g.containsEdge(x2, v5) || !g.containsEdge(x2, v3))\n continue;\n X2.add(x2);\n }\n\n for (V v1 : X1) {\n if (g.containsEdge(v1, v3))\n continue;\n for (V v4 : X2) {\n if (v1 == v4 || g.containsEdge(v1, v4) || g.containsEdge(v2, v4))\n continue;\n for (Set<V> FPrime : componentsOfF) {\n if (hasANeighbour(g, FPrime, v1) && hasANeighbour(g, FPrime, v4)) {\n if (certify) {\n Set<V> validSet = new HashSet<>();\n validSet.addAll(FPrime);\n validSet.add(v1);\n validSet.add(v4);\n GraphPath<V, E> p = new DijkstraShortestPath<>(\n new AsSubgraph<>(g, validSet)).getPath(v1, v4);\n List<E> edgeList = new LinkedList<>();\n edgeList.addAll(p.getEdgeList());\n if (p.getLength() % 2 == 1) {\n edgeList.add(g.getEdge(v4, v5));\n edgeList.add(g.getEdge(v5, v1));\n\n } else {\n edgeList.add(g.getEdge(v4, v3));\n edgeList.add(g.getEdge(v3, v2));\n edgeList.add(g.getEdge(v2, v1));\n\n }\n\n double weight =\n edgeList.stream().mapToDouble(g::getEdgeWeight).sum();\n certificate = new GraphWalk<>(g, v1, v1, edgeList, weight);\n }\n return true;\n }\n }\n }\n }\n }\n }\n }\n\n return false;\n }",
"public boolean DijkstraHelp(int src, int dest) {\n PriorityQueue<Entry>queue=new PriorityQueue();//queue storages the nodes that we will visit by the minimum tag\n //WGraph_DS copy = (WGraph_DS) (copy());//create a copy graph that the algorithm will on it\n initializeTag();\n initializeInfo();\n node_info first=this.ga.getNode(src);\n first.setTag(0);//distance from itself=0\n queue.add(new Entry(first,first.getTag()));\n while(!queue.isEmpty()) {\n Entry pair=queue.poll();\n node_info current= pair.node;\n if (current.getInfo() != null) continue;//if we visit we can skip to the next loop because we have already marked\n current.setInfo(\"visited\");//remark the info\n Collection<node_info> listNeighbors = this.ga.getV(current.getKey());//create a collection for the neighbors list\n LinkedList<node_info> Neighbors = new LinkedList<>(listNeighbors);//create the neighbors list\n if (Neighbors == null) continue;\n for(node_info n:Neighbors) {\n\n if(n.getTag()>ga.getEdge(n.getKey(),current.getKey())+current.getTag())\n {\n n.setTag(current.getTag() + ga.getEdge(n.getKey(), current.getKey()));//compute the new tag\n }\n queue.add(new Entry(n,n.getTag()));\n }\n }\n Iterator<node_info> it=this.ga.getV().iterator();\n while(it.hasNext()){\n if(it.next().getInfo()==null) return false;\n }\n return true;\n }",
"protected void repeatedFoundWhenInsert(CntAVLTreeNode node) {\n System.out.println(\"添加失败:不允许添加相同的节点!\");\n }",
"public Node cloneGraph(Node node) {\r\n if (node == null) return null;\r\n dfs(node);\r\n return map.get(node.val);\r\n }",
"private void expandNode() {\r\n\t\t\t// Dijkstra's algorithm to handle separately\r\n\t\t\tif (dijkstra.isSelected()) {\r\n\t\t\t\tCell u;\r\n\t\t\t\t// 11: while Q is not empty:\r\n\t\t\t\tif (graph.isEmpty()) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 12: u := vertex in Q (graph) with smallest distance in dist[]\r\n\t\t\t\t// ;\r\n\t\t\t\t// 13: remove u from Q (graph);\r\n\t\t\t\tu = graph.remove(0);\r\n\t\t\t\t// Add vertex u in closed set\r\n\t\t\t\tclosedSet.add(u);\r\n\t\t\t\t// If target has been found ...\r\n\t\t\t\tif (u.row == targetPos.row && u.col == targetPos.col) {\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// Counts nodes that have expanded.\r\n\t\t\t\texpanded++;\r\n\t\t\t\t// Update the color of the cell\r\n\t\t\t\tgrid[u.row][u.col] = CLOSED;\r\n\t\t\t\t// 14: if dist[u] = infinity:\r\n\t\t\t\tif (u.dist == INFINITY) {\r\n\t\t\t\t\t// ... then there is no solution.\r\n\t\t\t\t\t// 15: break;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t\t// 16: end if\r\n\t\t\t\t}\r\n\t\t\t\t// Create the neighbors of u\r\n\t\t\t\tArrayList<Cell> neighbors = createSuccesors(u, false);\r\n\t\t\t\t// 18: for each neighbor v of u:\r\n\t\t\t\tfor (Cell v : neighbors) {\r\n\t\t\t\t\t// 20: alt := dist[u] + dist_between(u, v) ;\r\n\t\t\t\t\tint alt = u.dist + distBetween(u, v);\r\n\t\t\t\t\t// 21: if alt < dist[v]:\r\n\t\t\t\t\tif (alt < v.dist) {\r\n\t\t\t\t\t\t// 22: dist[v] := alt ;\r\n\t\t\t\t\t\tv.dist = alt;\r\n\t\t\t\t\t\t// 23: previous[v] := u ;\r\n\t\t\t\t\t\tv.prev = u;\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[v.row][v.col] = FRONTIER;\r\n\t\t\t\t\t\t// 24: decrease-key v in Q;\r\n\t\t\t\t\t\t// (sort list of nodes with respect to dist)\r\n\t\t\t\t\t\tCollections.sort(graph, new CellComparatorByDist());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// The handling of the other four algorithms\r\n\t\t\t} else {\r\n\t\t\t\tCell current;\r\n\t\t\t\tif (dfs.isSelected() || bfs.isSelected()) {\r\n\t\t\t\t\t// Here is the 3rd step of the algorithms DFS and BFS\r\n\t\t\t\t\t// 3. Remove the first state, Si, from OPEN SET ...\r\n\t\t\t\t\tcurrent = openSet.remove(0);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Here is the 3rd step of the algorithms A* and Greedy\r\n\t\t\t\t\t// 3. Remove the first state, Si, from OPEN SET,\r\n\t\t\t\t\t// for which f(Si) ≤ f(Sj) for all other\r\n\t\t\t\t\t// open states Sj ...\r\n\t\t\t\t\t// (sort first OPEN SET list with respect to 'f')\r\n\t\t\t\t\tCollections.sort(openSet, new CellComparatorByF());\r\n\t\t\t\t\tcurrent = openSet.remove(0);\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add it to CLOSED SET.\r\n\t\t\t\tclosedSet.add(0, current);\r\n\t\t\t\t// Update the color of the cell\r\n\t\t\t\tgrid[current.row][current.col] = CLOSED;\r\n\t\t\t\t// If the selected node is the target ...\r\n\t\t\t\tif (current.row == targetPos.row && current.col == targetPos.col) {\r\n\t\t\t\t\t// ... then terminate etc\r\n\t\t\t\t\tCell last = targetPos;\r\n\t\t\t\t\tlast.prev = current.prev;\r\n\t\t\t\t\tclosedSet.add(last);\r\n\t\t\t\t\tfound = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// Count nodes that have been expanded.\r\n\t\t\t\texpanded++;\r\n\t\t\t\t// Here is the 4rd step of the algorithms\r\n\t\t\t\t// 4. Create the successors of Si, based on actions\r\n\t\t\t\t// that can be implemented on Si.\r\n\t\t\t\t// Each successor has a pointer to the Si, as its predecessor.\r\n\t\t\t\t// In the case of DFS and BFS algorithms, successors should not\r\n\t\t\t\t// belong neither to the OPEN SET nor the CLOSED SET.\r\n\t\t\t\tArrayList<Cell> succesors;\r\n\t\t\t\tsuccesors = createSuccesors(current, false);\r\n\t\t\t\t// Here is the 5th step of the algorithms\r\n\t\t\t\t// 5. For each successor of Si, ...\r\n\t\t\t\tfor (Cell cell : succesors) {\r\n\t\t\t\t\t// ... if we are running DFS ...\r\n\t\t\t\t\tif (dfs.isSelected()) {\r\n\t\t\t\t\t\t// ... add the successor at the beginning of the list\r\n\t\t\t\t\t\t// OPEN SET\r\n\t\t\t\t\t\topenSet.add(0, cell);\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t// ... if we are runnig BFS ...\r\n\t\t\t\t\t} else if (bfs.isSelected()) {\r\n\t\t\t\t\t\t// ... add the successor at the end of the list OPEN SET\r\n\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t// ... if we are running A* or Greedy algorithms (step 5\r\n\t\t\t\t\t\t// of A* algorithm) ...\r\n\t\t\t\t\t} else if (aStar.isSelected() || guloso.isSelected()) {\r\n\t\t\t\t\t\t// ... calculate the value f(Sj) ...\r\n\t\t\t\t\t\tint dxg = current.col - cell.col;\r\n\t\t\t\t\t\tint dyg = current.row - cell.row;\r\n\t\t\t\t\t\tint dxh = targetPos.col - cell.col;\r\n\t\t\t\t\t\tint dyh = targetPos.row - cell.row;\r\n\t\t\t\t\t\tif (diagonal.isSelected()) {\r\n\t\t\t\t\t\t\t// with diagonal movements\r\n\t\t\t\t\t\t\t// calculate 1000 times the Euclidean distance\r\n\t\t\t\t\t\t\tif (guloso.isSelected()) {\r\n\t\t\t\t\t\t\t\t// especially for the Greedy ...\r\n\t\t\t\t\t\t\t\tcell.g = 0;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcell.g = current.g + (int) ((double) 1000 * Math.sqrt(dxg * dxg + dyg * dyg));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.h = (int) ((double) 1000 * Math.sqrt(dxh * dxh + dyh * dyh));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// without diagonal movements\r\n\t\t\t\t\t\t\t// calculate Manhattan distances\r\n\t\t\t\t\t\t\tif (guloso.isSelected()) {\r\n\t\t\t\t\t\t\t\t// especially for the Greedy ...\r\n\t\t\t\t\t\t\t\tcell.g = 0;\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tcell.g = current.g + Math.abs(dxg) + Math.abs(dyg);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcell.h = Math.abs(dxh) + Math.abs(dyh);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcell.f = cell.g + cell.h;\r\n\t\t\t\t\t\t// ... If Sj is neither in the OPEN SET nor in the\r\n\t\t\t\t\t\t// CLOSED SET states ...\r\n\t\t\t\t\t\tint openIndex = isInList(openSet, cell);\r\n\t\t\t\t\t\tint closedIndex = isInList(closedSet, cell);\r\n\t\t\t\t\t\tif (openIndex == -1 && closedIndex == -1) {\r\n\t\t\t\t\t\t\t// ... then add Sj in the OPEN SET ...\r\n\t\t\t\t\t\t\t// ... evaluated as f(Sj)\r\n\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t\t// Else ...\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// ... if already belongs to the OPEN SET, then ...\r\n\t\t\t\t\t\t\tif (openIndex > -1) {\r\n\t\t\t\t\t\t\t\t// ... compare the new value assessment with the\r\n\t\t\t\t\t\t\t\t// old one.\r\n\t\t\t\t\t\t\t\t// If old <= new ...\r\n\t\t\t\t\t\t\t\tif (openSet.get(openIndex).f <= cell.f) {\r\n\t\t\t\t\t\t\t\t\t// ... then eject the new node with state\r\n\t\t\t\t\t\t\t\t\t// Sj.\r\n\t\t\t\t\t\t\t\t\t// (ie do nothing for this node).\r\n\t\t\t\t\t\t\t\t\t// Else, ...\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// ... remove the element (Sj, old) from the\r\n\t\t\t\t\t\t\t\t\t// list\r\n\t\t\t\t\t\t\t\t\t// to which it belongs ...\r\n\t\t\t\t\t\t\t\t\topenSet.remove(openIndex);\r\n\t\t\t\t\t\t\t\t\t// ... and add the item (Sj, new) to the\r\n\t\t\t\t\t\t\t\t\t// OPEN SET.\r\n\t\t\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// ... if already belongs to the CLOSED SET,\r\n\t\t\t\t\t\t\t\t// then ...\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// ... compare the new value assessment with the\r\n\t\t\t\t\t\t\t\t// old one.\r\n\t\t\t\t\t\t\t\t// If old <= new ...\r\n\t\t\t\t\t\t\t\tif (closedSet.get(closedIndex).f <= cell.f) {\r\n\t\t\t\t\t\t\t\t\t// ... then eject the new node with state\r\n\t\t\t\t\t\t\t\t\t// Sj.\r\n\t\t\t\t\t\t\t\t\t// (ie do nothing for this node).\r\n\t\t\t\t\t\t\t\t\t// Else, ...\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// ... remove the element (Sj, old) from the\r\n\t\t\t\t\t\t\t\t\t// list\r\n\t\t\t\t\t\t\t\t\t// to which it belongs ...\r\n\t\t\t\t\t\t\t\t\tclosedSet.remove(closedIndex);\r\n\t\t\t\t\t\t\t\t\t// ... and add the item (Sj, new) to the\r\n\t\t\t\t\t\t\t\t\t// OPEN SET.\r\n\t\t\t\t\t\t\t\t\topenSet.add(cell);\r\n\t\t\t\t\t\t\t\t\t// Update the color of the cell\r\n\t\t\t\t\t\t\t\t\tgrid[cell.row][cell.col] = FRONTIER;\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}",
"@Test\r\n void insert_multiple_vertexes_and_edges_remove_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.addEdge(\"A\", \"C\");\r\n graph.addEdge(\"B\", \"D\");\r\n \r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n int numberOfEdges = graph.size();\r\n int numberOfVertices = graph.order();\r\n if(numberOfEdges != 4) {\r\n fail();\r\n }\r\n if(numberOfVertices != 4) {\r\n fail();\r\n }\r\n \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")|!vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n \r\n // Check that A's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // Check that B's outgoing edges are correct\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\") | !adjacent.contains(\"D\"))\r\n fail(); \r\n // C and D have no out going edges \r\n adjacent = graph.getAdjacentVerticesOf(\"C\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n adjacent = graph.getAdjacentVerticesOf(\"D\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Remove B from the graph \r\n graph.removeVertex(\"B\");\r\n // Check that A's outgoing edges are correct\r\n // An edge to B should no exist any more \r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (adjacent.contains(\"B\") || !adjacent.contains(\"C\"))\r\n fail();\r\n // There should be no elements in the list of successors\r\n // of B since its deleted form the graph\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.isEmpty())\r\n fail(); \r\n // Check that graph has still has all vertexes not removed\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"C\")|\r\n !vertices.contains(\"D\")) {\r\n fail();\r\n }\r\n //Check that vertex B was removed from graph \r\n if(vertices.contains(\"B\")) {\r\n fail();\r\n }\r\n numberOfEdges = graph.size();\r\n numberOfVertices = graph.order();\r\n if(numberOfEdges != 1) {\r\n fail();\r\n }\r\n if(numberOfVertices != 3) {\r\n fail();\r\n }\r\n }",
"@Test(timeout = 5000)\n public void testAddlabelWithExclusivity() throws Exception {\n mgr.addToCluserNodeLabels(Arrays.asList(NodeLabel.newInstance(\"a\", false), NodeLabel.newInstance(\"b\", true)));\n Assert.assertFalse(isExclusiveNodeLabel(\"a\"));\n Assert.assertTrue(isExclusiveNodeLabel(\"b\"));\n }",
"public boolean IsCyclic() {\r\n\t\tHashMap<String, Boolean> processed = new HashMap<>();\r\n\t\tLinkedList<Pair> queue = new LinkedList<>();\r\n\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tif (processed.containsKey(vname)) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\tPair rootpair = new Pair(vname, vname);\r\n\t\t\tqueue.addLast(rootpair);\r\n\t\t\twhile (queue.size() != 0) {\r\n\t\t\t\t// 1. removeFirst\r\n\t\t\t\tPair rp = queue.removeFirst();\r\n\r\n\t\t\t\t// 2. check if processed, mark if not\r\n\t\t\t\tif (processed.containsKey(rp.vname)) {\r\n\t\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t\tprocessed.put(rp.vname, true);\r\n\r\n\t\t\t\t// 3. Check, if an edge is found\r\n\t\t\t\tSystem.out.println(rp.vname + \" via \" + rp.psf);\r\n\r\n\t\t\t\t// 4. Add the unprocessed nbrs back\r\n\t\t\t\tArrayList<String> nbrnames = new ArrayList<>(rp.vtx.nbrs.keySet());\r\n\t\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\t\tif (!processed.containsKey(nbrname)) {\r\n\t\t\t\t\t\tPair np = new Pair(nbrname, rp.psf + nbrname);\r\n\t\t\t\t\t\tqueue.addLast(np);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}",
"private Node removeDuplicate() {\n ArrayList<Integer> values = new ArrayList<Integer>();\n int len = this.getlength();\n Node result = this;\n\n if (len == 1) {\n System.out.println(\"only one element can't duplicate\");\n return result;\n } else {\n Node current = result;\n\n for (int i = 0; i < len; i++) {\n if (values.contains(current.value)) {\n result = result.remove(i);\n len = result.getlength();\n i--; // reset the loop back\n current = current.nextNode;\n } else {\n values.add(current.value);\n current = current.nextNode;\n }\n }\n return result;\n }\n }",
"@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }",
"@Test\r\n void create_edge_between_null_vertexes() {\r\n graph.addEdge(null, \"B\");\r\n graph.addEdge(\"A\", null);\r\n graph.addEdge(null, null);\r\n vertices = graph.getAllVertices();\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!vertices.isEmpty() | !adjacentA.isEmpty() | !adjacentB.isEmpty()) {\r\n fail();\r\n } \r\n }",
"public static void bfs(int a, int b) {\n\t\t\r\n\t\tQueue<Node> q = new LinkedList<>();\r\n\t\t\r\n\t\tq.add(new Node(a,b));\r\n\t\t\r\n\t\twhile(!q.isEmpty()) {\r\n\t\t\t\r\n\t\t\tNode n = q.remove();\r\n\t\t\t\r\n\t\t\tint x = n.x;\r\n\t\t\tint y = n.y;\r\n\t\t\t\r\n\t\t\tif(x+1 <= N && map[x+1][y] > map[x][y]) {\r\n\t\t\t\tif(visited[x+1][y] != 1) {\r\n\t\t\t\t\tq.add(new Node(x+1,y));\r\n\t\t\t\t\tvisited[x+1][y] = cnt;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(x-1 > 0 && map[x-1][y] > map[x][y]) {\r\n\t\t\t\tif(visited[x-1][y] != 1) {\r\n\t\t\t\t\tq.add(new Node(x-1,y));\r\n\t\t\t\t\tvisited[x-1][y] = cnt;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(y-1 > 0 && map[x][y-1] > map[x][y]) {\r\n\t\t\t\tif(visited[x][y-1] != 1) {\r\n\t\t\t\t\tq.add(new Node(x,y-1));\r\n\t\t\t\t\tvisited[x][y-1] = cnt;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tif(y+1 <=N && map[x][y+1] > map[x][y]) {\r\n\t\t\t\tif(visited[x][y+1] != 1) {\r\n\t\t\t\t\tq.add(new Node(x,y+1));\r\n\t\t\t\t\tvisited[x][y+1] = cnt;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"private void relax(SiteEdge e) {\n int v = e.from(), w = e.to();\n if (distTo[w] > distTo[v] + e.weight()) {\n distTo[w] = distTo[v] + e.weight();\n edgeTo[w] = e;\n if (pq.contains(w)) pq.decreaseKey(w, distTo[w]);\n else pq.insert(w, distTo[w]);\n }\n }",
"@Override\n\tpublic boolean insertOneEdge(NodeRelation nodeRelation) {\n\t\treturn false;\n\t}",
"@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }",
"public abstract boolean isUsing(Long graphNode);",
"public int minimumCost(int N, int[][] connections) {\n int[] parent = new int[N + 1];\n Arrays.fill(parent, -1);\n Arrays.sort(connections, (a,b) -> (a[2]-b[2]));\n int cnt = 0;\n int minCost = 0;\n \n for(int[] edge: connections){\n int src = edge[0];\n int dst = edge[1];\n int cost = edge[2];\n \n int srcSubsetId = find(parent, src);\n int dstSubsetId = find(parent, dst);\n \n if(srcSubsetId == dstSubsetId) {\n // Including this edge will cause cycles, then ignore it\n continue;\n }\n cnt += 1;\n minCost += cost;\n union(parent, src, dst);\n }\n return cnt==N-1? minCost : -1;\n}"
] | [
"0.5696584",
"0.55074584",
"0.54742414",
"0.5458123",
"0.54335296",
"0.5400762",
"0.5368728",
"0.534231",
"0.53363377",
"0.53279",
"0.5265475",
"0.52295",
"0.51690465",
"0.5153438",
"0.51514775",
"0.514375",
"0.5126547",
"0.5123107",
"0.51076365",
"0.5081543",
"0.50774",
"0.5072107",
"0.5071281",
"0.50590676",
"0.50574154",
"0.5045214",
"0.5042346",
"0.5039134",
"0.5037133",
"0.5032749",
"0.502502",
"0.5009783",
"0.49874985",
"0.49824673",
"0.49786463",
"0.4975316",
"0.49730116",
"0.49709013",
"0.49705595",
"0.49480137",
"0.49469152",
"0.49468774",
"0.49401566",
"0.4927552",
"0.4915207",
"0.49130595",
"0.49125937",
"0.4908517",
"0.49061576",
"0.49056995",
"0.4894428",
"0.48932484",
"0.48900083",
"0.48836604",
"0.4880231",
"0.48790118",
"0.48745432",
"0.48736072",
"0.48689154",
"0.4867535",
"0.48635986",
"0.48620635",
"0.48611006",
"0.4861045",
"0.48543504",
"0.48536733",
"0.4851393",
"0.48411918",
"0.4840864",
"0.48380986",
"0.4837508",
"0.48329303",
"0.48314586",
"0.48261896",
"0.48259807",
"0.48211604",
"0.48091963",
"0.48053363",
"0.4804326",
"0.4800849",
"0.48005238",
"0.47975022",
"0.47962254",
"0.4795768",
"0.4795489",
"0.47934538",
"0.47929734",
"0.47920552",
"0.4789161",
"0.4788064",
"0.47858685",
"0.47822413",
"0.477694",
"0.47698933",
"0.47698328",
"0.4767766",
"0.47659847",
"0.47643897",
"0.47559083",
"0.4747665",
"0.4740319"
] | 0.0 | -1 |
Iterate List for a specific valuer | public boolean listNavigator(String xpathLocator,String varyingXpath, String valueLookingFor)
{
//Fetch WebElements List by combining xPath and subxPath
List<WebElement> ListItems = driver.findElements(By.xpath(xpathLocator + varyingXpath));
for(int i=0; i < ListItems.size(); i++) //Iterating on Elements
{
//System.out.println(ListItems.get(i).getText());
if(ListItems.get(i).getText().equals(valueLookingFor)) //Looking for a Matching Value
{
reportInfo(valueLookingFor +" Found!");
clickButton(xpathLocator + "[" + (i+1) + "]"); //click if match
return true;
}
}
return false; //status of operation
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void processLargeInList(Set values);",
"private static void iterateAllELementInLinkedList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\n\t\tfor (Integer i : list)\n\t\t\tSystem.out.println(i);\n\n\t}",
"@Override\n\t\t\tpublic FplValue next() {\n\t\t\t\treturn subListIter.next();\n\t\t\t}",
"public void iterateEventList();",
"protected List<V> getVO(List<T> list) {\n List<V> listVO = new ArrayList();\n\n for (T t : list) {\n V vo = getVO(t);\n\n if (vo != null) {\n listVO.add(vo);\n }\n }\n\n return listVO;\n }",
"List getValues();",
"private static void value(ArrayList<tok> pHolder, ArrayList<tok> xmlList) {\n\t\t\r\n\t\tif(pHolder.get(index).getType() == Token_Type.TOK_APOSTROPHE){\r\n\t\t\tindex++;\r\n\t\t\tif(pHolder.get(index).getType() == Token_Type.TOK_ID){\r\n\t\t\t\tindex++;\r\n\t\t\t\tif(pHolder.get(index).getType() == Token_Type.TOK_APOSTROPHE){\r\n\t\t\t\t\tindex++;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse{noError = false;}\r\n\t\t\t}\r\n\t\t\telse{noError = false;}\r\n\t\t}\r\n\t\telse if(pHolder.get(index).getType() == Token_Type.TOK_NUM){\r\n\t\t\tindex++;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\telse{noError = false;}\r\n\t}",
"public final io.reactivex.i<Pair<j, Boolean>> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n for (Object next : list) {\n Object obj;\n if (((j) next).aAt().getId() == com.iqoption.core.f.RQ().Dr().getUserId()) {\n obj = 1;\n continue;\n } else {\n obj = null;\n continue;\n }\n if (obj != null) {\n break;\n }\n }\n Object next2 = null;\n j jVar = (j) next2;\n if (jVar != null) {\n return io.reactivex.i.bZ(kotlin.j.D(jVar, Boolean.valueOf(this.dlr.a(this.dls, list))));\n }\n return io.reactivex.i.aWe();\n }",
"public static void main(String[] args) {\n\t\tArrayList<String> list=new ArrayList();\r\n\t\tlist.add(\"first\");//add the first into list\r\n\t\tlist.add(\"second\");\r\n\t\tIterator itr=list.iterator();\r\n\t\tSystem.out.println(\"List of values\");\r\n\t\twhile(itr.hasNext())//returns true if the iteration\r\n\t\t{\r\n\t\t\tSystem.out.println(itr.next());\r\n\t\t}\r\n\t\tSystem.out.println(\"Update values\");\r\n\t\tlist.set(1, \"35\");\r\n\t\tIterator itr1=list.iterator();\r\n\t\twhile(itr1.hasNext())//returns true if the iteration\r\n\t\t{\r\n\t\t\tSystem.out.println(itr1.next());\r\n\t\t}\r\n\t}",
"@Override\n public Iterator<Value> iterator()\n {\n return values.iterator();\n }",
"public static void main(String[] args) throws Exception{\n\t\tCollection<Integer> values = new ArrayList<>();\r\n\t\tvalues.add(3);\r\n\t\tvalues.add(77);\r\n\t\tvalues.add(5);\r\n\t\t//to fetch the values we have tow ways 1. Iterator 2.enhacned for loop\r\n\t\t/*Iterator i = values.iterator();\r\n\t\twhile(i.hasNext()){\r\n\t\t\tSystem.out.println(i.next());\r\n\t\t}\r\n\t\t*/\r\n\t\t//or for each\r\n\t\tvalues.forEach(i->System.out.println(i));\r\n\r\n\r\n\r\n\r\n\t}",
"@SuppressWarnings(\"rawtypes\")\r\n private List<AllelicValueElement> getAllelicValueElementsFromList(List results) {\r\n List<AllelicValueElement> values = new ArrayList<AllelicValueElement>();\r\n\r\n for (Object o : results) {\r\n Object[] result = (Object[]) o;\r\n if (result != null) {\r\n Integer gid = (Integer) result[0];\r\n String data = (String) result[1];\r\n String markerName = (String) result[2];\r\n Integer peakHeight = (Integer) result[3];\r\n AllelicValueElement allelicValueElement = new AllelicValueElement(gid, data, markerName, peakHeight);\r\n values.add(allelicValueElement);\r\n }\r\n }\r\n\r\n return values;\r\n }",
"protected void listItem(List<String> list) {\n for (int i = 0; i < list.size(); i++) {\n System.out.println(i + 1 + \" \" + list.get(i));\n }\n }",
"public static <T, R> List<R> process(List<T> list, Function<T, R> f) {\n\t\tList<R> result = new ArrayList<>();\n\t\tfor (T t : list) {\n\t\t\tR r = f.apply(t);\n\t\t\tresult.add(r);\n\t\t}\n\t\treturn result;\n\t}",
"void mo1929a(int i, int i2, List<DkCloudRedeemFund> list);",
"public static void Search(ArrayList<Integer> list, int val)\n{\n // Your code here\n int result = -1;\n for(int i=0; i<list.size(); i++)\n {\n if(list.get(i) == val)\n {\n result = i;\n break;\n }\n }\n System.out.print(result + \" \");\n \n}",
"public Object get(ListField list, int index) {\nif ( list == _lfBoys ) {\nreturn _listBoys.elementAt(index);\n} else {\nreturn _listGirls.elementAt(index);\n}\n}",
"public int sumListeForEach(ArrayList<Integer> list) {\r\n int resultat = 0;\r\n for (int tal : list) {\r\n resultat = resultat + tal;\r\n }\r\n return resultat;\r\n }",
"public ListIterator getIndependentParametersIterator();",
"public static void main(String args[] ) throws Exception {\n \n Scanner s = new Scanner(System.in);\n List<String> inputList = new ArrayList<String>(); \n int limit = Integer.parseInt(s.nextLine());\n while (s.hasNextLine()) {\n \n String scanValue = s.nextLine();\n inputList.add(scanValue); \n } \n\n List<Integer> intList = getAllValuesArr(inputList);\n \n intList.stream().forEach(i -> {\n\n IntStream.range(1, i+1).forEach(num -> { \n printRangeNumbers(num); \n });\n });\n \n\n\n }",
"@Override\n\tpublic void visit(ValueListExpression arg0) {\n\t\t\n\t}",
"public final void accept(List<l> list) {\n com.iqoption.core.data.b.c a = this.dlr.dlm;\n kotlin.jvm.internal.h.d(list, \"it\");\n a.setValue(list);\n }",
"@Override\n\tpublic void getValues(ArrayList<String> str) {\n\t\tfor(String st : str)\n\t\t{\n\t\t\tSystem.out.println(st);\n\t\t}\n\t}",
"public static ArrayList<StudentGrade> getGradesbyRubric(ArrayList<Rubric> rubric , String rubricName)\n{\n ArrayList<StudentGrade> grades = null;\n for(Rubric search: rubric)\n {\n if(search.getRubricName().equalsIgnoreCase(rubricName))\n {\n \n grades= search.getGrades();\n }\n\n }\n return grades; \n}",
"public final List<l> apply(List<j> list) {\n kotlin.jvm.internal.h.e(list, \"it\");\n boolean a = this.dlr.a(this.dls, list);\n Iterable<j> iterable = list;\n Collection arrayList = new ArrayList(n.e(iterable, 10));\n for (j jVar : iterable) {\n kotlin.jvm.internal.h.d(jVar, \"it\");\n arrayList.add(new l(jVar, a ^ 1));\n }\n return (List) arrayList;\n }",
"boolean get(List<T> datas);",
"public static void main(String[] args) {\n Collection values = new ArrayList();\n values.add(5);\n values.add(6);\n\n for (Object valu : values) {\n System.out.println(valu);\n }\n\n }",
"public static void main(String[] args) {\n List<String> al =new ArrayList<String>(); // creating object for the array list and map it to the interface-(List)\n al.add(\"India\");\n al.add(\"Canada\");\n al.add(\"China\");\n al.add(\"USA\");\n al.add(\"Australia\");\n\n al.add(2,\"Africa\");//inserts data\n System.out.println(al.contains(\"canada\"));//finds an value\n\n System.out.println(al.get(0)); // prints \"India\"\n\n Iterator<String> iter =al.iterator(); // helps to print all the values in the arraylist\n while(iter.hasNext()) //hasNext() is a boolean.. it says whether there is next value in a arraylist\n {\n String country = iter.next();\n System.out.println(country);\n }\n }",
"public void evaluate(ContainerValue cont, Value value, List<Value> result);",
"@Override\n protected List<ElementSearch> fw_findElementsBy(String PropType, String PropValue)\n {\n List<ElementSearch> temp_lst = new ArrayList<>();\n if (PropValue.contains(\"|\"))\n {\n String[] valueList = PropValue.split(\"\\\\|\");\n for (String eachValue : valueList) {\n if ((eachValue != null) && (eachValue.length() > 0))\n {\n temp_lst.addAll(((WebElement)element).findElements(Utilities.getIdentifier(PropType, eachValue)).stream().map(ElementObject::new).collect(Collectors.toList()));\n }\n }\n }\n else\n {\n temp_lst.addAll(((WebElement)element).findElements(Utilities.getIdentifier(PropType, PropValue)).stream().map(ElementObject::new).collect(Collectors.toList()));\n }\n //END HERE\n return temp_lst;\n }",
"private static List<Car> getCarsByCriteria(Iterable<Car> iter, CarCriteria criteria) {\n List<Car> returnCars = new ArrayList<>();\n\n for (Car c : iter) {\n\n //Passing the criteria based on the users input\n if (criteria.test(c)) {\n returnCars.add(c);\n }\n }\n return returnCars;\n }",
"public Iterator<V> values();",
"public Iterator<V> values();",
"public final T getValueFrom(List<UnknownFieldData> list) {\n return list == null ? null : this.repeated ? getRepeatedValueFrom(list) : getSingularValueFrom(list);\n }",
"public void printValues(){\n Node runner = head;\n while(runner != null){ //iterate through end of list\n System.out.println(runner.value);\n runner = runner.next;\n }\n }",
"java.util.List<java.lang.String> getValuesList();",
"public static void main(String[] args) {\n\n List list = new ArrayList();\n\n Iterator i = list.iterator();\n\n list.add(1);\n list.add(\"String\");\n list.add(true);\n list.add(12.23d);\n list.add('c');\n\n while (i.hasNext()) {\n System.out.println(\"Using Iterators : \" + i.next());\n }\n\n\n }",
"java.util.List<java.lang.Float> getInList();",
"public void processList(List<String> inList);",
"public static void hasNext() {\n\tLinkedList<Integer> list = new LinkedList<>();\n\t\n\tfor (int i = 0; i< 100; i++)\n\t\tif (i % 2 == 0) \n\t\t\tlist.add(i);\n\t\n\tIterator<Integer> g = list.iterator();\n\t\n\t// loop controlled by hasNext\n\twhile(g.hasNext())\n\t\tInteger x = g.next();\n\t \n\t\t//use x .....\n\t\n\n}",
"private static <V> int buscarArbol(V pValor, List<Graph<V>> pLista) {\n for (int x = 1; x <= pLista.size(); x++) {\n Graph<V> arbol = pLista.get(x);\n Iterator<V> it1 = arbol.iterator();\n while (it1.hasNext()) {\n V aux = it1.next();\n if (aux.equals(pValor)) {\n return x;\n }\n }\n }\n return 0;\n }",
"public List<V> transformList(List<E> list) {\n \tList<V> result = new ArrayList<>(list.size());\n if (list != null) {\n for (E entity : list) {\n result.add(getCachedVO(entity));\n }\n }\n \treturn result;\n }",
"public static void eval(List<Integer>list,Predicate<Integer> pred)\n\t{\n\t\tfor(int i:list)\n\t\t{\n\t\t\tif(pred.test(i))\n\t\t\t{\n\t\t\t\tSystem.out.println(i + \" \"+ \" is an even integer\");\n\t\t\t}\n\t\t}\n\n\t}",
"private EvalResult iterateObject(Expression left, Environment env, EvalResult ourIterable) throws Exception {\n Map<String, EvalResult> ourObject = (HashMap) ourIterable._value;\n\n for(Map.Entry<String, EvalResult> binding : ourObject.entrySet()) {\n EvalResult keyValuePair = getKeyValuePair(binding);\n evaluator.Bind(_iterator, keyValuePair, env);\n\n if(_diagnostics.size() > 0)\n return null;\n\n EvalResult bodyResult = _body.evaluate(env);\n _diagnostics.addAll(_body.getDiagnostics());\n\n if(_diagnostics.size() > 0)\n return null;\n\n if(bodyResult._value != null)\n return bodyResult;\n\n }\n return null;\n }",
"public void listAll(){\n /*\n for(int i=0;i<employeesList.size();i++){\n System.out.println(i);\n Employee employee=(Employee)employeesList.get(i);\n System.out.print(employeesList.get(i));\n */ \n \n \n //for used to traverse employList in order to print all employee's data\n for (int i = 0; i < employeesList.size(); i++) {\n System.out.println(\"Name: \" + employeesList.get(i).getName()); \n System.out.println(\"Salary_complement: \"+employeesList.get(i).getSalary_complement()); \n \n }\n \n \n }",
"public List<NeonValue> getValues();",
"public void printElements(List<Integer> list, int number) {\n for (int i = number; i < list.size(); i++) {\n System.out.println(list.get(i));\n }\n }",
"private <TKey extends Comparable<TKey>, TValue> List<TValue> createValues(List<IKeyValueNode<TKey, TValue>> data) {\n List<TValue> values = new ArrayList<>();\n\n for (IKeyValueNode<TKey, TValue> node : data) {\n values.add(node.getValue());\n }\n\n return values;\n }",
"public List<Object> getValues();",
"public void printOutValues() {\n for (String key : myList.keySet()) {\n System.out.println(key + \" --> \" + myList.get(key));\n }\n }",
"long findValues(List<Object> values, List<Column> columns);",
"public boolean find(int value) {\n // Write your code here\n for(Integer i : list){\n int num = value - i;\n if((num == i && map.get(i) > 1) || (num != i && map.containsKey(num))){\n return true;\n }\n }\n return false;\n }",
"public abstract java.util.List extractListItems (Object obj, String countProp, String itemProp) \n\t throws SAFSException;",
"java.util.List<java.lang.Integer> getRequestedValuesList();",
"public HashMap<Integer, User> process(List<User> list) {\n HashMap<Integer, User> listMap = new HashMap<>();\n Iterator<User> iterator = list.iterator();\n while (iterator.hasNext()) {\n User temp = iterator.next();\n if (temp != null) {\n listMap.put(temp.getId(), temp);\n }\n }\n return listMap;\n }",
"private <T> T findActual(T matchingObject, List<? extends T> list) {\n T actual = null;\n for (T check : list) {\n if (check.equals(matchingObject)) {\n actual = check;\n }\n }\n return actual;\n }",
"private void getInventoryNumber(ArrayList list){}",
"public Interface_EntityIterator( TColStd_HSequenceOfTransient list) {\n this(OCCwrapJavaJNI.new_Interface_EntityIterator__SWIG_1( TColStd_HSequenceOfTransient.getCPtr(list) , list), true);\n }",
"public static <T> void forEach(List<T> list, Consumer<T> c) {\n\t\tfor (T t : list) {\n\t\t\tc.accept(t);\n\t\t}\n\t}",
"public List<DomainObject> getListByKeyandValue(String colname, List<Object> keyValue) {\r\n Session session = getSession();\r\n List<DomainObject> retList = null;\r\n try {\r\n Criteria query = session.createCriteria(getPersistentClass()).add(Restrictions.in(colname, keyValue));\r\n retList = query.list();\r\n } catch (HibernateException e) {\r\n LOG.error(MODULE + \"Exception in getListByKeyandValue with List<Values> Method:\" + e, e);\r\n } finally {\r\n// if (session.isOpen()) {\r\n// session.close();\r\n// }\r\n }\r\n return retList;\r\n }",
"public Iterator<IDatasetItem> iterateOverDatasetItems();",
"public void printList(){\n System.out.println(\"Printing the list\");\n for(int i = 0; i<adjacentcyList.length;i++){\n System.out.println(adjacentcyList[i].value);\n }\n }",
"public Iterable<V> values();",
"private boolean in(Integer e, ArrayList<Integer> l) {\n for (int i=0; i<l.size();i++) {\n if (l.get(i) == e) {\n return true;\n }\n }\n return false;\n }",
"@Test\n public void testGetPropertyValueSet(){\n List<User> list = toList(//\n new User(2L),\n new User(5L),\n new User(5L));\n\n Set<Integer> set = CollectionsUtil.getPropertyValueSet(list, \"id\", Integer.class);\n assertThat(set, contains(2, 5));\n }",
"@Override\n public Function<List<Integer>, Integer> finisher() {\n return resultList -> resultList.get(0);\n }",
"int getNextList(int list) {\n\t\treturn m_lists.getField(list, 3);\n\t}",
"@Test\n public void elementLocationTestIterative() {\n int elementNumber = 3;\n System.out.println(nthToLastReturnIterative(list.getHead(), elementNumber).getElement());\n }",
"@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 }",
"public void searchByEmail() {\n System.out.println(\"enter email to get that person details:\");\n Scanner sc = new Scanner(System.in);\n String email = sc.nextLine();\n Iterator itr = list.iterator();\n while (itr.hasNext()) {\n Contact person = (Contact) itr.next();\n if (email.equals(person.getEmail())) {\n List streamList = list.stream().filter(n -> n.getEmail().contains(email)).collect(Collectors.toList());\n System.out.println(streamList);\n }\n }\n }",
"@Override\n\tpublic void forEach(Processor processor) {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tprocessor.process(elements[i]);\n\t\t}\n\t}",
"public Iterator getValues() {\n synchronized (values) {\n return Collections.unmodifiableList(new ArrayList(values)).iterator();\n }\n }",
"int getRequestedValues(int index);",
"public List<Map<Integer, String>> find1List(List<Map<Integer, String>> list, int key, String keyValue)\n\t{\n\t\tfor(int i=0; i<list.size(); i++)\n\t\t{\n\t\t\t if (list.get(i).get(key).equals(keyValue)) return list.subList(i, i+1);\n\t\t}\n\t\treturn null;\n\t}",
"public static void showList(ArrayList<? extends Machine2> list) {\r\n\t\tfor (Machine2 value : list) {\r\n\t\t\tSystem.out.println(value);\r\n\t\t\tvalue.start();\r\n\t\t\r\n\t\t\t//value.snap(); // won't work because we can call only Machine2 methods here\r\n\t\t}\r\n\r\n\t}",
"private void iterateEnemyShots() {\n\t\tfor (Shot s : enemyShotList) {\n\t\t\tfor (ArrayList<Invader> row : enemyArray) {\n\t\t\t\tfor(Invader a : row) {\n\t\t\t\t\ta.shouldAttack(s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void print_list(List li){\n Iterator<Node> it=li.iterator();\n while(it.hasNext()){Node n=it.next();System.out.print(n.freq+\" \");}System.out.println();\n }",
"Iterable<K> findKeysForValue(V val);",
"public <T> void traverse(ArrayList<T> list);",
"public static void main(String[] args) {\nList l=new ArrayList();\nIterator i=l.iterator();\nwhile(i.hasNext()){\n\tSystem.out.println(i.next());\n}\n\t}",
"List<ProductInfoOutput> findList(List<String> productIdList);",
"private void printCommonList(String type, List<Entry<String, Integer>> list) {\r\n System.out.println(type + \": \");\r\n if (list.isEmpty()) {\r\n System.out.println(\"Nothing common found.\");\r\n } else {\r\n list.stream().forEach((entry) -> {\r\n System.out.println(entry.getKey() + \" - \" + entry.getValue());\r\n });\r\n }\r\n System.out.println();\r\n }",
"public boolean findElement(int element) {\r\n\tfor(int i = 0 ;i <myList.size();i++) {\r\n\t\tif(element == myList.get(i))\r\n\t\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"@Override\n public Iterator<NFetchMode> iterator() {\n return Arrays.asList(all).iterator();\n }",
"public void list()\n {\n for(Personality objectHolder : pList)\n {\n String toPrint = objectHolder.getDetails();\n System.out.println(toPrint);\n }\n }",
"protected void iterateOnAttributeValue(DescriptorIterator descriptorIterator, Object attributeValue) {\n if (attributeValue == null) {\n return;\n }\n ContainerPolicy cp = this.getContainerPolicy();\n for (Object iter = cp.iteratorFor(attributeValue); cp.hasNext(iter);) {\n super.iterateOnAttributeValue(descriptorIterator, cp.next(iter, descriptorIterator.getSession()));\n }\n }",
"public final void accept(List<? extends com.iqoption.fragment.c.a.a.j> list) {\n a aVar = this.dhx.dhv.dhu;\n kotlin.jvm.internal.i.e(list, \"list\");\n aVar.aU(list);\n }",
"private static void fun2(List<String> ac1, List<List<String>> result, int index) {\n\t\tString key = ac1.get(0);\r\n\t\tfor(int i=index;i<result.size();i++){\r\n\t\t\tList<String> res=result.get(i);\r\n\t\t\tif(res.get(0).equals(key)){\r\n\t\t\t\t//check if any one of the value is repeated\r\n\t\t\t\tboolean check=fun3(res,ac1);\r\n\t\t\t\tif(check){\r\n\t\t\t\t\tfor(int j=1;j<ac1.size();j++){\r\n\t\t\t\t\t\tres.add(ac1.get(i));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void scanNameAndgetPriceValue(WebDriver driver){\n\t\tList<String> price;\n\t\t\t\n\t\t\n\t\tdo{\t\t\t\n\t\t\tList<WebElement>rows = driver.findElements(By.xpath(\"//td[1]\"));\n\t\t\tprice = rows.stream().filter(s -> s.getText().contains(\"Rice\")).map(s ->getPriceVegi(s)).collect(Collectors.toList());\n\t\t\tprice.stream().forEach(s -> System.out.println(s));\t\t\t\n\t\t\tif(price.size()<1){\n\t\t\t\tdriver.findElement(By.cssSelector(\"[aria-label='Next']\")).click();\n\t\t\t}\t\t\t\n\t\t}while(price.size()<1);\t\t\n\t}",
"@Override\n public boolean hasNext() {\n return(it.hasNext());\n }",
"protected abstract String listLearnValues();",
"public static void calculateSum(List<Integer> numbers){\n int sum = 0;\n for(int i = 0; i < numbers.size(); i++){\n if(numbers.get(i) % 2 == 0){\n sum += numbers.get(i) * numbers.get(i);\n }\n }\n System.out.println(sum);\n\n }",
"int getListData(int list) {\n\t\treturn m_lists.getField(list, 5);\n\t}",
"public static void main(String[] args) {\n \t\n List<Float> ab = new ArrayList<>();\n ab.add(7.32f);\n ab.add(5.556f);\n ab.add(3.32f);\n ab.add(22.58f);\n ab.add(77.3f);\n\n System.out.print(\"Data in list are:- \");\n float sum = 0;\n \n // make an iterator \n \n Iterator<Float> iterator = ab.iterator();\n while(iterator.hasNext()){\n float a = iterator.next();\n if(!iterator.hasNext()) System.out.print(a);\n else System.out.print(a + \", \");\n \n // addition of elements \n \n sum += a;\n }\n\n System.out.println(\"\\nThe sum of all elements are:- \" + sum);\n }",
"public static void forEach(HashSet<Employee> employeDetails) {\n\t\tfor (Employee emp : employeDetails) {\n\t\t\tSystem.out.println(emp.getEmpId() + emp.getEmpName() + emp.getEmpAge() + emp.getEmpSalary());\n\t\t}\n\t}",
"private void popularTela(List<Parcela> lstParcelas) {\n for (Parcela parcela : lstParcelas) {\n popularTela(parcela);\n }\n }",
"private <T extends C9360c> void m15511a(List<T> list) {\n if (list != null && mo9140c() != null) {\n int i = 0;\n int i2 = 0;\n for (T t : list) {\n if (t.f25644a == this.f13394b.getOwner().getId()) {\n i = t.f25645b;\n } else if (t.f25644a == this.f13396d.f11667e) {\n i2 = t.f25645b;\n }\n }\n if (!((Integer) this.f13396d.get(\"data_pk_anchor_score\", Integer.valueOf(0))).equals(Integer.valueOf(i))) {\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_anchor_score\", Integer.valueOf(i));\n }\n if (!((Integer) this.f13396d.get(\"data_pk_guest_score\", Integer.valueOf(0))).equals(Integer.valueOf(i2))) {\n this.f13396d.lambda$put$1$DataCenter(\"data_pk_guest_score\", Integer.valueOf(i2));\n }\n }\n }",
"@Override\n List<Value> values();",
"protected abstract IList _listValue(IScope scope, IType contentsType, boolean cast);",
"public static void main(String[] args) {\n\t\tList<Integer> ll=new LinkedList<>();\n\t\tll.add(34);\n\t\tll.add(540);\n\t\tll.add(89);\n\t\tIterator<Integer> it=ll.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tSystem.out.println(\"element \"+it.next());\n\t\t}\n\t}",
"void mo13375a(boolean z, int i, int i2, List<C15929a> list);"
] | [
"0.5848712",
"0.58091825",
"0.5731203",
"0.56033236",
"0.5526379",
"0.5500465",
"0.54903466",
"0.54729015",
"0.5472789",
"0.5402707",
"0.5372826",
"0.53540224",
"0.5303211",
"0.5299362",
"0.52878857",
"0.52678674",
"0.52492607",
"0.5246622",
"0.52415967",
"0.52177596",
"0.5214066",
"0.5208369",
"0.52071",
"0.5179222",
"0.51678264",
"0.51663786",
"0.5165999",
"0.51580864",
"0.51545185",
"0.51507807",
"0.51350605",
"0.51311976",
"0.51311976",
"0.512232",
"0.5114301",
"0.51124746",
"0.5106685",
"0.50937515",
"0.50830686",
"0.5071837",
"0.5070382",
"0.5066108",
"0.50659585",
"0.5064797",
"0.50546795",
"0.50387514",
"0.5038347",
"0.5035571",
"0.502441",
"0.50098026",
"0.5000446",
"0.4994965",
"0.49859366",
"0.49778795",
"0.49751478",
"0.49735284",
"0.49643698",
"0.49509102",
"0.493987",
"0.49316978",
"0.492451",
"0.49220356",
"0.4917652",
"0.4915425",
"0.48967427",
"0.48932415",
"0.48885268",
"0.48830438",
"0.48830342",
"0.48799813",
"0.487898",
"0.48782173",
"0.48750877",
"0.4873301",
"0.4872633",
"0.4868566",
"0.48544464",
"0.4854333",
"0.4846975",
"0.48394012",
"0.4836081",
"0.48321486",
"0.4819896",
"0.4818773",
"0.4818408",
"0.48151928",
"0.48122317",
"0.48090717",
"0.4797253",
"0.4796786",
"0.47962758",
"0.47915152",
"0.47893193",
"0.47871202",
"0.47863227",
"0.47840634",
"0.478112",
"0.47797891",
"0.47770363",
"0.47739583",
"0.47737148"
] | 0.0 | -1 |
using game of life idea: newState | oldState > bit | public int[][] imageSmoother(int[][] M) {
if (M == null || M.length == 0) return M;
int[][] dirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}, {1,1}, {1,-1}, {-1,1}, {-1,-1}};
for (int i = 0 ; i < M.length; i ++) {
for (int j = 0 ; j < M[0].length; j ++) {
int sum = 0;
int count = 0;
for (int[] dir : dirs) {
int next_i = i + dir[0];
int next_j = j + dir[1];
if (next_i >= 0 && next_i < M.length && next_j >= 0 && next_j < M[0].length) {
count ++;
sum = sum + (M[next_i][next_j] & 1);
}
}
int val = (sum + M[i][j]) / count;
if (val == 1) {
M[i][j] = (1 << 1) + M[i][j];
}
}
}
for (int i = 0 ; i < M.length; i ++) {
for (int j = 0 ; j < M[0].length; j ++) {
M[i][j] = M[i][j] & 1;
}
}
return M;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract int newState();",
"void stateChanged( final GameState oldState, final GameState newState );",
"long getStateChange();",
"protected S state(S newState) {\n S oldState = state;\n state = newState;\n return oldState;\n }",
"public void applyNewState() {\n this.setAlive(this.newState);\n }",
"void changeState(Spreadable spreadable, State from, State to, int count);",
"public State getNewState() {\n\t\treturn newState;\n\t}",
"public State getNewState() {\n return newState;\n }",
"abstract public void updateState();",
"public void updateState();",
"public void state(@NotNull State newState) {\n State state = this.state.get();\n\n if (state.ordinal() < newState.ordinal())\n this.state.compareAndSet(state, newState);\n }",
"public Boolean getNewState() {\n return this.newState;\n }",
"public void setState(State newState) {this.state = newState;}",
"private void nextState() {\n int x;\n int y;\n y = st3;\n x = (st0 & MASK) ^ st1 ^ st2;\n x ^= (x << SH0);\n y ^= (y >>> SH0) ^ x;\n st0 = st1;\n st1 = st2;\n st2 = x ^ (y << SH1);\n st3 = y;\n st1 ^= parameter.getMat1(y);\n st2 ^= parameter.getMat2(y);\n }",
"public abstract void stateChanged(STATE state);",
"void nextState();",
"private void updateState() {\n\t while(!isGoodState()) {\n\t\t updateStateOnce();\n\t }\n }",
"public void setStateOfMovement(int movementState){stateOfMovement = movementState; }",
"private ScanState switchState(ScanState desired,EnumSet<ScanState> allowed) {\n final ScanState old;\n final long timestamp;\n final long sequence;\n synchronized(this) {\n old = state;\n if (!allowed.contains(state))\n throw new IllegalStateException(state.toString());\n state = desired;\n timestamp = System.currentTimeMillis();\n sequence = getNextSeqNumber();\n }\n LOG.fine(\"switched state: \"+old+\" -> \"+desired);\n if (old != desired)\n queueStateChangedNotification(sequence,timestamp,old,desired);\n return old;\n }",
"protected void stateChanged(final SpacecraftState state) {\n final AbsoluteDate date = state.getDate();\n final boolean forward = date.durationFrom(getStartDate()) >= 0.0;\n for (final DoubleArrayDictionary.Entry changed : state.getAdditionalStatesValues().getData()) {\n final TimeSpanMap<double[]> tsm = unmanagedStates.get(changed.getKey());\n if (tsm != null) {\n // this is an unmanaged state\n if (forward) {\n tsm.addValidAfter(changed.getValue(), date, false);\n } else {\n tsm.addValidBefore(changed.getValue(), date, false);\n }\n }\n }\n }",
"public void alterState(SimulationState currentState) {\r\n int size = states.size();\r\n states.removeIf(state -> state.getFrameNumber() >= currentState.getFrameNumber());\r\n alteredStates.removeIf(num -> num >= currentState.getFrameNumber());\r\n alteredStates.add(currentState.getFrameNumber());\r\n states.add(currentState.getFrameNumber(), currentState);\r\n for (int i = states.size(); i < size; i++) {\r\n nextState();\r\n }\r\n }",
"private void computeExternalState(InternalState newState) {\n if (internalState != newState) {\n switch (internalState) {\n case BUILD:\n Preconditions.checkState(newState == InternalState.PROBE_IN || newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROBE_IN:\n Preconditions.checkState(newState == InternalState.PROBE_PIVOT_AND_OUT ||\n newState == InternalState.PROJECT_NON_MATCHES ||\n newState == InternalState.REPLAY ||\n newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROBE_OUT:\n case PROBE_PIVOT_AND_OUT:\n Preconditions.checkState(newState == InternalState.PROBE_IN ||\n newState == InternalState.PROBE_OUT ||\n newState == InternalState.PROBE_PIVOT_AND_OUT ||\n newState == InternalState.PROJECT_NON_MATCHES ||\n newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case PROJECT_NON_MATCHES:\n Preconditions.checkState(newState == InternalState.REPLAY || newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n\n case REPLAY:\n Preconditions.checkState(newState == InternalState.DONE,\n \"unexpected transition from state \" + internalState + \" to new state \" + newState);\n break;\n }\n internalState = newState;\n }\n computeExternalState();\n }",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"int getState();",
"@Override\n\tpublic void setState(State state) \n\t\t{ current = new PuzzleState(state.getString(state.getState()),\n\t\t\t\t\t\t\t\t\tstate.getString(state.getGoalState())); \n\t\t}",
"final protected void setEntityState(int newState)\n {\n state = newState;\n }",
"public void updateState(boolean gameDone){\r\n if (animation == 0) {\r\n if (this.state==this.color){\r\n if (this.travel!=0)\r\n this.state=this.color+256;\r\n else\r\n if (idle_counter == 3)\r\n this.state=this.color+264;\r\n }\r\n else if (this.state>=16) {\r\n if (this.state<=31) {\r\n if (this.state+8>31 && !gameDone)\r\n this.state=this.color;\r\n else {\r\n this.state += 8;\r\n }\r\n }\r\n else if (this.state<=63){\r\n if (this.state+8<=63)\r\n this.state+=8;\r\n }\r\n else if (this.state <= 103){\r\n if (this.state + 8 > 103)\r\n this.state=this.color;\r\n else\r\n this.state += 8;\r\n }\r\n else if (this.state<=159){\r\n if (this.state+8>159)\r\n this.state=this.color;\r\n else\r\n this.state += 8;\r\n }\r\n else if (this.state<=255){\r\n if (this.state + 8 > 255) \r\n this.state = this.color;\r\n else\r\n this.state += 8;\r\n if (this.state>=184 && this.state<=199)\r\n this.positionY-=7;\r\n else if (this.state>=208 && this.state<=223)\r\n this.positionY+=7;\r\n }\r\n else if (this.state<264)\r\n this.state=this.color;\r\n else if (idle_counter==3)\r\n this.state=this.color; \r\n }\r\n }\r\n if (idle_counter==3)\r\n idle_counter=0;\r\n if (animation >= 4 && !gameDone) {\r\n animation = 0;\r\n idle_counter++;\r\n }\r\n //creates a slowmo effect once the game is done\r\n else if (animation==18 && gameDone){\r\n animation = 0;\r\n idle_counter++;\r\n }\r\n else \r\n animation++;\r\n \r\n }",
"public boolean updateState( Integer state)\n {\n //some result checking...\n //set last update time\n time = NTPDate.currentTimeMillis();\n int prevState = nState;\n //get state as int\n nState = state.intValue();\n return (prevState!=nState);\n }",
"private static void _VerifyAllowedTransition(short oldState, short newState){\r\n\t\tswitch (oldState){\r\n\t\t\tcase STATE_INSTALLED: {\r\n\t\t\t\tif (newState == STATE_SELECTED) {break;}\r\n\t\t\t\tif (newState == STATE_BLOCKED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\t\t\tcase STATE_SELECTED: {\r\n\t\t\t\tif (newState == STATE_BLOCKED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\t\t\tcase STATE_UPLOADED: {\r\n\t\t\t\tif (newState == STATE_INSTALLED) {break;}\r\n\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t\t}\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new RuntimeException(\"State transition is not allowed\");\r\n\t\t}\r\n\t}",
"public String getNewState() {\n\t\treturn this.newState;\n\t}",
"private void changeState() {\n if (jobs.contains(this.currentFloor)){\n throw new AssertionError(\"Changing state of elevator no \" + ElevatorID + \" on destination floor\");\n }\n\n // empty job set -> going to IDLE state\n if (jobs.size() == 0) {\n this.currentState = IDLE;\n return;\n }\n\n Integer closestFloorDownwards = jobs.floor(this.currentFloor);\n Integer closestFloorUpwards = jobs.ceiling(this.currentFloor);\n\n switch (this.currentState) {\n // if elevator is in idle state then we need to go to the closest job possible\n case IDLE -> {\n Integer closestFloor =\n findClosestFloor(this.currentFloor, closestFloorUpwards, closestFloorDownwards);\n\n if (closestFloor < this.currentFloor) {\n this.currentState = DOWN;\n } else {\n this.currentState = UP;\n }\n }\n case DOWN -> {\n if (closestFloorDownwards != null) { // if there exists a predecessor in `jobs`\n this.currentState = DOWN; // let's continue going down\n } else {\n this.currentState = UP; // otherwise we need to go up\n }\n }\n case UP -> {\n if (closestFloorUpwards != null) { // if there exists a successor in `jobs`\n this.currentState = UP; // let's continue going up\n } else {\n this.currentState = DOWN; // otherwise we need to go down\n }\n }\n }\n }",
"public void updateNewState() {\n Integer aliveCount = 0;\n for (final Cell neighbor : this.neighbors) {\n if (neighbor.isAlive()) {\n aliveCount++;\n }\n }\n\n if (aliveCount < 2) {\n this.setNewState(false);\n } else if (!this.isAlive() && aliveCount == 3) {\n this.setNewState(true);\n } else if (aliveCount > 3) {\n this.setNewState(false);\n }\n }",
"public void changeState(int transition) {\n lastState = currentState;\n currentState = nextState[currentState][transition];\n // System.out.println(\" = \" + currentState);\n if (currentState == -2) {\n System.out.println(\"Error [\" + currentState + \"] has occured\");\n terminate();\n }\n else if (currentState == -1) {\n terminate();\n }\n states[currentState].run();\n }",
"public int getState() {return state;}",
"public int getState() {return state;}",
"void currentStateChanged();",
"public void setState(int newState) {\n state = newState;\n }",
"@Override\n protected void incrementStates() {\n\n }",
"public void changeState() {\n if (!isDead) {\n Bitmap temp = getBitmap();\n setBitmap(stateBitmap);\n stateBitmap = temp;\n }\n }",
"private LogicStatus updateState(Board thing) {\n count(thing);\n CellType curstate = thing.getCellType(x,y);\n\n // is it a terminal?\n if (walls.size() == 3) {\n if (curstate == CellType.NOTTERMINAL) return LogicStatus.CONTRADICTION;\n thing.setCellType(x,y,CellType.TERMINAL);\n return LogicStatus.LOGICED;\n }\n\n // the other states (BEND,STRAIGHT) require two paths.\n if (paths.size() < 2) return LogicStatus.STYMIED;\n\n Iterator<Direction> dit = paths.iterator();\n Direction d1 = dit.next();\n Direction d2 = dit.next();\n\n CellType nextct = d1 == d2.getOpp() ? CellType.STRAIGHT : CellType.BEND;\n\n if (nextct == CellType.STRAIGHT) {\n thing.setCellType(x,y,nextct);\n return LogicStatus.LOGICED;\n }\n\n if (curstate == CellType.NOTBEND) return LogicStatus.CONTRADICTION;\n\n thing.setCellType(x,y,nextct);\n return LogicStatus.LOGICED;\n }",
"State getState();",
"State getState();",
"State getState();",
"State getState();",
"public void changeState()\r\n\t{\r\n\t\tfailedNumber=0;\r\n\t\tif(state.equalsIgnoreCase(\"IN PREPARATION\"))\r\n\t\t\tsetState(\"IN TRANSIT\");\r\n\t\telse if(state.equalsIgnoreCase(\"IN TRANSIT\"))\r\n\t\t{\r\n\t\t\tfailedNumber=Math.random();\r\n\t\t\tif(failedNumber<=0.2) setState(\"FAILED\");\r\n\t\t\telse setState(\"RECEIVED\");\r\n\t\t}\r\n\t}",
"private void updateState() {\n switch (game.getGameState()) {\n case GAME:\n gamePlay();\n break;\n case ONE:\n lostTurnByOne();\n break;\n case READY:\n readyToPlay();\n break;\n case START:\n startGame();\n break;\n case TURN:\n startTurn();\n break;\n case FINISH:\n finishGame();\n break;\n }\n }",
"Object getState();",
"@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}",
"public void gameOfLife(int[][] board) {\n int m = board.length;\n int n = ( m > 0 ? board[0].length : 0);\n int[] dx = {-1, -1, -1, 0, 1, 1, 1, 0};\n int[] dy = {-1, 0, 1, 1, 1, 0, -1, -1};\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n int cnt = 0;\n /**\n * Count the neighbors with live status.\n */\n for (int k = 0; k < 8; k++) {\n int x = i + dx[k];\n int y = j + dy[k];\n /**\n * Notice using board[x][y] here, not board[i][j]\n * The next state is created by applying the above rules simultaneously to every cell in the current state,\n * so we concern state==1 and state==2(both states indicate live)\n */\n if (x >= 0 && x < m && y >= 0 && y < n && (board[x][y] == 1 || board[x][y] == 2)) {\n cnt++;\n }\n }\n if (board[i][j] == 1 && (cnt < 2 || cnt > 3)) {\n /**\n * From live to dead.\n */\n board[i][j] = 2;\n }\n if (board[i][j] == 0 && cnt == 3) {\n /**\n * From dead to live\n */\n board[i][j] = 3;\n }\n }\n }\n /**\n * Restore state back to 0 and 1.\n */\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n board[i][j] %= 2;\n }\n }\n }",
"public void setState(PlayerState newPlayerState) {\n\n this.playerState = newPlayerState;\n\n closeWindows();\n\n\n switch (newPlayerState) {\n\n case CHOOSE_BONUS_TILE:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(false);\n\n setEndTurn(false);\n\n setUseLeader(false);\n\n\n break;\n\n\n case THROWDICES:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(true);\n\n setSkipAction(false);\n\n setEndTurn(false);\n\n setUseLeader(false);\n\n try {\n throwDices();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n break;\n\n\n\n case DOACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(true);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n try {\n yourTurn();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n\n break;\n\n case BONUSACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n try {\n bonusAction();\n } catch (InterruptedException e) {\n LOGGER.log(Level.WARNING, \"Interrupted!\", e);\n // clean up state...\n Thread.currentThread().interrupt();\n }\n\n break;\n\n\n case CHOOSEACTION:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(true);\n\n setThrowDices(false);\n\n setSkipAction(true);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n break;\n\n\n case CHOOSEWORKERS:\n case ACTIVATE_PAY_TO_OBTAIN_CARDS:\n case CHOOSE_EFFECT:\n case CHOOSECOST:\n case CHOOSE_COUNCIL_PRIVILEGE:\n case PRAY:\n case WAITING:\n\n noButtonsAble();\n\n setLeaderButtons(false);\n\n setUseLeader(false);\n\n break;\n\n case ENDTURN:\n\n setActions(false);\n\n setLeaderButtons(false);\n\n setFamilyPawns(false);\n\n setThrowDices(false);\n\n setSkipAction(false);\n\n setEndTurn(true);\n\n setUseLeader(true);\n\n\n break;\n\n case LEADER:\n\n noButtonsAble();\n\n setUseLeader(true);\n break;\n\n\n case SUSPENDED:\n\n noButtonsAble();\n\n setLeaderButtons(false);\n\n setUseLeader(false);\n\n suspendedPane.setVisible(true);\n\n break;\n\n\n }\n\n }",
"public static int activityStateToWorkItemState( int newState )\r\n {\r\n // The states actually have the same ordinals.\r\n return newState;\r\n }",
"void changed(State state, Exception e);",
"public void setCellState(int newState) {\n this.myState = newState;\n }",
"public boolean transition() {\n current = new State(ts++, hopper); \n if (terminus.isTerminus(current)) {\n return false;\n } else {\n hopper.sendBall(oneMinute);\n return true;\n }\n }",
"public void getState();",
"public int getState();",
"public int getState();",
"public int getState();",
"public int getState();",
"@Override\r\n\tpublic void updateState() {\r\n\t\tState<A> result = null;\r\n\t\tif(events.size() > 0){\r\n\t\t\tfor(Event<A> a : events){\r\n\t\t\t\tstate = (result = state.perform(this,a)) == null ? state : result;\r\n\t\t\t}\r\n\t\t\tevents.removeAllElements();\r\n\t\t}\r\n\t\tstate = (result = state.perform(this, null)) == null ? state : result;\r\n\t\trequestInput();\r\n\t\t\r\n\t}",
"private List<State> substitueStateSketch(State oldState, Set<Node> components) {\n\n// long start = System.currentTimeMillis();\n\n List<State> ret = new ArrayList<>();\n\n for (Node sk : components) {\n\n State newState = new State(oldState);\n VariableNode v = newState.pp.findSelectedVar();\n v.sketch = sk;\n\n if (sk instanceof NullaryTerminalNode) {\n\n NullaryTerminalNode n = (NullaryTerminalNode) sk;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n if (n.sym.name.equals(\"<any>\")) continue;\n } else if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n newState.cost += Main.NOT_TERMINAL_PATTERN;\n }\n }\n\n newState.pp.numNullaryTerminals++;\n } else if (sk instanceof OperatorNode) {\n if (((OperatorNode) sk).special) newState.cost += Main.SPECIAL_REPEATATLEAST_1;\n\n String opName = ((OperatorNode) sk).operatorName;\n\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"not\")) {\n if (!(opName.equals(\"startwith\") || opName.equals(\"endwith\") || opName.equals(\"contain\"))) {\n newState.cost += Main.NOT_NOT_CONTAIN_SW_EW_PATTERN;\n }\n }\n }\n } else {\n\n // do not continue if we are trying to replace argument of notcc with a op node\n if (v.parent != null && !(v.parent instanceof RepSketchNode)) {\n if (((OperatorNode) v.parent).operatorName.equals(\"notcc\")) {\n continue;\n }\n }\n }\n\n newState.pp.numOperatorSketch++; // TODO: it might be a problem if we have a rf sketch such as concat(v:contain(v:?{<num>}))\n newState.pp.deselectVar();\n if (evalApprox(newState)) ret.add(newState);\n\n }\n\n return ret;\n\n }",
"public LinkedList<State> getNextAvailableStates() {\n LinkedList<Integer> currentSide = new LinkedList<>();\n LinkedList<Integer> otherSide = new LinkedList<>();\n LinkedList<State> newStates = new LinkedList<>();\n if(isLeft) {\n if(leftSide != null) currentSide = new LinkedList<>(leftSide);\n if(rightSide != null) otherSide = new LinkedList<>(rightSide);\n } else {\n if (rightSide != null) currentSide = new LinkedList<>(rightSide);\n if (leftSide != null) otherSide = new LinkedList<>(leftSide);\n }\n\n // add one people to the other side of the bridge\n for (int index=0; index< currentSide.size(); index++) {\n LinkedList<Integer> newCurrentSide = new LinkedList<>(currentSide);\n LinkedList<Integer> newOtherSide = new LinkedList<>(otherSide);\n int firstPeopleMoved = newCurrentSide.remove(index);\n newOtherSide.add(firstPeopleMoved);\n State state = (isLeft) ? new State(newCurrentSide, newOtherSide, !isLeft,timeTaken+firstPeopleMoved, depth+1, highestSpeed) :\n new State(newOtherSide, newCurrentSide, !isLeft, timeTaken+firstPeopleMoved, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n String currentAction = \"move \" + firstPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this); // copy all the previous actions from the parent\n state.addActions(currentAction); // add new action to state generated by parent\n // add to the new states of list\n newStates.add(state);\n // add two people to the other side of the bridge\n for (int second=0; second < newCurrentSide.size(); second++) {\n LinkedList<Integer> newSecondCurrentSide = new LinkedList<>(newCurrentSide);\n LinkedList<Integer> newSecondOtherSide = new LinkedList<>(newOtherSide);\n int secondPeopleMoved = newSecondCurrentSide.remove(second);\n newSecondOtherSide.add(secondPeopleMoved);\n int slowerSpeed = (firstPeopleMoved > secondPeopleMoved) ? firstPeopleMoved : secondPeopleMoved;\n state = (isLeft) ? new State(newSecondCurrentSide, newSecondOtherSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed) :\n new State(newSecondOtherSide, newSecondCurrentSide, !isLeft, timeTaken+slowerSpeed, depth+1, highestSpeed);\n state.setReward(state.calculateReward(firstPeopleMoved, secondPeopleMoved));\n // add this as parent to the child\n state.parents = new LinkedList<>(this.parents);\n state.addParent(this);\n // set the action that get to this state\n currentAction = \"move \"+ firstPeopleMoved + \" \" + secondPeopleMoved;\n currentAction += (isLeft) ? \" across\" : \" back\";\n state.copyActions(this);\n state.addActions(currentAction);\n // add to the new states of list\n newStates.add(state);\n }\n\n }\n return newStates;\n }",
"public interface I_GameHistory extends PropertyChangeListener {\n\n /**\n * Checks if the current state has been encountered before\n * @return true if the current game state is equal to an earlier encountered state\n */\n default boolean isRepeatState() {\n return isRepeatState(FULL_EQUAL);\n }\n\n default boolean isRepeatState(I_GameState state) {\n return isRepeatState(FULL_EQUAL, state);\n }\n\n /**\n * Checks if the current state has been encountered before using a list of predicates to compare states with\n * @param predicate a predicate testing some relation between two states.\n * @return true if the current game state is equal to an earlier encountered state\n */\n boolean isRepeatState(final BiPredicate<I_GameState, I_GameState> predicate);\n\n boolean isRepeatState(final BiPredicate<I_GameState, I_GameState> predicate, I_GameState state);\n /**\n * Checks if the current state has been encountered before.\n * All states that returns true given the predicate being aplied to it as well as the current state are\n * being returned as a collection.\n * @return true if the current game state is equal to an earlier encountered state\n */\n default Collection<I_GameState> getRepeatStates() {\n return getRepeatStates(FULL_EQUAL);\n }\n\n default Collection<I_GameState> getRepeatStates(I_GameState state) {\n return getRepeatStates(FULL_EQUAL, state);\n }\n\n /**\n * Checks if the current state has been encountered before using a list of predicate to compare states with.\n * All states that returns true given the predicate being applied to it as well as the current state are\n * being returned as a collection.\n * @param predicate a predicate testing some relation between two states.\n * @return true if the current game state is equal to an earlier encountered state\n */\n Collection<I_GameState> getRepeatStates(final BiPredicate<I_GameState, I_GameState> predicate);\n\n Collection<I_GameState> getRepeatStates(final BiPredicate<I_GameState, I_GameState> predicate, I_GameState state);\n\n /**\n * This predicate returns true only if the two states are actually both referencing the same object.\n */\n BiPredicate<I_GameState, I_GameState> IDENTITY_EQUAL = I_GameHistory::identityEqual;\n\n /**\n * This predicate returns true if the sizes of the lists in the first state are all\n * equal to the length of the corresponding list in the second state.\n */\n BiPredicate<I_GameState, I_GameState> PILE_SIZE_EQUAL = I_GameHistory::sizeEqual;\n\n /**\n * This predicate returns true only if the content of each list in one state matches exactly the content\n * of the corresponding lists in the other state. Objects.equals() is used to check equality of the contents.\n */\n BiPredicate<I_GameState, I_GameState> PILE_CONTENT_EQUAL = I_GameHistory::contentEqual;\n\n /**\n * This predicate tests all of the other standard predicates in this interface.\n * They are tried in a prioritized manor with the least expensive first.\n * It returns as soon as it can be sure of the result.\n */\n BiPredicate<I_GameState, I_GameState> FULL_EQUAL = IDENTITY_EQUAL.or(PILE_SIZE_EQUAL.and(PILE_CONTENT_EQUAL));\n\n /**\n * Returns true only if the two states are actually both referencing the same object.\n *\n * @param state1 a state to compare\n * @param state2 the state to compare it to\n * @return true if the contents of one state all equals the contents of the other state\n */\n private static boolean identityEqual(final I_GameState state1, final I_GameState state2) {\n if (state1 == state2)\n return true;\n\n return Stream.of(new SimpleEntry<>(state1, state2))\n .flatMap( // transform the elements by making a new stream with the transformation to be used\n pair -> Arrays.stream(E_PileID.values()) // stream the pileIDs\n // make new pair of the elements of that pile from each state\n .map(pileID -> new SimpleEntry<>(\n pair.getKey().get(pileID),\n pair.getValue().get(pileID)\n )\n )\n )\n .allMatch(pair -> pair.getKey() == pair.getValue());\n }\n\n /**\n * Returns true if the sizes of the lists in the first state are all\n * equal to the length of the corresponding list in the second state.\n *\n * @param state1 a state to compare\n * @param state2 the state to compare it to\n * @return true if the contents of one state all equals the contents of the other state\n */\n private static boolean sizeEqual(final I_GameState state1, final I_GameState state2) {\n //if a state is null there surely must be a mistake somewhere\n if (state1 == null || state2 == null) throw new NullPointerException(\"A state cannot be null when comparing\");\n\n // make a stream with a data structure containing both states\n return Stream.of(new SimpleEntry<>(state1, state2))\n .flatMap( // transform the elements by making a new stream with the transformation to be used\n pair -> Arrays.stream(E_PileID.values()) // stream the pileIDs\n // make new pair of the elements of that pile from each state\n .map(pileID -> new SimpleEntry<>(\n pair.getKey().get(pileID),\n pair.getValue().get(pileID)\n )\n )\n )\n .map(I_GameHistory::replaceNulls)\n .allMatch(pair -> pair.getKey().size() == pair.getValue().size()); // check they have equal sizes\n }\n\n /**\n * Returns true only if the content of each list in one state matches exactly the content\n * of the corresponding lists in the other state. Objects.equals() is used to check equality of the contents.\n *\n * @param state1 a state to compare\n * @param state2 the state to compare it to\n * @return true if the contents of one state all equals the contents of the other state\n */\n private static boolean contentEqual(final I_GameState state1, final I_GameState state2) {\n //if a state is null there surely must be a mistake somewhere\n if (state1 == null || state2 == null) throw new NullPointerException(\"A state cannot be null when comparing\");\n //if ( !sizeEqual(state1, state2) ) return false;\n\n return Stream.of(new SimpleImmutableEntry<>(state1, state2))\n .flatMap( //map the pair of states to many pairs of piles\n statePair -> Arrays.stream(E_PileID.values())\n .map(pileID -> new SimpleEntry<>(\n statePair.getKey().get(pileID),\n statePair.getValue().get(pileID)\n )\n )\n )\n .map(I_GameHistory::replaceNulls)\n .flatMap( // map the pairs of piles to many pairs of Optional<I_card>s.\n listPair -> IntStream //make sure to always traverse the longer list\n .range(0, Math.max(listPair.getKey().size(), listPair.getValue().size()))\n .mapToObj(i -> new SimpleEntry<>(\n getIfExists(listPair.getKey(), i),\n getIfExists(listPair.getValue(), i))\n )\n )\n // map pairs to booleans by checking that the element in a pair are equal\n .map(cardPair -> Objects.equals(cardPair.getKey(), cardPair.getValue()))\n // reduce the many values to one bool by saying all must be true or the statement is false\n .reduce(true, (e1, e2) -> e1 && e2);\n }\n\n static SimpleEntry<List<I_CardModel>, List<I_CardModel>> replaceNulls(SimpleEntry<List<I_CardModel>, List<I_CardModel>> entry) {\n var key = entry.getKey();\n var value = entry.getValue();\n if (key == null)\n key = List.of();\n if (value == null)\n value = List.of();\n\n return new SimpleEntry<>(key, value);\n }\n\n default <t extends I_GameState> Predicate<t> partiallyApplyPredicate(BiPredicate<t, t> biPred, t arg) {\n return test -> biPred.test(arg, test);\n }\n\n /**\n * A convenient to get an optional card from a list that might throw index out of bounds\n * @param list the list to take an element from\n * @param index the index of the element\n * @return empty if element is null or dosen't exist, otherwise the element at index wrapped in {@link Optional}\n */\n private static Optional<I_CardModel> getIfExists(List<I_CardModel> list, int index) {\n try {\n return Optional.ofNullable(list.get(index));\n } catch (IndexOutOfBoundsException e) {\n return Optional.empty();\n }\n }\n\n //todo might be a good idea to implement a method that checks for the moves that has been tried when in a given state\n}",
"@Override\r\n public boolean updateState(Status currentState, Event event,\r\n Status nextState, UserVmTcDetail vo, Object data) {\n return false;\r\n }",
"private boolean transitionRunStateTo(int state) {\n for (;;) {\n int s = runState;\n if (s >= state)\n return false;\n if (_unsafe.compareAndSwapInt(this, runStateOffset, s, state))\n return true;\n }\n }",
"public void setState (int new_state, int force) {\n\t\t\tLog.d (\"STATE\", \"New state : \" + new_state);\n\t\t\tif (new_state >= BotMove.RIGHT_15 && new_state <= BotMove.LEFT_5){\n\t\t\t\tstate = new_state;\n\t\t\t\ttakeInterruptAction();\n\t\t\t}\n\t\t\telse if(state != new_state || force == 1){\n\t\t\t\tstate = new_state;\n\t\t\t\ttakeInterruptAction();\n\t\t\t}\n\t\t\telse wt.take_reading = true;\n\t\t}",
"public interface StateMachineListener\n{\n //================| Public Methods |====================================\n \n /**\n * Notification that the state of the game has changed.\n\n * @param oldState \n * @param newState\n */\n void stateChanged( final GameState oldState, final GameState newState );\n}",
"public void stateChanged(ChangeEvent e) {\n\t\tupdatePits();\n\t\tSystem.out.println(\"Player 0 score: \" + model.getMancalas()[0]);\n\t\tSystem.out.println(\"Player 1 score: \" + model.getMancalas()[1]);\n\t\tleftScore.setText( Integer.toString(model.getMancalas()[1]));\n\t\trightScore.setText( Integer.toString(model.getMancalas()[0]));\n\t\tSystem.out.println(\"It is now player: \" + model.getPlayer() + \"'s turn\");\n\t\t\n\t}",
"public State getOldState() {\n\t\treturn oldState;\n\t}",
"LabState state();",
"public void updateState(int i) {\n byte count = nextState[i];\n nextState[i] = 0;\n\n if (currentState[i] == 0) {\n currentState[i] = ((count >= minBirth) && (count <= maxBirth)) ? (byte)1 : (byte)0;\n } else {\n currentState[i] = ((count >= minSurvive) && (count <= maxSurvive)) ? (byte)1 : (byte)0;\n }\n\n // After calculating the new state, set the appropriate rendering enable for the\n // cell object in the world, so we can see it. We take advantage of this test to\n // count the current live population, too.\n if (currentState[i] != 0) {\n cells[i].setRenderingEnable(true);\n ++population;\n } else {\n cells[i].setRenderingEnable(false);\n }\n }",
"@Override\n public int getState() {\n return myState;\n }",
"public static int processStateToActivityState(int newState) {\r\n // The states actually have the same ordinals.\r\n return newState;\r\n }",
"public TaskState getNewTaskState(){\n\n TaskState newState = new TaskState();\n\n newState.graph = new DescGraph();\n newState.moveStack = new Stack<>();\n newState.hasSolution = false;\n newState.isNew = true;\n\n newState.moveStack.push(\n new HorseMove(newState.graph.getFirst())\n );\n\n return newState;\n\n }",
"@Override\n\tpublic void adjust() {\n\t\tstate = !state;\n\t}",
"void setState(int state);",
"public void setState(int state);",
"public void setState(int state);",
"void update( State state );",
"public void checkState() {\r\n\t\tout.println(state);\r\n\t\tif(getEnergy() < 80 && getOthers() > 5) {\r\n\t\t\tstate = 1;\r\n\t\t\tturnLeft(getHeading() % 90);\r\n\t\t\tahead(moveAmount);\r\n\t\t}\r\n\t\telse if(getEnergy() < 80 && getOthers() < 5) {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tstate = 0;\r\n\t\t}\r\n\t\t\r\n\t}",
"public int getStateOfMovement(){ return stateOfMovement; }",
"public static int activityStateToProcessState( int newState )\r\n {\r\n // The states actually have the same ordinals.\r\n return newState;\r\n }",
"@Override\n public void updateState(Perception p) {\n \n //TODO: Complete Method\n }",
"@Test\n public void testStateTransitions2()\n {\n theEngine.start();\n letPlayerWin();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Halted\n theEngine.quit();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Player won -> Player died\n killPlayerByPlayerMove();\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inWonState());\n \n //Undo from player won state\n theEngine.undoLastMove();\n //didn't throw assertion error, so this is fine\n assertTrue(theEngine.invariant());\n assertTrue(theEngine.inHaltedState());\n }",
"public abstract State getSourceState ();",
"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\tpublic void stateChanged() {\n\t\t\n\t}",
"Update withState(String state);",
"ControllerState getNewObjectState();",
"public IServerState changeState(ServerEvents serverEvent);",
"private static int runStateOf(int c) { return c & ~CAPACITY; }",
"public void updateState(boolean state);",
"public byte getState(){\n\t\t/*\n\t\tOFFLINE((byte)0),\n ONLINE((byte)1),\n SAVING((byte)2);\n\t\t */\n\t\t//getWorld().getcWorld().update(this);\n\t\treturn state;\n\t}",
"public IFsm transitionTo(Class<? extends IState> p_newState) throws Exception;",
"public interface AbstractState {\r\n abstract void toNextState(ChessBoard chessBoard,AbstractState state);\r\n}",
"@Test\n\tpublic void validState_changeState() {\n\t\tString testState = \"OFF\";\n\t\tItem testItem = new Item().createItemFromItemName(\"lamp_woonkamer\");\n\t\ttestItem.changeState(testItem.getName(), testState);\n\t\tSystem.out.println(testItem.getState());\n\t\tassertEquals(testItem.getState(), testState);\n\t\t\n\t}",
"public void updateQValue(State oldState, State state)\n\t{\n\t\t// update according to reward of current state\n\t\tdouble reward = state.getReward();\n\t\t\n\t\t// get bets QValue for calculating updated qvalue\n\t\tList<boolean[]> actions = getValidActions();\n\n\t\t// initialize values for comparison in next loop\n\t\tStateActionPair sap = new StateActionPair(state, actions.get(0));\n\t\tdouble bestQValue = getStateActionValue(sap);\n\t\t\n\t\t// for each action, get stateaction pair and compare highest qValue \n\t\t// to return the future reward\n\t\tfor(int i=1; i<actions.size(); i++)\n\t\t{\n\t\t\tsap = new StateActionPair(state, actions.get(i));\n\t\t\tdouble Q = getStateActionValue(sap);\n\t\t\tif( Q > bestQValue )\n\t\t\t\tbestQValue = Q;\n\t\t}\n\n\t\t// create state action pair\n\t\tStateActionPair oldSap = new StateActionPair(oldState, returnAction);\n\t\tdouble oldQ = getStateActionValue(oldSap);\n\n\t\t// calculate reward according to qLearn\n\t\tdouble updatedValue = oldQ + alpha*(reward + gamma*bestQValue - oldQ);\n\t\t\n\t\tqValues.put(oldSap, updatedValue);\t// update qValue of State-action pair\n\t}"
] | [
"0.79368764",
"0.7557704",
"0.709088",
"0.69510055",
"0.6603025",
"0.6566572",
"0.64805484",
"0.6476128",
"0.6468225",
"0.64581144",
"0.64259833",
"0.6415121",
"0.6384521",
"0.63702345",
"0.63398486",
"0.6336421",
"0.6323715",
"0.6251576",
"0.6251174",
"0.62062144",
"0.61955726",
"0.6195503",
"0.6192025",
"0.6192025",
"0.6192025",
"0.6192025",
"0.6192025",
"0.6192025",
"0.6170725",
"0.6170683",
"0.61579084",
"0.61309975",
"0.61309624",
"0.6119514",
"0.61006916",
"0.6098962",
"0.60890746",
"0.6084421",
"0.6084421",
"0.6071581",
"0.606753",
"0.60631484",
"0.60614103",
"0.6058557",
"0.60199565",
"0.60199565",
"0.60199565",
"0.60199565",
"0.6001661",
"0.5998946",
"0.5996639",
"0.59752136",
"0.59736204",
"0.5965375",
"0.5964796",
"0.594338",
"0.59345317",
"0.5932285",
"0.5926497",
"0.59251",
"0.59251",
"0.59251",
"0.59251",
"0.59225225",
"0.5915802",
"0.59013104",
"0.58997",
"0.58954996",
"0.58844006",
"0.58823997",
"0.58815205",
"0.5881208",
"0.5879778",
"0.58720326",
"0.5863306",
"0.5862397",
"0.58612716",
"0.58608514",
"0.58553225",
"0.58524895",
"0.58445364",
"0.58445364",
"0.5840241",
"0.583554",
"0.5826722",
"0.5817245",
"0.5803887",
"0.5788891",
"0.5787538",
"0.57871",
"0.57850695",
"0.5784085",
"0.57815164",
"0.5776385",
"0.57760924",
"0.57703507",
"0.5767125",
"0.57653767",
"0.5757806",
"0.57495415",
"0.57451546"
] | 0.0 | -1 |
Constructor is package protected and cannot be called by applications directly. Applications should use the createImage factory method to build new SVGImage instances. | SVGImage(final ScalableImage scalableImage) {
if (scalableImage == null) {
throw new NullPointerException();
}
this.scalableImage = scalableImage;
this.doc = (DocumentNode) ((javax.microedition.m2g.SVGImage) scalableImage).getDocument();
this.svg = (SVG) doc.getDocumentElement();
this.sg = ScalableGraphics.createInstance();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static SVGImage createImage(InputStream is) throws IOException {\n ScalableImage scalableImage = ScalableImage.createImage(is, null);\n return new SVGImage(scalableImage);\n }",
"@Override\r\n\tpublic void init() {\n\t\timg = new ImageClass();\r\n\t\timg.Init(imgPath);\r\n\t}",
"public Image() {\n \n }",
"public ImageFactoryImpl()\n\t{\n\t\tsuper();\n\t}",
"public SVGModel() {\n \t\telementToModel = new HashMap<SVGElement, SVGElementModel>();\n \t\ttagNameToTagCount = new HashMap<String, Integer>();\n \t\tgrid = new Grid();\n \t}",
"public HSIImage()\r\n {\r\n }",
"public Image() {\n }",
"@Nonnull\n private BufferedImage createImage() {\n return new BufferedImage(getWidth(), getHeight(), getImageType().getType());\n }",
"protected Bitmap getSVGImageForName(String name) throws IOException {\n String path = SVG_BASE_PATH + name + \".svg\";\n\n // create a shape document (load the SVG)\n PXShapeDocument document = PXSVGLoader.loadFromStream(getContext().getAssets().open(path));\n\n // grab root shape\n PXShapeGroup root = (PXShapeGroup) document.getShape();\n RectF bounds = root.getViewport();\n\n if (bounds == null || bounds.isEmpty()) {\n // use 100x100 if we didn't find a view port in the SVG file\n bounds = new RectF(0, 0, 100, 100);\n }\n\n // set size\n document.setBounds(bounds);\n // render to UIImage\n Drawable drawable = root.renderToImage(bounds, false);\n return ((BitmapDrawable) drawable).getBitmap();\n }",
"public GraphicsFactory() {\n\t\tsuper();\n\t}",
"public Image() {\n\t\tsuper();\n\t\taddNewAttributeList(NEW_ATTRIBUTES);\n\t\taddNewResourceList(NEW_RESOURCES);\n\t}",
"private Images() {}",
"public Image getImage() {\n if (image == null) {//GEN-END:|34-getter|0|34-preInit\n // write pre-init user code here\n try {//GEN-BEGIN:|34-getter|1|34-@java.io.IOException\n image = Image.createImage(\"/226px-Wave.svg.png\");\n } catch (java.io.IOException e) {//GEN-END:|34-getter|1|34-@java.io.IOException\n e.printStackTrace();\n }//GEN-LINE:|34-getter|2|34-postInit\n // write post-init user code here\n }//GEN-BEGIN:|34-getter|3|\n return image;\n }",
"public static SVGImage createImage(String svgURI) throws IOException {\n ScalableImage scalableImage = null;\n\n try {\n scalableImage = ScalableImage.createImage(svgURI, null);\n } catch (NullPointerException npe) {\n throw new IllegalArgumentException(ERROR_NULL_URI);\n } \n \n return new SVGImage(scalableImage);\n }",
"private Image createImage(String image_file) {\n\t\tImage img = new Image(image_file);\n\t\treturn img;\n\t}",
"public Graphics2D createGraphics()\n {\n return this.image.createGraphics();\n }",
"public Image()\r\n {\r\n super();\r\n setBounds( 0, 0, 10, 10 );\r\n }",
"public void convert() throws Exception {\r\n\t\tString svg_URI_input = Paths.get(\"library.svg\").toUri().toURL().toString();\r\n\t\tTranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);\r\n\t\tthis.setNewImage(generate(20));// Define the name of the file\r\n\t\ttry (OutputStream png_ostream = new FileOutputStream(newImage)) {\r\n\t\t\tTranscoderOutput output_png_image = new TranscoderOutput(png_ostream);\r\n\r\n\t\t\tPNGTranscoder my_converter = new PNGTranscoder();\r\n\t\t\tmy_converter.transcode(input_svg_image, output_png_image);\r\n\r\n\t\t\tpng_ostream.flush();\r\n\t\t\tpng_ostream.close();\r\n\t\t}\r\n\r\n\t}",
"public SVG build() throws SVGParseException {\n if (data == null) {\n throw new IllegalStateException(\"SVG input not specified. Call one of the readFrom...() methods first.\");\n }\n SVGParser parser = new SVGParser();\n SVG svg = parser.parse(data);\n svg.setFillColorFilter(fillColorFilter);\n svg.setStrokeColorFilter(strokeColorFilter);\n return svg;\n }",
"public SpriteBuilder(String imagePath) {\r\n if (imagePath == null || \"\".equals(imagePath.trim())) {\r\n throw new IllegalArgumentException(\"The image path can't be null!!\");\r\n }\r\n this.imageView = new ImageView(imagePath);\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }",
"private GraphicsUtils() {\n }",
"public VectorImage() {\n\t}",
"Image createImage();",
"public ImageConverter() {\n\t}",
"private ImageUtils() {}",
"public IconRenderer() \n\t{\n\t\t\n\t}",
"public void buildImage(String INPUT_XML_SYMBOL) throws IOException, JAXBException, XMLStreamException {\n\n\t\tFile xmlFile = new File(OUTPUT_FILE_TEMP);\n\n\t\tString outputFileName = (INPUT_XML_SYMBOL).replaceAll(\".xml\", \".png\");\n\t\t\n\n\t\tint resolutionX = 500;\n\t\tJaxbErrorLogRepository errorRep = new JaxbErrorLogRepository(xmlFile);\n\t\tInputRepository inputRep = new JaxbInputRepository(xmlFile);\n\t\tGraphicFactory gFac = new ImageFactory_PNG();\n\t\tGraphicBuilder gBuilder = new GraphicBuilder(inputRep, gFac, errorRep);\n\t\tBufferedImage image = gBuilder.buildImage(resolutionX, outputFileName);\n\t\timage = trim(image);\n\n\t\t// Writing image now:\n\n\t\t// Get all possible Image Writers that are actually available for the\n\t\t// type PNG\n\t\tIterator<ImageWriter> imageWriters = ImageIO.getImageWritersBySuffix(\"PNG\");\n\n\t\t// Ok, we need the output file of course\n\t\tFile file = new File(outputFileName);\n\t\t\n\t\t// select the first found Writer\n\t\tImageWriter imageWriter = (ImageWriter) imageWriters.next();\n\n\t\t// Now we define the output stream\n\t\ttry (ImageOutputStream ios = ImageIO.createImageOutputStream(file)) {\n\t\t\timageWriter.setOutput(ios);\n\n\t\t\t// Here we add the Listener which reports to the logger, so we can\n\t\t\t// see\n\t\t\t// the progress\n\t\t\timageWriter.addIIOWriteProgressListener(new GraphicBuilderImageWriteListener());\n\n\t\t\t// Now start writing the image\n\t\t\timageWriter.write(image);\n\t\t}\n\n\t\t// delete errorLog and output_file_temp\n\t\tString errorLog = OUTPUT_FILE_TEMP.replace(\".xml\", \".graphic_errors.xml\");\n\t\tFile tempErrorLogFile = new File(errorLog);\n\t\ttempErrorLogFile.delete();\n\n\t\txmlFile.delete();\n\n\t}",
"public XONImageMaker() {\r\n\t\tthis(true, null);\r\n\t}",
"private SVGGraphics2D getGenerator() throws Exception {\n\t\tDOMImplementation dom = GenericDOMImplementation.getDOMImplementation();\n\t\tDocument doc = dom.createDocument(null, \"svg\", null);\n\t\tSVGGraphics2D generator = new SVGGraphics2D(doc);\n\t\treturn generator;\n\t}",
"protected GraphicsEnvironment() {}",
"public Image() {\n\t\t\tthis(Color.white, 0);\n\t\t}",
"public SvgStyle() {\n\n\t\t\tfillPaint = new Paint();\n\t\t\tstrokePaint = new Paint();\n\t\t\tfillPaint.setStyle(Paint.Style.FILL);\n\t\t\tstrokePaint.setStyle(Paint.Style.STROKE);\n\t\t\tfillPaint.setColor(0xff000000);\n\t\t\tstrokePaint.setColor(0xff000000);\n\t\t\tmasterOpacity = 1;\n\t\t\tfillOpacity = 1;\n\t\t\tstrokeOpacity = 1;\n\t\t\tfillPaint.setAntiAlias(true);\n\t\t\tstrokePaint.setAntiAlias(true);\n\t\t\tfillPaint.setStrokeWidth(1f);\n\t\t\tstrokePaint.setStrokeWidth(1f);\n\t\t\tfillPaint.setTextAlign(Paint.Align.LEFT);\n\t\t\tstrokePaint.setTextAlign(Paint.Align.LEFT);\n\t\t\tfillPaint.setTextSize(0.02f);\n\t\t\tstrokePaint.setTextSize(0.02f);\n\t\t\tfillPaint.setTextScaleX(1f);\n\t\t\tstrokePaint.setTextScaleX(1f);\n\t\t\tfillPaint.setTypeface(Typeface.DEFAULT);\n\t\t\tstrokePaint.setTypeface(Typeface.DEFAULT);\n\t\t\thasFill = true;\n\t\t\thasStroke = false;\n\t\t}",
"public abstract Image gen();",
"IMG createIMG();",
"private void createImage()\n {\n GreenfootImage image = new GreenfootImage(width, height);\n setImage(\"Player.png\");\n }",
"public static GraphicsFactory init() {\n\t\ttry {\n\t\t\tGraphicsFactory theGraphicsFactory = (GraphicsFactory)EPackage.Registry.INSTANCE.getEFactory(GraphicsPackage.eNS_URI);\n\t\t\tif (theGraphicsFactory != null) {\n\t\t\t\treturn theGraphicsFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception) {\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new GraphicsFactory();\n\t}",
"protected static ImageIcon createImageIcon(String path) {\r\n if (path != null) {\r\n return new ImageIcon(path);\r\n } else {\r\n System.err.println(\"Couldn't find file: \" + path);\r\n return null;\r\n }\r\n }",
"public ImageCanvas() {\r\n super();\r\n }",
"public BufferedImage create() {\n checkDimensions();\n final BufferedImage image = createImage();\n getImagePainter().paint(image);\n return image;\n }",
"public void createImage(String pathImg) {\n\t\ttry {\n\t\t\tImageIO.write(this.bi, \"PNG\", new File(pathImg));\n\t\t\tSystem.out.println(\" Create image of the Graph : \" + this.nameGraph);\n\t\t} catch (Exception e) {\n\t\t\t// just send a mail\n\t\t\t// EmailSender.sendMailError(e, StaticGeneral.pathReport);\n\t\t}\n\t\tSystem.gc();\n\t\tSystem.runFinalization();\n\t}",
"protected static Image getIcon(final String imagePath) {\r\n return new Image(DISPLAY, Thread.currentThread()\r\n .getContextClassLoader().getResourceAsStream(imagePath));\r\n }",
"public AnimationSVGView() {\n this.model = new BasicAnimationModel();\n this.out = new StringBuilder();\n this.speed = 1;\n }",
"public DrawingImages(String Path){\r\n\t\tpath = Path;\r\n\t\t\r\n\t\tBufferedImage image = null;\r\n try\r\n {\r\n image = ImageIO.read(new File(path));\r\n }\r\n catch (Exception e)\r\n {\r\n e.printStackTrace();\r\n System.exit(1);\r\n }\r\n ImageIcon imageIcon = new ImageIcon(image);\r\n JLabel jLabel = new JLabel();\r\n jLabel.setIcon(imageIcon);\r\n getContentPane().add(jLabel, BorderLayout.CENTER);\r\n \r\n setSize(new Dimension(400,400));\r\n setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\r\n\t\tsetVisible(true);\r\n\t\tpack();\r\n\t\tsetLocationRelativeTo(null);\r\n\t}",
"public RoadSign(int x, int y, String imageFileName) {\n super(x, y, imageFileName);\n }",
"private ImageLoader() {}",
"private static ImageResource initImageResource() {\n\t\tImageResource imageResource = new ImageResource(Configuration.SUPERVISOR_LOGGER);\n\t\t\n\t\timageResource.addResource(ImageTypeAWMS.VERTICAL_BAR.name(), imagePath + \"blue_vertical_bar.png\");\n\t\timageResource.addResource(ImageTypeAWMS.HORIZONTAL_BAR.name(), imagePath + \"blue_horizontal_bar.png\");\n\t\timageResource.addResource(ImageTypeAWMS.WELCOME.name(), imagePath + \"welcome.png\");\n\t\t\n\t\t\n\t\treturn imageResource;\n\t}",
"public SvgGraphics(int numOfVertices, int scale){\n\t\t//Set the scale\n\t\tthis.scale = scale;\n\t\t\n\t\t//Get the size of the graph (from the paper 2*n-4 x n-2)\n\t\tint xSize = (2*numOfVertices - 4);\n\t\tint ySize = (numOfVertices - 2);\n\t\t\n\t\t//Set the starting x and y coordinates (in pixels).\n\t\t//The r just moves the graph up and over so that the bottom nodes\n\t\t//are fully displayed.\n\t\tint startx = r;\n\t\tint starty = (scale*ySize) + r;\n\t\t\n\t\t//Set the initial xml format for SVG\n\t\t//Also rotate the picture and move to a place that can be viewed\n\t\toutput = \"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\n\" +\n\t\t\t\t\"<!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 1.1//EN\\\" \" +\n\t\t\t\t\"\\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\\">\\n\\n\" +\n\t\t\t\t\"<svg width=\\\"100%\\\" height=\\\"100%\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n\\n\" +\n\t\t\t\t\"<g transform=\\\"matrix(1, 0, 0, -1, \" + startx + \", \" + starty +\")\\\">\\n\" +\n\t\t\t\t\"<g font-family=\\\"Verdana\\\" font-size=\\\"8\\\" >\\n\\n\";\n\t}",
"public ImageWriterSVG(String format)\n\t{\n\t\tif (!(\"svg\".equals(format) || \"svgz\".equals(format)))\n\t\t{\n\t\t\tthrow new IllegalArgumentException(\"format \" + format + \" is not accepted by this ImageWriter\");\n\t\t}\n\t\t\n\t\tacceptedFormat = format;\n\t}",
"public void setSVG(SVG mysvg)\r\n {\r\n if (mysvg == null)\r\n throw new IllegalArgumentException(\"Null value passed to setSVG()\");\r\n\r\n setSoftwareLayerType();\r\n setImageDrawable(new PictureDrawable(mysvg.renderToPicture()));\r\n mSvg = mysvg;\r\n mRenderer = getNewRenderer(mSvg);\r\n }",
"public Image(String path) {\n this.south = loadImage(path + \"-South\" + \".png\");\n this.north = loadImage(path + \"-North\" + \".png\");\n this.west = loadImage(path + \"-West\" + \".png\");\n this.east = loadImage(path + \"-East\" + \".png\");\n\n currentImage = north;\n }",
"private void initScene() {\n myStringBuilder.append(\"<svg width=\\\"\" + width + \"\\\" height=\\\"\" + height +\n \"\\\" version=\\\"1.1\\\"\\n\" + \" xmlns=\\\"http://www.w3.org/2000/svg\\\">\");\n }",
"public mapaSVG(int x, int y) {\n this.x = x;\n this.y = y;\n imprime();\n }",
"public\n XImageEditor() \n {\n super(\"XImage\", new VersionID(\"2.2.1\"), \"Temerity\",\n\t \"The Radiance HDR image viewer.\", \n\t \"ximage\"); \n\n addSupport(OsType.MacOS);\n addSupport(OsType.Windows);\n }",
"public ImageGraphics createGraphics(String image, float width, float height) {\n\t\tImageGraphics imageGraphics = new ImageGraphics(image, height, width);\n\t\timageGraphics.setParent(entity);\n\t\treturn imageGraphics;\n\t}",
"public GraphicLayer() {\r\n super();\r\n }",
"public Image createImage() {\n if (source == null) {\n source = new MemoryImageSource(width, height, cModel, pixels, 0, width);\n source.setAnimated(true);\n }\n Image img = Toolkit.getDefaultToolkit().createImage(source);\n return img;\n }",
"private void loadShipImage() {\r\n\t\tshipImageView = Ship.getImage();\r\n\t\tshipImageView.setX(ship.getCurrentLocation().x * scalingFactor);\r\n\t\tshipImageView.setY(ship.getCurrentLocation().y * scalingFactor);\r\n\r\n\t\troot.getChildren().add(shipImageView);\r\n\r\n\t}",
"public SvgEntityReference(DxfConverter dxfc)\r\n\t{\r\n\t\tsuper(dxfc);\r\n\t\tsetType(\"g\");\r\n\t\tsvgUtility = DxfConverterRef.getSvgUtil();\r\n\t\tvirtualDxfPoint = new Point(DxfConverterRef);\r\n\t}",
"public AbstractIOImage(String filePath) {\n super(filePath);\n }",
"public SpriteBuilder(Image image) {\r\n if (image == null) {\r\n throw new IllegalArgumentException(\"The image can't be null!!\");\r\n }\r\n this.imageView = new ImageView(image);\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }",
"public static ImageFactory init()\n\t{\n\t\ttry\n\t\t{\n\t\t\tImageFactory theImageFactory = (ImageFactory)EPackage.Registry.INSTANCE.getEFactory(ImagePackage.eNS_URI);\n\t\t\tif (theImageFactory != null)\n\t\t\t{\n\t\t\t\treturn theImageFactory;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception exception)\n\t\t{\n\t\t\tEcorePlugin.INSTANCE.log(exception);\n\t\t}\n\t\treturn new ImageFactoryImpl();\n\t}",
"public void openImage() {\n InputStream f = Controller.class.getResourceAsStream(\"route.png\");\n img = new Image(f, mapImage.getFitWidth(), mapImage.getFitHeight(), false, true);\n h = (int) img.getHeight();\n w = (int) img.getWidth();\n pathNodes = new GraphNodeAL[h * w];\n mapImage.setImage(img);\n //makeGrayscale();\n }",
"public SVGBuilder readFromInputStream(InputStream svgData) {\n this.data = svgData;\n return this;\n }",
"public ImageConverter() {\n this.source = new Mat();\n this.convertedImage = new Mat();\n }",
"private void initImage() {\n this.image = (BufferedImage)this.createImage(DisplayPanel.COLS, DisplayPanel.ROWS);\n this.r.setRect(0, 0, DisplayPanel.ROWS, DisplayPanel.COLS);\n this.paint = new TexturePaint(this.image,\n this.r);\n }",
"public EasyAnimatorSVGViewImpl(Appendable output, int width, int height) throws\n IllegalArgumentException {\n super(output);\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\"Width and height have to be greater than 0.\");\n }\n this.myStringBuilder = new StringBuilder(); // StringBuilder that gathers all input from model\n // and converts it to svg code as a String.\n this.height = height;\n this.width = width;\n this.initScene();\n }",
"public ImageContent() {\n }",
"public Scania(double x, double y) {\n super(2, Color.WHITE, 300, \"Scania\", x, y);\n try{icon = ImageIO.read(DrawPanel.class.getResourceAsStream(\"/pics/Scania.jpg\"));\n }catch (IOException ex)\n {\n ex.printStackTrace();\n icon = null;\n }\n }",
"public NewShape() {\r\n\t\tsuper();\r\n\t}",
"public IImage createImage(IImage source) {\n return null;\r\n }",
"@Override\n\tpublic void init() {\n\t\tthis.image = Helper.getImageFromAssets(AssetConstants.IMG_ROAD_NORMAL);\n\t}",
"private Images() {\n \n imgView = new ImageIcon(this,\"images/View\");\n\n imgUndo = new ImageIcon(this,\"images/Undo\");\n imgRedo = new ImageIcon(this,\"images/Redo\");\n \n imgCut = new ImageIcon(this,\"images/Cut\");\n imgCopy = new ImageIcon(this,\"images/Copy\");\n imgPaste = new ImageIcon(this,\"images/Paste\");\n \n imgAdd = new ImageIcon(this,\"images/Add\");\n \n imgNew = new ImageIcon(this,\"images/New\");\n imgDel = new ImageIcon(this,\"images/Delete\");\n \n imgShare = new ImageIcon(this,\"images/Share\");\n }",
"public Pixel() {\r\n\t\t}",
"public ImageFile(BufferedImage img) throws ImageException{\r\n\tloadImage(img);\r\n}",
"ElementImage createElementImage();",
"private void createImageFiles() {\n\t\tswitchIconClosed = Icon.createImageIcon(\"/images/events/switchImageClosed.png\");\n\t\tswitchIconOpen = Icon.createImageIcon(\"/images/events/switchImageOpen.png\");\n\t\tswitchIconEmpty = Icon.createImageIcon(\"/images/events/switchImageEmpty.png\");\n\t\tswitchIconOff = Icon.createImageIcon(\"/images/events/switchImageOff.png\");\n\t\tswitchIconOn = Icon.createImageIcon(\"/images/events/switchImageOn.png\");\n\t\tleverIconClean = Icon.createImageIcon(\"/images/events/leverImageClean.png\");\n\t\tleverIconRusty = Icon.createImageIcon(\"/images/events/leverImageRusty.png\");\n\t\tleverIconOn = Icon.createImageIcon(\"/images/events/leverImageOn.png\");\n\t}",
"public PgmImage() {\r\n int[][] defaultPixels = {{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}};\r\n pixels = new int[defaultPixels.length][defaultPixels[0].length];\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[0].length; ++col) {\r\n pixels[row][col] = (int) (defaultPixels[row][col] * 255.0 / 12);\r\n }\r\n }\r\n pix2img();\r\n }",
"public GeometricObject() {\n dateCreated = new java.util.Date();\n }",
"public Mesita()\r\n {\r\n super(\"mesa.png\"); \r\n }",
"protected abstract SVGException createSVGException(short type, String key, Object[] args);",
"public SpriteBuilder(ImageView imageView) {\r\n if (imageView == null) {\r\n throw new IllegalArgumentException(\"The image view can't be null!!\");\r\n }\r\n this.imageView = imageView;\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }",
"public ImageProcessor(Pic a) {\n image = a;\n }",
"public ImagePane() {\r\n\t\tsuper();\r\n\t}",
"public Element(int x, int y, int width, int height, int seilx, int seily, double scale, double xscale, double yscale, String iconpath,\n\t\t\tAufzugschacht aufzugschacht) {\n\t\tsetSize(width, height);\n\t\tsetLocation(x, y);\n\t\tthis.aufzugschacht = aufzugschacht;\n\t\tthis.iconPath = iconpath;\n\t\tif (iconpath != null) {\n\t\t\timageIcon = new ImageIcon(Helper.getFileURL(iconpath));\n\t\t}\n\t\tthis.scale = scale;\n\t\tthis.xscale = xscale;\n\t\tthis.yscale = yscale;\n\t\txRel = (int) ((double) x / xscale);\n\t\tyRel = (int) ((double) y / yscale);\n\t\twidthRel = (int) ((double) width / scale);\n\t\theightRel = (int) ((double) height / scale);\n\t\tseilxRel = (int) ((double) seilx / xscale);\n\t\tseilyRel = (int) ((double) seily / yscale);\n\t\tinitListener();\n\t}",
"public Graphics create()\r\n\t{\r\n\t\t// System.out.println(\"create\");\r\n\t\treturn null;\r\n\t}",
"public Picture(BufferedImage image)\n {\n super(image);\n }",
"public Picture(BufferedImage image)\n {\n super(image);\n }",
"private void processSvg(final InputStream data) throws IOException {\n final File tmpFile = writeToTmpFile(data);\n log.debug(\"Stored uploaded image in temporary file {}\", tmpFile);\n\n // by default, store SVG data as-is for all variants: the browser will do the real scaling\n scaledData = new AutoDeletingTmpFileInputStream(tmpFile);\n\n // by default, use the bounding box as scaled width and height\n scaledWidth = width;\n scaledHeight = height;\n\n if (!isOriginalVariant()) {\n try {\n scaleSvg(tmpFile);\n } catch (ParserConfigurationException | SAXException e) {\n log.info(\"Could not read dimensions of SVG image, using the bounding box dimensions instead\", e);\n }\n }\n }",
"public SVGView(String fileName) {\n super(fileName);\n this.textDescription = this.textualize();\n }",
"public GLimage(String path, int Px, int Py) throws IOException\n\t{\n\t\tthis.x = Px;\n\t\tthis.y = Py;\n\t\tthis.path = path;\n\t\tthis.tag = \"default\";\n\t\tinit();\n\t}",
"private DuakIcons()\r\n {\r\n }",
"private ImageMappings() {}",
"private void init() {\n\n /*image = new BufferedImage(\n WIDTH, HEIGHT,\n BufferedImage.TYPE_INT_RGB//OR BufferedImage.TYPE_INT_ARGB\n );*/\n initImage();\n \n g = (Graphics2D) image.getGraphics();\n\n running = true;\n\n initGSM();\n \n gsm.setAttribute(\"WIDTH\", WIDTH);\n gsm.setAttribute(\"HEIGHT\", HEIGHT);\n gsm.setAttribute(\"CAMERA_X1\", 0);\n gsm.setAttribute(\"CAMERA_Y1\", 0);\n gsm.setAttribute(\"WORLD_X1\", 0);\n gsm.setAttribute(\"WORLD_Y1\", 0);\n\n }",
"public Image getImagen() {\n\t\tRectangle rootFigureBounds = this.getBounds();\n\t\tGC figureCanvasGC = new GC(this.canvas);\n\n\t\tImage image = new Image(this.canvas.getDisplay(), rootFigureBounds.width,\n\t\t\t\trootFigureBounds.height);\n\t\tGC imageGC = new GC(image);\n\n\t\timageGC.setBackground(figureCanvasGC.getBackground());\n\t\timageGC.setForeground(figureCanvasGC.getForeground());\n\t\timageGC.setFont(figureCanvasGC.getFont());\n\t\timageGC.setLineStyle(figureCanvasGC.getLineStyle());\n\t\timageGC.setLineWidth(figureCanvasGC.getLineWidth());\n\t\t// imageGC.setXORMode(figureCanvasGC.getXORMode());\n\n\t\tGraphics imgGraphics = new SWTGraphics(imageGC);\n\t\tthis.paint(imgGraphics);\n\n\t\treturn image;\n\t}",
"protected GeometricObject() \n\t{\n\t\tdateCreated = new java.util.Date();\n\t}",
"public void setup() {\n\t\tthis.image = new BufferedImage(maxXPos, maxYPos, BufferedImage.TYPE_4BYTE_ABGR);\n\t\tthis.graphics = getImage().createGraphics();\n\t}",
"protected abstract Image loadImage();",
"private ImageIcon createIcon(String path) {\r\n\t\tInputStream is = this.getClass().getResourceAsStream(path);\r\n\t\tif (is == null) {\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\tByteArrayOutputStream buffer = new ByteArrayOutputStream();\r\n\t\t\r\n\t\tint n;\r\n\t\tbyte[] data = new byte[4096];\r\n\t\ttry {\r\n\t\t\twhile ((n = is.read(data, 0, data.length)) != -1) {\r\n\t\t\t\tbuffer.write(data, 0, n);\r\n\t\t\t}\r\n\t\t\tis.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\tthrow new RuntimeException();\r\n\t\t}\r\n\t\t\r\n\t\treturn new ImageIcon(buffer.toByteArray());\r\n\t\t\r\n\t}",
"public FlyImage(String path, BufferedImage image)\n\t{\n\t\t//TODO add in validation\n\t\tthis.imagePath = path;\n\t\tthis.image = image;\n\t}",
"public Image creerImage() {\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n\t\ttry {\r\n\t\t\t// Transfert de l image dans le buffer de bytes\r\n\t\t\tImageIO.write(monImage.getImage(), \"png\", baos);\r\n\t\t\t\r\n\t\t\t// Creation d une instance d Image iText\r\n\t\t\tImage image = Image.getInstance(baos.toByteArray());\r\n\t\t\treturn image;\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} catch (BadElementException 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 null;\r\n\t}"
] | [
"0.68422204",
"0.6276056",
"0.6222674",
"0.61644727",
"0.6149587",
"0.61161757",
"0.60981596",
"0.60664463",
"0.60661054",
"0.60582125",
"0.596417",
"0.59525067",
"0.5898156",
"0.5861164",
"0.5825563",
"0.58007985",
"0.57914335",
"0.5791065",
"0.57889044",
"0.57791376",
"0.5776919",
"0.5752233",
"0.5747102",
"0.5728923",
"0.57033736",
"0.5652947",
"0.56442887",
"0.56378406",
"0.56313604",
"0.5624469",
"0.55755895",
"0.5561113",
"0.5556656",
"0.5538915",
"0.55374116",
"0.55300933",
"0.5517898",
"0.5516068",
"0.5503566",
"0.5470152",
"0.5462697",
"0.5462045",
"0.54456186",
"0.5435397",
"0.54314697",
"0.54218286",
"0.5402516",
"0.5400548",
"0.5399687",
"0.5399137",
"0.53919053",
"0.5369384",
"0.5363517",
"0.53415775",
"0.53367805",
"0.53071415",
"0.53002703",
"0.5298183",
"0.52953595",
"0.52734333",
"0.52650267",
"0.5253516",
"0.52521867",
"0.52482986",
"0.52467746",
"0.5231562",
"0.5229526",
"0.5229128",
"0.5224043",
"0.52237123",
"0.5215391",
"0.5204675",
"0.51982725",
"0.51972973",
"0.51955974",
"0.5178811",
"0.5174695",
"0.51717275",
"0.5160186",
"0.5158423",
"0.5157359",
"0.51551557",
"0.51413596",
"0.51349044",
"0.5134524",
"0.51341784",
"0.51341784",
"0.5117726",
"0.51073265",
"0.51061946",
"0.50995827",
"0.5096782",
"0.50938165",
"0.5093751",
"0.5093212",
"0.5080581",
"0.50799245",
"0.507892",
"0.50772005",
"0.5075134"
] | 0.65814024 | 1 |
Creates a new SVGImage. The image's initial viewport size is determined as described above. The initial user transform is set to identity which is the same state as after calling the resetTransform method. | public static SVGImage createImage(String svgURI) throws IOException {
ScalableImage scalableImage = null;
try {
scalableImage = ScalableImage.createImage(svgURI, null);
} catch (NullPointerException npe) {
throw new IllegalArgumentException(ERROR_NULL_URI);
}
return new SVGImage(scalableImage);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"public IImage createImage(IImage image, int x, int y, int width, int height, int transform) {\n return null;\r\n }",
"public static SVGImage createImage(InputStream is) throws IOException {\n ScalableImage scalableImage = ScalableImage.createImage(is, null);\n return new SVGImage(scalableImage);\n }",
"SVGImage(final ScalableImage scalableImage) {\n if (scalableImage == null) {\n throw new NullPointerException();\n }\n\n this.scalableImage = scalableImage;\n this.doc = (DocumentNode) ((javax.microedition.m2g.SVGImage) scalableImage).getDocument();\n this.svg = (SVG) doc.getDocumentElement();\n this.sg = ScalableGraphics.createInstance();\n }",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"public Builder clearImageByTransform() {\n if (imageByTransformBuilder_ == null) {\n imageByTransform_ = com.yahoo.xpathproto.TransformTestProtos.ContentImage.getDefaultInstance();\n onChanged();\n } else {\n imageByTransformBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x00001000);\n return this;\n }",
"public BufferedImage create() {\n checkDimensions();\n final BufferedImage image = createImage();\n getImagePainter().paint(image);\n return image;\n }",
"public Image createImage() {\n if (source == null) {\n source = new MemoryImageSource(width, height, cModel, pixels, 0, width);\n source.setAnimated(true);\n }\n Image img = Toolkit.getDefaultToolkit().createImage(source);\n return img;\n }",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(640, 600);\n\t}",
"private void processSvg(final InputStream data) throws IOException {\n final File tmpFile = writeToTmpFile(data);\n log.debug(\"Stored uploaded image in temporary file {}\", tmpFile);\n\n // by default, store SVG data as-is for all variants: the browser will do the real scaling\n scaledData = new AutoDeletingTmpFileInputStream(tmpFile);\n\n // by default, use the bounding box as scaled width and height\n scaledWidth = width;\n scaledHeight = height;\n\n if (!isOriginalVariant()) {\n try {\n scaleSvg(tmpFile);\n } catch (ParserConfigurationException | SAXException e) {\n log.info(\"Could not read dimensions of SVG image, using the bounding box dimensions instead\", e);\n }\n }\n }",
"private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }",
"public static Transform identity(){\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {0.0f, 0.0f, 1.0f, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"@Override\r\n\tpublic void makeTransform() {\n\r\n\t\tImgproc.GaussianBlur(src, dst, new Size(size, size),\r\n\t\t\t\tTransConstants.GAUSSIAN_SIGMA);\r\n\r\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(800, 600);\n\t}",
"public SVGModel() {\n \t\telementToModel = new HashMap<SVGElement, SVGElementModel>();\n \t\ttagNameToTagCount = new HashMap<String, Integer>();\n \t\tgrid = new Grid();\n \t}",
"private void createScene() {\r\n imageView.setFitWidth(400);\r\n imageView.setFitHeight(300);\r\n\r\n Scene scene = new Scene(rootScene(), 700, 600);\r\n\r\n primaryStage.setTitle(TITLE);\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n }",
"public abstract BufferedImage transform();",
"private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"@Nonnull\n private BufferedImage createImage() {\n return new BufferedImage(getWidth(), getHeight(), getImageType().getType());\n }",
"public AnimationSVGView() {\n this.model = new BasicAnimationModel();\n this.out = new StringBuilder();\n this.speed = 1;\n }",
"@Test\n public void testIdentity() throws TransformException {\n create(3, 0, 1, 2);\n assertIsIdentity(transform);\n assertParameterEquals(Affine.provider(3, 3, true).getParameters(), null);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = source.clone();\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"public SvgGraphics(int numOfVertices, int scale){\n\t\t//Set the scale\n\t\tthis.scale = scale;\n\t\t\n\t\t//Get the size of the graph (from the paper 2*n-4 x n-2)\n\t\tint xSize = (2*numOfVertices - 4);\n\t\tint ySize = (numOfVertices - 2);\n\t\t\n\t\t//Set the starting x and y coordinates (in pixels).\n\t\t//The r just moves the graph up and over so that the bottom nodes\n\t\t//are fully displayed.\n\t\tint startx = r;\n\t\tint starty = (scale*ySize) + r;\n\t\t\n\t\t//Set the initial xml format for SVG\n\t\t//Also rotate the picture and move to a place that can be viewed\n\t\toutput = \"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\n\" +\n\t\t\t\t\"<!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 1.1//EN\\\" \" +\n\t\t\t\t\"\\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\\">\\n\\n\" +\n\t\t\t\t\"<svg width=\\\"100%\\\" height=\\\"100%\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n\\n\" +\n\t\t\t\t\"<g transform=\\\"matrix(1, 0, 0, -1, \" + startx + \", \" + starty +\")\\\">\\n\" +\n\t\t\t\t\"<g font-family=\\\"Verdana\\\" font-size=\\\"8\\\" >\\n\\n\";\n\t}",
"void setInitialImageBoundsFillScreen() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\n\t\t\t\tboolean resize=false;\n\t\t\t\t\n\t\t\t\tint newWidth=mImageWidth;\n\t\t\t\tint newHeight=mImageHeight;\n\t\t\t\n\t\t\t\t// The setting of these max sizes is very arbitrary\n\t\t\t\t// Need to find a better way to determine max size\n\t\t\t\t// to avoid attempts too big a bitmap and throw OOM\n\t\t\t\tif (mMinWidth==-1) { \n\t\t\t\t\t// set minimums so that the largest\n\t\t\t\t\t// direction we always filled (no empty view space)\n\t\t\t\t\t// this maintains initial aspect ratio\n\t\t\t\t\tif (mViewWidth > mViewHeight) {\n\t\t\t\t\t\tmMinWidth = mViewWidth;\n\t\t\t\t\t\tmMinHeight = (int)(mMinWidth/mAspect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\t\t\tmMinWidth = (int)(mAspect*mViewHeight);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tmMaxWidth = (int)(mMinWidth * 1.5f);\n\t\t\t\t\tmMaxHeight = (int)(mMinHeight * 1.5f);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (newWidth < mMinWidth) {\n\t\t\t\t\tnewWidth = mMinWidth;\n\t\t\t\t\tnewHeight = (int) (((float) mMinWidth / mImageWidth) * mImageHeight);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\tif (newHeight < mMinHeight) {\n\t\t\t\t\tnewHeight = mMinHeight;\n\t\t\t\t\tnewWidth = (int) (((float) mMinHeight / mImageHeight) * mImageWidth);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\t\n\t\t\t\t// scale the bitmap\n\t\t\t\tif (resize) {\n\t\t\t\t\tscaleBitmap(newWidth, newHeight);\n\t\t\t\t} else {\n\t\t\t\t\tmExpandWidth=newWidth;\n\t\t\t\t\tmExpandHeight=newHeight;\t\t\t\t\t\n\t\t\t\t\tmResizeFactorX = ((float) newWidth / mImageWidth);\n\t\t\t\t\tmResizeFactorY = ((float) newHeight / mImageHeight);\n\t\t\t\t\tmRightBound = 0 - (mExpandWidth - mViewWidth);\n\t\t\t\t\tmBottomBound = 0 - (mExpandHeight - mViewHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private Image getScaledImage(Image image, float x, float y) {\n AffineTransform transform = new AffineTransform();\n transform.scale(x, y);\n transform.translate(\n (x-1) * image.getWidth(null) / 2,\n (y-1) * image.getHeight(null) / 2);\n\n // create a transparent (not translucent) image\n Image newImage = gc.createCompatibleImage(\n image.getWidth(null),\n image.getHeight(null),\n Transparency.BITMASK);\n\n // draw the transformed image\n Graphics2D g = (Graphics2D)newImage.getGraphics();\n g.drawImage(image, transform, null);\n g.dispose();\n\n return newImage;\n }",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"public final native Mat4 resetToIdentity() /*-{\n return $wnd.mat4.identity(this);\n }-*/;",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(600, 500);\n\t}",
"public ResultTransform() {\n super(((org.xms.g.utils.XBox) null));\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n this.setHInstance(new HImpl());\n } else {\n this.setGInstance(new GImpl());\n }\n wrapper = false;\n }",
"private void initScene() {\n myStringBuilder.append(\"<svg width=\\\"\" + width + \"\\\" height=\\\"\" + height +\n \"\\\" version=\\\"1.1\\\"\\n\" + \" xmlns=\\\"http://www.w3.org/2000/svg\\\">\");\n }",
"public void setTransform(Transform transform);",
"RenderedImage createScaledRendering(Long id, \n\t\t\t\t\tint w, \n\t\t\t\t\tint h, \n\t\t\t\t\tSerializableState hintsState) \n\tthrows RemoteException;",
"Image createImage();",
"public void scaleAffine(){\n //Get the monitors size.\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n transform = new AffineTransform();\n double width = screenSize.getWidth();\n double height = screenSize.getHeight();\n\n //Set up the scale amount for our Affinetransform\n double xscale = width / model.getBbox().getWidth();\n double yscale = height / model.getBbox().getHeight();\n\n double scale = max(xscale, yscale);\n\n adjustZoomLvl(scale);\n transform.translate(-model.getBbox().getMinX(), -model.getBbox().getMaxY());\n\n bounds = new CanvasBounds(getBounds(), transform);\n adjustZoomFactor();\n }",
"protected Bitmap getSVGImageForName(String name) throws IOException {\n String path = SVG_BASE_PATH + name + \".svg\";\n\n // create a shape document (load the SVG)\n PXShapeDocument document = PXSVGLoader.loadFromStream(getContext().getAssets().open(path));\n\n // grab root shape\n PXShapeGroup root = (PXShapeGroup) document.getShape();\n RectF bounds = root.getViewport();\n\n if (bounds == null || bounds.isEmpty()) {\n // use 100x100 if we didn't find a view port in the SVG file\n bounds = new RectF(0, 0, 100, 100);\n }\n\n // set size\n document.setBounds(bounds);\n // render to UIImage\n Drawable drawable = root.renderToImage(bounds, false);\n return ((BitmapDrawable) drawable).getBitmap();\n }",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"private void setupInitialImagePosition(float drawableWidth, float drawableHeight) {\n float cropRectWidth = mCropRect.width();\n float cropRectHeight = mCropRect.height();\n\n float widthScale = mCropRect.width() / drawableWidth;\n float heightScale = mCropRect.height() / drawableHeight;\n\n float initialMinScale = Math.max(widthScale, heightScale);\n\n float tw = (cropRectWidth - drawableWidth * initialMinScale) / 2.0f + mCropRect.left;\n float th = (cropRectHeight - drawableHeight * initialMinScale) / 2.0f + mCropRect.top;\n\n mCurrentImageMatrix.reset();\n mCurrentImageMatrix.postScale(initialMinScale, initialMinScale);\n mCurrentImageMatrix.postTranslate(tw, th);\n setImageMatrix(mCurrentImageMatrix);\n }",
"private BufferedImage scale(BufferedImage sourceImage) {\n GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();\n GraphicsDevice graphicsDevice = graphicsEnvironment.getDefaultScreenDevice();\n GraphicsConfiguration graphicsConfiguration = graphicsDevice.getDefaultConfiguration();\n BufferedImage scaledImage = graphicsConfiguration.createCompatibleImage(IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n Graphics2D newGraphicsImage = scaledImage.createGraphics();\n newGraphicsImage.setColor(Color.white);\n newGraphicsImage.fillRect(0, 0, IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n double xScale = (double) IMAGE_DIMENSION / sourceImage.getWidth();\n double yScale = (double) IMAGE_DIMENSION / sourceImage.getHeight();\n AffineTransform affineTransform = AffineTransform.getScaleInstance(xScale,yScale);\n newGraphicsImage.drawRenderedImage(sourceImage, affineTransform);\n newGraphicsImage.dispose();\n\n return scaledImage;\n }",
"public EasyAnimatorSVGViewImpl(Appendable output, int width, int height) throws\n IllegalArgumentException {\n super(output);\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\"Width and height have to be greater than 0.\");\n }\n this.myStringBuilder = new StringBuilder(); // StringBuilder that gathers all input from model\n // and converts it to svg code as a String.\n this.height = height;\n this.width = width;\n this.initScene();\n }",
"public void beginScaling() {\n xScale = 1.0f;\n yScale = 1.0f;\n }",
"private void loadShipImage() {\r\n\t\tshipImageView = Ship.getImage();\r\n\t\tshipImageView.setX(ship.getCurrentLocation().x * scalingFactor);\r\n\t\tshipImageView.setY(ship.getCurrentLocation().y * scalingFactor);\r\n\r\n\t\troot.getChildren().add(shipImageView);\r\n\r\n\t}",
"@Override\r\n\tprotected Point getInitialSize() {\r\n\t\treturn new Point(450, 300);\r\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(450, 300);\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(450, 300);\n\t}",
"private void createImageView() {\n /**\n * We use @{@link AdjustableImageView} so that we can have behaviour like setAdjustViewBounds(true)\n * for Android below API 18\n */\n viewsToBeInflated.add(new AdjustableImageView(getActivityContext()));\n }",
"@Override\r\n\tpublic View makeView() {\n\t\tImageView image = new ImageView(this);\r\n\t\t// cente会让居中显示并缩放\r\n\t\timage.setScaleType(ScaleType.FIT_CENTER);\r\n\t\treturn image;\r\n\t}",
"public SpriteBuilder(ImageView imageView) {\r\n if (imageView == null) {\r\n throw new IllegalArgumentException(\"The image view can't be null!!\");\r\n }\r\n this.imageView = imageView;\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }",
"TwoDShape5() {\n width = height = 0.0;\n }",
"@Override\r\n public Sprite build() {\r\n return new Sprite(imageView, totalNbrFrames, columns, offsetX, offsetY, widthFrame, heightFrame);\r\n }",
"private void updateBaseMatrix(Drawable d) {\n ImageView imageView = getImageView();\n if (null == imageView || null == d) {\n return;\n }\n\n final float viewWidth = getImageViewWidth(imageView);\n final float viewHeight = getImageViewHeight(imageView);\n final int drawableWidth = d.getIntrinsicWidth();\n final int drawableHeight = d.getIntrinsicHeight();\n\n mBaseMatrix.reset();\n\n final float widthScale = viewWidth / drawableWidth;\n final float heightScale = viewHeight / drawableHeight;\n\n if (mScaleType == ScaleType.CENTER) {\n mBaseMatrix.postTranslate((viewWidth - drawableWidth) / 2F,\n (viewHeight - drawableHeight) / 2F);\n\n } else if (mScaleType == ScaleType.CENTER_CROP) {\n float scale = Math.max(widthScale, heightScale);\n mBaseMatrix.postScale(scale, scale);\n mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F,\n (viewHeight - drawableHeight * scale) / 2F);\n\n } else if (mScaleType == ScaleType.CENTER_INSIDE) {\n float scale = Math.min(1.0f, Math.min(widthScale, heightScale));\n mBaseMatrix.postScale(scale, scale);\n mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F,\n (viewHeight - drawableHeight * scale) / 2F);\n\n } else {\n RectF mTempSrc = new RectF(0, 0, drawableWidth, drawableHeight);\n RectF mTempDst = new RectF(0, 0, viewWidth, viewHeight);\n\n switch (mScaleType) {\n case FIT_CENTER:\n mBaseMatrix\n .setRectToRect(mTempSrc, mTempDst, ScaleToFit.CENTER);\n break;\n\n case FIT_START:\n mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.START);\n break;\n\n case FIT_END:\n mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.END);\n break;\n\n case FIT_XY:\n mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.FILL);\n break;\n\n default:\n break;\n }\n }\n\n resetMatrix();\n }",
"@Override\n protected Point getInitialSize() {\n return new Point(450, 504);\n }",
"IMG createIMG();",
"public void setFreeAspectRatio() {\n setAspectRatio(-1.0);\n }",
"@Test(expected = UnsupportedOperationException.class)\n public void SVGViewTest3() {\n IView a = new SVGView(new AnimatorModelImpl(0, 0, 100, 100), \"toh-3.txt\", 10);\n a.makeVisible();\n }",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(450, 270);\n\t}",
"public RenderedImage createRendering(RenderContext renderContext) {\n/* 245 */ AffineTransform gn2dev, usr2dev = renderContext.getTransform();\n/* */ \n/* */ \n/* 248 */ if (usr2dev == null) {\n/* 249 */ usr2dev = new AffineTransform();\n/* 250 */ gn2dev = usr2dev;\n/* */ } else {\n/* 252 */ gn2dev = (AffineTransform)usr2dev.clone();\n/* */ } \n/* */ \n/* */ \n/* 256 */ AffineTransform gn2usr = this.node.getTransform();\n/* 257 */ if (gn2usr != null) {\n/* 258 */ gn2dev.concatenate(gn2usr);\n/* */ }\n/* */ \n/* 261 */ Rectangle2D bounds2D = getBounds2D();\n/* */ \n/* 263 */ if (this.cachedBounds != null && this.cachedGn2dev != null && this.cachedBounds.equals(bounds2D) && gn2dev.getScaleX() == this.cachedGn2dev.getScaleX() && gn2dev.getScaleY() == this.cachedGn2dev.getScaleY() && gn2dev.getShearX() == this.cachedGn2dev.getShearX() && gn2dev.getShearY() == this.cachedGn2dev.getShearY()) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 272 */ double deltaX = usr2dev.getTranslateX() - this.cachedUsr2dev.getTranslateX();\n/* */ \n/* 274 */ double deltaY = usr2dev.getTranslateY() - this.cachedUsr2dev.getTranslateY();\n/* */ \n/* */ \n/* */ \n/* */ \n/* 279 */ if (deltaX == 0.0D && deltaY == 0.0D)\n/* */ {\n/* 281 */ return (RenderedImage)this.cachedRed;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 286 */ if (deltaX == (int)deltaX && deltaY == (int)deltaY)\n/* */ {\n/* 288 */ return (RenderedImage)new TranslateRed(this.cachedRed, (int)Math.round(this.cachedRed.getMinX() + deltaX), (int)Math.round(this.cachedRed.getMinY() + deltaY));\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 301 */ if (bounds2D.getWidth() > 0.0D && bounds2D.getHeight() > 0.0D) {\n/* */ \n/* 303 */ this.cachedUsr2dev = (AffineTransform)usr2dev.clone();\n/* 304 */ this.cachedGn2dev = gn2dev;\n/* 305 */ this.cachedBounds = bounds2D;\n/* 306 */ this.cachedRed = (CachableRed)new GraphicsNodeRed8Bit(this.node, usr2dev, this.usePrimitivePaint, renderContext.getRenderingHints());\n/* */ \n/* */ \n/* 309 */ return (RenderedImage)this.cachedRed;\n/* */ } \n/* */ \n/* 312 */ this.cachedUsr2dev = null;\n/* 313 */ this.cachedGn2dev = null;\n/* 314 */ this.cachedBounds = null;\n/* 315 */ this.cachedRed = null;\n/* 316 */ return null;\n/* */ }",
"public BufferedImage getScaledImage ( float scale ) {\n\n int oldW = param.Parameters.IMAGEW;\n int oldH = param.Parameters.IMAGEH;\n\n param.Parameters.SCALE = scale;\n param.Parameters.IMAGEW = (int)((float)param.Parameters.IMAGEW * param.Parameters.SCALE);\n param.Parameters.IMAGEH = (int)((float)param.Parameters.IMAGEH * param.Parameters.SCALE);\n\n BufferedImage img =\n param.Parameters.PROBLEM.getData(param.Parameters.STATE, program, 0, 0);\n\n param.Parameters.SCALE = 1.0f;\n param.Parameters.IMAGEW = oldW;\n param.Parameters.IMAGEH = oldH;\n\n System.gc();\n\n return img;\n\n }",
"public void resetUserTransform() {\n workTransform.setTransform(null);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"public PgmImage() {\r\n int[][] defaultPixels = {{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}};\r\n pixels = new int[defaultPixels.length][defaultPixels[0].length];\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[0].length; ++col) {\r\n pixels[row][col] = (int) (defaultPixels[row][col] * 255.0 / 12);\r\n }\r\n }\r\n pix2img();\r\n }",
"private void applyWindowToViewportTransformation(Graphics2D g2,\n double left, double right, double bottom, double top,\n boolean preserveAspect) {\n int width = getWidth();\n int height = getHeight();\n if (preserveAspect) {\n double displayAspect = Math.abs((double) height / width);\n double requestedAspect = Math.abs((bottom - top) / (right - left));\n if (displayAspect > requestedAspect) {\n double excess = (bottom - top) * (displayAspect / requestedAspect - 1);\n bottom += excess / 2;\n top -= excess / 2;\n } else if (displayAspect < requestedAspect) {\n double excess = (right - left) * (requestedAspect / displayAspect - 1);\n right += excess / 2;\n left -= excess / 2;\n }\n }\n g2.scale(width / (right - left), height / (bottom - top));\n g2.translate(-left, -top);\n double pixelWidth = Math.abs((right - left) / width);\n double pixelHeight = Math.abs((bottom - top) / height);\n pixelSize = (float) Math.max(pixelWidth, pixelHeight);\n }",
"public SVGView(ReadAnimationModel r) {\n if (r == null) {\n throw new IllegalArgumentException(\"model cannot be null\");\n }\n speed = 1000;\n model = Objects.requireNonNull(r);\n this.width = model.getBounds().getBoundWidth();\n this.height = model.getBounds().getBoundHeight();\n }",
"@Override\n protected Point getInitialSize() {\n return new Point(930, 614);\n }",
"public Transform(Transform transform){\n System.arraycopy(transform.matrix, 0, matrix, 0, 16); \n }",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"public Graphics2D createGraphics()\n {\n return this.image.createGraphics();\n }",
"private void rebuildImageIfNeeded() {\n Rectangle origRect = this.getBounds(); //g.getClipBounds();\n// System.out.println(\"origRect \" + origRect.x + \" \" + origRect.y + \" \" + origRect.width + \" \" + origRect.height);\n\n backBuffer = createImage(origRect.width, origRect.height);\n// System.out.println(\"Image w \" + backBuffer.getWidth(null) + \", h\" + backBuffer.getHeight(null));\n Graphics backGC = backBuffer.getGraphics();\n backGC.setColor(Color.BLACK);\n backGC.fillRect(0, 0, origRect.width, origRect.height);\n// updateCSysEntList(combinedRotatingMatrix);\n paintWorld(backGC);\n }",
"public SVG build() throws SVGParseException {\n if (data == null) {\n throw new IllegalStateException(\"SVG input not specified. Call one of the readFrom...() methods first.\");\n }\n SVGParser parser = new SVGParser();\n SVG svg = parser.parse(data);\n svg.setFillColorFilter(fillColorFilter);\n svg.setStrokeColorFilter(strokeColorFilter);\n return svg;\n }",
"@Override\r\n\tprotected Point getInitialSize() {\r\n\t\treturn new Point(320, 204);\r\n\t}",
"private ImageView setStartMenuImage() {\r\n Image image = null;\r\n try {\r\n image = new Image(new FileInputStream(\"images/icon1.png\"));\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n ImageView imageView = new ImageView(image);\r\n imageView.setFitHeight(HEIGHT / 4);\r\n imageView.setPreserveRatio(true);\r\n return imageView;\r\n }",
"public Viewer() {\r\n\t\tzoom = DEFAULT_ZOOM;\r\n\t\tisWireframe = false;\r\n\t\tisAxes = true;\r\n\t\tnextRotationAngle = 0;\r\n\t\tnextRotationAxis = null;\r\n\t\trotationMatrix = null;\r\n\t\tscreenWidth = 0;\r\n\t\tscreenHeight = 0;\r\n\t}",
"public void render() { image.drawFromTopLeft(getX(), getY()); }",
"public CoordinateSystem() {\r\n\t\torigin = new GuiPoint(0, 0);\r\n\t\tzoomFactor = 1f;\r\n\t}",
"public native void setXResolution(double xRes) throws MagickException;",
"public Image()\r\n {\r\n super();\r\n setBounds( 0, 0, 10, 10 );\r\n }",
"public Image createScaledImage (double scale, int interpolType)\r\n {\r\n\tImageScaler scaler = new ImageScaler(scale, interpolType);\r\n\treturn (HSIImage)scaler.filter(this);\r\n }",
"void setInitialImageBoundsFitImage() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\t\t\t\n\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\tmMinWidth = mViewWidth; \n\t\t\t\tmMaxWidth = (int)(mMinWidth * mMaxSize);\n\t\t\t\tmMaxHeight = (int)(mMinHeight * mMaxSize);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\tscaleBitmap(mMinWidth, mMinHeight);\n\t\t }\n\t\t}\n\t}",
"public void setOriginalAspectRatioFixed() {\n if (!isImageLoaded()) {\n // if no image was loaded set the aspect ratio to free\n setAspectRatio(-1.0);\n return;\n }\n Rect imageRect = getImageRect();\n setAspectRatio((double) (imageRect.width()) / (double) (imageRect.height()));\n }",
"public void convert() throws Exception {\r\n\t\tString svg_URI_input = Paths.get(\"library.svg\").toUri().toURL().toString();\r\n\t\tTranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);\r\n\t\tthis.setNewImage(generate(20));// Define the name of the file\r\n\t\ttry (OutputStream png_ostream = new FileOutputStream(newImage)) {\r\n\t\t\tTranscoderOutput output_png_image = new TranscoderOutput(png_ostream);\r\n\r\n\t\t\tPNGTranscoder my_converter = new PNGTranscoder();\r\n\t\t\tmy_converter.transcode(input_svg_image, output_png_image);\r\n\r\n\t\t\tpng_ostream.flush();\r\n\t\t\tpng_ostream.close();\r\n\t\t}\r\n\r\n\t}",
"public String toSVG() {\n\n StringBuilder toReturn = new StringBuilder();\n toReturn.append(\"<svg width=\" + \"\\\"\" + Integer.toString(this.width)\n + \"\\\"\" + \" height=\" + \"\\\"\" + Integer.toString(this.height)\n + \"\\\"\" + \" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n\"); // add website\n String tag;\n for (String s : model.getIDSet()) {\n\n IShape sh = model.currentShape(0, s);\n if (sh.isRectangle()) {\n toReturn.append(\"<rect id=\" + \"\\\"\" + s + \"\\\"\" + \" \");\n tag = \"</rect>\";\n toReturn.append(\"x=\\\"\" + sh.getLocation().getX() + \"\\\" y=\\\"\"\n + sh.getLocation().getY() + \"\\\" width=\\\"\" + sh.getWidth() + \"\\\" height=\\\"\"\n + sh.getHeight() + \"\\\" fill=\\\"rgb(\" + sh.getColor().getRedInt() + \",\" +\n sh.getColor().getGreenInt() + \",\"\n + sh.getColor().getBlueInt() + \")\\\" visibility=\\\"visible\\\" >\\n\");\n } else {\n toReturn.append(\"<ellipse id=\" + \"\\\"\" + s + \"\\\"\" + \" \");\n toReturn.append(\"cx=\\\"\" + sh.getLocation().getX() + \"\\\" cy=\\\"\" + sh.getLocation().getY()\n + \"\\\" rx=\\\"\" + sh.getWidth() + \"\\\" ry=\\\"\" + sh.getHeight() + \"\\\" fill=\\\"rgb(\"\n + sh.getColor().getRedInt() + \",\" + sh.getColor().getGreenInt() + \",\"\n + sh.getColor().getBlueInt() + \")\\\" visibility=\\\"visible\\\" >\\n\");\n tag = \"</ellipse>\";\n }\n\n toReturn.append(svgColors(s));\n\n toReturn.append(svgSizes(s));\n\n toReturn.append(svgMoves(s));\n\n toReturn.append(tag + \"\\n\");\n\n }\n toReturn.append(\"</svg>\");\n return toReturn.toString();\n }",
"private ImageView createImageView(final File imageFile) {\n\n ImageView imageView = null;\n try {\n final Image image = new Image(new FileInputStream(imageFile), 150, 0, true,\n true);\n imageView = new ImageView(image);\n imageView.setFitWidth(150);\n imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {\n\n @Override\n public void handle(MouseEvent mouseEvent) {\n\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\n\n if(mouseEvent.getClickCount() == 2){\n try {\n BorderPane borderPane = new BorderPane();\n ImageView imageView = new ImageView();\n Image image = new Image(new FileInputStream(imageFile));\n imageView.setImage(image);\n imageView.setStyle(\"-fx-background-color: BLACK\");\n imageView.setFitHeight(window1Stage.getHeight() - 10);\n imageView.setPreserveRatio(true);\n imageView.setSmooth(true);\n imageView.setCache(true);\n borderPane.setCenter(imageView);\n borderPane.setStyle(\"-fx-background-color: BLACK\");\n Stage newStage = new Stage();\n newStage.setWidth(window1Stage.getWidth());\n newStage.setHeight(window1Stage.getHeight());\n newStage.setTitle(imageFile.getName());\n Scene scene = new Scene(borderPane, Color.BLACK);\n newStage.setScene(scene);\n newStage.show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n }\n }\n });\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n }\n return imageView;\n }",
"private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }",
"public Transform() {\n setIdentity();\n }",
"public static Transform newScale(float sx, float sy, float sz){\n return new Transform(new float[][]{\n {sx, 0.0f, 0.0f, 0.0f},\n {0.0f, sy, 0.0f, 0.0f},\n {0.0f, 0.0f, sz, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n\n });\n }",
"void ship_setup() {\n ship = new Ship(level);\n ship_image_view = new ImageView(ship_image);\n ship_image_view.setX(ship.x_position);\n ship_image_view.setY(ship.y_position);\n ship_image_view.setFitWidth(Ship.SHIP_WIDTH);\n ship_image_view.setFitHeight(Ship.SHIP_HEIGHT);\n game_pane.getChildren().add(ship_image_view);\n }",
"@Override\n\tpublic void resize(int width, int height) {\n\t\tcreate();\n\t}",
"private Image getScaledImage(Image sourceImage)\n {\n //create storage for the new image\n BufferedImage resizedImage = new BufferedImage(50, 50,\n BufferedImage.TYPE_INT_ARGB);\n\n //create a graphic from the image\n Graphics2D g2 = resizedImage.createGraphics();\n\n //sets the rendering options\n g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,\n RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\n //copies the source image into the new image\n g2.drawImage(sourceImage, 0, 0, 50, 50, null);\n\n //clean up\n g2.dispose();\n\n //return 50 x 50 image\n return resizedImage;\n }",
"public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }",
"private void renderImage(double tx, double ty, BufferedImage img, int size, double rotation) {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"drawing Image @\" + tx + \",\" + ty);\n }\n \n AffineTransform temp = graphics.getTransform();\n AffineTransform markAT = new AffineTransform();\n Point2D mapCentre = new java.awt.geom.Point2D.Double(tx, ty);\n Point2D graphicCentre = new java.awt.geom.Point2D.Double();\n temp.transform(mapCentre, graphicCentre);\n markAT.translate(graphicCentre.getX(), graphicCentre.getY());\n \n double shearY = temp.getShearY();\n double scaleY = temp.getScaleY();\n \n double originalRotation = Math.atan(shearY / scaleY);\n \n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"originalRotation \" + originalRotation);\n }\n \n markAT.rotate(rotation - originalRotation);\n \n double unitSize = Math.max(img.getWidth(), img.getHeight());\n \n double drawSize = (double) size / unitSize;\n \n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"unitsize \" + unitSize + \" size = \" + size + \" -> scale \" + drawSize);\n }\n \n markAT.scale(drawSize, drawSize);\n graphics.setTransform(markAT);\n \n // we moved the origin to the centre of the image.\n graphics.drawImage(img, -img.getWidth() / 2, -img.getHeight() / 2, obs);\n \n graphics.setTransform(temp);\n \n return;\n }",
"public AxesTransform() {\n\n\t}",
"private BufferedImage user_space(BufferedImage image) {\n // create new_img with the attributes of image\n BufferedImage new_img = new BufferedImage(image.getWidth(),\n image.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n Graphics2D graphics = new_img.createGraphics();\n graphics.drawRenderedImage(image, null);\n graphics.dispose(); // release all allocated memory for this image\n return new_img;\n }",
"public Image() {\n\t\t\tthis(Color.white, 0);\n\t\t}",
"protected Point getInitialSize() {\n\t\t return new Point(700, 500);\n\t }",
"private void transformAndDraw(GraphicsContext gc, Image image, double x, double y) {\n\t\t\n\t\tgc.save(); // saves the current state on stack, including the current transform\n\n\t\t//draws image at the specified locations x,y with given heights and widths of image\n\t\tgc.drawImage(image, 0, 0, imgWidthOrig, imgHeightOrig, x, y, imgWidth, imgHeight);\n\n\t\t\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(590, 459);\n\t}",
"private void ScaleImage(){\n\t\tBufferedImage resizedImage = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2 = resizedImage.createGraphics();\n\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\tg2.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), null);\n\t\tg2.dispose();\n\t\tthis.image = resizedImage;\n\t}",
"int wkhtmltoimage_init(int use_graphics);",
"public Builder clearImagesByTransform() {\n if (imagesByTransformBuilder_ == null) {\n imagesByTransform_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00002000);\n onChanged();\n } else {\n imagesByTransformBuilder_.clear();\n }\n return this;\n }",
"public AffineTransform getInitialCtm(\n )\n {\n AffineTransform initialCtm;\n if(getScanner().getRenderContext() == null) // Device-independent.\n {\n initialCtm = new AffineTransform(); // Identity.\n }\n else // Device-dependent.\n {\n IContentContext contentContext = getScanner().getContentContext();\n Dimension2D canvasSize = getScanner().getCanvasSize();\n\n // Axes orientation.\n RotationEnum rotation = contentContext.getRotation();\n switch(rotation)\n {\n case Downward:\n initialCtm = new AffineTransform(1, 0, 0, -1, 0, canvasSize.getHeight());\n break;\n case Leftward:\n initialCtm = new AffineTransform(0, 1, 1, 0, 0, 0);\n break;\n case Upward:\n initialCtm = new AffineTransform(-1, 0, 0, 1, canvasSize.getWidth(), 0);\n break;\n case Rightward:\n initialCtm = new AffineTransform(0, -1, -1, 0, canvasSize.getWidth(), canvasSize.getHeight());\n break;\n default:\n throw new NotImplementedException();\n }\n\n // Scaling.\n Rectangle2D contentBox = contentContext.getBox();\n Dimension2D rotatedCanvasSize = rotation.transform(canvasSize);\n initialCtm.scale(\n rotatedCanvasSize.getWidth() / contentBox.getWidth(),\n rotatedCanvasSize.getHeight() / contentBox.getHeight()\n );\n\n // Origin alignment.\n initialCtm.translate(-contentBox.getMinX(), -contentBox.getMinY());\n }\n return initialCtm;\n }",
"public static void bgfx_set_view_transform(@NativeType(\"bgfx_view_id_t\") int _id, @Nullable @NativeType(\"void const *\") FloatBuffer _view, @Nullable @NativeType(\"void const *\") FloatBuffer _proj) {\n if (CHECKS) {\n checkSafe(_view, 64 >> 2);\n checkSafe(_proj, 64 >> 2);\n }\n nbgfx_set_view_transform((short)_id, memAddressSafe(_view), memAddressSafe(_proj));\n }",
"@Override\r\n\tprotected OsgiPlatform createPlatform() {\n\t\tOsgiPlatform osgiPlatform = super.createPlatform();\r\n\t\tosgiPlatform.getConfigurationProperties().setProperty(\"javax.xml.transform.TransformerFactory\", \"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl\");\r\n\t\treturn osgiPlatform;\r\n\t}"
] | [
"0.5719658",
"0.5614061",
"0.5563369",
"0.5150495",
"0.50856704",
"0.49362493",
"0.49043736",
"0.4879658",
"0.48418725",
"0.480547",
"0.4790694",
"0.47753134",
"0.47571033",
"0.46749282",
"0.46634588",
"0.46573716",
"0.4642405",
"0.46380356",
"0.46232203",
"0.46139163",
"0.45979124",
"0.45960632",
"0.45694262",
"0.45631373",
"0.45548695",
"0.45321512",
"0.45224747",
"0.45218703",
"0.45183867",
"0.45118135",
"0.447915",
"0.44779035",
"0.44680706",
"0.44653633",
"0.44421223",
"0.44318625",
"0.44300172",
"0.44192532",
"0.441719",
"0.44094718",
"0.43916738",
"0.43904835",
"0.4381253",
"0.4381253",
"0.4375805",
"0.4369743",
"0.43616882",
"0.43614894",
"0.43549",
"0.43357608",
"0.43337244",
"0.43313023",
"0.43277138",
"0.43241185",
"0.4322343",
"0.43221125",
"0.4320135",
"0.43187255",
"0.4312198",
"0.4305236",
"0.4302597",
"0.4293617",
"0.42935115",
"0.4291209",
"0.42871213",
"0.42866674",
"0.4282123",
"0.42598906",
"0.42560783",
"0.42521983",
"0.42507857",
"0.4246148",
"0.42316332",
"0.42304534",
"0.4226734",
"0.42158085",
"0.42138147",
"0.42133942",
"0.4203831",
"0.42030838",
"0.41972357",
"0.4191575",
"0.4189091",
"0.41859585",
"0.4182578",
"0.41822782",
"0.4181909",
"0.41762295",
"0.41629666",
"0.4157005",
"0.41539803",
"0.41498044",
"0.41416377",
"0.41381323",
"0.4137414",
"0.41327375",
"0.41257983",
"0.4113516",
"0.41093025",
"0.40998206"
] | 0.44013852 | 40 |
Creates a new SVGImage. The image's initial viewport size is determined as described above. The initial user transform is set to identity which is the same state as after calling the resetTransform method. | public static SVGImage createImage(InputStream is) throws IOException {
ScalableImage scalableImage = ScalableImage.createImage(is, null);
return new SVGImage(scalableImage);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"public IImage createImage(IImage image, int x, int y, int width, int height, int transform) {\n return null;\r\n }",
"SVGImage(final ScalableImage scalableImage) {\n if (scalableImage == null) {\n throw new NullPointerException();\n }\n\n this.scalableImage = scalableImage;\n this.doc = (DocumentNode) ((javax.microedition.m2g.SVGImage) scalableImage).getDocument();\n this.svg = (SVG) doc.getDocumentElement();\n this.sg = ScalableGraphics.createInstance();\n }",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"public Builder clearImageByTransform() {\n if (imageByTransformBuilder_ == null) {\n imageByTransform_ = com.yahoo.xpathproto.TransformTestProtos.ContentImage.getDefaultInstance();\n onChanged();\n } else {\n imageByTransformBuilder_.clear();\n }\n bitField0_ = (bitField0_ & ~0x00001000);\n return this;\n }",
"public BufferedImage create() {\n checkDimensions();\n final BufferedImage image = createImage();\n getImagePainter().paint(image);\n return image;\n }",
"public Image createImage() {\n if (source == null) {\n source = new MemoryImageSource(width, height, cModel, pixels, 0, width);\n source.setAnimated(true);\n }\n Image img = Toolkit.getDefaultToolkit().createImage(source);\n return img;\n }",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(640, 600);\n\t}",
"private void processSvg(final InputStream data) throws IOException {\n final File tmpFile = writeToTmpFile(data);\n log.debug(\"Stored uploaded image in temporary file {}\", tmpFile);\n\n // by default, store SVG data as-is for all variants: the browser will do the real scaling\n scaledData = new AutoDeletingTmpFileInputStream(tmpFile);\n\n // by default, use the bounding box as scaled width and height\n scaledWidth = width;\n scaledHeight = height;\n\n if (!isOriginalVariant()) {\n try {\n scaleSvg(tmpFile);\n } catch (ParserConfigurationException | SAXException e) {\n log.info(\"Could not read dimensions of SVG image, using the bounding box dimensions instead\", e);\n }\n }\n }",
"private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }",
"public static Transform identity(){\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {0.0f, 0.0f, 1.0f, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"@Override\r\n\tpublic void makeTransform() {\n\r\n\t\tImgproc.GaussianBlur(src, dst, new Size(size, size),\r\n\t\t\t\tTransConstants.GAUSSIAN_SIGMA);\r\n\r\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(800, 600);\n\t}",
"public SVGModel() {\n \t\telementToModel = new HashMap<SVGElement, SVGElementModel>();\n \t\ttagNameToTagCount = new HashMap<String, Integer>();\n \t\tgrid = new Grid();\n \t}",
"private void createScene() {\r\n imageView.setFitWidth(400);\r\n imageView.setFitHeight(300);\r\n\r\n Scene scene = new Scene(rootScene(), 700, 600);\r\n\r\n primaryStage.setTitle(TITLE);\r\n primaryStage.setScene(scene);\r\n primaryStage.show();\r\n }",
"public abstract BufferedImage transform();",
"private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"@Nonnull\n private BufferedImage createImage() {\n return new BufferedImage(getWidth(), getHeight(), getImageType().getType());\n }",
"public AnimationSVGView() {\n this.model = new BasicAnimationModel();\n this.out = new StringBuilder();\n this.speed = 1;\n }",
"@Test\n public void testIdentity() throws TransformException {\n create(3, 0, 1, 2);\n assertIsIdentity(transform);\n assertParameterEquals(Affine.provider(3, 3, true).getParameters(), null);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = source.clone();\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"public SvgGraphics(int numOfVertices, int scale){\n\t\t//Set the scale\n\t\tthis.scale = scale;\n\t\t\n\t\t//Get the size of the graph (from the paper 2*n-4 x n-2)\n\t\tint xSize = (2*numOfVertices - 4);\n\t\tint ySize = (numOfVertices - 2);\n\t\t\n\t\t//Set the starting x and y coordinates (in pixels).\n\t\t//The r just moves the graph up and over so that the bottom nodes\n\t\t//are fully displayed.\n\t\tint startx = r;\n\t\tint starty = (scale*ySize) + r;\n\t\t\n\t\t//Set the initial xml format for SVG\n\t\t//Also rotate the picture and move to a place that can be viewed\n\t\toutput = \"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\n\" +\n\t\t\t\t\"<!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 1.1//EN\\\" \" +\n\t\t\t\t\"\\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\\">\\n\\n\" +\n\t\t\t\t\"<svg width=\\\"100%\\\" height=\\\"100%\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n\\n\" +\n\t\t\t\t\"<g transform=\\\"matrix(1, 0, 0, -1, \" + startx + \", \" + starty +\")\\\">\\n\" +\n\t\t\t\t\"<g font-family=\\\"Verdana\\\" font-size=\\\"8\\\" >\\n\\n\";\n\t}",
"void setInitialImageBoundsFillScreen() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\n\t\t\t\tboolean resize=false;\n\t\t\t\t\n\t\t\t\tint newWidth=mImageWidth;\n\t\t\t\tint newHeight=mImageHeight;\n\t\t\t\n\t\t\t\t// The setting of these max sizes is very arbitrary\n\t\t\t\t// Need to find a better way to determine max size\n\t\t\t\t// to avoid attempts too big a bitmap and throw OOM\n\t\t\t\tif (mMinWidth==-1) { \n\t\t\t\t\t// set minimums so that the largest\n\t\t\t\t\t// direction we always filled (no empty view space)\n\t\t\t\t\t// this maintains initial aspect ratio\n\t\t\t\t\tif (mViewWidth > mViewHeight) {\n\t\t\t\t\t\tmMinWidth = mViewWidth;\n\t\t\t\t\t\tmMinHeight = (int)(mMinWidth/mAspect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\t\t\tmMinWidth = (int)(mAspect*mViewHeight);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tmMaxWidth = (int)(mMinWidth * 1.5f);\n\t\t\t\t\tmMaxHeight = (int)(mMinHeight * 1.5f);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (newWidth < mMinWidth) {\n\t\t\t\t\tnewWidth = mMinWidth;\n\t\t\t\t\tnewHeight = (int) (((float) mMinWidth / mImageWidth) * mImageHeight);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\tif (newHeight < mMinHeight) {\n\t\t\t\t\tnewHeight = mMinHeight;\n\t\t\t\t\tnewWidth = (int) (((float) mMinHeight / mImageHeight) * mImageWidth);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\t\n\t\t\t\t// scale the bitmap\n\t\t\t\tif (resize) {\n\t\t\t\t\tscaleBitmap(newWidth, newHeight);\n\t\t\t\t} else {\n\t\t\t\t\tmExpandWidth=newWidth;\n\t\t\t\t\tmExpandHeight=newHeight;\t\t\t\t\t\n\t\t\t\t\tmResizeFactorX = ((float) newWidth / mImageWidth);\n\t\t\t\t\tmResizeFactorY = ((float) newHeight / mImageHeight);\n\t\t\t\t\tmRightBound = 0 - (mExpandWidth - mViewWidth);\n\t\t\t\t\tmBottomBound = 0 - (mExpandHeight - mViewHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private Image getScaledImage(Image image, float x, float y) {\n AffineTransform transform = new AffineTransform();\n transform.scale(x, y);\n transform.translate(\n (x-1) * image.getWidth(null) / 2,\n (y-1) * image.getHeight(null) / 2);\n\n // create a transparent (not translucent) image\n Image newImage = gc.createCompatibleImage(\n image.getWidth(null),\n image.getHeight(null),\n Transparency.BITMASK);\n\n // draw the transformed image\n Graphics2D g = (Graphics2D)newImage.getGraphics();\n g.drawImage(image, transform, null);\n g.dispose();\n\n return newImage;\n }",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"public final native Mat4 resetToIdentity() /*-{\n return $wnd.mat4.identity(this);\n }-*/;",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(600, 500);\n\t}",
"public ResultTransform() {\n super(((org.xms.g.utils.XBox) null));\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n this.setHInstance(new HImpl());\n } else {\n this.setGInstance(new GImpl());\n }\n wrapper = false;\n }",
"private void initScene() {\n myStringBuilder.append(\"<svg width=\\\"\" + width + \"\\\" height=\\\"\" + height +\n \"\\\" version=\\\"1.1\\\"\\n\" + \" xmlns=\\\"http://www.w3.org/2000/svg\\\">\");\n }",
"RenderedImage createScaledRendering(Long id, \n\t\t\t\t\tint w, \n\t\t\t\t\tint h, \n\t\t\t\t\tSerializableState hintsState) \n\tthrows RemoteException;",
"public void setTransform(Transform transform);",
"Image createImage();",
"public void scaleAffine(){\n //Get the monitors size.\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n transform = new AffineTransform();\n double width = screenSize.getWidth();\n double height = screenSize.getHeight();\n\n //Set up the scale amount for our Affinetransform\n double xscale = width / model.getBbox().getWidth();\n double yscale = height / model.getBbox().getHeight();\n\n double scale = max(xscale, yscale);\n\n adjustZoomLvl(scale);\n transform.translate(-model.getBbox().getMinX(), -model.getBbox().getMaxY());\n\n bounds = new CanvasBounds(getBounds(), transform);\n adjustZoomFactor();\n }",
"protected Bitmap getSVGImageForName(String name) throws IOException {\n String path = SVG_BASE_PATH + name + \".svg\";\n\n // create a shape document (load the SVG)\n PXShapeDocument document = PXSVGLoader.loadFromStream(getContext().getAssets().open(path));\n\n // grab root shape\n PXShapeGroup root = (PXShapeGroup) document.getShape();\n RectF bounds = root.getViewport();\n\n if (bounds == null || bounds.isEmpty()) {\n // use 100x100 if we didn't find a view port in the SVG file\n bounds = new RectF(0, 0, 100, 100);\n }\n\n // set size\n document.setBounds(bounds);\n // render to UIImage\n Drawable drawable = root.renderToImage(bounds, false);\n return ((BitmapDrawable) drawable).getBitmap();\n }",
"private void setupInitialImagePosition(float drawableWidth, float drawableHeight) {\n float cropRectWidth = mCropRect.width();\n float cropRectHeight = mCropRect.height();\n\n float widthScale = mCropRect.width() / drawableWidth;\n float heightScale = mCropRect.height() / drawableHeight;\n\n float initialMinScale = Math.max(widthScale, heightScale);\n\n float tw = (cropRectWidth - drawableWidth * initialMinScale) / 2.0f + mCropRect.left;\n float th = (cropRectHeight - drawableHeight * initialMinScale) / 2.0f + mCropRect.top;\n\n mCurrentImageMatrix.reset();\n mCurrentImageMatrix.postScale(initialMinScale, initialMinScale);\n mCurrentImageMatrix.postTranslate(tw, th);\n setImageMatrix(mCurrentImageMatrix);\n }",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"private BufferedImage scale(BufferedImage sourceImage) {\n GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();\n GraphicsDevice graphicsDevice = graphicsEnvironment.getDefaultScreenDevice();\n GraphicsConfiguration graphicsConfiguration = graphicsDevice.getDefaultConfiguration();\n BufferedImage scaledImage = graphicsConfiguration.createCompatibleImage(IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n Graphics2D newGraphicsImage = scaledImage.createGraphics();\n newGraphicsImage.setColor(Color.white);\n newGraphicsImage.fillRect(0, 0, IMAGE_DIMENSION, IMAGE_DIMENSION);\n\n double xScale = (double) IMAGE_DIMENSION / sourceImage.getWidth();\n double yScale = (double) IMAGE_DIMENSION / sourceImage.getHeight();\n AffineTransform affineTransform = AffineTransform.getScaleInstance(xScale,yScale);\n newGraphicsImage.drawRenderedImage(sourceImage, affineTransform);\n newGraphicsImage.dispose();\n\n return scaledImage;\n }",
"public EasyAnimatorSVGViewImpl(Appendable output, int width, int height) throws\n IllegalArgumentException {\n super(output);\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\"Width and height have to be greater than 0.\");\n }\n this.myStringBuilder = new StringBuilder(); // StringBuilder that gathers all input from model\n // and converts it to svg code as a String.\n this.height = height;\n this.width = width;\n this.initScene();\n }",
"public void beginScaling() {\n xScale = 1.0f;\n yScale = 1.0f;\n }",
"public static SVGImage createImage(String svgURI) throws IOException {\n ScalableImage scalableImage = null;\n\n try {\n scalableImage = ScalableImage.createImage(svgURI, null);\n } catch (NullPointerException npe) {\n throw new IllegalArgumentException(ERROR_NULL_URI);\n } \n \n return new SVGImage(scalableImage);\n }",
"private void loadShipImage() {\r\n\t\tshipImageView = Ship.getImage();\r\n\t\tshipImageView.setX(ship.getCurrentLocation().x * scalingFactor);\r\n\t\tshipImageView.setY(ship.getCurrentLocation().y * scalingFactor);\r\n\r\n\t\troot.getChildren().add(shipImageView);\r\n\r\n\t}",
"@Override\r\n\tprotected Point getInitialSize() {\r\n\t\treturn new Point(450, 300);\r\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(450, 300);\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(450, 300);\n\t}",
"private void createImageView() {\n /**\n * We use @{@link AdjustableImageView} so that we can have behaviour like setAdjustViewBounds(true)\n * for Android below API 18\n */\n viewsToBeInflated.add(new AdjustableImageView(getActivityContext()));\n }",
"@Override\r\n\tpublic View makeView() {\n\t\tImageView image = new ImageView(this);\r\n\t\t// cente会让居中显示并缩放\r\n\t\timage.setScaleType(ScaleType.FIT_CENTER);\r\n\t\treturn image;\r\n\t}",
"public SpriteBuilder(ImageView imageView) {\r\n if (imageView == null) {\r\n throw new IllegalArgumentException(\"The image view can't be null!!\");\r\n }\r\n this.imageView = imageView;\r\n this.widthFrame = this.imageView.getImage().getWidth();\r\n this.heightFrame = this.imageView.getImage().getHeight();\r\n }",
"TwoDShape5() {\n width = height = 0.0;\n }",
"@Override\r\n public Sprite build() {\r\n return new Sprite(imageView, totalNbrFrames, columns, offsetX, offsetY, widthFrame, heightFrame);\r\n }",
"private void updateBaseMatrix(Drawable d) {\n ImageView imageView = getImageView();\n if (null == imageView || null == d) {\n return;\n }\n\n final float viewWidth = getImageViewWidth(imageView);\n final float viewHeight = getImageViewHeight(imageView);\n final int drawableWidth = d.getIntrinsicWidth();\n final int drawableHeight = d.getIntrinsicHeight();\n\n mBaseMatrix.reset();\n\n final float widthScale = viewWidth / drawableWidth;\n final float heightScale = viewHeight / drawableHeight;\n\n if (mScaleType == ScaleType.CENTER) {\n mBaseMatrix.postTranslate((viewWidth - drawableWidth) / 2F,\n (viewHeight - drawableHeight) / 2F);\n\n } else if (mScaleType == ScaleType.CENTER_CROP) {\n float scale = Math.max(widthScale, heightScale);\n mBaseMatrix.postScale(scale, scale);\n mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F,\n (viewHeight - drawableHeight * scale) / 2F);\n\n } else if (mScaleType == ScaleType.CENTER_INSIDE) {\n float scale = Math.min(1.0f, Math.min(widthScale, heightScale));\n mBaseMatrix.postScale(scale, scale);\n mBaseMatrix.postTranslate((viewWidth - drawableWidth * scale) / 2F,\n (viewHeight - drawableHeight * scale) / 2F);\n\n } else {\n RectF mTempSrc = new RectF(0, 0, drawableWidth, drawableHeight);\n RectF mTempDst = new RectF(0, 0, viewWidth, viewHeight);\n\n switch (mScaleType) {\n case FIT_CENTER:\n mBaseMatrix\n .setRectToRect(mTempSrc, mTempDst, ScaleToFit.CENTER);\n break;\n\n case FIT_START:\n mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.START);\n break;\n\n case FIT_END:\n mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.END);\n break;\n\n case FIT_XY:\n mBaseMatrix.setRectToRect(mTempSrc, mTempDst, ScaleToFit.FILL);\n break;\n\n default:\n break;\n }\n }\n\n resetMatrix();\n }",
"@Override\n protected Point getInitialSize() {\n return new Point(450, 504);\n }",
"IMG createIMG();",
"public void setFreeAspectRatio() {\n setAspectRatio(-1.0);\n }",
"@Test(expected = UnsupportedOperationException.class)\n public void SVGViewTest3() {\n IView a = new SVGView(new AnimatorModelImpl(0, 0, 100, 100), \"toh-3.txt\", 10);\n a.makeVisible();\n }",
"public BufferedImage getScaledImage ( float scale ) {\n\n int oldW = param.Parameters.IMAGEW;\n int oldH = param.Parameters.IMAGEH;\n\n param.Parameters.SCALE = scale;\n param.Parameters.IMAGEW = (int)((float)param.Parameters.IMAGEW * param.Parameters.SCALE);\n param.Parameters.IMAGEH = (int)((float)param.Parameters.IMAGEH * param.Parameters.SCALE);\n\n BufferedImage img =\n param.Parameters.PROBLEM.getData(param.Parameters.STATE, program, 0, 0);\n\n param.Parameters.SCALE = 1.0f;\n param.Parameters.IMAGEW = oldW;\n param.Parameters.IMAGEH = oldH;\n\n System.gc();\n\n return img;\n\n }",
"public RenderedImage createRendering(RenderContext renderContext) {\n/* 245 */ AffineTransform gn2dev, usr2dev = renderContext.getTransform();\n/* */ \n/* */ \n/* 248 */ if (usr2dev == null) {\n/* 249 */ usr2dev = new AffineTransform();\n/* 250 */ gn2dev = usr2dev;\n/* */ } else {\n/* 252 */ gn2dev = (AffineTransform)usr2dev.clone();\n/* */ } \n/* */ \n/* */ \n/* 256 */ AffineTransform gn2usr = this.node.getTransform();\n/* 257 */ if (gn2usr != null) {\n/* 258 */ gn2dev.concatenate(gn2usr);\n/* */ }\n/* */ \n/* 261 */ Rectangle2D bounds2D = getBounds2D();\n/* */ \n/* 263 */ if (this.cachedBounds != null && this.cachedGn2dev != null && this.cachedBounds.equals(bounds2D) && gn2dev.getScaleX() == this.cachedGn2dev.getScaleX() && gn2dev.getScaleY() == this.cachedGn2dev.getScaleY() && gn2dev.getShearX() == this.cachedGn2dev.getShearX() && gn2dev.getShearY() == this.cachedGn2dev.getShearY()) {\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 272 */ double deltaX = usr2dev.getTranslateX() - this.cachedUsr2dev.getTranslateX();\n/* */ \n/* 274 */ double deltaY = usr2dev.getTranslateY() - this.cachedUsr2dev.getTranslateY();\n/* */ \n/* */ \n/* */ \n/* */ \n/* 279 */ if (deltaX == 0.0D && deltaY == 0.0D)\n/* */ {\n/* 281 */ return (RenderedImage)this.cachedRed;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 286 */ if (deltaX == (int)deltaX && deltaY == (int)deltaY)\n/* */ {\n/* 288 */ return (RenderedImage)new TranslateRed(this.cachedRed, (int)Math.round(this.cachedRed.getMinX() + deltaX), (int)Math.round(this.cachedRed.getMinY() + deltaY));\n/* */ }\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 301 */ if (bounds2D.getWidth() > 0.0D && bounds2D.getHeight() > 0.0D) {\n/* */ \n/* 303 */ this.cachedUsr2dev = (AffineTransform)usr2dev.clone();\n/* 304 */ this.cachedGn2dev = gn2dev;\n/* 305 */ this.cachedBounds = bounds2D;\n/* 306 */ this.cachedRed = (CachableRed)new GraphicsNodeRed8Bit(this.node, usr2dev, this.usePrimitivePaint, renderContext.getRenderingHints());\n/* */ \n/* */ \n/* 309 */ return (RenderedImage)this.cachedRed;\n/* */ } \n/* */ \n/* 312 */ this.cachedUsr2dev = null;\n/* 313 */ this.cachedGn2dev = null;\n/* 314 */ this.cachedBounds = null;\n/* 315 */ this.cachedRed = null;\n/* 316 */ return null;\n/* */ }",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(450, 270);\n\t}",
"public void resetUserTransform() {\n workTransform.setTransform(null);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"public PgmImage() {\r\n int[][] defaultPixels = {{0, 1, 2, 3}, {4, 5, 6, 7}, {8, 9, 10, 11}};\r\n pixels = new int[defaultPixels.length][defaultPixels[0].length];\r\n for (int row = 0; row < pixels.length; ++row) {\r\n for (int col = 0; col < pixels[0].length; ++col) {\r\n pixels[row][col] = (int) (defaultPixels[row][col] * 255.0 / 12);\r\n }\r\n }\r\n pix2img();\r\n }",
"private void applyWindowToViewportTransformation(Graphics2D g2,\n double left, double right, double bottom, double top,\n boolean preserveAspect) {\n int width = getWidth();\n int height = getHeight();\n if (preserveAspect) {\n double displayAspect = Math.abs((double) height / width);\n double requestedAspect = Math.abs((bottom - top) / (right - left));\n if (displayAspect > requestedAspect) {\n double excess = (bottom - top) * (displayAspect / requestedAspect - 1);\n bottom += excess / 2;\n top -= excess / 2;\n } else if (displayAspect < requestedAspect) {\n double excess = (right - left) * (requestedAspect / displayAspect - 1);\n right += excess / 2;\n left -= excess / 2;\n }\n }\n g2.scale(width / (right - left), height / (bottom - top));\n g2.translate(-left, -top);\n double pixelWidth = Math.abs((right - left) / width);\n double pixelHeight = Math.abs((bottom - top) / height);\n pixelSize = (float) Math.max(pixelWidth, pixelHeight);\n }",
"public SVGView(ReadAnimationModel r) {\n if (r == null) {\n throw new IllegalArgumentException(\"model cannot be null\");\n }\n speed = 1000;\n model = Objects.requireNonNull(r);\n this.width = model.getBounds().getBoundWidth();\n this.height = model.getBounds().getBoundHeight();\n }",
"@Override\n protected Point getInitialSize() {\n return new Point(930, 614);\n }",
"public Transform(Transform transform){\n System.arraycopy(transform.matrix, 0, matrix, 0, 16); \n }",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"public Graphics2D createGraphics()\n {\n return this.image.createGraphics();\n }",
"private void rebuildImageIfNeeded() {\n Rectangle origRect = this.getBounds(); //g.getClipBounds();\n// System.out.println(\"origRect \" + origRect.x + \" \" + origRect.y + \" \" + origRect.width + \" \" + origRect.height);\n\n backBuffer = createImage(origRect.width, origRect.height);\n// System.out.println(\"Image w \" + backBuffer.getWidth(null) + \", h\" + backBuffer.getHeight(null));\n Graphics backGC = backBuffer.getGraphics();\n backGC.setColor(Color.BLACK);\n backGC.fillRect(0, 0, origRect.width, origRect.height);\n// updateCSysEntList(combinedRotatingMatrix);\n paintWorld(backGC);\n }",
"public SVG build() throws SVGParseException {\n if (data == null) {\n throw new IllegalStateException(\"SVG input not specified. Call one of the readFrom...() methods first.\");\n }\n SVGParser parser = new SVGParser();\n SVG svg = parser.parse(data);\n svg.setFillColorFilter(fillColorFilter);\n svg.setStrokeColorFilter(strokeColorFilter);\n return svg;\n }",
"@Override\r\n\tprotected Point getInitialSize() {\r\n\t\treturn new Point(320, 204);\r\n\t}",
"private ImageView setStartMenuImage() {\r\n Image image = null;\r\n try {\r\n image = new Image(new FileInputStream(\"images/icon1.png\"));\r\n } catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n ImageView imageView = new ImageView(image);\r\n imageView.setFitHeight(HEIGHT / 4);\r\n imageView.setPreserveRatio(true);\r\n return imageView;\r\n }",
"public Viewer() {\r\n\t\tzoom = DEFAULT_ZOOM;\r\n\t\tisWireframe = false;\r\n\t\tisAxes = true;\r\n\t\tnextRotationAngle = 0;\r\n\t\tnextRotationAxis = null;\r\n\t\trotationMatrix = null;\r\n\t\tscreenWidth = 0;\r\n\t\tscreenHeight = 0;\r\n\t}",
"public void render() { image.drawFromTopLeft(getX(), getY()); }",
"public CoordinateSystem() {\r\n\t\torigin = new GuiPoint(0, 0);\r\n\t\tzoomFactor = 1f;\r\n\t}",
"public native void setXResolution(double xRes) throws MagickException;",
"public Image()\r\n {\r\n super();\r\n setBounds( 0, 0, 10, 10 );\r\n }",
"public Image createScaledImage (double scale, int interpolType)\r\n {\r\n\tImageScaler scaler = new ImageScaler(scale, interpolType);\r\n\treturn (HSIImage)scaler.filter(this);\r\n }",
"void setInitialImageBoundsFitImage() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\t\t\t\n\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\tmMinWidth = mViewWidth; \n\t\t\t\tmMaxWidth = (int)(mMinWidth * mMaxSize);\n\t\t\t\tmMaxHeight = (int)(mMinHeight * mMaxSize);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\tscaleBitmap(mMinWidth, mMinHeight);\n\t\t }\n\t\t}\n\t}",
"public void setOriginalAspectRatioFixed() {\n if (!isImageLoaded()) {\n // if no image was loaded set the aspect ratio to free\n setAspectRatio(-1.0);\n return;\n }\n Rect imageRect = getImageRect();\n setAspectRatio((double) (imageRect.width()) / (double) (imageRect.height()));\n }",
"public void convert() throws Exception {\r\n\t\tString svg_URI_input = Paths.get(\"library.svg\").toUri().toURL().toString();\r\n\t\tTranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);\r\n\t\tthis.setNewImage(generate(20));// Define the name of the file\r\n\t\ttry (OutputStream png_ostream = new FileOutputStream(newImage)) {\r\n\t\t\tTranscoderOutput output_png_image = new TranscoderOutput(png_ostream);\r\n\r\n\t\t\tPNGTranscoder my_converter = new PNGTranscoder();\r\n\t\t\tmy_converter.transcode(input_svg_image, output_png_image);\r\n\r\n\t\t\tpng_ostream.flush();\r\n\t\t\tpng_ostream.close();\r\n\t\t}\r\n\r\n\t}",
"public String toSVG() {\n\n StringBuilder toReturn = new StringBuilder();\n toReturn.append(\"<svg width=\" + \"\\\"\" + Integer.toString(this.width)\n + \"\\\"\" + \" height=\" + \"\\\"\" + Integer.toString(this.height)\n + \"\\\"\" + \" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n\"); // add website\n String tag;\n for (String s : model.getIDSet()) {\n\n IShape sh = model.currentShape(0, s);\n if (sh.isRectangle()) {\n toReturn.append(\"<rect id=\" + \"\\\"\" + s + \"\\\"\" + \" \");\n tag = \"</rect>\";\n toReturn.append(\"x=\\\"\" + sh.getLocation().getX() + \"\\\" y=\\\"\"\n + sh.getLocation().getY() + \"\\\" width=\\\"\" + sh.getWidth() + \"\\\" height=\\\"\"\n + sh.getHeight() + \"\\\" fill=\\\"rgb(\" + sh.getColor().getRedInt() + \",\" +\n sh.getColor().getGreenInt() + \",\"\n + sh.getColor().getBlueInt() + \")\\\" visibility=\\\"visible\\\" >\\n\");\n } else {\n toReturn.append(\"<ellipse id=\" + \"\\\"\" + s + \"\\\"\" + \" \");\n toReturn.append(\"cx=\\\"\" + sh.getLocation().getX() + \"\\\" cy=\\\"\" + sh.getLocation().getY()\n + \"\\\" rx=\\\"\" + sh.getWidth() + \"\\\" ry=\\\"\" + sh.getHeight() + \"\\\" fill=\\\"rgb(\"\n + sh.getColor().getRedInt() + \",\" + sh.getColor().getGreenInt() + \",\"\n + sh.getColor().getBlueInt() + \")\\\" visibility=\\\"visible\\\" >\\n\");\n tag = \"</ellipse>\";\n }\n\n toReturn.append(svgColors(s));\n\n toReturn.append(svgSizes(s));\n\n toReturn.append(svgMoves(s));\n\n toReturn.append(tag + \"\\n\");\n\n }\n toReturn.append(\"</svg>\");\n return toReturn.toString();\n }",
"private ImageView createImageView(final File imageFile) {\n\n ImageView imageView = null;\n try {\n final Image image = new Image(new FileInputStream(imageFile), 150, 0, true,\n true);\n imageView = new ImageView(image);\n imageView.setFitWidth(150);\n imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {\n\n @Override\n public void handle(MouseEvent mouseEvent) {\n\n if(mouseEvent.getButton().equals(MouseButton.PRIMARY)){\n\n if(mouseEvent.getClickCount() == 2){\n try {\n BorderPane borderPane = new BorderPane();\n ImageView imageView = new ImageView();\n Image image = new Image(new FileInputStream(imageFile));\n imageView.setImage(image);\n imageView.setStyle(\"-fx-background-color: BLACK\");\n imageView.setFitHeight(window1Stage.getHeight() - 10);\n imageView.setPreserveRatio(true);\n imageView.setSmooth(true);\n imageView.setCache(true);\n borderPane.setCenter(imageView);\n borderPane.setStyle(\"-fx-background-color: BLACK\");\n Stage newStage = new Stage();\n newStage.setWidth(window1Stage.getWidth());\n newStage.setHeight(window1Stage.getHeight());\n newStage.setTitle(imageFile.getName());\n Scene scene = new Scene(borderPane, Color.BLACK);\n newStage.setScene(scene);\n newStage.show();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n\n }\n }\n }\n });\n } catch (FileNotFoundException ex) {\n ex.printStackTrace();\n }\n return imageView;\n }",
"private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }",
"public Transform() {\n setIdentity();\n }",
"public static Transform newScale(float sx, float sy, float sz){\n return new Transform(new float[][]{\n {sx, 0.0f, 0.0f, 0.0f},\n {0.0f, sy, 0.0f, 0.0f},\n {0.0f, 0.0f, sz, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n\n });\n }",
"void ship_setup() {\n ship = new Ship(level);\n ship_image_view = new ImageView(ship_image);\n ship_image_view.setX(ship.x_position);\n ship_image_view.setY(ship.y_position);\n ship_image_view.setFitWidth(Ship.SHIP_WIDTH);\n ship_image_view.setFitHeight(Ship.SHIP_HEIGHT);\n game_pane.getChildren().add(ship_image_view);\n }",
"private Image getScaledImage(Image sourceImage)\n {\n //create storage for the new image\n BufferedImage resizedImage = new BufferedImage(50, 50,\n BufferedImage.TYPE_INT_ARGB);\n\n //create a graphic from the image\n Graphics2D g2 = resizedImage.createGraphics();\n\n //sets the rendering options\n g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,\n RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\n //copies the source image into the new image\n g2.drawImage(sourceImage, 0, 0, 50, 50, null);\n\n //clean up\n g2.dispose();\n\n //return 50 x 50 image\n return resizedImage;\n }",
"public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }",
"@Override\n\tpublic void resize(int width, int height) {\n\t\tcreate();\n\t}",
"private void renderImage(double tx, double ty, BufferedImage img, int size, double rotation) {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"drawing Image @\" + tx + \",\" + ty);\n }\n \n AffineTransform temp = graphics.getTransform();\n AffineTransform markAT = new AffineTransform();\n Point2D mapCentre = new java.awt.geom.Point2D.Double(tx, ty);\n Point2D graphicCentre = new java.awt.geom.Point2D.Double();\n temp.transform(mapCentre, graphicCentre);\n markAT.translate(graphicCentre.getX(), graphicCentre.getY());\n \n double shearY = temp.getShearY();\n double scaleY = temp.getScaleY();\n \n double originalRotation = Math.atan(shearY / scaleY);\n \n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"originalRotation \" + originalRotation);\n }\n \n markAT.rotate(rotation - originalRotation);\n \n double unitSize = Math.max(img.getWidth(), img.getHeight());\n \n double drawSize = (double) size / unitSize;\n \n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"unitsize \" + unitSize + \" size = \" + size + \" -> scale \" + drawSize);\n }\n \n markAT.scale(drawSize, drawSize);\n graphics.setTransform(markAT);\n \n // we moved the origin to the centre of the image.\n graphics.drawImage(img, -img.getWidth() / 2, -img.getHeight() / 2, obs);\n \n graphics.setTransform(temp);\n \n return;\n }",
"public AxesTransform() {\n\n\t}",
"private BufferedImage user_space(BufferedImage image) {\n // create new_img with the attributes of image\n BufferedImage new_img = new BufferedImage(image.getWidth(),\n image.getHeight(), BufferedImage.TYPE_3BYTE_BGR);\n Graphics2D graphics = new_img.createGraphics();\n graphics.drawRenderedImage(image, null);\n graphics.dispose(); // release all allocated memory for this image\n return new_img;\n }",
"public Image() {\n\t\t\tthis(Color.white, 0);\n\t\t}",
"protected Point getInitialSize() {\n\t\t return new Point(700, 500);\n\t }",
"private void transformAndDraw(GraphicsContext gc, Image image, double x, double y) {\n\t\t\n\t\tgc.save(); // saves the current state on stack, including the current transform\n\n\t\t//draws image at the specified locations x,y with given heights and widths of image\n\t\tgc.drawImage(image, 0, 0, imgWidthOrig, imgHeightOrig, x, y, imgWidth, imgHeight);\n\n\t\t\n\t}",
"private void ScaleImage(){\n\t\tBufferedImage resizedImage = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);\n\t\tGraphics2D g2 = resizedImage.createGraphics();\n\t\tg2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);\n\t\tg2.drawImage(image, 0, 0, this.getWidth(), this.getHeight(), null);\n\t\tg2.dispose();\n\t\tthis.image = resizedImage;\n\t}",
"@Override\n\tprotected Point getInitialSize() {\n\t\treturn new Point(590, 459);\n\t}",
"int wkhtmltoimage_init(int use_graphics);",
"public Builder clearImagesByTransform() {\n if (imagesByTransformBuilder_ == null) {\n imagesByTransform_ = java.util.Collections.emptyList();\n bitField0_ = (bitField0_ & ~0x00002000);\n onChanged();\n } else {\n imagesByTransformBuilder_.clear();\n }\n return this;\n }",
"public AffineTransform getInitialCtm(\n )\n {\n AffineTransform initialCtm;\n if(getScanner().getRenderContext() == null) // Device-independent.\n {\n initialCtm = new AffineTransform(); // Identity.\n }\n else // Device-dependent.\n {\n IContentContext contentContext = getScanner().getContentContext();\n Dimension2D canvasSize = getScanner().getCanvasSize();\n\n // Axes orientation.\n RotationEnum rotation = contentContext.getRotation();\n switch(rotation)\n {\n case Downward:\n initialCtm = new AffineTransform(1, 0, 0, -1, 0, canvasSize.getHeight());\n break;\n case Leftward:\n initialCtm = new AffineTransform(0, 1, 1, 0, 0, 0);\n break;\n case Upward:\n initialCtm = new AffineTransform(-1, 0, 0, 1, canvasSize.getWidth(), 0);\n break;\n case Rightward:\n initialCtm = new AffineTransform(0, -1, -1, 0, canvasSize.getWidth(), canvasSize.getHeight());\n break;\n default:\n throw new NotImplementedException();\n }\n\n // Scaling.\n Rectangle2D contentBox = contentContext.getBox();\n Dimension2D rotatedCanvasSize = rotation.transform(canvasSize);\n initialCtm.scale(\n rotatedCanvasSize.getWidth() / contentBox.getWidth(),\n rotatedCanvasSize.getHeight() / contentBox.getHeight()\n );\n\n // Origin alignment.\n initialCtm.translate(-contentBox.getMinX(), -contentBox.getMinY());\n }\n return initialCtm;\n }",
"public static void bgfx_set_view_transform(@NativeType(\"bgfx_view_id_t\") int _id, @Nullable @NativeType(\"void const *\") FloatBuffer _view, @Nullable @NativeType(\"void const *\") FloatBuffer _proj) {\n if (CHECKS) {\n checkSafe(_view, 64 >> 2);\n checkSafe(_proj, 64 >> 2);\n }\n nbgfx_set_view_transform((short)_id, memAddressSafe(_view), memAddressSafe(_proj));\n }",
"@Override\r\n\tprotected OsgiPlatform createPlatform() {\n\t\tOsgiPlatform osgiPlatform = super.createPlatform();\r\n\t\tosgiPlatform.getConfigurationProperties().setProperty(\"javax.xml.transform.TransformerFactory\", \"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl\");\r\n\t\treturn osgiPlatform;\r\n\t}"
] | [
"0.57167816",
"0.5613822",
"0.5150434",
"0.50831705",
"0.49356127",
"0.49050984",
"0.48806885",
"0.48401996",
"0.4805009",
"0.4788808",
"0.47737038",
"0.47567275",
"0.46726587",
"0.4661355",
"0.46568123",
"0.4641195",
"0.46348453",
"0.46212235",
"0.46148953",
"0.45957446",
"0.45943713",
"0.456795",
"0.4563056",
"0.45529908",
"0.4529245",
"0.45209894",
"0.4519847",
"0.45168033",
"0.45113668",
"0.4477866",
"0.44769228",
"0.4468462",
"0.44634038",
"0.44423357",
"0.4429243",
"0.4429207",
"0.4418248",
"0.44161892",
"0.44076225",
"0.44040304",
"0.43910962",
"0.43883362",
"0.4379185",
"0.4379185",
"0.43753427",
"0.43689397",
"0.43615064",
"0.43598408",
"0.43539923",
"0.43336818",
"0.43316483",
"0.43313268",
"0.4325681",
"0.4321858",
"0.43214157",
"0.4321036",
"0.43201303",
"0.43186375",
"0.43119764",
"0.43036428",
"0.43012118",
"0.4291226",
"0.42910308",
"0.4288993",
"0.42867216",
"0.42861465",
"0.42817315",
"0.42581433",
"0.4255666",
"0.42513275",
"0.42501876",
"0.42436346",
"0.42302272",
"0.42292556",
"0.42279518",
"0.42152268",
"0.4213366",
"0.4211757",
"0.42023966",
"0.4202255",
"0.41943341",
"0.41894716",
"0.41877496",
"0.41845566",
"0.41813847",
"0.4181088",
"0.41808572",
"0.41754696",
"0.41597712",
"0.4157607",
"0.4153552",
"0.41477352",
"0.41390494",
"0.41363314",
"0.4136174",
"0.41328877",
"0.4124638",
"0.41114908",
"0.41083238",
"0.40986297"
] | 0.5565575 | 2 |
Sets the SVG image's viewport width and height. | public void setViewportSize(int width, int height)
throws IllegalArgumentException {
if (( width < 0 ) || (height < 0))
throw new IllegalArgumentException();
scalableImage.setViewportWidth(width);
scalableImage.setViewportHeight(height);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setDimension(double width, double height);",
"public void setViewportDims(float width, float height) {\n\t\tthis.viewportDims[0] = width;\n\t\tthis.viewportDims[1] = height;\n\t\tthis.viewportRatio = width / height;\n\t}",
"@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }",
"public void setViewport(final int x, final int y, final int width, final int height) {\n viewport.set(x, y, width, height);\n }",
"public void setViewport(double x, double y, double width, double height) {\n xViewport = x;\n yViewport = y;\n widthViewport = width;\n heightViewport = height;\n nViewportUpdates++;\n setScaleFactor();\n }",
"private void updateViewport(int width, int height)\n\t{\n\t\tviewportWidth = width;\n\t\tviewportHeight = height;\n\t}",
"@Override\n public void resize(int width, int height) {\n viewport.update(width, height);\n }",
"@Override\n public void resize(int width, int height) {\n viewport.update(width, height);\n }",
"@Override\n public void resize(int width, int height) {\n stage.getViewport().update(width, height, true);\n stage.mapImg.setHeight(Gdx.graphics.getHeight());\n stage.mapImg.setWidth(Gdx.graphics.getWidth());\n stage.gameUI.show();\n }",
"public void setViewPort(int width, int height) {\n String res = Integer.toString(width) + \"x\" + Integer.toString(height);\n this.standardPairs.put(Parameters.VIEWPORT, res);\n }",
"public void setImage(final Image image) {\r\n getView().setImage(image);\r\n getView().setFitWidth(this.getDimension().getWidth());\r\n getView().setPreserveRatio(true);\r\n getView().setViewport(new Rectangle2D(0, 0, this.getDimension().getWidth(), this.getDimension().getHeight()));\r\n }",
"@Override\r\n public void resize(int width, int height) {\n stage.getViewport().update(width, height, true);\r\n }",
"public native void setXResolution(double xRes) throws MagickException;",
"@Override\n\tpublic void setWidthAndHeight(int width, int height) {\n\t\t\n\t}",
"@Override\n public void resize(int width, int height) {\n stage.getViewport().update(width, height, true);\n }",
"@Override\n\tpublic void resize(int width, int height) {\n\t stage.getViewport().update(width, height, true);\n\t}",
"public void setFrameSize();",
"public void setSize(float width, float height);",
"@Override\n public void resize(int width, int height) {\n camera.viewportWidth = width/25;\n camera.viewportHeight = height/25;\n camera.update();\n }",
"@Override public void resize (int width, int height) {\n\t\tviewport.update(width, height, true);\n\t\tstage.getViewport().update(width, height, true);\n\t}",
"@Override\n\tpublic void resize(int width, int height) {\n\t\tui.setViewport(width, height);\n\t\tcamera.setToOrtho(false);\n\t}",
"public ParametersBuilder setViewportSize(\n int viewportWidth, int viewportHeight, boolean viewportOrientationMayChange) {\n this.viewportWidth = viewportWidth;\n this.viewportHeight = viewportHeight;\n this.viewportOrientationMayChange = viewportOrientationMayChange;\n return this;\n }",
"public void setSize(double aWidth, double aHeight) { setWidth(aWidth); setHeight(aHeight); }",
"@Override\n public void settings() {\n setSize(WIDTH, HEIGHT);\n }",
"public void setScale() {\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n scaleAffine();\n Scalebar.putZoomLevelDistances();\n\n //Set up the JFrame using the monitors resolution.\n setSize(screenSize); //screenSize\n setPreferredSize(new Dimension(800, 600)); //screenSize\n setExtendedState(Frame.NORMAL); //Frame.MAXIMIZED_BOTH\n }",
"public void settings() { size(1200, 800); }",
"public void resize( int width, int height ) {\n uiViewport.update( width, height );\n uiCamera.update();\n }",
"public void initSize() {\n WIDTH = 320;\n //WIDTH = 640;\n HEIGHT = 240;\n //HEIGHT = 480;\n SCALE = 2;\n //SCALE = 1;\n }",
"void setWidthHeight() {\n\t\tsetWidthHeight(getNcols() * grid().gridW, getNvisibleRows() * grid().gridH);\n\t}",
"public void SetResolution() {\r\n DisplayMetrics displayMetrics = new DisplayMetrics();\r\n WindowManager wm = (WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE);\r\n wm.getDefaultDisplay().getMetrics(displayMetrics);\r\n this.ScreenWidth = displayMetrics.widthPixels;\r\n this.ScreenHeight = displayMetrics.heightPixels;\r\n }",
"@Override\n public void resize(int width, int height) {\n bgViewPort.update(width, height, true);\n stage.getViewport().update(width, height, true);\n fonts.getFontViewport().update(width, height, true);\n }",
"public void settings() {\r\n size(WIDTH, HEIGHT); // Set size of screen\r\n }",
"@Override\n public void settings() {\n size(800, 800, P3D);\n }",
"void setStats(double newWidth, double newHeight) {\n width = newWidth;\n height = newHeight;\n }",
"public void setScreenSize(int width, int height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tthis.halfWidth = width >> 1;\r\n\t\tthis.halfHeight = height >> 1;\r\n\t\tthis.scaleFactor = ((width + height) >> 7) + 1;\r\n\t\tchanged = true;\r\n\t}",
"private void updateViewBounds() \r\n {\r\n assert !sim.getMap().isEmpty() : \"Visualiser needs simulator whose a map has at least one node\"; \r\n \r\n \r\n viewMinX = minX * zoomFactor;\r\n viewMinY = minY * zoomFactor;\r\n \r\n viewMaxX = maxX * zoomFactor;\r\n viewMaxY = maxY * zoomFactor;\r\n \r\n \r\n double marginLength = zoomFactor * maxCommRange;\r\n \r\n \r\n // Set the size of the component\r\n int prefWidth = (int)Math.ceil( (viewMaxX - viewMinX) + (marginLength * 2) );\r\n int prefHeight = (int)Math.ceil( (viewMaxY - viewMinY) + (marginLength * 2) );\r\n setPreferredSize( new Dimension( prefWidth, prefHeight ) );\r\n \r\n \r\n // Adjust for margin lengths \r\n viewMinX -= marginLength;\r\n viewMinY -= marginLength;\r\n \r\n viewMaxX += marginLength;\r\n viewMaxY += marginLength;\r\n }",
"@Override\n\tpublic void resize(int width, int height) {\n\t\trenderer.setSize(width, height);\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}",
"private void setFrameSize(int width, int height){\r\n\t\tthis.framewidth=width;\r\n\t\tthis.frameheight=height;\r\n\t}",
"public void setDimensions(double newWidth, double newHeight) {\n this.width = newWidth;\n this.height = newHeight;\n }",
"public void setFreeAspectRatio() {\n setAspectRatio(-1.0);\n }",
"public void setTargetResolution(int w, int h) {\n captureW = w;\n captureH = h;\n }",
"public void resize (int width, int height) \n\t{ \n\t\tcamera.viewportWidth = (Constants.VIEWPORT_HEIGHT / height) *\n\t\t\twidth;\n\t\tcamera.update();\n\t\tcameraGUI.viewportHeight = Constants.VIEWPORT_GUI_HEIGHT;\n\t\tcameraGUI.viewportWidth = (Constants.VIEWPORT_GUI_HEIGHT\n\t\t\t\t/ (float)height) * (float)width;\n\t\tcameraGUI.position.set(cameraGUI.viewportWidth / 2,\n\t\t\t\tcameraGUI.viewportHeight / 2, 0);\n\t\tcameraGUI.update();\n\t}",
"public void setScreenSize(int width, int height) {\n\t\tm_width = width;\n\t\tm_height = height;\n\t}",
"public void settings() {\n size(640, 384);\n }",
"@Override\n\tpublic void resize(int width, int height) {\n\t\tviewCamera.viewportWidth = width;\n\t\tviewCamera.viewportHeight = height;\n\t\tviewCamera.position.set(0, 0, 0);\n\t\tviewCamera.update();\n\n\t\tVector3 min = MIN_BOUND.cpy();\n\t\tVector3 max = new Vector3(MAX_BOUND.x - width, MAX_BOUND.y - height, 0);\n\t\tviewCamera.project(min, 0, 0, width, height);\n\t\tviewCamera.project(max, 0, 0, width, height);\n\t\tbounds = new BoundingBox(min, max);\n\t\t// do a pan to reset camera position\n\t\tpan(min);\n\t}",
"@Override\n\tpublic void setResolution(Dimension size) {\n\n\t}",
"public native void setUnits(int resolutionType) throws MagickException;",
"void setInitialImageBoundsFillScreen() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\n\t\t\t\tboolean resize=false;\n\t\t\t\t\n\t\t\t\tint newWidth=mImageWidth;\n\t\t\t\tint newHeight=mImageHeight;\n\t\t\t\n\t\t\t\t// The setting of these max sizes is very arbitrary\n\t\t\t\t// Need to find a better way to determine max size\n\t\t\t\t// to avoid attempts too big a bitmap and throw OOM\n\t\t\t\tif (mMinWidth==-1) { \n\t\t\t\t\t// set minimums so that the largest\n\t\t\t\t\t// direction we always filled (no empty view space)\n\t\t\t\t\t// this maintains initial aspect ratio\n\t\t\t\t\tif (mViewWidth > mViewHeight) {\n\t\t\t\t\t\tmMinWidth = mViewWidth;\n\t\t\t\t\t\tmMinHeight = (int)(mMinWidth/mAspect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\t\t\tmMinWidth = (int)(mAspect*mViewHeight);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tmMaxWidth = (int)(mMinWidth * 1.5f);\n\t\t\t\t\tmMaxHeight = (int)(mMinHeight * 1.5f);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (newWidth < mMinWidth) {\n\t\t\t\t\tnewWidth = mMinWidth;\n\t\t\t\t\tnewHeight = (int) (((float) mMinWidth / mImageWidth) * mImageHeight);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\tif (newHeight < mMinHeight) {\n\t\t\t\t\tnewHeight = mMinHeight;\n\t\t\t\t\tnewWidth = (int) (((float) mMinHeight / mImageHeight) * mImageWidth);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\t\n\t\t\t\t// scale the bitmap\n\t\t\t\tif (resize) {\n\t\t\t\t\tscaleBitmap(newWidth, newHeight);\n\t\t\t\t} else {\n\t\t\t\t\tmExpandWidth=newWidth;\n\t\t\t\t\tmExpandHeight=newHeight;\t\t\t\t\t\n\t\t\t\t\tmResizeFactorX = ((float) newWidth / mImageWidth);\n\t\t\t\t\tmResizeFactorY = ((float) newHeight / mImageHeight);\n\t\t\t\t\tmRightBound = 0 - (mExpandWidth - mViewWidth);\n\t\t\t\t\tmBottomBound = 0 - (mExpandHeight - mViewHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"void updateVisualizationSize(\n\t\tint visualizationWidth,\n\t\tint visualizationHeight)\n\t{\n\t\tthis.visualizationWidth = visualizationWidth;\n\t\tthis.visualizationHeight = visualizationHeight;\n\t}",
"public void setDesiredSize(int width, int height) {\n mDesiredWidth = width;\n mDesiredHeight = height;\n if (mRenderSurface != null) {\n mRenderSurface.resize(width, height);\n }\n }",
"public void setSurfaceSize(int width, int height) {\n // synchronized to make sure these all change atomically\n synchronized (surfaceHolder) {\n canvasWidth = width;\n canvasHeight = height;\n }\n }",
"void rootViewSizeChange()\n {\n int rootW = (int) Math.ceil(_rootView.getWidth());\n int rootH = (int) Math.ceil(_rootView.getHeight());\n _canvas.setWidth(rootW*_scale); _canvas.setHeight(rootH*_scale);\n }",
"@Test\n\tpublic void testSetDimensions() {\n\t\tExplorer explore = new Explorer();\n\t\texplore.setDimensions(3, 3);\n\t\tassertTrue(explore.getHeight() == 3);\n\t\tassertTrue(explore.getWidth() == 3);\n\t}",
"public final void setRealSize() {\r\n setZoom(ZOOM_REAL_SIZE);\r\n }",
"public void setWidthHeight(double x, double y) {\n\t\twidth = x;\n\t\theight = y;\n\t}",
"public void setAspectRatio(float aspectRatio) {\n this.aspectRatio = aspectRatio;\n// float radiusX=radius/aspectRatio, radiusY=radius*aspectRatio;\n }",
"public void setMouseSize(float width, float height) { \n \tpointer.width = width; \n \tpointer.height = height;\n }",
"void setSize(float w, float h) {\n _w = w;\n _h = h;\n }",
"private void getImgSize(){\n imgSizeX = 1080; //mAttacher.getDisplayRect().right - mAttacher.getDisplayRect().left;\n imgSizeY = 888.783f; //mAttacher.getDisplayRect().bottom - mAttacher.getDisplayRect().top;\n }",
"@Override\n public void resize(int x, int y) {\n viewport.update(x, y, true);\n }",
"@Override\n\tprotected void onSizeChanged(int w, int h, int oldw, int oldh) {\n\t\tsuper.onSizeChanged(w, h, oldw, oldh);\n\n\t\t// save device height width, we use it a lot of places\n\t\tmViewHeight = h;\n\t\tmViewWidth = w;\n\n\t\t// fix up the image\n\t\tsetInitialImageBounds();\n\t}",
"public static void setResolution(int width, int height) {\n WIDTH = width;\n HEIGHT = height;\n SCALAR = 1920 / WIDTH + ((1920 % WIDTH == 0) ? 0 : 1);\n }",
"public void zoomIn()\n {\n zoomIn(1, width >> 1, height >> 1);\n }",
"public void setImageSize(SpecialDimension width, SpecialDimension height)\n\t{\n\t\tsetImageWidth(width);\n\t\tsetImageHeight(height);\n\t}",
"public void setImageSize(int width, SpecialDimension height)\n\t{\n\t\tsetImageWidth(width);\n\t\tsetImageHeight(height);\n\t}",
"public void setImage(Image image) {\n this.image = image;\n width = image.getWidth();\n height = image.getHeight();\n }",
"public void setImageSize(SpecialDimension width, int height)\n\t{\n\t\tsetImageWidth(width);\n\t\tsetImageHeight(height);\n\t}",
"public void initResolution(int height, int width, double viewAngle) {\n\t\tthis.resolutionX = width;\n\t\tthis.resolutionY = height;\n\t\tthis.plainWidth = 2.0 * Math.tan(Math.toRadians(viewAngle / 2.0)) * this.distanceToPlain;\n\t}",
"private static native void setImagesize_0(long nativeObj, int W, int H);",
"public void recalculateViewport() {\r\n glViewport(0, 0, getWidth(), getHeight());\r\n spriteBatch.recalculateViewport(getWidth(), getHeight());\r\n EventManager.getEventManager().fireEvent(new WindowResizedEvent(getWidth(), getHeight()));\r\n }",
"public void setRange(int spatialWidth, int spatialHeight) {\n\t\tthis.spatialWidth = spatialWidth;\n\t\tthis.spatialHeight = spatialHeight;\n\t}",
"@DISPID(1034)\n @PropGet\n ms.html.ISVGElement viewportElement();",
"public void setMinSize(double aWidth, double aHeight) { setMinWidth(aWidth); setMinHeight(aHeight); }",
"public void setImageView() {\n \timage = new Image(\"/Model/boss3.png\", true);\n \tboss = new ImageView(image); \n }",
"protected synchronized void setAspectRatio(double aspectRatio)\n {\n myAspectRatio = aspectRatio;\n myHalfFOVy = Math.atan(Math.tan(myHalfFOVx) / myAspectRatio);\n resetProjectionMatrix();\n }",
"void setWindowSize(int s);",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"public void setBounds(int x, int y, int width, int height) {\n\n // must set this first\n super.setBounds(x, y, width, height);\n\n int vpw = getViewportSize().width;\n int vph = getViewportSize().height;\n int imw = im.getWidth();\n int imh = im.getHeight();\n\n if ( vpw >= imw && vph >= imh ) {\n ic.setBounds(x, y, width, height); \n } else {\n // BUG\n // This fixes bad image positions during resize\n // but breaks tiles (causes them all to load)\n // Somehow the graphics context clip area gets\n // changed in the ImageCanvas update(g) call.\n // This occurs when the image size is greater\n // than the viewport when the display first\n // comes up. Removing the repaint in the\n // ImageCanvas fixes this, but breaks ImageCanvas.\n // Should have a new ImageCanvas call that sets\n // the origin without a repaint.\n\n /* causes all tiles to be loaded, breaks scrolling, fixes resize */\n //setOrigin(0, 0);\n\n /* causes image to shift incorrectly on resize event */\n ic.setBounds(x, y, vpw, vph);\n }\n\n this.panelWidth = width;\n this.panelHeight = height;\n }",
"private void updateSize() {\n double width = pane.getWidth();\n double height = pane.getHeight();\n\n if(oldWidth == 0) {\n oldWidth = width;\n }\n if(oldHeight == 0) {\n oldHeight = height;\n }\n\n double oldHvalue = pane.getHvalue();\n double oldVvalue = pane.getVvalue();\n if(Double.isNaN(oldVvalue)) {\n oldVvalue = 0;\n }\n if(Double.isNaN(oldHvalue)) {\n oldHvalue = 0;\n }\n\n pane.setVmax(height);\n pane.setHmax(width);\n\n if(grow) {\n renderMapGrow(width, height, curZoom);\n } else {\n renderMap(width, height, curZoom);\n }\n\n pane.setVvalue((height/oldHeight)*oldVvalue);\n pane.setHvalue((width/oldWidth)*oldHvalue);\n\n oldWidth = width;\n oldHeight = height;\n }",
"public void setBounds(double anX, double aY, double aW, double aH) { setX(anX); setY(aY); setWidth(aW); setHeight(aH); }",
"@As( \"figure with dimensions x: $, y: $, width: $, height: $\" )\n void figure(double x, double y, double width, double height) {\n figure = new SVGRectFigure(x,y,width,height);\n handles.clear();\n ResizeHandleKit.addEdgeResizeHandles(figure,handles);\n ResizeHandleKit.addCornerResizeHandles(figure, handles);\n setUpView();\n }",
"public void settings() {\r\n size(750, 550);\r\n }",
"public void set(double x, double y, double width, double height) {\n setRect(x, y, width, height);\n }",
"public void size(final int theWidth, final int theHeight);",
"@Override\n public void resize(int width, int height) {game.screenPort.update(width, height, true);}",
"@DISPID(1034)\n @PropPut\n void viewportElement(\n ms.html.ISVGElement rhs);",
"public void setSize(int w, int h){\n this.width = w;\n this.height = h;\n ppuX = (float)width / CAMERA_WIDTH;\n ppuY = (float)height / CAMERA_HEIGHT;\n }",
"private void setImageOnGUI() {\n\n // Capture position and set to the ImageView\n if (AppConstants.fullScreenBitmap != null) {\n fullScreenSnap.setImageBitmap(AppConstants.fullScreenBitmap);\n }\n\n }",
"private void setImage(Image image, double width, double height) {\n setImage(image, width, height, (int) (spriteView.getImage().getWidth() / width));\n }",
"public static void setWindowToiPhoneView() {\n try {\n WebDriverManager.getWebDriver().manage().window().setPosition(new Point(0, 0));\n WebDriverManager.getWebDriver().manage().window().setSize(new Dimension(375, 667));\n } catch (DriverNotInitializedException e) {\n Assert.fail(\"Driver not initialized\");\n }\n }",
"private void basicSize(){\n setSize(375,400);\n }",
"void setSize(Dimension size);",
"void setInitialImageBoundsFitImage() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\t\t\t\n\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\tmMinWidth = mViewWidth; \n\t\t\t\tmMaxWidth = (int)(mMinWidth * mMaxSize);\n\t\t\t\tmMaxHeight = (int)(mMinHeight * mMaxSize);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\tscaleBitmap(mMinWidth, mMinHeight);\n\t\t }\n\t\t}\n\t}",
"public void setSVG(SVG mysvg)\r\n {\r\n if (mysvg == null)\r\n throw new IllegalArgumentException(\"Null value passed to setSVG()\");\r\n\r\n setSoftwareLayerType();\r\n setImageDrawable(new PictureDrawable(mysvg.renderToPicture()));\r\n mSvg = mysvg;\r\n mRenderer = getNewRenderer(mSvg);\r\n }",
"public int getViewportWidth() {\n return viewport.getWidth();\n }",
"public void setPreviewSize(int width, int height) {\n String v = Integer.toString(width) + \"x\" + Integer.toString(height);\n set(\"preview-size\", v);\n }",
"public void setAspectRatio(float aspectRatio) {\n\t\tthis.aspectRatio = aspectRatio;\n\t}",
"public void setCameraPreviewSize(int width, int height) {\n Log.d(TAG, \"setCameraPreviewSize\");\n mIncomingWidth = width;\n mIncomingHeight = height;\n mIncomingSizeUpdated = true;\n }",
"public void setScreenResolution(int width, int height) {\n String res = Integer.toString(width) + \"x\" + Integer.toString(height);\n this.standardPairs.put(Parameters.RESOLUTION, res);\n }",
"private void initScene() {\n myStringBuilder.append(\"<svg width=\\\"\" + width + \"\\\" height=\\\"\" + height +\n \"\\\" version=\\\"1.1\\\"\\n\" + \" xmlns=\\\"http://www.w3.org/2000/svg\\\">\");\n }"
] | [
"0.6467205",
"0.6336471",
"0.62927765",
"0.6159334",
"0.60496145",
"0.60341066",
"0.5966636",
"0.5966636",
"0.5908074",
"0.58913344",
"0.58909726",
"0.5887661",
"0.5879053",
"0.58504325",
"0.58468145",
"0.58062047",
"0.57938486",
"0.57928425",
"0.57846016",
"0.5756864",
"0.57397556",
"0.57007575",
"0.5699304",
"0.56726736",
"0.5657019",
"0.56476",
"0.5608739",
"0.55964255",
"0.5585573",
"0.5568605",
"0.5557806",
"0.55520195",
"0.5546591",
"0.5543724",
"0.5524691",
"0.5518593",
"0.54904443",
"0.5477632",
"0.5446028",
"0.5433145",
"0.54291105",
"0.5413115",
"0.5409299",
"0.5404447",
"0.54026484",
"0.53775764",
"0.5371377",
"0.5358717",
"0.5358163",
"0.5357147",
"0.5345264",
"0.53142786",
"0.5309478",
"0.5305911",
"0.530252",
"0.52984285",
"0.52790254",
"0.52742755",
"0.52706087",
"0.52657545",
"0.52656645",
"0.5261244",
"0.5255497",
"0.5251767",
"0.52393615",
"0.5235879",
"0.5235604",
"0.5235138",
"0.52323216",
"0.52294487",
"0.5219669",
"0.5210597",
"0.51952803",
"0.5190683",
"0.51865995",
"0.5185663",
"0.5185344",
"0.5185306",
"0.51851285",
"0.5184918",
"0.5181089",
"0.51761985",
"0.51654184",
"0.5154177",
"0.5152808",
"0.51511997",
"0.5145022",
"0.5142305",
"0.5138703",
"0.5125124",
"0.5112623",
"0.5110503",
"0.51086146",
"0.5106845",
"0.51032877",
"0.509343",
"0.5077599",
"0.5072998",
"0.50704813",
"0.5068343"
] | 0.628637 | 3 |
Returns the viewport's width. | public int getViewportWidth() {
return scalableImage.getViewportWidth();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getViewportWidth() {\n return viewport.getWidth();\n }",
"public int getUsedViewportWidth() {\n return Math.abs((int)(0.5 + widthViewport - xMargin));\n }",
"public int getAbsWidthViewport() {\n return Math.abs((int)(0.5 + widthViewport));\n }",
"public int getWidth() {\n return viewWidth;\n }",
"@Override\n\tpublic final int getClientWidth() {\n\t\treturn getViewportElement().getClientWidth();\n\t}",
"public double getSceneWidth() {\n return this.applicationScene.getWidth();\n }",
"public int getScreenWidth();",
"public int getScreenWidth();",
"public int getWidth(){\n Window w = vc.getFullScreenWindow();\n if(w != null){\n return w.getWidth();\n } else {\n return 0;\n }\n }",
"public int getWidth() {\n return mPresentationEngine.getWidth();\n }",
"public int getScreenWidth() {\n return this.screenWidth;\n }",
"@Override\n\tpublic int getWidth() {\n\t\treturn windowWidth;\n\t}",
"public int getWidth() {\n return (int) (this.width * ViewHandlerImpl.getScaleModifier());\n }",
"private float ScreenWidth() {\n RelativeLayout linBoardGame = (RelativeLayout) ((Activity) context).findViewById(R.id.gridContainer);\n Resources r = linBoardGame.getResources();\n DisplayMetrics d = r.getDisplayMetrics();\n return d.widthPixels;\n }",
"protected double getWindowWidth() {\n\t\treturn m_windowWidth;\n\t}",
"public int getScreenWidth()\r\n\t{\r\n\t\treturn mScreen.getWidth();\r\n\t}",
"public int getWidth () {\r\n\tcheckWidget();\r\n\tint [] args = {OS.Pt_ARG_WIDTH, 0, 0};\r\n\tOS.PtGetResources (handle, args.length / 3, args);\r\n\treturn args [1];\r\n}",
"public static double getDisplayWidth() {\n\t\treturn javafx.stage.Screen.getPrimary().getVisualBounds().getWidth();\n\t}",
"public double getWidth() {\n return location.width();\n }",
"public int getWidth() {\n\t\treturn canvasWidth;\n\t}",
"public int getWidth() {\r\n return Display.getWidth();\r\n }",
"public int getDocumentWidth() {\n\t\treturn Math.round(mRootSvgWidth);\n\t}",
"public static int getWidth()\r\n\t{\r\n\t\treturn width;\r\n\t}",
"@Override\n\tpublic int getWidth() {\n\n\t\treturn ((WorldWindowSWTGLCanvas) slave).getCanvas().getSize().x;\n\t}",
"public final int getWidth() {\r\n return width;\r\n }",
"public int getWidthScreen(){\n return widthScreen ;\n }",
"public int sWidth(){\n\t\t\n\t\tint Measuredwidth = 0; \n\t\tPoint size = new Point();\n\t\tWindowManager w = activity.getWindowManager();\n\t\tif(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {\n\t\t w.getDefaultDisplay().getSize(size);\n\t\t Measuredwidth = size.x; \n\t\t}else{\n\t\t Display d = w.getDefaultDisplay(); \n\t\t Measuredwidth = d.getWidth(); \n\t\t}\n\t\treturn Measuredwidth;\n\t}",
"public int getWidth() {\r\n return width;\r\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public float getWidth()\n {\n return getBounds().width();\n }",
"public float getViewportRatio() {\n\t\treturn viewportRatio;\n\t}",
"public final int getWidth() {\r\n return (int) size.x();\r\n }",
"public int getWidth() {\r\n return width;\r\n }",
"public int getWidth() {\n return mWidth;\n }",
"public float getWidth() {\n return width;\n }",
"public int getWidth()\n {\n return width;\n }",
"public int getWidth()\n {\n return width;\n }",
"public int getWidth()\n {\n return width;\n }",
"public int getWidth()\r\n\t{\r\n\t\treturn WIDTH;\r\n\t}",
"public double getWidth() {\n return getElement().getWidth();\n }",
"public static int getWidth() {\r\n\t\treturn 1280;\r\n\t}",
"public int getWidth() {\n\t\treturn width;\r\n\t}",
"@Override\n\tpublic final int getScrollWidth() {\n\t\t// TODO(dramaix): Use document.scrollingElement when its available. See\n\t\t// getScrollLeft().\n\t\treturn getViewportElement().getScrollWidth();\n\t}",
"public double getWidthInInches()\n {\n return width;\n }",
"public double getWidth () {\n return width;\n }",
"private void findScreenWidth() {\n DisplayMetrics dm = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);\n screenWidth = dm.widthPixels;\n }",
"public int getWidth();",
"public int getWidth();",
"public int getWidth();",
"@Override\n public int getWidth() {\n return graphicsEnvironmentImpl.getWidth(canvas);\n }",
"public int getWidth() {\n return width;\n }",
"public int getWidth() {\n return width;\n }",
"public static int resWidth() {\n\t\t\n\t\treturn (int)resolution.getWidth();\n\t\t\n\t}",
"public int getWidth() {\r\n\t\treturn width;\r\n\t}",
"public int getWidth() {\r\n\t\treturn width;\r\n\t}",
"public int getWidth() {\n return width_;\n }",
"public int getWidth() {\n return width_;\n }",
"public float getWidth() {\r\n\t\treturn width;\r\n\t}",
"public final float getWidth() {\n return mWidth;\n }",
"public int getWidth() {\n return (int) Math.round(width);\n }",
"public double getWidth() {\r\n return width;\r\n }",
"public int getWidth() {\n\t\t\treturn width;\n\t\t}",
"public int getWidth()\r\n\t{\r\n\t\treturn width;\r\n\t}",
"public double getWidth() {\n return width;\n }",
"public double getWidth() {\n return width;\n }",
"public double getWidth() {\n return width;\n }",
"public int getWidth() {\n return width_;\n }",
"public Integer getWidth()\n {\n return (Integer) getStateHelper().eval(PropertyKeys.width, null);\n }",
"public double getWidth()\r\n {\r\n return width;\r\n }",
"public double getWidth() {\n\t\t\treturn width.get();\n\t\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth()\r\n\t{\r\n\t\treturn mWidth;\r\n\t}",
"public int getWidth()\n {\n return this.width;\n }",
"public double getVideoWidth() {\n return getElement().getVideoWidth();\n }",
"public float getWidth() {\n\t\treturn width;\n\t}",
"public int getWidth()\n\t{\n\t\treturn width;\n\t}"
] | [
"0.89942783",
"0.7968807",
"0.7702506",
"0.76747483",
"0.75265324",
"0.7526094",
"0.7520719",
"0.7520719",
"0.746473",
"0.73625165",
"0.71616656",
"0.71589565",
"0.7156267",
"0.71301955",
"0.7107669",
"0.7068984",
"0.6992292",
"0.6939178",
"0.6928177",
"0.69226307",
"0.6909157",
"0.68840307",
"0.6856599",
"0.6854226",
"0.6833566",
"0.68164665",
"0.6800524",
"0.6778531",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.67774606",
"0.6773307",
"0.67541826",
"0.6750192",
"0.6744994",
"0.6742137",
"0.67401123",
"0.6726229",
"0.6726229",
"0.6726229",
"0.6720662",
"0.6717955",
"0.6709544",
"0.67078155",
"0.67021036",
"0.67006373",
"0.6698166",
"0.66962093",
"0.6676144",
"0.6676144",
"0.6676144",
"0.6669298",
"0.6669095",
"0.6669095",
"0.6661959",
"0.6661444",
"0.6661444",
"0.66597205",
"0.66597205",
"0.6657271",
"0.6657255",
"0.6656894",
"0.6655231",
"0.6653106",
"0.66514593",
"0.6649755",
"0.6649755",
"0.6649755",
"0.6643514",
"0.664345",
"0.6641582",
"0.66394323",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.66340417",
"0.6632776",
"0.6631364",
"0.66277087",
"0.6623782",
"0.6623575"
] | 0.80340385 | 1 |
Returns the viewport's height. | public int getViewportHeight() {
return scalableImage.getViewportHeight();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public int getViewportHeight() {\n return viewport.getHeight();\n }",
"public int getUsedHeightViewport() {\n return Math.abs((int)(0.5 + heightViewport - yMargin));\n }",
"public int getScreenHeight();",
"public int getScreenHeight();",
"public int getAbsHeightViewport() {\n return Math.abs((int)(0.5 + heightViewport));\n }",
"@Override\n\tpublic int getHeight() {\n\t\treturn windowHeight;\n\t}",
"public int getScreenHeight() {\n return this.screenHeight;\n }",
"public int getHeight(){\n Window w = vc.getFullScreenWindow();\n if(w != null){\n return w.getHeight();\n } else {\n return 0;\n }\n }",
"public int getHeight() {\n return mPresentationEngine.getHeight();\n }",
"public int getHeight() {\n\t\treturn canvasHeight;\n\t}",
"public int getHeight() {\n return (int) (this.height * ViewHandlerImpl.getScaleModifier());\n }",
"protected double getWindowHeight() {\n\t\treturn m_windowHeight;\n\t}",
"public double getHeight() {\n return location.height();\n }",
"public double getSceneHeight() {\n return this.applicationScene.getHeight();\n }",
"public int getScreenHeight()\r\n\t{\r\n\t\treturn mScreen.getHeight();\r\n\t}",
"public int getViewportOffsetY() {\n return viewport.getY();\n }",
"@Override\n public int getHeight() {\n return graphicsEnvironmentImpl.getHeight(canvas);\n }",
"public float getHeight();",
"public int getHeight() {\r\n return Display.getHeight();\r\n }",
"public static double getDisplayHeight() {\n\t\treturn javafx.stage.Screen.getPrimary().getVisualBounds().getHeight();\n\t}",
"public float getHeight() {\n return height;\n }",
"public double getHeight() {\n return getElement().getHeight();\n }",
"public double getHeight () {\n return height;\n }",
"public final int getHeight() {\r\n return height;\r\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"@Override\n\tpublic final int getScrollHeight() {\n\t\t// TODO(dramaix): Use document.scrollingElement when its available. See\n\t\t// getScrollLeft().\n\t\treturn getViewportElement().getScrollHeight();\n\t}",
"public float getHeight() {\r\n\t\treturn height;\r\n\t}",
"public double getHeight();",
"public double getHeight();",
"public float getHeight() {\n\t\treturn height;\n\t}",
"public int getCurrentHeight();",
"public int getHeight() {\n return height;\n }",
"public int getHeightScreen(){\n return heightScreen ;\n }",
"public double getHeight() {\n return height;\n }",
"public double getHeight() {\n return height;\n }",
"public int getHeight() {\n\t\treturn WORLD_HEIGHT;\n\t}",
"public double getHeight() {\r\n return height;\r\n }",
"public double getHeight() {\n\t\t\treturn height.get();\n\t\t}",
"@Override\n\tpublic final int getClientHeight() {\n\t\treturn getViewportElement().getClientHeight();\n\t}",
"public static int getHeight()\r\n\t{\r\n\t\treturn height;\r\n\t}",
"private int getWindowHeight() {\n DisplayMetrics displayMetrics = new DisplayMetrics();\n ((Activity) getContext()).getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n return displayMetrics.heightPixels;\n }",
"public int getHeight()\r\n\t{\r\n\t\treturn HEIGHT;\r\n\t}",
"public int getHeight() {\n\t\t\treturn height;\n\t\t}",
"public int getHeight() {\r\n\t\treturn height;\r\n\t}",
"public int getHeight() {\r\n\t\treturn height;\r\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public int getHeight() {\n\t\treturn height;\n\t}",
"public double getHeight()\r\n {\r\n return height;\r\n }",
"public int getHeight()\n {\n return height;\n }",
"public int getHeight() {\n return mHeight;\n }",
"public int getHeight() {\n return mHeight;\n }",
"public float getHeight()\n {\n return getUpperRightY() - getLowerLeftY();\n }",
"public int getHeight() {\r\n\t\t\r\n\t\treturn height;\r\n\t}",
"public int getHeight()\r\n\t{\r\n\t\treturn height;\r\n\t}",
"float getSurfaceHeight();",
"int getheight();",
"public Number getHeight() {\n\t\treturn getAttribute(HEIGHT_TAG);\n\t}",
"public double getHeight() {\r\n\t\treturn height;\r\n\t}",
"public int getHeight() \n\t{\n\t\treturn height;\n\t}",
"public int getHeight()\n\t{\n\t\treturn height;\n\t}",
"public int getHeight()\n\t{\n\t\treturn height;\n\t}",
"public double getHeight() {\n\t\treturn height;\n\t}",
"public double getHeight() {\n\t\treturn height;\n\t}",
"public double getHeight() {\n\t\treturn height;\n\t}",
"public double getHeight() {\n\t\treturn height;\n\t}",
"public double getHeight() {\n\t\treturn height;\n\t}",
"public double getHeight() {\n\t\treturn height;\n\t}",
"public double getVideoHeight() {\n return getElement().getVideoHeight();\n }",
"public final float getHeight() {\n return mHeight;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"public int getHeight() {\n return height;\n }",
"double getHeight();",
"public int getPanelHeight() {\n return height;\n }",
"public int getHeight() {\r\n return Height;\r\n }",
"public double getHeight()\r\n {\r\n return height;\r\n }",
"public float getHeight() {\n return this.height;\n }",
"public int getHeight()\n {\n \treturn height;\n }",
"public int getHeight() {\n return height_;\n }",
"public int getHeight();",
"public int getHeight();"
] | [
"0.8916236",
"0.77791375",
"0.77771777",
"0.77771777",
"0.7776566",
"0.75482726",
"0.7465841",
"0.74367404",
"0.7403692",
"0.73445785",
"0.7276012",
"0.723335",
"0.72086746",
"0.7208291",
"0.7207613",
"0.71909726",
"0.716237",
"0.7146022",
"0.714246",
"0.71388024",
"0.7135088",
"0.71333194",
"0.711332",
"0.71028507",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70996857",
"0.70967454",
"0.7084388",
"0.70793015",
"0.70793015",
"0.70712745",
"0.7071198",
"0.7058548",
"0.7057017",
"0.7054429",
"0.7054429",
"0.705354",
"0.7053483",
"0.70503926",
"0.70479417",
"0.70465136",
"0.7045619",
"0.7044037",
"0.70296943",
"0.70285046",
"0.70285046",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.701977",
"0.70174986",
"0.70152193",
"0.700973",
"0.700973",
"0.7009691",
"0.7001836",
"0.6996707",
"0.699372",
"0.6993642",
"0.6993597",
"0.6990316",
"0.698986",
"0.6988069",
"0.6988069",
"0.6984423",
"0.6984423",
"0.6984423",
"0.6984423",
"0.6984423",
"0.6984423",
"0.6983656",
"0.69780034",
"0.6970414",
"0.6970414",
"0.6970414",
"0.6956876",
"0.69498086",
"0.6944449",
"0.6941094",
"0.6924837",
"0.69209725",
"0.691219",
"0.690787",
"0.690787"
] | 0.79353327 | 1 |
Renders the SVG image into the Graphics object. The viewport is the (0, 0, viewportWidth, viewportHeight) rectangle in viewport space. This rectangle is positioned on the canvas by the x and y parameters. The viewportWidth and viewportHeight are lengths in the viewport coordinate space, which means they represent the number of device pixels for the width and height of the image. Note that the Graphics's translation (set by the translate method) affects the location of the viewport as well. For example, consider the following code snippet: // Initially, the graphics context origin is (0, 0) Graphics g = ...; // Change the graphics origin to (10, 30) g.translate(10, 30); // Draw an SVGImage SVGImage svgImage = ...; svgImage.drawImage(g, 20, 40); The viewport will be positionned at (30, 70) because the drawImage call uses the Graphics translation and the viewport's origin. In mathematical terms, the following transform is used to transform viewport coordinates to graphics coordinates: [1 0 tx+x] [0 1 ty+y] [0 0 1 ] Where tx is the current Graphics translation along the xaxis, ty is the current Graphics translation along the yaxis, x is the origin of the viewport along the xaxis and y is the origin of the viewport along the yaxis. In addition, rendering is limited to the area defined by the current Graphics's clip. The area which may be impacted by this call is the intersection of the viewport and the current clip. | public void drawImage(Graphics g, int x, int y) {
sg.bindTarget(g);
sg.render(x, y, scalableImage);
sg.releaseTarget();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void glViewport(int x, int y, int width, int height);",
"public void render(Graphics graphics) {\n graphics.drawImage(view, 0, 0, view.getWidth(), view.getHeight(), null);\n }",
"public void render(Graphics graphics){\n\t\tgraphics.drawImage(view, 0, 0, view.getWidth(), view.getHeight(), null);\n\t}",
"void render(GraphicsContext gc, double xOffSet, double yOffSet);",
"static void draw()\n {\n for (Viewport viewport : viewports)\n viewport.draw(renderers);\n }",
"public void render() { image.drawFromTopLeft(getX(), getY()); }",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"@DISPID(1034)\n @PropGet\n ms.html.ISVGElement viewportElement();",
"public void setViewport(final int x, final int y, final int width, final int height) {\n viewport.set(x, y, width, height);\n }",
"@Override\n public void render(Graphics g) {\n if (isVisible()) { \n g.drawImage(getImage(), (int)position.getX(), (int) position.getY(), width, height, null);\n }\n }",
"public void render(Graphics g)\r\n\t{\r\n\t\tg.drawImage(view, 0, 0, view.getWidth(), view.getHeight(), null);\r\n\t}",
"@Override\n public void render (Graphics2D g, int x, int y)\n {\n AffineTransform aTransform = new AffineTransform();\n aTransform.translate((int) this.getX(), (int) this.getY());\n g.drawImage(image.getScaledInstance(width, height, 0), aTransform, null);\n renderComponents(g, x, y);\n }",
"public void recalculateViewport() {\r\n glViewport(0, 0, getWidth(), getHeight());\r\n spriteBatch.recalculateViewport(getWidth(), getHeight());\r\n EventManager.getEventManager().fireEvent(new WindowResizedEvent(getWidth(), getHeight()));\r\n }",
"@DISPID(1034)\n @PropPut\n void viewportElement(\n ms.html.ISVGElement rhs);",
"public abstract void render(Graphics2D graphics);",
"public void setViewport(double x, double y, double width, double height) {\n xViewport = x;\n yViewport = y;\n widthViewport = width;\n heightViewport = height;\n nViewportUpdates++;\n setScaleFactor();\n }",
"private void drawToScreen() {\n \n Graphics g2 = getGraphics();\n /*g2.drawImage(image, 0, 0, \n WIDTH * SCALE, HEIGHT * SCALE, \n 0, 0, WIDTH, HEIGHT, \n this);*/\n g2.drawImage(image,\n (int)gsm.getAttribute(\"CAMERA_X1\"),\n (int)gsm.getAttribute(\"CAMERA_Y1\"),\n (int)gsm.getAttribute(\"CAMERA_X1\") + WIDTH*SCALE,\n (int)gsm.getAttribute(\"CAMERA_Y1\") + HEIGHT*SCALE,\n (int)gsm.getAttribute(\"WORLD_X1\"),\n (int)gsm.getAttribute(\"WORLD_Y1\"),\n (int)gsm.getAttribute(\"WORLD_X1\") + WIDTH,\n (int)gsm.getAttribute(\"WORLD_Y1\") + HEIGHT,\n this);\n\t\t/*g2.drawImage(image, 0, 0,\n\t\t\t\tWIDTH * SCALE, HEIGHT * SCALE,\n\t\t\t\tnull);*/\n\t\tg2.dispose();}",
"public void drawImage(float x, float y, float width, float height);",
"private void updateViewport(int width, int height)\n\t{\n\t\tviewportWidth = width;\n\t\tviewportHeight = height;\n\t}",
"@Override\n\tpublic void paintComponent(Graphics g) {\n\n\t\ttry {\n\t\t\tGraphics2D g2d = (Graphics2D) g;\n\n\t\t\tfloat w = this.getWidth();\n\t\t\tfloat h = this.getHeight();\n\n\t\t\tRenderingContext batch = new RenderingContext(g2d, w, h);\n\n\t\t\tif (!didInitCam) {\n\t\t\t\tcam = new OrthographicCamera(w, h);\n\n\t\t\t\tcam.zoomFor(world.getSize());\n\n\t\t\t\tdidInitCam = true;\n\t\t\t}\n\n\t\t\tcam.setViewportSize(w, h);\n\n\t\t\t// cam.update(); //Nothing in this function call.\n\t\t\tbatch.setProjectionMatrix(cam);\n\n\t\t\tif (world != null) {\n\t\t\t\tworld.render(batch);\n\t\t\t}\n\n\t\t\t// Render the grid.\n\t\t\tif (showGrid) {\n\t\t\t\tg2d.setStroke(new BasicStroke(1));\n\t\t\t\tg.setColor(new Color(1.0f, 1.0f, 1.0f, 0.5f));\n\t\t\t\tPoint2D.Float size = world.getSize();\n\t\t\t\t// draw Y lines\n\t\t\t\tfor (int i = 0; i <= size.y + .5f; i++) {\n\t\t\t\t\tbatch.drawLine(0, i, size.x, i);\n\t\t\t\t}\n\t\t\t\t// draw X lines\n\t\t\t\tfor (int j = 0; j <= size.x + .5f; j++) {\n\t\t\t\t\tbatch.drawLine(j, 0, j, size.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Render selection stuff.\n\t\t\trenderSelectedTiles(g2d, batch);\n\t\t\trenderSelectedEntities(g2d, batch);\n\t\t\tif (renderingTool != null)\n\t\t\t\trenderingTool.render(g2d, batch);\n\n\t\t} catch (ClassCastException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"@Override\r\n\tpublic void render(Graphics g) {\n\t\timg.setPosition(x - cam.getX(), y - cam.getY());\r\n\t\timg.render(g);\r\n\t}",
"public void paintComponent(Graphics g)\n {\n super.paintComponent(g);\n\n // safest to create a copy of the graphics component -- one must\n // ensure that no changes are made to the original\n Graphics2D graphics = (Graphics2D) g.create();\n\n JViewport viewport = null;\n JScrollPane scrollPane = null;\n Insets borders = null;\n\n int viewportWidth = 0;\n int viewportHeight = 0;\n int agentGUISize = Parameters.getAgentGUISize();\n int imageWidth = gridWidth * agentGUISize;\n int imageHeight = gridHeight * agentGUISize;\n\n // make sure that we're grabbing onto the viewport of the scroll pane\n Component ancestor = getParent();\n if (ancestor == null || !(ancestor instanceof JViewport))\n {\n //Exception e = new Exception(\n // \"AgentCanvas instance must be within JScrollPane instance\");\n //e.printStackTrace();\n //return;\n\n viewportWidth = imageWidth;\n viewportHeight = imageHeight;\n\n borders = new Insets(5,5,5,5);\n }\n else\n {\n // presumably we have the viewport of scroll pane containing 'this'\n viewport = (JViewport) ancestor;\n\n viewportWidth = viewport.getWidth();\n viewportHeight = viewport.getHeight();\n\n scrollPane = (JScrollPane) viewport.getParent();\n borders = scrollPane.getInsets();\n }\n\n // Note that drawImage automatically scales the image to fit that \n // rectangle.\n int renderWidth = gridWidth * agentGUISize;\n int renderHeight = gridHeight * agentGUISize;\n\n // determine the starting (x,y) in the viewport where the image\n // will be drawn\n viewportX = 10 + Math.max((viewportWidth - renderWidth) / 2, 0);\n viewportY = 20 + Math.max((viewportHeight - renderHeight) / 2, 0);\n\n // in case there was a previous image, clear things out\n //graphics.clearRect(0, 0, viewportWidth, viewportHeight);\n //graphics.clearRect(viewportX, viewportY, viewportWidth, viewportHeight);\n graphics.clearRect(viewportX, viewportY, renderWidth, renderHeight);\n\n // now draw the shelters\n for (int col = 0; col < gridWidth; col++ )\n {\n for (int row = 0; row < gridHeight; row++ )\n {\n Shelter s = shelters.getShelterAt( col, row ); //shelterGrid[col][row];\n\n // make sure not to draw any agent outside the image boundaries;\n // remember that graphics x corresponds to column and graphics y\n // corresponds to row\n if ((row >= 0) && (col >= 0) &&\n ((row * agentGUISize) + agentGUISize <= renderHeight) &&\n ((col * agentGUISize) + agentGUISize <= renderWidth))\n {\n int guiX = GUI_XPAD + viewportX + (col * agentGUISize);\n int guiY = GUI_YPAD + viewportY + (row * agentGUISize);\n\n int occupants = s.getCurrentOccupancy();\n int capacity = s.getMaxCapacity();\n int infested = s.getInfestedCount();\n int infected = s.getInfectedCount();\n \n if ( DEBUG ){\n if ( infested > occupants || infected > occupants ) {\n System.out.println(\n \"Shelter(\" + col + \", \" + row + \") \" + \n \" occupants = \" + occupants + \n \" infested = \" + infested + \n \" infected = \" + infected );\n }\n }\n \n double proportionInfested = infested / (double) occupants;\n double proportionInfected = infected / (double) occupants;\n if ( occupants == 0 ){\n proportionInfested = 0.0;\n proportionInfected = 0.0;\n }\n double proportionOccupied = occupants / (double) capacity;\n double proportionUnoccupied = 1.0 - proportionOccupied;\n \n // Shelter Occupancy info\n \n graphics.setPaint( Color.white );\n int unoccupiedHeight = \n (int) Math.round(agentGUISize * proportionUnoccupied);\n int occupiedHeight = agentGUISize - unoccupiedHeight;\n \n // Proportion of shelter currently not in use\n graphics.fillRect( guiX, guiY, \n OCCUPANCY_BAR_WIDTH, unoccupiedHeight );\n \n graphics.setPaint( Color.black );\n graphics.fillRect(guiX, guiY + unoccupiedHeight, \n OCCUPANCY_BAR_WIDTH, occupiedHeight );\n \n if (occupants > 0){\n graphics.setPaint( Color.white );\n String str = \"\"+occupants;\n graphics.drawString(str, guiX + 2, guiY + unoccupiedHeight + 15);\n graphics.setPaint( Color.black );\n }\n \n // Infestation info\n \n // Color of upper half of grid square should get more purple\n // as more Hosts are infested\n int red = 255 - (int) Math.round( 255 * proportionInfested);\n int green = 255 - (int) Math.round( 255 * proportionInfested);\n int blue = 255;\n \n Color infestColor = null;\n try{\n infestColor = new Color( red, green, blue );\n } catch (IllegalArgumentException ie ) {\n System.out.println(\"Weird color for infested block: (\" \n + red + \", \" + green + \", \" + blue + \")\");\n System.out.println(\"Shelter at (\" + row + \", \" + col +\")\");\n System.out.println(\"Usually means infested count is off.\");\n infestColor = Color.white;\n }\n\n graphics.setPaint( infestColor );\n\n graphics.fillRect(guiX + OCCUPANCY_BAR_WIDTH, guiY, STATUS_BAR_WIDTH, agentGUISize / 2);\n \n String data = \"\" + occupants + \"/\" + infested;\n graphics.setPaint( Color.black );\n graphics.drawString(data, guiX + OCCUPANCY_BAR_WIDTH + 5, guiY + agentGUISize/2 - 10 );\n \n // Infection info\n \n // Color of lower half of grid square should get redder\n // as more Hosts are infected.\n red = 255;\n green = 255 - (int) Math.round( 255 * proportionInfected);\n blue = 255 - (int) Math.round( 255 * proportionInfected);\n \n Color infectColor = null;\n try {\n infectColor = new Color( red, green, blue );\n } catch (IllegalArgumentException ie) {\n System.out.println(\"Weird color for infected block: (\" \n + red + \", \" + green + \", \" + blue + \")\");\n System.out.println(\"Shelter at (\" + row + \", \" + col +\")\");\n System.out.println(\"Usually means infected count is off.\");\n infestColor = Color.white; \n }\n\n graphics.setPaint( infectColor );\n\n graphics.fillRect(guiX + OCCUPANCY_BAR_WIDTH, \n guiY + agentGUISize/2, \n STATUS_BAR_WIDTH, \n agentGUISize / 2);\n \n data = \"\" + occupants + \"/\" + infected;\n graphics.setPaint( Color.black );\n graphics.drawString(data, guiX + OCCUPANCY_BAR_WIDTH + 5, guiY + agentGUISize - 10 );\n \n // Color of lower half of grid square should get bluer\n // as more Hosts are infected\n\n /*\n if (a.isTreated())\n {\n // if treated with antibiotic, draw a little dot in the\n // middle of the rendered agent\n int dotSize = 2;\n graphics.setPaint(Color.black);\n graphics.fillRect(guiX + ((agentGUISize - dotSize) / 2),\n guiY + ((agentGUISize - dotSize) / 2),\n dotSize, dotSize);\n }\n */\n \n drawShelterFrame(graphics, \n guiX, guiY, agentGUISize, agentGUISize );\n }\n }\n }\n\n // draw the grid last so that it will overlay the agent squares \n //drawGrid(graphics, viewportX, viewportY, renderWidth, renderHeight);\n drawGrid(graphics, viewportX + GUI_XPAD, viewportY + GUI_YPAD, renderWidth, renderHeight);\n\n // show the number of infected/uninfected agents\n drawAgentInfo(graphics, viewportX, viewportY, \n renderWidth, renderHeight, borders);\n\n revalidate();\n\n // get rid of the graphics copy\n graphics.dispose();\n }",
"static void addViewport(Viewport viewport) { viewports.add(viewport); }",
"public abstract void render(Graphics g);",
"@Override\r\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(image, (int) (x - handler.getGameCamera().getxOffset()), \r\n\t\t\t\t(int) (y - handler.getGameCamera().getyOffset()), width, height, null);\r\n\t}",
"@Override\n public void drawImage(Image image, double x, double y, double width, double height) {\n Object nativeImage = graphicsEnvironmentImpl.drawImage(canvas, image, x, y, width, height, image.getCached());\n image.cache(nativeImage);\n }",
"@Override\r\n protected void redrawViewport() {\n this.viewport.scrollAccordingly(this.gaze.getGazePitch(), this.gaze.getGazeYaw());\r\n }",
"protected abstract void render(Graphics g);",
"public void toViewportSpace(float[] userSpaceCoordinate,\n int[] viewportCoordinate) {\n if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {\n throw new IllegalArgumentException();\n }\n \n if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {\n throw new IllegalArgumentException();\n }\n \n // Get the current screenCTM\n Transform txf = svg.getTransformState();\n\n float[] pt = new float[2];\n pt[0] = viewportCoordinate[0];\n pt[1] = viewportCoordinate[1];\n txf.transformPoint(userSpaceCoordinate, pt);\n viewportCoordinate[0] = (int) pt[0];\n viewportCoordinate[1] = (int) pt[1];\n }",
"@Override\n\tpublic void paint(Graphics g) {\n\t\tGraphics2D backBufferG2 = (Graphics2D)backBuffer.getGraphics();\n\t\tbackBufferG2.translate(0, scene.height);\n\t\tbackBufferG2.scale(1, -1);\n\t\t\n\t\t// Clear the buffer image before drawing stuff onto it\n\t\tbackBufferG2.setColor(scene.backgroundColor);\n\t\tbackBufferG2.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t// Now we render the entire scene!\n\t\trenderer.scheduleNodeForRendering(scene); // Render scene + all it's children!\n\t\trenderer.scheduleNodeForRendering(scene.camera); //Need to specify camera individually \n\t\t\t\t\t\t\t\t\t\t\t\t\t//because camera isn't in the scene's children array\n\t\trenderer.renderAllNodes(backBufferG2);\n\t\t\n\t\t// Finally we draw the buffer image onto the main Graphics object\n\t\tg.drawImage(backBuffer, 0 , 0, this);\n\t}",
"void render(Graphics g);",
"SVGImage(final ScalableImage scalableImage) {\n if (scalableImage == null) {\n throw new NullPointerException();\n }\n\n this.scalableImage = scalableImage;\n this.doc = (DocumentNode) ((javax.microedition.m2g.SVGImage) scalableImage).getDocument();\n this.svg = (SVG) doc.getDocumentElement();\n this.sg = ScalableGraphics.createInstance();\n }",
"public void render (Graphics2D g);",
"public void render () {\n image (img, xC, yC, xLength * getPixelSize(), yLength * getPixelSize());\n }",
"protected void drawPlot()\n\t{\n \t\tfill(255);\n \t\tbeginShape();\n \t\tvertex(m_ViewCoords[0] - 1, m_ViewCoords[1] - 1);\n \t\tvertex(m_ViewCoords[2] + 1, m_ViewCoords[1] - 1);\n \t\tvertex(m_ViewCoords[2] + 1, m_ViewCoords[3] + 1);\n \t\tvertex(m_ViewCoords[0] - 1, m_ViewCoords[3] + 1);\n \t\tendShape(CLOSE);\n\t}",
"public abstract void draw(PGraphics graphics, float maxX, float maxY);",
"private void renderImage(double tx, double ty, BufferedImage img, int size, double rotation) {\n if (LOGGER.isLoggable(Level.FINEST)) {\n LOGGER.finest(\"drawing Image @\" + tx + \",\" + ty);\n }\n \n AffineTransform temp = graphics.getTransform();\n AffineTransform markAT = new AffineTransform();\n Point2D mapCentre = new java.awt.geom.Point2D.Double(tx, ty);\n Point2D graphicCentre = new java.awt.geom.Point2D.Double();\n temp.transform(mapCentre, graphicCentre);\n markAT.translate(graphicCentre.getX(), graphicCentre.getY());\n \n double shearY = temp.getShearY();\n double scaleY = temp.getScaleY();\n \n double originalRotation = Math.atan(shearY / scaleY);\n \n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"originalRotation \" + originalRotation);\n }\n \n markAT.rotate(rotation - originalRotation);\n \n double unitSize = Math.max(img.getWidth(), img.getHeight());\n \n double drawSize = (double) size / unitSize;\n \n if (LOGGER.isLoggable(Level.FINER)) {\n LOGGER.finer(\"unitsize \" + unitSize + \" size = \" + size + \" -> scale \" + drawSize);\n }\n \n markAT.scale(drawSize, drawSize);\n graphics.setTransform(markAT);\n \n // we moved the origin to the centre of the image.\n graphics.drawImage(img, -img.getWidth() / 2, -img.getHeight() / 2, obs);\n \n graphics.setTransform(temp);\n \n return;\n }",
"abstract void draw(Graphics g, int xoff, int yoff,\n int x, int y, int width, int height);",
"public void render(Graphics g){\r\n g.drawImage(sprite, x - Camera.x, y - Camera.y, null);\r\n }",
"public Viewport getViewport() {\n return viewport;\n }",
"private void renderTex() {\n final float\n w = xdim(),\n h = ydim(),\n x = xpos(),\n y = ypos() ;\n GL11.glBegin(GL11.GL_QUADS) ;\n GL11.glTexCoord2f(0, 0) ;\n GL11.glVertex2f(x, y + (h / 2)) ;\n GL11.glTexCoord2f(0, 1) ;\n GL11.glVertex2f(x + (w / 2), y + h) ;\n GL11.glTexCoord2f(1, 1) ;\n GL11.glVertex2f(x + w, y + (h / 2)) ;\n GL11.glTexCoord2f(1, 0) ;\n GL11.glVertex2f(x + (w / 2), y) ;\n GL11.glEnd() ;\n }",
"public static void renderImage(Image image , double x , double y , double width , double height , double imageX , double imageY ,\n\t\t\tdouble imageWidth , double imageHeight) {\n\t\t//Find out what rendering mode to use\n\t\tif (! Settings.Android && Settings.Video.OpenGL)\n\t\t\t//Render the image using OpenGL\n\t\t\tBasicRendererOpenGL.renderImage(image , x , y , width , height , imageX , imageY , imageWidth , imageHeight);\n\t\telse if (! Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render the image using Java\n\t\t\tBasicRendererJava.renderImage(image , x , y , width , height , imageX , imageY , imageWidth , imageHeight);\n\t\telse if (Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render the image using Android\n\t\t\tBasicRendererAndroid.renderImage(image , x , y , width , height , imageX , imageY , imageWidth , imageHeight);\n\t}",
"public void render(){\n\t\tGL11.glPushMatrix();\n GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);\n\n /* Load the Identity Matrix to reset our drawing locations */\n GL11.glLoadIdentity(); \n \n /* Zoom */\n \tGL11.glScalef(zoom, zoom, 0);\n \t\n \t /* Position */\n \tGL11.glTranslatef(parent.width/zoom/2-position.x, parent.height/zoom/2-position.y, 0);\n\n \t/* Prepares draw list with graphics elements list to sort and render */\n \tdrawlist.clear();\n\t\tdrawlist.addAll(graphicsElements);\n\n\t\t/* Sort draw list, with respect to y of sprite */\n\t\tCollections.sort(drawlist, new Comparator<Sprite>() {\n\t\t\t@Override\n\t\t\tpublic int compare(Sprite s1, Sprite s2) {\n\t\t\t\t/* Sprites that not sort, like backgrounds or maps */\n\t\t\t\tif(!s1.sort)\n\t\t\t\t\treturn -1;\n\t\t\t\tif(!s2.sort)\n\t\t\t\t\treturn 1;\n\t\n\t\t\t\t\n\t\t if (s1.position.y+s1.height < s2.position.y+s2.height) {\n\t\t return -1;\n\t\t }else {\n\t\t return 1;\n\t\t }\n\t\t\t}\n\t\t});\n\t\t\n\t\t/* render each sprite already ordered of draw list */\n \tfor (Iterator<Sprite> iterator = drawlist.iterator(); iterator.hasNext();) {\n\t\t\tSprite s = iterator.next();\n\t\t\ts.render();\n \t}\n \t\n \tGL11.glPushMatrix();\n }",
"private void renderMap(double width, double height, double curZoom) {\n if(curMap != null) { // if it can be obtained, set the width and height using the aspect ratio\n double aspectRatio = curMap.getMap().getWidth()/curMap.getMap().getHeight();\n double scaledW, scaledH;\n // keep the aspect ratio\n scaledH = (1 / ((1 / (width)) * aspectRatio));\n scaledW = ((height)*aspectRatio);\n if(scaledH > height) {\n canvas.setHeight(height*curZoom);\n canvas.setWidth(scaledW*curZoom);\n if(curZoom <= 1) { // If we aren't zoomed, translate the image to the center of the screen\n canvas.setTranslateX(((width - scaledW) / 2));\n canvas.setTranslateY(0);\n } else {\n canvas.setTranslateX(0);\n }\n } else {\n canvas.setHeight(scaledH*curZoom);\n canvas.setWidth(width*curZoom);\n if(curZoom <= 1) { // If we aren't zoomed, translate the image to the center of the screen\n canvas.setTranslateY(((height - scaledH) / 2));\n canvas.setTranslateX(0);\n } else {\n canvas.setTranslateY(0);\n }\n }\n } else {\n canvas.setHeight(height*curZoom);\n canvas.setWidth(width*curZoom);\n }\n render();\n }",
"public void requestrender() {\n\t\trender(g2d);\r\n\t\tGraphics g = getGraphics();\r\n\t\tg.drawImage(image , 0 , 0, null);\r\n\t\tg.dispose();\r\n\t\t\r\n\t}",
"public void drawRect(float x, float y, float width, float height, float u, float v, float texW, float texH) {\n float a = TextureManager.getBound().w, b = TextureManager.getBound().h;\n float u1 = u / a, v1 = v / a;\n float u2 = (u + texW) / a, v2 = (v + texH) / b;\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x2, y1, u2, v1,\n x1, y1, u1, v1,\n x2, y2, u2, v2,\n x1, y2, u1, v2\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }",
"@Override\n\tpublic void draw(Graphics g) {\n\n\t\tg.drawImage(MyImages.img_me, x, y, null);\n\t\t// g.drawRect(this.pos.x, this.pos.y, this.pos.width, this.pos.height);\n\t\t// this.pos.width+ rect_space_x, this.pos.height + rect_space_y);\n\n\t}",
"@Override\n public void drawImage(Image image, double x, double y) {\n Object nativeImage = graphicsEnvironmentImpl.drawImage(canvas, image, x, y, image.getCached());\n image.cache(nativeImage);\n }",
"public void render(int x, int y, int width, int height) {\n if(mNativeAddress != 0)\n nativeRender(mNativeAddress, x, y, width, height);\n }",
"public void renderImage(BufferedImage image, int xPosition, int yPosition)\n {\n int[] imagePixels = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();\n\n for(int y = 0; y < image.getHeight(); y++ ) \n {\n for(int x = 0; x < image.getWidth(); x++ ) \n {\n pixels[(x + xPosition) + (y + yPosition) * view.getWidth() ] = imagePixels[x + y * image.getWidth()];\n }\n }\n }",
"public abstract void render(PixelImage canvas);",
"public SvgGraphics(int numOfVertices, int scale){\n\t\t//Set the scale\n\t\tthis.scale = scale;\n\t\t\n\t\t//Get the size of the graph (from the paper 2*n-4 x n-2)\n\t\tint xSize = (2*numOfVertices - 4);\n\t\tint ySize = (numOfVertices - 2);\n\t\t\n\t\t//Set the starting x and y coordinates (in pixels).\n\t\t//The r just moves the graph up and over so that the bottom nodes\n\t\t//are fully displayed.\n\t\tint startx = r;\n\t\tint starty = (scale*ySize) + r;\n\t\t\n\t\t//Set the initial xml format for SVG\n\t\t//Also rotate the picture and move to a place that can be viewed\n\t\toutput = \"<?xml version=\\\"1.0\\\" standalone=\\\"no\\\"?>\\n\" +\n\t\t\t\t\"<!DOCTYPE svg PUBLIC \\\"-//W3C//DTD SVG 1.1//EN\\\" \" +\n\t\t\t\t\"\\\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\\\">\\n\\n\" +\n\t\t\t\t\"<svg width=\\\"100%\\\" height=\\\"100%\\\" version=\\\"1.1\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n\\n\" +\n\t\t\t\t\"<g transform=\\\"matrix(1, 0, 0, -1, \" + startx + \", \" + starty +\")\\\">\\n\" +\n\t\t\t\t\"<g font-family=\\\"Verdana\\\" font-size=\\\"8\\\" >\\n\\n\";\n\t}",
"public abstract void Draw(Graphics2D g, double zoomFactor);",
"public abstract void Draw(Graphics2D g, double zoomFactor);",
"private void drawRectForView(ViewNodeJSO view) {\n clearCanvas();\n drawRectForView(view, mCanvas, mScale, HTMLColors.RED, HTMLColors.YELLOW);\n }",
"@Override\n public void rect(double x, double y, double width, double height) {\n graphicsEnvironmentImpl.rect(canvas, x, y, width, height);\n }",
"public GLGraphics drawRect(float x, float y, float w, float h) {\n\t\treturn renderRect(false, x, y, w, h);\n\t}",
"public void setViewportView(Component paramComponent) {\n/* 1004 */ if (getViewport() == null) {\n/* 1005 */ setViewport(createViewport());\n/* */ }\n/* 1007 */ getViewport().setView(paramComponent);\n/* */ }",
"public void draw(Graphics2D graphics)\r\n\t{\r\n\t\t// Save the old graphics matrix and insert the camera matrix in its place.\r\n\t\tAffineTransform old = graphics.getTransform();\r\n\t\tgraphics.setTransform(_Camera.getTransformMatrix());\r\n\r\n\t\t// Draw the current scene.\r\n\t\tif (_CurrentScene != null)\r\n\t\t{\r\n\t\t\t_CurrentScene.draw(graphics);\r\n\t\t}\r\n\r\n\t\t// Reinstate the old graphics matrix.\r\n\t\tgraphics.setTransform(old);\r\n\t}",
"public void draw(Graphics window);",
"@java.lang.Override\n public int getViewportIndex() {\n return viewportIndex_;\n }",
"public void render(Graphics graphics)\n {\n // for(int index = 0; index < pixels.length; index++) { \n // pixels[index] = (int)(Math.random() * 0xFFFFFF);\n // }\n graphics.drawImage(view, 0, 0, view.getWidth(), view.getHeight(), null);\n }",
"@Override\n\tprotected void paintView(Graphics2D g2){\n\t\t// Create the image buffer for drawing the world.\n\t\tBufferedImage world_buffer = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_ARGB);\n\t\tGraphics2D world_g2 = (Graphics2D) world_buffer.getGraphics();\n\t\t// Translate and scale the world.\n\t\tworld_g2.setTransform(getTransform());\n\t\t// Draw the background.\n\t\tworld_g2.setPaint(getBackground());\n\t\treverseRectangle(world_g2, new Point(0,0), new Point(getWidth(), 0), new Point(getWidth(), getHeight()), new Point(0,getHeight()));\n\t\t// Draw the graded region.\n\t\tdrawGround(world_g2);\n\t\t// Draw the runway.\n\t\tdrawRunway(world_g2);\n\t\t// Draw the world to the screen.\n\t\tg2.drawImage(world_buffer, 0, 0, null);\n\t\t// Draw the overlay to the screen.\n\t\tdrawOverlay(g2);\n\t}",
"private void updateViewBounds() \r\n {\r\n assert !sim.getMap().isEmpty() : \"Visualiser needs simulator whose a map has at least one node\"; \r\n \r\n \r\n viewMinX = minX * zoomFactor;\r\n viewMinY = minY * zoomFactor;\r\n \r\n viewMaxX = maxX * zoomFactor;\r\n viewMaxY = maxY * zoomFactor;\r\n \r\n \r\n double marginLength = zoomFactor * maxCommRange;\r\n \r\n \r\n // Set the size of the component\r\n int prefWidth = (int)Math.ceil( (viewMaxX - viewMinX) + (marginLength * 2) );\r\n int prefHeight = (int)Math.ceil( (viewMaxY - viewMinY) + (marginLength * 2) );\r\n setPreferredSize( new Dimension( prefWidth, prefHeight ) );\r\n \r\n \r\n // Adjust for margin lengths \r\n viewMinX -= marginLength;\r\n viewMinY -= marginLength;\r\n \r\n viewMaxX += marginLength;\r\n viewMaxY += marginLength;\r\n }",
"private void render() {\n\t\tBufferStrategy bs = this.getBufferStrategy();\r\n\t\tif (bs == null) {\r\n\t\t\tcreateBufferStrategy(3);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//Initiates Graphics class using bufferStrategy\r\n\t\tGraphics g = bs.getDrawGraphics();\r\n\t\t\r\n\t\t//displays img on screen\r\n\t\tg.drawImage(img, 0, 0, null);\r\n\t\t\r\n\t\tg.setColor(Color.CYAN);\r\n\t\tg.drawString(fps + \" FPS\", 10, 10);\r\n\t\tg.setFont(new Font(\"Arial\", 0, 45));\r\n\r\n\t\tg.dispose();//clears graphics\r\n\t\tbs.show();//shows graphics\r\n\t}",
"@Override\n public void render(Graphics g) {\n\n g.drawImage(displayedImage, x, y, null);\n\n if(Game.showHitbox) {\n g.setColor(Color.green);\n g.drawRect(x, y, 64, 64);\n }\n }",
"public Affine.Point viewportToWorld(Affine.Point dst, Point src) {\n if (dst == null) {\n dst = new Affine.Point();\n }\n dst.x = viewportToWorldX(src.x);\n dst.y = viewportToWorldY(src.y);\n return dst;\n }",
"@java.lang.Override\n public int getViewportIndex() {\n return viewportIndex_;\n }",
"private void transformAndDraw(GraphicsContext gc, Image image, double x, double y) {\n\t\t\n\t\tgc.save(); // saves the current state on stack, including the current transform\n\n\t\t//draws image at the specified locations x,y with given heights and widths of image\n\t\tgc.drawImage(image, 0, 0, imgWidthOrig, imgHeightOrig, x, y, imgWidth, imgHeight);\n\n\t\t\n\t}",
"abstract public void projection(GL gl,\n int width, int height);",
"public EasyAnimatorSVGViewImpl(Appendable output, int width, int height) throws\n IllegalArgumentException {\n super(output);\n if (width <= 0 || height <= 0) {\n throw new IllegalArgumentException(\"Width and height have to be greater than 0.\");\n }\n this.myStringBuilder = new StringBuilder(); // StringBuilder that gathers all input from model\n // and converts it to svg code as a String.\n this.height = height;\n this.width = width;\n this.initScene();\n }",
"private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }",
"public void render(Graphics g)\n\t{\n\t\tint xStart = (int)Math.max(0, handler.getGameCamera().getxOffset()/ Tile.TILEWIDTH);\n\t\tint xEnd = (int)Math.min(width, (handler.getGameCamera().getxOffset() + handler.getWidth())/ Tile.TILEWIDTH + 1);\n\t\tint yStart = (int)Math.max(0, handler.getGameCamera().getyOffset()/ Tile.TILEHEIGHT);\n\t\tint yEnd = (int)Math.min(height, (handler.getGameCamera().getyOffset() + handler.getHeight())/ Tile.TILEHEIGHT + 1);\n\t\t\n\t\t//renders all the tiles \n\t\tfor(int y = yStart; y < yEnd; y++)\n\t\t{\n\t\t\tfor(int x = xStart; x < xEnd; x++)\n\t\t\t{\n\t\t\t\tgetTile(x, y).render(g, (int)(x * Tile.TILEWIDTH - handler.getGameCamera().getxOffset()),(int) (y * Tile.TILEHEIGHT - handler.getGameCamera().getyOffset()));\n\t\t\t}\n\t\t}\n\t\t\n\t\t//GameObjects\n\t\tgameObjectManger.render(g);\n\t}",
"public void drawImage(float x, float y, float width, float height,\n\t\t\tColor color);",
"public BufferedImage getImageView(int width, int height) {\n\n\t\tif (width < 0 || height < 0) {\n\t\t\tthrow new IllegalArgumentException(\"view width and view height should be greater than zero\");\n\t\t}\n\t\t\n\t\tif(view.getPlaceHolderAxisNorth() + view.getPlaceHolderAxisSouth() > height ){\n\t\t\tthrow new IllegalArgumentException(\"height is too small, holder north(\"+view.getPlaceHolderAxisNorth()+\") + south(\"+view.getPlaceHolderAxisSouth()+\") size are greater than height(\"+height+\")\");\n\t\t}\n\t\tif(view.getPlaceHolderAxisWest() + view.getPlaceHolderAxisEast() > width ){\n\t\t\tthrow new IllegalArgumentException(\"width is too small, holder west(\"+view.getPlaceHolderAxisWest()+\") + east(\"+view.getPlaceHolderAxisEast()+\") size are greater than width(\"+width+\")\");\n\t\t}\n\t\t\n\n\t\t// image view\n\t\tBufferedImage viewImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n\t\tGraphics viewGraphics = viewImage.getGraphics();\n\n\t\tGraphics2D g2d = (Graphics2D) viewGraphics;\n\n\t\t\n\t\tDimension old = view.getSize();\n\t\t\n\t\tview.setSize(new Dimension(width, height));\n\n\t\t// component part\n\t\tViewPartComponent northPart = (ViewPartComponent) view.getViewPartComponent(ViewPart.North);\n\t\tViewPartComponent southPart = (ViewPartComponent) view.getViewPartComponent(ViewPart.South);\n\t\tViewPartComponent eastPart = (ViewPartComponent) view.getViewPartComponent(ViewPart.East);\n\t\tViewPartComponent westPart = (ViewPartComponent) view.getViewPartComponent(ViewPart.West);\n\t\tDevicePartComponent devicePart = (DevicePartComponent) view.getViewPartComponent(ViewPart.Device);\n\n\t\t// size component\n\t\tnorthPart.setSize(width, view.getPlaceHolderAxisNorth());\n\t\tsouthPart.setSize(width, view.getPlaceHolderAxisSouth());\n\t\teastPart.setSize(view.getPlaceHolderAxisEast(), view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth());\n\t\twestPart.setSize(view.getPlaceHolderAxisWest(), view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth());\n\t\tdevicePart.setSize(view.getWidth() - view.getPlaceHolderAxisWest() - view.getPlaceHolderAxisEast(), view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth());\n\n\t\t// buffered image\n\n\t\tBufferedImage northImage = null;\n\t\tif (view.getPlaceHolderAxisNorth() > 0) {\n\t\t\tnorthImage = new BufferedImage(view.getWidth(), view.getPlaceHolderAxisNorth(), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D ng2d = (Graphics2D) northImage.getGraphics();\n\t\t\tnorthPart.paintComponent(ng2d);\n\t\t\tng2d.dispose();\n\n\t\t}\n\n\t\tBufferedImage southImage = null;\n\t\tif (view.getPlaceHolderAxisSouth() > 0) {\n\t\t\tsouthImage = new BufferedImage(view.getWidth(), view.getPlaceHolderAxisSouth(), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D sg2d = (Graphics2D) southImage.getGraphics();\n\t\t\tsouthPart.paintComponent(sg2d);\n\t\t\tsg2d.dispose();\n\n\t\t}\n\n\t\tBufferedImage eastImage = null;\n\t\tif (view.getPlaceHolderAxisEast() > 0) {\n\t\t\teastImage = new BufferedImage(view.getPlaceHolderAxisEast(), view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth(), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D eg2d = (Graphics2D) eastImage.getGraphics();\n\t\t\teastPart.paintComponent(eg2d);\n\t\t\teg2d.dispose();\n\n\t\t}\n\n\t\tBufferedImage westImage = null;\n\t\tif (view.getPlaceHolderAxisWest() > 0) {\n\t\t\twestImage = new BufferedImage(view.getPlaceHolderAxisWest(), view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth(), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D wg2d = (Graphics2D) westImage.getGraphics();\n\t\t\twestPart.paintComponent(wg2d);\n\t\t\twg2d.dispose();\n\n\t\t}\n\n\t\tBufferedImage deviceImage = null;\n\t\tif (view.getWidth() - view.getPlaceHolderAxisWest() - view.getPlaceHolderAxisEast() > 0 && view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth() > 0) {\n\t\t\tdeviceImage = new BufferedImage(view.getWidth() - view.getPlaceHolderAxisWest() - view.getPlaceHolderAxisEast(), view.getHeight() - view.getPlaceHolderAxisNorth() - view.getPlaceHolderAxisSouth(), BufferedImage.TYPE_INT_ARGB);\n\t\t\tGraphics2D dg2d = (Graphics2D) deviceImage.getGraphics();\n\t\t\tdevicePart.paintComponent(dg2d);\n\t\t\tdg2d.dispose();\n\n\t\t}\n\n\t\t// paint in image view\n\n\t\tRenderingHints qualityHints = new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);\n\t\tqualityHints.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t qualityHints.put(RenderingHints.KEY_DITHERING,\n\t\t RenderingHints.VALUE_DITHER_ENABLE);\n\t\t// qualityHints.put(RenderingHints.KEY_ALPHA_INTERPOLATION,\n\t\t// RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY);\n\t\t// qualityHints.put(RenderingHints.KEY_RENDERING,\n\t\t// RenderingHints.VALUE_RENDER_QUALITY);\n\t\t// qualityHints.put(RenderingHints.KEY_COLOR_RENDERING,\n\t\t// RenderingHints.VALUE_COLOR_RENDER_QUALITY);\n\t\t// qualityHints.put(RenderingHints.KEY_INTERPOLATION,\n\t\t// RenderingHints.VALUE_INTERPOLATION_BICUBIC);\n\t\t// qualityHints.put(RenderingHints.KEY_FRACTIONALMETRICS,\n\t\t// RenderingHints.VALUE_FRACTIONALMETRICS_ON);\n\t\tg2d.setRenderingHints(qualityHints);\n\n\t\tif (view.getBackgroundPainter() != null) {\n\t\t\tview.getBackgroundPainter().paintViewBackground(view,width,height, g2d);\n\t\t}\n\n\t\tif (northImage != null) {\n\t\t\tg2d.drawImage(northImage, 0, 0, northImage.getWidth(), northImage.getHeight(), null);\n\t\t}\n\n\t\tif (southImage != null) {\n\t\t\tg2d.drawImage(southImage, 0, view.getHeight() - view.getPlaceHolderAxisSouth(), southImage.getWidth(), southImage.getHeight(), null);\n\t\t\tsouthImage.flush();\n\t\t}\n\n\t\tif (eastImage != null) {\n\t\t\tg2d.drawImage(eastImage, view.getWidth() - view.getPlaceHolderAxisEast(), view.getPlaceHolderAxisNorth(), eastImage.getWidth(), eastImage.getHeight(), null);\n\t\t\teastImage.flush();\n\t\t}\n\n\t\tif (westImage != null) {\n\t\t\tg2d.drawImage(westImage, 0, view.getPlaceHolderAxisNorth(), westImage.getWidth(), westImage.getHeight(), null);\n\t\t\twestImage.flush();\n\t\t}\n\n\t\tif (deviceImage != null) {\n\t\t\tg2d.drawImage(deviceImage, view.getPlaceHolderAxisWest(), view.getPlaceHolderAxisNorth(), deviceImage.getWidth(), deviceImage.getHeight(), null);\n\t\t\tdeviceImage.flush();\n\t\t}\n\n\t\tg2d.dispose();\n\t\tviewImage.flush();\n\n\t\t\n\t\tif(old != null)\n\t\t\tview.setSize(old);\n\t\treturn viewImage;\n\t}",
"public void draw(Graphics graphics);",
"public static void renderImage(Image image , double x , double y , double width , double height) {\n\t\t//Find out what rendering mode to use\n\t\tif (! Settings.Android && Settings.Video.OpenGL)\n\t\t\t//Render the image using OpenGL\n\t\t\tBasicRendererOpenGL.renderImage(image , x , y , width , height);\n\t\telse if (! Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render the image using Java\n\t\t\tBasicRendererJava.renderImage(image , x , y , width , height);\n\t\telse if (Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render the image using Android\n\t\t\tBasicRendererAndroid.renderImage(image , x , y , width , height);\n\t}",
"public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"public void render(Graphics g) {\n\t}",
"public abstract void draw( Graphics2D gtx );",
"public void drawRect(float x, float y, float width, float height) {\n float x1 = margins.computeX(x), y1 = margins.computeY(y);\n float x2 = margins.computeX(x + width), y2 = margins.computeY(y + height);\n buffer(() -> {\n GL15.glBufferData(GL15.GL_ARRAY_BUFFER, new float[]{\n x1, y1, 0F, 0F,\n x2, y1, 1F, 0F,\n x2, y2, 1F, 1F,\n x1, y2, 0F, 1F\n }, GL15.GL_STREAM_DRAW);\n GL11.glDrawArrays(GL11.GL_QUADS, 0, 4);\n });\n }",
"public void paint(Graphics2D graphics, Rectangle paintArea, AffineTransform transform) {\n if ((graphics == null) || (paintArea == null)) {\n LOGGER.info(\"renderer passed null arguments\");\n \n return;\n }\n \n AffineTransform at = transform;\n \n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.fine(\"Affine Transform is \" + at);\n }\n \n /* If we are rendering to a component which has already set up some\n * form of transformation then we can concatenate our\n * transformation to it. An example of this is the ZoomPane\n * component of the swinggui module.*/\n if (concatTransforms) {\n AffineTransform atg = graphics.getTransform();\n atg.concatenate(at);\n graphics.setTransform(atg);\n } else {\n graphics.setTransform(at);\n }\n \n setScaleDenominator(1 / graphics.getTransform().getScaleX());\n \n try {\n // set the passed graphic as the current graphic but\n // be sure to release it before\n this.graphics = graphics;\n \n Layer[] layers = context.getLayerList().getLayers();\n \n for (int l = 0; l < layers.length; l++) {\n Layer layer = layers[l];\n \n if (!layer.getVisability()) {\n // Only render layer when layer is visible\n continue;\n }\n \n FeatureCollection fc = layer.getFeatures();\n \n try {\n mapExtent = this.context.getBbox().getAreaOfInterest();\n \n if (LOGGER.isLoggable(Level.FINE)) {\n LOGGER.fine(\"renderering \" + fc.size() + \" features\");\n }\n \n // extract the feature type stylers from the style object\n // and process them\n processStylers(fc, layer.getStyle().getFeatureTypeStyles());\n } catch (Exception exception) {\n LOGGER.warning(\"Exception \" + exception + \" rendering layer \" + layer);\n exception.printStackTrace();\n }\n }\n } finally {\n this.graphics = null;\n }\n }",
"public JViewport getViewport() {\n/* 938 */ return this.viewport;\n/* */ }",
"private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }",
"public static void render(FPoint2 viewPt) {\n V.fillCircle(viewPt, V.getScale() * .4);\n }",
"public void render(){\n\t\tBufferStrategy bs = frame.getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tframe.createBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\trenderGraphics(bs);\n\t}",
"public void paint (Graphics g) {\n Rectangle bbox = getBounds (); // find the window size\n paintBox (g, 0, 0, bbox.width, bbox.height); // draw something!\n }",
"@Override\n\tpublic void draw(Graphics g) {\n\t\tthis.canvas.drawImage(g, this.image.getImage(), this.position.x, this.position.y);\n\t}",
"@Override\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(curr_img, x, y, null);\n\t}",
"void drawOnCanvas(@NonNull Canvas canvas, float minX, float minY, float maxX, float maxY);",
"public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }",
"boolean inViewport(final int index) {\n resetViewport(start);\n return index >= start && index <= end;\n }",
"public void Draw(Graphics2D g2d)\n {\n this.Update();\n \n for (int i = 0; i < xPositions.length; i++)\n {\n g2d.drawImage(image, (int)xPositions[i], yPosition, null);\n }\n }",
"public static void renderImage(Image image , double x , double y) {\n\t\t//Find out what rendering mode to use\n\t\tif (! Settings.Android && Settings.Video.OpenGL)\n\t\t\t//Render the image using OpenGL\n\t\t\tBasicRendererOpenGL.renderImage(image , x , y);\n\t\telse if (! Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render the image using Java\n\t\t\tBasicRendererJava.renderImage(image , x , y);\n\t\telse if (Settings.Android && ! Settings.Video.OpenGL)\n\t\t\t//Render the image using Android\n\t\t\tBasicRendererAndroid.renderImage(image , x , y);\n\t}",
"@Override\n\tpublic void renderGeometry(SvgRenderContext state) {\n\t\t\n\t}",
"public void draw (Graphics g,Location loc){\n System.err.println(\"This method not yet implemented\");\n }",
"public void toUserSpace(int[] viewportCoordinate,\n float[] userSpaceCoordinate) {\n\n if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {\n throw new IllegalArgumentException();\n }\n if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {\n throw new IllegalArgumentException();\n }\n\n // Get the current screenCTM\n Transform txf = svg.getTransformState();\n\n try {\n txf = (Transform) txf.inverse();\n } catch (SVGException se) {\n throw new IllegalStateException(ERROR_NON_INVERTIBLE_SVG_TRANSFORM);\n }\n\n float[] pt = new float[2];\n pt[0] = viewportCoordinate[0];\n pt[1] = viewportCoordinate[1];\n txf.transformPoint(pt, userSpaceCoordinate);\n }",
"DeviceCoordinate transformWorldToScreen(final double x, final double y);",
"public Graphics2D createGraphics()\n {\n return this.image.createGraphics();\n }",
"public SVGViewBoxElementModel getViewBox() {\n \t\treturn viewBox;\n \t}"
] | [
"0.55511314",
"0.5547273",
"0.54712313",
"0.5297764",
"0.52970535",
"0.5212562",
"0.51733404",
"0.51716846",
"0.5157597",
"0.511784",
"0.5080748",
"0.5061125",
"0.49745646",
"0.49591258",
"0.49424583",
"0.49297017",
"0.49285853",
"0.48953986",
"0.48717847",
"0.48478654",
"0.4832108",
"0.4804834",
"0.4801594",
"0.47893965",
"0.47759253",
"0.4751359",
"0.4731036",
"0.4727942",
"0.47202295",
"0.4719008",
"0.4713208",
"0.47128376",
"0.4710359",
"0.4667155",
"0.466485",
"0.4643827",
"0.462178",
"0.46168405",
"0.46075234",
"0.46002105",
"0.45959583",
"0.45950577",
"0.45922646",
"0.45858473",
"0.45727843",
"0.4570535",
"0.4554253",
"0.45530298",
"0.4526546",
"0.45088333",
"0.45052832",
"0.45033738",
"0.45018762",
"0.45018762",
"0.4499216",
"0.449854",
"0.44873142",
"0.448701",
"0.4473845",
"0.44647807",
"0.44637427",
"0.4443841",
"0.44350076",
"0.44332838",
"0.4427802",
"0.44257098",
"0.4421768",
"0.44083974",
"0.44007418",
"0.43989515",
"0.43921158",
"0.43859804",
"0.4383161",
"0.43777227",
"0.43712837",
"0.43700376",
"0.4367638",
"0.43605363",
"0.43575525",
"0.43569767",
"0.43533477",
"0.43382296",
"0.43142298",
"0.4310205",
"0.43080303",
"0.4304599",
"0.4300033",
"0.4298847",
"0.42903635",
"0.4288437",
"0.42864314",
"0.4285136",
"0.4285029",
"0.4284967",
"0.42743498",
"0.42728716",
"0.42712516",
"0.4267583",
"0.4262654",
"0.42619932"
] | 0.49065554 | 17 |
Maps the input viewport coordinate to an SVG user space coordinate. Input coordinates may be outside the [0, 0, viewportWidth, viewportHeight] rectangle. The transformation accounts for the SVG user space to viewport space transform due to the processing of preserveAspectRatio and viewBox on the root <svg> element as well as any user transform (see the zoom, pan and rotate methods). Using the U and F notation from the class description, the transform applied to the input coordinate is: inverse(U.F), where the inverse() function is such that inverse(U.F).U.F is equal to the identity transform. | public void toUserSpace(int[] viewportCoordinate,
float[] userSpaceCoordinate) {
if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {
throw new IllegalArgumentException();
}
if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {
throw new IllegalArgumentException();
}
// Get the current screenCTM
Transform txf = svg.getTransformState();
try {
txf = (Transform) txf.inverse();
} catch (SVGException se) {
throw new IllegalStateException(ERROR_NON_INVERTIBLE_SVG_TRANSFORM);
}
float[] pt = new float[2];
pt[0] = viewportCoordinate[0];
pt[1] = viewportCoordinate[1];
txf.transformPoint(pt, userSpaceCoordinate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void toViewportSpace(float[] userSpaceCoordinate,\n int[] viewportCoordinate) {\n if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {\n throw new IllegalArgumentException();\n }\n \n if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {\n throw new IllegalArgumentException();\n }\n \n // Get the current screenCTM\n Transform txf = svg.getTransformState();\n\n float[] pt = new float[2];\n pt[0] = viewportCoordinate[0];\n pt[1] = viewportCoordinate[1];\n txf.transformPoint(userSpaceCoordinate, pt);\n viewportCoordinate[0] = (int) pt[0];\n viewportCoordinate[1] = (int) pt[1];\n }",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"public void setTransform(Rectangle view, Rectangle2D limits) {\n this.view = view;\n\t\tRectangle2D.Double lim = (Rectangle2D.Double)limits.clone();\n xUnit = (view.width/(lim.width - lim.x));\n yUnit = (view.height/(lim.height - lim.y));\n \n if (xUnit > yUnit){\n\t\t\txUnit = yUnit;\n\t\t\tlim.width = ((view.width/xUnit) + lim.x);\n }else{\n\t\t\tyUnit = xUnit;\n\t\t\tlim.height = ((view.height/yUnit) + lim.y);\n }\n\t\t\n aux.setToIdentity();\n transform.setToIdentity();\n aux.translate(lim.x, lim.y);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.scale(1/xUnit, -1/yUnit);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.translate(0, (-1) * (view.height - 1));\n transform.concatenate(aux);\n try {\n inverse = transform.createInverse();\n \t}catch (Exception e){\n\t\t\tSystem.out.println(\"Unable to create inverse trasform\");\n\t\t}\n\t\t\n this.limits = limits;\n\t\t\n }",
"public DoubleVec invModelToView(DoubleVec pos){\n return refPoint.sub((pos.sub(refPoint)).div(zoomFactor));\n }",
"public float[] unProjectCoordinates(float x, float y) {\n\t\t// construct the input vector\n\t\tfloat[] inVec = new float[] {\n\t\t\t\t/* x: */ x, /* y: */ y, \n\t\t\t\t/* z: */ 0, /* w: */ 1\n\t\t};\n\t\t// map from window coordinates to NDC coordinates\n\t\tinVec[0] = (inVec[0] / viewportDims[0]) * 2.0f - 1.0f;\n\t\tinVec[1] = (inVec[1] / viewportDims[1]) * 2.0f - 1.0f;\n\t\tinVec[1] = -inVec[1];\n\t\t\n\t\t// get the output coordinates\n\t\tfloat[] outVec = new float[4];\n\t\tMatrix.multiplyMV(outVec, 0, reverseMatrix, 0, inVec, 0);\n\t\tif (outVec[3] == 0) \n\t\t\treturn null;\n\t\t\n\t\t// divide by the homogenous coordinates\n\t\toutVec[0] /= outVec[3];\n\t\toutVec[1] /= outVec[3];\n\t\toutVec[2] /= outVec[3];\n\t\t\n\t\treturn outVec;\n\t}",
"private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }",
"DeviceCoordinate transformWorldToScreen(final double x, final double y);",
"@Override\r\n protected Matrix4f genViewMatrix() {\r\n\r\n // refreshes the position\r\n position = calcPosition();\r\n\r\n // calculate the camera's coordinate system\r\n Vector3f[] coordSys = genCoordSystem(position.subtract(center));\r\n Vector3f right, up, forward;\r\n forward = coordSys[0];\r\n right = coordSys[1];\r\n up = coordSys[2];\r\n\r\n // we move the world, not the camera\r\n Vector3f position = this.position.negate();\r\n\r\n return genViewMatrix(forward, right, up, position);\r\n }",
"public abstract interface View {\r\n public abstract int worldToRealX(double x);\r\n\r\n public abstract int worldToRealY(double y);\r\n\r\n public abstract double realToWorldX(int x);\r\n\r\n public abstract double realToWorldY(int y);\r\n}",
"public Affine.Point viewportToWorld(Affine.Point dst, Point src) {\n if (dst == null) {\n dst = new Affine.Point();\n }\n dst.x = viewportToWorldX(src.x);\n dst.y = viewportToWorldY(src.y);\n return dst;\n }",
"public void inverse(Projection projection);",
"Vector2 unproject(Vector2 v) {\n return viewport.unproject(v);\n }",
"@Override\r\n\tpublic void stepUp(Matrix3x3f viewport)\r\n\t{\n\t\ttransform(new Vector2f(2.0f, 0.0f), 0.0f, viewport, 2.0f, 2.0f);\r\n\t}",
"public interface ICanvasTransform {\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the X axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformXScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the Y axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformYScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a point on the screen to absolute world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the canvas screen coordinate.\r\n\t * @return the corresponding world coordinate.\r\n\t */\r\n\tWorldCoordinate transformScreenToWorld(final DeviceCoordinate screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a distance in screen space to a corresponding distance\r\n\t * in world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the distance on screen.\r\n\t * @return the corresponding distance in world coordinates.\r\n\t */\r\n\tWorldDistance transformScreenDeltaToWorld(final DeviceDistance screen);\r\n\r\n\t/**\r\n\t * Transforms a world coordinate to a point on the canvas screen.\r\n\t * \r\n\t * @param x\r\n\t * the x coordinate in world space.\r\n\t * @param y\r\n\t * the y coordinate in world space.\r\n\t * @return the corresponding point on the canvas screen.\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(final double x, final double y);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(WorldCoordinate world);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tint transformWorldLengthToScreen(final double world);\r\n\r\n}",
"public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }",
"@DISPID(1034)\n @PropPut\n void viewportElement(\n ms.html.ISVGElement rhs);",
"public Vector3 unprojectHUD(int xPos, int yPos) {\n\t\tHUDCam.unproject(touchPointHUD.set(xPos, yPos, 0), viewportHUD.x, viewportHUD.y, viewportHUD.width, viewportHUD.height);\n\t\treturn touchPointHUD;\n\t}",
"private void applyWindowToViewportTransformation(Graphics2D g2,\n double left, double right, double bottom, double top,\n boolean preserveAspect) {\n int width = getWidth();\n int height = getHeight();\n if (preserveAspect) {\n double displayAspect = Math.abs((double) height / width);\n double requestedAspect = Math.abs((bottom - top) / (right - left));\n if (displayAspect > requestedAspect) {\n double excess = (bottom - top) * (displayAspect / requestedAspect - 1);\n bottom += excess / 2;\n top -= excess / 2;\n } else if (displayAspect < requestedAspect) {\n double excess = (right - left) * (requestedAspect / displayAspect - 1);\n right += excess / 2;\n left -= excess / 2;\n }\n }\n g2.scale(width / (right - left), height / (bottom - top));\n g2.translate(-left, -top);\n double pixelWidth = Math.abs((right - left) / width);\n double pixelHeight = Math.abs((bottom - top) / height);\n pixelSize = (float) Math.max(pixelWidth, pixelHeight);\n }",
"@DISPID(1034)\n @PropGet\n ms.html.ISVGElement viewportElement();",
"public static void bgfx_set_view_transform(@NativeType(\"bgfx_view_id_t\") int _id, @Nullable @NativeType(\"void const *\") FloatBuffer _view, @Nullable @NativeType(\"void const *\") FloatBuffer _proj) {\n if (CHECKS) {\n checkSafe(_view, 64 >> 2);\n checkSafe(_proj, 64 >> 2);\n }\n nbgfx_set_view_transform((short)_id, memAddressSafe(_view), memAddressSafe(_proj));\n }",
"public SVGViewBoxElementModel getViewBox() {\n \t\treturn viewBox;\n \t}",
"@Override\r\n\tpublic void stepBack(Matrix3x3f viewport)\r\n\t{\n\t\ttransform(new Vector2f(-2.0f, 0.0f), 0.0f, viewport, 2.0f, 2.0f);\r\n\t}",
"Point inViewPort();",
"public double viewportToWorldX(int x) {\n return xWindow + (x - xMargin - xViewport) / xScaleFactor;\n }",
"public PVector getTransformedPosition(){\n\t\treturn gui.getTransform().transform(position);\n\t}",
"public DoubleVec modelToView(DoubleVec pos){\n return refPoint.sub(pos).mult(zoomFactor).add(refPoint);\n }",
"public PortView getOutPortViewAt(int x, int y) {\r\n \t\treturn (PortView) graph.getGraphLayoutCache().getMapping(graph.getOutPortAt(x, y), false);\r\n \t}",
"@Override\n\tpublic void visit(InverseExpression arg0) {\n\n\t}",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public static void bgfx_set_view_transform(@NativeType(\"bgfx_view_id_t\") int _id, @Nullable @NativeType(\"void const *\") ByteBuffer _view, @Nullable @NativeType(\"void const *\") ByteBuffer _proj) {\n if (CHECKS) {\n checkSafe(_view, 64);\n checkSafe(_proj, 64);\n }\n nbgfx_set_view_transform((short)_id, memAddressSafe(_view), memAddressSafe(_proj));\n }",
"public final native Mat4 inverse() /*-{\n return $wnd.mat4.inverse(this, $wnd.mat4.create());\n }-*/;",
"public OMSVGPoint getCoordinates(MouseEvent<? extends EventHandler> e, boolean snap) {\n \tOMSVGMatrix m = modelGroup.getElement().<SVGGElement>cast().getScreenCTM().inverse();\n \tOMSVGPoint p = svg.createSVGPoint(e.getClientX(), e.getClientY()).matrixTransform(m);\n \treturn grid.snapsToGrid() ? grid.snap(p) : p;\n }",
"public abstract Transformation updateTransform(Rectangle selectionBox);",
"public static Vector2 touchToScreenPos()\n {\n Vector3 input = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);\n input = GdxStart.camera.unproject(input);\n return new Vector2(input.x, input.y);\n }",
"void from_screen_x_y_norot (Point3D p, int x, int y, double offx, double scalex, double offy, double scaley, int screen_off_x, int screen_off_y) { \n // screen_off_x + toInt(scalex*(offx+p.x)) = x ==>\n // scalex*p.x = x - screen_off_x - scalex*offx;\n p.x = (x - screen_off_x - scalex*offx)/scalex;\n p.y = (y - screen_off_y - scaley*offy)/scaley;\n }",
"private Point[] inverseTransformCoordinateSystem(Point[] objectPosition, Point centerOffset) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\tobjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x += centerOffset.x,\n\t\t\t\tobjectPosition[i].y += centerOffset.y\t\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"private Point3D getXAxis(Point3D eye, Point3D view, Point3D viewUp) {\n\t\t\t\tPoint3D OG = view.sub(eye).normalize();\n\t\t\t\treturn OG.vectorProduct(getYAxis(eye, view, viewUp)).normalize();\n\t\t\t}",
"public RMTransform getTransformInverse() { return getTransform().invert(); }",
"public Coordinates unitVector(Coordinates vector);",
"public PortView getInPortViewAt(int x, int y) {\r\n \t\treturn (PortView) graph.getGraphLayoutCache().getMapping(graph.getInPortAt(x, y), false);\r\n \t}",
"public Coordinate toGlobal(Coordinate deviceGlobalPose){\n\t\tdouble x_mm=x/Device.ppmX;\n\t\tdouble y_mm=y/Device.ppmY;\n\t\t\n\t\tdouble cos=Math.cos(deviceGlobalPose.a);\n\t\tdouble sin=Math.sin(deviceGlobalPose.a);\n\t\t\n\t\tdouble x_gl=x_mm*cos-y_mm*sin+deviceGlobalPose.x;\n\t\tdouble y_gl=x_mm*sin+y_mm*cos+deviceGlobalPose.y;\n\t\tdouble a_gl=a+deviceGlobalPose.a;\n\t\t\n\t\treturn new Coordinate(x_gl,y_gl,a_gl);\n\t}",
"GridGeometry invertGridGeometry(Map<String, Object> input, Query targetQuery,\n GridGeometry targetGridGeometry) throws ProcessException;",
"public\n Projection project ( double x , double y , double z , ClampMode clampModeOutside , boolean extrudeInverted ) {\n boolean outsideFrustum;\n if ( this.viewport == null || this.modelview == null || this.projection == null )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n Vector3D posVec = new Vector3D ( x , y , z );\n boolean[] frustum = this.doFrustumCheck ( this.frustum , this.frustumPos , x , y , z );\n boolean bl = outsideFrustum = frustum[0] || frustum[1] || frustum[2] || frustum[3];\n if ( outsideFrustum ) {\n boolean outsideInvertedFrustum;\n boolean opposite = posVec.sub ( this.frustumPos ).dot ( this.viewVec ) <= 0.0;\n boolean[] invFrustum = this.doFrustumCheck ( this.invFrustum , this.frustumPos , x , y , z );\n boolean bl2 = outsideInvertedFrustum = invFrustum[0] || invFrustum[1] || invFrustum[2] || invFrustum[3];\n if ( extrudeInverted && ! outsideInvertedFrustum || outsideInvertedFrustum && clampModeOutside != ClampMode.NONE ) {\n if ( extrudeInverted && ! outsideInvertedFrustum || clampModeOutside == ClampMode.DIRECT && outsideInvertedFrustum ) {\n double vecX = 0.0;\n double vecY = 0.0;\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n if ( opposite ) {\n vecX = this.displayWidth * this.widthScale - (double) this.coords.get ( 0 ) * this.widthScale - this.displayWidth * this.widthScale / 2.0;\n vecY = this.displayHeight * this.heightScale - ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale - this.displayHeight * this.heightScale / 2.0;\n } else {\n vecX = (double) this.coords.get ( 0 ) * this.widthScale - this.displayWidth * this.widthScale / 2.0;\n vecY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale - this.displayHeight * this.heightScale / 2.0;\n }\n Vector3D vec = new Vector3D ( vecX , vecY , 0.0 ).snormalize ( );\n vecX = vec.x;\n vecY = vec.y;\n Line vectorLine = new Line ( this.displayWidth * this.widthScale / 2.0 , this.displayHeight * this.heightScale / 2.0 , 0.0 , vecX , vecY , 0.0 );\n double angle = Math.toDegrees ( Math.acos ( vec.y / Math.sqrt ( vec.x * vec.x + vec.y * vec.y ) ) );\n if ( vecX < 0.0 ) {\n angle = 360.0 - angle;\n }\n Vector3D intersect = new Vector3D ( 0.0 , 0.0 , 0.0 );\n intersect = angle >= this.bra && angle < this.tra ? this.rb.intersect ( vectorLine ) : ( angle >= this.tra && angle < this.tla ? this.tb.intersect ( vectorLine ) : ( angle >= this.tla && angle < this.bla ? this.lb.intersect ( vectorLine ) : this.bb.intersect ( vectorLine ) ) );\n return new Projection ( intersect.x , intersect.y , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( clampModeOutside != ClampMode.ORTHOGONAL || ! outsideInvertedFrustum )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n if ( opposite ) {\n guiX = this.displayWidth * this.widthScale - guiX;\n guiY = this.displayHeight * this.heightScale - guiY;\n }\n if ( guiX < 0.0 ) {\n guiX = 0.0;\n } else if ( guiX > this.displayWidth * this.widthScale ) {\n guiX = this.displayWidth * this.widthScale;\n }\n if ( guiY < 0.0 ) {\n guiY = 0.0;\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n } else {\n if ( ! ( guiY > this.displayHeight * this.heightScale ) )\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n guiY = this.displayHeight * this.heightScale;\n }\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n if ( ! opposite )\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n guiX = this.displayWidth * this.widthScale - guiX;\n guiY = this.displayHeight * this.heightScale - guiY;\n return new Projection ( guiX , guiY , outsideInvertedFrustum ? Projection.Type.OUTSIDE : Projection.Type.INVERTED );\n }\n if ( ! GLU.gluProject ( (float) x , (float) y , (float) z , this.modelview , this.projection , this.viewport , this.coords ) )\n return new Projection ( 0.0 , 0.0 , Projection.Type.FAIL );\n double guiX = (double) this.coords.get ( 0 ) * this.widthScale;\n double guiY = ( this.displayHeight - (double) this.coords.get ( 1 ) ) * this.heightScale;\n return new Projection ( guiX , guiY , Projection.Type.INSIDE );\n }",
"public Point2D.Float getScreenToGameCoords(double screenX, double screenY) {\n\t\treturn cam.unproject((float) screenX, (float) screenY);\n\t}",
"float[] getViewMatrix();",
"void transformPage(View page, float position);",
"public Grid2DFloat vectorUGrid() {\n Grid2DFloat mGrid = getMagGrid();\n Grid2DFloat dGrid = getDirGrid();\n Grid2DFloat uGrid = new Grid2DFloat(mGrid.getXdim(), mGrid.getYdim());\n int i, j;\n for (i = 0; i < uGrid.getXdim(); i++) {\n for (j = 0; j < uGrid.getYdim(); j++) {\n float angle = (float) Math.toRadians(dGrid.get(i, j));\n uGrid.set(i, j, (float) (Math.sin(angle) * mGrid.get(i, j)));\n }\n }\n return uGrid;\n }",
"public Point2D.Float getScreenToGameCoords(int screenX, int screenY) {\n\t\treturn cam.unproject((float) screenX, (float) screenY);\n\t}",
"public void transform(float a11, float a12, float a21, float a22, float x, float y);",
"public Coordinates unitVector(Coordinates vector, Coordinates origin);",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"private void calculateViewportOffset (int[] xy, int visitorX, int visitorY) {\n Image mapImage = cityMap.getMapImage ();\n\n int mapWidth = mapImage.getWidth ();\n int mapHeight = mapImage.getHeight ();\n\n int vpWidth = getWidth ();\n int vpHeight = getHeight ();\n\n int x = visitorX - (vpWidth / 2);\n int y = visitorY - (vpHeight / 2);\n\n if ((x + vpWidth) > mapWidth) {\n x = mapWidth - vpWidth;\n }\n\n if ((y + vpHeight) > mapHeight) {\n y = mapHeight - vpHeight;\n }\n\n if (x < 0) {\n x = 0;\n }\n\n if (y < 0) {\n y = 0;\n }\n\n xy[X] = x;\n xy[Y] = y;\n }",
"public void setUV(float u0, float v0,\n float u1, float v1,\n float u2, float v2) {\n // sets & scales uv texture coordinates to center of the pixel\n u_array[0] = (u0 * F_TEX_WIDTH + 0.5f) * 65536f;\n u_array[1] = (u1 * F_TEX_WIDTH + 0.5f) * 65536f;\n u_array[2] = (u2 * F_TEX_WIDTH + 0.5f) * 65536f;\n v_array[0] = (v0 * F_TEX_HEIGHT + 0.5f) * 65536f;\n v_array[1] = (v1 * F_TEX_HEIGHT + 0.5f) * 65536f;\n v_array[2] = (v2 * F_TEX_HEIGHT + 0.5f) * 65536f;\n }",
"public void setToCoordinates(int toX, int toY);",
"public static PVector fromScreen( PVector in ) {\n\t\tfloat x = PApplet.norm( in.x, 0, screenSize[0] );\n\t\tfloat y = PApplet.norm( in.y, 0, screenSize[1] );\n\t\treturn new PVector( x, y );\n\t}",
"private void setMToIdentity()\n\t\t{\n\t\t\tfor(rowNumber = 0; rowNumber < 4; rowNumber++)\n\t\t\t\tfor(int column = 0; column < 4; column++)\n\t\t\t\t{\n\t\t\t\t\tif(rowNumber == column)\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 0;\n\t\t\t\t}\n\t\t\ttransform = new Transform3D(mElements);\n\t\t\trowNumber = 0;\n\t\t}",
"public void setFromCoordinates(int fromX, int fromY);",
"public Rectangle.Double viewportToWorld(Rectangle.Double dst, Rectangle src) {\n if (dst == null) {\n dst = new Rectangle.Double();\n }\n double x = viewportToWorldX(src.x);\n double y = viewportToWorldY(src.y);\n double width = src.width / xScaleFactor;\n double height = src.height / yScaleFactor;\n dst.setFrameFromDiagonal(x, y, x + width, y + height);\n return dst;\n }",
"public int worldToViewportX(double x) {\n return (int)(0.5 + xMargin + xViewport + (x - xWindow) * xScaleFactor);\n }",
"private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }",
"godot.wire.Wire.Transform2D getTransform2DValue();",
"public double getUserFriendlyXPos(){\n return xPos - myGrid.getWidth()/ HALF;\n }",
"protected synchronized void resetModelViewMatrix()\n {\n Matrix4d transform = new Matrix4d();\n // translate so that the viewer is at the origin\n Matrix4d translation = new Matrix4d();\n translation.setTranslation(myPosition.getLocation().multiply(-1.));\n // rotate to put the viewer pointing in the -z direction with the up\n // vector along the +y axis.\n Quaternion quat = Quaternion.lookAt(myPosition.getDir().multiply(-1.), myPosition.getUp());\n Matrix4d rotation = new Matrix4d();\n rotation.setRotationQuaternion(quat);\n // set the transform.\n transform.multLocal(rotation);\n transform.multLocal(translation);\n myModelViewMatrix = transform.toFloatArray();\n setInverseModelViewMatrix(transform.invert());\n clearModelToWindowTransform();\n }",
"@Test\n public void testIdentity() throws TransformException {\n create(3, 0, 1, 2);\n assertIsIdentity(transform);\n assertParameterEquals(Affine.provider(3, 3, true).getParameters(), null);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = source.clone();\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public Point worldToViewport(Point dst, Affine.Point src) {\n if (dst == null) {\n dst = new Point();\n }\n dst.x = worldToViewportX(src.x);\n dst.y = worldToViewportY(src.y);\n return dst;\n }",
"private static Vector2f toGuiCoords(float x, float y) {\r\n\t\treturn(new Vector2f((x/DisplayManager.getWidth()) - 0.5f, y/DisplayManager.getHeight()));\r\n\t}",
"public Point getXUpper()\n {\n return (Point)xUpp.clone();\n }",
"public Vector3 unprojectGame(int xPos, int yPos) {\n\t\tGAMECam.unproject(touchPointGAME.set(xPos, yPos, 0), viewportGAME.x, viewportGAME.y, viewportGAME.width, viewportGAME.height);\n\t\treturn touchPointGAME;\n\t}",
"private int getIsoX(int x, int y) {\n\t\tint rshift = (DEFAULT_VIEW_SIZE/2) - (TILE_WIDTH/2) + (x - y); //Pan camera to the right\n\t\treturn (x - y) * (TILE_WIDTH/2) + rshift;\n\t}",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"public Point2D userToDeviceSpace(\n Point2D point\n )\n {return ctm.transform(point, null);}",
"public final OMSVGElement getNearestViewportElement() {\n return (OMSVGElement)convert(((SVGTextElement)ot).getNearestViewportElement());\n }",
"public Vector3f objectToViewCoord(Matrix4f viewMatrix, Vector3f worldPosition) {\r\n\t\tVector4f objectPos4f = new Vector4f(worldPosition.x, worldPosition.y, worldPosition.z, 1f);\r\n\t\tVector4f objectWorld = Matrix4f.transform(viewMatrix, objectPos4f, null);\r\n\t\treturn new Vector3f(objectWorld.x, objectWorld.y, objectWorld.z);\r\n\t}",
"private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }",
"@Override\n\tpublic Pnt2d applyTo(Pnt2d uv) {\n\t\tdouble[] xy = Ai.operate(MathUtil.toHomogeneous(uv.toDoubleArray()));\n\t\t// apply the camera's radial lens distortion in the normalized plane:\n\t\tdouble[] xyd = cam.warp(xy);\n\t\t// apply the (forward) camera mapping to get the undistorted sensor point (u',v'):\n\t\treturn PntDouble.from(cam.mapToSensorPlane(xyd));\n\t}",
"private Vector3d convertToModelAnswer()\r\n {\r\n GeographicPosition pos = (GeographicPosition)EasyMock.getCurrentArguments()[0];\r\n\r\n return pos.asVector3d();\r\n }",
"public PointF modelToView(PointF p){\n\t\tPointF q = new PointF(p.x/zoom,height-p.y/zoom);\n\t\treturn q;\t\t\n\t}",
"private float normalizedToScreen(double normalizedCoord) {\n return (float) (padding + normalizedCoord * (getWidth() - 2 * padding));\n }",
"public Vector3d screenToModelPointVector(Vector2i pos)\n {\n double adjustedX = pos.getX() - getViewOffset().getX();\n double adjustedY = pos.getY() - getViewOffset().getY();\n // get the percentage of the screen for the positions\n // then use that to get the angles off of the viewer\n // Intersect those with the earth to get the actual selection points.\n double fromXpct = adjustedX / getViewportWidth() - 0.5;\n double fromYpct = adjustedY / getViewportHeight() - 0.5;\n double fromXAngleChange = -fromXpct * myHalfFOVx * 2.;\n double fromYAngleChange = -fromYpct * myHalfFOVy * 2.;\n return rotateDir(fromXAngleChange, fromYAngleChange).getNormalized();\n }",
"public void setuMVPMatrix(float[] mvpMatrix)\n {\n GLES20.glUniformMatrix4fv(uMVPMatrix, 1, false, mvpMatrix, 0);\n }",
"public float toWorldCoordinateX(float mouseX){\n \treturn (mouseX/zoom) - (parent.width/zoom/2) + position.x;\n }",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"void glViewport(int x, int y, int width, int height);",
"public void transform(View view) {\n DrawRect.getCoord(1);\n\n // block to get coord os ROI\n ArrayList<Integer> full_x_ROIcoord = new ArrayList<>();\n ArrayList<Integer> full_y_ROIcoord = new ArrayList<>();\n\n if (xRed < 0 || xRed > 750 || yRed < 0 || yRed > 1000 ||\n xOrg < 0 || xOrg > 750 || yOrg < 0 || yOrg > 1000 ||\n xYell < 0 || xYell > 750 || yYell < 0 || yYell > 1000 ||\n xGreen < 0 || xGreen > 750 || yGreen < 0 || yGreen > 1000) {\n return;\n } else {\n // clear situation with x<= xYell\n for (int x = xRed; x < xYell; x++) {\n for (int y = yRed; y < yYell; y++) {\n full_x_ROIcoord.add(x);\n full_y_ROIcoord.add(y);\n }\n }\n }\n // end block\n\n // block get contour via CannyFilter\n Mat sMat = oImage.submat(yRed, yGreen, xRed, xOrg);\n Imgproc.Canny(sMat, sMat, 25, 100 * 2);\n ArrayList<Double> subMatValue = new ArrayList<>();\n\n for (int x = 0; x < sMat.cols(); x++) {\n for (int y = 0; y < sMat.rows(); y++) {\n double[] ft2 = sMat.get(y, x);\n subMatValue.add(ft2[0]);\n }\n }\n int count = 0;\n for (int x = xRed; x < xYell; x++) {\n for (int y = yRed; y < yYell; y++) {\n oImage.put(y, x, subMatValue.get(count));\n count++;\n }\n }\n // end block\n\n displayImage(oImage);\n }",
"public final native void transform(String transform, Element node) /*-{ this.transform(transform, node) }-*/;",
"public void setTransform(Transform transform);",
"public WorldToScreenTransform getWorldToScreenTransform() { return this; }",
"Query invertQuery(Map<String, Object> input, Query targetQuery, GridGeometry gridGeometry) throws ProcessException;",
"public CoordinateSystem() {\r\n\t\torigin = new GuiPoint(0, 0);\r\n\t\tzoomFactor = 1f;\r\n\t}",
"private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}",
"public Coordinate pixelToWorld(int x, int y, Envelope map) {\n if (graphics == null) {\n LOGGER.info(\"no graphics yet deffined\");\n \n return null;\n }\n \n //set up the affine transform and calculate scale values\n AffineTransform at = setUpTransform(map, screenSize);\n \n /* If we are rendering to a component which has already set up some form\n * of transformation then we can concatenate our transformation to it.\n * An example of this is the ZoomPane component of the swinggui module.*/\n if (concatTransforms) {\n graphics.getTransform().concatenate(at);\n } else {\n graphics.setTransform(at);\n }\n \n try {\n Point2D result = at.inverseTransform(new java.awt.geom.Point2D.Double(x, y),\n new java.awt.geom.Point2D.Double());\n Coordinate c = new Coordinate(result.getX(), result.getY());\n \n return c;\n } catch (Exception e) {\n LOGGER.warning(e.toString());\n }\n \n return null;\n }",
"public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}",
"private double screenToNormalized(float screenCoord) {\n int width = getWidth();\n if (width <= 2 * padding) {\n // prevent division by zero, simply return 0.\n return 0d;\n } else {\n double result = (screenCoord - padding) / (width - 2 * padding);\n return Math.min(1d, Math.max(0d, result));\n }\n }",
"public UserView createUserView() {\r\n return new IGAFitnessPlotView();\r\n }",
"private void adjustEViewPosition() {\n double aVec[] = theRocket.getCoordSys().getPositionVec();\n CoordSys eViewSys = new CoordSys();\n eViewSys.setZAxis(VMath.normalize(aVec));\n\n aVec = VMath.vecMultByScalar(aVec, 2.5);\n eViewSys.setPositionAsVec(aVec);\n\n double[] zAxis = VMath.normalize(eViewSys.zAxis().getVectorForm());\n double[] yAxis = VMath.normalize(theRocket.getCoordSys().yAxis().getVectorForm());\n double[] xAxis = VMath.normalize(VMath.crossprd(yAxis, zAxis));\n yAxis = VMath.crossprd(zAxis, xAxis);\n eViewSys.setXAxis(xAxis);\n eViewSys.setYAxis(yAxis);\n eViewSys.setZAxis(zAxis);\n\n eViewSys.xRotate(180);\n eViewSys.zRotate(-90);\n eView.setViewingCoordSys(eViewSys);\n }",
"public Vector2df guiToCoordinate(GuiPoint point) {\r\n\t\tint guiX = point.x;\r\n\t\tint guiY = point.y;\r\n\t\tfloat zoom = 1.0f / zoomFactor;\r\n\t\tint coordX = Math.round((guiX - origin.x) * zoom);\r\n\t\tint coordY = Math.round((guiY - origin.y) * zoom);\r\n\t\tVector2df pos = new Vector2df(coordX, coordY);\r\n\t\treturn pos;\r\n\t}",
"private void userInput(){\n if(mousePressed){\n rX -= (mouseY - pmouseY) * 0.002f;//map(mouseY,0,height,-PI,PI);\n rY -= (mouseX - pmouseX) * 0.002f;// map(mouseX,0,width,PI,-PI);\n }\n rotateX(rX);\n rotateY(rY);\n\n if(keyPressed){\n if(keyCode == UP){\n zoom += 0.01f;\n }\n if(keyCode == DOWN){\n zoom -= 0.01f;\n }\n }\n }",
"public void setView(Rectangle2D bounds) {\r\n if (bounds == null) {\r\n return;\r\n }\r\n Rectangle2D old = getView();\r\n defaultView = new Rectangle2D.Double(bounds.getX(), bounds.getY(),\r\n bounds.getWidth(), bounds.getHeight());\r\n \r\n minX = defaultView.getMinX();\r\n maxX = defaultView.getMaxX();\r\n minY = defaultView.getMinY();\r\n maxY = defaultView.getMaxY();\r\n \r\n majorX = defaultMajorX;\r\n majorY = defaultMajorY;\r\n firePropertyChange(\"view\", old, getView());\r\n repaint();\r\n }"
] | [
"0.63020337",
"0.52207303",
"0.51171327",
"0.49520612",
"0.4946528",
"0.4897498",
"0.48944974",
"0.48605463",
"0.47922677",
"0.46967703",
"0.46762478",
"0.46680734",
"0.4654633",
"0.46348011",
"0.46110725",
"0.45979896",
"0.45891306",
"0.45836955",
"0.45601293",
"0.45357284",
"0.44860116",
"0.44740373",
"0.44664997",
"0.44585738",
"0.44480926",
"0.44151726",
"0.44081122",
"0.43820503",
"0.43798485",
"0.4378454",
"0.4353649",
"0.4320204",
"0.43135345",
"0.4303599",
"0.42991602",
"0.42972404",
"0.42963916",
"0.42951414",
"0.42877337",
"0.42838174",
"0.42737606",
"0.42585993",
"0.42394328",
"0.42244178",
"0.4219359",
"0.42002925",
"0.41984606",
"0.4196539",
"0.41964987",
"0.41888317",
"0.4185358",
"0.41827548",
"0.41824037",
"0.4181486",
"0.41757348",
"0.41702205",
"0.41674587",
"0.41623175",
"0.4158211",
"0.41481635",
"0.41335335",
"0.41323793",
"0.41295636",
"0.41269886",
"0.41180897",
"0.41026163",
"0.40979797",
"0.40932402",
"0.409254",
"0.4089941",
"0.40894964",
"0.40887663",
"0.40797555",
"0.40755966",
"0.40534475",
"0.40532994",
"0.4051187",
"0.4048605",
"0.40401697",
"0.40244064",
"0.40119973",
"0.40105265",
"0.4009316",
"0.40085036",
"0.40078986",
"0.40046355",
"0.40021962",
"0.39969572",
"0.39896718",
"0.39871705",
"0.39795578",
"0.39748642",
"0.39667183",
"0.39639658",
"0.39631367",
"0.39624265",
"0.39595395",
"0.39567104",
"0.39328203",
"0.39320678"
] | 0.6943398 | 0 |
Maps the input SVG user space coordinate to a viewport coordinate. The transformation applied includes the user space to viewport space transform due to the processing of preserveAspectRatio and viewBox on the root <svg> element as well as any user transform (see the zoom, pan and rotate methods).Using the U and F notation from the class description, the transform applied to the input coordinate is: U.F Note that the resulting coordinate may be outside the [0, 0, viewportWidth, viewportHeight] rectangle. | public void toViewportSpace(float[] userSpaceCoordinate,
int[] viewportCoordinate) {
if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {
throw new IllegalArgumentException();
}
if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {
throw new IllegalArgumentException();
}
// Get the current screenCTM
Transform txf = svg.getTransformState();
float[] pt = new float[2];
pt[0] = viewportCoordinate[0];
pt[1] = viewportCoordinate[1];
txf.transformPoint(userSpaceCoordinate, pt);
viewportCoordinate[0] = (int) pt[0];
viewportCoordinate[1] = (int) pt[1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void toUserSpace(int[] viewportCoordinate,\n float[] userSpaceCoordinate) {\n\n if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {\n throw new IllegalArgumentException();\n }\n if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {\n throw new IllegalArgumentException();\n }\n\n // Get the current screenCTM\n Transform txf = svg.getTransformState();\n\n try {\n txf = (Transform) txf.inverse();\n } catch (SVGException se) {\n throw new IllegalStateException(ERROR_NON_INVERTIBLE_SVG_TRANSFORM);\n }\n\n float[] pt = new float[2];\n pt[0] = viewportCoordinate[0];\n pt[1] = viewportCoordinate[1];\n txf.transformPoint(pt, userSpaceCoordinate);\n }",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"@DISPID(1034)\n @PropGet\n ms.html.ISVGElement viewportElement();",
"public abstract interface View {\r\n public abstract int worldToRealX(double x);\r\n\r\n public abstract int worldToRealY(double y);\r\n\r\n public abstract double realToWorldX(int x);\r\n\r\n public abstract double realToWorldY(int y);\r\n}",
"public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }",
"DeviceCoordinate transformWorldToScreen(final double x, final double y);",
"public static void bgfx_set_view_transform(@NativeType(\"bgfx_view_id_t\") int _id, @Nullable @NativeType(\"void const *\") FloatBuffer _view, @Nullable @NativeType(\"void const *\") FloatBuffer _proj) {\n if (CHECKS) {\n checkSafe(_view, 64 >> 2);\n checkSafe(_proj, 64 >> 2);\n }\n nbgfx_set_view_transform((short)_id, memAddressSafe(_view), memAddressSafe(_proj));\n }",
"public Affine.Point viewportToWorld(Affine.Point dst, Point src) {\n if (dst == null) {\n dst = new Affine.Point();\n }\n dst.x = viewportToWorldX(src.x);\n dst.y = viewportToWorldY(src.y);\n return dst;\n }",
"public SVGViewBoxElementModel getViewBox() {\n \t\treturn viewBox;\n \t}",
"public static void bgfx_set_view_transform(@NativeType(\"bgfx_view_id_t\") int _id, @Nullable @NativeType(\"void const *\") ByteBuffer _view, @Nullable @NativeType(\"void const *\") ByteBuffer _proj) {\n if (CHECKS) {\n checkSafe(_view, 64);\n checkSafe(_proj, 64);\n }\n nbgfx_set_view_transform((short)_id, memAddressSafe(_view), memAddressSafe(_proj));\n }",
"private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public void setTransform(Rectangle view, Rectangle2D limits) {\n this.view = view;\n\t\tRectangle2D.Double lim = (Rectangle2D.Double)limits.clone();\n xUnit = (view.width/(lim.width - lim.x));\n yUnit = (view.height/(lim.height - lim.y));\n \n if (xUnit > yUnit){\n\t\t\txUnit = yUnit;\n\t\t\tlim.width = ((view.width/xUnit) + lim.x);\n }else{\n\t\t\tyUnit = xUnit;\n\t\t\tlim.height = ((view.height/yUnit) + lim.y);\n }\n\t\t\n aux.setToIdentity();\n transform.setToIdentity();\n aux.translate(lim.x, lim.y);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.scale(1/xUnit, -1/yUnit);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.translate(0, (-1) * (view.height - 1));\n transform.concatenate(aux);\n try {\n inverse = transform.createInverse();\n \t}catch (Exception e){\n\t\t\tSystem.out.println(\"Unable to create inverse trasform\");\n\t\t}\n\t\t\n this.limits = limits;\n\t\t\n }",
"Point inViewPort();",
"@Override\r\n protected Matrix4f genViewMatrix() {\r\n\r\n // refreshes the position\r\n position = calcPosition();\r\n\r\n // calculate the camera's coordinate system\r\n Vector3f[] coordSys = genCoordSystem(position.subtract(center));\r\n Vector3f right, up, forward;\r\n forward = coordSys[0];\r\n right = coordSys[1];\r\n up = coordSys[2];\r\n\r\n // we move the world, not the camera\r\n Vector3f position = this.position.negate();\r\n\r\n return genViewMatrix(forward, right, up, position);\r\n }",
"@DISPID(1034)\n @PropPut\n void viewportElement(\n ms.html.ISVGElement rhs);",
"public DoubleVec modelToView(DoubleVec pos){\n return refPoint.sub(pos).mult(zoomFactor).add(refPoint);\n }",
"public interface ICanvasTransform {\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the X axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformXScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a relative length along the Y axis to world\r\n\t * coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the length on screen.\r\n\t * @return the corresponding length in world coordinates.\r\n\t */\r\n\tdouble transformYScreenLengthToWorld(final double screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a point on the screen to absolute world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the canvas screen coordinate.\r\n\t * @return the corresponding world coordinate.\r\n\t */\r\n\tWorldCoordinate transformScreenToWorld(final DeviceCoordinate screen);\r\n\r\n\t/**\r\n\t * Inverse-transforms a distance in screen space to a corresponding distance\r\n\t * in world coordinates.\r\n\t * \r\n\t * @param screen\r\n\t * the distance on screen.\r\n\t * @return the corresponding distance in world coordinates.\r\n\t */\r\n\tWorldDistance transformScreenDeltaToWorld(final DeviceDistance screen);\r\n\r\n\t/**\r\n\t * Transforms a world coordinate to a point on the canvas screen.\r\n\t * \r\n\t * @param x\r\n\t * the x coordinate in world space.\r\n\t * @param y\r\n\t * the y coordinate in world space.\r\n\t * @return the corresponding point on the canvas screen.\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(final double x, final double y);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tDeviceCoordinate transformWorldToScreen(WorldCoordinate world);\r\n\r\n\t/**\r\n\t * @param world\r\n\t * @return\r\n\t */\r\n\tint transformWorldLengthToScreen(final double world);\r\n\r\n}",
"public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public PointF modelToView(PointF p){\n\t\tPointF q = new PointF(p.x/zoom,height-p.y/zoom);\n\t\treturn q;\t\t\n\t}",
"private void calculateViewportOffset (int[] xy, int visitorX, int visitorY) {\n Image mapImage = cityMap.getMapImage ();\n\n int mapWidth = mapImage.getWidth ();\n int mapHeight = mapImage.getHeight ();\n\n int vpWidth = getWidth ();\n int vpHeight = getHeight ();\n\n int x = visitorX - (vpWidth / 2);\n int y = visitorY - (vpHeight / 2);\n\n if ((x + vpWidth) > mapWidth) {\n x = mapWidth - vpWidth;\n }\n\n if ((y + vpHeight) > mapHeight) {\n y = mapHeight - vpHeight;\n }\n\n if (x < 0) {\n x = 0;\n }\n\n if (y < 0) {\n y = 0;\n }\n\n xy[X] = x;\n xy[Y] = y;\n }",
"float[] getViewMatrix();",
"@Override\r\n\tpublic void stepUp(Matrix3x3f viewport)\r\n\t{\n\t\ttransform(new Vector2f(2.0f, 0.0f), 0.0f, viewport, 2.0f, 2.0f);\r\n\t}",
"public double viewportToWorldX(int x) {\n return xWindow + (x - xMargin - xViewport) / xScaleFactor;\n }",
"private void applyWindowToViewportTransformation(Graphics2D g2,\n double left, double right, double bottom, double top,\n boolean preserveAspect) {\n int width = getWidth();\n int height = getHeight();\n if (preserveAspect) {\n double displayAspect = Math.abs((double) height / width);\n double requestedAspect = Math.abs((bottom - top) / (right - left));\n if (displayAspect > requestedAspect) {\n double excess = (bottom - top) * (displayAspect / requestedAspect - 1);\n bottom += excess / 2;\n top -= excess / 2;\n } else if (displayAspect < requestedAspect) {\n double excess = (right - left) * (requestedAspect / displayAspect - 1);\n right += excess / 2;\n left -= excess / 2;\n }\n }\n g2.scale(width / (right - left), height / (bottom - top));\n g2.translate(-left, -top);\n double pixelWidth = Math.abs((right - left) / width);\n double pixelHeight = Math.abs((bottom - top) / height);\n pixelSize = (float) Math.max(pixelWidth, pixelHeight);\n }",
"public PVector getTransformedPosition(){\n\t\treturn gui.getTransform().transform(position);\n\t}",
"godot.wire.Wire.Transform2D getTransform2DValue();",
"public Point worldToViewport(Point dst, Affine.Point src) {\n if (dst == null) {\n dst = new Point();\n }\n dst.x = worldToViewportX(src.x);\n dst.y = worldToViewportY(src.y);\n return dst;\n }",
"public int worldToViewportX(double x) {\n return (int)(0.5 + xMargin + xViewport + (x - xWindow) * xScaleFactor);\n }",
"public PointF viewToModel(PointF p){\n\t\tPointF q = new PointF(p.x*zoom,(height-p.y)*zoom);\n\t\treturn q;\t\t\n\t}",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"void mo2268a(View view, PointF pointF, float f);",
"private Vector3d convertToModelAnswer()\r\n {\r\n GeographicPosition pos = (GeographicPosition)EasyMock.getCurrentArguments()[0];\r\n\r\n return pos.asVector3d();\r\n }",
"public void transform(float a11, float a12, float a21, float a22, float x, float y);",
"public abstract Transformation updateTransform(Rectangle selectionBox);",
"void transformPage(View page, float position);",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"public PortView getInPortViewAt(int x, int y) {\r\n \t\treturn (PortView) graph.getGraphLayoutCache().getMapping(graph.getInPortAt(x, y), false);\r\n \t}",
"public final OMSVGElement getNearestViewportElement() {\n return (OMSVGElement)convert(((SVGTextElement)ot).getNearestViewportElement());\n }",
"public void moveViewTo(int newX, int newY) {\n int scaledWidth = (int) (TileDataRegister.TILE_WIDTH * scale);\n int scaledHeight = (int) (TileDataRegister.TILE_HEIGHT * scale);\n int baseX = (int) (map.getWidth() * TileDataRegister.TILE_WIDTH * scale) / 2;\n\n int x = baseX + (newY - newX) * scaledWidth / 2;\n x -= viewPortWidth * 0.5;\n\n int y = (newY + newX) * scaledHeight / 2;\n y -= viewPortHeight * 0.5;\n\n targetXOffset = -1 * x;\n targetYOffset = -1 * y;\n\n doPan = true;\n\n gameChanged = true;\n }",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"public Point2D userToDeviceSpace(\n Point2D point\n )\n {return ctm.transform(point, null);}",
"void glViewport(int x, int y, int width, int height);",
"public final native void transform(String transform, Element node) /*-{ this.transform(transform, node) }-*/;",
"public OMSVGPoint getCoordinates(MouseEvent<? extends EventHandler> e, boolean snap) {\n \tOMSVGMatrix m = modelGroup.getElement().<SVGGElement>cast().getScreenCTM().inverse();\n \tOMSVGPoint p = svg.createSVGPoint(e.getClientX(), e.getClientY()).matrixTransform(m);\n \treturn grid.snapsToGrid() ? grid.snap(p) : p;\n }",
"public void setTransform(Transform transform);",
"public DoubleVec invModelToView(DoubleVec pos){\n return refPoint.sub((pos.sub(refPoint)).div(zoomFactor));\n }",
"public abstract Point_3 evaluate(double u, double v);",
"public float getProperty(View view) {\n return view.getScaleX();\n }",
"public Mat4x4 getMatView() {\n Mat4x4 matCameraRotX = MatrixMath.matrixMakeRotationX(cameraRot.getX());\n Mat4x4 matCameraRotY = MatrixMath.matrixMakeRotationY(cameraRot.getY());\n Mat4x4 matCameraRotZ = MatrixMath.matrixMakeRotationZ(cameraRot.getZ());\n Mat4x4 matCameraRotXY = MatrixMath.matrixMultiplyMatrix(matCameraRotX, matCameraRotY);\n Mat4x4 matCameraRot = MatrixMath.matrixMultiplyMatrix(matCameraRotXY, matCameraRotZ);\n matCamera = calculateMatCamera(up, target, matCameraRot);\n matView = MatrixMath.matrixQuickInverse(matCamera);\n return matView;\n }",
"public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}",
"public void transform(Vector3D V) {\r\n\t\tVector3D rv = new Vector3D();\r\n\t\trv.x = V.x * M11 + V.y * M21 + V.z * M31 + V.w * M41;\r\n\t\trv.y = V.x * M12 + V.y * M22 + V.z * M32 + V.w * M42;\r\n\t\trv.z = V.x * M13 + V.y * M23 + V.z * M33 + V.w * M43;\r\n\t\trv.w = V.x * M14 + V.y * M24 + V.z * M34 + V.w * M44;\r\n\t\tV.set(rv);\r\n\t}",
"private static void verifyViewPoint() {\n if (viewPoint.x < 0)\n viewPoint.x = 0;\n if (viewPoint.y < 0)\n viewPoint.y = 0;\n if (viewPoint.x > map.WIDTH - GAME_WIDTH * zoom)\n viewPoint.x = map.WIDTH - ((int) (GAME_WIDTH * zoom));\n if (viewPoint.y > map.HEIGHT - GAME_HEIGHT * zoom)\n viewPoint.y = map.HEIGHT - ((int) (GAME_HEIGHT * zoom));\n }",
"private void updateViewBounds() \r\n {\r\n assert !sim.getMap().isEmpty() : \"Visualiser needs simulator whose a map has at least one node\"; \r\n \r\n \r\n viewMinX = minX * zoomFactor;\r\n viewMinY = minY * zoomFactor;\r\n \r\n viewMaxX = maxX * zoomFactor;\r\n viewMaxY = maxY * zoomFactor;\r\n \r\n \r\n double marginLength = zoomFactor * maxCommRange;\r\n \r\n \r\n // Set the size of the component\r\n int prefWidth = (int)Math.ceil( (viewMaxX - viewMinX) + (marginLength * 2) );\r\n int prefHeight = (int)Math.ceil( (viewMaxY - viewMinY) + (marginLength * 2) );\r\n setPreferredSize( new Dimension( prefWidth, prefHeight ) );\r\n \r\n \r\n // Adjust for margin lengths \r\n viewMinX -= marginLength;\r\n viewMinY -= marginLength;\r\n \r\n viewMaxX += marginLength;\r\n viewMaxY += marginLength;\r\n }",
"public PortView getOutPortViewAt(int x, int y) {\r\n \t\treturn (PortView) graph.getGraphLayoutCache().getMapping(graph.getOutPortAt(x, y), false);\r\n \t}",
"public Rectangle.Double viewportToWorld(Rectangle.Double dst, Rectangle src) {\n if (dst == null) {\n dst = new Rectangle.Double();\n }\n double x = viewportToWorldX(src.x);\n double y = viewportToWorldY(src.y);\n double width = src.width / xScaleFactor;\n double height = src.height / yScaleFactor;\n dst.setFrameFromDiagonal(x, y, x + width, y + height);\n return dst;\n }",
"public void setUV(float u0, float v0,\n float u1, float v1,\n float u2, float v2) {\n // sets & scales uv texture coordinates to center of the pixel\n u_array[0] = (u0 * F_TEX_WIDTH + 0.5f) * 65536f;\n u_array[1] = (u1 * F_TEX_WIDTH + 0.5f) * 65536f;\n u_array[2] = (u2 * F_TEX_WIDTH + 0.5f) * 65536f;\n v_array[0] = (v0 * F_TEX_HEIGHT + 0.5f) * 65536f;\n v_array[1] = (v1 * F_TEX_HEIGHT + 0.5f) * 65536f;\n v_array[2] = (v2 * F_TEX_HEIGHT + 0.5f) * 65536f;\n }",
"private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }",
"public Vector3f objectToViewCoord(Matrix4f viewMatrix, Vector3f worldPosition) {\r\n\t\tVector4f objectPos4f = new Vector4f(worldPosition.x, worldPosition.y, worldPosition.z, 1f);\r\n\t\tVector4f objectWorld = Matrix4f.transform(viewMatrix, objectPos4f, null);\r\n\t\treturn new Vector3f(objectWorld.x, objectWorld.y, objectWorld.z);\r\n\t}",
"@Override\n protected Point2D generateViewLocation() {\n double minX = 300.0 - Constants.DRILL_WIDTH / 2.0 - SIZE * 0.5 + X_PAD; // Account for VBox width\n double maxX = 300.0 + Constants.DRILL_WIDTH / 2.0 - SIZE * 1.5 - X_PAD; // Account for VBox width\n double maxY = Constants.DRILL_HEIGHT - Y_PAD;\n return new Point2D(FXGL.random(minX, maxX), FXGL.random(Y_PAD / 2.0, maxY));\n }",
"boolean mo2269a(View view, PointF pointF);",
"private float normalizedToScreen(double normalizedCoord) {\n return (float) (padding + normalizedCoord * (getWidth() - 2 * padding));\n }",
"public Vector2df guiToCoordinate(GuiPoint point) {\r\n\t\tint guiX = point.x;\r\n\t\tint guiY = point.y;\r\n\t\tfloat zoom = 1.0f / zoomFactor;\r\n\t\tint coordX = Math.round((guiX - origin.x) * zoom);\r\n\t\tint coordY = Math.round((guiY - origin.y) * zoom);\r\n\t\tVector2df pos = new Vector2df(coordX, coordY);\r\n\t\treturn pos;\r\n\t}",
"abstract public Matrix4fc getViewMatrix();",
"public Vector3d screenToModelPointVector(Vector2i pos)\n {\n double adjustedX = pos.getX() - getViewOffset().getX();\n double adjustedY = pos.getY() - getViewOffset().getY();\n // get the percentage of the screen for the positions\n // then use that to get the angles off of the viewer\n // Intersect those with the earth to get the actual selection points.\n double fromXpct = adjustedX / getViewportWidth() - 0.5;\n double fromYpct = adjustedY / getViewportHeight() - 0.5;\n double fromXAngleChange = -fromXpct * myHalfFOVx * 2.;\n double fromYAngleChange = -fromYpct * myHalfFOVy * 2.;\n return rotateDir(fromXAngleChange, fromYAngleChange).getNormalized();\n }",
"@Override\n\tpublic Pnt2d applyTo(Pnt2d uv) {\n\t\tdouble[] xy = Ai.operate(MathUtil.toHomogeneous(uv.toDoubleArray()));\n\t\t// apply the camera's radial lens distortion in the normalized plane:\n\t\tdouble[] xyd = cam.warp(xy);\n\t\t// apply the (forward) camera mapping to get the undistorted sensor point (u',v'):\n\t\treturn PntDouble.from(cam.mapToSensorPlane(xyd));\n\t}",
"private Point3D getXAxis(Point3D eye, Point3D view, Point3D viewUp) {\n\t\t\t\tPoint3D OG = view.sub(eye).normalize();\n\t\t\t\treturn OG.vectorProduct(getYAxis(eye, view, viewUp)).normalize();\n\t\t\t}",
"godot.wire.Wire.Transform getTransformValue();",
"public static Vector2 touchToScreenPos()\n {\n Vector3 input = new Vector3(Gdx.input.getX(), Gdx.input.getY(), 0);\n input = GdxStart.camera.unproject(input);\n return new Vector2(input.x, input.y);\n }",
"public Rectangle worldToViewport(Rectangle dst, Rectangle.Double src) {\n if (dst == null) {\n dst = new Rectangle();\n }\n int x = worldToViewportX(src.x);\n int y = worldToViewportY(src.y);\n int width = (int)(0.5 + src.width * xScaleFactor);\n int height = (int)(0.5 + src.height * yScaleFactor);\n dst.setFrameFromDiagonal(x, y, x + width, y + height);\n return dst;\n }",
"public void onBoundsResolved()\n {\n updateTransform();\n }",
"private int scaleAbsoluteCoordinateToViewCoordinate(int coordinate) {\n float scaleFactor = (float) mPlayerManager.getView().getWidth() / (float) TEST_PAGE_WIDTH;\n return Math.round((float) coordinate * scaleFactor);\n }",
"public float toWorldCoordinateX(float mouseX){\n \treturn (mouseX/zoom) - (parent.width/zoom/2) + position.x;\n }",
"private Point translateOpenCvCoordsToWebCoords(Point pointToClick, WebElement refElement) {\n return new Point((int) (pointToClick.x - (refElement.getSize().width / 2)), (int) (pointToClick.y - (refElement.getSize().height / 2)));\n }",
"@Generated\n @Selector(\"position\")\n @ByValue\n public native CGPoint position();",
"public WorldToScreenTransform getWorldToScreenTransform() { return this; }",
"private void userInput(){\n if(mousePressed){\n rX -= (mouseY - pmouseY) * 0.002f;//map(mouseY,0,height,-PI,PI);\n rY -= (mouseX - pmouseX) * 0.002f;// map(mouseX,0,width,PI,-PI);\n }\n rotateX(rX);\n rotateY(rY);\n\n if(keyPressed){\n if(keyCode == UP){\n zoom += 0.01f;\n }\n if(keyCode == DOWN){\n zoom -= 0.01f;\n }\n }\n }",
"public static PVector fromScreen( PVector in ) {\n\t\tfloat x = PApplet.norm( in.x, 0, screenSize[0] );\n\t\tfloat y = PApplet.norm( in.y, 0, screenSize[1] );\n\t\treturn new PVector( x, y );\n\t}",
"public interface Coordinates {\n\n /**\n * Gets coordinates on the element relative to the top-left corner of the monitor (screen). This\n * method automatically scrolls the page and/or frames to make element visible in viewport before\n * calculating its coordinates.\n *\n * @return coordinates on the element relative to the top-left corner of the monitor (screen).\n * @throws org.openqa.selenium.ElementNotInteractableException if the element can't be scrolled\n * into view.\n */\n Point onScreen();\n\n /**\n * Gets coordinates on the element relative to the top-left corner of OS-window being used to\n * display the content. Usually it is the browser window's viewport. This method automatically\n * scrolls the page and/or frames to make element visible in viewport before calculating its\n * coordinates.\n *\n * @return coordinates on the element relative to the top-left corner of the browser window's\n * viewport.\n * @throws org.openqa.selenium.ElementNotInteractableException if the element can't be scrolled\n * into view.\n */\n Point inViewPort();\n\n /**\n * Gets coordinates on the element relative to the top-left corner of the page.\n *\n * @return coordinates on the element relative to the top-left corner of the page.\n */\n Point onPage();\n\n Object getAuxiliary();\n}",
"boolean isSVGViewVisible(final String viewName,\n final W element);",
"public void transform(View view) {\n DrawRect.getCoord(1);\n\n // block to get coord os ROI\n ArrayList<Integer> full_x_ROIcoord = new ArrayList<>();\n ArrayList<Integer> full_y_ROIcoord = new ArrayList<>();\n\n if (xRed < 0 || xRed > 750 || yRed < 0 || yRed > 1000 ||\n xOrg < 0 || xOrg > 750 || yOrg < 0 || yOrg > 1000 ||\n xYell < 0 || xYell > 750 || yYell < 0 || yYell > 1000 ||\n xGreen < 0 || xGreen > 750 || yGreen < 0 || yGreen > 1000) {\n return;\n } else {\n // clear situation with x<= xYell\n for (int x = xRed; x < xYell; x++) {\n for (int y = yRed; y < yYell; y++) {\n full_x_ROIcoord.add(x);\n full_y_ROIcoord.add(y);\n }\n }\n }\n // end block\n\n // block get contour via CannyFilter\n Mat sMat = oImage.submat(yRed, yGreen, xRed, xOrg);\n Imgproc.Canny(sMat, sMat, 25, 100 * 2);\n ArrayList<Double> subMatValue = new ArrayList<>();\n\n for (int x = 0; x < sMat.cols(); x++) {\n for (int y = 0; y < sMat.rows(); y++) {\n double[] ft2 = sMat.get(y, x);\n subMatValue.add(ft2[0]);\n }\n }\n int count = 0;\n for (int x = xRed; x < xYell; x++) {\n for (int y = yRed; y < yYell; y++) {\n oImage.put(y, x, subMatValue.get(count));\n count++;\n }\n }\n // end block\n\n displayImage(oImage);\n }",
"public static Vect3 makeXYZ(double x, String ux, double y, String uy, double z, String uz) {\n\t\treturn new Vect3(Units.from(ux,x),Units.from(uy,y),Units.from(uz,z));\n\t}",
"private double translateX( double xRaw )\r\n {\r\n double x = xRaw;\r\n \r\n // Zoom\r\n x = x * zoomFactor;\r\n \r\n // Shift\r\n x = x - viewMinX;\r\n \r\n // Center\r\n double cShift = (getWidth()/2) - ((viewMaxX-viewMinX)/2);\r\n x = x + cShift;\r\n \r\n return x;\r\n }",
"public int getViewportOffsetX() {\n return viewport.getX();\n }",
"private void processSvg(final InputStream data) throws IOException {\n final File tmpFile = writeToTmpFile(data);\n log.debug(\"Stored uploaded image in temporary file {}\", tmpFile);\n\n // by default, store SVG data as-is for all variants: the browser will do the real scaling\n scaledData = new AutoDeletingTmpFileInputStream(tmpFile);\n\n // by default, use the bounding box as scaled width and height\n scaledWidth = width;\n scaledHeight = height;\n\n if (!isOriginalVariant()) {\n try {\n scaleSvg(tmpFile);\n } catch (ParserConfigurationException | SAXException e) {\n log.info(\"Could not read dimensions of SVG image, using the bounding box dimensions instead\", e);\n }\n }\n }",
"public void scaleAffine(){\n //Get the monitors size.\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n transform = new AffineTransform();\n double width = screenSize.getWidth();\n double height = screenSize.getHeight();\n\n //Set up the scale amount for our Affinetransform\n double xscale = width / model.getBbox().getWidth();\n double yscale = height / model.getBbox().getHeight();\n\n double scale = max(xscale, yscale);\n\n adjustZoomLvl(scale);\n transform.translate(-model.getBbox().getMinX(), -model.getBbox().getMaxY());\n\n bounds = new CanvasBounds(getBounds(), transform);\n adjustZoomFactor();\n }",
"public void setuMVPMatrix(float[] mvpMatrix)\n {\n GLES20.glUniformMatrix4fv(uMVPMatrix, 1, false, mvpMatrix, 0);\n }",
"private void setCameraView() {\n double bottomBoundary = mUserPosition.getLatitude() - .1;\n double leftBoundary = mUserPosition.getLongitude() - .1;\n double topBoundary = mUserPosition.getLatitude() + .1;\n double rightBoundary = mUserPosition.getLongitude() + .1;\n\n mMapBoundary = new LatLngBounds(\n new LatLng(bottomBoundary, leftBoundary),\n new LatLng(topBoundary, rightBoundary)\n );\n\n mGoogleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(mMapBoundary, 500,500,1));\n }",
"public Coordinates unitVector(Coordinates vector, Coordinates origin);",
"@Override\r\n\tpublic void render(float[] mtrxProjectionAndView) {\n\t\t\r\n\t}",
"private Vec2 calculatePos() {\n\t\tNetTransformComponent transform = actor.getEntity().getNetTransform();\n\t\tif (transform != null) {\n\t\t\tVec2 screenPos = scene.getCamera()\n\t\t\t\t\t.getScreenCoordinates(Vec3.add(transform.getPosition(), new Vec3(-2.0f, 3.25f, 0.0f)));\n\t\t\tVec2 result = new Vec2(screenPos.getX(), screenPos.getY());\n\t\t\treturn result;\n\t\t}\n\n\t\treturn new Vec2(0.0f, 0.0f);\n\t}",
"private void fixView(final float newX, final float newY) {\n final float x = this.worldView.getX();\n final float y = this.worldView.getY();\n final float scale = this.worldView.getScale();\n final int width = this.worldView.getMasterImage().getWidth();\n final int height = this.worldView.getMasterImage().getHeight();\n\n float updatedX = Math.max(0, newX);\n float updatedY = Math.max(0, newY);\n\n\n if (width * scale + x > width) {\n updatedX = width - (width * scale);\n }\n if (height * scale + y > height) {\n updatedY = height - (height * scale);\n }\n\n this.worldView.setX(updatedX);\n this.worldView.setY(updatedY);\n\n }",
"public double getUserFriendlyXPos(){\n return xPos - myGrid.getWidth()/ HALF;\n }",
"public Vector2 getMousePosition() {\n\t\tif (camera == null)\n\t\t\treturn new Vector2(0,0);\n\t\tfloat mx = Program.mouse.getX(), my = Program.mouse.getY();\n\t\tfloat xPercent = mx/Program.DISPLAY_WIDTH, yPercent = my/Program.DISPLAY_HEIGHT;\n\t\tfloat x = camera.getX() + camera.getWidth() * xPercent,\n\t\t\t y = camera.getY() + camera.getHeight() * yPercent;\n\t\treturn new Vector2(x,y);\n\t}",
"private Mat4x4 calculateMatCamera(Vec4df up, Vec4df target, Mat4x4 transform) {\n lookDirection = MatrixMath.matrixMultiplyVector(transform, target);\n target = MatrixMath.vectorAdd(origin, lookDirection);\n return MatrixMath.matrixPointAt(origin, target, up);\n }",
"public Square modelToView(Square s){\n\t\treturn new Square(s.x/zoom,height-s.y/zoom,s.w/zoom,s.isTarget);\n\t}",
"private static Vector2f toGuiCoords(float x, float y) {\r\n\t\treturn(new Vector2f((x/DisplayManager.getWidth()) - 0.5f, y/DisplayManager.getHeight()));\r\n\t}",
"public UserView createUserView() {\r\n return new IGAFitnessPlotView();\r\n }",
"public Coordinates unitVector(Coordinates vector);",
"@Override\n public void onPositionChanged(GeoCoordinate geoCoordinate) {\n m_mapTransformCenter = m_map.projectToPixel\n (geoCoordinate).getResult();\n }"
] | [
"0.67003083",
"0.5567477",
"0.5017525",
"0.5010826",
"0.49711618",
"0.49582875",
"0.49294138",
"0.48661283",
"0.4862093",
"0.48104197",
"0.47959188",
"0.4792824",
"0.47663394",
"0.4748559",
"0.47363704",
"0.4706028",
"0.47048903",
"0.46642753",
"0.46437022",
"0.46335837",
"0.46289468",
"0.46151444",
"0.45647895",
"0.4531981",
"0.45280132",
"0.4520821",
"0.44966218",
"0.4468636",
"0.44573522",
"0.4436559",
"0.44356623",
"0.44296396",
"0.44137594",
"0.44043308",
"0.4388384",
"0.43564343",
"0.4338516",
"0.43278012",
"0.432728",
"0.43186557",
"0.43124834",
"0.43106335",
"0.42999735",
"0.42996326",
"0.42958874",
"0.4293556",
"0.4291892",
"0.4274456",
"0.42738894",
"0.42691368",
"0.42542344",
"0.42535535",
"0.4252558",
"0.4251968",
"0.4250408",
"0.42467186",
"0.42439854",
"0.42281544",
"0.42228037",
"0.42177823",
"0.4217023",
"0.4211715",
"0.42116785",
"0.4201348",
"0.4190293",
"0.41828287",
"0.41715285",
"0.41689613",
"0.41637105",
"0.41593382",
"0.41567436",
"0.4143065",
"0.41332975",
"0.41241193",
"0.4115102",
"0.41142005",
"0.4101062",
"0.4100936",
"0.40984896",
"0.40728244",
"0.40674734",
"0.40633613",
"0.4060299",
"0.40602028",
"0.40519533",
"0.40417543",
"0.4037983",
"0.4026064",
"0.40231028",
"0.4021091",
"0.40200183",
"0.40195405",
"0.4019248",
"0.4018608",
"0.40164903",
"0.40151376",
"0.40124238",
"0.40068948",
"0.40039477",
"0.39985147"
] | 0.643341 | 1 |
Preconcatenates a zoom transform to the current user transform. As a result of invoking this method, the new user transform becomes: U' = Z.U Where U is the previous user transform and Z is the uniform scale transform: [zoom 0 0] [ 0 zoom 0] [ 0 0 1] | public void zoom(float zoom) {
if (zoom <=0) {
throw new IllegalArgumentException();
}
workTransform.setTransform(null);
workTransform.mScale(zoom);
workTransform.mMultiply(userTransform);
doc.setTransform(workTransform);
swapTransforms();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void resetUserTransform() {\n workTransform.setTransform(null);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"public void scaleTransform(Vector3f scale) {\r\n\t\tm[0][0] = scale.x; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;\r\n\t\tm[1][0] = 0.0f; m[1][1] = scale.y; m[1][2] = 0.0f; m[1][3] = 0.0f;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = scale.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public void zoomIn() {\n if (scale < 0.8) {\n double scaleFactor = (scale + 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale += 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n\n }",
"public void preConcatenate(AffineTransform3D Tx) {\r\n\t\tthis.set(MatrixMult(Tx, this));\r\n\t}",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"public void zoomOut() {\n if (scale > 0.05) {\n double scaleFactor = (scale - 0.03) / scale;\n currentXOffset = scaleFactor * (currentXOffset - viewPortWidth / 2) + viewPortWidth / 2;\n currentYOffset = scaleFactor * (currentYOffset - viewPortHeight / 2) + viewPortHeight / 2;\n scale -= 0.03;\n\n selectionChanged = true;\n gameChanged = true;\n }\n }",
"protected void primSetZoom(double zoom) {\n\tPoint p1 = getViewport().getClientArea().getCenter();\n\tPoint p2 = p1.getCopy();\n\tPoint p = getViewport().getViewLocation();\n\tdouble prevZoom = this.zoom;\n\tthis.zoom = zoom;\n\tpane.setScale(zoom);\n\tfireZoomChanged();\n\tgetViewport().validate();\n\t\n\tp2.scale(zoom / prevZoom);\n\tDimension dif = p2.getDifference(p1);\n\tp.x += dif.width;\n\tp.y += dif.height;\n\tsetViewLocation(p);\t\n}",
"private void rescale() {\n this.affineTransform = AffineTransform.getScaleInstance(this.zoom,\n this.zoom);\n int width = (int) ((this.board.getWidth() * 32) * this.zoom);\n int height = (int) ((this.board.getHeight() * 32) * this.zoom);\n this.setPreferredSize(new Dimension(width, height));\n this.repaint();\n }",
"public void getInterpolatedScale (float u, Point3f newScale) {\r\n \r\n // if linear interpolation\r\n if (this.linear == 1) {\r\n\r\n newScale.x = keyFrame[1].scale.x + \r\n ((keyFrame[2].scale.x - keyFrame[1].scale.x) * u);\r\n newScale.y = keyFrame[1].scale.y + \r\n ((keyFrame[2].scale.y - keyFrame[1].scale.y) * u);\r\n newScale.z = keyFrame[1].scale.z + \r\n ((keyFrame[2].scale.z - keyFrame[1].scale.z) * u);\r\n\r\n } else {\r\n\r\n newScale.x = e0.x + u * (e1.x + u * (e2.x + u * e3.x));\r\n newScale.y = e0.y + u * (e1.y + u * (e2.y + u * e3.y));\r\n newScale.z = e0.z + u * (e1.z + u * (e2.z + u * e3.z));\r\n\r\n }\r\n }",
"private void unsafeSetInitialZoom() {\n if (hic.isInPearsonsMode()) {\n initialZoom = hic.getMatrix().getFirstPearsonZoomData(HiC.Unit.BP).getZoom();\n } else if (HiCFileTools.isAllChromosome(hic.getXContext().getChromosome())) {\n mainViewPanel.getResolutionSlider().setEnabled(false);\n initialZoom = hic.getMatrix().getFirstZoomData(HiC.Unit.BP).getZoom();\n } else {\n mainViewPanel.getResolutionSlider().setEnabled(true);\n\n HiC.Unit currentUnit = hic.getZoom().getUnit();\n\n List<HiCZoom> zooms = (currentUnit == HiC.Unit.BP ? hic.getDataset().getBpZooms() :\n hic.getDataset().getFragZooms());\n\n\n// Find right zoom level\n\n int pixels = mainViewPanel.getHeatmapPanel().getMinimumDimension();\n int len;\n if (currentUnit == HiC.Unit.BP) {\n len = (Math.max(hic.getXContext().getChrLength(), hic.getYContext().getChrLength()));\n } else {\n len = Math.max(hic.getDataset().getFragmentCounts().get(hic.getXContext().getChromosome().getName()),\n hic.getDataset().getFragmentCounts().get(hic.getYContext().getChromosome().getName()));\n }\n\n int maxNBins = pixels / HiCGlobals.BIN_PIXEL_WIDTH;\n int bp_bin = len / maxNBins;\n initialZoom = zooms.get(zooms.size() - 1);\n for (int z = 1; z < zooms.size(); z++) {\n if (zooms.get(z).getBinSize() < bp_bin) {\n initialZoom = zooms.get(z - 1);\n break;\n }\n }\n\n }\n hic.unsafeActuallySetZoomAndLocation(\"\", \"\", initialZoom, 0, 0, -1, true, HiC.ZoomCallType.INITIAL, true);\n }",
"public void adjustZoomLvl(double scale){\n zoomLevel = ZoomCalculator.calculateZoom(scale);\n scale = ZoomCalculator.setScale(zoomLevel);\n transform.setToScale(scale, -scale);\n }",
"protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }",
"public void updateZoom() {\n camera.zoom = zoomLevel;\n }",
"private void swapTransforms() {\n Transform tmp = workTransform;\n workTransform = userTransform;\n userTransform = tmp;\n }",
"public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"public void transform(Vector3D V) {\r\n\t\tVector3D rv = new Vector3D();\r\n\t\trv.x = V.x * M11 + V.y * M21 + V.z * M31 + V.w * M41;\r\n\t\trv.y = V.x * M12 + V.y * M22 + V.z * M32 + V.w * M42;\r\n\t\trv.z = V.x * M13 + V.y * M23 + V.z * M33 + V.w * M43;\r\n\t\trv.w = V.x * M14 + V.y * M24 + V.z * M34 + V.w * M44;\r\n\t\tV.set(rv);\r\n\t}",
"public void zoomCam(float zoom){\n\t\tthis.camera.setZoom(zoom);\n\t}",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"private AffineTransform setUpTransform(Envelope mapExtent, Rectangle screenSize) {\n double scaleX = screenSize.getWidth() / mapExtent.getWidth();\n double scaleY = screenSize.getHeight() / mapExtent.getHeight();\n \n double tx = -mapExtent.getMinX() * scaleX;\n double ty = (mapExtent.getMinY() * scaleY) + screenSize.getHeight();\n \n AffineTransform at = new AffineTransform(scaleX, 0.0d, 0.0d, -scaleY, tx, ty);\n \n return at;\n }",
"private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"public void inverseScale(Point3 scale) {\r\n\t\tx /= scale.x;\r\n\t\ty /= scale.y;\r\n\t\tz /= scale.z;\r\n\t}",
"public void unzoom() {\n\t\tdisp.unzoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"protected void zoomToScale(float scale) {\n \t\tif (tweening) {\n \t\t\tscaleIntegrator.target(scale);\n \t\t} else {\n \t\t\tmapDisplay.sc = scale;\n \t\t\t// Also update Integrator to support correct tweening after switch\n \t\t\tscaleIntegrator.target(scale);\n \t\t\tscaleIntegrator.set(scale);\n \t\t}\n \t}",
"void multitouchZoom(int new_zoom);",
"public static void changeCameraZoom(boolean zoomIn){\r\n\t\tif(zoomIn && zoomLevel > 0){\r\n\t\t\tzoomLevel -= 2;\r\n\t\t}else if(!zoomIn){\r\n\t\t\tzoomLevel += 2;\r\n\t\t}\r\n\t}",
"public void scaleAffine(){\n //Get the monitors size.\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n transform = new AffineTransform();\n double width = screenSize.getWidth();\n double height = screenSize.getHeight();\n\n //Set up the scale amount for our Affinetransform\n double xscale = width / model.getBbox().getWidth();\n double yscale = height / model.getBbox().getHeight();\n\n double scale = max(xscale, yscale);\n\n adjustZoomLvl(scale);\n transform.translate(-model.getBbox().getMinX(), -model.getBbox().getMaxY());\n\n bounds = new CanvasBounds(getBounds(), transform);\n adjustZoomFactor();\n }",
"private void setTransform(Transform3D trans) {\n this.transformGroup.setTransform(trans);\n }",
"public void zoomIn() {\n if (zoom > 0) {\n zoom--;\n spielPanel.setZoom(zoom);\n }\n }",
"public synchronized void addZoom(float zoom)\r\n {\r\n this.setZoom(zoom + this.getZoom());\r\n }",
"public void zoomScaleIn() {\n \t\tzoomScale(SCALE_DELTA_IN);\n \t}",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"private void changeFromImageZoom() {\n switch (ImageZoomFragment.getOrigin()) {\n case MAIN_ACTIVITY_ZOOM_IDENTIFIER:\n Drawable drawable = ImageZoomFragment.getDrawable();\n user.setUserProfileImage(((BitmapDrawable) drawable).getBitmap());\n changeFragment(getFragment(APPLICATION_FRAGMENTS[0]));\n break;\n case InfoPetFragment.INFO_PET_ZOOM_IDENTIFIER:\n InfoPetFragment.setPetProfileDrawable(ImageZoomFragment.getDrawable());\n changeFragment(new InfoPetFragment());\n break;\n case InfoGroupFragment.INFO_GROUP_ZOOM_IDENTIFIER:\n changeFragment(new InfoGroupFragment());\n Bitmap bitmap = ((BitmapDrawable) ImageZoomFragment.getDrawable()).getBitmap();\n updateGroupImage(InfoGroupFragment.getGroup(), bitmap);\n break;\n default:\n }\n }",
"public void setTransform(Transform transform);",
"protected Matrix4 computeTransform() {\n return super.computeTransform();\n }",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"void regroupTouches() {\n\t\tint s=mTouchPoints.size();\n\t\tif (s>0) {\n\t\t\tif (mMainTouch == null) {\n\t\t\t\tif (mPinchTouch != null) {\n\t\t\t\t\tmMainTouch=mPinchTouch;\n\t\t\t\t\tmPinchTouch=null;\n\t\t\t\t} else {\n\t\t\t\t\tmMainTouch=getUnboundPoint();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (s>1) {\n\t\t\t\tif (mPinchTouch == null) {\n\t\t\t\t\tmPinchTouch=getUnboundPoint();\n\t\t\t\t\tstartZoom();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void onPinchZoomStarted(PinchZoomDetector pPinchZoomDetector,\n TouchEvent pSceneTouchEvent) {\n\n // On first detection of pinch zooming, obtain the initial zoom factor\n mInitialTouchZoomFactor = mCamera.getZoomFactor();\n }",
"public void scale(Point3 scale) {\r\n\t\tx *= scale.x;\r\n\t\ty *= scale.y;\r\n\t\tz *= scale.z;\r\n\t}",
"public void zoomIn() {\n\tsetZoom(getNextZoomLevel());\n}",
"public final double transformZoom(double d) {\n double d2;\n int type2 = getType();\n if (type2 == 0) {\n return d + 1.0d;\n }\n if (type2 != 1) {\n if (type2 == 2) {\n d2 = getZoom();\n } else if (type2 == 3) {\n return getZoom();\n } else {\n if (type2 != 4) {\n return d;\n }\n d2 = getZoom();\n }\n return d + d2;\n }\n double d3 = d - 1.0d;\n if (d3 < 0.0d) {\n return 0.0d;\n }\n return d3;\n }",
"private void userInput(){\n if(mousePressed){\n rX -= (mouseY - pmouseY) * 0.002f;//map(mouseY,0,height,-PI,PI);\n rY -= (mouseX - pmouseX) * 0.002f;// map(mouseX,0,width,PI,-PI);\n }\n rotateX(rX);\n rotateY(rY);\n\n if(keyPressed){\n if(keyCode == UP){\n zoom += 0.01f;\n }\n if(keyCode == DOWN){\n zoom -= 0.01f;\n }\n }\n }",
"public void translateTransform(Vector3f trans) {\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = trans.x;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = trans.y;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = trans.z;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"public void setScale(Vector3d scale) {\r\n transform3D.setScale(scale);\r\n transformGroup.setTransform(transform3D);\r\n }",
"@Override\r\n\tpublic void makeTransform() {\n\r\n\t\tImgproc.GaussianBlur(src, dst, new Size(size, size),\r\n\t\t\t\tTransConstants.GAUSSIAN_SIGMA);\r\n\r\n\t}",
"public static void fromRotationTranslationScaleOrigin(final Quaternion q, final Vector3f v, final Vector3f s,\r\n\t\t\tfinal Matrix4f out, final Vector3f pivot) {\r\n\t\tfinal float x = q.x;\r\n\t\tfinal float y = q.y;\r\n\t\tfinal float z = q.z;\r\n\t\tfinal float w = q.w;\r\n\t\tfinal float x2 = x + x;\r\n\t\tfinal float y2 = y + y;\r\n\t\tfinal float z2 = z + z;\r\n\t\tfinal float xx = x * x2;\r\n\t\tfinal float xy = x * y2;\r\n\t\tfinal float xz = x * z2;\r\n\t\tfinal float yy = y * y2;\r\n\t\tfinal float yz = y * z2;\r\n\t\tfinal float zz = z * z2;\r\n\t\tfinal float wx = w * x2;\r\n\t\tfinal float wy = w * y2;\r\n\t\tfinal float wz = w * z2;\r\n\t\tfinal float sx = s.x;\r\n\t\tfinal float sy = s.y;\r\n\t\tfinal float sz = s.z;\r\n\t\tout.m00 = (1 - (yy + zz)) * sx;\r\n\t\tout.m01 = (xy + wz) * sx;\r\n\t\tout.m02 = (xz - wy) * sx;\r\n\t\tout.m03 = 0;\r\n\t\tout.m10 = (xy - wz) * sy;\r\n\t\tout.m11 = (1 - (xx + zz)) * sy;\r\n\t\tout.m12 = (yz + wx) * sy;\r\n\t\tout.m13 = 0;\r\n\t\tout.m20 = (xz + wy) * sz;\r\n\t\tout.m21 = (yz - wx) * sz;\r\n\t\tout.m22 = (1 - (xx + yy)) * sz;\r\n\t\tout.m23 = 0;\r\n\t\tout.m30 = (v.x + pivot.x) - ((out.m00 * pivot.x) + (out.m10 * pivot.y) + (out.m20 * pivot.z));\r\n\t\tout.m31 = (v.y + pivot.y) - ((out.m01 * pivot.x) + (out.m11 * pivot.y) + (out.m21 * pivot.z));\r\n\t\tout.m32 = (v.z + pivot.z) - ((out.m02 * pivot.x) + (out.m12 * pivot.y) + (out.m22 * pivot.z));\r\n\t\tout.m33 = 1;\r\n\t}",
"private void setMToIdentity()\n\t\t{\n\t\t\tfor(rowNumber = 0; rowNumber < 4; rowNumber++)\n\t\t\t\tfor(int column = 0; column < 4; column++)\n\t\t\t\t{\n\t\t\t\t\tif(rowNumber == column)\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 0;\n\t\t\t\t}\n\t\t\ttransform = new Transform3D(mElements);\n\t\t\trowNumber = 0;\n\t\t}",
"public synchronized void setZoom(float zoom)\r\n {\r\n this.zoom = Utils.clampFloat(zoom, .4f, 1.5f);\r\n }",
"public static void bgfx_encoder_set_transform_cached(@NativeType(\"bgfx_encoder_t *\") long _this, @NativeType(\"uint32_t\") int _cache, @NativeType(\"uint16_t\") int _num) {\n nbgfx_encoder_set_transform_cached(_this, _cache, (short)_num);\n }",
"public static Transform newScale(Vec3 sc){\n return newScale(sc.x, sc.y, sc.z);\n }",
"@Override\n public void setZoom(double zoom)\n {\n super.setZoom(zoom);\n delayedRepainting.requestRepaint(ZOOM_REPAINT);\n }",
"protected Matrix4 computeTransform() {\n return internalGroup.computeTransform();\n }",
"public void setZoom(double zoom) {\n if (zoom > 0) {\n this.zoom = zoom;\n this.rescale();\n }\n }",
"public AffineTransform3D() {\r\n\t\tthis.M11 = 1;\r\n\t\tthis.M12 = 0;\r\n\t\tthis.M13 = 0;\r\n\t\tthis.M14 = 0;\r\n\t\tthis.M21 = 0;\r\n\t\tthis.M22 = 1;\r\n\t\tthis.M23 = 0;\r\n\t\tthis.M24 = 0;\r\n\t\tthis.M31 = 0;\r\n\t\tthis.M32 = 0;\r\n\t\tthis.M33 = 1;\r\n\t\tthis.M34 = 0;\r\n\t\tthis.M41 = 0;\r\n\t\tthis.M42 = 0;\r\n\t\tthis.M43 = 0;\r\n\t\tthis.M44 = 1;\r\n\t}",
"public void postTranslate(float tx, float ty, float tz) {\n float[] t = {\n 1, 0, 0, tx,\n 0, 1, 0, ty,\n 0, 0, 1, tz,\n 0, 0, 0, 1};\n \n matrix = mulMM(matrix, t);\n }",
"public void zoomIn() {\n\t\tif (this.zoom + DELTA_ZOOM <= MAX_ZOOM)\n\t\t\tthis.setZoom(this.zoom + DELTA_ZOOM);\n\t}",
"private double translateX( double xRaw )\r\n {\r\n double x = xRaw;\r\n \r\n // Zoom\r\n x = x * zoomFactor;\r\n \r\n // Shift\r\n x = x - viewMinX;\r\n \r\n // Center\r\n double cShift = (getWidth()/2) - ((viewMaxX-viewMinX)/2);\r\n x = x + cShift;\r\n \r\n return x;\r\n }",
"public void setZoom(float zoom) {\n this.zoom = zoom;\n }",
"@Override\r\n\tpublic void stepUp(Matrix3x3f viewport)\r\n\t{\n\t\ttransform(new Vector2f(2.0f, 0.0f), 0.0f, viewport, 2.0f, 2.0f);\r\n\t}",
"private void clampZoom()\n\t{\n\t\tif (zoom < ZOOM_MINIMUM)\n\t\t{\n\t\t\tzoom = ZOOM_MINIMUM;\n\t\t}\n\t\telse if (zoom > ZOOM_MAXIMUM)\n\t\t{\n\t\t\tzoom = ZOOM_MAXIMUM;\n\t\t}\n\t}",
"public void setZoom(float zoom) {\r\n\t\tif (zoom < 0.1f)\r\n\t\t\treturn;\r\n\t\tthis.zoomFactor = zoom;\r\n\t}",
"public static void bgfx_set_transform_cached(@NativeType(\"uint32_t\") int _cache, @NativeType(\"uint16_t\") int _num) {\n nbgfx_set_transform_cached(_cache, (short)_num);\n }",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"@Override\r\n\tpublic void stepBack(Matrix3x3f viewport)\r\n\t{\n\t\ttransform(new Vector2f(-2.0f, 0.0f), 0.0f, viewport, 2.0f, 2.0f);\r\n\t}",
"public synchronized void transform() {\n Iterator<String> it = entity_to_wxy.keySet().iterator();\n while (it.hasNext()) {\n String entity = it.next();\n double wx = entity_to_wxy.get(entity).getX(),\n wy = entity_to_wxy.get(entity).getY();\n int sx, sy;\n entity_to_sxy.put(entity, (sx = wxToSx(wx)) + BundlesDT.DELIM + (sy = wyToSy(wy)));\n entity_to_sx.put(entity, sx); entity_to_sy.put(entity, sy);\n }\n transform_id++;\n }",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"private static void mapScaler(android.hardware.camera2.impl.CameraMetadataNative r1, android.hardware.camera2.legacy.ParameterUtils.ZoomData r2, android.hardware.Camera.Parameters r3) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e5 in method: android.hardware.camera2.legacy.LegacyResultMapper.mapScaler(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.ParameterUtils$ZoomData, android.hardware.Camera$Parameters):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.hardware.camera2.legacy.LegacyResultMapper.mapScaler(android.hardware.camera2.impl.CameraMetadataNative, android.hardware.camera2.legacy.ParameterUtils$ZoomData, android.hardware.Camera$Parameters):void\");\n }",
"@Override\n\t\tpublic GLGroupTransform transforms() { return transforms; }",
"public void transform(float a11, float a12, float a21, float a22, float x, float y);",
"public void zoom() {\n\t\tdisp.zoom();\n\t\texactZoom.setText(disp.getScale() + \"\");\n\t\tresize();\n\t\trepaint();\n\t}",
"public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }",
"public void scale (float scaleX, float scaleY, float scaleZ) {\r\n \t\tVertexAttribute posAttr = getVertexAttribute(Usage.Position);\r\n \t\tint offset = posAttr.offset / 4;\r\n \t\tint numComponents = posAttr.numComponents;\r\n \t\tint numVertices = getNumVertices();\r\n \t\tint vertexSize = getVertexSize() / 4;\r\n \r\n \t\tfloat[] vertices = new float[numVertices * vertexSize];\r\n \t\tgetVertices(vertices);\r\n \r\n \t\tint idx = offset;\r\n \t\tswitch (numComponents) {\r\n \t\tcase 1:\r\n \t\t\tfor (int i = 0; i < numVertices; i++) {\r\n \t\t\t\tvertices[idx] *= scaleX;\r\n \t\t\t\tidx += vertexSize;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\tcase 2:\r\n \t\t\tfor (int i = 0; i < numVertices; i++) {\r\n \t\t\t\tvertices[idx] *= scaleX;\r\n \t\t\t\tvertices[idx + 1] *= scaleY;\r\n \t\t\t\tidx += vertexSize;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\tcase 3:\r\n \t\t\tfor (int i = 0; i < numVertices; i++) {\r\n \t\t\t\tvertices[idx] *= scaleX;\r\n \t\t\t\tvertices[idx + 1] *= scaleY;\r\n \t\t\t\tvertices[idx + 2] *= scaleZ;\r\n \t\t\t\tidx += vertexSize;\r\n \t\t\t}\r\n \t\t\tbreak;\r\n \t\t}\r\n \r\n \t\tsetVertices(vertices);\r\n \t}",
"public void zoomScaleOut() {\n \t\tzoomScale(SCALE_DELTA_OUT);\n \t}",
"public void resetTransforms() { \r\n transforms2 = new HashMap<BundlesDT.DT,Map<String,Map<String,String>>>(); \r\n transforms2.put(BundlesDT.DT.IPv4, new HashMap<String,Map<String,String>>());\r\n transforms2.put(BundlesDT.DT.IPv4CIDR, new HashMap<String,Map<String,String>>());\r\n if (transforms.containsKey(BundlesDT.DT.IPv4)) {\r\n Iterator<String> it = transforms.get(BundlesDT.DT.IPv4).keySet().iterator();\r\n while (it.hasNext()) transforms2.get(BundlesDT.DT.IPv4).put(it.next(), new HashMap<String,String>());\r\n }\r\n if (transforms.containsKey(BundlesDT.DT.IPv4CIDR)) {\r\n sorted_cidr_trans = new HashMap<String,CIDRRec[]>();\r\n Iterator<String> it = transforms.get(BundlesDT.DT.IPv4CIDR).keySet().iterator();\r\n while (it.hasNext()) {\r\n String trans = it.next();\r\n transforms2.get(BundlesDT.DT.IPv4).put(trans, new HashMap<String,String>());\r\n transforms2.get(BundlesDT.DT.IPv4CIDR).put(trans, new HashMap<String,String>());\r\n\tCIDRRec recs[] = new CIDRRec[transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).keySet().size()];\r\n\tIterator<String> it_cidr = transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).keySet().iterator();\r\n\tfor (int i=0;i<recs.length;i++) {\r\n\t String cidr = it_cidr.next();\r\n\t recs[i] = new CIDRRec(cidr,transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).get(cidr));\r\n }\r\n\tArrays.sort(recs);\r\n\tsorted_cidr_trans.put(trans,recs);\r\n }\r\n }\r\n }",
"private void setZoomLevel() {\n final float oldMaxScale = photoView.getMaximumScale();\n photoView.setMaximumScale(oldMaxScale *2);\n photoView.setMediumScale(oldMaxScale);\n }",
"public void setZoom(){\n\t\tactive.setZoom();\n\t}",
"@Test\n @DependsOnMethod(\"testDimensionReduction\")\n public void testDimensionAugmentation() throws TransformException {\n transform = new ProjectiveTransform(Matrices.create(4, 3, new double[] {\n 0, 1, 0,\n 1, 0, 0,\n 0, 0, 0,\n 0, 0, 1}));\n\n assertInstanceOf(\"inverse\", CopyTransform.class, transform.inverse());\n verifyTransform(new double[] {2,3, 6,0, 2, Double.NaN},\n new double[] {3,2,0, 0,6,0, Double.NaN, 2, 0});\n }",
"public void transform( final float factor ) {\n final var compDimen = new ScalableDimension( getParentBounds() );\n transform( compDimen.scale( factor ) );\n }",
"private void adjustZoomFactor(){\n switch(zoomLevel){\n case 0:zoomFactor = 39; break;\n case 1:zoomFactor = 37; break;\n case 2:zoomFactor = 35; break;\n case 3:zoomFactor = 33; break;\n case 4:zoomFactor = 31; break;\n case 5:zoomFactor = 29; break;\n case 6:zoomFactor = 27; break;\n case 7:zoomFactor = 25; break;\n case 8:zoomFactor = 23; break;\n case 9:zoomFactor = 21; break;\n case 10:zoomFactor = 20; break;\n case 11:zoomFactor = 18; break;\n case 12:zoomFactor = 16; break;\n case 13:zoomFactor = 14; break;\n case 14:zoomFactor = 12; break;\n case 15:zoomFactor = 10; break;\n case 16:zoomFactor = 8; break;\n case 17:zoomFactor = 6; break;\n case 18:zoomFactor = 4; break;\n case 19:zoomFactor = 2; break;\n case 20:zoomFactor = 0; break;\n }\n }",
"public void zoomIn() {\n \t\tzoom(1);\n \t}",
"public void setZoom(float zoom){\r\n zoom = zoom * 100;\r\n zoom = Math.round(zoom);\r\n this.zoom = Math.max(zoom / 100, 0.01f);\r\n }",
"public Point3D normalize() {\n\t\treturn this.divide(Math.sqrt(x*x + y*y + z*z));\n\t}",
"private void setView( boolean reset_zoom )\n {\n float azimuth = getAzimuthAngle();\n float altitude = getAltitudeAngle();\n float distance = getDistance();\n\n float r = (float)(distance * Math.cos( altitude * Math.PI/180.0 ));\n\n float x = (float)(r * Math.cos( azimuth * Math.PI/180.0 ));\n float y = (float)(r * Math.sin( azimuth * Math.PI/180.0 ));\n float z = (float)(distance * Math.sin( altitude * Math.PI/180.0 ));\n\n float vrp[] = getVRP().get();\n \n setCOP( new Vector3D( x + vrp[0], y + vrp[1], z + vrp[2] ) );\n\n apply( reset_zoom );\n }",
"public void scale(double x, double y, double z){\n \tMatrix scale = new Matrix();\n \tscale.identity();\n \tscale.set(1,1,x);\n \tscale.set(2,2,y);\n \tscale.set(3,3,z);\n \tthis.leftMultiply(scale);\n\n }",
"public void postMultiply(Transform transform) {\n matrix = mulMM(matrix, transform.matrix);\n }",
"public void toUserSpace(int[] viewportCoordinate,\n float[] userSpaceCoordinate) {\n\n if (( userSpaceCoordinate == null ) || ( viewportCoordinate == null )) {\n throw new IllegalArgumentException();\n }\n if (( userSpaceCoordinate.length != 2 ) || ( viewportCoordinate.length != 2 )) {\n throw new IllegalArgumentException();\n }\n\n // Get the current screenCTM\n Transform txf = svg.getTransformState();\n\n try {\n txf = (Transform) txf.inverse();\n } catch (SVGException se) {\n throw new IllegalStateException(ERROR_NON_INVERTIBLE_SVG_TRANSFORM);\n }\n\n float[] pt = new float[2];\n pt[0] = viewportCoordinate[0];\n pt[1] = viewportCoordinate[1];\n txf.transformPoint(pt, userSpaceCoordinate);\n }",
"public void normalize() {\r\n\t\tfloat length = (float) this.lenght();\r\n\t\tif (length > 0) {\r\n\t\t\tx /= length;\r\n\t\t\ty /= length;\r\n\t\t\tz /= length;\r\n\t\t}\r\n\t}",
"public void rescale()\r\n\t{\n\t}",
"private SimilarityTransformation3D getCombinedTransfo3D(Document document,double sourcescale,double targetscale) {\n\t\tElement root = XMLUtil.getRootElement(document);\n\n\t\tArrayList<Element> transfoElementArrayList = XMLUtil.getElements(root,\n\t\t\t\t\"MatrixTransformation\");\n\t\t// int nbtransfo=transfoElementArrayList.size();\n\t\tArrayList<Matrix> listoftransfo = new ArrayList<Matrix>();\n\t\t\n\t\t//Matrix ScaleSourcetransfo=Matrix.identity(4, 4).times(sourcescale);\n\t\t//Matrix Scaletargettransfo=Matrix.identity(4, 4).times(1.0/targetscale);\n\t\tMatrix ScaleSourcetransfo=Matrix.identity(4, 4).times(sourcescale);\n\t\tScaleSourcetransfo.set(3,3,1.0);\n\t\tScaleSourcetransfo.set(2,2,1.0);//do not touch z\n\t\tMatrix Scaletargettransfo=Matrix.identity(4, 4).times(1.0/targetscale);\n\t\tScaletargettransfo.set(3,3,1.0);\n\t\tScaletargettransfo.set(2,2,1.0);//do not touch z\n\t\t//listoftransfo.add(ScaleSourcetransfo);\n\t\t// the default value of orisizex has to the actual pixel size:\n\t\t// otherwise during the initialisation (i.e the first tranform \n\t\t//when getcombined transform has nothing to return\n\t\tdouble orisizex=source.getValue().getPixelSizeX();\n\t\tdouble orisizey=source.getValue().getPixelSizeY();\n\t\tdouble orisizez=source.getValue().getPixelSizeZ();\n\t\tElement transfoElementf=transfoElementArrayList.get(0);\n\t\tdouble orisizexbinned=XMLUtil.getAttributeDoubleValue(transfoElementf, \"formerpixelsizeX\", 0);\n\t\t//double orisizeybinned=XMLUtil.getAttributeDoubleValue(transfoElementf, \"formerpixelsizeY\", 0);\n\t\t//double orisizezbinned=XMLUtil.getAttributeDoubleValue(transfoElementf, \"formerpixelsizeZ\", 0);\n\t\tif ((orisizex==orisizexbinned)&&(sourcescale!=1)){\n\t\t\tlistoftransfo.add(ScaleSourcetransfo);\n\t\t\tSystem.out.println(\"Warning something strange happened to your metadata. Check your binned metadata and these one.\");\n\t\t}\n\t\tfor (Element transfoElement : transfoElementArrayList) {\n\t\t\tdouble[][] m = new double[4][4];\n\t\t\t// int order = XMLUtil.getAttributeIntValue( transfoElement, \"order\"\n\t\t\t// , -1 ); //to be check for now only: has to be used!!!\n\t\t\t// the only different pixel size (i.e the orginal source size) is given only at the first transformation\n\t\t\t\n\t\t\t\n\t\t\tm[0][0] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m00\", 0);\n\t\t\tm[0][1] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m01\", 0);\n\t\t\tm[0][2] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m02\", 0);\n\t\t\tm[0][3] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m03\", 0);\n\n\t\t\tm[1][0] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m10\", 0);\n\t\t\tm[1][1] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m11\", 0);\n\t\t\tm[1][2] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m12\", 0);\n\t\t\tm[1][3] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m13\", 0);\n\n\t\t\tm[2][0] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m20\", 0);\n\t\t\tm[2][1] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m21\", 0);\n\t\t\tm[2][2] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m22\", 0);\n\t\t\tm[2][3] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m23\", 0);\n\n\t\t\tm[3][0] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m30\", 0);\n\t\t\tm[3][1] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m31\", 0);\n\t\t\tm[3][2] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m32\", 0);\n\t\t\tm[3][3] = XMLUtil.getAttributeDoubleValue(transfoElement, \"m33\", 0);\n\t\t\t\n\t\t\tMatrix T = new Matrix(m);\n\t\t\tlistoftransfo.add(T);\n\n\t\t}\n\t\tlistoftransfo.add(Scaletargettransfo);\n\t\tMatrix CombinedTransfo = Matrix.identity(4, 4);\n\t\tfor (int i = 0; i < listoftransfo.size(); i++) {\n\t\t\tCombinedTransfo = listoftransfo.get(i).times(CombinedTransfo);\n\t\t}\n\t\t\n\t\t\n\t\tSimilarityTransformation3D resulttransfo=new SimilarityTransformation3D(CombinedTransfo,orisizex,orisizey,orisizez);\n\t\treturn resulttransfo;\n\t\n}",
"public void scaleBy(float scale) {\n internalGroup.scaleBy(scale);\n dataTrait.scaleX = internalGroup.getScaleX();\n dataTrait.scaleY = internalGroup.getScaleY();\n resetSprite();\n\n }",
"public void normalize()\n {\n double magnitude = this.magnitude();\n this.x = x / (float)magnitude;\n this.y = y / (float)magnitude;\n this.z = z / (float)magnitude;\n this.w = w / (float)magnitude;\n }",
"public void scale(double xScale, double yScale, double zScale) {\n\t\t// Create a matrix that will transform vertices to their new positions\n\t\tMatrix scaleMatrix = new Matrix(3, 3);\n\t\tscaleMatrix.setElement(0, 0, xScale);\n\t\tscaleMatrix.setElement(1, 1, yScale);\n\t\tscaleMatrix.setElement(2, 2, zScale);\n\t\tfor (int i = 0; i < verts.length; i++) {\n\t\t\tverts[i] = scaleMatrix.multiply(verts[i]);\n\t\t}\n\t}",
"public void postScale(float sx, float sy, float sz) {\n float[] s = {\n sx, 0, 0, 0,\n 0, sy, 0, 0,\n 0, 0, sz, 0,\n 0, 0, 0, 1};\n \n matrix = mulMM(matrix, s);\n }",
"public void zoomIn()\n {\n zoomIn(1, width >> 1, height >> 1);\n }",
"public void translate(double x, double y, double z){\n \n \tMatrix trans = new Matrix();\n \ttrans.identity();\n \ttrans.set(1,4,x);\n \ttrans.set(2,4,y);\n \ttrans.set(3,4,x);\n \tthis.leftMultiply(trans);\n\n /* this doesn't work yet\n this.temp.identity();\n temp.set(1,4,x);\n temp.set(2,4,y);\n temp.set(3,4,x);\n this.leftMultiply(temp); */\n }"
] | [
"0.5598555",
"0.544503",
"0.52879065",
"0.51713353",
"0.5171151",
"0.51469964",
"0.51268053",
"0.5109894",
"0.5087411",
"0.50379366",
"0.4997387",
"0.49785444",
"0.49610513",
"0.49533984",
"0.4873649",
"0.48534247",
"0.4851968",
"0.48134813",
"0.48058644",
"0.47902462",
"0.47883603",
"0.47848225",
"0.47741717",
"0.47717574",
"0.4750126",
"0.47487095",
"0.4740805",
"0.47383037",
"0.47382078",
"0.4678942",
"0.46786645",
"0.46691892",
"0.4667674",
"0.46653023",
"0.46513492",
"0.4649904",
"0.4649591",
"0.46372324",
"0.462958",
"0.46103612",
"0.46063003",
"0.4582291",
"0.45774028",
"0.45528585",
"0.45497966",
"0.45445627",
"0.45432445",
"0.45254996",
"0.4519325",
"0.451673",
"0.4506488",
"0.45053938",
"0.4498869",
"0.4482509",
"0.44824183",
"0.44744962",
"0.44694373",
"0.44575334",
"0.44533584",
"0.4447009",
"0.44432387",
"0.4440249",
"0.44349608",
"0.4426449",
"0.4422453",
"0.44144198",
"0.44133604",
"0.4412013",
"0.4395814",
"0.43946767",
"0.43706453",
"0.43685508",
"0.43624672",
"0.43596467",
"0.43593764",
"0.435849",
"0.43558574",
"0.43553433",
"0.43546334",
"0.43473554",
"0.43472263",
"0.43208748",
"0.4307209",
"0.43068713",
"0.4306551",
"0.43044615",
"0.430164",
"0.42969644",
"0.42927024",
"0.4290669",
"0.42770663",
"0.4272854",
"0.42696613",
"0.42690665",
"0.42653042",
"0.4260648",
"0.42582357",
"0.42581096",
"0.4256645",
"0.42563236"
] | 0.5621549 | 0 |
Preconcatenates a translation to the current user transform. As a result of invoking this method, the new user transform becomes: U' = T.U Where U is the previous user transform and T is the following transform: [1 0 panX] [0 1 panY] [0 0 1] | public void pan(float panX, float panY) {
workTransform.setTransform(null);
workTransform.mTranslate(panX, panY);
workTransform.mMultiply(userTransform);
doc.setTransform(workTransform);
swapTransforms();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void resetUserTransform() {\n workTransform.setTransform(null);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"public void preConcatenate(AffineTransform3D Tx) {\r\n\t\tthis.set(MatrixMult(Tx, this));\r\n\t}",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"private void updateTranslated() {\r\n\r\n\tfloat[] dp = new float[3];\r\n\tTools3d.subtract(p, _p, dp);\r\n\r\n\tfor (int i = 0; i < npoints * 3; i+= 3) {\r\n\t // translate by adding the amount local origin has moved by\r\n\t ps[i] += dp[0];\r\n\t ps[i + 1] += dp[1];\r\n\t ps[i + 2] += dp[2];\r\n\t}\r\n\t\r\n\t// reset bounding box and clear dirty flag\r\n\tbox.setBB();\r\n\tdirtyT = false;\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n }",
"private void swapTransforms() {\n Transform tmp = workTransform;\n workTransform = userTransform;\n userTransform = tmp;\n }",
"public void translateTransform(Vector3f trans) {\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = trans.x;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = trans.y;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = trans.z;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"public void postTranslate(float tx, float ty, float tz) {\n float[] t = {\n 1, 0, 0, tx,\n 0, 1, 0, ty,\n 0, 0, 1, tz,\n 0, 0, 0, 1};\n \n matrix = mulMM(matrix, t);\n }",
"public void translate( Vector3f t )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( t );\n\t\tmat.mul( opMat );\n\t}",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"public void transform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"transform\");\r\n\t}",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"@FXML\n public void translation(){\n double x = Double.parseDouble(translation_x.getText());\n double y = Double.parseDouble(translation_y.getText());\n double z = Double.parseDouble(translation_z.getText());\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]+x,A[1]+y,A[2]+z);\n t1.getTetraeder()[1].setPoint(B[0]+x,B[1]+y,B[2]+z);\n t1.getTetraeder()[2].setPoint(C[0]+x,C[1]+y,C[2]+z);\n t1.getTetraeder()[3].setPoint(D[0]+x,D[1]+y,D[2]+z);\n\n redraw();\n }",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public void translate(double x, double y, double z){\n \n \tMatrix trans = new Matrix();\n \ttrans.identity();\n \ttrans.set(1,4,x);\n \ttrans.set(2,4,y);\n \ttrans.set(3,4,x);\n \tthis.leftMultiply(trans);\n\n /* this doesn't work yet\n this.temp.identity();\n temp.set(1,4,x);\n temp.set(2,4,y);\n temp.set(3,4,x);\n this.leftMultiply(temp); */\n }",
"protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }",
"public void apply() {\n\t\tglTranslated(0, 0, -centerDistance);\n\t\tglRotated(pitch, 1, 0, 0);\n\t\tglRotated(yaw, 0, 0, 1);\n\t\tglScaled(scale, scale, scale);\n\n\t\tglTranslated(-pos.get(0), -pos.get(1), -pos.get(2));\n\t}",
"public void transform(Vector3D V) {\r\n\t\tVector3D rv = new Vector3D();\r\n\t\trv.x = V.x * M11 + V.y * M21 + V.z * M31 + V.w * M41;\r\n\t\trv.y = V.x * M12 + V.y * M22 + V.z * M32 + V.w * M42;\r\n\t\trv.z = V.x * M13 + V.y * M23 + V.z * M33 + V.w * M43;\r\n\t\trv.w = V.x * M14 + V.y * M24 + V.z * M34 + V.w * M44;\r\n\t\tV.set(rv);\r\n\t}",
"protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }",
"public void setTransform(Transform transform);",
"private void updateRotated() {\r\n\r\n\tfor (int n = 0; n < npoints * 3; n += 3) {\r\n\r\n\t // take the linear sum of local co-ords with local\r\n\t // unit vectors and then translate by adding the local\r\n\t // origin's co-ords\r\n\t ps[n] = locals[n] * i[0] + locals[n + 1] * j[0] + locals[n + 2] * k[0];\r\n\t ps[n + 1] = locals[n] * i[1] + locals[n + 1] * j[1] + locals[n + 2] * k[1];\r\n\t ps[n + 2] = locals[n] * i[2] + locals[n + 1] * j[2] + locals[n + 2] * k[2];\r\n\r\n\t ps[n] += p[0];\r\n\t ps[n + 1] += p[1];\r\n\t ps[n + 2] += p[2];\r\n\t}\r\n\r\n\t// reset bounding box and clear dirty flags\r\n\tbox.setBB();\r\n\tdirtyR = false;\r\n\tdirtyT = false;\r\n\r\n\t// normals must be reset\r\n\tthis.setNormals();\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n\t_roll = roll;\r\n }",
"private double translateX( double xRaw )\r\n {\r\n double x = xRaw;\r\n \r\n // Zoom\r\n x = x * zoomFactor;\r\n \r\n // Shift\r\n x = x - viewMinX;\r\n \r\n // Center\r\n double cShift = (getWidth()/2) - ((viewMaxX-viewMinX)/2);\r\n x = x + cShift;\r\n \r\n return x;\r\n }",
"public final void rule__RelativeTransformation__Group__3__Impl() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6205:1: ( ( 'transformation' ) )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6206:1: ( 'transformation' )\n {\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6206:1: ( 'transformation' )\n // ../uk.ac.kcl.inf.robotics.rigid_bodies.ui/src-gen/uk/ac/kcl/inf/robotics/ui/contentassist/antlr/internal/InternalRigidBodies.g:6207:1: 'transformation'\n {\n before(grammarAccess.getRelativeTransformationAccess().getTransformationKeyword_3()); \n match(input,63,FOLLOW_63_in_rule__RelativeTransformation__Group__3__Impl12566); \n after(grammarAccess.getRelativeTransformationAccess().getTransformationKeyword_3()); \n\n }\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n\n \trestoreStackSize(stackSize);\n\n }\n return ;\n }",
"public static Transform newTranslation(Vec3 tr){\n return newTranslation(tr.x, tr.y, tr.z);\n }",
"public static Transform newTranslation(float tx, float ty, float tz){\n return new Transform(new float[][]{{1.0f, 0.0f, 0.0f, tx},\n {0.0f, 1.0f, 0.0f, ty},\n {0.0f, 0.0f, 1.0f, tz},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"@Override\r\n\tprotected AffineTransform getPointTransformation() {\n\t\treturn null;\r\n\t}",
"public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"@Override\t\t\t\n\tpublic final myPointf transformPoint(myPointf A, int transformIDX, float t) {\treturn trans[transformIDX].transformPoint(A, t);}",
"public Tree transformTree(Tree t) {\n return QPtransform(t);\n }",
"protected Matrix4 computeTransform() {\n return super.computeTransform();\n }",
"public void setTransform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"setTransform\");\r\n\t}",
"public String transform(String text){\n for(int i=0; i<transforms.length; i++)\n {\n if(transforms[i].contains(\"fromabbreviation\")){\n text = textTransformerAbbreviation.fromAbbreviation(text);\n }\n if(transforms[i].contains(\"toabbreviation\")){\n text = textTransformerAbbreviation.toAbbreviation(text);\n }\n if(transforms[i].contains(\"inverse\")){\n text = textTransformerInverse.inverse(text);\n }\n if(transforms[i].contains(\"upper\")){\n text = textTransformerLetterSize.upper(text);\n }\n if(transforms[i].contains(\"lower\")){\n text = textTransformerLetterSize.lower(text);\n }\n if(transforms[i].contains(\"capitalize\")) {\n text = textTransformerLetterSize.capitalize(text);\n }\n if(transforms[i].contains(\"latex\")){\n text = textTransformerLatex.toLatex(text);\n }\n if(transforms[i].contains(\"numbers\")){\n text = textTransformerNumbers.toText(text);\n }\n if(transforms[i].contains(\"repetitions\")){\n text = textTransformerRepetition.deleteRepetitions(text);\n }\n logger.debug(\"Text after \" + (i+1) + \" transform: \" + text);\n }\n\n logger.debug(\"Final form: \" + text);\n return text;\n }",
"public void translate( float x, float y, float z )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, z ) );\n\t\tmat.mul( opMat );\n\t}",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"abstract void translate(double x, double y, double z);",
"public void transform(float a11, float a12, float a21, float a22, float x, float y);",
"Transform<A, B> getTransform();",
"private Point transform(Point pt1) {\n Point pt2 = new Point(0,0) ;\n pt2.x = pos.x + new Double(pt1.x*Math.cos(heading)+pt1.y*Math.sin(heading)).intValue() ;\n pt2.y = pos.y + new Double(-pt1.x*Math.sin(heading)+pt1.y*Math.cos(heading)).intValue() ;\n return pt2 ;\n }",
"public synchronized void transform() {\n Iterator<String> it = entity_to_wxy.keySet().iterator();\n while (it.hasNext()) {\n String entity = it.next();\n double wx = entity_to_wxy.get(entity).getX(),\n wy = entity_to_wxy.get(entity).getY();\n int sx, sy;\n entity_to_sxy.put(entity, (sx = wxToSx(wx)) + BundlesDT.DELIM + (sy = wyToSy(wy)));\n entity_to_sx.put(entity, sx); entity_to_sy.put(entity, sy);\n }\n transform_id++;\n }",
"public void getInterpolatedPosition (float u, Point3f newPos) {\r\n \r\n // if linear interpolation\r\n if (this.linear == 1) {\r\n newPos.x = keyFrame[1].position.x + \r\n ((keyFrame[2].position.x - keyFrame[1].position.x) * u);\r\n newPos.y = keyFrame[1].position.y + \r\n ((keyFrame[2].position.y - keyFrame[1].position.y) * u);\r\n newPos.z = keyFrame[1].position.z + \r\n ((keyFrame[2].position.z - keyFrame[1].position.z) * u);\r\n } else {\r\n\r\n newPos.x = c0.x + u * (c1.x + u * (c2.x + u * c3.x));\r\n newPos.y = c0.y + u * (c1.y + u * (c2.y + u * c3.y));\r\n newPos.z = c0.z + u * (c1.z + u * (c2.z + u * c3.z));\r\n\r\n }\r\n }",
"private void setOrigin() {\n Hep3Vector origin = VecOp.mult(CoordinateTransformations.getMatrix(), _sensor.getGeometry().getPosition());\n // transform to p-side\n Polygon3D psidePlane = this.getPsidePlane();\n Translation3D transformToPside = new Translation3D(VecOp.mult(-1 * psidePlane.getDistance(),\n psidePlane.getNormal()));\n this._org = transformToPside.translated(origin);\n }",
"public AffineTransform getOldAffineTransform ( )\n {\n return oldAffineTransformation;\n }",
"Transforms getTransforms();",
"void setTransforms(Transforms transforms);",
"public double getTranslateX() { return translateX; }",
"public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }",
"public AffineTransform3D() {\r\n\t\tthis.M11 = 1;\r\n\t\tthis.M12 = 0;\r\n\t\tthis.M13 = 0;\r\n\t\tthis.M14 = 0;\r\n\t\tthis.M21 = 0;\r\n\t\tthis.M22 = 1;\r\n\t\tthis.M23 = 0;\r\n\t\tthis.M24 = 0;\r\n\t\tthis.M31 = 0;\r\n\t\tthis.M32 = 0;\r\n\t\tthis.M33 = 1;\r\n\t\tthis.M34 = 0;\r\n\t\tthis.M41 = 0;\r\n\t\tthis.M42 = 0;\r\n\t\tthis.M43 = 0;\r\n\t\tthis.M44 = 1;\r\n\t}",
"public static Transform translate(Vector2f translate) {\n\t\treturn transpose(1.0f, 0.0f, translate.x, 0.0f, 1.0f, translate.y);\n\t}",
"private void setMToIdentity()\n\t\t{\n\t\t\tfor(rowNumber = 0; rowNumber < 4; rowNumber++)\n\t\t\t\tfor(int column = 0; column < 4; column++)\n\t\t\t\t{\n\t\t\t\t\tif(rowNumber == column)\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 0;\n\t\t\t\t}\n\t\t\ttransform = new Transform3D(mElements);\n\t\t\trowNumber = 0;\n\t\t}",
"public void setTransform(int jointIndex, int index, float value) {\r\n\t\tswitch(index) {\r\n\t\tcase 0: this.translations[jointIndex].x = value; break;\r\n\t\tcase 1: this.translations[jointIndex].y = value; break;\r\n\t\tcase 2: this.translations[jointIndex].z = value; break;\r\n\t\tcase 3: this.orientations[jointIndex].x = value; break;\r\n\t\tcase 4: this.orientations[jointIndex].y = value; break;\r\n\t\tcase 5:\r\n\t\t\tthis.orientations[jointIndex].z = value;\r\n\t\t\tthis.processOrientation(this.orientations[jointIndex]);\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public void refreshPosition() {\n\n this.setTransform(getTransform());\n }",
"public Point transform(double x, double y, double z) {\n\t\t\n\t\n\t\tdouble uIso = (x * xToU) + (y * yToU) + (z * zToU);\n\t\tdouble vIso = (x * xToV) + (y * yToV) + (z * zToV);\n\t\t\n\t\tint uDraw = xOffset + (int)(scale * uIso);\n\t\tint vDraw = yOffset + (int)(scale * vIso);\n\t\t\n\t\treturn new Point(uDraw, vDraw);\n\t}",
"public void concatenate(AffineTransform3D Tx) {\r\n\t\tthis.set(MatrixMult(this, Tx));\r\n\t}",
"public void getInterpolatedPositionVector (float u, Vector3f newPos) {\r\n // if linear interpolation\r\n if (this.linear == 1) {\r\n newPos.x = keyFrame[1].position.x + \r\n ((keyFrame[2].position.x - keyFrame[1].position.x) * u);\r\n newPos.y = keyFrame[1].position.y + \r\n ((keyFrame[2].position.y - keyFrame[1].position.y) * u);\r\n newPos.z = keyFrame[1].position.z + \r\n ((keyFrame[2].position.z - keyFrame[1].position.z) * u);\r\n } else {\r\n\r\n newPos.x = c0.x + u * (c1.x + u * (c2.x + u * c3.x));\r\n newPos.y = c0.y + u * (c1.y + u * (c2.y + u * c3.y));\r\n newPos.z = c0.z + u * (c1.z + u * (c2.z + u * c3.z));\r\n\r\n }\r\n }",
"public void translate(float x, float y);",
"protected void reverseTransformations(Graphics2D g2d) {\n\t\tg2d.translate(pivotPoint.x, pivotPoint.y);\n\t\tg2d.scale(1.0/scaleX, 1.0/scaleY);\n\t\tg2d.rotate(-rotation);//, pivotPoint.x, pivotPoint.y);\n\n\t\tg2d.translate(-pivotPoint.x, -pivotPoint.y);\n\t\tg2d.translate(-position.x,-position.y);\n\t\t\n\t}",
"public final Shape translate(Vector fromPoint, Vector toPoint) {\n\t\treturn transform(new Translation(fromPoint, toPoint));\n\t}",
"public void translate(Point p){\n a.translate(p);\n b.translate(p);\n c.translate(p);\n }",
"public Transform getTransformation() {\n Transform t = Transform.newTranslation(position);\n t = t.compose(Transform.newScale(scale));\n t = t.compose(Transform.newXRotation(rotation.x));\n t = t.compose(Transform.newYRotation(rotation.y));\n t = t.compose(Transform.newZRotation(rotation.z));\n return t;\n }",
"public void translate( float x, float y )\n\t{\n\t\tMatrix4f opMat = new Matrix4f();\n\t\topMat.set( new Vector3f( x, y, 0 ) );\n\t\tmat.mul( opMat );\n\t}",
"public void skaliere(double u)\n {\n p1.setX(p1.getX() * u);\n p1.setY(p1.getY() * u);\n p2.setX(p2.getX() * u);\n p2.setY(p2.getY() * u);\n p3.setX(p3.getX() * u);\n p3.setY(p3.getY() * u);\n p4.setX(p4.getX() * u);\n p4.setY(p4.getY() * u);\n }",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"public Transform getTransform() {return transform;}",
"public void translateBy(float x, float y, float z) {\n\t\tposition.add(x, y, z);\n\t\tmodified = true;\n\t}",
"public PVector getTransformedPosition(){\n\t\treturn gui.getTransform().transform(position);\n\t}",
"public Matrix getTransform()\n {\n return transform;\n }",
"private void rotateTransformPoints(double angle) {\n int i;\n for(i=1; i<9;i++) {\n GeoVector vec = new GeoVector(this.transformPointers[i].getX(), this.transformPointers[i].getY(), this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n vec.rotate(((angle*-1.0) * (2.0*Math.PI))/360);\n vec.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.transformPointers[i].translate( (int)(vec.getX() - this.transformPointers[i].getX()), (int)(vec.getY() - this.transformPointers[i].getY()));\n }\n\n }",
"@Override\n public void setAffineTransform(AffineTransform af) {\n\n }",
"public void establishOldAffineTransform ( Graphics2D graphics2d )\n {\n oldAffineTransformation = graphics2d.getTransform ( );\n }",
"public void translate(int x, int y);",
"private void updateTranslationfromCenterAnchor(Pose pose, int teapotId) {\n float poseX = pose.tx();\n float poseZ = pose.tz();\n\n float anchorPoseX = globalCenterPose.tx();\n float anchorPoseZ = globalCenterPose.tz();\n\n float[] translate = new float[3];\n\n if (poseX > anchorPoseX) {\n translate[0] = poseX - anchorPoseX;\n } else {\n translate[0] = -(anchorPoseX - poseX);\n }\n\n if (poseZ > anchorPoseZ) {\n translate[2] = poseZ - anchorPoseZ;\n } else {\n translate[2] = -(anchorPoseZ - poseZ);\n }\n\n teapotTranslations[teapotId] = translate;\n }",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"public RMTransform getTransformInverse() { return getTransform().invert(); }",
"private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}",
"private static Point3d transformPoint(Matrix4d transformMat, Point3d originalPoint) {\n Point3d tempPoint = new Point3d();\n transformMat.transform(new Point3d(originalPoint.getX(), originalPoint.getY(), originalPoint.getZ()), tempPoint);\n return tempPoint;\n }",
"public synchronized void resetConquestWarriorTransformation() {\n ConquestWarriorTransformation = null;\n }",
"public Transform getTransform(){\n switch (this){\n case promote_terminals: return new SubexpressionTransformation.TerminalChain();\n case promote_redundant: return new SubexpressionTransformation.RedundantChain();\n case promote_summary: return new SubexpressionTransformation.SummarisingChain();\n case promote_chomsky: return new SubexpressionTransformation.ChomskyChain();\n case filter: return new RelationFilterTransformation();\n case order: return new EvaluationOrderTransformation(true, true);\n default: throw new RuntimeException(\"Unreachable\");\n }\n }",
"public static Transform identity(){\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {0.0f, 0.0f, 1.0f, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"private void setTransform(Transform3D trans) {\n this.transformGroup.setTransform(trans);\n }",
"public void translate(float theX, float theY) {\n\t}",
"@Override\n\tpublic Mat GetTranslateMatrix()\n\t{\n\t\treturn mT;\n\t}",
"public void updateTransformMatrix(float[] fArr) {\n boolean z;\n float f;\n float f2;\n boolean z2 = true;\n if (!this.mVideoStabilizationCropped || !ModuleManager.isVideoModule()) {\n f2 = 1.0f;\n f = 1.0f;\n z = false;\n } else {\n f2 = MOVIE_SOLID_CROPPED_X * 1.0f;\n f = MOVIE_SOLID_CROPPED_Y * 1.0f;\n z = true;\n }\n if (this.mNeedCropped) {\n f2 *= this.mScaleX;\n f *= this.mScaleY;\n z = true;\n }\n if (this.mDisplayOrientation == 0) {\n z2 = z;\n }\n if (z2) {\n Matrix.translateM(fArr, 0, 0.5f, 0.5f, 0.0f);\n Matrix.rotateM(fArr, 0, (float) this.mDisplayOrientation, 0.0f, 0.0f, 1.0f);\n Matrix.scaleM(fArr, 0, f2, f, 1.0f);\n Matrix.translateM(fArr, 0, -0.5f, -0.5f, 0.0f);\n }\n }",
"private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }",
"public T transform(T item) {\n T result = item;\n for (SimpleTransformation<T> transformation : transformations) {\n result = transformation.transform(result);\n }\n\n return result;\n }",
"public static void fromRotationTranslationScaleOrigin(final Quaternion q, final Vector3f v, final Vector3f s,\r\n\t\t\tfinal Matrix4f out, final Vector3f pivot) {\r\n\t\tfinal float x = q.x;\r\n\t\tfinal float y = q.y;\r\n\t\tfinal float z = q.z;\r\n\t\tfinal float w = q.w;\r\n\t\tfinal float x2 = x + x;\r\n\t\tfinal float y2 = y + y;\r\n\t\tfinal float z2 = z + z;\r\n\t\tfinal float xx = x * x2;\r\n\t\tfinal float xy = x * y2;\r\n\t\tfinal float xz = x * z2;\r\n\t\tfinal float yy = y * y2;\r\n\t\tfinal float yz = y * z2;\r\n\t\tfinal float zz = z * z2;\r\n\t\tfinal float wx = w * x2;\r\n\t\tfinal float wy = w * y2;\r\n\t\tfinal float wz = w * z2;\r\n\t\tfinal float sx = s.x;\r\n\t\tfinal float sy = s.y;\r\n\t\tfinal float sz = s.z;\r\n\t\tout.m00 = (1 - (yy + zz)) * sx;\r\n\t\tout.m01 = (xy + wz) * sx;\r\n\t\tout.m02 = (xz - wy) * sx;\r\n\t\tout.m03 = 0;\r\n\t\tout.m10 = (xy - wz) * sy;\r\n\t\tout.m11 = (1 - (xx + zz)) * sy;\r\n\t\tout.m12 = (yz + wx) * sy;\r\n\t\tout.m13 = 0;\r\n\t\tout.m20 = (xz + wy) * sz;\r\n\t\tout.m21 = (yz - wx) * sz;\r\n\t\tout.m22 = (1 - (xx + yy)) * sz;\r\n\t\tout.m23 = 0;\r\n\t\tout.m30 = (v.x + pivot.x) - ((out.m00 * pivot.x) + (out.m10 * pivot.y) + (out.m20 * pivot.z));\r\n\t\tout.m31 = (v.y + pivot.y) - ((out.m01 * pivot.x) + (out.m11 * pivot.y) + (out.m21 * pivot.z));\r\n\t\tout.m32 = (v.z + pivot.z) - ((out.m02 * pivot.x) + (out.m12 * pivot.y) + (out.m22 * pivot.z));\r\n\t\tout.m33 = 1;\r\n\t}",
"public static Transform newXRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, costh, -sinth, 0.0f},\n {0.0f, sinth, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public static Tree QPtransform(Tree t) {\n doTransform(t);\n return t;\n }",
"@Override\n\tpublic IMatrix nTranspose(boolean liveView) {\n\t\tif (liveView) {\n\t\t\treturn new MatrixTransposeView(this);\n\t\t} else {\n\t\t\treturn new MatrixTransposeView(this.copy());\n\t\t}\n\t}",
"protected void build_transforms()\n {\n goniometer_rotation = tof_calc.makeEulerRotation( phi, chi, -omega );\n\n goniometer_rotation_inverse = \n tof_calc.makeEulerRotationInverse( phi, chi, -omega );\n }",
"public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}",
"public final void transform(Tuple3f t) {\n\t\n \t// alias-safe\n \tthis.transform(t, t);\n }",
"public final void transform(Tuple3f t, Tuple3f result) {\n\t\n \t// alias-safe\n \tresult.set(this.m00 * t.x + this.m01 * t.y + this.m02 * t.z,\n \t\t\t this.m10 * t.x + this.m11 * t.y + this.m12 * t.z,\n \t\t\t this.m20 * t.x + this.m21 * t.y + this.m22 * t.z);\n }",
"public Transform() {\n setIdentity();\n }",
"public punto() {\n\t\t\tx = 0;\n\t\t\ty = 0;\n\t\t\tz = 0;\n\t\t}",
"public void fromTransformations(Transformations transformations);",
"protected void establishTransformationMatrix(final AffineTransform at) {\n saveGraphicsState();\n concatenateTransformationMatrix(UnitConv.mptToPt(at));\n }",
"public void reverseLastTranslation() {\r\n this.translate(-lastDx,-lastDy);\r\n }",
"public void translate(double Tx, double Ty, double Tz) {\r\n\t\tthis.set(MatrixMult(this, getTranslateInstance(Tx, Ty, Tz)));\r\n\t}",
"private AffineTransform createTransform() {\n Dimension size = getSize();\n Rectangle2D.Float panelRect = new Rectangle2D.Float(\n BORDER,\n BORDER,\n size.width - BORDER - BORDER,\n size.height - BORDER - BORDER);\n AffineTransform tr = AffineTransform.getTranslateInstance(panelRect.getCenterX(), panelRect.getCenterY());\n double sx = panelRect.getWidth() / mapBounds.getWidth();\n double sy = panelRect.getHeight() / mapBounds.getHeight();\n double scale = min(sx, sy);\n tr.scale(scale, -scale);\n tr.translate(-mapBounds.getCenterX(), -mapBounds.getCenterY());\n return tr;\n }"
] | [
"0.5749675",
"0.5734017",
"0.5608214",
"0.5591421",
"0.5508363",
"0.5473745",
"0.5278088",
"0.5265929",
"0.5259762",
"0.515249",
"0.51422286",
"0.5104175",
"0.5021292",
"0.50102144",
"0.5008092",
"0.4993547",
"0.49714598",
"0.4935059",
"0.49273822",
"0.49145812",
"0.48877695",
"0.486663",
"0.4833488",
"0.4829942",
"0.47979587",
"0.47969815",
"0.47907218",
"0.47758162",
"0.47598907",
"0.47493696",
"0.47245064",
"0.4707206",
"0.46947086",
"0.46914294",
"0.46856967",
"0.46634984",
"0.46460548",
"0.46404544",
"0.46371007",
"0.4636762",
"0.46104315",
"0.46015483",
"0.4594581",
"0.45934147",
"0.45909965",
"0.458242",
"0.45705184",
"0.45661741",
"0.45613092",
"0.45580226",
"0.45578516",
"0.45530194",
"0.45500514",
"0.45494705",
"0.45322174",
"0.45127788",
"0.45115533",
"0.45086244",
"0.45077476",
"0.45071048",
"0.4504263",
"0.4504105",
"0.44912484",
"0.44874263",
"0.4487225",
"0.44833457",
"0.44831592",
"0.44740686",
"0.4469363",
"0.4467699",
"0.44675386",
"0.4466647",
"0.4466598",
"0.4459423",
"0.4456712",
"0.44567108",
"0.44510764",
"0.4450326",
"0.44479078",
"0.44419432",
"0.4432692",
"0.44315767",
"0.4431552",
"0.44301173",
"0.44284734",
"0.4424201",
"0.44209242",
"0.44116268",
"0.44099507",
"0.44097248",
"0.44078693",
"0.4404313",
"0.4401542",
"0.44011483",
"0.4401084",
"0.44003618",
"0.43921238",
"0.43912587",
"0.4374108",
"0.4361771"
] | 0.46008024 | 42 |
Preconcatenates a rotation about the given center to the current user transform. As a result of invoking this method, the new user transform becomes: U' = R.U Where U is the previous user transform and R is the uniform scale transform: [1 0 x][cos(theta) sin(theta) 0][1 0 x] [0 1 y][sin(theta) cos(theta) 0][0 1 y] [0 0 1][ 0 0 1][0 0 1] Postive angles go clockwise because of the orientation of the coordinate system. | public void rotate(float theta, float x, float y) {
workTransform.setTransform(null);
workTransform.mTranslate(x, y);
workTransform.mRotate(theta);
workTransform.mTranslate(-x, -y);
workTransform.mMultiply(userTransform);
doc.setTransform(workTransform);
swapTransforms();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public float getRotation() { return centroid_rot; }",
"public void rotateTransform(Vector3f rot) {\r\n\t\tMatrix4f rx = new Matrix4f();\r\n\t\tMatrix4f ry = new Matrix4f();\r\n\t\tMatrix4f rz = new Matrix4f();\r\n\t\t\t\t\r\n\t\t// Convert the angles to radians\r\n\t\tfloat x = (float) Math.toRadians(rot.x);\r\n\t\tfloat y = (float) Math.toRadians(rot.y);\r\n\t\tfloat z = (float) Math.toRadians(rot.z);\r\n\r\n\t\t// Create the X-Rotation matrix\r\n\t\trx.m[0][0] = 1.0f; rx.m[0][1] = 0.0f;\t \t\t\t rx.m[0][2] = 0.0f; \t\t\t\trx.m[0][3] = 0.0f;\r\n\t rx.m[1][0] = 0.0f; rx.m[1][1] = (float) Math.cos(x); rx.m[1][2] = (float) -Math.sin(x); rx.m[1][3] = 0.0f;\r\n\t rx.m[2][0] = 0.0f; rx.m[2][1] = (float) Math.sin(x); rx.m[2][2] = (float) Math.cos(x) ; rx.m[2][3] = 0.0f;\r\n\t rx.m[3][0] = 0.0f; rx.m[3][1] = 0.0f; \t\t\t\t rx.m[3][2] = 0.0f;\t\t \t\t\trx.m[3][3] = 1.0f;\r\n\r\n\t // Create the Y-Rotation matrix\r\n\t ry.m[0][0] = (float) Math.cos(y); ry.m[0][1] = 0.0f; ry.m[0][2] = (float) -Math.sin(y); ry.m[0][3] = 0.0f;\r\n\t ry.m[1][0] = 0.0f; \t\t\t\t ry.m[1][1] = 1.0f; ry.m[1][2] = 0.0f; \t\t\t\try.m[1][3] = 0.0f;\r\n\t ry.m[2][0] = (float) Math.sin(y); ry.m[2][1] = 0.0f; ry.m[2][2] = (float) Math.cos(y) ; ry.m[2][3] = 0.0f;\r\n\t ry.m[3][0] = 0.0f; \t\t\t\t ry.m[3][1] = 0.0f; ry.m[3][2] = 0.0f; \t\t\t\try.m[3][3] = 1.0f;\r\n\r\n\t // Create the Z-Rotation matrix\r\n\t rz.m[0][0] = (float) Math.cos(z); rz.m[0][1] = (float) -Math.sin(z); rz.m[0][2] = 0.0f; rz.m[0][3] = 0.0f;\r\n\t rz.m[1][0] = (float) Math.sin(z); rz.m[1][1] = (float) Math.cos(z) ; rz.m[1][2] = 0.0f; rz.m[1][3] = 0.0f;\r\n\t rz.m[2][0] = 0.0f; \t\t\t\t rz.m[2][1] = 0.0f; \t\t\t\t rz.m[2][2] = 1.0f; rz.m[2][3] = 0.0f;\r\n\t rz.m[3][0] = 0.0f; \t\t\t\t rz.m[3][1] = 0.0f; \t\t\t\t rz.m[3][2] = 0.0f; rz.m[3][3] = 1.0f;\r\n\t\t\t\r\n\t // Multiply all the matrices together\r\n\t\tMatrix4f rzy = rz.mult(ry);\r\n\t\tMatrix4f r = rzy.mult(rx);\r\n\t\t\t \r\n\t\tm = r.m;\r\n\r\n\t}",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"private void updateRotated() {\r\n\r\n\tfor (int n = 0; n < npoints * 3; n += 3) {\r\n\r\n\t // take the linear sum of local co-ords with local\r\n\t // unit vectors and then translate by adding the local\r\n\t // origin's co-ords\r\n\t ps[n] = locals[n] * i[0] + locals[n + 1] * j[0] + locals[n + 2] * k[0];\r\n\t ps[n + 1] = locals[n] * i[1] + locals[n + 1] * j[1] + locals[n + 2] * k[1];\r\n\t ps[n + 2] = locals[n] * i[2] + locals[n + 1] * j[2] + locals[n + 2] * k[2];\r\n\r\n\t ps[n] += p[0];\r\n\t ps[n + 1] += p[1];\r\n\t ps[n + 2] += p[2];\r\n\t}\r\n\r\n\t// reset bounding box and clear dirty flags\r\n\tbox.setBB();\r\n\tdirtyR = false;\r\n\tdirtyT = false;\r\n\r\n\t// normals must be reset\r\n\tthis.setNormals();\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n\t_roll = roll;\r\n }",
"protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }",
"public void resetUserTransform() {\n workTransform.setTransform(null);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"void copyOffsetRotation (DMatrix3 R);",
"public void setCenterOfRotation(float[] cor) {\n\t\t//centerOfRotation.set(cor);\n\t}",
"void applyRotationMatrix() {\n for (int i = 0; i < coors.length; i++) {\n for (int j = 0; j < coors[i].length; j++) {\n newCoors[i][j] = coors[i][0] * R[j][0] + coors[i][1] * R[j][1] + coors[i][2] * R[j][2];\n }\n // add perspective\n float scale = map(Math.abs(newCoors[i][2]), 0, (float) (halfSize * Math.sqrt(3)), 1, 1.5f);\n if (newCoors[i][2] < 0) {\n scale = 2f - scale;\n }\n for (int j = 0; j < 2; j++) {\n newCoors[i][j] *= scale;\n }\n }\n // to R2\n // just dont use Z\n setPathAndAlpha();\n }",
"protected void setupRotationOrigin()\n\t{\n\t\tthis.currentRotationAxis = new Point2D.Double(getOriginX(), getOriginY());\n\t\tupdateDefaultMomentMass();\n\t\tthis.currentMomentMass = this.defaultMomentMass;\n\t\t\n\t\t//changeRotationAxisTo(new Point2D.Double(0, 0));\n\t}",
"void copyRotation(DMatrix3 R);",
"void setRotation (DMatrix3C R);",
"public void setCenterOfRotation(Point centerOfRotation) {\r\n\t\tthis.centerOfRotation = centerOfRotation;\r\n\t}",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"@Override\n\tpublic Sample normalize(Sample sample) {\n\t\tdouble angle = 0;\n\n\t\tint smallestX = 100000000;\n\t\tint largestX = -100000000;\n\t\tint smallestXIndex = 0;\n\t\tint largestXIndex = 0;\n\t\tfor (int i = 0; i < sample.getMatrix().size(); i++) {\n\t\t\t// Looking for the left most point.\n\t\t\tList<Integer> vector = sample.getMatrix().get(i);\n\t\t\tint avg = getAverageX(vector);\n\t\t\tif (avg < smallestX) {\n\t\t\t\tsmallestX = avg;\n\t\t\t\tsmallestXIndex = i;\n\t\t\t}\n\t\t\tif (avg > largestX) {\n\t\t\t\tlargestX = avg;\n\t\t\t\tlargestXIndex = i;\n\t\t\t}\n\t\t}\n\t\tList<Integer> leftVector = sample.getMatrix().get(smallestXIndex);\n\t\tList<Integer> rightVector = sample.getMatrix().get(largestXIndex);\n\n\t\tint leftX = leftVector.get(0);\n\t\tint leftY = leftVector.get(1);\n\t\tint rightX = rightVector.get(0);\n\t\tint rightY = rightVector.get(1);\n\t\t\n\t\tdouble dy = rightY - leftY;\n\t\tdouble dx = rightX - leftX;\n\t\t\n\t\t//estimate the center point to perform rotation around.\n\t\tdouble centerX = leftX+(dx/2);\n\t\tdouble centerY = leftY+(dy/2);\n\n\t\tangle = (-1)*Math.atan2(dy, dx);\n\n\t\tif (Math.abs(angle) > ROTATION_THRESHOLD) {\n\t\t\tfor (List<Integer> vector : sample.getMatrix()) {\n\t\t\t\tfor (int i = 0; i < vector.size(); i += 2) {\n\t\t\t\t\tdouble x = vector.get(i)-centerX; //rotation around (0,0)\n\t\t\t\t\tdouble y = vector.get(i + 1)-centerY; //rotation around (0,0)\n\t\t\t\t\t// x' = x*cos(a) - y*sin(a)\n\t\t\t\t\t// y' = x*sin(a) + y*cos(a)\n\t\t\t\t\tvector.set(i,\n\t\t\t\t\t\t\t(int)(Math.round(((x * Math.cos(angle)) - (y * Math.sin(angle))))+centerX));\n\t\t\t\t\tvector.set(i + 1,\n\t\t\t\t\t\t\t(int)(Math.round(((x * Math.sin(angle)) + (y * Math.cos(angle))))+centerY));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn sample;\n\t}",
"protected void build_transforms()\n {\n goniometer_rotation = tof_calc.makeEulerRotation( phi, chi, -omega );\n\n goniometer_rotation_inverse = \n tof_calc.makeEulerRotationInverse( phi, chi, -omega );\n }",
"void setOffsetRotation(DMatrix3C R);",
"public void setRotate() {\r\n\t\tint npoints = xpoints.length;\r\n\t\tdouble[] tempxpoints = new double[xpoints.length];\r\n\t\tdouble[] tempypoints = new double[xpoints.length];\r\n\t\tdouble radians = Math.toRadians(angle%360);\r\n\t\tdouble y = pivotY;\r\n\t\tdouble x = pivotX;\r\n\t\tfor(int i = 0; i<xpoints.length; i++) {\r\n\t\t\ttempxpoints[i] = (Math.cos(radians)*(xpoints[i]-x)-Math.sin(radians)*(ypoints[i]-y)+x);\r\n\t\t\ttempypoints[i] = (Math.sin(radians)*(xpoints[i]-x)+Math.cos(radians)*(ypoints[i]-y)+y);\r\n\t\t}\r\n\t\txpoints = tempxpoints;\r\n\t\typoints = tempypoints;\r\n\t\tangle = 0;\r\n\t}",
"public void recenter()\n {\n PointF center = centroid();\n\n for (PointF point : points)\n {\n point.x -= center.x;\n point.y -= center.y;\n }\n }",
"public void postRotateQuat(float x, float y, float z, float w) {\n \n float len = (float) Math.sqrt(x*x+y*y+z*z+w*w);\n if(len != 1){\n x /= len;\n y /= len;\n z /= len;\n w /= len;\n }\n \n float[] r = { \n 1 - (2*y*y + 2*z*z), 2*x*y - 2*z*w, 2*x*z+2*y*w, 0,\n 2*x*y + 2*z*w, 1 - (2*x*x + 2*z*z), 2*y*z-2*x*w, 0,\n 2*x*z - 2*y*w, 2*y*z + 2*x*w, 1 - (2*x*x+2*y*y), 0,\n 0, 0, 0, 1.0f};\n matrix = mulMM(matrix, r);\n }",
"public void apply() {\n\t\tglTranslated(0, 0, -centerDistance);\n\t\tglRotated(pitch, 1, 0, 0);\n\t\tglRotated(yaw, 0, 0, 1);\n\t\tglScaled(scale, scale, scale);\n\n\t\tglTranslated(-pos.get(0), -pos.get(1), -pos.get(2));\n\t}",
"private void processOrientation(Quaternion raw) {\r\n\t\tfloat t = 1.0f - (raw.x * raw.x) - (raw.y * raw.y) - (raw.z * raw.z);\r\n\t\tif (t < 0.0f) raw.w = 0.0f;\r\n\t\telse raw.w = -(FastMath.sqrt(t));\r\n\t}",
"public abstract Vector4fc rotateAbout(float angle, float x, float y, float z);",
"void rotate();",
"public void rotate() {\n // amoeba rotate\n // Here i will use my rotation_x and rotation_y\n }",
"public void preConcatenate(AffineTransform3D Tx) {\r\n\t\tthis.set(MatrixMult(Tx, this));\r\n\t}",
"private void normalizeOrientation() {\n\t\twhile (this.orientation >= 2 * Math.PI) {\n\t\t\torientation -= 2 * Math.PI;\n\t\t}\n\t\twhile (this.orientation < 0) {\n\t\t\torientation += 2 * Math.PI;\n\t\t}\n\t}",
"public void cameraTransform(Vector3f targ, Vector3f up) {\r\n\t\t// First normalize the target\r\n\t\tVector3f n = targ;\r\n\t\tn.normalize();\r\n\t\t// Then normalize the up vector\r\n\t\tVector3f u = up;\r\n\t\tu.normalize();\r\n\t\t// Then cross the two together to get the right vector\r\n\t\tu = u.cross(n);\r\n\t\tVector3f v = n.cross(u);\r\n\r\n\t\t// Finally build a matrix from the result\r\n\t\tm[0][0] = u.x; m[0][1] = u.y; m[0][2] = u.z; m[0][3] = 0.0f;\r\n\t\tm[1][0] = v.x; m[1][1] = v.y; m[1][2] = v.z; m[1][3] = 0.0f;\r\n\t\tm[2][0] = n.x; m[2][1] = n.y; m[2][2] = n.z; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}",
"void rotate(float x, float y, float z) {\n target_angle[0] += x;\n target_angle[1] += y;\n target_angle[2] += z;\n postSetAngle();\n }",
"public static void fromRotationTranslationScaleOrigin(final Quaternion q, final Vector3f v, final Vector3f s,\r\n\t\t\tfinal Matrix4f out, final Vector3f pivot) {\r\n\t\tfinal float x = q.x;\r\n\t\tfinal float y = q.y;\r\n\t\tfinal float z = q.z;\r\n\t\tfinal float w = q.w;\r\n\t\tfinal float x2 = x + x;\r\n\t\tfinal float y2 = y + y;\r\n\t\tfinal float z2 = z + z;\r\n\t\tfinal float xx = x * x2;\r\n\t\tfinal float xy = x * y2;\r\n\t\tfinal float xz = x * z2;\r\n\t\tfinal float yy = y * y2;\r\n\t\tfinal float yz = y * z2;\r\n\t\tfinal float zz = z * z2;\r\n\t\tfinal float wx = w * x2;\r\n\t\tfinal float wy = w * y2;\r\n\t\tfinal float wz = w * z2;\r\n\t\tfinal float sx = s.x;\r\n\t\tfinal float sy = s.y;\r\n\t\tfinal float sz = s.z;\r\n\t\tout.m00 = (1 - (yy + zz)) * sx;\r\n\t\tout.m01 = (xy + wz) * sx;\r\n\t\tout.m02 = (xz - wy) * sx;\r\n\t\tout.m03 = 0;\r\n\t\tout.m10 = (xy - wz) * sy;\r\n\t\tout.m11 = (1 - (xx + zz)) * sy;\r\n\t\tout.m12 = (yz + wx) * sy;\r\n\t\tout.m13 = 0;\r\n\t\tout.m20 = (xz + wy) * sz;\r\n\t\tout.m21 = (yz - wx) * sz;\r\n\t\tout.m22 = (1 - (xx + yy)) * sz;\r\n\t\tout.m23 = 0;\r\n\t\tout.m30 = (v.x + pivot.x) - ((out.m00 * pivot.x) + (out.m10 * pivot.y) + (out.m20 * pivot.z));\r\n\t\tout.m31 = (v.y + pivot.y) - ((out.m01 * pivot.x) + (out.m11 * pivot.y) + (out.m21 * pivot.z));\r\n\t\tout.m32 = (v.z + pivot.z) - ((out.m02 * pivot.x) + (out.m12 * pivot.y) + (out.m22 * pivot.z));\r\n\t\tout.m33 = 1;\r\n\t}",
"private void updateCamera() {\n\t\tVector3f x = new Vector3f();\n\t\tVector3f y = new Vector3f();\n\t\tVector3f z = new Vector3f();\n\t\tVector3f temp = new Vector3f(this.mCenterOfProjection);\n\n\t\ttemp.sub(this.mLookAtPoint);\n\t\ttemp.normalize();\n\t\tz.set(temp);\n\n\t\ttemp.set(this.mUpVector);\n\t\ttemp.cross(temp, z);\n\t\ttemp.normalize();\n\t\tx.set(temp);\n\n\t\ty.cross(z, x);\n\n\t\tMatrix4f newMatrix = new Matrix4f();\n\t\tnewMatrix.setColumn(0, x.getX(), x.getY(), x.getZ(), 0);\n\t\tnewMatrix.setColumn(1, y.getX(), y.getY(), y.getZ(), 0);\n\t\tnewMatrix.setColumn(2, z.getX(), z.getY(), z.getZ(), 0);\n\t\tnewMatrix.setColumn(3, mCenterOfProjection.getX(),\n\t\t\t\tmCenterOfProjection.getY(), mCenterOfProjection.getZ(), 1);\n\t\ttry {\n\t\t\tnewMatrix.invert();\n\t\t\tthis.mCameraMatrix.set(newMatrix);\n\t\t} catch (SingularMatrixException exc) {\n\t\t\tLog.d(\"Camera\",\n\t\t\t\t\t\"SingularMatrixException on Matrix: \"\n\t\t\t\t\t\t\t+ newMatrix.toString());\n\t\t}\n\t}",
"public void setCameraRotateForPickUp(float[] quat) {\n float[] newquat = normalizeQuat(quat);\n float rollRad = getRollRad(newquat);\n //Need to convert radians to convert to rotation that camera is using\n //pass to augmented image renderer and convert back into quaternion\n augmentedImageRenderer.updateCameraRotateForPickUp(eulerAnglesRadToQuat(-rollRad, 0, 0));\n }",
"private Point[] inverseTransformCoordinateSystem(Point[] objectPosition, Point centerOffset) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\tobjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x += centerOffset.x,\n\t\t\t\tobjectPosition[i].y += centerOffset.y\t\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}",
"private void resetRotationAxisToOrigin()\n\t{\n\t\tdouble newSpeed = this.currentMomentMass * getRotation() /\n\t\t\t\tthis.defaultMomentMass;\n\t\t\n\t\t// Changes back to normal rotation\n\t\tthis.currentRotationAxis = new Point2D.Double(getOriginX(), getOriginY());\n\t\tsetRotation(newSpeed);\n\t}",
"public void rotate(double deg) {\n deg = deg % 360;\n// System.out.println(\"Stopni:\" + deg);\n double e = 0;\n double f = 0;\n\n// for(int i = 0; i < pixels.length; i++) {\n// for(int j = 0; j < pixels[i].length; j++) {\n// e += pixels[i][j].getX();\n// f += pixels[i][j].getY();\n// }\n// }\n //e = e / (pixels.length * 2);\n //f = f / (pixels[0].length * 2);\n e = pixels.length / 2;\n f = pixels[0].length / 2;\n System.out.println(e);\n System.out.println(f);\n\n// System.out.println(e + \":\" + f);\n Matrix affineTransform;\n Matrix translateMinus = Matrix.translateRotate(-e, -f);\n Matrix translatePlus = Matrix.translateRotate(e, f);\n Matrix movedTransform = Matrix.multiply(translateMinus, Matrix.rotate(deg));\n //movedTransform.display();\n affineTransform = Matrix.multiply(movedTransform, translatePlus);\n //affineTransform.display();\n\n for(int i = 0; i < pixels.length; i++) {\n for(int j = 0; j < pixels[i].length; j++) {\n double[][] posMatrix1 = {{pixels[i][j].getX()}, {pixels[i][j].getY()}, {1}};\n Matrix m1 = new Matrix(posMatrix1);\n Matrix result1;\n result1 = Matrix.multiply(Matrix.transpose(affineTransform.v), m1);\n\n pixels[i][j].setX(Math.round(result1.v[0][0]));\n pixels[i][j].setY(Math.round(result1.v[1][0]));\n }\n }\n\n\n }",
"void calculateRotationMatrix() {\n R[0][0] = (float) (Math.cos(angle[0]) * Math.cos(angle[1]));\n R[1][0] = (float) (Math.sin(angle[0]) * Math.cos(angle[1]));\n R[0][1] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) - Math.sin(angle[0]) * Math.cos(angle[2]));\n R[1][1] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.sin(angle[2]) + Math.cos(angle[0]) * Math.cos(angle[2]));\n R[0][2] = (float) (Math.cos(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) + Math.sin(angle[0]) * Math.sin(angle[2]));\n R[1][2] = (float) (Math.sin(angle[0]) * Math.sin(angle[1]) * Math.cos(angle[2]) - Math.cos(angle[0]) * Math.sin(angle[2]));\n R[2][0] = (float) - Math.sin(angle[1]);\n R[2][1] = (float) (Math.cos(angle[1]) * Math.sin(angle[2]));\n R[2][2] = (float) (Math.cos(angle[1]) * Math.cos(angle[2]));\n }",
"void setOffsetWorldRotation(DMatrix3C R);",
"@Override\n default void prependPitchRotation(double pitch)\n {\n AxisAngleTools.prependPitchRotation(pitch, this, this);\n }",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"public static Point PointRotate3D(final Point origin, final Point toRotate, final Vector rotationAxis, final float angle) { \n Vector axis = (rotationAxis.magnitude() == 1) ? rotationAxis : rotationAxis.normal();\n float dist = sqrt(sq(axis.y) + sq(axis.z)); \n Matrix T = new Matrix(new double[][]{\n new double[] {1, 0, 0, -origin.x},\n new double[] {0, 1, 0, -origin.y},\n new double[] {0, 0, 1, -origin.z},\n new double[] {0, 0, 0, 1},\n });\n Matrix TInv = T.inverse();\n\n float aZ = (axis.z == 0 && dist == 0) ? 0 : (axis.z / dist);\n float aY = (axis.y == 0 && dist == 0) ? 0 : (axis.y / dist);\n Matrix Rx = new Matrix(new double[][]{\n new double[] {1, 0, 0, 0},\n new double[] {0, aZ, -aY, 0},\n new double[] {0, aY, aZ, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix RxInv = new Matrix(new double[][]{\n new double[] {1, 0, 0, 0},\n new double[] {0, aZ, aY, 0},\n new double[] {0, -aY, aZ, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix Ry = new Matrix(new double[][]{\n new double[] {dist, 0, -axis.x, 0},\n new double[] {0, 1, 0, 0},\n new double[] {axis.x, 0, dist, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix RyInv = Ry.inverse();\n\n Matrix Rz = new Matrix(new double[][]{\n new double[] {cos(angle), -sin(angle), 0, 0},\n new double[] {sin(angle), cos(angle), 0, 0},\n new double[] {0, 0, 1, 0},\n new double[] {0, 0, 0, 1},\n });\n\n Matrix origSpace = new Matrix(new double[][] {\n new double[]{toRotate.x},\n new double[]{toRotate.y},\n new double[]{toRotate.z},\n new double[]{1}\n });\n Matrix rotated = TInv.times(RxInv).times(RyInv).times(Rz).times(Ry).times(Rx).times(T).times(origSpace);\n\n return new Point((float) rotated.get(0, 0), (float) rotated.get(1, 0), (float) rotated.get(2, 0));\n }",
"LocalMaterialData rotate();",
"public static Transform newXRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, costh, -sinth, 0.0f},\n {0.0f, sinth, costh, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"@Override\n\tpublic float getCenterOfRotationX() {\n\t\treturn 0.25f;\n\t}",
"DMatrix3C getRotation();",
"public Transform getRotationTransformation() {\n Transform t = Transform.newXRotation(rotation.x);\n t = t.compose(Transform.newYRotation(rotation.y));\n t = t.compose(Transform.newZRotation(rotation.z));\n return t;\n }",
"public void rotate(){\n\t\t\n\t\tfor(Vertex v : vertices){\n\n\t\t\tMatrix m = ViewSettings.getRotationMatrix4().multiply(v);\n\n\t\t\tv.setX(m.getValue(0, 0));\n\t\t\tv.setY(m.getValue(1, 0));\n\t\t\tv.setZ(m.getValue(2, 0));\n\t\t\tv.setW(m.getValue(3, 0));\n\t\t}\n\t}",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"void setPrevRotations(Vec2 rotations);",
"private void rotate() {\n byte tmp = topEdge;\n topEdge = leftEdge;\n leftEdge = botEdge;\n botEdge = rightEdge;\n rightEdge = tmp;\n tmp = reversedTopEdge;\n reversedTopEdge = reversedLeftEdge;\n reversedLeftEdge = reversedBotEdge;\n reversedBotEdge = reversedRightEdge;\n reversedRightEdge = tmp;\n tmp = ltCorner;\n ltCorner = lbCorner;\n lbCorner = rbCorner;\n rbCorner = rtCorner;\n rtCorner = tmp;\n\n }",
"public void calculateRotation() {\r\n float x = this.getX();\r\n float y = this.getY();\r\n\r\n float mouseX = ((float) Mouse.getX() - 960) / (400.0f / 26.0f);\r\n float mouseY = ((float) Mouse.getY() - 540) / (400.0f / 23.0f);\r\n\r\n float b = mouseX - x;\r\n float a = mouseY - y;\r\n\r\n rotationZ = (float) Math.toDegrees(Math.atan2(a, b)) + 90;\r\n\r\n forwardX = (float) Math.sin(Math.toRadians(rotationZ));\r\n forwardY = (float) -Math.cos(Math.toRadians(rotationZ));\r\n }",
"private void setupTransformationMatrix(ShapeRenderer renderer){\n\t\trenderer.identity();\n\t\trenderer.translate(cx, cy, 0);\n\t\trenderer.rotate(0, 0, 1, angle); \n\t\trenderer.translate(-cx, -cy, 0);\n\t}",
"public void zRotate() {\n\t\t\n\t}",
"private void setOrigin() {\n Hep3Vector origin = VecOp.mult(CoordinateTransformations.getMatrix(), _sensor.getGeometry().getPosition());\n // transform to p-side\n Polygon3D psidePlane = this.getPsidePlane();\n Translation3D transformToPside = new Translation3D(VecOp.mult(-1 * psidePlane.getDistance(),\n psidePlane.getNormal()));\n this._org = transformToPside.translated(origin);\n }",
"protected void updatePreviewDisplayRotation(Size previewSize, TextureView textureView) {\n int rotationDegrees = 0;\n MCameraActivity activity = mCameraActivity;\n int displayRotation = activity.getWindowManager().getDefaultDisplay().getRotation();\n Configuration config = activity.getResources().getConfiguration();\n // Get UI display rotation\n switch (displayRotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n }\n // Get device natural orientation\n int deviceOrientation = Configuration.ORIENTATION_PORTRAIT;\n if ((rotationDegrees % 180 == 0 &&\n config.orientation == Configuration.ORIENTATION_LANDSCAPE) ||\n ((rotationDegrees % 180 != 0 &&\n config.orientation == Configuration.ORIENTATION_PORTRAIT))) {\n deviceOrientation = Configuration.ORIENTATION_LANDSCAPE;\n }\n // Rotate the buffer dimensions if device orientation is portrait.\n int effectiveWidth = previewSize.getWidth();\n int effectiveHeight = previewSize.getHeight();\n if (deviceOrientation == Configuration.ORIENTATION_PORTRAIT) {\n effectiveWidth = previewSize.getHeight();\n effectiveHeight = previewSize.getWidth();\n }\n // Find and center view rect and buffer rect\n Matrix transformMatrix = textureView.getTransform(null);\n int viewWidth = textureView.getWidth();\n int viewHeight = textureView.getHeight();\n RectF viewRect = new RectF(0, 0, viewWidth, viewHeight);\n RectF bufRect = new RectF(0, 0, effectiveWidth, effectiveHeight);\n float centerX = viewRect.centerX();\n float centerY = viewRect.centerY();\n bufRect.offset(centerX - bufRect.centerX(), centerY - bufRect.centerY());\n // Undo ScaleToFit.FILL done by the surface\n transformMatrix.setRectToRect(viewRect, bufRect, Matrix.ScaleToFit.FILL);\n // Rotate buffer contents to proper orientation\n transformMatrix.postRotate((360 - rotationDegrees) % 360, centerX, centerY);\n if ((rotationDegrees % 180) == 90) {\n int temp = effectiveWidth;\n effectiveWidth = effectiveHeight;\n effectiveHeight = temp;\n }\n // Scale to fit view, cropping the longest dimension\n float scale =\n Math.max(viewWidth / (float) effectiveWidth, viewHeight / (float) effectiveHeight);\n transformMatrix.postScale(scale, scale, centerX, centerY);\n Handler handler = new Handler(Looper.getMainLooper());\n class TransformUpdater implements Runnable {\n TextureView mView;\n Matrix mTransformMatrix;\n\n TransformUpdater(TextureView view, Matrix matrix) {\n mView = view;\n mTransformMatrix = matrix;\n }\n\n @Override\n public void run() {\n mView.setTransform(mTransformMatrix);\n }\n }\n handler.post(new TransformUpdater(textureView, transformMatrix));\n }",
"private void computeRotate() {\n time = Math.min(\n duration,\n time + MaterialWeatherView.WeatherAnimationImplementor.REFRESH_INTERVAL);\n rotationNow = (rotationEnd - rotationStart) * (1 - Math.pow(1 - 1.0 * time / duration, 2 * FACTOR))\n + rotationStart;\n if (time == duration) {\n // finish.\n rotating = false;\n }\n }",
"@Override\n \t\t\t\tpublic void doRotateX() {\n \n \t\t\t\t}",
"@Override\r\n\tpublic void rotate() {\n\t\t\r\n\t}",
"public Point getCenterOfRotation() {\r\n\t\treturn centerOfRotation;\r\n\t}",
"public Matrix rotate90DegreeInPlace() {\n\t\tfor(int layer = 0; layer < this.getWidth() / 2; ++layer) {\n\t\t\tint first = layer;\n\t\t\tint last = this.getWidth() - 1 - layer;\n\t\t\t\n\t\t\tfor(int i = first; i < last; ++i) {\n\t\t\t\tint offset = i - first;\n\t\t\t\t\n\t\t\t\t//save top\n\t\t\t\tdouble top = this.getElement(first, i);\n\t\t\t\t\n\t\t\t\t// left -> top\n\t\t\t\tthis.setElement(first, i, this.getElement(last - offset, first));\n\t\t\t\t// bottom -> left\n\t\t\t\tthis.setElement(last - offset, first, this.getElement(last, last - offset));\n\t\t\t\t// right -> bottom\n\t\t\t\tthis.setElement(last, last - offset, this.getElement(i, last));\n\t\t\t\t// top -> right\n\t\t\t\tthis.setElement(i, last, top);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t}",
"public void rotateCCW() {\n for (Vector2D vec : template) {\n CCW.matrixVectorProductInPlace(vec);\n }\n }",
"@Override\n default void prependYawRotation(double yaw)\n {\n AxisAngleTools.prependYawRotation(yaw, this, this);\n }",
"public static NewRotateLeft create(AnimatableModelInstance originObject, float ex, float ey, int duration) {\n\n\t\tVector3 posO = originObject.transState.position.cpy();\t\n\t\t//Vector3 posO = new Vector3();\n\t\t//originObject.transform.getTranslation(posO);\n\t\t\n\t\tQuaternion rotation = originObject.transState.rotation.cpy();\t\n\t\t//Quaternion rotation = new Quaternion();\n\t\t//originObject.transform.getRotation(rotation,true); //existing rotation\n\t\t\n\t\t Vector3 axisVec = new Vector3();\n\t float existingangle = (float) (rotation.getAxisAngle(axisVec) * axisVec.nor().z);\n\t existingangle = existingangle < 0 ? existingangle + 360 : existingangle; //convert <0 values\n\t\t\n\t\tGdx.app.log(logstag,\"_____________________________________existing angle=\"+existingangle); //relative to x axis pointing left anticlockwise\n\t\n\t\t//float scalex = originObject.transform.getScaleX(); //get how much the object has been scaled\n\t\t//float scaley = originObject.transform.getScaleY();\n\t\t\n\t\tVector2 fromPoint = new Vector2(posO.x,posO.y); //we need to scale them down due to how the positions might have been scaled up if the matrix is scaled (I hate how matrixs work :-/ Just cant get it in my head)\n\t\tVector2 tooPoint = new Vector2(ex,ey);\n\n\t\tfromPoint.sub(tooPoint); \n\n\t\t//Log.info(\"length=\"+corner2.len());\n\n\t\tfloat angle = 180+fromPoint.angle(); //absolute angle between the two objects\n\t\tGdx.app.log(logstag,\"________target angle=\"+angle); //should point towards ex/ey \n\t\t\n\t//\tfloat distance = fromPoint.len();\n\n\t\t\n\t\t//difference between this angle and existing one\n\t\tangle = angle - existingangle;\n\t\t\n\t\tNewRotateLeft rot = new NewRotateLeft(angle,500);\n\t\t//NewForward forward = new NewForward(distance,duration-500);\n\t\t\t\t\n\t\treturn rot;\n\t}",
"public void postRotate(float angle, float x, float y, float z){\n angle = (float)Math.toRadians(angle);\n \n float len = (float) Math.sqrt(x*x+y*y+z*z);\n if(len != 1){\n x /= len;\n y /= len;\n z /= len;\n }\n float c = (float) Math.cos(angle);\n float s = (float) Math.sin(angle);\n \n float[] r = {\n x*x*(1-c)+c , x*y*(1-c)-z*s, x*z*(1-c)+y*s, 0,\n y*x*(1-c)+z*s, y*y*(1-c)+c, y*z*(1-c)-x*s, 0,\n x*z*(1-c)-y*s, y*z*(1-c)+x*s, z*z*(1-c)+c, 0,\n 0, 0 , 0, 1};\n\n matrix = mulMM(matrix, r);\n }",
"public void resetRotation(Vector3 rotationVector) {\n // setta la matrice accumulatedRotation come matrice identità...\n Matrix.setIdentityM(accumulatedRotation, 0);\n // ...gli applica la rotazione...\n Matrix.rotateM(accumulatedRotation, 0, (float) rotationVector.x(), 1.0f, 0.0f, 0.0f);\n Matrix.rotateM(accumulatedRotation, 0, (float) rotationVector.y(), 0.0f, 1.0f, 0.0f);\n Matrix.rotateM(accumulatedRotation, 0, (float) rotationVector.z(), 0.0f, 0.0f, 1.0f);\n\n // come ultima cosa tiene traccia degli angoli di rotazione sui 3 assi\n angle.x(rotationVector.x());\n angle.y(rotationVector.y());\n angle.z(rotationVector.z());\n }",
"public Vector rotateAroundAxisX(Vector center, double theta) {\n double cosTheta = Math.cos(theta);\n double sinTheta = Math.sin(theta);\n Vector centered = difference(center);\n Vector rotated = new Vector(\n centered.x,\n centered.y * cosTheta - centered.z * sinTheta,\n centered.y * sinTheta + centered.z * cosTheta\n );\n return rotated.sum(center);\n }",
"public float[] getCenterOfRotation(float[] cor) {\n\t\tif ((cor == null) || (cor.length < 3)) {\n\t\t\tcor = new float[3];\n\t\t}\n\t\tcenterOfRotation.get(cor);\n\t\treturn(cor);\n\t}",
"public static Transform rotate(float radians) {\n\t\tVector2f rot = cpvforangle(radians);\n\t\treturn transpose(rot.x, -rot.y, 0.0f, rot.y, rot.x, 0.0f);\n\t}",
"public abstract void rotate();",
"DMatrix3C getOffsetRotation();",
"public void setRotation(float newRotation)\n {\n setRotation(newRotation, Anchor.CENTER.of(this));\n }",
"private void rotateTransformPoints(double angle) {\n int i;\n for(i=1; i<9;i++) {\n GeoVector vec = new GeoVector(this.transformPointers[i].getX(), this.transformPointers[i].getY(), this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n vec.rotate(((angle*-1.0) * (2.0*Math.PI))/360);\n vec.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.transformPointers[i].translate( (int)(vec.getX() - this.transformPointers[i].getX()), (int)(vec.getY() - this.transformPointers[i].getY()));\n }\n\n }",
"public AffineTransform getInitialCtm(\n )\n {\n AffineTransform initialCtm;\n if(getScanner().getRenderContext() == null) // Device-independent.\n {\n initialCtm = new AffineTransform(); // Identity.\n }\n else // Device-dependent.\n {\n IContentContext contentContext = getScanner().getContentContext();\n Dimension2D canvasSize = getScanner().getCanvasSize();\n\n // Axes orientation.\n RotationEnum rotation = contentContext.getRotation();\n switch(rotation)\n {\n case Downward:\n initialCtm = new AffineTransform(1, 0, 0, -1, 0, canvasSize.getHeight());\n break;\n case Leftward:\n initialCtm = new AffineTransform(0, 1, 1, 0, 0, 0);\n break;\n case Upward:\n initialCtm = new AffineTransform(-1, 0, 0, 1, canvasSize.getWidth(), 0);\n break;\n case Rightward:\n initialCtm = new AffineTransform(0, -1, -1, 0, canvasSize.getWidth(), canvasSize.getHeight());\n break;\n default:\n throw new NotImplementedException();\n }\n\n // Scaling.\n Rectangle2D contentBox = contentContext.getBox();\n Dimension2D rotatedCanvasSize = rotation.transform(canvasSize);\n initialCtm.scale(\n rotatedCanvasSize.getWidth() / contentBox.getWidth(),\n rotatedCanvasSize.getHeight() / contentBox.getHeight()\n );\n\n // Origin alignment.\n initialCtm.translate(-contentBox.getMinX(), -contentBox.getMinY());\n }\n return initialCtm;\n }",
"Point rotate (double angle, Point result);",
"public void setRotation(float newRotation, PointF newPivot)\n {\n this.rotation = newRotation;\n this.rotationPivot = newPivot;\n \n updateTransform();\n notifyParentOfPositionChange();\n conditionallyRepaint();\n }",
"private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }",
"public @NotNull Image rotateCCW()\n {\n if (this.data != null)\n {\n if (this.mipmaps > 1) Image.LOGGER.warning(\"Image manipulation only applied to base mipmap level\");\n \n Color.Buffer output = Color.malloc(this.format, this.width * this.height);\n \n long srcPtr = this.data.address();\n long dstPtr = output.address();\n \n for (int y = 0; y < this.height; y++)\n {\n for (int x = 0; x < this.width; x++)\n {\n long src = Integer.toUnsignedLong(y * this.width + this.width - x - 1) * this.format.sizeof;\n long dst = Integer.toUnsignedLong(x * this.height + y) * this.format.sizeof;\n \n MemoryUtil.memCopy(srcPtr + src, dstPtr + dst, this.format.sizeof);\n }\n }\n \n this.data.free();\n this.data = output;\n }\n return this;\n }",
"private Point[] transformCoordinateSystem(Point[] objectPosition, Point newCenter) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\t// Move location to coordinate system with center in origo \n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x - newCenter.x,\n\t\t\t\tobjectPosition[i].y - newCenter.y\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"public void rotateToFront() {\n SXRTransform transform = mSceneRootObject.getTransform();\n transform.setRotation(1, 0, 0, 0);\n transform.rotateByAxisWithPivot(-frontFacingRotation + 180, 0, 1, 0, 0, 0, 0);\n }",
"private Vector3f rotate2(float angle, float t, Vector3f X, boolean lerpZ) {\n\t\tVector3f W = project(X, N);\n\t\tVector3f U = X.subtract(W);\n\t\tVector3f result = lerp(W, W.negate(), lerpZ ? t : 0);\n\t\tresult.addScaleLocal(U, (float) Math.cos(angle*t));\n\t\tresult.addScaleLocal(N.cross(U), -(float) Math.sin(angle*t));\n\t\treturn result;\n\t}",
"protected Matrix4 computeTransform() {\n return super.computeTransform();\n }",
"private void applyRotation(int position, float start, float end) {\n\t\tfinal float centerX = mContainer.getWidth() / 2.0f;\n\t\tfinal float centerY = mContainer.getHeight() / 2.0f;\n\t\tfinal Rotate3d rotation = new Rotate3d(start, end, centerX, centerY,\n\t\t\t\t310.0f, true);\n\t\trotation.setDuration(500);\n\t\trotation.setFillAfter(true);\n\t\trotation.setInterpolator(new AccelerateInterpolator());\n\t\trotation.setAnimationListener(new DisplayNextView(position));\n\t\tmContainer.startAnimation(rotation);\n\t}",
"public void rotate2D(Point3D center, double angle) {\n _x = _x - center.x();\n _y = _y - center.y();\n double a = Math.atan2(_y,_x);\n //\tSystem.out.println(\"Angle: \"+a);\n double radius = Math.sqrt((_x*_x) + (_y*_y));\n _x = (center.x() + radius * Math.cos(a+angle));\n _y = (center.y() + radius * Math.sin(a+angle));\n }",
"public Matrix4 setToRotation(float axisX, float axisY, float axisZ, float angle) {\n if (angle != 0.0f) {\n return set(quat.set(tmpV.set(axisX, axisY, axisZ), angle));\n }\n idt();\n return this;\n }",
"public void rotate(double angle) {\t\t\n\t\t// precompute values\n\t\tVector t = new Vector(this.a14, this.a24, this.a34);\n\t\tif (t.length() > 0) t = t.norm();\n\t\t\n\t\tdouble x = t.x();\n\t\tdouble y = t.y();\n\t\tdouble z = t.z();\n\t\t\n\t\tdouble s = Math.sin(angle);\n\t\tdouble c = Math.cos(angle);\n\t\tdouble d = 1 - c;\n\t\t\n\t\t// precompute to avoid double computations\n\t\tdouble dxy = d*x*y;\n\t\tdouble dxz = d*x*z;\n\t\tdouble dyz = d*y*z;\n\t\tdouble xs = x*s;\n\t\tdouble ys = y*s;\n\t\tdouble zs = z*s;\n\t\t\n\t\t// update matrix\n\t\ta11 = d*x*x+c; a12 = dxy-zs; a13 = dxz+ys;\n\t\ta21 = dxy+zs; a22 = d*y*y+c; a23 = dyz-xs;\n\t\ta31 = dxz-ys; a32 = dyz+xs; a33 = d*z*z+c;\n\t}",
"protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }",
"public void xRotate() {\n\t\t\n\t}",
"public static double normalizeAngle(double a, double center)\r\n/* 25: */ {\r\n/* 26: 91 */ return a - 6.283185307179586D * FastMath.floor((a + 3.141592653589793D - center) / 6.283185307179586D);\r\n/* 27: */ }",
"private float interpolateRotation(float par1, float par2, float par3)\n {\n float f3;\n\n for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F)\n {\n ;\n }\n\n while (f3 >= 180.0F)\n {\n f3 -= 360.0F;\n }\n\n return par1 + par3 * f3;\n }",
"void rotate () {\n final int rows = currentPiece.height;\n final int columns = currentPiece.width;\n int[][] rotated = new int[columns][rows];\n\n for (int i = 0; i < rows; i++)\n for (int j = 0; j < columns; j++)\n rotated[j][i] = currentPiece.blocks[i][columns - 1 - j];\n\n Piece rotatedPiece = new Piece(currentPiece.color, rotated);\n int kicks[][] = {\n {0, 0},\n {0, 1},\n {0, -1},\n //{0, -2},\n //{0, 2},\n {1, 0},\n //{-1, 0},\n {1, 1},\n //{-1, 1},\n {1, -1},\n //{-1, -1},\n };\n for (int kick[] : kicks) {\n if (canMove(currentRow + kick[0], currentColumn + kick[1], rotatedPiece)) {\n //System.out.println(\"Kicking \" + kick[0] + \", \" + kick[1]);\n currentPiece = rotatedPiece;\n currentRow += kick[0];\n currentColumn += kick[1];\n updateView();\n break;\n }\n }\n }",
"public abstract Vector4fc rotate(IQuaternionf quat);",
"@Override\n default void prependRollRotation(double roll)\n {\n AxisAngleTools.prependRollRotation(roll, this, this);\n }",
"public Quaternion getCurrentRotation() {\n long currentTimeMillis = System.currentTimeMillis();\n\n if (currentTimeMillis > finishTimeMillis) {\n return finishRotation;\n } else {\n float percent = ((float)(currentTimeMillis-startTimeMillis)) / ((float)(finishTimeMillis-startTimeMillis));\n Quaternion interpolatedRotation = new Quaternion();\n \n // Not sure if slerp is right, but you never know !\n interpolatedRotation.slerp(startRotation, finishRotation, percent);\n return interpolatedRotation;\n }\n }",
"@Override\n\tpublic void rotate() {\n\t}",
"public void forceSyncRotation() {\n this.rotateCtr = 14;\n }",
"public static Transform newZRotation(float th){\n float sinth = (float) Math.sin(th);\n float costh = (float) Math.cos(th);\n return new Transform(new float[][]{\n {costh, -sinth, 0.0f, 0.0f},\n {sinth, costh, 0.0f, 0.0f},\n {0.0f, 0.0f, 1.0f, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public void rotateBy(float angleDelta)\n {\n this.rotation += angleDelta;\n \n updateTransform();\n notifyParentOfPositionChange();\n conditionallyRepaint();\n }",
"public abstract Vector4fc rotateZ(float angle);",
"private Vector rollCorrectCenterCubes(AutopilotInputs_v2 inputs, Vector currentCoord){\n //get the roll from the inputs\n float roll = inputs.getRoll();\n// System.out.println(\"Current roll: \" + roll);\n //make the transformation matrix\n SquareMatrix rollMatrix = new SquareMatrix(new float[]{(float) cos(roll), (float) -sin(roll), 0,\n (float) sin(roll), (float) cos(roll) , 0,\n 0 , 0 , 1});\n //then transform the inputs back to the original:\n Vector correctedVector = rollMatrix.matrixVectorProduct(currentCoord);\n //save the corrected form\n return correctedVector;\n //return\n }",
"public void rotate(Vector3 rotationVector) {\n // setta la matrice lastRotation come matrice identità...\n Matrix.setIdentityM(lastRotation, 0);\n // ...gli applica la rotazione...\n Matrix.rotateM(lastRotation, 0, (float) rotationVector.x(), 1.0f, 0.0f, 0.0f);\n Matrix.rotateM(lastRotation, 0, (float) rotationVector.y(), 0.0f, 1.0f, 0.0f);\n Matrix.rotateM(lastRotation, 0, (float) rotationVector.z(), 0.0f, 0.0f, 1.0f);\n\n // ...applica questa nuova rotazione alla matrice di rotazione complessiva...\n Matrix.multiplyMM(rotationMatrix, 0, lastRotation, 0, accumulatedRotation, 0);\n\n // ...e salva questa nuova matrice di rotazione in accumulatedRotation che verrà usata nel rendering\n System.arraycopy(rotationMatrix, 0, accumulatedRotation, 0, 16);\n\n // come ultima cosa calcola i gradi che esprimono la rotazione attuale\n // convertendoli da radianti in gradi e poi cambiandone il segno\n angle.x(-Math.atan2(accumulatedRotation[9],accumulatedRotation[10])*180/Math.PI);\n angle.y(-Math.atan2(-accumulatedRotation[8],\n (float)Math.sqrt(accumulatedRotation[9]*accumulatedRotation[9]+accumulatedRotation[10]*accumulatedRotation[10]))*180/Math.PI);\n angle.z(-Math.atan2(accumulatedRotation[4],accumulatedRotation[0])*180/Math.PI);\n }"
] | [
"0.52985203",
"0.528802",
"0.52560717",
"0.52425075",
"0.522926",
"0.52103126",
"0.5207778",
"0.5182516",
"0.5176308",
"0.5162379",
"0.50850034",
"0.5075222",
"0.5020304",
"0.50090957",
"0.49590385",
"0.4956102",
"0.49560523",
"0.48385763",
"0.48143375",
"0.48113155",
"0.4808755",
"0.4789929",
"0.47839174",
"0.47800446",
"0.47754702",
"0.47753713",
"0.47579855",
"0.475717",
"0.47546718",
"0.47375366",
"0.47021937",
"0.4697294",
"0.46925166",
"0.46826",
"0.46799505",
"0.46782345",
"0.46738428",
"0.46701148",
"0.46688673",
"0.46675396",
"0.46598935",
"0.4659473",
"0.46535492",
"0.46330133",
"0.4619828",
"0.46024475",
"0.45999712",
"0.4594763",
"0.45822787",
"0.45650023",
"0.4554205",
"0.45444897",
"0.45375836",
"0.4529903",
"0.45141625",
"0.4504258",
"0.4499783",
"0.4484766",
"0.4479149",
"0.446407",
"0.44619048",
"0.44578907",
"0.44540113",
"0.4448098",
"0.44424257",
"0.44316304",
"0.4429994",
"0.44193986",
"0.44180232",
"0.44165307",
"0.44104025",
"0.4409781",
"0.44094837",
"0.4400696",
"0.43969157",
"0.43955868",
"0.43943778",
"0.43927422",
"0.4380236",
"0.43776497",
"0.4372885",
"0.43716305",
"0.4363212",
"0.43554577",
"0.43514535",
"0.4331541",
"0.43224418",
"0.43142965",
"0.4314071",
"0.4309671",
"0.43079987",
"0.43048236",
"0.42928436",
"0.42908126",
"0.42896742",
"0.42822865",
"0.4276068",
"0.42730743",
"0.42472818",
"0.42357537",
"0.42327902"
] | 0.0 | -1 |
Resets the user transform to identity. As a result, the user transform becomes: [1 0 0] [0 1 0] [0 0 1] | public void resetUserTransform() {
workTransform.setTransform(null);
doc.setTransform(workTransform);
swapTransforms();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"private void setMToIdentity()\n\t\t{\n\t\t\tfor(rowNumber = 0; rowNumber < 4; rowNumber++)\n\t\t\t\tfor(int column = 0; column < 4; column++)\n\t\t\t\t{\n\t\t\t\t\tif(rowNumber == column)\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 1;\n\t\t\t\t\telse\n\t\t\t\t\t\tmElements[rowNumber*4 + column] = 0;\n\t\t\t\t}\n\t\t\ttransform = new Transform3D(mElements);\n\t\t\trowNumber = 0;\n\t\t}",
"public void setIdentity() {\n System.arraycopy(IDENTITY, 0, matrix, 0, 16);\n }",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"private void swapTransforms() {\n Transform tmp = workTransform;\n workTransform = userTransform;\n userTransform = tmp;\n }",
"public static Transform identity(){\n return new Transform(new float[][]{\n {1.0f, 0.0f, 0.0f, 0.0f},\n {0.0f, 1.0f, 0.0f, 0.0f},\n {0.0f, 0.0f, 1.0f, 0.0f},\n {0.0f, 0.0f, 0.0f, 1.0f}\n });\n }",
"public void SetMatrixToIdentity() {\n \n\t/*\n\tinputs--\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[0][0] = 1;\t this.mat_f_m[0][1] = 0;\tthis.mat_f_m[0][2] = 0;\t this.mat_f_m[0][3] = 0;\n\tthis.mat_f_m[1][0] = 0;\t this.mat_f_m[1][1] = 1;\tthis.mat_f_m[1][2] = 0;\t this.mat_f_m[1][3] = 0;\n\tthis.mat_f_m[2][0] = 0;\t this.mat_f_m[2][1] = 0;\tthis.mat_f_m[2][2] = 1;\t this.mat_f_m[2][3] = 0;\n\tthis.mat_f_m[3][0] = 0;\t this.mat_f_m[3][1] = 0;\tthis.mat_f_m[3][2] = 0;\t this.mat_f_m[3][3] = 1;\t\n \n }",
"public void initIdentity() \r\n\t{\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\t}",
"public final void setIdentity() {\n m00 = 1f;\n m11 = 1f;\n m22 = 1f;\n m33 = 1f;\n\n m01 = 0f;\n m02 = 0f;\n m03 = 0f;\n m10 = 0f;\n m12 = 0f;\n m13 = 0f;\n m20 = 0f;\n m21 = 0f;\n m23 = 0f;\n m30 = 0f;\n m31 = 0f;\n m32 = 0f;\n }",
"public void set(Transform transform) {\n \tif(transform == null){ // TODO: Quick workaround for wap3 cars problem\n \t\tsetIdentity();\n \t}\n \telse {\n \t\tSystem.arraycopy(transform.matrix, 0, this.matrix, 0, 16);\n \t}\n }",
"public final native Mat4 resetToIdentity() /*-{\n return $wnd.mat4.identity(this);\n }-*/;",
"public void makeIdentity() {\n if (rows == cols) {\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n if (i == j) {\n matrix.get(i)[j] = 1;\n }\n else {\n matrix.get(i)[j] = 0;\n }\n }\n }\n }\n else {\n throw new NonSquareMatrixException();\n }\n }",
"public final void setIdentity() {\n \t\n this.m00 = 1.0F;\n this.m01 = 0.0F;\n this.m02 = 0.0F;\n this.m10 = 0.0F;\n this.m11 = 1.0F;\n this.m12 = 0.0F;\n this.m20 = 0.0F;\n this.m21 = 0.0F;\n this.m22 = 1.0F;\n }",
"public Transform() {\n setIdentity();\n }",
"public void resetPose() {\n }",
"public void resetMMatrix() {\n Matrix.setIdentityM(mModelMatrix, 0);\n }",
"public void setTransform(Transform transform);",
"public void reset(){\r\n\t\tSystem.out.println(\"(EnigmaMachine) Initial Positions: \" + Arrays.toString(initPositions));\r\n\t\trotors.setPositions(initPositions);\r\n\t}",
"@Test\n public void testIdentity() throws TransformException {\n create(3, 0, 1, 2);\n assertIsIdentity(transform);\n assertParameterEquals(Affine.provider(3, 3, true).getParameters(), null);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = source.clone();\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"public void reset() {\n\t\tinit(0, 0, 1, false);\n\t}",
"public void transform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"transform\");\r\n\t}",
"public void reset() {\n\t\tmCenterOfProjection = new Vector3f(0, 0, 15);\n\t\tmLookAtPoint = new Vector3f(0, 0, 0);\n\t\tmUpVector = new Vector3f(0, 1, 0);\n\t\tmCameraMatrix = new Matrix4f();\n\t\tthis.update();\n\t}",
"public void glLoadIdentity() {\r\n\t\tMatrix.setIdentityM(this.mMatrixStack, this.mMatrixStackOffset);\r\n\t}",
"public void setTransform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"setTransform\");\r\n\t}",
"protected synchronized void resetModelViewMatrix()\n {\n Matrix4d transform = new Matrix4d();\n // translate so that the viewer is at the origin\n Matrix4d translation = new Matrix4d();\n translation.setTranslation(myPosition.getLocation().multiply(-1.));\n // rotate to put the viewer pointing in the -z direction with the up\n // vector along the +y axis.\n Quaternion quat = Quaternion.lookAt(myPosition.getDir().multiply(-1.), myPosition.getUp());\n Matrix4d rotation = new Matrix4d();\n rotation.setRotationQuaternion(quat);\n // set the transform.\n transform.multLocal(rotation);\n transform.multLocal(translation);\n myModelViewMatrix = transform.toFloatArray();\n setInverseModelViewMatrix(transform.invert());\n clearModelToWindowTransform();\n }",
"public Transform(Transform transform){\n System.arraycopy(transform.matrix, 0, matrix, 0, 16); \n }",
"public void modelUntangle()\n {\n\tif (manim==null) return;\n\n\tmodelStop();\n\tmanim.rewind();\n\tmanim.generations().unTangle();\n\tmanim.scale(width,height);\n\tclearToBack();\n\tmodelFlush();\n }",
"public synchronized void resetConquestWarriorTransformation() {\n ConquestWarriorTransformation = null;\n }",
"void setTransforms(Transforms transforms);",
"protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }",
"public void setToOriginals(){\n\t\t//set all occupied nodes as empty\n\t\tif(nodeStatus == Status.occupied){\n\t\t\tsetAsEmpty();\n\t\t}\n\t\t//if the node had a unit end on it, reset that value\n\t\tif(ended == true){\n\t\t\tended=false;\n\t\t}\n\t\tf=0;\n\t\tg=0;\n\t\th=0;\n\t}",
"private void resetMatrix() {\n mSuppMatrix.reset();\n setImageViewMatrix(getDrawMatrix());\n checkMatrixBounds();\n }",
"public RMTransform getTransformInverse() { return getTransform().invert(); }",
"public void clearTargetRotation ()\n {\n _targetRotation = _actor.getRotation();\n ((Agent)_actor).setTurnDirection(0);\n }",
"protected void resetProjectionMatrix()\n {\n float tan = (float)Math.tan(myHalfFOVx);\n synchronized (this)\n {\n resetProjectionMatrixClipped();\n myProjectionMatrix = new float[16];\n myProjectionMatrix[0] = 1f / tan;\n myProjectionMatrix[5] = (float)(myAspectRatio / tan);\n myProjectionMatrix[10] = -1f;\n myProjectionMatrix[11] = -1f;\n myProjectionMatrix[14] = -2f;\n clearModelToWindowTransform();\n }\n }",
"public static void reset(){\r\n\t\tx=0;\r\n\t\ty=0;\r\n\t}",
"public void identity(){\n for (int j = 0; j<4; j++){\n \tfor (int i = 0; i<4; i++){\n \t\tif (i == j)\n \t\t\tarray[i][j] = 1;\n \t\telse\n \t\t\tarray[i][j] = 0;\n \t }\n \t }\n\t}",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"public static void inverseTransform() {\n int first = BinaryStdIn.readInt();\n String st = BinaryStdIn.readString();\n char[] t1 = st.toCharArray();\n int length = t1.length;\n\n int[] count = new int[R + 1];\n int[] next = new int[length];\n\n for (int i = 0; i < length; i++)\n count[t1[i] + 1]++;\n for (int r = 0; r < R; r++)\n count[r + 1] += count[r];\n for (int i = 0; i < length; i++)\n next[count[t1[i]]++] = i;\n\n\n for (int i = 0; i < length; i++) {\n first = next[first];\n BinaryStdOut.write(t1[first]);\n\n }\n BinaryStdOut.close();\n }",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public void resetAlphaValues();",
"public void invert() {\n \n float[] result = new float[16];\n System.arraycopy(IDENTITY, 0, result, 0, 16);\n \n for(int i = 0; i < 4; i++){\n int i4 = i*4;\n \n // make sure[i,i] is != 0\n \n for(int j = 0; matrix[i4+i] == 0 && j < 4; j++){\n if(j != i && matrix[j*4+i] != 0){\n transform(i, 1, j, matrix, result);\n }\n }\n \n // ensure tailing 0s\n \n for(int j = 0; j < i; j++){\n if(matrix[i4+j] != 0){\n transform(i, -matrix[i4+j]/matrix[j*4+j], j, matrix, result);\n }\n }\n\n if(matrix[i4+i] == 0){\n throw new IllegalArgumentException(\"Not invertable\");\n }\n\n // dump(\"row \"+i+\" leading zeros\", matrix, result);\n }\n \n for(int i = 3; i >= 0; i--){\n int i4 = i*4;\n if(matrix[i4+i] != 1){\n float f = matrix[i4+i];\n matrix[i4+i] = 1;\n for(int j = 0; j < 4; j++){\n result[i4+j] /= f;\n if(j > i){\n matrix[i4+j] /= f;\n }\n }\n }\n\n// dump(\"row \"+i+\" leading 1\", matrix, result);\n \n for(int j = i+1; j < 4; j++){\n if(matrix[i*4+j] != 0){\n transform(i, -matrix[i*4+j], j, matrix, result);\n }\n }\n\n// dump(\"row \"+i+\" tailing 0\", matrix, result);\n\n }\n\n matrix = result;\n }",
"public void reset(){\n x = originalX;\n y = originalY;\n dx = originalDX;\n dy = originalDY;\n }",
"public void rotate() \n {\n \tint[] rotatedState = new int[state.length];\n \tfor (int i = 0; i < state.length; ++i)\n \t\trotatedState[(i+7)%14] = state[i];\n \tstate = rotatedState;\n }",
"public void reset() {\r\n this.x = resetX;\r\n this.y = resetY;\r\n state = 0;\r\n }",
"protected static void setIdentityTransformer(com.tangosol.net.security.IdentityTransformer transformer)\n {\n __s_IdentityTransformer = transformer;\n }",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"private void abortTransformations() {\n for (Integer num : this.mTransformedViews.keySet()) {\n TransformState currentState = getCurrentState(num.intValue());\n if (currentState != null) {\n currentState.abortTransformation();\n currentState.recycle();\n }\n }\n }",
"private void resetMask() {\n maskArray = new int [][]{\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0},\n {0,0,0,0}\n };\n }",
"public void reset(){\n active = false;\n done = false;\n state = State.invisible;\n curX = 0;\n }",
"public void flip() {\n float tx = x1;\n float ty = y1;\n x1 = x2;\n y1 = y2;\n x2 = tx;\n y2 = ty;\n nx = -nx;\n ny = -ny;\n }",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"public void rotateBack() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[i][j] = tmp_grid[i][j];\n\t\t}",
"public void resetPhase();",
"public void resetAngle() {\n\t\t//this.angle = (this.orientation % 4 + 4) * (90);\n\t\tthis.angle = this.orientation * 90*-1;\n\t\tthis.tweenAngle.setCurrentValue(this.angle);\n\t\tthis.tweenAngle.setTargetValue(this.angle);\n\t}",
"public final void reset$$dsl$guidsl$ltms() {\n userSet = false;\n value = variable.U;\n // to be extended by later layers\n }",
"public void rotate() {\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\ttmp_grid[i][j] = squares[i][j];\n\t\t\t// copy back rotated 90 degrees\n\t\t\tfor(int i=0; i<4; i++)\n\t\t\t\tfor(int j=0; j<4; j++)\n\t\t\t\t\tsquares[j][i] = tmp_grid[i][3-j];\n \n //log rotation\n LogEvent(\"rotate\");\n\t\t}",
"public final void resetCtxts(){\n System.arraycopy(initStates,0,I,0,I.length);\n ArrayUtil.intArraySet(mPS,0);\n }",
"private void aretes_aY(){\n\t\tthis.cube[49] = this.cube[43]; \n\t\tthis.cube[43] = this.cube[21];\n\t\tthis.cube[21] = this.cube[10];\n\t\tthis.cube[10] = this.cube[32];\n\t\tthis.cube[32] = this.cube[49];\n\t}",
"private void reset() {\n\t availableInputs = new HashSet<String>(Arrays.asList(INPUT));\n\t requiredOutputs = new HashSet<String>(Arrays.asList(OUTPUT));\n\t updateInputAndOutput(availableInputs, requiredOutputs);\n\t}",
"@Override\n public void Invert() {\n\t \n }",
"public void reset(){\n currentStage = 0;\n currentSide = sideA;\n }",
"public void transform(Matrix m)\n { \n\t \tfor(int i= 0 ; i < this.vertex.length ; i++)\n\t \t{\n\t \t\tthis.vertex[i] = this.vertex[i].transform(m);\n\t \t}\n\t \n }",
"private void arretes_fY(){\n\t\tthis.cube[49] = this.cube[46]; \n\t\tthis.cube[46] = this.cube[48];\n\t\tthis.cube[48] = this.cube[52];\n\t\tthis.cube[52] = this.cube[50];\n\t\tthis.cube[50] = this.cube[49];\n\t}",
"public void reset() {\r\n minX = null;\r\n maxX = null;\r\n minY = null;\r\n maxY = null;\r\n\r\n minIn = null;\r\n maxIn = null;\r\n\r\n inverted = false;\r\n }",
"public void restoreOldTransform ( Graphics2D graphics2d )\n {\n graphics2d.setTransform ( getOldAffineTransform ( ) );\n }",
"public void reset() {\n this.predictor.reset();\n for(int i=0; i<this.predictedIntraday.length; i++) {\n this.predictedIntraday[i] = 0;\n }\n }",
"public TransformationMatrix() {\n\t\ta11 = 1; a12 = 0; a13 = 0; a14 = 0;\n\t\ta21 = 0; a22 = 1; a23 = 0; a24 = 0;\n\t\ta31 = 0; a32 = 0; a33 = 1; a34 = 0;\n\t}",
"void rotate();",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"public void reset () {\n input = 0;\n }",
"public void reset() {\r\n active.clear();\r\n missioncontrollpieces = GameConstants.PIECES_SET;\r\n rolled = 0;\r\n phase = 0;\r\n round = 0;\r\n action = 0;\r\n }",
"public void restore() {\n currentIm= originalIm.copy();\n }",
"public void resetCigs() {\n user.resetCigs();\n saveData();\n }",
"static void setIdentityM(float[] sm, int smOffset) {\n for (int i = 0; i < 16; i++) {\n sm[smOffset + i] = 0;\n }\n for (int i = 0; i < 16; i += 5) {\n sm[smOffset + i] = 1.0f;\n }\n }",
"@Override\n public void setAffineTransform(AffineTransform af) {\n\n }",
"public synchronized void reset(){\n\t\tif(motor.isMoving())\n\t\t\treturn;\n\t\tmotor.rotateTo(0);\n\t}",
"@NativeType(\"uint32_t\")\n public static int bgfx_set_transform(@NativeType(\"void const *\") FloatBuffer _mtx) {\n return nbgfx_set_transform(memAddress(_mtx), (short)(_mtx.remaining() >> 4));\n }",
"protected void reset() {\n leftSkier.reset();\n rightSkier.reset();\n }",
"public void zero() {\r\n\t\tthis.x = 0.0f;\r\n\t\tthis.y = 0.0f;\r\n\t}",
"public void reset()\n {\n // put your code here\n position = 0;\n order = \"\";\n set[0] = 0;\n set[1] = 0;\n set[2] = 0;\n }",
"public Matrix4f SetMatrixToIdentityAndGet() {\n \n\t/*\n\tinputs--\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tthis :\n\t The self matrix set to identity\n\t*/\n\t\n\tthis.mat_f_m[0][0] = 1;\t this.mat_f_m[0][1] = 0;\tthis.mat_f_m[0][2] = 0;\t this.mat_f_m[0][3] = 0;\n\tthis.mat_f_m[1][0] = 0;\t this.mat_f_m[1][1] = 1;\tthis.mat_f_m[1][2] = 0;\t this.mat_f_m[1][3] = 0;\n\tthis.mat_f_m[2][0] = 0;\t this.mat_f_m[2][1] = 0;\tthis.mat_f_m[2][2] = 1;\t this.mat_f_m[2][3] = 0;\n\tthis.mat_f_m[3][0] = 0;\t this.mat_f_m[3][1] = 0;\tthis.mat_f_m[3][2] = 0;\t this.mat_f_m[3][3] = 1;\t\n\t\n\treturn this;\n \n }",
"public void flip(){\n Matrix mirrorMatrix = new Matrix();\n mirrorMatrix.preScale(-1, 1);\n Bitmap turnMap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mirrorMatrix, false);\n turnMap.setDensity(DisplayMetrics.DENSITY_DEFAULT);\n bitmap = new BitmapDrawable(turnMap).getBitmap();\n }",
"public void SetMatrixToZeros() {\n \n\t/*\n\tinputs--\n\t*/\n\t\n\t/*\n\toutputs--\n\t*/\n\t\n\tthis.mat_f_m[0][0] = 0;\t this.mat_f_m[0][1] = 0;\tthis.mat_f_m[0][2] = 0;\t this.mat_f_m[0][3] = 0;\n\tthis.mat_f_m[1][0] = 0;\t this.mat_f_m[1][1] = 0;\tthis.mat_f_m[1][2] = 0;\t this.mat_f_m[1][3] = 0;\n\tthis.mat_f_m[2][0] = 0;\t this.mat_f_m[2][1] = 0;\tthis.mat_f_m[2][2] = 0;\t this.mat_f_m[2][3] = 0;\n\tthis.mat_f_m[3][0] = 0;\t this.mat_f_m[3][1] = 0;\tthis.mat_f_m[3][2] = 0;\t this.mat_f_m[3][3] = 0;\t\n \n }",
"public void reset() {\n\t board = new int[]{1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0,\n 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0,\n 0, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2};\n\t currentPlayer = 1;\n\t turnCount = 0;\n\t for (int i=0; i<81; i++) {\n\t \n\t\t hash ^= rand[3*i+board[i]]; //row-major order\n\t \n\t }\n }",
"public void setTransform(CGAffineTransform transform) {\n \t\tthis.transform = transform;\n \t}",
"public void resetEnc(){\n EncX.reset();\n }",
"public void flip() {\n flipRecur(root);\n }",
"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 transform() {\n\t\tthis.targetRootBlock = copy(this.sourceRootBlock);\n\n\t\tList<BlockImpl> blocks = allSubobjectsOfKind(targetRootBlock,\n\t\t\t\tBlockImpl.class);\n\t\tList<Block> emptyBlocks = new LinkedList<Block>();\n\t\tfor (Block block : blocks) {\n\t\t\tif (block.getModelElement().size() == 0) {\n\t\t\t\temptyBlocks.add(block);\n\t\t\t}\n\t\t}\n\n\t\tfor (Block block : emptyBlocks) {\n\t\t\tcreateSquare(block);\n\t\t\tEcoreUtil.delete(block);\n\t\t}\n\n\t\tif (LOGGER.isInfoEnabled()) {\n\t\t\tLOGGER.info(\"Completed Transformation\");\n\t\t}\n\t}",
"public final native void transform(String transform, Element node) /*-{ this.transform(transform, node) }-*/;",
"void resetMotionVector()\n {\n forwardVector.resetMotionVector();\n backwardVector.resetMotionVector();\n }",
"public void resetUpperface() {\n\t\tdetectionModel.getPrimaryDataModel().getExpressiveDataModel().setRaiseBrow(0);\n\t\tdetectionModel.getPrimaryDataModel().getExpressiveDataModel().setFurrowBrow(0);\n\t}",
"public void reset() {\n for (int i = 0; i < this.numRows; i++) {\n this.rows[i] = new int[0];\n }\n for (int k = 0; k < this.numCols; k++) {\n this.cols[k] = new IntOpenHashSet();\n }\n }",
"public static void reset() {\n Castle.userId(null);\n Castle.flush();\n }",
"@NativeType(\"uint32_t\")\n public static int bgfx_set_transform(@NativeType(\"void const *\") ByteBuffer _mtx) {\n return nbgfx_set_transform(memAddress(_mtx), (short)(_mtx.remaining() >> 6));\n }",
"public void resetData() {\n user = new User();\n saveData();\n }",
"private void resetRotationAxisToOrigin()\n\t{\n\t\tdouble newSpeed = this.currentMomentMass * getRotation() /\n\t\t\t\tthis.defaultMomentMass;\n\t\t\n\t\t// Changes back to normal rotation\n\t\tthis.currentRotationAxis = new Point2D.Double(getOriginX(), getOriginY());\n\t\tsetRotation(newSpeed);\n\t}",
"public void Reset(){\n py = 0f;\n }",
"public static void inverseTransform()\r\n {\r\n \tint first = BinaryStdIn.readInt();\r\n \tString s = BinaryStdIn.readString();\r\n \tBinaryStdIn.close();\r\n \t\r\n \tchar[] t = s.toCharArray();\r\n \r\n \tchar[] firstCharacters = t.clone();\r\n \tArrays.sort(firstCharacters);\r\n \t\r\n \t// Construction next[] using t[] and first\r\n \tint[] next = constructNext(t, firstCharacters, first);\r\n \t\r\n \t// Writing original string to StdOut using next[] and first\r\n \tint index = first;\r\n \tfor (int i = 0; i < t.length; i++)\r\n \t{\r\n \t\tBinaryStdOut.write(firstCharacters[index]);\r\n \t\tindex = next[index];\r\n \t}\r\n \tBinaryStdOut.close();\r\n }"
] | [
"0.67230994",
"0.65821",
"0.6476933",
"0.6323734",
"0.6242517",
"0.61927956",
"0.60196",
"0.59179455",
"0.59166235",
"0.58707356",
"0.58177626",
"0.58092535",
"0.5754163",
"0.57215905",
"0.5657319",
"0.56390715",
"0.56248885",
"0.55938005",
"0.5590878",
"0.55555564",
"0.5529668",
"0.55244243",
"0.55098593",
"0.550043",
"0.54898685",
"0.54804856",
"0.5455026",
"0.5436452",
"0.5351128",
"0.53296125",
"0.5321325",
"0.5298298",
"0.52979225",
"0.5270998",
"0.5266834",
"0.5254119",
"0.5242129",
"0.52385795",
"0.5212404",
"0.5198989",
"0.5194733",
"0.51892596",
"0.516258",
"0.5162078",
"0.5161478",
"0.51542896",
"0.5152844",
"0.51333404",
"0.5126167",
"0.51044524",
"0.5101975",
"0.51014644",
"0.50909007",
"0.5074154",
"0.50661117",
"0.5058153",
"0.5055042",
"0.5051925",
"0.5040708",
"0.503187",
"0.5027736",
"0.5018438",
"0.5018332",
"0.5015611",
"0.50111425",
"0.50106555",
"0.50105304",
"0.50054723",
"0.50033927",
"0.5002567",
"0.49939248",
"0.49888536",
"0.49870145",
"0.4982295",
"0.49729642",
"0.49704733",
"0.4967447",
"0.49562383",
"0.49553683",
"0.49442208",
"0.49396986",
"0.49316505",
"0.4917669",
"0.49081644",
"0.49058455",
"0.48984146",
"0.48946306",
"0.4891305",
"0.48872662",
"0.48848158",
"0.48839512",
"0.48834255",
"0.48788288",
"0.48774898",
"0.48750573",
"0.48691005",
"0.48670986",
"0.48662814",
"0.48654595",
"0.48644352"
] | 0.72678214 | 0 |
Implementation helpers. Swaps the workTransform and the userTransform values. | private void swapTransforms() {
Transform tmp = workTransform;
workTransform = userTransform;
userTransform = tmp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void resetUserTransform() {\n workTransform.setTransform(null);\n doc.setTransform(workTransform);\n swapTransforms();\n }",
"protected Matrix4 computeTransform() {\n return super.computeTransform();\n }",
"protected Matrix4 computeTransform() {\n return internalGroup.computeTransform();\n }",
"Transform<A, B> getTransform();",
"public void resetTransform() {\n this.mView.setScaleX(1.0f);\n this.mView.setScaleY(1.0f);\n this.mView.setTranslationX(0.0f);\n this.mView.setTranslationY(0.0f);\n }",
"public void setTransform(float a11, float a12, float a21, float a22, float x, float y);",
"public synchronized void transform() {\n Iterator<String> it = entity_to_wxy.keySet().iterator();\n while (it.hasNext()) {\n String entity = it.next();\n double wx = entity_to_wxy.get(entity).getX(),\n wy = entity_to_wxy.get(entity).getY();\n int sx, sy;\n entity_to_sxy.put(entity, (sx = wxToSx(wx)) + BundlesDT.DELIM + (sy = wyToSy(wy)));\n entity_to_sx.put(entity, sx); entity_to_sy.put(entity, sy);\n }\n transform_id++;\n }",
"public void setTransform(Transform transform);",
"private void applyTransform() {\n GlStateManager.rotate(180, 1.0F, 0.0F, 0.0F);\n GlStateManager.translate(offsetX, offsetY - 26, offsetZ);\n }",
"public void applyTransform() {\n\t\tglRotatef(xaxisrot, 1.0f, 0.0f, 0.0f);\n\t\tglRotatef(yaxisrot, 0.0f, 1.0f, 0.0f);\n\t\tglRotatef(tilt, 0.0f, 0.0f, 1.0f);\n\t\tglTranslatef(-pos.geti(), -pos.getj(), -pos.getk());\n\t}",
"private void updateTransform() {\n Matrix matrix = new Matrix();\n float centerX = dataBinding.viewFinder.getWidth() / 2f;\n float centerY = dataBinding.viewFinder.getHeight() / 2f;\n int rotation = dataBinding.viewFinder.getDisplay().getRotation();\n int rotationDegrees = 0;\n switch (rotation) {\n case Surface.ROTATION_0:\n rotationDegrees = 0;\n break;\n case Surface.ROTATION_90:\n rotationDegrees = 90;\n break;\n case Surface.ROTATION_180:\n rotationDegrees = 180;\n break;\n case Surface.ROTATION_270:\n rotationDegrees = 270;\n break;\n default:\n }\n matrix.postRotate(-rotationDegrees, centerX, centerY);\n }",
"public void establishOldAffineTransform ( Graphics2D graphics2d )\n {\n oldAffineTransformation = graphics2d.getTransform ( );\n }",
"public Transform getTransform() {return transform;}",
"@Override\r\n\tprotected AffineTransform getPointTransformation() {\n\t\treturn null;\r\n\t}",
"public void transform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"transform\");\r\n\t}",
"public void restoreOldTransform ( Graphics2D graphics2d )\n {\n graphics2d.setTransform ( getOldAffineTransform ( ) );\n }",
"public AffineTransform getOldAffineTransform ( )\n {\n return oldAffineTransformation;\n }",
"public void setTransform(AffineTransform Tx)\r\n\t{\r\n\t\t// System.out.println(\"setTransform\");\r\n\t}",
"public RMTransform getTransform()\n{\n return new RMTransform(getX(), getY(), getRoll(), getWidth()/2, getHeight()/2,\n getScaleX(), getScaleY(), getSkewX(), getSkewY());\n}",
"public void setTransform(AffineTransform transform)\n/* */ {\n/* 202 */ AffineTransform old = getTransform();\n/* 203 */ this.transform = transform;\n/* 204 */ setDirty(true);\n/* 205 */ firePropertyChange(\"transform\", old, transform);\n/* */ }",
"protected abstract Object transform(Object o);",
"public Matrix getTransform()\n {\n return transform;\n }",
"public synchronized void resetConquestWarriorTransformation() {\n ConquestWarriorTransformation = null;\n }",
"@Override\r\n\tpublic void transformComponent(AffineTransform transform, Set<JVGShape> locked) {\n\t}",
"public void updateTransform() {\n \t\tif (viewBox != null) {\n \t\t\tOMSVGRect bbox = ((SVGRectElement)viewBox.getElement()).getBBox();\n //\t\t\tGWT.log(\"bbox = \" + bbox.getDescription());\n \t\t\tfloat d = (float)Math.sqrt((bbox.getWidth() * bbox.getWidth() + bbox.getHeight() * bbox.getHeight()) * 0.25) * scale * 2;\n //\t\t\tGWT.log(\"d = \" + d);\n \t\t\n \t\t\t// Compute the actual canvas size. It is the max of the window rect\n \t\t\t// and the transformed bbox.\n \t\t\tfloat width = Math.max(d, windowRect.getWidth());\n \t\t\tfloat height = Math.max(d, windowRect.getHeight());\n //\t\t\tGWT.log(\"width = \" + width);\n //\t\t\tGWT.log(\"height = \" + height);\n \n \t\t\t// Compute the display transform to center the image in the\n \t\t\t// canvas\n \t\t\tOMSVGMatrix m = svg.createSVGMatrix();\n \t\t\tfloat cx = bbox.getCenterX();\n \t\t\tfloat cy = bbox.getCenterY();\n \t\t\tm = m.translate(0.5f * (width - bbox.getWidth()) -bbox.getX(), 0.5f * (height - bbox.getHeight()) -bbox.getY())\n \t\t\t.translate(cx, cy)\n \t\t\t.rotate(angle)\n \t\t\t.scale(scale)\n \t\t\t.translate(-cx, -cy);\n \t\t\t((ISVGTransformable)xformGroup).getTransform().getBaseVal().getItem(0).setMatrix(m);\n \t\t\t((ISVGTransformable)modelGroup.getTwinWrapper()).getTransform().getBaseVal().getItem(0).setMatrix(m);\n //\t\t\tGWT.log(\"m=\" + m.getDescription());\n \t\t\tsvg.getStyle().setWidth(width, Unit.PX);\n \t\t\tsvg.getStyle().setHeight(height, Unit.PX);\n \t\t}\n \t}",
"protected void reverseTransformations(Graphics2D g2d) {\n\t\tg2d.translate(pivotPoint.x, pivotPoint.y);\n\t\tg2d.scale(1.0/scaleX, 1.0/scaleY);\n\t\tg2d.rotate(-rotation);//, pivotPoint.x, pivotPoint.y);\n\n\t\tg2d.translate(-pivotPoint.x, -pivotPoint.y);\n\t\tg2d.translate(-position.x,-position.y);\n\t\t\n\t}",
"public final native void transform(String transform, Element node) /*-{ this.transform(transform, node) }-*/;",
"public RMTransform getTransformInverse() { return getTransform().invert(); }",
"@Override\n public AffineTransform getAffineTransform() {\n return null;\n }",
"public void resetTransforms() { \r\n transforms2 = new HashMap<BundlesDT.DT,Map<String,Map<String,String>>>(); \r\n transforms2.put(BundlesDT.DT.IPv4, new HashMap<String,Map<String,String>>());\r\n transforms2.put(BundlesDT.DT.IPv4CIDR, new HashMap<String,Map<String,String>>());\r\n if (transforms.containsKey(BundlesDT.DT.IPv4)) {\r\n Iterator<String> it = transforms.get(BundlesDT.DT.IPv4).keySet().iterator();\r\n while (it.hasNext()) transforms2.get(BundlesDT.DT.IPv4).put(it.next(), new HashMap<String,String>());\r\n }\r\n if (transforms.containsKey(BundlesDT.DT.IPv4CIDR)) {\r\n sorted_cidr_trans = new HashMap<String,CIDRRec[]>();\r\n Iterator<String> it = transforms.get(BundlesDT.DT.IPv4CIDR).keySet().iterator();\r\n while (it.hasNext()) {\r\n String trans = it.next();\r\n transforms2.get(BundlesDT.DT.IPv4).put(trans, new HashMap<String,String>());\r\n transforms2.get(BundlesDT.DT.IPv4CIDR).put(trans, new HashMap<String,String>());\r\n\tCIDRRec recs[] = new CIDRRec[transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).keySet().size()];\r\n\tIterator<String> it_cidr = transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).keySet().iterator();\r\n\tfor (int i=0;i<recs.length;i++) {\r\n\t String cidr = it_cidr.next();\r\n\t recs[i] = new CIDRRec(cidr,transforms.get(BundlesDT.DT.IPv4CIDR).get(trans).get(cidr));\r\n }\r\n\tArrays.sort(recs);\r\n\tsorted_cidr_trans.put(trans,recs);\r\n }\r\n }\r\n }",
"public abstract Transformation updateTransform(Rectangle selectionBox);",
"@java.lang.Override\n public godot.wire.Wire.Transform getTransformValue() {\n if (transformValueBuilder_ == null) {\n if (typeCase_ == 14) {\n return (godot.wire.Wire.Transform) type_;\n }\n return godot.wire.Wire.Transform.getDefaultInstance();\n } else {\n if (typeCase_ == 14) {\n return transformValueBuilder_.getMessage();\n }\n return godot.wire.Wire.Transform.getDefaultInstance();\n }\n }",
"public void updateTransformMatrix(float[] fArr) {\n boolean z;\n float f;\n float f2;\n boolean z2 = true;\n if (!this.mVideoStabilizationCropped || !ModuleManager.isVideoModule()) {\n f2 = 1.0f;\n f = 1.0f;\n z = false;\n } else {\n f2 = MOVIE_SOLID_CROPPED_X * 1.0f;\n f = MOVIE_SOLID_CROPPED_Y * 1.0f;\n z = true;\n }\n if (this.mNeedCropped) {\n f2 *= this.mScaleX;\n f *= this.mScaleY;\n z = true;\n }\n if (this.mDisplayOrientation == 0) {\n z2 = z;\n }\n if (z2) {\n Matrix.translateM(fArr, 0, 0.5f, 0.5f, 0.0f);\n Matrix.rotateM(fArr, 0, (float) this.mDisplayOrientation, 0.0f, 0.0f, 1.0f);\n Matrix.scaleM(fArr, 0, f2, f, 1.0f);\n Matrix.translateM(fArr, 0, -0.5f, -0.5f, 0.0f);\n }\n }",
"public AffineTransform getTransform()\n/* */ {\n/* 194 */ return this.transform;\n/* */ }",
"public interface ITransformablePacket {\n\n default boolean isPacketOnMainThread(INetHandlerPlayServer server, boolean callingFromSponge) {\n if (!MixinLoadManager.isSpongeEnabled() || callingFromSponge) {\n NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;\n EntityPlayerMP player = serverHandler.player;\n return player.getServerWorld().isCallingFromMinecraftThread();\n } else {\n return false;\n }\n }\n\n /**\n * Puts the player into local coordinates and makes a record of where they used to be.\n */\n default void doPreProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {\n if (isPacketOnMainThread(server, callingFromSponge)) {\n // System.out.println(\"Pre packet process\");\n NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;\n EntityPlayerMP player = serverHandler.player;\n PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);\n if (wrapper != null\n && wrapper.getPhysicsObject().getShipTransformationManager() != null) {\n ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();\n ISubspace worldSubspace = worldProvider.getSubspace();\n worldSubspace.snapshotSubspacedEntity((ISubspacedEntity) player);\n wrapper.getPhysicsObject().getShipTransformationManager()\n .getCurrentTickTransform().transform(player,\n TransformType.GLOBAL_TO_SUBSPACE);\n }\n\n }\n }\n\n /**\n * Restores the player from local coordinates to where they used to be.\n */\n default void doPostProcessing(INetHandlerPlayServer server, boolean callingFromSponge) {\n if (isPacketOnMainThread(server, callingFromSponge)) {\n NetHandlerPlayServer serverHandler = (NetHandlerPlayServer) server;\n EntityPlayerMP player = serverHandler.player;\n PhysicsWrapperEntity wrapper = getPacketParent(serverHandler);\n // I don't care what happened to that ship in the time between, we must restore\n // the player to their proper coordinates.\n ISubspaceProvider worldProvider = (ISubspaceProvider) player.getServerWorld();\n ISubspace worldSubspace = worldProvider.getSubspace();\n ISubspacedEntity subspacedEntity = (ISubspacedEntity) player;\n ISubspacedEntityRecord record = worldSubspace\n .getRecordForSubspacedEntity(subspacedEntity);\n // System.out.println(player.getPosition());\n if (subspacedEntity.currentSubspaceType() == CoordinateSpaceType.SUBSPACE_COORDINATES) {\n subspacedEntity.restoreSubspacedEntityStateToRecord(record);\n player.setPosition(player.posX, player.posY, player.posZ);\n }\n // System.out.println(player.getPosition());\n // We need this because Sponge Mixins prevent this from properly working. This\n // won't be necessary on client however.\n }\n }\n\n PhysicsWrapperEntity getPacketParent(NetHandlerPlayServer server);\n}",
"public void refreshPosition() {\n\n this.setTransform(getTransform());\n }",
"@Override\n public boolean isTransforming() {\n return super.isTransforming() || desiredWorldPosition != null;\n }",
"public ResultTransform() {\n super(((org.xms.g.utils.XBox) null));\n if (org.xms.g.utils.GlobalEnvSetting.isHms()) {\n this.setHInstance(new HImpl());\n } else {\n this.setGInstance(new GImpl());\n }\n wrapper = false;\n }",
"godot.wire.Wire.Transform getTransformValue();",
"public void translateTransform(Vector3f trans) {\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = trans.x;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = trans.y;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = trans.z;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\r\n\t}",
"private void transformObject(int x, int y) {\n double sx, sy, l, r, nx, ny, tx, ty, alpha, origCX = 0, origCY = 0;\n Rectangle bnds;\n\n if(curr_obj == transformPointers[Action.ROTATE]) {\n /* the mouse vector 1 */\n GeoVector mouseVector = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n /* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */\n GeoVector rotationVector = new GeoVector(this.lastPosition[0], this.lastPosition[1], this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseVector.normalize();\n rotationVector.normalize();\n\n alpha = mouseVector.getAngleWith(rotationVector.getX(), rotationVector.getY());\n\n /** After passing the 180 degrees, the atan2 function returns a negative angle from 0 to PI. So this will convert the final gobal angle to 0-2PI */\n if(alpha < 0 ) {\n alpha = (2 * Math.PI) + alpha; \n }\n\n alpha -= this.currRotation;\n this.currRotation += alpha;\n\n Point c = new Point(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n this.aux_obj.uRotate((float)(-1.0*(alpha*(180/Math.PI))), c);\n \n } else {\n alpha = this.aux_obj.getRotation();\n\n /** Here we rotate the selected Graphic Object, it's tranformation points and the mouse coordinates back to the zero angle, to permit a correct object scalling. */\n if(alpha != 0.0) {\n origCX = this.aux_obj.getCenterX();\n origCY = this.aux_obj.getCenterY();\n this.aux_obj.uRotate((float)(alpha*-1.0), this.aux_obj.getCenter());\n rotateTransformPoints(alpha);\n GeoVector mouseCoord = new GeoVector(x, y, this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n\n mouseCoord.rotate( ((alpha*-1.0) * (2.0*Math.PI))/360 );\n mouseCoord.addPoint(this.aux_obj.getCenterX(), this.aux_obj.getCenterY());\n x = (int)mouseCoord.getX();\n y = (int)mouseCoord.getY();\n\n }\n\n /** Tatami rotates the object from it's x and y point to the edges. So this means that sometimes we need to translate the object a few pixels to asure that it's upper left corner is on the same position. */\n if(curr_obj == transformPointers[Action.NORTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)-tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.NORTH]) {\n if(y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate(0, (int)-ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTH];\n }\n } else if(curr_obj == transformPointers[Action.NORTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y < (transformPointers[Action.SOUTH].getY()-2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = (transformPointers[Action.SOUTH].getY()+2) - y;\n sy = ny / (l+r);\n ty = (sy*l-l) + (sy*r-r);\n\n aux_obj.uTranslate((int)tx, (int)-ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.NORTHEAST];\n }\n\n } else if(curr_obj == transformPointers[Action.WEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n aux_obj.uTranslate((int)-tx, 0);\n aux_obj.scale( (float)sx, 1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.WEST];\n }\n } else if(curr_obj == transformPointers[Action.EAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) ) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n aux_obj.uTranslate((int)tx, 0);\n aux_obj.scale( (float)sx, (float)1);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.EAST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHWEST]) {\n if(x < (transformPointers[Action.EAST].getX()-2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = (transformPointers[Action.EAST].getX()+2) - x ;\n sx = nx / (l+r);\n tx = (sx*l-l) + (sx*r-r);\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)-tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHWEST];\n }\n } else if(curr_obj == transformPointers[Action.SOUTH]) {\n if(y > (transformPointers[Action.NORTH].getY()+2)) {\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate(0, (int)ty);\n aux_obj.scale( 1, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTH];\n }\n } else if(curr_obj == transformPointers[Action.SOUTHEAST]) {\n if(x > (transformPointers[Action.WEST].getX()+2) && y > (transformPointers[Action.NORTH].getY()+2)) {\n\n l = aux_obj.getX() - (transformPointers[Action.WEST].getX()+2);\n r = (transformPointers[Action.EAST].getX()+2) - aux_obj.getX();\n nx = x - (transformPointers[Action.WEST].getX()+2);\n sx = nx / (l+r);\n tx = sx*l-l;\n\n l = aux_obj.getY() - (transformPointers[Action.NORTH].getY()+2);\n r = (transformPointers[Action.SOUTH].getY()+2) - aux_obj.getY();\n ny = y - (transformPointers[Action.NORTH].getY()+2);\n sy = ny / (l+r);\n ty = sy*l-l;\n\n aux_obj.uTranslate((int)tx, (int)ty);\n aux_obj.scale( (float)sx, (float)sy);\n\n if(alpha != 0.0) {\n this.aux_obj.uTranslate((int)(origCX - this.aux_obj.getCenterX()), (int)(origCY - this.aux_obj.getCenterY()));\n this.aux_obj.rotate((float)alpha);\n }\n\n canvas.remove(transformPoints);\n transformPoints.clear();\n bnds = aux_obj.getBounds();\n createTransformPoints(bnds, aux_obj);\n curr_obj = transformPointers[Action.SOUTHEAST];\n }\n }\n\n\n }\n \n }",
"void setTransforms(Transforms transforms);",
"public void transform() {\n\t\tthis.targetRootBlock = copy(this.sourceRootBlock);\n\n\t\tList<BlockImpl> blocks = allSubobjectsOfKind(targetRootBlock,\n\t\t\t\tBlockImpl.class);\n\t\tList<Block> emptyBlocks = new LinkedList<Block>();\n\t\tfor (Block block : blocks) {\n\t\t\tif (block.getModelElement().size() == 0) {\n\t\t\t\temptyBlocks.add(block);\n\t\t\t}\n\t\t}\n\n\t\tfor (Block block : emptyBlocks) {\n\t\t\tcreateSquare(block);\n\t\t\tEcoreUtil.delete(block);\n\t\t}\n\n\t\tif (LOGGER.isInfoEnabled()) {\n\t\t\tLOGGER.info(\"Completed Transformation\");\n\t\t}\n\t}",
"@java.lang.Override\n public godot.wire.Wire.TransformOrBuilder getTransformValueOrBuilder() {\n if (typeCase_ == 14) {\n return (godot.wire.Wire.Transform) type_;\n }\n return godot.wire.Wire.Transform.getDefaultInstance();\n }",
"@java.lang.Override\n public godot.wire.Wire.TransformOrBuilder getTransformValueOrBuilder() {\n if ((typeCase_ == 14) && (transformValueBuilder_ != null)) {\n return transformValueBuilder_.getMessageOrBuilder();\n } else {\n if (typeCase_ == 14) {\n return (godot.wire.Wire.Transform) type_;\n }\n return godot.wire.Wire.Transform.getDefaultInstance();\n }\n }",
"@java.lang.Override\n public godot.wire.Wire.Transform getTransformValue() {\n if (typeCase_ == 14) {\n return (godot.wire.Wire.Transform) type_;\n }\n return godot.wire.Wire.Transform.getDefaultInstance();\n }",
"protected void applyTransformations(Graphics2D g2d) {\n\t\tg2d.translate(position.x,position.y);\n\t\tg2d.translate(pivotPoint.x, pivotPoint.y);\n\t\t//Would still like to rotate around scaled pivot point maybe\n\t\tg2d.rotate(rotation);\n\t\tg2d.scale(scaleX, scaleY);\n\t\tg2d.translate(-pivotPoint.x, -pivotPoint.y);\n\t\tpointTransform = g2d.getTransform();\n\t}",
"Activity getTransformForwardActivity();",
"public void transform(float a11, float a12, float a21, float a22, float x, float y);",
"Transforms getTransforms();",
"Object transform(Object o);",
"public Transform getTransform(){\n switch (this){\n case promote_terminals: return new SubexpressionTransformation.TerminalChain();\n case promote_redundant: return new SubexpressionTransformation.RedundantChain();\n case promote_summary: return new SubexpressionTransformation.SummarisingChain();\n case promote_chomsky: return new SubexpressionTransformation.ChomskyChain();\n case filter: return new RelationFilterTransformation();\n case order: return new EvaluationOrderTransformation(true, true);\n default: throw new RuntimeException(\"Unreachable\");\n }\n }",
"@Override\t\t\t\n\tpublic final myPointf transformPoint(myPointf A, int transformIDX, float t) {\treturn trans[transformIDX].transformPoint(A, t);}",
"godot.wire.Wire.TransformOrBuilder getTransformValueOrBuilder();",
"public void fromTransformations(Transformations transformations);",
"public abstract BufferedImage transform();",
"private static Point3d transformPoint(Matrix4d transformMat, Point3d originalPoint) {\n Point3d tempPoint = new Point3d();\n transformMat.transform(new Point3d(originalPoint.getX(), originalPoint.getY(), originalPoint.getZ()), tempPoint);\n return tempPoint;\n }",
"@Override\n public void setAffineTransform(AffineTransform af) {\n\n }",
"public AffineTransform getTransform()\r\n\t{\r\n\t\treturn _g2.getTransform();\r\n\t}",
"private void setTransform(Transform3D trans) {\n this.transformGroup.setTransform(trans);\n }",
"private Point[] inverseTransformCoordinateSystem(Point[] objectPosition, Point centerOffset) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\tobjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x += centerOffset.x,\n\t\t\t\tobjectPosition[i].y += centerOffset.y\t\t\t\t\t\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}",
"public Transform() {\n setIdentity();\n }",
"public void resolveTransformsAndSend(Component component, Matrix4f currentGlobalTransform, RenderingConversion renderingConversion) {\n\n\t\t// if its a transform object, update the currentGlobalTransform\n\t\tif (component.getComponentType().equals(ComponentType.TRANSFORM)) {\n\t\t\tTransformObject transformObject = (TransformObject) component;\n\n\t\t\tcurrentGlobalTransform = Matrix4f.Transform(\n\t\t\t\t\ttransformObject.getPosition(),\n\t\t\t\t\ttransformObject.getRotation().toMatrix(),\n\t\t\t\t\ttransformObject.getScale()).multiply(currentGlobalTransform);\n\t\t\t// then set clean so the next pass doesn't bother with this transform\n\t\t}\n\t\t// if the component is a renderable, send an update to the graphics updating the instance transform of it\n\t\telse if (component.getComponentType().isRender()) {\n\n\t\t\tif (component.getComponentType().equals(ComponentType.GEOMETRY)) {\n\t\t\t\tGeometryObject geometryObject = (GeometryObject) component;\n\t\t\t\tcurrentGlobalTransform = geometryObject.getLocalTransformation().multiply(currentGlobalTransform);\n\t\t\t}\n\n\t\t\trenderingConversion.sendComponentInstanceUpdate(component, currentGlobalTransform);\n\t\t}\n\n\t\t// then set the components global transform matrix\n\t\tcomponent.setGlobalTransform(currentGlobalTransform);\n\t\tcomponent.setClean();\n\n\t\t// then get all children and run again\n\t\tfor (Component child : component.getChildren()) {\n\t\t\tresolveTransformsAndSend(child, currentGlobalTransform, renderingConversion);\n\t\t}\n\t}",
"public void setTransform(Rectangle view, Rectangle2D limits) {\n this.view = view;\n\t\tRectangle2D.Double lim = (Rectangle2D.Double)limits.clone();\n xUnit = (view.width/(lim.width - lim.x));\n yUnit = (view.height/(lim.height - lim.y));\n \n if (xUnit > yUnit){\n\t\t\txUnit = yUnit;\n\t\t\tlim.width = ((view.width/xUnit) + lim.x);\n }else{\n\t\t\tyUnit = xUnit;\n\t\t\tlim.height = ((view.height/yUnit) + lim.y);\n }\n\t\t\n aux.setToIdentity();\n transform.setToIdentity();\n aux.translate(lim.x, lim.y);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.scale(1/xUnit, -1/yUnit);\n transform.concatenate(aux);\n aux.setToIdentity();\n aux.translate(0, (-1) * (view.height - 1));\n transform.concatenate(aux);\n try {\n inverse = transform.createInverse();\n \t}catch (Exception e){\n\t\t\tSystem.out.println(\"Unable to create inverse trasform\");\n\t\t}\n\t\t\n this.limits = limits;\n\t\t\n }",
"@Override\n\tpublic RectTransform getTransform() {\n\t\treturn (RectTransform) super.getTransform();\n\t}",
"protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }",
"private void updateTranslated() {\r\n\r\n\tfloat[] dp = new float[3];\r\n\tTools3d.subtract(p, _p, dp);\r\n\r\n\tfor (int i = 0; i < npoints * 3; i+= 3) {\r\n\t // translate by adding the amount local origin has moved by\r\n\t ps[i] += dp[0];\r\n\t ps[i + 1] += dp[1];\r\n\t ps[i + 2] += dp[2];\r\n\t}\r\n\t\r\n\t// reset bounding box and clear dirty flag\r\n\tbox.setBB();\r\n\tdirtyT = false;\r\n\r\n\t// finally\r\n\t_p[0] = p[0];\r\n\t_p[1] = p[1];\r\n\t_p[2] = p[2];\r\n }",
"public Transform getTransform () {\n\t\torg.jbox2d.common.Transform trans = body.getTransform();\n\t\ttransform.vals[Transform.POS_X] = trans.p.x;\n\t\ttransform.vals[Transform.POS_Y] = trans.p.y;\n\t\ttransform.vals[Transform.COS] = trans.q.c;\n\t\ttransform.vals[Transform.SIN] = trans.q.s;\n\t\treturn transform;\n\t}",
"Activity getTransformBackwardActivity();",
"public AffineTransform getTransform() {\n return new AffineTransform(transform);\n }",
"public RMTransform getTransformFromShape(RMShape aShape)\n{\n // The transform from parent is just our inverse transform, transform from child is just child's transform\n if(aShape==getParent())\n return getTransformInverse();\n if(aShape!=null && this==aShape.getParent())\n return aShape.getTransform();\n\n // Return the inverse of transform to shape\n return getTransformToShape(aShape).invert();\n}",
"private SparkTran generateParentTran(SparkPlan sparkPlan, SparkWork sparkWork, BaseWork work) throws Exception {\n if (cloneToWork.containsKey(work)) {\n BaseWork originalWork = cloneToWork.get(work);\n if (workToParentWorkTranMap.containsKey(originalWork)) {\n return workToParentWorkTranMap.get(originalWork);\n }\n }\n\n SparkTran result;\n if (work instanceof MapWork) {\n result = generateMapInput((MapWork)work);\n sparkPlan.addTran(result);\n } else if (work instanceof ReduceWork) {\n List<BaseWork> parentWorks = sparkWork.getParents(work);\n result = generate(sparkWork.getEdgeProperty(parentWorks.get(0), work), cloneToWork.containsKey(work));\n sparkPlan.addTran(result);\n for (BaseWork parentWork : parentWorks) {\n sparkPlan.connect(workToTranMap.get(parentWork), result);\n }\n } else {\n throw new IllegalStateException(\"AssertionError: generateParentTran() only expect MapWork or ReduceWork,\" +\n \" but found \" + work.getClass().getName());\n }\n\n if (cloneToWork.containsKey(work)) {\n workToParentWorkTranMap.put(cloneToWork.get(work), result);\n }\n\n return result;\n }",
"private void abortTransformations() {\n for (Integer num : this.mTransformedViews.keySet()) {\n TransformState currentState = getCurrentState(num.intValue());\n if (currentState != null) {\n currentState.abortTransformation();\n currentState.recycle();\n }\n }\n }",
"public void transform() {\n final var bounds = getParentBounds();\n transform( bounds.width, bounds.height );\n }",
"@Override\n final public String getTransform() {\n String transform = ScijavaGsonHelper.getGson(context).toJson(rt, RealTransform.class);\n //logger.debug(\"Serialization result = \"+transform);\n return transform;\n }",
"public Object enterTransform(Object value) {\n return value;\n }",
"protected boolean transformIncomingData() {\r\n\t\tboolean rB=false;\r\n\t\tArrayList<String> targetStruc ;\r\n\t\t\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (transformationModelImported == false){\r\n\t\t\t\testablishTransformationModel();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// soappTransform.requiredVariables\r\n\t\t\tif (transformationsExecuted == false){\r\n\t\t\t\texecuteTransformationModel();\r\n\t\t\t}\r\n\t\t\trB = transformationModelImported && transformationsExecuted ;\r\n\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn rB;\r\n\t}",
"@Test\n public void testIdentity() throws TransformException {\n create(3, 0, 1, 2);\n assertIsIdentity(transform);\n assertParameterEquals(Affine.provider(3, 3, true).getParameters(), null);\n\n final double[] source = generateRandomCoordinates();\n final double[] target = source.clone();\n verifyTransform(source, target);\n\n makeProjectiveTransform();\n verifyTransform(source, target);\n }",
"public void setToIdentity() {\r\n\t\tthis.set(new AffineTransform3D());\r\n\t}",
"protected void establishTransformationModel() {\r\n\t \r\n\t\tTransformationModel transformModel ;\r\n\t\tArrayList<TransformationStack> modelTransformStacks ;\r\n\t\t\r\n\t\t\r\n\t\t// the variables needed for the profile\r\n\t\t// targetStruc = getTargetVector();\r\n\t\tsomData = soappTransformer.getSomData() ; \r\n\t\t// soappTransformer.setSomData( somApplication.getSomData() );\r\n\t\tsomApplication.setSomData(somData) ;\r\n\t\t\r\n\t\tsomData.getVariablesLabels() ;\r\n\t\t \r\n\t\t\r\n\t\t// from here we transfer...\r\n\t\tmodelTransformStacks = soappTransformer.getTransformationModel().getVariableTransformations();\r\n\t\ttransformModel = soappTransformer.getTransformationModel() ;\r\n\t\t \r\n\t\t\r\n\t\ttransformationModelImported = true;\r\n\t}",
"private Point[] transformCoordinateSystem(Point[] objectPosition, Point newCenter) {\n\t\tPoint[] transformedObjectPosition = objectPosition;\n\t\tfor(int i = 0; i < objectPosition.length; i++) {\n\t\t\t// Move location to coordinate system with center in origo \n\t\t\ttransformedObjectPosition[i].set(new double[] {\n\t\t\t\tobjectPosition[i].x - newCenter.x,\n\t\t\t\tobjectPosition[i].y - newCenter.y\n\t\t\t});\n\t\t}\n\t\t\n\t\treturn transformedObjectPosition;\n\t}",
"public void updateExtraTransformMatrix(float[] fArr) {\n }",
"public Object transform(Object object) {\n for (int i = 0; i < iTransformers.length; i++) {\n object = iTransformers[i].transform(object);\n }\n return object;\n }",
"protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }",
"@Test\n @DependsOnMethod(\"testDimensionReduction\")\n public void testDimensionAugmentation() throws TransformException {\n transform = new ProjectiveTransform(Matrices.create(4, 3, new double[] {\n 0, 1, 0,\n 1, 0, 0,\n 0, 0, 0,\n 0, 0, 1}));\n\n assertInstanceOf(\"inverse\", CopyTransform.class, transform.inverse());\n verifyTransform(new double[] {2,3, 6,0, 2, Double.NaN},\n new double[] {3,2,0, 0,6,0, Double.NaN, 2, 0});\n }",
"public Transform(Transform transform){\n System.arraycopy(transform.matrix, 0, matrix, 0, 16); \n }",
"public final void transform(Tuple3f t) {\n\t\n \t// alias-safe\n \tthis.transform(t, t);\n }",
"@Override\r\n\tpublic void makeTransform() {\n\r\n\t\tImgproc.GaussianBlur(src, dst, new Size(size, size),\r\n\t\t\t\tTransConstants.GAUSSIAN_SIGMA);\r\n\r\n\t}",
"@Override\n protected void afterAttach(){\n\n float scaleE = (float) Math.pow(toValue, 1.0 / totalIterations);\n scaleTransform.updateValues(scaleE, scaleE, scaleE);\n }",
"void updateJointTransform(RigidBodyTransform jointTransformToUpdate);",
"public Transformation getTransform() {\n\t\treturn mk;\n\t}",
"public void flip() {\n float tx = x1;\n float ty = y1;\n x1 = x2;\n y1 = y2;\n x2 = tx;\n y2 = ty;\n nx = -nx;\n ny = -ny;\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 }",
"@Override\n public Matrix4 calculateTransform(long now, float deltaSeconds) {\n transform.idt();\n for (final Action action : pressed.values().toArray()) {\n action.perform(deltaSeconds);\n }\n scrollAction.perform();\n return transform;\n }",
"public Object transform(Object object) {\r\n for (int i = 0; i < iTransformers.length; i++) {\r\n object = iTransformers[i].transform(object);\r\n }\r\n return object;\r\n }",
"@Override\n final public void computeTransform()\n {\n // PCA\n IDoubleArray Cov = moments.getCov();\n IEigenvalueDecomposition evd = alg.evd(Cov);\n IDoubleArray evalPCA = evd.getEvalNorm();\n IDoubleArray evecPCA = evd.getRightEigenvectorMatrix().viewReal();\n \n // normalize principal components\n IDoubleArray S = doublesNew.array(evalPCA.size());\n for (int i=0; i<S.size(); i++)\n S.set(i, 1.0*Math.sqrt(evalPCA.get(i)));\n // normalize weights by dividing by the standard deviation of the pcs \n IDoubleArray evecPCAscaled = alg.product(evecPCA, doublesNew.diag(S));\n\n // time-lagged covariance matrix\n this.CovTauSym = moments.getCovLagged();\n // symmetrize\n CovTauSym = alg.addWeightedToNew(0.5, CovTauSym, 0.5, alg.transposeToNew(CovTauSym)); // symmetrize\n\n // TICA weights\n IDoubleArray pcCovTau = alg.product(alg.product(alg.transposeToNew(evecPCAscaled), CovTauSym), evecPCAscaled);\n\n IEigenvalueDecomposition evd2 = alg.evd(pcCovTau);\n this.evalTICA = evd2.getEvalNorm();\n this.evecTICA = alg.product(evecPCAscaled, evd2.getRightEigenvectorMatrix().viewReal()); \n }",
"@Override\n\tpublic IMatrix nTranspose(boolean liveView) {\n\t\tif (liveView) {\n\t\t\treturn new MatrixTransposeView(this);\n\t\t} else {\n\t\t\treturn new MatrixTransposeView(this.copy());\n\t\t}\n\t}",
"public void updateTransform(float transX, float transY, float scaleX, float scaleY, int viewportWidth, int viewportHeight) {\n float left = ((float) this.mView.getLeft()) + transX;\n float top = ((float) this.mView.getTop()) + transY;\n RectF r = ZoomView.adjustToFitInBounds(new RectF(left, top, (((float) this.mView.getWidth()) * scaleX) + left, (((float) this.mView.getHeight()) * scaleY) + top), viewportWidth, viewportHeight);\n this.mView.setScaleX(scaleX);\n this.mView.setScaleY(scaleY);\n transX = r.top - ((float) this.mView.getTop());\n this.mView.setTranslationX(r.left - ((float) this.mView.getLeft()));\n this.mView.setTranslationY(transX);\n }",
"public T transform(T item) {\n T result = item;\n for (SimpleTransformation<T> transformation : transformations) {\n result = transformation.transform(result);\n }\n\n return result;\n }",
"public Object transform(Object input) {\n return input;\n }"
] | [
"0.72430253",
"0.64678526",
"0.6181767",
"0.61177015",
"0.61070067",
"0.5940023",
"0.5920639",
"0.5878104",
"0.5817928",
"0.581135",
"0.57362854",
"0.571096",
"0.5704099",
"0.5679151",
"0.56389266",
"0.55913067",
"0.557124",
"0.5531649",
"0.55045176",
"0.5491588",
"0.5473865",
"0.54693425",
"0.5464329",
"0.5438845",
"0.5434633",
"0.54270965",
"0.5416681",
"0.5416671",
"0.5402191",
"0.5386037",
"0.53739417",
"0.5345559",
"0.5342493",
"0.5331529",
"0.5329714",
"0.5302162",
"0.53002024",
"0.5275616",
"0.5261758",
"0.525886",
"0.52471507",
"0.5244935",
"0.524119",
"0.5215625",
"0.5215216",
"0.52081454",
"0.5200444",
"0.5195464",
"0.5194464",
"0.51885325",
"0.51861304",
"0.5176825",
"0.51321715",
"0.51283896",
"0.51252306",
"0.5110841",
"0.5098379",
"0.50978845",
"0.5087308",
"0.50869834",
"0.5086172",
"0.5085139",
"0.50824857",
"0.507919",
"0.50705576",
"0.5069917",
"0.50537586",
"0.5050639",
"0.5049897",
"0.50436854",
"0.502307",
"0.50195414",
"0.5017135",
"0.50136536",
"0.49807432",
"0.497984",
"0.4971593",
"0.49696183",
"0.4967782",
"0.49673066",
"0.4966643",
"0.49629036",
"0.49594107",
"0.49592736",
"0.49544227",
"0.49466223",
"0.49230906",
"0.49193248",
"0.49187443",
"0.4908235",
"0.49021265",
"0.4900554",
"0.48993576",
"0.4899252",
"0.4898882",
"0.48981678",
"0.48968148",
"0.48866346",
"0.48858854",
"0.4885645"
] | 0.8082759 | 0 |
private JFileChooser jf = new JFileChooser(); private float[] pesos; | @Override
public void runAlgorithm(SignalManager sm, List<SignalIntervalProperties>
signals, AlgorithmRunner ar) {
Signal flujo = sm.getSignal("Flujo");
JSWBManager.getSignalManager().removeAllAnnotations();
if (flujo == null) {
advertirSenalNoEncontrada();
return;
}
// TODO se modifica un valor estático al instanciar un objeto
pr(flujo);
float tmp= pesoHipoapnea;
pesoHipoapnea = 1;
pr(flujo);
pesoHipoapnea = tmp;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.position.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.position.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.position.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble positionFromFile = 0;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tpositionFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tpositionFromFile = 0;\r\n\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tantennaArray.position[conversion] = positionFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshPositionTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.amplitude.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.amplitude.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.amplitude.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble amplitudeFromFile = 0;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tamplitudeFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tamplitudeFromFile = 0;\r\n\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tantennaArray.amplitude[conversion] = amplitudeFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshAmplitudeTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\r\n\t\t\t}",
"public NewFileChooser_Alejandro() {\n initComponents();\n }",
"public void salvaAula()\n { \n JFileChooser fileChooser = new JFileChooser();\n String strFilePlan = \"out/\" + this.myAula.getNome()+ \"_plan\"+ \".png\";\n System.out.println(\"scrivo su file \"+ strFilePlan);\n File fp = new File(strFilePlan);\n String strFileDati = \"out/\" + this.myAula.getNome()+ \"_dati\"+ \".png\";\n File fd = new File(strFileDati);\n fileChooser.setSelectedFile(fd);\n try\n { \n ImageIO.write(this.getPlan(), \"png\", fp);\n ImageIO.write(this.getDati(), \"png\", fd);\n }\n catch (Exception ex)\n {\n System.out.println(\"errore in Salvataggio aula su file\");\n }\n \n JOptionPane.showMessageDialog(this, \"file salvati correttamente sotto cartella /out\",\"Info\", JOptionPane.INFORMATION_MESSAGE);\n }",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tfinal JFileChooser fc = new JFileChooser();\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\t//In response to a button click:\r\n\t\t\t\tint returnVal = fc.showOpenDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t if (returnVal == JFileChooser.APPROVE_OPTION) {\t\t \t\r\n\t\t \tList<String> lines = null;\r\n\t\t File file = fc.getSelectedFile();\r\n\t\t Path path = Paths.get(file.getAbsolutePath());\r\n\t\t int loopLength = antennaArray.phase.length;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tlines = Files.readAllLines(path, StandardCharsets.UTF_8);\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(lines.size() < antennaArray.phase.length) {\r\n\t\t\t\t\t\t\tint difference = antennaArray.phase.length - lines.size();\r\n\t\t\t\t\t\t\tfor(int addition = 0; addition < difference; addition++)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tlines.add(\"0\");\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tfor (int conversion = 0; conversion < loopLength; conversion++) {\r\n\t\t\t\t\t\t\tdouble phaseFromFile = 0;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tphaseFromFile = Double.parseDouble(lines.get(conversion));\r\n\t\t\t\t\t\t\t} catch (NumberFormatException ex) {\r\n\t\t\t\t\t\t\t\tphaseFromFile = 0;\r\n\t\t\t\t\t\t\t}\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tantennaArray.phase[conversion] = phaseFromFile;\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\trefreshPhaseTable();\r\n\t\t\t\t\t\tdrawPlotWithInitialParameterValues();\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\t\t\t\t\t\r\n\t\t } else {\r\n\t\t // Cancelled by the user.\r\n\t\t }\t\r\n\t\t\t}",
"public void KivKvtbaValt()\r\n {\r\n// int nIdx = 0 ;\r\n// int nExtLen = 0 ;\r\n// int nKiterjPoz = 0 ;\r\n File cAktKvt = null ;\r\n Object aKivElemek[] ;\r\n \r\n// boolean bRC = false ;\r\n//System.out.println( \"JFileValasztDlg::KivKvtbaValt()\") ;\r\n\r\n try\r\n {\r\n aKivElemek = m_jKvtTartList.getSelectedValues() ;\r\n\r\n // Ha netan tobb lenne kivalasztva (bas single selection lett beallitva) ...\r\n if ( aKivElemek.length > 0 )\r\n {\r\n cAktKvt = new File( m_sAktKonyvtar /*GetAktKonyvtar()*/ + System.getProperty( IKonstansok.sFileSeparator) + aKivElemek[0].toString()) ;\r\n \r\n if ( cAktKvt != null && cAktKvt.isDirectory() == true )\r\n {\r\n KvtTartListFrissit( cAktKvt.getCanonicalPath()) ;\r\n// KonyvtarTartKiir( cAktKvt) ; ez csak pont a listaablakot nem frissiti !\r\n \r\n // A felso edit kontorlba valo beiras hianyzik !\r\n// E:\\TAMAS\\PROG\\JAVA\\ecl_wrkspc\\CPolar\\2003 v. E:\\TAMAS\\PROG\r\n//System.out.println( \"JFileValasztDlg::KivKvtbaValt() cAktKvt.getCanonicalPath() : \" + cAktKvt.getCanonicalPath()) ;\r\n// E:\\TAMAS\\PROG\\JAVA\\ecl_wrkspc\\CPolar\\.\\2003 v. E:\\TAMAS\\PROG\\JAVA\\..\r\n//System.out.println( \"JFileValasztDlg::KivKvtbaValt() cAktKvt.getAbsolutePath() : \" + cAktKvt.getAbsolutePath()) ; \r\n//m_jKonyvtarTxtFld.setText( cAktKvt.getCanonicalPath()) ; ??? <-> KvtTartListFrissit()\r\n }\r\n }\r\n }\r\n catch( IOException cIOException)\r\n {\r\n//System.out.println( \"JFileValasztDlg::KivKvtbaValt() : cIOException\") ;\r\n ExceptionTrace( (Exception) cIOException) ;\r\n }\r\n catch( SecurityException cSecurityException)\r\n {\r\n//System.out.println( \"JFileValasztDlg::KivKvtbaValt() : SecurityException\") ;\r\n ExceptionTrace( (Exception) cSecurityException) ;\r\n }\r\n catch( NullPointerException cNullPointerException)\r\n {\r\n//System.out.println( \"JFileValasztDlg::KivKvtbaValt() : NullPointerException\") ;\r\n ExceptionTrace( (Exception) cNullPointerException) ;\r\n } \r\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jFileChooserEdicion = new javax.swing.JFileChooser();\n jPanelVista = new javax.swing.JPanel();\n jLabelNombreVista = new javax.swing.JLabel();\n jLabelMarcaVista = new javax.swing.JLabel();\n jLabelEdadVista = new javax.swing.JLabel();\n jLabelPrecioVista = new javax.swing.JLabel();\n jLabelTipoVista = new javax.swing.JLabel();\n jLabelMuestraNombre = new javax.swing.JLabel();\n jLabelMuestraMarca = new javax.swing.JLabel();\n jLabelMuestraEdad = new javax.swing.JLabel();\n jLabelMuestraPrecio = new javax.swing.JLabel();\n jLabelMuestraTipo = new javax.swing.JLabel();\n jLabelFotoVista = new javax.swing.JLabel();\n jPanelBaseVista = new javax.swing.JPanel();\n jButtonAnterirorVista = new javax.swing.JButton();\n jLabelMostrandoVista = new javax.swing.JLabel();\n jLabelDeVista = new javax.swing.JLabel();\n jLabelMaximoCarrouselVista = new javax.swing.JLabel();\n jButtonSiguienteVista = new javax.swing.JButton();\n jButtonCancelFilterVista = new javax.swing.JButton();\n jPanelEdicion = new javax.swing.JPanel();\n jLabelMuestraAccionEdicion = new javax.swing.JLabel();\n jLabelNombreEdicion = new javax.swing.JLabel();\n jLabelMarcaEdicion = new javax.swing.JLabel();\n jLabelEdadEdicion = new javax.swing.JLabel();\n jLabelPrecioEdicion = new javax.swing.JLabel();\n jLabelTipoEdicion = new javax.swing.JLabel();\n jComboBoxMarcaEdicion = new javax.swing.JComboBox();\n jComboBoxTipoEdicion = new javax.swing.JComboBox();\n jTextFieldNombreEdicion = new javax.swing.JTextField();\n jTextFieldEdadEdicion = new javax.swing.JTextField();\n jTextFieldPrecioEdicion = new javax.swing.JTextField();\n jButtonAgregarFotoEdicion = new javax.swing.JButton();\n jLabelRutaImagenEdicion = new javax.swing.JLabel();\n jButtonAceptarEdicion = new javax.swing.JButton();\n jButtonCancelarEdicion = new javax.swing.JButton();\n jPanelFiltro = new javax.swing.JPanel();\n jLabelNombreFiltro = new javax.swing.JLabel();\n jTextFieldNombreFiltro = new javax.swing.JTextField();\n jLabelMarcaFiltro = new javax.swing.JLabel();\n jComboBoxMarcaFiltro = new javax.swing.JComboBox();\n jLabelEdadFiltro = new javax.swing.JLabel();\n jTextFieldEdadFiltro = new javax.swing.JTextField();\n jLabelPrecioFiltro = new javax.swing.JLabel();\n jTextFieldPrecioFiltro = new javax.swing.JTextField();\n jLabelTipoFiltro = new javax.swing.JLabel();\n jComboBoxTipoFiltro = new javax.swing.JComboBox();\n jButtonAceptarFiltro = new javax.swing.JButton();\n jButtonCancelarFiltro = new javax.swing.JButton();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenuArchivo = new javax.swing.JMenu();\n jMenuItemAgregar = new javax.swing.JMenuItem();\n jMenuItemModificar = new javax.swing.JMenuItem();\n jMenuItemBorrar = new javax.swing.JMenuItem();\n jMenuItemFiltrar = new javax.swing.JMenuItem();\n jMenuItemVista = new javax.swing.JMenuItem();\n jMenuItemGuardar = new javax.swing.JMenuItem();\n jMenuItemCargar = new javax.swing.JMenuItem();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n formWindowClosing(evt);\n }\n });\n\n jPanelVista.setPreferredSize(new java.awt.Dimension(690, 320));\n\n jLabelNombreVista.setText(\"Nombre\");\n\n jLabelMarcaVista.setText(\"Marca\");\n\n jLabelEdadVista.setText(\"Edad\");\n\n jLabelPrecioVista.setText(\"Precio\");\n\n jLabelTipoVista.setText(\"Tipo\");\n\n jLabelMuestraNombre.setMaximumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraNombre.setMinimumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraNombre.setPreferredSize(new java.awt.Dimension(200, 15));\n\n jLabelMuestraMarca.setMaximumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraMarca.setMinimumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraMarca.setPreferredSize(new java.awt.Dimension(200, 15));\n\n jLabelMuestraEdad.setMaximumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraEdad.setMinimumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraEdad.setPreferredSize(new java.awt.Dimension(200, 15));\n\n jLabelMuestraPrecio.setMaximumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraPrecio.setMinimumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraPrecio.setPreferredSize(new java.awt.Dimension(200, 15));\n\n jLabelMuestraTipo.setMaximumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraTipo.setMinimumSize(new java.awt.Dimension(200, 15));\n jLabelMuestraTipo.setPreferredSize(new java.awt.Dimension(200, 15));\n\n jLabelFotoVista.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));\n jLabelFotoVista.setPreferredSize(new java.awt.Dimension(125, 150));\n jLabelFotoVista.setRequestFocusEnabled(false);\n\n java.awt.FlowLayout flowLayout1 = new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 40, 5);\n flowLayout1.setAlignOnBaseline(true);\n jPanelBaseVista.setLayout(flowLayout1);\n\n jButtonAnterirorVista.setText(\"Anterior\");\n jButtonAnterirorVista.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonAnterirorVistaActionPerformed(evt);\n }\n });\n jPanelBaseVista.add(jButtonAnterirorVista);\n\n jLabelMostrandoVista.setText(\"X\");\n jPanelBaseVista.add(jLabelMostrandoVista);\n\n jLabelDeVista.setText(\" de \");\n jPanelBaseVista.add(jLabelDeVista);\n\n jLabelMaximoCarrouselVista.setText(\"X\");\n jPanelBaseVista.add(jLabelMaximoCarrouselVista);\n\n jButtonSiguienteVista.setText(\"Siguiente\");\n jButtonSiguienteVista.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonSiguienteVistaActionPerformed(evt);\n }\n });\n jPanelBaseVista.add(jButtonSiguienteVista);\n\n jButtonCancelFilterVista.setText(\"Cancelar Filtro\");\n jButtonCancelFilterVista.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonCancelFilterVistaActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanelVistaLayout = new javax.swing.GroupLayout(jPanelVista);\n jPanelVista.setLayout(jPanelVistaLayout);\n jPanelVistaLayout.setHorizontalGroup(\n jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelVistaLayout.createSequentialGroup()\n .addGap(34, 34, 34)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelNombreVista)\n .addComponent(jLabelMarcaVista)\n .addComponent(jLabelEdadVista)\n .addComponent(jLabelPrecioVista)\n .addComponent(jLabelTipoVista))\n .addGap(18, 18, 18)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jLabelMuestraNombre, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabelMuestraMarca, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabelMuestraEdad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabelMuestraPrecio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabelMuestraTipo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 193, Short.MAX_VALUE)\n .addComponent(jLabelFotoVista, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(83, 83, 83))\n .addComponent(jPanelBaseVista, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 690, Short.MAX_VALUE)\n .addGroup(jPanelVistaLayout.createSequentialGroup()\n .addGap(283, 283, 283)\n .addComponent(jButtonCancelFilterVista)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanelVistaLayout.setVerticalGroup(\n jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelVistaLayout.createSequentialGroup()\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelVistaLayout.createSequentialGroup()\n .addGap(108, 108, 108)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelNombreVista)\n .addComponent(jLabelMuestraNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelMarcaVista)\n .addComponent(jLabelMuestraMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(11, 11, 11)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelEdadVista, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelMuestraEdad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelPrecioVista)\n .addComponent(jLabelMuestraPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelVistaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelTipoVista)\n .addComponent(jLabelMuestraTipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelVistaLayout.createSequentialGroup()\n .addGap(76, 76, 76)\n .addComponent(jLabelFotoVista, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addComponent(jPanelBaseVista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButtonCancelFilterVista)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jPanelEdicion.setPreferredSize(new java.awt.Dimension(690, 320));\n\n jLabelMuestraAccionEdicion.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jLabelMuestraAccionEdicion.setMaximumSize(new java.awt.Dimension(60, 20));\n jLabelMuestraAccionEdicion.setMinimumSize(new java.awt.Dimension(60, 20));\n jLabelMuestraAccionEdicion.setPreferredSize(new java.awt.Dimension(60, 20));\n\n jLabelNombreEdicion.setText(\"Nombre\");\n\n jLabelMarcaEdicion.setText(\"Marca\");\n\n jLabelEdadEdicion.setText(\"Edad\");\n\n jLabelPrecioEdicion.setText(\"Precio\");\n\n jLabelTipoEdicion.setText(\"Tipo\");\n\n jComboBoxMarcaEdicion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jComboBoxTipoEdicion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jTextFieldNombreEdicion.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jTextFieldNombreEdicionFocusGained(evt);\n }\n });\n\n jTextFieldEdadEdicion.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jTextFieldEdadEdicionFocusGained(evt);\n }\n });\n\n jTextFieldPrecioEdicion.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jTextFieldPrecioEdicionFocusGained(evt);\n }\n });\n\n jButtonAgregarFotoEdicion.setText(\"Agregar Foto\");\n jButtonAgregarFotoEdicion.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonAgregarFotoEdicionActionPerformed(evt);\n }\n });\n\n jLabelRutaImagenEdicion.setMaximumSize(new java.awt.Dimension(441, 15));\n jLabelRutaImagenEdicion.setMinimumSize(new java.awt.Dimension(441, 15));\n jLabelRutaImagenEdicion.setPreferredSize(new java.awt.Dimension(441, 15));\n\n jButtonAceptarEdicion.setText(\"Aceptar\");\n jButtonAceptarEdicion.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonAceptarEdicionActionPerformed(evt);\n }\n });\n\n jButtonCancelarEdicion.setText(\"Cancelar\");\n jButtonCancelarEdicion.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonCancelarEdicionActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanelEdicionLayout = new javax.swing.GroupLayout(jPanelEdicion);\n jPanelEdicion.setLayout(jPanelEdicionLayout);\n jPanelEdicionLayout.setHorizontalGroup(\n jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelEdicionLayout.createSequentialGroup()\n .addContainerGap(41, Short.MAX_VALUE)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelEdicionLayout.createSequentialGroup()\n .addComponent(jLabelMuestraAccionEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(303, 303, 303))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelEdicionLayout.createSequentialGroup()\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanelEdicionLayout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelMarcaEdicion)\n .addComponent(jLabelPrecioEdicion)\n .addComponent(jLabelEdadEdicion)\n .addComponent(jLabelTipoEdicion)\n .addComponent(jLabelNombreEdicion))\n .addGap(23, 23, 23)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelEdicionLayout.createSequentialGroup()\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jComboBoxTipoEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jComboBoxMarcaEdicion, 0, 200, Short.MAX_VALUE)\n .addComponent(jTextFieldNombreEdicion)\n .addComponent(jTextFieldEdadEdicion)\n .addComponent(jTextFieldPrecioEdicion)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 166, Short.MAX_VALUE))\n .addGroup(jPanelEdicionLayout.createSequentialGroup()\n .addComponent(jButtonAceptarEdicion)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButtonCancelarEdicion))))\n .addComponent(jLabelRutaImagenEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, 441, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButtonAgregarFotoEdicion)\n .addGap(101, 101, 101))))\n );\n jPanelEdicionLayout.setVerticalGroup(\n jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelEdicionLayout.createSequentialGroup()\n .addGap(37, 37, 37)\n .addComponent(jLabelMuestraAccionEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButtonAgregarFotoEdicion)\n .addComponent(jLabelRutaImagenEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelEdicionLayout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextFieldNombreEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelNombreEdicion))\n .addGap(59, 59, 59)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextFieldEdadEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelEdadEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanelEdicionLayout.createSequentialGroup()\n .addGap(62, 62, 62)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelMarcaEdicion)\n .addComponent(jComboBoxMarcaEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelPrecioEdicion)\n .addComponent(jTextFieldPrecioEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jComboBoxTipoEdicion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelTipoEdicion))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelEdicionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButtonAceptarEdicion)\n .addComponent(jButtonCancelarEdicion))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jPanelFiltro.setPreferredSize(new java.awt.Dimension(690, 320));\n\n jLabelNombreFiltro.setText(\"Nombre\");\n\n jTextFieldNombreFiltro.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jTextFieldNombreFiltroFocusGained(evt);\n }\n });\n\n jLabelMarcaFiltro.setText(\"Marca\");\n\n jComboBoxMarcaFiltro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jLabelEdadFiltro.setText(\"Edad\");\n\n jTextFieldEdadFiltro.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jTextFieldEdadFiltroFocusGained(evt);\n }\n });\n\n jLabelPrecioFiltro.setText(\"Precio\");\n\n jTextFieldPrecioFiltro.addFocusListener(new java.awt.event.FocusAdapter() {\n public void focusGained(java.awt.event.FocusEvent evt) {\n jTextFieldPrecioFiltroFocusGained(evt);\n }\n });\n\n jLabelTipoFiltro.setText(\"Tipo\");\n\n jComboBoxTipoFiltro.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jButtonAceptarFiltro.setText(\"Filtrar\");\n jButtonAceptarFiltro.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonAceptarFiltroActionPerformed(evt);\n }\n });\n\n jButtonCancelarFiltro.setText(\"Cancelar\");\n jButtonCancelarFiltro.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonCancelarFiltroActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanelFiltroLayout = new javax.swing.GroupLayout(jPanelFiltro);\n jPanelFiltro.setLayout(jPanelFiltroLayout);\n jPanelFiltroLayout.setHorizontalGroup(\n jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 690, Short.MAX_VALUE)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelFiltroLayout.createSequentialGroup()\n .addGap(132, 132, 132)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelMarcaFiltro)\n .addComponent(jLabelPrecioFiltro)\n .addComponent(jLabelEdadFiltro)\n .addComponent(jLabelTipoFiltro)\n .addComponent(jLabelNombreFiltro))\n .addGap(23, 23, 23)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelFiltroLayout.createSequentialGroup()\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jComboBoxTipoFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jComboBoxMarcaFiltro, 0, 200, Short.MAX_VALUE)\n .addComponent(jTextFieldNombreFiltro)\n .addComponent(jTextFieldEdadFiltro)\n .addComponent(jTextFieldPrecioFiltro)))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 166, Short.MAX_VALUE))\n .addGroup(jPanelFiltroLayout.createSequentialGroup()\n .addComponent(jButtonAceptarFiltro)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jButtonCancelarFiltro)))\n .addGap(132, 132, 132)))\n );\n jPanelFiltroLayout.setVerticalGroup(\n jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 320, Short.MAX_VALUE)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelFiltroLayout.createSequentialGroup()\n .addGap(59, 59, 59)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanelFiltroLayout.createSequentialGroup()\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextFieldNombreFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelNombreFiltro))\n .addGap(59, 59, 59)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jTextFieldEdadFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelEdadFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanelFiltroLayout.createSequentialGroup()\n .addGap(40, 40, 40)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabelMarcaFiltro)\n .addComponent(jComboBoxMarcaFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabelPrecioFiltro)\n .addComponent(jTextFieldPrecioFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jComboBoxTipoFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabelTipoFiltro))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButtonAceptarFiltro)\n .addComponent(jButtonCancelarFiltro))\n .addContainerGap(60, Short.MAX_VALUE)))\n );\n\n jMenuArchivo.setText(\"Archivo\");\n\n jMenuItemAgregar.setText(\"Agregar\");\n jMenuItemAgregar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemAgregarActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemAgregar);\n\n jMenuItemModificar.setText(\"Modificar\");\n jMenuItemModificar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemModificarActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemModificar);\n\n jMenuItemBorrar.setText(\"Borrar\");\n jMenuItemBorrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemBorrarActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemBorrar);\n\n jMenuItemFiltrar.setText(\"Filtrar\");\n jMenuItemFiltrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemFiltrarActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemFiltrar);\n\n jMenuItemVista.setText(\"Vista\");\n jMenuItemVista.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemVistaActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemVista);\n\n jMenuItemGuardar.setText(\"Guardar\");\n jMenuItemGuardar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemGuardarActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemGuardar);\n\n jMenuItemCargar.setText(\"Cargar\");\n jMenuItemCargar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenuItemCargarActionPerformed(evt);\n }\n });\n jMenuArchivo.add(jMenuItemCargar);\n\n jMenuBar1.add(jMenuArchivo);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanelFiltro, javax.swing.GroupLayout.DEFAULT_SIZE, 714, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanelEdicion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap()))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanelVista, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap()))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanelFiltro, javax.swing.GroupLayout.DEFAULT_SIZE, 348, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addComponent(jPanelEdicion, javax.swing.GroupLayout.DEFAULT_SIZE, 326, Short.MAX_VALUE)\n .addContainerGap()))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jPanelVista, javax.swing.GroupLayout.DEFAULT_SIZE, 325, Short.MAX_VALUE)\n .addGap(11, 11, 11)))\n );\n\n pack();\n }",
"public void setaFileChooser(JFileChooser aFileChooser) {\r\n\t\tthis.aFileChooser = aFileChooser;\r\n\t}",
"public void chooser() {\n\t\tString[] currency_a = new String[8];// puts the currency name from imported file\n\t\tString[] symbol_a = new String[8];// puts the currency symbols from imported file\n\t\tDouble[] rate_a = new Double[8];// stores the rate from imported file\n\t\tJFileChooser fc = new JFileChooser(); // object of jfilechooser\n\t\tfc.setCurrentDirectory(new java.io.File(\".\")); // sets the current directory to the project's directory\n\t\tfc.setDialogTitle(\"Choose File\");\n\t\tfc.setFileSelectionMode(JFileChooser.FILES_ONLY);// only files can be selected\n\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"TEXT FILES\", \"txt\", \"text\");// only selects text\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// files\n\t\tfc.setFileFilter(filter);// applys the filter to jfilechooser\n\t\tfc.showOpenDialog(null);// opens the jfilechooser dialog box\n\t\tint i = 0; // to store values in array\n\t\ttry {\n\t\t\tbr = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(new FileInputStream(fc.getSelectedFile().getAbsolutePath()), \"UTF8\"));\n\t\t\tSystem.out.println(\"This is works \");\n\t\t\t// reads the files with UTF-8 encoded file\n\t\t\t// gets the file chosen by jfilechooser\n\t\t\t// stores the file content in br\n\t\t\ttry {\n\t\t\t\tline= br.readLine();\n\t\t\t\tSystem.out.println(\"This is line: \"+line);\n\t\t\t\t\n\t\t\t\twhile ((line = br.readLine()) != null) {// reads a line of text. A line is considered to be terminated\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// by any one of a line feed ('\\n')\n\t\t\t\t\t\n\t\t\t\t\t// if the file hasn't ended, the loop continues\n\n\t\t\t\t\tString[] temp = line.split(\",\");// splits the content of the file using , as token and stores them\n\t\t\t\t\t\t\t\t\t\t\t\t\t// in array temp\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcurrency_a[i] = temp[0].trim();// puts the value of currency from the file\n\t\t\t\t\t\t// temp 0 stores the first word in line and stores it in currency\n\t\t\t\t\t\tif (temp[0].trim().isEmpty()) {// checks and notifies if there is no value in temp\n\t\t\t\t\t\t\tString msg = \"The currency name may be missing in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Currency\", JOptionPane.ERROR_MESSAGE);// displays\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// error\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// message\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttry {// tries to parse the string into double and is only successful if there are\n\t\t\t\t\t\t\t\t// nothing but numbers in the string\n\n\t\t\t\t\t\t\trate_a[i] = Double.parseDouble(temp[1].trim());// puts the value of rate from the file and\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// converts in into double because\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// everything is in strings in the file\n\n\t\t\t\t\t\t} catch (NumberFormatException e) {// if the number can't be parsed, error message is displayed\n\t\t\t\t\t\t\tString msg = \"The rate may not be a numeric value in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Number\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (temp[1].trim().isEmpty()) {// checks and notifies if there are errors\n\t\t\t\t\t\t\tString msg = \"The rate may be missing in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Number\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsymbol_a[i] = temp[2].trim(); // stores the value of symbols from the file\n\t\t\t\t\t\tif (temp[2].trim().isEmpty()) {\n\t\t\t\t\t\t\tString msg = \"The currency symbol may be missing in line \" + (i + 1) + \".\";\n\t\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Symbol\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (ArrayIndexOutOfBoundsException e) { // if there are more or less values in the line, array\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// out of bound error occurs\n\t\t\t\t\t\tString msg = \"The field delimiter may be missing or wrong field delimiter is used in line \"\n\t\t\t\t\t\t\t\t+ (i + 1) + \".\";\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid Delimeter\", JOptionPane.ERROR_MESSAGE);\n\n\t\t\t\t\t}\n\t\t\t\t\ti++; // increases the value of i\n\t\t\t\t}\n\t\t\t} catch (IOException e) {// input or output operation is failed or interpreted\n\t\t\t\tString msg = \"Input Error\";\n\t\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid File\", JOptionPane.ERROR_MESSAGE);\n\t\t\t}\n\t\t} catch (UnsupportedEncodingException e) { // if file type is not supported\n\t\t\tString msg = \"File Not Supported\";\n\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid File\", JOptionPane.ERROR_MESSAGE);\n\t\t} catch (FileNotFoundException e) { // if file is not found\n\t\t\tString msg = \"File Not Found\";\n\t\t\tJOptionPane.showMessageDialog(null, msg, \"Invalid File\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\n\t\tcurrencyCombo.removeAllItems(); // once the values are added into the array, remove all the content of combobox\n\n\t\tfor (int j = 0; j < currency_a.length; j++) {\n\n\t\t\t// overrides the previous values in the array with new ones from the file\n\t\t\tcurrencyName[j] = currency_a[j];\n\t\t\tsymbol[j] = symbol_a[j];\n\t\t\tfactor[j] = rate_a[j];\n\t\t\tif (currencyName[j]!=null && symbol[j]!=null && factor[j] != null) {\n\t\t\t\tcurrencyCombo.addItem(currency_a[j]);// adds new currency name into currency combo read from files\n\t\t\t}else {\n\t\t\t\tcurrencyCombo.addItem(\"Invalid\");\n\t\t\t}\n\t\t}\n\t}",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\t//On efface la fenetre precedente et on en recree une\n\t\t\t\t\t\t\tfenetreDimensions.dispose();\n\t\t\t\t\t\t\tJFrame fenetreFilons = new JFrame();\n\n\t\t\t\t\t\t\t//On enregistre les valeurs des sliders precedents\n\t\t\t\t\t\t\tpartie.largeur = 2*sliderLargeur.getValue()-1;\n\t\t\t\t\t\t\tpartie.hauteur = 2*sliderHauteur.getValue()-1;\n\n\t\t\t\t\t\t\t//On cree un nouveau panneau qui contient un texte et un slider afin de regler le nombre de filons\n\t\t\t\t\t\t\tJPanel panneauFilons = new JPanel();\n\t\t\t\t\t\t\tJLabel labelFilons = new JLabel(1 + \" filon(s) :\");\n\t\t\t\t\t\t\tJSlider sliderFilons = new JSlider();\n\t\t\t\t\t\t\tsliderFilons.setMinimum(0);\n\t\t\t\t\t\t\tsliderFilons.setMaximum((partie.largeur*partie.hauteur-partie.largeur-partie.hauteur+3)/4);\n\t\t\t\t\t\t\tsliderFilons.setValue(1);\n\t\t\t\t\t\t\tsliderFilons.setMajorTickSpacing((partie.largeur*partie.hauteur-partie.largeur-partie.hauteur+3)/8);\n\t\t\t\t\t\t\tsliderFilons.setPaintTicks(true);\n\t\t\t\t\t\t\tsliderFilons.setPaintLabels(true);\n\t\t\t\t\t\t\tsliderFilons.addChangeListener(new ChangeListener(){\n\t\t\t\t\t\t\t\tpublic void stateChanged(ChangeEvent event) {\n\t\t\t\t\t\t\t\t\t//Action liee au deplacement du slider\n\t\t\t\t\t\t\t\t\tlabelFilons.setText(((JSlider)event.getSource()).getValue() + \" filons :\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tpanneauFilons.setBorder(BorderFactory.createTitledBorder(\"Nombre de filons\"));\t\n\t\t\t\t\t\t\tpanneauFilons.add(labelFilons);\n\t\t\t\t\t\t\tpanneauFilons.add(sliderFilons);\t\n\n\t\t\t\t\t\t\t//On cree un bouton \"Jouer\"\n\t\t\t\t\t\t\tJButton boutonJouer = new JButton(\"Jouer\");\n\t\t\t\t\t\t\tboutonJouer.addActionListener(new ActionListener() {\n\t\t\t\t\t\t\t\t//Action liee a l'appui sur le bouton \"jouer\"\n\t\t\t\t\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\t\t\tfenetreFilons.dispose();\n\t\t\t\t\t\t\t\t\tpartie.nbFilons = sliderFilons.getValue();\n\t\t\t\t\t\t\t\t\tinitialisation();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t//On cree un bouton \"Annuler\"\n\t\t\t\t\t\t\tJButton annulerFilons = new JButton(\"Annuler\");\n\t\t\t\t\t\t\tannulerFilons.addActionListener(new ActionListener() {\n\t\t\t\t\t\t\t\t//Action liee a l'appui sur le bouton \"jouer\"\n\t\t\t\t\t\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\t\t\tfenetreFilons.dispose();\n\t\t\t\t\t\t\t\t\tpartie.quitter();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t//On cree un panneau recueillant deux bontons\n\t\t\t\t\t\t\tJPanel boutonsFilons = new JPanel();\n\t\t\t\t\t\t\tboutonsFilons.add(boutonJouer);\n\t\t\t\t\t\t\tboutonsFilons.add(annulerFilons);\t\n\n\t\t\t\t\t\t\t//On parametre la fenetre et agence les differents panneaux, puis on l'affiche\n\t\t\t\t\t\t\tfenetreFilons.setSize(320, 140);\n\t\t\t\t\t\t\tfenetreFilons.setTitle(\"Choix du nombre de filons\");\n\t\t\t\t\t\t\tfenetreFilons.setIconImage(new ImageIcon(getClass().getResource(\"/images/icone.gif\")).getImage());\n\t\t\t\t\t\t\tfenetreFilons.setLocationRelativeTo(null);\n\t\t\t\t\t\t\tfenetreFilons.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\t\t\t\t\t\tfenetreFilons.getContentPane().add(panneauFilons, BorderLayout.CENTER);\n\t\t\t\t\t\t\tfenetreFilons.getContentPane().add(boutonsFilons, BorderLayout.SOUTH);\n\t\t\t\t\t\t\tfenetreFilons.setVisible(true);\n\t\t\t\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Image Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"jpg\", \"gif\", \"PNG\"); // 파일 필터로 사용되는 확장자. *.jpg. *.gif만\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tfilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 알아온다.\r\n\t\t\t\tplaqueP2.setIcon(new ImageIcon(((new ImageIcon(filePath))\r\n\t\t\t\t\t\t.getImage()).getScaledInstance(300, 250,\r\n\t\t\t\t\t\tjava.awt.Image.SCALE_SMOOTH))); // 파일을 로딩하여 이미지 레이블에\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 출력한다.\r\n\t\t\t\tplaqueP2.addMouseListener(new EnlargeListener());\r\n\t\t\t}",
"private void abrirFichero() {\r\n\t\tJFileChooser abrir = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tabrir.setFileFilter(filtro);\r\n\t\tif(abrir.showOpenDialog(abrir) == JFileChooser.APPROVE_OPTION){\r\n\t\t\ttry {\r\n\t\t\t\tGestion.liga = (Liga) Gestion.abrir(abrir.getSelectedFile());\r\n\t\t\t\tGestion.setAbierto(true);\r\n\t\t\t\tGestion.setFichero(abrir.getSelectedFile());\r\n\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t} catch (ClassNotFoundException | IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"No se ha podido abrir el fichero\", \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Image Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"jpg\", \"gif\", \"PNG\"); // 파일 필터로 사용되는 확장자. *.jpg. *.gif만\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tfilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 알아온다.\r\n\t\t\t\tplaqueP3.setIcon(new ImageIcon(((new ImageIcon(filePath))\r\n\t\t\t\t\t\t.getImage()).getScaledInstance(300, 250,\r\n\t\t\t\t\t\tjava.awt.Image.SCALE_SMOOTH))); // 파일을 로딩하여 이미지 레이블에\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 출력한다.\r\n\t\t\t\tplaqueP3.addMouseListener(new EnlargeListener());\r\n\t\t\t}",
"private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked\n // TODO add your handling code here:\n int index = jComboBox3.getSelectedIndex();\n //float fvalue=Float.parseFloat(jTextField1.getText());\n int fl = 0;\n if (!jTextField1.getText().matches(\"[+]?([0-9]*[.])?[0-9]+\")) {\n fl++;\n }\n if (fl == 0) {\n switch (index) {\n case 0 ->\n Sensors.thresholdCO = Float.parseFloat(jTextField1.getText());\n case 1 ->\n Sensors.thresholdHeat = Float.parseFloat(jTextField1.getText());\n case 2 ->\n Sensors.thresholdSmoke = Float.parseFloat(jTextField1.getText());\n }\n Sensors.duration = Integer.parseInt(jComboBox1.getSelectedItem().toString());\n Sensors.volume = jSlider1.getValue();\n Sensors.logint = Integer.parseInt(jComboBox2.getSelectedItem().toString());\n switch (index) {\n case 0 ->\n Location.conCsensor(Sensors.duration, Sensors.volume, Sensors.logint, Sensors.thresholdCO);\n case 1 ->\n Location.conHsensor(Sensors.duration, Sensors.volume, Sensors.logint, Sensors.thresholdHeat);\n case 2 ->\n Location.conSsensor(Sensors.duration, Sensors.volume, Sensors.logint, Sensors.thresholdSmoke);\n }\n JOptionPane.showMessageDialog(this, \"Sensor is successfully configured\");\n Configure C = new Configure();\n C.setVisible(true);\n this.dispose();\n } else {\n JOptionPane.showMessageDialog(this, \"Please fill valid Threshold value!\");\n }\n\n }",
"private void fileChooser(){\n JFileChooser chooser = new JFileChooser();\n // Note: source for ExampleFileFilter can be found in FileChooserDemo,\n // under the demo/jfc directory in the JDK.\n //ExampleFileFilter filter = new ExampleFileFilter();\n// filter.addExtension(\"jpg\");\n// filter.addExtension(\"gif\");\n// filter.setDescription(\"JPG & GIF Images\");\n // chooser.setFileFilter(new javax.swing.plaf.basic.BasicFileChooserUI.AcceptAllFileFilter());\n int returnVal = chooser.showOpenDialog(this.getContentPane());\n if(returnVal == JFileChooser.APPROVE_OPTION) {\n System.out.println(\"You chose to open this file: \" +\n chooser.getSelectedFile().getName());\n try{\n this.leerArchivo(chooser.getSelectedFile());\n\n }\n catch (Exception e){\n System.out.println(\"Imposible abrir archivo \" + e);\n }\n }\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Image Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"jpg\", \"gif\", \"PNG\"); // 파일 필터로 사용되는 확장자. *.jpg. *.gif만\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tfilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 알아온다.\r\n\r\n\t\t\t\tplaqueP1.setIcon(new ImageIcon(((new ImageIcon(filePath))\r\n\t\t\t\t\t\t.getImage()).getScaledInstance(300, 250,\r\n\t\t\t\t\t\tjava.awt.Image.SCALE_SMOOTH))); // 파일을 로딩하여 이미지 레이블에\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 출력한다.\r\n\t\t\t\tplaqueP1.addMouseListener(new EnlargeListener());\r\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\t@SuppressWarnings(\"serial\")\r\n\t\t\t\tJFileChooser fc = new JFileChooser(){\r\n\t\t\t\t @Override\r\n\t\t\t\t public void approveSelection(){\r\n\t\t\t\t File f = getSelectedFile();\r\n\t\t\t\t if(f.exists() && getDialogType() == SAVE_DIALOG){\r\n\t\t\t\t int result = JOptionPane.showConfirmDialog(this,\"The file exists, overwrite?\",\"Existing file\",JOptionPane.YES_NO_OPTION);\r\n\t\t\t\t switch(result){\r\n\t\t\t\t case JOptionPane.YES_OPTION:\r\n\t\t\t\t super.approveSelection();\r\n\t\t\t\t return;\r\n\t\t\t\t case JOptionPane.NO_OPTION:\r\n\t\t\t\t return;\r\n\t\t\t\t case JOptionPane.CLOSED_OPTION:\r\n\t\t\t\t return;\r\n\t\t\t\t }\r\n\t\t\t\t }\r\n\t\t\t\t super.approveSelection();\r\n\t\t\t\t } \r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif(currentDirectory != null) fc.setCurrentDirectory(currentDirectory);\r\n\t\t\t\t\r\n\t\t\t\tfc.setFileFilter(new FileNameExtensionFilter(\"Antenna Array Synthesizer File (*.aas)\",\"aas\"));\r\n\t\t\t\t\r\n\t\t\t\tint returnVal = fc.showSaveDialog(null);\r\n\t\t\t\tcurrentDirectory = fc.getCurrentDirectory();\r\n\t\t\t\t\r\n\t\t\t\tif (returnVal == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\t\t\t\t\r\n\t\t\t\t\t// Fetch the all corresponding values from the user interface.\r\n\t\t\t\t\tgetParametersFromUserInterface();\r\n\t\t\t\t\t// Antenna Parameters\r\n\t\t\t\t\tCurrentConfiguration cc = new CurrentConfiguration();\r\n\t\t\t\t\tcc.numberofElements = numberOfElements;\r\n\t\t\t\t\tcc.L = L;\r\n\t\t\t\t\tcc.H = H;\r\n\t\t\t\t\tcc.amplitudeIsUsed = amplitudeIsUsed;\r\n\t\t\t\t\tcc.phaseIsUsed = phaseIsUsed;\r\n\t\t\t\t\tcc.positionIsUsed = positionIsUsed;\r\n\t\t\t\t\tcc.amplitudeValues = antennaArray.amplitude;\r\n\t\t\t\t\tcc.phaseValues = antennaArray.phase;\r\n\t\t\t\t\tcc.positionValues = antennaArray.position;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// For Outer Mask\r\n\t\t\t\t\tint numberOfOuterMask = mask.outerMaskSegments.size();\r\n\t\t\t\t\tcc.nameForOuter = new String[numberOfOuterMask];\r\n\t\t\t\t\tcc.startAngleForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tcc.stopAngleForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tcc.numberOfPointsForOuter = new int[numberOfOuterMask];\r\n\t\t\t\t\tcc.levelForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tcc.weightForOuter = new double[numberOfOuterMask];\r\n\t\t\t\t\tfor(int s=0; s<numberOfOuterMask; s++) {\r\n\t\t\t\t\t\tcc.nameForOuter[s] = mask.outerMaskSegments.get(s).name;\r\n\t\t\t\t\t\tcc.startAngleForOuter[s] = mask.outerMaskSegments.get(s).startAngle;\r\n\t\t\t\t\t\tcc.stopAngleForOuter[s] = mask.outerMaskSegments.get(s).stopAngle;\r\n\t\t\t\t\t\tcc.numberOfPointsForOuter[s] = mask.outerMaskSegments.get(s).numberOfPoints;\r\n\t\t\t\t\t\tcc.levelForOuter[s] = mask.outerMaskSegments.get(s).level;\r\n\t\t\t\t\t\tcc.weightForOuter[s] = mask.outerMaskSegments.get(s).weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// For Inner Mask\r\n\t\t\t\t\tint numberOfInnerMask = mask.innerMaskSegments.size();\r\n\t\t\t\t\tcc.nameForInner = new String[numberOfInnerMask];\r\n\t\t\t\t\tcc.startAngleForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tcc.stopAngleForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tcc.numberOfPointsForInner = new int[numberOfInnerMask];\r\n\t\t\t\t\tcc.levelForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tcc.weightForInner = new double[numberOfInnerMask];\r\n\t\t\t\t\tfor(int s=0; s<numberOfInnerMask; s++) {\r\n\t\t\t\t\t\tcc.nameForInner[s] = mask.innerMaskSegments.get(s).name;\r\n\t\t\t\t\t\tcc.startAngleForInner[s] = mask.innerMaskSegments.get(s).startAngle;\r\n\t\t\t\t\t\tcc.stopAngleForInner[s] = mask.innerMaskSegments.get(s).stopAngle;\r\n\t\t\t\t\t\tcc.numberOfPointsForInner[s] = mask.innerMaskSegments.get(s).numberOfPoints;\r\n\t\t\t\t\t\tcc.levelForInner[s] = mask.innerMaskSegments.get(s).level;\r\n\t\t\t\t\t\tcc.weightForInner[s] = mask.innerMaskSegments.get(s).weight;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Algorithm Parameters\r\n\t\t\t\t\tcc.populationNumber = populationNumber;\r\n\t\t\t\t\tcc.maximumIterationNumber = maximumIterationNumber;\r\n\t\t\t\t\tcc.F = F;\r\n\t\t\t\t\tcc.Cr = Cr;\r\n\t\t\t\t\t///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = fc.getSelectedFile();\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(\"aas\")) {\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t file = new File(file.toString() + \".aas\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry\r\n\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\tFileOutputStream fileOut = new FileOutputStream(file.getAbsolutePath());\r\n\t\t\t\t\t\tObjectOutputStream out = new ObjectOutputStream(fileOut);\r\n\t\t\t\t\t\tout.writeObject(cc);\r\n\t\t\t\t\t\tout.close();\r\n\t\t\t\t\t\tfileOut.close();\r\n\t\t\t\t\t}catch(IOException i)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ti.printStackTrace();\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}\r\n\t\t\t\t\r\n\t\t\t}",
"private static void caso4(ArrayList<Float> listaValores) {\n \n }",
"public JFileChooser getaFileChooser() {\r\n\t\treturn aFileChooser;\r\n\t}",
"@Override\n public void actionPerformed(ActionEvent e) {\n File selectedFile;\n JFileChooser fileChooser = new JFileChooser();\n int reply = fileChooser.showOpenDialog(null);\n if (reply == JFileChooser.APPROVE_OPTION) {\n selectedFile = fileChooser.getSelectedFile();\n geefBestandTextField1.setText(selectedFile.getAbsolutePath());\n }\n\n }",
"public void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\t\t\t\tfenetreFilons.dispose();\n\t\t\t\t\t\t\t\t\tpartie.nbFilons = sliderFilons.getValue();\n\t\t\t\t\t\t\t\t\tinitialisation();\n\t\t\t\t\t\t\t\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n JanelaEscolhePasta = new javax.swing.JFileChooser();\n PainelEscolheArquivo = new javax.swing.JPanel();\n textFieldNomeArquivo = new javax.swing.JTextField();\n botaoAdicionarArquivo = new javax.swing.JButton();\n jScrollPane5 = new javax.swing.JScrollPane();\n listaDeArquivos = new javax.swing.JList<>();\n botaoSelecionarArquivo = new javax.swing.JButton();\n botaoImportarArquivo = new javax.swing.JButton();\n jScrollPane8 = new javax.swing.JScrollPane();\n listaDePaths = new javax.swing.JList<>();\n PainelEdicaoTexto = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n AreaDoTexto = new javax.swing.JTextArea();\n PainelEscolheUsuario = new javax.swing.JPanel();\n textFieldNomeUsuario = new javax.swing.JTextField();\n botaoAdicionarUsuario = new javax.swing.JButton();\n jScrollPane6 = new javax.swing.JScrollPane();\n listaDeUsuarios = new javax.swing.JList<>();\n botaoSelecionarUsuario = new javax.swing.JButton();\n textFieldSelecioneUsuario = new javax.swing.JTextField();\n PainelEscolheFormatacao = new javax.swing.JPanel();\n botaoAdicionarFormatacao = new javax.swing.JButton();\n jScrollPane7 = new javax.swing.JScrollPane();\n listaDeFormatacoes = new javax.swing.JList<>();\n botaoSelecionarFormatacao = new javax.swing.JButton();\n textFieldSelecioneUsuario1 = new javax.swing.JTextField();\n janelaFonte = new javax.swing.JFrame();\n comboBoxFonte = new javax.swing.JComboBox<>();\n jLabel1 = new javax.swing.JLabel();\n textFieldTamanhoFormatacao = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n comboBoxCorFonte = new javax.swing.JComboBox<>();\n jLabel4 = new javax.swing.JLabel();\n comboBoxCorFundo = new javax.swing.JComboBox<>();\n jLabel5 = new javax.swing.JLabel();\n textFieldNomeFormatacao = new javax.swing.JTextField();\n botaoCadastraFonte = new javax.swing.JButton();\n JanelaEscolheArquivo = new javax.swing.JFileChooser();\n barraMenu = new javax.swing.JMenuBar();\n menuUsuario = new javax.swing.JMenu();\n menuBotaoAlterarUsuario = new javax.swing.JMenuItem();\n menuArquivo = new javax.swing.JMenu();\n menuBotaoAbrir = new javax.swing.JMenuItem();\n menuFormatacao = new javax.swing.JMenuItem();\n menuBotaoSalvar = new javax.swing.JMenuItem();\n menuBotaoSalvarComo = new javax.swing.JMenuItem();\n menuINEdit = new javax.swing.JMenu();\n menuBotaoSobre = new javax.swing.JMenuItem();\n menuBotaoAjuda = new javax.swing.JMenuItem();\n\n JanelaEscolhePasta.setDialogTitle(\"Seleção de Pasta\");\n JanelaEscolhePasta.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY);\n JanelaEscolhePasta.setToolTipText(\"Selecione a pasta onde sera criado o novo arquivo.\");\n\n PainelEscolheArquivo.setMinimumSize(new java.awt.Dimension(500, 500));\n\n textFieldNomeArquivo.setText(\"Nome\");\n textFieldNomeArquivo.setPreferredSize(new java.awt.Dimension(500, 50));\n textFieldNomeArquivo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n textFieldNomeArquivoActionPerformed(evt);\n }\n });\n\n botaoAdicionarArquivo.setText(\"Adicionar Arquivo\");\n botaoAdicionarArquivo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoAdicionarArquivoActionPerformed(evt);\n }\n });\n\n listaDeArquivos.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n listaDeArquivos.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n listaDeArquivosValueChanged(evt);\n }\n });\n jScrollPane5.setViewportView(listaDeArquivos);\n\n botaoSelecionarArquivo.setText(\"Selecionar Arquivo\");\n botaoSelecionarArquivo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoSelecionarArquivoActionPerformed(evt);\n }\n });\n\n botaoImportarArquivo.setText(\"Importar\");\n botaoImportarArquivo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoImportarArquivoActionPerformed(evt);\n }\n });\n\n listaDePaths.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n listaDePaths.addListSelectionListener(new javax.swing.event.ListSelectionListener() {\n public void valueChanged(javax.swing.event.ListSelectionEvent evt) {\n listaDePathsValueChanged(evt);\n }\n });\n jScrollPane8.setViewportView(listaDePaths);\n\n javax.swing.GroupLayout PainelEscolheArquivoLayout = new javax.swing.GroupLayout(PainelEscolheArquivo);\n PainelEscolheArquivo.setLayout(PainelEscolheArquivoLayout);\n PainelEscolheArquivoLayout.setHorizontalGroup(\n PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheArquivoLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(botaoSelecionarArquivo, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(PainelEscolheArquivoLayout.createSequentialGroup()\n .addGroup(PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addComponent(textFieldNomeArquivo, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheArquivoLayout.createSequentialGroup()\n .addComponent(botaoAdicionarArquivo)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(botaoImportarArquivo, javax.swing.GroupLayout.DEFAULT_SIZE, 104, Short.MAX_VALUE))\n .addComponent(jScrollPane8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))))\n .addContainerGap())\n );\n PainelEscolheArquivoLayout.setVerticalGroup(\n PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheArquivoLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(botaoAdicionarArquivo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(textFieldNomeArquivo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(botaoImportarArquivo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(PainelEscolheArquivoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)\n .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(botaoSelecionarArquivo, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n AreaDoTexto.setColumns(20);\n AreaDoTexto.setFont(new java.awt.Font(\"Arial\", 0, 12)); // NOI18N\n AreaDoTexto.setLineWrap(true);\n AreaDoTexto.setRows(5);\n AreaDoTexto.setTabSize(4);\n jScrollPane1.setViewportView(AreaDoTexto);\n\n javax.swing.GroupLayout PainelEdicaoTextoLayout = new javax.swing.GroupLayout(PainelEdicaoTexto);\n PainelEdicaoTexto.setLayout(PainelEdicaoTextoLayout);\n PainelEdicaoTextoLayout.setHorizontalGroup(\n PainelEdicaoTextoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE)\n );\n PainelEdicaoTextoLayout.setVerticalGroup(\n PainelEdicaoTextoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 454, Short.MAX_VALUE)\n );\n\n PainelEscolheUsuario.setMinimumSize(new java.awt.Dimension(500, 500));\n\n textFieldNomeUsuario.setEditable(false);\n textFieldNomeUsuario.setText(\"Nome\");\n textFieldNomeUsuario.setPreferredSize(new java.awt.Dimension(500, 50));\n textFieldNomeUsuario.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n textFieldNomeUsuarioActionPerformed(evt);\n }\n });\n\n botaoAdicionarUsuario.setText(\"Adicionar Usuário\");\n botaoAdicionarUsuario.setEnabled(false);\n\n listaDeUsuarios.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n listaDeUsuarios.setToolTipText(\"\");\n listaDeUsuarios.setAutoscrolls(false);\n jScrollPane6.setViewportView(listaDeUsuarios);\n\n botaoSelecionarUsuario.setText(\"Selecionar Usuário\");\n botaoSelecionarUsuario.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoSelecionarUsuarioActionPerformed(evt);\n }\n });\n\n textFieldSelecioneUsuario.setEditable(false);\n textFieldSelecioneUsuario.setText(\"Selecione um Usuario:\");\n textFieldSelecioneUsuario.setBorder(null);\n\n javax.swing.GroupLayout PainelEscolheUsuarioLayout = new javax.swing.GroupLayout(PainelEscolheUsuario);\n PainelEscolheUsuario.setLayout(PainelEscolheUsuarioLayout);\n PainelEscolheUsuarioLayout.setHorizontalGroup(\n PainelEscolheUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheUsuarioLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(PainelEscolheUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(textFieldSelecioneUsuario)\n .addComponent(jScrollPane6)\n .addComponent(botaoSelecionarUsuario, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(PainelEscolheUsuarioLayout.createSequentialGroup()\n .addComponent(textFieldNomeUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 242, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(botaoAdicionarUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE)))\n .addContainerGap())\n );\n PainelEscolheUsuarioLayout.setVerticalGroup(\n PainelEscolheUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheUsuarioLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(PainelEscolheUsuarioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(botaoAdicionarUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(textFieldNomeUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(textFieldSelecioneUsuario, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 350, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(botaoSelecionarUsuario, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n PainelEscolheFormatacao.setMinimumSize(new java.awt.Dimension(500, 500));\n\n botaoAdicionarFormatacao.setText(\"Adicionar Formatação\");\n botaoAdicionarFormatacao.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoAdicionarFormatacaoActionPerformed(evt);\n }\n });\n\n listaDeFormatacoes.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);\n listaDeFormatacoes.setToolTipText(\"\");\n listaDeFormatacoes.setAutoscrolls(false);\n jScrollPane7.setViewportView(listaDeFormatacoes);\n\n botaoSelecionarFormatacao.setText(\"Selecionar Formatação\");\n botaoSelecionarFormatacao.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoSelecionarFormatacaoActionPerformed(evt);\n }\n });\n\n textFieldSelecioneUsuario1.setEditable(false);\n textFieldSelecioneUsuario1.setText(\"Selecione uma Formatação:\");\n textFieldSelecioneUsuario1.setBorder(null);\n textFieldSelecioneUsuario1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n textFieldSelecioneUsuario1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout PainelEscolheFormatacaoLayout = new javax.swing.GroupLayout(PainelEscolheFormatacao);\n PainelEscolheFormatacao.setLayout(PainelEscolheFormatacaoLayout);\n PainelEscolheFormatacaoLayout.setHorizontalGroup(\n PainelEscolheFormatacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheFormatacaoLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(PainelEscolheFormatacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(textFieldSelecioneUsuario1)\n .addComponent(jScrollPane7, javax.swing.GroupLayout.DEFAULT_SIZE, 488, Short.MAX_VALUE)\n .addComponent(botaoSelecionarFormatacao, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(botaoAdicionarFormatacao, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addContainerGap())\n );\n PainelEscolheFormatacaoLayout.setVerticalGroup(\n PainelEscolheFormatacaoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(PainelEscolheFormatacaoLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(botaoAdicionarFormatacao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(textFieldSelecioneUsuario1, javax.swing.GroupLayout.DEFAULT_SIZE, 20, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 350, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(botaoSelecionarFormatacao, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n janelaFonte.setTitle(\"Cadastro de Fonte\");\n janelaFonte.setMinimumSize(new java.awt.Dimension(418, 230));\n janelaFonte.setResizable(false);\n\n comboBoxFonte.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n comboBoxFonte.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n comboBoxFonteActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Tamanho:\");\n\n textFieldTamanhoFormatacao.setText(\"12\");\n\n jLabel2.setText(\"Fonte:\");\n\n jLabel3.setText(\"Cor Fonte:\");\n\n comboBoxCorFonte.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jLabel4.setText(\"Cor Fundo:\");\n\n comboBoxCorFundo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { \"Item 1\", \"Item 2\", \"Item 3\", \"Item 4\" }));\n\n jLabel5.setText(\"Nome:\");\n\n botaoCadastraFonte.setText(\"OK\");\n botaoCadastraFonte.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoCadastraFonteActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout janelaFonteLayout = new javax.swing.GroupLayout(janelaFonte.getContentPane());\n janelaFonte.getContentPane().setLayout(janelaFonteLayout);\n janelaFonteLayout.setHorizontalGroup(\n janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(janelaFonteLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(botaoCadastraFonte, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(janelaFonteLayout.createSequentialGroup()\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(comboBoxFonte, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(textFieldTamanhoFormatacao)))\n .addGroup(janelaFonteLayout.createSequentialGroup()\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(comboBoxCorFonte, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, janelaFonteLayout.createSequentialGroup()\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(comboBoxCorFundo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(janelaFonteLayout.createSequentialGroup()\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(textFieldNomeFormatacao, javax.swing.GroupLayout.DEFAULT_SIZE, 339, Short.MAX_VALUE)))\n .addContainerGap())\n );\n janelaFonteLayout.setVerticalGroup(\n janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(janelaFonteLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(textFieldNomeFormatacao, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(comboBoxFonte, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(textFieldTamanhoFormatacao, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(comboBoxCorFonte, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(janelaFonteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(comboBoxCorFundo, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(botaoCadastraFonte)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n JanelaEscolheArquivo.setCurrentDirectory(new java.io.File(\"C:\\\\\"));\n JanelaEscolheArquivo.setDialogTitle(\"Seleção de Arquivo\");\n JanelaEscolheArquivo.setFileFilter(new FiltroArquivo());\n JanelaEscolheArquivo.setToolTipText(\"Selecione o arquivo .txt a ser aberto.\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n menuUsuario.setText(\"Usuário\");\n\n menuBotaoAlterarUsuario.setText(\"Alterar Usuário\");\n menuBotaoAlterarUsuario.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuBotaoAlterarUsuarioActionPerformed(evt);\n }\n });\n menuUsuario.add(menuBotaoAlterarUsuario);\n\n barraMenu.add(menuUsuario);\n\n menuArquivo.setText(\"Arquivo\");\n\n menuBotaoAbrir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK));\n menuBotaoAbrir.setText(\"Trocar\");\n menuBotaoAbrir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuBotaoAbrirActionPerformed(evt);\n }\n });\n menuArquivo.add(menuBotaoAbrir);\n\n menuFormatacao.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK));\n menuFormatacao.setText(\"Alterar Formatação\");\n menuFormatacao.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuFormatacaoActionPerformed(evt);\n }\n });\n menuArquivo.add(menuFormatacao);\n\n menuBotaoSalvar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));\n menuBotaoSalvar.setText(\"Salvar\");\n menuBotaoSalvar.setMargin(new java.awt.Insets(677, 21, 21, 21));\n menuBotaoSalvar.setMaximumSize(new java.awt.Dimension(677, 21));\n menuBotaoSalvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuBotaoSalvarActionPerformed(evt);\n }\n });\n menuArquivo.add(menuBotaoSalvar);\n\n menuBotaoSalvarComo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));\n menuBotaoSalvarComo.setText(\"Salvar como\");\n menuBotaoSalvarComo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuBotaoSalvarComoActionPerformed(evt);\n }\n });\n menuArquivo.add(menuBotaoSalvarComo);\n\n barraMenu.add(menuArquivo);\n\n menuINEdit.setText(\"INEdit\");\n\n menuBotaoSobre.setText(\"Sobre\");\n menuBotaoSobre.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuBotaoSobreActionPerformed(evt);\n }\n });\n menuINEdit.add(menuBotaoSobre);\n\n menuBotaoAjuda.setText(\"Ajuda\");\n menuBotaoAjuda.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n menuBotaoAjudaActionPerformed(evt);\n }\n });\n menuINEdit.add(menuBotaoAjuda);\n\n barraMenu.add(menuINEdit);\n\n setJMenuBar(barraMenu);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 500, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 454, Short.MAX_VALUE)\n );\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n fcImagem = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n edtCodigo = new javax.swing.JTextField();\n edtDescr = new javax.swing.JTextField();\n edtPreco = new javax.swing.JTextField();\n btnSelImg = new javax.swing.JButton();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n edtImagem = new javax.swing.JTextField();\n btnAnterior = new javax.swing.JButton();\n btnProximo = new javax.swing.JButton();\n btnSalvar = new javax.swing.JButton();\n btnAdicionar = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setTitle(\"Cadastro de Produto\");\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(\"Informações\"));\n\n jLabel1.setText(\"Código\");\n\n jLabel2.setText(\"Descrição\");\n\n edtCodigo.setText(\"edtCodigo\");\n\n edtDescr.setText(\"edtDescr\");\n\n edtPreco.setText(\"edtPreco\");\n\n btnSelImg.setText(\"Selecionar...\");\n btnSelImg.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSelImgActionPerformed(evt);\n }\n });\n\n jLabel3.setText(\"Preço\");\n\n jLabel4.setText(\"Imagem\");\n\n edtImagem.setText(\"edtImagem\");\n\n btnAnterior.setText(\"<<\");\n btnAnterior.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAnteriorActionPerformed(evt);\n }\n });\n\n btnProximo.setText(\">>\");\n btnProximo.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnProximoActionPerformed(evt);\n }\n });\n\n btnSalvar.setText(\"Salvar\");\n btnSalvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnSalvarActionPerformed(evt);\n }\n });\n\n btnAdicionar.setText(\"+\");\n btnAdicionar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAdicionarActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(edtImagem)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(edtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(edtDescr, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel3)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(edtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btnSelImg, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btnAnterior)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnProximo)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(btnAdicionar, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(btnSalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(edtCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(edtDescr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(edtPreco, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnSelImg, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(edtImagem, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnAnterior)\n .addComponent(btnProximo)\n .addComponent(btnSalvar)\n .addComponent(btnAdicionar))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n setLocationRelativeTo(null);\n }",
"public static void otvoriFajl() {\r\n\t\tJFileChooser fc = new JFileChooser();\r\n\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\"Gym files\", \"gym\");\r\n\r\n\t\tfc.setFileFilter(filter);\r\n\t\tfc.setCurrentDirectory(new File(\".\"));\r\n\t\tint izbor = fc.showOpenDialog(teretanaGui.getContentPane());\r\n\r\n\t\tif (izbor == JFileChooser.APPROVE_OPTION) {\r\n\t\t\tFile f = fc.getSelectedFile();\r\n\r\n\t\t\tString fileName = f.getAbsolutePath();\r\n\r\n\t\t\tpath = fileName;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tlistaClanova.ucitajIzFajla(fileName);\r\n\t\t\t\tpopuniTabelu();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(teretanaGui.getContentPane(), \"Greska pri ucitavanju clanova!\", \"Greska\",\r\n\t\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"@Action\n public void fecharTela()\n {\n try\n {\n float valor = sv.nfMoeda.parse( ftfEncaminhado.getText() ).floatValue();\n if ( valor < 0 )\n {\n JOptionPane.showMessageDialog( sv.getComponent(), \"O valor encaminhado não pode ser negativo. Tente novamente.\", \"Resultados\", JOptionPane.WARNING_MESSAGE );\n ftfEncaminhado.setText( \"\" );\n ftfEncaminhado.grabFocus();\n }\n else\n {\n bOk.grabFocus();\n jornada.setEncaminhamento( valor );\n bd.realizarEncaminhamento( valor );\n }\n }\n catch ( ParseException ex )\n {\n JOptionPane.showMessageDialog( sv.getComponent(), \"Valor informado inválido. Tente novamente.\", \"Resultados\", JOptionPane.WARNING_MESSAGE );\n Logger.getLogger( TelaResultadoJornada.class.getName() ).log( Level.SEVERE, null, ex );\n }\n catch ( SQLException e )\n {\n JOptionPane.showMessageDialog( sv.getComponent(), \"Erro ao escrever valor encaminhado no banco de dados. Informe ao responsável.\", \"Resultados\", JOptionPane.WARNING_MESSAGE );\n }\n\n // Rotina de fechamento:\n int resposta = JOptionPane.showConfirmDialog( painelPrincipal,\n \"Confirma o encaminhameto de \" + ftfEncaminhado.getText() + \" para a matriz?\",\n \"Resultados\",\n JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE );\n\n if ( resposta == JOptionPane.YES_OPTION )\n {\n resposta = JOptionPane.showConfirmDialog( painelPrincipal,\n \"Os dados de quantidade e valor vendido de cada produto foram anotados?\",\n \"Resultados\",\n JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE );\n\n if ( resposta == JOptionPane.YES_OPTION )\n {\n try\n {\n bd.setEncaminhamento( jornada );\n float novoCaixa = jornada.getCaixaFinal() - jornada.getEncaminhamento();\n sv.sugerirCaixaInicial( novoCaixa );\n dispose();\n }\n catch ( SQLException ex )\n {\n JOptionPane.showMessageDialog( painelPrincipal,\n \"Erro ao gravar valor encaminhado no banco de dados. Informe o responsável.\",\n \"Resultados\",\n JOptionPane.WARNING_MESSAGE);\n Logger.getLogger( TelaResultadoJornada.class.getName() ).log( Level.SEVERE, null, ex );\n } \n }\n }\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n JFileChooser fc = new JFileChooser(); \n int returnVal = fc.showOpenDialog(null);\n if (returnVal == JFileChooser.APPROVE_OPTION) {\n File file = fc.getSelectedFile();\n System.out.println(file.getAbsolutePath()); \n image = loadImage( file);\n }\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Image Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"jpg\", \"gif\", \"PNG\"); // 파일 필터로 사용되는 확장자. *.jpg. *.gif만\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tfilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 알아온다.\r\n\t\t\t\t\r\n\r\n\t\t\t\tteethP1.setIcon(new ImageIcon(((new ImageIcon(filePath))\r\n\t\t\t\t\t\t.getImage()).getScaledInstance(300, 250,\r\n\t\t\t\t\t\tjava.awt.Image.SCALE_SMOOTH))); // 파일을 로딩하여 이미지 레이블에\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 출력한다.\r\n\t\t\t\tteethP1.addMouseListener(new EnlargeListener());\r\n\t\t\t}",
"public void seleccionarArchivo(){\n JFileChooser j= new JFileChooser();\r\n FileNameExtensionFilter fi= new FileNameExtensionFilter(\"pdf\",\"pdf\");\r\n j.setFileFilter(fi);\r\n int se = j.showOpenDialog(this);\r\n if(se==0){\r\n this.txtCurriculum.setText(\"\"+j.getSelectedFile().getName());\r\n ruta_archivo=j.getSelectedFile().getAbsolutePath();\r\n }else{}\r\n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Image Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"jpg\", \"gif\", \"PNG\"); // 파일 필터로 사용되는 확장자. *.jpg. *.gif만\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tfilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 알아온다.\r\n\t\t\t\t\r\n\t\t\t\tteethP2.setIcon(new ImageIcon(((new ImageIcon(filePath))\r\n\t\t\t\t\t\t.getImage()).getScaledInstance(300, 250,\r\n\t\t\t\t\t\tjava.awt.Image.SCALE_SMOOTH))); // 파일을 로딩하여 이미지 레이블에\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 출력한다.\r\n\t\t\t\tteethP2.addMouseListener(new EnlargeListener());\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Image Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"jpg\", \"gif\", \"PNG\"); // 파일 필터로 사용되는 확장자. *.jpg. *.gif만\r\n\t\t\t\t\t\t\t\t\t\t\t\t// 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tfilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 알아온다.\r\n\t\t\t\t\r\n\t\t\t\tteethP3.setIcon(new ImageIcon(((new ImageIcon(filePath))\r\n\t\t\t\t\t\t.getImage()).getScaledInstance(300, 250,\r\n\t\t\t\t\t\tjava.awt.Image.SCALE_SMOOTH))); // 파일을 로딩하여 이미지 레이블에\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 출력한다.\r\n\t\t\t\tteethP3.addMouseListener(new EnlargeListener());\r\n\t\t\t}",
"private void jfanoActionPerformed(java.awt.event.ActionEvent evt) {\n }",
"private void choixRepertoire(int format){\n\t\tString path = \"\"; //Chemin a parcourir\n\t\tJFileChooser chooser = null;\n\t\tif(SauvegardeRepertoire.getPaths().isEmpty()){//Si la liste des repertoires est vide\n\t\t\tchooser = new JFileChooser();\n\t\t}\n\t\telse{//si elle n'est pas vide\n\t\t\tIterator<String> it = SauvegardeRepertoire.getPaths().iterator();\n\t\t\twhile (it.hasNext() && path.equals(\"\")) {\n\t\t\t\tString str = (String) it.next();\n\t\t\t\tFile file = new File(str);\n\n\t\t\t\tif (file.exists()) //on recupere le premier repertoire possible\t\n\t\t\t\t\tpath = file.getAbsolutePath();\n\t\t\t}\n\n\t\t\tif(path.equals(\"\"))//si on a pas trouvé de chemin coherent\n\t\t\t\tchooser = new JFileChooser();\n\t\t\telse\n\t\t\t\tchooser = new JFileChooser(path);\n\t\t}\n\t\tFileNameExtensionFilter filter=null;\n\t\tswitch(format)\n\t\t{\n\t\t\tcase PDFFile:\n\t\t\t\tfilter = new FileNameExtensionFilter(\"PDF\",\"pdf\");\n\t\t\t\tbreak;\n\t\t\tcase ARFFFile:\n\t\t\t\tchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);\n\t\t\t\tchooser.setAcceptAllFileFilterUsed(false);\n\t\t\t\tbreak;\n\t\t}\n\n\t\tchooser.setFileFilter(filter);\n\t\tchooser.setMultiSelectionEnabled(false);\n\t\tint returnVal = chooser.showOpenDialog(null);\n\t\tif(returnVal == JFileChooser.APPROVE_OPTION) {\n\t\t\tSauvegardeRepertoire.ajoutPath(chooser);//permet de sauvegarder les repertoires\n\t\t\tif(filter!=null && filter.getExtensions()[0].equals(\"pdf\")) {\n\t\t\t\tgestionFichier(chooser);\n\t\t\t\tunlockButton();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tgestionFichierDataSet(chooser);\n\t\t\t\tbDataTraining.setEnabled(true);\n\t\t\t}\n\n\t\t}\n\t}",
"public void subir_file()\n {\n FileChooser fc = new FileChooser();\n\n fc.getExtensionFilters().addAll(new FileChooser.ExtensionFilter(\"PDF Files\",\"*.pdf\")\n , new FileChooser.ExtensionFilter(\"Jpg Images\",\"*.jpg\",\"*.JPEG\",\"*.JPG\",\"*.jpeg\",\"*.PNG\",\"*.png\"));\n\n File fileSelected = fc.showOpenDialog(null);\n\n if (fileSelected!= null){\n txt_ruta.setText(fileSelected.getPath());\n\n if(txt_ruta.getText().contains(\".pdf\"))\n {\n System.out.println(\"si es pdf\");\n Image image = new Image(\"/sample/Clases/pdf.png\");\n image_esquema.setImage(image);\n\n }\n else\n {\n File file = new File(txt_ruta.getText());\n javafx.scene.image.Image image = new Image(file.toURI().toString());\n image_esquema.setImage(image);\n }\n\n }\n else{\n System.out.println(\"no se seleccinoó\");\n }\n }",
"public void initializeJFileChoosers()\r\n\t{\r\n\t\tqFileChooser = new JFileChooser();\r\n\t\textensionFilter = new FileNameExtensionFilter(\"Img\",\"jpg\",\"gif\",\"png\");\r\n\t\tqFileChooser.setFileFilter(extensionFilter);\r\n\t\tqFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t\taFileChooser = new JFileChooser();\r\n\t\textensionFilter = new FileNameExtensionFilter(\"Img\",\"jpg\",\"gif\",\"png\");\r\n\t\taFileChooser.setFileFilter(extensionFilter);\r\n\t\taFileChooser.setAcceptAllFileFilterUsed(false);\r\n\t}",
"private void jButtonBrowseInputFilesActionPerformed(ActionEvent e) {\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tfileChooser.addChoosableFileFilter(new RootFileFilter());\n\t\tfileChooser.setAcceptAllFileFilterUsed(false);\n\t\tint result = fileChooser.showOpenDialog(this);\n\t\tif (result == JFileChooser.APPROVE_OPTION) {\n\t\t\tFile file = fileChooser.getSelectedFile();\n\t\t\tjTextFieldInputFiles.setText(file.getAbsolutePath());\n\t\t}\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jFileChooser1 = new javax.swing.JFileChooser();\n jButton1 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jFileChooser1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jFileChooser1ActionPerformed(evt);\n }\n });\n\n jButton1.setFont(new java.awt.Font(\"Times New Roman\", 1, 14)); // NOI18N\n jButton1.setText(\"GRAFICA\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 575, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton1)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(19, 19, 19)\n .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGap(227, 227, 227)\n .addComponent(jButton1)))\n .addContainerGap(58, Short.MAX_VALUE))\n );\n\n pack();\n }",
"public JPImportarFatura() {\n initComponents();\n }",
"public SanPhamJFrame() {\n initComponents();\n setLocationRelativeTo(null);\n fileChooser = new JFileChooser();\n\n }",
"private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed\n\n JFileChooser chooser = new JFileChooser(); ////apabila merah -> ALT+ENTER -> j file chooser -> TOP\n chooser.showOpenDialog(null);\n File f = chooser.getSelectedFile();\n String filename = f.getAbsolutePath();\n vpath.setText(filename);\n }",
"public static ArrayList<String[]> open() {\r\n int r = file.showOpenDialog(null);\r\n ArrayList<String> data = new ArrayList<>();\r\n String line = \"\";\r\n ArrayList<String[]> datosF = new ArrayList<String[]>();\r\n\r\n if (r == JFileChooser.APPROVE_OPTION) {\r\n arch = file.getSelectedFile();\r\n ruta = arch.getAbsolutePath();\r\n System.out.println(\"\\nArchivo a utilizar: \" + arch.getAbsolutePath());\r\n try {\r\n FileReader read = new FileReader(ruta);\r\n BufferedReader read1 = new BufferedReader(read);\r\n data.add(read1.readLine());\r\n while ((line = read1.readLine()) != null) {\r\n line = line.toLowerCase();\r\n data.add(line);\r\n }\r\n } catch (ArithmeticException | IOException | NumberFormatException e) {\r\n System.out.println(e.toString());\r\n }\r\n }\r\n\r\n for (int i = 0; i < data.size(); i++) {\r\n String[] l = data.get(i).toLowerCase().split(\" \");\r\n datosF.add(l);\r\n }\r\n return datosF;\r\n }",
"public void getDataFromFileOptionsOpen(ActionEvent event) throws Exception {\n\n //file choose\n FileChooser fileChooser = new FileChooser();\n SelectFileButton.setOnAction(e -> {\n try {\n FileImportNameTxtF.clear();\n File selectedFile = fileChooser.showOpenDialog(null);\n //fileChooser.getExtensionFilters().add(new FileChooser.ExtensionFilter(\".txt\"));//only shows .txt files to user\n FileImportNameTxtF.appendText(selectedFile.getPath());\n\n } catch (Exception exception) {\n exception.printStackTrace();\n }\n });\n\n //submit file\n SubmitFileButton.setOnAction(e -> {\n a[0] = FileImportNameTxtF.getText();\n\n });\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n fileCho = new javax.swing.JFileChooser();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n fileCho.setBackground(style.GraphicCharter.colorYellow);\n fileCho.setCurrentDirectory(new java.io.File(\"D:\\\\Projets\"));\n fileCho.setDialogTitle(\"\");\n fileCho.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY);\n fileCho.setFont(style.GraphicCharter.fontCorps);\n fileCho.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n fileChoActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(fileCho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(fileCho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n pack();\n }",
"private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n try {\n // Block of code to try\n String nombre= nombreB.getText();\n double precio= Double.parseDouble(precioB.getText());\n int cantidad=(Integer) cantidadB.getValue();\n String franquicia= comboBox1.getSelectedItem().toString();\n String descripcion=descripcionB.getText();\n //String fr, String nom, String des, double pr, int ex\n boolean existe=false;\n for(int i=0;i<figuras.size();i++){\n if(nombre.equals(figuras.get(i).getNombre())& franquicia.equals(figuras.get(i).getFranquicia())){\n existe=true;\n }\n }\n if(existe){\n JOptionPane.showMessageDialog(null, \"Figura ya ingresada\");\n }else{\n Figura nuevo = new Figura(franquicia,nombre,descripcion,precio,cantidad);\n figuras.add(nuevo);\n dibujarTabla();\n nombreB.setText(\"\");\n precioB.setText(\"\");\n cantidadB.setValue(0);\n descripcionB.setText(\"\");\n }\n }\n catch(Exception e) {\n // Block of code to handle errors\n JOptionPane.showMessageDialog(null, \"Error en el ingreso de datos, por favor revise sus valores\");\n }\n \n \n \n \n }",
"private void guardarComo() {\r\n\t\tJFileChooser guardar = new JFileChooser();\r\n\t\tFileNameExtensionFilter filtro = new FileNameExtensionFilter(\"obj\",\"obj\");\r\n\t\tguardar.setFileFilter(filtro);\r\n\t\tif(guardar.showSaveDialog(guardar) == JFileChooser.APPROVE_OPTION){\r\n\t\t\tGestion.setFichero(Gestion.extensionValida(guardar.getSelectedFile()));\r\n\t\t\ttry {\r\n\t\t\t\tif(!Gestion.existe(Gestion.getFichero())){\r\n\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tswitch(JOptionPane.showConfirmDialog(null, \"El archivo existe. Desea sobreescribirlo?\", \"Aviso\", JOptionPane.WARNING_MESSAGE)){\r\n\t\t\t\t\tcase JOptionPane.OK_OPTION:\r\n\t\t\t\t\t\tGestion.escribir(Gestion.getFichero());\r\n\t\t\t\t\t\tGestion.setModificado(false);\r\n\t\t\t\t\t\t\t\tfrmLigaDeFtbol.setTitle(Gestion.getFichero().getName());\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tJOptionPane.showMessageDialog(null, e.getMessage(), \"Error\", JOptionPane.ERROR_MESSAGE);\r\n\t\t\t}\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 _FileChooser = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n _tfTenSinhVien = new javax.swing.JTextField();\n _tfNgaySinh = new javax.swing.JTextField();\n _tfMaSinhVien = new javax.swing.JTextField();\n jLabel5 = new javax.swing.JLabel();\n _btLuu = new javax.swing.JButton();\n _btSua = new javax.swing.JButton();\n _btThem = new javax.swing.JButton();\n _btXoa = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n jLabel6 = new javax.swing.JLabel();\n jScrollPane1 = new javax.swing.JScrollPane();\n _tbleDanhSachSinhVien = new javax.swing.JTable();\n _btMoFile = new javax.swing.JButton();\n _btLuuFile = new javax.swing.JButton();\n _btThoat = new javax.swing.JButton();\n _btHuy = new javax.swing.JButton();\n\n _FileChooser.setDialogTitle(\"\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n jLabel1.setText(\"Thông tin sinh viên\");\n\n jLabel2.setText(\"Mã sinh viên:\");\n\n jLabel3.setText(\"Tên sinh viên:\");\n\n jLabel4.setText(\"Ngày sinh:\");\n\n jLabel5.setText(\"(MM/dd/yyyy)\");\n\n _btLuu.setText(\"Lưu\");\n _btLuu.setEnabled(false);\n _btLuu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btLuuActionPerformed(evt);\n }\n });\n\n _btSua.setText(\"Sửa\");\n _btSua.setEnabled(false);\n _btSua.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btSuaActionPerformed(evt);\n }\n });\n\n _btThem.setText(\"Thêm\");\n _btThem.setEnabled(false);\n _btThem.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btThemActionPerformed(evt);\n }\n });\n\n _btXoa.setText(\"Xóa\");\n _btXoa.setEnabled(false);\n _btXoa.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btXoaActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel4)\n .addComponent(jLabel2))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(_tfMaSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_tfTenSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 217, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(_tfNgaySinh, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel5))))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(77, 77, 77)\n .addComponent(_btThem, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btLuu, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btSua, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btXoa, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_tfMaSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(_tfTenSinhVien, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_tfNgaySinh, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(_btLuu, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)\n .addComponent(_btSua, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)\n .addComponent(_btThem, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE)\n .addComponent(_btXoa, javax.swing.GroupLayout.DEFAULT_SIZE, 41, Short.MAX_VALUE))\n .addContainerGap())\n );\n\n jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());\n\n jLabel6.setText(\"Danh sách sinh viên\");\n\n _tbleDanhSachSinhVien.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Mã sinh viên\", \"Tên sinh viên\", \"Ngày sinh\"\n }\n ));\n jScrollPane1.setViewportView(_tbleDanhSachSinhVien);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 566, Short.MAX_VALUE))\n .addContainerGap())\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 152, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n _btMoFile.setText(\"File\");\n _btMoFile.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btMoFileActionPerformed(evt);\n }\n });\n\n _btLuuFile.setText(\"CSDL\");\n _btLuuFile.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btLuuFileActionPerformed(evt);\n }\n });\n\n _btThoat.setText(\"Thoát\");\n _btThoat.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btThoatActionPerformed(evt);\n }\n });\n\n _btHuy.setText(\"Hủy\");\n _btHuy.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n _btHuyActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(26, 26, 26)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(_btMoFile, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(_btLuuFile, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22)\n .addComponent(_btHuy, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(226, 226, 226)\n .addComponent(_btThoat, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))\n .addContainerGap(24, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(21, 21, 21)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(_btMoFile, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_btLuuFile, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_btThoat, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(_btHuy, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap())\n );\n\n pack();\n }",
"public void actionPerformed(ActionEvent e) {\n Profesor p = null;\n System.out.println(\"---- Profesores ----\");\n Ficheros.leerFicheros(p, Ficheros.D_PROFESORES);\n }",
"private void jIdFilmeActionPerformed(java.awt.event.ActionEvent evt) {\n }",
"private void botaoImagemClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_botaoImagemClienteMouseClicked\n\n // Instancia seletor de arquivo.\n JFileChooser arquivo = new JFileChooser();\n\n // Insere filtro para png e jgp.\n arquivo.setFileFilter(filtro);\n\n // Inicia variavel para parametrizar imagem.\n BufferedImage img;\n\n // Variavel para receber imagem.\n Icon novaImg = null;\n\n // Parametro para seletor selecionar somente o pre determinado\n arquivo.setAcceptAllFileFilterUsed(false);\n\n // Instancia seletor no frame.\n arquivo.showOpenDialog(painelCadastrarCliente);\n\n // Titulo.\n arquivo.setDialogTitle(\"Escolha imagem: extensao jpg e png\");\n\n // Impede mais de uma selecao.\n arquivo.setMultiSelectionEnabled(true);\n\n // Se alguma imagem for selecionada.\n if (arquivo.getSelectedFile() != null) {\n\n // Verifica erro de Io\n try {\n\n // Parametriza a dimensao de imagem.\n int largura = 161, altura = 158;\n\n // Recebe arquivo selecionado.\n img = ImageIO.read(arquivo.getSelectedFile());\n\n // Recebe imagem parametrizada.\n novaImg = new ImageIcon(img.getScaledInstance(largura, altura,\n java.awt.Image.SCALE_SMOOTH));\n\n // Insere imagem na tela por um label.\n imgCaminho = arquivo.getSelectedFile().getAbsolutePath();\n\n } catch (IOException ex) {\n\n // Mensagem de erro.\n JOptionPane.showMessageDialog(null, \"Erro na imagem\", \"Erro\", JOptionPane.ERROR);\n\n }\n\n // Substitui label por imagem.\n imagemCliente.setIcon(novaImg);\n imagemCliente.setVisible(true);\n\n }\n }",
"public void KvtTartListFrissit( String sKonyvtar)\r\n {\n File cAktKvt = null ;\r\n Object aKvtTartalma[] = null ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit( \" + sKonyvtar + \")\") ;\r\n\r\n// cAktKvt = new File( \".\") ;\r\n// cAktKvt = new File( \"/home/tamas/java/Polar/hrmfiles\") ;\r\n cAktKvt = new File( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit cAktKvt = new File() utan\") ;\r\n\r\n // Az aktualis konyvtar teljes utvonalanak beirasa\r\n// Itt nyeli le a vegerol a \\-t vagy /-t :\r\n// m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) ; // getAbsolutePath()\r\n m_jKonyvtarTxtFld.setText( sKonyvtar) ;\r\n\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit m_jKonyvtarTxtFld.setText( cAktKvt.getAbsolutePath()) utan\") ;\r\n if ( cAktKvt != null && cAktKvt.isDirectory() == true )\r\n {\r\n aKvtTartalma = HRMFileSzuro( cAktKvt) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : HRMFileSzuro() utan\") ;\r\n\r\n if ( aKvtTartalma != null )\r\n {\r\n/*\r\nfor ( int i=0 ; i < aKvtTartalma.length ; i++ )\r\n{\r\nSystem.out.println( \"JFileValasztDlg.KvtTartListFrissit() : cKvtrkFileok[\" + i + \"]=\" + aKvtTartalma[i].toString()) ;\r\n}\r\n*/\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : .setListData() utan\") ;\r\n\r\n // Itt mar valoszinu, hogy a ListBox a konyvtar file-jait tartalmazza +++\r\n SetAktKonyvtar( sKonyvtar) ;\r\n\r\n m_jKvtTartList.setSelectedIndex( 0) ;\r\n \r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : SetAktKonyvtar() utan\") ;\r\n//System.out.println( \"JFileValasztDlg.KvtTartListFrissit() : setListData\") ;\r\n/*\r\n for ( nIdx = 0 ; nIdx < aKvtTartalma.length ; nIdx++ )\r\n {\r\n m_jKvtTartList.setListData( aKvtTartalma) ;\r\n }\r\n*/\r\n }\r\n }\r\n }",
"@Override\r\n\t\t\t\r\n\t\t \r\n\t\t\tpublic void mouseClicked(MouseEvent arg0) {\n\t\t\t JFileChooser fc=new JFileChooser();\r\n\t\t\t \r\n\t\t\t //Indicamos que podemos seleccionar varios ficheros\r\n\t\t\t fc.setMultiSelectionEnabled(true);\r\n\t\t\t \r\n\t\t\t //Indicamos lo que podemos seleccionar\r\n\t\t\t fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t //Abrimos la ventana, guardamos la opcion seleccionada por el usuario\r\n\t\t\t int seleccion=fc.showOpenDialog(contentPane);\r\n\t\t\t \r\n\t\t\t //Si el usuario, pincha en aceptar\r\n\t\t\t \r\n\t\t\t /*formato nomre fichero sesiones. \r\n\t\t\t * IdPaciente_IdSesion_Fecha_Hora*/\r\n\t\t\t if(seleccion==JFileChooser.APPROVE_OPTION){\r\n\t\t\t \t fichero=fc.getSelectedFile();\r\n\t\t\t \t ManejadorDeFicheros mf = new ManejadorDeFicheros();\r\n\t\t\t \t ArrayList<Sesion> sesiones = mf.buscaSesiones(fichero);\r\n\t\t\t \t\t tiempos = GestionDatos.obtenerTiempos(sesiones);\r\n\t\t\t \t\t \r\n\t\t\t \t\t velocidades = GestionDatos.obtenerVelocidades(sesiones);\r\n\t\t\t \t String nombreFichero = fichero.getName();\r\n\t\t\t \t String sesion = \"Sesion \"+Integer.parseInt(nombreFichero.substring(3,5));\r\n\t\t\t \t String fecha = nombreFichero.substring(6,8)+\"/\"+ nombreFichero.substring(8, 10)+\"/\"+nombreFichero.substring(10,14);\r\n\t\t\t \t String hora = nombreFichero.substring(15,17)+\":\"+ nombreFichero.substring(17,19)+\":\"+nombreFichero.substring(19,21);\r\n\t\t\t \t modelo.addRow(new Object[]{sesion, fecha, hora});\r\n\t\t\t \t \r\n\t\t\t \t\t \r\n\t\t\t }\r\n\t\t\t \r\n\t\t\t \r\n\t\t\t \r\n\t\t\t}",
"private static float[] readFloatArray( URL loc ) throws IOException {\n DataInputStream in =\n new DataInputStream( new BufferedInputStream( loc.openStream() ) );\n FloatList flist = new FloatList();\n try {\n while ( true ) {\n float value = in.readFloat();\n if ( value >= 0f && value <= 1f ) {\n flist.add( value );\n }\n else {\n throw new IOException( \"RGB values out of range\" );\n }\n }\n }\n catch ( EOFException e ) {\n return flist.toFloatArray();\n }\n finally {\n in.close();\n }\n }",
"public String[][] readFilesUsingFileChooser() {\r\n Vector<ZipFile> logs = new Vector<ZipFile>();\r\n Vector<String> marioData = new Vector<>();\r\n Vector<Vector<Integer>> marioActions = new Vector<Vector<Integer>>();\r\n Vector<Level> levels = new Vector<Level>();\r\n\r\n JFileChooser chooser = new JFileChooser();\r\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n \"MarioAi Log files\", \"zip\");\r\n chooser.setMultiSelectionEnabled(true);\r\n chooser.setFileFilter(filter);\r\n\r\n int returnVal = chooser.showOpenDialog(this);\r\n if (returnVal == JFileChooser.APPROVE_OPTION) {\r\n for (File file : chooser.getSelectedFiles()) {\r\n try {\r\n logs.add(new ZipFile(file));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n Scanner scan = null;\r\n for (ZipFile zip : logs) {\r\n marioData.add(zip.getName());\r\n if (zip.getEntry(\"actions.act\") != null) {\r\n try {\r\n scan = new Scanner(zip.getInputStream(zip.getEntry(\"actions.act\")));\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n Byte act;\r\n Vector<Integer> actions = new Vector<Integer>();\r\n while ((act = scan.nextByte()) != null) {\r\n actions.add(act.intValue());\r\n }\r\n marioActions.add(actions);\r\n }\r\n if (zip.getEntry(\"level.lvl\") != null) {\r\n ObjectInputStream ois = null;\r\n try {\r\n ois = new ObjectInputStream(zip.getInputStream(zip.getEntry(\"level.lvl\")));\r\n Level lvl = (Level) ois.readObject();\r\n levels.add(lvl);\r\n\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n } catch (ClassNotFoundException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n txtFuncion = new javax.swing.JTextField();\n btnGraficar = new javax.swing.JButton();\n cmbOperaciones = new javax.swing.JComboBox<String>();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n txtFuncion2 = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n txtFactor = new javax.swing.JTextField();\n jTabbedPane1 = new javax.swing.JTabbedPane();\n lblPictureF1 = new javax.swing.JLabel();\n lblPictureF2 = new javax.swing.JLabel();\n lblPictureF3 = new javax.swing.JLabel();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"Ingrese función x(n):\");\n\n btnGraficar.setText(\"Calcular\");\n btnGraficar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnGraficarActionPerformed(evt);\n }\n });\n\n cmbOperaciones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Suma\", \"Resta\", \"Multiplicación\", \"Atenuación-Amplificación\", \"Desplazamiento\", \"Reflejo\", \"Diezmación\", \"Interpolación a cero\", \"Interpolación a escalón\", \"Interpolación lineal\" }));\n\n jLabel2.setText(\"seleccione operacion\");\n\n jLabel3.setText(\"Ingrese funcion x2(n)\");\n\n jLabel4.setText(\"Formato de datos: puede ingresar la secuencia separada por comas, indicando el origen de los datos con la letra O seguida al valor correspondiente al origen\");\n\n jLabel5.setText(\"Ingrese el valor\");\n\n txtFactor.setText(\"0\");\n\n lblPictureF1.setMaximumSize(new java.awt.Dimension(800, 600));\n lblPictureF1.setMinimumSize(new java.awt.Dimension(50, 40));\n lblPictureF1.setPreferredSize(new java.awt.Dimension(800, 600));\n jTabbedPane1.addTab(\"Secuencia1\", lblPictureF1);\n lblPictureF1.getAccessibleContext().setAccessibleDescription(\"\");\n\n lblPictureF2.setMaximumSize(new java.awt.Dimension(800, 600));\n lblPictureF2.setMinimumSize(new java.awt.Dimension(50, 40));\n lblPictureF2.setPreferredSize(new java.awt.Dimension(800, 600));\n jTabbedPane1.addTab(\"Secuencia2\", lblPictureF2);\n\n lblPictureF3.setMaximumSize(new java.awt.Dimension(800, 600));\n lblPictureF3.setMinimumSize(new java.awt.Dimension(50, 40));\n lblPictureF3.setPreferredSize(new java.awt.Dimension(800, 600));\n jTabbedPane1.addTab(\"Resultado\", lblPictureF3);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel4)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnGraficar)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel3)\n .addComponent(jLabel5))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(txtFuncion2, javax.swing.GroupLayout.DEFAULT_SIZE, 212, Short.MAX_VALUE)\n .addComponent(txtFactor)))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2))\n .addGap(20, 20, 20)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(cmbOperaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(txtFuncion, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(18, 18, 18)\n .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(39, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel4)\n .addGap(4, 4, 4)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtFuncion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(cmbOperaciones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addGap(25, 25, 25)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtFuncion2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel5)\n .addComponent(txtFactor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(19, 19, 19)\n .addComponent(btnGraficar))\n .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n escolherArquivo = new javax.swing.JFileChooser();\n radioGroupModoExec = new javax.swing.ButtonGroup();\n jScrollPane1 = new javax.swing.JScrollPane();\n grade = new javax.swing.JTable();\n jScrollPane2 = new javax.swing.JScrollPane();\n tabelaPilha = new javax.swing.JTable();\n NormalRadio = new javax.swing.JRadioButton();\n PassoRadio = new javax.swing.JRadioButton();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n botaoExecutar = new javax.swing.JButton();\n botaoParar = new javax.swing.JButton();\n jScrollPane3 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n jLabel3 = new javax.swing.JLabel();\n jMenuBar2 = new javax.swing.JMenuBar();\n jMenu4 = new javax.swing.JMenu();\n openMenu = new javax.swing.JMenuItem();\n closeMenu = new javax.swing.JMenuItem();\n exitMenu = new javax.swing.JMenuItem();\n jMenu5 = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n grade.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n\n }\n ));\n jScrollPane1.setViewportView(grade);\n\n tabelaPilha.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"Endereço\", \"Valor\"\n }\n ));\n jScrollPane2.setViewportView(tabelaPilha);\n\n radioGroupModoExec.add(NormalRadio);\n NormalRadio.setText(\"Normal\");\n NormalRadio.setActionCommand(\"normal\");\n NormalRadio.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n NormalRadioActionPerformed(evt);\n }\n });\n\n radioGroupModoExec.add(PassoRadio);\n PassoRadio.setSelected(true);\n PassoRadio.setText(\"Passo a Passo\");\n PassoRadio.setActionCommand(\"passoapasso\");\n\n jLabel1.setText(\"Modo de Execução\");\n\n jLabel2.setText(\"Memória (Pilha)\");\n\n botaoExecutar.setText(\"Executar\");\n botaoExecutar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n botaoExecutarActionPerformed(evt);\n }\n });\n\n botaoParar.setText(\"Parar\");\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane3.setViewportView(jTextArea1);\n\n jLabel3.setText(\"Saída de Dados\");\n\n jMenu4.setText(\"File\");\n\n openMenu.setText(\"Abrir\");\n openMenu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n openMenuActionPerformed(evt);\n }\n });\n jMenu4.add(openMenu);\n\n closeMenu.setText(\"Fechar\");\n jMenu4.add(closeMenu);\n\n exitMenu.setText(\"Sair\");\n exitMenu.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n exitMenuActionPerformed(evt);\n }\n });\n jMenu4.add(exitMenu);\n\n jMenuBar2.add(jMenu4);\n\n jMenu5.setText(\"Edit\");\n jMenuBar2.add(jMenu5);\n\n setJMenuBar(jMenuBar2);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 531, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(37, 37, 37)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 237, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(55, 55, 55)\n .addComponent(jLabel3))\n .addGroup(layout.createSequentialGroup()\n .addGap(42, 42, 42)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(232, 232, 232)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(NormalRadio)\n .addComponent(PassoRadio))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(botaoExecutar)\n .addGap(26, 26, 26)\n .addComponent(botaoParar, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap(21, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(jLabel2)\n .addGap(122, 122, 122))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(43, 43, 43)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE))\n .addGap(20, 20, 20)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jLabel3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(NormalRadio)\n .addComponent(botaoExecutar)\n .addComponent(botaoParar))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(PassoRadio)\n .addContainerGap(52, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n pack();\n }",
"public void valueChanged(ListSelectionEvent e)\n\t{\n\t\t\n\t\t//si el cambio es en la lista de Proyectos\n\t\tif (e.getSource() == lP)\n {\n\t\t\tif( arrayRutas.isEmpty() == false)\n\t\t\t{\t\n\t\t\t\t proySeleccionado = arrayRutas.get(lP.getSelectedIndex());\n\t\t\t\t proySeleccionado += \"\\\\src\";\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.println(\"Seleccione un proyecto\");\n \n\t\t\tArrayList<String> clases = new ArrayList<String>();\n\t\t\ttry{\n\t\t\t\tFile proy = new File(proySeleccionado);\n\t\t\t\trec.getAllJavaFiles(proy, clases, arrayRutasClases);\n\t\t\t\tlC = new JList(clases.toArray());\n\t\t\t\tlC.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\t\t\tlistClases.setViewportView(lC);\n\t\t\t\tlC.addListSelectionListener(this);\n\t\t\t\tgetContentPane().add(listClases);\n\t\t\t\tfor (String string : arrayRutasClases) {\n\t\t\t\t\t System.out.println(string);\n\t\t\t\t}\n\t\t\t}catch(Exception e1)\n\t\t\t{\n\t\t\t\tclases.add(\"Seleccione proyecyto válido\");\n\t\t\t}\n }\n\t\t//si el cambio es en la lista de Clases\n\t\tif (e.getSource() == lC)\n\t\t{\n\t\t\tif(arrayRutasClases.isEmpty() == false)\n\t\t\t{\n\t\t\t\tmetodos = rec.obtenerListaMetodos(arrayRutasClases.get(lC.getSelectedIndex()));\n\t\t\t\tlM = new JList(metodos.toArray());\n\t\t\t\tlM.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n\t\t\t\t//Ponemos la lista a la escucha de cambios\n\t\t\t\tlM.addListSelectionListener(this);\n\t\t\t\tlistMetodos.setViewportView(lM);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(metodos.toString());\n\t\t}\n\t\t\n\t\t//si el cambio es en la lista de Metodos\n\t\tif (e.getSource() == lM)\n\t\t{\n\t\t\t\n\t\t\trec.fanIn((String)arrayRutasClases.get(lC.getSelectedIndex()), (String)metodos.get(lM.getSelectedIndex()) );\n\t\t\trec.fanOut((String)arrayRutasClases.get(lC.getSelectedIndex()), (String)metodos.get(lM.getSelectedIndex()) );\n\t\t\t//va el path, y el nombre completo del metodo\n\t\t\t\n\t\t\trec.analizarMetodo((String)arrayRutasClases.get(lC.getSelectedIndex()), (String)metodos.get(lM.getSelectedIndex()) );\n\t\t\t\n\t\t\t//me guarda todo en Recorrer rec. Despues cuando apreto btnAnalizar\n\t\t\t//Toma todo lo que tiene rec (cant lineas, porc coment, etc)\n\t\t}\n\t\t\t\n }",
"private void btnModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnModificarActionPerformed\n if(libCancion.getSelectedIndex()<0){\n \n }\n else{\n int a = libCancion.getSelectedIndex();\n modificar = new modificarInfo();\n modificar.setVisible(true);\n modificar.btn.getModel().setEnabled(true);\n modificar.btn.addActionListener(new ActionListener(){\n public void actionPerformed(ActionEvent evt){\n \n String artista = modificar.txtArtista.getText();\n String album = modificar.txtAlbum.getText();\n String genero = modificar.txtGenero.getText();\n cancion.modificarCancion(a, artista, album, genero);\n modificar.lblCorrecto.setText(\"Se ha modificado\");\n libCancion.setModel(lista);\n }\n \n \n \n \n });\n imagen=null;\n modificar.subir.setEnabled(true);\n modificar.subir.addActionListener(new ActionListener(){\n public void actionPerformed(ActionEvent evt){\n int status = fileChooser.showOpenDialog (null);\n if (status == JFileChooser.APPROVE_OPTION){\n File selectedFile = fileChooser.getSelectedFile();\n imagen = selectedFile.getAbsolutePath();\n System.out.println(imagen);\n cancion.subirImagen(a, imagen);\n \n \n }\n \n else{ \n if (status == JFileChooser.CANCEL_OPTION){\n System.out.println(\"CANCELAR\");\n }\n cancion.subirImagen(a, imagen);\n \n \n }\n }\n });\n }\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jDialog1 = new javax.swing.JDialog();\n jColorChooser1 = new javax.swing.JColorChooser();\n BotonAceptarColor = new javax.swing.JButton();\n BotonCancelarColor = new javax.swing.JButton();\n jDialog2 = new javax.swing.JDialog();\n SliderAncho = new javax.swing.JSlider();\n BotonOKAncho = new javax.swing.JButton();\n BotonCancelarAncho = new javax.swing.JButton();\n BotonAplicarAncho = new javax.swing.JButton();\n jTextField1 = new javax.swing.JTextField();\n jDialog3 = new javax.swing.JDialog();\n jFileChooser1 = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n BotonColor = new javax.swing.JButton();\n BolorLapiz = new javax.swing.JButton();\n BotonCuadrado = new javax.swing.JButton();\n BotonGrosor = new javax.swing.JButton();\n BotonLinea = new javax.swing.JButton();\n BotonNuevo = new javax.swing.JButton();\n BotonCirculo = new javax.swing.JButton();\n estado = new javax.swing.JComboBox();\n jSeparator1 = new javax.swing.JSeparator();\n BotonGoma = new javax.swing.JButton();\n BotonGuardar = new javax.swing.JButton();\n jSeparator2 = new javax.swing.JSeparator();\n jButton1 = new javax.swing.JButton();\n\n jDialog1.setResizable(false);\n jDialog1.setType(java.awt.Window.Type.UTILITY);\n\n BotonAceptarColor.setText(\"Aceptar\");\n BotonAceptarColor.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonAceptarColorMousePressed(evt);\n }\n });\n\n BotonCancelarColor.setText(\"Cancelar\");\n BotonCancelarColor.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonCancelarColorMousePressed(evt);\n }\n });\n\n javax.swing.GroupLayout jDialog1Layout = new javax.swing.GroupLayout(jDialog1.getContentPane());\n jDialog1.getContentPane().setLayout(jDialog1Layout);\n jDialog1Layout.setHorizontalGroup(\n jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jDialog1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jColorChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 585, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jDialog1Layout.createSequentialGroup()\n .addGap(9, 9, 9)\n .addComponent(BotonAceptarColor)\n .addGap(18, 18, 18)\n .addComponent(BotonCancelarColor)))\n .addContainerGap(45, Short.MAX_VALUE))\n );\n jDialog1Layout.setVerticalGroup(\n jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jDialog1Layout.createSequentialGroup()\n .addComponent(jColorChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(BotonCancelarColor)\n .addComponent(BotonAceptarColor)))\n );\n\n jDialog2.setTitle(\"tipo\");\n jDialog2.setMinimumSize(new java.awt.Dimension(510, 220));\n jDialog2.setResizable(false);\n\n SliderAncho.setMajorTickSpacing(5);\n SliderAncho.setMaximum(50);\n SliderAncho.setMinorTickSpacing(1);\n SliderAncho.setPaintLabels(true);\n SliderAncho.setPaintTicks(true);\n SliderAncho.setSnapToTicks(true);\n SliderAncho.setValue(5);\n\n BotonOKAncho.setText(\"ok\");\n BotonOKAncho.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonOKAnchoMousePressed(evt);\n }\n });\n\n BotonCancelarAncho.setText(\"Cancelar\");\n BotonCancelarAncho.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonCancelarAnchoMousePressed(evt);\n }\n });\n\n BotonAplicarAncho.setText(\"Aplicar\");\n BotonAplicarAncho.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonAplicarAnchoMousePressed(evt);\n }\n });\n\n jTextField1.setHorizontalAlignment(javax.swing.JTextField.RIGHT);\n jTextField1.setName(\"\"); // NOI18N\n\n javax.swing.GroupLayout jDialog2Layout = new javax.swing.GroupLayout(jDialog2.getContentPane());\n jDialog2.getContentPane().setLayout(jDialog2Layout);\n jDialog2Layout.setHorizontalGroup(\n jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(SliderAncho, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 510, Short.MAX_VALUE)\n .addGroup(jDialog2Layout.createSequentialGroup()\n .addGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jDialog2Layout.createSequentialGroup()\n .addGap(22, 22, 22)\n .addComponent(BotonAplicarAncho, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(BotonCancelarAncho))\n .addGroup(jDialog2Layout.createSequentialGroup()\n .addGap(23, 23, 23)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(BotonOKAncho)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jDialog2Layout.setVerticalGroup(\n jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jDialog2Layout.createSequentialGroup()\n .addGap(14, 14, 14)\n .addComponent(SliderAncho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(BotonOKAncho)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(11, 11, 11)\n .addGroup(jDialog2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(BotonCancelarAncho)\n .addComponent(BotonAplicarAncho))\n .addContainerGap())\n );\n\n javax.swing.GroupLayout jDialog3Layout = new javax.swing.GroupLayout(jDialog3.getContentPane());\n jDialog3.getContentPane().setLayout(jDialog3Layout);\n jDialog3Layout.setHorizontalGroup(\n jDialog3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDialog3Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n jDialog3Layout.setVerticalGroup(\n jDialog3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jDialog3Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap())\n );\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setBackground(new java.awt.Color(204, 204, 255));\n setResizable(false);\n getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());\n\n jPanel1.setBackground(new java.awt.Color(255, 255, 255));\n jPanel1.setBorder(new javax.swing.border.MatteBorder(null));\n jPanel1.setPreferredSize(new java.awt.Dimension(778, 400));\n jPanel1.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {\n public void mouseDragged(java.awt.event.MouseEvent evt) {\n jPanel1MouseDragged(evt);\n }\n });\n jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseEntered(java.awt.event.MouseEvent evt) {\n jPanel1MouseEntered(evt);\n }\n public void mouseExited(java.awt.event.MouseEvent evt) {\n jPanel1MouseExited(evt);\n }\n public void mousePressed(java.awt.event.MouseEvent evt) {\n jPanel1MousePressed(evt);\n }\n public void mouseReleased(java.awt.event.MouseEvent evt) {\n jPanel1MouseReleased(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 768, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGap(0, 658, Short.MAX_VALUE)\n );\n\n getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(105, 3, 770, 660));\n\n BotonColor.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/rsz_1rsz_1423068917_color.png\"))); // NOI18N\n BotonColor.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonColorMousePressed(evt);\n }\n });\n getContentPane().add(BotonColor, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 180, 40, 40));\n\n BolorLapiz.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423070099_editor_pencil_pen_edit_write-32.png\"))); // NOI18N\n BolorLapiz.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BolorLapizMousePressed(evt);\n }\n });\n getContentPane().add(BolorLapiz, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 180, 40, 40));\n\n BotonCuadrado.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423068527_ic_crop_square_48px-32.png\"))); // NOI18N\n BotonCuadrado.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonCuadradoMousePressed(evt);\n }\n });\n getContentPane().add(BotonCuadrado, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 80, 40, 40));\n\n BotonGrosor.setFont(new java.awt.Font(\"Trebuchet MS\", 1, 14)); // NOI18N\n BotonGrosor.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423069442_line_width.png\"))); // NOI18N\n BotonGrosor.setText(\"Grosor\");\n BotonGrosor.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n BotonGrosor.setMaximumSize(new java.awt.Dimension(97, 73));\n BotonGrosor.setMinimumSize(new java.awt.Dimension(97, 73));\n BotonGrosor.setPreferredSize(new java.awt.Dimension(97, 73));\n BotonGrosor.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n BotonGrosor.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonGrosorMousePressed(evt);\n }\n });\n getContentPane().add(BotonGrosor, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 230, 90, 80));\n\n BotonLinea.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423069711_line.png\"))); // NOI18N\n BotonLinea.setMaximumSize(new java.awt.Dimension(65, 41));\n BotonLinea.setMinimumSize(new java.awt.Dimension(65, 41));\n BotonLinea.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonLineaMousePressed(evt);\n }\n });\n getContentPane().add(BotonLinea, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 130, 40, 40));\n\n BotonNuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423489881_new10-32.png\"))); // NOI18N\n BotonNuevo.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonNuevoMousePressed(evt);\n }\n });\n getContentPane().add(BotonNuevo, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 370, 40, 40));\n\n BotonCirculo.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423068469_check-circle-outline-blank-24.png\"))); // NOI18N\n BotonCirculo.setMaximumSize(new java.awt.Dimension(65, 41));\n BotonCirculo.setMinimumSize(new java.awt.Dimension(65, 41));\n BotonCirculo.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonCirculoMousePressed(evt);\n }\n });\n getContentPane().add(BotonCirculo, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 80, 40, 40));\n\n estado.setFont(new java.awt.Font(\"Trebuchet MS\", 1, 14)); // NOI18N\n estado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Liso\", \"Punteada\", \"Rayada\", \"Mixta\" }));\n getContentPane().add(estado, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 320, 90, 30));\n getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(3, 360, 100, 10));\n\n BotonGoma.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423069882_eraser.png\"))); // NOI18N\n BotonGoma.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonGomaMousePressed(evt);\n }\n });\n getContentPane().add(BotonGoma, new org.netbeans.lib.awtextra.AbsoluteConstraints(55, 130, 40, 40));\n\n BotonGuardar.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423489857_save.png\"))); // NOI18N\n BotonGuardar.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n BotonGuardarMousePressed(evt);\n }\n });\n getContentPane().add(BotonGuardar, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 370, 40, 40));\n getContentPane().add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 225, 100, 10));\n\n jButton1.setFont(new java.awt.Font(\"Trebuchet MS\", 1, 14)); // NOI18N\n jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/1423068527_ic_crop_square_48px-32.png\"))); // NOI18N\n jButton1.setText(\"Rellenar\");\n jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n jButton1.setVerticalAlignment(javax.swing.SwingConstants.TOP);\n jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);\n jButton1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mousePressed(java.awt.event.MouseEvent evt) {\n jButton1MousePressed(evt);\n }\n });\n getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(5, 10, 90, 65));\n\n pack();\n }",
"private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {\n JFileChooser j = new JFileChooser();\n j.setFileSelectionMode(JFileChooser.FILES_ONLY);\n \n ExtensionFileFilter eff = new ExtensionFileFilter(\"java class/jar\",\n new String[]{\".class\",\".jar\"});\n j.setFileFilter(eff);\n \n if (Directory!=null)\n j.setCurrentDirectory(Directory);\n \n j.setDialogTitle(\"Choose target java class:\");\n Integer opt = j.showOpenDialog(this);\n\n if (opt == JFileChooser.APPROVE_OPTION)\n {\n \n File file = j.getSelectedFile();\n filePath = file.getAbsolutePath();\n File sdirectory = j.getCurrentDirectory();\n if (sdirectory.exists()&&sdirectory.isDirectory())\n Directory = sdirectory;\n LoadFile(filePath);\n\n patches = new HashMap<String, byte[]>();\n } \n }",
"public void setPreco(Float preco) { this.preco = preco; }",
"public void actionPerformed(ActionEvent e) {\n\tif (\"open\".equals(e.getActionCommand())) {\n\t\tfd.show(); \n\t\t if (fd.getFile() == null) \n\t\t { \n\t\t Label1.setText(\"You have not select\"); \n\t\t } else \n\t\t { \n\t\t in = new File [30];\n\t\t\tin = fd.getFiles ();\t\n\t\t\tLabel1.setText(\"You have selected \" + in.length + \" images\"); \n\t\t }\n\t}\n\tif (\"apply\".equals(e.getActionCommand())) {\n\t\tif (in == null) Label1.setText(\"You have not select\"); \n\t\telse {\n\t\t\tif (in.length < 30) Label1.setText(\"Chưa đủ 30 ảnh. Đã có \" + in.length + \"/30 ảnh\"); \n\t\t\telse {\n\t\tString S = nameImage.getText();\n\t\tif (S.equals(\"\")) Label1.setText(\"Không được để trống tên\");\n\t\telse {\n\t\tFile file = new File(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\"+ S);\n\t\t if (!file.exists()) {\n\t\t if (file.mkdir()) {\n\t\t System.out.println(\"Directory is created!\");\n\t\t } else {\n\t\t System.out.println(\"Failed to create directory!\");\n\t\t }\n\t\t }\n\t\t InputStream inStream= null;\n\t\t OutputStream outStream = null;\n\t\t \n\t\t //for(int i = 0; i <= in.length - 1; i ++) System.out.println(\"i = \" + i +\" name: \" + in[i].toString());\n\t\t \n\t\t try {\n\t\t\t //File [] getFiles () \n\t\t\t for(int i = 0; i <= in.length - 1; i ++) {\n\t\t\t if (i == 30) {\n\t\t\t\t //Label1.setText(\"Thừa ảnh. Bỏ từ ảnh \"+ in[i].getName()); \n JOptionPane.showMessageDialog(fr, \"Thừa ảnh. Bỏ từ ảnh \"+ in[i].getName());\n\t\t\t break;\n\t\t\t }\n\t\t inStream = new FileInputStream(in[i]);\n\t\t outStream = new FileOutputStream(new File(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\"+ S+\"\\\\icon\"+(i+1)+\".jpg\"));\n\n\t\t int length;\n\t\t byte[] buffer = new byte[2097152];\n\n\t\t // copy the file content in bytes\n\t\t while ((length = inStream.read(buffer)) > 0) {\n\t\t outStream.write(buffer, 0, length);\n\t\t }\n\t\t\t }\n\t\t System.out.println(\"File is copied successful!\");\n\t\t \n\t\t } catch (IOException ex) {\n\t\t ex.printStackTrace();\n\t\t }\t\t \n\t\t fr.setVisible(false);\n\t\t}}}\n\t}\n\tif (\"replace\".equals(e.getActionCommand())) {\n\t\tif (in == null) Label1.setText(\"You have not select\"); \n\t\telse {\n\t\t\tif (in.length > 30) Label1.setText(\"Thừa ảnh\"); \n\t\t\telse {\n\t\t\tfd.setDirectory(\"D:\\\\java\\\\PROJECT_I\\\\src\\\\\");\n\t\t\tfd.show(); \n\t\t\tFile[] in2;\n\t\t\t in2 = new File [30];\n\t\t\t\tin2 = fd.getFiles ();\n\t\t File tmp = new File(in2[0].getParent());\n\t\t String tv = tmp.getName();\n\t\t int kq = 0;\n\t\t File folder = new File(\"D:\\\\java\\\\PROJECT_I\\\\src\");\n\t\t\t //&& s != \"HighScore\" && s !=\"icon\" && s != \"icon\" && s != \"sound\"\n\t\t\t for (final File fileEntry : folder.listFiles()) {\n\t\t\t if (fileEntry.isDirectory()) {\n\t\t\t \tString s = fileEntry.getName();\n\t\t if (!s.equals(\"Game_lat_hinh\") && !s.equals(\"HighScore\") && !s.equals(\"icon\") && !s.equals(\"img\") && !s.equals(\"sound\")) {\n\t\t \tif (s.equals(tv)) kq = 1; \t\n\t\t }\n\t\t\t }\n\t\t\t }\n\t\t if (kq == 0) Label1.setText(\"File đã chọn không trong thư viện\" );\n\t\t else {\n if (in2.length != in.length ) Label1.setText(\"Số lượng chọn sai . Đã chọn\" + in2.length + \"/\" + in.length + \" ảnh\"); \n else {\n\t\t InputStream inStream= null;\n\t\t OutputStream outStream = null;\n\t\t \n\t\t //for(int i = 0; i <= in.length - 1; i ++) System.out.println(\"i = \" + i +\" name: \" + in[i].toString());\n\t\t \n\t\t try {\n\t\t\t //File [] getFiles () \n\t\t\t for(int i = 0; i <= in2.length - 1; i ++) {\t\t\n\t\t inStream = new FileInputStream(in[i]);\n\t\t outStream = new FileOutputStream(new File(in2[i].getAbsolutePath()));\n\t\t\t in2[i].delete();\n\t\t int length;\n\t\t byte[] buffer = new byte[2097152];\n\n\t\t // copy the file content in bytes\n\t\t while ((length = inStream.read(buffer)) > 0) {\n\t\t outStream.write(buffer, 0, length);\n\t\t }\n\t\t\t }\n\t\t System.out.println(\"File is copied successful!\");\n\t\t \n\t\t } catch (IOException ex) {\n\t\t ex.printStackTrace();\n\t\t }\t\t \n\t\t fr.setVisible(false);\n }}}}\n}\n}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\r\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tint opt = chooser.showOpenDialog(null);\r\n\t\t\t\tif (opt == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tFileInputStream fi = new FileInputStream(file);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tObjectInputStream ois = new ObjectInputStream(fi);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(ois.readUTF().equals(user)) {\r\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tStudentArray =(ArrayList<Student>) ois.readObject();\r\n\t\t\t\t\t\t\t\ttab =(MyTabbedPane) ois.readObject();\r\n\t\t\t\t\t\t\t} catch (ClassNotFoundException e1) {\r\n\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\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} catch (IOException e1) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}",
"public void grabarDatos(ActionEvent actionEvent){\r\n int esMo = Integer.parseInt(txtMotos.getText());\r\n estMo = esMo;\r\n int esCar = Integer.parseInt(txtCarros.getText());\r\n estCar = esCar;\r\n int esCam = Integer.parseInt(txtCamiones.getText());\r\n estCam = esCam;\r\n double ctarifa = Double.parseDouble(txtTarifa.getText());\r\n tarifa = ctarifa;\r\n /**\r\n * para eliminar los datos una vez sean guardados de lo contrario quedaria con el mismo\r\n * numero que se coloco.\r\n */\r\n txtMotos.setText(\"\");\r\n txtCarros.setText(\"\");\r\n txtCamiones.setText(\"\");\r\n txtTarifa.setText(\"\");\r\n txtMensaje.setText(\"Informacion grabada satisfactoriamente\");\r\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jLabel1 = new javax.swing.JLabel();\n jIdFilme = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jCPF = new javax.swing.JFormattedTextField();\n jLabel3 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n jDataEmprestimo = new javax.swing.JFormattedTextField();\n jDataDevolucao = new javax.swing.JFormattedTextField();\n jLabel5 = new javax.swing.JLabel();\n jValor = new javax.swing.JFormattedTextField();\n Empresta = new javax.swing.JButton();\n jButtonListarFilmes = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n\n jLabel1.setText(\"ID do Filme\");\n\n jIdFilme.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jIdFilmeActionPerformed(evt);\n }\n });\n\n jLabel2.setText(\"CPF\");\n\n jLabel3.setText(\"Data de empréstimo\");\n\n jLabel4.setText(\"Data de devolução\");\n\n jLabel5.setText(\"Valor\");\n\n Empresta.setText(\"Realizar Empréstimo\");\n Empresta.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n EmprestaActionPerformed(evt);\n }\n });\n\n jButtonListarFilmes.setText(\"Ver Filmes\");\n jButtonListarFilmes.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButtonListarFilmesActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(125, 125, 125)\n .addComponent(jButtonListarFilmes)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(Empresta, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jCPF, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jIdFilme, javax.swing.GroupLayout.PREFERRED_SIZE, 197, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 67, Short.MAX_VALUE)\n .addComponent(jDataDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jDataEmprestimo, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jValor, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE)))\n .addGap(0, 0, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(67, 67, 67)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(jIdFilme, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jCPF, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(jDataEmprestimo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(jDataDevolucao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel5)\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jValor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(Empresta)\n .addComponent(jButtonListarFilmes))))\n .addContainerGap())\n );\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jFileChooser1 = new javax.swing.JFileChooser();\n jLabel1 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jLabelImg = new javax.swing.JLabel();\n jButton2 = new javax.swing.JButton();\n jSeparator1 = new javax.swing.JSeparator();\n jButton3 = new javax.swing.JButton();\n jLabel3 = new javax.swing.JLabel();\n jSpinnerCajas = new javax.swing.JSpinner();\n\n jFileChooser1.setAcceptAllFileFilterUsed(false);\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Configuración\");\n setIconImage(getIconImage());\n getContentPane().setLayout(null);\n\n jLabel1.setFont(new java.awt.Font(\"Tahoma\", 3, 48)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(153, 0, 0));\n jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);\n jLabel1.setText(\"Configuración\");\n getContentPane().add(jLabel1);\n jLabel1.setBounds(110, 10, 520, 70);\n\n jLabel5.setFont(new java.awt.Font(\"Tahoma\", 0, 20)); // NOI18N\n jLabel5.setText(\"Número de Cajas:\");\n getContentPane().add(jLabel5);\n jLabel5.setBounds(100, 210, 170, 32);\n\n jButton1.setFont(new java.awt.Font(\"Tahoma\", 3, 20)); // NOI18N\n jButton1.setText(\"Procesar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton1);\n jButton1.setBounds(320, 280, 180, 80);\n\n jLabelImg.setFont(new java.awt.Font(\"Tahoma\", 0, 20)); // NOI18N\n jLabelImg.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));\n getContentPane().add(jLabelImg);\n jLabelImg.setBounds(570, 140, 110, 110);\n\n jButton2.setFont(new java.awt.Font(\"Candara\", 1, 18)); // NOI18N\n jButton2.setText(\"Cargar\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton2);\n jButton2.setBounds(320, 140, 180, 30);\n getContentPane().add(jSeparator1);\n jSeparator1.setBounds(0, 90, 740, 10);\n\n jButton3.setFont(new java.awt.Font(\"Candara\", 1, 18)); // NOI18N\n jButton3.setText(\"Volver\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton3);\n jButton3.setBounds(40, 320, 110, 40);\n\n jLabel3.setFont(new java.awt.Font(\"Tahoma\", 0, 20)); // NOI18N\n jLabel3.setText(\"Logo del Programa:\");\n getContentPane().add(jLabel3);\n jLabel3.setBounds(100, 140, 200, 32);\n\n jSpinnerCajas.setModel(new javax.swing.SpinnerNumberModel(5, 1, 50, 1));\n getContentPane().add(jSpinnerCajas);\n jSpinnerCajas.setBounds(320, 210, 180, 26);\n\n setSize(new java.awt.Dimension(757, 461));\n setLocationRelativeTo(null);\n }",
"public jHistorialSeleccionarVoluntario() {\n initComponents();\n \n \n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tJFileChooser jfc=new JFileChooser();\n\t\t\n\t\t//显示文件和目录\n\t\tjfc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES );\n\t\tjfc.showDialog(new JLabel(), \"选择\");\n\t\tFile file=jfc.getSelectedFile();\n\t\t\n\t\t//file.getAbsolutePath()获取到的绝对路径。\n\t\tif(file.isDirectory()){\n\t\t\tSystem.out.println(\"文件夹:\"+file.getAbsolutePath());\n\t\t}else if(file.isFile()){\n\t\t\tSystem.out.println(\"文件:\"+file.getAbsolutePath());\n\t\t}\n\t\t\n\t\t//jfc.getSelectedFile().getName() 获取到文件的名称、文件名。\n\t\tSystem.out.println(jfc.getSelectedFile().getName());\n\t\t\n\t}",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents()\n {\n\n jPanel2 = new javax.swing.JPanel();\n jFileChooserFoto = new javax.swing.JFileChooser();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"August- Selecione uma imagem\");\n\n jFileChooserFoto.setApproveButtonText(\"Carregar\");\n jFileChooserFoto.setCurrentDirectory(new java.io.File(\"H:\\\\Pedro\\\\WEB\\\\Arquivos_htm\\\\doctor whosite\"));\n jFileChooserFoto.setDialogTitle(\"Selecione uma imagem\");\n jFileChooserFoto.addActionListener(new java.awt.event.ActionListener()\n {\n public void actionPerformed(java.awt.event.ActionEvent evt)\n {\n jFileChooserFotoActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jFileChooserFoto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jFileChooserFoto, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jFileChooser1 = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTable1 = new javax.swing.JTable();\n btn_baru = new javax.swing.JButton();\n btn_ubah = new javax.swing.JButton();\n btn_hapus = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n btn_upload = new javax.swing.JButton();\n jPanel3 = new javax.swing.JPanel();\n btn_kembali = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowOpened(java.awt.event.WindowEvent evt) {\n formWindowOpened(evt);\n }\n });\n\n jPanel1.setBackground(new java.awt.Color(0, 51, 51));\n\n jTable1.setBackground(new java.awt.Color(204, 255, 204));\n jTable1.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null},\n {null, null, null, null}\n },\n new String [] {\n \"Title 1\", \"Title 2\", \"Title 3\", \"Title 4\"\n }\n ));\n jTable1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jTable1MouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(jTable1);\n\n btn_baru.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_baru.setText(\"Baru\");\n btn_baru.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_baruActionPerformed(evt);\n }\n });\n\n btn_ubah.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_ubah.setText(\"Ubah\");\n btn_ubah.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_ubahActionPerformed(evt);\n }\n });\n\n btn_hapus.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_hapus.setText(\"Hapus\");\n btn_hapus.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_hapusActionPerformed(evt);\n }\n });\n\n jPanel2.setBackground(new java.awt.Color(255, 255, 204));\n\n jLabel1.setFont(new java.awt.Font(\"Agency FB\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(51, 153, 255));\n jLabel1.setText(\"Daftar Penduduk\");\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 332, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel1)\n .addContainerGap(22, Short.MAX_VALUE))\n );\n\n btn_upload.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_upload.setText(\"Upload\");\n btn_upload.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_uploadActionPerformed(evt);\n }\n });\n\n jPanel3.setBackground(new java.awt.Color(255, 255, 204));\n jPanel3.setPreferredSize(new java.awt.Dimension(160, 52));\n\n btn_kembali.setBackground(new java.awt.Color(0, 0, 0));\n btn_kembali.setFont(new java.awt.Font(\"Agency FB\", 1, 18)); // NOI18N\n btn_kembali.setForeground(new java.awt.Color(51, 153, 255));\n btn_kembali.setText(\"Kembali\");\n btn_kembali.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btn_kembaliActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btn_kembali, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btn_kembali)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addGap(10, 10, 10)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(btn_baru, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_ubah, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_hapus, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(btn_upload, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 681, Short.MAX_VALUE))\n .addContainerGap())\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, 701, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 395, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btn_baru)\n .addComponent(btn_ubah)\n .addComponent(btn_hapus)\n .addComponent(btn_upload))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n\n pack();\n }",
"public JFileChooser getAnswerFileChooser() {\r\n\t\treturn aFileChooser;\r\n\t}",
"public void seleccionarFichero(){\n JFileChooser fileChooser = new JFileChooser();\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"xml\", \"xml\");\n fileChooser.setFileFilter(filter);\n fileChooser.setCurrentDirectory(new java.io.File(\"./ficheros\"));\n int seleccion = fileChooser.showOpenDialog(vista_principal);\n if (seleccion == JFileChooser.APPROVE_OPTION){\n fichero = fileChooser.getSelectedFile();\n vista_principal.getTxtfield_nombre_fichero().\n setText(fichero.getName().substring(0, fichero.getName().length()-4));\n }\n }",
"public int openFileChooser(){\n int returnVal = fileChooser.showOpenDialog(getCanvas()); //Parent component as parameter - affects position of dialog\n FileNameExtensionFilter filter = new FileNameExtensionFilter(\"ZIP & OSM & BIN\", \"osm\", \"zip\", \"bin\",\"OSM\",\"ZIP\",\"BIN\"); //The allowed files in the filechooser\n fileChooser.setFileFilter(filter); //sets the above filter\n return returnVal;\n }",
"private JFileChooser getInChooser() \r\n {\r\n if (inChooser == null) \r\n {\r\n inChooser = new JFileChooser();\r\n }\r\n return inChooser;\r\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n groupFiltro = new javax.swing.ButtonGroup();\n groupTipo = new javax.swing.ButtonGroup();\n groupCampos = new javax.swing.ButtonGroup();\n jFiles = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jPanel3 = new javax.swing.JPanel();\n jLabel1 = new javax.swing.JLabel();\n jPanel4 = new javax.swing.JPanel();\n btVisualizar = new javax.swing.JButton();\n btsalvar = new javax.swing.JButton();\n painelFiltro = new javax.swing.JPanel();\n ckPendentes = new javax.swing.JCheckBox();\n ckReprovados = new javax.swing.JCheckBox();\n ckAprovados = new javax.swing.JCheckBox();\n jLabel8 = new javax.swing.JLabel();\n jPanel8 = new javax.swing.JPanel();\n jLabel11 = new javax.swing.JLabel();\n radCompleto = new javax.swing.JRadioButton();\n radSimplificado = new javax.swing.JRadioButton();\n radPersonalizado = new javax.swing.JRadioButton();\n painelCampos = new javax.swing.JPanel();\n jLabel12 = new javax.swing.JLabel();\n ckId = new javax.swing.JCheckBox();\n ckNome = new javax.swing.JCheckBox();\n ckCpf = new javax.swing.JCheckBox();\n ckRg = new javax.swing.JCheckBox();\n ckTelefone = new javax.swing.JCheckBox();\n ckDatanasc = new javax.swing.JCheckBox();\n ckSexo = new javax.swing.JCheckBox();\n ckTurma = new javax.swing.JCheckBox();\n ckSituacao = new javax.swing.JCheckBox();\n\n jFiles.setDialogTitle(\"\");\n jFiles.setFileSelectionMode(javax.swing.JFileChooser.DIRECTORIES_ONLY);\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setPreferredSize(new java.awt.Dimension(800, 620));\n setResizable(false);\n\n jPanel1.setBackground(new java.awt.Color(54, 54, 54));\n\n jPanel3.setBackground(new java.awt.Color(2, 67, 63));\n\n jLabel1.setFont(new java.awt.Font(\"Courier New\", 1, 40)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(252, 209, 71));\n jLabel1.setText(\"RELATÓRIO DE ALUNOS\");\n jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 488, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(150, 150, 150))\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)\n );\n\n jPanel4.setBackground(new java.awt.Color(54, 54, 54));\n\n btVisualizar.setText(\"VISUALIZAR\");\n btVisualizar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btVisualizarActionPerformed(evt);\n }\n });\n\n btsalvar.setText(\"SALVAR PDF\");\n btsalvar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btsalvarActionPerformed(evt);\n }\n });\n\n painelFiltro.setBackground(new java.awt.Color(54, 54, 54));\n painelFiltro.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n painelFiltro.setPreferredSize(new java.awt.Dimension(330, 170));\n\n ckPendentes.setBackground(new java.awt.Color(54, 54, 54));\n ckPendentes.setFont(new java.awt.Font(\"Courier New\", 1, 18)); // NOI18N\n ckPendentes.setForeground(new java.awt.Color(255, 255, 255));\n ckPendentes.setSelected(true);\n ckPendentes.setText(\"Pendentes\");\n ckPendentes.setName(\"Pendente\"); // NOI18N\n\n ckReprovados.setBackground(new java.awt.Color(54, 54, 54));\n ckReprovados.setFont(new java.awt.Font(\"Courier New\", 1, 18)); // NOI18N\n ckReprovados.setForeground(new java.awt.Color(255, 255, 255));\n ckReprovados.setSelected(true);\n ckReprovados.setText(\"Reprovados\");\n ckReprovados.setName(\"Reprovado\"); // NOI18N\n\n ckAprovados.setBackground(new java.awt.Color(54, 54, 54));\n ckAprovados.setFont(new java.awt.Font(\"Courier New\", 1, 18)); // NOI18N\n ckAprovados.setForeground(new java.awt.Color(255, 255, 255));\n ckAprovados.setSelected(true);\n ckAprovados.setText(\"Aprovados\");\n ckAprovados.setName(\"Aprovado\"); // NOI18N\n\n jLabel8.setFont(new java.awt.Font(\"Courier New\", 1, 22)); // NOI18N\n jLabel8.setForeground(new java.awt.Color(255, 255, 255));\n jLabel8.setText(\"Filtro.:\");\n\n javax.swing.GroupLayout painelFiltroLayout = new javax.swing.GroupLayout(painelFiltro);\n painelFiltro.setLayout(painelFiltroLayout);\n painelFiltroLayout.setHorizontalGroup(\n painelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(painelFiltroLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(painelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(ckPendentes)\n .addComponent(ckAprovados)\n .addComponent(jLabel8)\n .addComponent(ckReprovados))\n .addContainerGap(168, Short.MAX_VALUE))\n );\n painelFiltroLayout.setVerticalGroup(\n painelFiltroLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(painelFiltroLayout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel8)\n .addGap(8, 8, 8)\n .addComponent(ckAprovados)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(ckReprovados)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(ckPendentes)\n .addContainerGap(27, Short.MAX_VALUE))\n );\n\n jPanel8.setBackground(new java.awt.Color(54, 54, 54));\n jPanel8.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n jPanel8.setPreferredSize(new java.awt.Dimension(330, 170));\n\n jLabel11.setFont(new java.awt.Font(\"Courier New\", 1, 22)); // NOI18N\n jLabel11.setForeground(new java.awt.Color(255, 255, 255));\n jLabel11.setText(\"Tipo Relatório.:\");\n\n radCompleto.setBackground(new java.awt.Color(54, 54, 54));\n groupTipo.add(radCompleto);\n radCompleto.setFont(new java.awt.Font(\"Courier New\", 1, 18)); // NOI18N\n radCompleto.setForeground(new java.awt.Color(255, 255, 255));\n radCompleto.setText(\"Completo\");\n radCompleto.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n radCompletoItemStateChanged(evt);\n }\n });\n\n radSimplificado.setBackground(new java.awt.Color(54, 54, 54));\n groupTipo.add(radSimplificado);\n radSimplificado.setFont(new java.awt.Font(\"Courier New\", 1, 18)); // NOI18N\n radSimplificado.setForeground(new java.awt.Color(255, 255, 255));\n radSimplificado.setSelected(true);\n radSimplificado.setText(\"Simplificado\");\n radSimplificado.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n radSimplificadoItemStateChanged(evt);\n }\n });\n\n radPersonalizado.setBackground(new java.awt.Color(54, 54, 54));\n groupTipo.add(radPersonalizado);\n radPersonalizado.setFont(new java.awt.Font(\"Courier New\", 1, 18)); // NOI18N\n radPersonalizado.setForeground(new java.awt.Color(255, 255, 255));\n radPersonalizado.setText(\"Personalisado\");\n radPersonalizado.addItemListener(new java.awt.event.ItemListener() {\n public void itemStateChanged(java.awt.event.ItemEvent evt) {\n radPersonalizadoItemStateChanged(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);\n jPanel8.setLayout(jPanel8Layout);\n jPanel8Layout.setHorizontalGroup(\n jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel8Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(radCompleto)\n .addComponent(jLabel11)\n .addComponent(radSimplificado, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(radPersonalizado, javax.swing.GroupLayout.PREFERRED_SIZE, 193, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(103, Short.MAX_VALUE))\n );\n jPanel8Layout.setVerticalGroup(\n jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel8Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel11)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(radCompleto)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(radSimplificado)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(radPersonalizado)\n .addContainerGap(23, Short.MAX_VALUE))\n );\n\n painelCampos.setBackground(new java.awt.Color(54, 54, 54));\n painelCampos.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));\n painelCampos.setPreferredSize(new java.awt.Dimension(330, 170));\n\n jLabel12.setFont(new java.awt.Font(\"Courier New\", 1, 22)); // NOI18N\n jLabel12.setForeground(new java.awt.Color(255, 255, 255));\n jLabel12.setText(\"Campos.:\");\n\n ckId.setBackground(new java.awt.Color(54, 54, 54));\n ckId.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckId.setForeground(new java.awt.Color(255, 255, 255));\n ckId.setSelected(true);\n ckId.setText(\"Id\");\n ckId.setEnabled(false);\n ckId.setName(\"Aluno.id\"); // NOI18N\n\n ckNome.setBackground(new java.awt.Color(54, 54, 54));\n ckNome.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckNome.setForeground(new java.awt.Color(255, 255, 255));\n ckNome.setSelected(true);\n ckNome.setText(\"Nome\");\n ckNome.setEnabled(false);\n ckNome.setName(\"Aluno.nome\"); // NOI18N\n\n ckCpf.setBackground(new java.awt.Color(54, 54, 54));\n ckCpf.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckCpf.setForeground(new java.awt.Color(255, 255, 255));\n ckCpf.setSelected(true);\n ckCpf.setText(\"CPF\");\n ckCpf.setEnabled(false);\n ckCpf.setName(\"Aluno.cpf\"); // NOI18N\n\n ckRg.setBackground(new java.awt.Color(54, 54, 54));\n ckRg.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckRg.setForeground(new java.awt.Color(255, 255, 255));\n ckRg.setText(\"RG\");\n ckRg.setEnabled(false);\n ckRg.setName(\"Aluno.rg\"); // NOI18N\n\n ckTelefone.setBackground(new java.awt.Color(54, 54, 54));\n ckTelefone.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckTelefone.setForeground(new java.awt.Color(255, 255, 255));\n ckTelefone.setText(\"Telefone\");\n ckTelefone.setEnabled(false);\n ckTelefone.setName(\"Aluno.telefone\"); // NOI18N\n\n ckDatanasc.setBackground(new java.awt.Color(54, 54, 54));\n ckDatanasc.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckDatanasc.setForeground(new java.awt.Color(255, 255, 255));\n ckDatanasc.setText(\"Data de Nascimento\");\n ckDatanasc.setEnabled(false);\n ckDatanasc.setName(\"Aluno.datanasc\"); // NOI18N\n\n ckSexo.setBackground(new java.awt.Color(54, 54, 54));\n ckSexo.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckSexo.setForeground(new java.awt.Color(255, 255, 255));\n ckSexo.setText(\"Sexo\");\n ckSexo.setEnabled(false);\n ckSexo.setName(\"Aluno.sexo\"); // NOI18N\n\n ckTurma.setBackground(new java.awt.Color(54, 54, 54));\n ckTurma.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckTurma.setForeground(new java.awt.Color(255, 255, 255));\n ckTurma.setSelected(true);\n ckTurma.setText(\"Turma\");\n ckTurma.setEnabled(false);\n ckTurma.setName(\"Aluno.turma\"); // NOI18N\n\n ckSituacao.setBackground(new java.awt.Color(54, 54, 54));\n ckSituacao.setFont(new java.awt.Font(\"Courier New\", 1, 16)); // NOI18N\n ckSituacao.setForeground(new java.awt.Color(255, 255, 255));\n ckSituacao.setSelected(true);\n ckSituacao.setText(\"Situação\");\n ckSituacao.setEnabled(false);\n ckSituacao.setName(\"Estagio.situacao\"); // NOI18N\n\n javax.swing.GroupLayout painelCamposLayout = new javax.swing.GroupLayout(painelCampos);\n painelCampos.setLayout(painelCamposLayout);\n painelCamposLayout.setHorizontalGroup(\n painelCamposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(painelCamposLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(painelCamposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(painelCamposLayout.createSequentialGroup()\n .addComponent(jLabel12)\n .addGap(18, 18, 18)\n .addComponent(ckId)\n .addGap(18, 18, 18)\n .addComponent(ckNome)\n .addGap(18, 18, 18)\n .addComponent(ckCpf)\n .addGap(18, 18, 18)\n .addComponent(ckRg)\n .addGap(18, 18, 18)\n .addComponent(ckTelefone)\n .addGap(18, 18, 18)\n .addComponent(ckSexo))\n .addGroup(painelCamposLayout.createSequentialGroup()\n .addComponent(ckDatanasc)\n .addGap(18, 18, 18)\n .addComponent(ckTurma)\n .addGap(18, 18, 18)\n .addComponent(ckSituacao)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n painelCamposLayout.setVerticalGroup(\n painelCamposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(painelCamposLayout.createSequentialGroup()\n .addContainerGap()\n .addGroup(painelCamposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel12)\n .addComponent(ckId)\n .addComponent(ckNome)\n .addComponent(ckCpf)\n .addComponent(ckRg)\n .addComponent(ckTelefone)\n .addComponent(ckSexo))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addGroup(painelCamposLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(ckDatanasc)\n .addComponent(ckTurma)\n .addComponent(ckSituacao))\n .addContainerGap(56, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(164, 164, 164)\n .addComponent(btsalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(176, 176, 176)\n .addComponent(btVisualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addGap(53, 53, 53)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addComponent(painelCampos, javax.swing.GroupLayout.DEFAULT_SIZE, 690, Short.MAX_VALUE)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(30, 30, 30)\n .addComponent(painelFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))\n .addContainerGap(52, Short.MAX_VALUE))\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(painelFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(painelCampos, javax.swing.GroupLayout.PREFERRED_SIZE, 143, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btVisualizar, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(btsalvar, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addContainerGap(66, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(1, 1, 1)\n .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(0, 5, Short.MAX_VALUE)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 5, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n );\n\n pack();\n setLocationRelativeTo(null);\n }",
"public FilterChooser() {\n\n \tsuper();\n \tchooser = new JFileChooser();\n \tthis.setupListeners();\n \t\n \n }",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tint opt = chooser.showSaveDialog(null);\r\n\t\t\t\tif (opt == JFileChooser.APPROVE_OPTION) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tFile file = chooser.getSelectedFile();\r\n\t\t\t\t\tif (FilenameUtils.getExtension(file.getName()).equalsIgnoreCase(user)) {\r\n\t\t\t\t\t\t// filename is OK as-is\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfile = new File(file.toString() + \".\"+user);\r\n\t\t\t\t\t\tfile = new File(file.getParentFile(), FilenameUtils.getBaseName(file.getName()) + \".\"+user);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tFileOutputStream fo = new FileOutputStream(file);\r\n\t\t\t\t\t\tObjectOutputStream oos = new ObjectOutputStream(fo);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.writeUTF(user);\r\n\t\t\t\t\t\toos.writeObject(StudentArray);\r\n\t\t\t\t\t\toos.writeObject(tab);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toos.close();\r\n\t\t\t\t\t\tfo.close();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} catch (IOException e1) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te1.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}",
"private void getArquivo()\n {\n /*** Obtem o conteudo do pacote através do diretorio ***/\n File file = new File(caminho_origem);\n if (file.isFile())\n {\n try\n {\n /*** Lê o pacote e põe em um array de bytes ***/\n DataInputStream diStream = new DataInputStream(new FileInputStream(file));\n long len = (int) file.length();\n if (len > Utils.tamanho_maximo_arquivo)\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_muito_grande);\n System.exit(0);\n }\n Float numero_pacotes_ = ((float)len / Utils.tamanho_util_pacote);\n int numero_pacotes = numero_pacotes_.intValue();\n int ultimo_pacote = (int) len - (Utils.tamanho_util_pacote * numero_pacotes);\n int read = 0;\n /***\n 1500\n fileBytes[1500]\n p[512]\n p[512]\n p[476]len - (512 * numero_pacotes.intValue())\n ***/\n byte[] fileBytes = new byte[(int)len];\n while (read < fileBytes.length)\n {\n fileBytes[read] = diStream.readByte();\n read++;\n }\n int i = 0;\n int pacotes_feitos = 0;\n while ( pacotes_feitos < numero_pacotes)\n {\n byte[] mini_pacote = new byte[Utils.tamanho_util_pacote];\n for (int k = 0; k < Utils.tamanho_util_pacote; k++)\n {\n mini_pacote[k] = fileBytes[i];\n i++;\n }\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(mini_pacote);\n this.pacotes.add(pacote_);\n pacotes_feitos++;\n }\n byte[] ultimo_mini_pacote = new byte[ultimo_pacote];\n int ultimo_indice = ultimo_mini_pacote.length;\n for (int j = 0; j < ultimo_mini_pacote.length; j++)\n {\n ultimo_mini_pacote[j] = fileBytes[i];\n i++;\n }\n byte[] ultimo_mini_pacote2 = new byte[512];\n System.arraycopy(ultimo_mini_pacote, 0, ultimo_mini_pacote2, 0, ultimo_mini_pacote.length);\n for(int h = ultimo_indice; h < 512; h++ ) ultimo_mini_pacote2[h] = \" \".getBytes()[0];\n Pacote pacote_ = new Pacote();\n pacote_.setConteudo(ultimo_mini_pacote2);\n this.pacotes.add(pacote_);\n this.janela = new HashMap<>();\n for (int iterator = 0; iterator < this.pacotes.size(); iterator++) janela.put(iterator, new Estado());\n } catch (Exception e)\n {\n System.out.println(Utils.prefixo_cliente + Utils.erro_na_leitura);\n System.exit(0);\n }\n } else\n {\n System.out.println(Utils.prefixo_cliente + Utils.arquivo_inexistente);\n System.exit(0);\n }\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jFileChooser1 = new javax.swing.JFileChooser();\n jPanel1 = new javax.swing.JPanel();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n jTextArea1 = new javax.swing.JTextArea();\n jLabel1 = new javax.swing.JLabel();\n jLabel2 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n jList1 = new javax.swing.JList<>();\n jButton3 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Zarzadzanie Projektami\");\n\n jButton1.setText(\"wczytaj z pliku\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"demo\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jTextArea1.setColumns(20);\n jTextArea1.setRows(5);\n jScrollPane1.setViewportView(jTextArea1);\n\n jLabel1.setText(\"Dane Wejsciowe\");\n\n jLabel2.setText(\"Wyniki\");\n jLabel2.setToolTipText(\"\");\n\n jScrollPane2.setViewportView(jList1);\n\n jButton3.setText(\"start\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addComponent(jScrollPane2)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel2)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(0, 695, Short.MAX_VALUE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2)\n .addComponent(jButton3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 358, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 219, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n pack();\n }",
"public Double devolucionFM(int i) {\n Double ejemplo = FavoritosFM[i];\r\n return ejemplo;\r\n }",
"private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {\n inicial();\n int inicial;\n int[] vet = new int[Grafos.tam];\n String impressao;\n if (!repres()) {\n return;\n }\n try {\n inicial = Integer.parseInt(verticeInicialB.getText());\n } catch (NumberFormatException ex) {\n JOptionPane.showMessageDialog(null, \"Entrada inválida\",\"ERRO\", ERROR_MESSAGE);\n verticeInicialB.setText(\"\");\n verticeInicialB.requestFocus();\n return;\n }\n if (!control.verificarEntrada(inicial)) {\n JOptionPane.showMessageDialog(null, \"Entrada inválida\",\"ERRO\", ERROR_MESSAGE);\n resetCampo(verticeInicialB);\n return;\n }\n if (!control.verificarEntrada(inicial)) {\n return;\n }\n if (radioProfundidade.isSelected()) {\n impressao = control.buscaProfundidadeString(inicial, representacao);\n resultadoText.setText(impressao);\n } else {\n impressao = control.buscaLarguraString(vet, inicial, representacao);\n view.pintarArestas(vet);\n resultadoText.setText(impressao);\n }\n\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\n\t\t\t\tden = textDenumire.getText().trim();\n\t\t\t\tcat = textCategorie.getText().trim();\n\t\t\t\ttara = textTara.getText().trim();\n\t\t\t\tpret = textPret.getText().trim();\n\t\t\t\t\n\t\t\t\tif(den.isEmpty()) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Seteaza numele produsului\", \"Eroare!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(cat.isEmpty()) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Seteaza categoria produsului!\", \"Eroare!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(tara.isEmpty()) {\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Selecteaza tara de origine!\", \"Eroare!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(pret.isEmpty()) {\t\t\t\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"Seteaza pretul produsului!\", \"Eroare!\", JOptionPane.ERROR_MESSAGE);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tpretDouble = Double.parseDouble(pret);\n\t\t\t\tint ok = 0;\n\t\t\t\t\n\t\t\t\tfor(int i = 0; i< Gestiune.getInstance().getProduse().size(); i++) {\n\t\t\t\t\tif(Gestiune.getInstance().getProduse().get(i).getDenumire().compareTo(den) == 0 &&\n\t\t\t\t\t\t\tGestiune.getInstance().getProduse().get(i).getCategorie().compareTo(cat)==0 &&\n\t\t\t\t\t\t\tGestiune.getInstance().getProduse().get(i).getTaraOrigine().compareTo(tara) == 0) {\n\t\t\t\t\t\tok = 1;\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(ok == 1) {\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFile tempFile = new File(fProduse.getAbsoluteFile()+ \".tmp\");\n\t\t\t\t\t\tRandomAccessFile raf = new RandomAccessFile(fProduse, \"r\");\n\t\t\t\t\t\tPrintWriter pw = new PrintWriter(new FileWriter(tempFile));\n\t\t\t\t\t\t\n\t\t\t\t\t\tString line = null;\n\t\t\t\t\t\tString []words;\n\t\t\t\t\t\t\n\t\t\t\t\t\tline = raf.readLine();\n\t\t\t\t\t\tpw.write(line+\"\\n\");\n\t\t\t\t\t\twords = line.split(\" \");\n\t\t\t\t\t\t\n\t\t\t\t\t\tVector<String> tari = new Vector<String>();\n\t\t\t\t\t\tfor(int i = 2; i < words.length; i++)\n\t\t\t\t\t\t\ttari.add(words[i]);\n\t\t\t\t\t\t\n\t\t\t\t\t\twhile((line = raf.readLine())!=null) {\n\t\t\t\t\t\t\tString templine = line;\n\t\t\t\t\t\t\twords = line.split(\" \");\n\t\t\t\t\t\t\tif(!words[0].equals(den)) {\n\t\t\t\t\t\t\t\tpw.write(templine + \"\\n\");\n\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\tpw.write(den + \" \" + cat);\n\t\t\t\t\t\t\t\tfor(int i = 0; i < tari.size(); i++)\n\t\t\t\t\t\t\t\t\tif(tara.equals(tari.get(i))) {\n\t\t\t\t\t\t\t\t\t\t//System.out.println(\"aici\"+i);\n\t\t\t\t\t\t\t\t\t\tpw.write(\" \"+pretDouble);\n\t\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpw.write(\" \"+ words[i+2]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tpw.write(\"\\n\");\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\tpw.close();\n\t\t\t\t\t\t\n\t\t\t\t\t\tfProduse.delete();\n\t\t\t\t\t\ttempFile.renameTo(fProduse);\n\t\t\t\t\t\t\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\"S-a gasit produsul!\", \"Produsul adaugat!\", JOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t\t\t\n\t\t\t\t\t}catch (IOException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"Nu s-a gasit produsul!\", \"Produsul nu exista!\", JOptionPane.WARNING_MESSAGE);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed\n DefaultTableModel tabla = (DefaultTableModel) jTable1.getModel();\n\n String paraulaCercada;\n paraulaCercada = this.jTextField1.getText();//guarda les dades del text field a una variable pera despres guardarla al array\n\n Cercadors.cercar_incidencia(tabla, paraulaCercada);\n\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jTextField1 = new javax.swing.JTextField();\n jButton1 = new javax.swing.JButton();\n jButton2 = new javax.swing.JButton();\n jFileChooser1 = new javax.swing.JFileChooser();\n jButton3 = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n\n jButton1.setText(\"Upload\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jButton2.setText(\"Cancel\");\n jButton2.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton2ActionPerformed(evt);\n }\n });\n\n jFileChooser1.setPreferredSize(new java.awt.Dimension(1, 1));\n\n jButton3.setText(\"Browse\");\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jButton3))\n .addComponent(jFileChooser1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addComponent(jButton1)\n .addGap(20, 20, 20)\n .addComponent(jButton2)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(33, 33, 33)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jButton3))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jFileChooser1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jButton1)\n .addComponent(jButton2))\n .addContainerGap())\n );\n\n pack();\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n b_mostrar = new javax.swing.JButton();\n jPanel1 = new javax.swing.JPanel();\n jScrollPane2 = new javax.swing.JScrollPane();\n l_perfiles = new javax.swing.JList();\n jPanel3 = new javax.swing.JPanel();\n jScrollPane4 = new javax.swing.JScrollPane();\n l_juegos1 = new javax.swing.JList();\n jButton2 = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n jPanel2 = new javax.swing.JPanel();\n jScrollPane3 = new javax.swing.JScrollPane();\n descripcion = new javax.swing.JTextArea();\n jPanel4 = new javax.swing.JPanel();\n jScrollPane5 = new javax.swing.JScrollPane();\n l_juegos = new javax.swing.JList();\n precio = new javax.swing.JLabel();\n e_precio = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n jButton3 = new javax.swing.JButton();\n jLabel2 = new javax.swing.JLabel();\n\n b_mostrar.setText(\"Mostrar\");\n b_mostrar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n b_mostrarActionPerformed(evt);\n }\n });\n\n jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Perfiles\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 51)));\n\n jScrollPane2.setViewportView(l_perfiles);\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 161, Short.MAX_VALUE)\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Juegos\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(0, 0, 51)));\n\n l_juegos1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n l_juegos1MouseClicked(evt);\n }\n });\n l_juegos1.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n l_juegos1KeyTyped(evt);\n }\n });\n jScrollPane4.setViewportView(l_juegos1);\n\n javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);\n jPanel3.setLayout(jPanel3Layout);\n jPanel3Layout.setHorizontalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)\n .addContainerGap())\n );\n jPanel3Layout.setVerticalGroup(\n jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel3Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 318, Short.MAX_VALUE)\n .addContainerGap())\n );\n\n jButton2.setText(\"jButton1\");\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setMinimumSize(new java.awt.Dimension(745, 453));\n getContentPane().setLayout(null);\n\n jLabel1.setFont(new java.awt.Font(\"Segoe UI Light\", 1, 36)); // NOI18N\n jLabel1.setForeground(new java.awt.Color(0, 51, 102));\n jLabel1.setText(\"Comprar Juego\");\n getContentPane().add(jLabel1);\n jLabel1.setBounds(10, 11, 259, 48);\n\n jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Descripcion\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Tahoma\", 0, 14), new java.awt.Color(0, 51, 102))); // NOI18N\n jPanel2.setForeground(new java.awt.Color(0, 0, 105));\n\n descripcion.setEditable(false);\n descripcion.setColumns(20);\n descripcion.setRows(5);\n jScrollPane3.setViewportView(descripcion);\n descripcion.setLineWrap(true);\n descripcion.setWrapStyleWord(true);\n\n javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);\n jPanel2.setLayout(jPanel2Layout);\n jPanel2Layout.setHorizontalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(26, Short.MAX_VALUE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(21, 21, 21))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(22, 22, 22))\n );\n\n getContentPane().add(jPanel2);\n jPanel2.setBounds(293, 115, 411, 178);\n\n jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, \"Juegos\", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font(\"Tahoma\", 0, 14), new java.awt.Color(0, 51, 102))); // NOI18N\n\n l_juegos.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n l_juegosMouseClicked(evt);\n }\n });\n l_juegos.addKeyListener(new java.awt.event.KeyAdapter() {\n public void keyTyped(java.awt.event.KeyEvent evt) {\n l_juegosKeyTyped(evt);\n }\n });\n jScrollPane5.setViewportView(l_juegos);\n\n javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);\n jPanel4.setLayout(jPanel4Layout);\n jPanel4Layout.setHorizontalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 171, Short.MAX_VALUE)\n .addContainerGap())\n );\n jPanel4Layout.setVerticalGroup(\n jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel4Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(27, Short.MAX_VALUE))\n );\n\n getContentPane().add(jPanel4);\n jPanel4.setBounds(30, 70, 203, 340);\n\n precio.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n precio.setForeground(new java.awt.Color(0, 51, 105));\n precio.setText(\"Precio: U$S\");\n getContentPane().add(precio);\n precio.setBounds(310, 330, 80, 20);\n\n e_precio.setFont(new java.awt.Font(\"Tahoma\", 0, 14)); // NOI18N\n e_precio.setForeground(new java.awt.Color(0, 51, 102));\n getContentPane().add(e_precio);\n e_precio.setBounds(390, 330, 72, 20);\n\n jButton1.setFont(new java.awt.Font(\"Tahoma\", 0, 12)); // NOI18N\n jButton1.setForeground(new java.awt.Color(0, 51, 102));\n jButton1.setText(\"Comprar\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton1);\n jButton1.setBounds(500, 370, 90, 30);\n\n jButton3.setFont(new java.awt.Font(\"Tahoma\", 0, 12)); // NOI18N\n jButton3.setForeground(new java.awt.Color(0, 51, 102));\n jButton3.setText(\"Cancelar\");\n jButton3.setPreferredSize(new java.awt.Dimension(90, 30));\n jButton3.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton3ActionPerformed(evt);\n }\n });\n getContentPane().add(jButton3);\n jButton3.setBounds(610, 370, 90, 30);\n getContentPane().add(jLabel2);\n jLabel2.setBounds(0, -10, 990, 470);\n\n pack();\n }",
"private void initComponents() {\n\n jFileChooser1 = new javax.swing.JFileChooser();\n chooser = new javax.swing.JFileChooser();\n\n addWindowListener(new java.awt.event.WindowAdapter() {\n public void windowClosing(java.awt.event.WindowEvent evt) {\n closeDialog(evt);\n }\n });\n\n chooser.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n chooserActionPerformed(evt);\n }\n });\n add(chooser, java.awt.BorderLayout.CENTER);\n\n pack();\n }",
"public JPanelRegistro() {\n initComponents();\n jfcImagen.setFileFilter(filtro);\n jfcImagen.setDialogTitle(\"Seleccione una imagen\");\n jfcImagen.setAcceptAllFileFilterUsed(false);\n jlImagen.setBackground(Color.white);\n \n \n }",
"public void datos(Temperatura t1){\n //Pizarra x = new Pizarra();\n //Dialog d = new Dialog();\n String v;\n float numero;\n //char n; \n //x.setVisible(true);\n //n = r.charAt(0);\n \n switch(opc){\n case 1:\n do\n v = d.readString(\"Ingresa la temperatura en grados Farenheit\");\n while(!isNum(v));\n numero=Float.parseFloat(v);\n t1.setFaren(numero);\n break;\n case 2:\n do\n v = d.readString(\"Ingresa la temperatura en grados Celsius\");\n while(!isNum(v));\n numero=Float.parseFloat(v);\n t1.setCelsius(numero);\n break;\n }\n }",
"private void openItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openItemActionPerformed\n if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {\n File file = fileChooser.getSelectedFile();\n String t = \"\";\n if (file.isFile()) {\n if ((file.getName().toLowerCase().endsWith(\".jpg\")\n || file.getName().toLowerCase().endsWith(\".png\"))) {\n files.add(file.getAbsolutePath());\n flist.add(file);\n } else if (file.getName().toLowerCase().endsWith(\".pdf\")) {\n parsePDF(file.getAbsolutePath());\n flist.add(file);\n }\n t += file.getAbsolutePath() + \"\\n\";\n } else {\n for (File f : file.listFiles()) {\n if (f.isFile() && (f.getName().toLowerCase().endsWith(\".jpg\")\n || f.getName().toLowerCase().endsWith(\".png\"))) {\n files.add(f.getAbsolutePath());\n flist.add(f);\n t += f.getAbsolutePath() + \"\\n\";\n } else if (f.isFile() && f.getName().toLowerCase().endsWith(\".pdf\")) {\n parsePDF(f.getAbsolutePath());\n flist.add(f);\n t += f.getAbsolutePath() + \"\\n\";\n }\n }\n }\n textArea.setText(t);\n } else {\n System.out.println(\"File access cancelled.\");\n }\n }",
"public void recarga(){\n \tthis.fuerza *= 1.1;\n \tthis.vitalidad *= 1.1; \n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n btnAbrir = new javax.swing.JButton();\n jLabel1 = new javax.swing.JLabel();\n txtExigencia = new javax.swing.JTextField();\n btnEjecutar = new javax.swing.JButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n txtRadios = new javax.swing.JTextArea();\n jLabel2 = new javax.swing.JLabel();\n chkMostrar = new javax.swing.JCheckBox();\n txtUmbral = new javax.swing.JTextField();\n jLabel3 = new javax.swing.JLabel();\n txtTamanioFiltro = new javax.swing.JTextField();\n jLabel4 = new javax.swing.JLabel();\n jScrollPane2 = new javax.swing.JScrollPane();\n txtResultado = new javax.swing.JTextArea();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(\"Contador de Monedas\");\n\n btnAbrir.setText(\"Abrir imagen\");\n btnAbrir.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAbrirActionPerformed(evt);\n }\n });\n\n jLabel1.setText(\"Exigencia\");\n\n txtExigencia.setText(\"0.95\");\n\n btnEjecutar.setText(\"Ejecutar\");\n btnEjecutar.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnEjecutarActionPerformed(evt);\n }\n });\n\n txtRadios.setColumns(20);\n txtRadios.setRows(5);\n jScrollPane1.setViewportView(txtRadios);\n\n jLabel2.setText(\"Radios\");\n\n chkMostrar.setText(\"Mostrar\");\n\n txtUmbral.setText(\"100\");\n\n jLabel3.setText(\"Umbral binarización:\");\n\n txtTamanioFiltro.setText(\"5\");\n\n jLabel4.setText(\"Tamaño de ventana para filtro\");\n\n txtResultado.setColumns(20);\n txtResultado.setRows(5);\n jScrollPane2.setViewportView(txtResultado);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(45, 45, 45)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel3)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtUmbral, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel1)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtExigencia, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(layout.createSequentialGroup()\n .addComponent(jLabel4)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(txtTamanioFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel2)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(0, 0, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btnAbrir, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addGap(0, 0, Short.MAX_VALUE)\n .addComponent(chkMostrar)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(btnEjecutar))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane2)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(btnAbrir)\n .addGap(18, 18, 18)\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(txtExigencia, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel3)\n .addComponent(txtUmbral, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel4)\n .addComponent(txtTamanioFiltro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGap(10, 10, 10)\n .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(btnEjecutar)\n .addComponent(chkMostrar))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n\n pack();\n }",
"public JFileChooser getqFileChooser() {\r\n\t\treturn qFileChooser;\r\n\t}",
"public String ouvrir(){\n \n JTextArea text=new JTextArea();\n FileNameExtensionFilter filter = new FileNameExtensionFilter (\n \"java\", \"java\");\n chooser.setFileFilter(filter);\n \n int ret=chooser.showOpenDialog(text);\n String path=\"\";\n if(ret==JFileChooser.APPROVE_OPTION){\n path=chooser.getSelectedFile().getAbsolutePath();\n }\n\n return path;\n }",
"@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jPanel1 = new javax.swing.JPanel();\n jLabel9 = new javax.swing.JLabel();\n jLabel5 = new javax.swing.JLabel();\n jLabel4 = new javax.swing.JLabel();\n estrela = new javax.swing.JTextField();\n diretor = new javax.swing.JTextField();\n jLabel1 = new javax.swing.JLabel();\n jLabel6 = new javax.swing.JLabel();\n codigo = new javax.swing.JTextField();\n jLabel2 = new javax.swing.JLabel();\n jLabel3 = new javax.swing.JLabel();\n jButton1 = new javax.swing.JButton();\n nomefilme = new javax.swing.JTextField();\n jComboBox1 = new javax.swing.JComboBox();\n jComboBox2 = new javax.swing.JComboBox();\n jMenuBar1 = new javax.swing.JMenuBar();\n jMenu1 = new javax.swing.JMenu();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);\n setResizable(false);\n\n jLabel9.setFont(new java.awt.Font(\"Tekton Pro Ext\", 0, 18)); // NOI18N\n jLabel9.setText(\"CADASTRO DE FILMES\");\n\n jLabel5.setFont(new java.awt.Font(\"Arial\", 1, 14)); // NOI18N\n jLabel5.setText(\"Diretor:\");\n\n jLabel4.setFont(new java.awt.Font(\"Arial\", 1, 14)); // NOI18N\n jLabel4.setText(\"Ano de Lançamento: \");\n\n jLabel1.setFont(new java.awt.Font(\"Arial\", 1, 14)); // NOI18N\n jLabel1.setText(\"Código\");\n\n jLabel6.setFont(new java.awt.Font(\"Arial\", 1, 14)); // NOI18N\n jLabel6.setText(\"Estrela:\");\n\n jLabel2.setFont(new java.awt.Font(\"Arial\", 1, 14)); // NOI18N\n jLabel2.setText(\"Nome do Filme:\");\n\n jLabel3.setFont(new java.awt.Font(\"Arial\", 1, 14)); // NOI18N\n jLabel3.setText(\"Gênero:\");\n\n jButton1.setBackground(new java.awt.Color(102, 102, 255));\n jButton1.setText(\"Proximo >>\");\n jButton1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jButton1ActionPerformed(evt);\n }\n });\n\n jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"Ação\", \"Terror\", \"Comédia\", \"Drama\",\"Épicos\" }));\n\n jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { \"1990\", \"1991\", \"1992\", \"1993\",\"1994\",\"1995\",\"1996\",\"1997\",\"1998\",\"1999\",\"2000\",\"2001\",\"2002\",\"2003\",\"2004\",\"2005\",\"2006\",\"2007\",\"2008\",\"2009\",\"2010\",\"2011\",\"2012\",\"2013\",\"2014\",\"2015\" }));\n\n javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);\n jPanel1.setLayout(jPanel1Layout);\n jPanel1Layout.setHorizontalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(24, 24, 24)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel2)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(nomefilme, javax.swing.GroupLayout.PREFERRED_SIZE, 484, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jButton1)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(jLabel6)\n .addGap(18, 18, 18)\n .addComponent(estrela, javax.swing.GroupLayout.PREFERRED_SIZE, 271, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)\n .addComponent(jLabel3)\n .addGap(27, 27, 27)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jLabel1)\n .addComponent(jLabel5))\n .addGap(18, 18, 18)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(diretor, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addComponent(codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(18, 18, 18)\n .addComponent(jLabel4)\n .addGap(18, 18, 18)\n .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))))))))\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(194, 194, 194)\n .addComponent(jLabel9)))\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jLabel9)\n .addGap(28, 28, 28)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(nomefilme, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel2))\n .addGap(32, 32, 32)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel6)\n .addComponent(estrela, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel3)\n .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(30, 30, 30)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jLabel1)\n .addComponent(codigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(35, 35, 35)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(jLabel5)\n .addComponent(diretor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(13, 13, 13)\n .addComponent(jButton1)\n .addContainerGap(106, Short.MAX_VALUE))\n );\n\n jMenu1.setText(\"SAIR\");\n jMenu1.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n jMenu1MouseClicked(evt);\n }\n });\n jMenu1.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jMenu1ActionPerformed(evt);\n }\n });\n jMenuBar1.add(jMenu1);\n\n setJMenuBar(jMenuBar1);\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());\n getContentPane().setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addContainerGap(26, Short.MAX_VALUE))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n pack();\n setLocationRelativeTo(null);\n }",
"private void openPressed(){\n\t\tJFileChooser fileChooser = new JFileChooser(System.getProperty(\"user.dir\"));\n\t\tFileNameExtensionFilter extentions = new FileNameExtensionFilter(\"SuperCalcSave\", \"scalcsave\");\n\t\tfileChooser.setFileFilter(extentions);\n\t\tint retunedVal = fileChooser.showOpenDialog(this);\n\t\tFile file = null;\n\t\tif(retunedVal == JFileChooser.APPROVE_OPTION){\n\t\t\tfile = fileChooser.getSelectedFile();\n\t\t}\n\t\t//only continue if a file is selected\n\t\tif(file != null){\n\t\t\tSaveFile saveFile = null;\n\t\t\ttry {\n\t\t\t\t//read in file\n\t\t\t\tObjectInputStream input = new ObjectInputStream(new FileInputStream(file));\n\t\t\t\tsaveFile = (SaveFile) input.readObject();\n\t\t\t\tinput.close();\n\t\t\t\tVariable.setList(saveFile.getVariables());\n\t\t\t\tUserFunction.setFunctions(saveFile.getFunctions());\n\t\t\t\tmenuBar.updateFunctions();\n\t\t\t\tSystem.out.println(\"Open Success\");\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"private void btnAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAgregarActionPerformed\n \n camino=null;\n \n int status = fileChooser.showOpenDialog (null);\n if (status == JFileChooser.APPROVE_OPTION){\n File selectedFile = fileChooser.getSelectedFile();\n camino = selectedFile.getAbsolutePath();\n }\n else{ \n if (status == JFileChooser.CANCEL_OPTION){\n System.out.println(\"CANCELAR\");\n }\n \n }\n try {\n cancion.agregarCancion(camino);\n } catch (IOException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (UnsupportedTagException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InvalidDataException ex) {\n Logger.getLogger(biblioteca.class.getName()).log(Level.SEVERE, null, ex);\n }\n String[] test = cancion.mostrarCancion(i);\n lista.addElement(\" \"+test[0]);\n libCancion.setModel(lista);\n i++;\n }",
"public FenFileChooser(FenStudy prec) {\n this.prec = prec;\n initComponents();\n this.setLocation(prec.getLocation());\n fileCho.setApproveButtonText(\"Select\");\n }",
"@Override\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tObject ob=e.getSource();\n\t\tif(ob==btnPhoto)//사진가져오기 버튼\n\t\t{\n\t\t\t//FileDialog 이용해서 사진을 가져오면 사진 변경되도록 해보세요\n\t\t\tFileDialog dlg=new FileDialog(this, \"사진가져오기\", FileDialog.LOAD);\n\t\t\tdlg.setVisible(true);\n\t\t\t//취소가 아닌경우 사진 출력\n\t\t\tif(dlg.getDirectory()!=null)\n\t\t\t{\n\t\t\t\timageName=dlg.getDirectory()+dlg.getFile();\n\t\t\t\t//Image생성\n\t\t\t\tphotoImage=new ImageIcon(imageName).getImage();\n\t\t\t\t//paint 메서드 호출\n\t\t\t\tmyPhoto.repaint();\n\t\t\t}\n\t\t\t\n\t\t}else if(ob==btnSave)//정보 저장\n\t\t{\n\t\t\t//입력한 이름.txt 로 저장하기(java0901 폴더에)\n\t\t\t//입력체크-이름이나 나이를 입력안하면 경고메세지후 메서드 종료\n\t\t\tString name=txtName.getText().trim();//trim():양쪽 공백제거\n\t\t\tString blood=comboBlood.getSelectedItem().toString();\n\t\t\tString age=txtAge.getText();\n\t\t\tif(name.length()==0)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(this, \"이름을 입력해주세요\");\n\t\t\t\ttxtName.requestFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(age.length()==0)\n\t\t\t{\n\t\t\t\tJOptionPane.showMessageDialog(this, \"나이를 입력해주세요\");\n\t\t\t\ttxtAge.requestFocus();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t//파일에 한줄에 정보한개씩\n\t\t\t//이미지명(첫줄),이름(2번째줄),혈액형(3번째줄),나이(4번째줄)에 저장\n\t\t\tFileWriter fw=null;\n\t\t\ttry {\n\t\t\t\tfw=new FileWriter(\"D:\\\\java0901\\\\\"+name+\".txt\");\n\t\t\t\t//저장\n\t\t\t\tfw.write(imageName+\"\\n\");\n\t\t\t\tfw.write(name+\"\\n\");\n\t\t\t\tfw.write(blood+\"\\n\");\n\t\t\t\tfw.write(age+\"\\n\");\t\t\t\t\n\t\t\t} catch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}finally {\n\t\t\t\ttry {\n\t\t\t\t\tfw.close();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//이미지는 처음 이미지로 초기화. 이름과 나이는 지우고, \n\t\t\t//혈액형은 다시 1번째꺼로 초기화\t\t\t\n\t\t\tphotoImage=new ImageIcon(\"D:\\\\java0901\\\\image\\\\귀여운 아이콘\\\\c1.png\").getImage();\n\t\t\tmyPhoto.repaint();\n\t\t\ttxtName.setText(\"\");\n\t\t\ttxtAge.setText(\"\");\n\t\t\tcomboBlood.setSelectedIndex(0);\n\t\t\t\n\t\t}else if(ob==btnOpen)//정보 가져오기\n\t\t{\n\t\t\t//해당 이름으로 된 파일을 불러오면 그 데이타로 \n\t\t\t//사진,이름,혈액형,나이가 변경되도록 한다\n\t\t\tFileReader fr=null;\n\t\t\tBufferedReader br=null;\n\t\t\tFileDialog dlg=new FileDialog(this,\"파일열기\",FileDialog.LOAD);\n\t\t\tdlg.setVisible(true);\n\t\t\tif(dlg.getDirectory()!=null)\n\t\t\t{\n\t\t\t\tString fileName=dlg.getDirectory()+dlg.getFile();\n\t\t\t\ttry {\n\t\t\t\t\tfr=new FileReader(fileName);\n\t\t\t\t\tbr=new BufferedReader(fr);\n\t\t\t\t\t//1번째 데이타는 사진명\n\t\t\t\t\timageName=br.readLine();//사진명\n\t\t\t\t\tphotoImage=new ImageIcon(imageName).getImage();\n\t\t\t\t\tmyPhoto.repaint();\n\t\t\t\t\t\n\t\t\t\t\t//2번째 데이타는 이름\n\t\t\t\t\tString name=br.readLine();\n\t\t\t\t\ttxtName.setText(name);\n\t\t\t\t\t\n\t\t\t\t\t//3번째-혈액형\n\t\t\t\t\tString blood=br.readLine();\n\t\t\t\t\tcomboBlood.setSelectedItem(blood);\n\t\t\t\t\t\n\t\t\t\t\t//4번째-나이\n\t\t\t\t\tString age=br.readLine();\n\t\t\t\t\ttxtAge.setText(age);\n\t\t\t\t\t\n\t\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(br!=null) br.close();\n\t\t\t\t\t\tif(fr!=null) fr.close();\n\t\t\t\t\t}catch (IOException e1) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void setPeso(String peso) {\r\n\t\tthis.peso = Float.parseFloat(peso.replace(\",\",\".\"));\r\n\t}",
"private void jMenuItemGuardarBDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemGuardarBDActionPerformed\n LOG.trace(evt.paramString());\n\n jfc.showSaveDialog(this);\n File f = jfc.getSelectedFile();\n\n try (FileOutputStream fos = new FileOutputStream(f);\n ObjectOutputStream oos = new ObjectOutputStream(fos)) {\n\n oos.writeObject(listaDeportes);\n\n } catch (HeadlessException | IOException e) {\n LOG.error(e.getMessage(), e);\n }\n}",
"public void chargerListe(ActionEvent evt)\n\t{\n\t\tJFileChooser fileChooser = new JFileChooser();\n\t\tMyFileFilter filter = new MyFileFilter();\n\t\tfilter.addExtension(\"xml\");\n\t\tfileChooser.setFileFilter(filter);\n\t\tfileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\t\t\n\t\tint returnVal = fileChooser.showOpenDialog(FormJoueur.this);\n\t\t\n\t\tif (returnVal == JFileChooser.APPROVE_OPTION)\n\t\t{\n\t\t\t//=== suppression des joueurs ===\n\t\t\t((JoueursTableModel)sorter.getTableModel()).clear();\t\t\t\n\t\t\tFile file = fileChooser.getSelectedFile();\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tXMLDecoder d = new XMLDecoder(\n\t\t\t\t\t\t\t\t new BufferedInputStream(\n\t\t\t\t\t\t\t\t\t new FileInputStream(file)));\n\t\t\t\twhile(true)\n\t\t\t\t{\t\t\t\t\t\t \n\t\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tObject result = d.readObject();\n\t\t\t\t\t\t((JoueursTableModel)sorter.getTableModel()).addJoueur((Joueur)result);\n\t\t\t\t\t}\n\t\t\t\t\tcatch(ArrayIndexOutOfBoundsException exp)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\t\t\t\t\t\t\t\n\t\t\t\t};\n\t\t\t\td.close();\n\t\t\t}\n\t\t\tcatch(Exception exp)\n\t\t\t{\t\t\t\t\n\t\t\t\tlogger.error(exp);\n\t\t\t}\n\t\t}\t\n\t\t((JoueursTableModel)sorter.getTableModel()).fireTableDataChanged();\t\n\t\t//competition.notifyJoueursChanged();\n\t}",
"@Override\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\tJFileChooser chooser = new JFileChooser();\r\n\t\t\t\tFileNameExtensionFilter filter = new FileNameExtensionFilter(\r\n\t\t\t\t\t\t\"Excel Files\", // 파일 이름에 창에 출력될 문자열\r\n\t\t\t\t\t\t\"xls\"); // 파일 필터로 사용되는 확장자. *.xml 만 나열됨\r\n\t\t\t\tchooser.setFileFilter(filter); // 파일 다이얼로그에 파일 필터 설정\r\n\t\t\t\tchooser.setMultiSelectionEnabled(false);//다중 선택 불가\r\n\r\n\t\t\t\t// 파일 다이얼로그 출력\r\n\t\t\t\tint ret = chooser.showOpenDialog(null);\r\n\t\t\t\tif (ret != JFileChooser.APPROVE_OPTION) { // 사용자가 창을 강제로 닫았거나 취소\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// 버튼을 누른 경우\r\n\t\t\t\t\tJOptionPane.showMessageDialog(null, \"파일을 선택하지 않았습니다\", \"경고\",\r\n\t\t\t\t\t\t\tJOptionPane.WARNING_MESSAGE);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t// 사용자가 파일을 선택하고 \"열기\" 버튼을 누른 경우\r\n\t\t\t\tString readFilePath = chooser.getSelectedFile().getPath(); // 파일 경로명을 알아온다.\t\t\t\t\r\n\t\t\t\tShowPatientInfo_K showPatientInfo = new ShowPatientInfo_K(readFilePath);\r\n\t\t\t}",
"public void seleccionarPieza(java.awt.event.MouseEvent evt) {\n // Se pasa como parametro el evento\n CuadroPieza t = ((CuadroPieza) evt.getComponent());//Averiguo en que cuadro sucedio el evento\n if (t.getPieza() != null) {//Veo si el cuadro no esta vacio.\n if (t.getPieza().getColor() == getTurno()) {//Veo si es del mismo color del turno que actualmente le toca.\n cuadroSeleccionado = t;\n /*\n * Con esto hago que se resalten los posibles movimientos en todo el tablero.\n */\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n tablero[x][y].opacarPieza();//Si hay piezas seleccionadas, las opaco\n if (isSeleccionarAlternativas()) {//Resalto los posibles movimientos.\n if (cuadroSeleccionado.getPieza().validarMovimiento(tablero[x][y], this)) {\n tablero[x][y].resaltarPieza(tablero[x][y].getPieza() != null ? getAlerta() : null);\n }\n }\n }\n }\n /*\n * Resalto el cuadro que ha sido seleccionado para que el usuario sepa que cuadro selecciono\n */\n cuadroSeleccionado.resaltarPieza(getSeleccionado());\n /*\n * Establesco la imagen de la pieza que ha sido seleccionada al label.\n */\n tmp.setIcon(cuadroSeleccionado.getPieza().getImagenPieza());\n /*\n * borro la imagen de la pieza del cuadro.\n */\n cuadroSeleccionado.lbl.setIcon(null);\n /*\n * Establesco la nueva posicion del label, que tiene la imagen de la pieza.\n */\n tmp.setLocation(cuadroSeleccionado.getLocation().x + evt.getX() - 18, cuadroSeleccionado.getLocation().y + evt.getY() - 28);\n }\n }\n }"
] | [
"0.6089183",
"0.59833395",
"0.591674",
"0.5838628",
"0.58305013",
"0.5795262",
"0.57461053",
"0.5727022",
"0.5713097",
"0.57078004",
"0.56875765",
"0.56812173",
"0.56800336",
"0.56698245",
"0.56484896",
"0.5644621",
"0.56366783",
"0.5620882",
"0.5620719",
"0.55948186",
"0.5593629",
"0.5570124",
"0.55693966",
"0.55450004",
"0.55244666",
"0.5501455",
"0.54999673",
"0.5475974",
"0.5474039",
"0.54716873",
"0.5464715",
"0.5435478",
"0.54326814",
"0.5427276",
"0.54221004",
"0.5405087",
"0.54030025",
"0.5402347",
"0.53955054",
"0.5383892",
"0.5355639",
"0.5342083",
"0.533059",
"0.53279847",
"0.5310233",
"0.53093",
"0.53046834",
"0.5295688",
"0.5295539",
"0.52910256",
"0.52896416",
"0.5270364",
"0.52563816",
"0.52469623",
"0.5239099",
"0.5234341",
"0.52249706",
"0.52221954",
"0.52214986",
"0.5219335",
"0.5218709",
"0.52135956",
"0.52074707",
"0.5205111",
"0.5195356",
"0.51769525",
"0.5175163",
"0.5174743",
"0.5171999",
"0.5165815",
"0.51634973",
"0.5161805",
"0.51534736",
"0.5150671",
"0.5150314",
"0.5146931",
"0.5140757",
"0.5128855",
"0.5126499",
"0.5107301",
"0.51010174",
"0.5100627",
"0.50990236",
"0.5094414",
"0.5094088",
"0.5091218",
"0.5087577",
"0.50870657",
"0.5086554",
"0.5079609",
"0.50777805",
"0.50750744",
"0.50721306",
"0.5071471",
"0.5069954",
"0.5064816",
"0.50622946",
"0.50539744",
"0.50313574",
"0.50285065",
"0.5027045"
] | 0.0 | -1 |
Wrapper method for Twilio API | private void initializeUnderlyingTransport(final String accountSid,
final String authToken){
Twilio.init(accountSid, authToken);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface TwilioService {\n @GET(\"PhoneNumbers/{phoneNumber}?Type=carrier\")\n Call<TwilioLookupResponse> lookup(@Path(\"phoneNumber\") String phoneNumber);\n}",
"public interface TwilioService {\n String ACCOUNT_ID_TEST = \"ACCXXXX\";\n String ACCOUNT_TOKEN_TEST = \"ACXXX\";\n String FROM = \"XXXXX\";\n\n}",
"public TwilioWrapperLibraryBuilder twilio(String _sid, String _token)\n {\n this.twilio_account_sid = _sid;\n this.twilio_account_token = _token;\n return this;\n }",
"void requestSendSMSCode(Context context,String phone);",
"ChatRecord.Rsp getChatRecordRsp();",
"ChatRecord.Req getChatRecordReq();",
"public OtherResponse sendMT(String mobilenumber, String message, String shortcode, int carrierid, int campaignid, Date sendat, String msgfxn, int priority, String fteu, float tariff) throws PrepException, SQLException, JAXBException, SAXException, MalformedURLException, IOException{\n String response;\n\n if(canSendMT(mobilenumber)){\n //System.out.print(\"User with mobile number:\"+mobilenumber+\" exist!\");\n\n String mt_request_xml = createXml(mobilenumber, message, shortcode, carrierid, campaignid, sendat, msgfxn, priority, fteu, tariff);\n response = postMT(mt_request_xml);\n\n com.novartis.xmlbinding.mt_response.Response res = getResponse(response);\n\n\n\n List<String> statusmsg = getStatusmessage(response);\n\n return new OtherResponse(res.getStatus(), statusmsg);\n }\n else{//if user not registerd or opted-in send back message on how to register for GetOnTrack\n String registerMsg = \"Novartis Pharmaceuticals Corp: You have to register for the GetOnTrack BP Tracker to use the service. Didn't mean to? Call 877-577-7726 for more information\";\n String mt_request_xml = createXml(mobilenumber, registerMsg, shortcode, carrierid, campaignid, sendat, msgfxn, priority, fteu, tariff);\n response = postMT(mt_request_xml);\n com.novartis.xmlbinding.mt_response.Response res = getResponse(response);\n //com.novartis.xmlbinding.mt_response.Response res = getResponse(\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><response><mts><mt><mobilenumber>\"+mobilenumber+\"</mobilenumber></mt></mts><status>FAIL</status><statusmessage><exceptions><exception>User not opted in for SMS</exception></exceptions></statusmessage></response>\");\n\n\n //System.out.print(\"User with mobile number:\"+mobilenumber+\" does not exist!\");\n List<String> statusmsg = getStatusmessage(response);\n\n return new OtherResponse(res.getStatus(), statusmsg);\n }\n\n }",
"public interface APIService {\n\n @FormUrlEncoded\n @POST(\"receipts.php\")\n Call<Receipt> verifyParticipant(@Field(\"regID\") int regID, @Field(\"mobile\") String mobile);\n}",
"public void sendSms() {\n\n }",
"public interface OTP {\n @FormUrlEncoded\n @POST(\"/api/generate_otp\")\n public void generateOTP(\n @Field(\"new_user\") String bool,\n @Field(\"mobile_no\") String mobile,\n\n\n Callback<Response> callback);\n}",
"private CallResponse() {\n initFields();\n }",
"com.polytech.spik.protocol.SpikMessages.Sms getSms();",
"@GET\n @Path(\"{thingName}/{status}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String recieveAlarm(@PathParam(\"thingName\") String thingName, \n @PathParam(\"status\") String status,@Context UriInfo info) {\n\n MultivaluedMap queryMap = info.getQueryParameters();\n Iterator itr = queryMap.keySet().iterator();\n HashMap<String, String> dataMap = new HashMap<>(); \n while(itr.hasNext()){\n Object key = itr.next();\n Object value = queryMap.getFirst(key);\n dataMap.put(key.toString(), value.toString());\n }\n ThingInfoMap thingInfoMap = new ThingInfoMap(thingName, new Timestamp(new Date().getTime()).toString(),status);\n thingInfoMap.setContent(dataMap);\n \n int alarmID = database.addAlarm(thingInfoMap);\n Dweet newDweet;\n if(alarmID != -1){\n thingInfoMap.setAlarmID(alarmID);\n newDweet = new Dweet(\"succeeded\", \"sending\", \"alarm\", thingInfoMap);\n newDweet.setTo(\"myMobileA\"); // it's not included in database\n String warningMsg = gson.toJson(newDweet);\n //send alarm to mobile use GCM\n sendToMobileByGCM(warningMsg);\n return warningMsg;\n } else {\n newDweet = new Dweet(\"failed\", \"alarm is failed to added\");\n return gson.toJson(newDweet);\n }\n\n }",
"public interface SlackService {\n\n // \"?token=\" + API_KEY + \"&channel=\" + BOTS_CHANNEL_ID + \"&as_user=true\" + \"&text=\" + messageText);\n\n @POST(\"chat.postMessage\")\n Call<SendMessageResponse> sendMessage(@Query(\"token\") String token, @Query(\"channel\") String channel, @Query(\"as_user\") String asUser, @Query(\"text\") String messageText);\n}",
"com.ubtrobot.phone.PhoneCall.ResponseType getResponseType();",
"@GET(\"numbervalidation\")\n Call<ResponseBody> numbervalidation(@Query(\"mobile_number\") String mobile_number, @Query(\"country_code\") String country_code, @Query(\"user_type\") String user_type, @Query(\"language\") String language, @Query(\"forgotpassword\") String forgotpassword);",
"private SpeechletResponse bankTelephoneNumberResponse(){\n\n Place place = getPlaceWithTelephoneNumber();\n\n if (place == null) {\n log.error(\"No place was found! Your address: \" + deviceAddress.toString());\n return getAskResponse(BANK_CONTACT_CARD, ERROR_TEXT);\n }\n\n return doBankTelephoneNumberResponse(place);\n }",
"public interface RequestOtpVerify {\n\n @FormUrlEncoded\n @POST(Urls.REQUEST_VERIFY)\n Call<OtpData> getJson(@Field(\"otp\") String otp, @Field(\"number\") String mobile, @Field(\"token\") String access_token);\n\n}",
"messages.Clienthello.ClientHello getClientHello();",
"public TwilioWrapperLibrary buildLibrary()\n {\n return new TwilioWrapperLibrary( this.twilio_account_sid, this.twilio_account_token, this.thinQ_id, this.thinQ_token);\n }",
"public interface TransferRestClient {\n\n @GET(\"GenerateToken\")\n Observable<String> generateToken(@Query(\"email\") String email,\n @Query(\"nome\") String name);\n\n @POST(\"SendMoney\")\n @FormUrlEncoded\n Observable<String> sendMoney(@Field(\"ClienteId\") int contactId,\n @Field(\"token\") String token,\n @Field(\"valor\") Double value);\n\n @GET(\"GetTransfers\")\n Observable<Response<List<TransferResponse>>> getTransfers(@Query(\"token\") String token);\n}",
"SendSMSResponse sendSMSProcess(SendSMSRequest smsRequest) throws Exception;",
"FriendList.Rsp getFriendlistRes();",
"public void resendOTP() {\n ApiInterface apiInterface = RestClient.getApiInterface();\n apiInterface.userResendOTP(\"bearer\" + \" \" + CommonData.getAccessToken())\n .enqueue(new ResponseResolver<CommonResponse>(OtpActivity.this, true, true) {\n @Override\n public void success(final CommonResponse commonResponse) {\n Log.d(\"debug\", commonResponse.getMessage());\n Toast.makeText(OtpActivity.this, \"New OTP Sent\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void failure(final APIError error) {\n Log.d(\"debug\", error.getMessage());\n\n }\n });\n\n\n }",
"public interface ShortUrlApi {\n\n @POST(\"shorturl\")\n @Converter(ShortUrlConverter.class)\n Call<String> shortUrl(@Body String longUrl,@Query(\"access_token\")String accessToken);\n\n class ShortUrlConverter extends JacksonConverter<String,String> {\n @Override\n public byte[] request(ObjectMapper mapper, Type type, String longUrl) throws IOException {\n return String.format(\"{\\\"action\\\":\\\"long2short\\\",\\\"long_url”:”%s”}\",longUrl).getBytes(CHARSET_UTF8);\n }\n\n @Override\n public String response(ObjectMapper mapper, Type type, byte[] response) throws IOException {\n JsonNode jsonNode = mapper.readTree(response);\n return jsonNode.path(\"short_url\").asText();\n }\n }\n}",
"ISerializer invoke(String responseReceiverId);",
"public interface LKSmsService {\n\n /**\n * 发送 短信\n * @param sms\n *\n * @return\n */\n Result sendSms(SmsRequest sms) throws IOException;\n\n\n\n}",
"public interface ChannelREST {\n public static final String ENDPOINT = \"http://92.222.72.89:8080/\";\n\n @GET(\"/club/{idClub}/channels/{idChannel}/messages\")\n Call<List<Message>> getAllMessageFromChannel(@Path(\"idClub\") Integer id, @Path(\"idChannel\") Integer idChannel);\n @GET(\"/club/{idClub}/channels\")\n Call<List<Channel>> getAllChannelFromClub(@Path(\"idClub\") Integer id);\n @FormUrlEncoded\n @POST(\"/club/{idClub}/channels/{idChannel}/postMessage\")\n Call<Message> postMessage(@Path(\"idClub\") Integer id, @Path(\"idChannel\") Integer idChannel, @Field(\"idUser\") Integer idUser, @Field(\"content\")String content);\n}",
"public void usersUserIdCallsAnsweredGet (String userId, final Response.Listener<InlineResponse2006> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdCallsAnsweredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdCallsAnsweredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/calls/answered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2006) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2006.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public void usersUserIdInviteToWhatsAppPost (String userId, List<Body2> body, final Response.Listener<InlineResponse2009> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdInviteToWhatsAppPost\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdInviteToWhatsAppPost\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/invite_to_WhatsApp\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"POST\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2009) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2009.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public Builder(final String twilioAccount,\n final String twilioAuthToken,\n PhoneNumber twilioPhoneNumber) {\n this.twilioAccount = twilioAccount;\n this.twilioAuthToken = twilioAuthToken;\n this.twilioPhoneNumber = twilioPhoneNumber;\n }",
"public interface RTSPConstants\n{\n // 1xx: Informational - Request received, continuing process\n public static final int RTSP_CONTINUE =100;\n \n // 2xx: Success - The action was successfully received, understood, and accepted\n public static final int RTSP_OK =200;\n public static final int RTSP_CREATED =201;\n public static final int RTSP_LOW_ON_STORAGE_SPACE =250;\n \n // 3xx: Redirection - Further action must be taken in order to complete the request\n public static final int RTSP_MULTIPLE_CHOICES =300;\n public static final int RTSP_MOVED_PERMANENTLY =301;\n public static final int RTSP_MOVED_TEMPORARILY =302;\n public static final int RTSP_SEE_OTHER =303;\n public static final int RTSP_NOT_MODIFIED =304;\n public static final int RTSP_USE_PROXY =305;\n \n // 4xx: Client Error - The request contains bad syntax or cannot be fulfilled\n public static final int RTSP_BAD_REQUEST =400;\n public static final int RTSP_UNAUTHORIZED =401;\n public static final int RTSP_PAYMENT_REQUIRED =402;\n public static final int RTSP_FORBIDDEN =403;\n public static final int RTSP_NOT_FOUND =404;\n public static final int RTSP_METHOD_NOT_ALLOWED =405;\n public static final int RTSP_NOT_ACCEPTABLE =406;\n public static final int RTSP_PROXY_AUTHENTICATION_REQUIRED =407;\n public static final int RTSP_REQUEST_TIME_OUT =408;\n public static final int RTSP_GONE =410;\n public static final int RTSP_LENGTH_REQUIRED =411;\n public static final int RTSP_PRECONDITION_FAILED =412;\n public static final int RTSP_REQUEST_ENTITY_TOO_LARGE =413;\n public static final int RTSP_REQUEST_URI_TOO_LARGE =414;\n public static final int RTSP_UNSUPPORTED_MEDIA_TYPE =415;\n public static final int RTSP_PARAMETER_NOT_UNDERSTOOD =451;\n public static final int RTSP_CONFERENCE_NOT_FOUND =452;\n public static final int RTSP_NOT_ENOUGH_BANDWIDTH =453;\n public static final int RTSP_SESSION_NOT_FOUND =454;\n public static final int RTSP_METHOD_NOT_VALID_IN_THIS_STATE =455;\n public static final int RTSP_HEADER_FIELD_NOT_VALID_FOR_RESOURCE =456;\n public static final int RTSP_INVALID_RANGE =457;\n public static final int RTSP_PARAMETER_IS_READ_ONLY =458;\n public static final int RTSP_AGGREGATE_OPERATION_NOT_ALLOWED =459;\n public static final int RTSP_ONLY_AGGREGATE_OPERATION_ALLOWED =460;\n public static final int RTSP_UNSUPPORTED_TRANSPORT =461;\n public static final int RTSP_DESTINATION_UNREACHABLE =462;\n \n // 5xx: Server Error - The server failed to fulfill an apparently valid request\n public static final int RTSP_INTERNAL_SERVER_ERROR =500;\n public static final int RTSP_NOT_IMPLEMENTED =501;\n public static final int RTSP_BAD_GATEWAY =502;\n public static final int RTSP_SERVICE_UNAVAILABLE =503;\n public static final int RTSP_GATEWAY_TIME_OUT =504;\n public static final int RTSP_RTSP_VERSION_NOT_SUPPORTED =505;\n public static final int RTSP_OPTION_NOT_SUPPORTED =551;\n\n\n\n public static final String tantau_sccsid = \"@(#)$Id: RTSPConstants.java,v 1.1 2009/02/06 14:24:14 rsoder Exp $\";\n}",
"public void usersUserIdCheckContactsUseWhatsAppPost (String userId, String returnUserInfo, List<Body1> body, final Response.Listener<InlineResponse2008> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdCheckContactsUseWhatsAppPost\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdCheckContactsUseWhatsAppPost\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/check_contacts_use_whatsApp\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n queryParams.addAll(ApiInvoker.parameterToPairs(\"\", \"returnUserInfo\", returnUserInfo));\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"POST\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2008) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2008.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"@Override\n public void phoneCalling() {\n Log.e(\"test_TTS\", \"phoneCalling\");\n }",
"@Override\n public void phoneCalling() {\n Log.e(\"test_TTS\", \"phoneCalling\");\n }",
"ChatWithServer.Req getChatWithServerReq();",
"@Override\n protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n try {\n // attempt to find the existing session..\n TwiMLResponse twiMLResponse;\n String id = getWorkflowSessionId(req);\n PyObject twilioRequest = buildRequestTuple(req);\n PyGenerator pygen = workflowSessionCache.getIfPresent(id);\n if (null == pygen) {\n // load the workflow provided\n Invocable f = loadWorkflow(getWorkflowName(req));\n // create the python generator\n pygen = (PyGenerator) f.invokeFunction(\"execute\", twilioRequest);\n twiMLResponse = toTwiMLResponse(pygen.next());\n } else {\n // execute the next request..\n twiMLResponse = toTwiMLResponse(pygen.send(twilioRequest));\n }\n\n // determine if this is the last response..\n if (twiMLResponse instanceof LastTwilioResponse) {\n workflowSessionCache.invalidate(id);\n } else {\n workflowSessionCache.put(id, pygen);\n }\n\n // send back the Twilio response..\n resp.addCookie(new Cookie(\"uuid\", id));\n resp.getWriter().write(twiMLResponse.toXML());\n } catch (Exception ex) {\n throw new ServletException(ex);\n }\n }",
"@Override\n public void callUsers(String userPhone) {\n }",
"public Call invite(String url);",
"@Override\n\tprotected VoiceMessage convert(Map<String, String> requestMap)\n\t\t\tthrows Exception {\n\t\tVoiceMessage voiceMessage = new VoiceMessage();\n\t\tvoiceMessage\n\t\t\t\t.setCreateTime(Long.parseLong(requestMap.get(\"CreateTime\")));\n\t\tvoiceMessage.setFormat(requestMap.get(\"Format\"));\n\t\tvoiceMessage.setFromUserName(requestMap.get(\"FromUserName\"));\n\t\tvoiceMessage.setMediaId(requestMap.get(\"MediaId\"));\n\t\tvoiceMessage.setMsgId(Long.parseLong(requestMap.get(\"MsgId\")));\n\t\tvoiceMessage.setMsgType(requestMap.get(\"MsgType\"));\n\t\tvoiceMessage.setToUserName(requestMap.get(\"ToUserName\"));\n\t\tvoiceMessage.setRecognition(requestMap.get(\"Recognition\"));\n\t\treturn voiceMessage;\n\t}",
"public interface InsertRandomNumberServiceRetrofit {\n\n @POST(\"bubblesortingnumber/\")\n @Headers({\"Accept: application/json\",\"Content-Type: application/json\"})\n Call<ResultResponse> addNumber (@Body NumberPojo numberPojo);\n}",
"messages.Facademessages.Subscribe getSubscribe();",
"public void sendRRequests() {\n\n }",
"public interface ChatService {\n public Object requestRongToken(Member member) throws Exception;\n}",
"public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String message = \"Hello. It's me.\";\n\n // Create a TwiML response and add our friendly message.\n Say say = new Say.Builder(message).build();\n\n // Play an MP3 for incoming callers.\n Play play = new Play.Builder(\"http://howtodocs.s3.amazonaws.com/ahoyhoy.mp3\").build();\n\n Say sayInGather = new Say.Builder(\"To speak to a real person, press 1. \"\n + \"Press 2 to record a message for a Twilio educator. \"\n + \"Press any other key to start over.\").build();\n\n Gather gather = new Gather.Builder()\n .action(\"/handle-gather\")\n .numDigits(1)\n .method(Method.POST)\n .say(sayInGather)\n .build();\n\n VoiceResponse twiml = new VoiceResponse.Builder()\n .say(say)\n .play(play)\n .gather(gather)\n .build();\n\n response.setContentType(\"application/xml\");\n try {\n response.getWriter().print(twiml.toXml());\n } catch (TwiMLException e) {\n e.printStackTrace();\n }\n }",
"netty.framework.messages.TestMessage.TestRequest getRequest();",
"public interface LoginClient {\n @POST(\"login\")\n Call<FlashMessage> loginAccount(@Body User user);\n //public void getFeed(@Body User user, Callback<User> response);\n}",
"public interface SendNotificationService {\n @FormUrlEncoded\n @POST(\"sendNotification3.php\")\n Call<SendNotificationApiResponse> sendNotification(@Field(\"to\") String to, @Field(\"message\") String message,\n @Field(\"title\") String title, @Field(\"time\") String time,\n @Field(\"sender\") String sender);\n}",
"public String getSenderPhoneNumber();",
"public interface API {\n @GET(\"api/v1.5/tr.json/translate\")\n Call<Resp> Translate(@QueryMap Map<String, String> parameters);\n\n}",
"public java.lang.String sendSMS(java.lang.String accessCode, java.lang.String toNumber, java.lang.String body) throws java.rmi.RemoteException;",
"public interface RokyInfoService {\n\n @FormUrlEncoded\n @POST(\"SpiritServiceApp/v1/send/singleEbike\")\n Call<ResponseBody> singleEbike(@Field(\"ueSn\") String ueSn, @Field(\"data\") String data);\n\n @GET(\"SpiritServiceApp/v1/devices\")\n Call<DevicesMsg> devices(@Query(\"ue_sn_array\") String ueSnArray);\n\n\n @GET(\"SpiritServiceApp/stock/ccus\")\n Call<DevicesMsg> ccus(@Query(\"maxId\") String maxId);\n\n}",
"public interface GetOrderDetails {\n @FormUrlEncoded\n @POST(\"/getorderdetails\")\n Call<List<OrderCustomerDetails>> getOrderDetails(\n @Field(\"OrderId\") String OrderId\n\n );\n @FormUrlEncoded\n @POST(\"/canceluser\")\n Call<Updatepending> canceluser(\n @Field(\"OrderId\") String OrderId\n\n );\n\n\n}",
"public interface APICallbacks\r\n{\r\n\r\n /**\r\n * <p>This is the copyright notice for this class </p>\r\n *\r\n * @copyright<br><p><B>Patsystems UK Limited 2000-2007</b></p>\r\n */\r\n public static final String COPYRIGHT = \"Copyright (c) Patsystems UK Limited 2000-2007\";\r\n\r\n /**\r\n * Host Link Status Change message ID.\r\n */\r\n public static final int MID_HOST_LINK_CHANGE = 1;\r\n\r\n /**\r\n * Price Link Status Change message ID.\r\n */\r\n public static final int MID_PRICE_LINK_CHANGE = 2;\r\n\r\n /**\r\n * Logon Status message ID.\r\n */\r\n public static final int MID_LOGON_STATUS = 3;\r\n\r\n /**\r\n * User Message message ID.\r\n */\r\n public final static int MID_MESSAGE = 4;\r\n\r\n /**\r\n * Order message ID.\r\n */\r\n public static final int MID_ORDER = 5;\r\n\r\n /**\r\n * End of Day message ID.\r\n */\r\n public static final int MID_FORCED_LOGOUT = 6;\r\n\r\n /**\r\n * Download Complete message ID.\r\n */\r\n public static final int MID_DOWNLOAD_COMPLETE = 7;\r\n\r\n /**\r\n * Price Change message ID.\r\n */\r\n public static final int MID_PRICE = 8;\r\n\r\n /**\r\n * Fill message ID.\r\n */\r\n public static final int MID_FILL = 9;\r\n\r\n /**\r\n * Status Update message ID.\r\n */\r\n public static final int MID_STATUS = 10;\r\n\r\n /**\r\n * Contract Added message ID.\r\n */\r\n public static final int MID_CONTRACT_ADDED = 11;\r\n\r\n /**\r\n * Contract Deleted message ID.\r\n */\r\n public static final int MID_CONTRACT_DELETED = 12;\r\n\r\n /**\r\n * Exchange Rate Updated message ID.\r\n */\r\n public static final int MID_EXCHANGE_RATE = 13;\r\n\r\n /**\r\n * Connectivity Status Update message ID.\r\n */\r\n public static final int MID_CONNECTIVITY_STATUS = 14;\r\n\r\n /**\r\n * Order Cancellation Timeout message ID.\r\n */\r\n public static final int MID_ORDER_CANCEL_FAILURE_ID = 15;\r\n\r\n /**\r\n * At Best message ID.\r\n */\r\n public static final int MID_AT_BEST_ID = 16;\r\n\r\n /**\r\n * Memory warning message ID.\r\n */\r\n public static final int MID_MEMORY_WARNING = 18;\r\n\r\n /**\r\n * Subscriber Depth message ID.\r\n */\r\n public static final int MID_SUBSCRIBER_DEPTH = 19;\r\n\r\n /**\r\n * DOM update message ID.\r\n */\r\n public static final int MID_DOM_UPDATE = 21;\r\n\r\n /**\r\n * Settlement Price message ID.\r\n */\r\n public static final int MID_SETTLEMENT_PRICE = 22;\r\n\r\n /**\r\n * Strategy creation successfullyReceived ID.\r\n */\r\n public static final int MID_STRATEGY_CREATION_RECEIVED = 23;\r\n\r\n /**\r\n * Strategy creation failure ID.\r\n */\r\n public static final int MID_STRATEGY_CREATION_FAILURE = 24;\r\n\r\n /**\r\n * Generic Price message ID.\r\n */\r\n public static final int MID_GENERIC_PRICE = 26;\r\n\r\n /**\r\n * Price blank message ID\r\n */\r\n public static final int MID_BLANK_PRICE = 27;\r\n\r\n /**\r\n * Order Queued Timeout ID.\r\n */\r\n public static final int MID_ORDER_QUEUED_TIMEOUT = 28;\r\n\r\n /**\r\n * Order Sent Timeout ID.\r\n */\r\n public static final int MID_ORDER_SENT_TIMEOUT = 29;\r\n\r\n /**\r\n * Order Book reset ID.\r\n */\r\n public static final int MID_RESET_ORDERBOOK = 30;\r\n\r\n /**\r\n * Exception/Error ID (Internal).\r\n */\r\n public static final int MID_ERROR = -1;\r\n\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQ = 100;\r\n\r\n /**\r\n * LOW Price Alert.\r\n */\r\n public static final int MID_LOWPRICE = 101;\r\n\r\n /**\r\n * HIGH Price Alert.\r\n */\r\n public static final int MID_HIGHPRICE = 102;\r\n\r\n\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQI_BID = 103;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQI_OFFER = 104;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQI_2_SIDES = 105;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_BID = 106;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_OFFER = 107;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_2_SIDES = 108;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_CROSS = 109;\r\n\r\n /**\r\n * Strategy creation strategy created event id.\r\n */\r\n public static final int MID_STRATEGY_CREATION_CREATED = 200;\r\n\r\n /**\r\n * Event ID to update order history\r\n */\r\n public static final int MID_UPDATE_ORDERHISTORY = 1000;\r\n\r\n\r\n}",
"protected void TextHttp() {\n\t\tLoginBean loginb = new LoginBean();\n\t\tloginb.setPhone(\"15236290644\");\n\t\tActivityDataRequest.getLoginCheck(TagConfig.TAG_MSG,this, loginb);\n\t\t\n\t\tLoginBean loginb2 = new LoginBean();\n\t\tloginb2.setPhone(\"15631001601\");\n\t\tActivityDataRequest.getLoginCheck(2,this, loginb2);\n\t\t\n\t}",
"@Override\n public String sendSms(String phone, String smsContext) {\n String extno = \"\";\n StringBuilder param = new StringBuilder();\n param.append(\"&account=\" + account);\n param.append(\"&pswd=\" + password);\n param.append(\"&mobile=\" + phone);\n try {\n param.append(\"&msg=\" + URLEncoder.encode(smsContext, \"utf-8\"));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n return \"\";\n }\n param.append(\"&needstatus=\" + false);\n param.append(\"&extno=\" + extno);\n\n try {\n return SmsUtil.sendSms(url, param.toString());\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }",
"public interface SmsClient {\n\n\t/**\n\t * Delivers a text-sms-request to the websms-api.\n\t * \n\t * @param textMessage\n\t * A derived message-object which holds every possible parameters\n\t * needed for sending an text-sms.\n\t * @param maxSmsPerMessage\n\t * Defines an upper-limit of how many messages should be sent.\n\t * @param test\n\t * True if the use of the function is for testing-purposes, and\n\t * no real-sms should be send.\n\t * @return The status-code for successful requests.\n\t * @throws ApiException\n\t * Returns an exception with a status-code, that was thrown at\n\t * api-level.\n\t * @throws ParameterValidationException\n\t * The parameters which where provided are invalid. No request\n\t * was made to the server.\n\t * @throws AuthorizationFailedException\n\t * Is thrown when the authorization by username/password failed.\n\t * @throws HttpConnectionException\n\t * Is thrown when a problem occurs while connecting to the api.\n\t */\n\tpublic int send(TextMessage textMessage, int maxSmsPerMessage, boolean test)\n\t\t\tthrows ApiException, ParameterValidationException,\n\t\t\tAuthorizationFailedException, HttpConnectionException;\n\n\t/**\n\t * Delivers a sms-request with binary-content to the websms-api.\n\t * \n\t * @param binaryMessage\n\t * A derived message-object which holds every possible parameters\n\t * needed for sending an binary-sms.\n\t * @param test\n\t * True if the use of the function is for testing-purposes, and\n\t * no real-sms should be send.\n\t * \n\t * @return The status-code for successful requests.\n\t * @throws ApiException\n\t * Returns an exception with a status-code, that was thrown at\n\t * api-level.\n\t * @throws ParameterValidationException\n\t * The parameters which where provided are invalid. No request\n\t * was made to the server.\n\t * @throws AuthorizationFailedException\n\t * Is thrown when the authorization by username/passsword\n\t * failed.\n\t * @throws HttpConnectionException\n\t * Is thrown when connection is refused or a timeout occured.\n\t */\n\tpublic int send(BinaryMessage binaryMessage, boolean test)\n\t\t\tthrows ApiException, ParameterValidationException,\n\t\t\tAuthorizationFailedException, HttpConnectionException;\n\n}",
"Optional<PhoneCall> push(CreatePhoneCallRequest request);",
"public interface HttpApi {\n /**\n * 登录时获取验证码.\n *\n * @param phone 手机号\n * @return {\"code\":0}\n */\n @FormUrlEncoded\n @POST(ProtocolHttp.URL_LOGIN_CODE)\n Flowable<BaseHttpResult> loginCode(@Field(\"phone\") String phone);\n}",
"public void usersUserIdMessagesUnreadGet (String userId, final Response.Listener<InlineResponse2001> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesUnreadGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesUnreadGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/unread\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2001) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2001.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"protected String getRequestMessage() {\n NbaTXRequestVO nbaTXRequest = new NbaTXRequestVO();\n nbaTXRequest.setTransType(NbaOliConstants.TC_TYPE_MIBFOLLOWUP);\n nbaTXRequest.setTransMode(NbaOliConstants.TC_MODE_ORIGINAL);\n nbaTXRequest.setBusinessProcess(NbaUtils.getBusinessProcessId(getUser()));\n //create txlife with default request fields\n NbaTXLife nbaTXLife = new NbaTXLife(nbaTXRequest);\n TXLife tXLife = nbaTXLife.getTXLife();\n UserAuthRequestAndTXLifeRequest userAuthRequestAndTXLifeRequest = tXLife.getUserAuthRequestAndTXLifeRequest();\n userAuthRequestAndTXLifeRequest.deleteUserAuthRequest();\n TXLifeRequest tXLifeRequest = userAuthRequestAndTXLifeRequest.getTXLifeRequestAt(0);\n \tnbaTXLife.getTXLife().setVersion(NbaOliConstants.OLIFE_VERSION_39_02); \n \tOLifE olife = nbaTXLife.getTXLife().getUserAuthRequestAndTXLifeRequest().getTXLifeRequestAt(0).getOLifE();\n \tolife.setVersion(NbaOliConstants.OLIFE_VERSION_39_02); \n\n tXLifeRequest.setPrimaryObjectID(CARRIER_PARTY_1);\n tXLifeRequest.setMaxRecords(getMibFollowUpMaxRecords());\n tXLifeRequest.setStartRecord(getStartRecord().intValue());\n tXLifeRequest.setStartDate(NbaUtils.addDaysToDate(getStartDate(),-1));\n tXLifeRequest.setEndDate(NbaUtils.addDaysToDate(getEndDate(),-1));\n tXLifeRequest.setTestIndicator(getTestIndicator());\n MIBRequest mIBRequest = new MIBRequest();\n tXLifeRequest.setMIBRequest(mIBRequest);\n MIBServiceDescriptor mIBServiceDescriptor = new MIBServiceDescriptor();\n MIBServiceDescriptorOrMIBServiceConfigurationID mIBServiceDescriptorOrMIBServiceConfigurationID = new MIBServiceDescriptorOrMIBServiceConfigurationID();\n mIBServiceDescriptorOrMIBServiceConfigurationID.addMIBServiceDescriptor(mIBServiceDescriptor);\n mIBRequest.setMIBServiceDescriptorOrMIBServiceConfigurationID(mIBServiceDescriptorOrMIBServiceConfigurationID);\n mIBServiceDescriptor.setMIBService(NbaOliConstants.TC_MIBSERVICE_CHECKING);\n OLifE oLifE = tXLifeRequest.getOLifE();\n Party party = new Party();\n oLifE.addParty(party);\n party.setId(CARRIER_PARTY_1);\n party.setPartyTypeCode(NbaOliConstants.OLIX_PARTYTYPE_CORPORATION);\n party.setPersonOrOrganization(new PersonOrOrganization());\n party.getPersonOrOrganization().setOrganization(new Organization());\n Carrier carrier = new Carrier();\n party.setCarrier(carrier);\n carrier.setCarrierCode(getCurrentCarrierCode());\n String responseMessage = nbaTXLife.toXmlString();\n if (getLogger().isDebugEnabled()) {\n getLogger().logDebug(\"TxLife 404 Request Message:\\n \" + responseMessage);\n }\n return responseMessage;\n }",
"AddFriendFromOther.Rsp getAddFriendFromOtherRsp();",
"public interface Api {\n\n @GET(\"index\")\n Call<String> getSimple();\n\n @GET(\"getxml\")\n Call<String> getXml(@Query(\"code\") int code);\n\n @FormUrlEncoded\n @POST(\"postme\")\n Call<String> postSimple(@Field(\"from\") String foo);\n\n @Headers({\"Content-Type: application/xml\", \"Accept: application/json\"})\n @POST(\"postxml\")\n Call<String> postXml(@Body RequestBody aRequestBody);\n\n\n}",
"public void usersUserIdMessagesDeliveredGet (String userId, final Response.Listener<InlineResponse2002> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesDeliveredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesDeliveredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/delivered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2002) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2002.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"Single<WebClientServiceRequest> whenSent();",
"Single<WebClientServiceRequest> whenSent();",
"com.exacttarget.wsdl.partnerapi.QueryRequestMsgDocument.QueryRequestMsg getQueryRequestMsg();",
"public void usersUserIdCallsNonansweredGet (String userId, final Response.Listener<InlineResponse2005> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdCallsNonansweredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdCallsNonansweredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/calls/nonanswered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2005) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2005.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public String getResponseMessage();",
"public abstract void retrain(Call serviceCall, Response serviceResponse, CallContext messageContext);",
"public interface WsResponse {\n /**\n * Sends textual content to the client.\n * @param content The text to send.\n */\n void sendText(String content);\n\n /**\n * Sends the given object serialized as JSON to the client.\n * @param data The object to send as JSON.\n */\n void sendJson(Object data);\n\n /**\n * Sends binary data to the client.\n * @param data A byte array containing the data to send.\n */\n default void sendBinary(byte[] data) {\n ByteBuffer buffer = ByteBuffer.wrap(data);\n sendBinary(buffer);\n }\n\n /**\n * Sends binary data to the client.\n * @param data A byte array containing the data to send.\n * @param offset An offset into the array at the start of the data to send.\n * @param length The number of bytes from the starting offset to send.\n */\n default void sendBinary(byte[] data, int offset, int length) {\n ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);\n sendBinary(buffer);\n }\n\n /**\n * Send binary data to the client.\n * @param buffer A {@link ByteBuffer} wrapping the data to send.\n */\n void sendBinary(ByteBuffer buffer);\n}",
"public void onRecieve(RoundTimeMessage message) {\n\n\n }",
"public abstract EOutgoingSMSAcceptionStatus rawSendMessage(OutgoingSMSDto smsOut) throws IOException;",
"java.lang.String getResponse();",
"public interface SendSmsService {\n public String sendSms(String phoneNum);\n public boolean checkSmsCode(String phoneNum, String smsCode);\n}",
"public interface WelcomeScreenRequestApi {\n\n @GET(Urls.REQUEST_Welcome_SCREEN)\n Call<WelcomeScreenData> getWelcomeData();\n\n}",
"public void makeCall() {\n\n }",
"public interface RealTimeTransportApi {\n\n @GET(\"busstopinformation\")\n Call<PublicStopListResponse> listAllStops(@Query(\"operator\") String operator);\n\n @GET(\"realtimebusinformation\")\n Call<RealtimeRouteResponse> getRealtimeInfo(@Query(\"stopid\") String stopId);\n\n}",
"public interface ApiInterface {\n\n @GET(\"{bids}\")\n Call<BidBoardResult> getBidItems(@Path(\"bids\") String bids);\n\n}",
"@Test\n\tpublic void testTwilioAuthentication() throws LiquidoException {\n\t\tString email = null;\n\t\tString mobilephone;\n\t\tlong userAuthyId;\n\n\t\t//----- create new user\n\t\ttry {\n\t\t\tlong rand5digits = System.currentTimeMillis() & 10000;\n\t\t\temail = \"userFromTest\" + rand5digits + \"@liquido.vote\";\n\t\t\tmobilephone = \"+49111\" + rand5digits;\n\t\t\tString countryCode = \"49\";\n\t\t\tuserAuthyId = client.createTwilioUser(email, mobilephone, countryCode);\n\t\t\tlog.info(\"Created new twilio user[mobilephone=\" + mobilephone + \", authyId=\" + userAuthyId + \"]\");\n\t\t} catch (RestClientException e) {\n\t\t\tlog.error(\"Cannot create twilio user \"+email, e.toString());\n\t\t\tthrow e;\n\t\t}\n\n\t\t//----- send authentication request (via push or SMS)\n\t\ttry {\n\t\t\tlog.debug(\"Send SMS or push notification to mobilephone=\"+mobilephone);\n\t\t\tString res = client.sendSmsOrPushNotification(userAuthyId);\n\t\t\tlog.debug(\" => \"+res);\n\t\t\tif (res.contains(\"ignored\")) {\n\t\t\t\tlog.info(\"Sent push authentication request to userAuthyId=\" + userAuthyId + \" Response:\\n\" + res);\n\t\t\t} else {\n\t\t\t\tlog.info(\"Sent Sms to userAuthyId=\" + userAuthyId + \" Response:\\n\" + res);\n\t\t\t}\n\t\t} catch (LiquidoException e) {\n\t\t\tlog.error(\"Cannot send SMS to twilio userAuthIy=\"+userAuthyId, e);\n\t\t\tthrow e;\n\t\t}\n\n\t\t//----- validate user's token (this cannot be automated.)\n\t\t//String otp = <otp that user entered from his mobile phone> ;\n\t\t//client.verifyOneTimePassword(userAuthyId, otp);\n\n\t\t//----- remove user\n\t\ttry {\n\t\t\tString res = client.removeUser(userAuthyId);\n\t\t\tlog.info(\"Removed user userAuthyId=\" + userAuthyId + \" Respone:\\n\" + res);\n\t\t} catch (RestClientException e) {\n\t\t\tlog.error(\"Cannot remove userAuthIy=\"+userAuthyId, e);\n\t\t\tthrow e;\n\t\t}\n\t}",
"public void usersUserIdMessagesFavoriteGet (String userId, final Response.Listener<InlineResponse2004> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesFavoriteGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesFavoriteGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/favorite\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2004) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2004.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public interface HeshouyouApi {\n public String sendMsg(String msg);\n}",
"@Override\n\tpublic void onDial() {\n\t\t\n\t}",
"public interface RankClient {\n @POST(\"api/givefeedback\")\n @FormUrlEncoded\n Call<Response> giverank (@Field(\"reviewer\") String reviewer,\n @Field(\"reviewee\") String reviewee,\n @Field(\"rank\") int rank);\n}",
"public interface RetrofitService {\n @Headers(\"X-Mashape-Key: AuuyclCPjcmshv2iOPq190OpzLrMp1FJWwejsnJrdfwOUr4h44\")\n\n @FormUrlEncoded\n @POST(\"convert\")\n Call<ServerResponse> converterUnidade(@Field(\"from-type\") String from_type, //Unidade original\n @Field(\"from-value\") String from_value, //Valor\n @Field(\"to-type\") String to_type); //Unidade final\n}",
"@Override\n\tpublic JSONObject getTelMessageCode(HttpServletRequest request) {\n\t\t\n\t\tJSONObject obj = new JSONObject();\n\t\tString tel = request.getParameter(\"tel\");\n\n\t\t//判断参数是否为空以及数字型参数格式是否正确\n\t\tif(ConfigUtil.isNull(tel)){\n\t\t\tobj.put(\"resultCode\",\"0001\");\n\t\t\treturn obj;\n\t\t}\n\t\t//发送短信并保存到数据库\n\t\tMessageInfo msg = new MessageInfo();\n\t\tString code = NumUtil.getRandomTelCode(6);\n\t\ttry{\n\t\t\tString str = \"注册校验码 :\" + code + \"请及时完成注册。\";\n\t\t\tif(MessageUtil.sendMessage(tel, str)){\n\t\t\t\tmsg.setTel(tel);\n\t\t\t\tmsg.setData(str);\n\t\t\t\tmsg.setType(0);\n\t\t\t\tmsg.setState(0);//默认可用\n\t\t\t\tinsert(msg);\n\t\t\t\tlog.info(\"send \"+ code +\" to \" + tel + \"suc .\");\n\t\t\t}else{\n\t\t\t\tlog.error(\"send \"+ code +\" to \" + tel + \"error .\");\n\t\t\t\tobj.put(\"resultCode\", \"0002\");\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\tlog.error(\"insert essage error .\" + e.getMessage());\n\t\t}\n\t\tobj.put(\"msgCode\", code);\n\t\tobj.put(\"resultCode\",\"0000\");\n\t\treturn obj;\t\t\n\t}",
"private void sendTelemetry(HttpRecordable recordable) {\n }",
"@Override\n public void sendSms(String smsBody) {\n }",
"public void usersUserIdMessagesGet (String userId, final Response.Listener<Message> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((Message) ApiInvoker.deserialize(localVarResponse, \"\", Message.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public interface TwoversePublicApi {\n /**\n * Creates a new account.\n * \n * @param user\n * the user to create. Must have a hashed password set and must\n * NOT have an ID set. The ID will be set when returning from\n * this method.\n * @return the ID for new account\n * @throws ExistingUserException\n * if an account with this username already exists\n * @throws UnsetPasswordException\n * if the hashed password is not set\n */\n public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;\n\n /**\n * Add a new object to the universe.\n * \n * These functions modify galaxy, but over XML-RPC that doesn't really work.\n * So, we must explicitly return the new object\n * \n * @param body\n * the object to add. The ID must NOT be set, and will be set on\n * returning from this method.\n * @return the ID for the new object\n * @throws UnhandledCelestialBodyException\n */\n public CelestialBody add(CelestialBody body)\n throws UnhandledCelestialBodyException;\n\n /**\n * Updates an object in the universe with the one provided, overwriting any\n * previous values.\n * \n * @param body\n * the body to update. The ID must be set and it must be known by\n * the server.\n * @return the updated object\n */\n public CelestialBody update(CelestialBody body);\n\n /**\n * Add a new link to the universe.\n * \n * @param link\n * the object to add. The ID must NOT be set, and will be set on\n * returning from this method.\n * @return the ID for the new object\n * @throws UnhandledCelestialBodyException\n */\n public Link add(Link link);\n}",
"public interface IMailboxUsageMailboxCountsRequest extends IHttpRequest {\n\n /**\n * Gets the MailboxUsageMailboxCounts from the service\n *\n * @param callback the callback to be called after success or failure\n */\n void get(final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Gets the MailboxUsageMailboxCounts from the service\n *\n * @return the MailboxUsageMailboxCounts from the request\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts get() throws ClientException;\n\n /**\n * Delete this item from the service\n *\n * @param callback the callback when the deletion action has completed\n */\n void delete(final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Delete this item from the service\n *\n * @throws ClientException if there was an exception during the delete operation\n */\n void delete() throws ClientException;\n\n /**\n * Patches this MailboxUsageMailboxCounts with a source\n *\n * @param sourceMailboxUsageMailboxCounts the source object with updates\n * @param callback the callback to be called after success or failure\n */\n void patch(final MailboxUsageMailboxCounts sourceMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Patches this MailboxUsageMailboxCounts with a source\n *\n * @param sourceMailboxUsageMailboxCounts the source object with updates\n * @return the updated MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts patch(final MailboxUsageMailboxCounts sourceMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the new object to create\n * @param callback the callback to be called after success or failure\n */\n void post(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the new object to create\n * @return the created MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts post(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the object to create/update\n * @param callback the callback to be called after success or failure\n */\n void put(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the object to create/update\n * @return the created MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts put(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Sets the select clause for the request\n *\n * @param value the select clause\n * @return the updated request\n */\n IMailboxUsageMailboxCountsRequest select(final String value);\n\n /**\n * Sets the expand clause for the request\n *\n * @param value the expand clause\n * @return the updated request\n */\n IMailboxUsageMailboxCountsRequest expand(final String value);\n\n}",
"public static void recordCall(Context context, Intent intent) {\n\t\tContentValues values = new ContentValues();\n\t\tString number = intent.getStringExtra(\"Number\");\n\t\tvalues.put(RecordlistTable.TYPE, 2);\n\t\tvalues.put(RecordlistTable.SUBID, intent.getIntExtra(\"subid\", SubscriptionManager.getDefaultSmsSubId()));\n\t\tvalues.put(RecordlistTable.PHONE_NUMBER, number);\n\t\tvalues.put(RecordlistTable.TIME, System.currentTimeMillis());\n\t\tvalues.put(RecordlistTable.FORMAT, intent.getStringExtra(\"format\"));\n\t\tString cityName = getGeoDescription(context, number);\n\t\tif(!TextUtils.isEmpty(cityName)) {\n\t\t\tvalues.put(RecordlistTable.LOCATION, cityName);\n\t\t}\n\t\tif(context.getContentResolver().isSecreted(number)) {\n\t\t\tvalues.put(RecordlistTable.USER_MODE, 1);\n\t\t}\n\t\tUri uri= context.getContentResolver().insert(RECORDLIST_URI, values);\n\t\tlog(\"recordCall-Uri:\" + uri);\n\t\t//testRestoreItem(context, 2);\n\t}",
"public interface RestInterface {\n\n @GET(\"{currency}/\")\n Call<List<ResponseModel>> geCurrency(@Path(\"currency\") String currency);\n}",
"abstract void telephoneValidity();",
"R request();",
"public interface PokeApiService {\n\n @GET(\"qvqk-dtmf.json\")\n Call<ArrayList<ViasRespuesta>> obtenerListaPokemon();\n}",
"FriendList.Req getFriendlistReq();",
"public void sendToAdmin(String sessionid, Smsmodel sms, String vals) throws ProtocolException, MalformedURLException, IOException {\r\n String val = null;\r\n System.out.println(\"hello boy \" + vals);\r\n String sender = \"DND_BYPASSGetItDone\";\r\n URL url = new URL(\"http://www.smslive247.com/http/index.aspx?cmd=sendmsg&sessionid=\" + sessionid + \"&message=\" + sms.getVendorMessage() + \"&sender=\" + sender + \"&sendto=\" + vals + \"&msgtype=0\");\r\n //http://www.bulksmslive.com/tools/geturl/Sms.php?username=abc&password=xyz&sender=\"+sender+\"&message=\"+message+\"&flash=0&sendtime=2009-10- 18%2006:30&listname=friends&recipients=\"+recipient; \r\n //URL gims_url = new URL(\"http://smshub.lubredsms.com/hub/xmlsmsapi/send?user=loliks&pass=GJP8wRTs&sender=nairabox&message=Acct%3A5073177777%20Amt%3ANGN1%2C200.00%20CR%20Desc%3ATesting%20alert%20Avail%20Bal%3ANGN%3A1%2C342%2C158.36&mobile=08065711040&flash=0\");\r\n final String USER_AGENT = \"Mozilla/5.0\";\r\n\r\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\r\n con.setRequestMethod(\"GET\");\r\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\r\n int responseCode = con.getResponseCode();\r\n BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n String inputLine;\r\n StringBuffer response = new StringBuffer();\r\n // System.out.println(messageModel.getBody() + \" dude\");\r\n while ((inputLine = in.readLine()) != null) {\r\n response.append(inputLine);\r\n }\r\n in.close();\r\n String responseCod = response.toString();\r\n }",
"public void testSendSmsTest() {\n String from = \"14121234567\";\n String to = \"14121234567\";\n assertThat(messagingClient).isNotNull();\n\n SendMessageResponse messageResponse = messagingClient.sendSms(jwt, to, from, \"This is a test message\");\n assertThat(messageResponse).isNotNull();\n assertThat(messageResponse.getMessageUuid()).isNotBlank();\n }",
"private TwitterAPI(){\n\t\t\n\t}",
"public abstract String getResponse();"
] | [
"0.6824193",
"0.6453042",
"0.5881974",
"0.56454027",
"0.56110924",
"0.55884826",
"0.55197096",
"0.5432672",
"0.5419874",
"0.5326111",
"0.5314383",
"0.5292388",
"0.5290472",
"0.5275127",
"0.52657783",
"0.5223897",
"0.52218044",
"0.5213514",
"0.5208777",
"0.51834035",
"0.51803696",
"0.51747173",
"0.51472855",
"0.51444596",
"0.5129796",
"0.51193047",
"0.51036704",
"0.5102829",
"0.5063487",
"0.50626445",
"0.5055643",
"0.50454754",
"0.5027103",
"0.5020421",
"0.5020421",
"0.50169337",
"0.5014771",
"0.5000886",
"0.4999495",
"0.49929732",
"0.4991948",
"0.49771282",
"0.49765304",
"0.4974539",
"0.49703878",
"0.49623287",
"0.4958043",
"0.4951391",
"0.4950016",
"0.494383",
"0.49301243",
"0.49272048",
"0.49268335",
"0.49210632",
"0.49118453",
"0.4908224",
"0.49078804",
"0.48957697",
"0.4894373",
"0.48904085",
"0.48875096",
"0.48613644",
"0.4856936",
"0.4855384",
"0.4853267",
"0.4853267",
"0.48519874",
"0.48466647",
"0.48466152",
"0.48449725",
"0.48375976",
"0.48345003",
"0.48312208",
"0.48248985",
"0.4824755",
"0.48186147",
"0.4816165",
"0.48155984",
"0.48143232",
"0.48133817",
"0.48066986",
"0.48064527",
"0.47967306",
"0.4796306",
"0.47935855",
"0.478965",
"0.47866857",
"0.47866252",
"0.4786154",
"0.47857717",
"0.47855222",
"0.4784885",
"0.47801012",
"0.47742933",
"0.47679025",
"0.4767475",
"0.4765691",
"0.4763217",
"0.47619206",
"0.47594348",
"0.47586024"
] | 0.0 | -1 |
Wrapper method for Twilio API | protected void sendViaUnderlyingTransport(final String message){
log.debug("Message to send {}", message);
Message.creator(phoneReceiver, phoneSender, message)
.create();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface TwilioService {\n @GET(\"PhoneNumbers/{phoneNumber}?Type=carrier\")\n Call<TwilioLookupResponse> lookup(@Path(\"phoneNumber\") String phoneNumber);\n}",
"public interface TwilioService {\n String ACCOUNT_ID_TEST = \"ACCXXXX\";\n String ACCOUNT_TOKEN_TEST = \"ACXXX\";\n String FROM = \"XXXXX\";\n\n}",
"public TwilioWrapperLibraryBuilder twilio(String _sid, String _token)\n {\n this.twilio_account_sid = _sid;\n this.twilio_account_token = _token;\n return this;\n }",
"void requestSendSMSCode(Context context,String phone);",
"ChatRecord.Rsp getChatRecordRsp();",
"ChatRecord.Req getChatRecordReq();",
"public OtherResponse sendMT(String mobilenumber, String message, String shortcode, int carrierid, int campaignid, Date sendat, String msgfxn, int priority, String fteu, float tariff) throws PrepException, SQLException, JAXBException, SAXException, MalformedURLException, IOException{\n String response;\n\n if(canSendMT(mobilenumber)){\n //System.out.print(\"User with mobile number:\"+mobilenumber+\" exist!\");\n\n String mt_request_xml = createXml(mobilenumber, message, shortcode, carrierid, campaignid, sendat, msgfxn, priority, fteu, tariff);\n response = postMT(mt_request_xml);\n\n com.novartis.xmlbinding.mt_response.Response res = getResponse(response);\n\n\n\n List<String> statusmsg = getStatusmessage(response);\n\n return new OtherResponse(res.getStatus(), statusmsg);\n }\n else{//if user not registerd or opted-in send back message on how to register for GetOnTrack\n String registerMsg = \"Novartis Pharmaceuticals Corp: You have to register for the GetOnTrack BP Tracker to use the service. Didn't mean to? Call 877-577-7726 for more information\";\n String mt_request_xml = createXml(mobilenumber, registerMsg, shortcode, carrierid, campaignid, sendat, msgfxn, priority, fteu, tariff);\n response = postMT(mt_request_xml);\n com.novartis.xmlbinding.mt_response.Response res = getResponse(response);\n //com.novartis.xmlbinding.mt_response.Response res = getResponse(\"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\"?><response><mts><mt><mobilenumber>\"+mobilenumber+\"</mobilenumber></mt></mts><status>FAIL</status><statusmessage><exceptions><exception>User not opted in for SMS</exception></exceptions></statusmessage></response>\");\n\n\n //System.out.print(\"User with mobile number:\"+mobilenumber+\" does not exist!\");\n List<String> statusmsg = getStatusmessage(response);\n\n return new OtherResponse(res.getStatus(), statusmsg);\n }\n\n }",
"public interface APIService {\n\n @FormUrlEncoded\n @POST(\"receipts.php\")\n Call<Receipt> verifyParticipant(@Field(\"regID\") int regID, @Field(\"mobile\") String mobile);\n}",
"public void sendSms() {\n\n }",
"public interface OTP {\n @FormUrlEncoded\n @POST(\"/api/generate_otp\")\n public void generateOTP(\n @Field(\"new_user\") String bool,\n @Field(\"mobile_no\") String mobile,\n\n\n Callback<Response> callback);\n}",
"private CallResponse() {\n initFields();\n }",
"com.polytech.spik.protocol.SpikMessages.Sms getSms();",
"@GET\n @Path(\"{thingName}/{status}\")\n @Produces(MediaType.APPLICATION_JSON)\n public String recieveAlarm(@PathParam(\"thingName\") String thingName, \n @PathParam(\"status\") String status,@Context UriInfo info) {\n\n MultivaluedMap queryMap = info.getQueryParameters();\n Iterator itr = queryMap.keySet().iterator();\n HashMap<String, String> dataMap = new HashMap<>(); \n while(itr.hasNext()){\n Object key = itr.next();\n Object value = queryMap.getFirst(key);\n dataMap.put(key.toString(), value.toString());\n }\n ThingInfoMap thingInfoMap = new ThingInfoMap(thingName, new Timestamp(new Date().getTime()).toString(),status);\n thingInfoMap.setContent(dataMap);\n \n int alarmID = database.addAlarm(thingInfoMap);\n Dweet newDweet;\n if(alarmID != -1){\n thingInfoMap.setAlarmID(alarmID);\n newDweet = new Dweet(\"succeeded\", \"sending\", \"alarm\", thingInfoMap);\n newDweet.setTo(\"myMobileA\"); // it's not included in database\n String warningMsg = gson.toJson(newDweet);\n //send alarm to mobile use GCM\n sendToMobileByGCM(warningMsg);\n return warningMsg;\n } else {\n newDweet = new Dweet(\"failed\", \"alarm is failed to added\");\n return gson.toJson(newDweet);\n }\n\n }",
"public interface SlackService {\n\n // \"?token=\" + API_KEY + \"&channel=\" + BOTS_CHANNEL_ID + \"&as_user=true\" + \"&text=\" + messageText);\n\n @POST(\"chat.postMessage\")\n Call<SendMessageResponse> sendMessage(@Query(\"token\") String token, @Query(\"channel\") String channel, @Query(\"as_user\") String asUser, @Query(\"text\") String messageText);\n}",
"com.ubtrobot.phone.PhoneCall.ResponseType getResponseType();",
"@GET(\"numbervalidation\")\n Call<ResponseBody> numbervalidation(@Query(\"mobile_number\") String mobile_number, @Query(\"country_code\") String country_code, @Query(\"user_type\") String user_type, @Query(\"language\") String language, @Query(\"forgotpassword\") String forgotpassword);",
"private SpeechletResponse bankTelephoneNumberResponse(){\n\n Place place = getPlaceWithTelephoneNumber();\n\n if (place == null) {\n log.error(\"No place was found! Your address: \" + deviceAddress.toString());\n return getAskResponse(BANK_CONTACT_CARD, ERROR_TEXT);\n }\n\n return doBankTelephoneNumberResponse(place);\n }",
"public interface RequestOtpVerify {\n\n @FormUrlEncoded\n @POST(Urls.REQUEST_VERIFY)\n Call<OtpData> getJson(@Field(\"otp\") String otp, @Field(\"number\") String mobile, @Field(\"token\") String access_token);\n\n}",
"messages.Clienthello.ClientHello getClientHello();",
"public TwilioWrapperLibrary buildLibrary()\n {\n return new TwilioWrapperLibrary( this.twilio_account_sid, this.twilio_account_token, this.thinQ_id, this.thinQ_token);\n }",
"public interface TransferRestClient {\n\n @GET(\"GenerateToken\")\n Observable<String> generateToken(@Query(\"email\") String email,\n @Query(\"nome\") String name);\n\n @POST(\"SendMoney\")\n @FormUrlEncoded\n Observable<String> sendMoney(@Field(\"ClienteId\") int contactId,\n @Field(\"token\") String token,\n @Field(\"valor\") Double value);\n\n @GET(\"GetTransfers\")\n Observable<Response<List<TransferResponse>>> getTransfers(@Query(\"token\") String token);\n}",
"SendSMSResponse sendSMSProcess(SendSMSRequest smsRequest) throws Exception;",
"FriendList.Rsp getFriendlistRes();",
"public void resendOTP() {\n ApiInterface apiInterface = RestClient.getApiInterface();\n apiInterface.userResendOTP(\"bearer\" + \" \" + CommonData.getAccessToken())\n .enqueue(new ResponseResolver<CommonResponse>(OtpActivity.this, true, true) {\n @Override\n public void success(final CommonResponse commonResponse) {\n Log.d(\"debug\", commonResponse.getMessage());\n Toast.makeText(OtpActivity.this, \"New OTP Sent\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void failure(final APIError error) {\n Log.d(\"debug\", error.getMessage());\n\n }\n });\n\n\n }",
"public interface ShortUrlApi {\n\n @POST(\"shorturl\")\n @Converter(ShortUrlConverter.class)\n Call<String> shortUrl(@Body String longUrl,@Query(\"access_token\")String accessToken);\n\n class ShortUrlConverter extends JacksonConverter<String,String> {\n @Override\n public byte[] request(ObjectMapper mapper, Type type, String longUrl) throws IOException {\n return String.format(\"{\\\"action\\\":\\\"long2short\\\",\\\"long_url”:”%s”}\",longUrl).getBytes(CHARSET_UTF8);\n }\n\n @Override\n public String response(ObjectMapper mapper, Type type, byte[] response) throws IOException {\n JsonNode jsonNode = mapper.readTree(response);\n return jsonNode.path(\"short_url\").asText();\n }\n }\n}",
"ISerializer invoke(String responseReceiverId);",
"public interface LKSmsService {\n\n /**\n * 发送 短信\n * @param sms\n *\n * @return\n */\n Result sendSms(SmsRequest sms) throws IOException;\n\n\n\n}",
"public interface ChannelREST {\n public static final String ENDPOINT = \"http://92.222.72.89:8080/\";\n\n @GET(\"/club/{idClub}/channels/{idChannel}/messages\")\n Call<List<Message>> getAllMessageFromChannel(@Path(\"idClub\") Integer id, @Path(\"idChannel\") Integer idChannel);\n @GET(\"/club/{idClub}/channels\")\n Call<List<Channel>> getAllChannelFromClub(@Path(\"idClub\") Integer id);\n @FormUrlEncoded\n @POST(\"/club/{idClub}/channels/{idChannel}/postMessage\")\n Call<Message> postMessage(@Path(\"idClub\") Integer id, @Path(\"idChannel\") Integer idChannel, @Field(\"idUser\") Integer idUser, @Field(\"content\")String content);\n}",
"public void usersUserIdCallsAnsweredGet (String userId, final Response.Listener<InlineResponse2006> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdCallsAnsweredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdCallsAnsweredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/calls/answered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2006) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2006.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public void usersUserIdInviteToWhatsAppPost (String userId, List<Body2> body, final Response.Listener<InlineResponse2009> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdInviteToWhatsAppPost\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdInviteToWhatsAppPost\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/invite_to_WhatsApp\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"POST\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2009) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2009.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public Builder(final String twilioAccount,\n final String twilioAuthToken,\n PhoneNumber twilioPhoneNumber) {\n this.twilioAccount = twilioAccount;\n this.twilioAuthToken = twilioAuthToken;\n this.twilioPhoneNumber = twilioPhoneNumber;\n }",
"public interface RTSPConstants\n{\n // 1xx: Informational - Request received, continuing process\n public static final int RTSP_CONTINUE =100;\n \n // 2xx: Success - The action was successfully received, understood, and accepted\n public static final int RTSP_OK =200;\n public static final int RTSP_CREATED =201;\n public static final int RTSP_LOW_ON_STORAGE_SPACE =250;\n \n // 3xx: Redirection - Further action must be taken in order to complete the request\n public static final int RTSP_MULTIPLE_CHOICES =300;\n public static final int RTSP_MOVED_PERMANENTLY =301;\n public static final int RTSP_MOVED_TEMPORARILY =302;\n public static final int RTSP_SEE_OTHER =303;\n public static final int RTSP_NOT_MODIFIED =304;\n public static final int RTSP_USE_PROXY =305;\n \n // 4xx: Client Error - The request contains bad syntax or cannot be fulfilled\n public static final int RTSP_BAD_REQUEST =400;\n public static final int RTSP_UNAUTHORIZED =401;\n public static final int RTSP_PAYMENT_REQUIRED =402;\n public static final int RTSP_FORBIDDEN =403;\n public static final int RTSP_NOT_FOUND =404;\n public static final int RTSP_METHOD_NOT_ALLOWED =405;\n public static final int RTSP_NOT_ACCEPTABLE =406;\n public static final int RTSP_PROXY_AUTHENTICATION_REQUIRED =407;\n public static final int RTSP_REQUEST_TIME_OUT =408;\n public static final int RTSP_GONE =410;\n public static final int RTSP_LENGTH_REQUIRED =411;\n public static final int RTSP_PRECONDITION_FAILED =412;\n public static final int RTSP_REQUEST_ENTITY_TOO_LARGE =413;\n public static final int RTSP_REQUEST_URI_TOO_LARGE =414;\n public static final int RTSP_UNSUPPORTED_MEDIA_TYPE =415;\n public static final int RTSP_PARAMETER_NOT_UNDERSTOOD =451;\n public static final int RTSP_CONFERENCE_NOT_FOUND =452;\n public static final int RTSP_NOT_ENOUGH_BANDWIDTH =453;\n public static final int RTSP_SESSION_NOT_FOUND =454;\n public static final int RTSP_METHOD_NOT_VALID_IN_THIS_STATE =455;\n public static final int RTSP_HEADER_FIELD_NOT_VALID_FOR_RESOURCE =456;\n public static final int RTSP_INVALID_RANGE =457;\n public static final int RTSP_PARAMETER_IS_READ_ONLY =458;\n public static final int RTSP_AGGREGATE_OPERATION_NOT_ALLOWED =459;\n public static final int RTSP_ONLY_AGGREGATE_OPERATION_ALLOWED =460;\n public static final int RTSP_UNSUPPORTED_TRANSPORT =461;\n public static final int RTSP_DESTINATION_UNREACHABLE =462;\n \n // 5xx: Server Error - The server failed to fulfill an apparently valid request\n public static final int RTSP_INTERNAL_SERVER_ERROR =500;\n public static final int RTSP_NOT_IMPLEMENTED =501;\n public static final int RTSP_BAD_GATEWAY =502;\n public static final int RTSP_SERVICE_UNAVAILABLE =503;\n public static final int RTSP_GATEWAY_TIME_OUT =504;\n public static final int RTSP_RTSP_VERSION_NOT_SUPPORTED =505;\n public static final int RTSP_OPTION_NOT_SUPPORTED =551;\n\n\n\n public static final String tantau_sccsid = \"@(#)$Id: RTSPConstants.java,v 1.1 2009/02/06 14:24:14 rsoder Exp $\";\n}",
"public void usersUserIdCheckContactsUseWhatsAppPost (String userId, String returnUserInfo, List<Body1> body, final Response.Listener<InlineResponse2008> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = body;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdCheckContactsUseWhatsAppPost\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdCheckContactsUseWhatsAppPost\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/check_contacts_use_whatsApp\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n queryParams.addAll(ApiInvoker.parameterToPairs(\"\", \"returnUserInfo\", returnUserInfo));\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"POST\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2008) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2008.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"@Override\n public void phoneCalling() {\n Log.e(\"test_TTS\", \"phoneCalling\");\n }",
"@Override\n public void phoneCalling() {\n Log.e(\"test_TTS\", \"phoneCalling\");\n }",
"ChatWithServer.Req getChatWithServerReq();",
"@Override\n protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n try {\n // attempt to find the existing session..\n TwiMLResponse twiMLResponse;\n String id = getWorkflowSessionId(req);\n PyObject twilioRequest = buildRequestTuple(req);\n PyGenerator pygen = workflowSessionCache.getIfPresent(id);\n if (null == pygen) {\n // load the workflow provided\n Invocable f = loadWorkflow(getWorkflowName(req));\n // create the python generator\n pygen = (PyGenerator) f.invokeFunction(\"execute\", twilioRequest);\n twiMLResponse = toTwiMLResponse(pygen.next());\n } else {\n // execute the next request..\n twiMLResponse = toTwiMLResponse(pygen.send(twilioRequest));\n }\n\n // determine if this is the last response..\n if (twiMLResponse instanceof LastTwilioResponse) {\n workflowSessionCache.invalidate(id);\n } else {\n workflowSessionCache.put(id, pygen);\n }\n\n // send back the Twilio response..\n resp.addCookie(new Cookie(\"uuid\", id));\n resp.getWriter().write(twiMLResponse.toXML());\n } catch (Exception ex) {\n throw new ServletException(ex);\n }\n }",
"@Override\n public void callUsers(String userPhone) {\n }",
"public Call invite(String url);",
"@Override\n\tprotected VoiceMessage convert(Map<String, String> requestMap)\n\t\t\tthrows Exception {\n\t\tVoiceMessage voiceMessage = new VoiceMessage();\n\t\tvoiceMessage\n\t\t\t\t.setCreateTime(Long.parseLong(requestMap.get(\"CreateTime\")));\n\t\tvoiceMessage.setFormat(requestMap.get(\"Format\"));\n\t\tvoiceMessage.setFromUserName(requestMap.get(\"FromUserName\"));\n\t\tvoiceMessage.setMediaId(requestMap.get(\"MediaId\"));\n\t\tvoiceMessage.setMsgId(Long.parseLong(requestMap.get(\"MsgId\")));\n\t\tvoiceMessage.setMsgType(requestMap.get(\"MsgType\"));\n\t\tvoiceMessage.setToUserName(requestMap.get(\"ToUserName\"));\n\t\tvoiceMessage.setRecognition(requestMap.get(\"Recognition\"));\n\t\treturn voiceMessage;\n\t}",
"public interface InsertRandomNumberServiceRetrofit {\n\n @POST(\"bubblesortingnumber/\")\n @Headers({\"Accept: application/json\",\"Content-Type: application/json\"})\n Call<ResultResponse> addNumber (@Body NumberPojo numberPojo);\n}",
"messages.Facademessages.Subscribe getSubscribe();",
"public void sendRRequests() {\n\n }",
"public interface ChatService {\n public Object requestRongToken(Member member) throws Exception;\n}",
"public void service(HttpServletRequest request, HttpServletResponse response) throws IOException {\n String message = \"Hello. It's me.\";\n\n // Create a TwiML response and add our friendly message.\n Say say = new Say.Builder(message).build();\n\n // Play an MP3 for incoming callers.\n Play play = new Play.Builder(\"http://howtodocs.s3.amazonaws.com/ahoyhoy.mp3\").build();\n\n Say sayInGather = new Say.Builder(\"To speak to a real person, press 1. \"\n + \"Press 2 to record a message for a Twilio educator. \"\n + \"Press any other key to start over.\").build();\n\n Gather gather = new Gather.Builder()\n .action(\"/handle-gather\")\n .numDigits(1)\n .method(Method.POST)\n .say(sayInGather)\n .build();\n\n VoiceResponse twiml = new VoiceResponse.Builder()\n .say(say)\n .play(play)\n .gather(gather)\n .build();\n\n response.setContentType(\"application/xml\");\n try {\n response.getWriter().print(twiml.toXml());\n } catch (TwiMLException e) {\n e.printStackTrace();\n }\n }",
"netty.framework.messages.TestMessage.TestRequest getRequest();",
"public interface LoginClient {\n @POST(\"login\")\n Call<FlashMessage> loginAccount(@Body User user);\n //public void getFeed(@Body User user, Callback<User> response);\n}",
"public interface SendNotificationService {\n @FormUrlEncoded\n @POST(\"sendNotification3.php\")\n Call<SendNotificationApiResponse> sendNotification(@Field(\"to\") String to, @Field(\"message\") String message,\n @Field(\"title\") String title, @Field(\"time\") String time,\n @Field(\"sender\") String sender);\n}",
"public String getSenderPhoneNumber();",
"public interface API {\n @GET(\"api/v1.5/tr.json/translate\")\n Call<Resp> Translate(@QueryMap Map<String, String> parameters);\n\n}",
"public java.lang.String sendSMS(java.lang.String accessCode, java.lang.String toNumber, java.lang.String body) throws java.rmi.RemoteException;",
"public interface RokyInfoService {\n\n @FormUrlEncoded\n @POST(\"SpiritServiceApp/v1/send/singleEbike\")\n Call<ResponseBody> singleEbike(@Field(\"ueSn\") String ueSn, @Field(\"data\") String data);\n\n @GET(\"SpiritServiceApp/v1/devices\")\n Call<DevicesMsg> devices(@Query(\"ue_sn_array\") String ueSnArray);\n\n\n @GET(\"SpiritServiceApp/stock/ccus\")\n Call<DevicesMsg> ccus(@Query(\"maxId\") String maxId);\n\n}",
"public interface GetOrderDetails {\n @FormUrlEncoded\n @POST(\"/getorderdetails\")\n Call<List<OrderCustomerDetails>> getOrderDetails(\n @Field(\"OrderId\") String OrderId\n\n );\n @FormUrlEncoded\n @POST(\"/canceluser\")\n Call<Updatepending> canceluser(\n @Field(\"OrderId\") String OrderId\n\n );\n\n\n}",
"public interface APICallbacks\r\n{\r\n\r\n /**\r\n * <p>This is the copyright notice for this class </p>\r\n *\r\n * @copyright<br><p><B>Patsystems UK Limited 2000-2007</b></p>\r\n */\r\n public static final String COPYRIGHT = \"Copyright (c) Patsystems UK Limited 2000-2007\";\r\n\r\n /**\r\n * Host Link Status Change message ID.\r\n */\r\n public static final int MID_HOST_LINK_CHANGE = 1;\r\n\r\n /**\r\n * Price Link Status Change message ID.\r\n */\r\n public static final int MID_PRICE_LINK_CHANGE = 2;\r\n\r\n /**\r\n * Logon Status message ID.\r\n */\r\n public static final int MID_LOGON_STATUS = 3;\r\n\r\n /**\r\n * User Message message ID.\r\n */\r\n public final static int MID_MESSAGE = 4;\r\n\r\n /**\r\n * Order message ID.\r\n */\r\n public static final int MID_ORDER = 5;\r\n\r\n /**\r\n * End of Day message ID.\r\n */\r\n public static final int MID_FORCED_LOGOUT = 6;\r\n\r\n /**\r\n * Download Complete message ID.\r\n */\r\n public static final int MID_DOWNLOAD_COMPLETE = 7;\r\n\r\n /**\r\n * Price Change message ID.\r\n */\r\n public static final int MID_PRICE = 8;\r\n\r\n /**\r\n * Fill message ID.\r\n */\r\n public static final int MID_FILL = 9;\r\n\r\n /**\r\n * Status Update message ID.\r\n */\r\n public static final int MID_STATUS = 10;\r\n\r\n /**\r\n * Contract Added message ID.\r\n */\r\n public static final int MID_CONTRACT_ADDED = 11;\r\n\r\n /**\r\n * Contract Deleted message ID.\r\n */\r\n public static final int MID_CONTRACT_DELETED = 12;\r\n\r\n /**\r\n * Exchange Rate Updated message ID.\r\n */\r\n public static final int MID_EXCHANGE_RATE = 13;\r\n\r\n /**\r\n * Connectivity Status Update message ID.\r\n */\r\n public static final int MID_CONNECTIVITY_STATUS = 14;\r\n\r\n /**\r\n * Order Cancellation Timeout message ID.\r\n */\r\n public static final int MID_ORDER_CANCEL_FAILURE_ID = 15;\r\n\r\n /**\r\n * At Best message ID.\r\n */\r\n public static final int MID_AT_BEST_ID = 16;\r\n\r\n /**\r\n * Memory warning message ID.\r\n */\r\n public static final int MID_MEMORY_WARNING = 18;\r\n\r\n /**\r\n * Subscriber Depth message ID.\r\n */\r\n public static final int MID_SUBSCRIBER_DEPTH = 19;\r\n\r\n /**\r\n * DOM update message ID.\r\n */\r\n public static final int MID_DOM_UPDATE = 21;\r\n\r\n /**\r\n * Settlement Price message ID.\r\n */\r\n public static final int MID_SETTLEMENT_PRICE = 22;\r\n\r\n /**\r\n * Strategy creation successfullyReceived ID.\r\n */\r\n public static final int MID_STRATEGY_CREATION_RECEIVED = 23;\r\n\r\n /**\r\n * Strategy creation failure ID.\r\n */\r\n public static final int MID_STRATEGY_CREATION_FAILURE = 24;\r\n\r\n /**\r\n * Generic Price message ID.\r\n */\r\n public static final int MID_GENERIC_PRICE = 26;\r\n\r\n /**\r\n * Price blank message ID\r\n */\r\n public static final int MID_BLANK_PRICE = 27;\r\n\r\n /**\r\n * Order Queued Timeout ID.\r\n */\r\n public static final int MID_ORDER_QUEUED_TIMEOUT = 28;\r\n\r\n /**\r\n * Order Sent Timeout ID.\r\n */\r\n public static final int MID_ORDER_SENT_TIMEOUT = 29;\r\n\r\n /**\r\n * Order Book reset ID.\r\n */\r\n public static final int MID_RESET_ORDERBOOK = 30;\r\n\r\n /**\r\n * Exception/Error ID (Internal).\r\n */\r\n public static final int MID_ERROR = -1;\r\n\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQ = 100;\r\n\r\n /**\r\n * LOW Price Alert.\r\n */\r\n public static final int MID_LOWPRICE = 101;\r\n\r\n /**\r\n * HIGH Price Alert.\r\n */\r\n public static final int MID_HIGHPRICE = 102;\r\n\r\n\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQI_BID = 103;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQI_OFFER = 104;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQI_2_SIDES = 105;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_BID = 106;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_OFFER = 107;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_2_SIDES = 108;\r\n /**\r\n * RFQ Change message ID.\r\n */\r\n public static final int MID_RFQT_CROSS = 109;\r\n\r\n /**\r\n * Strategy creation strategy created event id.\r\n */\r\n public static final int MID_STRATEGY_CREATION_CREATED = 200;\r\n\r\n /**\r\n * Event ID to update order history\r\n */\r\n public static final int MID_UPDATE_ORDERHISTORY = 1000;\r\n\r\n\r\n}",
"protected void TextHttp() {\n\t\tLoginBean loginb = new LoginBean();\n\t\tloginb.setPhone(\"15236290644\");\n\t\tActivityDataRequest.getLoginCheck(TagConfig.TAG_MSG,this, loginb);\n\t\t\n\t\tLoginBean loginb2 = new LoginBean();\n\t\tloginb2.setPhone(\"15631001601\");\n\t\tActivityDataRequest.getLoginCheck(2,this, loginb2);\n\t\t\n\t}",
"@Override\n public String sendSms(String phone, String smsContext) {\n String extno = \"\";\n StringBuilder param = new StringBuilder();\n param.append(\"&account=\" + account);\n param.append(\"&pswd=\" + password);\n param.append(\"&mobile=\" + phone);\n try {\n param.append(\"&msg=\" + URLEncoder.encode(smsContext, \"utf-8\"));\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n return \"\";\n }\n param.append(\"&needstatus=\" + false);\n param.append(\"&extno=\" + extno);\n\n try {\n return SmsUtil.sendSms(url, param.toString());\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }",
"public interface SmsClient {\n\n\t/**\n\t * Delivers a text-sms-request to the websms-api.\n\t * \n\t * @param textMessage\n\t * A derived message-object which holds every possible parameters\n\t * needed for sending an text-sms.\n\t * @param maxSmsPerMessage\n\t * Defines an upper-limit of how many messages should be sent.\n\t * @param test\n\t * True if the use of the function is for testing-purposes, and\n\t * no real-sms should be send.\n\t * @return The status-code for successful requests.\n\t * @throws ApiException\n\t * Returns an exception with a status-code, that was thrown at\n\t * api-level.\n\t * @throws ParameterValidationException\n\t * The parameters which where provided are invalid. No request\n\t * was made to the server.\n\t * @throws AuthorizationFailedException\n\t * Is thrown when the authorization by username/password failed.\n\t * @throws HttpConnectionException\n\t * Is thrown when a problem occurs while connecting to the api.\n\t */\n\tpublic int send(TextMessage textMessage, int maxSmsPerMessage, boolean test)\n\t\t\tthrows ApiException, ParameterValidationException,\n\t\t\tAuthorizationFailedException, HttpConnectionException;\n\n\t/**\n\t * Delivers a sms-request with binary-content to the websms-api.\n\t * \n\t * @param binaryMessage\n\t * A derived message-object which holds every possible parameters\n\t * needed for sending an binary-sms.\n\t * @param test\n\t * True if the use of the function is for testing-purposes, and\n\t * no real-sms should be send.\n\t * \n\t * @return The status-code for successful requests.\n\t * @throws ApiException\n\t * Returns an exception with a status-code, that was thrown at\n\t * api-level.\n\t * @throws ParameterValidationException\n\t * The parameters which where provided are invalid. No request\n\t * was made to the server.\n\t * @throws AuthorizationFailedException\n\t * Is thrown when the authorization by username/passsword\n\t * failed.\n\t * @throws HttpConnectionException\n\t * Is thrown when connection is refused or a timeout occured.\n\t */\n\tpublic int send(BinaryMessage binaryMessage, boolean test)\n\t\t\tthrows ApiException, ParameterValidationException,\n\t\t\tAuthorizationFailedException, HttpConnectionException;\n\n}",
"Optional<PhoneCall> push(CreatePhoneCallRequest request);",
"public interface HttpApi {\n /**\n * 登录时获取验证码.\n *\n * @param phone 手机号\n * @return {\"code\":0}\n */\n @FormUrlEncoded\n @POST(ProtocolHttp.URL_LOGIN_CODE)\n Flowable<BaseHttpResult> loginCode(@Field(\"phone\") String phone);\n}",
"public void usersUserIdMessagesUnreadGet (String userId, final Response.Listener<InlineResponse2001> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesUnreadGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesUnreadGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/unread\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2001) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2001.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"protected String getRequestMessage() {\n NbaTXRequestVO nbaTXRequest = new NbaTXRequestVO();\n nbaTXRequest.setTransType(NbaOliConstants.TC_TYPE_MIBFOLLOWUP);\n nbaTXRequest.setTransMode(NbaOliConstants.TC_MODE_ORIGINAL);\n nbaTXRequest.setBusinessProcess(NbaUtils.getBusinessProcessId(getUser()));\n //create txlife with default request fields\n NbaTXLife nbaTXLife = new NbaTXLife(nbaTXRequest);\n TXLife tXLife = nbaTXLife.getTXLife();\n UserAuthRequestAndTXLifeRequest userAuthRequestAndTXLifeRequest = tXLife.getUserAuthRequestAndTXLifeRequest();\n userAuthRequestAndTXLifeRequest.deleteUserAuthRequest();\n TXLifeRequest tXLifeRequest = userAuthRequestAndTXLifeRequest.getTXLifeRequestAt(0);\n \tnbaTXLife.getTXLife().setVersion(NbaOliConstants.OLIFE_VERSION_39_02); \n \tOLifE olife = nbaTXLife.getTXLife().getUserAuthRequestAndTXLifeRequest().getTXLifeRequestAt(0).getOLifE();\n \tolife.setVersion(NbaOliConstants.OLIFE_VERSION_39_02); \n\n tXLifeRequest.setPrimaryObjectID(CARRIER_PARTY_1);\n tXLifeRequest.setMaxRecords(getMibFollowUpMaxRecords());\n tXLifeRequest.setStartRecord(getStartRecord().intValue());\n tXLifeRequest.setStartDate(NbaUtils.addDaysToDate(getStartDate(),-1));\n tXLifeRequest.setEndDate(NbaUtils.addDaysToDate(getEndDate(),-1));\n tXLifeRequest.setTestIndicator(getTestIndicator());\n MIBRequest mIBRequest = new MIBRequest();\n tXLifeRequest.setMIBRequest(mIBRequest);\n MIBServiceDescriptor mIBServiceDescriptor = new MIBServiceDescriptor();\n MIBServiceDescriptorOrMIBServiceConfigurationID mIBServiceDescriptorOrMIBServiceConfigurationID = new MIBServiceDescriptorOrMIBServiceConfigurationID();\n mIBServiceDescriptorOrMIBServiceConfigurationID.addMIBServiceDescriptor(mIBServiceDescriptor);\n mIBRequest.setMIBServiceDescriptorOrMIBServiceConfigurationID(mIBServiceDescriptorOrMIBServiceConfigurationID);\n mIBServiceDescriptor.setMIBService(NbaOliConstants.TC_MIBSERVICE_CHECKING);\n OLifE oLifE = tXLifeRequest.getOLifE();\n Party party = new Party();\n oLifE.addParty(party);\n party.setId(CARRIER_PARTY_1);\n party.setPartyTypeCode(NbaOliConstants.OLIX_PARTYTYPE_CORPORATION);\n party.setPersonOrOrganization(new PersonOrOrganization());\n party.getPersonOrOrganization().setOrganization(new Organization());\n Carrier carrier = new Carrier();\n party.setCarrier(carrier);\n carrier.setCarrierCode(getCurrentCarrierCode());\n String responseMessage = nbaTXLife.toXmlString();\n if (getLogger().isDebugEnabled()) {\n getLogger().logDebug(\"TxLife 404 Request Message:\\n \" + responseMessage);\n }\n return responseMessage;\n }",
"AddFriendFromOther.Rsp getAddFriendFromOtherRsp();",
"public interface Api {\n\n @GET(\"index\")\n Call<String> getSimple();\n\n @GET(\"getxml\")\n Call<String> getXml(@Query(\"code\") int code);\n\n @FormUrlEncoded\n @POST(\"postme\")\n Call<String> postSimple(@Field(\"from\") String foo);\n\n @Headers({\"Content-Type: application/xml\", \"Accept: application/json\"})\n @POST(\"postxml\")\n Call<String> postXml(@Body RequestBody aRequestBody);\n\n\n}",
"public void usersUserIdMessagesDeliveredGet (String userId, final Response.Listener<InlineResponse2002> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesDeliveredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesDeliveredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/delivered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2002) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2002.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"Single<WebClientServiceRequest> whenSent();",
"Single<WebClientServiceRequest> whenSent();",
"com.exacttarget.wsdl.partnerapi.QueryRequestMsgDocument.QueryRequestMsg getQueryRequestMsg();",
"public void usersUserIdCallsNonansweredGet (String userId, final Response.Listener<InlineResponse2005> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdCallsNonansweredGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdCallsNonansweredGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/calls/nonanswered\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2005) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2005.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public String getResponseMessage();",
"public abstract void retrain(Call serviceCall, Response serviceResponse, CallContext messageContext);",
"public interface WsResponse {\n /**\n * Sends textual content to the client.\n * @param content The text to send.\n */\n void sendText(String content);\n\n /**\n * Sends the given object serialized as JSON to the client.\n * @param data The object to send as JSON.\n */\n void sendJson(Object data);\n\n /**\n * Sends binary data to the client.\n * @param data A byte array containing the data to send.\n */\n default void sendBinary(byte[] data) {\n ByteBuffer buffer = ByteBuffer.wrap(data);\n sendBinary(buffer);\n }\n\n /**\n * Sends binary data to the client.\n * @param data A byte array containing the data to send.\n * @param offset An offset into the array at the start of the data to send.\n * @param length The number of bytes from the starting offset to send.\n */\n default void sendBinary(byte[] data, int offset, int length) {\n ByteBuffer buffer = ByteBuffer.wrap(data, offset, length);\n sendBinary(buffer);\n }\n\n /**\n * Send binary data to the client.\n * @param buffer A {@link ByteBuffer} wrapping the data to send.\n */\n void sendBinary(ByteBuffer buffer);\n}",
"public void onRecieve(RoundTimeMessage message) {\n\n\n }",
"public abstract EOutgoingSMSAcceptionStatus rawSendMessage(OutgoingSMSDto smsOut) throws IOException;",
"java.lang.String getResponse();",
"public interface SendSmsService {\n public String sendSms(String phoneNum);\n public boolean checkSmsCode(String phoneNum, String smsCode);\n}",
"public interface WelcomeScreenRequestApi {\n\n @GET(Urls.REQUEST_Welcome_SCREEN)\n Call<WelcomeScreenData> getWelcomeData();\n\n}",
"public void makeCall() {\n\n }",
"public interface RealTimeTransportApi {\n\n @GET(\"busstopinformation\")\n Call<PublicStopListResponse> listAllStops(@Query(\"operator\") String operator);\n\n @GET(\"realtimebusinformation\")\n Call<RealtimeRouteResponse> getRealtimeInfo(@Query(\"stopid\") String stopId);\n\n}",
"public interface ApiInterface {\n\n @GET(\"{bids}\")\n Call<BidBoardResult> getBidItems(@Path(\"bids\") String bids);\n\n}",
"@Test\n\tpublic void testTwilioAuthentication() throws LiquidoException {\n\t\tString email = null;\n\t\tString mobilephone;\n\t\tlong userAuthyId;\n\n\t\t//----- create new user\n\t\ttry {\n\t\t\tlong rand5digits = System.currentTimeMillis() & 10000;\n\t\t\temail = \"userFromTest\" + rand5digits + \"@liquido.vote\";\n\t\t\tmobilephone = \"+49111\" + rand5digits;\n\t\t\tString countryCode = \"49\";\n\t\t\tuserAuthyId = client.createTwilioUser(email, mobilephone, countryCode);\n\t\t\tlog.info(\"Created new twilio user[mobilephone=\" + mobilephone + \", authyId=\" + userAuthyId + \"]\");\n\t\t} catch (RestClientException e) {\n\t\t\tlog.error(\"Cannot create twilio user \"+email, e.toString());\n\t\t\tthrow e;\n\t\t}\n\n\t\t//----- send authentication request (via push or SMS)\n\t\ttry {\n\t\t\tlog.debug(\"Send SMS or push notification to mobilephone=\"+mobilephone);\n\t\t\tString res = client.sendSmsOrPushNotification(userAuthyId);\n\t\t\tlog.debug(\" => \"+res);\n\t\t\tif (res.contains(\"ignored\")) {\n\t\t\t\tlog.info(\"Sent push authentication request to userAuthyId=\" + userAuthyId + \" Response:\\n\" + res);\n\t\t\t} else {\n\t\t\t\tlog.info(\"Sent Sms to userAuthyId=\" + userAuthyId + \" Response:\\n\" + res);\n\t\t\t}\n\t\t} catch (LiquidoException e) {\n\t\t\tlog.error(\"Cannot send SMS to twilio userAuthIy=\"+userAuthyId, e);\n\t\t\tthrow e;\n\t\t}\n\n\t\t//----- validate user's token (this cannot be automated.)\n\t\t//String otp = <otp that user entered from his mobile phone> ;\n\t\t//client.verifyOneTimePassword(userAuthyId, otp);\n\n\t\t//----- remove user\n\t\ttry {\n\t\t\tString res = client.removeUser(userAuthyId);\n\t\t\tlog.info(\"Removed user userAuthyId=\" + userAuthyId + \" Respone:\\n\" + res);\n\t\t} catch (RestClientException e) {\n\t\t\tlog.error(\"Cannot remove userAuthIy=\"+userAuthyId, e);\n\t\t\tthrow e;\n\t\t}\n\t}",
"public void usersUserIdMessagesFavoriteGet (String userId, final Response.Listener<InlineResponse2004> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesFavoriteGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesFavoriteGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages/favorite\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((InlineResponse2004) ApiInvoker.deserialize(localVarResponse, \"\", InlineResponse2004.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public interface HeshouyouApi {\n public String sendMsg(String msg);\n}",
"@Override\n\tpublic void onDial() {\n\t\t\n\t}",
"public interface RankClient {\n @POST(\"api/givefeedback\")\n @FormUrlEncoded\n Call<Response> giverank (@Field(\"reviewer\") String reviewer,\n @Field(\"reviewee\") String reviewee,\n @Field(\"rank\") int rank);\n}",
"public interface RetrofitService {\n @Headers(\"X-Mashape-Key: AuuyclCPjcmshv2iOPq190OpzLrMp1FJWwejsnJrdfwOUr4h44\")\n\n @FormUrlEncoded\n @POST(\"convert\")\n Call<ServerResponse> converterUnidade(@Field(\"from-type\") String from_type, //Unidade original\n @Field(\"from-value\") String from_value, //Valor\n @Field(\"to-type\") String to_type); //Unidade final\n}",
"@Override\n\tpublic JSONObject getTelMessageCode(HttpServletRequest request) {\n\t\t\n\t\tJSONObject obj = new JSONObject();\n\t\tString tel = request.getParameter(\"tel\");\n\n\t\t//判断参数是否为空以及数字型参数格式是否正确\n\t\tif(ConfigUtil.isNull(tel)){\n\t\t\tobj.put(\"resultCode\",\"0001\");\n\t\t\treturn obj;\n\t\t}\n\t\t//发送短信并保存到数据库\n\t\tMessageInfo msg = new MessageInfo();\n\t\tString code = NumUtil.getRandomTelCode(6);\n\t\ttry{\n\t\t\tString str = \"注册校验码 :\" + code + \"请及时完成注册。\";\n\t\t\tif(MessageUtil.sendMessage(tel, str)){\n\t\t\t\tmsg.setTel(tel);\n\t\t\t\tmsg.setData(str);\n\t\t\t\tmsg.setType(0);\n\t\t\t\tmsg.setState(0);//默认可用\n\t\t\t\tinsert(msg);\n\t\t\t\tlog.info(\"send \"+ code +\" to \" + tel + \"suc .\");\n\t\t\t}else{\n\t\t\t\tlog.error(\"send \"+ code +\" to \" + tel + \"error .\");\n\t\t\t\tobj.put(\"resultCode\", \"0002\");\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t}catch(Exception e){\n\t\t\tlog.error(\"insert essage error .\" + e.getMessage());\n\t\t}\n\t\tobj.put(\"msgCode\", code);\n\t\tobj.put(\"resultCode\",\"0000\");\n\t\treturn obj;\t\t\n\t}",
"private void sendTelemetry(HttpRecordable recordable) {\n }",
"@Override\n public void sendSms(String smsBody) {\n }",
"public void usersUserIdMessagesGet (String userId, final Response.Listener<Message> responseListener, final Response.ErrorListener errorListener) {\n Object postBody = null;\n\n // verify the required parameter 'userId' is set\n if (userId == null) {\n VolleyError error = new VolleyError(\"Missing the required parameter 'userId' when calling usersUserIdMessagesGet\",\n new ApiException(400, \"Missing the required parameter 'userId' when calling usersUserIdMessagesGet\"));\n }\n\n // create path and map variables\n String path = \"/users/{userId}/messages\".replaceAll(\"\\\\{format\\\\}\",\"json\").replaceAll(\"\\\\{\" + \"userId\" + \"\\\\}\", apiInvoker.escapeString(userId.toString()));\n\n // query params\n List<Pair> queryParams = new ArrayList<Pair>();\n // header params\n Map<String, String> headerParams = new HashMap<String, String>();\n // form params\n Map<String, String> formParams = new HashMap<String, String>();\n\n\n\n String[] contentTypes = {\n \n };\n String contentType = contentTypes.length > 0 ? contentTypes[0] : \"application/json\";\n\n if (contentType.startsWith(\"multipart/form-data\")) {\n // file uploading\n MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();\n \n\n HttpEntity httpEntity = localVarBuilder.build();\n postBody = httpEntity;\n } else {\n // normal form params\n }\n\n String[] authNames = new String[] { \"Authorization\" };\n\n try {\n apiInvoker.invokeAPI(basePath, path, \"GET\", queryParams, postBody, headerParams, formParams, contentType, authNames,\n new Response.Listener<String>() {\n @Override\n public void onResponse(String localVarResponse) {\n try {\n responseListener.onResponse((Message) ApiInvoker.deserialize(localVarResponse, \"\", Message.class));\n } catch (ApiException exception) {\n errorListener.onErrorResponse(new VolleyError(exception));\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n errorListener.onErrorResponse(error);\n }\n });\n } catch (ApiException ex) {\n errorListener.onErrorResponse(new VolleyError(ex));\n }\n }",
"public interface TwoversePublicApi {\n /**\n * Creates a new account.\n * \n * @param user\n * the user to create. Must have a hashed password set and must\n * NOT have an ID set. The ID will be set when returning from\n * this method.\n * @return the ID for new account\n * @throws ExistingUserException\n * if an account with this username already exists\n * @throws UnsetPasswordException\n * if the hashed password is not set\n */\n public int createAccount(User user) throws ExistingUserException,\n UnsetPasswordException;\n\n /**\n * Add a new object to the universe.\n * \n * These functions modify galaxy, but over XML-RPC that doesn't really work.\n * So, we must explicitly return the new object\n * \n * @param body\n * the object to add. The ID must NOT be set, and will be set on\n * returning from this method.\n * @return the ID for the new object\n * @throws UnhandledCelestialBodyException\n */\n public CelestialBody add(CelestialBody body)\n throws UnhandledCelestialBodyException;\n\n /**\n * Updates an object in the universe with the one provided, overwriting any\n * previous values.\n * \n * @param body\n * the body to update. The ID must be set and it must be known by\n * the server.\n * @return the updated object\n */\n public CelestialBody update(CelestialBody body);\n\n /**\n * Add a new link to the universe.\n * \n * @param link\n * the object to add. The ID must NOT be set, and will be set on\n * returning from this method.\n * @return the ID for the new object\n * @throws UnhandledCelestialBodyException\n */\n public Link add(Link link);\n}",
"public interface IMailboxUsageMailboxCountsRequest extends IHttpRequest {\n\n /**\n * Gets the MailboxUsageMailboxCounts from the service\n *\n * @param callback the callback to be called after success or failure\n */\n void get(final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Gets the MailboxUsageMailboxCounts from the service\n *\n * @return the MailboxUsageMailboxCounts from the request\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts get() throws ClientException;\n\n /**\n * Delete this item from the service\n *\n * @param callback the callback when the deletion action has completed\n */\n void delete(final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Delete this item from the service\n *\n * @throws ClientException if there was an exception during the delete operation\n */\n void delete() throws ClientException;\n\n /**\n * Patches this MailboxUsageMailboxCounts with a source\n *\n * @param sourceMailboxUsageMailboxCounts the source object with updates\n * @param callback the callback to be called after success or failure\n */\n void patch(final MailboxUsageMailboxCounts sourceMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Patches this MailboxUsageMailboxCounts with a source\n *\n * @param sourceMailboxUsageMailboxCounts the source object with updates\n * @return the updated MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts patch(final MailboxUsageMailboxCounts sourceMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the new object to create\n * @param callback the callback to be called after success or failure\n */\n void post(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the new object to create\n * @return the created MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts post(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the object to create/update\n * @param callback the callback to be called after success or failure\n */\n void put(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the object to create/update\n * @return the created MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts put(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Sets the select clause for the request\n *\n * @param value the select clause\n * @return the updated request\n */\n IMailboxUsageMailboxCountsRequest select(final String value);\n\n /**\n * Sets the expand clause for the request\n *\n * @param value the expand clause\n * @return the updated request\n */\n IMailboxUsageMailboxCountsRequest expand(final String value);\n\n}",
"public static void recordCall(Context context, Intent intent) {\n\t\tContentValues values = new ContentValues();\n\t\tString number = intent.getStringExtra(\"Number\");\n\t\tvalues.put(RecordlistTable.TYPE, 2);\n\t\tvalues.put(RecordlistTable.SUBID, intent.getIntExtra(\"subid\", SubscriptionManager.getDefaultSmsSubId()));\n\t\tvalues.put(RecordlistTable.PHONE_NUMBER, number);\n\t\tvalues.put(RecordlistTable.TIME, System.currentTimeMillis());\n\t\tvalues.put(RecordlistTable.FORMAT, intent.getStringExtra(\"format\"));\n\t\tString cityName = getGeoDescription(context, number);\n\t\tif(!TextUtils.isEmpty(cityName)) {\n\t\t\tvalues.put(RecordlistTable.LOCATION, cityName);\n\t\t}\n\t\tif(context.getContentResolver().isSecreted(number)) {\n\t\t\tvalues.put(RecordlistTable.USER_MODE, 1);\n\t\t}\n\t\tUri uri= context.getContentResolver().insert(RECORDLIST_URI, values);\n\t\tlog(\"recordCall-Uri:\" + uri);\n\t\t//testRestoreItem(context, 2);\n\t}",
"public interface RestInterface {\n\n @GET(\"{currency}/\")\n Call<List<ResponseModel>> geCurrency(@Path(\"currency\") String currency);\n}",
"abstract void telephoneValidity();",
"R request();",
"public interface PokeApiService {\n\n @GET(\"qvqk-dtmf.json\")\n Call<ArrayList<ViasRespuesta>> obtenerListaPokemon();\n}",
"FriendList.Req getFriendlistReq();",
"public void sendToAdmin(String sessionid, Smsmodel sms, String vals) throws ProtocolException, MalformedURLException, IOException {\r\n String val = null;\r\n System.out.println(\"hello boy \" + vals);\r\n String sender = \"DND_BYPASSGetItDone\";\r\n URL url = new URL(\"http://www.smslive247.com/http/index.aspx?cmd=sendmsg&sessionid=\" + sessionid + \"&message=\" + sms.getVendorMessage() + \"&sender=\" + sender + \"&sendto=\" + vals + \"&msgtype=0\");\r\n //http://www.bulksmslive.com/tools/geturl/Sms.php?username=abc&password=xyz&sender=\"+sender+\"&message=\"+message+\"&flash=0&sendtime=2009-10- 18%2006:30&listname=friends&recipients=\"+recipient; \r\n //URL gims_url = new URL(\"http://smshub.lubredsms.com/hub/xmlsmsapi/send?user=loliks&pass=GJP8wRTs&sender=nairabox&message=Acct%3A5073177777%20Amt%3ANGN1%2C200.00%20CR%20Desc%3ATesting%20alert%20Avail%20Bal%3ANGN%3A1%2C342%2C158.36&mobile=08065711040&flash=0\");\r\n final String USER_AGENT = \"Mozilla/5.0\";\r\n\r\n HttpURLConnection con = (HttpURLConnection) url.openConnection();\r\n con.setRequestMethod(\"GET\");\r\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\r\n int responseCode = con.getResponseCode();\r\n BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n String inputLine;\r\n StringBuffer response = new StringBuffer();\r\n // System.out.println(messageModel.getBody() + \" dude\");\r\n while ((inputLine = in.readLine()) != null) {\r\n response.append(inputLine);\r\n }\r\n in.close();\r\n String responseCod = response.toString();\r\n }",
"public void testSendSmsTest() {\n String from = \"14121234567\";\n String to = \"14121234567\";\n assertThat(messagingClient).isNotNull();\n\n SendMessageResponse messageResponse = messagingClient.sendSms(jwt, to, from, \"This is a test message\");\n assertThat(messageResponse).isNotNull();\n assertThat(messageResponse.getMessageUuid()).isNotBlank();\n }",
"private TwitterAPI(){\n\t\t\n\t}",
"public abstract String getResponse();"
] | [
"0.6824193",
"0.6453042",
"0.5881974",
"0.56454027",
"0.56110924",
"0.55884826",
"0.55197096",
"0.5432672",
"0.5419874",
"0.5326111",
"0.5314383",
"0.5292388",
"0.5290472",
"0.5275127",
"0.52657783",
"0.5223897",
"0.52218044",
"0.5213514",
"0.5208777",
"0.51834035",
"0.51803696",
"0.51747173",
"0.51472855",
"0.51444596",
"0.5129796",
"0.51193047",
"0.51036704",
"0.5102829",
"0.5063487",
"0.50626445",
"0.5055643",
"0.50454754",
"0.5027103",
"0.5020421",
"0.5020421",
"0.50169337",
"0.5014771",
"0.5000886",
"0.4999495",
"0.49929732",
"0.4991948",
"0.49771282",
"0.49765304",
"0.4974539",
"0.49703878",
"0.49623287",
"0.4958043",
"0.4951391",
"0.4950016",
"0.494383",
"0.49301243",
"0.49272048",
"0.49268335",
"0.49210632",
"0.49118453",
"0.4908224",
"0.49078804",
"0.48957697",
"0.4894373",
"0.48904085",
"0.48875096",
"0.48613644",
"0.4856936",
"0.4855384",
"0.4853267",
"0.4853267",
"0.48519874",
"0.48466647",
"0.48466152",
"0.48449725",
"0.48375976",
"0.48345003",
"0.48312208",
"0.48248985",
"0.4824755",
"0.48186147",
"0.4816165",
"0.48155984",
"0.48143232",
"0.48133817",
"0.48066986",
"0.48064527",
"0.47967306",
"0.4796306",
"0.47935855",
"0.478965",
"0.47866857",
"0.47866252",
"0.4786154",
"0.47857717",
"0.47855222",
"0.4784885",
"0.47801012",
"0.47742933",
"0.47679025",
"0.4767475",
"0.4765691",
"0.4763217",
"0.47619206",
"0.47594348",
"0.47586024"
] | 0.0 | -1 |
/ Enabled aggressive block sorting | public final boolean equals(Object object) {
block20: {
block19: {
if (object == this) break block19;
if (!(object instanceof zzdme)) {
return false;
}
object = (zzdme)object;
if (!Arrays.equals(this.zzlmn, ((zzdme)object).zzlmn)) {
return false;
}
if (this.zzlmo == null ? ((zzdme)object).zzlmo != null : !this.zzlmo.equals(((zzdme)object).zzlmo)) {
return false;
}
if (Double.doubleToLongBits(this.zzlmp) != Double.doubleToLongBits(((zzdme)object).zzlmp)) {
return false;
}
if (Float.floatToIntBits(this.zzlmq) != Float.floatToIntBits(((zzdme)object).zzlmq)) {
return false;
}
if (this.zzlmr != ((zzdme)object).zzlmr) {
return false;
}
if (this.zzlms != ((zzdme)object).zzlms) {
return false;
}
if (this.zzlmt != ((zzdme)object).zzlmt) {
return false;
}
if (this.zzlmu != ((zzdme)object).zzlmu) {
return false;
}
if (!zzfjq.equals(this.zzlmv, ((zzdme)object).zzlmv)) {
return false;
}
if (!zzfjq.equals(this.zzlmw, ((zzdme)object).zzlmw)) {
return false;
}
if (!zzfjq.equals(this.zzlmx, ((zzdme)object).zzlmx)) {
return false;
}
if (!zzfjq.equals(this.zzlmy, ((zzdme)object).zzlmy)) {
return false;
}
if (!zzfjq.equals(this.zzlmz, ((zzdme)object).zzlmz)) {
return false;
}
if (this.zzlna != ((zzdme)object).zzlna) {
return false;
}
if (this.zzpnc != null && !this.zzpnc.isEmpty()) {
return this.zzpnc.equals(((zzdme)object).zzpnc);
}
if (((zzdme)object).zzpnc != null && !((zzdme)object).zzpnc.isEmpty()) break block20;
}
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sortBlocks(){\n\t\tCurrentSets = getCurrentSets();\n\t\tif(CurrentSets == 1){\n\t\t\treturn;\n\t\t}else{\n\t\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\t\tfor(j = i + 1; j < CurrentSets; j++){\n\t\t\t\t\tif((Integer.parseInt(blocks[i].getHexTag(), 16)) > (Integer.parseInt(blocks[j].getHexTag(), 16))){\n\t\t\t\t\t\ttemp = blocks[j];\n\t\t\t\t\t\tblocks[j] = blocks[i];\n\t\t\t\t\t\tblocks[i] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void sort(IAlg algorithm, boolean decrescent){}",
"private static void sortingMemo() {\n\t\t\n\t}",
"public void sort()throws InterruptedException{\n\t\tfor (int i = 0; i < a.length - 1; i++) {\n\t\t\tint minPos = minPosition(i);\n\t\t\tsortStateLock.lock();\n\t\t\ttry{\n\t\t\t\tswap(minPos, i);\n\t\t\t\t// For animation\n\t\t\t\talreadySorted = i;\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tsortStateLock.unlock();\n\t\t \t\t}\n\t\t\tpause(2);\n\t }\n }",
"public FastNondominatedSorting() {\r\n\t\tthis(new ParetoDominanceComparator());\r\n\t}",
"private PerfectMergeSort() {}",
"@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }",
"public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void sort() {\n\t\trunPassZero();\n\t\tList<TupleReaderBinary> buffers = new ArrayList<>();\n\t\tList<Tuple> sortStage = new ArrayList<>();\n\t\tassert (readerBucketID == 0);\n\t\tassert (writerBucketID == 0);\n\t\tassert (passNumber == 1);\n\t\tassert (currentGroup == 1);\n\t\toutputBuffer.clear();\n\n\t\t// assign buffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tbuffers.add(null);\n\t\t\tassignBuffer(buffers, i);\n\t\t\tsortStage.add(null);\n\t\t}\n\n\t\tassert (buffers.size() == numInputBuffers);\n\t\tassert (sortStage.size() == numInputBuffers);\n\n\t\t// read from buffers into list of size numInputBuffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t}\n\n\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\" + instanceHashcode\n\t\t\t\t+ \"_\" + passNumber + \"_\" + writerBucketID);\n\n\t\twhile (true) {\n\t\t\tif (!findAndReplaceSmallest(buffers, sortStage)) {\n\t\t\t\tprevPrevTotalBuckets = prevTotalBuckets;\n\t\t\t\tprevTotalBuckets = writerBucketID + 1;\n\t\t\t\tflushOutputBuffer();\n\t\t\t\toutputWriter.close();\n\n\t\t\t\t// We are done! Return\n\t\t\t\tif (prevTotalBuckets == 1) {\n\t\t\t\t\tdeleteTempFiles();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twriterBucketID = 0;\n\t\t\t\treaderBucketID = 0;\n\t\t\t\twriterFlushes = 0;\n\t\t\t\tdeleteTempFiles();\n\t\t\t\tpassNumber++;\n\t\t\t\tcurrentGroup = 1;\n\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tassignBuffer(buffers, i);\n\t\t\t\t\tsortStage.add(null);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t\t\t}\n\n\t\t\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\"\n\t\t\t\t\t\t+ instanceHashcode + \"_\" + passNumber + \"_\" + writerBucketID);\n\t\t\t}\n\t\t}\n\n\t}",
"public void radixSorting() {\n\t\t\n\t}",
"public void sort() {\n }",
"public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}",
"public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}",
"private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }",
"public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}",
"@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}",
"@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }",
"@Override\n\tvoid sort(int[] array, SortingVisualizer display) {\n\t\tSystem.out.println(\"a\");\n\t\tboolean sorted = false;\n\t\tboolean h = true;\n\t\twhile (sorted == false) {\nh=true;\n\t\t\t// System.out.println(\"1\");\n\t\t\tRandom x = new Random();\n\t\t\tint y = x.nextInt(array.length);\n\n\t\t\tint el1 = array[y];\n\t\t\tint z = x.nextInt(array.length);\n\t\t\tint el2 = array[z];\n\n\t\t\tarray[y] = el2;\n\t\t\tarray[z] = el1;\n\t\t\tfor (int i = 0; i < array.length - 1; i++) {\n/*\n\t\t\t\tif (array[i] < array[i + 1]) {\n\n\t\t\t\t\th = true;\n\n\t\t\t\t}*/\n\n\t\t\t\tif (array[i] > array[i + 1]) {\n\t\t\t\t\th = false;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (h == true) {\n\n\t\t\t\tsorted = true;\n\t\t\t}\n\n\t\t\tdisplay.updateDisplay();\n\t\t\t\n\t\t}\n\t}",
"@Test\n public void doubleSortWithExchangeUnbalancedNodes() {\n ExternalSort es1 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emptyList(), false);\n SingleSender ss = new SingleSender(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), Mockito.mock(BatchSchema.class), es1, 0,\n MinorFragmentIndexEndpoint.newBuilder().setMinorFragmentId(0).build());\n Fragment f1 = new Fragment();\n f1.addOperator(ss);\n Wrapper w1 = new Wrapper(f1, 0);\n w1.overrideEndpoints(Arrays.asList(N1, N2));\n\n UnorderedReceiver or = new UnorderedReceiver(OpProps.prototype(1, Long.MAX_VALUE), Mockito.mock(BatchSchema.class), 0, Collections.emptyList(), false);\n ExternalSort es2 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), or, Collections.emptyList(), false);\n Fragment f2 = new Fragment();\n f2.addOperator(es2);\n Wrapper w2 = new Wrapper(f2, 0);\n w2.overrideEndpoints(Collections.singletonList(N1));\n\n\n MemoryAllocationUtilities.setMemory(options, ImmutableMap.of(f1, w1, f2, w2), 10 + adjustReserve);\n assertEquals(3L, es1.getProps().getMemLimit());\n assertEquals(3L, es2.getProps().getMemLimit());\n }",
"public List<SimulinkBlock> generateBlockOrder(UnmodifiableCollection<SimulinkBlock> unmodifiableCollection,\n\t\t\tSet<SimulinkBlock> unsortedBlocks) {\n\t\tSet<SimulinkBlock> unsorted = new HashSet<SimulinkBlock>();\n\t\tSet<SimulinkBlock> unsortedRev = new HashSet<SimulinkBlock>();\n\t\tList<SimulinkBlock> sorted = new LinkedList<SimulinkBlock>();\n\n\t\t// start with source blocks without input\n\t\tfor (SimulinkBlock block : unmodifiableCollection) {\n\t\t\tif (block.getInPorts().isEmpty()) {\n\t\t\t\tsorted.add(block);\n\t\t\t} else {\n\t\t\t\tunsorted.add(block);\n\t\t\t}\n\t\t}\n\n\t\tint sizeBefore = 0;\n\t\tint sizeAfter = 0;\n\t\tdo {\n\t\t\tsizeBefore = unsorted.size();\n\t\t\tfor (SimulinkBlock myBlock : unsorted) {\n\t\t\t\tunsortedRev.add(myBlock);\n\t\t\t}\n\t\t\tunsorted.clear();\n\t\t\tfor (SimulinkBlock block : unsortedRev) {\n\t\t\t\tboolean allPredeccesorsAvailable = specialBlockChecking(block, sorted);\n\t\t\t\tif (allPredeccesorsAvailable) {\n\t\t\t\t\tsorted.add(block);\n\t\t\t\t} else {\n\t\t\t\t\tunsorted.add(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizeAfter = unsorted.size();\n\t\t\tunsortedRev.clear();\n\t\t} while ((!(unsorted.isEmpty())) && (!(sizeBefore == sizeAfter)));\n\n\t\tfor (SimulinkBlock block : unsorted) {\n\t\t\t// TODO sort the last unsorted blocks\n\t\t\tPluginLogger\n\t\t\t\t\t.info(\"Currently unsorted after sorting : \" + block.getName() + \" of type \" + block.getType());\n\t\t\tsorted.add(block);\n\t\t\tunsortedBlocks.add(block);\n\t\t}\n\t\treturn sorted;\n\t}",
"@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}",
"private Sort() { }",
"public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}",
"@Override\n public void sortCurrentList(FileSortHelper sort) {\n }",
"public String doSort();",
"public void sortArray() {\n\t\tSystem.out.println(\"QUICK SORT\");\n\t}",
"@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }",
"private void updateOrder() {\n Arrays.sort(positions);\n }",
"@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }",
"void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }",
"void sort();",
"void sort();",
"public void shellSort(int[] a) \n {\n int increment = a.length / 2;\n while (increment > 0) \n {\n \n for (int i = increment; i < a.length; i++) //looping over the array\n {\n int j = i;\n int temp = a[i]; // swapping the values to a temporary array\n try\n {\n if(!orderPanel) // checking for Descending order\n {\n while (j >= increment && a[j - increment] > temp) \n {\n a[j] = a[j - increment]; //swapping the values\n thread.sleep(100);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n }\n \n else\n {\n while (j >= increment && a[j - increment] < temp) //checking for Ascending order\n {\n a[j] = a[j - increment];\n thread.sleep(200);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n a[j] = temp;\n }\n \n if (increment == 2) \n {\n increment = 1;\n } \n else \n {\n increment *= (5.0 / 11);\n }\n }\n }",
"private void externalSort() throws IOException{\n\t\t/*\n\t\t * Pass 0: internal sort\n\t\t */\n\t\t// Read in from child;Write out runs of B pages;\n\t\t\n\t\tint numPerRun = B * 4096 / (schema.size() * 4); // # of tuples per run given in Pass0\n\t\tboolean buildMore;\n\t\tint numRuns = 0;\n\t\tif(sortAttrsIndex == null) {\n\t\t\tthis.buildAttrsIndex();\n\t\t}\n\t\texComparator myComp = new exComparator();\n\t\tinternal = new PriorityQueue<Tuple>(myComp);\n\t\tdo {\n\t\t\tbuildMore = this.buildHeap(numPerRun);\n\t\t\tnumRuns++;\n\t\t\t\n\t\t\t// write out the (numRuns)th run\n\t\t\tTupleWriter TW;\n\t\t\tif(!buildMore && numRuns == 1) {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t} else {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"0_\" + numRuns));\n\t\t\t}\n\t\t\twhile(!internal.isEmpty()) {\n//\t\t\t\tSystem.out.println(internal.peek().data);\n\t\t\t\tTW.setNextTuple(internal.poll()); \n\t\t\t}\n\t\t\t// leftover, fill with zero and write out\n\t\t\tif(!TW.bufferEmpty()) { // TW would never know the end of writing\n\t\t\t\tTW.fillFlush(); \n\t\t\t}\n\t\t\tTW.close();\n\t\t\t// internal must be empty until this point\n\t\t}while (buildMore);\n\t\t\n\t\t/*\n\t\t * Pass 1 and any following\n\t\t */\n\t\tif(numRuns > 1) { // if numRuns generated in Pass 0 is 1 already, file sorted already, no need to merge\n\t\t\tthis.merge(numRuns, myComp);\n\t\t}\n\t\t\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif (currentSize >= size)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"MERGESORT END\");\n\t\t\t\t\ttimer.stop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// deciding the block to to merged\n\t\t\t\telse if (mergeSortCodeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tif (leftStart >= size - 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentSize = currentSize * 2;\n\t\t\t\t\t\tleftStart = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmid = leftStart + currentSize - 1;\n\t\t\t\t\t\tif (leftStart + 2 * currentSize - 1 >= size - 1)\n\t\t\t\t\t\t\trightEnd = size - 1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trightEnd = leftStart + 2 * currentSize - 1;\n\t\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tmergeSortDelayFlag1 = 1;\n\t\t\t\t\t\tmergeSortdelay1 = 0;\n\t\t\t\t\t\tmergeSortCodeFlag = 0;\n\t\t\t\t\t\tif(mid >= rightEnd)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mergeSortDelayFlag1 == 1)\n\t\t\t\t{\n\t\t\t\t\tmergeSortdelay1++;\n\t\t\t\t\tif (mergeSortdelay1 >= DELAY)\n\t\t\t\t\t{\n\t\t\t\t\t\tl = leftStart;\n\t\t\t\t\t\tm = mid;\n\t\t\t\t\t\tr = rightEnd;\n\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\tmergeInitializeFlag = 1;\n\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Merging the block selected\n\t\t\t\t\n\t\t\t\t// initializing the variables needed by the merge block \n\t\t\t\telse if (mergeInitializeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\ti = l;\n\t\t\t\t\tj = m + 1;\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\trightFlag = 0;\n\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\tupFlag = 0;\n\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\tbox.setColorRange(l, m, BLOCK_COLOR1);\n\t\t\t\t\tbox.setColorRange(m + 1, r, BLOCK_COLOR2);\n\t\t\t\t\tpaintBox();\n\t\t\t\t\t\n\t\t\t\t\tmergeFlag = 1;\n\t\t\t\t\tmergeInitializeFlag = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// actual merging starts here\n\t\t\t\telse if (mergeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\t// step zero check whether to continue merging or not\n\t\t\t\t\tif (j > r)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i >= j)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag1 = 1;\n\t\t\t\t\t\t\tcolorFlag1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay1++;\n\t\t\t\t\t\t\tif (colorDelay1 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\t\t\t\tcolorDelay1 = 0;\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\telse if (i >= j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (j > r)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag2 = 1;\n\t\t\t\t\t\t\tcolorFlag2 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay2++;\n\t\t\t\t\t\t\tif (colorDelay2 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\t\t\t\tcolorDelay2 = 0;\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// Step one Check whether a[i] <= a[j]\n\t\t\t\t\telse if (codeFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\tcurrRect.setColor(FOCUS_COLOR1);\n\t\t\t\t\t\tscanRect.setColor(FOCUS_COLOR2);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tdelayFlag2 = 1;\n\t\t\t\t\t\tcodeFlag = 0;\n\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (delayFlag2 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay2++;\n\t\t\t\t\t\tif (delay2 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\t\tif (currRect.getData() < scanRect.getData())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdelayFlag1 = 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{\n\t\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\t\tcurrentDownCount = 0;\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\telse if (delayFlag1 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay1++;\n\t\t\t\t\t\tif (delay1 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\t\t\ti++;\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// Moving the first rectangle on right down (if it was smaller than the first one on the left)\n\t\t\t\t\telse if (downFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, YCHANGE);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t\tindex = j - 1;\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// moving each of the rectangles in the block to the right(between the two smallest rectangle on both side)\n\t\t\t\t\t// including the first rectangle\n\t\t\t\t\telse if (rightBlockFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (index < i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightFlag = 1;\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tindexRightCount = 0;\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// moving a rectangle in the block to the right\n\t\t\t\t\telse if (rightFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(index, XCHANGE, 0);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tindexRightCount += XCHANGE;\n\t\t\t\t\t\tif (indexRightCount >= width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = indexRightCount - width;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(index, -excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\trightFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindex--;\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// moving the rectangle left (the smallest in the un-merged block)\n\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, -XCHANGE, 0);\n\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentLeftCount >= width * (j - i))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentLeftCount - width * (j - i);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\tcurrentUpCount = 0;\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// moving the rectangle up (the smallest in the un-merged block)\n\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -YCHANGE);\n\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRectangle smallestRect = box.getRectangle(j);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int t = j - 1; t >= i; t--)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.setRectangle(box.getRectangle(t), t + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbox.setRectangle(smallestRect, i);\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public void sortByLength()\n {\n boolean swapMade;//has a swap been made in the most recent pass?\n \n //repeat looking for swaps\n do\n {\n swapMade=false;//just starting this pass, so no swap yet\n \n //go through entire array. looking for swaps that need to be done\n for(int i = 0; i<currentRide-1; i++)\n {\n //if the other RideLines has less people\n if(rides[i].getCurrentPeople()<rides[i+1].getCurrentPeople())\n {\n // standard swap, using a temporary. swap with less people\n RideLines temp = rides[i];\n rides[i]=rides[i+1];\n rides[i+1]=temp;\n \n swapMade=true;//remember this pass made at least one swap\n }\n \n } \n }while(swapMade);//until no swaps were found in the most recent past\n \n redrawLines();//redraw the image\n \n }",
"private void sortByAmount(){\n int stopPos = 0;\n while(colours.size()-stopPos > 0){\n int inARow = 1;\n for(int i = colours.size() - 1; i > stopPos; i--){\n if(colours.get(i-1).getAmount() < colours.get(i).getAmount()){\n rgb temp = new rgb(colours.get(i-1));\n colours.set(i-1, colours.get(i));\n colours.set(i, temp);\n }else{\n inARow++;\n }\n }\n stopPos++;\n if(inARow == colours.size()){\n break;\n }\n }\n }",
"public static void specialSets() {\n\t\tSystem.out.printf(\"%12s%15s%15s%10s%10s%10s%10s%n\",\"Size\",\"Range\",\"Pre-Sort Type\",\"Insertion\",\"Selectuon\",\"Quick\",\"Merge\");\n\t\tint[] array;\n\t\t//200K\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 200000);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Sorted array\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Sorted\");\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Reverse Sorted\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Reverse Sorted\");\n\t\tint[] temp = new int[array.length];\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttemp[i] = array[array.length -1 -i];\n\t\t}\n\t\tfourSorts(temp);\n\t\tSystem.out.println();\n\t\t//Range 1-20\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-20\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 20);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }",
"public void sortCompetitors(){\n\t\t}",
"public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}",
"@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Override\n\tpublic void setSortCounters(boolean sortCounters) {\n\t\t\n\t}",
"public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }",
"public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }",
"public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }",
"private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }",
"public void changeSortOrder();",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"private static void selectionSort(ArrayList<Box> BoxArray) { \n\n\t\tfor ( int i = 0; i < BoxArray.size(); i++ ) { \n\t\t\tint lowPos = i; \n\t\t\tfor ( int j = i + 1; j < BoxArray.size(); j++ ) \n\t\t\t\tif ( BoxArray.get(j).volume() < BoxArray.get(lowPos).volume() ) \n\t\t\t\t\tlowPos = j;\n\t\t\tif ( BoxArray.get(lowPos) != BoxArray.get(i) ) { \n\t\t\t\tBox temp = BoxArray.get(lowPos);\n\t\t\t\tBoxArray.set(lowPos, BoxArray.get(i));\n\t\t\t\tBoxArray.set(i, temp);\n\t\t\t}\n\t\t}\n\t}",
"public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}",
"public BubSortList() {\n\t\tray = new int[MAXSIZE];\n\t\tnowLength = 0;\n\t}",
"public void sortByDefault() {\r\n\t\tcomparator = null;\r\n\t}",
"public static void s1AscendingTest() {\n int key = 903836722;\n SortingLab<Integer> sli = new SortingLab<Integer>(key);\n int M = 600000;\n int N = 1000;\n double start;\n double elapsedTime;\n System.out.print(\"Sort 1 Ascending\\n\");\n for (; N < M; N *= 2) {\n Integer[] ai = getRandomArray(N, Integer.MAX_VALUE);\n Arrays.sort(ai);\n start = System.nanoTime();\n sli.sort1(ai);\n elapsedTime = (System.nanoTime() - start) / 1_000_000_000d;\n System.out.print(N + \"\\t\");\n System.out.printf(\"%4.3f\\n\", elapsedTime);\n }\n }",
"public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}",
"public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }",
"@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}",
"@VTID(28)\n boolean getSortUsingCustomLists();",
"public void sortOccurred() {\n //SET ALL THE ROWS TO -1, (THEY INITIALIZE TO 0).\n \tfor(int i = 0; i < data.length; i++) {\n \t\tdata[i] = null;\n \t\trowIndexLookup[i] = -1;\n \t}\t\t\n }",
"public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}",
"private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }",
"public void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }",
"private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }",
"void sortV();",
"private void sortAndEmitUpTo(double maxX)\n {\n /**\n * Heuristic: Check if there are no obvious segments to process\n * and skip sorting & processing if so\n * \n * This is a heuristic only.\n * There may be new segments at the end of the buffer\n * which are less than maxx. But this should be rare,\n * and they will all get processed eventually.\n */\n if (bufferHeadMaxX() >= maxX)\n return;\n \n // this often sorts more than are going to be processed.\n //TODO: Can this be done faster? eg priority queue?\n \n // sort segs in buffer, since they arrived in potentially unsorted order\n Collections.sort(segmentBuffer, ORIENT_COMPARATOR);\n int i = 0;\n int n = segmentBuffer.size();\n LineSeg prevSeg = null;\n \n //reportProcessed(maxX);\n \n while (i < n) {\n LineSeg seg = (LineSeg) segmentBuffer.get(i);\n if (seg.getMaxX() >= maxX)\n \tbreak;\n \n i++;\n if (removeDuplicates) {\n if (prevSeg != null) {\n // skip this segment if it is a duplicate\n if (prevSeg.equals(seg)) {\n // merge in side label of dup seg\n prevSeg.merge(seg);\n continue;\n }\n }\n prevSeg = seg;\n }\n // remove interior segments (for dissolving)\n if (removeInteriorSegs\n && seg.getTopoLabel() == TopologyLabel.BOTH_INTERIOR)\n continue;\n \n segSink.process(seg);\n }\n //System.out.println(\"SegmentStreamSorter: total segs = \" + n + \", processed = \" + i);\n removeSegsFromBuffer(i);\n }",
"public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }",
"public static void main(String[] args) throws FileNotFoundException{\n int[] quicktimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes1[i] = (int)endTime;\n }\n \n int[] mergetimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes1[i] = (int)endTime;\n }\n \n int[] heaptimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes1[i] = (int)endTime;\n }\n \n int[] quicktimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[i] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes2[i] = (int)endTime;\n }\n \n int[] mergetimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes2[i] = (int)endTime;\n }\n \n int[] heaptimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes2[i] = (int)endTime;\n }\n \n int[] quicktimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes3[i] = (int)endTime;\n }\n \n int[] mergetimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes3[i] = (int)endTime;\n }\n \n int[] heaptimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes3[i] = (int)endTime;\n }\n \n int[] quicktimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes4[i] = (int)endTime;\n }\n \n int[] mergetimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes4[i] = (int)endTime;\n }\n \n int[] heaptimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes4[i] = (int)endTime;\n }\n \n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE REVERSE SORTED ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes5[i] = (int)endTime;\n }\n \n int[] mergetimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes5[i] = (int)endTime;\n }\n \n int[] heaptimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes5[i] = (int)endTime;\n }\n \n int[] quicktimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes6[i] = (int)endTime;\n }\n \n int[] mergetimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes6[i] = (int)endTime;\n }\n \n int[] heaptimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes6[i] = (int)endTime;\n }\n \n int[] quicktimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes7[i] = (int)endTime;\n }\n \n int[] mergetimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes7[i] = (int)endTime;\n }\n \n int[] heaptimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes7[i] = (int)endTime;\n }\n \n int[] quicktimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes8[i] = (int)endTime;\n }\n \n int[] mergetimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes8[i] = (int)endTime;\n }\n \n int[] heaptimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes8[i] = (int)endTime;\n }\n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE RANDOM ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes9[i] = (int)endTime;\n }\n \n int[] mergetimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes9[i] = (int)endTime;\n }\n \n int[] heaptimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes9[i] = (int)endTime;\n }\n \n int[] quicktimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes10[i] = (int)endTime;\n }\n \n int[] mergetimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes10[i] = (int)endTime;\n }\n \n int[] heaptimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes10[i] = (int)endTime;\n }\n \n int[] quicktimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes11[i] = (int)endTime;\n }\n \n int[] mergetimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes11[i] = (int)endTime;\n }\n \n int[] heaptimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);;\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes11[i] = (int)endTime;\n }\n \n int[] quicktimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes12[i] = (int)endTime;\n }\n \n int[] mergetimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes12[i] = (int)endTime;\n }\n \n int[] heaptimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes12[i] = (int)endTime;\n }\n \n //PRINTING THE RESULTS OUT INTO FILE\n File f = new File(\"Results.txt\");\n FileOutputStream fos = new FileOutputStream(f);\n PrintWriter pw = new PrintWriter(fos);\n pw.println(\"SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes1), medVal(quicktimes1), varVal(quicktimes1, meanVal(quicktimes1)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes2), medVal(quicktimes2), varVal(quicktimes2, meanVal(quicktimes2)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes3), medVal(quicktimes3), varVal(quicktimes3, meanVal(quicktimes3)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes4), medVal(quicktimes4), varVal(quicktimes4, meanVal(quicktimes4)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes1), medVal(mergetimes1), varVal(mergetimes1, meanVal(mergetimes1)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes2), medVal(mergetimes2), varVal(mergetimes2, meanVal(mergetimes2)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes3), medVal(mergetimes3), varVal(mergetimes3, meanVal(mergetimes3)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes4), medVal(mergetimes4), varVal(mergetimes4, meanVal(mergetimes4)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes1), medVal(heaptimes1), varVal(heaptimes1, meanVal(heaptimes1)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes2), medVal(heaptimes2), varVal(heaptimes2, meanVal(heaptimes2)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes3), medVal(heaptimes3), varVal(heaptimes3, meanVal(heaptimes3)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes4), medVal(heaptimes4), varVal(heaptimes4, meanVal(heaptimes4)));\n pw.println(\"REVERSE SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes5), medVal(quicktimes5), varVal(quicktimes5, meanVal(quicktimes5)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes6), medVal(quicktimes6), varVal(quicktimes6, meanVal(quicktimes6)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes7), medVal(quicktimes7), varVal(quicktimes7, meanVal(quicktimes7)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes8), medVal(quicktimes8), varVal(quicktimes8, meanVal(quicktimes8)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes5), medVal(mergetimes5), varVal(mergetimes5, meanVal(mergetimes5)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes6), medVal(mergetimes6), varVal(mergetimes6, meanVal(mergetimes6)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes7), medVal(mergetimes7), varVal(mergetimes7, meanVal(mergetimes7)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes8), medVal(mergetimes8), varVal(mergetimes8, meanVal(mergetimes8)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes5), medVal(heaptimes5), varVal(heaptimes5, meanVal(heaptimes5)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes6), medVal(heaptimes6), varVal(heaptimes6, meanVal(heaptimes6)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes7), medVal(heaptimes7), varVal(heaptimes7, meanVal(heaptimes7)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes8), medVal(heaptimes8), varVal(heaptimes8, meanVal(heaptimes8)));\n pw.println(\"RANDOM ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes9), medVal(quicktimes9), varVal(quicktimes9, meanVal(quicktimes9)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes10), medVal(quicktimes10), varVal(quicktimes10, meanVal(quicktimes10)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes11), medVal(quicktimes11), varVal(quicktimes11, meanVal(quicktimes11)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes12), medVal(quicktimes12), varVal(quicktimes12, meanVal(quicktimes12)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes9), medVal(mergetimes9), varVal(mergetimes9, meanVal(mergetimes9)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes10), medVal(mergetimes10), varVal(mergetimes10, meanVal(mergetimes10)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes11), medVal(mergetimes11), varVal(mergetimes11, meanVal(mergetimes11)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes12), medVal(mergetimes12), varVal(mergetimes12, meanVal(mergetimes12)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes9), medVal(heaptimes9), varVal(heaptimes9, meanVal(heaptimes9)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes10), medVal(heaptimes10), varVal(heaptimes10, meanVal(heaptimes10)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes11), medVal(heaptimes11), varVal(heaptimes11, meanVal(heaptimes11)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes12), medVal(heaptimes12), varVal(heaptimes12, meanVal(heaptimes12)));\n pw.close();\n }",
"public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }",
"public void sort() {\n\t\tif (data.size() < 10) {\n\t\t\tbubbleSort();\n\t\t\tSystem.out.println(\"Bubble Sort\");\n\t\t} else {\n\t\t\tquickSort();\n\t\t\tSystem.out.println(\"Quick Sort\");\n\t\t}\n\t}",
"public void sort() {\r\n lang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\r\n int nrElems = array.getLength();\r\n ArrayMarker iMarker = null, jMarker = null;\r\n // highlight method header\r\n code.highlight(\"header\");\r\n lang.nextStep();\r\n\r\n // check if array is null\r\n code.toggleHighlight(\"header\", \"ifNull\");\r\n incrementNrComparisons(); // if null\r\n lang.nextStep();\r\n\r\n // switch to variable declaration\r\n\r\n code.toggleHighlight(\"ifNull\", \"variables\");\r\n lang.nextStep();\r\n\r\n // initialize i\r\n code.toggleHighlight(\"variables\", \"initializeI\");\r\n iMarker = installArrayMarker(\"iMarker\", array, nrElems - 1);\r\n incrementNrAssignments(); // i =...\r\n lang.nextStep();\r\n\r\n // switch to outer loop\r\n code.unhighlight(\"initializeI\");\r\n\r\n while (iMarker.getPosition() >= 0) {\r\n code.highlight(\"outerLoop\");\r\n lang.nextStep();\r\n\r\n code.toggleHighlight(\"outerLoop\", \"innerLoop\");\r\n if (jMarker == null) {\r\n jMarker = installArrayMarker(\"jMarker\", array, 0);\r\n } else\r\n jMarker.move(0, null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n while (jMarker.getPosition() <= iMarker.getPosition() - 1) {\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"if\");\r\n array.highlightElem(jMarker.getPosition() + 1, null, null);\r\n array.highlightElem(jMarker.getPosition(), null, null);\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n\r\n if (array.getData(jMarker.getPosition()) > array.getData(jMarker\r\n .getPosition() + 1)) {\r\n // swap elements\r\n code.toggleHighlight(\"if\", \"swap\");\r\n array.swap(jMarker.getPosition(), jMarker.getPosition() + 1, null,\r\n DEFAULT_TIMING);\r\n incrementNrAssignments(3); // swap\r\n lang.nextStep();\r\n code.unhighlight(\"swap\");\r\n } else {\r\n code.unhighlight(\"if\");\r\n }\r\n // clean up...\r\n // lang.nextStep();\r\n code.highlight(\"innerLoop\");\r\n array.unhighlightElem(jMarker.getPosition(), null, null);\r\n array.unhighlightElem(jMarker.getPosition() + 1, null, null);\r\n if (jMarker.getPosition() <= iMarker.getPosition())\r\n jMarker.move(jMarker.getPosition() + 1, null, DEFAULT_TIMING);\r\n incrementNrAssignments(); // j++ will always happen...\r\n }\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"decrementI\");\r\n array.highlightCell(iMarker.getPosition(), null, DEFAULT_TIMING);\r\n if (iMarker.getPosition() > 0)\r\n iMarker.move(iMarker.getPosition() - 1, null, DEFAULT_TIMING);\r\n else\r\n iMarker.moveBeforeStart(null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n lang.nextStep();\r\n code.unhighlight(\"decrementI\");\r\n }\r\n\r\n // some interaction...\r\n TrueFalseQuestionModel tfQuestion = new TrueFalseQuestionModel(\"tfQ\");\r\n tfQuestion.setPrompt(\"Did this work?\");\r\n tfQuestion.setPointsPossible(1);\r\n tfQuestion.setGroupID(\"demo\");\r\n tfQuestion.setCorrectAnswer(true);\r\n tfQuestion.setFeedbackForAnswer(true, \"Great!\");\r\n tfQuestion.setFeedbackForAnswer(false, \"argh!\");\r\n lang.addTFQuestion(tfQuestion);\r\n\r\n lang.nextStep();\r\n HtmlDocumentationModel link = new HtmlDocumentationModel(\"link\");\r\n link.setLinkAddress(\"http://www.heise.de\");\r\n lang.addDocumentationLink(link);\r\n\r\n lang.nextStep();\r\n MultipleChoiceQuestionModel mcq = new MultipleChoiceQuestionModel(\"mcq\");\r\n mcq.setPrompt(\"Which AV system can handle dynamic rewind?\");\r\n mcq.setGroupID(\"demo\");\r\n mcq.addAnswer(\"GAIGS\", -1, \"Only static images, not dynamic\");\r\n mcq.addAnswer(\"Animal\", 1, \"Good!\");\r\n mcq.addAnswer(\"JAWAA\", -2, \"Not at all!\");\r\n lang.addMCQuestion(mcq);\r\n\r\n lang.nextStep();\r\n MultipleSelectionQuestionModel msq = new MultipleSelectionQuestionModel(\r\n \"msq\");\r\n msq.setPrompt(\"Which of the following AV systems can handle interaction?\");\r\n msq.setGroupID(\"demo\");\r\n msq.addAnswer(\"Animal\", 2, \"Right - I hope!\");\r\n msq.addAnswer(\"JHAVE\", 2, \"Yep.\");\r\n msq.addAnswer(\"JAWAA\", 1, \"Only in Guido's prototype...\");\r\n msq.addAnswer(\"Leonardo\", -1, \"Nope.\");\r\n lang.addMSQuestion(msq);\r\n lang.nextStep();\r\n // Text text = lang.newText(new Offset(10, 20, \"array\", \"S\"), \"Hi\", \"hi\",\r\n // null);\r\n // lang.nextStep();\r\n }",
"private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"\\tSelection\\tBubble\\tInsertion\\tCollections\\tQuick\\tinPlaceQuick\\tMerge\");\r\n\t\tfor (int n = 1000; n <= 7000; n += 500) {\r\n\t\t\tAPArrayList<Double> lists = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listb = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listi = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listc = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listipq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listm = new APArrayList<Double>();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tDouble val = Math.random();\r\n\t\t\t\tlists.add(val);\r\n\t\t\t\tlistb.add(val);\r\n\t\t\t\tlisti.add(val);\r\n\t\t\t\tlistc.add(val);\r\n\t\t\t\tlistq.add(val);\r\n\t\t\t\tlistipq.add(val);\r\n\t\t\t\tlistm.add(val);\r\n\t\t\t}\r\n\r\n\t\t\tlong selStartTime = System.nanoTime();\r\n\t\t\tlists.selectionSort();\r\n\t\t\tlong selEndTime = System.nanoTime();\r\n\t\t\tlong selSortTime = selEndTime - selStartTime;\r\n\t\t\tlists.clear();\r\n\t\t\t\r\n\t\t\tlong bubStartTime = System.nanoTime();\r\n\t\t\tlistb.bubbleSort();\r\n\t\t\tlong bubEndTime = System.nanoTime();\r\n\t\t\tlong bubSortTime = bubEndTime - bubStartTime;\r\n\t\t\tlistb.clear();\r\n\t\t\t\r\n\t\t\tlong insStartTime = System.nanoTime();\r\n\t\t\tlisti.insertionSort();\r\n\t\t\tlong insEndTime = System.nanoTime();\r\n\t\t\tlong insSortTime = insEndTime - insStartTime;\r\n\t\t\tlisti.clear();\r\n\t\t\t\r\n\t\t\tlong CollStartTime = System.nanoTime();\r\n\t\t\tlistc.sort();\r\n\t\t\tlong CollEndTime = System.nanoTime();\r\n\t\t\tlong CollSortTime = CollEndTime - CollStartTime;\r\n\t\t\tlistc.clear();\r\n\t\t\t\r\n\t\t\tlong quickStartTime = System.nanoTime();\r\n\t\t\tlistq.simpleQuickSort();\r\n\t\t\tlong quickEndTime = System.nanoTime();\r\n\t\t\tlong quickSortTime = quickEndTime - quickStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\tlong inPlaceQuickStartTime = System.nanoTime();\r\n\t\t\tlistipq.inPlaceQuickSort();\r\n\t\t\tlong inPlaceQuickEndTime = System.nanoTime();\r\n\t\t\tlong inPlaceQuickSortTime = inPlaceQuickEndTime - inPlaceQuickStartTime;\r\n\t\t\tlistipq.clear();\r\n\t\t\t\r\n\t\t\tlong mergeStartTime = System.nanoTime();\r\n\t\t\tlistm.mergeSort();\r\n\t\t\tlong mergeEndTime = System.nanoTime();\r\n\t\t\tlong mergeSortTime = mergeEndTime - mergeStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(n + \"\\t\" + selSortTime + \"\\t\" + bubSortTime + \"\\t\" + insSortTime + \"\\t\" + CollSortTime + \"\\t\" + quickSortTime + \"\\t\" + inPlaceQuickSortTime + \"\\t\" + mergeSortTime);\r\n\t\t}\r\n\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}",
"public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}",
"private void sortGallery_10_Runnable() {\r\n\r\n\t\tif (_allPhotos == null || _allPhotos.length == 0) {\r\n\t\t\t// there are no files\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal GalleryMT20Item[] virtualGalleryItems = _galleryMT20.getAllVirtualItems();\r\n\t\tfinal int virtualSize = virtualGalleryItems.length;\r\n\r\n\t\tif (virtualSize == 0) {\r\n\t\t\t// there are no items\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// sort photos with new sorting algorithm\r\n\t\tArrays.sort(_sortedAndFilteredPhotos, getCurrentComparator());\r\n\r\n\t\tupdateUI_GalleryItems(_sortedAndFilteredPhotos, null);\r\n\t}",
"private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }",
"private static long sortingTime(String[] array, boolean isStandardSort) {\n long start = System.currentTimeMillis(); // starting time\n if (isStandardSort) \n Arrays.sort(array);\n selectionSort(array);\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }",
"@Override // java.util.Comparator\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public int compare(androidx.recyclerview.widget.GapWorker.Task r6, androidx.recyclerview.widget.GapWorker.Task r7) {\n /*\n r5 = this;\n androidx.recyclerview.widget.GapWorker$Task r6 = (androidx.recyclerview.widget.GapWorker.Task) r6\n androidx.recyclerview.widget.GapWorker$Task r7 = (androidx.recyclerview.widget.GapWorker.Task) r7\n androidx.recyclerview.widget.RecyclerView r5 = r6.view\n r0 = 0\n r1 = 1\n if (r5 != 0) goto L_0x000c\n r2 = r1\n goto L_0x000d\n L_0x000c:\n r2 = r0\n L_0x000d:\n androidx.recyclerview.widget.RecyclerView r3 = r7.view\n if (r3 != 0) goto L_0x0013\n r3 = r1\n goto L_0x0014\n L_0x0013:\n r3 = r0\n L_0x0014:\n r4 = -1\n if (r2 == r3) goto L_0x001d\n if (r5 != 0) goto L_0x001b\n L_0x0019:\n r0 = r1\n goto L_0x0037\n L_0x001b:\n r0 = r4\n goto L_0x0037\n L_0x001d:\n boolean r5 = r6.immediate\n boolean r2 = r7.immediate\n if (r5 == r2) goto L_0x0026\n if (r5 == 0) goto L_0x0019\n goto L_0x001b\n L_0x0026:\n int r5 = r7.viewVelocity\n int r1 = r6.viewVelocity\n int r5 = r5 - r1\n if (r5 == 0) goto L_0x002f\n L_0x002d:\n r0 = r5\n goto L_0x0037\n L_0x002f:\n int r5 = r6.distanceToItem\n int r6 = r7.distanceToItem\n int r5 = r5 - r6\n if (r5 == 0) goto L_0x0037\n goto L_0x002d\n L_0x0037:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.recyclerview.widget.GapWorker.AnonymousClass1.compare(java.lang.Object, java.lang.Object):int\");\n }",
"public void sort() {\n\t\tfor (int i = 1; i < this.dataModel.getLength(); i++) {\n\t\t\tfinal int x = this.dataModel.get(i);\n\n\t\t\t// Find location to insert using binary search\n\t\t\tfinal int j = Math.abs(this.dataModel.binarySearch(0, i, x) + 1);\n\n\t\t\t// Shifting array to one location right\n\t\t\tthis.dataModel.arrayCopy(j, j + 1, i - j);\n\n\t\t\t// Placing element at its correct location\n\t\t\tthis.dataModel.set(j, x);\n\t\t\tthis.repaint(this.count++);\n\t\t}\n\t}",
"public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }",
"private static void fourSorts(int[] array) {\n\t\tStopWatch1 timer;\n\t\tint[] temp;\n\t\t//Performs insertion sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.insertionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\n\t\t//Performs selection sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.selectionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs quick sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.quickSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs merge sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.mergeSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t}",
"private void orderSegments() {\n //insert numOrder for the db\n int i = 0;\n for(TransportSegmentLogic transportSegment: transportSegments){\n transportSegment.setOrder(i);\n i++;\n }\n\n\n\n /*int i = 0;\n int j = 1;\n\n\n TransportSegmentLogic swapSegment;\n\n while(j < transportSegments.size()){\n if(transportSegments.get(j).getOrigin().equals(transportSegments.get(i).getDestination())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(i +1, swapSegment);\n i = i + 1;\n j = i + 1;\n }\n j++;\n }\n\n j = transportSegments.size() -1;\n\n while(j > i){\n if(transportSegments.get(j).getDestination().equals(transportSegments.get(0).getOrigin())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(0, swapSegment);\n i = i + 1;\n j = transportSegments.size();\n }\n j--;\n } */\n }",
"public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }",
"private synchronized void freshSort(){\n Process[] newQueue = new Process[pros.proSize()];\n for(int i = 0; i <queue.length; i++){\n if(pros.isInList(queue[i])){\n newQueue[i] = queue[i];\n }\n }\n queue = new Process[pros.proSize()];\n queue = newQueue;\n }",
"public void sortFullList()\r\n {\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"[\" + this.id + \"] sorting full data\");\r\n }\r\n sortRowList(this.getRowListFull());\r\n }",
"private void updateFilteringAndSorting() {\n log.debug(\"update filtering of adapter called\");\n if (lastUsedComparator != null) {\n sortWithoutNotify(lastUsedComparator, lastUsedAsc);\n }\n Filter filter = getFilter();\n if (filter instanceof UpdateableFilter){\n ((UpdateableFilter)filter).updateFiltering();\n }\n }",
"private static void evaluateMergesortVogellaThreaded() {\n\n // LOGGER.info(\"evaluating parallel mergesort with Java Threads based on the Vogella version\");\n\n // The time before start to sort.\n long startTime;\n\n // The time after sort.\n long endTime;\n\n // generate sorted array\n numbers = generateSortedArray(ARRAY_SIZE);\n\n // get array to evaluate\n generateWorstUnsortArray(numbers);\n\n // get systemtime before sorting\n startTime = System.currentTimeMillis();\n\n // sort\n msVogellaJThreads.sort(numbers);\n\n // get systemtime after sorting\n endTime = System.currentTimeMillis();\n\n // show the result of the sorting process\n System.out.println(\"\\n- Sortierergebnis: Java Threads (Vogella) -\");\n System.out.println(\"Die sortierte Folge lautet: \" + arrayToString(numbers));\n System.out.printf(\"Für die Sortierung wurden %d ms benötigt\", endTime - startTime);\n System.out.println(\"\\n------------------------------------------------\\n\");\n }",
"public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}",
"public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }",
"public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }",
"void sortUI();",
"private static long sortingTime(double[] array, boolean isStandardSort) {\n long start = 0; // starting time\n if (isStandardSort) { \n start = System.currentTimeMillis(); \n Arrays.sort(array);\n } else {\t\n start = System.currentTimeMillis();\n selectionSort(array);\n }\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }",
"public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }",
"private void compressBlocks(final int phaseId) {\n // 1. uncross all crossing blocks: O(|G|)\n popBlocks(head -> head.isTerminal() && head.getPhaseId() < phaseId,\n tail -> tail.isTerminal() && tail.getPhaseId() < phaseId);\n\n List<BlockRecord<N, S>> shortBlockRecords = new ArrayList<>();\n List<BlockRecord<N, S>> longBlockRecords = new ArrayList<>();\n\n // 2. get all blocks: O(|G|)\n slp.getProductions().stream().forEach(rule -> consumeBlocks(rule.getRight(), shortBlockRecords::add, longBlockRecords::add, letter -> true));\n\n // 3.1 sort short blocks using RadixSort: O(|G|)\n sortBlocks(shortBlockRecords);\n\n // 3.2 sort long blocks O((n+m) log(n+m))\n Collections.sort(longBlockRecords, blockComparator);\n List<BlockRecord<N, S>> blockRecords = mergeBlocks(shortBlockRecords, longBlockRecords);\n\n // compress blocks\n BlockRecord<N, S> lastRecord = null;\n S letter = null;\n\n // 4. compress blocks: O(|G|)\n for(BlockRecord<N, S> record : blockRecords) {\n\n // check when it is the correct time to introduce a fresh letter\n if(lastRecord == null || !lastRecord.equals(record)) {\n letter = terminalAlphabet.createTerminal(phase, 1L, record.node.getElement().getLength() * record.block.getLength(), record.block);\n lastRecord = record;\n }\n replaceBlock(record, letter);\n }\n }",
"public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }"
] | [
"0.71958536",
"0.62565136",
"0.6211859",
"0.6066874",
"0.60649514",
"0.60547626",
"0.6042697",
"0.60229224",
"0.60208774",
"0.6018803",
"0.5967496",
"0.59531975",
"0.5936611",
"0.59034646",
"0.58325744",
"0.5803332",
"0.57898223",
"0.5735091",
"0.56754756",
"0.56691617",
"0.56315297",
"0.56141055",
"0.5614064",
"0.56133956",
"0.5596241",
"0.5594053",
"0.5591207",
"0.5589715",
"0.55570346",
"0.5556744",
"0.55520993",
"0.5547199",
"0.5538552",
"0.553682",
"0.553682",
"0.5535173",
"0.55313975",
"0.5528798",
"0.5524029",
"0.552128",
"0.5517468",
"0.5514557",
"0.5509532",
"0.5504564",
"0.5496435",
"0.54771304",
"0.54768634",
"0.54753083",
"0.54436463",
"0.5439351",
"0.54388607",
"0.5431832",
"0.5425818",
"0.5406829",
"0.540516",
"0.54008496",
"0.54005593",
"0.5397498",
"0.5396155",
"0.539353",
"0.5388475",
"0.53876966",
"0.53864014",
"0.5372252",
"0.5348514",
"0.534409",
"0.53425384",
"0.53310883",
"0.5316419",
"0.53089523",
"0.5307931",
"0.53077245",
"0.5307338",
"0.5293772",
"0.5293408",
"0.5292075",
"0.52902186",
"0.5286798",
"0.52836347",
"0.52826256",
"0.5270687",
"0.5266422",
"0.5266419",
"0.5264624",
"0.52627313",
"0.5261853",
"0.52548265",
"0.5252035",
"0.5247527",
"0.52455163",
"0.5241727",
"0.52413034",
"0.52404505",
"0.5240351",
"0.52270204",
"0.52259195",
"0.5224885",
"0.52244425",
"0.522045",
"0.52198964",
"0.5219359"
] | 0.0 | -1 |
/ Enabled aggressive block sorting | public final int hashCode() {
int n = 0;
int n2 = this.getClass().getName().hashCode();
int n3 = Arrays.hashCode(this.zzlmn);
int n4 = this.zzlmo == null ? 0 : this.zzlmo.hashCode();
long l = Double.doubleToLongBits(this.zzlmp);
int n5 = (int)(l ^ l >>> 32);
int n6 = Float.floatToIntBits(this.zzlmq);
int n7 = (int)(this.zzlmr ^ this.zzlmr >>> 32);
int n8 = this.zzlms;
int n9 = this.zzlmt;
int n10 = this.zzlmu ? 1231 : 1237;
int n11 = zzfjq.hashCode(this.zzlmv);
int n12 = zzfjq.hashCode(this.zzlmw);
int n13 = zzfjq.hashCode(this.zzlmx);
int n14 = zzfjq.hashCode(this.zzlmy);
int n15 = zzfjq.hashCode(this.zzlmz);
int n16 = (int)(this.zzlna ^ this.zzlna >>> 32);
int n17 = n;
if (this.zzpnc == null) return (((((((n10 + ((((((n4 + ((n2 + 527) * 31 + n3) * 31) * 31 + n5) * 31 + n6) * 31 + n7) * 31 + n8) * 31 + n9) * 31) * 31 + n11) * 31 + n12) * 31 + n13) * 31 + n14) * 31 + n15) * 31 + n16) * 31 + n17;
if (this.zzpnc.isEmpty()) {
n17 = n;
return (((((((n10 + ((((((n4 + ((n2 + 527) * 31 + n3) * 31) * 31 + n5) * 31 + n6) * 31 + n7) * 31 + n8) * 31 + n9) * 31) * 31 + n11) * 31 + n12) * 31 + n13) * 31 + n14) * 31 + n15) * 31 + n16) * 31 + n17;
}
n17 = this.zzpnc.hashCode();
return (((((((n10 + ((((((n4 + ((n2 + 527) * 31 + n3) * 31) * 31 + n5) * 31 + n6) * 31 + n7) * 31 + n8) * 31 + n9) * 31) * 31 + n11) * 31 + n12) * 31 + n13) * 31 + n14) * 31 + n15) * 31 + n16) * 31 + n17;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void sortBlocks(){\n\t\tCurrentSets = getCurrentSets();\n\t\tif(CurrentSets == 1){\n\t\t\treturn;\n\t\t}else{\n\t\t\tfor(i = 0; i < CurrentSets - 1; i++){\n\t\t\t\tfor(j = i + 1; j < CurrentSets; j++){\n\t\t\t\t\tif((Integer.parseInt(blocks[i].getHexTag(), 16)) > (Integer.parseInt(blocks[j].getHexTag(), 16))){\n\t\t\t\t\t\ttemp = blocks[j];\n\t\t\t\t\t\tblocks[j] = blocks[i];\n\t\t\t\t\t\tblocks[i] = temp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void sort(IAlg algorithm, boolean decrescent){}",
"private static void sortingMemo() {\n\t\t\n\t}",
"public void sort()throws InterruptedException{\n\t\tfor (int i = 0; i < a.length - 1; i++) {\n\t\t\tint minPos = minPosition(i);\n\t\t\tsortStateLock.lock();\n\t\t\ttry{\n\t\t\t\tswap(minPos, i);\n\t\t\t\t// For animation\n\t\t\t\talreadySorted = i;\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tsortStateLock.unlock();\n\t\t \t\t}\n\t\t\tpause(2);\n\t }\n }",
"public FastNondominatedSorting() {\r\n\t\tthis(new ParetoDominanceComparator());\r\n\t}",
"private PerfectMergeSort() {}",
"@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}",
"public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }",
"public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }",
"public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private void sort() {\n\t\trunPassZero();\n\t\tList<TupleReaderBinary> buffers = new ArrayList<>();\n\t\tList<Tuple> sortStage = new ArrayList<>();\n\t\tassert (readerBucketID == 0);\n\t\tassert (writerBucketID == 0);\n\t\tassert (passNumber == 1);\n\t\tassert (currentGroup == 1);\n\t\toutputBuffer.clear();\n\n\t\t// assign buffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tbuffers.add(null);\n\t\t\tassignBuffer(buffers, i);\n\t\t\tsortStage.add(null);\n\t\t}\n\n\t\tassert (buffers.size() == numInputBuffers);\n\t\tassert (sortStage.size() == numInputBuffers);\n\n\t\t// read from buffers into list of size numInputBuffers\n\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t}\n\n\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\" + instanceHashcode\n\t\t\t\t+ \"_\" + passNumber + \"_\" + writerBucketID);\n\n\t\twhile (true) {\n\t\t\tif (!findAndReplaceSmallest(buffers, sortStage)) {\n\t\t\t\tprevPrevTotalBuckets = prevTotalBuckets;\n\t\t\t\tprevTotalBuckets = writerBucketID + 1;\n\t\t\t\tflushOutputBuffer();\n\t\t\t\toutputWriter.close();\n\n\t\t\t\t// We are done! Return\n\t\t\t\tif (prevTotalBuckets == 1) {\n\t\t\t\t\tdeleteTempFiles();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twriterBucketID = 0;\n\t\t\t\treaderBucketID = 0;\n\t\t\t\twriterFlushes = 0;\n\t\t\t\tdeleteTempFiles();\n\t\t\t\tpassNumber++;\n\t\t\t\tcurrentGroup = 1;\n\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tassignBuffer(buffers, i);\n\t\t\t\t\tsortStage.add(null);\n\t\t\t\t}\n\t\t\t\tfor (int i = 0; i < numInputBuffers; i++) {\n\t\t\t\t\tsortStage.set(i, readFromBuffer(buffers, i));\n\t\t\t\t}\n\n\t\t\t\toutputWriter = new TupleWriterBinary(DatabaseCatalog.getInstance().getTempDirectory() + \"/\"\n\t\t\t\t\t\t+ instanceHashcode + \"_\" + passNumber + \"_\" + writerBucketID);\n\t\t\t}\n\t\t}\n\n\t}",
"public void radixSorting() {\n\t\t\n\t}",
"public void sort() {\n }",
"public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}",
"public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}",
"private void trIntroSort(int r34, int r35, int r36, int r37, int r38, io.netty.handler.codec.compression.Bzip2DivSufSort.TRBudget r39, int r40) {\n /*\n r33 = this;\n r0 = r33;\n r0 = r0.SA;\n r16 = r0;\n r4 = 64;\n r0 = new io.netty.handler.codec.compression.Bzip2DivSufSort.StackEntry[r4];\n r29 = r0;\n r32 = 0;\n r27 = 0;\n r4 = r38 - r37;\n r22 = trLog(r4);\n r28 = r27;\n r23 = r22;\n L_0x001a:\n if (r23 >= 0) goto L_0x02b6;\n L_0x001c:\n r4 = -1;\n r0 = r23;\n if (r0 != r4) goto L_0x01a4;\n L_0x0021:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x0050;\n L_0x002d:\n r22 = r23;\n L_0x002f:\n r26 = 0;\n L_0x0031:\n r0 = r26;\n r1 = r28;\n if (r0 >= r1) goto L_0x072a;\n L_0x0037:\n r4 = r29[r26];\n r4 = r4.d;\n r5 = -3;\n if (r4 != r5) goto L_0x004d;\n L_0x003e:\n r4 = r29[r26];\n r4 = r4.b;\n r5 = r29[r26];\n r5 = r5.c;\n r0 = r33;\n r1 = r34;\n r0.lsUpdateGroup(r1, r4, r5);\n L_0x004d:\n r26 = r26 + 1;\n goto L_0x0031;\n L_0x0050:\n r6 = r35 + -1;\n r10 = r38 + -1;\n r4 = r33;\n r5 = r34;\n r7 = r36;\n r8 = r37;\n r9 = r38;\n r25 = r4.trPartition(r5, r6, r7, r8, r9, r10);\n r0 = r25;\n r8 = r0.first;\n r0 = r25;\n r9 = r0.last;\n r0 = r37;\n if (r0 < r8) goto L_0x0072;\n L_0x006e:\n r0 = r38;\n if (r9 >= r0) goto L_0x016d;\n L_0x0072:\n r0 = r38;\n if (r8 >= r0) goto L_0x0087;\n L_0x0076:\n r17 = r37;\n r31 = r8 + -1;\n L_0x007a:\n r0 = r17;\n if (r0 >= r8) goto L_0x0087;\n L_0x007e:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x007a;\n L_0x0087:\n r0 = r38;\n if (r9 >= r0) goto L_0x009c;\n L_0x008b:\n r17 = r8;\n r31 = r9 + -1;\n L_0x008f:\n r0 = r17;\n if (r0 >= r9) goto L_0x009c;\n L_0x0093:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x008f;\n L_0x009c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = 0;\n r6 = 0;\n r4.<init>(r5, r8, r9, r6);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + -1;\n r6 = -2;\n r0 = r37;\n r1 = r38;\n r4.<init>(r5, r0, r1, r6);\n r29[r27] = r4;\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x0117;\n L_0x00bd:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x00e3;\n L_0x00c2:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r38 - r9;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r9, r1, r5);\n r29[r28] = r4;\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n L_0x00dd:\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x00e3:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x00f3;\n L_0x00e8:\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x00f3:\n if (r28 != 0) goto L_0x00fa;\n L_0x00f5:\n r27 = r28;\n r22 = r23;\n L_0x00f9:\n return;\n L_0x00fa:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x0117:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0138;\n L_0x011c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r8 - r37;\n r5 = trLog(r5);\n r0 = r35;\n r1 = r37;\n r4.<init>(r0, r1, r8, r5);\n r29[r28] = r4;\n r37 = r9;\n r4 = r38 - r9;\n r22 = trLog(r4);\n goto L_0x00dd;\n L_0x0138:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0148;\n L_0x013d:\n r38 = r8;\n r4 = r8 - r37;\n r22 = trLog(r4);\n r27 = r28;\n goto L_0x00dd;\n L_0x0148:\n if (r28 != 0) goto L_0x014f;\n L_0x014a:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x014f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x016d:\n r17 = r37;\n L_0x016f:\n r0 = r17;\n r1 = r38;\n if (r0 >= r1) goto L_0x017e;\n L_0x0175:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r17;\n r17 = r17 + 1;\n goto L_0x016f;\n L_0x017e:\n if (r28 != 0) goto L_0x0186;\n L_0x0180:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0186:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n goto L_0x00dd;\n L_0x01a4:\n r4 = -2;\n r0 = r23;\n if (r0 != r4) goto L_0x01ea;\n L_0x01a9:\n r27 = r28 + -1;\n r4 = r29[r27];\n r8 = r4.b;\n r4 = r29[r27];\n r9 = r4.c;\n r11 = r35 - r34;\n r4 = r33;\n r5 = r34;\n r6 = r36;\n r7 = r37;\n r10 = r38;\n r4.trCopy(r5, r6, r7, r8, r9, r10, r11);\n if (r27 != 0) goto L_0x01c8;\n L_0x01c4:\n r22 = r23;\n goto L_0x00f9;\n L_0x01c8:\n r27 = r27 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x01ea:\n r4 = r16[r37];\n if (r4 < 0) goto L_0x0202;\n L_0x01ee:\n r8 = r37;\n L_0x01f0:\n r4 = r16[r8];\n r4 = r4 + r34;\n r16[r4] = r8;\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0200;\n L_0x01fc:\n r4 = r16[r8];\n if (r4 >= 0) goto L_0x01f0;\n L_0x0200:\n r37 = r8;\n L_0x0202:\n r0 = r37;\n r1 = r38;\n if (r0 >= r1) goto L_0x028c;\n L_0x0208:\n r8 = r37;\n L_0x020a:\n r4 = r16[r8];\n r4 = r4 ^ -1;\n r16[r8] = r4;\n r8 = r8 + 1;\n r4 = r16[r8];\n if (r4 < 0) goto L_0x020a;\n L_0x0216:\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r5 = r16[r8];\n r5 = r5 + r35;\n r5 = r16[r5];\n if (r4 == r5) goto L_0x0241;\n L_0x0224:\n r4 = r8 - r37;\n r4 = r4 + 1;\n r24 = trLog(r4);\n L_0x022c:\n r8 = r8 + 1;\n r0 = r38;\n if (r8 >= r0) goto L_0x0244;\n L_0x0232:\n r9 = r37;\n r31 = r8 + -1;\n L_0x0236:\n if (r9 >= r8) goto L_0x0244;\n L_0x0238:\n r4 = r16[r9];\n r4 = r4 + r34;\n r16[r4] = r31;\n r9 = r9 + 1;\n goto L_0x0236;\n L_0x0241:\n r24 = -1;\n goto L_0x022c;\n L_0x0244:\n r4 = r8 - r37;\n r5 = r38 - r8;\n if (r4 > r5) goto L_0x0264;\n L_0x024a:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = -3;\n r0 = r35;\n r1 = r38;\n r4.<init>(r0, r8, r1, r5);\n r29[r28] = r4;\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0264:\n r4 = 1;\n r5 = r38 - r8;\n if (r4 >= r5) goto L_0x0282;\n L_0x0269:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r37;\n r1 = r24;\n r4.<init>(r5, r0, r8, r1);\n r29[r28] = r4;\n r37 = r8;\n r22 = -3;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0282:\n r35 = r35 + 1;\n r38 = r8;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x028c:\n if (r28 != 0) goto L_0x0294;\n L_0x028e:\n r27 = r28;\n r22 = r23;\n goto L_0x00f9;\n L_0x0294:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x02b6:\n r4 = r38 - r37;\n r5 = 8;\n if (r4 > r5) goto L_0x02d5;\n L_0x02bc:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 != 0) goto L_0x02cc;\n L_0x02c8:\n r22 = r23;\n goto L_0x002f;\n L_0x02cc:\n r33.trInsertionSort(r34, r35, r36, r37, r38);\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x02d5:\n r22 = r23 + -1;\n if (r23 != 0) goto L_0x0331;\n L_0x02d9:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x02e5:\n r15 = r38 - r37;\n r10 = r33;\n r11 = r34;\n r12 = r35;\n r13 = r36;\n r14 = r37;\n r10.trHeapSort(r11, r12, r13, r14, r15);\n r8 = r38 + -1;\n L_0x02f6:\n r0 = r37;\n if (r0 >= r8) goto L_0x032b;\n L_0x02fa:\n r4 = r16[r8];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r9 = r8 + -1;\n L_0x030a:\n r0 = r37;\n if (r0 > r9) goto L_0x0329;\n L_0x030e:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r4 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n if (r4 != r0) goto L_0x0329;\n L_0x0320:\n r4 = r16[r9];\n r4 = r4 ^ -1;\n r16[r9] = r4;\n r9 = r9 + -1;\n goto L_0x030a;\n L_0x0329:\n r8 = r9;\n goto L_0x02f6;\n L_0x032b:\n r22 = -3;\n r23 = r22;\n goto L_0x001a;\n L_0x0331:\n r8 = r33.trPivot(r34, r35, r36, r37, r38);\n r0 = r16;\n r1 = r37;\n r2 = r16;\n swapElements(r0, r1, r2, r8);\n r4 = r16[r37];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r31 = r0.trGetC(r1, r2, r3, r4);\n r9 = r37 + 1;\n L_0x034e:\n r0 = r38;\n if (r9 >= r0) goto L_0x0369;\n L_0x0352:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0369;\n L_0x0366:\n r9 = r9 + 1;\n goto L_0x034e;\n L_0x0369:\n r8 = r9;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x036e:\n r0 = r32;\n r1 = r31;\n if (r0 >= r1) goto L_0x039e;\n L_0x0374:\n r9 = r9 + 1;\n r0 = r38;\n if (r9 >= r0) goto L_0x039e;\n L_0x037a:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x039e;\n L_0x038e:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0374;\n L_0x0394:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0374;\n L_0x039e:\n r17 = r38 + -1;\n L_0x03a0:\n r0 = r17;\n if (r9 >= r0) goto L_0x03bb;\n L_0x03a4:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03bb;\n L_0x03b8:\n r17 = r17 + -1;\n goto L_0x03a0;\n L_0x03bb:\n r18 = r17;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03c1:\n r0 = r32;\n r1 = r31;\n if (r0 <= r1) goto L_0x03f5;\n L_0x03c7:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x03cd:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x03e1:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x03c7;\n L_0x03e7:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x03c7;\n L_0x03f5:\n r0 = r17;\n if (r9 >= r0) goto L_0x045a;\n L_0x03f9:\n r0 = r16;\n r1 = r16;\n r2 = r17;\n swapElements(r0, r9, r1, r2);\n L_0x0402:\n r9 = r9 + 1;\n r0 = r17;\n if (r9 >= r0) goto L_0x042c;\n L_0x0408:\n r4 = r16[r9];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 > r1) goto L_0x042c;\n L_0x041c:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x0402;\n L_0x0422:\n r0 = r16;\n r1 = r16;\n swapElements(r0, r9, r1, r8);\n r8 = r8 + 1;\n goto L_0x0402;\n L_0x042c:\n r17 = r17 + -1;\n r0 = r17;\n if (r9 >= r0) goto L_0x03f5;\n L_0x0432:\n r4 = r16[r17];\n r0 = r33;\n r1 = r34;\n r2 = r35;\n r3 = r36;\n r32 = r0.trGetC(r1, r2, r3, r4);\n r0 = r32;\n r1 = r31;\n if (r0 < r1) goto L_0x03f5;\n L_0x0446:\n r0 = r32;\n r1 = r31;\n if (r0 != r1) goto L_0x042c;\n L_0x044c:\n r0 = r16;\n r1 = r17;\n r2 = r16;\n r3 = r18;\n swapElements(r0, r1, r2, r3);\n r18 = r18 + -1;\n goto L_0x042c;\n L_0x045a:\n r0 = r18;\n if (r8 > r0) goto L_0x0716;\n L_0x045e:\n r17 = r9 + -1;\n r26 = r8 - r37;\n r30 = r9 - r8;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x046c;\n L_0x046a:\n r26 = r30;\n L_0x046c:\n r19 = r37;\n r21 = r9 - r26;\n L_0x0470:\n if (r26 <= 0) goto L_0x0484;\n L_0x0472:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0470;\n L_0x0484:\n r26 = r18 - r17;\n r4 = r38 - r18;\n r30 = r4 + -1;\n r0 = r26;\n r1 = r30;\n if (r0 <= r1) goto L_0x0492;\n L_0x0490:\n r26 = r30;\n L_0x0492:\n r19 = r9;\n r21 = r38 - r26;\n L_0x0496:\n if (r26 <= 0) goto L_0x04aa;\n L_0x0498:\n r0 = r16;\n r1 = r19;\n r2 = r16;\n r3 = r21;\n swapElements(r0, r1, r2, r3);\n r26 = r26 + -1;\n r19 = r19 + 1;\n r21 = r21 + 1;\n goto L_0x0496;\n L_0x04aa:\n r4 = r9 - r8;\n r8 = r37 + r4;\n r4 = r18 - r17;\n r9 = r38 - r4;\n r4 = r16[r8];\n r4 = r4 + r34;\n r4 = r16[r4];\n r0 = r31;\n if (r4 == r0) goto L_0x04d3;\n L_0x04bc:\n r4 = r9 - r8;\n r24 = trLog(r4);\n L_0x04c2:\n r17 = r37;\n r31 = r8 + -1;\n L_0x04c6:\n r0 = r17;\n if (r0 >= r8) goto L_0x04d6;\n L_0x04ca:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04c6;\n L_0x04d3:\n r24 = -1;\n goto L_0x04c2;\n L_0x04d6:\n r0 = r38;\n if (r9 >= r0) goto L_0x04eb;\n L_0x04da:\n r17 = r8;\n r31 = r9 + -1;\n L_0x04de:\n r0 = r17;\n if (r0 >= r9) goto L_0x04eb;\n L_0x04e2:\n r4 = r16[r17];\n r4 = r4 + r34;\n r16[r4] = r31;\n r17 = r17 + 1;\n goto L_0x04de;\n L_0x04eb:\n r4 = r8 - r37;\n r5 = r38 - r9;\n if (r4 > r5) goto L_0x060c;\n L_0x04f1:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x0571;\n L_0x04f7:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x051e;\n L_0x04fc:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x051e:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0538;\n L_0x0523:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0538:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0549;\n L_0x053d:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0549:\n if (r28 != 0) goto L_0x054f;\n L_0x054b:\n r27 = r28;\n goto L_0x00f9;\n L_0x054f:\n r27 = r28 + -1;\n r20 = r29[r27];\n r0 = r20;\n r0 = r0.a_isRightVersion;\n r35 = r0;\n r0 = r20;\n r0 = r0.b;\n r37 = r0;\n r0 = r20;\n r0 = r0.c;\n r38 = r0;\n r0 = r20;\n r0 = r0.d;\n r22 = r0;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0571:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x05c6;\n L_0x0577:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x059e;\n L_0x057c:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x059e:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05c0;\n L_0x05a3:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x05c0:\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x05c6:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x05f5;\n L_0x05cb:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x05f5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x060c:\n r4 = r8 - r37;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x067b;\n L_0x0612:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x0639;\n L_0x0617:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x0639:\n r4 = 1;\n r5 = r8 - r37;\n if (r4 >= r5) goto L_0x0653;\n L_0x063e:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r28] = r4;\n r38 = r8;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0653:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x0664;\n L_0x0658:\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x0664:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r38;\n r3 = r22;\n r4.<init>(r0, r1, r2, r3);\n r29[r28] = r4;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x067b:\n r4 = r38 - r9;\n r5 = r9 - r8;\n if (r4 > r5) goto L_0x06d0;\n L_0x0681:\n r4 = 1;\n r5 = r38 - r9;\n if (r4 >= r5) goto L_0x06a8;\n L_0x0686:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r5 = r35 + 1;\n r0 = r24;\n r4.<init>(r5, r8, r9, r0);\n r29[r27] = r4;\n r37 = r9;\n r23 = r22;\n goto L_0x001a;\n L_0x06a8:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ca;\n L_0x06ad:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x06ca:\n r38 = r8;\n r23 = r22;\n goto L_0x001a;\n L_0x06d0:\n r4 = 1;\n r5 = r9 - r8;\n if (r4 >= r5) goto L_0x06ff;\n L_0x06d5:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r28 = r27 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r38;\n r2 = r22;\n r4.<init>(r0, r9, r1, r2);\n r29[r27] = r4;\n r35 = r35 + 1;\n r37 = r8;\n r38 = r9;\n r22 = r24;\n r23 = r22;\n goto L_0x001a;\n L_0x06ff:\n r27 = r28 + 1;\n r4 = new io.netty.handler.codec.compression.Bzip2DivSufSort$StackEntry;\n r0 = r35;\n r1 = r37;\n r2 = r22;\n r4.<init>(r0, r1, r8, r2);\n r29[r28] = r4;\n r37 = r9;\n r28 = r27;\n r23 = r22;\n goto L_0x001a;\n L_0x0716:\n r4 = r38 - r37;\n r0 = r39;\n r1 = r40;\n r4 = r0.update(r1, r4);\n if (r4 == 0) goto L_0x002f;\n L_0x0722:\n r22 = r22 + 1;\n r35 = r35 + 1;\n r23 = r22;\n goto L_0x001a;\n L_0x072a:\n r27 = r28;\n goto L_0x00f9;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.netty.handler.codec.compression.Bzip2DivSufSort.trIntroSort(int, int, int, int, int, io.netty.handler.codec.compression.Bzip2DivSufSort$TRBudget, int):void\");\n }",
"public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}",
"@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}",
"@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }",
"@Override\n\tvoid sort(int[] array, SortingVisualizer display) {\n\t\tSystem.out.println(\"a\");\n\t\tboolean sorted = false;\n\t\tboolean h = true;\n\t\twhile (sorted == false) {\nh=true;\n\t\t\t// System.out.println(\"1\");\n\t\t\tRandom x = new Random();\n\t\t\tint y = x.nextInt(array.length);\n\n\t\t\tint el1 = array[y];\n\t\t\tint z = x.nextInt(array.length);\n\t\t\tint el2 = array[z];\n\n\t\t\tarray[y] = el2;\n\t\t\tarray[z] = el1;\n\t\t\tfor (int i = 0; i < array.length - 1; i++) {\n/*\n\t\t\t\tif (array[i] < array[i + 1]) {\n\n\t\t\t\t\th = true;\n\n\t\t\t\t}*/\n\n\t\t\t\tif (array[i] > array[i + 1]) {\n\t\t\t\t\th = false;\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (h == true) {\n\n\t\t\t\tsorted = true;\n\t\t\t}\n\n\t\t\tdisplay.updateDisplay();\n\t\t\t\n\t\t}\n\t}",
"public List<SimulinkBlock> generateBlockOrder(UnmodifiableCollection<SimulinkBlock> unmodifiableCollection,\n\t\t\tSet<SimulinkBlock> unsortedBlocks) {\n\t\tSet<SimulinkBlock> unsorted = new HashSet<SimulinkBlock>();\n\t\tSet<SimulinkBlock> unsortedRev = new HashSet<SimulinkBlock>();\n\t\tList<SimulinkBlock> sorted = new LinkedList<SimulinkBlock>();\n\n\t\t// start with source blocks without input\n\t\tfor (SimulinkBlock block : unmodifiableCollection) {\n\t\t\tif (block.getInPorts().isEmpty()) {\n\t\t\t\tsorted.add(block);\n\t\t\t} else {\n\t\t\t\tunsorted.add(block);\n\t\t\t}\n\t\t}\n\n\t\tint sizeBefore = 0;\n\t\tint sizeAfter = 0;\n\t\tdo {\n\t\t\tsizeBefore = unsorted.size();\n\t\t\tfor (SimulinkBlock myBlock : unsorted) {\n\t\t\t\tunsortedRev.add(myBlock);\n\t\t\t}\n\t\t\tunsorted.clear();\n\t\t\tfor (SimulinkBlock block : unsortedRev) {\n\t\t\t\tboolean allPredeccesorsAvailable = specialBlockChecking(block, sorted);\n\t\t\t\tif (allPredeccesorsAvailable) {\n\t\t\t\t\tsorted.add(block);\n\t\t\t\t} else {\n\t\t\t\t\tunsorted.add(block);\n\t\t\t\t}\n\t\t\t}\n\t\t\tsizeAfter = unsorted.size();\n\t\t\tunsortedRev.clear();\n\t\t} while ((!(unsorted.isEmpty())) && (!(sizeBefore == sizeAfter)));\n\n\t\tfor (SimulinkBlock block : unsorted) {\n\t\t\t// TODO sort the last unsorted blocks\n\t\t\tPluginLogger\n\t\t\t\t\t.info(\"Currently unsorted after sorting : \" + block.getName() + \" of type \" + block.getType());\n\t\t\tsorted.add(block);\n\t\t\tunsortedBlocks.add(block);\n\t\t}\n\t\treturn sorted;\n\t}",
"@Test\n public void doubleSortWithExchangeUnbalancedNodes() {\n ExternalSort es1 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), ARBTRIARY_LEAF, Collections.emptyList(), false);\n SingleSender ss = new SingleSender(OpProps.prototype(1, Long.MAX_VALUE).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), Mockito.mock(BatchSchema.class), es1, 0,\n MinorFragmentIndexEndpoint.newBuilder().setMinorFragmentId(0).build());\n Fragment f1 = new Fragment();\n f1.addOperator(ss);\n Wrapper w1 = new Wrapper(f1, 0);\n w1.overrideEndpoints(Arrays.asList(N1, N2));\n\n UnorderedReceiver or = new UnorderedReceiver(OpProps.prototype(1, Long.MAX_VALUE), Mockito.mock(BatchSchema.class), 0, Collections.emptyList(), false);\n ExternalSort es2 = new ExternalSort(OpProps.prototype(0, Long.MAX_VALUE).cloneWithMemoryExpensive(true).cloneWithMemoryFactor(options.getOption(SORT_FACTOR)).cloneWithBound(options.getOption(SORT_BOUNDED)), or, Collections.emptyList(), false);\n Fragment f2 = new Fragment();\n f2.addOperator(es2);\n Wrapper w2 = new Wrapper(f2, 0);\n w2.overrideEndpoints(Collections.singletonList(N1));\n\n\n MemoryAllocationUtilities.setMemory(options, ImmutableMap.of(f1, w1, f2, w2), 10 + adjustReserve);\n assertEquals(3L, es1.getProps().getMemLimit());\n assertEquals(3L, es2.getProps().getMemLimit());\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tfor (int i = 0; i < 1000000; i++) {\n\t\t\t\tint[] a = Util.generateRandomArray(500, 200000);\n\t\t\t\tint[] b = a.clone();\n\t\t\t\t\n\t\t\t\ta = sort(a);\n\t\t\t\tArrays.sort(b);\n\t\t\t\t\n\t\t\t\tfor (int j = 0; j < b.length; j++) {\n\t\t\t\t\tUtil.Assert(a[j] == b[j], \"shit\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Heap sort ok\");\n\t\t}",
"private Sort() { }",
"public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}",
"@Override\n public void sortCurrentList(FileSortHelper sort) {\n }",
"public String doSort();",
"public void sortArray() {\n\t\tSystem.out.println(\"QUICK SORT\");\n\t}",
"@Override\n public void sort() throws IOException {\n long i = 0;\n // j represents the turn of writing the numbers either to g1 or g2 (or viceversa)\n long j = 0;\n long runSize = (long) Math.pow(2, i);\n long size;\n\n long startTime = System.currentTimeMillis();\n\n System.out.println(\"Strart sorting \"+ this.inputFileName);\n\n while(i <= Math.ceil(Math.log(this.n) / Math.log(2))){\n j = 0;\n do{\n size = merge(runSize, destinationFiles[(int)j % 2]);\n j += 1;\n }while (size/2 == runSize);\n\n System.out.println(\"iteration: \" + i + \", Run Size:\" + runSize + \", Total time elapsed: \" + (System.currentTimeMillis() - startTime));\n i += 1;\n runSize = (long) Math.pow(2, i);\n swipe();\n }\n System.out.println(\"The file has been sorted! Total time elapsed: \"+(System.currentTimeMillis() - startTime));\n\n destinationFiles[0].close();\n destinationFiles[1].close();\n originFiles[0].close();\n originFiles[1].close();\n\n createFile(OUT_PATH +inputFileName);\n copyFile(new File(originFileNames[0]), new File(\"out/TwoWayMergesort/OUT_\"+inputFileName));\n\n }",
"private void updateOrder() {\n Arrays.sort(positions);\n }",
"@Override\n public void sort() {\n for (int i = 0; i < size; i++) {\n for (int j = i + 1; j < size; j++) {\n if (((Comparable) data[i]).compareTo(data[j]) > 0) {\n E c = data[i];\n data[i] = data[j];\n data[j] = c;\n\n }\n }\n }\n }",
"void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }",
"void sort();",
"void sort();",
"public void shellSort(int[] a) \n {\n int increment = a.length / 2;\n while (increment > 0) \n {\n \n for (int i = increment; i < a.length; i++) //looping over the array\n {\n int j = i;\n int temp = a[i]; // swapping the values to a temporary array\n try\n {\n if(!orderPanel) // checking for Descending order\n {\n while (j >= increment && a[j - increment] > temp) \n {\n a[j] = a[j - increment]; //swapping the values\n thread.sleep(100);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n }\n \n else\n {\n while (j >= increment && a[j - increment] < temp) //checking for Ascending order\n {\n a[j] = a[j - increment];\n thread.sleep(200);\n repaint();\n this.setThreadState();\n j = j - increment;\n }\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e);\n }\n a[j] = temp;\n }\n \n if (increment == 2) \n {\n increment = 1;\n } \n else \n {\n increment *= (5.0 / 11);\n }\n }\n }",
"private void externalSort() throws IOException{\n\t\t/*\n\t\t * Pass 0: internal sort\n\t\t */\n\t\t// Read in from child;Write out runs of B pages;\n\t\t\n\t\tint numPerRun = B * 4096 / (schema.size() * 4); // # of tuples per run given in Pass0\n\t\tboolean buildMore;\n\t\tint numRuns = 0;\n\t\tif(sortAttrsIndex == null) {\n\t\t\tthis.buildAttrsIndex();\n\t\t}\n\t\texComparator myComp = new exComparator();\n\t\tinternal = new PriorityQueue<Tuple>(myComp);\n\t\tdo {\n\t\t\tbuildMore = this.buildHeap(numPerRun);\n\t\t\tnumRuns++;\n\t\t\t\n\t\t\t// write out the (numRuns)th run\n\t\t\tTupleWriter TW;\n\t\t\tif(!buildMore && numRuns == 1) {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"sortResult\"));\n\t\t\t} else {\n\t\t\t\tTW = new TupleWriter(new FileOutputStream(tempsubdir + \"0_\" + numRuns));\n\t\t\t}\n\t\t\twhile(!internal.isEmpty()) {\n//\t\t\t\tSystem.out.println(internal.peek().data);\n\t\t\t\tTW.setNextTuple(internal.poll()); \n\t\t\t}\n\t\t\t// leftover, fill with zero and write out\n\t\t\tif(!TW.bufferEmpty()) { // TW would never know the end of writing\n\t\t\t\tTW.fillFlush(); \n\t\t\t}\n\t\t\tTW.close();\n\t\t\t// internal must be empty until this point\n\t\t}while (buildMore);\n\t\t\n\t\t/*\n\t\t * Pass 1 and any following\n\t\t */\n\t\tif(numRuns > 1) { // if numRuns generated in Pass 0 is 1 already, file sorted already, no need to merge\n\t\t\tthis.merge(numRuns, myComp);\n\t\t}\n\t\t\n\t}",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t{\n\t\t\t\tif (currentSize >= size)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"MERGESORT END\");\n\t\t\t\t\ttimer.stop();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// deciding the block to to merged\n\t\t\t\telse if (mergeSortCodeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\tif (leftStart >= size - 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tcurrentSize = currentSize * 2;\n\t\t\t\t\t\tleftStart = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tmid = leftStart + currentSize - 1;\n\t\t\t\t\t\tif (leftStart + 2 * currentSize - 1 >= size - 1)\n\t\t\t\t\t\t\trightEnd = size - 1;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\trightEnd = leftStart + 2 * currentSize - 1;\n\t\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tmergeSortDelayFlag1 = 1;\n\t\t\t\t\t\tmergeSortdelay1 = 0;\n\t\t\t\t\t\tmergeSortCodeFlag = 0;\n\t\t\t\t\t\tif(mid >= rightEnd)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (mergeSortDelayFlag1 == 1)\n\t\t\t\t{\n\t\t\t\t\tmergeSortdelay1++;\n\t\t\t\t\tif (mergeSortdelay1 >= DELAY)\n\t\t\t\t\t{\n\t\t\t\t\t\tl = leftStart;\n\t\t\t\t\t\tm = mid;\n\t\t\t\t\t\tr = rightEnd;\n\t\t\t\t\t\tmergeSortDelayFlag1 = 0;\n\t\t\t\t\t\tmergeInitializeFlag = 1;\n\t\t\t\t\t\tleftStart += 2 * currentSize;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Merging the block selected\n\t\t\t\t\n\t\t\t\t// initializing the variables needed by the merge block \n\t\t\t\telse if (mergeInitializeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\ti = l;\n\t\t\t\t\tj = m + 1;\n\t\t\t\t\tindex = 0;\n\t\t\t\t\tcurrentDownCount = 0;\n\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\tcurrentUpCount = 0;\n\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\trightFlag = 0;\n\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\tupFlag = 0;\n\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\tbox.setBaseColor(BASE_COLOR);\n\t\t\t\t\tbox.setColorRange(l, m, BLOCK_COLOR1);\n\t\t\t\t\tbox.setColorRange(m + 1, r, BLOCK_COLOR2);\n\t\t\t\t\tpaintBox();\n\t\t\t\t\t\n\t\t\t\t\tmergeFlag = 1;\n\t\t\t\t\tmergeInitializeFlag = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// actual merging starts here\n\t\t\t\telse if (mergeFlag == 1)\n\t\t\t\t{\n\t\t\t\t\t// step zero check whether to continue merging or not\n\t\t\t\t\tif (j > r)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (i >= j)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay1 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag1 = 1;\n\t\t\t\t\t\t\tcolorFlag1 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag1 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay1++;\n\t\t\t\t\t\t\tif (colorDelay1 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t\tcolorDelayFlag1 = 0;\n\t\t\t\t\t\t\t\tcolorFlag1 = 1;\n\t\t\t\t\t\t\t\tcolorDelay1 = 0;\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\telse if (i >= j)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (j > r)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmergeFlag = 0;\n\t\t\t\t\t\t\tmergeSortCodeFlag = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tcolorDelay2 = 0;\n\t\t\t\t\t\t\tcolorDelayFlag2 = 1;\n\t\t\t\t\t\t\tcolorFlag2 = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (colorDelayFlag2 == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcolorDelay2++;\n\t\t\t\t\t\t\tif (colorDelay2 >= DELAY)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\t\tcolorDelayFlag2 = 0;\n\t\t\t\t\t\t\t\tcolorFlag2 = 1;\n\t\t\t\t\t\t\t\tcolorDelay2 = 0;\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// Step one Check whether a[i] <= a[j]\n\t\t\t\t\telse if (codeFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\tcurrRect.setColor(FOCUS_COLOR1);\n\t\t\t\t\t\tscanRect.setColor(FOCUS_COLOR2);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tdelayFlag2 = 1;\n\t\t\t\t\t\tcodeFlag = 0;\n\t\t\t\t\t\tdelay2 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\telse if (delayFlag2 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay2++;\n\t\t\t\t\t\tif (delay2 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tRectangle currRect = box.getRectangle(i);\n\t\t\t\t\t\t\tRectangle scanRect = box.getRectangle(j);\n\t\t\t\t\t\t\tif (currRect.getData() < scanRect.getData())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.getRectangle(i).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelay1 = 0;\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdelayFlag1 = 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{\n\t\t\t\t\t\t\t\tbox.getRectangle(j).setColor(END_COLOR);\n\t\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\tdelayFlag2 = 0;\n\t\t\t\t\t\t\t\tdownFlag = 1;\n\t\t\t\t\t\t\t\tcurrentDownCount = 0;\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\telse if (delayFlag1 == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tdelay1++;\n\t\t\t\t\t\tif (delay1 >= DELAY)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tdelayFlag1 = 0;\n\t\t\t\t\t\t\ti++;\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// Moving the first rectangle on right down (if it was smaller than the first one on the left)\n\t\t\t\t\telse if (downFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, YCHANGE);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tcurrentDownCount += YCHANGE;\n\t\t\t\t\t\tif (currentDownCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentDownCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\tdownFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindexRightCount = 0;\n\t\t\t\t\t\t\tindex = j - 1;\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// moving each of the rectangles in the block to the right(between the two smallest rectangle on both side)\n\t\t\t\t\t// including the first rectangle\n\t\t\t\t\telse if (rightBlockFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (index < i)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tleftFlag = 1;\n\t\t\t\t\t\t\tcurrentLeftCount = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trightFlag = 1;\n\t\t\t\t\t\t\trightBlockFlag = 0;\n\t\t\t\t\t\t\tindexRightCount = 0;\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// moving a rectangle in the block to the right\n\t\t\t\t\telse if (rightFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(index, XCHANGE, 0);\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tindexRightCount += XCHANGE;\n\t\t\t\t\t\tif (indexRightCount >= width)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = indexRightCount - width;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(index, -excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\trightFlag = 0;\n\t\t\t\t\t\t\trightBlockFlag = 1;\n\t\t\t\t\t\t\tindex--;\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// moving the rectangle left (the smallest in the un-merged block)\n\t\t\t\t\telse if (leftFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, -XCHANGE, 0);\n\t\t\t\t\t\tcurrentLeftCount += XCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentLeftCount >= width * (j - i))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentLeftCount - width * (j - i);\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, excess, 0);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tleftFlag = 0;\n\t\t\t\t\t\t\tupFlag = 1;\n\t\t\t\t\t\t\tcurrentUpCount = 0;\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// moving the rectangle up (the smallest in the un-merged block)\n\t\t\t\t\telse if (upFlag == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, -YCHANGE);\n\t\t\t\t\t\tcurrentUpCount += YCHANGE;\n\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\tif (currentUpCount >= DOWN)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint excess = currentUpCount - DOWN;\n\t\t\t\t\t\t\tbox.addOffsetRectangle(j, 0, excess);\n\t\t\t\t\t\t\tpaintBox();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRectangle smallestRect = box.getRectangle(j);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (int t = j - 1; t >= i; t--)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbox.setRectangle(box.getRectangle(t), t + 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbox.setRectangle(smallestRect, i);\n\t\t\t\t\t\t\tupFlag = 0;\n\t\t\t\t\t\t\tcodeFlag = 1;\n\t\t\t\t\t\t\tj++;\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public void sortByLength()\n {\n boolean swapMade;//has a swap been made in the most recent pass?\n \n //repeat looking for swaps\n do\n {\n swapMade=false;//just starting this pass, so no swap yet\n \n //go through entire array. looking for swaps that need to be done\n for(int i = 0; i<currentRide-1; i++)\n {\n //if the other RideLines has less people\n if(rides[i].getCurrentPeople()<rides[i+1].getCurrentPeople())\n {\n // standard swap, using a temporary. swap with less people\n RideLines temp = rides[i];\n rides[i]=rides[i+1];\n rides[i+1]=temp;\n \n swapMade=true;//remember this pass made at least one swap\n }\n \n } \n }while(swapMade);//until no swaps were found in the most recent past\n \n redrawLines();//redraw the image\n \n }",
"private void sortByAmount(){\n int stopPos = 0;\n while(colours.size()-stopPos > 0){\n int inARow = 1;\n for(int i = colours.size() - 1; i > stopPos; i--){\n if(colours.get(i-1).getAmount() < colours.get(i).getAmount()){\n rgb temp = new rgb(colours.get(i-1));\n colours.set(i-1, colours.get(i));\n colours.set(i, temp);\n }else{\n inARow++;\n }\n }\n stopPos++;\n if(inARow == colours.size()){\n break;\n }\n }\n }",
"public static void specialSets() {\n\t\tSystem.out.printf(\"%12s%15s%15s%10s%10s%10s%10s%n\",\"Size\",\"Range\",\"Pre-Sort Type\",\"Insertion\",\"Selectuon\",\"Quick\",\"Merge\");\n\t\tint[] array;\n\t\t//200K\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 200000);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Sorted array\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Sorted\");\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t\t//Reverse Sorted\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-200k\",\"Reverse Sorted\");\n\t\tint[] temp = new int[array.length];\n\t\tfor(int i = 0; i < array.length; i++) {\n\t\t\ttemp[i] = array[array.length -1 -i];\n\t\t}\n\t\tfourSorts(temp);\n\t\tSystem.out.println();\n\t\t//Range 1-20\n\t\tSystem.out.printf(\"%12d%15s%15s\",200000,\"1-20\",\"N/A\");\n\t\tarray = generateArray(200000, 1, 20);\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }",
"public void sortCompetitors(){\n\t\t}",
"public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}",
"@Override\n\tvoid sort(int[] arr, SortingVisualizer display) {\n\t\tint current = 0;\n\t\tint x;\n\t\tint y;\n\t\tboolean complete = false;\n\t\twhile(complete == false) {\n\t\t\tcurrent = 0;\n\t\t\tcomplete = true;\n\t\t\tfor(int i = 0 ; i < arr.length; i ++) {\n\t\t\t\tdisplay.updateDisplay();\n\t\t\t\tif(arr[current] > arr[i]) {\n\t\t\t\t\tx = arr[i];\n\t\t\t\t\ty = arr[current];\n\t\t\t\t\tarr[i] = y;\n\t\t\t\t\tarr[current] = x;\n\t\t\t\t\tcomplete = false;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"@Override\n\tpublic void setSortCounters(boolean sortCounters) {\n\t\t\n\t}",
"public BucketSort()\n {\n for(int i = 0; i < 30; i++)\n {\n a[i] = generator.nextInt(50)+1;\n b[i] = a[i];\n }\n }",
"public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }",
"public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }",
"private void setup() {\r\n final int gsz = _g.getNumNodes();\r\n if (_k==2) {\r\n\t\t\tNodeComparator2 comp = new NodeComparator2();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t} else { // _k==1\r\n\t\t\tNodeComparator4 comp = new NodeComparator4();\r\n\t\t\t_origNodesq = new TreeSet(comp);\r\n\t\t}\r\n for (int i=0; i<gsz; i++) {\r\n _origNodesq.add(_g.getNodeUnsynchronized(i)); // used to be _g.getNode(i)\r\n }\r\n _nodesq = new TreeSet(_origNodesq);\r\n //System.err.println(\"done sorting\");\r\n }",
"public void changeSortOrder();",
"private void sortEntities(){\n for (int i = 1; i < sorted.size; i++) {\n for(int j = i ; j > 0 ; j--){\n \tEntity e1 = sorted.get(j);\n \tEntity e2 = sorted.get(j-1);\n if(getRL(e1) < getRL(e2)){\n sorted.set(j, e2);\n sorted.set(j-1, e1);\n }\n }\n }\n }",
"private static void selectionSort(ArrayList<Box> BoxArray) { \n\n\t\tfor ( int i = 0; i < BoxArray.size(); i++ ) { \n\t\t\tint lowPos = i; \n\t\t\tfor ( int j = i + 1; j < BoxArray.size(); j++ ) \n\t\t\t\tif ( BoxArray.get(j).volume() < BoxArray.get(lowPos).volume() ) \n\t\t\t\t\tlowPos = j;\n\t\t\tif ( BoxArray.get(lowPos) != BoxArray.get(i) ) { \n\t\t\t\tBox temp = BoxArray.get(lowPos);\n\t\t\t\tBoxArray.set(lowPos, BoxArray.get(i));\n\t\t\t\tBoxArray.set(i, temp);\n\t\t\t}\n\t\t}\n\t}",
"public void sort() {\n\t\t\tfor (int j = nowLength - 1; j > 1; j--) {\n\t\t\t\tfor (int i = 0; i < j; i++) {\n\t\t\t\t\tif (ray[i] > ray[i+1]) {\n\t\t\t\t\t\tint tmp = ray [i];\n\t\t\t\t\t\tray[i] = ray[i+1];\n\t\t\t\t\t\tray[i+1] = tmp;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tprint();\n\t\t\t}\n\t}",
"public BubSortList() {\n\t\tray = new int[MAXSIZE];\n\t\tnowLength = 0;\n\t}",
"public void sortByDefault() {\r\n\t\tcomparator = null;\r\n\t}",
"public static void s1AscendingTest() {\n int key = 903836722;\n SortingLab<Integer> sli = new SortingLab<Integer>(key);\n int M = 600000;\n int N = 1000;\n double start;\n double elapsedTime;\n System.out.print(\"Sort 1 Ascending\\n\");\n for (; N < M; N *= 2) {\n Integer[] ai = getRandomArray(N, Integer.MAX_VALUE);\n Arrays.sort(ai);\n start = System.nanoTime();\n sli.sort1(ai);\n elapsedTime = (System.nanoTime() - start) / 1_000_000_000d;\n System.out.print(N + \"\\t\");\n System.out.printf(\"%4.3f\\n\", elapsedTime);\n }\n }",
"public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}",
"public void setSortOnCPUTime() {\n this.sortedJobList = new TreeSet<Job>(new Comparator<Job>() {\n @Override\n public int compare(Job a, Job b) {\n\n int aCPUUsed = 0;\n int bCPUUsed = 0;\n\n try {\n aCPUUsed = a.getCPUUsed();\n bCPUUsed = b.getCPUUsed();\n } catch (AS400SecurityException e) {\n e.printStackTrace();\n } catch (ErrorCompletingRequestException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ObjectDoesNotExistException e) {\n e.printStackTrace();\n }\n\n if (aCPUUsed == bCPUUsed) return 0;\n else return bCPUUsed - aCPUUsed;\n }\n });\n }",
"@Override\n \tpublic void sort() {\n \t\tArrays.sort(data);\n \t}",
"@VTID(28)\n boolean getSortUsingCustomLists();",
"public void sortOccurred() {\n //SET ALL THE ROWS TO -1, (THEY INITIALIZE TO 0).\n \tfor(int i = 0; i < data.length; i++) {\n \t\tdata[i] = null;\n \t\trowIndexLookup[i] = -1;\n \t}\t\t\n }",
"public void doTheAlgorithm() {\n this.swapCount = 0;\n this.compCount = 0;\n \n\t\tdoQuickSort(0, this.sortArray.length - 1);\n\t}",
"private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }",
"public void sort() {\n Collections.sort(jumpers, new SortJumperByPoints()); \n }",
"private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }",
"void sortV();",
"private void sortAndEmitUpTo(double maxX)\n {\n /**\n * Heuristic: Check if there are no obvious segments to process\n * and skip sorting & processing if so\n * \n * This is a heuristic only.\n * There may be new segments at the end of the buffer\n * which are less than maxx. But this should be rare,\n * and they will all get processed eventually.\n */\n if (bufferHeadMaxX() >= maxX)\n return;\n \n // this often sorts more than are going to be processed.\n //TODO: Can this be done faster? eg priority queue?\n \n // sort segs in buffer, since they arrived in potentially unsorted order\n Collections.sort(segmentBuffer, ORIENT_COMPARATOR);\n int i = 0;\n int n = segmentBuffer.size();\n LineSeg prevSeg = null;\n \n //reportProcessed(maxX);\n \n while (i < n) {\n LineSeg seg = (LineSeg) segmentBuffer.get(i);\n if (seg.getMaxX() >= maxX)\n \tbreak;\n \n i++;\n if (removeDuplicates) {\n if (prevSeg != null) {\n // skip this segment if it is a duplicate\n if (prevSeg.equals(seg)) {\n // merge in side label of dup seg\n prevSeg.merge(seg);\n continue;\n }\n }\n prevSeg = seg;\n }\n // remove interior segments (for dissolving)\n if (removeInteriorSegs\n && seg.getTopoLabel() == TopologyLabel.BOTH_INTERIOR)\n continue;\n \n segSink.process(seg);\n }\n //System.out.println(\"SegmentStreamSorter: total segs = \" + n + \", processed = \" + i);\n removeSegsFromBuffer(i);\n }",
"public void sort(){\n for(int i = array.length-1;i >= 0;i--){\n sink(i);\n }\n while(size > 0){\n swap(0, size-1);\n size -= 1;\n sink(0);\n }\n }",
"public static void main(String[] args) throws FileNotFoundException{\n int[] quicktimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes1[i] = (int)endTime;\n }\n \n int[] mergetimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes1[i] = (int)endTime;\n }\n \n int[] heaptimes1 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes1[i] = (int)endTime;\n }\n \n int[] quicktimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[i] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes2[i] = (int)endTime;\n }\n \n int[] mergetimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes2[i] = (int)endTime;\n }\n \n int[] heaptimes2 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes2[i] = (int)endTime;\n }\n \n int[] quicktimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes3[i] = (int)endTime;\n }\n \n int[] mergetimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes3[i] = (int)endTime;\n }\n \n int[] heaptimes3 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes3[i] = (int)endTime;\n }\n \n int[] quicktimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes4[i] = (int)endTime;\n }\n \n int[] mergetimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes4[i] = (int)endTime;\n }\n \n int[] heaptimes4 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes4[i] = (int)endTime;\n }\n \n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE REVERSE SORTED ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes5[i] = (int)endTime;\n }\n \n int[] mergetimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes5[i] = (int)endTime;\n }\n \n int[] heaptimes5 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes5[i] = (int)endTime;\n }\n \n int[] quicktimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes6[i] = (int)endTime;\n }\n \n int[] mergetimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes6[i] = (int)endTime;\n }\n \n int[] heaptimes6 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[10000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes6[i] = (int)endTime;\n }\n \n int[] quicktimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes7[i] = (int)endTime;\n }\n \n int[] mergetimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes7[i] = (int)endTime;\n }\n \n int[] heaptimes7 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[100000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes7[i] = (int)endTime;\n }\n \n int[] quicktimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.quickSort(sarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes8[i] = (int)endTime;\n }\n \n int[] mergetimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.mergeSort(sarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes8[i] = (int)endTime;\n }\n \n int[] heaptimes8 = new int[3];\n for (int i = 0; i < 3; i++){\n int[] sarray = new int[1000000];\n for (int j = 0; j < sarray.length; j++)\n sarray[j] = j;\n for(int k = 0; k < sarray.length / 2; k++){\n int temp = sarray[k];\n sarray[k] = sarray[sarray.length - k - 1];\n sarray[sarray.length - k - 1] = temp;\n }\n long startTime = System.nanoTime();\n Sorting.heapSort(sarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes8[i] = (int)endTime;\n }\n \n //THESE WILL GENERATE THE MERGE/HEAP/QUICK SORT FOR THE RANDOM ARRAYS OF VARIOUS LENGTHS\n int[] quicktimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes9[i] = (int)endTime;\n }\n \n int[] mergetimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes9[i] = (int)endTime;\n }\n \n int[] heaptimes9 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes9[i] = (int)endTime;\n }\n \n int[] quicktimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes10[i] = (int)endTime;\n }\n \n int[] mergetimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes10[i] = (int)endTime;\n }\n \n int[] heaptimes10 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[10000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(9999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes10[i] = (int)endTime;\n }\n \n int[] quicktimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes11[i] = (int)endTime;\n }\n \n int[] mergetimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes11[i] = (int)endTime;\n }\n \n int[] heaptimes11 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[100000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(99999);;\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes11[i] = (int)endTime;\n }\n \n int[] quicktimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.quickSort(rarray);\n long endTime = System.nanoTime() - startTime;\n quicktimes12[i] = (int)endTime;\n }\n \n int[] mergetimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.mergeSort(rarray);\n long endTime = System.nanoTime() - startTime;\n mergetimes12[i] = (int)endTime;\n }\n \n int[] heaptimes12 = new int[10];\n for (int i = 0; i < 10; i++){\n int[] rarray = new int[1000000];\n Random rand = new Random(i);\n for (int j = 0; j < rarray.length; j++)\n rarray[j] = rand.nextInt(999999);\n long startTime = System.nanoTime();\n Sorting.heapSort(rarray);\n long endTime = System.nanoTime() - startTime;\n heaptimes12[i] = (int)endTime;\n }\n \n //PRINTING THE RESULTS OUT INTO FILE\n File f = new File(\"Results.txt\");\n FileOutputStream fos = new FileOutputStream(f);\n PrintWriter pw = new PrintWriter(fos);\n pw.println(\"SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes1), medVal(quicktimes1), varVal(quicktimes1, meanVal(quicktimes1)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes2), medVal(quicktimes2), varVal(quicktimes2, meanVal(quicktimes2)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes3), medVal(quicktimes3), varVal(quicktimes3, meanVal(quicktimes3)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes4), medVal(quicktimes4), varVal(quicktimes4, meanVal(quicktimes4)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes1), medVal(mergetimes1), varVal(mergetimes1, meanVal(mergetimes1)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes2), medVal(mergetimes2), varVal(mergetimes2, meanVal(mergetimes2)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes3), medVal(mergetimes3), varVal(mergetimes3, meanVal(mergetimes3)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes4), medVal(mergetimes4), varVal(mergetimes4, meanVal(mergetimes4)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes1), medVal(heaptimes1), varVal(heaptimes1, meanVal(heaptimes1)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes2), medVal(heaptimes2), varVal(heaptimes2, meanVal(heaptimes2)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes3), medVal(heaptimes3), varVal(heaptimes3, meanVal(heaptimes3)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes4), medVal(heaptimes4), varVal(heaptimes4, meanVal(heaptimes4)));\n pw.println(\"REVERSE SORTED ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes5), medVal(quicktimes5), varVal(quicktimes5, meanVal(quicktimes5)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes6), medVal(quicktimes6), varVal(quicktimes6, meanVal(quicktimes6)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes7), medVal(quicktimes7), varVal(quicktimes7, meanVal(quicktimes7)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes8), medVal(quicktimes8), varVal(quicktimes8, meanVal(quicktimes8)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes5), medVal(mergetimes5), varVal(mergetimes5, meanVal(mergetimes5)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes6), medVal(mergetimes6), varVal(mergetimes6, meanVal(mergetimes6)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes7), medVal(mergetimes7), varVal(mergetimes7, meanVal(mergetimes7)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes8), medVal(mergetimes8), varVal(mergetimes8, meanVal(mergetimes8)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes5), medVal(heaptimes5), varVal(heaptimes5, meanVal(heaptimes5)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes6), medVal(heaptimes6), varVal(heaptimes6, meanVal(heaptimes6)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes7), medVal(heaptimes7), varVal(heaptimes7, meanVal(heaptimes7)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes8), medVal(heaptimes8), varVal(heaptimes8, meanVal(heaptimes8)));\n pw.println(\"RANDOM ARRAYS TIMES:\");\n pw.printf(\"1000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes9), medVal(quicktimes9), varVal(quicktimes9, meanVal(quicktimes9)));\n pw.printf(\"10000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes10), medVal(quicktimes10), varVal(quicktimes10, meanVal(quicktimes10)));\n pw.printf(\"100000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes11), medVal(quicktimes11), varVal(quicktimes11, meanVal(quicktimes11)));\n pw.printf(\"1000000 Quick Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(quicktimes12), medVal(quicktimes12), varVal(quicktimes12, meanVal(quicktimes12)));\n pw.printf(\"1000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes9), medVal(mergetimes9), varVal(mergetimes9, meanVal(mergetimes9)));\n pw.printf(\"10000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes10), medVal(mergetimes10), varVal(mergetimes10, meanVal(mergetimes10)));\n pw.printf(\"100000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes11), medVal(mergetimes11), varVal(mergetimes11, meanVal(mergetimes11)));\n pw.printf(\"1000000 Merge Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(mergetimes12), medVal(mergetimes12), varVal(mergetimes12, meanVal(mergetimes12)));\n pw.printf(\"1000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes9), medVal(heaptimes9), varVal(heaptimes9, meanVal(heaptimes9)));\n pw.printf(\"10000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes10), medVal(heaptimes10), varVal(heaptimes10, meanVal(heaptimes10)));\n pw.printf(\"100000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes11), medVal(heaptimes11), varVal(heaptimes11, meanVal(heaptimes11)));\n pw.printf(\"1000000 Heap Sort: Mean = %f, Median = %f, Variance = %f%n\", meanVal(heaptimes12), medVal(heaptimes12), varVal(heaptimes12, meanVal(heaptimes12)));\n pw.close();\n }",
"public void sort() {\n\t\tif (data.size() < 10) {\n\t\t\tbubbleSort();\n\t\t\tSystem.out.println(\"Bubble Sort\");\n\t\t} else {\n\t\t\tquickSort();\n\t\t\tSystem.out.println(\"Quick Sort\");\n\t\t}\n\t}",
"public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }",
"public void sort() {\r\n lang.setInteractionType(Language.INTERACTION_TYPE_AVINTERACTION);\r\n\r\n int nrElems = array.getLength();\r\n ArrayMarker iMarker = null, jMarker = null;\r\n // highlight method header\r\n code.highlight(\"header\");\r\n lang.nextStep();\r\n\r\n // check if array is null\r\n code.toggleHighlight(\"header\", \"ifNull\");\r\n incrementNrComparisons(); // if null\r\n lang.nextStep();\r\n\r\n // switch to variable declaration\r\n\r\n code.toggleHighlight(\"ifNull\", \"variables\");\r\n lang.nextStep();\r\n\r\n // initialize i\r\n code.toggleHighlight(\"variables\", \"initializeI\");\r\n iMarker = installArrayMarker(\"iMarker\", array, nrElems - 1);\r\n incrementNrAssignments(); // i =...\r\n lang.nextStep();\r\n\r\n // switch to outer loop\r\n code.unhighlight(\"initializeI\");\r\n\r\n while (iMarker.getPosition() >= 0) {\r\n code.highlight(\"outerLoop\");\r\n lang.nextStep();\r\n\r\n code.toggleHighlight(\"outerLoop\", \"innerLoop\");\r\n if (jMarker == null) {\r\n jMarker = installArrayMarker(\"jMarker\", array, 0);\r\n } else\r\n jMarker.move(0, null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n while (jMarker.getPosition() <= iMarker.getPosition() - 1) {\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"if\");\r\n array.highlightElem(jMarker.getPosition() + 1, null, null);\r\n array.highlightElem(jMarker.getPosition(), null, null);\r\n incrementNrComparisons();\r\n lang.nextStep();\r\n\r\n if (array.getData(jMarker.getPosition()) > array.getData(jMarker\r\n .getPosition() + 1)) {\r\n // swap elements\r\n code.toggleHighlight(\"if\", \"swap\");\r\n array.swap(jMarker.getPosition(), jMarker.getPosition() + 1, null,\r\n DEFAULT_TIMING);\r\n incrementNrAssignments(3); // swap\r\n lang.nextStep();\r\n code.unhighlight(\"swap\");\r\n } else {\r\n code.unhighlight(\"if\");\r\n }\r\n // clean up...\r\n // lang.nextStep();\r\n code.highlight(\"innerLoop\");\r\n array.unhighlightElem(jMarker.getPosition(), null, null);\r\n array.unhighlightElem(jMarker.getPosition() + 1, null, null);\r\n if (jMarker.getPosition() <= iMarker.getPosition())\r\n jMarker.move(jMarker.getPosition() + 1, null, DEFAULT_TIMING);\r\n incrementNrAssignments(); // j++ will always happen...\r\n }\r\n lang.nextStep();\r\n code.toggleHighlight(\"innerLoop\", \"decrementI\");\r\n array.highlightCell(iMarker.getPosition(), null, DEFAULT_TIMING);\r\n if (iMarker.getPosition() > 0)\r\n iMarker.move(iMarker.getPosition() - 1, null, DEFAULT_TIMING);\r\n else\r\n iMarker.moveBeforeStart(null, DEFAULT_TIMING);\r\n incrementNrAssignments();\r\n lang.nextStep();\r\n code.unhighlight(\"decrementI\");\r\n }\r\n\r\n // some interaction...\r\n TrueFalseQuestionModel tfQuestion = new TrueFalseQuestionModel(\"tfQ\");\r\n tfQuestion.setPrompt(\"Did this work?\");\r\n tfQuestion.setPointsPossible(1);\r\n tfQuestion.setGroupID(\"demo\");\r\n tfQuestion.setCorrectAnswer(true);\r\n tfQuestion.setFeedbackForAnswer(true, \"Great!\");\r\n tfQuestion.setFeedbackForAnswer(false, \"argh!\");\r\n lang.addTFQuestion(tfQuestion);\r\n\r\n lang.nextStep();\r\n HtmlDocumentationModel link = new HtmlDocumentationModel(\"link\");\r\n link.setLinkAddress(\"http://www.heise.de\");\r\n lang.addDocumentationLink(link);\r\n\r\n lang.nextStep();\r\n MultipleChoiceQuestionModel mcq = new MultipleChoiceQuestionModel(\"mcq\");\r\n mcq.setPrompt(\"Which AV system can handle dynamic rewind?\");\r\n mcq.setGroupID(\"demo\");\r\n mcq.addAnswer(\"GAIGS\", -1, \"Only static images, not dynamic\");\r\n mcq.addAnswer(\"Animal\", 1, \"Good!\");\r\n mcq.addAnswer(\"JAWAA\", -2, \"Not at all!\");\r\n lang.addMCQuestion(mcq);\r\n\r\n lang.nextStep();\r\n MultipleSelectionQuestionModel msq = new MultipleSelectionQuestionModel(\r\n \"msq\");\r\n msq.setPrompt(\"Which of the following AV systems can handle interaction?\");\r\n msq.setGroupID(\"demo\");\r\n msq.addAnswer(\"Animal\", 2, \"Right - I hope!\");\r\n msq.addAnswer(\"JHAVE\", 2, \"Yep.\");\r\n msq.addAnswer(\"JAWAA\", 1, \"Only in Guido's prototype...\");\r\n msq.addAnswer(\"Leonardo\", -1, \"Nope.\");\r\n lang.addMSQuestion(msq);\r\n lang.nextStep();\r\n // Text text = lang.newText(new Offset(10, 20, \"array\", \"S\"), \"Hi\", \"hi\",\r\n // null);\r\n // lang.nextStep();\r\n }",
"private static void allSorts(int[] array) {\n\t\tSystem.out.printf(\"%12d\",array.length);\n\t\tint[] temp;\n\t\tStopWatch1 timer;\n\t\t\n\t\t//Performs bubble sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.bubbleSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\t\tfourSorts(array);\n\t\tSystem.out.println();\n\t}",
"public void insertReorderBarrier() {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tSystem.out.println(\"\\tSelection\\tBubble\\tInsertion\\tCollections\\tQuick\\tinPlaceQuick\\tMerge\");\r\n\t\tfor (int n = 1000; n <= 7000; n += 500) {\r\n\t\t\tAPArrayList<Double> lists = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listb = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listi = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listc = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listipq = new APArrayList<Double>();\r\n\t\t\tAPArrayList<Double> listm = new APArrayList<Double>();\r\n\t\t\t\r\n\t\t\tfor (int i = 0; i < n; i++) {\r\n\t\t\t\tDouble val = Math.random();\r\n\t\t\t\tlists.add(val);\r\n\t\t\t\tlistb.add(val);\r\n\t\t\t\tlisti.add(val);\r\n\t\t\t\tlistc.add(val);\r\n\t\t\t\tlistq.add(val);\r\n\t\t\t\tlistipq.add(val);\r\n\t\t\t\tlistm.add(val);\r\n\t\t\t}\r\n\r\n\t\t\tlong selStartTime = System.nanoTime();\r\n\t\t\tlists.selectionSort();\r\n\t\t\tlong selEndTime = System.nanoTime();\r\n\t\t\tlong selSortTime = selEndTime - selStartTime;\r\n\t\t\tlists.clear();\r\n\t\t\t\r\n\t\t\tlong bubStartTime = System.nanoTime();\r\n\t\t\tlistb.bubbleSort();\r\n\t\t\tlong bubEndTime = System.nanoTime();\r\n\t\t\tlong bubSortTime = bubEndTime - bubStartTime;\r\n\t\t\tlistb.clear();\r\n\t\t\t\r\n\t\t\tlong insStartTime = System.nanoTime();\r\n\t\t\tlisti.insertionSort();\r\n\t\t\tlong insEndTime = System.nanoTime();\r\n\t\t\tlong insSortTime = insEndTime - insStartTime;\r\n\t\t\tlisti.clear();\r\n\t\t\t\r\n\t\t\tlong CollStartTime = System.nanoTime();\r\n\t\t\tlistc.sort();\r\n\t\t\tlong CollEndTime = System.nanoTime();\r\n\t\t\tlong CollSortTime = CollEndTime - CollStartTime;\r\n\t\t\tlistc.clear();\r\n\t\t\t\r\n\t\t\tlong quickStartTime = System.nanoTime();\r\n\t\t\tlistq.simpleQuickSort();\r\n\t\t\tlong quickEndTime = System.nanoTime();\r\n\t\t\tlong quickSortTime = quickEndTime - quickStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\tlong inPlaceQuickStartTime = System.nanoTime();\r\n\t\t\tlistipq.inPlaceQuickSort();\r\n\t\t\tlong inPlaceQuickEndTime = System.nanoTime();\r\n\t\t\tlong inPlaceQuickSortTime = inPlaceQuickEndTime - inPlaceQuickStartTime;\r\n\t\t\tlistipq.clear();\r\n\t\t\t\r\n\t\t\tlong mergeStartTime = System.nanoTime();\r\n\t\t\tlistm.mergeSort();\r\n\t\t\tlong mergeEndTime = System.nanoTime();\r\n\t\t\tlong mergeSortTime = mergeEndTime - mergeStartTime;\r\n\t\t\tlistq.clear();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(n + \"\\t\" + selSortTime + \"\\t\" + bubSortTime + \"\\t\" + insSortTime + \"\\t\" + CollSortTime + \"\\t\" + quickSortTime + \"\\t\" + inPlaceQuickSortTime + \"\\t\" + mergeSortTime);\r\n\t\t}\r\n\t}",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\t@Override\n\tpublic void sort() {\n\t\t\n\t\t// create maxHeap\n\t\tHeap<E> maxHeap = new MaxHeap<E>(arr);\n\t\t\n\t\telapsedTime = System.nanoTime(); // get time of start\n\t\t\n\t\tfor (int i = length - 1; i > 0; i--) {\n\n\t\t\tmaxHeap.swap(arr, 0, i);\n\t\t\tmaxHeap.heapSize--;\n\t\t\t((MaxHeap) maxHeap).maxHeapify(arr, 0);\n\n\t\t}\n\t\t\n\t\telapsedTime = System.nanoTime() - elapsedTime; // get elapsed time\n\t\t\n\t\tprint(); // print sorted array\n\t\tprintElapsedTime(); // print elapsed time\n\t\t\n\t\t\n\t}",
"public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}",
"private void sortGallery_10_Runnable() {\r\n\r\n\t\tif (_allPhotos == null || _allPhotos.length == 0) {\r\n\t\t\t// there are no files\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tfinal GalleryMT20Item[] virtualGalleryItems = _galleryMT20.getAllVirtualItems();\r\n\t\tfinal int virtualSize = virtualGalleryItems.length;\r\n\r\n\t\tif (virtualSize == 0) {\r\n\t\t\t// there are no items\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// sort photos with new sorting algorithm\r\n\t\tArrays.sort(_sortedAndFilteredPhotos, getCurrentComparator());\r\n\r\n\t\tupdateUI_GalleryItems(_sortedAndFilteredPhotos, null);\r\n\t}",
"private void collapseIgloo() {\n blocks.sort(Comparator.comparing(a -> a.center.getY()));\n\n double minDistance, distance;\n Point3D R = new Point3D(0, -1, 0);\n for (int i = 0; i < blocks.size(); i++) {\n minDistance = Double.MAX_VALUE;\n for (int j = i - 1; j >= 0; j--) {\n if (boundingSpheresIntersect(blocks.get(i), blocks.get(j))) {\n distance = minDistance(blocks.get(i), blocks.get(j), R);\n if (distance < minDistance) {\n minDistance = distance;\n }\n }\n }\n if (minDistance != Double.MAX_VALUE) {\n blocks.get(i).move(R.multiply(minDistance));\n }\n }\n }",
"private static long sortingTime(String[] array, boolean isStandardSort) {\n long start = System.currentTimeMillis(); // starting time\n if (isStandardSort) \n Arrays.sort(array);\n selectionSort(array);\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"@Override // java.util.Comparator\n /* Code decompiled incorrectly, please refer to instructions dump. */\n public int compare(androidx.recyclerview.widget.GapWorker.Task r6, androidx.recyclerview.widget.GapWorker.Task r7) {\n /*\n r5 = this;\n androidx.recyclerview.widget.GapWorker$Task r6 = (androidx.recyclerview.widget.GapWorker.Task) r6\n androidx.recyclerview.widget.GapWorker$Task r7 = (androidx.recyclerview.widget.GapWorker.Task) r7\n androidx.recyclerview.widget.RecyclerView r5 = r6.view\n r0 = 0\n r1 = 1\n if (r5 != 0) goto L_0x000c\n r2 = r1\n goto L_0x000d\n L_0x000c:\n r2 = r0\n L_0x000d:\n androidx.recyclerview.widget.RecyclerView r3 = r7.view\n if (r3 != 0) goto L_0x0013\n r3 = r1\n goto L_0x0014\n L_0x0013:\n r3 = r0\n L_0x0014:\n r4 = -1\n if (r2 == r3) goto L_0x001d\n if (r5 != 0) goto L_0x001b\n L_0x0019:\n r0 = r1\n goto L_0x0037\n L_0x001b:\n r0 = r4\n goto L_0x0037\n L_0x001d:\n boolean r5 = r6.immediate\n boolean r2 = r7.immediate\n if (r5 == r2) goto L_0x0026\n if (r5 == 0) goto L_0x0019\n goto L_0x001b\n L_0x0026:\n int r5 = r7.viewVelocity\n int r1 = r6.viewVelocity\n int r5 = r5 - r1\n if (r5 == 0) goto L_0x002f\n L_0x002d:\n r0 = r5\n goto L_0x0037\n L_0x002f:\n int r5 = r6.distanceToItem\n int r6 = r7.distanceToItem\n int r5 = r5 - r6\n if (r5 == 0) goto L_0x0037\n goto L_0x002d\n L_0x0037:\n return r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: androidx.recyclerview.widget.GapWorker.AnonymousClass1.compare(java.lang.Object, java.lang.Object):int\");\n }",
"private static void performSort(TestApp testApp) {\n testApp.testPartition();\n\n /*\n Date end = new Date();\n System.out.println(\"Sort ended @ \" + end.getTime());\n System.out.println(\"Total time = \" + (end.getTime() - start.getTime())/1000.0 + \" seconds...\");\n */\n }",
"public void sort() {\n\t\tfor (int i = 1; i < this.dataModel.getLength(); i++) {\n\t\t\tfinal int x = this.dataModel.get(i);\n\n\t\t\t// Find location to insert using binary search\n\t\t\tfinal int j = Math.abs(this.dataModel.binarySearch(0, i, x) + 1);\n\n\t\t\t// Shifting array to one location right\n\t\t\tthis.dataModel.arrayCopy(j, j + 1, i - j);\n\n\t\t\t// Placing element at its correct location\n\t\t\tthis.dataModel.set(j, x);\n\t\t\tthis.repaint(this.count++);\n\t\t}\n\t}",
"public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }",
"private static void fourSorts(int[] array) {\n\t\tStopWatch1 timer;\n\t\tint[] temp;\n\t\t//Performs insertion sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.insertionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\n\t\t//Performs selection sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.selectionSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs quick sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.quickSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t\t//Performs merge sort\n\t\ttimer = new StopWatch1();\n\t\ttemp = copyArray(array);\n\t\ttimer.start();\n\t\tSort.mergeSort(temp);\n\t\ttimer.stop();\n\t\tSystem.out.printf(\"%10d\",timer.getElapsedTime());\n\n\t}",
"private void orderSegments() {\n //insert numOrder for the db\n int i = 0;\n for(TransportSegmentLogic transportSegment: transportSegments){\n transportSegment.setOrder(i);\n i++;\n }\n\n\n\n /*int i = 0;\n int j = 1;\n\n\n TransportSegmentLogic swapSegment;\n\n while(j < transportSegments.size()){\n if(transportSegments.get(j).getOrigin().equals(transportSegments.get(i).getDestination())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(i +1, swapSegment);\n i = i + 1;\n j = i + 1;\n }\n j++;\n }\n\n j = transportSegments.size() -1;\n\n while(j > i){\n if(transportSegments.get(j).getDestination().equals(transportSegments.get(0).getOrigin())){\n swapSegment = transportSegments.get(j);\n transportSegments.remove(swapSegment);\n transportSegments.add(0, swapSegment);\n i = i + 1;\n j = transportSegments.size();\n }\n j--;\n } */\n }",
"public void run()\n { // checking for appropriate sorting algorithm\n \n if(comboAlgorithm.equals(\"Shell Sort\"))\n {\n this.shellSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Selection Sort\"))\n {\n this.selectionSort(randInt);\n }\n \n if(comboAlgorithm.equals(\"Insertion Sort\"))\n {\n this.insertionSort(randInt);\n }\n if(comboAlgorithm.equals(\"Bubble Sort\"))\n {\n this.bubbleSort(randInt);\n }\n \n }",
"private synchronized void freshSort(){\n Process[] newQueue = new Process[pros.proSize()];\n for(int i = 0; i <queue.length; i++){\n if(pros.isInList(queue[i])){\n newQueue[i] = queue[i];\n }\n }\n queue = new Process[pros.proSize()];\n queue = newQueue;\n }",
"public void sortFullList()\r\n {\r\n if (log.isDebugEnabled())\r\n {\r\n log.debug(\"[\" + this.id + \"] sorting full data\");\r\n }\r\n sortRowList(this.getRowListFull());\r\n }",
"private void updateFilteringAndSorting() {\n log.debug(\"update filtering of adapter called\");\n if (lastUsedComparator != null) {\n sortWithoutNotify(lastUsedComparator, lastUsedAsc);\n }\n Filter filter = getFilter();\n if (filter instanceof UpdateableFilter){\n ((UpdateableFilter)filter).updateFiltering();\n }\n }",
"private static void evaluateMergesortVogellaThreaded() {\n\n // LOGGER.info(\"evaluating parallel mergesort with Java Threads based on the Vogella version\");\n\n // The time before start to sort.\n long startTime;\n\n // The time after sort.\n long endTime;\n\n // generate sorted array\n numbers = generateSortedArray(ARRAY_SIZE);\n\n // get array to evaluate\n generateWorstUnsortArray(numbers);\n\n // get systemtime before sorting\n startTime = System.currentTimeMillis();\n\n // sort\n msVogellaJThreads.sort(numbers);\n\n // get systemtime after sorting\n endTime = System.currentTimeMillis();\n\n // show the result of the sorting process\n System.out.println(\"\\n- Sortierergebnis: Java Threads (Vogella) -\");\n System.out.println(\"Die sortierte Folge lautet: \" + arrayToString(numbers));\n System.out.printf(\"Für die Sortierung wurden %d ms benötigt\", endTime - startTime);\n System.out.println(\"\\n------------------------------------------------\\n\");\n }",
"public void sort() {\r\n // sort the process variables\r\n Arrays.sort(pvValues, categoryComparator);\r\n fireTableDataChanged();\r\n }",
"public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}",
"public void sort() throws IOException {\n for(int i = 0; i < 32; i++)\n {\n if(i%2 == 0){\n filePointer = file;\n onePointer = one;\n }else{\n filePointer = one;\n onePointer = file;\n }\n filePointer.seek(0);\n onePointer.seek(0);\n zero.seek(0);\n zeroCount = oneCount = 0;\n for(int j = 0; j < totalNumbers; j++){\n int n = filePointer.readInt();\n sortN(n,i);\n }\n //Merging\n onePointer.seek(oneCount*4);\n zero.seek(0L);\n for(int j = 0; j < zeroCount; j++){\n int x = zero.readInt();\n onePointer.writeInt(x);\n }\n //One is merged\n }\n }",
"void sortUI();",
"private static long sortingTime(double[] array, boolean isStandardSort) {\n long start = 0; // starting time\n if (isStandardSort) { \n start = System.currentTimeMillis(); \n Arrays.sort(array);\n } else {\t\n start = System.currentTimeMillis();\n selectionSort(array);\n }\n return System.currentTimeMillis() - start; // measure time consumed\n }",
"@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }",
"private void compressBlocks(final int phaseId) {\n // 1. uncross all crossing blocks: O(|G|)\n popBlocks(head -> head.isTerminal() && head.getPhaseId() < phaseId,\n tail -> tail.isTerminal() && tail.getPhaseId() < phaseId);\n\n List<BlockRecord<N, S>> shortBlockRecords = new ArrayList<>();\n List<BlockRecord<N, S>> longBlockRecords = new ArrayList<>();\n\n // 2. get all blocks: O(|G|)\n slp.getProductions().stream().forEach(rule -> consumeBlocks(rule.getRight(), shortBlockRecords::add, longBlockRecords::add, letter -> true));\n\n // 3.1 sort short blocks using RadixSort: O(|G|)\n sortBlocks(shortBlockRecords);\n\n // 3.2 sort long blocks O((n+m) log(n+m))\n Collections.sort(longBlockRecords, blockComparator);\n List<BlockRecord<N, S>> blockRecords = mergeBlocks(shortBlockRecords, longBlockRecords);\n\n // compress blocks\n BlockRecord<N, S> lastRecord = null;\n S letter = null;\n\n // 4. compress blocks: O(|G|)\n for(BlockRecord<N, S> record : blockRecords) {\n\n // check when it is the correct time to introduce a fresh letter\n if(lastRecord == null || !lastRecord.equals(record)) {\n letter = terminalAlphabet.createTerminal(phase, 1L, record.node.getElement().getLength() * record.block.getLength(), record.block);\n lastRecord = record;\n }\n replaceBlock(record, letter);\n }\n }",
"public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }",
"public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }"
] | [
"0.7197401",
"0.6255372",
"0.6211219",
"0.6066339",
"0.60643095",
"0.6053787",
"0.6042538",
"0.6023608",
"0.6020515",
"0.60189277",
"0.59674764",
"0.5952937",
"0.59363294",
"0.59033793",
"0.5832205",
"0.5802957",
"0.5789782",
"0.5734266",
"0.56746376",
"0.5668239",
"0.5630748",
"0.5614282",
"0.56136245",
"0.5612872",
"0.5595159",
"0.5593839",
"0.5590597",
"0.5589105",
"0.5557131",
"0.55564046",
"0.55515",
"0.5546584",
"0.5537787",
"0.55366087",
"0.55366087",
"0.5534389",
"0.553137",
"0.552898",
"0.5523925",
"0.5520821",
"0.551747",
"0.55138594",
"0.5509064",
"0.55046546",
"0.5495546",
"0.5477092",
"0.54761994",
"0.54755706",
"0.544318",
"0.54394525",
"0.54381126",
"0.5431472",
"0.54259145",
"0.5407146",
"0.54047555",
"0.5400459",
"0.5399707",
"0.53969526",
"0.53959537",
"0.53933954",
"0.5387792",
"0.53873384",
"0.5386018",
"0.5372296",
"0.5348855",
"0.5343851",
"0.53424007",
"0.5331061",
"0.53162867",
"0.53089345",
"0.53078157",
"0.5307365",
"0.53071064",
"0.52933794",
"0.52921444",
"0.5291532",
"0.5290235",
"0.52863544",
"0.5283154",
"0.5282011",
"0.5270212",
"0.52656233",
"0.52655876",
"0.52642053",
"0.52623945",
"0.5261534",
"0.5254047",
"0.52514416",
"0.5246936",
"0.5245122",
"0.52413344",
"0.5241006",
"0.5240666",
"0.5239813",
"0.52271265",
"0.5225861",
"0.52243507",
"0.5223106",
"0.52205354",
"0.5220406",
"0.5218794"
] | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.