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
delete a cmVocabularyCategory by primary key
@Transactional public void delete(final String pk) { dao.delete(CmVocabularyCategory.class, pk); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Transactional\r\n\tpublic void delete(CmVocabularyCategory cmVocabularyCategory) {\r\n\t\tdao.delete(cmVocabularyCategory);\r\n\t}", "void deleteCategory(long id);", "void deleteCategory(Integer id);", "void deleteCategoryById(int categoryId);", "public void deleteCategorie(Categorie c);", "void deleteCategory(Category category);", "Boolean deleteCategory(Integer category_Id) throws DvdStoreException;", "void deleteCategoryByName(String categoryName);", "void delete(Category category);", "int deleteByPrimaryKey(TbInvCategoryKey key);", "public void deleteCategory(Long id) throws BusinessException;", "@Delete({\n \"delete from `category`\",\n \"where `cate_id` = #{cateId,jdbcType=INTEGER}\"\n })\n int deleteByPrimaryKey(Integer cateId);", "void deleteCategoryProducts(long id);", "@Override\n\tpublic void deleteCateogry(int id) {\n\t\tcategoryRepository.deleteById(id);\n\t\t\n\t}", "void deleteCodeCategory(UUID id)\n throws DAOException;", "@Override\r\n\tpublic void deleteCategory(Category c) {\n\t\tem.remove(em.find(Category.class, c.getIdCategory()));\r\n\t\t\r\n\t}", "@Override\n\tpublic void delete(Category entity) {\n\t\t\n\t}", "@Override\n\tpublic void delete(Category entity) {\n\n\t}", "public Medicine deleteMedicineCategory(Integer medicine_id_1, Integer related_category_id);", "private void deleteCategory(String key) {\n Query foodInCategory = table_food.orderByChild(\"menuId\").equalTo(key);\n foodInCategory.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n\n for(DataSnapshot item:dataSnapshot.getChildren())\n item.getRef().removeValue();\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n\n table_category.child(key).removeValue();\n Toast.makeText(this, \"Category is deleted ! \", Toast.LENGTH_SHORT).show();\n }", "@FXML\n private void deleteCategory()\n {\n CategoryFxModel selectedCategory = categoryTable.getSelectionModel().getSelectedItem();\n if(selectedCategory == null)\n {\n DialogsUtils.categoryNotSelectedDialog();\n }\n else\n {\n Optional<ButtonType> result = DialogsUtils.deleteCategoryConfirmationDialog();\n deleteCategoryWhenOkPressed(selectedCategory, result);\n }\n }", "void removeCategory(Category category);", "public void delete(Category category) {\n category_dao.delete(category);\n }", "public void deleteCategory(Category category) throws Exception {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n category.setApproved(false);\n dbb.overwriteCategory(category);\n dbb.commit();\n dbb.closeConnection();\n }", "public void delete(Long categoriaId) {\n LOGGER.log(Level.INFO, \"Borrando categoria con id = {0}\", categoriaId);\n CategoriaEntity categoriaEntity = em.find(CategoriaEntity.class, categoriaId);\n em.remove(categoriaEntity);\n LOGGER.log(Level.INFO, \"Saliendo de borrar la categoria con id = {0}\", categoriaId);\n }", "void deleteCatFood(Long catId, Long foodId);", "public int deleteByPrimaryKey(Integer categoryId) throws SQLException {\r\n Category key = new Category();\r\n key.setCategoryId(categoryId);\r\n int rows = sqlMapClient.delete(\"CATEGORY.abatorgenerated_deleteByPrimaryKey\", key);\r\n return rows;\r\n }", "@Override\r\n\tpublic void deleteCategory(Category category) {\n\t\tgetHibernateTemplate().delete(category);\r\n\t}", "public static void deleteVocab(Context context){\n Toast.makeText(context, \"deleted\", Toast.LENGTH_SHORT).show();\n DatabaseReference vocabRef=FirebaseDatabase.getInstance().getReference().child(\"user\").child(FirebaseAuth.getInstance().getUid()).child(\"vocab\").child(currentVocabId);\n vocabRef.removeValue();\n }", "Boolean removeCategoryfromDvd(Integer category_Id, Integer dvdId) \n throws DvdStoreException;", "public void deletePortletCategory(PortletCategory category);", "int deleteByExample(CategoryExample example);", "void deleteCachedCodeCategory(UUID id)\n throws DAOException;", "@Delete\n void delete(SpeciesCategory speciesCategory);", "@Override\n public void delete(long id) {\n categoryRepository.deleteById(id);\n }", "public long deleteByCatalogueId(String catalogueId);", "public void delete(int id) {\n\t\tcat_vo cv = new cat_vo();\n\t\tcv.setId(id);\n\t\tSessionFactory sf = new Configuration().configure()\n\t\t\t\t.buildSessionFactory();\n\t\tSession s = sf.openSession();\n\t\tTransaction tr = s.beginTransaction();\n\n\t\ts.delete(cv);\n\t\ttr.commit();\n\t}", "public String deleteCategory()\n {\n logger.info(\"**** In deleteCategory in Controller ****\");\n boolean deleteFlag = categoryService.deleteCategory(categoryId);\n if (deleteFlag)\n {\n FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, Constants.CATEGORY_DELETION_SUCCESS, Constants.CATEGORY_DELETION_SUCCESS);\n FacesContext.getCurrentInstance().getExternalContext().getFlash().setKeepMessages(true);\n FacesContext.getCurrentInstance().addMessage(null, facesMsg);\n }\n\n return searchCategory();\n }", "@Override\r\n\tpublic boolean delete(Se_cat se_cat) {\n\t\treturn se_catdao.delete(se_cat);\r\n\t}", "boolean delete(DishCategory dishCategory);", "void deletingCatalogItemById(final Long id);", "public void deleteCategory(int id){\n\t\t// delete all the values in location\n\t\tdb.delete(DBEntryContract.LocationEntry.TABLE_NAME, DBEntryContract.LocationEntry.COLUMN_NAME_CATEGORY +\" = ?\", new String[]{String.valueOf(id)});\n\t\t// delete the category\n\t\tdb.delete(DBEntryContract.CategoryEntry.TABLE_NAME, DBEntryContract.CategoryEntry._ID+\"= ?\", new String[]{String.valueOf(id)});\n\t}", "public void deleteCatMovies(CatMovie selectedCatMovie) throws DalException\n {\n // Attempts to connect to the database.\n try ( Connection con = dbCon.getConnection())\n {\n // SQL code. \n String sql = \"DELETE FROM CatMovie WHERE id=?;\";\n // Prepared statement. \n PreparedStatement ps = con.prepareStatement(sql);\n ps.setInt(1, selectedCatMovie.getId());\n // Attempts to execute the statement.\n ps.execute();\n } catch (SQLException ex)\n {\n Logger.getLogger(CatMovieDBDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "@Override\n\tpublic int deleteById(String id) {\n\t\treturn SApplicationcategorydao.deleteById(SApplicationcategory.class, id);\n\t}", "@Override\n\tpublic Categories delete(Integer catId) {\n\t\treturn categoriesDAO.delete(catId);\n\t}", "int deleteByPrimaryKey(countrylanguageKey key);", "@Override\n public boolean deleteCategory(int categoryId)\n {\n String query = \"DELETE FROM Categories WHERE CategoryID = \" + categoryId;\n return DataService.executeDelete(query);\n }", "private void deleteItem()\n {\n Category categoryToDelete = dataCategories.get(dataCategories.size()-1);\n AppDatabase db = Room.databaseBuilder(getApplicationContext(),\n AppDatabase.class, \"database-name\").allowMainThreadQueries().build();\n db.categoryDao().delete(categoryToDelete);\n testDatabase();\n }", "public static void deleteCategoryName(Context context, int id) {\r\n DbManager dbManager = new DbManager(context);\r\n SQLiteDatabase db = dbManager.getWritableDatabase();\r\n\r\n ContentValues values = new ContentValues();\r\n values.put(CategoryTable.COLUMN_NAME_IS_DELETED, 1);\r\n\r\n db.update(\r\n DbContract.CategoryTable.TABLE_NAME,\r\n values,\r\n DbContract.CategoryTable._ID + \" = ?\",\r\n new String[]{Integer.toString(id)}\r\n );\r\n db.close();\r\n }", "public void delete(Long id) {\n log.debug(\"Request to delete Categoria : {}\", id);\n categoriaRepository.delete(id);\n }", "public void delete(Integer id) {\n\t\tfindById(id);\n\n\t\t//fazendo isso pois se tentar remover algum obj que tenha objetos associados com ele\n\t\t//quero que der uma exceção personalizada, em vez de erro 500\n\t\ttry {\n\t\t\trepo.deleteById(id);\n\t\t} catch (Exception e) {\n\t\t\tthrow new DataIntegrityException(\"Não é possível excluir categoria que não possui produto\");\n\t\t}\n\t}", "void deleteCategoryParameterProductDetails(long id);", "void deleteMataKuliah (int id);", "@Override\r\n\tpublic void delete(SecondCategory scategory) {\n\t\tscategory.setIs_delete(1);\r\n\t\tscategoryDao.update(scategory);\r\n\t}", "@Override\n public boolean deleteCategory(Category oldCategory)\n {\n return deleteCategory(oldCategory.getCategoryID());\n }", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tdeleteCategory(myCategory);\n\t\t\t\t}", "void processDeleteCategoryEvent(AchieveSettings settings, String category);", "@DeleteMapping(\"/category/{id}\")\n ResponseEntity<Category> deleteCategory(@PathVariable Long id){\n categoryRepository.deleteById(id);\n return ResponseEntity.ok().build();\n }", "int deleteByPrimaryKey(RepStuLearningKey key);", "@DeleteMapping(\"/delete/{idcategory}\")\n\tpublic ResponseEntity<?> deleteById(@PathVariable int idcategory){\n\t\tCategoryVO cat = catService.deleteById(idcategory);\n\t\treturn checkNull(cat);\n\t}", "@RequestMapping(value = \"/delete/{categoryId}\")\n public String deleteCategory(@PathVariable Long categoryId, RedirectAttributes redirectAttributes) {\n try {\n categoryService.delete(categoryId);\n } catch (RuntimeException e) {\n redirectAttributes.addFlashAttribute(\"error\",e.getMessage());\n }\n\n return \"redirect:/admin/categories\";\n }", "void deleteDaftarhunianDtl(DaftarhunianDtl.MyCompositePK no) {\n }", "@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n @RequestMapping(value=\"/{id}\", method=RequestMethod.DELETE)\n public ResponseEntity<Void> deleteCategory(@PathVariable Long id){\n try {\n catService.delete(id);\n } catch (Exception e) {\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n }\n\n return new ResponseEntity<>(HttpStatus.OK);\n }", "@DeleteMapping(\"/categoriesfu/{id}\")\n\t@Secured({ AuthoritiesConstants.ADMIN, AuthoritiesConstants.BOSS, AuthoritiesConstants.MANAGER })\n public synchronized ResponseEntity<Void> deleteCategory(@PathVariable Long id) {\n log.debug(\"REST request to delete Category : {}\", id);\n //fu\n final String user =SecurityUtils.getCurrentUserLogin().get();\n final UserToRestaurant userToRestaurant=userToRestaurantRepository.findOneByUserLogin(user);\n final Restaurant restaurant=userToRestaurant.getRestaurant();\n final Optional<Category> category = categoryRepository.findById(id);\n if(category.get().getRestaurant().getId()!=restaurant.getId()) {\n \tid = null;\n }\n categoryRepository.deleteById(id);\n return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())).build();\n }", "@Override\n\tpublic void deleteCategory(Category Category) {\n\t\tsessionFactory.getCurrentSession().delete(Category);\n\t\tsessionFactory.getCurrentSession().flush();\n\t}", "@Override\n\tprotected void destroyRecord(int id) {\n\t\tCategory category = new Category();\n\t\tcategory.setId(id);\n\t\tnew Categories().destroy(category);\t\n\t}", "int deleteByPrimaryKey(Integer idMovCta);", "@Override\n\tpublic void eliminaCategoria(String nome) {\n\t\tDB db = getDB();\n\t\tMap<Long, Categoria> categorie = db.getTreeMap(\"categorie\");\n\t\tlong hash = nome.hashCode();\n\t\tcategorie.remove(hash);\n\t\tdb.commit();\n\t}", "int deleteByPrimaryKey(Long catalogId);", "@Override\r\n\tpublic boolean deleteCategorie(Categorie categorie) {\n\t\treturn cateDao.deleteCategorie(categorie);\r\n\t}", "@Delete({\r\n \"delete from `review_level_setting`\",\r\n \"where `id` = #{id,jdbcType=VARCHAR}\"\r\n })\r\n int deleteByPrimaryKey(String id);", "@Override\n\tpublic boolean delete(Category category) {\n\t\tsessionFactory.getCurrentSession().delete(category);\n\t\treturn true;\n\t}", "void deleteTrackerListCategory(final Integer id);", "public int delete( Integer idConge ) ;", "@Override\n\tpublic void deleteCategory(HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\n\t}", "@Override\n\tpublic void clearDBCategorie() {\n\t\tDB db = getDB();\n\t\tMap<Long, Risposta> risposte = db.getTreeMap(\"categorie\");\n\t\trisposte.clear();\n\t\tdb.commit();\n\t\t\n\t}", "@Test\n public void deleteCategory_Deletes(){\n int returned = testDatabase.addCategory(category);\n testDatabase.deleteCategory(returned);\n assertEquals(\"deleteCategory - Deletes From Database\", null, testDatabase.getCategory(returned));\n }", "DvdCategory searchCategoryById(Integer id) throws DvdStoreException;", "public Result deleteCategories(int id){\r\n Result result = new Result();\r\n int numRowsDeleted;\r\n String deleteCommand = \"DELETE FROM Categories WHERE productID= ?\";\r\n\r\n try {\r\n PreparedStatement statement = conn.prepareStatement(deleteCommand);\r\n statement.setInt(1, id);\r\n\r\n numRowsDeleted = statement.executeUpdate();\r\n\r\n if(numRowsDeleted >0)\r\n result.successful();\r\n else\r\n result.failure(\"Failed to delete category\");\r\n\r\n }catch (SQLException e){\r\n result.failure(\"Failed to create a statement\");\r\n }\r\n\r\n return result;\r\n }", "int deleteByPrimaryKey(String menuId);", "@RequestMapping(value = \"/deleteCategory\", method = RequestMethod.POST)\r\n\tpublic ModelAndView deleteCategory(@RequestParam String categoryId) {\r\n\t\tcategoryService.deleteCategoryByCategoryId(Integer.parseInt(categoryId));\r\n\t\treturn new ModelAndView(\"redirect:/admin\");\r\n\t}", "@Override\n\tpublic void delComLanguage(int id) {\n\t\t\n\t}", "@Override\n\tpublic int delete(Long id) {\n\t\treturn foodCategoryDao.delete(id);\n\t}", "@Override\n\tpublic boolean deleteCategory(String catName) {\n\t\tTransaction tx=sessionFactory.getCurrentSession().beginTransaction();\n\t\tboolean found =categoryhome.isFound(catName);\n\t\tif(found==true)\n\t\t{\n\t\t\tCategory cat=categoryhome.getByName(catName);\n\t\t\tsessionFactory.getCurrentSession().delete(cat);\n\t\t\ttx.commit();\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\t\n\t\t}\n\t\n\t}", "public void removeCvcategory(Cvcategory cvcategory);", "public void delete(int id) {\n\t\tCategory function = this.get(id) ;\r\n\t\tthis.getCurrentSession().delete(function);\r\n\t}", "int deleteByPrimaryKey(String menuid);", "int deleteByPrimaryKey(T00RolePostKey key);", "public void delete(Long cid) {\n\t\tcategoryDao.delete(cid);\n\t}", "public void delete(K id);", "public void delete(RutaPk pk) throws RutaDaoException;", "@Override\n @CacheEvict\n public void delete(Long id) {\n log.debug(\"Request to delete Category : {}\", id);\n categoryRepository.delete(id);\n }", "int deleteByPrimaryKey(Long articleTagId);", "int deleteByPrimaryKey(Integer cId);", "int deleteByPrimaryKey(Integer cId);", "Boolean restoreCategory(Integer category_Id) throws DvdStoreException;", "public static void eliminarTodosLosConceptosCatgeorias() {\n\t\tnew Delete().from(ConceptoCategoria.class).execute();\n\t}", "public String deleteView()\n {\n logger.info(\"**** In deleteView in Controller ****\" + categoryId);\n this.category = categoryService.getCategoryByCategoryId(categoryId);\n return Constants.DELETE_CATEGORY_VIEW;\n }", "@Override\n\tpublic boolean deleteProductByCategoryId(int categoryId) {\n\t\treturn false;\n\t}", "private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {\n int index = jList1.getSelectedIndex();\n \n String idCategory = listIDCategory.get(index);\n deleteCategory(idCategory);\n \n }" ]
[ "0.76444525", "0.7598077", "0.75521874", "0.75407135", "0.75199944", "0.74917835", "0.7406628", "0.7141458", "0.70541704", "0.70248365", "0.6972051", "0.6890781", "0.6735683", "0.6687355", "0.667955", "0.66658026", "0.6600993", "0.6568878", "0.65545845", "0.6543982", "0.65155685", "0.65039414", "0.64975506", "0.644996", "0.64490116", "0.6415152", "0.6410521", "0.63992167", "0.6372073", "0.63638806", "0.63545877", "0.6293404", "0.6282612", "0.6279604", "0.6248238", "0.62263745", "0.62194604", "0.62178355", "0.62010235", "0.62009215", "0.6198728", "0.6172481", "0.6161692", "0.6156554", "0.61542964", "0.61503965", "0.6122922", "0.6112103", "0.61025226", "0.60921925", "0.6091696", "0.60770667", "0.6053643", "0.6052139", "0.60338837", "0.6002901", "0.6002772", "0.60017866", "0.6000564", "0.5992934", "0.59844166", "0.5980622", "0.59747034", "0.5933089", "0.59327763", "0.59224826", "0.5916592", "0.5915955", "0.5915082", "0.591362", "0.5913548", "0.5911423", "0.5909506", "0.5896486", "0.5879425", "0.58558", "0.5854437", "0.58521485", "0.5834972", "0.5829095", "0.5824074", "0.58218896", "0.5815199", "0.5800557", "0.5796092", "0.5795464", "0.5795397", "0.57950336", "0.5772886", "0.57718563", "0.5767294", "0.5758415", "0.57504326", "0.5730217", "0.5730217", "0.57219607", "0.5720354", "0.5708797", "0.57077104", "0.57056457" ]
0.7787066
0
find return CmVocabularyCategory get CmVocabularyCategory object by primary key
@Transactional public CmVocabularyCategory getCmVocabularyCategoryById(final String id) { CmVocabularyCategory cmVocabularyCategory = dao.findById(CmVocabularyCategory.class, id); return cmVocabularyCategory; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Cvcategory findCvcategoryById(Long id);", "Category findCategoryById(Long id);", "Category getCategoryById(int id);", "Category findById(int id);", "public Category getCategoryById()\r\n {\r\n return cdb.getCategoryById();\r\n }", "Categorie findOne(Long id);", "Category getCategoryById(int categoryId);", "Category getCategoryById(Integer categoryId);", "ProductCategory find(int id)throws IllegalArgumentException;", "public Categorie getCategorieById(long id);", "Category selectCategory(long id);", "@Override\n\tpublic Category findById(String id) {\n\t\treturn null;\n\t}", "CodeCategory getCodeCategory(UUID id)\n throws DAOException;", "ItemCategory selectByPrimaryKey(Integer id);", "DvdCategory searchCategoryById(Integer id) throws DvdStoreException;", "Optional<Category> getCategory(Integer id);", "Category findByName(String name);", "public Long getCategoriaId();", "@Override\n\tpublic Category getById(long id) {\n\t\treturn getById(id);\n\t}", "@Override\n\tpublic Category fetchByPrimaryKey(long categoryId) {\n\t\treturn fetchByPrimaryKey((Serializable)categoryId);\n\t}", "CachedCodeCategory getCachedCodeCategory(UUID id)\n throws DAOException;", "@Override\n\tpublic Category getCategory(int id) {\n\t\treturn categoryRepository.getOne(id);\n\t}", "@Override\n\tpublic Category getCategoryById(String id) {\n\t\tSession session = sessionFactory.openSession();\n\t\tsession.beginTransaction();\n\t\tint catId = Integer.parseInt(id);\n\t\tQuery query = session.getNamedQuery(Category.GET);\n\t\tquery.setInteger(\"id\", catId);\n\t\tCategory category = (Category) query.uniqueResult();\n\t\tsession.getTransaction().commit();\n\t\tsession.close();\n\t\treturn category;\n\t}", "@Override\r\n\tpublic Category getCategoryById(int id) {\n\t\treturn getHibernateTemplate().get(Category.class, id);\r\n\t}", "ConfigCategory getCategoryById(long categoryId);", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Category> getCategoryFindById(Byte id) {\n return em.createNamedQuery(\"Category.findById\", Category.class)\n .setParameter(\"id\", id)\n .getResultList();\n }", "public static Category findCategoryById(Long id){\n return categoryFinder.where().eq(\"category-id\", id).findUnique();\n }", "AbsractCategory searchByID(int identificaitonNumber) throws PersistenceException;", "Category getByName(String name);", "public DVDCategorie getDVDCategorie(int id);", "Category getCategoryByName(String categoryName);", "public Category selectByPrimaryKey(Integer categoryId) throws SQLException {\r\n Category key = new Category();\r\n key.setCategoryId(categoryId);\r\n Category record = (Category) sqlMapClient.queryForObject(\"CATEGORY.abatorgenerated_selectByPrimaryKey\", key);\r\n return record;\r\n }", "@Transactional\r\n\tpublic Categories selectByPrimaryKey(Integer id) {\n\t\tCategories categories = categoriesDao.selectByPrimaryKey(id);\r\n\t\t//return categories;\r\n\t\treturn categories;\r\n\t}", "@Override\n\tpublic SApplicationcategory findById(String id) {\n\t\treturn SApplicationcategorydao.findById(SApplicationcategory.class,id);\n\t}", "public Category find_Category(Integer category_id, Integer branch_id) {\n return category_dao.find(category_id, branch_id);\n }", "@Override\n\tpublic Categories findById(Integer catId) {\n\t\treturn categoriesDAO.findById(catId);\n\t}", "@Override\n\tpublic Category getCategory(Long id) {\n\t\treturn (Category)sessionFactory.getCurrentSession().get(Category.class.getName(), id);\n\t}", "@Override\r\n\tpublic Category findCategory(int idCategory) {\n\t\treturn em.find(Category.class, idCategory);\r\n\t}", "@RequestMapping(value=\"/{categoryId}\",\n\t\t\tmethod=RequestMethod.GET, \n\t\t\tproduces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<Category> getCategoryById(@PathVariable(\"categoryId\") Long categoryId){\n\t\t\n\t\tCategory category = categoryService.findById(categoryId);\n\t\tif (category == null) {\n\t\t\treturn new ResponseEntity<Category>(HttpStatus.NOT_FOUND);\n\t\t}\n\t\t\n\t\treturn new ResponseEntity<Category>(category, HttpStatus.OK);\n\t}", "@Transactional\r\n\tpublic List<CmVocabularyCategory> getCmVocabularyCategorys() {\r\n\t\treturn dao.findAllWithOrder(CmVocabularyCategory.class, \"modifyTimestamp\", false);\r\n\t}", "public Category getCategory();", "@Override\n public ICategory findById(Long id) {\n return locationDao.findById(id);\n }", "@Override\n @Transactional(readOnly = true)\n @Cacheable\n public Category findOne(Long id) {\n log.debug(\"Request to get Category : {}\", id);\n return categoryRepository.findOne(id);\n }", "ProductCategory findOneProductCategoryByProductCategoryCode(String categoryCode);", "public long getCategoryId();", "public DocCategory getDocCategoryById(Integer id) {\n return docCategoryRepository.findById(id).orElseThrow(EntityNotFoundException::new);\n }", "TbInvCategory selectByPrimaryKey(TbInvCategoryKey key);", "@RequestMapping(value = RestConstant.BY_ID, method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)\r\n\tpublic ResponseEntity<Category> getCategoryById(@PathVariable(\"id\") Long id) {\r\n\t\ttry {\r\n\t\t\tCategory category = categoryService.findById(id);\r\n\t\t\treturn new ResponseEntity<Category>(category, HttpStatus.OK);\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.error(\"Failed to read category \" + id, e);\r\n\t\t\treturn new ResponseEntity<Category>(HttpStatus.INTERNAL_SERVER_ERROR);\r\n\t\t}\r\n\t}", "@RequestMapping(value = \"/category/{id}\", method = RequestMethod.GET)\n\tpublic @ResponseBody Optional<Category> findCategoryRest(@PathVariable(\"id\") Long categoryId) {\n\t\treturn CatRepo.findById(categoryId);\n\t}", "public Category get(int id) {\n\t\treturn (Category) this.getCurrentSession().get(Category.class, id);\r\n\t}", "@Transactional(readOnly = true)\n public SubCategory findOne(Long id) {\n log.debug(\"Request to get SubCategory : {}\", id);\n SubCategory subCategory = subCategoryRepository.findOne(id);\n return subCategory;\n }", "public static Categorias obtenerCategoria(int id){\n Categorias categoria = new Categorias();\n \n Categorias c = new Categorias();\n \n c.conectar();\n \n c.crearQuery(\"select * from categoria_libro where id = ?\");\n \n c.agregarParametro(1, id);\n \n ResultSet informacion = c.getResultSet();\n \n try {\n if (informacion.next())\n categoria = new Categorias(informacion);\n } catch (Exception error) {}\n \n c.desconectar();\n \n return categoria;\n }", "public int getR_Category_ID();", "@Override\n\tpublic List<Category> findcategory() {\n\t\t\n\t\tConnection conn=null;\n\t\tPreparedStatement pst=null;\n\t\tResultSet rs=null;\n\t\t\n\t\tList<Category> list=new ArrayList<Category>();\n\t\ttry {\n\t\t\tconn=DBUtils.getConnection();\n\t\t\tpst=conn.prepareStatement(\"select id,parent_id,name,status,sort_order,create_time,update_time from category\");\n\t\t\t\n\t\t\trs=pst.executeQuery();\n\t\t\t\n\t\t\twhile (rs.next()) {\n\t\t\t\tCategory category=new Category(rs.getInt(\"id\"),rs.getInt(\"parent_id\"),rs.getString(\"name\"),rs.getInt(\"status\"),rs.getInt(\"sort_order\"),rs.getDate(\"create_time\"),rs.getDate(\"update_time\"));\n\t\t\t\tlist.add(category);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally {\n\t\t\ttry {\n\t\t\t\tDBUtils.Close(conn, pst, rs);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t\t\n\t\t\n\n\t}", "@Override\n\tpublic Category getCategory(String catId) {\n\t\tString cat=\"From Category where catId='\"+catId+\"'\";\n\t\tQuery q=sessionFactory.getCurrentSession().createQuery(cat);\n\t\tList<Category> catlist=(List<Category>) q.list();\n\t\tif(catlist==null||catlist.isEmpty())\n\t\t{\n\t\treturn null;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn catlist.get(0);\n\t\t\n\t\t}\n\t}", "@ApiMethod(name = \"getCategory\", path = \"category/{id}\", httpMethod = ApiMethod.HttpMethod.GET)\n public Category getCategory(@Named(\"id\") Long id)\n throws NotFoundException {\n\n return mCategoryService.getById(id);\n }", "public List<Cvcategory> findAllCvcategories();", "EmailTemplateSubCategoryMaster findbyId(long subcategoryId);", "@Override\n public Category getCategoryById(int categoryId)\n {\n String query = \"SELECT * FROM Categories WHERE CategoryID = \" + categoryId;\n ResultSet rs = DataService.getData(query);\n \n try\n {\n if (rs.next())\n {\n return convertResultSetToCategory(rs);\n }\n }\n catch (SQLException e)\n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n \n return null;\n }", "@Test\n public void findCategoryById() {\n\n Long categoryId = (long) 1;\n CategoryEto category = this.dishmanagement.findCategory(categoryId);\n assertThat(category).isNotNull();\n }", "public Category findByCategoryName(String CategoryName) throws InstanceNotFoundException;", "public Integer getCategoryId() {\n return categoryId;\n }", "public Integer getCategoryId() {\n return categoryId;\n }", "public Category getById(final Long id) {\r\n return this.manager.find(Category.class, id);\r\n }", "public Long getCategoryId() {\n return categoryId;\n }", "@Override\n// @CachePut(cacheNames = \"category\",key=\"#name\")\n public CMSCategory getOrCreateOneByName(String name){\n CMSCategory category = findCMSCategoryByName(name);\n if (category==null) {\n category = new CMSCategory();\n category.setDisabled(false);\n category.setEnglishName(name);\n category.setName(name);\n cmsCategoryRepository.save(category);\n }\n return category;\n }", "public Category getCategoryById(Long id) {\n if (allCategories == null || sortedCategories == null) {\n buildCategories();\n }\n\n Category categoryToReturn = null;\n for (Category category : allCategories) {\n if (category.getId().equals(id)) {\n categoryToReturn = category;\n }\n }\n return categoryToReturn;\n }", "public Category getCategory()\r\n\t{\r\n\t\treturn getCategory( getSession().getSessionContext() );\r\n\t}", "public static Category getCategoryById(int id){\n\t\treturn CategoryDAO.getCategoryById(id);\n\t}", "@Override\n\tpublic Category getCategory(int idCat) {\n\t\treturn dao.getCategory(idCat);\n\t}", "Category selectCategory(String name);", "@GetMapping(\"/find/{idcategory}\")\n\tpublic ResponseEntity<?> findById(@PathVariable int idcategory){\n\t\tCategoryVO cat = catService.findById(idcategory);\n\t\treturn checkNull(cat);\n\t}", "int getCategoryId();", "public Conge find( Integer idConge ) ;", "public Category findCategory(Long cid) {\n\t\treturn categoryDao.get(cid);\n\t}", "@Override\r\n\tpublic Categoria read(int id) {\n\t\tCategoria a = new Categoria();\r\n\t\tString SQL = \"select *from rol where categoria_idcategoria=?\";\r\n\t\ttry {\r\n\t\t\tcx = Conexion.getConexion();\r\n\t\t\tps = cx.prepareStatement(SQL);\r\n\t\t\tps.setInt(1, id);\r\n\t\t\trs = ps.executeQuery();\r\n\t\t\twhile (rs.next()) {\t\t\t\t\r\n\t\t\t\ta.setCategoria_idcategoria(rs.getInt(\"categoria_idcategoria\"));\r\n\t\t\t\ta.setNombre(rs.getString(\"nombre\"));\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\treturn a;\r\n\t}", "Optional<Category> getCategory(String title);", "@Override\n\tpublic ItemTypeCategory fetchByPrimaryKey(Serializable primaryKey)\n\t\tthrows SystemException {\n\t\tItemTypeCategory itemTypeCategory = (ItemTypeCategory)EntityCacheUtil.getResult(ItemTypeCategoryModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\tItemTypeCategoryImpl.class, primaryKey);\n\n\t\tif (itemTypeCategory == _nullItemTypeCategory) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (itemTypeCategory == null) {\n\t\t\tSession session = null;\n\n\t\t\ttry {\n\t\t\t\tsession = openSession();\n\n\t\t\t\titemTypeCategory = (ItemTypeCategory)session.get(ItemTypeCategoryImpl.class,\n\t\t\t\t\t\tprimaryKey);\n\n\t\t\t\tif (itemTypeCategory != null) {\n\t\t\t\t\tcacheResult(itemTypeCategory);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tEntityCacheUtil.putResult(ItemTypeCategoryModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\t\tItemTypeCategoryImpl.class, primaryKey,\n\t\t\t\t\t\t_nullItemTypeCategory);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tEntityCacheUtil.removeResult(ItemTypeCategoryModelImpl.ENTITY_CACHE_ENABLED,\n\t\t\t\t\tItemTypeCategoryImpl.class, primaryKey);\n\n\t\t\t\tthrow processException(e);\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcloseSession(session);\n\t\t\t}\n\t\t}\n\n\t\treturn itemTypeCategory;\n\t}", "@Override\n\tpublic List<Category> getCategoryByKey(String mc) {\n\t\treturn dao.getCategoryByKey(mc);\n\t}", "public Kateggorija getKateggorijaPoId(int _id) {\n\n try {\n return getDaoKateggorija().queryForId(_id);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n }", "public int getCategory_id() {\n return category_id;\n }", "public Category getCategoryById(int categoryId) {\n\t\tSession session = getSession();\n\t\t\n\t\tQuery query = session.createQuery(\"from Category where categoryId = ?\");\n\t\tquery.setInteger(0, categoryId);\n\t\treturn(Category) query.uniqueResult();\n\t}", "public SubCategory getSubCategoryId(Integer catId);", "public static Category getCategory(int id) {\n List<Category> categories = getCategories();\n for (Category c : categories) {\n if (c.getId() == id) {\n return c;\n }\n }\n return null;\n }", "@Query(\"SELECT * FROM species_category WHERE category_id = :id LIMIT 1\")\n LiveData<SpeciesCategory> findById(long id);", "public void setCategoriaId(Long id);", "@PreAuthorize(\"hasRole('ROLE_ADMIN')\")\n @RequestMapping(value=\"/{id}\", method= RequestMethod.GET)\n public ResponseEntity<CategoryDTO> getCategory(@PathVariable Long id){\n\n Category cat = catService.findOne(id);\n\n if(cat == null){\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n }\n\n return new ResponseEntity<>(catMapper.toDto(cat), HttpStatus.OK);\n }", "public Category get(Long cid) {\n\t\treturn categoryDao.get(cid);\n\t}", "@Override\n\tpublic List<AnimalCategory> findCategory() {\n\t\tList<AnimalCategory> list = animaldao.findCategory();\n\t\treturn list;\n\t}", "@Transactional\n\tpublic CategoryEntity getCategoryEntity(int idCategory) {\n\t\t\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\tCategoryEntity categoryEntity = (CategoryEntity) session.createQuery(\"from category where idCategory='\"+idCategory+\"'\").getSingleResult();\n\t\t\n\t\treturn categoryEntity;\n\t}", "public objData getAnswerCategory(String id){\n objData objdata = new objData();\n try{\n MainClient mc = new MainClient(DBConn.getHost());\n\n String query = \"SELECT AC_REFID, AC_CATEGORY FROM ANS_CATEGORY WHERE AC_REFID = '\" + id + \"'\";\n String data[] = {};\n\n objdata.setTableData(mc.getQuery(query,data));\n }\n catch(Exception e){\n objdata.setErrorMessage(e.toString());\n objdata.setFlag(1);\n }\n return objdata;\n }", "public String getCategoryId() {\n return categoryId;\n }", "@Override\n\tpublic Category getCategory(String categoryId) throws Exception {\n\t\treturn null;\n\t}", "@Transactional\r\n\tpublic void delete(final String pk) {\r\n\t\tdao.delete(CmVocabularyCategory.class, pk);\r\n\t}", "public Category getCategorybyID(int id) {\n\t dbUtil = new DBUtil();\n\t StringBuffer sbQuery = dbUtil.getQueryBuffer();\n\t ArrayList<String> args = dbUtil.getArgs();\n\t ResultSet rs = null;\n\t Category found = null;\n\t \n\t /*** Get the details of a particular User ***/\n\t /*** QUERY ***/\n\t sbQuery.setLength(0);\n\t sbQuery.append(\" SELECT \");\n\t sbQuery.append(\" id, \");\n\t sbQuery.append(\" name, \");\n\t sbQuery.append(\" userid \");\n\t sbQuery.append(\" FROM lookup.category c \");\n\t sbQuery.append(\" WHERE c.id = ? \");\n\t \n\t /*** Get Connection and Execute ***/\n\t try{\n\t \n\t PreparedStatement ps = dbUtil.getConnection().prepareStatement(sbQuery.toString());\n\t \n\t /*** Add query parameters ***/\n\t ps.setInt(1, id);\n\t \n\t rs = ps.executeQuery();\n\t \n\t }catch(Exception e){\n\t log.info(\"Exception Occured\");\n\t log.info(\"Class Name: \" +this.getClass().getName());\n\t log.info(\"Method: getUserById()\");\n\t log.info(e.getMessage());\n\t }\n\t \n\t /*** Convert the result set into a User object ***/\n\t if(rs!=null)\n\t found = TransformUtil.convertToCategory(rs);\n\t \n\t dbUtil.closeConnection();\n\t dbUtil = null;\n\t \n\t return found;\n\t}", "public Category getCategory() {\n return category;\n }", "public Cursor getCategoriaId(String idCategoria){\n //Creamos el conector de bases de datos\n AdmiSQLiteOpenHelper admin = new AdmiSQLiteOpenHelper(this, \"administracion\", null, 1 );\n // Abre la base de datos en modo lectura y escritura\n SQLiteDatabase BasesDeDatos = admin.getWritableDatabase();\n Cursor consultaId = BasesDeDatos.rawQuery(\"SELECT id, nom_categoria, desp_categoria FROM t_categoria WHERE activo = 1 AND id =\" + idCategoria, null);\n // consultaId.close();\n // BasesDeDatos.close();\n return consultaId;\n }", "public Category getCategory() {\r\n return category;\r\n }", "@Override\n\tpublic Cat getById(Integer id) {\n\t\tOptional<Cat> cat = catRepository.findById(id);\n\t\tif(cat.isPresent()) {\n\t\t\treturn cat.get();\n\t\t} else {\n\t\t\tthrow new CatNotFoundException();\n\t\t}\n\t}", "public Category getCategory() {\r\n\t\treturn entity.getCategory();\r\n\t}" ]
[ "0.7548028", "0.7547502", "0.73906916", "0.7349028", "0.73265904", "0.7314586", "0.7251769", "0.7104408", "0.7099431", "0.70570904", "0.69815105", "0.67677045", "0.6746542", "0.670121", "0.6636676", "0.66293746", "0.6525613", "0.65178746", "0.6500964", "0.6475855", "0.6418403", "0.6414725", "0.63979286", "0.63944817", "0.63838345", "0.6379465", "0.63765115", "0.63498956", "0.6311886", "0.6285116", "0.62532306", "0.62531376", "0.6252976", "0.62445134", "0.620935", "0.61754596", "0.61607754", "0.6140879", "0.61085147", "0.60998285", "0.60969543", "0.60833925", "0.60695326", "0.6052836", "0.60517985", "0.60088766", "0.600119", "0.5990348", "0.5987833", "0.5980961", "0.5970688", "0.59615135", "0.5959149", "0.5949901", "0.5932142", "0.59229404", "0.59136903", "0.58956707", "0.58956575", "0.5888701", "0.5888306", "0.58783054", "0.58783054", "0.58776027", "0.5868202", "0.5848011", "0.5843627", "0.58399266", "0.5839851", "0.5821762", "0.5816204", "0.58140945", "0.5799633", "0.57947433", "0.57561654", "0.5704733", "0.56993264", "0.5692704", "0.5685449", "0.56823885", "0.56816953", "0.56791526", "0.5678345", "0.5664103", "0.5662213", "0.5655604", "0.56529266", "0.56497586", "0.56467235", "0.56451315", "0.5643422", "0.5641887", "0.5633978", "0.5631348", "0.56231564", "0.5617194", "0.56169873", "0.56003433", "0.5582235", "0.55788255" ]
0.74294335
2
get all CmVocabularyCategory objects
@Transactional public List<CmVocabularyCategory> getCmVocabularyCategorys() { return dao.findAllWithOrder(CmVocabularyCategory.class, "modifyTimestamp", false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "List<Category> getAllCategories();", "public List<Categorie> getAllCategories();", "public List<ProductCatagory> getAllCategory() throws BusinessException;", "public List<Cvcategory> findAllCvcategories();", "@Override\n\tpublic List<Category> getAllCategory() {\n\t\treturn category.selectAllCategory();\n\t}", "public static List<Category> getAllCategory() {\n\n List<Category> categoryList = new ArrayList<>();\n try {\n categoryList = Category.listAll(Category.class);\n } catch (Exception e) {\n\n }\n return categoryList;\n\n }", "public List<Category> findAll() {\n\t\treturn categoryMapper.selectAll();\n\t}", "public List<Category> getAllCategories() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = (Query) session.createQuery(\"from Category\");\r\n\t\tList<Category> categories = query.list();\r\n\r\n\t\treturn categories;\r\n\t}", "@Override\r\n\tpublic List<Category> getAllCategory() {\n\t\tString hql = \"from Category\";\r\n\t\treturn (List<Category>) getHibernateTemplate().find(hql);\r\n\t}", "@Override\r\n\tpublic List<Category> getAllCategory() {\n\t\treturn categoryDao.getAll();\r\n\t}", "public List<Category> getAllCategories() {\n\t\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\tQuery q = session.createQuery(\"from Category\");\n\t\t\tList<Category> catlist = q.list();\n\t\t\t\n\t\t\treturn catlist;\n\t\t}", "@Override\n\tpublic Iterable<Category> findAllCategory() {\n\t\treturn categoryRepository.findAll();\n\t}", "@Override\n\tpublic List<Category> findAllCategory() {\n\t\treturn categoryRepository.findAllCategory();\n\t}", "List<ProductCategory> getAll();", "@Override\n\tpublic List<Category> getAllCategory() {\n\t\treturn dao.getAllCategory();\n\t}", "public List<Category> findAll() {\n\t\treturn categoryDao.getAll();\n\t}", "public Flowable<List<Category>> getCategories() {\n return findAllData(Category.class);\n }", "List<Category> getAllCategories() throws DaoException;", "@Override\n\tpublic List<Category> getAllCategories() {\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(\"FROM \"+Category.class.getName());\n\t\treturn (List<Category>)query.list();\t\t\n\t}", "@Override\r\n\tpublic List<Category> list() {\n\t\treturn categories;\r\n\t}", "List<Category> lisCat() {\n return dao.getAll(Category.class);\n }", "public List<DocCategory> getAllDocCategories() {\n return docCategoryRepository.findAll();\n }", "@Override\r\n\tpublic List<Categorie> getAllCategorie() {\n\t\treturn cateDao.getAllCategorie();\r\n\t}", "public static List<Category> findAll() {\n List<Category> categories = categoryFinder.findList();\n if(categories.isEmpty()){\n categories = new ArrayList<>();\n }\n return categories;\n }", "@Override\n\tpublic List<Category> findAll() {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "List<Category> getAllCategories() throws DataBaseException;", "public List<Category> findAll();", "public ArrayList<Category> getCategories() {\n ArrayList<Category> categories = new ArrayList<>();\n Cursor cursor = database.rawQuery(\"SELECT * FROM tbl_categories\", null);\n cursor.moveToFirst();\n while (!cursor.isAfterLast()) {\n Category category = new Category();\n category.setCategory_id(cursor.getInt(cursor.getColumnIndex(\"category_id\")));\n category.setCategory_name(cursor.getString(cursor.getColumnIndex(\"category_name\")));\n\n\n categories.add(category);\n cursor.moveToNext();\n }\n cursor.close();\n return categories;\n }", "public List<Category> getCategories() {\n CategoryRecords cr = company.getCategoryRecords();\n List<Category> catList = cr.getCategories();\n return catList;\n }", "public @NotNull Set<Category> findAllCategories() throws BazaarException;", "public List<Category> list() {\n\t\tSession session = getSession();\n\n\t\tQuery query = session.createQuery(\"from Category\");\n\t\tList<Category> categoryList = query.list();\n session.close();\n\t\treturn categoryList;\n\t}", "public Collection<Categoria> listar() {\n\t\tQuery q = manager.createQuery(\"SELECT p FROM Categoria p\");\n\t\treturn (Collection<Categoria>) q.getResultList();\n\t}", "public List<String> getCategories();", "List<Category> findAll();", "public ArrayList<Categories> getAllCategories() {\n\t\t\n\t\tCategories cg;\n\t\tArrayList<Categories> list=new ArrayList<Categories>();\n\t\t\n\t\ttry {\n\t\t\t String query=\"select * from categories;\";\n\t\t\tPreparedStatement pstm=con.prepareStatement(query);\n\t\t\tResultSet set= pstm.executeQuery();\n\t\t\t\n\t\t\twhile(set.next()) {\n\t\t\t\tint cid=set.getInt(1);\n\t\t\t\tString cname=set.getString(2);\n\t\t\t\tString cdes=set.getString(3);\n\t\t\t\t\n\t\t\t\tcg=new Categories(cid, cname, cdes);\n\t\t\t\tlist.add(cg);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "@Override\r\n\tpublic List<Category> findAll() {\n\t\treturn(List<Category>) em.createNamedQuery(\"findAllCategories\").getResultList();\r\n\t}", "public List<Category> getAllAvailableCategory() {\n\t\treturn categoryManager.getAllAvailable();\n\t}", "@Override\n public List<Category> getAll()\n {\n \n ResultSet rs = DataService.getData(\"SELECT * FROM Categories\");\n \n List<Category> categories = new ArrayList<Category>();\n \n try\n {\n while (rs.next())\n {\n categories.add(convertResultSetToCategory(rs));\n }\n }\n catch (SQLException e)\n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n \n return categories;\n }", "public List<Category> findAllCategoryt_id() {\n\t\treturn null;\n\t\t\n\t}", "public static List<Categorias> obtenerCategorias(){\n List<Categorias> categorias = new ArrayList<>();\n \n Categorias c = new Categorias();\n \n c.conectar();\n \n c.crearQuery(\"select * from categoria_libro\");\n \n ResultSet informacion = c.getResultSet();\n \n try {\n while (informacion.next())\n categorias.add(new Categorias(informacion));\n } catch (Exception error) {}\n \n c.desconectar();\n \n return categorias;\n }", "public List<CategoriaVO> mostrarCategorias() {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tCategoriaDAO OwlDAO = new CategoriaDAO();\n\t\t\tList<CategoriaVO> resultado = new ArrayList();\n\t\t\tresultado = OwlDAO.obtenerCategorias(mysql);\n\t\t\treturn resultado;\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\t\t\treturn null;\n\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}", "public static List<Category> getCategories(Context context) {\r\n DbManager dbManager = new DbManager(context);\r\n SQLiteDatabase db = dbManager.getReadableDatabase();\r\n\r\n Cursor cursor = db.query(\r\n CategoryTable.TABLE_NAME,\r\n new String[]{CategoryTable._ID, CategoryTable.COLUMN_NAME_CATEGORY_NAME},\r\n CategoryTable.COLUMN_NAME_IS_DELETED + \" = 0\",\r\n null,\r\n null,\r\n null,\r\n CategoryTable.COLUMN_NAME_CATEGORY_NAME + \" ASC\"\r\n );\r\n\r\n List<Category> categories = new ArrayList<>();\r\n while(cursor.moveToNext()) {\r\n Category category = new Category();\r\n category._id = cursor.getInt(cursor.getColumnIndexOrThrow(CategoryTable._ID));\r\n category.category = cursor.getString(cursor.getColumnIndexOrThrow(CategoryTable.COLUMN_NAME_CATEGORY_NAME));\r\n categories.add(category);\r\n }\r\n cursor.close();\r\n db.close();\r\n\r\n return categories;\r\n }", "@ModelAttribute(\"categories\")\r\n\tpublic List<Category> getCategoryList() {\r\n\t\treturn categoryDAO.list();\r\n\t}", "List<Categorie> findAll();", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Category> getCategoryFindAll() {\n return em.createNamedQuery(\"Category.findAll\", Category.class).getResultList();\n }", "@Override\n\tpublic List<Categories> getListCat() {\n\t\treturn categoriesDAO.getListCat();\n\t}", "public List<Category> getListCategory() {\n List<Category> list = new ArrayList<>();\n SQLiteDatabase sqLiteDatabase = dbHelper.getWritableDatabase();\n\n Cursor cursor = sqLiteDatabase.rawQuery(\"SELECT * FROM Category\", null);\n while (cursor.moveToNext()) {\n int id =cursor.getInt(0);\n\n Category category = new Category(id, cursor.getString(cursor.getColumnIndex(\"Name\")), cursor.getString(cursor.getColumnIndex(\"Image\")));\n Log.d(\"TAG\", \"getListCategory: \" + category.getId());\n list.add(category);\n }\n cursor.close();\n dbHelper.close();\n return list;\n }", "public List<CategoriaEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todas las categorias\");\n // Se crea un query para buscar todas las categorias en la base de datos.\n TypedQuery query = em.createQuery(\"select u from CategoriaEntity u\", CategoriaEntity.class);\n // Note que en el query se hace uso del método getResultList() que obtiene una lista de categorias.\n return query.getResultList();\n }", "public static ArrayList<String> getCategories() {\n String query;\n ArrayList<String> categories = new ArrayList<String>();\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT category FROM category;\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()) {\n categories.add(rs.getString(\"category\"));\n }\n\n Database.closeDBconnection(con);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n return categories;\n }", "public List<Category> getCategories() {\n this.catr = m_oCompany.getCategoryRecords();\n return catr.getCategories();\n }", "public List<Category> queryExistingCategory(){\n\t\tArrayList<Category> cs = new ArrayList<Category>(); \n\t\tCursor c = queryTheCursorCategory(); \n\t\twhile(c.moveToNext()){\n\t\t\tCategory category = new Category();\n\t\t\tcategory._id = c.getInt(c.getColumnIndex(\"_id\"));\n\t\t\tcategory.title = c.getString(c.getColumnIndex(DBEntryContract.CategoryEntry.COLUMN_NAME_TITLE));\n\t\t\tcategory.numberOfEntries = this.queryLocationEntryNumberByCategory(category._id);\n\t\t\tcs.add(category);\n\t\t}\n\t\t// close the cursor\n\t\tc.close();\n\t\treturn cs;\n\t\t\n\t}", "public List<Category> getlist() {\n\t\tSession session = getSession();\n\t\t\n\t\tQuery query = session.createQuery(\"from Category\");\n\t\tList<Category> categoryList = query.list();\n\t\treturn categoryList;\n\t}", "public Categories getCategories() {\n return this.categories;\n }", "public ArrayList<Categoria> listarCategorias();", "public List<String> findAllCategories() {\r\n\t\tList<String> result = new ArrayList<>();\r\n\r\n\t\t// 1) get a Connection from the DataSource\r\n\t\tConnection con = DB.gInstance().getConnection();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// 2) create a PreparedStatement from a SQL string\r\n\t\t\tPreparedStatement ps = con.prepareStatement(GET_CATEGORIES_SQL);\r\n\r\n\t\t\t// 3) execute the SQL\r\n\t\t\tResultSet resultSet = ps.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\r\n\t\t\t\tString cat = resultSet.getString(1);\r\n\t\t\t\tresult.add(cat);\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException se) {\r\n\t\t\tse.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tDB.gInstance().returnConnection(con);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "@GetMapping(\"/category\")\n\t public ResponseEntity<List<Category>> getcategorys() {\n\n\t List<Category> list = categoryService.getAllcategorys();\n\t if (list.size() <= 0) {\n\t return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\t }\n\t return ResponseEntity.status(HttpStatus.CREATED).body(list);\n\t }", "@RequestMapping(value = \"/categories\", method = RequestMethod.GET, produces = \"application/json\")\n public Collection<String> getCategories() {\n return this.datasetService.getCategories();\n }", "@Override\n\tpublic List<Cat> getAll() {\n\t\treturn catRepository.findAll();\n\t}", "public Set<String> getAllBooksCategories() {\n List<Book> books = bookRepository.findAll();\n Set<String> categories = new HashSet<>();\n for (Book book : books) {\n if (book.getCategories() != null) {\n categories.addAll(Arrays.asList(book.getCategories()));\n }\n }\n return categories;\n }", "public List<Categoria> listarCategorias(){\n //este metodo devuelve una lista.\n return categoriaRepo.findAll(); \n\n }", "@Override\n\tpublic List<EventCategory> getAllCategories() {\n\t\treturn categoriesRepository.findAll();\n\t}", "@NonNull\n public static List<Category> getCategories() {\n if (CATEGORY == null) {\n CATEGORY = new ArrayList<>();\n CATEGORY.add(new Category(\"Bollywood\", R.drawable.bollywood, 1));\n CATEGORY.add(new Category(\"Hollywood\", R.drawable.hollywood3, 2));\n CATEGORY.add(new Category(\"Cricket\", R.drawable.cricket4, 3));\n CATEGORY.add(new Category(\"Science\", R.drawable.science1, 4));\n CATEGORY.add(new Category(\"Geography\", R.drawable.geography, 5));\n CATEGORY.add(new Category(\"History\", R.drawable.history, 6));\n }\n return CATEGORY;\n }", "@GetMapping\n\t public List<Categories> touslescategories() {\n\t\treturn catsociete.findAll();}", "@Override\n\tpublic List<Categoryb> GetCategpryb() {\n\t\treturn null;\n\t}", "public static ResultSet getAllCategory() {\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"SELECT catName FROM category\");\n return rs;\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public List<Category> getAllCategories() {\n\t dbUtil = new DBUtil();\n\t StringBuffer sbQuery = dbUtil.getQueryBuffer();\n\t ArrayList<String> args = dbUtil.getArgs();\n\t ResultSet rs = null;\n\t List<Category> listCategory = null;\n\t \n\t /*** Get the details of a particular Category ***/\n\t /*** QUERY ***/\n\t sbQuery.setLength(0);\n\t sbQuery.append(\" SELECT \");\n\t sbQuery.append(\" id, \");\n\t sbQuery.append(\" name, \");\n\t sbQuery.append(\" userid \");\n\t sbQuery.append(\" FROM lookup.category \");\n\t \n\t /*** Prepare parameters for query ***/\n\t args.clear();\n\t \n\t \n\t /*** Pass the appropriate arguments to DBUtil class ***/\n\t rs = dbUtil.executeSelect(sbQuery.toString(), args);\n\t \n\t /*** Convert the result set into a User object ***/\n\t if(rs!=null)\n\t listCategory = TransformUtil.convertToListCategory(rs);\n\t \n\t dbUtil.closeConnection();\n\t dbUtil = null;\n\t \n\t return listCategory;\n\t}", "@Override\n\tpublic List<Category> list() {\n\t\tList<Category> list=(List<Category>)\n\t\tsessionFactory.getCurrentSession().createCriteria(Category.class).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).list();\n\t\treturn list;\n\t}", "List<Category> getCategories() throws DAOExceptionHandler;", "@Override\n public Single<List<CategoryModel>> getCategories() {\n return api.getCategories().map(categories -> iVmMapper.mapToViewModel(categories));\n }", "public List<CategoryMappingValue> getCategories() {\r\n\t\treturn categories;\r\n\t}", "@GetMapping(\"category\")\n\t\tpublic List<String> getCategory(){\n\t\t\tList<String> list = repo.findByCat();\n\t\t\treturn list;\n\t\t\t\n\t\t\t\n\t\t}", "@Override\r\n\tpublic List<Categoria> readAll() {\n\t\tList<Categoria> lista = new ArrayList<>();\r\n\t\tString SQL = \"select *from categoria\";\r\n\t\ttry {\r\n\t\t\tcx = Conexion.getConexion();\r\n\t\t\tps = cx.prepareStatement(SQL);\r\n\t\t\trs = ps.executeQuery(SQL);\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tCategoria r = new Categoria();\r\n\t\t\t\tr.setCategoria_idcategoria(rs.getInt(\"CATEGORIA_IDCATEGORIA\"));\r\n\t\t\t\tr.setNombre(rs.getString(\"NOMBRE\"));\r\n\t\t\t\tlista.add(r);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.out.println(\"Error: \"+e);\r\n\t\t}\r\n\t\t\r\n\t\treturn lista;\r\n\t}", "default List<String> getCategory(String category) {\n return new ArrayList<>(getCategories().get(category.toLowerCase()).values());\n }", "public List<StadiumCategoryDTO> getCategories() {\n\t\treturn categories;\n\t}", "@Override\n\tpublic List<AnimalCategory> findCategory() {\n\t\tList<AnimalCategory> list = animaldao.findCategory();\n\t\treturn list;\n\t}", "public List<ZCategory> SelectAll() {\r\n\t\tList<ZCategory> Categories = new ArrayList<>();\r\n\t\tString lines[];\r\n\t\tlines = fm.getArray();\r\n\t\tfor (String string : lines) {\r\n\t\t\tCategories.add(stringToCategory(string));\r\n\t\t}\r\n\t\treturn Categories;\r\n\t}", "public ObservableList<String> getCategories()\n {\n ArrayList<Category> categoryList = rentalModel.getCategoryList();\n ArrayList<String> categoryListString = new ArrayList<>();\n for (int i = 0; i < categoryList.size(); i++)\n {\n categoryListString.add(categoryList.get(i).toString());\n }\n categoriesList = FXCollections.observableArrayList(categoryListString);\n return categoriesList;\n }", "@Override\n\tpublic List<Category> getCategories(){\n\t\treturn null;\n\t}", "public List<Category> getCategoriesDetails(){\r\n\t\tList<Category> res = new ArrayList<Category>();\r\n\t\tString req = \"select c.label, sum(f.amount) as total, sum(f.amount)/tmp.totmonth as percent, c.color \"\r\n\t\t\t\t\t+ \"from fee f, category c, (select sum(amount) as totmonth \"\r\n\t\t\t\t\t+ \"from fee \"\r\n\t\t\t\t\t+ \"where strftime('%m%Y', date) = strftime('%m%Y', date('now'))) as tmp \"\r\n\t\t\t\t\t+ \"where c.id = f.categoryid \"\r\n\t\t\t\t\t+ \"and strftime('%m%Y', f.date) = strftime('%m%Y', date('now')) \"\r\n\t\t\t\t\t+ \"group by c.id \"\r\n\t\t\t\t\t+ \"order by total desc;\";\r\n\t\t\r\n\t\tCursor cursor = database.rawQuery(req, null);\t\t\t\t\r\n\t\tif (cursor.moveToFirst()) {\r\n\t\t\tdo {\r\n\t\t\t\tCategory cat = new Category();\r\n\t\t\t\tcat.setLabel(cursor.getString(0));\r\n\t\t\t\tcat.setTotal(cursor.getString(1));\r\n\t\t\t\tcat.setPercent(cursor.getString(2));\r\n\t\t\t\tcat.setColor(cursor.getString(3));\r\n\t\t\t\tres.add(cat);\r\n\t\t\t} while (cursor.moveToNext());\r\n\t\t}\r\n\t\tif (cursor != null && !cursor.isClosed()) {\r\n\t\t\tcursor.close();\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t}", "public Vector<Vector<String>> getCategoryList()\r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\tString sql = \"SELECT * FROM categories\";\r\n\t\t\t\r\n\t\t\t//ResultSet rs= this.statement.executeQuery(sql);\t\t\r\n\t\t\tDataAccess data = new DataAccess();\r\n\t\t\tResultSet rs=data.getResultSet(sql);\t\t\r\n\t\t\tVector<Vector<String>> list= new Vector<Vector<String>>();\r\n\t\t\twhile (rs.next())\r\n\t\t\t{\r\n\t\t\t\tVector <String> result = new Vector <String>();\r\n\t\t\t\tresult.add(rs.getString(1));\r\n\t\t\t\tresult.add(rs.getString(2));\r\n\t\t\t\tresult.add(rs.getString(3));\t\t\t\t\t\t\r\n\t\t\t\tlist.add(result);\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\treturn list;\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public List<DVDCategorie> listDVDCategorie();", "public io.reactivesw.catalog.grpc.CategoryList getCategories(io.reactivesw.catalog.grpc.Empty request) {\n return blockingUnaryCall(\n getChannel(), METHOD_GET_CATEGORIES, getCallOptions(), request);\n }", "public List<String> categories() {\n return this.categories;\n }", "public java.util.List<es.davinciti.liferay.model.LineaGastoCategoria> findAll()\n\t\tthrows com.liferay.portal.kernel.exception.SystemException;", "@Override\n\tpublic ArrayList<Categoria> getCategorie() {\n\t\tDB db = getDB();\n\t\tArrayList<Categoria> categorie = new ArrayList<Categoria>();\n\t\tMap<Long, Categoria> list = db.getTreeMap(\"categorie\");\n\t\tfor(Map.Entry<Long, Categoria> categoria : list.entrySet())\n\t\t\tif(categoria.getValue() instanceof Categoria)\n\t\t\t\tcategorie.add((Categoria)categoria.getValue());\n\t\treturn categorie;\n\t}", "WebBookNewsCateListResult listAllBookNewsCategories();", "@Transactional\r\n\tpublic CmVocabularyCategory getCmVocabularyCategoryById(final String id) {\r\n\t\tCmVocabularyCategory cmVocabularyCategory = dao.findById(CmVocabularyCategory.class, id);\r\n\t\treturn cmVocabularyCategory;\r\n\t}", "@Override\n public List<CategoryDTO> listAll() {\n List<CategoryDTO> result = new ArrayList<>();\n List<Category> listCategory = categoryRepository.findAll();\n for (Category category: listCategory){\n result.add(categoryConverter.toDTO(category));\n }\n return result;\n }", "public void getCategorory(){\n\t\tDynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(AssetCategory.class, \"category\", PortalClassLoaderUtil.getClassLoader());\n\t\ttry {\n\t\t\tList<AssetCategory> assetCategories = AssetCategoryLocalServiceUtil.dynamicQuery(dynamicQuery);\n\t\t\tfor(AssetCategory category : assetCategories){\n\t\t\t\tlog.info(category.getName());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public static void consultarListaCategorias(Activity activity) {\n ConexionSQLite conectar = new ConexionSQLite(activity, BASE_DATOS, null, 1);\n SQLiteDatabase db = conectar.getReadableDatabase();\n CategoriaVo categoria = null;\n listaCategorias = new ArrayList<CategoriaVo>();\n Cursor cursor = db.rawQuery(\"SELECT * FROM \"+TABLA_CATEGORIAS, null);\n\n while (cursor.moveToNext()) {\n categoria = new CategoriaVo();\n categoria.setId(cursor.getInt(0));\n categoria.setCategoria(cursor.getString(1));\n categoria.setDescripcion(cursor.getString(2));\n\n listaCategorias.add(categoria);\n }\n db.close();\n }", "ListCategoryResponse listCategories(ListCategoryRequest request);", "@Override\n\tpublic List<FoodCategory> findAll() {\n\t\treturn foodCategoryDao.findAll();\n\t}", "@Override\r\n\tpublic List<Category> getAllCategories() throws CategoryRetrievalException {\n\t\ttry {\r\n\t\t\treturn categoryDao.getAllCategories();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tthrow new CategoryRetrievalException(\"error in retriving Category\");\r\n\t\t}\r\n\t}", "public final List<String> getCategories() {\n return new ArrayList<>(questionGeneratorStrategyFactory.createPracticeQuestionStrategy().generateQuestions().keySet());\n }", "@Transactional\n\tpublic List<CategoryEntity> GetCategory() {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\tList<CategoryEntity> categoryEntities = session.createQuery(\"from category\").getResultList();\n\n\t\treturn categoryEntities;\n\t}", "@Override\n\tpublic List<Categorya> GetCategorya() {\n\t\treturn null;\n\t}", "@Override\n public List<ProductCategory> getAllAvailableProductCategoriesForMetaData() {\n final List<Category> avaliableCategories = productCategoryDao.fetchAllAvailableCategoriesForProduct();\n final List<ProductCategory> availableProductCategories = new ArrayList<ProductCategory>();\n for (final Category availableCategory : avaliableCategories) {\n final ProductCategory category = new ProductCategory();\n category.setCategoryId(availableCategory.getCategoryId());\n category.setCategoryName(availableCategory.getCategoryName());\n category.setCategoryPartNumber(availableCategory.getCategoryPartNumber());\n availableProductCategories.add(category);\n }\n return availableProductCategories;\n }", "List<Category> getDeletedCategories();", "public List<ItemCategory> getByCat(int id) {\n return repository.findByCategoryId(id);\n }", "@Override\n\tpublic List<Category> findAll(int start, int end) {\n\t\treturn findAll(start, end, null);\n\t}" ]
[ "0.77787966", "0.7776659", "0.74419147", "0.7413999", "0.737426", "0.7339268", "0.726524", "0.7254111", "0.7250088", "0.724766", "0.7240098", "0.72391456", "0.72291553", "0.72036713", "0.72013986", "0.71347946", "0.7082838", "0.70707655", "0.7057638", "0.70493144", "0.70427614", "0.70221007", "0.70093274", "0.7009186", "0.697498", "0.69704354", "0.6967304", "0.69407535", "0.69258684", "0.6925593", "0.6872686", "0.68714064", "0.68660724", "0.68649113", "0.68357223", "0.68202186", "0.68179244", "0.6794301", "0.6790144", "0.6777555", "0.6770509", "0.676308", "0.6755093", "0.6741369", "0.6721175", "0.66863996", "0.664006", "0.6622292", "0.6610415", "0.6578677", "0.6573604", "0.6567285", "0.6554221", "0.65453887", "0.6539678", "0.6537615", "0.6511831", "0.65007627", "0.64967686", "0.6495207", "0.6473657", "0.6466769", "0.64522165", "0.6434689", "0.64276797", "0.64164144", "0.6415781", "0.6409742", "0.6361177", "0.63605845", "0.6341973", "0.63416874", "0.63416827", "0.63264453", "0.6323594", "0.6312499", "0.6304382", "0.630273", "0.62819844", "0.62819576", "0.62804306", "0.6270287", "0.6269172", "0.62681603", "0.6258153", "0.62504363", "0.6242951", "0.62417454", "0.62416166", "0.6204985", "0.6204287", "0.61998606", "0.6180135", "0.61710346", "0.61496055", "0.61486655", "0.61419374", "0.61208564", "0.611429", "0.61091703" ]
0.82347256
0
get all CmVocabularyCategory objects and support order
@Transactional public List<CmVocabularyCategory> getCmVocabularyCategorysWithOrder(String orderBy, boolean isAsc) { return dao.findAllWithOrder(CmVocabularyCategory.class, orderBy, isAsc); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Transactional\r\n\tpublic List<CmVocabularyCategory> getCmVocabularyCategorys() {\r\n\t\treturn dao.findAllWithOrder(CmVocabularyCategory.class, \"modifyTimestamp\", false);\r\n\t}", "public List<Categorie> getAllCategories();", "List<Category> getAllCategories();", "public List<ProductCatagory> getAllCategory() throws BusinessException;", "@Override\n\tpublic List<Category> getAllCategory() {\n\t\treturn category.selectAllCategory();\n\t}", "List<ProductCategory> getAll();", "public static List<Category> getAllCategory() {\n\n List<Category> categoryList = new ArrayList<>();\n try {\n categoryList = Category.listAll(Category.class);\n } catch (Exception e) {\n\n }\n return categoryList;\n\n }", "public List<Cvcategory> findAllCvcategories();", "@Override\r\n\tpublic List<Category> getAllCategory() {\n\t\treturn categoryDao.getAll();\r\n\t}", "List<Category> getAllCategories() throws DaoException;", "@Override\n\tpublic Iterable<Category> findAllCategory() {\n\t\treturn categoryRepository.findAll();\n\t}", "@Override\n\tpublic List<Category> getAllCategory() {\n\t\treturn dao.getAllCategory();\n\t}", "public ArrayList<Category> getCategories() {\n ArrayList<Category> categories = new ArrayList<>();\n Cursor cursor = database.rawQuery(\"SELECT * FROM tbl_categories\", null);\n cursor.moveToFirst();\n while (!cursor.isAfterLast()) {\n Category category = new Category();\n category.setCategory_id(cursor.getInt(cursor.getColumnIndex(\"category_id\")));\n category.setCategory_name(cursor.getString(cursor.getColumnIndex(\"category_name\")));\n\n\n categories.add(category);\n cursor.moveToNext();\n }\n cursor.close();\n return categories;\n }", "public List<Category> getAllCategories() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = (Query) session.createQuery(\"from Category\");\r\n\t\tList<Category> categories = query.list();\r\n\r\n\t\treturn categories;\r\n\t}", "@Override\n\tpublic List<Category> findAllCategory() {\n\t\treturn categoryRepository.findAllCategory();\n\t}", "@Override\r\n\tpublic List<Category> getAllCategory() {\n\t\tString hql = \"from Category\";\r\n\t\treturn (List<Category>) getHibernateTemplate().find(hql);\r\n\t}", "public static List<Category> getCategories(Context context) {\r\n DbManager dbManager = new DbManager(context);\r\n SQLiteDatabase db = dbManager.getReadableDatabase();\r\n\r\n Cursor cursor = db.query(\r\n CategoryTable.TABLE_NAME,\r\n new String[]{CategoryTable._ID, CategoryTable.COLUMN_NAME_CATEGORY_NAME},\r\n CategoryTable.COLUMN_NAME_IS_DELETED + \" = 0\",\r\n null,\r\n null,\r\n null,\r\n CategoryTable.COLUMN_NAME_CATEGORY_NAME + \" ASC\"\r\n );\r\n\r\n List<Category> categories = new ArrayList<>();\r\n while(cursor.moveToNext()) {\r\n Category category = new Category();\r\n category._id = cursor.getInt(cursor.getColumnIndexOrThrow(CategoryTable._ID));\r\n category.category = cursor.getString(cursor.getColumnIndexOrThrow(CategoryTable.COLUMN_NAME_CATEGORY_NAME));\r\n categories.add(category);\r\n }\r\n cursor.close();\r\n db.close();\r\n\r\n return categories;\r\n }", "public List<Category> getAllCategories() {\n\t\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\tQuery q = session.createQuery(\"from Category\");\n\t\t\tList<Category> catlist = q.list();\n\t\t\t\n\t\t\treturn catlist;\n\t\t}", "public List<String> getCategories();", "public Flowable<List<Category>> getCategories() {\n return findAllData(Category.class);\n }", "@Override\r\n\tpublic List<Category> list() {\n\t\treturn categories;\r\n\t}", "public List<Category> findAll() {\n\t\treturn categoryMapper.selectAll();\n\t}", "List<Category> getAllCategories() throws DataBaseException;", "@Override\n\tpublic List<Category> getAllCategories() {\n\t\tQuery query = sessionFactory.getCurrentSession().createQuery(\"FROM \"+Category.class.getName());\n\t\treturn (List<Category>)query.list();\t\t\n\t}", "List<Category> lisCat() {\n return dao.getAll(Category.class);\n }", "@Override\r\n\tpublic List<Categorie> getAllCategorie() {\n\t\treturn cateDao.getAllCategorie();\r\n\t}", "public List<Category> findAll();", "public @NotNull Set<Category> findAllCategories() throws BazaarException;", "public List<DocCategory> getAllDocCategories() {\n return docCategoryRepository.findAll();\n }", "public Collection<Categoria> listar() {\n\t\tQuery q = manager.createQuery(\"SELECT p FROM Categoria p\");\n\t\treturn (Collection<Categoria>) q.getResultList();\n\t}", "List<Category> findAll();", "public List<Category> getCategories() {\n CategoryRecords cr = company.getCategoryRecords();\n List<Category> catList = cr.getCategories();\n return catList;\n }", "public static List<Category> findAll() {\n List<Category> categories = categoryFinder.findList();\n if(categories.isEmpty()){\n categories = new ArrayList<>();\n }\n return categories;\n }", "public static List<Categorias> obtenerCategorias(){\n List<Categorias> categorias = new ArrayList<>();\n \n Categorias c = new Categorias();\n \n c.conectar();\n \n c.crearQuery(\"select * from categoria_libro\");\n \n ResultSet informacion = c.getResultSet();\n \n try {\n while (informacion.next())\n categorias.add(new Categorias(informacion));\n } catch (Exception error) {}\n \n c.desconectar();\n \n return categorias;\n }", "List<Categorie> findAll();", "public List<Category> findAll() {\n\t\treturn categoryDao.getAll();\n\t}", "public List<Category> getListCategory() {\n List<Category> list = new ArrayList<>();\n SQLiteDatabase sqLiteDatabase = dbHelper.getWritableDatabase();\n\n Cursor cursor = sqLiteDatabase.rawQuery(\"SELECT * FROM Category\", null);\n while (cursor.moveToNext()) {\n int id =cursor.getInt(0);\n\n Category category = new Category(id, cursor.getString(cursor.getColumnIndex(\"Name\")), cursor.getString(cursor.getColumnIndex(\"Image\")));\n Log.d(\"TAG\", \"getListCategory: \" + category.getId());\n list.add(category);\n }\n cursor.close();\n dbHelper.close();\n return list;\n }", "public ArrayList<Categoria> listarCategorias();", "public List<CategoriaVO> mostrarCategorias() {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tCategoriaDAO OwlDAO = new CategoriaDAO();\n\t\t\tList<CategoriaVO> resultado = new ArrayList();\n\t\t\tresultado = OwlDAO.obtenerCategorias(mysql);\n\t\t\treturn resultado;\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\t\t\treturn null;\n\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}", "public List<Category> list() {\n\t\tSession session = getSession();\n\n\t\tQuery query = session.createQuery(\"from Category\");\n\t\tList<Category> categoryList = query.list();\n session.close();\n\t\treturn categoryList;\n\t}", "public List<Category> getAllAvailableCategory() {\n\t\treturn categoryManager.getAllAvailable();\n\t}", "public List<Category> queryExistingCategory(){\n\t\tArrayList<Category> cs = new ArrayList<Category>(); \n\t\tCursor c = queryTheCursorCategory(); \n\t\twhile(c.moveToNext()){\n\t\t\tCategory category = new Category();\n\t\t\tcategory._id = c.getInt(c.getColumnIndex(\"_id\"));\n\t\t\tcategory.title = c.getString(c.getColumnIndex(DBEntryContract.CategoryEntry.COLUMN_NAME_TITLE));\n\t\t\tcategory.numberOfEntries = this.queryLocationEntryNumberByCategory(category._id);\n\t\t\tcs.add(category);\n\t\t}\n\t\t// close the cursor\n\t\tc.close();\n\t\treturn cs;\n\t\t\n\t}", "public ArrayList<Categories> getAllCategories() {\n\t\t\n\t\tCategories cg;\n\t\tArrayList<Categories> list=new ArrayList<Categories>();\n\t\t\n\t\ttry {\n\t\t\t String query=\"select * from categories;\";\n\t\t\tPreparedStatement pstm=con.prepareStatement(query);\n\t\t\tResultSet set= pstm.executeQuery();\n\t\t\t\n\t\t\twhile(set.next()) {\n\t\t\t\tint cid=set.getInt(1);\n\t\t\t\tString cname=set.getString(2);\n\t\t\t\tString cdes=set.getString(3);\n\t\t\t\t\n\t\t\t\tcg=new Categories(cid, cname, cdes);\n\t\t\t\tlist.add(cg);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn list;\n\t}", "default List<String> getCategory(String category) {\n return new ArrayList<>(getCategories().get(category.toLowerCase()).values());\n }", "public List<Categoria> listarCategorias(){\n //este metodo devuelve una lista.\n return categoriaRepo.findAll(); \n\n }", "@Override\n\tpublic List<Category> findAll() {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public List<Category> findAllCategoryt_id() {\n\t\treturn null;\n\t\t\n\t}", "@Override\n public List<Category> getAll()\n {\n \n ResultSet rs = DataService.getData(\"SELECT * FROM Categories\");\n \n List<Category> categories = new ArrayList<Category>();\n \n try\n {\n while (rs.next())\n {\n categories.add(convertResultSetToCategory(rs));\n }\n }\n catch (SQLException e)\n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n \n return categories;\n }", "@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)\n public List<Category> getCategoryFindAll() {\n return em.createNamedQuery(\"Category.findAll\", Category.class).getResultList();\n }", "List<Category> findAllByOrderByCategoryIdAsc();", "@Override\n\tpublic List<Categoryb> GetCategpryb() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Categories> getListCat() {\n\t\treturn categoriesDAO.getListCat();\n\t}", "public static ArrayList<String> getCategories() {\n String query;\n ArrayList<String> categories = new ArrayList<String>();\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT category FROM category;\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()) {\n categories.add(rs.getString(\"category\"));\n }\n\n Database.closeDBconnection(con);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n return categories;\n }", "public final List<String> getCategories() {\n return new ArrayList<>(questionGeneratorStrategyFactory.createPracticeQuestionStrategy().generateQuestions().keySet());\n }", "public List<CategoriaEntity> findAll() {\n LOGGER.log(Level.INFO, \"Consultando todas las categorias\");\n // Se crea un query para buscar todas las categorias en la base de datos.\n TypedQuery query = em.createQuery(\"select u from CategoriaEntity u\", CategoriaEntity.class);\n // Note que en el query se hace uso del método getResultList() que obtiene una lista de categorias.\n return query.getResultList();\n }", "public Set<String> getAllBooksCategories() {\n List<Book> books = bookRepository.findAll();\n Set<String> categories = new HashSet<>();\n for (Book book : books) {\n if (book.getCategories() != null) {\n categories.addAll(Arrays.asList(book.getCategories()));\n }\n }\n return categories;\n }", "public Categories getCategories() {\n return this.categories;\n }", "@ModelAttribute(\"categories\")\r\n\tpublic List<Category> getCategoryList() {\r\n\t\treturn categoryDAO.list();\r\n\t}", "@NonNull\n public static List<Category> getCategories() {\n if (CATEGORY == null) {\n CATEGORY = new ArrayList<>();\n CATEGORY.add(new Category(\"Bollywood\", R.drawable.bollywood, 1));\n CATEGORY.add(new Category(\"Hollywood\", R.drawable.hollywood3, 2));\n CATEGORY.add(new Category(\"Cricket\", R.drawable.cricket4, 3));\n CATEGORY.add(new Category(\"Science\", R.drawable.science1, 4));\n CATEGORY.add(new Category(\"Geography\", R.drawable.geography, 5));\n CATEGORY.add(new Category(\"History\", R.drawable.history, 6));\n }\n return CATEGORY;\n }", "List<Category> getCategories() throws DAOExceptionHandler;", "@Override\r\n\tpublic List<Category> findAll() {\n\t\treturn(List<Category>) em.createNamedQuery(\"findAllCategories\").getResultList();\r\n\t}", "public List<DVDCategorie> listDVDCategorie();", "public List<Category> getlist() {\n\t\tSession session = getSession();\n\t\t\n\t\tQuery query = session.createQuery(\"from Category\");\n\t\tList<Category> categoryList = query.list();\n\t\treturn categoryList;\n\t}", "@GetMapping\n\t public List<Categories> touslescategories() {\n\t\treturn catsociete.findAll();}", "public List<ZCategory> SelectAll() {\r\n\t\tList<ZCategory> Categories = new ArrayList<>();\r\n\t\tString lines[];\r\n\t\tlines = fm.getArray();\r\n\t\tfor (String string : lines) {\r\n\t\t\tCategories.add(stringToCategory(string));\r\n\t\t}\r\n\t\treturn Categories;\r\n\t}", "private void listadoCategorias() {\r\n sessionProyecto.getCategorias().clear();\r\n sessionProyecto.setCategorias(itemService.buscarPorCatalogo(CatalogoEnum.CATALOGOPROYECTO.getTipo()));\r\n }", "public List<String> findAllCategories() {\r\n\t\tList<String> result = new ArrayList<>();\r\n\r\n\t\t// 1) get a Connection from the DataSource\r\n\t\tConnection con = DB.gInstance().getConnection();\r\n\r\n\t\ttry {\r\n\r\n\t\t\t// 2) create a PreparedStatement from a SQL string\r\n\t\t\tPreparedStatement ps = con.prepareStatement(GET_CATEGORIES_SQL);\r\n\r\n\t\t\t// 3) execute the SQL\r\n\t\t\tResultSet resultSet = ps.executeQuery();\r\n\t\t\twhile (resultSet.next()) {\r\n\r\n\t\t\t\tString cat = resultSet.getString(1);\r\n\t\t\t\tresult.add(cat);\r\n\t\t\t}\r\n\r\n\t\t} catch (SQLException se) {\r\n\t\t\tse.printStackTrace();\r\n\t\t} finally {\r\n\t\t\tDB.gInstance().returnConnection(con);\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t}", "@Override\n\tpublic List<Category> list() {\n\t\tList<Category> list=(List<Category>)\n\t\tsessionFactory.getCurrentSession().createCriteria(Category.class).setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).list();\n\t\treturn list;\n\t}", "@GetMapping(\"/category\")\n\t public ResponseEntity<List<Category>> getcategorys() {\n\n\t List<Category> list = categoryService.getAllcategorys();\n\t if (list.size() <= 0) {\n\t return ResponseEntity.status(HttpStatus.NOT_FOUND).build();\n\t }\n\t return ResponseEntity.status(HttpStatus.CREATED).body(list);\n\t }", "@RequestMapping(value = \"/categories\", method = RequestMethod.GET, produces = \"application/json\")\n public Collection<String> getCategories() {\n return this.datasetService.getCategories();\n }", "public List<Category> getCategories() {\n this.catr = m_oCompany.getCategoryRecords();\n return catr.getCategories();\n }", "@Override\n public List<ProductCategory> getAllAvailableProductCategoriesForMetaData() {\n final List<Category> avaliableCategories = productCategoryDao.fetchAllAvailableCategoriesForProduct();\n final List<ProductCategory> availableProductCategories = new ArrayList<ProductCategory>();\n for (final Category availableCategory : avaliableCategories) {\n final ProductCategory category = new ProductCategory();\n category.setCategoryId(availableCategory.getCategoryId());\n category.setCategoryName(availableCategory.getCategoryName());\n category.setCategoryPartNumber(availableCategory.getCategoryPartNumber());\n availableProductCategories.add(category);\n }\n return availableProductCategories;\n }", "public Vector<Vector<String>> getCategoryList()\r\n\t{\r\n\t\ttry \r\n\t\t{\r\n\t\t\tString sql = \"SELECT * FROM categories\";\r\n\t\t\t\r\n\t\t\t//ResultSet rs= this.statement.executeQuery(sql);\t\t\r\n\t\t\tDataAccess data = new DataAccess();\r\n\t\t\tResultSet rs=data.getResultSet(sql);\t\t\r\n\t\t\tVector<Vector<String>> list= new Vector<Vector<String>>();\r\n\t\t\twhile (rs.next())\r\n\t\t\t{\r\n\t\t\t\tVector <String> result = new Vector <String>();\r\n\t\t\t\tresult.add(rs.getString(1));\r\n\t\t\t\tresult.add(rs.getString(2));\r\n\t\t\t\tresult.add(rs.getString(3));\t\t\t\t\t\t\r\n\t\t\t\tlist.add(result);\r\n\t\t\t}\r\n\t\t\trs.close();\r\n\t\t\treturn list;\r\n\t\t\t\r\n\t\t}\r\n\t\tcatch (Exception ex)\r\n\t\t{\r\n\t\t\tex.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "@GetMapping(\"category\")\n\t\tpublic List<String> getCategory(){\n\t\t\tList<String> list = repo.findByCat();\n\t\t\treturn list;\n\t\t\t\n\t\t\t\n\t\t}", "@Override\n\tpublic ArrayList<Categoria> getCategorie() {\n\t\tDB db = getDB();\n\t\tArrayList<Categoria> categorie = new ArrayList<Categoria>();\n\t\tMap<Long, Categoria> list = db.getTreeMap(\"categorie\");\n\t\tfor(Map.Entry<Long, Categoria> categoria : list.entrySet())\n\t\t\tif(categoria.getValue() instanceof Categoria)\n\t\t\t\tcategorie.add((Categoria)categoria.getValue());\n\t\treturn categorie;\n\t}", "@Override\n\tpublic List<CategoryVO> mainCategory() {\n\t\treturn mapper.mainCategory();\n\t}", "public List<Category> getAllCategories() {\n\t dbUtil = new DBUtil();\n\t StringBuffer sbQuery = dbUtil.getQueryBuffer();\n\t ArrayList<String> args = dbUtil.getArgs();\n\t ResultSet rs = null;\n\t List<Category> listCategory = null;\n\t \n\t /*** Get the details of a particular Category ***/\n\t /*** QUERY ***/\n\t sbQuery.setLength(0);\n\t sbQuery.append(\" SELECT \");\n\t sbQuery.append(\" id, \");\n\t sbQuery.append(\" name, \");\n\t sbQuery.append(\" userid \");\n\t sbQuery.append(\" FROM lookup.category \");\n\t \n\t /*** Prepare parameters for query ***/\n\t args.clear();\n\t \n\t \n\t /*** Pass the appropriate arguments to DBUtil class ***/\n\t rs = dbUtil.executeSelect(sbQuery.toString(), args);\n\t \n\t /*** Convert the result set into a User object ***/\n\t if(rs!=null)\n\t listCategory = TransformUtil.convertToListCategory(rs);\n\t \n\t dbUtil.closeConnection();\n\t dbUtil = null;\n\t \n\t return listCategory;\n\t}", "public List<Category> getCategoriesDetails(){\r\n\t\tList<Category> res = new ArrayList<Category>();\r\n\t\tString req = \"select c.label, sum(f.amount) as total, sum(f.amount)/tmp.totmonth as percent, c.color \"\r\n\t\t\t\t\t+ \"from fee f, category c, (select sum(amount) as totmonth \"\r\n\t\t\t\t\t+ \"from fee \"\r\n\t\t\t\t\t+ \"where strftime('%m%Y', date) = strftime('%m%Y', date('now'))) as tmp \"\r\n\t\t\t\t\t+ \"where c.id = f.categoryid \"\r\n\t\t\t\t\t+ \"and strftime('%m%Y', f.date) = strftime('%m%Y', date('now')) \"\r\n\t\t\t\t\t+ \"group by c.id \"\r\n\t\t\t\t\t+ \"order by total desc;\";\r\n\t\t\r\n\t\tCursor cursor = database.rawQuery(req, null);\t\t\t\t\r\n\t\tif (cursor.moveToFirst()) {\r\n\t\t\tdo {\r\n\t\t\t\tCategory cat = new Category();\r\n\t\t\t\tcat.setLabel(cursor.getString(0));\r\n\t\t\t\tcat.setTotal(cursor.getString(1));\r\n\t\t\t\tcat.setPercent(cursor.getString(2));\r\n\t\t\t\tcat.setColor(cursor.getString(3));\r\n\t\t\t\tres.add(cat);\r\n\t\t\t} while (cursor.moveToNext());\r\n\t\t}\r\n\t\tif (cursor != null && !cursor.isClosed()) {\r\n\t\t\tcursor.close();\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t}", "@Override\n\tpublic List<Category> getCategories(){\n\t\treturn null;\n\t}", "CodeOrNullListType getCategoryList();", "@Override\n\tpublic List<EventCategory> getAllCategories() {\n\t\treturn categoriesRepository.findAll();\n\t}", "ListCategoryResponse listCategories(ListCategoryRequest request);", "@Override\n public Single<List<CategoryModel>> getCategories() {\n return api.getCategories().map(categories -> iVmMapper.mapToViewModel(categories));\n }", "List<Category> selectCategoryList();", "@Override\r\n\tpublic List<Categoria> readAll() {\n\t\tList<Categoria> lista = new ArrayList<>();\r\n\t\tString SQL = \"select *from categoria\";\r\n\t\ttry {\r\n\t\t\tcx = Conexion.getConexion();\r\n\t\t\tps = cx.prepareStatement(SQL);\r\n\t\t\trs = ps.executeQuery(SQL);\r\n\t\t\twhile(rs.next()) {\r\n\t\t\t\tCategoria r = new Categoria();\r\n\t\t\t\tr.setCategoria_idcategoria(rs.getInt(\"CATEGORIA_IDCATEGORIA\"));\r\n\t\t\t\tr.setNombre(rs.getString(\"NOMBRE\"));\r\n\t\t\t\tlista.add(r);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tSystem.out.println(\"Error: \"+e);\r\n\t\t}\r\n\t\t\r\n\t\treturn lista;\r\n\t}", "public static void consultarListaCategorias(Activity activity) {\n ConexionSQLite conectar = new ConexionSQLite(activity, BASE_DATOS, null, 1);\n SQLiteDatabase db = conectar.getReadableDatabase();\n CategoriaVo categoria = null;\n listaCategorias = new ArrayList<CategoriaVo>();\n Cursor cursor = db.rawQuery(\"SELECT * FROM \"+TABLA_CATEGORIAS, null);\n\n while (cursor.moveToNext()) {\n categoria = new CategoriaVo();\n categoria.setId(cursor.getInt(0));\n categoria.setCategoria(cursor.getString(1));\n categoria.setDescripcion(cursor.getString(2));\n\n listaCategorias.add(categoria);\n }\n db.close();\n }", "public io.reactivesw.catalog.grpc.CategoryList getCategories(io.reactivesw.catalog.grpc.Empty request) {\n return blockingUnaryCall(\n getChannel(), METHOD_GET_CATEGORIES, getCallOptions(), request);\n }", "public ObservableList<String> getCategories()\n {\n ArrayList<Category> categoryList = rentalModel.getCategoryList();\n ArrayList<String> categoryListString = new ArrayList<>();\n for (int i = 0; i < categoryList.size(); i++)\n {\n categoryListString.add(categoryList.get(i).toString());\n }\n categoriesList = FXCollections.observableArrayList(categoryListString);\n return categoriesList;\n }", "List<Channel> getJXCategory();", "List<Category> getDeletedCategories();", "public static ArrayList<AdminCategory> fetchCategoryList() {\r\n\r\n\t\tArrayList<AdminCategory> categoryList = new ArrayList<AdminCategory>();\r\n\r\n\t\tsqlQuery = \"SELECT categoryName, status, B.level,\" +\r\n\t\t\t\t\"(SELECT categoryName FROM flipkart_category A WHERE A.categoryID=C.parentID) AS parentCategory, \" +\r\n\t\t\t\t\"B.categoryID \" +\r\n\t\t\t\t\"FROM flipkart_category B, flipkart_path C \" +\r\n\t\t\t\t\"WHERE B.categoryID=C.categoryID ORDER BY B.level;\";\r\n\r\n\t\ttry{\r\n\t\t\tconn=DbConnection.getConnection();\r\n\t\t\tps=conn.prepareStatement(sqlQuery);\r\n\t\t\trs=ps.executeQuery();\r\n\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\tAdminCategory category = new AdminCategory();\r\n\t\t\t\tcategory.setCategoryName(rs.getString(1));\r\n\t\t\t\tcategory.setStatus(rs.getInt(2));\r\n\t\t\t\tcategory.setLevel(rs.getInt(3));\r\n\t\t\t\tcategory.setParentCategory(rs.getString(4));\r\n\t\t\t\tcategory.setCategoryID(rs.getInt(5));\r\n\t\t\t\tcategoryList.add(category);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn categoryList;\r\n\t}", "@Override\n public List<CategoryDTO> listAll() {\n List<CategoryDTO> result = new ArrayList<>();\n List<Category> listCategory = categoryRepository.findAll();\n for (Category category: listCategory){\n result.add(categoryConverter.toDTO(category));\n }\n return result;\n }", "@Override\n\tpublic List<Categorya> GetCategorya() {\n\t\treturn null;\n\t}", "@GetMapping(\"/categoriesfu\")\n public synchronized List<Category> getAllCategories() {\n log.debug(\"REST request to get a page of Categories\");\n //fu\n final String user =SecurityUtils.getCurrentUserLogin().get();\n final UserToRestaurant userToRestaurant=userToRestaurantRepository.findOneByUserLogin(user);\n final Restaurant restaurant=userToRestaurant.getRestaurant();\n return categoryRepository.findAllByRestaurant(restaurant);\n }", "@Override\n\tpublic List<Category> findAll(int start, int end) {\n\t\treturn findAll(start, end, null);\n\t}", "public List<CategoryMappingValue> getCategories() {\r\n\t\treturn categories;\r\n\t}", "public List<StadiumCategoryDTO> getCategories() {\n\t\treturn categories;\n\t}", "public String[] getAllCategories() {\n // array of columns to fetch\n String[] columns = {\n COLUMN_CATEGORY_ID,\n COLUMN_CATEGORY_DESC\n };\n // sorting orders\n String sortOrder =\n COLUMN_CATEGORY_ID + \" ASC\";\n \n \n // query the user table\n /**\n * Here query function is used to fetch records from user table this function works like we use sql query.\n * SQL query equivalent to this query function is\n * SELECT user_id,user_name,user_email,user_password FROM user ORDER BY user_name;\n */\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.query(\n TABLE_CATEGORY, //Table to query\n columns, //columns to return\n null, //columns for the WHERE clause\n null, //The values for the WHERE clause\n null, //group the rows\n null, //filter by row groups\n sortOrder); //The sort order\n String[] cats = new String[cursor.getCount()];\n // Traversing through all rows and adding to list\n int i;\n if (cursor.moveToFirst()) {\n for( i = 0; i < cursor.getCount() ; i++){\n cats[i] = cursor.getString(cursor.getColumnIndex(COLUMN_CATEGORY_DESC));\n cursor.moveToNext();\n }\n }\n\n cursor.close();\n db.close();\n // return user list\n return cats;\n }", "@Override\n\tpublic List<AnimalCategory> findCategory() {\n\t\tList<AnimalCategory> list = animaldao.findCategory();\n\t\treturn list;\n\t}", "@Transactional\n\tpublic List<CategoryEntity> GetCategory() {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\tList<CategoryEntity> categoryEntities = session.createQuery(\"from category\").getResultList();\n\n\t\treturn categoryEntities;\n\t}" ]
[ "0.79668367", "0.7581398", "0.75535417", "0.71911544", "0.70780754", "0.7070721", "0.6974168", "0.695372", "0.69320726", "0.68968195", "0.68630826", "0.6858897", "0.68428904", "0.6833223", "0.6832329", "0.6831831", "0.68256533", "0.6824663", "0.680561", "0.6758251", "0.6752147", "0.67431265", "0.6739206", "0.6736749", "0.6732745", "0.6707809", "0.668519", "0.66635555", "0.66336435", "0.66053057", "0.66004837", "0.6592982", "0.6563219", "0.65619236", "0.65523607", "0.6548225", "0.6538113", "0.6532161", "0.6520722", "0.65169954", "0.6516497", "0.6491319", "0.64863807", "0.6480184", "0.64578426", "0.64415544", "0.6430976", "0.64058703", "0.6402244", "0.6395949", "0.6392126", "0.6365654", "0.6351232", "0.63483953", "0.6340045", "0.6317243", "0.63144267", "0.6309864", "0.6289058", "0.6285535", "0.6273043", "0.6256991", "0.6251721", "0.62491965", "0.6248713", "0.62449807", "0.6216298", "0.6193572", "0.61924344", "0.61853534", "0.6182339", "0.6177542", "0.6170222", "0.6169918", "0.6163156", "0.6160983", "0.6155034", "0.615163", "0.615108", "0.6149236", "0.614507", "0.613967", "0.61332136", "0.61304176", "0.61150366", "0.6111435", "0.61092246", "0.6102405", "0.6101665", "0.6088831", "0.60805887", "0.60791254", "0.60640687", "0.6059186", "0.60588616", "0.604962", "0.60476905", "0.60402197", "0.60369796", "0.60245734" ]
0.6307348
58
get CmVocabularyCategory objects by fieldName
@Transactional public List<CmVocabularyCategory> getCmVocabularyCategorysByField(final String fieldName, final Object value) { return dao.findByField(CmVocabularyCategory.class, fieldName, value, "modifyTimestamp", false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Category getByName(String name);", "Category getCategoryByName(String categoryName);", "Category findByName(String name);", "@Transactional\r\n\tpublic List<CmVocabularyCategory> getCmVocabularyCategorys() {\r\n\t\treturn dao.findAllWithOrder(CmVocabularyCategory.class, \"modifyTimestamp\", false);\r\n\t}", "public List<Cvcategory> findAllCvcategories();", "public Category findByCategoryName(String CategoryName) throws InstanceNotFoundException;", "List getCategoriesOfType(String typeConstant);", "Category selectCategory(String name);", "default List<String> getCategory(String category) {\n return new ArrayList<>(getCategories().get(category.toLowerCase()).values());\n }", "Category getCategoryById(int id);", "Category getCategoryById(int categoryId);", "List<Category> getAllCategories();", "Category getCategoryById(Integer categoryId);", "@Override\r\n\tpublic List<Category> getCategoryByName(String name) {\n\t\tString hql = \"from Category c where c.category_name =?\";\r\n\t\treturn (List<Category>) getHibernateTemplate().find(hql, name);\r\n\t}", "String getCategory();", "String getCategory();", "public List<String> getCategories();", "public Categorie getCategorieById(long id);", "@Transactional\r\n\tpublic CmVocabularyCategory getCmVocabularyCategoryById(final String id) {\r\n\t\tCmVocabularyCategory cmVocabularyCategory = dao.findById(CmVocabularyCategory.class, id);\r\n\t\treturn cmVocabularyCategory;\r\n\t}", "public Category getCategory();", "public void getCategorory(){\n\t\tDynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(AssetCategory.class, \"category\", PortalClassLoaderUtil.getClassLoader());\n\t\ttry {\n\t\t\tList<AssetCategory> assetCategories = AssetCategoryLocalServiceUtil.dynamicQuery(dynamicQuery);\n\t\t\tfor(AssetCategory category : assetCategories){\n\t\t\t\tlog.info(category.getName());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t}\n\t}", "public String getCategory();", "public List<Categorie> getAllCategories();", "public List<Category> findAll();", "public Set<String> getCategory(){return category;}", "DvdCategory searchCategoryById(Integer id) throws DvdStoreException;", "String getCategoria();", "public final void readCategoria() {\n cmbCategoria.removeAllItems();\n cmbCategoria.addItem(\"\");\n categoryMapCategoria.clear();\n AtividadePreparoDAO atvprepDAO = new AtividadePreparoDAO();\n for (AtividadePreparo atvprep : atvprepDAO.readMotivoRetrabalho(\"Categoria\")) {\n Integer id = atvprep.getMotivo_retrabalho_id();\n String name = atvprep.getMotivo_retrabalho();\n cmbCategoria.addItem(name);\n categoryMapCategoria.put(id, name);\n }\n }", "public List<ProductCatagory> getAllCategory() throws BusinessException;", "List<Category> findAll();", "@Override\n\tpublic List<Category> getCategoryByKey(String mc) {\n\t\treturn dao.getCategoryByKey(mc);\n\t}", "List<DvdCategory> getCategory(Boolean status) throws DvdStoreException;", "VendorData getVendorCategories(String vendorCode);", "List<Category> lisCat() {\n return dao.getAll(Category.class);\n }", "List<Category> selectCategoryList();", "public Category getCategoryById()\r\n {\r\n return cdb.getCategoryById();\r\n }", "public Cvcategory findCvcategoryById(Long id);", "Category findCategoryById(Long id);", "List<ConfigCategory> getCategoryOfTypeAndDisplayName(String typeConstant, String catDisplayName);", "@GetMapping(\"category\")\n\t\tpublic List<String> getCategory(){\n\t\t\tList<String> list = repo.findByCat();\n\t\t\treturn list;\n\t\t\t\n\t\t\t\n\t\t}", "public interface SearchCategory {\n /**\n * @return Internal name of the category as a search field.\n */\n public String getFieldName();\n\n /**\n * @return Human readable name for the category.\n */\n public String getCategoryLabel();\n}", "public static BookCategory fromString(String name)\n {\n for (int i = 0; i < VALUES.length; i++)\n {\n BookCategory o = VALUES[i];\n if (o.name.equalsIgnoreCase(name))\n {\n return o;\n }\n }\n return OTHER;\n }", "public static String refersToCategory(String field){\n //Caller Used NameChecker.isCategory to find ones where the field name = a categeroy name\n if (field.equalsIgnoreCase(OWNER_LABEL)){\n return ENTITY_LABEL;\n }\n if (field.equalsIgnoreCase(SURVEYOR_LABEL)){\n return ENTITY_LABEL;\n }\n if (field.equalsIgnoreCase(UPLOADER_LABEL)){\n return ENTITY_LABEL;\n }\n return null;\n }", "private Object getAnomizedCategory() {\r\n\tString categorie = (String) record.get(\"categorie\");\r\n\tif (categorie != null) {\r\n\t switch (categorie) {\r\n\t case \"AD\":\r\n\t case \"CO\":\r\n\t case \"FI\":\r\n\t case \"IBL\":\r\n\t case \"KI\":\r\n\t case \"KL\":\r\n\t case \"VO\":\r\n\t\tbreak;\r\n\t default:\r\n\t\tcategorie = null;\r\n\t\tbreak;\r\n\t }\r\n\t}\r\n\r\n\treturn categorie;\r\n }", "List<Categorie> findAll();", "public static List<Category> getCategories(Context context) {\r\n DbManager dbManager = new DbManager(context);\r\n SQLiteDatabase db = dbManager.getReadableDatabase();\r\n\r\n Cursor cursor = db.query(\r\n CategoryTable.TABLE_NAME,\r\n new String[]{CategoryTable._ID, CategoryTable.COLUMN_NAME_CATEGORY_NAME},\r\n CategoryTable.COLUMN_NAME_IS_DELETED + \" = 0\",\r\n null,\r\n null,\r\n null,\r\n CategoryTable.COLUMN_NAME_CATEGORY_NAME + \" ASC\"\r\n );\r\n\r\n List<Category> categories = new ArrayList<>();\r\n while(cursor.moveToNext()) {\r\n Category category = new Category();\r\n category._id = cursor.getInt(cursor.getColumnIndexOrThrow(CategoryTable._ID));\r\n category.category = cursor.getString(cursor.getColumnIndexOrThrow(CategoryTable.COLUMN_NAME_CATEGORY_NAME));\r\n categories.add(category);\r\n }\r\n cursor.close();\r\n db.close();\r\n\r\n return categories;\r\n }", "String category();", "CodeOrNullListType getCategoryList();", "public static List<Categorias> obtenerCategorias(){\n List<Categorias> categorias = new ArrayList<>();\n \n Categorias c = new Categorias();\n \n c.conectar();\n \n c.crearQuery(\"select * from categoria_libro\");\n \n ResultSet informacion = c.getResultSet();\n \n try {\n while (informacion.next())\n categorias.add(new Categorias(informacion));\n } catch (Exception error) {}\n \n c.desconectar();\n \n return categorias;\n }", "public List<Category> autocompleteCategory(String name) {\n List<Category> categories = null;\n try {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n categories = dbb.autocompleteCategory(name);\n dbb.commit();\n dbb.closeConnection();\n } catch (Exception ex) {\n Logger.getLogger(GameDBLogic.class.getName()).log(Level.SEVERE, null, ex);\n }\n return categories;\n }", "@RequestMapping(method=RequestMethod.GET,\n\t\t\tproduces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<Collection<Category>> getCategories(@RequestParam(value = \"categoryName\", required = false) String categoryName){\n\t\t\n\t\tCollection<Category> categories = new ArrayList<>();\n\t\tif (categoryName != null) {\n\t\t\tCategory category = categoryService.findByName(categoryName);\n\t\t\tcategories.add(category);\n\t\t} else {\n\t\t\tCollection<Category> allCategories = categoryService.findAll();\n\t\t\tcategories.addAll(allCategories);\n\t\t}\n\t\treturn new ResponseEntity<Collection<Category>>(categories, HttpStatus.OK);\n\t\t\n\t}", "public DVDCategorie getDVDCategorie(int id);", "public List<DocCategory> getAllDocCategories() {\n return docCategoryRepository.findAll();\n }", "public static Category findCategoryByName(String name){\n return categoryFinder.where().eq(\"category-name\", name).findUnique();\n }", "List<Product> getProductsByCategory(String category);", "public List<String> getCategoryList(String cat) {\n ArrayList<String> ls = new ArrayList<String>();\n String[] keys = sortedStringKeys();\n\n for (String s : keys) {\n if (s.startsWith(cat)) { ls.add(getProperty(s)); }\n }\n return ls;\n }", "ConfigCategory getCategoryOfTypeAndCode(String typeConstant, String categoryCode);", "public List<Category> getCategoryByName(String name) {\n\t dbUtil = new DBUtil();\n\t StringBuffer sbQuery = dbUtil.getQueryBuffer();\n\t ArrayList<String> args = dbUtil.getArgs();\n\t ResultSet rs = null;\n\t List<Category> listCategory = null;\n\t \n\t /*** Get the details of a particular User ***/\n\t /*** QUERY ***/\n\t sbQuery.setLength(0);\n\t sbQuery.append(\" SELECT \");\n\t sbQuery.append(\" id, \");\n\t sbQuery.append(\" name, \");\n\t sbQuery.append(\" userid \");\n\t sbQuery.append(\" FROM lookup.category c \");\n\t sbQuery.append(\" WHERE UPPER(c.name) = UPPER(?) \");\n\t \n\t /*** Prepare parameters for query ***/\n\t args.clear();\n\t args.add(name);\n\t \n\t /*** Pass the appropriate arguments to DBUtil class ***/\n\t rs = dbUtil.executeSelect(sbQuery.toString(), args);\n\t \n\t /*** Convert the result set into a User object ***/\n\t if(rs!=null)\n\t listCategory = TransformUtil.convertToListCategory(rs);\n\t \n\t dbUtil.closeConnection();\n\t dbUtil = null;\n\t \n\t return listCategory;\n\t}", "List<ProductCategory> getAll();", "Category findById(int id);", "public List<Category> queryExistingCategory(){\n\t\tArrayList<Category> cs = new ArrayList<Category>(); \n\t\tCursor c = queryTheCursorCategory(); \n\t\twhile(c.moveToNext()){\n\t\t\tCategory category = new Category();\n\t\t\tcategory._id = c.getInt(c.getColumnIndex(\"_id\"));\n\t\t\tcategory.title = c.getString(c.getColumnIndex(DBEntryContract.CategoryEntry.COLUMN_NAME_TITLE));\n\t\t\tcategory.numberOfEntries = this.queryLocationEntryNumberByCategory(category._id);\n\t\t\tcs.add(category);\n\t\t}\n\t\t// close the cursor\n\t\tc.close();\n\t\treturn cs;\n\t\t\n\t}", "public List<DVDCategorie> listDVDCategorie();", "public List distinct(final String fieldName) {\n return distinct(fieldName, getReadPreference());\n }", "Optional<Category> getCategory(String title);", "public String getName(){\n return category;\n }", "List<Category> selectByExample(CategoryExample example);", "public ItemCategory getCategory();", "CodeType getCategory();", "List<Category> getAllCategories() throws DaoException;", "List<Category> getAllCategories() throws DataBaseException;", "public Limit get(String username, String category);", "public Category findByName(String name) {\n\t\ttry {\n\t\t\tString sql = \"SELECT * FROM categories WHERE name = ?\";\n\t\t\treturn jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Category.class), name);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Category by name '\" + name + \"': No data\");\n\t\t}\n\t\treturn null;\n\t}", "List<Category> getCategories() throws DAOExceptionHandler;", "public static ArrayList<String> getCategories() {\n String query;\n ArrayList<String> categories = new ArrayList<String>();\n\n try {\n Connection con = Database.createDBconnection();\n Statement stmt = con.createStatement();\n query = \"SELECT category FROM category;\";\n ResultSet rs = stmt.executeQuery(query);\n\n while(rs.next()) {\n categories.add(rs.getString(\"category\"));\n }\n\n Database.closeDBconnection(con);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n return categories;\n }", "public List<Category> getCategories() {\n CategoryRecords cr = company.getCategoryRecords();\n List<Category> catList = cr.getCategories();\n return catList;\n }", "public static List<Category> getCategorysofProvince(Province province){\n\t\treturn CategoryDAO.getCategorysofProvince(province);\n\t}", "public List<CategoriaVO> mostrarCategorias() {\n\t\tJDBCTemplate mysql = MysqlConnection.getConnection();\n\t\ttry {\n\t\t\tmysql.connect();\n\t\t\tCategoriaDAO OwlDAO = new CategoriaDAO();\n\t\t\tList<CategoriaVO> resultado = new ArrayList();\n\t\t\tresultado = OwlDAO.obtenerCategorias(mysql);\n\t\t\treturn resultado;\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace(System.err);\n\t\t\treturn null;\n\n\t\t} finally {\n\t\t\tmysql.disconnect();\n\t\t}\n\t}", "public ArrayList<Category> getCategories() {\n ArrayList<Category> categories = new ArrayList<>();\n Cursor cursor = database.rawQuery(\"SELECT * FROM tbl_categories\", null);\n cursor.moveToFirst();\n while (!cursor.isAfterLast()) {\n Category category = new Category();\n category.setCategory_id(cursor.getInt(cursor.getColumnIndex(\"category_id\")));\n category.setCategory_name(cursor.getString(cursor.getColumnIndex(\"category_name\")));\n\n\n categories.add(category);\n cursor.moveToNext();\n }\n cursor.close();\n return categories;\n }", "public List<Category> getListCategory() {\n List<Category> list = new ArrayList<>();\n SQLiteDatabase sqLiteDatabase = dbHelper.getWritableDatabase();\n\n Cursor cursor = sqLiteDatabase.rawQuery(\"SELECT * FROM Category\", null);\n while (cursor.moveToNext()) {\n int id =cursor.getInt(0);\n\n Category category = new Category(id, cursor.getString(cursor.getColumnIndex(\"Name\")), cursor.getString(cursor.getColumnIndex(\"Image\")));\n Log.d(\"TAG\", \"getListCategory: \" + category.getId());\n list.add(category);\n }\n cursor.close();\n dbHelper.close();\n return list;\n }", "static public List<Category> categoryReader() throws IOException {\n\n BufferedReader csvReader = new BufferedReader(new FileReader(CATEGORIES_REFERENCE_FILE));\n String row;\n List<Category> dataList = new ArrayList<>();\n\n row = csvReader.readLine();\n while ((row = csvReader.readLine()) != null){\n Category data = new Category();\n String[] datas = row.split(SEPARATOR_COMA);\n\n data.setCategory_id(Integer.parseInt(datas[0]));\n data.setName(datas[1]);\n dataList.add(data);\n\n }\n return dataList;\n }", "public ArrayList getCategory(int i) {\n\t\tif (categoryList.containsKey(i)) {\n\t\t\treturn categoryList.get(i);\n\t\t}\n\t\treturn null;\n\t}", "@Override\n\tpublic List<Category> getdatafromname(String con) {\n\t\treturn null;\n\t}", "Category selectCategory(long id);", "public List<Question> getCategory(String category) {\n List<Question> questions = loadQuestions(\"quiz/\" + category + \".txt\");\n return questions;\n }", "private void listCategory() {\r\n \r\n cmbCategoryFilter.removeAllItems();\r\n cmbCategory.removeAllItems();\r\n \r\n cmbCategoryFilter.addItem(\"All\");\r\n for (Category cat : Category.listCategory()) {\r\n cmbCategoryFilter.addItem(cat.getName());\r\n cmbCategory.addItem(cat.getName());\r\n }\r\n \r\n }", "public static ArrayList<String> catToCateg(String categ) throws Exception {\n\n\t\tArrayList<String> list = new ArrayList<String>();\n\n\t\tif (categOffsetIndex == null) {\n\t\t\tSystem.out.println(\"categ loading index...\");\n\t\t\tloadCategIndex();\n\t\t\tSystem.out.println(\"categ index loaded !!!\");\n\t\t}\n\n\t\tif (categOffsetIndex.get(categ) != null) {\n\t\t\tFile file = new File(basedir + \"categHierarchy\");\n\t\t\tRandomAccessFile rFile = new RandomAccessFile(file, \"r\");\n\t\t\t// System.out.println(categOffsetIndex.get(categ));\n\t\t\trFile.seek(categOffsetIndex.get(categ));\n\t\t\tString temp = rFile.readLine();\n\t\t\trFile.close();\n\t\t\tString arr[] = temp.split(\"\\t\");\n\n\t\t\tString temp1 = arr[1].substring(1, arr[1].length() - 1);\n\t\t\tString arr1[] = temp1.split(\",\");\n\n\t\t\tfor (String key : arr1) {\n\t\t\t\tlist.add(key.trim());\n\t\t\t}\n\t\t\trFile.close();\n\t\t\treturn list;\n\n\t\t}\n\n\t\telse {\n\n\t\t\treturn null;\n\t\t}\n\n\t}", "@GetMapping(\"movie-cat/{category}\")\n\tpublic List<Movie> getMovieCat(@PathVariable(\"category\") String category){\n\t\tList<Movie> list = repo.findByCategory(category);\n\t\treturn list;\n\t\t\n\t}", "Categorie findOne(Long id);", "@Override\n// @CachePut(cacheNames = \"category\",key=\"#name\")\n public CMSCategory getOrCreateOneByName(String name){\n CMSCategory category = findCMSCategoryByName(name);\n if (category==null) {\n category = new CMSCategory();\n category.setDisabled(false);\n category.setEnglishName(name);\n category.setName(name);\n cmsCategoryRepository.save(category);\n }\n return category;\n }", "public String getCategory() {\n return this.category;\n }", "List<Coupon> findByCategory(Category category);", "public io.reactivesw.catalog.grpc.CategoryList getCategories(io.reactivesw.catalog.grpc.Empty request) {\n return blockingUnaryCall(\n getChannel(), METHOD_GET_CATEGORIES, getCallOptions(), request);\n }", "public static List<Category> getAllCategory() {\n\n List<Category> categoryList = new ArrayList<>();\n try {\n categoryList = Category.listAll(Category.class);\n } catch (Exception e) {\n\n }\n return categoryList;\n\n }", "ConfigCategory getCategoryById(long categoryId);", "public static ResultSet getAllCategory() {\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(\"SELECT catName FROM category\");\n return rs;\n } catch (SQLException ex) {\n Logger.getLogger(itemDAO.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "public String getCategory(){\r\n\t\treturn this.category;\r\n\t}", "private Category classify() {\n Category category = null;\n if (name != null) {\n if (name.contains(\"potato\") || name.contains(\"apple\")) {\n category = Category.FOOD;\n } else if (name.contains(\"cloths\") || name.contains(\"pants\") || name.contains(\"shirt\")) {\n category = Category.CLOTHING;\n }\n }\n return category;\n }", "public List<Category> findAllCategoryt_id() {\n\t\treturn null;\n\t\t\n\t}", "List<? extends HasListBox> getCodeListsForCategory(String category);", "public interface Category {\n String getName();\n}" ]
[ "0.6557268", "0.6533281", "0.6238304", "0.60033137", "0.5955316", "0.5928011", "0.5809773", "0.5773636", "0.56954294", "0.56681454", "0.5637376", "0.55307156", "0.5520909", "0.550779", "0.54963326", "0.54963326", "0.5477254", "0.54740715", "0.54717225", "0.545487", "0.5445462", "0.54443485", "0.5437239", "0.5372342", "0.5348843", "0.53475606", "0.53465986", "0.5336407", "0.5327763", "0.5323856", "0.53204787", "0.53121567", "0.5309392", "0.52771765", "0.52759683", "0.5272745", "0.52652806", "0.52582824", "0.5232572", "0.52293915", "0.52276933", "0.52040714", "0.52028173", "0.51936996", "0.5193575", "0.51862335", "0.51636", "0.5162474", "0.515733", "0.51554674", "0.51538795", "0.51474893", "0.51358855", "0.51126766", "0.5112167", "0.5111577", "0.50784296", "0.50728446", "0.507082", "0.5058239", "0.50488585", "0.50419486", "0.5039555", "0.50371045", "0.5036547", "0.5022619", "0.502117", "0.5019597", "0.49996167", "0.49961242", "0.49927828", "0.49797133", "0.4978089", "0.49762464", "0.49680984", "0.49587628", "0.4956985", "0.49543193", "0.49508598", "0.49458244", "0.49440262", "0.4927204", "0.49233797", "0.49158883", "0.49124113", "0.4909286", "0.49092534", "0.4897247", "0.4895618", "0.48955077", "0.48918736", "0.4881538", "0.48683947", "0.48624104", "0.4854601", "0.48460478", "0.4843737", "0.48435804", "0.48407018", "0.4833346" ]
0.7883333
0
System.out.println(">Teclado: Has presionado la tecla: " + e.getKeyChar() );
@Override public void keyTyped(KeyEvent e){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\tSystem.out.println(e.getKeyChar()+\" ta precionando a tecla igual um idiota\");\n\t\t\t\tSystem.out.println(e.getKeyCode());\n\t\t\t}", "@Override\n\tpublic void keyTyped(KeyEvent e) {\n\t\tchar letra= e.getKeyChar();\n\t\tSystem.out.println(letra);\n\t\n\t}", "public void keyPressed(KeyEvent e) {}", "@Override\n\t\t\tpublic void keyReleased(KeyEvent e) {\n\t\t\t\tSystem.out.println(\"ta soltando o brouuu a tecla\");\n\t\t\t}", "char getKeyPressChar();", "@Override\n public void keyPressed(KeyEvent e) {}", "public void keyPressed( KeyEvent e ) { }", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "public void keyPressed(KeyEvent e) { }", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e) {\n\t\n\t}", "public void keyPressed(KeyEvent e) {\n System.out.println(\"keyPressed\");\n }", "public void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\n }", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\r\n\t\t\t}", "@Override\n\t\t\tpublic void keyTyped(KeyEvent e) {\n\t\t\t\tSystem.out.println(\"to digintando brouu\");\n\t\t\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\r\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t\t\t\t\t\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n \n }", "public void keyPressed(KeyEvent e) {\n\t\taux1.getUser().setText(aux1.getNombre().getText().toString()+aux1.getApellido1().getText().toString());\n\t\t\n\t}", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\n char c = e.getKeyChar();\r\n //seteo el caracter como texto del label\r\n lab.setText(Character.toString(c));\r\n }", "@Override\r\n\t\tpublic void keyPressed(KeyEvent e) {\n\t\t}", "public void keyPressed(KeyEvent e){\n \n JTextField tec = new JTextField();\n char teclado = e.getKeyChar();\n String tecla = \"\"+teclado;\n tec.setText(tecla);\n tec.setBounds(400, 300, 20, 20);\n add(tec);\n tec.setVisible(true);\n \n System.out.println(teclado +\" \"+tecla);\n \n JLabel teclou = new JLabel(\"EU SEI OQ VC DIGITOU\");\n add(teclou);\n teclou.setVisible(true);\n }", "@Override\n public void keyPressed(KeyEvent e) {\n }", "@Override\n public void keyPressed(KeyEvent e) {\n\n\n }", "@Override\r\n public void keyPressed(KeyEvent e) {\n \r\n }", "@Override\r\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\t\t\t\t\r\n\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\r\n\t}", "@Override\n\tpublic void keyPressed(KeyEvent e)\n\t\t{\n\t\t\t\n\t\t}", "@Override\n public void keyPressed(KeyEvent e) {\n \n \n }", "public void keyPressed(KeyEvent e) {\n\t\t\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void keyPressed(KeyEvent e) {\n\n\t\t\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\r\n\r\n }", "@Override\n\tpublic void keyPressed() {\n\t\t\n\t}", "@Override\r\n public void keyPressed(KeyEvent e) {\n\r\n }", "public void keyPressed(KeyEvent e) \r\n { \r\n keyUser = e.getKeyCode();\r\n }", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public void keyPressed(KeyEvent e) {\n\t\t\t\t}", "public boolean keyPressed(KeyEvent e);", "public void keyReleased (KeyEvent e){}", "@Override\n\tpublic void onKey(KeyEvent e) {\n\n\t}" ]
[ "0.82152784", "0.8025775", "0.7637464", "0.76220095", "0.75838643", "0.7571556", "0.75674856", "0.75561", "0.7555768", "0.7551403", "0.7551403", "0.7551403", "0.7551403", "0.75459015", "0.75459015", "0.7544133", "0.7544133", "0.7544133", "0.7543278", "0.7543278", "0.75406116", "0.75406116", "0.75406116", "0.75406116", "0.75406116", "0.75406116", "0.75406116", "0.75406116", "0.75406116", "0.75255823", "0.7511852", "0.74960613", "0.7487879", "0.7476686", "0.7476686", "0.7476686", "0.7476686", "0.7476686", "0.7476686", "0.7476686", "0.7473622", "0.7471931", "0.7471931", "0.747155", "0.74682164", "0.74682164", "0.74682164", "0.74643207", "0.74421424", "0.74421424", "0.74421424", "0.74421424", "0.74421424", "0.74421424", "0.74421424", "0.74421424", "0.7434807", "0.7434807", "0.7434807", "0.74300313", "0.74300313", "0.74300313", "0.74300313", "0.73955727", "0.73913985", "0.7385788", "0.7379799", "0.737055", "0.7368101", "0.73402643", "0.73365587", "0.73177606", "0.7309686", "0.7294077", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7288799", "0.7283928", "0.7277574", "0.72693765", "0.72572386", "0.7203188", "0.7203188", "0.7203188", "0.71905893", "0.71882915", "0.7169268" ]
0.0
-1
Obtener boton del Mouse pulsado
@Override public void mouseClicked(MouseEvent e){ String boton = W.detClick( e.getButton() ); System.out.println(" Mouse: Click " + boton ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void botonDemo_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed() {\n }", "@Override\n public void mousePressed(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n //System.out.println(\"->Mouse: Presionando Click \" + boton );\n }", "public void checkMouse(){\n if(Greenfoot.mouseMoved(null)){\n mouseOver = Greenfoot.mouseMoved(this);\n }\n //Si esta encima se volvera transparente el boton en el que se encuentra\n if(mouseOver){\n adjTrans(MAX_TRANS/2);\n }\n else{\n adjTrans(MAX_TRANS);\n }\n \n }", "void onLeftMouseButtonReleased(double mouseX, double mouseY);", "public void mouseLeft() {\n\n\t}", "void boton1Jugador_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\t//boton1Jugador.setForeground(Color.white);\n\t}", "void botCargar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n public void pulsarRaton(MouseEvent e) {\n pararCancion();\n //CAMBIAMOS LA PANTALLA\n PantallaNivel1 pantallaJuego = new PantallaNivel1(p);\n pantallaJuego.inicializarPantalla();\n p.cambiarPantalla(pantallaJuego);\n \n }", "public void mouseClicked(MouseEvent evt) {\n Location x = new Location( evt.getX(), evt.getY() );\n ripple = new Ripples(x, canvas, pond, true, movingRipples,this);\n run.addActionListener(ripple);\n pause.addActionListener(ripple);\n clear.addActionListener(ripple);\n speedController.addChangeListener(ripple);\n canvas.addMouseListener(ripple);\n canvas.addMouseMotionListener(ripple);\n }", "void botSalir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botonDescargaSobre_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\t//boton1Jugador.setForeground(Color.white);\n\t}", "void botGuardar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botAyuda_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botonRecibir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n\tpublic void mouseLeft() {\n\t\t\n\t}", "void botonAyuda_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mouseClicked() {\n\t\tswitch(screen) {\n\t\t\n\t\t// Pantalla Home\n\t\tcase 0:\n\t\t\tif((mouseX > 529 && mouseY > 691) && (mouseX < 966 & mouseY < 867)) {\n\t\t\t\t//si hace click adentro del boton de jugar\n\t\t\t\tscreen = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t// Pantalla Instrucciones\n\t\tcase 1:\n\t\t\t//si hace click adentro de la pantalla\n\t\t\tscreen = 2;\n\t\t\tbreak;\n\t\t}\n\t}", "void botonSalir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botGuardarComo_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed() {\n\t int ret = output.sendNoteOn(0, 3, 3);\n\t ret = output.sendSysex(new byte[] {(byte)0xF0, 1, 2, 3, 4, (byte)0xF7});\n\t}", "public void mousePressed (MouseEvent event) {}", "void botonReglas_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "private void mouseMove() {\n if (this.holding) {\n Point point = new Point(mousex, mousey);\n this.addPixel(point);\n }\n }", "void botonEnviar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_5) {\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"pulsos\", IR.panelecturasbt2);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"lectura\", IR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\n\t\t // Aki se llama al panelecturas\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-1\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t // IR.panelecturasbt2.setActualizar(true);\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasbt2\n\t\t // .setHilomuestrainfo(IR.panelecturasbt2\n\t\t // .getHilomuestrainfo());\n\t\t // IR.panelecturasbt2.hiloinfo = new Thread(\n\t\t // IR.panelecturasbt2.hilomuestrainfo);\n\t\t // IR.panelecturasbt2.hiloinfo.start();\n\n\t\t}", "public void mouseMoved(MouseEvent e){}", "@Override\n public void mouseAction( MouseEvent me )\n {\n \n }", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "void mousePressed() {\n firing = true;\n\n}", "public MouseHandler(TicTacToePanel ticTacToePanel) {\n\t}", "void botAcerca_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public SimpleTrackMouse()\n { \n // Set background color and arrange for the panel to listen for mouse events.\n setBackground(Color.WHITE);\n MouseHandler listener = new MouseHandler();\n addMouseListener(listener); // Register mouse listener.\n addMouseMotionListener(listener); // Register mouse motion listener.\n }", "@Override\r\n\tpublic void onMouseMove(Widget who, int x, int y) {\n\r\n\t}", "private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved\n \n /*Pon la bandera para saber que ya hubó un evento y no se desloguie*/\n bIdle = true;\n \n }", "private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved\n \n /*Pon la bandera para saber que ya hubó un evento y no se desloguie*/\n bIdle = true;\n \n }", "public void mousePressed(MouseEvent event)\r\n {\n }", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "@Override\r\n\tpublic void mousePressed(MouseEvent event ) {\n\t\t\r\n\t\tint whichButton =event.getButton();\r\n\t\tmsg=\"\";\r\n\t\tmsg =\"You Pressed Mouse \" ;\r\n\t\t\r\n\t\tif(whichButton==MouseEvent.BUTTON1)\r\n\t\t\tmsg+=\" BUTTON 1\";\r\n\t\telse if(whichButton==MouseEvent.BUTTON2)\r\n\t\t\tmsg+=\"Button 2\";\r\n\t\telse\r\n\t\t\tmsg+=\"Button 3\";\r\n\t\t\r\n\t\tmsg+=\"You are at position \"+\"<X \"+event.getX()+\" Y \"+event.getY()+\">\";\r\n\t\t\r\n\t\tif(event.getClickCount()==2)\r\n\t\t{\r\n\t\t\tmsg+=\" You double Clicked\";\r\n\t\t}\r\n\t\telse\r\n\t\t\tmsg+=\" You singel-Clicked\";\r\n\t\t\r\n\t\tlabel.setText(msg);\r\n\t\t\r\n\t}", "public void mouseOut() {\n process(1);\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tl1.setText(\"You pressed the mouse\");\r\n\t}", "void mousePressed(MouseEvent mouseEvent);", "public void mousePressed(MouseEvent e) {\r\n }", "public void mousePressed(MouseEvent e) {\n \t // Click gauche enfoncé\n \t if (e.getButton() == 1) {\n\t \t app.modifierCurseurVue(Cursor.MOVE_CURSOR);\n\t \t prevX = e.getX();\n\t \t prevY = e.getY();\n \t }\n }", "void botonDemo_mouseExited(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n\tpublic void mouseUp() {\n\t\t\n\t}", "public void mousePressed(MouseEvent arg0) {\n\n }", "public void mousePressed(MouseEvent arg0) {\n\n }", "public void mousePressed(MouseEvent e) {\n\n }", "@Override\r\n\tpublic void onMouseUp(Widget who, int x, int y) {\n\r\n\t}", "void botonJuegoRed_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void mousePressed(double x, double y, MouseEvent e );", "public void mousePressed(MouseEvent e) {\n }", "public void mousePressed() {\n if (mouseX > 250 && mouseX < 300 && mouseY > 45 && mouseY < 95) {\n // createWindows();\n // btnMakeWindow.setEnabled(false); createWindows();\n }\n\n if (mouseX > 20 && mouseX < 20+20 && mouseY > 20 && mouseY < 20+20) {\n button = !button;\n }\n if (mouseX > 250 && mouseX < 350 && mouseY > 20 && mouseY < 20+50) {\n\n }\n if (mouseX > 418 && mouseX < 473 && mouseY > 185 && mouseY < 204) {\n rgbEffects();\n }\n if (mouseX > 10 && mouseX < 49 && mouseY > 150 && mouseY < 169) {\n MyController1.getController(\"bar height\").setValue(50);\n MyController2.getController(\"width\").setValue(50);\n input.disableMonitoring();\n }\n if (mouseX > 395 && mouseX < 395+24 && mouseY > 285 && mouseY < 285+24) {\n\n JOptionPane.showMessageDialog(null, \"Audio Visualizer made by Debus Alexy\\nRaccourci clavier : Touche p ou P pour stopper le programme\\nTouche d ou D pour reset\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n if (mouseX > 180 && mouseX < 230 && mouseY > 152 && mouseY < 167) {\n javaColor = JColorChooser.showDialog(null, \"color picker\",Color.WHITE);\n\n\t\tif (javaColor!= null){\n\t\t BEAT = javaColor;\n rgbToHsv(BEAT);\n MyController1.getController(\"Saturation\").setValue((float)s);\n MyController1.getController(\"Brightness\").setValue((float)v);\n h-=90;\n if (h<0){\n h+=360;\n }\n MyController1.getController(\"Hue\").setValue((float)h);\n MyController1.getController(\"Hue\").setColorBackground(color(javaColor.getRed(),javaColor.getGreen(),javaColor.getBlue()));\n // MyController1.getController(\"Hue\").setColorValue(color(255-javaColor.getRed(),255-javaColor.getGreen(),255-javaColor.getBlue()));\n // mon_port.write(javaColor.getRed()+'g'+javaColor.getGreen()+'b'+javaColor.getBlue());\n \t}\n\t\telse {\n\t\t //default\n BEAT = Color.WHITE;\n\t\t}\n\n }\n\n if (mouseX > 430 && mouseX < 469 && mouseY > 290 && mouseY < 309) {\n leaving();\n }\n if (mouseX > 420 && mouseX < 450 && mouseY > 25 && mouseY < 35) {\n MyController1.getController(\"Play\").setValue(1);\n\n }else if (mouseX > 390 && mouseX < 400 && mouseY > 25 && mouseY < 35) {\n MyController1.getController(\"Play\").setValue(0);\n MyController1.getController(\"Beat pulse\").setValue(0);\n }\n\n if (mouseX > 400 && mouseX < 466 && mouseY > 20 && mouseY < 44) {\n buttonPlay = !buttonPlay;\n if (buttonPlay ==true){\n // mon_port.write('1');\n MyController1.getController(\"Play\").setImages(loadImage(\"On.png\"),loadImage(\"On.png\"),loadImage(\"On.png\"));\n }else{\n mon_port.write('0');\n MyController1.getController(\"Play\").setImages(loadImage(\"Off.png\"),loadImage(\"Off.png\"),loadImage(\"Off.png\"));\n }\n }\n}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed()\n{\n if(!welcomeFading)\n {\n welcomeFading = true;\n cp5.show();\n }\n if(!cp5.isMouseOver()) // check if were pressing a button\n {\n flock.AddAnimal(10, mouseX, mouseY);\n }\n}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"vai ficar clikando ai a toa? PATETA\");\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseEntered(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t\t\tPlay.setForeground(Color.darkGray);\r\n\t\t\t\t}", "public void mousePressed(MouseEvent e)\n { }", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "private void cs1() {\n\t\t\tctx.mouse.click(675,481,true);\n\t\t\t\n\t\t}", "public void mouseClicked(int mouseX, int mouseY, int mouse) {}", "public void mousePressed( MouseEvent event ){}", "public void mouseMoved(MouseEvent event) {\n }", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_8){\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\"pulsos\", IR.panelecturasbt2);\n\t\t\tIR.sensores.get(i).addPropertyChangeListener(\"lectura\",\n\t\t\t\tIR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\t\t // Aki se llama al panelecturas\n\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-4\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasmci.repaint();\n\t\t // IR.frmIrrisoft.getContentPane().add(\n\t\t // IR.panelecturasmci);\n\t\t // IR.panelecturasmci.setVisible(true);\n\n\t\t}", "@Override\n public void mouseMoved(MouseEvent e) {\n\n }", "@Override\n public void mouseMoved(MouseEvent arg0) {\n \n }", "public void mouseMoved(MouseEvent evt) { }", "void botonRecibir_mouseExited(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void pointToMouse() {\n pointToXY(p.mouseX,p.mouseY);\n }", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\tgame.selectWallnut();\n\t\t\tgame.updateHUD();\n\t\t}", "public void mousePressed(MouseEvent e) {\n \t\t\r\n \t}", "void mouseReleased(double x, double y, MouseEvent e );", "@Override\n public void mousePressed(MouseEvent mouseEvent) {\n if(autoFollow) {\n BoardIndex index = board.getIndexAtCoord(\n camera.pixelToPosition(new Vector2f(((float)mouseEvent.getX() / getWidth()) * width, ((float)mouseEvent.getY() / getHeight()) * height))\n );\n\n game.getCurrentPlayer().boardClicked(index);\n\n canPlay = false;\n }\n }", "public abstract boolean mouseOver( int x, int y );", "@Override\r\n\tpublic void onMouseDown(Widget who, int x, int y) {\n\r\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_6) {\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"pulsos\", IR.panelecturasbt2);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"lectura\", IR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\t\t // Aki se llama al panelecturas\n\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-2\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasmci.repaint();\n\t\t // IR.frmIrrisoft.getContentPane().add(\n\t\t // IR.panelecturasmci);\n\t\t // IR.panelecturasmci.setVisible(true);\n\n\t\t}", "public void mouseMoved (MouseEvent e){\n int mousePositionX = e.getX();\n int paddleX = mousePositionX - PADDLE_WIDTH / 2;\n int paddleY = (getHeight() - PADDLE_Y_OFFSET);\n movePaddle(paddleX, paddleY, mousePositionX);\n }", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }" ]
[ "0.6969157", "0.6791603", "0.67344654", "0.67314404", "0.67272997", "0.6719822", "0.66934025", "0.6630643", "0.6585384", "0.6577839", "0.6560817", "0.6560531", "0.65594083", "0.6543412", "0.6532829", "0.6527184", "0.65254956", "0.6506098", "0.6490205", "0.64753014", "0.6470325", "0.6433224", "0.6422151", "0.64195186", "0.64131796", "0.63974607", "0.63949645", "0.63934636", "0.6382283", "0.6382283", "0.6382283", "0.6382133", "0.6379167", "0.6376785", "0.63399434", "0.63399434", "0.63381034", "0.6335532", "0.633349", "0.633349", "0.6331246", "0.63300747", "0.63244", "0.63244", "0.63146496", "0.631373", "0.6311259", "0.63086104", "0.630259", "0.63023174", "0.6301815", "0.62995654", "0.6297228", "0.6297228", "0.6297188", "0.6295061", "0.62923956", "0.62855244", "0.62715113", "0.62702847", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.62623984", "0.6256656", "0.6245459", "0.6234609", "0.6228485", "0.6227755", "0.6227755", "0.6227755", "0.6227755", "0.6227755", "0.6227755", "0.6227755", "0.622762", "0.6224612", "0.6215428", "0.62101585", "0.62084055", "0.6206188", "0.6204218", "0.6203887", "0.6198552", "0.6196593", "0.6188047", "0.6173788", "0.6163542", "0.6158633", "0.6153877", "0.61518455", "0.61448765", "0.6143292", "0.6143191" ]
0.6608747
8
Obtener boton del Mouse pulsado
@Override public void mousePressed(MouseEvent e){ String boton = W.detClick( e.getButton() ); //System.out.println("->Mouse: Presionando Click " + boton ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void botonDemo_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed() {\n }", "public void checkMouse(){\n if(Greenfoot.mouseMoved(null)){\n mouseOver = Greenfoot.mouseMoved(this);\n }\n //Si esta encima se volvera transparente el boton en el que se encuentra\n if(mouseOver){\n adjTrans(MAX_TRANS/2);\n }\n else{\n adjTrans(MAX_TRANS);\n }\n \n }", "void onLeftMouseButtonReleased(double mouseX, double mouseY);", "public void mouseLeft() {\n\n\t}", "void boton1Jugador_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\t//boton1Jugador.setForeground(Color.white);\n\t}", "void botCargar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n public void mouseClicked(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n System.out.println(\" Mouse: Click \" + boton ); \n }", "@Override\n public void pulsarRaton(MouseEvent e) {\n pararCancion();\n //CAMBIAMOS LA PANTALLA\n PantallaNivel1 pantallaJuego = new PantallaNivel1(p);\n pantallaJuego.inicializarPantalla();\n p.cambiarPantalla(pantallaJuego);\n \n }", "public void mouseClicked(MouseEvent evt) {\n Location x = new Location( evt.getX(), evt.getY() );\n ripple = new Ripples(x, canvas, pond, true, movingRipples,this);\n run.addActionListener(ripple);\n pause.addActionListener(ripple);\n clear.addActionListener(ripple);\n speedController.addChangeListener(ripple);\n canvas.addMouseListener(ripple);\n canvas.addMouseMotionListener(ripple);\n }", "void botonDescargaSobre_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\t//boton1Jugador.setForeground(Color.white);\n\t}", "void botSalir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botGuardar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botAyuda_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botonRecibir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n\tpublic void mouseLeft() {\n\t\t\n\t}", "void botonAyuda_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mouseClicked() {\n\t\tswitch(screen) {\n\t\t\n\t\t// Pantalla Home\n\t\tcase 0:\n\t\t\tif((mouseX > 529 && mouseY > 691) && (mouseX < 966 & mouseY < 867)) {\n\t\t\t\t//si hace click adentro del boton de jugar\n\t\t\t\tscreen = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t// Pantalla Instrucciones\n\t\tcase 1:\n\t\t\t//si hace click adentro de la pantalla\n\t\t\tscreen = 2;\n\t\t\tbreak;\n\t\t}\n\t}", "void botonSalir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botGuardarComo_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed() {\n\t int ret = output.sendNoteOn(0, 3, 3);\n\t ret = output.sendSysex(new byte[] {(byte)0xF0, 1, 2, 3, 4, (byte)0xF7});\n\t}", "public void mousePressed (MouseEvent event) {}", "void botonReglas_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "private void mouseMove() {\n if (this.holding) {\n Point point = new Point(mousex, mousey);\n this.addPixel(point);\n }\n }", "void botonEnviar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_5) {\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"pulsos\", IR.panelecturasbt2);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"lectura\", IR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\n\t\t // Aki se llama al panelecturas\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-1\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t // IR.panelecturasbt2.setActualizar(true);\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasbt2\n\t\t // .setHilomuestrainfo(IR.panelecturasbt2\n\t\t // .getHilomuestrainfo());\n\t\t // IR.panelecturasbt2.hiloinfo = new Thread(\n\t\t // IR.panelecturasbt2.hilomuestrainfo);\n\t\t // IR.panelecturasbt2.hiloinfo.start();\n\n\t\t}", "public void mouseMoved(MouseEvent e){}", "@Override\n public void mouseAction( MouseEvent me )\n {\n \n }", "void mousePressed() {\n firing = true;\n\n}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "public MouseHandler(TicTacToePanel ticTacToePanel) {\n\t}", "void botAcerca_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public SimpleTrackMouse()\n { \n // Set background color and arrange for the panel to listen for mouse events.\n setBackground(Color.WHITE);\n MouseHandler listener = new MouseHandler();\n addMouseListener(listener); // Register mouse listener.\n addMouseMotionListener(listener); // Register mouse motion listener.\n }", "@Override\r\n\tpublic void onMouseMove(Widget who, int x, int y) {\n\r\n\t}", "private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved\n \n /*Pon la bandera para saber que ya hubó un evento y no se desloguie*/\n bIdle = true;\n \n }", "private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved\n \n /*Pon la bandera para saber que ya hubó un evento y no se desloguie*/\n bIdle = true;\n \n }", "public void mousePressed(MouseEvent event)\r\n {\n }", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "@Override\r\n\tpublic void mousePressed(MouseEvent event ) {\n\t\t\r\n\t\tint whichButton =event.getButton();\r\n\t\tmsg=\"\";\r\n\t\tmsg =\"You Pressed Mouse \" ;\r\n\t\t\r\n\t\tif(whichButton==MouseEvent.BUTTON1)\r\n\t\t\tmsg+=\" BUTTON 1\";\r\n\t\telse if(whichButton==MouseEvent.BUTTON2)\r\n\t\t\tmsg+=\"Button 2\";\r\n\t\telse\r\n\t\t\tmsg+=\"Button 3\";\r\n\t\t\r\n\t\tmsg+=\"You are at position \"+\"<X \"+event.getX()+\" Y \"+event.getY()+\">\";\r\n\t\t\r\n\t\tif(event.getClickCount()==2)\r\n\t\t{\r\n\t\t\tmsg+=\" You double Clicked\";\r\n\t\t}\r\n\t\telse\r\n\t\t\tmsg+=\" You singel-Clicked\";\r\n\t\t\r\n\t\tlabel.setText(msg);\r\n\t\t\r\n\t}", "public void mouseOut() {\n process(1);\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tl1.setText(\"You pressed the mouse\");\r\n\t}", "void mousePressed(MouseEvent mouseEvent);", "public void mousePressed(MouseEvent e) {\r\n }", "void botonDemo_mouseExited(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed(MouseEvent e) {\n \t // Click gauche enfoncé\n \t if (e.getButton() == 1) {\n\t \t app.modifierCurseurVue(Cursor.MOVE_CURSOR);\n\t \t prevX = e.getX();\n\t \t prevY = e.getY();\n \t }\n }", "@Override\n\tpublic void mouseUp() {\n\t\t\n\t}", "public void mousePressed(MouseEvent e) {\n\n }", "public void mousePressed(MouseEvent arg0) {\n\n }", "public void mousePressed(MouseEvent arg0) {\n\n }", "@Override\r\n\tpublic void onMouseUp(Widget who, int x, int y) {\n\r\n\t}", "void botonJuegoRed_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void mousePressed(double x, double y, MouseEvent e );", "public void mousePressed(MouseEvent e) {\n }", "public void mousePressed() {\n if (mouseX > 250 && mouseX < 300 && mouseY > 45 && mouseY < 95) {\n // createWindows();\n // btnMakeWindow.setEnabled(false); createWindows();\n }\n\n if (mouseX > 20 && mouseX < 20+20 && mouseY > 20 && mouseY < 20+20) {\n button = !button;\n }\n if (mouseX > 250 && mouseX < 350 && mouseY > 20 && mouseY < 20+50) {\n\n }\n if (mouseX > 418 && mouseX < 473 && mouseY > 185 && mouseY < 204) {\n rgbEffects();\n }\n if (mouseX > 10 && mouseX < 49 && mouseY > 150 && mouseY < 169) {\n MyController1.getController(\"bar height\").setValue(50);\n MyController2.getController(\"width\").setValue(50);\n input.disableMonitoring();\n }\n if (mouseX > 395 && mouseX < 395+24 && mouseY > 285 && mouseY < 285+24) {\n\n JOptionPane.showMessageDialog(null, \"Audio Visualizer made by Debus Alexy\\nRaccourci clavier : Touche p ou P pour stopper le programme\\nTouche d ou D pour reset\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n if (mouseX > 180 && mouseX < 230 && mouseY > 152 && mouseY < 167) {\n javaColor = JColorChooser.showDialog(null, \"color picker\",Color.WHITE);\n\n\t\tif (javaColor!= null){\n\t\t BEAT = javaColor;\n rgbToHsv(BEAT);\n MyController1.getController(\"Saturation\").setValue((float)s);\n MyController1.getController(\"Brightness\").setValue((float)v);\n h-=90;\n if (h<0){\n h+=360;\n }\n MyController1.getController(\"Hue\").setValue((float)h);\n MyController1.getController(\"Hue\").setColorBackground(color(javaColor.getRed(),javaColor.getGreen(),javaColor.getBlue()));\n // MyController1.getController(\"Hue\").setColorValue(color(255-javaColor.getRed(),255-javaColor.getGreen(),255-javaColor.getBlue()));\n // mon_port.write(javaColor.getRed()+'g'+javaColor.getGreen()+'b'+javaColor.getBlue());\n \t}\n\t\telse {\n\t\t //default\n BEAT = Color.WHITE;\n\t\t}\n\n }\n\n if (mouseX > 430 && mouseX < 469 && mouseY > 290 && mouseY < 309) {\n leaving();\n }\n if (mouseX > 420 && mouseX < 450 && mouseY > 25 && mouseY < 35) {\n MyController1.getController(\"Play\").setValue(1);\n\n }else if (mouseX > 390 && mouseX < 400 && mouseY > 25 && mouseY < 35) {\n MyController1.getController(\"Play\").setValue(0);\n MyController1.getController(\"Beat pulse\").setValue(0);\n }\n\n if (mouseX > 400 && mouseX < 466 && mouseY > 20 && mouseY < 44) {\n buttonPlay = !buttonPlay;\n if (buttonPlay ==true){\n // mon_port.write('1');\n MyController1.getController(\"Play\").setImages(loadImage(\"On.png\"),loadImage(\"On.png\"),loadImage(\"On.png\"));\n }else{\n mon_port.write('0');\n MyController1.getController(\"Play\").setImages(loadImage(\"Off.png\"),loadImage(\"Off.png\"),loadImage(\"Off.png\"));\n }\n }\n}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed()\n{\n if(!welcomeFading)\n {\n welcomeFading = true;\n cp5.show();\n }\n if(!cp5.isMouseOver()) // check if were pressing a button\n {\n flock.AddAnimal(10, mouseX, mouseY);\n }\n}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"vai ficar clikando ai a toa? PATETA\");\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseEntered(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t\t\tPlay.setForeground(Color.darkGray);\r\n\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "public void mousePressed(MouseEvent e)\n { }", "private void cs1() {\n\t\t\tctx.mouse.click(675,481,true);\n\t\t\t\n\t\t}", "public void mouseClicked(int mouseX, int mouseY, int mouse) {}", "public void mousePressed( MouseEvent event ){}", "public void mouseMoved(MouseEvent event) {\n }", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_8){\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\"pulsos\", IR.panelecturasbt2);\n\t\t\tIR.sensores.get(i).addPropertyChangeListener(\"lectura\",\n\t\t\t\tIR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\t\t // Aki se llama al panelecturas\n\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-4\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasmci.repaint();\n\t\t // IR.frmIrrisoft.getContentPane().add(\n\t\t // IR.panelecturasmci);\n\t\t // IR.panelecturasmci.setVisible(true);\n\n\t\t}", "@Override\n public void mouseMoved(MouseEvent e) {\n\n }", "@Override\n public void mouseMoved(MouseEvent arg0) {\n \n }", "public void mouseMoved(MouseEvent evt) { }", "void botonRecibir_mouseExited(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void pointToMouse() {\n pointToXY(p.mouseX,p.mouseY);\n }", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\tgame.selectWallnut();\n\t\t\tgame.updateHUD();\n\t\t}", "public void mousePressed(MouseEvent e) {\n \t\t\r\n \t}", "void mouseReleased(double x, double y, MouseEvent e );", "@Override\n public void mousePressed(MouseEvent mouseEvent) {\n if(autoFollow) {\n BoardIndex index = board.getIndexAtCoord(\n camera.pixelToPosition(new Vector2f(((float)mouseEvent.getX() / getWidth()) * width, ((float)mouseEvent.getY() / getHeight()) * height))\n );\n\n game.getCurrentPlayer().boardClicked(index);\n\n canPlay = false;\n }\n }", "public abstract boolean mouseOver( int x, int y );", "@Override\r\n\tpublic void onMouseDown(Widget who, int x, int y) {\n\r\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_6) {\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"pulsos\", IR.panelecturasbt2);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"lectura\", IR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\t\t // Aki se llama al panelecturas\n\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-2\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasmci.repaint();\n\t\t // IR.frmIrrisoft.getContentPane().add(\n\t\t // IR.panelecturasmci);\n\t\t // IR.panelecturasmci.setVisible(true);\n\n\t\t}", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }", "public void mouseMoved (MouseEvent e){\n int mousePositionX = e.getX();\n int paddleX = mousePositionX - PADDLE_WIDTH / 2;\n int paddleY = (getHeight() - PADDLE_Y_OFFSET);\n movePaddle(paddleX, paddleY, mousePositionX);\n }" ]
[ "0.69693935", "0.6791693", "0.67308486", "0.67266876", "0.6720071", "0.669357", "0.663158", "0.66088134", "0.6585307", "0.6577078", "0.6561232", "0.6561007", "0.6559886", "0.65437585", "0.6533194", "0.65276295", "0.6525804", "0.6504607", "0.6490022", "0.64759964", "0.6470965", "0.6432693", "0.64226747", "0.6418257", "0.6413624", "0.63972336", "0.63944167", "0.63929456", "0.6381987", "0.63817966", "0.63817966", "0.63817966", "0.63792574", "0.6377051", "0.63401335", "0.63401335", "0.633804", "0.63353026", "0.63319266", "0.63319266", "0.6330804", "0.63295466", "0.63238484", "0.63238484", "0.63139504", "0.6312018", "0.63102406", "0.63078517", "0.63023263", "0.63009596", "0.6300775", "0.62992716", "0.62972164", "0.62971836", "0.62971836", "0.62942463", "0.6292639", "0.62845194", "0.627143", "0.6268865", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6263303", "0.6256292", "0.62452406", "0.62338364", "0.62285227", "0.62285227", "0.62285227", "0.62285227", "0.62285227", "0.62285227", "0.62285227", "0.6228334", "0.62274754", "0.6223949", "0.62145066", "0.62098795", "0.6207642", "0.6206457", "0.62044364", "0.62036216", "0.61979085", "0.61955893", "0.61878276", "0.61735684", "0.6162235", "0.6157297", "0.615215", "0.6151884", "0.6144096", "0.61427647", "0.6142583" ]
0.67343783
2
Obtener boton del Mouse pulsado
@Override public void mouseReleased(MouseEvent e){ String boton = W.detClick( e.getButton() ); //Obtener cantidad de Clicks int clickCont = e.getClickCount(); System.out.println("->Mouse: Has soltado Click " + boton ); System.out.println(" Cantidad de Clicks: " + clickCont ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void botonDemo_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed() {\n }", "@Override\n public void mousePressed(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n //System.out.println(\"->Mouse: Presionando Click \" + boton );\n }", "public void checkMouse(){\n if(Greenfoot.mouseMoved(null)){\n mouseOver = Greenfoot.mouseMoved(this);\n }\n //Si esta encima se volvera transparente el boton en el que se encuentra\n if(mouseOver){\n adjTrans(MAX_TRANS/2);\n }\n else{\n adjTrans(MAX_TRANS);\n }\n \n }", "void onLeftMouseButtonReleased(double mouseX, double mouseY);", "public void mouseLeft() {\n\n\t}", "void boton1Jugador_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\t//boton1Jugador.setForeground(Color.white);\n\t}", "void botCargar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n public void mouseClicked(MouseEvent e){\n String boton = W.detClick( e.getButton() );\n \n System.out.println(\" Mouse: Click \" + boton ); \n }", "@Override\n public void pulsarRaton(MouseEvent e) {\n pararCancion();\n //CAMBIAMOS LA PANTALLA\n PantallaNivel1 pantallaJuego = new PantallaNivel1(p);\n pantallaJuego.inicializarPantalla();\n p.cambiarPantalla(pantallaJuego);\n \n }", "public void mouseClicked(MouseEvent evt) {\n Location x = new Location( evt.getX(), evt.getY() );\n ripple = new Ripples(x, canvas, pond, true, movingRipples,this);\n run.addActionListener(ripple);\n pause.addActionListener(ripple);\n clear.addActionListener(ripple);\n speedController.addChangeListener(ripple);\n canvas.addMouseListener(ripple);\n canvas.addMouseMotionListener(ripple);\n }", "void botonDescargaSobre_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t\t//boton1Jugador.setForeground(Color.white);\n\t}", "void botSalir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botGuardar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botAyuda_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botonRecibir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n\tpublic void mouseLeft() {\n\t\t\n\t}", "void botonAyuda_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mouseClicked() {\n\t\tswitch(screen) {\n\t\t\n\t\t// Pantalla Home\n\t\tcase 0:\n\t\t\tif((mouseX > 529 && mouseY > 691) && (mouseX < 966 & mouseY < 867)) {\n\t\t\t\t//si hace click adentro del boton de jugar\n\t\t\t\tscreen = 1;\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\t// Pantalla Instrucciones\n\t\tcase 1:\n\t\t\t//si hace click adentro de la pantalla\n\t\t\tscreen = 2;\n\t\t\tbreak;\n\t\t}\n\t}", "void botonSalir_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void botGuardarComo_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed() {\n\t int ret = output.sendNoteOn(0, 3, 3);\n\t ret = output.sendSysex(new byte[] {(byte)0xF0, 1, 2, 3, 4, (byte)0xF7});\n\t}", "public void mousePressed (MouseEvent event) {}", "void botonReglas_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "private void mouseMove() {\n if (this.holding) {\n Point point = new Point(mousex, mousey);\n this.addPixel(point);\n }\n }", "void botonEnviar_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_5) {\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"pulsos\", IR.panelecturasbt2);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"lectura\", IR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\n\t\t // Aki se llama al panelecturas\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-1\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t // IR.panelecturasbt2.setActualizar(true);\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasbt2\n\t\t // .setHilomuestrainfo(IR.panelecturasbt2\n\t\t // .getHilomuestrainfo());\n\t\t // IR.panelecturasbt2.hiloinfo = new Thread(\n\t\t // IR.panelecturasbt2.hilomuestrainfo);\n\t\t // IR.panelecturasbt2.hiloinfo.start();\n\n\t\t}", "public void mouseMoved(MouseEvent e){}", "@Override\n public void mouseAction( MouseEvent me )\n {\n \n }", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "public void mousePressed(MouseEvent e) {}", "void mousePressed() {\n firing = true;\n\n}", "public MouseHandler(TicTacToePanel ticTacToePanel) {\n\t}", "void botAcerca_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public SimpleTrackMouse()\n { \n // Set background color and arrange for the panel to listen for mouse events.\n setBackground(Color.WHITE);\n MouseHandler listener = new MouseHandler();\n addMouseListener(listener); // Register mouse listener.\n addMouseMotionListener(listener); // Register mouse motion listener.\n }", "@Override\r\n\tpublic void onMouseMove(Widget who, int x, int y) {\n\r\n\t}", "private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved\n \n /*Pon la bandera para saber que ya hubó un evento y no se desloguie*/\n bIdle = true;\n \n }", "private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved\n \n /*Pon la bandera para saber que ya hubó un evento y no se desloguie*/\n bIdle = true;\n \n }", "public void mousePressed(MouseEvent event)\r\n {\n }", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "public void mouseMoved(MouseEvent e) {}", "@Override\r\n\tpublic void mousePressed(MouseEvent event ) {\n\t\t\r\n\t\tint whichButton =event.getButton();\r\n\t\tmsg=\"\";\r\n\t\tmsg =\"You Pressed Mouse \" ;\r\n\t\t\r\n\t\tif(whichButton==MouseEvent.BUTTON1)\r\n\t\t\tmsg+=\" BUTTON 1\";\r\n\t\telse if(whichButton==MouseEvent.BUTTON2)\r\n\t\t\tmsg+=\"Button 2\";\r\n\t\telse\r\n\t\t\tmsg+=\"Button 3\";\r\n\t\t\r\n\t\tmsg+=\"You are at position \"+\"<X \"+event.getX()+\" Y \"+event.getY()+\">\";\r\n\t\t\r\n\t\tif(event.getClickCount()==2)\r\n\t\t{\r\n\t\t\tmsg+=\" You double Clicked\";\r\n\t\t}\r\n\t\telse\r\n\t\t\tmsg+=\" You singel-Clicked\";\r\n\t\t\r\n\t\tlabel.setText(msg);\r\n\t\t\r\n\t}", "public void mouseOut() {\n process(1);\n }", "@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\tl1.setText(\"You pressed the mouse\");\r\n\t}", "void mousePressed(MouseEvent mouseEvent);", "public void mousePressed(MouseEvent e) {\r\n }", "public void mousePressed(MouseEvent e) {\n \t // Click gauche enfoncé\n \t if (e.getButton() == 1) {\n\t \t app.modifierCurseurVue(Cursor.MOVE_CURSOR);\n\t \t prevX = e.getX();\n\t \t prevY = e.getY();\n \t }\n }", "void botonDemo_mouseExited(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "@Override\n\tpublic void mouseUp() {\n\t\t\n\t}", "public void mousePressed(MouseEvent e) {\n\n }", "public void mousePressed(MouseEvent arg0) {\n\n }", "public void mousePressed(MouseEvent arg0) {\n\n }", "@Override\r\n\tpublic void onMouseUp(Widget who, int x, int y) {\n\r\n\t}", "void botonJuegoRed_mouseEntered(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/punteroAct.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "void mousePressed(double x, double y, MouseEvent e );", "public void mousePressed(MouseEvent e) {\n }", "public void mousePressed() {\n if (mouseX > 250 && mouseX < 300 && mouseY > 45 && mouseY < 95) {\n // createWindows();\n // btnMakeWindow.setEnabled(false); createWindows();\n }\n\n if (mouseX > 20 && mouseX < 20+20 && mouseY > 20 && mouseY < 20+20) {\n button = !button;\n }\n if (mouseX > 250 && mouseX < 350 && mouseY > 20 && mouseY < 20+50) {\n\n }\n if (mouseX > 418 && mouseX < 473 && mouseY > 185 && mouseY < 204) {\n rgbEffects();\n }\n if (mouseX > 10 && mouseX < 49 && mouseY > 150 && mouseY < 169) {\n MyController1.getController(\"bar height\").setValue(50);\n MyController2.getController(\"width\").setValue(50);\n input.disableMonitoring();\n }\n if (mouseX > 395 && mouseX < 395+24 && mouseY > 285 && mouseY < 285+24) {\n\n JOptionPane.showMessageDialog(null, \"Audio Visualizer made by Debus Alexy\\nRaccourci clavier : Touche p ou P pour stopper le programme\\nTouche d ou D pour reset\", \"Information\", JOptionPane.INFORMATION_MESSAGE);\n }\n\n if (mouseX > 180 && mouseX < 230 && mouseY > 152 && mouseY < 167) {\n javaColor = JColorChooser.showDialog(null, \"color picker\",Color.WHITE);\n\n\t\tif (javaColor!= null){\n\t\t BEAT = javaColor;\n rgbToHsv(BEAT);\n MyController1.getController(\"Saturation\").setValue((float)s);\n MyController1.getController(\"Brightness\").setValue((float)v);\n h-=90;\n if (h<0){\n h+=360;\n }\n MyController1.getController(\"Hue\").setValue((float)h);\n MyController1.getController(\"Hue\").setColorBackground(color(javaColor.getRed(),javaColor.getGreen(),javaColor.getBlue()));\n // MyController1.getController(\"Hue\").setColorValue(color(255-javaColor.getRed(),255-javaColor.getGreen(),255-javaColor.getBlue()));\n // mon_port.write(javaColor.getRed()+'g'+javaColor.getGreen()+'b'+javaColor.getBlue());\n \t}\n\t\telse {\n\t\t //default\n BEAT = Color.WHITE;\n\t\t}\n\n }\n\n if (mouseX > 430 && mouseX < 469 && mouseY > 290 && mouseY < 309) {\n leaving();\n }\n if (mouseX > 420 && mouseX < 450 && mouseY > 25 && mouseY < 35) {\n MyController1.getController(\"Play\").setValue(1);\n\n }else if (mouseX > 390 && mouseX < 400 && mouseY > 25 && mouseY < 35) {\n MyController1.getController(\"Play\").setValue(0);\n MyController1.getController(\"Beat pulse\").setValue(0);\n }\n\n if (mouseX > 400 && mouseX < 466 && mouseY > 20 && mouseY < 44) {\n buttonPlay = !buttonPlay;\n if (buttonPlay ==true){\n // mon_port.write('1');\n MyController1.getController(\"Play\").setImages(loadImage(\"On.png\"),loadImage(\"On.png\"),loadImage(\"On.png\"));\n }else{\n mon_port.write('0');\n MyController1.getController(\"Play\").setImages(loadImage(\"Off.png\"),loadImage(\"Off.png\"),loadImage(\"Off.png\"));\n }\n }\n}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void mouseDown(MouseEvent e) {\n\t\t\t\t\n\t\t\t}", "public void mousePressed()\n{\n if(!welcomeFading)\n {\n welcomeFading = true;\n cp5.show();\n }\n if(!cp5.isMouseOver()) // check if were pressing a button\n {\n flock.AddAnimal(10, mouseX, mouseY);\n }\n}", "@Override\n\t\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\t\tSystem.out.println(\"vai ficar clikando ai a toa? PATETA\");\n\t\t\t\t\n\t\t\t}", "@Override\r\n\t\t\t\tpublic void mouseEntered(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t\t\tPlay.setForeground(Color.darkGray);\r\n\t\t\t\t}", "public void mousePressed(MouseEvent e)\n { }", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "@Override\n\t\t\t\t\t\tpublic void mouseDown(MouseEvent arg0) {\n\n\t\t\t\t\t\t}", "private void cs1() {\n\t\t\tctx.mouse.click(675,481,true);\n\t\t\t\n\t\t}", "public void mouseClicked(int mouseX, int mouseY, int mouse) {}", "public void mousePressed( MouseEvent event ){}", "public void mouseMoved(MouseEvent event) {\n }", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_8){\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\"pulsos\", IR.panelecturasbt2);\n\t\t\tIR.sensores.get(i).addPropertyChangeListener(\"lectura\",\n\t\t\t\tIR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\t\t // Aki se llama al panelecturas\n\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-4\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasmci.repaint();\n\t\t // IR.frmIrrisoft.getContentPane().add(\n\t\t // IR.panelecturasmci);\n\t\t // IR.panelecturasmci.setVisible(true);\n\n\t\t}", "@Override\n public void mouseMoved(MouseEvent e) {\n\n }", "@Override\n public void mouseMoved(MouseEvent arg0) {\n \n }", "public void mouseMoved(MouseEvent evt) { }", "void botonRecibir_mouseExited(MouseEvent e) {\n\t\tImageIcon cursor = new ImageIcon(\"../imagenes/cursores/puntero.gif\");\n\t\tImage image = cursor.getImage();\n\t\tCursor puntero = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(8, 8), \"img\");\n\t\tthis.setCursor(puntero);\n\n\t}", "public void pointToMouse() {\n pointToXY(p.mouseX,p.mouseY);\n }", "@Override\n\t\tpublic void mouseClicked(MouseEvent e) {\n\t\t\tgame.selectWallnut();\n\t\t\tgame.updateHUD();\n\t\t}", "public void mousePressed(MouseEvent e) {\n \t\t\r\n \t}", "void mouseReleased(double x, double y, MouseEvent e );", "@Override\n public void mousePressed(MouseEvent mouseEvent) {\n if(autoFollow) {\n BoardIndex index = board.getIndexAtCoord(\n camera.pixelToPosition(new Vector2f(((float)mouseEvent.getX() / getWidth()) * width, ((float)mouseEvent.getY() / getHeight()) * height))\n );\n\n game.getCurrentPlayer().boardClicked(index);\n\n canPlay = false;\n }\n }", "@Override\r\n\tpublic void onMouseDown(Widget who, int x, int y) {\n\r\n\t}", "public abstract boolean mouseOver( int x, int y );", "public void mouseClicked(MouseEvent e) {\n\t\t IR.panelecturasbt2 = Panelecturasbt2.getInstance();\n\t\t // Buclo popr los sensores para añadir los listeners\n\t\t // necesarios\n\t\t for (int i = 0; i < IR.sensores.size(); i++) {\n\t\t\tif (IR.sensores.get(i).getNum_placa() == IrrisoftConstantes.PLACA_BT2_6) {\n\t\t\t IR.sensores.get(i).setLectura(\"\");\n\t\t\t IR.sensores.get(i).setPulsos(-1);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"pulsos\", IR.panelecturasbt2);\n\t\t\t IR.sensores.get(i).addPropertyChangeListener(\n\t\t\t\t \"lectura\", IR.panelecturasbt2);\n\t\t\t}\n\t\t }\n\t\t // Aki se llama al panelecturas\n\n\t\t IR.panelecturas.setVisible(false);\n\t\t IR.panelecturasbt2.getLbltitulo().setText(\"PLACA BT2-2\");\n\t\t //IR.panelecturasbt2.tipo = 0;\n\t\t IR.panelecturasbt2.repaint();\n\t\t IR.frmIrrisoft.getContentPane().add(IR.panelecturasbt2);\n\t\t IR.panelecturasbt2.setVisible(true);\n\t\t // IR.panelecturasmci.repaint();\n\t\t // IR.frmIrrisoft.getContentPane().add(\n\t\t // IR.panelecturasmci);\n\t\t // IR.panelecturasmci.setVisible(true);\n\n\t\t}", "@Override\r\n public void mouseClicked(MouseEvent e) {\n System.out.println(e.getButton());\r\n\r\n // MouseEvent.BUTTON3 es el boton derecho\r\n }", "public void mouseMoved (MouseEvent e){\n int mousePositionX = e.getX();\n int paddleX = mousePositionX - PADDLE_WIDTH / 2;\n int paddleY = (getHeight() - PADDLE_Y_OFFSET);\n movePaddle(paddleX, paddleY, mousePositionX);\n }" ]
[ "0.6969757", "0.67926496", "0.67348504", "0.67312956", "0.672754", "0.67206746", "0.669406", "0.66315246", "0.66096973", "0.6583716", "0.65778", "0.65615284", "0.6561249", "0.6559979", "0.6543992", "0.6533217", "0.65281636", "0.65259963", "0.65055346", "0.6490189", "0.64760536", "0.64697033", "0.6433469", "0.64224154", "0.6418868", "0.64137226", "0.639866", "0.63944036", "0.6393547", "0.63827175", "0.63827175", "0.63827175", "0.63823813", "0.63799375", "0.6377265", "0.63411057", "0.63411057", "0.63385403", "0.6336525", "0.6332298", "0.6332298", "0.63317823", "0.63295525", "0.63237405", "0.63237405", "0.6315135", "0.63126314", "0.6311379", "0.63086766", "0.63034445", "0.6302098", "0.6301694", "0.6300353", "0.62980103", "0.6297839", "0.6297839", "0.6295729", "0.62929964", "0.6285597", "0.62725246", "0.62704235", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.62641317", "0.6256797", "0.6246727", "0.6234952", "0.6229204", "0.6229069", "0.6229069", "0.6229069", "0.6229069", "0.6229069", "0.6229069", "0.6229069", "0.6227925", "0.6225657", "0.6215495", "0.6209878", "0.6209426", "0.6206565", "0.62044686", "0.6203509", "0.6198248", "0.61965436", "0.61882526", "0.6174451", "0.6163462", "0.6157731", "0.61536855", "0.61536807", "0.61459213", "0.61446095", "0.6141822" ]
0.0
-1
Checks which nodes to be selected for expansion
public static void check() { while (!choiceOfNodes.isEmpty()) { Node node = choiceOfNodes.remove(); if (node.isItGoal()) { System.out.println("\nSolution: \n"); printTheBoards(node); System.out.println("No. of nodes generated in total: " + nodesGenerated); System.out.println("No. of nodes expanded: " + nodesOpened); return; } else { if (isItVisted(node)) { continue; } else { nodesOpened++; nodesCovered.add(node); startOperation(node); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected boolean selectionAccept(Node[] nodes) {\n return true;\n }", "public void checkNodes() {\n // Don't do anything when you check the nodes. This nodes is built by\n // when the setTarget method is called.\n }", "private void checkAndSet() {\n if (value == null) {\n throw new IllegalArgumentException(EXC_NodeCannotBeNull());\n }\n\n if (equalNodes(value, selectedNodes)) {\n return;\n }\n\n List<Node> validNodes = null;\n for (int i = 0; i < value.length; i++) {\n if (value[i] == null) {\n throw new IllegalArgumentException(EXC_NoElementOfNodeSelectionMayBeNull());\n }\n \n if (!isUnderRoot(value[i])) {\n if (validNodes == null) {\n validNodes = new ArrayList<Node>(value.length);\n for (int j = 0; j < i; j++) {\n validNodes.add(value[j]);\n }\n }\n } else if (validNodes != null) {\n validNodes.add(value[i]);\n }\n }\n if (validNodes != null) {\n newValue = validNodes.toArray(new Node[validNodes.size()]);\n if (equalNodes(newValue, selectedNodes)) {\n return;\n } \n } else {\n newValue = value;\n }\n\n if ((newValue.length != 0) && (vetoableSupport != null)) {\n try {\n // we send the vetoable change event only for non-empty selections\n vetoableSupport.fireVetoableChange(PROP_SELECTED_NODES, selectedNodes, newValue);\n } catch (PropertyVetoException ex) {\n veto = ex;\n return;\n }\n }\n updateSelection();\n }", "abstract public void showSelection(Node[] nodes) ;", "private boolean checkAction() {\n if (nodes == null || nodes.length > 1) {\r\n return false;\r\n }\r\n // Emptry node name\r\n if (jtfChildName.getText().isEmpty()) {\r\n JOptionPane.showMessageDialog(JZVNode.this,\r\n bundle.getString(\"dlg.error.addWithoutName\"),\r\n bundle.getString(\"dlg.error.title\"),\r\n JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n // No parent\r\n if (nodes == null || nodes.length != 1) {\r\n JOptionPane.showMessageDialog(JZVNode.this,\r\n bundle.getString(\"dlg.error.addWithoutParent\"),\r\n bundle.getString(\"dlg.error.title\"),\r\n JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n return true;\r\n }", "private void recursiveOefosTreeviewBuild(DefaultMutableTreeNode nodes, TreeMap<Object, Taxon> taxons, String sequence, String panelname) throws Exception {\r\n try {\r\n for (Map.Entry<Object, Taxon> kv : taxons.entrySet()) {\r\n ClassNode iNode = new ClassNode(\"\" + kv.getKey(), kv.getValue().upstream_identifier + \": \" + kv.getValue().description);\r\n \r\n ClassMutableNode inner = new ClassMutableNode(iNode);\r\n nodes.add(inner);\r\n String oefosname = panelname+\"----\"+sequence;\r\n if (this.oefos_path.get(oefosname) != null) {\r\n if (this.oefos_path.get(oefosname).containsValue(kv.getValue().TID)) {\r\n selected = inner;\r\n }\r\n }\r\n\r\n recursiveOefosTreeviewBuild(inner, kv.getValue().subtaxons, sequence, panelname);\r\n }\r\n\r\n // Utility.sortTreeChildren(nodes);\r\n } catch (Exception ex) {\r\n throw new Exception(\"Exception in recursiveOefosTreeviewBuild: \" + ex.getStackTrace() + \"\\n\");\r\n }\r\n }", "static public void doExpandall ( RunData data)\n\t{\n\t\t// get the state object\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t//get the ParameterParser from RunData\n\t\tParameterParser params = data.getParameters ();\n\n\t\t// save the current selections\n\t\tSet selectedSet = new TreeSet();\n\t\tString[] selectedItems = params.getStrings(\"selectedMembers\");\n\t\tif(selectedItems != null)\n\t\t{\n\t\t\tselectedSet.addAll(Arrays.asList(selectedItems));\n\t\t}\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, selectedSet);\n\n\t\t// expansion actually occurs in getBrowseItems method.\n\t\tstate.setAttribute(STATE_EXPAND_ALL_FLAG, Boolean.TRUE.toString());\n\t\tstate.setAttribute(STATE_NEED_TO_EXPAND_ALL, Boolean.TRUE.toString());\n\n\t}", "private void checkNodesToSearch() {\n if (nodesToSearch == null || nodesToSearch.length == 0) {\n Graph graph;\n if (Lookup.getDefault().lookup(DataTablesController.class).isShowOnlyVisible()) {\n graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraphVisible();\n } else {\n graph = Lookup.getDefault().lookup(GraphController.class).getGraphModel().getGraph();\n }\n nodesToSearch = graph.getNodes().toArray();\n }\n }", "public boolean hasBeenExpanded(Object inNode)\n\t{\n\t\tObject parent = inNode;\n\t\twhile( parent != null)\n\t\t{\n\t\t\tString path = toUrl(inNode);\n\t\t\tif( getExpandedNodes().contains(path) )\n\t\t\t{\n\t\t\t\tparent = getWebTree().getModel().getParent(parent);\n\t\t\t\t//If we get to the root and it is selected still then we are ok!\n\t\t\t\tif( parent == null)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean checkScanNodesCompleted() {\n\t\treturn cursor.getSelectionPos() >= jedisNodes.size();\n\t}", "@Override\n public boolean isValid() {\n return getComponent().manager.getSelectedNodes().length == 1;\n }", "public abstract boolean setNodeExpanded(int nodeIndex,boolean true_is_yes);", "@Test\n public void test34(){\n Tree<PermissionDO> tree = permissionService.getTree(16);\n for (Tree<PermissionDO> permissionDOTree : tree.getChildren()) {\n if((boolean)(permissionDOTree.getState().get(\"selected\"))){\n System.out.println(permissionDOTree.getText());\n }\n System.out.println(\"--------------------\");\n }\n }", "public abstract boolean \tgetNodeExpanded(int nodeIndex);", "private void validOrderResult() {\n TreeNode currentTreeNode = treeLeaf;\n TreeNode orderTreeNode = null;\n while (!(currentTreeNode instanceof SourceTreeNode)) {\n if (currentTreeNode instanceof OrderGlobalTreeNode) {\n orderTreeNode = currentTreeNode;\n break;\n } else {\n currentTreeNode = UnaryTreeNode.class.cast(currentTreeNode).getInputNode();\n }\n }\n if (null != orderTreeNode) {\n OrderGlobalTreeNode orderGlobalTreeNode = OrderGlobalTreeNode.class.cast(orderTreeNode);\n TreeNode aggTreeNode = orderTreeNode.getOutputNode();\n while (aggTreeNode != null && aggTreeNode.getNodeType() != NodeType.AGGREGATE) {\n aggTreeNode = aggTreeNode.getOutputNode();\n }\n if (null != aggTreeNode) {\n if (aggTreeNode instanceof FoldTreeNode) {\n TreeNode inputTreeNode = UnaryTreeNode.class.cast(aggTreeNode).getInputNode();\n if (inputTreeNode == orderTreeNode) {\n return;\n }\n UnaryTreeNode inputUnaryTreeNode = UnaryTreeNode.class.cast(inputTreeNode);\n if (inputUnaryTreeNode.getInputNode() == orderTreeNode &&\n (inputUnaryTreeNode instanceof EdgeVertexTreeNode &&\n EdgeVertexTreeNode.class.cast(inputUnaryTreeNode).getDirection() != Direction.BOTH)) {\n return;\n }\n String orderLabel = orderGlobalTreeNode.enableOrderFlag(labelManager);\n SelectOneTreeNode selectOneTreeNode = new SelectOneTreeNode(new SourceDelegateNode(inputUnaryTreeNode, schema), orderLabel, Pop.last, Lists.newArrayList(), schema);\n selectOneTreeNode.setConstantValueType(new ValueValueType(Message.VariantType.VT_INTEGER));\n OrderGlobalTreeNode addOrderTreeNode = new OrderGlobalTreeNode(inputUnaryTreeNode, schema,\n Lists.newArrayList(Pair.of(selectOneTreeNode, Order.incr)));\n UnaryTreeNode.class.cast(aggTreeNode).setInputNode(addOrderTreeNode);\n }\n } else {\n if (treeLeaf instanceof OrderGlobalTreeNode) {\n return;\n }\n TreeNode currTreeNode = orderTreeNode.getOutputNode();\n boolean hasSimpleShuffle = false;\n while (currTreeNode != null) {\n if (currTreeNode.getNodeType() == NodeType.FLATMAP\n || (currTreeNode instanceof PropertyNode &&\n !(UnaryTreeNode.class.cast(currTreeNode).getInputNode().getOutputValueType() instanceof EdgeValueType))) {\n hasSimpleShuffle = true;\n break;\n }\n currTreeNode = currTreeNode.getOutputNode();\n }\n if (!hasSimpleShuffle) {\n return;\n }\n\n UnaryTreeNode outputTreeNode = UnaryTreeNode.class.cast(treeLeaf);\n if (outputTreeNode.getInputNode() == orderTreeNode) {\n if (outputTreeNode instanceof EdgeVertexTreeNode &&\n EdgeVertexTreeNode.class.cast(outputTreeNode).getDirection() != Direction.BOTH) {\n return;\n }\n if (orderTreeNode.getOutputValueType() instanceof EdgeValueType && outputTreeNode instanceof PropertyNode) {\n return;\n }\n }\n String orderLabel = orderGlobalTreeNode.enableOrderFlag(labelManager);\n SelectOneTreeNode selectOneTreeNode = new SelectOneTreeNode(new SourceDelegateNode(treeLeaf, schema), orderLabel, Pop.last, Lists.newArrayList(), schema);\n selectOneTreeNode.setConstantValueType(new ValueValueType(Message.VariantType.VT_INTEGER));\n treeLeaf = new OrderGlobalTreeNode(treeLeaf, schema,\n Lists.newArrayList(Pair.of(selectOneTreeNode, Order.incr)));\n }\n }\n }", "private boolean checkAction() {\n if (nodes == null || nodes.length > 1) {\r\n return false;\r\n }\r\n // No parent\r\n if (nodes == null || nodes.length != 1) {\r\n JOptionPane.showMessageDialog(JZVNode.this, bundle\r\n .getString(\"dlg.error.updateWithoutParent\"),\r\n bundle.getString(\"dlg.error.title\"),\r\n JOptionPane.ERROR_MESSAGE);\r\n return false;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic void queuingFunc(TreeNode[] expandedNodes) {\n\n\t}", "public void RecursiveExpansion() throws TreeTooBigException {\r\n int transIndex; //Index to count transitions\r\n int[] newMarkup; //markup used to create new node\r\n boolean aTransitionIsEnabled = false; //To check for deadlock\r\n //Attribute used for assessing whether a node has occured before\r\n boolean repeatedNode = false; \r\n \r\n boolean allOmegas = false;\r\n \r\n boolean[] enabledTransitions = \r\n tree.dataLayer.getTransitionEnabledStatusArray(markup);\r\n\r\n //For each transition\r\n for (int i = 0; i < enabledTransitions.length; i++) {\r\n if (enabledTransitions[i] == true) {\r\n //Set transArray of to true for this index\r\n transArray[i] = true;\r\n \r\n //System.out.println(\"\\n Transition \" + i + \" Enabled\" );\r\n aTransitionIsEnabled = true;\r\n \r\n //print (\"\\n Old Markup is :\", markup);//debug\r\n \r\n //Fire transition to produce new markup vector\r\n newMarkup = fire(i);\r\n \r\n //print (\"\\n New Markup is :\", newMarkup);//debug\r\n \r\n //Check for safeness. If any of places have > 1 token set variable.\r\n for (int j = 0; j < newMarkup.length; j++) {\r\n if (newMarkup[j] > 1 || newMarkup[j] == -1) {\r\n tree.moreThanOneToken = true;\r\n break;\r\n }\r\n } \r\n \r\n //Create a new node using the new markup vector and attach it to\r\n //the current node as a child.\r\n children[i] = \r\n new myNode(newMarkup, this, tree, depth + 1);\r\n \r\n /* Now need to (a) check if any omegas (represented by -1) need to \r\n * be inserted in the markup vector of the new node, and (b) if the \r\n * resulting markup vector has appeared anywhere else in the tree. \r\n * We must do (a) before (b) as we need to know if the new node \r\n * contains any omegas to be able to compare it with existing nodes. \r\n */ \r\n allOmegas = children[i].InsertOmegas();\r\n \r\n //check if the resulting markup vector has occured anywhere else in the tree\r\n repeatedNode = (tree.root).FindMarkup(children[i]);\r\n \r\n if (tree.nodeCount >= Pipe.MAX_NODES && !tree.tooBig) {\r\n tree.tooBig = true;\r\n throw new TreeTooBigException();\r\n }\r\n \r\n if (!repeatedNode && !allOmegas) {\r\n children[i].RecursiveExpansion();\r\n }\r\n }\r\n }\r\n \r\n if (!aTransitionIsEnabled) {\r\n System.err.println(\"No transition enabled\");\r\n if (!tree.noEnabledTransitions || tree.pathToDeadlock.length < depth-1) {\r\n RecordDeadlockPath();\r\n tree.noEnabledTransitions = true;\r\n } else {\r\n System.err.println(\"Deadlocked node found, but path is not shorter\"\r\n + \" than current path.\");\r\n }\r\n } else {\r\n //System.out.println(\"Transitions enabled.\");\r\n }\r\n }", "private void expandTree() {\n tree.expand();\n }", "void getNodes(List<Node> lNode, List<Node> lSelNode, List<Node> lExistNode, boolean blank) {\n\n switch (type()) {\n\n case FILTER:\n // get exists {} nodes\n // draft\n getExistNodes(getFilter().getExp(), lExistNode);\n break;\n\n case NODE:\n add(lNode, getNode(), blank);\n break;\n\n case EDGE:\n case PATH:\n case XPATH:\n case EVAL:\n for (int i = 0; i < nbNode(); i++) {\n Node node = getNode(i);\n add(lNode, node, blank);\n }\n break;\n\n case ACCEPT:\n //use case: join() check connection, need all variables\n add(lNode, getNode());\n break;\n\n case VALUES:\n for (Node var : getNodeList()) {\n add(lNode, var);\n }\n break;\n\n case MINUS:\n // second argument does not bind anything: skip it\n if (first() != null) {\n first().getNodes(lNode, lSelNode, lExistNode, blank);\n }\n break;\n\n case BIND:\n add(lSelNode, getNode());\n break;\n\n case QUERY:\n\n // use case: select * where { {select ?y fun() as ?var where {}} }\n // we want ?y & ?var for select *\t\t\t\n for (Exp ee : getQuery().getSelectFun()) {\n add(lSelNode, ee.getNode());\n }\n break;\n\n default:\n for (Exp ee : this) {\n ee.getNodes(lNode, lSelNode, lExistNode, blank);\n }\n }\n\n }", "public void treeSelection() {\n\t\tFlowTreeNode ftn = (FlowTreeNode) tree.getLastSelectedPathComponent();\n\n\t\tif (ftn == null)\n\t\t\treturn;\n\t\telse\n\n\t\t{\n\n\t\t\tftn.execute();\n\t\t\tthis.revalidate();\n\t\t\t// buildTreeView();\n\n\t\t}\n\t}", "@And(\"the number of children option is selected as none\")\r\n public void selectNoOfChildren(){\n }", "void updateTreeSelection() {\n\n TreePath[] selections = tree.getSelectionPaths();\n currentSelectedPaths.clear();\n if (selections != null) {\n for (TreePath selection : selections) {\n currentSelectedPaths.add(selection);\n }\n }\n if ((selections == null) || (selections.length == 0)) {\n farmStatistics.setEnabled(false);\n linkStatistics.setEnabled(false);\n synchronized (basicPanel.getClusterPanel().getTreeLock()) {\n basicPanel.getClusterPanel().updateClusters(new Vector(), new Hashtable());\n }\n synchronized (basicPanel.getValPanel().getTreeLock()) {\n basicPanel.getValPanel().updateValues(new Vector());\n }\n synchronized (basicPanel.getModPanel().getTreeLock()) {\n basicPanel.getModPanel().updateList(new Vector());\n }\n return;\n }\n if ((selections.length == 1)\n && (((DefaultMutableTreeNode) selections[0].getLastPathComponent()).getUserObject() instanceof rcNode)) {\n farmStatistics.setEnabled(canShowFarmStatistics());\n linkStatistics.setEnabled(canShowLinkStatistics());\n } else {\n farmStatistics.setEnabled(false);\n linkStatistics.setEnabled(false);\n }\n Object[] userSel = new Object[selections.length];\n selectedGroups.clear();\n for (int j = 0; j < selections.length; j++) {\n userSel[j] = ((DefaultMutableTreeNode) selections[j].getLastPathComponent()).getUserObject();\n if (userSel[j] instanceof String) { // group selected\n selectedGroups.add(userSel[j]);\n DefaultMutableTreeNode groupNode = ((DefaultMutableTreeNode) selections[j].getLastPathComponent());\n for (int i = 0; i < treeModel.getChildCount(groupNode); i++) {\n tree.addSelectionPath(selections[j].pathByAddingChild(treeModel.getChild(groupNode, i)));\n }\n }\n }\n\n // update the parameters window to show only common parameters\n updateParamAndModPanels(userSel);\n }", "public boolean isSelectorNeeded() {\n if (!m_selectChecked) {\n if (m_selectorType != NestingCustomBase.SELECTION_UNCHECKED) {\n \n // before reporting selector needed, make sure at least once child is going to be present\n for (int i = 0; i < m_values.size(); i++) {\n DataNode node = (DataNode)m_values.get(i);\n if (!node.isIgnored()) {\n m_selectNeeded = true;\n break;\n }\n }\n \n }\n m_selectChecked = true;\n }\n return m_selectNeeded;\n }", "boolean applicable(Selection selection);", "public static void check6 (IR.Node node){\n if (node == null) return; \n if (node instanceof Expr){\n String ret = ((Expr)node).getType(); \n }\n \n List <IR.Node> children = node.getChildren(); \n if (children == null) return; \n\n for (int child=0; child<children.size(); child++){\n check6 (children.get(child)); \n }\n }", "public void expandSelection(boolean use_digraph) {\n RenderContext myrc = (RenderContext) rc; if (myrc == null) return;\n Set<String> sel = myrc.filterEntities(getRTParent().getSelectedEntities()),\n new_sel = new HashSet<String>();\n MyGraph to_use = (use_digraph) ? digraph : graph;\n if (sel != null && sel.size() > 0) {\n Iterator<String> it = sel.iterator();\n\twhile (it.hasNext()) {\n\t String entity = it.next();\n\t new_sel.add(entity);\n\t int entity_i = to_use.getEntityIndex(entity);\n\t for (int i=0;i<to_use.getNumberOfNeighbors(entity_i);i++) {\n String nbor = to_use.getEntityDescription(to_use.getNeighbor(entity_i, i));\n if (myrc.visible_entities.contains(nbor)) new_sel.add(nbor);\n\t }\n\t}\n }\n getRTParent().setSelectedEntities(new_sel);\n repaint();\n }", "public boolean isExpanded();", "public void sanityCheckNumNodes() {\n\t\tint sanity = viewedPos.sanityCheckGetNumberOfNodes();\n\t\tif(sanity != numPosRecorded) {\n\t\t\tSystem.err.println(\"ERROR: the number of nodes in the tree is not equal to the number of nodes added. #Added: \" + numPosRecorded + \" number received: \" + sanity);\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "private void expandTree() {\n for (int i=0; i<tree.getRowCount(); i++) {\n tree.expandRow(i);\n }\n }", "private boolean cycleCheck(Node current, Queue<Node> expanded){\n\n if( expanded.size() == 0){\n return false; //Because current is root\n }\n\n for(Node nodeInExpanded : expanded){\n\n if(current!=null && current.getDigit().getDigitString().equals(nodeInExpanded.getDigit().getDigitString())){\n //the digits are same so we check children.\n\n ArrayList<String> currentChildren = makeChildren(current);\n ArrayList<String> childrenOfExpanded = makeChildren(nodeInExpanded);\n\n int size;\n\n if(currentChildren.size() > childrenOfExpanded.size() ){\n size = childrenOfExpanded.size();\n }else if(currentChildren.size() < childrenOfExpanded.size()){\n size = currentChildren.size();\n }else{\n size = childrenOfExpanded.size();\n }\n /*\n I use the modulus operator so that I dont get a ArrayIndexOut of Bounds\n */\n\n if( currentChildren.size() == childrenOfExpanded.size()\n && currentChildren.get(0%size).equals(childrenOfExpanded.get(0%size))\n && currentChildren.get(1%size).equals(childrenOfExpanded.get(1%size))\n && currentChildren.get(2%size).equals(childrenOfExpanded.get(2%size))\n && currentChildren.get(3%size).equals(childrenOfExpanded.get(3%size))\n ){\n return true;\n }\n }\n }\n\n return false;\n }", "private void checkAtLeastOneRuleIsSelected() {\n\t\tsufficientRulesSelected = false;\n\t\tint checked = 0;\n\t\tControl[] controlArray = rulesGroup.getChildren();\n\n\t\tfor (Control elem : controlArray) {\n\t\t\tif (elem instanceof Button) {\n\t\t\t\tif (((Button) elem).getSelection()) {\n\t\t\t\t\tchecked++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (checked >= 1)\n\t\t\tsufficientRulesSelected = true;\n\t\tupdateFinishButton();\n\t}", "public static Iterable<SNode> sourceNodesQuery_72_10(final SourceSubstituteMacroNodesContext _context) {\n return Sequence.fromIterable(((Iterable<SNode>) _context.getVariable(\"var:menusAndContributionsForConcept\"))).where((it) -> it == _context.getNode() || (SNodeOperations.isInstanceOf(it, CONCEPTS.TransformationMenuContribution$jD) && SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(SNodeOperations.cast(it, CONCEPTS.TransformationMenuContribution$jD), LINKS.menuReference$uYXm), CONCEPTS.TransformationMenuReference_Named$rf), LINKS.menu$8pZB) == _context.getNode()));\n }", "public boolean validate(){\r\n \r\n // in some case, validate() may be called twice\r\n // hence clear the stack\r\n stack.clear();\r\n \r\n\t\tcollect();\r\n\t\r\n\t\tif (getBody()!=null){\r\n\t\t\t// select ?x\r\n\t\t\tfor (Variable var : getSelectVar()){\r\n\t\t\t\tif (hasExpression(var)){\r\n\t\t\t\t\tbind(var);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// select *\r\n\t\t\tif (isSelectAll()){\r\n\t\t\t\tfor (Variable var : getSelectAllVar()){\r\n\t\t\t\t\tif (hasExpression(var)){\r\n\t\t\t\t\t\tbind(var);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\tboolean ok = true;\r\n\t\t\t\r\n\t\t\tfor (Exp exp : getBody().getBody()){\r\n\t\t\t\tboolean b = exp.validate(this);\r\n\t\t\t\tif (! b){\r\n\t \t\t\tok = false;\r\n\t \t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn ok;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public boolean selected(int row){\n if (root == null) {\n compile();\n }\n return root.eval(row);\n }", "public void checkTree() {\r\n checkTreeFromNode(treeRoot);\r\n }", "private void evaluateNode(final Node expansionCandidate) {\n\t\tif (this.extraDebug)\n\t\t\tSystem.out.print(\" { \");\n\t\tTile tile = expansionCandidate.getTile();\n\t\tNodeValue nodeValue = expansionCandidate.getValue();\n\n\t\tfloat risk = 0;\n\t\tfloat pathCost = 0;\n\t\tfloat distanceCost = 0;\n\n\t\tif (this.goal.useRisk) {\n\t\t\tif (tile.getTileType() == TileType.UNKNOWN) {\n\t\t\t\tfor (TileType type : tile.getPossibleTypes()) {\n\t\t\t\t\tif (type == TileType.WALL) {\n\t\t\t\t\t\tif (this.extraDebug)\n\t\t\t\t\t\t\tSystem.out.print(\"posWall+\" + this.searchValues.getWall());\n\t\t\t\t\t\trisk += this.searchValues.getWall();\n\t\t\t\t\t} else if (type == TileType.PIT) {\n\t\t\t\t\t\tif (this.extraDebug)\n\t\t\t\t\t\t\tSystem.out.print(\" posPit+\" + this.searchValues.getPit());\n\t\t\t\t\t\trisk += this.searchValues.getPit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tile.getWumpusIds() != null && !tile.getWumpusIds().isEmpty()) {\n\t\t\t\tfloat wumpusRisk = 0;\n\t\t\t\tfor (int id : tile.getWumpusIds()) {\n\t\t\t\t\tSystem.out.println(\" id: \" + id + \" has distance: \" + tile.getWumpusDistance(id) + \" \");\n\t\t\t\t\tif (tile.getWumpusDistance(id) != 0) {\n\t\t\t\t\t\tif (this.extraDebug)\n\t\t\t\t\t\t\tSystem.out.print(\n\t\t\t\t\t\t\t\t\t\" wumpi+\" + this.searchValues.getWumpusDistanceFac() / tile.getWumpusDistance(id));\n\n\t\t\t\t\t\tif (tile.getWumpusDistance(id) > wumpusRisk) {\n\t\t\t\t\t\t\twumpusRisk = tile.getWumpusDistance(id);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\trisk += this.searchValues.getWumpusDistanceFac() / wumpusRisk;\n\t\t\t}\n\t\t\tif (this.state.getHistoryStench(tile.getPosVector()) != 0) {\n\t\t\t\tif (this.extraDebug)\n\t\t\t\t\tSystem.out.print(\" historyWumpi+\" + this.searchValues.getWumpusDistanceFac()\n\t\t\t\t\t\t\t/ this.state.getHistoryStench(tile.getPosVector()));\n\t\t\t\trisk += this.searchValues.getWumpusDistanceFac() / this.state.getHistoryStench(tile.getPosVector()) / 2;\n\t\t\t}\n\t\t}\n\n\t\tif (this.goal.usePathCost) {\n\t\t\tpathCost = nodeValue.getPathCost() + expansionCandidate.getParentNode().getValue().getPathCost() + 1;\n\t\t}\n\n\t\tif (this.goal.useDistanceCost) {\n\t\t\tVector2 goalLoc = ((GoalLocation) this.goal).getLocation(); // TODO: Dont like this cast here\n\t\t\tdistanceCost = Math.abs(goalLoc.getX() - expansionCandidate.getTile().getPosX())\n\t\t\t\t\t+ Math.abs(goalLoc.getY() - expansionCandidate.getTile().getPosY());\n\n\t\t\tif (tile.getTileType() == TileType.UNKNOWN) {\n\t\t\t\tpathCost += this.searchValues.getUnknown();\n\t\t\t}\n\t\t}\n\n\t\tnodeValue.setRisk(risk);\n\t\tnodeValue.setPathCost(pathCost);\n\t\tnodeValue.setDistanceCost(distanceCost);\n\t\tif (this.extraDebug)\n\t\t\tSystem.out.println(\" } \");\n\t}", "public abstract List<Node> expand();", "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}", "private void printExpanded(Queue<Node> expanded){\n\n ArrayList<String> nodes = new ArrayList<>();\n\n for(Node s : expanded){\n if(s != null){\n nodes.add(s.getDigit().getDigitString());\n }\n }\n\n\n if (forbidden.size() == 0){\n\n int size = nodes.size();\n int index = 0;\n\n for(int m=0; m<size; m++){\n if(index == size - 1){\n\n System.out.print(nodes.get(index));\n break;\n }\n\n System.out.print(nodes.get(index)+\",\");\n index++;\n }\n }else{\n\n nodes.removeAll(forbidden);\n int size = nodes.size();\n int index = 0;\n\n for(int m=0; m<size; m++){\n if(index == size - 1){\n\n System.out.print(nodes.get(index));\n break;\n }\n\n System.out.print(nodes.get(index)+\",\");\n index++;\n }\n }\n }", "public List<NodeExpansionDescription<T, A>> nextExpansion() {\r\n\t\tif (!this.initialized) {\r\n\t\t\ttry {\r\n\t\t\t\tinitGraph();\r\n\t\t\t} catch (Throwable e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\treturn lastExpansion;\r\n\t\t} else\r\n\t\t\tstep();\r\n\t\treturn lastExpansion;\r\n\t}", "public boolean isExpandable();", "@Test\n public void testExpandTree() {\n // TODO: test ExpandTree\n }", "@Override \n public boolean shouldTraverse(Traversal traversal, Exp e, Exp parent) {\n return true; \n }", "@Test(groups = { \"tree\" })\n\tpublic void testLoadRemoteDSWithInitExpand() throws Exception {\n\t\tstartupTest(\"treeLoadRemoteDSWithInitExpand.html\",null);\n\n\t\t//Verify the url\n\t\tString url = getBrowserUrl();\n\t\tlog(\"URL##########\"+ url);\n\n\t\t// Verify if the title of the page is correct\n\t\tverifyTitle(\"Incorrect page title;\", TITLE_REMOTEDS);\n\t\tcheckPageContent(TITLE_REMOTEDS);\n\n\t\tcommonLoadTestForJson();\n\n\t\t//Make sure we check on init expanded objects\n\n\t\tWebElement refsAll = getElement(\"{\\\"element\\\":\\\"#tree\\\",\\\"subId\\\":\\\"oj-tree-node['#refsall']['title']\\\"}\");\n\n\t\tWebElement refsUSA = getElement(\"{\\\"element\\\":\\\"#tree\\\",\\\"subId\\\":\\\"oj-tree-node['#refsusa']['title']\\\"}\");\n\n\t\tWebElement refsEurope = getElement(\"{\\\"element\\\":\\\"#tree\\\",\\\"subId\\\":\\\"oj-tree-node['#refseurope']['title']\\\"}\");\n\n\t\tWebElement supgold = getElement(\"{\\\"element\\\":\\\"#tree\\\",\\\"subId\\\":\\\"oj-tree-node['#supgold']['title']\\\"}\");\n\n\t\tWebElement supsilver = getElement(\"{\\\"element\\\":\\\"#tree\\\",\\\"subId\\\":\\\"oj-tree-node['#supsilver']['title']\\\"}\");\n\n\n\n }", "public static Iterable<SNode> sourceNodesQuery_72_15(final SourceSubstituteMacroNodesContext _context) {\n return Sequence.fromIterable(((Iterable<SNode>) _context.getVariable(\"var:menusAndContributionsForConcept\"))).where((it) -> {\n return it == _context.getNode() || (SNodeOperations.isInstanceOf(it, CONCEPTS.SubstituteMenu_Contribution$s3) && SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(SNodeOperations.cast(it, CONCEPTS.SubstituteMenu_Contribution$s3), LINKS.menuReference$MNaS), CONCEPTS.SubstituteMenuReference_Named$5O), LINKS.menu$9WHp) == _context.getNode());\n\n });\n }", "private void pressedSelect(MouseEvent e) {\r\n if (e.getModifiers() >= MouseEvent.BUTTON1_MASK) {\r\n /* Click on a node */\r\n if (graphX.nodesContains(e.getPoint())) {\r\n /* Resize the selected node */\r\n if (graphX.isOneNodeSelected() && !ctrlPressed\r\n && graphX.getSelectedNode().getResizeRectangle().contains(e.getPoint())) {\r\n NodeX nodeX = graphX.getSelectedNode();\r\n nodeX.setResize(true);\r\n nodeX.setState(true);\r\n nodeX.setRelativePosition(e.getPoint());\r\n }\r\n /* Click to resize a node */\r\n else if (graphX.getNode(e.getPoint()).getResizeRectangle().contains(e.getPoint()) && !ctrlPressed) {\r\n /* Put the node over the others */\r\n graphX.selectNode(e.getPoint());\r\n\r\n graphX.deselectAll();\r\n graphX.getNode(e.getPoint()).setResize(true);\r\n graphX.getNode(e.getPoint()).setState(true);\r\n graphX.getNode(e.getPoint()).setRelativePosition(e.getPoint());\r\n\r\n selectTool.setMultiple(false);\r\n selectTool.reset();\r\n }\r\n /* Click to move (select) a node or mode nodes */\r\n else {\r\n NodeX nodeX;\r\n if ((nodeX = graphX.getNode(e.getPoint())) != null) {\r\n if (ctrlPressed == false && nodeX.getState() == false) {\r\n graphX.deselectAll();\r\n }\r\n /* Deselect the node */\r\n if (ctrlPressed == true && nodeX.getState() == true) {\r\n graphX.deselectNode(nodeX);\r\n graphX.selectEdgesFromNodes();\r\n }\r\n /* Select the node */\r\n else {\r\n // graphX.deselectEdges();\r\n graphX.selectNode(nodeX);\r\n graphX.selectEdgesFromNodes();\r\n }\r\n\r\n /* Set the relative position at the selected nodes */\r\n for (int i = 0; i < graphX.nodesNumber(); i++) {\r\n if (graphX.nodeAt(i).getState()) {\r\n moveingGraph = true;\r\n graphX.nodeAt(i).setRelativePositionTo(e.getPoint());\r\n }\r\n }\r\n for (int i = 0; i < graphX.edgesNumber(); i++) {\r\n if (graphX.edgeAt(i).getState()) {\r\n graphX.edgeAt(i).setRelativePositionsTo(e.getPoint());\r\n }\r\n }\r\n\r\n dragMultiple = false;\r\n }\r\n }\r\n }\r\n /* Click on an edge */\r\n else if ((graphX.edgesContains(e.getPoint(), graph instanceof GraphOriented)\r\n || graphX.overSplitPoints(e.getPoint()) || edgeFromLabel(e.getPoint()) != null)\r\n && ctrlPressed == false) {\r\n deleteWays();\r\n\r\n EdgeX edgeX = graphX.getEdge(e.getPoint());\r\n if (edgeX != null) {\r\n graphX.deselectAll();\r\n edgeX.setState(true);\r\n } else {\r\n try {\r\n edgeX = edgeFromLabel(e.getPoint());\r\n graphX.deselectAll();\r\n edgeX.setState(true);\r\n } catch (NullPointerException e1) {\r\n }\r\n }\r\n // /* Set the split point if pressed on it */\r\n // graphX.getSelectedEdge().selectSplitPoint(e.getPoint());\r\n }\r\n /* Click on background */\r\n else {\r\n selectTool.setMultiple(true);\r\n selectTool.setFirstPoint(e.getPoint());\r\n /* Deselect all the nodes and edges */\r\n if (ctrlPressed == false) {\r\n graphX.deselectAll();\r\n /* Delete the ways */\r\n deleteWays();\r\n }\r\n }\r\n } else if (e.getModifiers() >= MouseEvent.BUTTON3_MASK) {\r\n NodeX nodeX = graphX.getNode(e.getPoint());\r\n EdgeX edgeX = graphX.getEdge(e.getPoint());\r\n\r\n if (nodeX != null) {\r\n itemType = NODE;\r\n\r\n /* Select the node */\r\n graphX.deselectAll();\r\n nodeX.setState(true);\r\n\r\n nodePopupMenu.show(this, e.getPoint().x, e.getPoint().y);\r\n } else if (edgeX != null) {\r\n /* Select the edge */\r\n graphX.deselectAll();\r\n edgeX.setState(true);\r\n\r\n if (ctrlPressed) {\r\n edgeX.deleteSplitPoint(e.getPoint());\r\n } else {\r\n itemType = EDGE;\r\n edgePopupMenu.show(this, e.getPoint().x, e.getPoint().y);\r\n splitPointLocation = e.getPoint();\r\n }\r\n\r\n // System.out.println(edgePopupMenu);\r\n // if(ctrlPressed) {\r\n // edgeX.deleteSplitPoint(e.getPoint());\r\n // }\r\n // else {\r\n // edgeX.addSplitPoint(e.getPoint());\r\n // }\r\n }\r\n }\r\n }", "public boolean isExpandable() {\n return term.isExpandable();\n }", "public void run() {\n List<Node> selNodes = new ArrayList<Node>(selectedPaths.size());\n\n for (Object path : selectedPaths) {\n selNodes.add(findPath(root, (String[]) path));\n }\n\n // set the selection\n Node[] newSelection = selNodes.toArray(new Node[selNodes.size()]);\n\n if (exploredCtx != null) {\n setExploredContext(findPath(root, exploredCtx), newSelection);\n } else {\n setSelectedNodes0(newSelection);\n }\n }", "@Step(\"There are the following elements on Different Elements page: 4 checkboxes, 4 radios, 1 dropdown, 2 buttons\")\n public void checkElements() {\n checkboxes.shouldHaveSize(4);\n radios.shouldHaveSize(4);\n dropdown.shouldBe(Condition.exist);\n buttons.shouldHaveSize(2);\n }", "public boolean isExpand(){\n return this == EXPAND;\n }", "void checkTrees(Box tree);", "void doMcTree() throws NotConnectedException, NotSuspendedException, NoResponseException\n\t{\n\t\t/* wait a bit if we are not halted */\n\t\twaitTilHalted();\n\t\ttry\n\t\t{\n\t\t\tString var = nextToken(); // our variable reference\n\t\t\tString member = \"_target\"; //$NON-NLS-1$\n\t\t\tboolean printPath = false;\n\t\t\tObject result = null;\n\t\t\tString name = null;\n\n\t\t\t// did the user specify a member name\n\t\t\tif (hasMoreTokens())\n\t\t\t{\n\t\t\t\tmember = nextToken();\n\n\t\t\t\t// did they specify some other options\n\t\t\t\twhile(hasMoreTokens())\n\t\t\t\t{\n\t\t\t\t\tString option = nextToken();\n\t\t\t\t\tif (option.equalsIgnoreCase(\"fullpath\")) //$NON-NLS-1$\n\t\t\t\t\t\tprintPath = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// first parse it, then attempt to evaluate the expression\n\t\t\tValueExp expr = parseExpression(var);\n\t\t\tresult = evalExpression(expr).value;\n\n\t\t\tStringBuilder sb = new StringBuilder();\n\n\t\t\tif (result instanceof Variable)\n\t\t\t{\n\t\t\t\tname = ((Variable)result).getName();\n\t\t\t\tresult = ((Variable)result).getValue();\n\t\t\t}\n\n\t\t\t// It worked an should now be a value that we can traverse looking for member properties\n\n\t\t\tif (result instanceof Value)\n\t\t\t{\n\t\t\t\tArrayList<Object> e = new ArrayList<Object>();\n\t\t\t\tdumpTree(new HashMap<Object, String>(), e, name, (Value)result, member);\n\n\t\t\t\t// now sort according to our criteria\n\t\t\t\ttreeResults(sb, e, member, printPath);\n\t\t\t}\n\t\t\telse\n\t\t\t\tthrow new NoSuchVariableException(result);\n\n\t\t\tout( sb.toString() );\n\t\t}\n\t\tcatch(NoSuchVariableException nsv)\n\t\t{\n\t\t\tMap<String, Object> args = new HashMap<String, Object>();\n\t\t\targs.put(\"variable\", nsv.getMessage()); //$NON-NLS-1$\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"variableUnknown\", args)); //$NON-NLS-1$\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"couldNotEvaluate\")); //$NON-NLS-1$\n\t\t}\n\t}", "public static void check18 (IR.Node node){\n if (node == null) return; \n if (node instanceof AssignmentStatement){\n if ((((AssignmentStatement)node).assignExpr) != null){\n String s1 = ((AssignmentStatement)node).loc.getType(); \n String s2 = ((AssignmentStatement)node).assignExpr.getType();\n if (!(s1.equals(\"any\") || s2.equals(\"any\"))){\n if (!(((AssignmentStatement)node).loc.getType().equals(((AssignmentStatement)node).assignExpr.getType()))){\n throw new IllegalStateException (\"Bad assignment.\"); \n }\n }\n\n }\n if ((((AssignmentStatement)node).op.type == Op.Type.minusequals) || (((AssignmentStatement)node).op.type == Op.Type.plusequals)){\n String s1 = ((AssignmentStatement)node).loc.getType(); \n String s2 = ((AssignmentStatement)node).assignExpr.getType();\n if (!(s1.equals(\"any\") || s2.equals(\"any\"))){\n if (!(((AssignmentStatement)node).loc.getType().equals(\"int\"))){\n throw new IllegalStateException (\"Bad assignment.\"); \n }\n if (!(((AssignmentStatement)node).assignExpr.getType().equals(\"int\"))){\n throw new IllegalStateException (\"Bad assignment.\"); \n }\n }\n }\n if ((((AssignmentStatement)node).op.type == Op.Type.increment) || (((AssignmentStatement)node).op.type == Op.Type.decrement)){\n if (!(((AssignmentStatement)node).loc.getType().equals(\"int\"))){\n if (!(((AssignmentStatement)node).loc.getType().equals(\"any\"))){\n throw new IllegalStateException (\"Bad assignment.\");\n } \n }\n }\n }\n if (node instanceof ForStatement){\n if (((ForStatement)node).initLoc == null || ((ForStatement)node).initExpr == null){\n throw new IllegalStateException (\"Bad assignment.\"); \n }\n if (!(((ForStatement)node).initLoc.getType().equals(((ForStatement)node).initExpr.getType()))){\n throw new IllegalStateException (\"Bad assignment.\"); \n } \n }\n List <IR.Node> children = node.getChildren(); \n if (children == null) return; \n\n for (int child=0; child<children.size(); child++){\n check18 (children.get(child)); \n }\n }", "boolean hasTreeNodeIdForVariantMatrix();", "@Override\n\t\t\t\tpublic void treeCollapsed(TreeExpansionEvent arg0) {\n\t\t\t\t}", "public void treeExpanded(TreeExpansionEvent e) {\n saySomething(\"Tree-expanded event detected\", e);\n }", "private void parseSome(Node node) {\r\n if (switchTest) return;\r\n parse(node.left());\r\n if (! ok) return;\r\n int saveIn = in;\r\n while (ok) {\r\n saveIn = in;\r\n parse(node.left());\r\n }\r\n if (! ok && in == saveIn) ok = true;\r\n }", "@Override\n\t\t\tpublic boolean checkPreconditions(){\n\t\t\t\treturn topLevelCheckbox.getSelection();\n\t\t\t}", "@Override\n\t\t\tpublic boolean checkPreconditions(){\n\t\t\t\treturn topLevelCheckbox.getSelection();\n\t\t\t}", "@Override\n\t\t\tpublic boolean checkPreconditions(){\n\t\t\t\treturn topLevelCheckbox.getSelection();\n\t\t\t}", "public boolean containsContextNodes();", "public void validateSelection()\r\n {\r\n for (int i = 0; i<getSelectedElements().size(); ++i)\r\n {\r\n ReportElement re = (ReportElement)getSelectedElements().elementAt(i);\r\n if (!getCrosstabElement().getElements().contains( re ))\r\n {\r\n getSelectedElements().remove(re);\r\n --i;\r\n }\r\n }\r\n // UPDATE SELECTION NOW!!!\r\n }", "public void selectionChanged(IWorkbenchPart sourcepart, ISelection selection) {\n\t\t\tif (sourcepart != ComponentsTree.this && \n\t\t\t\t\tsourcepart != null \n\t\t\t\t\t&& sourcepart.getSite() != null\n\t\t\t\t\t&& sourcepart.getSite().getId()!= null\n\t\t\t\t\t&& sourcepart.getSite().getId().equals(Constants.VIEW_MODELEXPLORER)) {\n\t\t\t\t\n\t\t\t\tEObject selectedElement = null;\n\t \tif (getCurrentSelections() != null && getCurrentSelections().size() > 0 ) {\n\t\t\t\t\tselectedElement = (EObject) adaptSelectedElement(getCurrentSelections().get(0));\n\t\t\t\t}\n\t \t\n\t \t/*\n\t \t * avoid the case the the view provides its own selection and re-builds the tree again.\n\t \t */\n\n\t \tif (selectedElement instanceof Class \n\t \t\t\t&& isValid((Class) selectedElement)\n\t \t\t\t&& !selectedElement.equals(selectedClass)) {\n\n\t \t\tif (actionLinkWithEditor.isChecked()) {\n\t\t\t\t\t\tshowSelection(sourcepart, selection);\n\t\t\t\t\t\tviewer.expandToLevel(DEFAULT_EXPAND_LEVEL);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void treeWillExpand(TreeExpansionEvent e)\n throws ExpandVetoException {\n saySomething(\"Tree-will-expand event detected\", e);\n int n = JOptionPane.showOptionDialog(this, willExpandText,\n willExpandTitle, JOptionPane.YES_NO_OPTION,\n JOptionPane.QUESTION_MESSAGE, null, willExpandOptions,\n willExpandOptions[1]);\n if (n == 0) {\n //User said cancel expansion.\n saySomething(\"Tree expansion cancelled\", e);\n throw new ExpandVetoException(e);\n }\n }", "private void resortAndReselectTreeGrid() {\n resortAndReselectTreeGrid(null);\n }", "boolean hasIsNodeOf();", "protected void checkSelectGesture(GraphicsNodeEvent evt) {\n\n\t\tGraphicsNodeMouseEvent mevt = null;\n\t\tif (evt instanceof GraphicsNodeMouseEvent) {\n\t\t\tmevt = (GraphicsNodeMouseEvent) evt;\n\t\t}\n\n\t\tGraphicsNode source = evt.getGraphicsNode();\n\t\tif (isDeselectGesture(evt)) {\n\t\t\tif (selectionNode != null) {\n\t\t\t\tselectionNodeRoot.removeTreeGraphicsNodeChangeListener(this);\n\t\t\t}\n\t\t\tclearSelection();\n\t\t} else if (mevt != null) {\n\n\t\t\tPoint2D p = mevt.getPoint2D();\n\n\t\t\tif ((source instanceof Selectable) && (isSelectStartGesture(evt))) {\n\t\t\t\tif (selectionNode != source) {\n\t\t\t\t\tif (selectionNode != null) {\n\t\t\t\t\t\tselectionNodeRoot.removeTreeGraphicsNodeChangeListener(this);\n\t\t\t\t\t}\n\t\t\t\t\tselectionNode = source;\n\t\t\t\t\tif (source != null) {\n\t\t\t\t\t\tselectionNodeRoot = source.getRoot();\n\t\t\t\t\t\tselectionNodeRoot.addTreeGraphicsNodeChangeListener(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t((Selectable) source).selectAt(p.getX(), p.getY());\n\t\t\t\tdispatchSelectionEvent(new SelectionEvent(null, SelectionEvent.SELECTION_STARTED, null));\n\n\t\t\t} else if (isSelectEndGesture(evt)) {\n\t\t\t\tif (selectionNode == source) {\n\t\t\t\t\t((Selectable) source).selectTo(p.getX(), p.getY());\n\t\t\t\t}\n\t\t\t\tObject oldSelection = getSelection();\n\t\t\t\tif (selectionNode != null) {\n\t\t\t\t\tShape newShape;\n\t\t\t\t\tnewShape = ((Selectable) selectionNode).getHighlightShape();\n\t\t\t\t\tdispatchSelectionEvent(new SelectionEvent(oldSelection, SelectionEvent.SELECTION_DONE, newShape));\n\t\t\t\t}\n\t\t\t} else if (isSelectContinueGesture(evt)) {\n\n\t\t\t\tif (selectionNode == source) {\n\t\t\t\t\tboolean result = ((Selectable) source).selectTo(p.getX(), p.getY());\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\tShape newShape = ((Selectable) selectionNode).getHighlightShape();\n\n\t\t\t\t\t\tdispatchSelectionEvent(new SelectionEvent(null, SelectionEvent.SELECTION_CHANGED, newShape));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ((source instanceof Selectable) && (isSelectAllGesture(evt))) {\n\t\t\t\tif (selectionNode != source) {\n\t\t\t\t\tif (selectionNode != null) {\n\t\t\t\t\t\tselectionNodeRoot.removeTreeGraphicsNodeChangeListener(this);\n\t\t\t\t\t}\n\t\t\t\t\tselectionNode = source;\n\t\t\t\t\tif (source != null) {\n\t\t\t\t\t\tselectionNodeRoot = source.getRoot();\n\t\t\t\t\t\tselectionNodeRoot.addTreeGraphicsNodeChangeListener(this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t((Selectable) source).selectAll(p.getX(), p.getY());\n\t\t\t\tObject oldSelection = getSelection();\n\t\t\t\tShape newShape = ((Selectable) source).getHighlightShape();\n\t\t\t\tdispatchSelectionEvent(new SelectionEvent(oldSelection, SelectionEvent.SELECTION_DONE, newShape));\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic boolean canExecute(Collection<? extends EObject> selections) {\n\t\tfor (EObject eObject : selections) {\n\t\t\tif (!(eObject instanceof UnknowClass)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "boolean hasNode()\n/* */ {\n/* 473 */ if ((this.bn == null) && (this.mn == null)) return false;\n/* 474 */ if (this.jt == null) return false;\n/* 475 */ return true;\n/* */ }", "public boolean addToSelectedNodes(LeafNode leaf)\n\t{\n\t\tif(leaf == null)\n\t\t\tthrow new NullPointerException();\n\t\treturn selectionNode.add(leaf);\n\t}", "public void treeWillExpand(TreeExpansionEvent e) throws ExpandVetoException {\n TreePath path = e.getPath();\n if (!tree.hasBeenExpanded(path)) {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();\n if (sheet.isMBeanNode(node) && !tree.hasMetadataNodes(node)) {\n tree.addMetadataNodes(node);\n }\n }\n }", "public boolean setManagerSelection(Node[] nodes) {\n try{\n getExplorerManager().setSelectedNodes(nodes);\n } catch (PropertyVetoException e) {\n return false;\n } catch (IllegalArgumentException iae) {\n // see #140613\n LOGGER.log(Level.WARNING, \"Failed to select the given nodes.\", iae);\n return false;\n }\n return true;\n }", "@Test\r\n public void testNotificationIndicesOnCollapseItemWithSelectedChild_37366() {\r\n getView().setShowRoot(true);\r\n // select child of root\r\n int index = 3;\r\n getSelectionModel().select(index);\r\n ListChangeReport report = new ListChangeReport(getSelectedIndices());\r\n getRoot().setExpanded(false);\r\n assertEquals(1, report.getEventCount());\r\n }", "private void selectBranch () {\n \n TagsNode node = (TagsNode)tagsTree.getLastSelectedPathComponent();\n \n if (node == null) {\n // nothing selected\n }\n else\n if (node == position.getTagsNode()) {\n // If we're already positioned on the selected node, then no\n // need to do anything else (especially since it might set off\n // an endless loop).\n }\n else\n if (node.getNodeType() == TagsNode.ITEM) {\n // System.out.println (\"selectBranch selected item = \" + node.toString());\n boolean modOK = modIfChanged();\n if (modOK) {\n ClubEvent branch = (ClubEvent)node.getTaggable();\n int branchIndex = clubEventList.findByUniqueKey (branch);\n if (branchIndex >= 0) {\n position = clubEventList.positionUsingListIndex (branchIndex);\n position.setTagsNode (node);\n positionAndDisplay();\n } else {\n System.out.println (\"ClubPlanner.selectBranch\");\n System.out.println \n (\"-- Selected a branch from the tree that couldn't be found in the list\");\n System.out.println (\"-- node = \" + node.toString());\n System.out.println (\"-- event = \" + branch.getWhat());\n System.out.println (\"-- branch index = \" + String.valueOf(branchIndex));\n }\n }\n }\n else {\n // Do nothing until an item is selected\n // System.out.println (\"selectBranch selected node = \" + node.toString());\n }\n }", "public static Iterable<SNode> sourceNodesQuery_72_11(final SourceSubstituteMacroNodesContext _context) {\n return Sequence.fromIterable(((Iterable<SNode>) _context.getVariable(\"var:menusAndContributionsForConcept\"))).select((it) -> (SNodeOperations.isInstanceOf(it, CONCEPTS.TransformationMenuContribution$jD) ? SLinkOperations.getTarget(SNodeOperations.cast(SLinkOperations.getTarget(SNodeOperations.cast(it, CONCEPTS.TransformationMenuContribution$jD), LINKS.menuReference$uYXm), CONCEPTS.TransformationMenuReference_Named$rf), LINKS.menu$8pZB) : it)).distinct().sort((it) -> (String) INamedConcept__BehaviorDescriptor.getFqName_idhEwIO9y.invoke(it), true);\n }", "public boolean setManagerExploredContextAndSelection(Node value, Node[] nodes) {\n try{\n getExplorerManager().setExploredContextAndSelection(value, nodes);\n }\n catch (PropertyVetoException e) {\n return false;\n }\n return true;\n }", "protected boolean uniqueNodesUnderOps(Expression root, Fragment op) {\n Set<Expression> visited = new HashSet<>();\n return uniqueNodesUnderOps(root, op, visited);\n }", "public void setShowNodes(Boolean value) {\n showNodes = value;\n }", "protected boolean selectionIsAppropriate(Element selection) {\n return selection.getName().equals(FormatType.EMPTY.getElementName());\n }", "protected IAstNode doExpand(IAstNode node, boolean instances, boolean expectErrors) {\n \tTypeInference infer = new TypeInference(typeEngine);\n \tinfer.infer(node, false);\n \tsanityTest(node);\n \t\n \t\n \t\tExpandAST expand = new ExpandAST(typeEngine, instances);\n \t\t\n \t\tList<Message> messages = new ArrayList<Message>();\n \t\tboolean hadAnyErrors = false;\n \t\tfor (int passes = 1; passes < 256; passes++) {\n \t\t\tmessages.clear();\n \t\t\tnode = expand.expand(messages, node);\n \t\t\t\n \t\t\tif (expand.isChanged()) {\n \t\t\t\tif (dumpExpand || messages.size() > 0) {\n \t\t\t\t\tSystem.out.println(\"After expansion pass \" + passes + \":\");\n \t\t\t\t\tDumpAST dump = new DumpAST(System.out);\n \t\t\t\t\tnode.accept(dump);\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tfor (Message msg : messages) {\n \t\t\t\t\tSystem.err.println(msg);\n \t\t\t\t\thadAnyErrors = true;\n \t\t\t\t}\n \t\t\t\tif (!expectErrors)\n \t\t\t\t\tassertEquals(catenate(messages), 0, messages.size());\n \t\t\t} else {\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \n \t\tmessages.clear();\n \t\texpand.validate(messages, node);\n \t\tfor (Message msg : messages) {\n \t\t\tSystem.err.println(msg);\n \t\t\thadAnyErrors = true;\n \t\t}\n \t\tif (!expectErrors)\n \t\t\tassertEquals(catenate(messages), 0, messages.size());\n \t\telse if (!hadAnyErrors || messages.isEmpty())\n \t\t\tfail(\"no messages generated\");\n \t\treturn node;\n \t}", "public boolean matches(XPathContext xctxt, int targetNode, QName mode) throws TransformerException {\n/* 152 */ double score = this.m_stepPattern.getMatchScore(xctxt, targetNode);\n/* */ \n/* 154 */ return (Double.NEGATIVE_INFINITY != score && matchModes(mode, this.m_template.getMode()));\n/* */ }", "void clickOnEmptyNode(Node node);", "private int evaluateChildren() {\n if (PRINT_PROGRESS) {\n System.out.println(\"Evaled:\"+boardsEvaluated);\n }\n if (this.children == null || this.children.isEmpty()) { // Exit case: Node is a leaf\n return evaluateBoard(this.board);\n }\n \n int bestEval = Integer.MIN_VALUE;\n for (final BoardTree child : this.children) {\n child.evaluation = child.evaluateChildren();\n if (child.evaluation > bestEval) {\n bestEval = child.evaluation;\n }\n }\n return bestEval;\n }", "private void GreedySearch(){\n\n Queue<Node> expanded = new LinkedList<>();\n ArrayList<Node> fringe = new ArrayList<>();\n ArrayList<Node> fringeTemp = new ArrayList<>();\n\n\n Node current = startNode;\n\n while(expanded.size() < 1000){\n\n if(current.getDigit().getDigitString().equals(goalNode.getDigit().getDigitString())){\n //goal is reached.\n solutionPath(current);\n expanded.add(current);\n printExpanded(expanded);\n System.exit(0);\n }\n\n\n boolean b = cycleCheck(current,expanded);\n\n if(!b) {\n expanded.add(current);\n }\n\n if(!b){\n\n if(current.getDigit().last_changed != 0){\n\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child first digit\n if ((Integer.parseInt(current.getDigit().getFirst_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseFirstDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(0);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n\n }\n }\n\n if(current.getDigit().last_changed != 1){\n\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n\n //+1 child\n if ((Integer.parseInt(current.getDigit().getSecond_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseSecondDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(1);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n if(current.getDigit().last_changed != 2){\n if ((Integer.parseInt(current.getDigit().getThird_digit()) - 1 >= 0)) {\n Node child_node = new Node(current.getDigit().decreaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n //+1 child\n if ((Integer.parseInt(current.getDigit().getThird_digit()) + 1 <= 9)) {\n Node child_node = new Node(current.getDigit().increaseThirdDigit());\n child_node.setParent(current);\n child_node.getDigit().setLastChanged(2);\n if(!forbidden.contains(child_node.getDigit().getDigitString())){\n fringe.add(child_node);\n }\n }\n }\n\n }\n\n\n\n for(Node n : fringe){\n heuristicSetter(n);\n\n }\n\n fringeTemp.addAll(fringe);\n //now all the nodes in fringe have the heuristic value.\n //We can get the last added minm\n Node minm;\n if(fringeTemp.size() != 0){\n minm = fringeTemp.get(0);\n }else{\n break;\n }\n for(int i = 1; i<fringeTemp.size(); i++){\n if(fringeTemp.get(i).getHeuristic() <= minm.getHeuristic()){\n minm = fringeTemp.get(i);\n }\n }\n\n //now we have the minm for the next stage.\n current = minm;\n fringeTemp.remove(minm);\n fringe.clear();\n }\n\n //While loop ends\n System.out.println(\"No solution found.\");\n printExpanded(expanded);\n\n\n\n }", "private void IfTreeIsValid(HttpServletRequest request, HttpServletResponse response) throws IOException {\n XMLTree tree;\n tree = XMLTree.getInstance();\n response.getWriter().write(tree.validate());\n }", "@DISPID(1611006004) //= 0x60060034. The runtime will prefer the VTID if present\n @VTID(79)\n boolean constraintsNodeInTree();", "public void treeWillCollapse(TreeExpansionEvent e) {\n saySomething(\"Tree-will-collapse event detected\", e);\n }", "public Set<LeafNode> getSelectedNodes()\n\t{\n\t\treturn Collections.unmodifiableSet(selectionNode);\n\t}", "boolean hasHasNodeSettings();", "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 abstract boolean hasSelection();", "boolean hasTreeNodeId();", "public static void doUnexpandall ( RunData data)\n\t{\n\t\t// get the state object\n\t\tSessionState state = ((JetspeedRunData)data).getPortletSessionState (((JetspeedRunData)data).getJs_peid ());\n\n\t\t//get the ParameterParser from RunData\n\t\tParameterParser params = data.getParameters ();\n\n\t\t// save the current selections\n\t\tSet selectedSet = new TreeSet();\n\t\tString[] selectedItems = params.getStrings (\"selectedMembers\");\n\t\tif(selectedItems != null)\n\t\t{\n\t\t\tselectedSet.addAll(Arrays.asList(selectedItems));\n\t\t}\n\t\tstate.setAttribute(STATE_LIST_SELECTIONS, selectedSet);\n\n\t\tstate.setAttribute(STATE_EXPANDED_COLLECTIONS, new TreeSet());\n\t\tstate.setAttribute(STATE_EXPANDED_FOLDER_SORT_MAP, new Hashtable());\n\t\tstate.setAttribute(STATE_EXPAND_ALL_FLAG, Boolean.FALSE.toString());\n\n\t}", "@Override public boolean selectAutomaticallyInTreeMenu() {\n return infoPanel == null;\n }", "@Test(groups = { \"Interactive\" })\n public void testMoreActions() {\n String defaultBlocks = \"[[1,1,1,\\\"Green\\\",[]],[1,1,2,\\\"Green\\\",[]],[1,1,3,\\\"Green\\\",[]],[1,1,4,\\\"Green\\\",[]]]\";\n ContextValue context = getContext(defaultBlocks);\n LogInfo.begin_track(\"testMoreActions\");\n runFormula(executor, \"(:s (: select *) (:for (call veryx left this) (: remove)))\", context,\n x -> x.allItems.stream().allMatch(c -> ((Voxel) c).color.equals(Color.Fake)));\n runFormula(executor,\n \"(:for * (:for (call veryx bot) (:loop (number 2) (:s (: add red left) (: select (call adj top))))))\", context,\n x -> x.allItems.size() == 6);\n runFormula(executor, \"(:s (: select *) (: select (call veryx bot selected)) (: remove selected) )\", context,\n x -> real(x.allItems).size() == 3);\n // x -> x.selected().iterator().next().get(\"height\") == new Integer(3)\n runFormula(executor, \"(:loop (count (color green)) (: add red left *))\", context, x -> x.allItems.size() == 20);\n\n LogInfo.end_track();\n }", "private void expandTree(TreeNode tn,Set<Condition> conds)\n{\n List<RuleInstance> rules = tn.getRules();\n double tot = rules.size();\n if (tot <= 1) return;\n if (conds == null || conds.isEmpty()) return;\n\n Condition best = null;\n List<RuleInstance> bestp = null;\n List<RuleInstance> bestf = null;\n double bestv = 0;\n\n for (Condition c : conds) {\n List<RuleInstance> pr = new ArrayList<RuleInstance>();\n List<RuleInstance> fr = new ArrayList<RuleInstance>();\n for (RuleInstance ri : rules) {\n\t if (c.match(ri)) pr.add(ri);\n\t else fr.add(ri);\n }\n if (pr.size() == 0 || fr.size() == 0) continue;\n double vp = pr.size() / tot;\n double vf = fr.size() / tot;\n double e = - vp * Math.log(vp) - vf * Math.log(vf);\n if (e > bestv) {\n\t best = c;\n\t bestp = pr;\n\t bestf = fr;\n }\n }\n\n if (best == null) return;\n\n tn.setCondition(best,bestp,bestf);\n expandTree(tn.getPassTree(),conds);\n expandTree(tn.getFailTree(),conds);\n}", "abstract protected QaIOReporter performAction(Node[] nodes);", "public void expandAllNodes(JTree tree, int startingIndex, int rowCount){\n for(int i=startingIndex;i<rowCount;++i){\n tree.expandRow(i);\n }\n\n if(tree.getRowCount()!=rowCount){\n expandAllNodes(tree, rowCount, tree.getRowCount());\n }\n}", "private void expandAllNodes(JTree tree, int startingIndex, int rowCount) {\n for (int i = startingIndex; i < rowCount; ++i) {\n tree.expandRow(i);\n }\n\n if (tree.getRowCount() != rowCount) {\n expandAllNodes(tree, rowCount, tree.getRowCount());\n\n }\n }" ]
[ "0.6451429", "0.6273281", "0.5728529", "0.56322384", "0.560912", "0.5480029", "0.5470007", "0.5451707", "0.54222906", "0.53954303", "0.5383867", "0.53456897", "0.53414047", "0.53206855", "0.53196925", "0.5309725", "0.52717346", "0.52565604", "0.5250201", "0.52448785", "0.5221506", "0.5218792", "0.51808256", "0.5163324", "0.5150591", "0.51478004", "0.5088777", "0.5084249", "0.50815856", "0.50666153", "0.5065898", "0.50549996", "0.5050102", "0.50473017", "0.50251526", "0.5018851", "0.5010307", "0.5009253", "0.50026935", "0.50023806", "0.4997428", "0.49955246", "0.49924254", "0.49918005", "0.49911678", "0.49797297", "0.49694002", "0.49693164", "0.49407506", "0.49272352", "0.49208602", "0.49070406", "0.4906241", "0.48928553", "0.4877043", "0.48722634", "0.48693782", "0.48598212", "0.48597872", "0.48597872", "0.48597872", "0.4859559", "0.48532367", "0.4850579", "0.4848715", "0.48463747", "0.4838329", "0.48351085", "0.48319653", "0.48265773", "0.48219374", "0.48064727", "0.4805388", "0.48039928", "0.4797666", "0.47932944", "0.47929266", "0.4790942", "0.47799426", "0.47603512", "0.47467953", "0.4745272", "0.47445816", "0.47281715", "0.47275838", "0.4725529", "0.47220722", "0.4721931", "0.47206762", "0.47081193", "0.47060245", "0.47024006", "0.47022822", "0.470091", "0.4697023", "0.4686885", "0.46793404", "0.46792513", "0.4678959", "0.46779513" ]
0.5940888
2
Checks if state is already present in the nodesCovered
private static boolean isItVisted(Node node) { boolean areNodesEqual = false; for (Node temp : nodesCovered) { if(choice==1){ if (node.count == temp.count) { if (areTheyEqual(temp.stateSpace, node.stateSpace)) { return true; } } } else{ if (node.manhattanDist == temp.manhattanDist) { if (areTheyEqual(temp.stateSpace, node.stateSpace)) { return true; } } } } return areNodesEqual; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean containState(String state) {\r\n for (int i = 0; i < this.visitedList.size(); i++) {\r\n if (state.equals(this.visitedList.get(i))) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }", "private boolean hasUniqueState()\n {\n return (getExternalArcState() == getMiddleArcState() && getExternalArcState() == getInternalArcState() && getExternalArcState() == getCircleState());\n }", "boolean hasState();", "boolean hasState();", "boolean hasState();", "boolean hasState();", "boolean hasState();", "boolean hasState();", "boolean hasState();", "boolean hasState();", "boolean containsObjectFlowState(ObjectFlowState objectFlowState);", "boolean hasHasState();", "public boolean checkIn(){\n return state.checkIn();\n }", "private boolean checkIfAlreadyIsState(ArrayList<ArrayList<Integer>> states, ArrayList<Integer> state){\n boolean res=true;\n Collections.sort(state);\n\n for (int i = 0 ; i < states.size();i++){\n ArrayList<Integer> currState = states.get(i);\n\n if(currState.size() != state.size())\n continue;\n else{\n Collections.sort(currState);\n\n if(state.equals(currState)){\n res = false;\n break;\n }\n }\n }\n\n return res;\n }", "private Result checkAllNodesAreUp(ClusterState clusterState) {\n\n for (NodeInfo storageNodeInfo : clusterInfo.getStorageNodeInfo()) {\n State wantedState = storageNodeInfo.getUserWantedState().getState();\n if (wantedState != State.UP && wantedState != State.RETIRED) {\n return Result.createDisallowed(\"Another storage node wants state \" +\n wantedState.toString().toUpperCase() + \": \" + storageNodeInfo.getNodeIndex());\n }\n\n State state = clusterState.getNodeState(storageNodeInfo.getNode()).getState();\n if (state != State.UP && state != State.RETIRED) {\n return Result.createDisallowed(\"Another storage node has state \" + state.toString().toUpperCase() +\n \": \" + storageNodeInfo.getNodeIndex());\n }\n }\n\n for (NodeInfo distributorNodeInfo : clusterInfo.getDistributorNodeInfo()) {\n State wantedState = distributorNodeInfo.getUserWantedState().getState();\n if (wantedState != State.UP && wantedState != State.RETIRED) {\n return Result.createDisallowed(\"Another distributor wants state \" + wantedState.toString().toUpperCase() +\n \": \" + distributorNodeInfo.getNodeIndex());\n }\n\n State state = clusterState.getNodeState(distributorNodeInfo.getNode()).getState();\n if (state != State.UP && state != State.RETIRED) {\n return Result.createDisallowed(\"Another distributor has state \" + state.toString().toUpperCase() +\n \": \" + distributorNodeInfo.getNodeIndex());\n }\n }\n\n return Result.allowSettingOfWantedState();\n }", "public boolean checkLastNodeStatus()\r\n {\r\n return visitedNodes.isEmpty();\r\n }", "private boolean checkScanNodesCompleted() {\n\t\treturn cursor.getSelectionPos() >= jedisNodes.size();\n\t}", "@Override\n public boolean equals(Object other) {\n return Arrays.equals(state, ((CannibalNode) other).state);\n }", "private void foundNonExistent() {\n\t\tstate = BridgeState.NON_EXISTENT;\n\t}", "public boolean isSetState()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n return get_store().count_elements(STATE$8) != 0;\r\n }\r\n }", "public void checkNodes() {\n // Don't do anything when you check the nodes. This nodes is built by\n // when the setTarget method is called.\n }", "public static void check() {\n\t\twhile (!choiceOfNodes.isEmpty()) {\n\t\t\tNode node = choiceOfNodes.remove();\n\t\t\tif (node.isItGoal()) {\n\t\t\t\tSystem.out.println(\"\\nSolution: \\n\");\n\t\t\t\tprintTheBoards(node);\n\t\t\t\tSystem.out.println(\"No. of nodes generated in total: \" + nodesGenerated);\n\t\t\t\tSystem.out.println(\"No. of nodes expanded: \" + nodesOpened);\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tif (isItVisted(node)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tnodesOpened++;\n\t\t\t\t\tnodesCovered.add(node);\n\t\t\t\t\tstartOperation(node);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected boolean Exists()\n\t{\n\t\tif (identity<1) return false;\n\t\tNodeReference nodeReference = getNodeReference();\n\t\treturn (nodeReference.exists() || nodeReference.hasSubnodes());\n\t}", "public boolean checkState(){\r\n boolean checkZero = false;\r\n for (int i = 0; i<puzzleSize; i++){\r\n for (int j = 0; j<puzzleSize; j++){\r\n if (this.state[i][j] == 0)\r\n checkZero = true;\r\n if ( (this.state[i][j]<0) || (this.state[i][j]>maxValue)){\r\n System.out.println(\"Value greater than \" + maxValue + \" found.\");\r\n return false;\r\n }\r\n for (int k = 0; k<puzzleSize; k++){\r\n for (int l = 0; l<puzzleSize; l++){\r\n if ( (this.state[i][j] == this.state[k][l])&&( (i!=k) || (j!=l))){\r\n System.out.println(\"State contained duplicate value(s).\");\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n if (!checkZero)\r\n System.out.println(\"State did not contain an empty space. Denote an empty space with a 0.\");\r\n return checkZero;\r\n }", "boolean isBranchTaken();", "public boolean isInCheck() {\n\t\treturn false;\n\t}", "public boolean containsState(final State state) {\r\n final State relativeState = (mTargetAgent != null ? state.getStateWithRespectToAgent(mTargetAgent) : state);\r\n return mStateMap.containsKey(relativeState);\r\n }", "public boolean checkState(){\r\n\t\t//Check if we have enough users\r\n\t\tfor (Map.Entry<String, Role> entry : roleMap.entrySet()){\r\n\t\t\tString rid = entry.getKey();\r\n\t\t\tRole role = roleMap.get(rid);\r\n\t\t\tlog.info(\"Veryifying \" + rid);\t\t\t\r\n\t\t\tif(!roleCount.containsKey(rid)){\r\n\t\t\t\tlog.severe(\"Unsure of game state.\" + rid + \" not found in roleCount\");\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t\r\n\t\t\t} else if(role.getMin() > roleCount.get(rid)) {\r\n\t\t\t\t\tlog.info(\"minimum number for roleID: \" + rid + \" not achived\");\r\n\t\t\t\t\treturn false;\r\n\t\t\t\r\n\t\t\t} else if(role.getMax() < roleCount.get(rid)) { //probably don't need this one but cycles are cheap\r\n\t\t\t\tlog.severe(\"OVER MAXIMUM number for roleID: \" + rid + \" not achived\");\r\n\t\t\t\tSystem.exit(-1);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//if we do reach here we've reached a critical mass of players. But we still need them to load the screen\r\n\t\t\r\n\t\tif((this.getGameState() != GAMESTATE.RUNNING) ||(this.gameState !=GAMESTATE.READY_TO_START) ) {\r\n\t\t\tsetGameState(GAMESTATE.CRITICAL_MASS);\r\n\t\t\tlog.info(\"have enough players for game\");\r\n\t\t}\r\n\t\t//if the users are done loading their screen, let us know and then we can start\r\n\t\tif (!userReady.containsValue(false)){\r\n\t\t\tsetGameState(GAMESTATE.READY_TO_START);\r\n\t\t\tlog.info(\"Gamestate is running!!\");\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private boolean contain(Estado state, List<Estado> states) {\n\t\tfor (Estado valid : states) {\n\t\t\tif (valid.getValue() == state.getValue()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean hasParentalStatus();", "protected boolean lastStateOnPathIsNew(PrioritizedSearchNode psn) {\n\n\tPrioritizedSearchNode cmpNode = (PrioritizedSearchNode) psn.backPointer;\n\n\twhile (cmpNode != null) {\n\t if (psn.equals(cmpNode)) {\n\t\treturn false;\n\t }\n\t cmpNode = (PrioritizedSearchNode) cmpNode.backPointer;\n\t}\n\n\treturn true;\n }", "protected void checkState()\n {\n if (getParentNode() != null)\n {\n throw new IllegalStateException(\n \"Node cannot be modified when added to a parent!\");\n }\n }", "public boolean isNodePresent(int nd) {\n if ((nd >= (int) nodeVector.size() || (nodeVector.get(nd).getIndex() == invalid_node_index))) {\n return false;\n } else {\n return true;\n }\n }", "public boolean checkIfFull() {\n this.isFull = true;\n for(int i=0; i<this.size; i++) {\n for(int j=0; j<this.size; j++) if(this.state[i][j].isEmpty) this.isFull = false;\n }\n }", "@java.lang.Override\n public boolean hasStateInfo() {\n return stateInfo_ != null;\n }", "public boolean finished() {\r\n\t\tboolean allOccupied = true;\r\n\t\tfor (Node n : allNodes.values()) {\r\n\t\t\tif (n.path == 0) {\r\n\t\t\t\tallOccupied = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (allOccupied) {\r\n\r\n\t\t\tfor (Integer path : paths.keySet()) {\r\n\t\t\t\tStack<Node> sn=paths.get(path);\r\n\t\t\t\tNode n = sn.peek();\r\n\t\t\t\tif (!EndPoint.containsValue(n)) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (sn.size() > 1) {\r\n\t\t\t\t\tStack<Node> snBK = (Stack<Node>) sn.clone();\r\n\t\t\t\t\t\r\n\t\t\t\t\tNode n1 = snBK.pop();\r\n\t\t\t\t\twhile (!snBK.isEmpty()) {\r\n\t\t\t\t\t\tif(n1.path!=path)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\tNode n2= snBK.pop();\r\n\t\t\t\t\t\tif(adjaMatrix[n1.index][n2.index]==0)\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tn1=n2;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t} else\r\n\t\t\treturn false;\r\n\t}", "void check_game_state() {\n // Game over\n if (lives <= 0){ // No lives left\n end_game();\n }\n for (Alien alien : aliens){ // Aliens reached bottom of screen\n if (alien.y_position + alien.alien_height >= ship.y_position) {\n end_game();\n break;\n }\n }\n\n // Empty board\n if (aliens.isEmpty()) { // All aliens defeated\n if (level < 3) { // Level up\n level_up();\n alien_setup();\n }\n else { // Victory\n end_game();\n }\n }\n }", "public boolean isStateKnown(){\n\t\treturn (state != null);\n\t}", "@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 }", "@Override\n\tpublic boolean isStartingState(State state, MaxNode maxNode) {\n\t\treturn false;\n\t}", "private boolean isStateFullyDetermined() {\n switch (hasSubstance) {\n case No:\n case Unknown:\n return false;\n case Yes:\n // if already established has substance, continue checking only until\n // reach threshold\n return (substanceMin <= 0) ? true : substanceCnt >= substanceMin;\n }\n throw new ShouldNotHappenException();\n }", "private void checkState() {\r\n\t\tswitch (this.stepPanel.getStep()) {\r\n\t\tcase StepPanel.STEP_HOST_GRAPH:\r\n\t\t\tcheckHostGraphAndNextStep();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_STOP_GRAPH:\r\n\t\t\tcheckStopGraphAndNextStep();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_CRITICAL_PAIRS:\r\n\t\t\tcheckPairsAndNextStep();\r\n\t\t\tbreak;\r\n\t\tcase StepPanel.STEP_FINISH:\r\n\t\t\tcheckIfReadyToParse();\r\n\t\t\tquitDialog();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "public static void checkinNodes() throws RepositoryException {\n Set<Node> checkedOutNodes = getCheckedoutNodes();\n for (Iterator<Node> itr = checkedOutNodes.iterator(); itr.hasNext(); ) {\n Node element = itr.next();\n JcrVersionUtil.checkin(element);\n itr.remove();\n }\n }", "private void checkHasNodeLeft() throws RemoteException {\n\t\tif (hasNodeLeft)\n\t\t\tthrow new RemoteException();\n\t}", "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 boolean existState(int id) {\n\t\treturn this.states.get(id) != null;\n\t}", "private boolean checkIn(MyPair<Integer, Integer> position){\n Board copy;\n try{\n copy = new Board(getBoard());\n }\n catch(Exception e){\n System.out.println(\"AAA\");\n return true;\n }\n\n copy.removePiece(copy.kingByColour(getColour()));\n copy.addPiece(new King(getColour(), copy, position));\n if(copy.check() == getColour())\n return true;\n return false;\n }", "boolean hasHasNodeID();", "public void checkInside() {\n checkInsideDone = false;\n }", "boolean hasNode()\n/* */ {\n/* 473 */ if ((this.bn == null) && (this.mn == null)) return false;\n/* 474 */ if (this.jt == null) return false;\n/* 475 */ return true;\n/* */ }", "private void performInsideCheck() {\n if (checkInsideDone) {\n return;\n }\n \n checkInsideDone = true;\n \n final Location playerLoc = World.getPlayer().getLocation();\n final int currX = playerLoc.getScX();\n final int currY = playerLoc.getScY();\n int currZ = playerLoc.getScZ();\n boolean nowOutside = false;\n boolean isInside = false;\n \n for (int i = 0; i < 2; ++i) {\n currZ++;\n if (isInside || parent.isMapAt(currX, currY, currZ)) {\n if (!insideStates[i]) {\n insideStates[i] = true;\n synchronized (unchecked) {\n unchecked.add(Location.getKey(currX, currY, currZ));\n }\n }\n isInside = true;\n } else {\n if (insideStates[i]) {\n insideStates[i] = false;\n nowOutside = true;\n }\n }\n }\n \n /*\n * If one of the values turned from inside to outside, all tiles are added to the list to be checked again.\n */\n if (nowOutside) {\n synchronized (unchecked) {\n unchecked.clear();\n parent.processTiles(this);\n }\n }\n \n World.getWeather().setOutside(!isInside);\n }", "private boolean isTransactionAlreadySeen(Transaction tx){\n return allTransactions.contains(tx);\n }", "void check(){\n if(!data.up.isEmpty()){\r\n if(data.floor == data.up.get(0)){\r\n data.up.remove(0);\r\n data.state = 0;\r\n data.statePrv = 1;\r\n data.isMoving = false;\r\n }\r\n }\r\n if(!data.down.isEmpty()){\r\n if(data.floor == data.down.get(0)){\r\n data.down.remove(0);\r\n data.state = 0;\r\n data.statePrv = -1;\r\n data.isMoving = false;\r\n }\r\n }\r\n }", "public boolean isCovered(ExpressionTree tree, VisitorState state) {\n return isCheckReturnValue(tree, state);\n }", "public boolean removeDeadTransitions() throws Exception{\n \tArrayList<Integer> st=new ArrayList<Integer>(getStates());//st fixes some arbitrary order of states\n \tboolean [][] canReach=buildConnectionMatrix(st);\n\n \t//collect reachable states\n \tStack<Integer> worklist=new Stack<Integer>();\n \tHashSet<Integer> reachableStates=new HashSet<Integer> ();\n \tfor(String var:pointers.keySet())\n \t\tworklist.push(st.indexOf(pointers.get(var)));\n \twhile(!worklist.empty()){\n \t\tint cur=worklist.pop();\n \t\treachableStates.add(st.get(cur));\n \t\tfor(int i=0;i<st.size();i++)\n \t\t\tif(canReach[cur][i]&&!worklist.contains(i)&&!reachableStates.contains(st.get(i)))\n \t\t\t\tworklist.push(i);\n \t}\n \t//remove unreachable states\n \tboolean hasUnreachableNonReferenceStates=false;//might still be a useless state\n \tfor(TreeAutomaton ta:lt){\n \tHashSet<Integer> toRemove=new HashSet<Integer>();\n \t\tfor(int s:ta.getStates())\n \t\t\tif(!reachableStates.contains(s)){\n \t\t\t\ttoRemove.add(s);\n \t\t\t}\n \tfor(int s:toRemove){\n\t\t\t\tif(!ta.isReferenceTo(s, NULL)&&!ta.isReferenceTo(s, UNDEF)&&ta.referenceTo(s)==-1)\n\t\t\t\t\thasUnreachableNonReferenceStates=true;\n \t\t\tta.removeState(s);\n \t}\n \t}\n \treturn hasUnreachableNonReferenceStates;\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 }", "private boolean isFree2Cover(Node nj, Set active) throws ParallelException {\r\n if (active.contains(nj)) return false;\r\n if (_k==2) {\r\n\t\t\tSet nnborsj = new HashSet(nj.getNNbors());\r\n\t\t\tnnborsj.retainAll(active);\r\n\t\t\tif (nnborsj.size()>0) return false;\r\n\t\t\treturn true;\r\n\t\t} else { // _k==1\r\n\t\t\t/* slow\r\n\t\t\tSet nborsj = new HashSet(nj.getNbors());\r\n\t\t\tnborsj.retainAll(active);\r\n\t\t\tif (nborsj.size()>0) return false;\r\n\t\t\treturn true;\r\n\t\t\t*/\r\n\t\t\t// /* faster: no need for HashSet creation\r\n\t\t\tSet nborsj = nj.getNborsUnsynchronized(); // no modification takes place\r\n\t\t\tIterator itj = nborsj.iterator();\r\n\t\t\twhile (itj.hasNext()) {\r\n\t\t\t\tNode nnj = (Node) itj.next();\r\n\t\t\t\tif (active.contains(nnj)) return false;\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t\t// */\r\n\t\t}\r\n }", "public boolean hasBeenVisited() {\n\t\treturn visited; // Replace with your code\n\t}", "public boolean isValid() {\n if (state.length != Board.dim*Board.dim) return false;\n if ((double)Board.dim != Math.sqrt((double)state.length)) return false;\n byte[] counts = new byte[state.length];\n try {\n for (int i = 0; i < counts.length; i++) counts[state[i]]++;\n } catch (ArrayIndexOutOfBoundsException e) { return false; }\n for (int i = 0; i < counts.length; i++) if (counts[i] != 1) return false;\n return true;\n }", "@Override\n\tpublic void stateCheck() {\n\t\tif(balance<0 && balance>=-1000)\n\t\t{\n\t\t\tacc.setState(new YellowState(this));\n\t\t}\n\t\telse if(balance<-1000)\n\t\t{\n\t\t\tacc.setState(new RedState(this));\n\t\t}\n\t}", "boolean hasIsNodeOf();", "private void reachable() {\r\n\r\n\t\tSortedSet<String> keys = new TreeSet<String>(vertexMap.keySet());\r\n\t\tIterator it = keys.iterator();\r\n\t\twhile (it.hasNext()) {\r\n\t\t\tVertex v = vertexMap.get(it.next());\r\n\t\t\tif (v.isStatus()) {\r\n\t\t\t\tSystem.out.println(v.getName());\r\n\t\t\t\tbfs(v);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasOccupation();", "boolean hasNode();", "boolean hasNode();", "private final void checkSccs(final ITool tool) throws IOException, InterruptedException, ExecutionException {\r\n\t\t// Initialize this.dg:\r\n\t\tthis.dg.makeNodePtrTbl();\r\n\t\t\r\n\t\t// Initialize nodeQueue with initial states. The initial states stored \r\n\t\t// separately in the DiskGraph are resolved to their pointer location\r\n\t\t// in the on-disk part of the DiskGraph.\r\n\t\t// The pointer location generally is obviously used to:\r\n\t\t// * Speed up disk lookups in the RandomAccessFile(s) backing up the DiskGraph\r\n\t\t// * Is replaced by the SCC link number the moment the node's successors\r\n\t\t// are explored during DFS search. At this point the ptr location isn't\r\n\t\t// needed anymore. The successors have been resolved.\r\n\t\t// \r\n\t\t// From each node in nodeQueue the SCC search is started down below,\r\n\t\t// which can subsequently add additional nodes into nodeQueue.\r\n\t\t// \r\n\t\t// Contrary to plain Tarjan, not all vertices are added to the\r\n\t\t// nodeQueue of unexplored states, but only the initial states. Since we\r\n\t\t// know that all non-initial states are reachable from the set of\r\n\t\t// initial states, this is sufficient to start with.\r\n\t\tfinal LongVec initNodes = this.dg.getInitNodes();\r\n\t\tfinal int numOfInits = initNodes.size();\r\n\t\t// Allocate space for all initial states, assuming the majority of\r\n\t\t// initial nodes will be done. Multiplied by 5 because of\r\n\t\t// <<long, int, long>> per \"record.\r\n\t\tfinal MemIntQueue nodeQueue = new MemIntQueue(liveCheck.getMetaDir(), \"root\", (numOfInits / 2) * 5);\r\n\t\tfor (int j = 0; j < numOfInits; j += 2) {\r\n\t\t\tfinal long state = initNodes.elementAt(j);\r\n\t\t\tfinal int tidx = (int) initNodes.elementAt(j + 1);\r\n\t\t\tfinal long ptr = this.dg.getLink(state, tidx);\r\n\t\t\t// Check if the node <<state, tidx>> s is done. A node s is undone\r\n\t\t\t// if it is an initial state which hasn't been explored yet. This is\r\n\t\t\t// the case if s has been added via LiveChecker#addInitState but not\r\n\t\t\t// yet via LiveChecker#addNextState. LiveChecker#addNextState fully\r\n\t\t\t// explores the given init state s because it has access to s'\r\n\t\t\t// successors.\r\n\t\t\tif (ptr >= 0) {\r\n\t\t\t\t// Make sure none of the init states has already been assigned a\r\n\t\t\t\t// link number. That would indicate a bug in makeNodePtrTbl\r\n\t\t\t\t// which is supposed to reset all link numbers to file ptrs.\r\n\t\t\t\tassert DiskGraph.isFilePointer(ptr);\r\n\t\t\t\tnodeQueue.enqueueLong(state);\r\n\t\t\t\tnodeQueue.enqueueInt(tidx);\r\n\t\t\t\tnodeQueue.enqueueLong(ptr);\r\n\t\t\t} else {\r\n\t\t\t\t// If this is the final check on the complete graph, no node is\r\n\t\t\t\t// allowed to be undone. If it's not the final check, ptr has to\r\n\t\t\t\t// be UNDONE (a non-UNDONE negative pointer is probably a bug).\r\n\t\t\t\t// isFinalCheck => ptr # UNDONE\r\n\t\t\t\tassert !isFinalCheck || ptr != TableauNodePtrTable.UNDONE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfinal int[] eaaction = this.pem.EAAction;\r\n\t\tfinal int slen = this.oos.getCheckState().length;\r\n\t\tfinal int alen = this.oos.getCheckAction().length;\r\n\t\t\r\n\t\t\r\n\t\t// Synchronize all LiveWorker instances to consistently read free\r\n\t\t// memory. This method is only called during initialization of SCC\r\n\t\t// search, thus synchronization should not cause significant thread\r\n\t\t// contention. We want a single LW to successfully allocate both\r\n\t\t// dfsStack *and* comStack.\r\n\t\tfinal IntStack dfsStack;\r\n\t\tfinal IntStack comStack;\r\n\t\tsynchronized (LiveWorker.class) {\r\n\t\t\t// Tarjan's stack\r\n\t\t\t// Append thread id to name for unique disk files during concurrent SCC search\r\n\t\t\tdfsStack = getStack(liveCheck.getMetaDir(), \"dfs\" + this.id);\r\n\t\t\t\r\n\t\t\t// comStack is only being added to during the deep first search. It is passed\r\n\t\t\t// to the checkComponent method while in DFS though. Note that the nodes pushed\r\n\t\t\t// onto comStack don't necessarily form a strongly connected component (see\r\n\t\t\t// comment above this.checkComponent(...) below for more details).\r\n\t\t\t//\r\n\t\t\t// See tlc2.tool.liveness.LiveWorker.DetailedFormatter.toString(MemIntStack)\r\n\t\t\t// which is useful during debugging.\r\n\t\t\tcomStack = getStack(liveCheck.getMetaDir(), \"com\" + this.id);\r\n\t\t}\r\n\r\n\t\t// Generate the SCCs and check if they contain a \"bad\" cycle.\r\n\t\twhile (nodeQueue.size() > 0) {\r\n\t\t\t// Pick one of the unexplored nodes as root and start searching the\r\n\t\t\t// reachable SCCs from it.\r\n\t\t\tfinal long state = nodeQueue.dequeueLong();\r\n\t\t\tfinal int tidx = nodeQueue.dequeueInt();\r\n\t\t\tfinal long loc = nodeQueue.dequeueLong();\r\n\r\n\t\t\t// Reset (remove all elements) the stack. Logically a new SCC search\r\n\t\t\t// is being started unrelated to the previous one.\r\n\t\t\tdfsStack.reset();\r\n\r\n\t\t\t// Push the first node onto the DFS stack which makes it the node\r\n\t\t\t// from which the depth-first-search is being started.\r\n\t\t\tdfsStack.pushLong(state);\r\n\t\t\tdfsStack.pushInt(tidx);\r\n\t\t\tdfsStack.pushLong(loc);\r\n\t\t\t// Push the smallest possible link number (confusingly called\r\n\t\t\t// MAX_PTR here but only because file pointers are < MAX_PTR) as the\r\n\t\t\t// first link number.\r\n\t\t\t// [0, MAX_PTR) for file pointers\r\n\t\t\t// [MAX_PTR, MAX_LINK] for links\r\n\t\t\tdfsStack.pushLong(DiskGraph.MAX_PTR);\r\n\t\t\tlong newLink = DiskGraph.MAX_PTR;\r\n\r\n\t\t\twhile (dfsStack.size() >= 7) {\r\n\t\t\t\tfinal long lowLink = dfsStack.popLong();\r\n\t\t\t\tfinal long curLoc = dfsStack.popLong();\r\n\t\t\t\tfinal int curTidx = dfsStack.popInt();\r\n\t\t\t\tfinal long curState = dfsStack.popLong();\r\n\t\t\t\t\r\n\t\t\t\t// At this point curLoc is still a file pointer (small MAX_PTR)\r\n\t\t\t\t// and not yet replaced by a link (MAX_PTR < curLoc < MAX_LINK).\r\n\t\t\t\tassert DiskGraph.isFilePointer(curLoc);\r\n\t\t\t\t\r\n\t\t\t\t// The current node is explored iff curLoc < 0. If it is indeed fully explored,\r\n\t\t\t\t// it means it has potentially found an SCC. Thus, check if this is the case\r\n\t\t\t\t// for the current GraphNode.\r\n\t\t\t\t// A node is fully explored if the nested loop over its\r\n\t\t\t\t// successors down below in the else branch has not revealed any\r\n\t\t\t\t// unexplored successors.\r\n\t\t\t\tif (curLoc == SCC_MARKER) {\r\n\t\t\t\t\t// Check if the current node's link is lowLink which\r\n\t\t\t\t\t// indicates that the nodes on comStack up to <<curState,\r\n\t\t\t\t\t// curTidx>> form an SCC.\r\n\t\t\t\t\t// If curLink # lowLink, continue by pop'ing the next node\r\n\t\t\t\t\t// from dfsStack. It can either be:\r\n\t\t\t\t\t// - unexplored in which case the else branch is taken and\r\n\t\t\t\t\t// DFS continues.\r\n\t\t\t\t\t// - be an intermediate node of the SCC and thus curLink #\r\n\t\t\t\t\t// lowLink for it too.\r\n\t\t\t\t\t// - can be the start of the SCC (curLink = lowLink).\r\n\t\t\t\t\tfinal long curLink = this.dg.getLink(curState, curTidx);\r\n\t\t\t\t\tassert curLink < AbstractDiskGraph.MAX_LINK;\r\n\t\t\t\t\tif (curLink == lowLink) {\r\n\t\t\t\t\t\t// The states on the comStack from \"top\" to <<curState,\r\n\t\t\t\t\t\t// curTidx>> form an SCC, thus check for \"bad\" cycle.\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t// The cycle does not necessarily include all states in\r\n\t\t\t\t\t\t// comStack. \"top\" might very well be curState in which\r\n\t\t\t\t\t\t// case only a single state is checked by\r\n\t\t\t\t\t\t// checkComponent.\r\n\t\t\t\t\t\t//\r\n\t\t\t\t\t\t// The aforementioned case happens regularly when the\r\n\t\t\t\t\t\t// behaviors to check don't have cycles at all (leaving\r\n\t\t\t\t\t\t// single node cycles aside for the moment). The DFS\r\n\t\t\t\t\t\t// followed each behavior from its initial state (see\r\n\t\t\t\t\t\t// nodeQueue) all the way to the behavior's end state at\r\n\t\t\t\t\t\t// which point DFS halts. Since DFS cannot continue\r\n\t\t\t\t\t\t// (there are no successors) it calls checkComponent now\r\n\t\t\t\t\t\t// with the current comStack and the end state as\r\n\t\t\t\t\t\t// <<curState, curTidx>> effectively checking the\r\n\t\t\t\t\t\t// topmost element of comStack. Unless this single state\r\n\t\t\t\t\t\t// violates any liveness properties, it gets removed\r\n\t\t\t\t\t\t// from comStack and DFS continues. Iff DFS still cannot\r\n\t\t\t\t\t\t// continue because the predecessor to endstate\r\n\t\t\t\t\t\t// (endstate - 1) has no more successors to explore\r\n\t\t\t\t\t\t// either, it again calls checkComponent for the single\r\n\t\t\t\t\t\t// element (endstate - 1). This goes on until either the\r\n\t\t\t\t\t\t// initial state is reached or an intermediate state has\r\n\t\t\t\t\t\t// unexplored successors with DFS.\r\n\t\t\t\t\t\tfinal boolean isOK = this.checkComponent(tool, curState, curTidx, comStack);\r\n\t\t\t\t\t\tif (!isOK) {\r\n\t\t\t\t\t\t\t// Found a \"bad\" cycle of one to comStack.size()\r\n\t\t\t\t\t\t\t// nodes, no point in searching for more SCCs as we\r\n\t\t\t\t\t\t\t// are only interested in one counter-example at a\r\n\t\t\t\t\t\t\t// time.\r\n\t\t\t\t\t\t\t// checkComponent will have printed the\r\n\t\t\t\t\t\t\t// counter-example by now.\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// Replace previous lowLink (plowLink) with the minimum of\r\n\t\t\t\t\t// the current lowLink and plowLink on the stack.\r\n\t\t\t\t\tfinal long plowLink = dfsStack.popLong();\r\n\t\t\t\t\tdfsStack.pushLong(Math.min(plowLink, lowLink));\r\n\t\t\t\t\t\r\n\t\t\t\t// No SCC found yet\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Assign newLink to curState:\r\n\t\t\t\t\tfinal long link = this.dg.putLink(curState, curTidx, newLink);\r\n\t\t\t\t\t// link is -1 if newLink has been assigned to pair\r\n\t\t\t\t\t// <<curState, curTidx>>. If the pair had been assigned a\r\n\t\t\t\t\t// link before, the previous link in range [MAX_PTR,\r\n\t\t\t\t\t// MAX_LINK] is returned. If the link is not -1, it means\r\n\t\t\t\t\t// the node has been explored by this DFS search before.\r\n\t\t\t\t\tif (link == -1) {\r\n\t\t\t\t\t\t// Push curState back onto dfsStack, but make curState\r\n\t\t\t\t\t\t// explored:\r\n\t\t\t\t\t\tdfsStack.pushLong(lowLink);\r\n\t\t\t\t\t\tdfsStack.pushLong(curState);\r\n\t\t\t\t\t\tdfsStack.pushInt(curTidx);\r\n\t\t\t\t\t\t// Push a marker onto the stack that, if pop'ed as\r\n\t\t\t\t\t\t// curLoc above causes branching to enter the true case\r\n\t\t\t\t\t\t// of the if block.\r\n\t\t\t\t\t\tdfsStack.pushLong(SCC_MARKER);\r\n\r\n\t\t\t\t\t\t// Add the tuple <<curState, curTidx, curLoc>> to comStack:\r\n\t\t\t\t\t\tcomStack.pushLong(curLoc);\r\n\t\t\t\t\t\tcomStack.pushInt(curTidx);\r\n\t\t\t\t\t\tcomStack.pushLong(curState);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Look at all the successors of curState:\r\n\t\t\t\t\t\tfinal GraphNode gnode = this.dg.getNode(curState, curTidx, curLoc);\r\n\t\t\t\t\t\tfinal int succCnt = gnode.succSize();\r\n\t\t\t\t\t\tlong nextLowLink = newLink;\r\n\t\t\t\t\t\t// DFS moved on to a new node, thus increment the newLink\r\n\t\t\t\t\t\t// number by 1 for subsequent exploration.\r\n\t\t\t\t\t\tnewLink = newLink + 1;\r\n\t\t\t\t\t\tfor (int i = 0; i < succCnt; i++) {\r\n\t\t\t\t\t\t\tfinal long nextState = gnode.getStateFP(i);\r\n\t\t\t\t\t\t\tfinal int nextTidx = gnode.getTidx(i);\r\n\t\t\t\t\t\t\tfinal long nextLink = this.dg.getLink(nextState, nextTidx);\r\n\t\t\t\t\t\t\t// If <<nextState, nextTidx>> node's link is < 0 it\r\n\t\t\t\t\t\t\t// means the node isn't \"done\" yet (see\r\n\t\t\t\t\t\t\t// tlc2.tool.liveness.TableauNodePtrTable.UNDONE).\r\n\t\t\t\t\t\t\t// A successor node t of gnode is undone if it is:\r\n\t\t\t\t\t\t\t// - An initial state which hasn't been explored yet\r\n\t\t\t\t\t\t\t// - t has not been added to the liveness disk graph\r\n\t\t\t\t\t\t\t// itself (only as the successor (transition) of\r\n\t\t\t\t\t\t\t// gnode).\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t// If it is >= 0, it either is a:\r\n\t\t\t\t\t\t\t// - file pointer location\r\n\t\t\t\t\t\t\t// - a previously assigned link (>= MAX_PTR)\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t// Iff nextLink == MAX_PTR, it means that the\r\n\t\t\t\t\t\t\t// <<nextState, nextTidx>> successor node has been\r\n\t\t\t\t\t\t\t// processed by checkComponent. The checks below\r\n\t\t\t\t\t\t\t// will result in the successor node being skipped.\r\n\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t// It is possible that <<nextState, nextTidx>> =\r\n\t\t\t\t\t\t\t// <<curState, curTid>> due to self loops. This is\r\n\t\t\t\t\t\t\t// intended, as checkAction has to be evaluated for\r\n\t\t\t\t\t\t\t// self loops too.\r\n\t\t\t\t\t\t\tif (nextLink >= 0) {\r\n\t\t\t\t\t\t\t\t// Check if the arc/transition from <<curState,\r\n\t\t\t\t\t\t\t\t// curTidx>> to <<nextState, nextTidx>>\r\n\t\t\t\t\t\t\t\t// satisfies (\"P-satisfiable\" MP page 422ff)\r\n\t\t\t\t\t\t\t\t// its PEM's EAAction. If it does, 1/3 of the\r\n\t\t\t\t\t\t\t\t// conditions for P-satisfiability are\r\n\t\t\t\t\t\t\t\t// satisfied. Thus it makes sense to check the\r\n\t\t\t\t\t\t\t\t// other 2/3 in checkComponent (AEAction &\r\n\t\t\t\t\t\t\t\t// Fulfilling promises). If the EAAction does\r\n\t\t\t\t\t\t\t\t// not hold, there is no point in checking the\r\n\t\t\t\t\t\t\t\t// other 2/3. All must hold for\r\n\t\t\t\t\t\t\t\t// P-satisfiability.\r\n\t\t\t\t\t\t\t\t//\r\n\t\t\t\t\t\t\t\t// This check is related to the fairness spec.\r\n\t\t\t\t\t\t\t\t// Skip to check the other conjuncts of the PossibleErrorModel (PEM) if the\r\n\t\t\t\t\t\t\t\t// action check is false (thus does not satisfy the PEM).\r\n\t\t\t\t\t\t\t\tif (gnode.getCheckAction(slen, alen, i, eaaction)) {\r\n\t\t\t\t\t\t\t\t\t// If the node's nextLink still points to\r\n\t\t\t\t\t\t\t\t\t// disk, it means it has no link assigned\r\n\t\t\t\t\t\t\t\t\t// yet which is the case if this node gets\r\n\t\t\t\t\t\t\t\t\t// explored during DFS search the first\r\n\t\t\t\t\t\t\t\t\t// time. Since it is new, add it to dfsStack\r\n\t\t\t\t\t\t\t\t\t// to have it explored subsequently by DFS.\r\n\t\t\t\t\t\t\t\t\tif (DiskGraph.isFilePointer(nextLink)) {\r\n\t\t\t\t\t\t\t\t\t\tdfsStack.pushLong(nextState);\r\n\t\t\t\t\t\t\t\t\t\tdfsStack.pushInt(nextTidx);\r\n\t\t\t\t\t\t\t\t\t\tdfsStack.pushLong(nextLink); // nextLink is logically a ptr/loc here\r\n\t\t\t\t\t\t\t\t\t\t// One would expect a (logical) lowLink\r\n\t\t\t\t\t\t\t\t\t\t// being pushed (additionally to the\r\n\t\t\t\t\t\t\t\t\t\t// ptr/loc in previous line) onto the\r\n\t\t\t\t\t\t\t\t\t\t// stack here. However, it is pushed\r\n\t\t\t\t\t\t\t\t\t\t// down below after all successors are\r\n\t\t\t\t\t\t\t\t\t\t// on the stack and valid for the\r\n\t\t\t\t\t\t\t\t\t\t// topmost successor. For the other\r\n\t\t\t\t\t\t\t\t\t\t// successors below the topmost, a link\r\n\t\t\t\t\t\t\t\t\t\t// number will be assigned subsequently.\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t// The node has been processed\r\n\t\t\t\t\t\t\t\t\t\t// already, thus use the minimum of its link\r\n\t\t\t\t\t\t\t\t\t\t// (nextLink) and nextLowLink.\r\n\t\t\t\t\t\t\t\t\t\tnextLowLink = Math.min(nextLowLink, nextLink);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t// The transition from <<curState, curTidx>>\r\n\t\t\t\t\t\t\t\t\t// to <<nextState, nextTidx>> is not\r\n\t\t\t\t\t\t\t\t\t// P-satisfiable and thus does not need to\r\n\t\t\t\t\t\t\t\t\t// be checkComponent'ed. However, since we\r\n\t\t\t\t\t\t\t\t\t// only added initial but no intermediate\r\n\t\t\t\t\t\t\t\t\t// states to nodeQueue above, we have to add\r\n\t\t\t\t\t\t\t\t\t// <<nextState, nextTidx>> to nodeQueue if\r\n\t\t\t\t\t\t\t\t\t// it's still unprocessed (indicated by its\r\n\t\t\t\t\t\t\t\t\t// on disk state). The current path\r\n\t\t\t\t\t\t\t\t\t// potentially might be the only one by\r\n\t\t\t\t\t\t\t\t\t// which DFS can reach it.\r\n\t\t\t\t\t\t\t\t\tif (DiskGraph.isFilePointer(nextLink)) {\r\n\t\t\t\t\t\t\t\t\tnodeQueue.enqueueLong(nextState);\r\n\t\t\t\t\t\t\t\t\tnodeQueue.enqueueInt(nextTidx);\r\n\t\t\t\t\t\t\t\t\tnodeQueue.enqueueLong(nextLink); // nextLink is logically a ptr/loc here\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t// If this is the final check on the complete\r\n\t\t\t\t\t\t\t\t// graph, no node is allowed to be undone. If\r\n\t\t\t\t\t\t\t\t// it's not the final check, nextLink has to be\r\n\t\t\t\t\t\t\t\t// UNDONE (a non-UNDONE negative nextLink is\r\n\t\t\t\t\t\t\t\t// probably a bug).\r\n\t\t\t\t\t\t\t\t// isFinalCheck => nextLink # UNDONE\r\n\t\t\t\t\t\t\t\tassert !isFinalCheck || nextLink != TableauNodePtrTable.UNDONE;\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// Push the next lowLink onto stack on top of all\r\n\t\t\t\t\t\t// successors. It is assigned to the topmost \r\n\t\t\t\t\t\t// successor only though.\r\n\t\t\t\t\t\tdfsStack.pushLong(nextLowLink);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// link above wasn't \"-1\", thus it has to be a valid\r\n\t\t\t\t\t\t// link in the known interval.\r\n\t\t\t\t\t\tassert AbstractDiskGraph.MAX_PTR <= link && link <= AbstractDiskGraph.MAX_LINK; \r\n\t\t\t\t\t\t// Push the minimum of the two links onto the stack. If\r\n\t\t\t\t\t\t// link == DiskGraph.MAX_PTR lowLink will always be the\r\n\t\t\t\t\t\t// minimum (unless this graph has a gigantic amount of\r\n\t\t\t\t\t\t// SCCs exceeding (MAX_LINK - MAX_PTR).\r\n\t\t\t\t\t\tdfsStack.pushLong(Math.min(lowLink, link));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Make sure all nodes on comStack have been checkComponent()'ed\r\n\t\tassert comStack.size() == 0;\r\n\t}", "private boolean checkGameState() {\n\t\tint numberOfPlayers = this.manSys.lockedNavmap.size();\n\t\tfor (int i = 0; i < numberOfPlayers; i++) {\n\t\t\tif (!snakesList.get(i).isDestroyed()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "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 boolean func_149662_c(IBlockState state) { return false; }", "public boolean checkNotDone() {\n boolean notDone = false;\n blocksPut = 0;\n \n for(int y = 0; y < buildHeight+1; y++) {\n for(int z = 0; z < buildSize; z++) {\n for(int x = 0; x < buildSize; x++) {\n if(myIal.lookBlock(x, y, z).equals(\"air\")) {\n notDone = true;\n } else {\n blocksPut++;\n }\n }\n }\n }\n\n return notDone;\n }", "@Override\n\tpublic boolean isSolved () {\n\t\tCube222 solved = new Cube222();\n\t\tfor ( int ctr = 0 ; ctr < state_.length ; ctr++ ) {\n\t\t\tif ( state_[ctr].id() != ctr\n\t\t\t || state_[ctr].frontback() != solved.state_[ctr].frontback()\n\t\t\t || state_[ctr].updown() != solved.state_[ctr].updown()\n\t\t\t || state_[ctr].leftright() != solved.state_[ctr].leftright() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isOver() {\n return this.treeNode.getBuilding().isFinished();\n }", "@Override\r\n public boolean equals(Object obj) {\r\n // check for null\r\n if (obj == null) {\r\n System.out.println(\"State.equals() null fail\");\r\n return false;\r\n }\r\n // check that these objects are both States\r\n if (getClass() != obj.getClass()) {\r\n System.out.println(\"State.equals() class fail\");\r\n return false;\r\n }\r\n // cast to State\r\n State other = (State) obj;\r\n // check if these have the same root stored\r\n if (!this.root.equals(other.root)) {\r\n System.out.println(\"State.equals() root fail\");\r\n return false;\r\n }\r\n // check if these have the same exit state\r\n if (this.getExit() != (other.getExit())) {\r\n System.out.println(\"State.equals() exit fail\");\r\n return false;\r\n }\r\n // check if these have the same directory stack\r\n if (!this.directoryStack.equals(other.directoryStack)) {\r\n System.out.println(\"State.equals() dirStack fail\");\r\n return false;\r\n }\r\n // check if these have the same working directory\r\n return this.getWorkingDirectory().equals(other.getWorkingDirectory());\r\n }", "public boolean isFullyCovered() {\n for (boolean i:mCovered) {\n if (!i) return false;\n }\n return true;\n }", "@SuppressWarnings(\"SameReturnValue\")\n public boolean checkInvariant() {\n if (layerList.isEmpty()) {\n throw new IllegalStateException(\"no layer in \" + getName());\n }\n if (activeLayer == null) {\n throw new IllegalStateException(\"no active layer in \" + getName());\n }\n if (!layerList.contains(activeLayer)) {\n throw new IllegalStateException(\"active layer (\" + activeLayer.getName() + \") not in list (\" + layerList.toString() + \")\");\n }\n return true;\n }", "private boolean hasCycle() {\n\t\tNode n = head;\n\t\tSet<Node> nodeSeen = new HashSet<>();\n\t\twhile (nodeSeen != null) {\n\t\t\tif (nodeSeen.contains(n)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tnodeSeen.add(n);\n\t\t\t}\n\t\t\tn = n.next;\n\t\t}\n\t\treturn false;\n\t}", "private void updateNodes(){\n ArrayList<Node> tempBoard = new ArrayList<>();\n\n for(int i = 0; i < board.size(); i++){\n Node node = new Node(board.get(i).getCoordinates());\n\n tempBoard.add(node);\n }\n\n\n //check each node for number of live nodes next to it to determine next iteration\n for(int i = 0; i < board.size(); i++){\n int liveCount = 0;\n\n Coordinate current = board.get(i).getCoordinates();\n\n Coordinate above = new Coordinate(current.getX(), current.getY() - 1);\n if(searchBoard(above) != -1){\n Node aboveNode = board.get(searchBoard(above));\n if(aboveNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bellow = new Coordinate(current.getX(), current.getY() + 1);\n if(searchBoard(bellow) != -1){\n Node bellowNode = board.get(searchBoard(bellow));\n if(bellowNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate right = new Coordinate(current.getX() + 1, current.getY());\n if(searchBoard(right) != -1){\n Node rightNode = board.get(searchBoard(right));\n if(rightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate left = new Coordinate(current.getX() - 1, current.getY());\n if(searchBoard(left) != -1){\n Node leftNode = board.get(searchBoard(left));\n if(leftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topLeft = new Coordinate(current.getX() - 1, current.getY() - 1);\n if(searchBoard(topLeft) != -1){\n Node topLeftNode = board.get(searchBoard(topLeft));\n if(topLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate topRight = new Coordinate(current.getX() + 1, current.getY() - 1);\n if(searchBoard(topRight) != -1){\n Node topRightNode = board.get(searchBoard(topRight));\n if(topRightNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomLeft = new Coordinate(current.getX() - 1, current.getY() + 1);\n if(searchBoard(bottomLeft) != -1){\n Node bottomLeftNode = board.get(searchBoard(bottomLeft));\n if(bottomLeftNode.getState()){\n liveCount++;\n }\n }\n\n Coordinate bottomRight = new Coordinate(current.getX() + 1, current.getY() + 1);\n if(searchBoard(bottomRight) != -1){\n Node bottomRightNode = board.get(searchBoard(bottomRight));\n if(bottomRightNode.getState()){\n liveCount++;\n }\n }\n\n //determine if node is alive or dead in next frame\n if(board.get(i).getState()){\n if(liveCount <= 1){\n tempBoard.get(i).setState(false);\n } else if(liveCount >= 3){\n tempBoard.get(i).setState(false);\n } else {\n tempBoard.get(i).setState(true);\n }\n } else {\n if(liveCount == 3){\n tempBoard.get(i).setState(true);\n } else {\n tempBoard.get(i).setState(false);\n }\n }\n }\n\n //update current board with new states\n for(int i = 0; i < tempBoard.size(); i++){\n board.get(i).setState(tempBoard.get(i).getState());\n }\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\tif (this == obj)\n\t\t\treturn true;\n\t\tif (obj == null)\n\t\t\treturn false;\n\t\tif (getClass() != obj.getClass())\n\t\t\treturn false;\n\t\tState other = (State) obj;\n\t\tif (state_rep == null) {\n\t\t\tif (other.state_rep != null)\n\t\t\t\treturn false;\n\t\t} else if (!state_rep.equals(other.state_rep))\n\t\t\treturn false;\n\t\treturn true;\n\t}", "private static boolean isStackEmpty(SessionState state)\n\t{\n\t\tStack operations_stack = (Stack) state.getAttribute(STATE_SUSPENDED_OPERATIONS_STACK);\n\t\tif(operations_stack == null)\n\t\t{\n\t\t\toperations_stack = new Stack();\n\t\t\tstate.setAttribute(STATE_SUSPENDED_OPERATIONS_STACK, operations_stack);\n\t\t}\n\t\treturn operations_stack.isEmpty();\n\t}", "public void checkIn() {\n\t}", "public boolean hasState() {\n return fieldSetFlags()[3];\n }", "public boolean hasState() {\n return fieldSetFlags()[3];\n }", "public static void ensureCheckoutNode(Node n) {\n try {\n if (!n.isCheckedOut() || (n.isNew() && !checkedOutNodes.get().contains(n))) {\n log.debug(\"***** checking out node: {}\", n);\n }\n \n // Checking out an already checked-out node is a no-op.\n JcrVersionUtil.checkout(n);\n checkedOutNodes.get().add(n);\n } catch (RepositoryException e) {\n throw new MetadataRepositoryException(\"Unable to checkout node: \" + n, e);\n }\n }", "public boolean func_149686_d(IBlockState state) { return false; }", "public boolean checkIn()\r\n\t{\r\n\t\tif(this.status == 'B')\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "private NFAState checkIfExists(String name) {\n\t\tNFAState ret = null;\n\t\tfor(NFAState s : states){\n\t\t\tif(s.getName().equals(name)){\n\t\t\t\tret = s;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "private boolean isBoardFull() {\n for (int i = 0; i < 3; i++) {\n for (int j = 0; j < 3; j++) {\n if (boardState[i][j] != 'X' && boardState[i][j] != 'O') {\n return false; \n }\n }\n }\n return true; \n }", "public boolean getContainsKey(String state) {\r\n boolean result = table.containsKey(state);//calling containsKey method to check is required \r\n //state is present\r\n return result;\r\n }", "boolean repOk() {\n Set<Node> visited = new HashSet<Node>();\n Node n = header;\n while (n != null) {\n if (!visited.add(n)) {\n return false;\n }\n n = n.next;\n }\n return true;\n }", "private NFAState checkIfExists(String name) {\r\n\t\tNFAState ret = null;\r\n\t\tfor (NFAState s : states) {\r\n\t\t\tif (s.getName().equals(name)) {\r\n\t\t\t\tret = s;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public boolean correctCheckConnectGraph(ArrayList<MECountry> countryArr){\n Queue<String> queue = new LinkedList<String>();\n\n //If it is a empty map.\n if(countryArr.isEmpty()){\n return true;\n }\n\n HashMap<String,Boolean> visited = new HashMap<String,Boolean>();\n for(int i=0 ; i<countryArr.size(); i++ ){\n String countryTemp = countryArr.get(i).getCountryName();\n visited.put(countryTemp,false);\n }\n String firstCountry = countryArr.get(0).getCountryName();\n queue.offer(firstCountry);\n //bfs\n while(!queue.isEmpty()){\n String queueHead = queue.poll();\n visited.put(queueHead, Boolean.TRUE);\n for(int j=0 ;j<countryArr.size();j++){\n if(countryArr.get(j).getCountryName().equals(queueHead)){\n String countryNeighbor = countryArr.get(j).getNeighbor();\n countryNeighbor = countryNeighbor.replaceAll(\"\\\\[\",\"\");\n countryNeighbor = countryNeighbor.replaceAll(\"\\\\]\",\"\");\n countryNeighbor = countryNeighbor.replaceAll(\", \",\",\");\n String[] countryNeighbors = countryNeighbor.split(\",\");\n for(int k = 1;k<countryNeighbors.length;k++){\n String readyToAddInQueue = countryNeighbors[k];\n if(visited.get(readyToAddInQueue)==false){\n queue.offer(readyToAddInQueue);\n }\n }\n }\n }\n }\n for (String key: visited.keySet()) {\n if(visited.get(key)==false){\n checkFlagCG = false;\n break;\n }\n }\n return checkFlagCG;\n }", "@Override\n public boolean equals(Object obj){\n \tState s=(State) obj;\n if (this.state==s.getState())\n \treturn true;\n else\n \treturn false;\n \t\t\n }", "public boolean checkExplosiveState () { return isExploding;}", "public boolean referencesInState(ResourceState ... expectedRefStates) throws DependencyException {\n\t\tfor (DependencyElement refEl : references) {\n\t\t\tif (refEl.resource == null) {\n\t\t\t\tthrow new DependencyException(\"Could not locate ResourceMetadata for \" + refEl);\n\t\t\t}\n\t\t\t\n\t\t\tboolean found = false;\n\t\t\tfor (int i = 0; i < expectedRefStates.length; i++) {\n\t\t\t\tif (refEl.resource.getState().isEquivalent(expectedRefStates[i])) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\tlog.info(refEl + \" is in state [\" + refEl.resource.getState() + \"], expected [\" + Arrays.asList(expectedRefStates) + \"]\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isStateActive(State state) {\n\t\tswitch (state) {\n\t\t\tcase mainRegion_State1 :\n\t\t\t\treturn stateVector[0] == State.mainRegion_State1;\n\t\t\tcase mainRegion_State2 :\n\t\t\t\treturn stateVector[0].ordinal() >= State.mainRegion_State2.ordinal()\n\t\t\t\t\t\t&& stateVector[0].ordinal() <= State.mainRegion_State2__region0_State5.ordinal();\n\t\t\tcase mainRegion_State2__region0_a :\n\t\t\t\treturn stateVector[0] == State.mainRegion_State2__region0_a;\n\t\t\tcase mainRegion_State2__region0_State4 :\n\t\t\t\treturn stateVector[0].ordinal() >= State.mainRegion_State2__region0_State4.ordinal() && stateVector[0]\n\t\t\t\t\t\t.ordinal() <= State.mainRegion_State2__region0_State4__region0_State7__region0_State9.ordinal();\n\t\t\tcase mainRegion_State2__region0_State4__region0_State6 :\n\t\t\t\treturn stateVector[0] == State.mainRegion_State2__region0_State4__region0_State6;\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7 :\n\t\t\t\treturn stateVector[0].ordinal() >= State.mainRegion_State2__region0_State4__region0_State7.ordinal()\n\t\t\t\t\t\t&& stateVector[0]\n\t\t\t\t\t\t\t\t.ordinal() <= State.mainRegion_State2__region0_State4__region0_State7__region0_State9\n\t\t\t\t\t\t\t\t\t\t.ordinal();\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7__region0_State8 :\n\t\t\t\treturn stateVector[0] == State.mainRegion_State2__region0_State4__region0_State7__region0_State8;\n\t\t\tcase mainRegion_State2__region0_State4__region0_State7__region0_State9 :\n\t\t\t\treturn stateVector[0] == State.mainRegion_State2__region0_State4__region0_State7__region0_State9;\n\t\t\tcase mainRegion_State2__region0_State5 :\n\t\t\t\treturn stateVector[0] == State.mainRegion_State2__region0_State5;\n\t\t\tdefault :\n\t\t\t\treturn false;\n\t\t}\n\t}", "private boolean checkNext(){\n boolean ret = this.hasNext;\n if ((this.allStatesIterator.hasNext()) || (this.allSubsetsIterator.hasNext()) || (this.allTransitionsIterator.hasNext())){\n hasNext = true;\n return hasNext;\n }\n hasNext = false;\n return ret;\n }" ]
[ "0.6597909", "0.6507966", "0.63168424", "0.63168424", "0.63168424", "0.63168424", "0.63168424", "0.63168424", "0.63168424", "0.63168424", "0.61831105", "0.6175408", "0.60816413", "0.60521287", "0.60382247", "0.5975571", "0.5945758", "0.5847908", "0.58098376", "0.5805718", "0.57736355", "0.57128984", "0.5696959", "0.56825256", "0.5679328", "0.5642756", "0.5626072", "0.5603881", "0.5579034", "0.5577703", "0.55658704", "0.5557981", "0.55333436", "0.5523679", "0.54994494", "0.5478767", "0.5468711", "0.54555017", "0.5446247", "0.5443024", "0.5436169", "0.54204226", "0.5417447", "0.541342", "0.5401876", "0.539769", "0.5395937", "0.5384876", "0.53716034", "0.53680974", "0.53488284", "0.53423333", "0.5338389", "0.5332112", "0.5328755", "0.5324981", "0.5323291", "0.5308634", "0.5308567", "0.53021824", "0.5301269", "0.529325", "0.5292023", "0.5292023", "0.5292023", "0.5292023", "0.5292023", "0.5281835", "0.5281835", "0.5279643", "0.5259866", "0.5252319", "0.5248083", "0.5231638", "0.52287173", "0.5213754", "0.5208909", "0.51975024", "0.51852846", "0.5183348", "0.5182751", "0.518202", "0.5177136", "0.5171342", "0.5168892", "0.5168892", "0.51686", "0.51632524", "0.51623154", "0.5161781", "0.51607186", "0.51594573", "0.5159412", "0.51555264", "0.5154754", "0.5154753", "0.51514614", "0.5148618", "0.51461303", "0.5135972" ]
0.5783013
20
Compares if they are same or not
private static boolean areTheyEqual(int[][] tempArray, int[][] array2) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { if (tempArray[i][j] != array2[i][j]) { return false; } } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boolean hasSameAs();", "@Test\n void compareTo_Identical_AllParts()\n {\n runIsMatchTest(AnswerType.yes, AnswerType.yes, AnswerType.yes, AnswerType.yes, ContactMatchType.Identical);\n }", "private boolean checkComp() {\n\t\tfor (int i = 0; i < comp.length; i++) {\n\t\t\tfor (int j = 0; j < comp[i].length; j++) {\n\t\t\t\tif (comp[i][j] != answer[i][j]) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public boolean isSame(){\r\n\t\tHugeInt mod2 = new HugeInt(this.p);\r\n\t\tmod2.modByHugeInt(new HugeInt(\"2\"));\r\n\t\tmod2.printHugeInt();\r\n\t\t\r\n\t\tHugeInt mod3 = new HugeInt(this.p);\r\n\t\tmod3.modByHugeInt(new HugeInt(\"3\"));\r\n\t\t\r\n\t\tif(this.p.compareHugeInts(this.p, new HugeInt(\"1\")) != -1)\r\n\t\t\tSystem.out.println(\"less than or equal to 1\");\r\n\t\telse if(this.p.compareHugeInts(this.p, new HugeInt(\"3\")) != -1)\r\n\t\t\tSystem.out.println(\"greater than 1 but less than 3\");\r\n\t\telse if(mod2.areAllZeros() || mod3.areAllZeros())\r\n\t\t\tSystem.out.println(\"mod by 2 or 3\");\r\n\t\t\r\n\t\treturn true;\r\n\t}", "private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }", "public void testComparisons() {\n\tfinal double small = Math.pow(2.0, -42);\n\n\t// Input: a, b\n\tdouble[][] input = new double[][] { new double[] { 1, 1 },\n\t\tnew double[] { 1, 2 }, new double[] { 1, 1 - small / 10 },\n\t\tnew double[] { 1, 1 + small / 10 },\n\n\t\tnew double[] { 0, 1 }, new double[] { 0, 0 },\n\t\tnew double[] { 0, -1 }, new double[] { 0, small / 100 },\n\t\tnew double[] { 2100000001.0001, 2100000001.0003 }, };\n\n\t// Output: less, equals\n\tboolean[][] output = new boolean[][] { new boolean[] { false, true },\n\t\tnew boolean[] { true, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, true },\n\n\t\tnew boolean[] { true, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, false }, new boolean[] { false, true },\n\t\tnew boolean[] { false, true }, };\n\n\tfor (int i = 0; i < input.length; ++i) {\n\t boolean l = StandardFloatingPointComparator.getDouble().less(\n\t\t input[i][0], input[i][1]);\n\t boolean e = StandardFloatingPointComparator.getDouble().equals(\n\t\t input[i][0], input[i][1]);\n\n\t boolean ne = StandardFloatingPointComparator.getDouble().notEquals(\n\t\t input[i][0], input[i][1]);\n\t boolean le = StandardFloatingPointComparator.getDouble()\n\t\t .lessOrEquals(input[i][0], input[i][1]);\n\t boolean g = StandardFloatingPointComparator.getDouble().greater(\n\t\t input[i][0], input[i][1]);\n\t boolean ge = StandardFloatingPointComparator.getDouble()\n\t\t .greaterOrEquals(input[i][0], input[i][1]);\n\n\t boolean less = output[i][0];\n\t boolean equals = output[i][1];\n\n\t boolean notEquals = !equals;\n\t boolean lessOrEquals = less || equals;\n\t boolean greater = !lessOrEquals;\n\t boolean greaterOrEquals = !less;\n\n\t assertFalse(l != less);\n\t assertFalse(g != greater);\n\t assertFalse(e != equals);\n\t assertFalse(ne != notEquals);\n\t assertFalse(le != lessOrEquals);\n\t assertFalse(ge != greaterOrEquals);\n\t}\n }", "private boolean isEqual(int[] x, int[] y) {\n for (int i = 0; i < 3; i++) {\n if (x[i] != y[i]) {\n return false;\n }\n }\n return true;\n }", "private boolean eq(int[] a,int[] b){\n\t\tboolean eq = true;\n\t\tif(a.length != b.length) return false;\n\t\tfor(int i=0;i<a.length;i++){\n\t\t\tif( a[i] != b[i] ){\n\t\t\t\teq = false;\n\t\t\t\tbreak;\n\t\t\t}else{\n\n\t\t\t}\n\t\t}\n\t\treturn eq;\n\t}", "private boolean compareMomenta(int[] a, int[] b){\n return ((a[0] == b[0]) &&\n (a[1]) == b[1]) ;\n }", "@Test\n public void codonCompare1(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(a);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(b);\n int expected = 0;\n assertEquals(expected, first.codonCompare(second));\n }", "void compareDataStructures();", "private static boolean areEqual (byte[] a, byte[] b) {\r\n int aLength = a.length;\r\n if (aLength != b.length)\r\n return false;\r\n for (int i = 0; i < aLength; i++)\r\n if (a[i] != b[i])\r\n return false;\r\n return true;\r\n }", "private boolean compareMatrix(int[][] result , int[][] expected){\n if(result.length != expected.length || result[0].length != expected[0].length){\n return false;\n }\n for(int i=0;i<result.length;i++){\n for(int j=0;j<result[0].length;j++){\n\n if(result[i][j] != expected[i][j]){\n return false;\n }\n }\n }\n return true;\n }", "static boolean areIdentical(Line l1, Line l2) {\n return areParallel(l1, l2) && (Math.abs(l1.c - l2.c) < EPS);\n }", "private static boolean slowEquals(final byte[] a, final byte[] b) {\n int diff = a.length ^ b.length;\n for (int i = 0; i < a.length && i < b.length; i++) {\n diff |= a[i] ^ b[i];\n }\n return diff == 0;\n }", "private boolean isValuesEqual(BinaryMessage tocmp, BinaryMessage original) {\n\t\tif(tocmp.getValue().equals(original.getValue())) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }", "private Comparison checkEquality(SimpleNode node1, SimpleNode node2) {\n // Compare the classes.\n Comparison comparison = compareClasses(node1, node2);\n if (!comparison.isEqual()) {\n return comparison;\n }\n\n // Compare the values.\n comparison = compareValues(node1, node2);\n if (!comparison.isEqual()) {\n return comparison;\n }\n\n // Compare the images.\n comparison = compareImages(node1, node2);\n if (!comparison.isEqual()) {\n return comparison;\n }\n\n // Compare the children.\n return compareChildren(node1, node2);\n }", "public boolean DEBUG_compare(Alphabet other) {\n System.out.println(\"now comparing the alphabets this with other:\\n\"+this+\"\\n\"+other);\n boolean sameSlexic = true;\n for (String s : other.slexic.keySet()) {\n if (!slexic.containsKey(s)) {\n sameSlexic = false;\n break;\n }\n if (!slexic.get(s).equals(other.slexic.get(s))) {\n sameSlexic = false;\n break;\n }\n slexic.remove(s);\n }\n System.out.println(\"the slexic attributes are the same : \" + sameSlexic);\n boolean sameSlexicinv = true;\n for (int i = 0, limit = other.slexicinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = slexicinv.size() + i; j < limit2; j++) {\n int k = j % slexicinv.size();\n if (other.slexicinv.get(i).equals(slexicinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSlexicinv = false;\n break;\n }\n\n }\n boolean sameSpair = true;\n System.out.println(\"the slexicinv attributes are the same : \" + sameSlexicinv);\n for (IntegerPair p : other.spair.keySet()) {\n if(!spair.containsKey(p)) {\n //if (!containsKey(spair, p)) {\n sameSpair = false;\n break;\n }\n //if (!(get(spair, p).equals(get(a.spair, p)))) {\n if (!spair.get(p).equals(other.spair.get(p))) {\n sameSpair = false;\n break;\n }\n }\n System.out.println(\"the spair attributes are the same : \" + sameSpair);\n boolean sameSpairinv = true;\n for (int i = 0, limit = other.spairinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = spairinv.size() + i; j < limit2; j++) {\n int k = j % spairinv.size();\n if (other.spairinv.get(i).equals(spairinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSpairinv = false;\n break;\n }\n }\n System.out.println(\"the spairinv attributes are the same : \" + sameSpairinv);\n return (sameSpairinv && sameSpair && sameSlexic && sameSlexicinv);\n }", "private boolean slowEquals(byte[] a, byte[] b)\n {\n int diff = a.length ^ b.length;\n for(int i = 0; i < a.length && i < b.length; i++)\n diff |= a[i] ^ b[i];\n return diff == 0;\n }", "public static boolean same(int[] a, int[] b) {\r\n \treturn (a[0] == b[0] && a[1] == b[1]) || (a[0] == b[1] && a[1] == b[0]);\r\n }", "private static boolean slowEquals(byte[] a, byte[] b) {\r\n int diff = a.length ^ b.length;\r\n for (int i = 0; i < a.length && i < b.length; i++) {\r\n diff |= a[i] ^ b[i];\r\n }\r\n return diff == 0;\r\n }", "private static boolean compare(BufferedInputStream b1, BufferedInputStream b2) throws IOException {\n\t\tint cmp1 = 0, cmp2;\r\n\t\tbyte[] i = new byte[100];\r\n\t\tbyte[] j = new byte[100];\r\n\t\t\r\n\t\twhile(cmp1 != -1){\r\n\t\t\tcmp1 = b1.read(i, 0, i.length);\r\n\t\t\tcmp2 = b2.read(j, 0, j.length);\r\n\t\t\tif(cmp1 != cmp2){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(int k = 0; k < cmp1; k++){\r\n\t\t\t\tif(i[k] != j[k]){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "static boolean areSame(String expr1, String expr2)\n\t{\n\n\t\t// Create a vector for all operands and\n\t\t// initialize the vector as 0.\n\t\tint[] v = new int[MAX_CHAR];\n\n\t\t// Put signs of all operands in expr1\n\t\teval(expr1, v, true);\n\n\t\t// Subtract signs of operands in expr2\n\t\teval(expr2, v, false);\n\n\t\t// If expressions are same, vector must\n\t\t// be 0.\n\t\tfor (int i = 0; i < MAX_CHAR; i++)\n\t\t\tif (v[i] != 0)\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "private static boolean slowEquals(byte[] a, byte[] b) {\n\t int diff = a.length ^ b.length;\n\t for(int i = 0; i < a.length && i < b.length; i++)\n\t diff |= a[i] ^ b[i];\n\t return diff == 0;\n\t }", "public static void main(String[] args) {\n int n1 = 0;\n int n2 = 0;\n int n3 = 0;\n if (n1 == n2 && n1 != n3) {\n System.out.println(\"n1 and n2 equal\");\n } else if (n2 == n3 && n2 != n1) {\n System.out.println(\"n2 and n3 equal\");\n } else if (n3 == n1 && n1 != n2) {\n System.out.println(\"n3 and n1 equal\");\n } else if (n1 == n2 && n1 == n3) {\n System.out.println(\"all equal\");\n }\n else {\n System.out.println(\"none equal\");\n }\n }", "public static void compare () {\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++) {\r\n if (d[i][j] != adjacencyMatrix[i][j])// here \r\n {\r\n System.out.println(\"Comparison failed\");\r\n \r\n return;\r\n }\r\n }\r\n }\r\n System.out.println(\"Comparison succeeded\");\r\n }", "public boolean check() {\n BigInteger t1 = y.modPow(int2, c.p);\n BigInteger t2 = x.modPow(int3, c.p);\n BigInteger t3 = ((t2.add(c.a.multiply(x))).add(c.b)).mod(c.p);\n return t1.compareTo(t3) == 0;\n }", "static boolean bigint_eq(bigint a, bigint b)\n {\n if (a.bigint_sign != b.bigint_sign)\n return false;\n else if (a.bigint_len != b.bigint_len)\n return false;\n else\n {\n for (int i = 0; i < a.bigint_len; i++)\n if (a.bigint_chiffres[i] != b.bigint_chiffres[i])\n return false;\n return true;\n }\n }", "private boolean inSameSuit() {\n for (int i = 0; i < cards.length-2; i++) {\n if (cards[i].charAt(1) != cards[i + 1].charAt(1)) {\n return false;\n }\n }\n \n return true;\n }", "public boolean isEquals() {\n long len = -1L;\n\n //1. check the lengths of the words\n for(S left : slp.getAxioms()) {\n if(len == -1L) {\n len = slp.length(left);\n }\n else {\n if(len != slp.length(left)) {\n return false;\n }\n }\n }\n\n // all words are the empty word\n if(len == 0) {\n return true;\n }\n\n // 2. the length are all equals and not zero => execute the recompression\n execute();\n\n S otherSymbol = null;\n boolean first = true;\n\n // 3. chech now if for all axioms X : |val(X)| = 1 and all val(X) are equals.\n for(S left : slp.getAxioms()) {\n if(first) {\n slp.length(left, true);\n first = false;\n }\n\n if(slp.length(left) != 1) {\n return false;\n }\n else {\n S symbol = slp.get(left, 1);\n if(otherSymbol == null) {\n otherSymbol = symbol;\n }\n\n if(!symbol.equals(otherSymbol)) {\n return false;\n }\n }\n }\n\n return true;\n }", "static void compare()\n {\n \tif(a < c)\n\t\t {\n\t\t\t comp_one = 1; //store this value , else zero default \n\t\t }\n\t\t if(c < b)\n\t\t {\n\t\t\t comp_two = 2; //store this value , else zero default\n\t\t }\n\t\t if(b < a)\n\t\t {\n\t\t\t comp_thr = 5; //store this value , else zero default\n\t\t }\n\t\t \n\t\t comp_val = comp_one + comp_two + comp_thr; //create a unique value by addition\n }", "boolean hasIsEquivalent();", "public void testCompare6() throws Exception {\r\n ComponentCompetitionSituation situation1 = new ComponentCompetitionSituation();\r\n situation1.setPostingDate(new Date());\r\n situation1.setEndDate(new Date(situation1.getPostingDate().getTime() + 100000));\r\n situation1.setPrize(200D);\r\n\r\n ComponentCompetitionSituation situation2 = new ComponentCompetitionSituation();\r\n situation2.setPostingDate(new Date());\r\n situation2.setEndDate(new Date(situation2.getPostingDate().getTime() + 100000));\r\n situation2.setPrize(200D);\r\n\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation1, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation2, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be == 0\r\n assertTrue(\"result of compare\", result == 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "public static void main(String[] args) {\n int[] a = {4, 6, 3};\n int[] b = {6, 4, 3};\n System.out.println(areSimilar(a, b));\n\n }", "@Test\n public void aminoCompareTest2() {\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(c);\n int expected = 0;\n assertEquals(expected, first.aminoAcidCompare(second));\n }", "boolean test() {\n int comp = this._col1.value().compareTo(this._col2.value());\n if (comp < 0 && (this.compRep & LT) != 0\n || comp > 0 && (this.compRep & GT) != 0\n || comp == 0 && (this.compRep & EQ) != 0) {\n return true;\n }\n return false;\n }", "@Test\n\tpublic void testEqualityCheck() {\n\t\tadd(\"f(x)=x^3\");\n\t\tadd(\"g(x)=-x^3\");\n\t\tt(\"f==g\", \"false\");\n\t\tt(\"f!=g\", \"true\");\n\t\tt(\"f==-g\", \"true\");\n\t\tt(\"f!=-g\", \"false\");\n\t}", "public void testCompare2() throws Exception {\r\n ComponentCompetitionSituation situation = new ComponentCompetitionSituation();\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(0.6D,\r\n situation, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // predictions in range < predictions below the range\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "public static void main(String[] args) {\n // Reflexive\n System.out.println(o.equals(o));\n System.out.println(r.equals(r));\n\n // Symmetric\n System.out.println(o.equals(p) + \" = \" + p.equals(o));\n System.out.println(r.equals(s) + \" = \" + s.equals(r));\n\n // Transitive\n System.out.println(o.equals(p) + \" = \" + p.equals(q) + \" = \" + o.equals(q));\n System.out.println(r.equals(s) + \" = \" + s.equals(t) + \" = \" + r.equals(t));\n\n // Comparing Point to ColorPoint\n System.out.println(p.equals(s.asPoint()));\n System.out.println(s.asPoint().equals(p));\n }", "public boolean checkEquality(){\n boolean flag = true;\n for (int i = 0; i < boardRows ; i++) {\n for (int j = 0; j < boardColumns; j++) {\n if(this.currentBoardState[i][j] != this.goalBoardState[i][j]){\n flag = false;\n }\n }\n }\n return flag;\n }", "public boolean checker(Object primObj, Object equalObj, Object diffObj) {\n logger.log(Level.FINE, \"Primary object:: \" + primObj);\n logger.log(Level.FINE,\n \"Object that is equal to the primary one:: \" + equalObj);\n logger.log(Level.FINE,\n \"Object that is different from the primary one:: \" + diffObj);\n\n if (!primObj.equals(equalObj)) {\n logger.log(Level.FINE, primObj + \" isn't equal to \" + equalObj);\n return false;\n }\n\n if (primObj.equals(diffObj)) {\n logger.log(Level.FINE, primObj + \" is equal to \" + diffObj);\n return false;\n }\n\n /*\n * Check that toString() method invoked twice on the same object\n * produces equal String objects\n */\n logger.log(Level.FINE,\n \"Check that toString() method invoked twice on the same object\"\n + \" produces equal String objects ...\");\n String str1 = primObj.toString();\n String str2 = primObj.toString();\n\n if (!(str1.equals(str2))) {\n logger.log(Level.FINE,\n \"toString() method invoked twice on the same object\"\n + \" produces non-equal String objects:\\n\" + str1 + \"\\n\"\n + str2);\n return false;\n }\n logger.log(Level.FINE, \"\\tpassed\");\n\n /*\n * Check that 2 equal objects have equal string representations\n */\n logger.log(Level.FINE,\n \"Check that 2 equal objects have equal string\"\n + \" representations ...\");\n String primObj_str = primObj.toString();\n String equalObj_str = equalObj.toString();\n\n if (!(primObj_str.equals(equalObj_str))) {\n logger.log(Level.FINE,\n \"2 equal objects have non-equal string representations:\\n\"\n + primObj_str + \"\\n\" + equalObj_str);\n return false;\n }\n logger.log(Level.FINE, \"\\tpassed\");\n return true;\n }", "static boolean Isosceles(long AA, long BB, long CC){\n if((AA==BB)||((AA==CC)||(BB==CC)))\n return true;\n else\n return false;\n }", "private int compareInternal(String shorter, String longer) {\n int lengthDiff = longer.length() - shorter.length();\n\n for (int compareStartIndexInsideLonger = 0; compareStartIndexInsideLonger <= lengthDiff; compareStartIndexInsideLonger++) {\n String compariosonPartFromLonger = longer.substring(compareStartIndexInsideLonger, compareStartIndexInsideLonger + shorter.length());\n //we have found an answer if they are not equal\n int result = shorter.compareTo(compariosonPartFromLonger);\n if (result != 0) {\n return result;\n }\n }\n\n //the are equal\n return 0;\n }", "@org.testng.annotations.Test\n public void test_equals_Symmetric()\n throws Exception {\n CategorieClient categorieClient = new CategorieClient(\"denis\", 1000, 10.2, 1.1, 1.2, false);\n Client x = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Client y = new Client(\"Denis\", \"Denise\", \"Paris\", categorieClient);\n Assert.assertTrue(x.equals(y) && y.equals(x));\n Assert.assertTrue(x.hashCode() == y.hashCode());\n }", "private boolean compare(ValueType first, ValueType second) {\r\n // TODO\r\n return false;\r\n }", "public static void main(String[] args) {\n Pair first = new Pair(\"Pesho\", \"Gosho\");\r\n Pair second = new Pair(\"Pesho\", \"Gosho\");\r\n Pair third = new Pair(\"Pesho\", \"Mariika\");\r\n \r\n System.out.println(first.equals(second));\r\n System.out.println(first.equals(third));\r\n }", "private static boolean compareList(List<Object> l1, List<Object> l2)\n {\n int count=0;\n for (Object o : l1)\n {\n Object temp = o;\n for (Object otemp : l2)\n {\n if (EqualsBuilder.reflectionEquals(temp, otemp))\n {\n count++;\n }\n }\n\n }\n\n if(count == l1.size()) return true;\n return false;\n\n }", "public boolean isEqual(MatchingCardsTile other){\n return this.getNumber() == other.getNumber();\n }", "private boolean identicalAtoms(IAtomContainer molecule1, List<IAtomContainer> fragsToCompare) {\n\t\n \tfor (int i = 0; i < fragsToCompare.size(); i++) {\n \t\t//no match\n \t\tif (molecule1.getBondCount() != fragsToCompare.get(i).getBondCount() && molecule1.getAtomCount() != fragsToCompare.get(i).getAtomCount()) \n \t\t{\n \t\t\tcontinue;\n \t\t}\n \t\t\n\n \t\tint n = 0;\n \t\t//array storing all already tried atoms\n \t\tboolean[] doneAtoms = new boolean[atomsContained + 1];\n \t\tfor (int j = 0; j < molecule1.getAtomCount(); j++) {\n \t\t\tfor (int k = 0; k < fragsToCompare.get(i).getAtomCount(); k++) \n \t\t\t{\n \t\t\t\t//compare atoms by symbol, thus only check for the same sum formula --> EXPERIMENTAL\n \t\t\t\tif(molecularFormulaRedundancyCheck)\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).getSymbol().equals(fragsToCompare.get(i).getAtom(k).getSymbol()) &&\n \t\t\t\t\t\t\t!doneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())]) {\n \t\t\t\t\tn++;\n \t\t\t\t\tdoneAtoms[Integer.parseInt(fragsToCompare.get(i).getAtom(k).getID())] = true;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t} \t\t\t\t\n \t\t\t\t//normal test creates way more fragments!\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\tif (molecule1.getAtom(j).equals(fragsToCompare.get(i).getAtom(k))) {\n \t\t\t\t\tn++;\n \t\t\t\t\tbreak;\n \t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tif(n == molecule1.getAtomCount())\n \t\t\treturn true;\n\t\t}\n\t //no match found\n\t\treturn false;\n\t}", "public boolean same(GameState c, GameState g) \n\t{\n\t\tfor(int x = 0; x<18; x++) //loop through the boards\n\t\t{\n\t\t\tif(c.getBoard()[x] != g.getBoard()[x]) //if one value is not the same in the afrra return false\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;//if they all are the same return true\n\t}", "private boolean comps(int a, int b){\n\t\tthis.comparisons.add(new Integer[]{a, b});\n\t\treturn true;\n\t}", "public void testCompare1() throws Exception {\r\n ComponentCompetitionSituation situation = new ComponentCompetitionSituation();\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(1.5D,\r\n situation, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // predictions in range < predictions above the range\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "public boolean allDuplicatesEqual() {\n int[] input = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};\n int dupA = findDuplicatesA(input);\n int dupB = findDuplicatesB(input);\n int dupC = findDuplicatesC(input);\n int dupD = findDuplicatesD(input);\n int dupE = findDuplicatesE(input);\n return dupA == dupB && dupA == dupC && dupA == dupD && dupA == dupE;\n }", "@Test\n public void testIsSameNumber() {\n int x = 1;\n int y = 1;\n int z = 2;\n\n assertEquals(true, Flik.isSameNumber(x, y));\n assertEquals(false, Flik.isSameNumber(x, z));\n }", "@Test\n public void aminoCompareTest1(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(d);\n int expected = 1;\n assertEquals(expected, first.aminoAcidCompare(second));\n }", "public void compareAddress()\n {\n Address a = new Address(\"Amapolas\",1500,\"Providencia\",\"Santiago\");\n Address b = new Address(\"amapolas\",1500, \"providencia\",\"santiago\");\n Address c = new Address(\"Hernando Aguirre\",1133,\"Providencia\", \"Santiago\");\n \n boolean d = a.equals(b); \n }", "private static boolean equalityTest1(String a, String b)\n {\n return a == b;\n }", "public void testCompare() throws Exception {\n\n Object testData[][] = {\n { \"aaa\", \"bbb\", -1 },\n { \"aaa\", \"aaa\", 0 },\n { \"bbb\", \"aaa\", 1 },\n { \"aaa\", \"aaa_L1_bbb.lsm\", -1 },\n { \"aaa_L1_bbb.lsm\", \"aaa_L1_bbb.lsm\", 0 },\n { \"aaa_L1_bbb.lsm\", \"aaa\", 1 },\n { \"aaa_L1_bbb.lsm\", \"aaa_L10_bbb.lsm\", -1 },\n { \"aaa_L10_bbb.lsm\", \"aaa_L1_bbb.lsm\", 1 },\n { \"aaa_La_bbb.lsm\", \"aaa_L1_bbb.lsm\", 1 },\n { \"aaa_L2_bbb.lsm\", \"aaa_L10_bbb.lsm\", -1 }\n };\n\n LNumberComparator comparator = new LNumberComparator();\n\n for (Object[] testRow : testData) {\n String name1 = (String) testRow[0];\n String name2 = (String) testRow[1];\n File file1 = new File(name1);\n File file2 = new File(name2);\n int expectedResult = (Integer) testRow[2];\n int actualResult = comparator.compare(new FileTarget(file1),\n new FileTarget(file2));\n\n boolean isValid = ((expectedResult > 0) && (actualResult > 0)) ||\n ((expectedResult < 0) && (actualResult < 0)) ||\n ((expectedResult == 0) && (actualResult == 0));\n\n assertTrue(name1 + \" compared to \" + name2 +\n \" returned invalid result of \" + actualResult +\n \" (should have same sign as \" + expectedResult + \")\",\n isValid);\n }\n\n }", "private static boolean isEqual(int[] nums1, int[] nums2){\n \tfor(int i=0; i<nums1.length; i++){\n \t\tif(nums1[i]!=nums2[i]){\n \t\t\treturn false;\n \t\t}\n \t}\n \treturn true;\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 }", "@Test\n public void codonCompare2(){\n //these list are already sorted\n AminoAcidLL first = AminoAcidLL.createFromRNASequence(c);\n AminoAcidLL second = AminoAcidLL.createFromRNASequence(d);\n int expected = 1;\n assertEquals(expected, first.codonCompare(second));\n\n }", "private static boolean equalityTest5(String a, String b)\n {\n return a.hashCode() == b.hashCode();\n }", "public void testCompare5() throws Exception {\r\n // smaller prizes\r\n ComponentCompetitionSituation situation1 = new ComponentCompetitionSituation();\r\n situation1.setPostingDate(new Date());\r\n situation1.setEndDate(new Date(situation1.getPostingDate().getTime() + 100000));\r\n situation1.setPrize(100D);\r\n\r\n // longer prizes\r\n ComponentCompetitionSituation situation2 = new ComponentCompetitionSituation();\r\n situation2.setPostingDate(new Date());\r\n situation2.setEndDate(new Date(situation2.getPostingDate().getTime() + 100000));\r\n situation2.setPrize(200D);\r\n\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation1, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation2, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // smaller prizes < longer prizes\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "static int ifEquals(int x, int y, int a, int b) { \n //return x==y?a:b; \n return onEqu1(x, y, a, b, ((x-y)-1)>>31);\n }", "public static boolean opposites(Pair[] data){\n HashSet<Pair> hs = new HashSet<>(20, 0.9f);\n for(Pair p : data) {\n if(hs.contains(new Pair(p.b(), p.a())))\n return true;\n hs.add(p);\n }\n return false;\n }", "boolean areTheyEqual(int[] array_a, int[] array_b) {\n if(array_a == null || array_b == null || array_a.length!=array_b.length) return false;\n\n HashMap<Integer,Integer> count = new HashMap<>();\n for(int x : array_a){\n count.put(x, count.getOrDefault(x,0)+1);\n }\n for(int y : array_b){\n count.put(y, count.getOrDefault(y,0)-1);\n if(count.get(y)==0) count.remove(y);\n }\n return count.size()==0;\n }", "public static void main(String[] args) {\n\t\tList l=new ArrayList();\r\n\t\tl.add(12);\r\n\t\tl.add(45);\r\n\t\tl.add(15);\r\n\t\tl.add(78);\r\n\t\t\r\n\t\tList l2=new ArrayList();\r\n\t\tl2.add(12);\r\n\t\tl2.add(45);\r\n\t\tl2.add(10);\r\n\t\tl2.add(78);\r\n\t\t\r\n\t\tBoolean m=l.containsAll(l2);\r\n\t\t\r\n\t\tif(m)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Elements are same\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Not equal\");\r\n\t\t}\r\n\t\t\r\n\r\n\t}", "boolean similarCard(Card c);", "@Test public void equalTest() {\n Dog d = new Dog(\"Owner 1\", \"Rex\", \"Boxer\", 90.0, 7);\n Dog d2 = new Dog(\"Owner 2\", \"Spot\", \"Pit Bull\", 90.0, 7);\n Assert.assertEquals(0, test.compare(d, d2));\n }", "public static boolean slowEquals(byte[] a, byte[] b) {\n int diff = a.length ^ b.length;\n for (int i = 0; i < a.length && i < b.length; i++)\n diff |= a[i] ^ b[i];\n return diff == 0;\n }", "public boolean increaseCompares() {\r\n\t\tthis.compares++;\r\n\t\treturn true;\r\n\t}", "private static boolean equals(int[] array1, int[] array2) {\n if(array1.length != array2.length)\n return false;\n \n Arrays.sort(array1);\n Arrays.sort(array2);\n \n int i = 0;\n for(; i < array1.length; ++i) {\n if(array1[i] != array2[i])\n break;\n }\n \n return (i == array1.length);\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "public boolean isEqual(FusableBooks record1, FusableBooks record2) {\n\t\treturn sim.calculate(record1.getBookName(), record2.getBookName()) == 1.0;\n\t}", "public void testCompare4() throws Exception {\r\n // timelines shorter than or equal to the target\r\n ComponentCompetitionSituation situation1 = new ComponentCompetitionSituation();\r\n situation1.setPostingDate(new Date());\r\n situation1.setEndDate(new Date(situation1.getPostingDate().getTime() + 1000));\r\n\r\n // timelines longer than the target\r\n ComponentCompetitionSituation situation2 = new ComponentCompetitionSituation();\r\n situation2.setPostingDate(new Date());\r\n situation2.setEndDate(new Date(situation2.getPostingDate().getTime() + 100000));\r\n\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation1, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(1.0D,\r\n situation2, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // timelines shorter than or equal to the target < timelines longer than the target\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "public boolean compare_same(String x, String y) {\n\t\tint fuzzy = 0;\n\t\tif (x.length() != y.length()) return false;\n\t\tfor (int i = 0, j = 0; i<x.length() && j<y.length();) {\n\t\t\tif (i>0 && x.charAt(i-1)=='_' && '0'<=x.charAt(i) && x.charAt(i)<='9') {\n\t\t\t\twhile (i<x.length() && '0'<=x.charAt(i) && x.charAt(i)<='9') i++;\n\t\t\t}\n\t\t\tif (j>0 && y.charAt(j-1)=='_' && '0'<=y.charAt(j) && y.charAt(j)<='9') {\n\t\t\t\twhile (j<y.length() && '0'<=y.charAt(j) && y.charAt(j)<='9') j++;\n\t\t\t}\n\t\t\tif (i<x.length() && j<y.length() && x.charAt(i) != y.charAt(j)) {\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti++; j++;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testEqualChars1() {\n char a = 'a';\n char b = 'a';\n char c = 'z';\n char d = 'B';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(a, c);\n boolean result3 = offByOne.equalChars(a, d);\n\n assertFalse(result1);\n assertFalse(result2);\n assertFalse(result3);\n }", "public static boolean timeConstantCompare(byte[] hash1, byte[] hash2) {\n\t\t// Use XOR to compare lengths, if same return 0, else return 1\n\t\tint difference = hash1.length ^ hash2.length;\n\t\tfor (int i = 0; i < hash1.length && i < hash2.length; i++) {\n\t\t\t// |= Execution time does not depend on equality of integers\n\t\t\tdifference |= hash1[i] ^ hash2[i];\n\t\t}\n\t\treturn difference == 0; // Returns true if all XOR operations returned\n\t\t\t\t\t\t\t\t// 0, if one XOR returned 1 it will return false\n\t}", "boolean compare(Object targetOne, Object targetTwo);", "public void testCompareBoolean() {\n\t\tboolean one = true;\n\t\tboolean two = false;\n\t\t//false ist kleiner wie true\n\t\tassertTrue(comp.compareBoolean(two, one) == -1);\n\t\tassertTrue(comp.compareBoolean(one, one) == 0);\n\t\tassertTrue(comp.compareBoolean(two, two) == 0);\n\t\tassertTrue(comp.compareBoolean(one, two) == 1);\n\t}", "@Test\n\tpublic void testSampleEquals() {\n\n\t\tassertTrue(square.equals(squareRotate));\n\t\t\n\t\tassertTrue(pyr1.equals(pyr5));\n\t\t\n\t\tassertTrue(s.equals(sInitial));\n\t\tassertFalse(stick.equals(stickRotated));\n\t\tassertFalse(s.equals(sRotated));\n\n\n\t}", "public AlgoAreEqual(Construction cons, GeoElement inputElement1,\n\t\t\tGeoElement inputElement2) {\n\t\tsuper(cons);\n\t\tthis.inputElement1 = inputElement1;\n\t\tthis.inputElement2 = inputElement2;\n\n\t\toutputBoolean = new GeoBoolean(cons);\n\n\t\tsetInputOutput();\n\t\tcompute();\n\n\t}", "@Test\n public void testHashcodeReturnsSameValueForIdenticalRecords() {\n int hashcodeA = record.hashCode();\n int hashcodeB = otherRecord.hashCode();\n\n assertThat(hashcodeA == hashcodeB, is(true));\n }", "public static void main(String[] args) {\n\t\tString FirstNumber = 15 + \"\" ;\n\t\tString SecondNumber = 15 + \"\";\n\t\t\n\t\tif(FirstNumber . compareTo(SecondNumber)==0)\n\t\t\n\t\t\tSystem.out.println(\"Numbers are equal\");\n\t\t\n\t\telse\n\t\t\t\n\t\t\tSystem.out.println(\"Numbers are not equal\");\n\t}", "public boolean compMatrix(Matrix m1, Matrix m2) {\n if (m1.getRowDimension() != m2.getRowDimension() || m1.getColumnDimension() != m2.getColumnDimension()) {\n return false;\n } else {\n for (int i = 0; i < m1.getRowDimension(); i++) {\n for (int j = 0; j < m1.getColumnDimension(); j++) {\n if (m1.get(i, j) != m2.get(i, j)) {\n return false;\n }\n }\n }\n }\n return true;\n }", "private boolean compareProperties (Properties props1 , Properties props2){\n boolean propertiesAreEqual = true;\n Properties props2Clone = (Properties)props2.clone();\n Iterator<Object> itProps1Name = props1.keySet().iterator();\n while (propertiesAreEqual && itProps1Name.hasNext()){\n String propertyName = (String)itProps1Name.next();\n if (props2Clone.containsKey(propertyName)){\n propertiesAreEqual = props1.getProperty(propertyName).trim()\n .equals(props2Clone.getProperty(propertyName).trim());\n // Remove checked property from props2Clone properties\n props2Clone.remove(propertyName);\n }\n else{\n propertiesAreEqual = false;\n }\n }\n // If there are left properties in CSS file then files are not equal\n if (props2Clone.size() > 0){\n propertiesAreEqual = false;\n }\n \n return propertiesAreEqual;\n \n }", "boolean canBeCompared(short controlType, short testType);", "public static void main(String[] args) {\n\t\tInteger integer1;\n\t\tInteger integer2;\n\n\t\tinteger1 = new Integer(10);\n\t\tinteger2 = new Integer(10);\n\t\t//第一次比较\n\t\tSystem.out.println(\"第一次比较:\"+(integer1==integer2));\n\n\t\t//第二次比较\n\t\tSystem.out.println(\"第二次比较:\"+(integer1==10));\n\n\t\tinteger1 = 127;\n\t\tinteger2 = 127;\n\t\t//第三次比较\n\t\tSystem.out.println(\"第三次比较:\"+(integer1==integer2));\n\n\t\tinteger1 = 128;\n\t\tinteger2 = 128;\n\t\t//第四次比较\n\t\tSystem.out.println(\"第四次比较:\"+(integer1==integer2));\n\n\t}", "public boolean isTheSame(CoordinateSystem cs) {\n // we need to introduce some order among the points before we can start comparing !\n double totalTolerance = 0.001;\n\n double dist1 = this.axis1.endsDistance(cs.axes.getKey()) + this.axis2.endsDistance(cs.axes.getValue());\n double dist2 = this.axis1.endsDistance(cs.axes.getValue()) + this.axis2.endsDistance(cs.axes.getKey());\n\n return (dist1 < totalTolerance || dist2 < totalTolerance);\n }", "private boolean isSameList(CardList l1, CardList l2){\r\n\t\tif (l1.size()!=l2.size())\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tIterator<Card> i1 = l1.iterator();\r\n\t\tIterator<Card> i2 = l2.iterator();\r\n\t\twhile(i1.hasNext()){\r\n\t\t\tif (!i1.next().equals(i2.next()))\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void areEquals(FileInfo a, FileInfo b)\n\t{\n\t\t// will test a subset for now\n\n\t\tassertEquals(a.width,b.width);\n\t\tassertEquals(a.height,b.height);\n\t\tassertEquals(a.nImages,b.nImages);\n\t\tassertEquals(a.whiteIsZero,b.whiteIsZero);\n\t\tassertEquals(a.intelByteOrder,b.intelByteOrder);\n\t\tassertEquals(a.pixels,b.pixels);\n\t\tassertEquals(a.pixelWidth,b.pixelWidth,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.pixelHeight,b.pixelHeight,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.unit,b.unit);\n\t\tassertEquals(a.pixelDepth,b.pixelDepth,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.frameInterval,b.frameInterval,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.calibrationFunction,b.calibrationFunction);\n\t\tAssert.assertDoubleArraysEqual(a.coefficients,b.coefficients,Assert.DOUBLE_TOL);\n\t\tassertEquals(a.valueUnit,b.valueUnit);\n\t\tassertEquals(a.fileType,b.fileType);\n\t\tassertEquals(a.lutSize,b.lutSize);\n\t\tassertArrayEquals(a.reds,b.reds);\n\t\tassertArrayEquals(a.greens,b.greens);\n\t\tassertArrayEquals(a.blues,b.blues);\n\t}", "public void testCompare3() throws Exception {\r\n ComponentCompetitionSituation situation = new ComponentCompetitionSituation();\r\n ComponentCompetitionPredictor predictor = new ComponentCompetitionPredictor();\r\n ComponentCompetitionFulfillmentPrediction prediction1 = new ComponentCompetitionFulfillmentPrediction(1.5D,\r\n situation, predictor);\r\n ComponentCompetitionFulfillmentPrediction prediction2 = new ComponentCompetitionFulfillmentPrediction(0.6D,\r\n situation, predictor);\r\n\r\n begin();\r\n\r\n for (int i = 0; i < TIMES; i++) {\r\n // predictions above the range < predictions below the range\r\n int result = comparator.compare(prediction1, prediction2);\r\n // result should be < 0\r\n assertTrue(\"result of compare\", result < 0);\r\n }\r\n\r\n print(\"ComponentCompetitionFulfillmentPredictionPrizeComparator#compare\");\r\n }", "@Test\r\n\tpublic void testCompareEqualsCase0() throws IOException {\r\n\t\tPerson p1 = DataUtil.readDataFromFile(\"test/data/case0/case0-person.json\", Person.class);\r\n\t\tPerson p2 = DataUtil.readDataFromFile(\"test/data/case0/case0-person.json\", Person.class);\r\n\r\n\t\tIContext ctx = ObjectCompare.compare(p1, p2);\r\n\t\tdebug(ctx.getDifferences());\r\n\t\tAssert.assertFalse(ctx.hasDifferences());\r\n\t}", "public static boolean compare(byte[] a, byte[] b) {\n\t\tif (a.length!=b.length) return false;\n\t\tfor (int i=0; i<a.length; i++)\n\t\t\tif (a[i]!=b[i]) return false;\n\t\treturn true;\n\t}", "@Test\n public void equals() {\n float[] a = new float[] {1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f}; \n float[] b = new float[] {2.0f, 1.0f, 6.0f, 3.0f, 4.0f, 5.0f, 6.0f}; \n assertTrue(Vec4f.equals(a, 2, b, 3));\n assertTrue(! Vec4f.equals(a, 0, b, 0));\n \n float[] a4 = new float[] {1.0f, 2.0f, 3.0f, 4.0f}; \n \n float[] b4 = new float[] {1.0f, 2.0f, 3.0f, 4.0f};\n float[] c4 = new float[] {2.0f, 2.0f, 3.0f, 4.0f};\n float[] d4 = new float[] {1.0f, 4.0f, 3.0f, 4.0f};\n float[] e4 = new float[] {1.0f, 2.0f, 6.0f, 4.0f};\n float[] f4 = new float[] {1.0f, 2.0f, 3.0f, 5.0f};\n assertTrue(Vec4f.equals(a4,b4));\n assertTrue(!Vec4f.equals(a4,c4));\n assertTrue(!Vec4f.equals(a4,d4));\n assertTrue(!Vec4f.equals(a4,e4));\n assertTrue(!Vec4f.equals(a4,f4)); \n }", "@Test\n public void testEquals_sameParameters() {\n CellIdentityNr cellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n CellIdentityNr anotherCellIdentityNr =\n new CellIdentityNr(PCI, TAC, NRARFCN, BANDS, MCC_STR, MNC_STR, NCI,\n ALPHAL, ALPHAS, Collections.emptyList());\n\n // THEN this two objects are equivalent\n assertThat(cellIdentityNr).isEqualTo(anotherCellIdentityNr);\n }", "boolean hasAlreadCompareLose();", "@Test\n @DisplayName(\"Test should detect equality between equal states.\")\n public void testShouldResultInEquality() {\n ObjectBag os1 = new ObjectBag(null, \"Hi\");\n ObjectBag os2 = new ObjectBag(null, \"Hi\");\n\n Assertions.assertThat(os1).isEqualTo(os2);\n }", "public void compareArray() {\n\t\tmatches = 0;\n\t\tfor(int g = 0; g<guessNum.length; g++) {\n\t\t\tfor(int r=0; r<randNum.length; r++) {\n\t\t\t\tif(guessNum[g]==randNum[r]) {\n\t\t\t\t\tmatches++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7362921", "0.7076814", "0.70604545", "0.67927605", "0.65984446", "0.6462575", "0.64062995", "0.6359585", "0.6350762", "0.63475645", "0.63445497", "0.63100386", "0.6306669", "0.6300913", "0.62988585", "0.6295321", "0.62931263", "0.6263547", "0.6262093", "0.6259212", "0.6257097", "0.62341535", "0.6225953", "0.62238526", "0.6211192", "0.62094927", "0.6205582", "0.6185838", "0.61654466", "0.6153726", "0.6149176", "0.6145614", "0.6143583", "0.6137632", "0.6116297", "0.6113195", "0.6092404", "0.60819227", "0.60800153", "0.60663885", "0.60468805", "0.6039851", "0.60337955", "0.6030455", "0.601778", "0.6017225", "0.6013747", "0.6011388", "0.60043526", "0.5998226", "0.59896004", "0.5988386", "0.59746516", "0.5969523", "0.59665793", "0.59634626", "0.59591913", "0.59557235", "0.5953002", "0.59470844", "0.5942335", "0.5936958", "0.59341425", "0.59241205", "0.59132326", "0.5909427", "0.59030765", "0.5900364", "0.5898447", "0.5890256", "0.5887004", "0.588444", "0.5878974", "0.58755416", "0.5871035", "0.5859098", "0.5856821", "0.58507764", "0.58458877", "0.58372426", "0.58311486", "0.583075", "0.58249927", "0.58210313", "0.58106446", "0.5799198", "0.57976437", "0.57939553", "0.579296", "0.5790095", "0.5788521", "0.57842904", "0.57774025", "0.57766604", "0.57751155", "0.57740664", "0.57731885", "0.5771504", "0.5769478", "0.57690895" ]
0.60414636
41
prints the sequence of states
private static void printTheBoards(Node node) { ArrayList<Node> finalList = new ArrayList<>(); do { finalList.add(node); node = node.parent; } while (node.parent != null); node.printBoard(); Collections.reverse(finalList); for (Node temp : finalList) { temp.printBoard(); } System.out.println("Path cost: " + finalList.size()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void printMachine(){\n\t\tfor(State s:theStates){\n\t\t\tSystem.out.println(s);\n\t\t}\n\t}", "public void printCurrentState() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tSystem.out.print(this.currentState[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public void printStateInt() {\n StringBuilder out = new StringBuilder();\n for (int r = 0; r < rows; r++) {\n out.append(\"[\");\n for (int c = 0; c < columns; c++) {\n int number = currentState[r][c];\n out.append(number);\n if (number < 10) {\n out.append(\" \");\n }\n if (c != columns - 1)\n out.append(\" \");\n }\n out.append(\"]\");\n if (r != rows - 1)\n out.append(\"\\n\");\n\n }\n System.out.println(out);\n }", "public void displayStateValues()\n\t{\n\t\tfor (State s : stateSpace)\n\t\t{\n\t\t\tSystem.out.println(s.state + \"\\t\" + this.value.get(s));\n\t\t}\n\t}", "@Test\n\tpublic void statePrint_test()\n\t{\n\t\tb.set(0,0, 'x');\n\t\tb.set(0,1, 'o');\n\t\tb.set(0,2, 'x');\n\t\tb.set(1,0, 'o');\n\t\tb.set(1,1, 'x');\n\t\tb.statePrint();\n\t\tassertTrue(out.toString().contains(\"x|o|x\\n------\\no|x| \\n------\\n | | \\n\"));\n\t}", "@Test\n\tpublic void statePrint_test1()\n\t{\n\t\tb.set(0,0, 'x');\n\t\tb.set(1,2, 'o');\n\t\tb.set(0,2, 'x');\n\t\tb.set(1,0, 'o');\n\t\tb.set(1,1, 'x');\n\t\tb.statePrint();\n\t\tassertTrue(out.toString().contains(\"x| |x\\n------\\no|x|o\\n------\\n | | \\n\"));\n\t}", "public void print() {\r\n for (final Map.Entry<State, StatePolicyProperties> mapping : mStateMap.entrySet()) {\r\n final StatePolicyProperties properties = mapping.getValue();\r\n\r\n // Print the state\r\n mapping.getKey().print();\r\n System.out.println(\" State value = \" + properties.getValue());\r\n\r\n // Print the actions with their probability\r\n for (Map.Entry<Action, Double> actionProbability : properties.getActionProbabilities().entrySet()) {\r\n System.out.println(\" Action probability \" + actionProbability.getKey() + \" = \"\r\n + actionProbability.getValue());\r\n }\r\n // Print the actions with their value\r\n for (Map.Entry<Action, Double> actionValue : properties.getActionValues().entrySet()) {\r\n System.out.println(\" Action value \" + actionValue.getKey() + \" = \" + actionValue.getValue());\r\n }\r\n }\r\n System.out.println();\r\n }", "public void printInitialState() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tfor (int j = 0; j < 9; j++) {\n\t\t\t\tSystem.out.print(this.initialState[i][j]);\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "@Override\n\tpublic String toString()\n\t{\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\tfor (int i = 0; i < 2 * size + 1; i++)\n\t\t{\n\t\t\tstringBuilder.append(\"-\");\n\t\t}\n\t\tstringBuilder.append(\"\\n|\");\n\t\tfor (int i = 0; i < state.size(); i++)\n\t\t{\n\t\t\tstringBuilder.append(state.get(i)).append(\"|\");\n\t\t\tif (i % size == size - 1 && i < state.size() - 1)\n\t\t\t{\n\t\t\t\tstringBuilder.append(\"\\n|\");\n\t\t\t}\n\t\t}\n\t\tstringBuilder.append(\"\\n\");\n\t\tfor (int i = 0; i < 2 * size + 1; i++)\n\t\t{\n\t\t\tstringBuilder.append(\"-\");\n\t\t}\n\t\treturn stringBuilder.toString();\n\t}", "@Override\n\tpublic String toString() {\n\t\tfinal StringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(super.toString());\n\t\tbuffer.append('\\n');\n\t\tfor (final State state : getStates()) {\n\t\t\tif (initialState == state) {\n\t\t\t\tbuffer.append(\"--> \");\n\t\t\t}\n\t\t\tbuffer.append(state);\n\t\t\tif (isFinalState(state)) {\n\t\t\t\tbuffer.append(\" **FINAL**\");\n\t\t\t}\n\t\t\tbuffer.append('\\n');\n\t\t\tfor (final Transition transition : getTransitionsFromState(state)) {\n\t\t\t\tbuffer.append('\\t');\n\t\t\t\tbuffer.append(transition);\n\t\t\t\tbuffer.append('\\n');\n\t\t\t}\n\t\t}\n\n\t\treturn buffer.toString();\n\t}", "void printstate()\n\t{\n\t\toperation.printstate();\n\t}", "private static void printGrid(Vector<State> states) {\n\t\tSystem.out.println(\"State\\tUP\\tDOWN\\tLEFT\\tRIGHT\");\n\t\tSystem.out\n\t\t\t\t.println(\"---------------------------------------------------\");\n\t\tfor (State s : states) {\n\t\t\tSystem.out.print(s.getName());\n\t\t\tSystem.out.print(\"\\t\" + String.format(\"%.1f\", s.getqUval()));\n\t\t\tSystem.out.print(\"\\t\" + String.format(\"%.1f\", s.getqDval()));\n\t\t\tSystem.out.print(\" \\t\" + String.format(\"%.1f\", s.getqLval()));\n\t\t\tSystem.out.print(\"\\t\" + String.format(\"%.1f\", s.getqRval()));\n\t\t\tSystem.out.println();\n\n\t\t}\n\t}", "@Override\n public String toString ()\n {\n StringBuffer buffer = new StringBuffer();\n for (State value : stateMap.values()) {\n buffer.append(value.toString());\n buffer.append(\"\\n\");\n }\n return buffer.toString();\n }", "public String toString() {\n try {\n StringBuilder sb = new StringBuilder();\n sb.append((\"STATES\") + System.getProperty(\"line.separator\"));\n sb.append((\"-----------\") + System.getProperty(\"line.separator\"));\n sb.append(statesToString());\n sb.append((\"TRANSITIONS\") + System.getProperty(\"line.separator\"));\n sb.append((\"-------------------\") + System.getProperty(\"line.separator\"));\n sb.append(transitionsToString());\n return sb.toString();\n } catch (RuntimeException sbe) {\n throw sbe;\n } catch (Exception sbe) {\n throw new RuntimeException(sbe);\n }\n }", "public String toString() {\n\tStringBuffer buffer = new StringBuffer();\n\t//\tbuffer.append(\" 6 5 4 3 2 1 \\n\");\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 12; i >= 7; --i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"|\");\n\tbuffer.append(toString(state[13]));\n\tbuffer.append(\"-----------------------------|\");\n\tbuffer.append(toString(state[6]));\n\tbuffer.append(\"\\n\");\n\t\n\tbuffer.append(\"| |\");\n\tfor (int i = 0; i <= 5; ++i) {\n\t buffer.append(toString(state[i]));\n\t}\n\tbuffer.append(\" |\\n\");\n\t\n\tbuffer.append(\"+---------------------------------------+\\n\");\n\tbuffer.append(\" 0 1 2 3 4 5 \\n\");\n\t\n\treturn buffer.toString();\n }", "protected void printQueue()\r\n\t{\r\n\t\tint south = 1;\r\n\t\tint west = 2;\r\n\t\tint midwest = 3;\r\n\t\t\r\n\t\tgetPriorityHeader(south);\r\n\t\tSystem.out.println(State.getHeader());\r\n\t\tdisplaySouth();\r\n\t\t\r\n\t\tgetPriorityHeader(west);\r\n\t\tSystem.out.println(State.getHeader());\r\n\t\tdisplayWest();\r\n\t\t\r\n\t\tgetPriorityHeader(midwest);\r\n\t\tSystem.out.println(State.getHeader());\r\n\t\tdisplayMidwest();\r\n\t}", "public String printState(){\n if (this.state.equals(\"unstarted\")) return \"unstarted 0\";\n\n else if (this.state.equals(\"terminated\")) return \"terminated 0\";\n else if (this.state.equals(\"blocked\")) {\n return String.format(\"blocked %d\", ioBurstTime);\n }\n else if (this.state.equals(\"ready\")) {\n if (remainingCPUBurstTime !=null){\n return String.format(\"ready %d\", remainingCPUBurstTime);\n }\n return \"ready 0\";\n }\n\n else if (this.state.equals(\"running\")){\n return String.format(\"running %d\", cpuBurstTime);\n }\n\n else return \"Something went wrong.\";\n }", "private static final void printBitVectorOfStates(long vector)\r\n {\r\n System.out.println(bitVectorOfStatesToString(vector));\r\n }", "public void display() {\n\t\tSystem.out.println(state+\" and its' capital is \"+capital);\n\t}", "public static final void printBitVectorOfStates(long vector)\r\n {\r\n System.out.println(bitVectorOfStatesToString(vector));\r\n }", "public String printPair() {\n\t\treturn \"(\"+leftState.getStateNo() + \",\" + rightState.getStateNo()+\")\";\n\t}", "public String toString()\n {\n \tint tempIndex;\n \tStringBuilder statesStr = new StringBuilder(\"States: { \");\n \tfor(ComplexState state: states)\n \t\tstatesStr.append(state.getName() + \", \");\n\t\ttempIndex = statesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tstatesStr.deleteCharAt(statesStr.lastIndexOf(\",\"));\n \tstatesStr.append(\"}\\n\");\n \tStringBuilder initStatesStr = new StringBuilder(\"Initial states: { \");\n \tfor(ComplexState state: initialStates)\n \t\tinitStatesStr.append(state.getName() + \", \");\n \ttempIndex = initStatesStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tinitStatesStr.deleteCharAt(initStatesStr.lastIndexOf(\",\"));\n \tinitStatesStr.append(\"}\\n\");\n \tStringBuilder transitionFuncStr = new StringBuilder(\"Transition relation: { \");\n \tArrayList<ComplexState> destStates = new ArrayList<ComplexState>();\n \tfor(ComplexState srcState: states) \n \t{\n \t\tdestStates = transitionRelation.get(srcState);\n \t\tif(destStates != null)\n\t \t\tfor(ComplexState destState: destStates)\n\t \t\t\ttransitionFuncStr.append(\"( \" + srcState.getName() + \", \" + destState.getName() + \" ), \" );\t\n \t}\n \ttempIndex = transitionFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\ttransitionFuncStr.deleteCharAt(transitionFuncStr.lastIndexOf(\",\"));\n \ttransitionFuncStr.append(\"}\\n\");\n \tStringBuilder labelingFuncStr = new StringBuilder(\"Labeling function: { \");\n \tArrayList<AtomicProp> atomicProps = new ArrayList<AtomicProp>();\n \tfor(ComplexState state: states) \n \t{\n \t\tlabelingFuncStr.append(\"( \" + state.getName() + \", { \");\n \t\tatomicProps = state.getLabels();\n \t\tif(atomicProps != null)\n \t\t\tfor(AtomicProp ap: state.getLabels())\n \t\t\t\tlabelingFuncStr.append(ap.getName() + \", \");\n \t\ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \t\tlabelingFuncStr.append(\"} ), \");\n \t}\n \ttempIndex = labelingFuncStr.lastIndexOf(\",\");\n \tif(tempIndex != -1)\n \t\tlabelingFuncStr.deleteCharAt(labelingFuncStr.lastIndexOf(\",\"));\n \tlabelingFuncStr.append(\"}\\n\"); \t\n \tString result = statesStr.toString() + initStatesStr.toString() + transitionFuncStr.toString() + labelingFuncStr.toString() + \"Type: \" + type.toString();\n \treturn result;\n }", "public String toString() {\n String result=\"Initial state: 0\\nFinal state: \"+(transitionTable.length-1)+\"\\nTransition list:\\n\";\n for (int i=0;i<epsilonTransitionTable.length;i++) for (int state: epsilonTransitionTable[i])\n result+=\" \"+i+\" -- epsilon --> \"+state+\"\\n\";\n for (int i=0;i<transitionTable.length;i++) for (int col = 0; col< NFA.N; col++)\n if (transitionTable[i][col]!=-1) result+=\" \"+i+\" -- \"+(char)col+\" --> \"+transitionTable[i][col]+\"\\n\";\n return result;\n }", "public void showBoardState() {\n System.out.print(\" \");\n //top row X axis\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for (int i = 0; i < boardSize; i++) {\n //conversion 0-9 to char for display as Y axis\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++) {\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n\n }\n System.out.println();\n }", "public void printSteps() {\n\t\tfor (int y = 0; y < idNode.length; y++) {\r\n\t\t\tint x=y;\r\n\t\t\tString steps = \"\" + x;\r\n\t\t\twhile (idNode[x] != x) {\r\n\t\t\t\tx = idNode[x];\r\n\t\t\t\tsteps += \"->\" + x;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(steps);\r\n\t\t}\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 }", "private void dumpState() {\r\n\t\tfor (TextChunk location : locationalResult) {\r\n\t\t\tlocation.printDiagnostics();\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private static void printGrid1(Vector<State> states) {\n\t\tint k = 0;\n\t\tfor (State s : states) {\n\t\t\tif (k == 3) {\n\t\t\t\tk = 0;\n\t\t\t\tSystem.out.print(\"\\n\\n\\n\");\n\t\t\t}\n\t\t\tSystem.out.print(\" \" + String.format(\"%.1f\", s.getqUval()) + \" \");\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.print(String.format(\"%.1f\", s.getqLval()));\n\t\t\tSystem.out.print(\" \" + String.format(\"%.1f\", s.getqRval()) + \"\\t\");\n\t\t\tSystem.out.println();\n\n\t\t\tSystem.out.print(\" \" + String.format(\"%.1f\", s.getqDval()));\n\n\t\t}\n\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 }", "@Override\r\n\tpublic String toString()\r\n\t{\r\n\t\treturn state.toString();\r\n\t}", "@Override\n public String toString()\n {\n return state.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}", "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}", "@Override\r\n\tvoid showGameState() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t \r\n System.out.println(\"-------------\");\r\n\t\t\r\n for (int i = 0; i < boardsize; i++) \r\n {\r\n System.out.print(\"| \");\r\n for (int j = 0; j < boardsize; j++) \r\n {\r\n \tif(board[i][j]==-1)\r\n \t\tSystem.out.print(\"_\" + \" | \");\r\n \telse if\t(board[i][j]==0)\r\n \t\tSystem.out.print( \"W | \");\r\n \telse\r\n \t\tSystem.out.print( \"B | \");\r\n }\r\n System.out.println();\r\n System.out.println(\"-------------\");\r\n }\r\n }", "@Override\n public String toString() {\n // | <M,C,B> |\n // | Depth = d |\n // -----------\n return \"\\n ----------- \\n\" + \"| <\" + this.state[0] + \",\" + this.state[1] + \",\" + this.state[2] + \"> |\\n\"\n + \"| Depth = \" + this.depth + \" |\\n\" + \" ----------- \\n\";\n }", "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 void dumpState() {\n\t\tif (_Debug) {\n\t\t\tSystem.out.println(\" :: SeqConditionSet --> BEGIN - dumpState\");\n\n\t\t\tSystem.out.println(\" ::--> Set : \" + mCombination);\n\n\t\t\tif (mConditions != null) {\n\t\t\t\tSystem.out.println(\" ::--> [\" + mConditions.size() + \"]\");\n\t\t\t\tSystem.out.println(\" ::----------------::\");\n\n\t\t\t\tfor (int i = 0; i < mConditions.size(); i++) {\n\t\t\t\t\tSeqCondition cond = mConditions.get(i);\n\n\t\t\t\t\tcond.dumpState();\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\" NULL\");\n\t\t\t\tSystem.out.println(\" ::----------------::\");\n\t\t\t}\n\n\t\t\tSystem.out.println(\" :: SeqConditionSet --> END - dumpState\");\n\t\t}\n\t}", "public void printAllStages() {\n printIndex();\n printRemoval();\n }", "private void show() {\n System.out.println(\"...................................................................................................................................................................\");\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n for(int i = 0; i < players.size(); i++) {\n if (state.getTurn() == i) {\n System.out.print(Color.PURPLE.getPrintColor());\n System.out.print((i+1) + \"- \" + players.get(i).toString());\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n }\n else {\n System.out.print(Color.CYAN.getPrintColor());\n System.out.print((i+1) + \"- \" + players.get(i).toString());\n System.out.print(Color.RESET.getPrintColor() + \"║\");\n }\n }\n System.out.println();\n System.out.print(\"Direction: \");\n if (state.getDirection() == +1) {\n System.out.println(Color.PURPLE.getPrintColor() + \"clockwise ↻\");\n }\n else {\n System.out.println(Color.PURPLE.getPrintColor() + \"anticlockwise ↺\");\n }\n System.out.println(Color.RESET.getPrintColor() + \"Turn: \" + Color.PURPLE.getPrintColor() + players.get(state.getTurn()).getName() + Color.RESET.getPrintColor());\n System.out.println(currentCard.currToString());\n if (controls.get(state.getTurn()) instanceof PcControl) {\n System.out.print(players.get(state.getTurn()).backHandToString() + Color.RESET.getPrintColor());\n }\n else {\n System.out.print(players.get(state.getTurn()).handToString() + Color.RESET.getPrintColor());\n }\n }", "void prettyPrint(StatePrettyPrinter pp);", "public String toString(){\n \tif(state){\n\t\treturn (\"1\");\n\t }\n\t else{\n\t\t return(\"0\");\n\t }\n }", "public void printState(int option, int depth) {\n State thisState = new State(capjug1,capjug2,currjug1,currjug2,goal,this.depth);\r\n State[] sa= getSuccessors(thisState);\r\n \r\n switch (option) {\r\n case 1:\r\n for(State s: sa)\r\n printHelp(s,option);\r\n break;\r\n \r\n case 2:\r\n for(State s: sa)\r\n printHelp(s,option);\r\n break;\r\n \r\n case 3:\r\n case 4:\r\n case 5:\r\n UninformedSearch.run(thisState,option,depth);\r\n break;\r\n \r\n default:\r\n }\r\n\r\n }", "protected void printStateFiles(){\n\t\tprintServerConfig();\n\t\tprintValConfig();\n\n\t\t//case where simultaneous sequential auctions are being run\n\t\tif(maxSeq>1 && maxSim>1){\n\t\t\t printSeqSimConfig();\n\t\t\t for(int i = 0; i<(maxSeq*maxSim); i++){\n\t\t\t\t\tif(i<maxSeq){\n\t\t\t\t\t\t//System.out.println(\"SeqNum \"+i);\n\t\t\t\t\t\tprintSimConfig(i);\n\t\t\t\t\t}\n\t\t\t\t\tprintSubAuction(i);\n\t\t\t\t}\n\t\t//case where sequential auctions are being run\n\t\t }else if(maxSeq>1){\n\t\t\t printSeqConfig(0);\n\t\t\t for(int i = 0; i<maxSeq; i++){\n\t\t\t\t\tprintSubAuction(i);\n\t\t\t}\n\t\t//case where simultaneous auctions are being run\n\t\t }else if(maxSim>1){\n\t\t\t printSimConfig(0);\n\t\t\t for(int i = 0; i<maxSim; i++){\n\t\t\t\t\tprintSubAuction(i);\n\t\t\t}\n\t\t//case where a single auction is being run\n\t\t }else if(maxSeq==1 && maxSim==1){\n\t\t\t //printSimConfig(0);\n\t\t\t printSubAuction(0);\n\t\t }else{\n\t\t\t System.out.println(\"ERROR: no auctions\");\n\t\t }\n\n\t\tprintIP_Port();\n\n\t}", "public void printAns(LinkedList<GameState> i) \n\t{\n\t\tGameState ans = i.getLast();//pull off the goal state\n\t\tLinkedList<GameState> an = new LinkedList<GameState>();//new linked list to loop through\n\t\tan.add(ans);//add the goal state to the new linked list\n\t\tint check = ans.getParentStateID();//this will hold the value of the parent id of the last gamestate move\n\t\twhile(check!=-1) {//keep going until we reach the start node\n\t\t\tfor(GameState x: i) //loop through closed\n\t\t\t{\n\t\t//\ti.get()\n\t\t\t\tif(x.getStateID()==check) //check to see if the state id of a x gamestate is the parent node of the check gamestate\n\t\t\t\t{\n\t\t\t\t\tan.add(x);//add the x gamestate to the answer\n\t\t\t\t\tcheck = x.getParentStateID();//update check value\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprintClosed(an);//callprintClosed to printout gamestate infor\n\t}", "public void printState() throws IOException, FileNotFoundException {\n\t\tprintState(new PrintWriter(new BufferedWriter(new FileWriter(modelname))));\n\t}", "@Override\n public String getState() {\n StringBuilder builder = new StringBuilder();\n StringBuilder listPitches = listAllPitches(this.getFinalBeat());\n int length = this.getFinalBeat();\n\n builder.append(listPitches);\n\n for (int i = 0; i < length; i++) {\n builder.append(\"\\n\" + padded(i, length) + notesToString(getNotesPlayingAtBeat(i), i));\n }\n return builder.toString();\n }", "static void displaySteps(int arr[]) {\n\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tSystem.out.print(arr[i] + \"\\t\");\n\t\t}\n\t}", "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}", "public void printStatus() {\n\t\tSystem.out.println(\"Current : \"+current+\"\\n\"\n\t\t\t\t+ \"Tour restant : \"+nb_rounds+\"\\n\"\n\t\t\t\t\t\t+ \"Troupe restant : \"+nb_to_train);\n\t}", "public void printState(int option, char player) {\n\t\tif(option == 1){\r\n\r\n\t\t\t//Get successors for the players\r\n\t\t\tState[] successors = this.getSuccessors(player);\r\n\r\n\t\t\t//If the state has no successors but is not a terminal\r\n\t\t\t//node, print the board itself.\r\n\t\t\tif(successors.length == 0 && !this.isTerminal()){\r\n\t\t\t\tSystem.out.println(this.getBoard());\r\n\t\t\t}\r\n\r\n\t\t\t//If there are no valid moves available and the node is \r\n\t\t\t//a terminal node\r\n\t\t\tif(successors.length == 0 && this.isTerminal())\r\n\t\t\t\treturn;\r\n\r\n\t\t\t//Print the successors in natural reading order\r\n\t\t\tif(successors.length != 0){\r\n\r\n\t\t\t\t//Print the states\r\n\t\t\t\tfor(State state : successors){\r\n\t\t\t\t\tSystem.out.println(state.getBoard());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//If option is 2, check whether the board is a terminal node or not\r\n\t\tif(option == 2){\r\n\r\n\t\t\t//Print the game theoretic value of the state, 1 if dark wins, -1 if light wins, 0\r\n\t\t\t//if it is a tie.\r\n\t\t\tif(this.isTerminal()){\r\n\t\t\t\tSystem.out.println(this.getScore());\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t//Print non terminal if the state is not a terminal node\r\n\t\t\t\tSystem.out.println(\"non-terminal\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\t\t//If option is 3, run the minimax algorithm on our board\r\n\t\tif(option == 3){\r\n\r\n\t\t\t//First print the game theoretic value for the given\r\n\t\t\t//player-board pair\r\n\t\t\tint gameTheoreticValue = Minimax.run(this, player);\r\n\t\t\tSystem.out.println(gameTheoreticValue);\r\n\t\t\t//Print the number of states explored\r\n\t\t\tSystem.out.println(Minimax.counterMinimax);\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t//If option is four\r\n\t\tif(option == 4 || option == 6){\r\n\r\n\t\t\t//If board is terminal, produce no output\r\n\t\t\tif(this.isTerminal())\r\n\t\t\t\treturn;\r\n\r\n\t\t\t//If no move possible, but not terminal, print the board\r\n\t\t\tif(this.getSuccessors(player).length == 0 && !this.isTerminal())\r\n\t\t\t\tSystem.out.println(this.getBoard());\r\n\r\n\t\t\t//Else print the first successor\r\n\t\t\tif(this.getSuccessors(player).length != 0){\r\n\t\t\t\tState[] successors = this.getSuccessors(player);\r\n\t\t\t\t//Print the first move of the player\r\n\t\t\t\tSystem.out.println(successors[0].getBoard());\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\t\t//If flag is equal to 5, run the alpha - beta pruning\r\n\t\t//algorithm\r\n\t\tif(option == 5){\r\n\r\n\t\t\t//First print the game theoretic value for the given\r\n\t\t\t//player-board pair\r\n\t\t\tint gameTheoreticValue = Minimax.run_with_pruning(this, player);\r\n\t\t\tSystem.out.println(gameTheoreticValue);\r\n\t\t\t//Print the number of states explored\r\n\t\t\tSystem.out.println(Minimax.counterPruning);\r\n\r\n\t\t}\r\n\r\n\t}", "public void update() \n {\n System.out.print( \" \" + Integer.toOctalString( subj.getState() ) );\n }", "@Output\n public String getState() {\n return state;\n }", "public void printMoves() {\n\t\tprintMovesHelper(this);\n\t\twhile (!outputStack.isEmpty()) {\n\t\t\tSystem.out.println(outputStack.pop());\n\t\t}\n\t}", "public void update()\n {\n System.out.print( \" \" + Integer.toBinaryString( subj.getState() ) );\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 }", "private void printMenu()\n {\n System.out.println(\"\");\n System.out.println(\"*** Salg ***\");\n System.out.println(\"(0) Tilbage\");\n System.out.println(\"(1) Opret\");\n System.out.println(\"(2) Find\");\n System.out.println(\"(3) Slet\");\n System.out.print(\"Valg: \");\n }", "private static void printCircuit() {\n\tfor (Gate i: gates) {\n\t System.out.println( i.toString() );\n\t}\n\tfor (Wire r: wires) {\n\t System.out.println( r.toString() );\n\t}\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 String dumpState() {\n StringBuilder out = new StringBuilder();\n out.append(currentPlayer);\n for (int i = 0; i < board.length; ++i)\n out.append(\" \" + board[i]);\n\n return out.toString();\n }", "private void addStateLog(){\n int state = GUIState.getState();\n if(state == 1){\n addText(\"Beginning \" + GUIState.command + \" processing!\");\n addText(\"Choose which card this card will affect!\");\n } if(state == 2){\n if(GUIState.command.equals(\"Summon\") || GUIState.command.equals(\"Defense\")){\n addText(\"Beginning \" + GUIState.command + \" processing!\");\n }\n addText(\"Choose where to put this card!\");\n }\n }", "public void printBoard(Tile[][] gameState) {\n\t\tint boardSize = gameState.length;\n\t\tSystem.out.println(printBoardLine());\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tSystem.out.print(\"|\");\n\t\t\t\tif (gameState[i][j].getColorValue().equals(black)) {\n\t\t\t\t\tSystem.out.print(\" b \");\n\t\t\t\t} else if (gameState[i][j].getColorValue().equals(white)) {\n\t\t\t\t\tSystem.out.print(\" w \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"|\");\n\t\t\tSystem.out.println(printBoardLine());\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 }", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "void printLevelOrder() \n { \n int h = height(this); \n int i; \n for (i=1; i<=h; i++) \n printGivenLevel(this, i); \n }", "public void print() {\n\t\tint i = 1;\n\t\tfor (String s: g.keySet()) {\n\t\t\tSystem.out.print(\"Element: \" + i++ + \" \" + s + \" --> \");\n\t\t\tfor (String k: g.get(s)) {\n\t\t\t\tSystem.out.print(k + \" ### \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "private void outputMe() {\n\t\tif (changeCount > 2) changeCount = 4 - (changeCount & 1);\n\t\tif (outputValue) {\n\t\t\tSystem.out.append( trueArray[ changeCount ] );\n\t\t} else {\n\t\t\tSystem.out.append( falseArray[ changeCount ] );\n\t\t}\n\t\tchangeCount = 0;\n\t}", "private static void PrintResult(State o) {\n\t\tif (o.cha!=null) {\n\t\t\tPrintResult(o.cha);// co duoc 2 buoc tren minh ms in ra dc buoc PrintResult\n\t\t\t//PrintResult goi de quy trong PrintResult\n\t\t\tswitch (o.me.i) {\n\t\t\tcase 0: System.out.println(\"Up\");break;\n\t\t\tcase 1: System.out.println(\"Down\");break;\n\t\t\tcase 2: System.out.println(\"Left\");break;\n\t\t\tcase 3: System.out.println(\"Right\");break;\n\t\t\t}\n\t\t}\n\t\to.Print();\n\t}", "public void printStatus(){\n System.out.println();\n System.out.println(\"Status: \");\n System.out.println(currentRoom.getLongDescription());\n currentRoom.printItems();\n System.out.println(\"You have made \" + moves + \" moves so far.\");\n }", "public void display()\r\n\t{\r\n\t\tfor (int i = 0; i < count; i++)\r\n\t\t\ts2.push(s1.pop());\r\n\t\tfor(int i = 0; i < count; i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(s2.peek() + \" \");\r\n\t\t\ts1.push(s2.pop());\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t}", "public void printClosed(LinkedList<GameState> i) \n\t{\n\t\tSystem.out.println(\"This is the answer\");\n\t\tfor(GameState x: i) //go through the linked list\n\t\t{\n\t\t\tx.printGameState();//print out the gamestate\n\t\t}\n\t}", "public void printContents() {\n\t\t\n//\t\tCollections.sort(finalized);\n\t\t\n\t\tSystem.out.print(\"Register Status:\");\n\t\t\n\t\tint i = 0;\n\t\tfor (; i < finalized.length - 1; i++) {\n\t\t\tSystem.out.println(\"Reg \" + i + \": \" + finalized[i].toString());\n\t\t}\n\t\tSystem.out.print(\"Reg \" + i + \": \" + finalized[finalized.length - 1].toString() + \"\\n\");\n\t}", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "private String print_Menu()\n\t{\n\t\tSystem.out.println(\"\\n----------CS542 Link State Routing Simulator----------\");\n\t\tSystem.out.println(\"(1) Create a Network Topology\");\n\t\tSystem.out.println(\"(2) Build a Forward Table\");\n\t\tSystem.out.println(\"(3) Shortest Path to Destination Router\");\n\t\tSystem.out.println(\"(4) Modify a Topology (Change the status of the Router)\");\n\t\tSystem.out.println(\"(5) Best Router for Broadcast\");\n\t\tSystem.out.println(\"(6) Exit\");\n\t\tSystem.out.print(\"Master Command: \");\n\n\t\treturn scan.next();\n\t}", "public void display(){\r\n \r\n System.out.println(\"\\n\\nHigh Population City\");\r\n highPop.display();\r\n System.out.println(\"Capital City\");\r\n capital.display();\r\n System.out.print(\"State Name: \" + stateName + \"\\nState Population: \" + statePop + \"\\n------------\");\r\n }", "public void print() {\n\t\tfor (int count = 0; count < adjacencyList.length; count++) {\n\t\t\tLinkedList<Integer> edges = adjacencyList[count];\n\t\t\tSystem.out.println(\"Adjacency list for \" + count);\n\n\t\t\tSystem.out.print(\"head\");\n\t\t\tfor (Integer edge : edges) {\n\t\t\t\tSystem.out.print(\" -> \" + edge);\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printState(PrintWriter out) throws IOException {\n\t\tint doc = 0;\n\n\t\tfor (ArrayList<Integer> fs: training) {\n\t\t\tint seqLen = fs.size();\n\t\t\tint[] docLevels = levels[doc];\n\t\t\tNCRPNode node;\n\t\t\tint type, token, level;\n\n\t\t\tStringBuffer path = new StringBuffer();\n\t\t\t\n\t\t\t// Start with the leaf, and build a string describing the path for this doc\n\t\t\tnode = documentLeaves[doc];\n\t\t\tfor (level = numLevels - 1; level >= 0; level--) {\n\t\t\t\tpath.append(node.nodeID + \" \");\n\t\t\t\tnode = node.parent;\n\t\t\t}\n\n\t\t\tfor (token = 0; token < seqLen; token++) {\n\t\t\t\ttype = fs.get(token);\n\t\t\t\tlevel = docLevels[token];\n\t\t\t\t\n\t\t\t\t// The \"\" just tells java we're not trying to add a string and an int\n\t\t\t\tout.println(path + \"\" + type + \" \" + vocab.get(type) + \" \" + level + \" \");\n\t\t\t}\n\t\t\tdoc++;\n\t\t}\n\t}", "public String toString() {\r\n\t\treturn (\"State: \" + this.key + \", Value: \" + this.val);\r\n\t}", "void print() {\r\n\t\tOperations.print(lexemes, tokens);\r\n\t}", "public void display() {\n\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t\n\t\tfor (byte r = (byte) (b.length - 1); r >= 0; r--) {\n\t\t\tSystem.out.print(r + 1);\n\t\t\t\n\t\t\tfor (byte c = 0; c < b[r].length; c++) {\n\t\t\t\tSystem.out.print(\" | \" + b[r][c]);\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\" |\");\n\t\t\tSystem.out.println(\" ---------------------------------------\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" a b c d e f g h\");\n\t}", "void printBoardState(Piece[] B,Player J,int N);", "public static ArrayList genStates(){\n ArrayList states = new ArrayList(44);\n List<String> notes = new ArrayList<String>(Arrays.asList(\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\"));\n List<String> beat = new ArrayList<String>(Arrays.asList(\"1\",\"2\",\"3\",\"4\"));\n //List<String> dot = new ArrayList<String>(Arrays.asList(\"1\",\"0\"));\n for(int n = 0; n<=10; n++){\n for(int b = 0; b<=3; b++){\n //for(int d = 0; d<=1; d++){\n String state = \"\"; \n state += notes.get(n);\n state += beat.get(b);\n //state += dot.get(d);\n states.add(state);\n //}\n }\n }\n return states;\n }", "public void display() {\n\t\tSystem.out.println(\"[\" + recDisplay(head) + \"]\");\n\t}", "public static void printMenu()\r\n\t{\r\n\t\tSystem.out.println(\"A) Add Scene\");\r\n\t\tSystem.out.println(\"R) Remove Scene\");\r\n\t\tSystem.out.println(\"S) Show Current Scene\");\r\n\t\tSystem.out.println(\"P) Print Adventure Tree\");\r\n\t\tSystem.out.println(\"B) Go Back A Scene\");\r\n\t\tSystem.out.println(\"F) Go Forward A Scene \");\r\n\t\tSystem.out.println(\"G) Play Game\");\r\n\t\tSystem.out.println(\"N) Print Path To Cursor\");\r\n\t\tSystem.out.println(\"M) Move Scene\");\r\n\t\tSystem.out.println(\"Q) Quit\");\r\n\t\tSystem.out.println();\r\n\t}", "@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 }", "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 displayActivations(){\n for (int i = 0; i < neurons.size(); i++){\n System.out.println(\"Neuron \" + i + \": \" + neurons.get(i).getActivation());\n }\n }", "public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "void printLevelOrder() {\n\t\tint h = height(root);\n\t\tint i;\n\t\tfor (i = h; i >= 1; i--)\n\t\t\tprintGivenLevel(root, i);\n\t}", "private void cmdInfoState() throws NoSystemException {\n MSystem system = system();\n MModel model = system.model();\n MSystemState state = system.state();\n NumberFormat nf = NumberFormat.getInstance();\n\n System.out.println(\"State: \" + state.name());\n\n // generate report for objects\n Report report = new Report(3, \"$l : $r $r\");\n\n // header\n report.addRow();\n report.addCell(\"class\");\n report.addCell(\"#objects\");\n report.addCell(\"+ #objects in subclasses\");\n report.addRuler('-');\n\n // data\n long total = 0;\n int n;\n\n for (MClass cls : model.classes()) {\n report.addRow();\n String clsname = cls.name();\n if (cls.isAbstract())\n clsname = '(' + clsname + ')';\n report.addCell(clsname);\n n = state.objectsOfClass(cls).size();\n total += n;\n report.addCell(nf.format(n));\n n = state.objectsOfClassAndSubClasses(cls).size();\n report.addCell(nf.format(n));\n }\n\n // footer\n report.addRuler('-');\n report.addRow();\n report.addCell(\"total\");\n report.addCell(nf.format(total));\n report.addCell(\"\");\n\n // print report\n report.printOn(System.out);\n System.out.println();\n\n // generate report for links\n report = new Report(2, \"$l : $r\");\n\n // header\n report.addRow();\n report.addCell(\"association\");\n report.addCell(\"#links\");\n report.addRuler('-');\n\n // data\n total = 0;\n\n for (MAssociation assoc : model.associations()) {\n report.addRow();\n report.addCell(assoc.name());\n n = state.linksOfAssociation(assoc).size();\n report.addCell(nf.format(n));\n total += n;\n }\n\n // footer\n report.addRuler('-');\n report.addRow();\n report.addCell(\"total\");\n report.addCell(nf.format(total));\n\n // print report\n report.printOn(System.out);\n }", "public static void main(String[] args){\r\n BST_Sequences<Integer> b = new BST_Sequences<>();\r\n\r\n BinaryNode<Integer> r = new BinaryNode<>(2);\r\n BinaryNode<Integer> n1 = new BinaryNode<>(1);\r\n BinaryNode<Integer> n2 = new BinaryNode<>(3);\r\n BinaryNode<Integer> n4 = new BinaryNode<>(4);\r\n r.setLeft(n1);\r\n r.setRight(n2);\r\n n2.setRight(n4);\r\n\r\n BST<Integer> bst = new BST<>(r);\r\n\r\n ArrayList<LinkedList<Integer>> l = b.allSequences(bst.getRoot());\r\n for(LinkedList<Integer> list : l){\r\n System.out.print(\"{\");\r\n for(Integer i : list){\r\n System.out.print(i + \" \");\r\n }\r\n System.out.println(\"}\");\r\n }\r\n }", "public void printStatus(){\n System.out.println(\"Nodes: \" + \n getVertexCount() + \" Edges: \" + \n getEdgeCount()); \n //and \" + getEdgeCount() + \" edges active.\");\n }", "@Override\n protected void incrementStates() {\n\n }", "public void printRegionStatus() {\n for (int i = 0; i < numRegions; i++) {\n System.out.print(regionList[i].getRegionName() + \" is \");\n if (regionList[i].checkOpen()) {\n System.out.println(\"open. :D\");\n } else {\n System.out.println(\"closed. D:\");\n }\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 void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "public void print() {\n \n for (int i=0 ; i< getNumberOfCases() ; i++) {\n Configuration conf = get(i);\n conf.print();\n System.out.print(\"\\n\");\n }\n}", "public String toString() {\r\n\t\treturn gameState;\r\n\t}", "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}", "public void printSequence(int l, int r) {\n\t\tfor (int i = 1; i <= 10; i++) {\n\t\t\tSystem.out.print(sequence[i + 1]);\n\t\t}\n\t}" ]
[ "0.77279997", "0.7413313", "0.73538214", "0.73336005", "0.73102534", "0.7299384", "0.72225463", "0.71419984", "0.7030336", "0.69223744", "0.6905958", "0.68932366", "0.6764954", "0.67621756", "0.6752191", "0.6664369", "0.66092366", "0.6590253", "0.65391773", "0.6484634", "0.64605546", "0.6420226", "0.6419218", "0.64149153", "0.6383687", "0.6372582", "0.6364163", "0.6345226", "0.63357145", "0.63215137", "0.6298251", "0.6245931", "0.6245931", "0.6245931", "0.62213343", "0.6196153", "0.618357", "0.61660033", "0.61622596", "0.6156954", "0.61555046", "0.6125569", "0.61108494", "0.60912377", "0.6085057", "0.60836357", "0.6038329", "0.601949", "0.601786", "0.60046256", "0.6003237", "0.5994705", "0.59890544", "0.597769", "0.59652543", "0.594679", "0.5943872", "0.59408754", "0.5904398", "0.5878576", "0.5871151", "0.58644044", "0.5861598", "0.5857237", "0.58551973", "0.58542424", "0.58508426", "0.58478796", "0.58419216", "0.58350277", "0.58345205", "0.5833516", "0.5833089", "0.58287036", "0.5821588", "0.58112586", "0.58075476", "0.5802995", "0.5785138", "0.578036", "0.5778283", "0.5770844", "0.57682836", "0.5762815", "0.5746205", "0.57457733", "0.5742548", "0.57395625", "0.57321817", "0.57313275", "0.5729569", "0.5725265", "0.57205945", "0.5718532", "0.5718214", "0.57136893", "0.57118595", "0.5693965", "0.56845737", "0.56792086", "0.56696564" ]
0.0
-1
determines the next possible states achievable from this node
public static void startOperation(Node presesntNode) { if (presesntNode != null) { goUp(presesntNode); goDown(presesntNode); goLeft(presesntNode); goRight(presesntNode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 HashMap<String,ArrayList<Rule_in_State>> get_rules_of_next_state() throws Exception;", "@Override\n\t\tprotected void calcNextState() {\n\t\t\tboolean manualPress = rd.gearManualLeftClose||rd.gearManualLeftOpen||rd.gearManualRightClose||rd.gearManualRightOpen;\n\t\t\t\n\t\t\t// if we complete an autoOpen/autoClose then switch to manual which is also like idle\n\t\t\tif (currentState==GearStates.autoOpen && rd.leftOpenSwitch && rd.rightOpenSwitch) {\n\t\t\t\tnextState = GearStates.manual;\n\t\t\t}\n\t\t\tif (currentState==GearStates.autoClose && rd.leftCloseSwitch && rd.rightCloseSwitch) {\n\t\t\t\tnextState = GearStates.manual;\n\t\t\t}\n\n\t\t\t// if the operator hits a button go to that state - manual overrides auto\n\t\t\tif(manualPress) nextState = GearStates.manual;\n\t\t\telse if (rd.gearAutoOpen) nextState = GearStates.autoOpen;\n\t\t\telse if (rd.gearAutoClose) nextState = GearStates.autoClose;\n\t\t\t\n\t\t\t// timeout - there is no way to timeout from manual operations, they're manual.\n\t\t\tif(secondsInState>3) nextState = GearStates.manual;\n\t\t}", "public SLR1_automat.State next_state(String symbol) throws Exception;", "public Sq<LifeState> statesForNextLife() {\r\n\r\n Sq<LifeState> dyingBasisSequence = Sq.repeat(Ticks.PLAYER_DYING_TICKS,\r\n new LifeState(lifeStates.head().lives(),\r\n LifeState.State.DYING));\r\n\r\n if (lives() <= 1) {\r\n return dyingBasisSequence.concat(\r\n Sq.constant(new LifeState(0, LifeState.State.DEAD)));\r\n }\r\n\r\n else {\r\n return dyingBasisSequence.concat(Sq\r\n .repeat(Ticks.PLAYER_INVULNERABLE_TICKS,\r\n new LifeState(lifeStates.head().lives() - 1,\r\n LifeState.State.INVULNERABLE))\r\n .concat(Sq.constant(\r\n new LifeState(lifeStates.head().lives() - 1,\r\n LifeState.State.VULNERABLE))));\r\n }\r\n }", "public String getNextState() {\n return nextState;\n }", "private static List<State<StepStateful>> getStates() {\n List<State<StepStateful>> states = new LinkedList<>();\n states.add(s0);\n states.add(s1);\n states.add(s2);\n states.add(s3);\n states.add(s4);\n states.add(s5);\n states.add(s6);\n return states;\n }", "public State next () { return nextState(); }", "private PlayState getNext(){\n return values()[(this.ordinal() + 1) % PlayState.values().length];\n }", "void nextState();", "private void setupDFA() {\r\n\t\tcurrentState = 0;\r\n\t\tif (actor.getScheduleFSM() == null) {\r\n\t\t\t// generate trivial DFA in case there is no schedule fsm.\r\n\t\t\t// 1. only one state\r\n\t\t\t// 2. all actions are eligible\r\n\t\t\t// 3. the successor state is always the same\r\n\t\t\teligibleActions = new Action [][] {actions};\r\n\t\t\tsuccessorState = new int [1] [actions.length];\r\n\t\t\tfor (int i = 0; i < actions.length; i++) {\r\n\t\t\t\tsuccessorState[0][i] = 0;\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\tSet stateSets = new HashSet();\r\n\t\t// put initial state into set of state sets\r\n\t\tSet initialState = Collections.singleton(actor.getScheduleFSM().getInitialState());\r\n\t\tstateSets.add(initialState);\r\n\t\tint previousSize = 0;\r\n\t\t// iterate until fixed-point, i.e. we cannot reach any new state set\r\n\t\twhile (previousSize != stateSets.size()) {\r\n\t\t\tpreviousSize = stateSets.size();\r\n\t\t\t// for each action...\r\n\t\t\tfor (int i = 0; i < actions.length; i ++) {\r\n\t\t\t\tSet nextStates = new HashSet();\r\n\t\t\t\t// ... compute the set of states that can be reached through it... \r\n\t\t\t\tfor (Iterator j = stateSets.iterator(); j.hasNext(); ) {\r\n\t\t\t\t\tSet s = (Set) j.next();\r\n\t\t\t\t\tif (isEligibleAction(s, actions[i])) {\r\n\t\t\t\t\t\tnextStates.add(computeNextStateSet(s, actions[i]));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// ... and add them to the state set\r\n\t\t\t\tstateSets.addAll(nextStates);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// The set of all reachable state sets is the state space of the NDA. \r\n\t\tndaStateSets = (Set []) new ArrayList(stateSets).toArray(new Set[stateSets.size()]);\r\n\t\t// Make sure the initial state is state 0.\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tif (ndaStateSets[i].equals(initialState)) {\r\n\t\t\t\tSet s = ndaStateSets[i];\r\n\t\t\t\tndaStateSets[i] = ndaStateSets[0];\r\n\t\t\t\tndaStateSets[0] = s;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\teligibleActions = new Action [ndaStateSets.length] [];\r\n\t\tsuccessorState = new int [ndaStateSets.length] [];\r\n\t\t// For each state set (i.e. each NDA state), identify the eligible actions,\r\n\t\t// and also the successor state set (i.e. the successor state in the NDA).\r\n\t\tfor (int i = 0; i < ndaStateSets.length; i++) {\r\n\t\t\tList ea = new ArrayList();\r\n\t\t\tList ss = new ArrayList();\r\n\t\t\tfor (int j = 0; j < actions.length; j++) {\r\n\t\t\t\tif (isEligibleAction(ndaStateSets[i], actions[j])) {\r\n\t\t\t\t\tea.add(actions[j]);\r\n\t\t\t\t\tss.add(computeNextStateSet(ndaStateSets[i], actions[j]));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\teligibleActions[i] = (Action []) ea.toArray(new Action[ea.size()]);\r\n\t\t\tList ds = Arrays.asList(ndaStateSets); // so we can use List.indexOf()\r\n\t\t\tsuccessorState[i] = new int [ss.size()];\r\n\t\t\t// locta the NDA successor state in array\r\n\t\t\tfor (int j = 0; j < ss.size(); j++) {\r\n\t\t\t\tsuccessorState[i][j] = ds.indexOf(ss.get(j));\r\n\t\t\t\t\r\n\t\t\t\t// must be in array, because we iterated until reaching a fixed point.\r\n\t\t\t\tassert successorState[i][j] >= 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void determineNextState(Cell cell)\n\t{\n\t\tMap<String, Cell> neighbors = cell.getNeighborsWrap();\n\t\tif (!cell.nextStateFinalized()) {\n\t\t\tList<Cell> emptyNeighbors = getEligibleNeighborsOfState(neighbors, EMPTY);\n\t\t\tif (cell.getState() == FISH) {\n\t\t\t\tupdateGenericSpeciesTraits(cell);\n\t\t\t\tif (emptyNeighbors.size() != 0) {\n\t\t\t\t\tif (readyToReproduce(cell)) {\n\t\t\t\t\t\treproduce(cell, emptyNeighbors);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmove(cell, emptyNeighbors);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (cell.getState() == SHARK) {\n\t\t\t\tupdateGenericSpeciesTraits(cell);\n\t\t\t\tincrementStarveTime(cell);\n\t\t\t\tList<Cell> fishNeighbors = new ArrayList<Cell>();\n\t\t\t\tfishNeighbors = getEligibleNeighborsOfState(neighbors, FISH);\n\t\t\t\tif (readyToStarve(cell)) {\n\t\t\t\t\tkill(cell);\n\t\t\t\t} else if (fishNeighbors.size() != 0) {\n\t\t\t\t\teat(fishNeighbors, cell);\n\t\t\t\t} else if (emptyNeighbors.size() != 0) {\n\t\t\t\t\tif (readyToReproduce(cell)) {\n\t\t\t\t\t\treproduce(cell, emptyNeighbors);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCell movedTo = move(cell, emptyNeighbors);\n\t\t\t\t\t\tincrementStarveTime(movedTo);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public List<String> getSequentialPlan() {\n // ==========================================\n // Computing the (cheapest) sequence of steps\n // ==========================================\n \n // Maps of steps and cost from the global state s to the others\n Map<GlobalState,List<Step>> steps = new HashMap();\n steps.put(current,new ArrayList());\n Map<GlobalState,Integer> costs = new HashMap();\n costs.put(current,0);\n // List of visited states\n List<GlobalState> visited = new ArrayList();\n visited.add(current);\n\n // List of global states still to be visited\n List<GlobalState> toBeVisited = new ArrayList();\n \n // Adding the states reachable from start to \"toBeVisited\"\n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations towards \"next\" \n List<Step> stepSeq = new ArrayList();\n stepSeq.add(step);\n steps.put(next,stepSeq);\n // Adding the cost of the sequence of operation towards \"next\"\n costs.put(next,step.getCost());\n toBeVisited.add(next);\n }\n \n // Exploring the graph of global states by exploiting \"toBeVisited\"\n while(toBeVisited.size() > 0) {\n // Removing the first global state to be visited and marking it\n // as visited\n GlobalState current = toBeVisited.remove(0);\n visited.add(current);\n \n for(Step step : current.getSteps()) {\n GlobalState next = step.getNextGlobalState();\n // Adding the sequence of operations from \"start\" to \"next\"\n // (if more convenient)\n int nextCost = costs.get(current) + step.getCost();\n if(visited.contains(next)) {\n // If current path is cheaper, updates \"steps\" and \"costs\"\n if(costs.get(next) > nextCost) {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next,nextCost);\n }\n } else {\n List<Step> stepSeq = new ArrayList();\n stepSeq.addAll(steps.get(current));\n stepSeq.add(step);\n steps.put(next,stepSeq);\n costs.put(next, nextCost);\n if(!(toBeVisited.contains(next))) toBeVisited.add(next);\n }\n }\n }\n \n // ====================================================\n // Computing the sequence of operations from \"s\" to \"t\"\n // ====================================================\n // If no plan is available, return null\n if(steps.get(target) == null) \n return null;\n // Otherwise, return the corresponding sequence of operations\n List<String> opSequence = new ArrayList();\n for(Step step : steps.get(target)) {\n if(!(step.getReason().contains(Step.handling))) {\n opSequence.add(step.getReason());\n }\n }\n return opSequence;\n }", "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 }", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "protected abstract int numStates();", "public void solveGame4() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}", "public int[] getNext(){\n if (wasExplored) return new int[0];\n int[] nextState = {next1.state_no};\n return nextState;\n }", "@Override\r\n public MachineState getNextState(MachineState state, List<Move> moves)\r\n throws TransitionDefinitionException {\r\n \tclearpropnet();\r\n \tmarkbases(state.getContents());\r\n\t\tmarkactions(toDoes(moves));\r\n\t\tMap<GdlSentence, Proposition> bases = propNet.getBasePropositions();\r\n\r\n\t\tSet<GdlSentence> nexts = new HashSet<GdlSentence>();\r\n\r\n\t\tfor (GdlSentence s : bases.keySet()) {\r\n\t\t\tif (bases.get(s).getSingleInputC().propmark()) nexts.add(s);\r\n\t\t}\r\n\t\treturn new MachineState(nexts);\r\n }", "public List<MachineState> getNextStates(MachineState state) throws MoveDefinitionException, TransitionDefinitionException, StateMachineException\n {\n List<MachineState> nextStates = new ArrayList<MachineState>();\n for (List<Move> move : getLegalJointMoves(state)) {\n nextStates.add(getNextState(state, move));\n }\n\n return nextStates;\n }", "public State[] getSuccessors(State curr) {\n State [] successors = new State [6];\r\n \r\n if(currjug1!=0) {\r\n //e1\r\n successors[0] = new State(capjug1, capjug2, 0, currjug2, goal,depth);\r\n successors[0].parentPt = curr;\r\n successors[0].depth = curr.depth+1;\r\n //p12\r\n int pour = pour(currjug1, currjug2, capjug2);\r\n successors[1] = new State(capjug1, capjug2, currjug1-pour, currjug2+pour, goal,depth);\r\n successors[1].parentPt = curr;\r\n successors[1].depth = curr.depth+1;\r\n }\r\n \r\n if(currjug2!=0) {\r\n //e2\r\n successors[2] = new State(capjug1, capjug2, currjug1, 0, goal,depth);\r\n successors[2].parentPt = curr;\r\n successors[2].depth = curr.depth+1;\r\n }\r\n \r\n //f2\r\n successors[3] = new State(capjug1, capjug2, currjug1, capjug2, goal,depth);\r\n successors[3].parentPt = curr;\r\n successors[3].depth = curr.depth+1;\r\n \r\n if(currjug2!=0) {\r\n //p21\r\n int pour = pour(currjug2, currjug1, capjug1);\r\n successors[4] = new State(capjug1, capjug2, currjug1+pour, currjug2-pour, goal,depth);\r\n successors[4].parentPt = curr;\r\n successors[4].depth = curr.depth+1;\r\n }\r\n \r\n //f1\r\n successors[5] = new State(capjug1, capjug2, capjug1, currjug2, goal,depth);\r\n successors[5].parentPt = curr;\r\n successors[5].depth = curr.depth+1;\r\n \r\n return successors;\r\n }", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "@Override\n protected void incrementStates() {\n\n }", "public LinkedList<GameState> successor(GameState a)\n\t{\n\t\t//temperary gamestates that will be used for the legal moves\n\t\tGameState w = new GameState();\n\t\tGameState x = new GameState();\n\t\tGameState y = new GameState();\n\t\tGameState z = new GameState();\n\t\t//System.out.println(\"THIS IS THE CURR NODE\");\n\t\t//a.printGameState();\n\t\t//System.out.println(a);\n\t\t//create a linked list to return all of the legal moves as game states\n\t\tLinkedList<GameState> ans = new LinkedList<GameState>();\n\t\t//these are arrays that will be used to populate gamestates above\n\t\tint[] d = a.moveDown();\n\t\tint[] r = a.moveRight();\n\t\tint[] u = a.moveUp();\n\t\tint[] l = a.moveLeft();\n\t\t//System.out.println(\"hello\");\n\t\t//this is for the down move\n\t\t//System.out.println(\"DOWN\");\n\t\tif(!same1(d,check)) //make sure that moving down is a legall move\n\t\t{\n\t\t\t//System.out.println(\"hello\");\n\t\t\t//if it is a legal move poplate the fieds with \n\t\t\tw.setBoard(d);\n\t\t\tw.setStateID(count);//giving unique id\n\t\t\tw.setG();\n\t\t\tw.setH(this.h(goalS.getBoard(), w));//passing in the empty space index of the goal node\n\t\t\tw.setF();\n\t\t\tw.setVisited(false);\n\t\t\tw.setParentStateID(a.getStateID());//set the parent id to that of the current game state\n\t\t\t//System.out.println(a.getStateID());\n\t\t\t//w.printGameState();\n\t\t\tw.setPriority(w.getF());//the priority is the f(n)\n\t\t\t \n\t\t\tans.add(w);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\t//this is for the up move\n\t\t//System.out.println(\"UP\");\n\t\tif(!same1(u,check)) //make sure that moving up is a legall move\n\t\t{\n\t\t\tx.setBoard(u);\n\t\t\tx.setStateID(count);//giving unique id\n\t\t\tx.setG();\n\t\t\tx.setH(this.h(goalS.getBoard(), x));//passing in the empty space index of the goal node\n\t\t\tx.setF();\n\t\t\tx.setParentStateID(a.getStateID());//set the parent id to that of the current game state\n\t\t\tx.setVisited(false);\n\t\t\t//x.printGameState();\n\t\t\tx.setPriority(x.getF());//the priority is the f(n)\n\t\t\tans.add(x);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\t//\tSystem.out.println(\"RIGHT\");\n\t\t//this is for the right move\n\t\tif(!same1(r,check)) //make sure that moving right is a legall move\n\t\t{\n\t\t\t//System.out.println(\"hello\");\n\t\t\ty.setBoard(r);\n\t\t\ty.setStateID(count);//giving unique id\n\t\t\ty.setG();\n\t\t\ty.setH(this.h(goalS.getBoard(), y));//passing in the empty space index of the goal node\n\t\t\ty.setF();\n\t\t\ty.setParentStateID(a.stateID);//set the parent id to that of the current game state\n\t\t\ty.setVisited(false);\n\t\t\t//y.printGameState();\n\t\t\ty.setPriority(y.getF());//the priority is the f(n)\n\t\t\tans.add(y);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\t//this is for the left move\n\t\t//System.out.println(\"LEFT\");\n\t\tif(!same1(l,check)) //make sure that moving left is a legall move\n\t\t{\n\t\t\tz.setBoard(l);\n\t\t\tz.setStateID(count);//giving unique id\n\t\t\tz.setG();\n\t\t\tz.setH(this.h(goalS.getBoard(), z));//passing in the empty space index of the goal node\n\t\t\tz.setF();\n\t\t\tz.setVisited(false);\n\t\t\tz.setParentStateID(a.getStateID());//set the parent id to that of the current game state\n\t\t\t//z.printGameState();\n\t\t\tz.setPriority(z.getF());//the priority is the f(n)r\n\t\t\t//count++;\n\t\t\tans.add(z);//add new gamestate to the linked list of legal moves\n\t\t}\n\t\tcount++;//increment count so all the games states have unique ids\n\t\treturn ans;\n\t}", "public void solveGame5() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\t\t\t\tcurrentSet.add(s);\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "BGPv4FSMState state();", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "public int numberOfStates();", "public abstract int numStates();", "private State getNextState(State currentState, Token token)\n\t\t\tthrows SyntaxException {\n\t\tswitch (currentState) {\n\t\tcase VAR_TYPE:\n\t\t\tif (token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_NAME;\n\t\t\t}\n\t\t\tthrow new SyntaxException(\"No var name after type\");\n\n\t\tcase VAR_NAME:\n\t\t\tif (token.getTokenType() == TokenType.EQUALS) {\n\t\t\t\treturn State.EQUALS;\n\t\t\t}\n\n\t\t\tif (token.getTokenType() == TokenType.COMMA) {\n\t\t\t\treturn State.COMMA;\n\t\t\t}\n\n\t\t\tif (token.getTokenType() == TokenType.SEMICOLON) {\n\t\t\t\treturn State.SEMICOLON;\n\t\t\t}\n\n\t\t\tthrow new SyntaxException(\"Expected equals sign\");\n\n\t\tcase EQUALS:\n\t\t\tif (TokenType.isVarValue(token.getTokenType())\n\t\t\t\t\t|| token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_VAL;\n\t\t\t}\n\n\t\t\tif (token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_VAL;\n\t\t\t}\n\t\t\tthrow new SyntaxException(\"Expected variable value\");\n\n\t\tcase VAR_VAL:\n\t\t\tif (token.getTokenType() == TokenType.COMMA) {\n\t\t\t\treturn State.COMMA;\n\t\t\t}\n\t\t\tif (token.getTokenType() == TokenType.SEMICOLON) {\n\t\t\t\treturn State.SEMICOLON;\n\t\t\t}\n\t\t\tthrow new SyntaxException(\"Unexpected token\");\n\n\t\tcase COMMA:\n\t\t\tif (token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_NAME;\n\t\t\t}\n\n\t\t\tthrow new SyntaxException(\"Expected variable name\");\n\n\t\tcase SEMICOLON:\n\t\t\tthrow new SyntaxException(\"Nothing should appear after semicolon\");\n\t\tdefault:\n\t\t\tthrow new SyntaxException(\"Unknown state\");\n\t\t}\n\t}", "List<S> getAllPossibleStates(S state);", "public void solveGame() {\n\t\tlosingStates = new HashSet<S>();\n\t\t\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tList<Set<S>> uncontrollableSuccessors = new ArrayList<Set<S>>();\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> currentUncontrollableSuccesors;\n\t\tSet<S> currentSet; \n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\tcurrentUncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\t\t\tcurrentSet = new HashSet<S>();\n\t\n\t\t\tif(!relaxAllControllables){\n\t\t\t\tfor(S s: currentUncontrollableSuccesors){\n\t\t\t\t\tif((!relaxOnAssumptions || (!assumptionsStates.contains(s) || assumptionsStates.contains(state))\n\t\t\t\t\t\t\t&& (!relaxSelfLoops || (!s.equals(state)))))\n\t\n\t\t\t\t\t\tcurrentSet.add(s);\n\t\t\t\t}\n\t\t\t}\n\t\t\t uncontrollableSuccessors.add(currentSet);\n\t\t\t isUncontrollable[indexCount] = currentSet.size() > 0;\n\t\t\t indexCount+=1;\n\t\t}\n\n\t\tlosingStates.addAll(game.getStates());\n\t\t\n\t\tSet<S> currentLosingStates;\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t\tcurrentLosingStates\t= new HashSet<S>();\n\t\t\t\n\t\t\t// Handle the pending states\n\t\t\twhile (!losing.isEmpty()) {\n\t\t\t\tS state = losing.poll();\n\n\t\t\t\t\n\t\t\t\tcurrentLosingStates.add(state);\n\n\t\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\t\tfor (S pred : predecessors) {\n\t\t\t\t\tif(losing.contains(pred) || currentLosingStates.contains(pred))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t\t//if(i == -1)\n\t\t\t\t\t\t//continue;\n\t\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tuncontrollableSuccessors.get(i).remove(state);\n\t\t\t\t\t\tif(uncontrollableSuccessors.get(i).isEmpty())\n\t\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tlosingStates.retainAll(currentLosingStates);\n\t\t\t\n\t\t}\n\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public void randomizeState() {\n\t\t//System.out.print(\"Randomizing State: \");\n\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\tfor(int i = 0; i<9; i++)// adds 0-8 to list\n\t\t\tlst.add(i);\n\t\tCollections.shuffle(lst);//randomizes list\n\t\tString str=\"\";\n\t\tfor(Integer i : lst)\n\t\t\tstr += String.valueOf(i);\n\t\t//System.out.println(str);\n\t\tcurrent = new PuzzleState(str,current.getString(current.getGoalState()));\n\t\t//pathCost++;\n\t}", "public void solveGame3() {\n\t\tlosingStates = new HashSet<S>();\n\t\tQueue<S> losing = new LinkedList<S>();\n\t\tint[] uncontrollableCount = new int[game.getStates().size()+1];\n\t\tint[] uncontrollableLosingCount = new int[game.getStates().size()+1];\n\t\tboolean[] isUncontrollable = new boolean[game.getStates().size()+1];\n\t\tHashMap<S, Integer> stateToIndex = new HashMap<S, Integer>();\n\t\t\n\t\tSet<S> uncontrollableSuccesors;\n\t\tint i;\n\t\tint indexCount = 0;\n\t\tfor(S state:game.getStates()){\n\t\t\tstateToIndex.put(state, indexCount);\n\t\t\t //if(i == -1)\n\t\t\t\t//continue;\n\t\t\t uncontrollableSuccesors = ((Set<S>)this.game.getUncontrollableSuccessors(state));\n\n\t\t\t uncontrollableCount[indexCount] = uncontrollableSuccesors.size();\n\t\t\t uncontrollableLosingCount[indexCount] = 0;\n\t\t\t isUncontrollable[indexCount] = game.isUncontrollable(state);\n\t\t\t indexCount+=1;\n\t\t}\n\t\t\n\t\tfor (Set<S> actualGoalSet : this.goalStates) {\n\t\t\tlosing.addAll(actualGoalSet);\n\t\t}\n\n\t\t// Handle the pending states\n\t\twhile (!losing.isEmpty()) {\n\t\t\tS state = losing.poll();\n\n\t\t\t\n\t\t\tlosingStates.add(state);\n\n\t\t\tSet<S> predecessors = this.game.getPredecessors(state);\n\t\t\tfor (S pred : predecessors) {\n\t\t\t\tif(losing.contains(pred) || losingStates.contains(pred))\n\t\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t\ti = stateToIndex.get(pred);\n\t\t\t\t//if(i == -1)\n\t\t\t\t\t//continue;\n\t\t\t\tif (!isUncontrollable[i]) {\n\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}else{\n\t\t\t\t\tuncontrollableLosingCount[i]++;\n\t\t\t\t\tif (uncontrollableLosingCount[i] == uncontrollableCount[i])\n\t\t\t\t\t\tlosing.add(pred);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"LOSING STATES SIZe : \" + losingStates.size());\n\t\t\n\t\tthis.gameSolved = true;\n\t}", "public S getRandomState();", "static int[] getState(Node root){\n if(root==null)\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,0,0};\n\n int[] leftAns = getState(root.left);\n int[] rightAns = getState(root.right);\n\n if(root.val<leftAns[1] || root.val> rightAns[0]){\n //failed\n return new int[]{Integer.MAX_VALUE, Integer.MIN_VALUE,-1, Math.max(leftAns[3], rightAns[3])};\n }\n else {//(root.val>leftAns[1] && root.val<rightAns[0]){\n\n return new int[] { Math.min(leftAns[0], root.val), Math.max(rightAns[1], root.val) , leftAns[2]+rightAns[2]+1, Math.max(leftAns[2]+rightAns[2]+1,\n Math.max(leftAns[3], rightAns[3])) };\n\n }\n\n\n }", "@Override\r\n\tpublic DFA getDFA() {\r\n\t\t// Must implement the breadth first search algorithm.\r\n\t\tQueue<Set<NFAState>> workQueue = new LinkedList<Set<NFAState>>();\r\n\t\tDFA d = new DFA(); // Step 1. https://www.javatpoint.com/automata-conversion-from-nfa-to-dfa\r\n\t\t// d.addStartState(\"[\" + startState.getName() + \"]\"); //Step 2.\r\n\t\tworkQueue.add(eClosure(startState));\r\n\r\n\t\twhile (!workQueue.isEmpty()) {\r\n\t\t\tSet<NFAState> currentNode = workQueue.poll(); // current workItem.\r\n\t\t\tboolean isFinalState = false;\r\n\r\n\t\t\tfor (NFAState n : currentNode) {\r\n\t\t\t\tif (n.isFinal()) {\r\n\t\t\t\t\tisFinalState = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (d.getStartState() == null && !isFinalState) {\r\n\t\t\t\td.addStartState(currentNode.toString());\r\n\t\t\t} else if (d.getStartState() == null && isFinalState) {\r\n\t\t\t\td.addFinalState(currentNode.toString());\r\n\t\t\t\td.addStartState(currentNode.toString());\r\n\t\t\t}\r\n\r\n\t\t\tfor (Character symb : getABC()) {\r\n\t\t\t\tSet<NFAState> setOfStateForSymb = new HashSet<NFAState>();\r\n\t\t\t\tfor (NFAState v : currentNode) {\r\n\t\t\t\t\tif (v.getTrans().get(symb) != null) {\r\n\t\t\t\t\t\tfor (NFAState t : v.getTrans().get(symb)) {\r\n\t\t\t\t\t\t\tsetOfStateForSymb.addAll(eClosure(t));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tboolean dfaHasState = false;\r\n\r\n\t\t\t\tfor (State s : d.getStates()) {\r\n\t\t\t\t\tif (s.getName().equals(setOfStateForSymb.toString())) {\r\n\t\t\t\t\t\tdfaHasState = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (setOfStateForSymb.toString() == \"[]\") {\r\n\t\t\t\t\tif (!dfaHasState) {\r\n\t\t\t\t\t\td.addState(\"[]\");\r\n\t\t\t\t\t\tworkQueue.add(setOfStateForSymb);\r\n\t\t\t\t\t}\r\n\t\t\t\t\td.addTransition(currentNode.toString(), symb, \"[]\");\r\n\t\t\t\t} else if (!dfaHasState) {\r\n\t\t\t\t\tboolean isFinal = false;\r\n\t\t\t\t\tfor (NFAState ns : setOfStateForSymb) {\r\n\t\t\t\t\t\tif (ns.isFinal()) {\r\n\t\t\t\t\t\t\tisFinal = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (isFinal) {\r\n\t\t\t\t\t\tworkQueue.add(setOfStateForSymb);\r\n\t\t\t\t\t\td.addFinalState(setOfStateForSymb.toString());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tworkQueue.add(setOfStateForSymb);\r\n\t\t\t\t\t\td.addState(setOfStateForSymb.toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\td.addTransition(currentNode.toString(), symb, setOfStateForSymb.toString());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn d;\r\n\t}", "@Override\n\tpublic DFA getDFA() {\n\t\t//create a new DFA\n\t\tDFA dfa = new DFA();\n\t\t//Create a queue of NFA sets for traversal\n\t\tQueue<Set<NFAState>> nq = new LinkedList<Set<NFAState>>();\n\t\t\n\t\t//Create set with start state and put it in the queue\n\t\tTreeSet<NFAState> startSet = new TreeSet<NFAState>();\n\t\tstartSet.add((NFAState) getStartState());\n\t\tdfa.addStartState(startSet.toString());\n\t\tnq.add(startSet);\n\t\t\n\t\t//for each set of NFAstates dequeued\n\t\twhile(!nq.isEmpty()) {\n\t\t\t\n\t\t\tSet<NFAState> ncurrent = nq.remove();\t\t\t\n\t\t\t\n\t\t\t//loops through each character that is not 'e' to complete transitions\n\t\t\tfor(Character c : abc) {\n\t\t\t\tif(c != 'e') {\n\t\t\t\t\tSet<NFAState> getTo = new TreeSet<NFAState>();\n\t\t\t\t\tfor(NFAState state : ncurrent) {\n\t\t\t\t\t\tgetTo.addAll(state.getTo(c));\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (getTo != null) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tfor (NFAState s : getTo) {\n\t\t\t\t\t\t\t\tif(s.hasNextE()) { // check each next state for e closure\n\t\t\t\t\t\t\t\t\tif(eClosure(s) != null) {\n\t\t\t\t\t\t\t\t\t\t//add the states from eclosure to getTo set\n\t\t\t\t\t\t\t\t\t\tSet<NFAState> setWithE = eClosure(s);\t\t\n\t\t\t\t\t\t\t\t\t\tgetTo.addAll(setWithE);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t//Add state name and transitions to DFA state\n\t\t\t\t\t\n\t\t\t\t\t//check if the state is final\n\t\t\t\t\tBoolean isFinal = false;\n\t\t\t\t\tfor (NFAState s : getTo) {\n\t\t\t\t\t\tfor(State f : getFinalStates()) {\n\t\t\t\t\t\t\tif(f.getName().equals(s.getName())) {\n\t\t\t\t\t\t\t\tisFinal = true;\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\t\n\t\t\t\t\t//check if the state already exists in the DFA\n\t\t\t\t\tBoolean inDFA = false;\t\t\n\t\t\t\t\tfor(DFAState dstate : dfa.getStates()) {\n\t\t\t\t\t\tif(dstate.getName().equals(getTo.toString())) {\n\t\t\t\t\t\t\tinDFA = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t//add the state to DFA if it is not already\n\t\t\t\t\tif(!inDFA) {\n\t\t\t\t\t\t//check if final\n\t\t\t\t\t\tif(isFinal) {\n\t\t\t\t\t\t\tdfa.addFinalState(getTo.toString());\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tdfa.addState(getTo.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnq.add(getTo); //add new set to queue\n\t\t\t\t\t}\n\t\t\t\t\t//create the transition\t\t\n\t\t\t\t\tdfa.addTransition(ncurrent.toString(), c, getTo.toString());\n\t\t\t\t}//end if\n\t\t\t}//end for\n\t\t}//end while\n\t\treturn dfa;\n\t}", "public int getState() {return state;}", "public int getState() {return state;}", "public Collection<String> nextStates(String type, String state) {\r\n\r\n\t\tCollection<String> ret = new HashSet<String>();\r\n\t\tret.add(state);\r\n\t\tTaskState ts = getState(type, state);\r\n\t\tif (ts != null)\r\n\t\t\tret.addAll(ts.nextStates);\r\n\t\treturn ret;\r\n\t}", "private synchronized void initStateMachine() {\n next = start;\n Deque<StateInfo> stack = getNextToAncestorStackLocked();\n\n // Enter all the states of the new branch.\n while (stack.size() > 0) {\n current = stack.pop();\n current.active = true;\n current.state.enter();\n }\n next = null;\n }", "State getState();", "State getState();", "State getState();", "State getState();", "public void transitionStates () {\n myCurrentState = myNextState;\n myNextState = null;\n }", "@Override\n public ArrayList<AState> getAllPossibleStates(AState state){\n MazeState s = (MazeState)state;\n ArrayList<AState> moves = new ArrayList<AState> ();\n\n\n int row = s.getState().getRowIndex();\n int col = s.getState().getColumnIndex();\n int [][] matrix = mySearchableMaze.getMazeMatrix();\n\n\n if(row+1 < matrix.length){\n if( matrix[row+1][col]==0 ){\n moves.add(new MazeState(new Position(row+1,col),false,s.getCost()+1));\n\n }\n }\n if(row-1 >= 0 ){\n if( matrix[row-1][col]==0){\n moves.add(new MazeState(new Position(row-1,col),false,s.getCost()+1));\n\n }\n }\n if(col+1 < matrix[0].length ){\n if( matrix[row][col+1]==0 ){\n moves.add(new MazeState(new Position(row,col+1),false,s.getCost()+1));\n\n }\n }\n if(col-1 >= 0 ){\n if( matrix[row][col-1]==0 ){\n moves.add(new MazeState(new Position(row,col-1),false,s.getCost()+1));\n }\n }\n return moves;\n }", "public void next() {\n Solver<ArrayList<Integer>> mySolver =\n new Solver<ArrayList<Integer>>();\n ArrayList<ArrayList<Integer>> Solution =\n mySolver.SolveBFS(this);\n\n //Reset 'tried' to none\n tried = new HashSet<ArrayList<Integer>>();\n\n //Set up the nextState\n ArrayList<Integer> nextState = new ArrayList<Integer>();\n\n if(Solution.size() == 0) {\n //No Solution\n } else if (Solution.size() == 1) {\n nextState = Solution.get(0);\n curBoard = nextState;\n } else {\n nextState = Solution.get(1);\n curBoard = nextState;\n moveCount++;\n }\n clearStack();\n\n\tsetChanged();\n\tnotifyObservers();\n }", "PowerState getState();", "Object getState();", "@Override\n public TurnState getNextState() { return new Finalize(); }", "public Node<S> next() {\n Node<S> current = popUnvisited();\n // Take the associated state\n S currentState = current.transition().to();\n // Explore the adjacent neighbors\n for(Transition<S> successor : this.successors.from(currentState)){\n // If the neighbor is still unexplored\n if (!this.visited.containsKey(successor.to())){\n // Create the associated neighbor\n Node<S> successorNode = factory.node(current, successor);\n this.stack.push(successorNode);\n }\n }\n this.visited.put(currentState, current);\n return current;\n }", "public int numStates();", "public void advance()\n\t{\n\t\t//calling copy function\n\t\tcopy(); \n\t\t//for loop for row \n\t\tfor(int row =0; row<this.currentVersion.length; row++)\n\t\t{\t//for loop for column\n\t\t\tfor(int column =0; column<this.currentVersion[row].length; column++)\n\t\t\t{\n\t\t\t\t//if statements to implement 2D CA rules\n\t\t\t\tif (column == 0 && row == 0)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row+1][column] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column +1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row == 0 && column == currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row][column - 1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column - 1];\n\t\t\t\t\telse if (currentVersion[row+1][column] == currentVersion [row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row == 0 && column > 0 && column < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row][column-1] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if(currentVersion[row+1][column] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row == currentVersion.length-1 && column == 0)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row-1][column] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row -1][column]; \n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] + 1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif (row > 0 && column ==0 && row < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row+1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column];\n\t\t\t\t\tif(currentVersion[row][column+1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif(row == currentVersion.length-1 && column == currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row-1][column] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(row == currentVersion.length-1 && column > 0 && column < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif(currentVersion[row-1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1]; \n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column] +1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\t\n\t\t\t\tif(row>0 && row < currentVersion.length-1 && column == currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif (currentVersion[row-1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row+1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column]; \n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0; \n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\tif(row>0 && row < currentVersion.length-1 && column > 0 && column < currentVersion.length-1)\n\t\t\t\t{\n\t\t\t\t\tif (currentVersion[row-1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row-1][column];\n\t\t\t\t\telse if(currentVersion[row+1][column] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row+1][column]; \n\t\t\t\t\telse if(currentVersion[row][column-1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column-1];\n\t\t\t\t\telse if(currentVersion[row][column+1] == currentVersion[row][column]+1)\n\t\t\t\t\t\tnextVersion[row][column] = currentVersion[row][column+1];\n\t\t\t\t\telse if (currentVersion[row][column] == 0)\n\t\t\t\t\t\tnextVersion[row][column] = 1; \n\t\t\t\t\telse if (currentVersion[row][column] == state-1)\n\t\t\t\t\t\tnextVersion[row][column] = 0;\n\t\t\t\t\telse if(currentVersion[row][column] == state-2)\n\t\t\t\t\t\tnextVersion[row][column] = (byte) (state-1);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t//passing new nextVersion array to currentVersion array\n\tsetUniverse(nextVersion);\n\t}", "private byte[] calculateAllPossibleOutboundStates(byte state, byte[] allPossible){\n int stateNumParticles = calcNumParticlesInState(state);\n int[] stateMomentum = calculateMomentum(state);\n ArrayList<Byte> possibleStates = new ArrayList<>();\n for(byte poss:allPossible){\n int possNumPart = calcNumParticlesInState(poss);\n if(possNumPart==stateNumParticles){\n int[] possMomentum = calculateMomentum(poss);\n if(compareMomenta(possMomentum, stateMomentum)){\n possibleStates.add(poss);\n }\n }\n }\n byte[] ret = new byte[possibleStates.size()];\n int i = 0;\n for(Byte b:possibleStates){\n ret[i++] = b.byteValue();\n }\n return ret;\n }", "private void setInitialAndFinalStates() {\n for (int i = 0; i < dfaStates.size(); i++) {\n List<State> currStateList = dfaStates.get(i);\n for (int j = 0; j < currStateList.size(); j++) {\n if (currStateList.get(j).getFinal()) {\n if (!finalStates.contains(dfaStatesWithNumbering.get(currStateList))) {\n finalStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n if (currStateList.get(j).getInitial()) {\n initialStates.add(dfaStatesWithNumbering.get(currStateList));\n }\n }\n }\n }", "public int getStates() {\n return states;\n }", "public void next() {\n double[][] next = new double[size][size];\n for (int i = 0; i < size; i++) {\n for (int j = 0; j < size; j++) {\n double sum = 0.0;\n for (int k = 0; k < size; k++) {\n sum += state[i][k] * transition[k][j];\n }\n next[i][j] = sum;\n }\n }\n this.currentStep++;\n this.state = next;\n }", "int getStateValue();", "int getStateValue();", "int getStateValue();", "private Set<Integer> getStatesFromWichReachableAccepting(LabelledTransitionSystem ret) {\n\t\tMap<Integer, Set<Integer>> reversedReachable = this.computeInverseTransitionRelation(ret);\n\n\t\tSet<Integer> reachable = new HashSet<>();\n\n\t\tlogger.debug(\"Accepting states: \" + ret.getAccepting());\n\t\tSet<Integer> current = ret.getAccepting();\n\n\t\tboolean[] visited = new boolean[ret.getStates().length];\n\n\t\twhile (!current.isEmpty()) {\n\t\t\tInteger evaluated = current.iterator().next();\n\t\t\tcurrent.remove(evaluated);\n\t\t\tif (!visited[evaluated]) {\n\t\t\t\tvisited[evaluated] = true;\n\t\t\t\treachable.add(evaluated);\n\t\t\t\tSet<Integer> prev = new HashSet<>(reversedReachable.get(evaluated));\n\t\t\t\tcurrent.addAll(prev);\n\t\t\t}\n\t\t}\n\n\t\treturn reachable;\n\t}", "public AeBpelState getState();", "protected abstract int newState();", "ESMFState getState();", "private int computeState() {\n int state;\n if (corePd)\n state = 1; //power down state\n else\n state = 2; // core, e.g. crystal on state\n if (!corePd && !biasPd)\n state = 3; // crystal and bias on state\n if (!corePd && !biasPd && !fsPd)\n state = 4; // crystal, bias and synth. on\n if (!corePd && !biasPd && !fsPd && !rxtx && !rxPd)\n state = 5; // receive state\n if (!corePd && !biasPd && !fsPd && rxtx && !txPd)\n state = PA_POW_reg.getPower() + 6;\n return state;\n }", "public int getState()\r\n\t{\r\n\t\treturn currentstate;\r\n\t}", "final State[] expand(Action[] possibleActions){\n\t\t\n\t\t\n\t\t//if actions is null or has no elements, then it was a end state - there are so sub-states\n\t\tif(possibleActions==null || possibleActions.length==0)\n\t\t\treturn new State[0];\n\t\t\n\t\t//create an array to hold the sub-states\n\t\tState[] states = new State[possibleActions.length];\n\t\t\n\t\t//get each possible sub state by performing all possible actions from this state\n\t\tfor(int i = 0; i<states.length; i++){\n\t\t\t//get the resulting state of actions[i]\n\t\t\tstates[i] = performAction(possibleActions[i]);\n\t\t\t//have the new state recored what action was taken to get to that state\n\t\t\tstates[i].setAction(possibleActions[i]);\n\t\t}\n\t\t\n\t\t//return the sub-states\n\t\treturn states;\n\t\t\n\t}", "public void compileStates(int timeinterval) {\r\n\t\tif(timeinterval == -1) {\r\n\t\t\t//Add initial State\r\n\t\t\treachableStates.add(initialState);\r\n\t\t\tthis.numReachableState = 1;\r\n\t\t\t\r\n\t\t}else{\t\t\t\t\r\n\t\tState s;\r\n\t\tint index = 0;\r\n\t\treachableStates.clear();\r\n\t\tfor(int i = 0; i < totalWorkloadLevel; i++) {\r\n\t\t\tfor(int j = 0; j < totalGreenEnergyLevel; j++) {\r\n\t\t\t\tfor(int k = 0; k < totalBatteryLevel; k++) {\r\n\t\t\t\t\ts = grid[timeinterval][i][j][k];\r\n\t\t\t\t\tif(s.getProbability() != 0) {\r\n\t\t\t\t\t\t//If probability of state is not 0, put this state into the reachable list. \r\n\t\t\t\t\t\ts.index = index;\r\n\t\t\t\t\t\tindex++;\r\n\t\t\t\t\t\treachableStates.add(s);\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\tthis.numReachableState = index;\r\n\t\t}\r\n\t}", "@Override\n public WorkflowStep next() {\n this.boardChangeDetected = 0;\n this.missingFutures = 0;\n this.missingTetromino = 0;\n startCalculator(false);\n return DETECT_ANOMALIES;\n }", "@Test\n public void genStateTransferMetric() {\n TreeMap<String, Integer> stat = new TreeMap<>();\n int currState = 8;\n for (int i = 1; i < numSteps; i++) {\n int nextStates = getNextState(currState);\n stat.compute(currState + \"-\" + nextStates, (k, v) -> v == null ? 1 : v + 1);\n currState = nextStates;\n }\n stat.forEach((k, v) -> System.out.printf(\"%s:%f\\n\", k.replace('-', ':'), (double) v / numSteps));\n }", "private Collection<? extends AbstractState> getFollowStates(AutomatonState state, List<AbstractState> otherElements, CFAEdge edge, boolean failOnUnknownMatch) throws CPATransferException {\n Preconditions.checkArgument(!(state instanceof AutomatonUnknownState));\n if (state == cpa.getBottomState()) {\n //return Collections.singleton(state);\n return Collections.emptySet();\n }\n\n if (state.getInternalState().getTransitions().isEmpty()) {\n // shortcut\n return Collections.singleton(state);\n }\n\n Collection<AbstractState> lSuccessors = new HashSet<AbstractState>(2);\n AutomatonExpressionArguments exprArgs = new AutomatonExpressionArguments(state.getVars(), otherElements, edge, logger);\n boolean edgeMatched = false;\n boolean nonDetState = state.getInternalState().isNonDetState();\n\n // these transitions cannot be evaluated until last, because they might have sideeffects on other CPAs (dont want to execute them twice)\n // the transitionVariables have to be cached (produced during the match operation)\n // the list holds a Transition and the TransitionVariables generated during its match\n List<Pair<AutomatonTransition, Map<Integer, String>>> transitionsToBeTaken = new ArrayList<Pair<AutomatonTransition, Map<Integer, String>>>(2);\n\n for (AutomatonTransition t : state.getInternalState().getTransitions()) {\n exprArgs.clearTransitionVariables();\n\n matchTime.start();\n ResultValue<Boolean> match = t.match(exprArgs);\n matchTime.stop();\n if (match.canNotEvaluate()) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition condition could not be evaluated: \" + match.getFailureMessage());\n }\n // if one transition cannot be evaluated the evaluation must be postponed until enough information is available\n return Collections.singleton(new AutomatonUnknownState(state));\n } else {\n if (match.getValue()) {\n edgeMatched = true;\n assertionsTime.start();\n ResultValue<Boolean> assertionsHold = t.assertionsHold(exprArgs);\n assertionsTime.stop();\n\n if (assertionsHold.canNotEvaluate()) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition assertions could not be evaluated: \" + assertionsHold.getFailureMessage());\n }\n // cannot yet be evaluated\n return Collections.singleton(new AutomatonUnknownState(state));\n\n } else if (assertionsHold.getValue()) {\n if (!t.canExecuteActionsOn(exprArgs)) {\n if (failOnUnknownMatch) {\n throw new CPATransferException(\"Automaton transition action could not be executed\");\n }\n // cannot yet execute, goto UnknownState\n return Collections.singleton(new AutomatonUnknownState(state));\n }\n\n // delay execution as described above\n Map<Integer, String> transitionVariables = ImmutableMap.copyOf(exprArgs.getTransitionVariables());\n transitionsToBeTaken.add(Pair.of(t, transitionVariables));\n\n } else {\n // matching transitions, but unfulfilled assertions: goto error state\n AutomatonState errorState = AutomatonState.automatonStateFactory(Collections.<String, AutomatonVariable>emptyMap(), AutomatonInternalState.ERROR, cpa);\n logger.log(Level.INFO, \"Automaton going to ErrorState on edge \\\"\" + edge.getDescription() + \"\\\"\");\n lSuccessors.add(errorState);\n }\n\n if (!nonDetState) {\n // not a nondet State, break on the first matching edge\n break;\n }\n }\n // do nothing if the edge did not match\n }\n }\n\n if (edgeMatched) {\n // execute Transitions\n for (Pair<AutomatonTransition, Map<Integer, String>> pair : transitionsToBeTaken) {\n // this transition will be taken. copy the variables\n AutomatonTransition t = pair.getFirst();\n Map<Integer, String> transitionVariables = pair.getSecond();\n actionTime.start();\n Map<String, AutomatonVariable> newVars = deepCloneVars(state.getVars());\n exprArgs.setAutomatonVariables(newVars);\n exprArgs.putTransitionVariables(transitionVariables);\n t.executeActions(exprArgs);\n actionTime.stop();\n AutomatonState lSuccessor = AutomatonState.automatonStateFactory(newVars, t.getFollowState(), cpa);\n //if (!(lSuccessor instanceof AutomatonState.BOTTOM)) {\n lSuccessors.add(lSuccessor);\n //} // else add nothing\n }\n return lSuccessors;\n } else {\n // stay in same state, no transitions to be executed here (no transition matched)\n return Collections.singleton(state);\n }\n }", "public static LocNode intialState() {\n\n\t \n\t char[][] newMatrix =copyMatrix(matrix);\n\t \n\t \n\n\t \n\twhile(true) {\n\t\t\t\n\t\t\t\n\t\tint i=getRandomIndex(size);\n\t\tint j=getRandomIndex(size);\n\t\t\n\t if(newMatrix[i][j]=='-') {\n\t \t\n\t \n\t \t newMatrix[i][j]='c' ;\n\t \t \n\t \t \n\t \t updateVisibility(i, j, newMatrix);\n\t \t \n\t \t\n\t \t LocNode intialState= new LocNode(newMatrix, calculateOpjectiveFunction(newMatrix));\n\t \t \n\t \t\n\t \t return intialState;\n\t }\n\t \n\t }\n }", "@Override\n\tpublic int incTstates() {\n\t\treturn 4;\n\t}", "org.landxml.schema.landXML11.StateType.Enum getState();", "@Override\n public Automaton next(){\n if (!this.hasNext()) return null;\n this.checkNext();\n \n Automaton ret = new Automaton();\n try {\n ret = new Automaton(this.currentTransitions,this.currentInitialStateId,this.currentFinalStatesIds);\n } catch (Exception ex) {\n Logger.getLogger(AutomatonIterator.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n if (!this.allStatesIterator.hasNext()){\n this.allStatesIterator = new IntegerIterator(1);\n this.currentInitialStateId = this.allStatesIterator.next();\n if(!this.allSubsetsIterator.hasNext()){\n this.allSubsetsIterator.reset();// = new SubsetIterator(this.numberOfStates);\n this.currentFinalStatesIds = this.allSubsetsIterator.next();\n this.currentTransitions = this.allTransitionsIterator.next();\n }\n else{\n this.currentFinalStatesIds = this.allSubsetsIterator.next();\n }\n }\n else{\n this.currentInitialStateId = this.allStatesIterator.next();\n }\n \n return ret;\n }", "@Test\n void getCurrentRewardsFromUpgradeTest() {\n EnumMap<CardPoints,Integer> oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n oracle.put(CardPoints.VICTORY, 3);\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); //index/state = 0, cost stage 1\n assertEquals(oracle, this.wonder.getProp().get(this.wonder.getState()).y); //index/state = 0, cost stage 1\n\n wonder.setState(wonder.getState() + 1); // stage one is build\n oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n //reward is an effect, so no cardpoints\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); // index/state = 1, cost stage 2\n\n wonder.setState(wonder.getState() + 1); // 2 stage build\n oracle = new EnumMap<CardPoints, Integer>(CardPoints.class);\n oracle.put(CardPoints.VICTORY, 7);\n assertEquals(oracle, this.wonder.getCurrentRewardsFromUpgrade()); // index/state = 2, cost stage 3\n wonder.setState(wonder.getState() + 1); // Build the last stage\n\n //return an outIndexError when we call this method\n }", "java.lang.String getState();", "public void optimize(){\n\n NfaState currState;\n HashMap<Integer, State> statesCloned = (HashMap)states.clone();\n\n\n boolean removed;\n\n for(Map.Entry<Integer, State> entry : statesCloned.entrySet()) {//for each state of the nfa\n\n do {\n removed=false;\n Integer id = entry.getKey();\n\n if (states.get(id) == null)//state already been removed\n continue;\n else\n currState = (NfaState) entry.getValue();\n\n HashMap<String, ArrayList<Integer>> startEdges = currState.getOut_edges();\n\n for (Map.Entry<String, ArrayList<Integer>> startEdge : startEdges.entrySet()) {//for each edge of the current state being optimezed\n\n ArrayList<Integer> transactions = new ArrayList(startEdge.getValue());\n\n\n for (Integer state2DegID : transactions) {// for each transaction the 2nd degree state\n NfaState stateDeg2 = (NfaState) states.get(state2DegID);\n\n if (stateDeg2.getOut_edges() == null)\n continue;\n\n\n\n ArrayList<Integer> edgesDeg2 = stateDeg2.getOut_edges().get(EPSILON);\n\n if (edgesDeg2 != null && edgesDeg2.size() == 1 && stateDeg2.getOut_edges().size() == 1) {//if the next state has only a epsilon transaction, we can remove this state\n NfaState successor = (NfaState) states.get(edgesDeg2.get(0));\n\n\n for (Map.Entry<String, ArrayList<Integer>> inEdgesDeg2 : stateDeg2.getIn_edges().entrySet()) {//for every in_edge of the state being removed, update the elements accordingly\n String key = inEdgesDeg2.getKey();\n\n if (inEdgesDeg2.getValue().size() > 0)\n removed = true;\n\n for (Integer stateBeingUpdatedId : inEdgesDeg2.getValue()) {//state to be updated\n NfaState stateBeingUpdated = (NfaState) states.get(stateBeingUpdatedId);\n //add new edge\n stateBeingUpdated.addEdge(key, successor);\n\n //remove out and in edge to intermediate\n stateBeingUpdated.getOut_edges().get(key).remove((Integer) stateDeg2.getId());\n }\n }\n\n //remove out_edges\n for (Map.Entry<String, ArrayList<Integer>> outEdgesDeg2 : stateDeg2.getOut_edges().entrySet()) {\n for (Integer sucId : outEdgesDeg2.getValue()){\n ((NfaState)states.get(sucId)).getIn_edges().get(outEdgesDeg2.getKey()).remove((Integer) stateDeg2.getId());\n }\n }\n //remove state\n states.remove(stateDeg2.getId());\n }\n }\n\n }\n\n }while (removed);\n }\n }", "int getStateValues(int index);", "public ArrayList<State> childStates(){\n boolean hasExpanded = false;\n this.childStates = new ArrayList<>();\n Successor successor = new Successor(); //for calling the successors functions\n //cases for this\n for (int i = 0; i < boardRows ; i++) {\n for (int j = 0; j < boardColumns; j++) {\n if(!hasExpanded){\n if(currentBoardState[i][j] == 0){\n\n if( i - 1 >= 0){\n //call moveDown()\n //System.out.println(i + \" \" + j);\n //System.out.println(\"calling moveDown()\");\n State newState = successor.moveDown(i, j, this.getCurrentBoardState(), this.getGoalBoardState());\n\n //newState.printBoard();\n childStates.add(newState);\n }\n\n if( i + 1 <= boardRows-1){\n //call moveUp()\n //System.out.println(i + \" \" + j);\n //System.out.println(\"calling moveUp()\");\n //this.printBoard();\n State newState = successor.moveUp(i, j, this.getCurrentBoardState(), this.getGoalBoardState());\n //newState.printBoard();\n childStates.add(newState);\n }\n\n if(j - 1 >= 0){\n //System.out.println(i + \" \" + j);\n //System.out.println(\"calling moveRight()\");\n //this.printBoard();\n State newState = successor.moveRIght(i, j, this.getCurrentBoardState(), this.getGoalBoardState());\n //newState.printBoard();\n childStates.add(newState);\n }\n\n if( j + 1 <= boardColumns - 1){\n //System.out.println(i + \" \" + j);\n //System.out.println(\"calling moveLeft()\");\n //this.printBoard();\n State newState = successor.moveLeft(i,j,this.getCurrentBoardState(), this.getGoalBoardState());\n //newState.printBoard();\n childStates.add(newState);\n }\n hasExpanded = true;\n }\n }\n }\n }\n return childStates;\n }", "@Override\n\tLiving next(Neighbors n) {\n\t\tint rabbit=0;\n\t\tint grass=0;\n\t\tint fox = 0;\n\t\tfor (int i=0;i<=7;i++){\n\t\t\tif (n.array[i] == 'R')\n\t\t\t\trabbit++;\n\t\t\telse if (n.array[i] == 'X')\n\t\t\t\tfox++;\n\t\t\telse if (n.array[i] == 'G')\n\t\t\t\tgrass++;\n\t\t}\n\t\tif (grass == 0 || fox>=rabbit+1){\n\t\t\treturn new Empty();\n\t\t}\n\t\t\n\t\telse\n\t\t\treturn new Rabbit();\n\t\t\n\t}", "synchronized void advanceState()\n {\n state = state.advance();\n notifyAll();\n }", "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 State getState();", "public State getState();", "State(int[][] startBoardState, int [][] goalBoardState){\n this.currentBoardState = startBoardState;\n this.goalBoardState = goalBoardState;\n this.g_cost = 0;\n this.parentState = null;\n }", "public static Set<ARGState> getOnePathToARGStateForSimpleProperty(ARGState source, ARGState destination) {\n Set<Integer> seenElements = new HashSet<Integer>();\n ARGState currentARGState = source;\n seenElements.add(source.getStateId());\n List<ARGState> path = new ArrayList<ARGState>();\n path.add(currentARGState);\n // Set<ARGState> result = new HashSet<ARGState>();\n while (currentARGState.getStateId() != destination.getStateId()) {\n boolean end = true;\n if (!currentARGState.getChildren().isEmpty()) {\n Iterator<ARGState> children = currentARGState.getChildren().iterator();\n ARGState childrenElement ;\n do {\n childrenElement = children.next();\n if (!seenElements.contains(childrenElement.getStateId())) {\n path.add(childrenElement);\n currentARGState=childrenElement;\n seenElements.add(childrenElement.getStateId());\n end = false;\n break;\n }\n } while(children.hasNext());\n if(end){\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n\n }\n else{\n path.remove(path.size()-1);\n if(path.size()!=0){\n currentARGState=path.get(path.size()-1);\n seenElements.add(currentARGState.getStateId());\n }\n else\n break;\n }\n }\n if(currentARGState.getStateId() != destination.getStateId())\n return null;\n if(!destination.getChildren().contains(source))\n return null;\n System.out.println(\"path.size=\"+path.size());\n Iterator<ARGState> it=path.iterator();\n for(int i=0;i<path.size()-1;i++){\n ARGState pre=path.get(i);\n ARGState suc=path.get(i+1);\n CFAEdge edge=pre.getEdgeToChild(suc);\n if(edge.getRawStatement().equals(\"BLANKEDGE\")){\n pre.getChildren().remove(suc);\n suc.getParents().remove(pre);\n AbstractStates.extractLocation(pre).getLeavingEdge().remove(edge);\n AbstractStates.extractLocation(suc).getEnteringEdges().remove(edge);\n }\n }\n return new HashSet<ARGState>(path);\n }", "private void generateSteps() {\n for (GlobalState g : this.globalStates) {\n List<String> faults = g.getPendingFaults(); \n if(faults.isEmpty()) {\n // Identifying all available operation transitions (when there \n // are no faults), and adding them as steps\n List<String> gSatisfiableReqs = g.getSatisfiableReqs();\n \n for(Node n : nodes) {\n String nName = n.getName();\n String nState = g.getStateOf(nName);\n List<Transition> nTau = n.getProtocol().getTau().get(nState);\n for(Transition t : nTau) {\n boolean firable = true;\n for(String req : t.getRequirements()) {\n if(!(gSatisfiableReqs.contains(n.getName() + \"/\" + req)))\n firable = false;\n }\n if(firable) {\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, t.getTargetState());\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,t.getOperation(),next));\n }\n }\n }\n } else {\n // Identifying all settling handlers for handling the faults\n // pending in this global state\n for(Node n: nodes) {\n // Computing the \"targetState\" of the settling handler for n\n String targetState = null;\n \n String nName = n.getName();\n String nState = g.getStateOf(nName);\n Map<String,List<String>> nRho = n.getProtocol().getRho();\n \n List<String> nFaults = new ArrayList();\n for(String req : nRho.get(nState)) {\n if(faults.contains(nName + \"/\" + req)) \n nFaults.add(req);\n }\n\n // TODO : Assuming handlers to be complete \n\n if(nFaults.size() > 0) {\n Map<String,List<String>> nPhi = n.getProtocol().getPhi();\n for(String handlingState : nPhi.get(nState)) {\n // Check if handling state is handling all faults\n boolean handles = true;\n for(String req : nRho.get(handlingState)) {\n if(nFaults.contains(req))\n handles = false;\n }\n\n // TODO : Assuming handlers to be race-free\n\n // Updating targetState (if the handlingState is \n // assuming a bigger set of requirements)\n if(handles) {\n if(targetState == null || nRho.get(handlingState).size() > nRho.get(targetState).size())\n targetState = handlingState;\n }\n }\n // Creating a new mapping for the actual state of n\n Map<String,String> nextMapping = new HashMap();\n nextMapping.putAll(g.getMapping());\n nextMapping.put(nName, targetState);\n // Searching the ref to the corresponding global \n // state in the list globalStates\n GlobalState next = search(nextMapping);\n // Adding the step to list of steps in g\n g.addStep(new Step(nName,next));\n }\n }\n }\n }\n }", "public void getState();" ]
[ "0.6990687", "0.6570848", "0.6480148", "0.64790124", "0.6341822", "0.6315959", "0.6287333", "0.62424177", "0.6229872", "0.6201965", "0.6155448", "0.6141691", "0.6135427", "0.6113497", "0.6091606", "0.6091606", "0.6091606", "0.6091606", "0.6091606", "0.6091606", "0.6079277", "0.59791595", "0.597677", "0.59760207", "0.5966369", "0.5953048", "0.59355044", "0.59243876", "0.5913216", "0.58899003", "0.5877102", "0.5872877", "0.5872877", "0.5872877", "0.5872877", "0.58682156", "0.5850446", "0.58346444", "0.58092207", "0.57747287", "0.57709336", "0.57498753", "0.5747088", "0.5745885", "0.57244617", "0.5722519", "0.5719913", "0.5716395", "0.57159466", "0.57159466", "0.5696471", "0.56647956", "0.56637037", "0.56637037", "0.56637037", "0.56637037", "0.5660071", "0.56570053", "0.5652864", "0.56473255", "0.5634635", "0.5634363", "0.56334424", "0.5629934", "0.5620115", "0.56177235", "0.56126034", "0.560999", "0.55985045", "0.55865407", "0.55865407", "0.55865407", "0.5570656", "0.5566818", "0.55636007", "0.55609256", "0.5555543", "0.5542713", "0.5533572", "0.55321205", "0.55239725", "0.5522881", "0.55221623", "0.55012786", "0.5499237", "0.5498302", "0.54958475", "0.54788524", "0.54743975", "0.546025", "0.54539335", "0.5451872", "0.5451152", "0.54494303", "0.54451257", "0.54420483", "0.54420483", "0.5436963", "0.54231817", "0.54184234", "0.54168785" ]
0.0
-1
Moves the blank tile up
public static void goUp(Node parent) { int[][] tempArray = new int[3][3]; int blankPositionRow = parent.getblankPositionRow(); int blankPositionCol = parent.getblankPositionCol(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { tempArray[i][j] = parent.stateSpace[i][j]; } } if (blankPositionRow != 0) { int temp = tempArray[blankPositionRow - 1][blankPositionCol]; tempArray[blankPositionRow - 1][blankPositionCol] = 0; tempArray[blankPositionRow][blankPositionCol] = temp; Node node = new Node(tempArray, finalState, parent); choiceOfNodes.add(node); nodesGenerated++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moveUp() {\n\n if (this.row - 1 < 16) {\n return;\n }\n this.row -= 1;\n\n playerImage.translate(0, -Cell.CELLSIZE);\n playerImage.draw();\n }", "public void moveUp()\n\t{\n\t\tthis.grid.moveUp();\n\t}", "private void swapTileWithBlank(TileView tv) {\n\t\tTile tile = tv.getCurrentTile();\n\n\t\tTileView theBlankTileView = tileViews\n\t\t\t\t.get(computeLocationValue(theBlankTile.getCurrentLocation()));\n\n//\t\tLog.v(\"log_tag\", \"Tile Row= \" + tile.getCurrentLocation().getRow()\n//\t\t\t\t+ \" Tile Column= \" + tile.getCurrentLocation().getColumn());\n//\t\tLog.v(\"log_tag\", \"theBlankTile Row= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getRow() + \" theBlankTile Column= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getColumn());\n\n\t\tif (tile.getCurrentLocation().isAdjacent(\n\t\t\t\ttheBlankTile.getCurrentLocation())) {\n\n\t\t\t// Animate tile movement\n\t\t\tif (tile.getCurrentLocation().getColumn() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// LEFT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.left_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getColumn() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// RIGHT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.right_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// UP\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.up_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// DOWN\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.down_animation));\n\t\t\t}\n\t\t\ttheBlankTileView.setCurrentTile(tile);\n\t\t\ttv.setCurrentTile(theBlankTile);\n\n\t\t\tmoveCount++;\n\n\t\t\tmoveTextView.setText(\"Moves : \" + moveCount);\n\t\t}\n\n\t\tif (isCorrect()) {\n\t\t\t((Activity) context).showDialog(PuzzleActivity.DIALOG_COMPLETED_ID);\n\t\t}\n\n\t}", "public void moveTileBack()\n {\n if(!(activeTile-1 < 0) && activeTile > 0)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile-1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile-1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile-1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile-1].getEndColor());\n \n tiles[activeTile-1].setTileLevel(tiles[activeTile-1].getTileLevel()+1);\n tiles[activeTile] = tiles[activeTile-1];\n previews[activeTile] = previews[activeTile-1];\n previewGradients[activeTile] = previewGradients[activeTile-1];\n previewHover[activeTile] = previewHover[activeTile-1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()-1);\n tiles[activeTile-1] = tmpTile;\n tiles[activeTile-1].setStartColor(tiles[activeTile-1].getStartColor());\n previews[activeTile-1] = tmpPreview;\n previewGradients[activeTile-1] = tmpPreviewGradients;\n previewHover[activeTile-1] = tmpPreviewHover;\n \n activeTile -= 1;\n createPreviewGradients();\n }\n }", "public void adjustUp() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].y = tiles[x][y].y - 4;\n backGroundTiles[x][y].y = backGroundTiles[x][y].y - 4;\n grassTiles[x][y].y = grassTiles[x][y].y - 4;\n }\n }", "public void moveUp() {\n\t\tstate.updateFloor(state.getFloor()+1);\n\t}", "public void moveUp()\n\t{\n\t\trow++;\n\t}", "public void moveUp()\n\t{\n\t\ty = y - STEP_SIZE;\n\t}", "public void moveUp()\n {\n if (!this.search_zone.isTopBorder(this.y_position))\n {\n this.y_position = (this.y_position - 1);\n }\n }", "public synchronized void moveDown(){\n if (!this.isAtBottom()){\n for (int j = 1; j < 25; j++){\n for (int i = 1; i < 13; i++){\n if (this.movable[i][j]){\n this.map[i][j - 1] = this.map[i][j];\n this.movable[i][j - 1] = this.movable[i][j];\n this.colors[i][j - 1] = this.colors[i][j];\n\n this.map[i][j] = false;\n this.movable[i][j] = false;\n this.colors[i][j] = null;\n\n }\n }\n }\n }\n this.piecePositionY--;\n repaint();\n }", "public void moveUp() {\n btMoveUp().push();\n }", "public void moveUp() {\n btMoveUp().push();\n }", "public void up(){\n\t\tmoveX=0;\n\t\tmoveY=-1;\n\t}", "protected void up() {\n move(positionX, positionY - 1);\n orientation = BattleGrid.RIGHT_ANGLE * 3;\n }", "public void moveUp() {\n locY = locY + 1;\n }", "public void reset( )\n\t{\n\t\tint count = 1;\n\t\tthis.setMoves( 0 );\n\t\tfor( int i = 0; i < this.getSize(); i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < this.getWidth(); j++ )\n\t\t\t{\n\t\t\t\tthis.setTile( count++, i, j );\n\t\t\t\tif( i == getSize( ) - 1 && j == getWidth( ) - 1 ) {\n\t\t\t\t\tthis.setTile( -1, i, j );\n\t\t\t\t\tlocationX = i;\n\t\t\t\t\tlocationY = j;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void moveUp() {\r\n\t\tmy_cursor_location.y--;\r\n\t}", "public void moveUp() {\n this.accelerateYU();\n this.moveY(this.getySpeed());\n this.setPicX(0);\n this.setPicY(211);\n this.setLoopCells(true);\n }", "public void moveUp() {\n\t\tsetPosY(getPosY() - steps);\n\t}", "public void moveTileForward()\n {\n if(!(activeTile+1 > tiles.length-1) && tiles[activeTile+1] != null)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile+1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile+1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile+1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile+1].getEndColor());\n \n tiles[activeTile+1].setTileLevel(tiles[activeTile+1].getTileLevel()-1);\n tiles[activeTile] = tiles[activeTile+1];\n previews[activeTile] = previews[activeTile+1];\n previewGradients[activeTile] = previewGradients[activeTile+1];\n previewHover[activeTile] = previewHover[activeTile+1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()+1);\n tiles[activeTile+1] = tmpTile;\n tiles[activeTile+1].setStartColor(tiles[activeTile+1].getStartColor());\n previews[activeTile+1] = tmpPreview;\n previewGradients[activeTile+1] = tmpPreviewGradients;\n previewHover[activeTile+1] = tmpPreviewHover;\n \n activeTile += 1;\n createPreviewGradients();\n }\n }", "private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }", "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "private void moveUp(GameWorld world) {\n world.world[world.avatarPosition.x][world.avatarPosition.y] = Tileset.FLOOR;\n world.world[world.avatarPosition.x][world.avatarPosition.y + 1] = Tileset.AVATAR;\n world.avatarPosition.y = world.avatarPosition.y + 1;\n }", "private boolean slideUp()\n {\n if (blankRow == SIZE - 1) {\n return false;\n }\n board[blankRow][blankCol] = board[blankRow + 1][blankCol];\n board[blankRow + 1][blankCol] = 0;\n blankRow += 1;\n return true;\n }", "public void undoLastMove()\n {\n if (inProgress() && stackTiles.size() > 1)\n {\n // TAKE THE TOP 2 TILES\n MahjongSolitaireTile topTile = stackTiles.remove(stackTiles.size()-1);\n MahjongSolitaireTile nextToTopTile = stackTiles.remove(stackTiles.size() - 1);\n \n // SET THEIR DESTINATIONS\n float boundaryLeft = miniGame.getBoundaryLeft();\n float boundaryTop = miniGame.getBoundaryTop();\n \n // FIRST TILE 1\n int col = topTile.getGridColumn();\n int row = topTile.getGridRow();\n int z = tileGrid[col][row].size();\n float targetX = this.calculateTileXInGrid(col, z);\n float targetY = this.calculateTileYInGrid(row, z);\n topTile.setTarget(targetX, targetY);\n movingTiles.add(topTile);\n topTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(topTile);\n \n // AND THEN TILE 2\n col = nextToTopTile.getGridColumn();\n row = nextToTopTile.getGridRow();\n z = tileGrid[col][row].size();\n targetX = this.calculateTileXInGrid(col, z);\n targetY = this.calculateTileYInGrid(row, z);\n nextToTopTile.setTarget(targetX, targetY);\n movingTiles.add(nextToTopTile);\n nextToTopTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(nextToTopTile);\n \n // PLAY THE AUDIO CUE\n miniGame.getAudio().play(MahjongSolitairePropertyType.UNDO_AUDIO_CUE.toString(), false); \n }\n }", "public void moveDown()\n\t{\n\t\tthis.grid.moveDown();\n\t}", "void moveUp();", "void moveUp();", "private void playerMoveUp()\n {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(false);\n this.setCurrentY(this.getCurrentY() - 1);\n if (this.getCurrentY() > -1) {\n if (!nextIsWall()) {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n } else {\n this.setCurrentY(this.getCurrentY() + 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n }\n } else// hit edge redo setlocation\n {\n this.setCurrentY(this.getCurrentY() + 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n } \n }", "private void goUpWall() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.turnLeft();\n\t\tthis.move(2);\n\t\tthis.turnRight();\n\t}", "public void adjustDown() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].y = tiles[x][y].y + 4;\n backGroundTiles[x][y].y = backGroundTiles[x][y].y + 4;\n grassTiles[x][y].y = grassTiles[x][y].y + 4;\n }\n }", "public void resetPlayerPosition() {\n\t\tthis.tilePositionX = this.STARTING_X;\n\t\tthis.tilePositionY = this.STARTING_Y;\n\t}", "public void moveDown()\n\t{\n\t\trow--;\n\t}", "private void moveBack(){\r\n\t\tturnAround();\r\n\t\tmove();\r\n\t}", "public void moveUp() {\n Coordinate upCoord = new Coordinate(getX(), getY() - 1);\n handleMove(upCoord, InteractionHandler.UP);\n }", "public void upPressed()\r\n {\r\n worldPanel.newMapPos(0,-zoom);\r\n miniMap.newMapPos(0,-1);\r\n }", "void move(Tile t);", "public boolean moveUpLeft() {\n\t\tif (check(col-1, row-1)) {\n\t\t\tHiVolts.board.squares[row][col] = 0; // set current location to nothing\n\t\t\tcol = col - 1; // get new x\n\t\t\trow = row - 1; // get new y\n\t\t\tHiVolts.board.squares[row][col] = 2; // set new location to avatar\n\t\t\tsuper.moveUpLeft(); // calls move function in piece\n\t\t}\n\t\treturn true;\n\t}", "public void moveTileUp(float delta) {\n if (y < destinationY - COMBAT_MOVEMENT_SPEED * delta) speedY = COMBAT_MOVEMENT_SPEED;\n else {\n speedY = (destinationY - y) / delta;\n isMoving = false;\n isMovingUp = false;\n }\n direction = Direction.UP;\n }", "public void moveDown() {\n\t\tstate.updateFloor(state.getFloor()-1);\n\t}", "public void dropNewTile() {\n ArrayList<Integer> emptyTilesX= new ArrayList<Integer>();\n ArrayList<Integer> emptyTilesY= new ArrayList<Integer>();\n\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n emptyTilesX.add(x);\n emptyTilesY.add(y);\n }\n }\n }\n\n int randTile= rand.nextInt(emptyTilesX.size());\n int percent= rand.nextInt(20);\n int newTileNumber= 2;\n if(percent==0 || percent==1 || percent==2) {\n newTileNumber= 4;\n }\n \n int dropX= emptyTilesX.get(randTile);\n int dropY= emptyTilesY.get(randTile);\n board[dropX][dropY]= newTileNumber;\n }", "void reset() {\n setPosition(-(TILE_WIDTH * CYCLE), TOP_Y);\n mySequenceIndex = 0;\n setAnimatedTile(myAnimatedTileIndex, FRAME_SEQUENCE[mySequenceIndex]);\n }", "public void moveDown() {\n locY = locY - 1;\n }", "public void goUp()\r\n\t{\r\n\t\tthis.Y--;\r\n\t}", "void moveUp() {\n\t\tsetY(y-1);\r\n\t\tdx=0;\r\n\t\tdy=-1;\r\n\t}", "@Override\n public void stepUp(Cell currentCell) {\n if(currentCell.getOldNoOfAliveNeighbours()==3)\n {\n currentCell.setState(new Alive());\n }\n }", "public void moveBack() {\r\n\t\tsetY(getY() - 134);\r\n\t\tmyImage = myImage.getScaledInstance(100, 100, 60);\r\n\r\n\t}", "public void laserMoveUp()\r\n\t{\r\n\r\n\t\tif (y > 0)\r\n\t\t\ty -= 20;\r\n\r\n\t\telse\r\n\t\t\tdestroyed = true;\r\n\r\n\t}", "public void compactUp() {\n\t// Iteramos a través del tablero partiendo de la primera fila\n\t// y primera columna. Si esta contiene un 0 y la fila posterior\n\t// de la misma columna es distinta de 0, el valor se intercambia.\n\t// El proceso se repite hasta que todas las posiciones susceptibles\n\t// al cambio se hayan comprobado.\n\tfor (int i = 0; i < board.length; i++) {\n\t for (int j = 0; j < board.length - 1; j++) {\n\t\tif (board[j][i] == EMPTY && board[j + 1][i] != EMPTY) {\n\t\t board[j][i] = board[j + 1][i];\n\t\t board[j + 1][i] = EMPTY;\n\t\t compactUp();\n\t\t}\n\t }\n\t}\n }", "@Override\n public void swapLayerUp(int index) {\n if (index + 1 == this.layers.size()) {\n throw new RuntimeException(\n \"Can't swap up when already at the top.\");\n }\n\n BoardLayerView hold = this.layers.get(index + 1);\n BoardLayerView move = this.layers.get(index);\n this.layers.set(index + 1, move);\n this.layers.set(index, hold);\n }", "public void addTileOnBeginning(Tile tile);", "public void down(){\n\t\tmoveX=0;\n\t\tmoveY=1;\n\t}", "public void blank() {\r\n\t\trunning = false;// sets the simulation to stopped\r\n\t\tfor (int i = 0; i < TOTAL_TILES; i++)// loops through all tiles\r\n\t\t\tnodes[i] = new Node(new Point(i / WIDTH_TILES * SIZE_TILES, i % HEIGHT_TILES * SIZE_TILES), new ImageIcon(\"empty.png\").getImage(), false, \"empty\");// sets empty tile\r\n\t}", "@Override\n\tpublic boolean moveUp() {\n\t\tboolean rs = super.moveUp();\n\t\tif(rs == true){\n\n\t\t}\n\t\treturn rs;\n\t}", "private boolean moveUP() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\tfor(i = 0 ; i < rows_size; i++) {\r\n\t\t\tfor( j = 0; j < columns_size; j++) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = i; k >= 0 && isEmpty(k-1,j); k--);\r\n\t\t\t\t\t\tif(k == 0) {\r\n\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\tgame[k][j] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(game[i][j].isEqual(game[k-1][j]) && game[k-1][j].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[k-1][j].setValue(game[k-1][j].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[k-1][j].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[k-1][j].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\t\tgame[k][j] = new Cell2048 (game[i][j]);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tflag = true;\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\tFalseFlag();\r\n\t\treturn flag;\r\n\t}", "public void placeTile(Tile t){\n\t\t//System.out.println(t.toString() + \" was placed\");\n\t\toccupied = true;\n\t\tcurrentTile = t;\n\t}", "public void moveUp() {\n if(!move.moveUp()) {\n \t if(physinteractor(getX(),getY()-1)) {\n \t\t move.moveUp();\n \t\t nonphysinteractor(getX(),getY());\n \t\t updatemove();\n \t }\n }else {\n \tupdatemove();\n \tnonphysinteractor(getX(),getY());\n }\n }", "public void empty() {\n\t\tempty.setPosition(sprite.getX(),sprite.getY());\n\t\tsprite = empty;\n\t}", "public void moveDown()\n\t{\n\t\ty = y + STEP_SIZE;\n\t}", "private void shiftTopToBottom(int colNum, int rowNum, FloorTile tile, int rotation) {\n shiftTilesTopToBottom(colNum, rowNum, tile, rotation);\n shiftPlayerPiecesTopToBottom(colNum);\n }", "private void shiftBottomToTop(int colNum, int rowNum, FloorTile tile, int rotation) {\n shiftTilesBottomToTop(colNum, rowNum, tile, rotation);\n shiftPlayerPiecesBottomToTop(colNum);\n }", "public GameGridBuilder up(int distance) {\n return putNewGameTileToMap(distance, () -> rowIndex--);\n }", "@Override\n protected void moveOver(){\n incrementXPos(getWidth()/2);\n if(pointUp){\n incrementYPos(-1*getHeight());\n } else {\n incrementYPos(getHeight());\n }\n incrementCol();\n setPointDirection();\n }", "public void reset()\n {\n playersPiece = -1;\n king = false;\n empty = true;\n setTileColor(-1);\n }", "public void clearGotoFloor();", "public void moveUp() {\n\t\tposY += speed;\n\t}", "private void moveOffScreen(GObject element) {\r\n\t\tif (element != null && (element.getX() > getWidth()|| element.getX() + element.getWidth() < 0)) {\r\n\t\t\tremove(element);\r\n\t\t\telement = null;\r\n\t\t}\r\n\t}", "public void move()\r\n\t{\r\n\t\ty-=8;\r\n\t}", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}", "protected void down() {\n move(positionX, positionY + 1);\n orientation = BattleGrid.RIGHT_ANGLE;\n }", "public void MoveTileSelf(Integer position){\n /**\n * if opponent activated confusion - move to a random tile\n */\n if(confused){\n //random tile for confusion\n Integer tile;\n do{\n Integer tile1 = returnRandom(getNthDigit(position,1)-1,getNthDigit(position,1)+2);\n Integer tile2 = returnRandom(getNthDigit(position,2)-1,getNthDigit(position,2)+2); // between 0 and 2\n tile = Integer.parseInt(tile1.toString() + tile2.toString());\n }while (tile==myTile || tile==opponentTile || getNthDigit(tile,1)<1 || getNthDigit(tile,1)>7 || getNthDigit(tile,2)<1 || getNthDigit(tile,2)>7);\n position = tile;\n showTimedAlertDialog(\"You are confused!\", \"moving at a random direction\", 5);\n confused = false;\n }\n\n /**\n * send message to opponent\n */\n MultiplayerManager.getInstance().SendMessage(position.toString());\n\n if(!is_debug){\n HandleLejos(myTile, position);\n }\n\n ImageView player1 = findImageButton(\"square_\"+position.toString());\n ImageView player1_old = findImageButton(\"square_\"+myTile.toString());\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player1_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n myTile = position;\n myTurn = false;\n turnNumber = turnNumber + 1;\n }", "private Boolean moveUp() {\n\t\t\tboolean loose = true;\n\n\t\t\tint x = startX;\n\t\t\tint y = startY;\n\n\t\t\tNode newNode = new Node(x, y, Util.getBall(1));\n\n\t\t\twhile (y >= 0 && chart[y][x] == null) {\n\t\t\t\tif (y + 1 < chart.length)\n\t\t\t\t\tchart[y + 1][x] = null;\n\n\t\t\t\tchart[y][x] = newNode;\n\n\t\t\t\tcanvas = holder.lockCanvas();\n\t\t\t\tonDraw(canvas);\n\t\t\t\tpostInvalidate();\n\t\t\t\tholder.unlockCanvasAndPost(canvas);\n\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(50);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t\tnewNode.setyPos(--y);\n\n\t\t\t\tloose = false;\n\t\t\t}\n\n\t\t\tif (loose)// No Update\n\t\t\t\treturn false;\n\n\t\t\tconnectNewNode(newNode);\n\t\t\treturn true;\n\t\t}", "public void addTileAtTheEnd(Tile tile);", "@Override\r\n\tpublic boolean move(Tile newLocation){\r\n\t\tif(!newLocation.checkOccupied() && newLocation.attribute != Tile.typeAttributes.get(TileType.WALL_TILE)){\r\n\t\t\tcurrentPosition.pullUnit();\r\n\t\t\tthis.currentPosition = newLocation;\r\n\t\t\tthis.currentPosition.pushUnit(this);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthis.act();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public MoveUpAction() {\n\tsuper(\"▲ Move Row Up\");\n }", "public void clearTiles() {\n \tfor (int x = 0; x < (mAbsoluteTileCount.getX()); x++) {\n for (int y = 0; y < (mAbsoluteTileCount.getY()); y++) {\n setTile(0, x, y);\n }\n }\n }", "public void MoveTileOpponent(Integer position){\n Integer position_inverted = revertTile(position);\n String position_inverted_str = String.valueOf(position_inverted);\n\n ImageView player2 = findImageButton(\"square_\"+position_inverted_str);\n ImageView player2_old = findImageButton(\"square_\"+opponentTile.toString());\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n player2_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n\n opponentTile = position_inverted;\n myTurn = true;\n canPlaceBomb = true;\n turnNumber = turnNumber + 1;\n\n if(ShotsCaller){\n placePowerup(null);\n }\n }", "private void undoPosition() {\r\n String undoingBoard = listOfBoards.pop();\r\n listOfMoves.pop();\r\n for (Square sq : map.keySet()) {\r\n char piece = undoingBoard.charAt(sq.index() + 1);\r\n if (piece == '-') {\r\n map.put(sq, EMPTY);\r\n }\r\n if (piece == 'B') {\r\n map.put(sq, BLACK);\r\n }\r\n if (piece == 'W') {\r\n map.put(sq, WHITE);\r\n }\r\n if (piece == 'K') {\r\n map.put(sq, KING);\r\n }\r\n board[sq.col()][sq.row()] = map.get(sq);\r\n }\r\n _moveCount -= 1;\r\n _turn = _turn.opponent();\r\n _repeated = false;\r\n }", "private void clearButtonUp(Floor floor)\r\n\t{\r\n\t\t\tdirectionButtonPanels[floor.getNumber()][1]=LiftButton.NOT_ACTIVE;\r\n\t}", "public void moveDown() {\n btMoveDown().push();\n }", "public void moveDown() {\n btMoveDown().push();\n }", "exitLockedTile(int row, int col){\r\n this.row = row;\r\n this.col = col;\r\n }", "public void PutTopUp()\n\t{\n\t\tif(!isStateTop)\n\t\t{\n\t\t\tSystem.out.println(\"Putting top up\");\n\t\t\tisStateTop=true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Top is already up\");\n\t\t}\n\t}", "private void moveShipUp()\r\n\t\t{\r\n\t\t\t\tboolean moved = true;\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n\r\n //if firstPlayer move unit up\r\n if(currentPlayer == 1)\r\n {\r\n int currentPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n if(currentPos >= 0 && currentPos < mapWidth)\r\n {\r\n int newPos = mapHeight -1;\r\n int newPos2 = mapHeight * newPos + currentPos;\r\n int mapTemp = mapPieces[0][newPos2];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(newPos2);\r\n }\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos - mapWidth);\r\n }\r\n }//end if\r\n\r\n //if secondPlayer move unit up\r\n if(currentPlayer == 2)\r\n {\r\n int currentPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n if(currentPos >= 0 && currentPos < mapWidth)\r\n {\r\n int newPos = mapHeight -1;\r\n int newPos2 = mapHeight * newPos + currentPos;\r\n int mapTemp = mapPieces[0][newPos2];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(newPos2);\r\n }\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos - mapWidth);\r\n }//end else\r\n }//end if\r\n\r\n //set up new player once unit has moved\r\n playerMoved(currentPlayer,currentUnit,moved);\r\n\r\n //set up new mapPosition if player moved\r\n if(moved == true)\r\n setMapPos();\r\n\t\t}", "@Test\n void RookMoveUp() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 5, 4, 1);\n\n board.getBoard()[5][4] = rook;\n\n board.movePiece(rook, 5, 2);\n\n Assertions.assertEquals(rook, board.getBoard()[5][2]);\n Assertions.assertNull(board.getBoard()[5][4]);\n }", "public void specialMove() {\n\t\tChessSquare initial = getSquare();\n\t\tChessSquare next;\n\t\t\n\t\tif(initial.getNorth() != null){\n\t\t\tnext = initial.getNorth();\n\t\t\t\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getEast() != null)\n\t\t\t\tif((next.getEast().getOccupant() == null) || (!next.getEast().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getWest() != null && next.getWest().getOccupant() == null)\n\t\t\t\tif((next.getWest().getOccupant() == null) || (!next.getWest().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t}\n\t\t\n\t\tif(initial.getSouth() != null){\n\t\t\tnext = initial.getSouth();\n\t\t\t\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getEast() != null)\n\t\t\t\tif((next.getEast().getOccupant() == null) || (!next.getEast().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\tif(next.getWest() != null)\n\t\t\t\tif((next.getWest().getOccupant() == null) || (!next.getWest().getOccupant().getColor().equals(this.getColor())))\n\t\t\t\t\tnext.removeOccupant();\n\t\t\t\n\t\t}\n\t\t\n\t\tnext = initial.getEast();\n\t\tif(next != null)\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\tnext = initial.getWest();\n\t\tif(next != null)\n\t\t\tif((next.getOccupant() == null) || (!next.getOccupant().getColor().equals(this.getColor())))\n\t\t\t\tnext.removeOccupant();\n\t\tsetCountdown(9);\n\t}", "public void moveDown() {\n\t\t\n\t}", "public void undoMove(Move move) {\n b[move.from.row][move.from.column] = true;\r\n\r\n // Set 'to' space to free\r\n b[move.to.row][move.to.column] = false;\r\n\r\n // Set 'step' space to occupied\r\n b[(move.from.row + move.to.row)/2][(move.from.column + move.to.column)/2] = true;\r\n\r\n // Increment number of pegs left on the board\r\n pegsLeft++;\r\n }", "public void downPressed()\r\n {\r\n worldPanel.newMapPos(0,zoom);\r\n miniMap.newMapPos(0,1);\r\n }", "public void resetMove() {\n pointer = 0;\n }", "private void moveUnitUp()\r\n {\r\n boolean moved = true;\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n\r\n //if firstPlayer move unit up\r\n if(currentPlayer == 1)\r\n {\r\n int currentPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n if(currentPos >= 0 && currentPos < mapWidth)\r\n {\r\n int newPos = mapHeight -1;\r\n int newPos2 = mapHeight * newPos + currentPos;\r\n int mapTemp = mapPieces[0][newPos2];\r\n if(mapTemp == 0 || mapTemp == 14)//if they try to move on water\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(newPos2);\r\n }\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth];\r\n if(mapTemp == 0 || mapTemp == 14)//if they try to move on water\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos - mapWidth);\r\n }\r\n }//end if\r\n\r\n //if secondPlayer move unit up\r\n if(currentPlayer == 2)\r\n {\r\n int currentPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n if(currentPos >= 0 && currentPos < mapWidth)\r\n {\r\n int newPos = mapHeight -1;\r\n int newPos2 = mapHeight * newPos + currentPos;\r\n int mapTemp = mapPieces[0][newPos2];\r\n if(mapTemp == 0 || mapTemp == 14)//if they try to move on water\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(newPos2);\r\n }\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth];\r\n if(mapTemp == 0 || mapTemp == 14)//if they try to move on water\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos - mapWidth);\r\n }//end else\r\n }//end if\r\n\r\n //set up new player once unit has moved\r\n playerMoved(currentPlayer,currentUnit,moved);\r\n\r\n //set up new mapPosition if player moved\r\n if(moved == true)\r\n setMapPos();\r\n }", "private void cleanUpTile(ArrayList<Move> moves)\n {\n for(Move m1 : moves)\n {\n gb.getTile(m1.getX(),m1.getY()).setStyle(null);\n gb.getTile(m1.getX(),m1.getY()).setOnMouseClicked(null);\n }\n gb.setTurn(gb.getTurn() + 1);\n }", "private void shiftUp() {\n int index = this.size;\n\n while (hasParent(index) && (parent(index).compareTo(heap[index]) > 0)) {\n swap(index, parentIndex(index));\n index = parentIndex(index);\n }\n }", "public void shuffleTiles() {\n\t\tdo {\n\t\t\tCollections.shuffle(tiles);\n\n\t\t\t// Place the blank tile at the end\n\t\t\ttiles.remove(theBlankTile);\n\t\t\ttiles.add(theBlankTile);\n\n\t\t\tfor (short row = 0; row < gridSize; row++) {\n\t\t\t\tfor (short column = 0; column < gridSize; column++) {\n\t\t\t\t\ttileViews.get(row * gridSize + column).setCurrentTile(\n\t\t\t\t\t\t\ttiles.get(row * gridSize + column));\n\t\t\t\t}\n\t\t\t}\n\t\t} while (!isSolvable());\n\t\tmoveCount = 0;\n\n\t}", "@Override\n\tpublic void movePlayerUp() {\n\t\tpacman.changeNextDirection(Direction.up);\n //movePacman();\n\t}", "public void moveUp()\n {\n if (yPos == 0)\n {\n movementY = 0;\n movementX = 0;\n }\n\n // Set the movement factor - negative Y because we are moving UP!\n movementY = -0.5;\n movementX = 0;\n }", "public Location up() {\n return new Location(row - 1, column);\n }", "private void shiftDownTiles(boolean isBorder, int shiftAmount){\n List<Tile> listOfTilesToUpdate = new ArrayList<Tile>();\n int floorRowIndex;\n if(isBorder){\n floorRowIndex=this.board.gridHeight-2;\n } else {\n floorRowIndex=this.board.gridHeight-1;\n }\n\n\n //update all existing tiles y coordinates with shifted y coordinates\n //only shift tile above the row that is being removed\n for(int rowIndex=0; rowIndex<this.rowToBeRemovedIndex; rowIndex++){\n for(int colIndex=0; colIndex<this.board.gridWidth; colIndex++){\n if(this.board.getTile(colIndex,rowIndex)!=null){ //tile exist at coordinates\n if(isBorder){\n if(rowIndex<=floorRowIndex){ //Stop at floor wall\n int leftWallIndex=0;\n int rightWallIndex=this.board.gridWidth-1;\n if(colIndex>leftWallIndex && colIndex<rightWallIndex){ //Ignore the the left and right walls\n Tile tile = this.board.getTile(colIndex,rowIndex);\n tile.rowIndex+=shiftAmount;\n tile.setCoordinates(tile.columnIndex,tile.rowIndex);\n listOfTilesToUpdate.add(tile);\n }\n }\n } else {\n Tile tile = this.board.getTile(colIndex,rowIndex);\n tile.rowIndex+=shiftAmount;\n tile.setCoordinates(tile.columnIndex,tile.rowIndex);\n listOfTilesToUpdate.add(tile);\n }\n }\n }\n }\n\n //Clear Board Grid. Set every element in 2D array to null.\n for(int rowIndex=0; rowIndex<this.board.gridHeight; rowIndex++){\n for(int colIndex=0; colIndex<this.board.gridWidth; colIndex++){\n Tile tile = this.board.getTile(colIndex, rowIndex);\n this.board.removeTile(tile);\n }\n }\n\n //add back tetris border\n if(this.includeTetrisBorder) {\n addBorder();\n }\n\n //Insert new tiles\n for(Tile newTile : listOfTilesToUpdate){\n this.board.placeTile(newTile);\n }\n }", "public void moveDown()\n\t{\n\t\ty = Math.min(y + 1, main.HEIGHT-1);\n\t\tsprite.setPosition(x*sprite.getWidth(),y*sprite.getHeight());\n\t}", "public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }", "@Override\n\tpublic void move() {\n\t\tCoordinate currPos = new Coordinate(control.getPosition());\n\t\t\n\t\t// if we have enough packages head to the exit\n\t\tif (control.numParcels() <= control.numParcelsFound()) {\n\t\t\t// if we don't have a path to the exit\n\t\t\tif (control.currentPath == null || !control.isHeadingToFinish) {\t\n\t\t\t\t// find path to exit\n\t\t\t\tArrayList<Coordinate> tempPath = null;\n\t\t\t\t// See if there's a path without needing to go through hazards\n\t\t\t\ttempPath = control.findPath(currPos, control.finish.get(0), control.hazardsMap.keySet());\n\t\t\t\tSet<Coordinate> tempHazards = new HashSet<>(control.hazardsMap.keySet());\n\t\t\t\t// If no path without going through hazards, just go through them\n\t\t\t\tif (tempPath == null || tempPath.size() == 0) {\n\t\t\t\t\tfor (Coordinate coord : control.hazardsMap.keySet()) {\n\t\t\t\t\t\ttempHazards.remove(coord);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If it's a valid map, there should be a path now\n\t\t\t\tcontrol.setPath(control.findPath(currPos, control.finish.get(0), tempHazards));\n\t\n\t\t\t\tcontrol.isHeadingToFinish = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\theadTowardsPackages(currPos);\n\t\t\n\t\texploreUnseenMap(currPos);\n\t\t\n\t\tMapTile currTile = control.getView().get(currPos);\n\t\tboolean isHealth = false;\n\t\tif (currTile.getType() == MapTile.Type.TRAP) {\n\t\t\tTrapTile trap = (TrapTile) currTile;\n\t\t\tif (trap.getTrap().equals(\"health\")) {\n\t\t\t\tisHealth = true;\n\t\t\t}\n\t\t}\n\t\tif (isHealth && (control.getHealth() < HEALTH_TRAP_THRESHOLD)) {\n\t\t\t// do nothing\n\t\t\treturn;\n\t\t} else {\n\t\t\tisHealth = false;\n\t\t\tcontrol.moveTowards(control.dest);\n\t\t}\n\t\t\n\t}" ]
[ "0.7227133", "0.7219437", "0.71684295", "0.7066142", "0.6934298", "0.6907921", "0.6810107", "0.67803794", "0.6754842", "0.6741269", "0.6716086", "0.6716086", "0.67098266", "0.66732603", "0.6658578", "0.6638022", "0.6622929", "0.65339637", "0.65177894", "0.6457518", "0.6443455", "0.64164364", "0.6389582", "0.638171", "0.6380115", "0.63798296", "0.63775015", "0.63775015", "0.6371344", "0.6362307", "0.6358399", "0.62843895", "0.6273469", "0.6270965", "0.6258533", "0.62536454", "0.6244066", "0.6217703", "0.6205942", "0.6201696", "0.61846054", "0.6126662", "0.61231977", "0.61125946", "0.6101841", "0.60934234", "0.6090415", "0.6086896", "0.6083838", "0.60813165", "0.60805976", "0.60635483", "0.6062536", "0.6029062", "0.6027135", "0.6023929", "0.60163933", "0.6007822", "0.5996388", "0.5995773", "0.59918886", "0.59885895", "0.59885085", "0.5977949", "0.5974173", "0.5973607", "0.5958136", "0.59527695", "0.5949998", "0.5949168", "0.59478223", "0.59476274", "0.5946214", "0.59461933", "0.59437895", "0.59409046", "0.59383446", "0.5927207", "0.5926896", "0.5921654", "0.5921654", "0.5910306", "0.59092945", "0.59084177", "0.5895381", "0.58906406", "0.58890086", "0.58802456", "0.5875709", "0.5874004", "0.5871997", "0.58685225", "0.5866543", "0.58515525", "0.5834697", "0.583251", "0.5830206", "0.5829312", "0.5828294", "0.5817168", "0.58156693" ]
0.0
-1
Moves the blank tile down
public static void goDown(Node parent) { int[][] tempArray = new int[3][3]; int blankPositionRow = parent.getblankPositionRow(); int blankPositionCol = parent.getblankPositionCol(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { tempArray[i][j] = parent.stateSpace[i][j]; } } if (blankPositionRow != 2) { int temp = tempArray[blankPositionRow + 1][blankPositionCol]; tempArray[blankPositionRow + 1][blankPositionCol] = 0; tempArray[blankPositionRow][blankPositionCol] = temp; Node node = new Node(tempArray, finalState, parent); choiceOfNodes.add(node); nodesGenerated++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public synchronized void moveDown(){\n if (!this.isAtBottom()){\n for (int j = 1; j < 25; j++){\n for (int i = 1; i < 13; i++){\n if (this.movable[i][j]){\n this.map[i][j - 1] = this.map[i][j];\n this.movable[i][j - 1] = this.movable[i][j];\n this.colors[i][j - 1] = this.colors[i][j];\n\n this.map[i][j] = false;\n this.movable[i][j] = false;\n this.colors[i][j] = null;\n\n }\n }\n }\n }\n this.piecePositionY--;\n repaint();\n }", "public void moveTileBack()\n {\n if(!(activeTile-1 < 0) && activeTile > 0)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile-1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile-1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile-1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile-1].getEndColor());\n \n tiles[activeTile-1].setTileLevel(tiles[activeTile-1].getTileLevel()+1);\n tiles[activeTile] = tiles[activeTile-1];\n previews[activeTile] = previews[activeTile-1];\n previewGradients[activeTile] = previewGradients[activeTile-1];\n previewHover[activeTile] = previewHover[activeTile-1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()-1);\n tiles[activeTile-1] = tmpTile;\n tiles[activeTile-1].setStartColor(tiles[activeTile-1].getStartColor());\n previews[activeTile-1] = tmpPreview;\n previewGradients[activeTile-1] = tmpPreviewGradients;\n previewHover[activeTile-1] = tmpPreviewHover;\n \n activeTile -= 1;\n createPreviewGradients();\n }\n }", "private void swapTileWithBlank(TileView tv) {\n\t\tTile tile = tv.getCurrentTile();\n\n\t\tTileView theBlankTileView = tileViews\n\t\t\t\t.get(computeLocationValue(theBlankTile.getCurrentLocation()));\n\n//\t\tLog.v(\"log_tag\", \"Tile Row= \" + tile.getCurrentLocation().getRow()\n//\t\t\t\t+ \" Tile Column= \" + tile.getCurrentLocation().getColumn());\n//\t\tLog.v(\"log_tag\", \"theBlankTile Row= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getRow() + \" theBlankTile Column= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getColumn());\n\n\t\tif (tile.getCurrentLocation().isAdjacent(\n\t\t\t\ttheBlankTile.getCurrentLocation())) {\n\n\t\t\t// Animate tile movement\n\t\t\tif (tile.getCurrentLocation().getColumn() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// LEFT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.left_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getColumn() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// RIGHT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.right_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// UP\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.up_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// DOWN\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.down_animation));\n\t\t\t}\n\t\t\ttheBlankTileView.setCurrentTile(tile);\n\t\t\ttv.setCurrentTile(theBlankTile);\n\n\t\t\tmoveCount++;\n\n\t\t\tmoveTextView.setText(\"Moves : \" + moveCount);\n\t\t}\n\n\t\tif (isCorrect()) {\n\t\t\t((Activity) context).showDialog(PuzzleActivity.DIALOG_COMPLETED_ID);\n\t\t}\n\n\t}", "public void moveDown()\n\t{\n\t\tthis.grid.moveDown();\n\t}", "public void moveDown() {\n\t\tstate.updateFloor(state.getFloor()-1);\n\t}", "public void moveDown()\n\t{\n\t\trow--;\n\t}", "public void adjustDown() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].y = tiles[x][y].y + 4;\n backGroundTiles[x][y].y = backGroundTiles[x][y].y + 4;\n grassTiles[x][y].y = grassTiles[x][y].y + 4;\n }\n }", "public void moveDown() {\n locY = locY - 1;\n }", "public void down(){\n\t\tmoveX=0;\n\t\tmoveY=1;\n\t}", "public void moveUp() {\n\n if (this.row - 1 < 16) {\n return;\n }\n this.row -= 1;\n\n playerImage.translate(0, -Cell.CELLSIZE);\n playerImage.draw();\n }", "public void moveDown()\n\t{\n\t\ty = y + STEP_SIZE;\n\t}", "public void moveUp()\n\t{\n\t\tthis.grid.moveUp();\n\t}", "protected void down() {\n move(positionX, positionY + 1);\n orientation = BattleGrid.RIGHT_ANGLE;\n }", "public void moveDown()\n\t{\n\t\ty = Math.min(y + 1, main.HEIGHT-1);\n\t\tsprite.setPosition(x*sprite.getWidth(),y*sprite.getHeight());\n\t}", "public void moveDown() {\n\t\t\n\t}", "public void moveDown()\n {\n if (!this.search_zone.isDownBorder(this.y_position))\n {\n this.y_position = (this.y_position + 1);\n }\n }", "public void adjustUp() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].y = tiles[x][y].y - 4;\n backGroundTiles[x][y].y = backGroundTiles[x][y].y - 4;\n grassTiles[x][y].y = grassTiles[x][y].y - 4;\n }\n }", "public void moveDown() {\n btMoveDown().push();\n }", "public void moveDown() {\n btMoveDown().push();\n }", "public void moveDown() {\n\t\tsetPosY(getPosY() + steps);\n\t}", "public void reset( )\n\t{\n\t\tint count = 1;\n\t\tthis.setMoves( 0 );\n\t\tfor( int i = 0; i < this.getSize(); i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < this.getWidth(); j++ )\n\t\t\t{\n\t\t\t\tthis.setTile( count++, i, j );\n\t\t\t\tif( i == getSize( ) - 1 && j == getWidth( ) - 1 ) {\n\t\t\t\t\tthis.setTile( -1, i, j );\n\t\t\t\t\tlocationX = i;\n\t\t\t\t\tlocationY = j;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void up(){\n\t\tmoveX=0;\n\t\tmoveY=-1;\n\t}", "public void moveUp()\n\t{\n\t\ty = y - STEP_SIZE;\n\t}", "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "public void moveUp() {\n\t\tstate.updateFloor(state.getFloor()+1);\n\t}", "public void downPressed()\r\n {\r\n worldPanel.newMapPos(0,zoom);\r\n miniMap.newMapPos(0,1);\r\n }", "public void moveUp()\n {\n if (!this.search_zone.isTopBorder(this.y_position))\n {\n this.y_position = (this.y_position - 1);\n }\n }", "public void moveUp() {\r\n\t\tmy_cursor_location.y--;\r\n\t}", "protected void up() {\n move(positionX, positionY - 1);\n orientation = BattleGrid.RIGHT_ANGLE * 3;\n }", "void moveDown();", "void moveDown();", "private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }", "public void moveBack() {\r\n\t\tsetY(getY() - 134);\r\n\t\tmyImage = myImage.getScaledInstance(100, 100, 60);\r\n\r\n\t}", "public void moveUp()\n\t{\n\t\trow++;\n\t}", "public void moveUp() {\n locY = locY + 1;\n }", "public void moveTileForward()\n {\n if(!(activeTile+1 > tiles.length-1) && tiles[activeTile+1] != null)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile+1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile+1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile+1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile+1].getEndColor());\n \n tiles[activeTile+1].setTileLevel(tiles[activeTile+1].getTileLevel()-1);\n tiles[activeTile] = tiles[activeTile+1];\n previews[activeTile] = previews[activeTile+1];\n previewGradients[activeTile] = previewGradients[activeTile+1];\n previewHover[activeTile] = previewHover[activeTile+1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()+1);\n tiles[activeTile+1] = tmpTile;\n tiles[activeTile+1].setStartColor(tiles[activeTile+1].getStartColor());\n previews[activeTile+1] = tmpPreview;\n previewGradients[activeTile+1] = tmpPreviewGradients;\n previewHover[activeTile+1] = tmpPreviewHover;\n \n activeTile += 1;\n createPreviewGradients();\n }\n }", "public void move()\r\n\t{\r\n\t\ty-=8;\r\n\t}", "private void moveBack(){\r\n\t\tturnAround();\r\n\t\tmove();\r\n\t}", "public void dropNewTile() {\n ArrayList<Integer> emptyTilesX= new ArrayList<Integer>();\n ArrayList<Integer> emptyTilesY= new ArrayList<Integer>();\n\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n emptyTilesX.add(x);\n emptyTilesY.add(y);\n }\n }\n }\n\n int randTile= rand.nextInt(emptyTilesX.size());\n int percent= rand.nextInt(20);\n int newTileNumber= 2;\n if(percent==0 || percent==1 || percent==2) {\n newTileNumber= 4;\n }\n \n int dropX= emptyTilesX.get(randTile);\n int dropY= emptyTilesY.get(randTile);\n board[dropX][dropY]= newTileNumber;\n }", "private boolean slideDown()\n {\n if (blankRow == 0) {\n return false;\n }\n board[blankRow][blankCol] = board[blankRow - 1][blankCol];\n board[blankRow - 1][blankCol] = 0;\n blankRow -= 1;\n return true;\n }", "void move(Tile t);", "public void compactDown() {\n\t// Iteramos a través del tablero partiendo de la primera fila\n\t// y última columna. Si esta contiene un 0 y la fila anterior\n\t// de la misma columna es distinta de 0, el valor se intercambia.\n\t// El proceso se repite hasta que todas las posiciones susceptibles\n\t// al cambio se hayan comprobado.\n\tfor (int i = 0; i < board.length; i++) {\n\t for (int j = board.length - 1; j > 0; j--) {\n\t\tif (board[j][i] == EMPTY && board[j - 1][i] != EMPTY) {\n\t\t board[j][i] = board[j - 1][i];\n\t\t board[j - 1][i] = EMPTY;\n\t\t compactDown();\n\t\t}\n\t }\n\t}\n }", "public GameGridBuilder down(int distance) {\n return putNewGameTileToMap(distance, () -> rowIndex++);\n }", "private boolean slideUp()\n {\n if (blankRow == SIZE - 1) {\n return false;\n }\n board[blankRow][blankCol] = board[blankRow + 1][blankCol];\n board[blankRow + 1][blankCol] = 0;\n blankRow += 1;\n return true;\n }", "public void moveDown() {\n this.accelerateYD();\n this.moveY(this.getySpeed());\n this.setPicX(0);\n this.setPicY(0);\n this.setLoopCells(true);\n }", "private void moveOffScreen(GObject element) {\r\n\t\tif (element != null && (element.getX() > getWidth()|| element.getX() + element.getWidth() < 0)) {\r\n\t\t\tremove(element);\r\n\t\t\telement = null;\r\n\t\t}\r\n\t}", "public void moveUp() {\n btMoveUp().push();\n }", "public void moveUp() {\n btMoveUp().push();\n }", "void reset() {\n setPosition(-(TILE_WIDTH * CYCLE), TOP_Y);\n mySequenceIndex = 0;\n setAnimatedTile(myAnimatedTileIndex, FRAME_SEQUENCE[mySequenceIndex]);\n }", "private void playerMoveDown()\n {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(false);\n this.setCurrentY(this.getCurrentY() + 1);\n if (this.getCurrentY() < 11) {\n if (!nextIsWall()) {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n } else {\n this.setCurrentY(this.getCurrentY() - 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n }\n } else {\n this.setCurrentY(this.getCurrentY() - 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n }\n }", "public void goUp()\r\n\t{\r\n\t\tthis.Y--;\r\n\t}", "public void moveUp() {\n this.accelerateYU();\n this.moveY(this.getySpeed());\n this.setPicX(0);\n this.setPicY(211);\n this.setLoopCells(true);\n }", "public void resetPlayerPosition() {\n\t\tthis.tilePositionX = this.STARTING_X;\n\t\tthis.tilePositionY = this.STARTING_Y;\n\t}", "public Location down() {\n return new Location(row + 1, column);\n }", "private void goDownWall() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.move(2);\n\t\tthis.turnLeft();\n\t}", "public void moveUp() {\n\t\tsetPosY(getPosY() - steps);\n\t}", "public void moveTileDown(float delta) {\n if (y > destinationY + COMBAT_MOVEMENT_SPEED * delta) speedY = -COMBAT_MOVEMENT_SPEED;\n else {\n speedY = (destinationY - y) / delta;\n isMoving = false;\n isMovingDown = false;\n }\n direction = Direction.DOWN;\n }", "@Override\n public void swapLayerDown(int index) {\n if (index - 1 < 0) {\n throw new RuntimeException(\n \"Can't swap down when already at the bottom.\");\n }\n\n BoardLayerView hold = this.layers.get(index - 1);\n BoardLayerView move = this.layers.get(index);\n this.layers.set(index - 1, move);\n this.layers.set(index, hold);\n }", "public void clearGotoFloor();", "private void bulletMoveOffScreen() {\r\n\t\tif(bullet != null && (bullet.getX() > getWidth() || bullet.getX() < 0)){\r\n\t\t\tremove(bullet);\r\n\t\t\tbullet = null;\r\n\t\t}\r\n\t}", "public void blank() {\r\n\t\trunning = false;// sets the simulation to stopped\r\n\t\tfor (int i = 0; i < TOTAL_TILES; i++)// loops through all tiles\r\n\t\t\tnodes[i] = new Node(new Point(i / WIDTH_TILES * SIZE_TILES, i % HEIGHT_TILES * SIZE_TILES), new ImageIcon(\"empty.png\").getImage(), false, \"empty\");// sets empty tile\r\n\t}", "private void goUpWall() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.turnLeft();\n\t\tthis.move(2);\n\t\tthis.turnRight();\n\t}", "public void undoLastMove()\n {\n if (inProgress() && stackTiles.size() > 1)\n {\n // TAKE THE TOP 2 TILES\n MahjongSolitaireTile topTile = stackTiles.remove(stackTiles.size()-1);\n MahjongSolitaireTile nextToTopTile = stackTiles.remove(stackTiles.size() - 1);\n \n // SET THEIR DESTINATIONS\n float boundaryLeft = miniGame.getBoundaryLeft();\n float boundaryTop = miniGame.getBoundaryTop();\n \n // FIRST TILE 1\n int col = topTile.getGridColumn();\n int row = topTile.getGridRow();\n int z = tileGrid[col][row].size();\n float targetX = this.calculateTileXInGrid(col, z);\n float targetY = this.calculateTileYInGrid(row, z);\n topTile.setTarget(targetX, targetY);\n movingTiles.add(topTile);\n topTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(topTile);\n \n // AND THEN TILE 2\n col = nextToTopTile.getGridColumn();\n row = nextToTopTile.getGridRow();\n z = tileGrid[col][row].size();\n targetX = this.calculateTileXInGrid(col, z);\n targetY = this.calculateTileYInGrid(row, z);\n nextToTopTile.setTarget(targetX, targetY);\n movingTiles.add(nextToTopTile);\n nextToTopTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(nextToTopTile);\n \n // PLAY THE AUDIO CUE\n miniGame.getAudio().play(MahjongSolitairePropertyType.UNDO_AUDIO_CUE.toString(), false); \n }\n }", "public void moveDown() {\n Coordinate downCoord = new Coordinate(getX(), getY() + 1);\n handleMove(downCoord, InteractionHandler.DOWN);\n }", "public void empty() {\n\t\tempty.setPosition(sprite.getX(),sprite.getY());\n\t\tsprite = empty;\n\t}", "private void oneLineDown() {\n if (!tryMove(curPiece, curX, curY - 1)) {\n \n pieceDropped();\n }\n }", "public void move_down() {\n\t\tlocation.setY(location.getY()+y_velocity);\n\t\timage.setTranslateY(location.getY());\n\t}", "exitLockedTile(int row, int col){\r\n this.row = row;\r\n this.col = col;\r\n }", "public void laserMoveUp()\r\n\t{\r\n\r\n\t\tif (y > 0)\r\n\t\t\ty -= 20;\r\n\r\n\t\telse\r\n\t\t\tdestroyed = true;\r\n\r\n\t}", "private void dropDown() {\n int newY = curY;\n\n while (newY > 0) {\n\n if (!tryMove(curPiece, curX, newY - 1)) {\n \n break;\n }\n \n --newY;\n }\n\n pieceDropped();\n }", "private void shiftDownTiles(boolean isBorder, int shiftAmount){\n List<Tile> listOfTilesToUpdate = new ArrayList<Tile>();\n int floorRowIndex;\n if(isBorder){\n floorRowIndex=this.board.gridHeight-2;\n } else {\n floorRowIndex=this.board.gridHeight-1;\n }\n\n\n //update all existing tiles y coordinates with shifted y coordinates\n //only shift tile above the row that is being removed\n for(int rowIndex=0; rowIndex<this.rowToBeRemovedIndex; rowIndex++){\n for(int colIndex=0; colIndex<this.board.gridWidth; colIndex++){\n if(this.board.getTile(colIndex,rowIndex)!=null){ //tile exist at coordinates\n if(isBorder){\n if(rowIndex<=floorRowIndex){ //Stop at floor wall\n int leftWallIndex=0;\n int rightWallIndex=this.board.gridWidth-1;\n if(colIndex>leftWallIndex && colIndex<rightWallIndex){ //Ignore the the left and right walls\n Tile tile = this.board.getTile(colIndex,rowIndex);\n tile.rowIndex+=shiftAmount;\n tile.setCoordinates(tile.columnIndex,tile.rowIndex);\n listOfTilesToUpdate.add(tile);\n }\n }\n } else {\n Tile tile = this.board.getTile(colIndex,rowIndex);\n tile.rowIndex+=shiftAmount;\n tile.setCoordinates(tile.columnIndex,tile.rowIndex);\n listOfTilesToUpdate.add(tile);\n }\n }\n }\n }\n\n //Clear Board Grid. Set every element in 2D array to null.\n for(int rowIndex=0; rowIndex<this.board.gridHeight; rowIndex++){\n for(int colIndex=0; colIndex<this.board.gridWidth; colIndex++){\n Tile tile = this.board.getTile(colIndex, rowIndex);\n this.board.removeTile(tile);\n }\n }\n\n //add back tetris border\n if(this.includeTetrisBorder) {\n addBorder();\n }\n\n //Insert new tiles\n for(Tile newTile : listOfTilesToUpdate){\n this.board.placeTile(newTile);\n }\n }", "public void addTileAtTheEnd(Tile tile);", "public static void moveBackFor(double distance) {\n leftMotor.rotate(-convertDistance(distance * TILE_SIZE), true);\n rightMotor.rotate(-convertDistance(distance * TILE_SIZE), false);\n }", "@Test\n void RookMoveDown() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 4, 4, 1);\n\n board.getBoard()[4][4] = rook;\n\n board.movePiece(rook, 4, 7);\n\n Assertions.assertEquals(rook, board.getBoard()[4][7]);\n Assertions.assertNull(board.getBoard()[4][4]);\n }", "private void playerMoveUp()\n {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(false);\n this.setCurrentY(this.getCurrentY() - 1);\n if (this.getCurrentY() > -1) {\n if (!nextIsWall()) {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n } else {\n this.setCurrentY(this.getCurrentY() + 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n }\n } else// hit edge redo setlocation\n {\n this.setCurrentY(this.getCurrentY() + 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n } \n }", "private void moveUp(GameWorld world) {\n world.world[world.avatarPosition.x][world.avatarPosition.y] = Tileset.FLOOR;\n world.world[world.avatarPosition.x][world.avatarPosition.y + 1] = Tileset.AVATAR;\n world.avatarPosition.y = world.avatarPosition.y + 1;\n }", "private void shiftTopToBottom(int colNum, int rowNum, FloorTile tile, int rotation) {\n shiftTilesTopToBottom(colNum, rowNum, tile, rotation);\n shiftPlayerPiecesTopToBottom(colNum);\n }", "void moveUp();", "void moveUp();", "public void upPressed()\r\n {\r\n worldPanel.newMapPos(0,-zoom);\r\n miniMap.newMapPos(0,-1);\r\n }", "public void moveLeft()\n\t{\n\t\tcol--;\n\t}", "public void move() {\n if (this.nextMove.equals(\"a\")) { // move down\n this.row = row + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"b\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"b\")) { // move right\n this.col = col + 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"c\";\n progress = 0;\n }\n } else if (this.nextMove.equals(\"c\")) { // move up\n this.row = row - 1;\n progress += 1;\n if (progress == steps) {\n nextMove = \"a\";\n progress = 0;\n }\n }\n }", "public boolean putDown(Box b) {\n //System.out.println(\"Nem tudod letenni a dobozt a MapElementre.\");\n return false;\n }", "public void move() {\n\t\tGrid<Actor> gr = getGrid();\n\t\tif (gr == null) {\n\t\t\treturn;\n\t\t}\n\t\tLocation loc = getLocation();\n\t\tLocation next = loc.getAdjacentLocation(getDirection());\n\t\t\n\t\tLocation next2 = next.getAdjacentLocation(getDirection());\n\t\tif (gr.isValid(next2)) {\n\t\t\tmoveTo(next2);\n\t\t} else {\n\t\t\tremoveSelfFromGrid();\n\t\t}\n\t}", "public void reset()\n {\n playersPiece = -1;\n king = false;\n empty = true;\n setTileColor(-1);\n }", "private void shiftBottomToTop(int colNum, int rowNum, FloorTile tile, int rotation) {\n shiftTilesBottomToTop(colNum, rowNum, tile, rotation);\n shiftPlayerPiecesBottomToTop(colNum);\n }", "void moveDown() {\n\t\tsetY(y+1);\r\n\t\tdx=0;\r\n\t\tdy=1;\r\n\t}", "void moveUp() {\n\t\tsetY(y-1);\r\n\t\tdx=0;\r\n\t\tdy=-1;\r\n\t}", "public void stop() {\n this.setCurrentCell(0);\n this.setPicX(0);\n slowDownX();\n slowDownY();\n setMoving(false);\n if (moveDown) {\n this.setPicY(0);\n } else if (moveUp) {\n this.setPicY(211);\n } else if (moveLeft) {\n this.setPicY(141);\n } else if (moveRight) {\n this.setPicY(74);\n }\n }", "public void onTileExit(Tile tile) {}", "public void moveDown() {\n\t\tposY -= speed;\n\t}", "@Override\n protected void moveOver(){\n incrementXPos(getWidth()/2);\n if(pointUp){\n incrementYPos(-1*getHeight());\n } else {\n incrementYPos(getHeight());\n }\n incrementCol();\n setPointDirection();\n }", "private boolean moveDOWN() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\t\r\n\t\tfor(i = (rows_size-1) ; i >= 0 ; i--) {\r\n\t\t\tfor( j = (columns_size -1); j >= 0; j--) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = i; k < rows_size && isEmpty(k+1,j); k++);\r\n\t\t\t\t\tif(k == (rows_size-1)) {\r\n\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\tgame[k][j] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(game[i][j].isEqual(game[k+1][j]) && game[k+1][j].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[k+1][j].setValue(game[k+1][j].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[k+1][j].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[k+1][j].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t\tif(k != i) {\r\n\t\t\t\t\t\t\t\t\tgame[k][j] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\t\tflag = true;\r\n\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}\r\n\tFalseFlag();\r\n\treturn flag;\r\n\t}", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "public GameGridBuilder up(int distance) {\n return putNewGameTileToMap(distance, () -> rowIndex--);\n }", "public void moveRight() {\n\t\tif (x1 < 24 && x2 < 24 && x3 < 24 && x4 < 24) {\n\t\t\tclearPiece();\n\t\t\tx1 += 1;\n\t\t\tx2 += 1;\n\t\t\tx3 += 1;\n\t\t\tx4 += 1;\n\t\t\tsetPiece();\n\t\t\trepaint();\n\t\t}\n\t}", "private void clearButtonDown(Floor floor)\r\n\t{\r\n\t\t\tdirectionButtonPanels[floor.getNumber()][0]=LiftButton.NOT_ACTIVE;\r\n\t}", "@Override\r\n\tpublic boolean move(Tile newLocation){\r\n\t\tif(!newLocation.checkOccupied() && newLocation.attribute != Tile.typeAttributes.get(TileType.WALL_TILE)){\r\n\t\t\tcurrentPosition.pullUnit();\r\n\t\t\tthis.currentPosition = newLocation;\r\n\t\t\tthis.currentPosition.pushUnit(this);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthis.act();\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Override\n\tpublic void movment() {\n\t\tif(ghost.shot && fired) {\n\t\t\tif(direction == RIGHT)\n\t\t\t\tmove(RIGHT);\n\t\t\telse if(direction == LEFT)\n\t\t\t\tmove(LEFT);\n\t\t\telse if(direction == UP)\n\t\t\t\tmove(UP);\n\t\t\telse if(direction == DOWN)\n\t\t\t\tmove(DOWN);\n\t\t}\n\t}", "@Override\r\n\tpublic String moveDown() {\n\t\tif((0<=x && x<=50) && (0<y && y<=10) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\ty--;\r\n\t\t}\r\n\t\telse if((0<=x && x<=50) && (40<y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\ty--;\r\n\t\t}\r\n\t\telse if((0<=x && x<=50) && (0<y && y<=50) && (0<=z && z<=10))\r\n\t\t{\r\n\t\t\ty--;\r\n\t\t}\r\n\t\telse if((0<=x && x<=10) && (0<y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\ty--;\r\n\t\t}\r\n\t\telse if((0<=x && x<=50) && (0<y && y<=50) && (40<=z && z<=50))\r\n\t\t{\r\n\t\t\ty--;\r\n\t\t}\r\n\t\telse if((40<=x && x<=50) && (0<y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\ty--;\r\n\t\t}\r\n\t\treturn getFormatedCoordinates();\r\n\t}", "public void addTileOnBeginning(Tile tile);" ]
[ "0.7342891", "0.7136297", "0.71355927", "0.7106235", "0.687667", "0.6870339", "0.6815365", "0.67846596", "0.6757518", "0.67278296", "0.6695065", "0.66535735", "0.66321987", "0.6593336", "0.6577684", "0.6537903", "0.6523311", "0.64813", "0.64813", "0.64716876", "0.64649653", "0.64514494", "0.6405417", "0.6400867", "0.6397773", "0.6375486", "0.6344434", "0.6343942", "0.63240254", "0.6293702", "0.6293702", "0.6289484", "0.62828434", "0.62823856", "0.6281613", "0.6281088", "0.62712866", "0.62680715", "0.62472826", "0.62220037", "0.61967903", "0.61931497", "0.6162984", "0.6157361", "0.61539346", "0.61427945", "0.613775", "0.613775", "0.6132218", "0.61102635", "0.6106144", "0.60891634", "0.606378", "0.6060987", "0.6049456", "0.6044838", "0.60302776", "0.6020859", "0.60174793", "0.6010835", "0.60095537", "0.59790885", "0.59769315", "0.5976552", "0.5960844", "0.5956916", "0.59546924", "0.5950437", "0.5946579", "0.59423685", "0.59322", "0.5913104", "0.58953416", "0.58691853", "0.58689505", "0.58675504", "0.586744", "0.58665735", "0.58665735", "0.5854416", "0.5854377", "0.58506125", "0.5847667", "0.58387285", "0.5824492", "0.5822248", "0.58212054", "0.5818509", "0.58177304", "0.5816318", "0.5808766", "0.58043545", "0.579441", "0.5786977", "0.5767108", "0.5761511", "0.576032", "0.57524055", "0.57503915", "0.5748718", "0.5748657" ]
0.0
-1
gos the blank tile left
public static void goLeft(Node parent) { int[][] tempArray = new int[3][3]; int blankPositionRow = parent.getblankPositionRow(); int blankPositionCol = parent.getblankPositionCol(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { tempArray[i][j] = parent.stateSpace[i][j]; } } if (blankPositionCol != 0) { int temp = tempArray[blankPositionRow][blankPositionCol - 1]; tempArray[blankPositionRow][blankPositionCol - 1] = 0; tempArray[blankPositionRow][blankPositionCol] = temp; Node node = new Node(tempArray, finalState, parent); choiceOfNodes.add(node); nodesGenerated++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void blank() {\r\n\t\trunning = false;// sets the simulation to stopped\r\n\t\tfor (int i = 0; i < TOTAL_TILES; i++)// loops through all tiles\r\n\t\t\tnodes[i] = new Node(new Point(i / WIDTH_TILES * SIZE_TILES, i % HEIGHT_TILES * SIZE_TILES), new ImageIcon(\"empty.png\").getImage(), false, \"empty\");// sets empty tile\r\n\t}", "private void swapTileWithBlank(TileView tv) {\n\t\tTile tile = tv.getCurrentTile();\n\n\t\tTileView theBlankTileView = tileViews\n\t\t\t\t.get(computeLocationValue(theBlankTile.getCurrentLocation()));\n\n//\t\tLog.v(\"log_tag\", \"Tile Row= \" + tile.getCurrentLocation().getRow()\n//\t\t\t\t+ \" Tile Column= \" + tile.getCurrentLocation().getColumn());\n//\t\tLog.v(\"log_tag\", \"theBlankTile Row= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getRow() + \" theBlankTile Column= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getColumn());\n\n\t\tif (tile.getCurrentLocation().isAdjacent(\n\t\t\t\ttheBlankTile.getCurrentLocation())) {\n\n\t\t\t// Animate tile movement\n\t\t\tif (tile.getCurrentLocation().getColumn() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// LEFT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.left_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getColumn() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// RIGHT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.right_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// UP\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.up_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// DOWN\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.down_animation));\n\t\t\t}\n\t\t\ttheBlankTileView.setCurrentTile(tile);\n\t\t\ttv.setCurrentTile(theBlankTile);\n\n\t\t\tmoveCount++;\n\n\t\t\tmoveTextView.setText(\"Moves : \" + moveCount);\n\t\t}\n\n\t\tif (isCorrect()) {\n\t\t\t((Activity) context).showDialog(PuzzleActivity.DIALOG_COMPLETED_ID);\n\t\t}\n\n\t}", "public void checkBlankSpace() {\n\t\tif (xOffset < 0) {\n\t\t\txOffset = 0;\n\t\t} else if (xOffset > handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth()) {\n\t\t\txOffset = handler.getWorld().getWidth() * Tile.TILEWIDTH - handler.getWidth();\n\t\t}\n\t\t\n\t\tif (yOffset < 0) {\n\t\t\tyOffset = 0;\n\t\t} else if (yOffset > handler.getWorld().getHeight() * Tile.TILEHEIGHT - handler.getHeight()) {\n\t\t\tyOffset = handler.getWorld().getHeight() * Tile.TILEWIDTH - handler.getHeight();\n\t\t}\n\t}", "public void reset( )\n\t{\n\t\tint count = 1;\n\t\tthis.setMoves( 0 );\n\t\tfor( int i = 0; i < this.getSize(); i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < this.getWidth(); j++ )\n\t\t\t{\n\t\t\t\tthis.setTile( count++, i, j );\n\t\t\t\tif( i == getSize( ) - 1 && j == getWidth( ) - 1 ) {\n\t\t\t\t\tthis.setTile( -1, i, j );\n\t\t\t\t\tlocationX = i;\n\t\t\t\t\tlocationY = j;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private void wrap() {\n if (myCurrentLeftX % (Grass.TILE_WIDTH * Grass.CYCLE) == 0) {\n if (myLeft) {\n myCowboy.move(Grass.TILE_WIDTH * Grass.CYCLE, 0);\n myCurrentLeftX += (Grass.TILE_WIDTH * Grass.CYCLE);\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i]\n .move(Grass.TILE_WIDTH * Grass.CYCLE, 0);\n }\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].move(Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n } else {\n myCowboy.move(-(Grass.TILE_WIDTH * Grass.CYCLE), 0);\n myCurrentLeftX -= (Grass.TILE_WIDTH * Grass.CYCLE);\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i].move(-Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].move(-Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n }\n }\n }", "public void moveTileBack()\n {\n if(!(activeTile-1 < 0) && activeTile > 0)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile-1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile-1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile-1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile-1].getEndColor());\n \n tiles[activeTile-1].setTileLevel(tiles[activeTile-1].getTileLevel()+1);\n tiles[activeTile] = tiles[activeTile-1];\n previews[activeTile] = previews[activeTile-1];\n previewGradients[activeTile] = previewGradients[activeTile-1];\n previewHover[activeTile] = previewHover[activeTile-1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()-1);\n tiles[activeTile-1] = tmpTile;\n tiles[activeTile-1].setStartColor(tiles[activeTile-1].getStartColor());\n previews[activeTile-1] = tmpPreview;\n previewGradients[activeTile-1] = tmpPreviewGradients;\n previewHover[activeTile-1] = tmpPreviewHover;\n \n activeTile -= 1;\n createPreviewGradients();\n }\n }", "public void empty() {\n\t\tempty.setPosition(sprite.getX(),sprite.getY());\n\t\tsprite = empty;\n\t}", "public void reset()\n {\n playersPiece = -1;\n king = false;\n empty = true;\n setTileColor(-1);\n }", "public static void render(Graphics g, Tile tile, Point pxCenterPoint, float value) {\n Point topLeft = new Point(pxCenterPoint.x - (tile.getImage().getWidth() / 2), pxCenterPoint.y - (tile.getImage().getHeight() / 2));\n if (value >= 0) {\n\n\n if (tile.getType() == \"Mountain\") {\n\n g.drawImage(GraphicAssets.col, topLeft.x, topLeft.y + 19 + 21, 60, tile.getImageHeight() / 2, null);\n g.drawImage(GraphicAssets.base, topLeft.x, topLeft.y + 19 + 19 + tile.getImageHeight() / 2, 60, 19, null);\n g.drawImage(tile.getImage(), topLeft.x, topLeft.y, tile.getImage().getWidth(), tile.getImage().getHeight(), null);\n\n } else if (tile.getType() == \"Water\" || tile.getType() == \"Grass\" || tile.getType() == \"Running\") {\n //\n //System.out.println(topLeft.y);\n g.drawImage(GraphicAssets.col, topLeft.x, topLeft.y + 10 + 19, 60, tile.getImageHeight() / 2, null);\n g.drawImage(GraphicAssets.base, topLeft.x, topLeft.y + 10 + 19 + tile.getImageHeight() / 2, 60, 19, null);\n g.drawImage(tile.getImage(), topLeft.x, topLeft.y + 10, tile.getImage().getWidth(), tile.getImage().getHeight(), null);\n } else {\n g.drawImage(GraphicAssets.col, topLeft.x, topLeft.y + 10 + 19, 60, tile.getImageHeight() / 2, null);\n g.drawImage(GraphicAssets.base, topLeft.x, topLeft.y + 10 + 19 + tile.getImageHeight() / 2, 60, 19, null);\n g.drawImage(tile.getImage(), topLeft.x, topLeft.y + 10, tile.getImage().getWidth(), tile.getImage().getHeight(), null);\n }\n if (tile.hasAreaEffect()) {\n areaEffectRenderer.render(g, tile.getAreaEffect(), topLeft);\n }\n\n if (tile.hasItem()) {\n for (Item item : tile.getItems()) {\n itemRenderer.render(g, item, topLeft);\n }\n }\n }\n }", "public void adjustLeft() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].x = tiles[x][y].x - 4;\n backGroundTiles[x][y].x = backGroundTiles[x][y].x - 4;\n grassTiles[x][y].x = grassTiles[x][y].x - 4;\n }\n }", "public void addTileOnBeginning(Tile tile);", "public void rotateLeft() {\n // I fucked up? Rotations are reversed, just gonna switch em\n// tileLogic = getRotateLeft();\n tileLogic = getRotateRight();\n// rotateLeftTex();\n rotateRightTex();\n }", "public void clearGotoFloor();", "void reset() {\n setPosition(-(TILE_WIDTH * CYCLE), TOP_Y);\n mySequenceIndex = 0;\n setAnimatedTile(myAnimatedTileIndex, FRAME_SEQUENCE[mySequenceIndex]);\n }", "public void drawTile() {\n\n }", "static void reset() {\n for( Tile x : tiles ) {\n x.setBackground(white);\n }\n tiles.get(0).setBackground(red);\n start = 0;\n flag = 0;\n }", "@Override\n protected void generateTiles() {\n }", "public WallTile()\n\t{\n\t\t\n\t}", "public void clearTiles() {\n \tfor (int x = 0; x < (mAbsoluteTileCount.getX()); x++) {\n for (int y = 0; y < (mAbsoluteTileCount.getY()); y++) {\n setTile(0, x, y);\n }\n }\n }", "public void dropNewTile() {\n ArrayList<Integer> emptyTilesX= new ArrayList<Integer>();\n ArrayList<Integer> emptyTilesY= new ArrayList<Integer>();\n\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n emptyTilesX.add(x);\n emptyTilesY.add(y);\n }\n }\n }\n\n int randTile= rand.nextInt(emptyTilesX.size());\n int percent= rand.nextInt(20);\n int newTileNumber= 2;\n if(percent==0 || percent==1 || percent==2) {\n newTileNumber= 4;\n }\n \n int dropX= emptyTilesX.get(randTile);\n int dropY= emptyTilesY.get(randTile);\n board[dropX][dropY]= newTileNumber;\n }", "@Override\n\tprotected void generateTiles() {\n\t}", "void positionToStart () {\n currentRow = 0 - currentPiece.getOffset();\n currentColumn = board.columns / 2 - currentPiece.width / 2;\n }", "@Override\r\n\tpublic void moveLeft() {\n\t\tswitch(state) {\r\n\t\tcase 0: case 2:\r\n\t\t\t{\r\n\t\t\t\tboolean ok = true;\r\n\t\t\t\tfor(Case c: cases) {\r\n\t\t\t\t\tif(!grille.isEmpty(c.getX()+x-1, c.getY()+y))\r\n\t\t\t\t\t\tok = false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(ok)\r\n\t\t\t\t\t--x;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase 1:\r\n\t\t{\r\n\t\t\tint x3 = cases.get(3).getX()-1, y3 = cases.get(3).getY();\r\n\t\t\tif(grille.isEmpty(x+x3, y+y3))\r\n\t\t\t\t--x;\r\n\t\t\t\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\t\tcase 3:\r\n\t\t{\r\n\t\t\tint x0 = cases.get(0).getX()-1, y0 = cases.get(0).getY();\r\n\t\t\tif(grille.isEmpty(x+x0, y+y0))\r\n\t\t\t\t--x;\r\n\t\t}\r\n\t\tbreak;\r\n\t\t\r\n\t\tdefault : \r\n\t\t\treturn;\r\n\t\t}\r\n\t}", "public void mousePressed(MouseEvent e) {\n\t\t\tEditorGUI.tileCurrent.updateFrom(Tile.createEmptyCurrent());\n\t\t}", "private void createTile(){\n for(int i = 0; i < COPY_TILE; i++){\n for(int k = 0; k < DIFF_TILES -2; k++){\n allTiles.add(new Tile(k));\n }\n }\n }", "private void boxCreator(int[] pos, int width, int height) {\n for (int x = pos[0]; x < pos[0] + width; x++) {\n tiles[x][pos[1]] = Tileset.WALL;\n }\n for (int y = pos[1]; y < pos[1] + height; y++) {\n tiles[pos[0]][y] = Tileset.WALL;\n }\n for (int x = pos[0]; x < pos[0] + width; x++) {\n tiles[x][pos[1] + height] = Tileset.WALL;\n }\n for (int y = pos[1]; y < pos[1] + height + 1; y++) {\n tiles[pos[0] + width][y] = Tileset.WALL;\n }\n for (int y = pos[1] + 1; y < pos[1] + height; y++) {\n for (int x = pos[0] + 1; x < pos[0] + width; x++) {\n tiles[x][y] = Tileset.FLOWER;\n }\n }\n }", "private void openFloor(Tile t) {\r\n int tileRow = t.getRow();\r\n int tileCol = t.getCol();\r\n if (t.getSurroudingBombs() == 0) { \r\n for (int r = tileRow - 1; r <= tileRow + 1; r++) {\r\n for (int c = tileCol - 1; c <= tileCol + 1; c++) {\r\n if (r >= 0 && r < gridSize && c >= 0 && c < gridSize) {\r\n Tile inspectionTile = grid[r][c]; \r\n if (!(r == tileRow && c == tileCol) && inspectionTile.isHidden() \r\n && !inspectionTile.getFlagged()) {\r\n if (!inspectionTile.isBomb()) {\r\n inspectionTile.handleTile();\r\n if (inspectionTile.getSurroudingBombs() == 0) {\r\n openFloor(inspectionTile);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (int r = tileRow - 1; r <= tileRow + 1; r++) {\r\n for (int c = tileCol - 1; c <= tileCol + 1; c++) {\r\n if (r >= 0 && r < gridSize && c >= 0 && c < gridSize) {\r\n Tile inspectionTile = grid[r][c]; \r\n if ((r != tileRow - 1 && c != tileCol - 1) ||\r\n (r != tileRow - 1 && c != tileCol + 1) ||\r\n (r != tileRow + 1 && c != tileCol - 1) ||\r\n (r != tileRow + 1 && c != tileCol + 1) && \r\n !(r == tileRow && c == tileCol) && inspectionTile.isHidden()) {\r\n if (!inspectionTile.isBomb()) {\r\n inspectionTile.handleTile();\r\n if (inspectionTile.getSurroudingBombs() == 0) {\r\n openFloor(inspectionTile);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "void reset() {\n if (myGrass != null) {\n myGrass.reset();\n }\n if (myCowboy != null) {\n myCowboy.reset();\n }\n if (myLeftTumbleweeds != null) {\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i].reset();\n }\n }\n if (myRightTumbleweeds != null) {\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].reset();\n }\n }\n myLeft = false;\n myCurrentLeftX = Grass.CYCLE * Grass.TILE_WIDTH;\n }", "private void begin(){\n for(int i = 0; i < height; i++){ //y\n for(int j = 0; j < width; j++){ //x\n for(int k = 0; k < ids.length; k++){\n if(m.getTileids()[j][i].equals(ids[k])){\n map[j][i] = Handler.memory.getTiles()[k];\n //Handler.debug(\"is tile null: \" + (Handler.memory.getTiles()[k] == null));\n \n k = ids.length;\n }else if(k == (ids.length - 1)){\n Handler.debug(\"something went wrong\", true);\n\n }\n }\n }\n }\n mt.setCleared(clear);\n mt.setMap(map);\n \n \n }", "public void generateLevel() {\n\t\tfor (int y = 0; y < this.height; y++) {\n\t\t\tfor (int x = 0; x < this.width; x++) {\n\t\t\t\tif (x * y % 10 < 5)\n\t\t\t\t\ttiles[x + y * width] = Tile.GRASS.getId();\n\t\t\t\telse\n\t\t\t\t\ttiles[x + y * width] = Tile.STONE.getId();\n\t\t\t}\n\t\t}\n\t}", "public void landPiece() {\n\t\t// current rotation of piece\n\t\tint rot = currentPiece.getPieceRotation();\n\t\t\n\t\t// x coordinate of current piece's northwest corner\n\t\tint row = currentPieceGridPosition[0];\n\t\t\n\t\t// y coordinate of current piece's northwest corner\n\t\tint col = currentPieceGridPosition[1];\t\n\n\t\t// adds currentPiece's landing positions to be true in blockMatrix\n\t\tfor(int i = 0; i < 4; i++) { \n\t\t\tfor(int j = 0; j < 4; j++) { \n\t\t\t\tif(currentPiece.isFilled(rot, i, j)) {\n\t\t\t\t\tblockMatrix[i + row][j + col] = true; \n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//add up scores\n\t\tnumLines += numberOfFormedLines(); \n\t\tif(numberOfFormedLines() >= 4) {\n\t\t\tnumTetrises++; \n\t\t}\n\t\t\n\t\t//clear out full lines\n\t\tfor(int i = 0; i < blockMatrix.length; i++) { \n\t\t\tif(fullLine(i)) { \n\t\t\t\tremoveLine(i);\n\t\t\t\t//find rows with blocks filled above cleared line to drop those down\n\t\t\t\tfor(int m = i-1; m >= 0; m--) { \n\t\t\t\t\tfor(int n = 0; n < NUM_COLS; n++) {\n\t\t\t\t\t\t// fill in space below, clear out current row \n\t\t\t\t\t\tif(hasBlock(m, n)) { \n\t\t\t\t\t\t\tblockMatrix[m][n] = false;\n\t\t\t\t\t\t\tblockMatrix[m+1][n] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// ready for next piece\n\t\taddNewPiece();\n\t}", "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "public void moveTileForward()\n {\n if(!(activeTile+1 > tiles.length-1) && tiles[activeTile+1] != null)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile+1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile+1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile+1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile+1].getEndColor());\n \n tiles[activeTile+1].setTileLevel(tiles[activeTile+1].getTileLevel()-1);\n tiles[activeTile] = tiles[activeTile+1];\n previews[activeTile] = previews[activeTile+1];\n previewGradients[activeTile] = previewGradients[activeTile+1];\n previewHover[activeTile] = previewHover[activeTile+1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()+1);\n tiles[activeTile+1] = tmpTile;\n tiles[activeTile+1].setStartColor(tiles[activeTile+1].getStartColor());\n previews[activeTile+1] = tmpPreview;\n previewGradients[activeTile+1] = tmpPreviewGradients;\n previewHover[activeTile+1] = tmpPreviewHover;\n \n activeTile += 1;\n createPreviewGradients();\n }\n }", "private void putTilesOnBoard() {\n boolean isWhite = true;\n for (int x = 0; x < 8; x++) {\n for (int y = 0; y < 8; y++) {\n Tile t = new Tile(isWhite, new Position(x, y));\n t.setOnMouseClicked(e -> {\n if (t.piece != null && this.activeTile == null && this.whitePlayer == t.piece.isWhite()) {\n this.activeTile = t;\n ArrayList<Position> moves = t.piece.getLegalMoves();\n this.highlightAvailableMoves(moves, t.isWhite);\n } else if (t.isHighlighted.getValue() && this.activeTile.piece != null ) {\n movePieces(t);\n } else {\n this.activeTile = null;\n this.clearHighlightedTiles();\n }\n this.updatePieceBoards();\n });\n t.isHighlighted.addListener((o, b, b1) -> {\n if (o.getValue() == true) {\n t.startHighlight();\n } else {\n t.clearHighlight();\n }\n });\n this.board[x][y] = t;\n this.add(this.board[x][y], x, y);\n isWhite = !isWhite;\n }\n isWhite = !isWhite;\n }\n\n }", "public void setInitialPosition()\n {\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.a2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.b2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.c2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.d2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.e2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.f2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.g2);\n putGenericPiece(GenericPiece.PAWN, Colour.WHITE, Square.h2);\n //Se colocan los peones negros en la séptima fila\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.a7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.b7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.c7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.d7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.e7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.f7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.g7);\n putGenericPiece(GenericPiece.PAWN, Colour.BLACK, Square.h7);\n //Se colocan las torres blancas en a1 y h1\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.a1);\n putGenericPiece(GenericPiece.ROOK,Colour.WHITE,Square.h1);\n //Se colocan las torres negras en a8 y h9\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.a8);\n putGenericPiece(GenericPiece.ROOK,Colour.BLACK,Square.h8);\n //Se colocan los caballos blancos en b1 y g1\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.b1);\n putGenericPiece(GenericPiece.KNIGHT,Colour.WHITE,Square.g1);\n //Se colocan los caballos negros en b8 y g8\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.b8);\n putGenericPiece(GenericPiece.KNIGHT,Colour.BLACK,Square.g8);\n //Se colocan los alfiles blancos en c1 y f1\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.c1);\n putGenericPiece(GenericPiece.BISHOP,Colour.WHITE,Square.f1);\n //Se colocan los alfiles negros en c8 y f8\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.c8);\n putGenericPiece(GenericPiece.BISHOP,Colour.BLACK,Square.f8);\n //Se coloca la dama blanca en d1\n putGenericPiece(GenericPiece.QUEEN,Colour.WHITE,Square.d1);\n //Se coloca la dama negra en d8\n putGenericPiece(GenericPiece.QUEEN,Colour.BLACK,Square.d8);\n //Se coloca el rey blanco en e1\n putGenericPiece(GenericPiece.KING,Colour.WHITE,Square.e1);\n //Se coloca el rey negro en e8\n putGenericPiece(GenericPiece.KING,Colour.BLACK,Square.e8);\n \n //Se permiten los enroques para ambos jugadores\n setCastlingShort(Colour.WHITE,true);\n setCastlingShort(Colour.BLACK,true);\n setCastlingLong(Colour.WHITE,true);\n setCastlingLong(Colour.BLACK,true);\n \n //Se da el turno a las blancas\n setTurn(Colour.WHITE);\n \n gamePositionsHash.clear();\n gamePositionsHash.put(zobristKey.getKey(), 1);\n }", "public void clearTiles() {\r\n\r\n for (int i = 0; i < 16; i += 1) {\r\n tiles[i] = 0;\r\n }\r\n boardView.invalidate();\r\n placedShips = 0;\r\n }", "public void handleRightWall(){\n for(int i = 0; i < 15; i ++){\n if(i % 2 == 1 ){\n maze[18][i] = VISIBLESPACE;\n }\n }\n }", "public void clearFloor(Position pos) {\n\t\t\tcellLabels.get(pos.getColumn(), pos.getRow()).setText(\"\");\n\t\t\tcellLabels.get(pos.getColumn(), pos.getRow()).setBackground(Color.gray);\n\t\t}", "public void resetCoordinates(){\n pos=0;\n if(this.pIndex<2){\n this.coordinates[0]=TILE_SIZE*15-DICE_SIZE;}\n else{\n this.coordinates[0]=0;}\n if(this.pIndex%3==0){\n this.coordinates[1]=0;}\n else{\n this.coordinates[1]=TILE_SIZE*15-DICE_SIZE;} \n }", "public void pave() {\n if (!world[position.x][position.y].equals(Tileset.NOTHING)) {\n System.out.println(\"I cannot pave at this place.\");\n return;\n }\n world[position.x][position.y] = Tileset.FLOOR;\n }", "public void resetPlayerPosition() {\n\t\tthis.tilePositionX = this.STARTING_X;\n\t\tthis.tilePositionY = this.STARTING_Y;\n\t}", "private void addLeftBlock(Position p, TETile te,\n int len, int leftWid, int rightWid) {\n\n int x = p.x;\n int y = p.y;\n for (int i = x; i > x - len; i -= 1) {\n for (int j = y - leftWid; j < y + rightWid + 1; j += 1) {\n world[i][j] = te;\n }\n }\n }", "private void drawTiles(Graphics g)\n {\n for (int x = 0; x < 19; x++)\n {\n for (int y = 0; y < 15; y++)\n {\n tileset.getSprite(5, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n switch(board[x][y])\n {\n case 1:\n {\n tileset.getSprite(4, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 2:\n {\n tileset.getSprite(3, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n break;\n }\n case 3:\n {\n if (bombs[x][y].getTimeLeft() > 80)\n {\n bombImage.getSprite(0, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n if (bombs[x][y].getTimeLeft() <= 80 && bombs[x][y].getTimeLeft() > 50)\n {\n bombImage.getSprite(1, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n if (bombs[x][y].getTimeLeft() <= 50 && bombs[x][y].getTimeLeft() > 20)\n {\n bombImage.getSprite(2, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n if (bombs[x][y].getTimeLeft() <= 20)\n {\n bombImage.getSprite(3, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n break;\n }\n //4 is player\n case 5:\n {\n if (fire[x][y] == null)\n {\n tileset.getSprite(2, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n break;\n }\n case 6:\n {\n if (fire[x][y] == null)\n {\n tileset.getSprite(15, 0).draw(x * 32 + jitterX, y * 32 + jitterY);\n }\n break;\n }\n }\n }\n }\n }", "private void createTiles() {\n\t\tint tile_width = bitmap.getWidth() / gridSize;\n\t\tint tile_height = bitmap.getHeight() / gridSize;\n\n\t\tfor (short row = 0; row < gridSize; row++) {\n\t\t\tfor (short column = 0; column < gridSize; column++) {\n\t\t\t\tBitmap bm = Bitmap.createBitmap(bitmap, column * tile_width,\n\t\t\t\t\t\trow * tile_height, tile_width, tile_height);\n\n\t\t\t\t// if final, Tile -> blank\n\t\t\t\tif ((row == gridSize - 1) && (column == gridSize - 1)) {\n\t\t\t\t\tbm = Bitmap.createBitmap(tile_width, tile_height,\n\t\t\t\t\t\t\tbm.getConfig());\n\t\t\t\t\tbm.eraseColor(Color.WHITE);\n\t\t\t\t\ttheBlankTile = new Tile(bm, row, column);\n\t\t\t\t\ttiles.add(theBlankTile);\n\t\t\t\t} else {\n\t\t\t\t\ttiles.add(new Tile(bm, row, column));\n\t\t\t\t}\n\t\t\t} // end column\n\t\t} // end row\n\t\tbitmap.recycle();\n\n\t}", "public static void blankBoard() {\r\n\t\tfor (int i = 0; i < Spaces.length; i++) {\r\n\t\t\tSpaces[i] = new Piece();\r\n\t\t}\r\n\t}", "public void initTiles()\n {\n PropertiesManager props = PropertiesManager.getPropertiesManager(); \n String imgPath = props.getProperty(MahjongSolitairePropertyType.IMG_PATH);\n int spriteTypeID = 0;\n SpriteType sT;\n \n // WE'LL RENDER ALL THE TILES ON TOP OF THE BLANK TILE\n String blankTileFileName = props.getProperty(MahjongSolitairePropertyType.BLANK_TILE_IMAGE_NAME);\n BufferedImage blankTileImage = miniGame.loadImageWithColorKey(imgPath + blankTileFileName, COLOR_KEY);\n ((MahjongSolitairePanel)(miniGame.getCanvas())).setBlankTileImage(blankTileImage);\n \n // THIS IS A HIGHLIGHTED BLANK TILE FOR WHEN THE PLAYER SELECTS ONE\n String blankTileSelectedFileName = props.getProperty(MahjongSolitairePropertyType.BLANK_TILE_SELECTED_IMAGE_NAME);\n BufferedImage blankTileSelectedImage = miniGame.loadImageWithColorKey(imgPath + blankTileSelectedFileName, COLOR_KEY);\n ((MahjongSolitairePanel)(miniGame.getCanvas())).setBlankTileSelectedImage(blankTileSelectedImage);\n \n // FIRST THE TYPE A TILES, OF WHICH THERE IS ONLY ONE OF EACH\n // THIS IS ANALOGOUS TO THE SEASON TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeATiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_A_TILES);\n for (int i = 0; i < typeATiles.size(); i++)\n {\n String imgFile = imgPath + typeATiles.get(i); \n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID);\n initTile(sT, TILE_A_TYPE);\n spriteTypeID++;\n }\n \n // THEN THE TYPE B TILES, WHICH ALSO ONLY HAVE ONE OF EACH\n // THIS IS ANALOGOUS TO THE FLOWER TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeBTiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_B_TILES);\n for (int i = 0; i < typeBTiles.size(); i++)\n {\n String imgFile = imgPath + typeBTiles.get(i); \n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID);\n initTile(sT, TILE_B_TYPE);\n spriteTypeID++;\n }\n \n // AND THEN TYPE C, FOR WHICH THERE ARE 4 OF EACH \n // THIS IS ANALOGOUS TO THE CHARACTER AND NUMBER TILES IN FLAVORLESS MAHJONG\n ArrayList<String> typeCTiles = props.getPropertyOptionsList(MahjongSolitairePropertyType.TYPE_C_TILES);\n for (int i = 0; i < typeCTiles.size(); i++)\n {\n String imgFile = imgPath + typeCTiles.get(i);\n sT = initTileSpriteType(imgFile, TILE_SPRITE_TYPE_PREFIX + spriteTypeID); \n for (int j = 0; j < 4; j++)\n {\n initTile(sT, TILE_C_TYPE);\n }\n spriteTypeID++;\n }\n }", "public void placeTile(Tile t){\n\t\t//System.out.println(t.toString() + \" was placed\");\n\t\toccupied = true;\n\t\tcurrentTile = t;\n\t}", "private void generateGhost() {\r\n\t\ttry {\r\n\t\t\tghost = (FallingPiece)falling.clone();\r\n\t\t} catch (CloneNotSupportedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\twhile(moveIfNoConflict(ghost.moveDown(), ghost));\t\t\r\n\t\tfor (BlockDrawable block : ghost.allBlocks())\r\n\t\t\tblock.setGhost(true);\r\n\t}", "public void fillTable() {\n\t\tif (scroll.getWidth() == 0) {\n\t\t\treturn;\n\t\t}\n\t\tboolean showedNew = false;\n\t\tArrayList<Placeable> currentView = new ArrayList<Placeable>();\n\t\tif (viewing == ViewingMode.MATERIAL) {\n\t\t\tif (loadedMats == null)\n\t\t\t\tloadedMats = repo.getAllMats();\n\t\t\tfor (NamedMaterial m: loadedMats) {\n\t\t\t\tcurrentView.add(m);\n\t\t\t}\n\t\t}\n\t\telse if (viewing == ViewingMode.PIECE){\n\t\t\tif (loadedPieces == null)\n\t\t\t\tloadedPieces = repo.getAllPieces();\n\t\t\tfor (Piece m: loadedPieces) {\n\t\t\t\tcurrentView.add(m);\n\t\t\t}\n\t\t\tshowedNew = true;\n\t\t}\n\t\t\n\t\ttiles.clearChildren();\n\t\tfloat cellWidth = 64.0f;\n\t\tint numAcross = (int)(scroll.getWidth() / cellWidth);\n\t\tif (numAcross <= 0) {\n\t\t\tnumAcross = 1;\n\t\t}\n\t\tint count = 0;\n\t\tActor tile;\n\t\twhile (count < currentView.size()) {\n\t\t\tfor (int y = 0; y < numAcross; y++) {\n\t\t\t\tif (!showedNew) {\n\t\t\t\t\ttile = new Label(\"New\", TextureOrganizer.getSkin());\n\t\t\t\t\t((Label)tile).setAlignment(Align.center);\n\t\t\t\t\ttile.addListener(new ClickListener() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t public void clicked(InputEvent event, float x, float y) {\n\t\t\t\t\t\t\tmakeNew();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tshowedNew = true;\n\t\t\t\t}\n\t\t\t\telse if (count >= currentView.size()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttile = new ColoredRectActor(currentView.get(count++));\n\t\t\t\t\ttile.addListener(new TileListener((ColoredRectActor)tile));\n\t\t\t\t}\n\t\t\t\ttiles.add(tile).width(cellWidth).height(cellWidth).fill();\n\t\t\t}\n\t\t\tif (count < currentView.size())\n\t\t\t\ttiles.row();\n\t\t}\n\t}", "public void leftPressed()\r\n {\r\n worldPanel.newMapPos(-zoom,0);\r\n miniMap.newMapPos(-1,0);\r\n }", "protected abstract void paintBoard() throws TilePixelOutOfRangeException;", "private void generateBorder() {\n\t\tfor (int y = 0; y < height; y++) {\n\t\t\tfor (int x = 0; x < width; x++) {\n\t\t\t\tif (x == 0 || y == 0 || x == width - 1 || y == height - 1) {\n\t\t\t\t\ttiles[x + y * width] = Tile.darkGrass;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void revealTiles() {\n\n for (int i = 0; i < minefield.getRows(); i++) {\n for (int j = 0; j < minefield.getCols(); j++) {\n if (minefield.getMinefield()[i][j].isRevealed()\n && !minefield.getMinefield()[i][j].isMined()) {\n tileLabel[i][j].setText(\"<html><b>\" + minefield.getMinefield()[i][j].getMinedNeighbours() + \"</html></b>\");\n tile[i][j].setBackground(new Color(208, 237, 243));\n switch (tileLabel[i][j].getText()) {\n case \"<html><b>0</html></b>\":\n tileLabel[i][j].setText(\"\");\n break;\n case \"<html><b>1</html></b>\":\n tileLabel[i][j].setForeground(Color.blue);\n break;\n case \"<html><b>2</html></b>\":\n tileLabel[i][j].setForeground(new Color(0, 100, 0));\n break;\n case \"<html><b>3</html></b>\":\n tileLabel[i][j].setForeground(Color.red);\n break;\n case \"<html><b>4</html></b>\":\n tileLabel[i][j].setForeground(new Color(75, 0, 130));\n break;\n case \"<html><b>5</html></b>\":\n tileLabel[i][j].setForeground(new Color(130, 0, 0));\n break;\n case \"<html><b>6</html></b>\":\n tileLabel[i][j].setForeground(new Color(0, 153, 153));\n break;\n case \"<html><b>7</html></b>\":\n tileLabel[i][j].setForeground(Color.black);\n break;\n case \"<html><b>8</html></b>\":\n tileLabel[i][j].setForeground(Color.darkGray);\n break;\n }\n }\n }\n }\n frame.repaint();\n }", "public Parent createContent(){\n Pane root = new Pane();\n root.setPrefSize((dimension * tileSize)+(tileSize*4)+menuWidth, (dimension * tileSize)+(tileSize*4));\n root.getChildren().addAll(tileGroup);\n TopOfBoard top = new TopOfBoard();\n Parent controlsAndMovement = top.newScene();\n root.getChildren().addAll(controlsAndMovement);\n\n // setting main game board template\n for (int i = 0; i< dimension; i++){\n for (int j = 0; j< dimension; j++){\n if (i==0||i== dimension -1||j==0||j== dimension -1){\n if (i==0) {\n if (j==0){\n tileInit(i, j, tileGroup, tileSize * 2, tileSize * 2, j * tileSize, i * tileSize);\n }\n else if (j== dimension -1){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, (j * tileSize)+tileSize, i * tileSize);\n }\n else {\n tileInit(i, j, tileGroup, tileSize*2, tileSize, (j * tileSize)+tileSize, i * tileSize);\n }\n }\n else if (i== dimension -1){\n if (j==0){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, j * tileSize, (i * tileSize)+tileSize);\n }\n else if (j== dimension -1){\n tileInit(i, j, tileGroup, tileSize*2, tileSize*2, (j * tileSize)+tileSize, (i * tileSize)+tileSize);\n }\n else {\n tileInit(i, j, tileGroup, tileSize * 2, tileSize, (j * tileSize) + tileSize, (i * tileSize) + tileSize);\n }\n }\n else if (j==0){\n tileInit(i, j, tileGroup, tileSize, tileSize*2, j * tileSize, (i * tileSize)+(tileSize));\n\n }\n else if (j== dimension -1) {\n tileInit(i, j, tileGroup, tileSize, tileSize*2, (j * tileSize)+(tileSize), (i * tileSize)+tileSize);\n }\n\n }\n }\n\n // Setting player score board\n for (int q = 1; q <= numOfPlayers; q++){\n if (q == 1){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*3);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*3.5), \"Player 1 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 2){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*5);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*5.5), \"Player 2 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 3){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*7);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*7.5), \"Player 3 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n else if (q == 4){\n Tile tile = new Tile((getTileSize()*2), (getTileSize()*4));\n tile.setTranslateX((getTileSize()* getDimension())+(getTileSize()*3));\n tile.setTranslateY(getTileSize()*9);\n Text text = new Text((getTileSize()* getDimension())+(getTileSize()*4), (getTileSize()*9.5), \"Player 4 score board:\");\n tileGroup.getChildren().addAll(tile, text);\n }\n\n }\n\n for (int r = 1; r <= numOfPlayers; r++) {\n if (r == 1) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(0);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 0.5), \"Player 1 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 2) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 3);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 3.5), \"Player 2 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 3) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 6);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 6.5), \"Player 3 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n } else if (r == 4) {\n Tile tile = new Tile((getTileSize() * 3), (getTileSize() * 4));\n tile.setTranslateX((getTileSize() * getDimension()) + (getTileSize() * 7));\n tile.setTranslateY(getTileSize() * 9);\n Text text = new Text((getTileSize() * getDimension()) + (getTileSize() * 8), (getTileSize() * 9.5), \"Player 4 owned cards:\");\n tileGroup.getChildren().addAll(tile, text);\n\n }\n }\n addImg();\n }\n return root;\n }", "public void setTiles() {\n\t\tTileStack names = new TileStack();\n\t\tfor(int x=0; x < theBoard.getCols(); x++) {\n\t\t\tfor(int y=0; y < theBoard.getRows(); y++) {\n\t\t\t\tp = new Point(x,y);\n\t\t\t\tif(p.equals(new Point(0,0)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(1,0)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(4,0)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(5,0)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(0,1)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(5,1)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(0,4)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(5,4)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(0,5)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(1,5)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(4,5)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse if(p.equals(new Point(5,5)))\n\t\t\t\t\ttheBoard.setTile(p, TilesEnums.SEA);\n\n\t\t\t\telse \n\t\t\t\t\ttheBoard.setTile(p, names.pop());\n\t\t\t}\n\t\t}\n\t}", "public void left () {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return;\n Location loc = getLocation();\n Location next = loc.getAdjacentLocation(Location.WEST);\n if (canMove(next)) {\n moveTo(next);\n }\n }", "protected void left() {\n move(positionX - 1, positionY);\n orientation = BattleGrid.RIGHT_ANGLE * 2;\n }", "public void nextTile() {\n/* 779 */ this.e.nextTile();\n/* 780 */ this.k = getTileIdx();\n/* */ \n/* */ \n/* 783 */ String str = (String)this.f.f(this.k);\n/* 784 */ if (str.equals(\"none\")) {\n/* 785 */ this.h = 0;\n/* */ }\n/* 787 */ else if (str.equals(\"rct\")) {\n/* 788 */ this.h = 1;\n/* 789 */ c();\n/* */ }\n/* 791 */ else if (str.equals(\"ict\")) {\n/* 792 */ this.h = 2;\n/* 793 */ d();\n/* */ } else {\n/* */ \n/* 796 */ throw new IllegalArgumentException(\"Component transformation not recognized\");\n/* */ } \n/* */ }", "private void newPiece() {\n curPiece.setRandomShape();\n//compute the initial curX and curY values \n curX = BOARD_WIDTH / 2 + 1;\n curY = BOARD_HEIGHT - 1 + curPiece.minY();\n//if a piece reaches the top and cannot drop any more piece\n if (!tryMove(curPiece, curX, curY)) {\n//cancel timer and display game over\n curPiece.setShape(Tetrominoe.NoShape);\n timer.cancel();\n isStarted = false;\n statusbar.setText(\"Game over\");\n }\n }", "public Tumbleweed(boolean left) throws Exception {\n super(Image.createImage(\"/images/tumbleweed.png\"), WIDTH, WIDTH);\n myY = JumpManager.DISP_HEIGHT - WIDTH - 2;\n myLeft = left;\n if (!myLeft) {\n setTransform(TRANS_MIRROR);\n }\n myJumpedOver = false;\n setVisible(false);\n }", "TileItem getCurrentTile();", "Tile getPosition();", "private void makeMaze() {\n\t\ttry {\n\t\t\tthis.end = ImageIO.read(new File(\"images/tiles/end_locked.png\"));\n\t\t\tint w = getWidth()/gui.getModel().getDifficulty();\n\t\t\tint h = getHeight()/gui.getModel().getDifficulty();\n\t\t\tint difficulty = gui.getModel().getDifficulty();\n\t\t\tmazeImage = new BufferedImage(difficulty*(getWidth()/difficulty), difficulty*(getHeight()/difficulty), BufferedImage.TYPE_INT_RGB);\n\t\t\tGraphics2D g = mazeImage.createGraphics();\n\t\t\tString tile = \"\";\n\t\t\tfor (BaseState s: gui.getModel().getMaze()) {\n\t\t\t\tint x = s.getX(); int y = s.getY();\n\t\t\t\t\n\t\t\t\t// check walls\n\t\t\t\tint numSides = 0;\n\t\t\t\tboolean rightWall = false;\n\t\t\t\tboolean leftWall = false;\n\t\t\t\tboolean topWall = false;\n\t\t\t\tboolean bottomWall = false;\n\t\t\t\tif (s.getRight() == null) rightWall = true;\n\t\t\t\tif (s.getLeft() == null) leftWall = true;\n\t\t\t\tif (s.getUp() == null) topWall = true;\n\t\t\t\tif (s.getDown() == null) bottomWall = true;\n\t\t\t\tif (topWall) numSides++;\n\t\t\t\tif (leftWall) numSides++;\n\t\t\t\tif (bottomWall) numSides++;\n\t\t\t\tif (rightWall) numSides++;\n\t\t\t\t\n\t\t\t\t// find tile type\n\t\t\t\tif (numSides == 3) { // dead end\n\t\t\t\t\tif (!rightWall) tile = \"images/tiles/deadend_left.bmp\";\n\t\t\t\t\telse if (!leftWall) tile = \"images/tiles/deadend_right.bmp\";\n\t\t\t\t\telse if (!topWall) tile = \"images/tiles/deadend_bottom.bmp\";\n\t\t\t\t\telse if (!bottomWall) tile = \"images/tiles/deadend_top.bmp\";\n\t\t\t\t} else if (numSides == 2) { // corner or hall\n\t\t\t\t\t//hall\n\t\t\t\t\tif (rightWall && leftWall) tile = \"images/tiles/hall_vertical.bmp\";\n\t\t\t\t\telse if (topWall && bottomWall) tile = \"images/tiles/hall_horizontal.bmp\";\n\t\t\t\t\t//corner\n\t\t\t\t\telse if (topWall && leftWall) tile = \"images/tiles/corner_top_left.bmp\";\n\t\t\t\t\telse if (topWall && rightWall) tile = \"images/tiles/corner_top_right.bmp\";\n\t\t\t\t\telse if (bottomWall && leftWall) tile = \"images/tiles/corner_bottom_left.bmp\";\n\t\t\t\t\telse if (bottomWall && rightWall) tile = \"images/tiles/corner_bottom_right.bmp\";\n\t\t\t\t} else if (numSides == 1) { // single side\n\t\t\t\t\tif (leftWall) tile = \"images/tiles/wall_left.bmp\";\n\t\t\t\t\telse if (rightWall) tile = \"images/tiles/wall_right.bmp\";\n\t\t\t\t\telse if (topWall) tile = \"images/tiles/wall_top.bmp\";\n\t\t\t\t\telse if (bottomWall) tile = \"images/tiles/wall_bottom.bmp\";\n\t\t\t\t} else { // open\n\t\t\t\t\ttile = \"images/tiles/open.bmp\";\n\t\t\t\t}\n\t\t\t\t// draw tile\n\t\t\t\tg.drawImage(ImageIO.read(new File(tile)), x*w, y*h, w, h, null);\n\t\t\t\t\n\t\t\t\t// check for ending and draw if need be\n\t\t\t\tif (s.getX() == gui.getModel().getDifficulty() - 1 && s.getY() == gui.getModel().getDifficulty() - 1) {\n\t\t\t\t\tg.drawImage(ImageIO.read(new File(\"images/tiles/end_unlocked.png\")), x*w, y*h, w, h, null);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch(IOException e) {System.err.println(\"Images not found.\");}\n\t}", "public TileFloor(int x, int y)\r\n {\r\n random = new Random(12345);\r\n ROWS = DEFAULT_ROWS;\r\n COLUMNS= DEFAULT_COLUMNS;\r\n this.x = x;\r\n this.y = y;\r\n }", "void buildBlock(Tile t);", "public void border() {\n\t\tfor (int x = 0; x < width; x++) {\n\t\t\tmaze[x][0] = Block.WALL;\n\t\t\tmaze[x][height - 1] = Block.WALL;\n\t\t}\n\t\tfor (int y = 0; y < height; y++) {\n\t\t\tmaze[0][y] = Block.WALL;\n\t\t\tmaze[width - 1][y] = Block.WALL;\n\t\t}\n\t}", "public void reset() {\n // White Pieces\n placePiece(new Rook(Player.White), new Position(\"a1\"));\n placePiece(new Knight(Player.White), new Position(\"b1\"));\n placePiece(new Bishop(Player.White), new Position(\"c1\"));\n placePiece(new Queen(Player.White), new Position(\"d1\"));\n placePiece(new King(Player.White), new Position(\"e1\"));\n placePiece(new Bishop(Player.White), new Position(\"f1\"));\n placePiece(new Knight(Player.White), new Position(\"g1\"));\n placePiece(new Rook(Player.White), new Position(\"h1\"));\n placePiece(new Pawn(Player.White), new Position(\"a2\"));\n placePiece(new Pawn(Player.White), new Position(\"b2\"));\n placePiece(new Pawn(Player.White), new Position(\"c2\"));\n placePiece(new Pawn(Player.White), new Position(\"d2\"));\n placePiece(new Pawn(Player.White), new Position(\"e2\"));\n placePiece(new Pawn(Player.White), new Position(\"f2\"));\n placePiece(new Pawn(Player.White), new Position(\"g2\"));\n placePiece(new Pawn(Player.White), new Position(\"h2\"));\n\n // Black Pieces\n placePiece(new Rook(Player.Black), new Position(\"a8\"));\n placePiece(new Knight(Player.Black), new Position(\"b8\"));\n placePiece(new Bishop(Player.Black), new Position(\"c8\"));\n placePiece(new Queen(Player.Black), new Position(\"d8\"));\n placePiece(new King(Player.Black), new Position(\"e8\"));\n placePiece(new Bishop(Player.Black), new Position(\"f8\"));\n placePiece(new Knight(Player.Black), new Position(\"g8\"));\n placePiece(new Rook(Player.Black), new Position(\"h8\"));\n placePiece(new Pawn(Player.Black), new Position(\"a7\"));\n placePiece(new Pawn(Player.Black), new Position(\"b7\"));\n placePiece(new Pawn(Player.Black), new Position(\"c7\"));\n placePiece(new Pawn(Player.Black), new Position(\"d7\"));\n placePiece(new Pawn(Player.Black), new Position(\"e7\"));\n placePiece(new Pawn(Player.Black), new Position(\"f7\"));\n placePiece(new Pawn(Player.Black), new Position(\"g7\"));\n placePiece(new Pawn(Player.Black), new Position(\"h7\"));\n }", "public Tile(int row, int column){\n this.row = row;\n this.column = column;\n this.piece = null;\n }", "@Override\n public Map put(Tile tile, int left, int top) {\n // TODO if useful\n int index = getPosition(left, top);\n while (this.tiles.size() <= index) {\n this.tiles.add(null);\n }\n this.tiles.set(index, tile);\n return this;\n }", "@Test\n public void rectLowerLeftWriteTest() {\n final Rectangle rect = new Rectangle(-20, 30, 50, 50);\n minx = 0;\n miny = 0;\n width = 100;\n height = 50;\n tilesWidth = 10;\n tilesHeight = 5;\n numBand = 3;\n setRenderedImgTest(minx, miny, width, height, tilesWidth, tilesHeight, numBand, null);\n setPixelIterator(renderedImage, rect);\n while (pixIterator.next()) pixIterator.setSample(-1);\n fillGoodTabRef(minx, miny, width, height, tilesWidth, tilesHeight, numBand, rect);\n setPixelIterator(renderedImage);\n int comp = 0;\n while (pixIterator.next()) {\n setTabTestValue(comp++, pixIterator.getSampleDouble());\n }\n assertTrue(compareTab());\n }", "public void resetEmpty() {\n\t /*reset the mineField with no mines*/\n mineField = blankField(this.row, this.col);\n }", "private void overwritePositionWithEmpty(int row, int col){\n gameBoard[row][col] = new EmptyPiece();\n }", "private void testBoardCreation() {\n for (int r = 0; r < Constants.BOARD_GRID_ROWS; r++) {\n for (int c = 0; c < Constants.BOARD_GRID_COLUMNS; c++) {\n Vector2 tokenLocation = this.mBoardLevel.getCenterOfLocation(r, c);\n Image tokenImage = new Image(this.mResources.getToken(PlayerType.RED));\n tokenImage.setPosition(tokenLocation.x, tokenLocation.y);\n this.mStage.addActor(tokenImage);\n }\n }\n }", "public void getTile_B8();", "public void setRemainingToScenery(){\n\t\tfor(int i=0;i<grid.length;i++){\n\t\t\tfor(int j=0;j<grid[0].length;j++){\n\t\t\t\tif(grid[i][j]==null)\n\t\t\t\t\tgrid[i][j]=new Scenery(i*grid[0].length+j);\n\t\t\t}\n\t\t}\n\t}", "exitLockedTile(int row, int col){\r\n this.row = row;\r\n this.col = col;\r\n }", "public void initBasicBoardTiles() {\n\t\ttry {\n\t\t\tfor(int i = 1 ; i <= BOARD_SIZE ; i+=2) {\n\t\t\t\tfor(char c = getColumnLowerBound() ; c <= getColumnUpperBound() ; c+=2) {\n\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, c), PrimaryColor.BLACK).build());\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, (char) ( c + 1)), PrimaryColor.WHITE).build());\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor(int i = 2 ; i <= BOARD_SIZE ; i+=2) {\n\t\t\t\tfor(char c = getColumnLowerBound() ; c <= getColumnUpperBound() ; c+=2) {\n\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, c), PrimaryColor.WHITE).build());\n\t\t\t\t\taddTile(new Tile.Builder(new Location(i, (char) ( c + 1)), PrimaryColor.BLACK).build());\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(LocationException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }", "public void place(GamePiece teil, QPosition pos) { // old German method name: platziere\n for (int x = teil.getMinX(); x <= teil.getMaxX(); x++) {\n for (int y = teil.getMinY(); y <= teil.getMaxY(); y++) {\n if (teil.filled(x, y)) {\n int ax = pos.getX() + x - teil.getMinX();\n int ay = pos.getY() + y - teil.getMinY();\n set(ax, ay, teil.getBlockType(x, y));\n }\n }\n }\n view.draw();\n }", "private boolean slideLeft()\n {\n if (blankCol == SIZE - 1) {\n return false;\n }\n board[blankRow][blankCol] = board[blankRow][blankCol + 1];\n board[blankRow][blankCol + 1] = 0;\n blankCol += 1;\n return true;\n }", "public void reset()\t{\n\t\tthis.snake.clear();\r\n\t\tdir = 1;\r\n\t\tthis.snake.add(new Dimension(2,5));\r\n\t\tthis.snake.add(new Dimension(2,6));\r\n\t\tthis.snake.add(new Dimension(2,7));\r\n\t}", "public boolean moveLEFT() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\t\r\n\t\tfor(i = (rows_size-1) ; i >= 0 ; i--) {\r\n\t\t\tfor( j = 0; j < columns_size; j++) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = j; k >= 0 && isEmpty(i,k-1); k--);\r\n\t\t\t\t\t\tif(k == 0) {\t\r\n\t\t\t\t\t\t\tif( k != j) {\r\n\t\t\t\t\t\t\tgame[i][k] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(game[i][j].isEqual(game[i][k-1]) && game[i][k-1].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[i][k-1].setValue(game[i][k-1].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[i][k-1].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[i][k-1].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif( k != j) {\r\n\t\t\t\t\t\t\t\tgame[i][k] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t}\r\n\tFalseFlag();\t\r\n\treturn flag;\r\n\t}", "public TilePiece(){\n\t\t\n\t\tiColour = null;\n\t\tiShape = null;\n\t}", "public void addTileAtTheEnd(Tile tile);", "private void boxCorners() {\n\t\tint tileTL = Track.getTiles()[(int) ((x + bounds.x) / Tile.TILEWIDTH)][(int) ((y + bounds.y)/ Tile.TILEHEIGHT)];\n\t\tint tileTR = Track.getTiles()[(int) ((x + bounds.x + bounds.width) / Tile.TILEWIDTH)][(int) ((y + bounds.y)/ Tile.TILEHEIGHT)];\n\t\tint tileBL = Track.getTiles()[(int) ((x + bounds.x) / Tile.TILEWIDTH)][(int) ((y + bounds.y + bounds.height)/ Tile.TILEHEIGHT)];\n\t\tint tileBR = Track.getTiles()[(int) ((x + bounds.x + bounds.width) / Tile.TILEWIDTH)][(int) ((y + bounds.y + bounds.height)/ Tile.TILEHEIGHT)];\n\t\tif(vector[0] == 0 && ((tileTL == 2 && tileTR == 3 && tileBL == 5 && tileBR == 4)||\n\t\t\t\t(tileTL == 21 && tileTR == 22 && tileBL == 24 && tileBR == 23) || \n\t\t\t\t(SettingsNdAudio.isHandicap() && tileTL == 25 && tileTR == 26 && tileBL == 28 && tileBR == 27) ||\n\t\t\t\t(SettingsNdAudio.isHandicap() && tileTL == 29 && tileTR == 30 && tileBL == 32 && tileBR == 31)\n\t\t\t\t)) {\n\t\t\tif(!hasReset) {\n\t\t\t\tticker = 0;\n\t\t\t\thasReset = true;\n\t\t\t}\n\t\t\tif(GameState.getGameActive() == 0) {\n\t\t\t\tGameState.setGameActive(2);\n\t\t\t}else if(GameState.getGameActive() == 4) {\n\t\t\t\tif(GameState.getLevel() + 1 < 10) {\n\t\t\t\t\tGameState.setLevel(GameState.getLevel() + 1);\n\t\t\t\t\tGameState newLv = new GameState(handler, GameState.getLevel());\n\t\t\t\t\tState.setState(newLv);\n\t\t\t\t} else\n\t\t\t\t\tGameState.setGameActive(2);\n\t\t\t}\n\t\t}\n\t}", "public void shuffleTiles() {\n\t\tdo {\n\t\t\tCollections.shuffle(tiles);\n\n\t\t\t// Place the blank tile at the end\n\t\t\ttiles.remove(theBlankTile);\n\t\t\ttiles.add(theBlankTile);\n\n\t\t\tfor (short row = 0; row < gridSize; row++) {\n\t\t\t\tfor (short column = 0; column < gridSize; column++) {\n\t\t\t\t\ttileViews.get(row * gridSize + column).setCurrentTile(\n\t\t\t\t\t\t\ttiles.get(row * gridSize + column));\n\t\t\t\t}\n\t\t\t}\n\t\t} while (!isSolvable());\n\t\tmoveCount = 0;\n\n\t}", "public Tile(GameLogic logic, PieceService pieceservice, int x, int y) {\n\n this.x = x;\n this.y = y;\n this.pieces = new ArrayList<>();\n\n setWidth(TakApp.TILE_SIZE);\n setHeight(TakApp.TILE_SIZE);\n \n relocate(x * TakApp.TILE_SIZE, y * TakApp.TILE_SIZE);\n Image tilebg = new Image(getClass().getResourceAsStream(\"/images/tile.jpg\"));\n ImagePattern imagePattern = new ImagePattern(tilebg);\n setFill(imagePattern);\n \n if (this.hasPieces() == false) {\n setOnMousePressed(e -> {\n String pieceColor = logic.checkTurn();\n Piece piece = pieceservice.makePiece(logic, pieceColor, x, y);\n if (piece != null) {\n pieceservice.setPiece(piece, x, y);\n this.pieces.add(piece);\n }\n });\n } else if (this.hasPieces() == true) {\n \n setOnMousePressed(e -> {\n this.oldX = this.getXcoordinate();\n this.oldY = this.getYcoordinate();\n });\n\n setOnMouseDragged(e -> {\n relocate(e.getSceneX(), e.getSceneY());\n });\n \n setOnMouseReleased(e -> {\n \n double mouseX = e.getSceneX();\n double mouseY = e.getSceneY();\n\n int newX = (int) Math.floor(mouseX / 100.0);\n int newY = (int) Math.floor(mouseY / 100.0);\n \n boolean validMove = logic.isValidMove(oldX, oldY, newX, newY);\n \n if (validMove) {\n pieceservice.removePiece(this.pieces.get(this.pieces.size() - 1), oldX, oldY);\n pieceservice.setPiece(this.pieces.get(this.pieces.size() - 1), newX, newY);\n } else {\n pieceservice.setPiece(this.pieces.get(this.pieces.size() - 1), oldX, oldY);\n }\n });\n } \n }", "public void compactLeft() {\n\t// Iteramos a través del tablero partiendo de la primera fila\n\t// y primera columna. Si esta contiene un 0 y la columna posterior\n\t// de la misma fila es distinta de 0, el valor se intercambia.\n\t// El proceso se repite hasta que todas las posiciones susceptibles\n\t// al cambio se hayan comprobado.\n\tfor (int i = 0; i < board.length; i++) {\n\t for (int j = 0; j < board.length - 1; j++) {\n\t\tif (board[i][j] == EMPTY && board[i][j + 1] != EMPTY) {\n\t\t board[i][j] = board[i][j + 1];\n\t\t board[i][j + 1] = EMPTY;\n\t\t compactLeft();\n\t\t}\n\t }\n\t}\n }", "public void markEmptyFields(int shipSize){\n\t\tint x = hitLocation3.x;\n\t\tint y = hitLocation3.y;\n\t\t\n\t\tif( hitLocation2==null && hitLocation3 !=null ){\n\t\t\tif(x-1 >= 0 && y - 1 >= 0){\n\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\t//po skosie lewy gorny\t\t\t\t\n\t\t\t}\n\t\t\tif(x-1 >= 0){\n\t\t\t\topponentShootTable[x-1][y] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y) );\t\t//gorny\n\t\t\t}\n\t\t\tif(y + 1 <sizeBoard){\n\t\t\t\topponentShootTable[x][y+1] = true;\n\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+1) );\t\t//prawy\t\n\t\t\t}\n\t\t\tif(x+1 < sizeBoard && y +1 < sizeBoard){\n\t\t\t\topponentShootTable[x+1][y+1] = true;\t\t\t\t//po skosie dol prawy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif(x-1 >= 0 && y + 1 < sizeBoard){\n\t\t\t\topponentShootTable[x-1][y+1] = true;\t\t\t\t//po skosie prawy gora\n\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif( x +1 < sizeBoard){\n\t\t\t\topponentShootTable[x+1][y] = true;\t\t\t\t// dolny\n\t\t\t\tpossibleshoots.remove(new TabLocation(x+1,y));\t\t\t\t\t\n\t\t\t}\n\t\t\tif(x+1 <sizeBoard && y - 1 >= 0){\n\t\t\t\topponentShootTable[x+1][y-1] = true;\t\t\t//po skosie dol lewy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\t\t\t\t\t\n\t\t\t}\n\t\t\tif(y - 1 >= 0){\n\t\t\t\topponentShootTable[x][y-1] = true;\t\t\t//lewy\n\t\t\t\tpossibleshoots.remove( new TabLocation(x, y-1) );\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\tboolean orientacja = false;\n\t\t\tif( hitLocation3.x == hitLocation2.x ) orientacja = true;\n\t\t\tint tempshipSize = shipSize;\n\t\t\tif( orientacja ){\n\t\t\t\t\n\t\t\t\tif( hitLocation2.y < hitLocation3.y ){\n\t\t\t\t\ttempshipSize = - shipSize;\n\t\t\t\t\n\t\t\t\t//prawy skrajny\t\n\t\t\t\t\tif(x-1 >= 0 && y + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation( x-1, y+tempshipSize ) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation( x, y+tempshipSize ) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 <sizeBoard && y+tempshipSize>=0){\n\t\t\t\t\t\topponentShootTable[x+1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+tempshipSize) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(y+1<sizeBoard ){\n\t\t\t\t\t\topponentShootTable[x][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+1) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+1<sizeBoard && x-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(y+1<sizeBoard && x+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(x-1 >= 0 && y + tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x-1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+tempshipSize) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y+tempshipSize) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+tempshipSize] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+tempshipSize) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(y-1 >= 0 ){\n\t\t\t\t\t\topponentShootTable[x][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x, y-1) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(y-1 >= 0 && x-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(y-1 >= 0 && x+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif( x-1 >= 0 ){\n\t\t\t\t\tif( hitLocation2.y < hitLocation3.y ){\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-1][y-i] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-1][y+i] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(x + 1 < sizeBoard){\n\t\t\t\t\tif(hitLocation2.y < hitLocation3.y){\n\t\t\t\t\t\tfor(int i=0; i<shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+1][y-i] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x+1][y+i] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+i) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\ttempshipSize = - shipSize;\n\t\t\t\t\n\t\t\t\t//dolny skrajny\t\n\t\t\t\t\tif(y-1 >= 0 && x + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y-1) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x + tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(y+1 < sizeBoard && x+tempshipSize >= 0){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y+1) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(x+1 < sizeBoard ){\n\t\t\t\t\t\topponentShootTable[x+1][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x+1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(x+1 < sizeBoard && y+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(y-1 >= 0 && x + tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y-1) );\t\t//lewy gorny skos\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y) );\t//lewy \n\t\t\t\t\t}\n\t\t\t\t\tif(y+1 < sizeBoard && x+tempshipSize < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x+ tempshipSize][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+ tempshipSize, y+1) );\t\t// lewy dolny skos\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(x-1 >= 0 ){\n\t\t\t\t\t\topponentShootTable[x-1][y] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y) );\t\n\t\t\t\t\t}\n\t\t\t\t\tif(x-1 >= 0 && y-1 >= 0){\n\t\t\t\t\t\topponentShootTable[x-1][y-1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y-1) );\n\t\t\t\t\t}\n\t\t\t\t\tif(x-1 >= 0 && y+1 < sizeBoard){\n\t\t\t\t\t\topponentShootTable[x-1][y+1] = true;\n\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-1, y+1) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(y-1 >= 0){\n\t\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x-i][y-1] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-i, y-1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+i][y-1] = true;\t\t\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+i, y-1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(y+1 < sizeBoard){\n\t\t\t\t\tif(hitLocation2.x < hitLocation3.x){\n\t\t\t\t\t\tfor(int i=0; i<shipSize;i++){\n\t\t\t\t\t\t\topponentShootTable[x-i][y+1] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x-i, y+1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tfor(int i=0; i < shipSize; i++){\n\t\t\t\t\t\t\topponentShootTable[x+i][y+1] = true;\n\t\t\t\t\t\t\tpossibleshoots.remove( new TabLocation(x+i, y+1) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void SpiritBomb()\r\n {\r\n\r\n\t \r\n\t\tLocation loc = new Location(userRow+1, userCol);\r\n\t\tLocation loc1 = new Location(userRow+1, userCol1);\r\n\t\tLocation loc2 = new Location(userRow+1, userCol2);\r\n\t\tLocation loc3 = new Location(userRow+1, userCol3);\r\n\t\t\r\n\t\tLocation loc4 = new Location(userRow, userCol);\r\n\t\tLocation loc5 = new Location(userRow, userCol1);\r\n\t\tLocation loc6 = new Location(userRow, userCol2);\r\n\t\tLocation loc7 = new Location(userRow, userCol3);\r\n\t\t\r\n\t\tLocation loc8 = new Location(userRow-1, userCol);\r\n\t\tLocation loc9 = new Location(userRow-1, userCol1);\r\n\t\tLocation loc10 = new Location(userRow-1, userCol2);\r\n\t\tLocation loc11 = new Location(userRow-1, userCol3);\r\n\t\t\r\n\t\tLocation loc12 = new Location(userRow-2, userCol);\r\n\t\tLocation loc13= new Location(userRow-2, userCol1);\r\n\t\tLocation loc14 = new Location(userRow-2, userCol2);\r\n\t\tLocation loc15 = new Location(userRow-2, userCol3);\r\n\r\n\t \r\n\r\n\r\n\r\n\t\t\r\n\t\tLocation base1 = new Location(userRow,0);\r\n\t\t\r\n\t\t\tgrid.setImage(base1, \"FSpiritHold.png\");\r\n\t\t\t\r\n\t\tfor(int a = 0; a<9; a++) {\r\n\t\tif(userCol>0 && userCol3 !=15 && userCol2!=15 && userCol1!=15 && userCol!=15 && userRow>0)\r\n\t\t{\r\n\t\r\n\t\t\t Location next101 = new Location(userRow+1,userCol);\r\n\t\t\t Location next102 = new Location(userRow+1,userCol1);\r\n\t\t\t Location next103 = new Location(userRow+1,userCol2);\r\n\t\t\t Location next104 = new Location(userRow+1,userCol3);\r\n\r\n\t\t\t\tLocation next201 = new Location(userRow,userCol);\r\n\t\t\t\tLocation next202 = new Location(userRow,userCol1);\r\n\t\t\t\tLocation next203 = new Location(userRow,userCol2);\r\n\t\t\t\tLocation next204 = new Location(userRow,userCol3);\r\n\t\t\t\t\r\n\t\t\t\tLocation next301 = new Location(userRow-1,userCol);\r\n\t\t\t\tLocation next302 = new Location(userRow-1,userCol1);\r\n\t\t\t\tLocation next303 = new Location(userRow-1,userCol2);\r\n\t\t\t\tLocation next304 = new Location(userRow-1,userCol3);\r\n\t\t\t\t\r\n\t\t\t Location next401 = new Location(userRow-2,userCol);\r\n\t\t\t Location next402 = new Location(userRow-2,userCol1);\r\n\t\t\t Location next403 = new Location(userRow-2,userCol2);\r\n\t\t\t Location next404 = new Location(userRow-2,userCol3);\r\n\t\t\t userCol+=1;\r\n\t\t\t userCol1+=1;\r\n\t\t\t\tuserCol2+=1;\r\n\t\t\t\tuserCol3+=1;\r\n\t\t\t grid.setImage(next101, \"SB401.png\");\r\n\t\t\t grid.setImage(loc1, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next102, \"SB402.png\");\r\n\t\t\t grid.setImage(loc2, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next103, \"SB403.png\");\r\n\t\t\t grid.setImage(loc2, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next104, \"SB404.png\");\r\n\t\t\t grid.setImage(loc3, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\tgrid.setImage(next201, \"SB301.png\");\r\n\t\t\t grid.setImage(loc4, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next202, \"SB302.png\");\r\n\t\t\t grid.setImage(loc5, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next203, \"SB303.png\");\r\n\t\t\t grid.setImage(loc6, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next204, \"SB304.png\");\r\n\t\t\t grid.setImage(loc7, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\tgrid.setImage(next301, \"SB201.png\");\r\n\t\t\t grid.setImage(loc8, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next302, \"SB202.png\");\r\n\t\t\t grid.setImage(loc9, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next303, \"SB203.png\");\r\n\t\t\t grid.setImage(loc10, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next304, \"SB204.png\");\r\n\t\t\t grid.setImage(loc11, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\tgrid.setImage(next401, \"SB101.png\");\r\n\t\t\t grid.setImage(loc12, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next402, \"SB102.png\");\r\n\t\t\t grid.setImage(loc13, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next403, \"SB103.png\");\r\n\t\t\t grid.setImage(loc14, null);\r\n\r\n\t\t\t \r\n\t\t\t\tgrid.setImage(next404, \"SB104.png\");\r\n\t\t\t grid.setImage(loc15, null);\r\n\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t \r\n\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n }\r\n }", "public void mouseExited(MouseEvent e) {\n\n\t\tif (shipsToPlace > 0) {\n\t\t\tint x = Integer.parseInt((\"\" + e.getComponent()).charAt(20) + \"\");\n\t\t\tint y = Integer.parseInt((\"\" + e.getComponent()).charAt(21) + \"\");\n\n\t\t\tchar isTileEnabled = (\"\" + e.getComponent()).charAt(22);\n\n\t\t\tif (isTileEnabled == 't')\n\t\t\t\tplayerBoard[x][y].setBackground(Color.darkGray);\n\n\t\t\tif (shipsToPlace == 3) {\n\n\t\t\t\tfor (int i = 1; i < 5; i++) {\n\n\t\t\t\t\tif ((x + i) < 10) {\n\n\t\t\t\t\t\tisTileEnabled = playerBoard[x + i][y].getName().charAt(2);\n\n\t\t\t\t\t\tif (isTileEnabled == 't')\n\t\t\t\t\t\t\tplayerBoard[x + i][y].setBackground(Color.darkGray);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tplayerBoard[x + i][y].setBackground(Color.lightGray);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else if (shipsToPlace == 2) {\n\t\t\t\tif (y + 1 < 10) {// first tile\n\n\t\t\t\t\tisTileEnabled = playerBoard[x][y + 1].getName().charAt(2);\n\n\t\t\t\t\tif (isTileEnabled == 't')\n\t\t\t\t\t\tplayerBoard[x][y + 1].setBackground(Color.darkGray);\n\t\t\t\t\telse\n\t\t\t\t\t\tplayerBoard[x][y + 1].setBackground(Color.lightGray);\n\n\t\t\t\t}\n\n\t\t\t\tif (y + 2 < 10) {// second tile\n\t\t\t\t\tisTileEnabled = playerBoard[x][y + 2].getName().charAt(2);\n\n\t\t\t\t\tif (isTileEnabled == 't')\n\t\t\t\t\t\tplayerBoard[x][y + 2].setBackground(Color.darkGray);\n\t\t\t\t\telse\n\t\t\t\t\t\tplayerBoard[x][y + 2].setBackground(Color.lightGray);\n\t\t\t\t}\n\n\t\t\t} else if (shipsToPlace == 1) {\n\n\t\t\t\tif (y + 1 < 10) {// first tile\n\n\t\t\t\t\tisTileEnabled = playerBoard[x][y + 1].getName().charAt(2);\n\n\t\t\t\t\tif (isTileEnabled == 't')\n\t\t\t\t\t\tplayerBoard[x][y + 1].setBackground(Color.darkGray);\n\t\t\t\t\telse\n\t\t\t\t\t\tplayerBoard[x][y + 1].setBackground(Color.lightGray);\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void moveLeft() {\n this.accelerateXL();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(141);\n this.setLoopCells(true);\n }", "public void adjustRight() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].x = tiles[x][y].x + 4;\n backGroundTiles[x][y].x = backGroundTiles[x][y].x + 4;\n grassTiles[x][y].x = grassTiles[x][y].x + 4;\n }\n\n }", "public boolean moveLeft() {\n\t\tif (check(col-1, row)) {\n\t\t\tHiVolts.board.squares[row][col] = 0;\n\t\t\tcol = col - 1;\n\t\t\tHiVolts.board.squares[row][col] = 2;\n\t\t\tsuper.moveLeft();\n\t\t}\n\t\treturn true;\n\t}", "@Test\n\tpublic void topLeftHorizWhiteCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(24,2);\n\t\td.set(1,3);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(3);\n\t\tassertTrue(1==test_arr.get(0).getX() && 0==test_arr.get(0).getY());\n\t}", "public void displayTiles() {\n System.out.println(\"\\n Tiles of this game : \");\n String phrase = \"No army deployed on this tile !\";\n for (Tile tile : this.board.getAllTiles()) {\n if (!tile.isEmpty()) {\n System.out.print(\" { Type tile : \" + tile.getCharacter() + \", Position Y : \" + tile.getPosX() +\", Position X : \" + tile.getPosY() + \", State : Occuped, Player : \" + tile.getPlayer().getName() + \", Army : \" + tile.getPersonnage().getName() + \", Army size : \" +((Army) tile.getPersonnage()).getArmySize() + \"}\\n\");\n } else {\n System.out.print(\" { Type tile : \" + tile.getCharacter() +\", Position Y : \" + tile.getPosX() +\", Position X : \" + tile.getPosY()+ \", State : \"+ phrase + \" }\\n\");\n }\n }\n }", "public FireTile() {\n super();\n setUtility(5);\n }", "public void wipe(){\n\t \tg2d.setColor(Color.yellow);\n g2d.fillRect(0,0, width, height);\n\t\t\n\n\t }", "public void createMinimap() {\n if (gameField.getFields().size() == 1024) {\n rootSize = 32;\n blockSize = 8;\n } else { //if size == 64^2 == 4096\n rootSize = 64;\n blockSize = 4;\n }\n int magnification = gameFieldController.getMagnification();\n if (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene() != null) {\n positionBoxSizeX = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getWidth() / (rootSize * magnification));\n\n positionBoxSizeY = blockSize *\n (AdvancedWarsApplication.getInstance().getGameScreenCon().base.getScene().getHeight() / (rootSize * magnification));\n } else {\n //for offline test\n positionBoxSizeX = (blockSize * 1920) / (rootSize * magnification);\n positionBoxSizeY = (blockSize * 1080) / (rootSize * magnification);\n }\n\n for (int i = 0; i < rootSize; ++i) {\n for (int j = 0; j < rootSize; ++j) {\n Field currentField = gameField.getFields().get(i * rootSize + j);\n Rectangle rectangle = new Rectangle(blockSize, blockSize);\n if (!currentField.getType().equals(\"Grass\")) {\n if (currentField.getType().equals(\"Water\")) {\n rectangle.setFill(Color.rgb(11, 89, 139));\n } else if (currentField.getType().equals(\"Forest\")) {\n rectangle.setFill(Color.rgb(38, 106, 0));\n } else { //if currentField equals Mountain\n rectangle.setFill(Color.rgb(95, 111, 54));\n }\n rectangle.relocate((i * blockSize) + 1, (j * blockSize) + 1);\n drawPane.getChildren().add(rectangle);\n }\n }\n }\n Rectangle rect = new Rectangle(positionBoxSizeX, positionBoxSizeY);\n Rectangle clip = new Rectangle(1, 1, positionBoxSizeX - 2, positionBoxSizeY - 2);\n positionBox = Shape.subtract(rect, clip);\n positionBox.setFill(Color.WHITE);\n drawPane.getChildren().add(positionBox);\n isCreated = true;\n }", "@Override\n public void tileOnTop(CoverFlowOpenGL view, int position) {\n }", "public void left(){\n\t\tmoveX=-1;\n\t\tmoveY=0;\n\t}" ]
[ "0.70391923", "0.6627267", "0.66013354", "0.65928584", "0.6460928", "0.636607", "0.63467014", "0.6337472", "0.63328516", "0.6276297", "0.62714154", "0.6269845", "0.6238282", "0.61979777", "0.6197791", "0.6176761", "0.6176328", "0.6175945", "0.61399573", "0.61169827", "0.610751", "0.6084143", "0.6066217", "0.6051498", "0.6025078", "0.6018308", "0.5998948", "0.5993788", "0.5981437", "0.59798276", "0.5974777", "0.5963888", "0.59607893", "0.59577835", "0.59556085", "0.5955409", "0.5953956", "0.5952381", "0.59477806", "0.59335625", "0.5930161", "0.59264845", "0.59185416", "0.5916925", "0.5914556", "0.5911871", "0.59113103", "0.58971703", "0.5877348", "0.5867648", "0.5859443", "0.5856727", "0.5846422", "0.5807795", "0.58067185", "0.58049077", "0.580096", "0.57941836", "0.5787075", "0.57865536", "0.57809895", "0.57772124", "0.5768863", "0.57674426", "0.5765644", "0.5761574", "0.57581407", "0.57552665", "0.5742957", "0.5737265", "0.5736364", "0.57350576", "0.57346994", "0.5728344", "0.57096714", "0.57070386", "0.57052225", "0.5703505", "0.5701966", "0.5698765", "0.56972283", "0.56964093", "0.56901795", "0.56875324", "0.5687322", "0.567659", "0.56730175", "0.56708664", "0.5670021", "0.56631935", "0.5652604", "0.56518954", "0.5651718", "0.5651289", "0.5648051", "0.564687", "0.5646655", "0.5645291", "0.5643723", "0.5641113", "0.56393534" ]
0.0
-1
Moves the blank tile right
public static void goRight(Node parent) { int[][] tempArray = new int[3][3]; int blankPositionRow = parent.getblankPositionRow(); int blankPositionCol = parent.getblankPositionCol(); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { tempArray[i][j] = parent.stateSpace[i][j]; } } if (blankPositionCol != 2) { int temp = tempArray[blankPositionRow][blankPositionCol + 1]; tempArray[blankPositionRow][blankPositionCol + 1] = 0; tempArray[blankPositionRow][blankPositionCol] = temp; Node node = new Node(tempArray, finalState, parent); choiceOfNodes.add(node); nodesGenerated++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void moveRight() {\n\t\tif (x1 < 24 && x2 < 24 && x3 < 24 && x4 < 24) {\n\t\t\tclearPiece();\n\t\t\tx1 += 1;\n\t\t\tx2 += 1;\n\t\t\tx3 += 1;\n\t\t\tx4 += 1;\n\t\t\tsetPiece();\n\t\t\trepaint();\n\t\t}\n\t}", "public void right(){\n\t\tmoveX=1;\n\t\tmoveY=0;\n\t}", "private void swapTileWithBlank(TileView tv) {\n\t\tTile tile = tv.getCurrentTile();\n\n\t\tTileView theBlankTileView = tileViews\n\t\t\t\t.get(computeLocationValue(theBlankTile.getCurrentLocation()));\n\n//\t\tLog.v(\"log_tag\", \"Tile Row= \" + tile.getCurrentLocation().getRow()\n//\t\t\t\t+ \" Tile Column= \" + tile.getCurrentLocation().getColumn());\n//\t\tLog.v(\"log_tag\", \"theBlankTile Row= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getRow() + \" theBlankTile Column= \"\n//\t\t\t\t+ theBlankTile.getCurrentLocation().getColumn());\n\n\t\tif (tile.getCurrentLocation().isAdjacent(\n\t\t\t\ttheBlankTile.getCurrentLocation())) {\n\n\t\t\t// Animate tile movement\n\t\t\tif (tile.getCurrentLocation().getColumn() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// LEFT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.left_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getColumn() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getColumn()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// RIGHT\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.right_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() < theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// UP\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.up_animation));\n\n\t\t\t} else if (tile.getCurrentLocation().getRow() > theBlankTile\n\t\t\t\t\t.getCurrentLocation().getRow()) {\n\t\t\t\ttheBlankTileView.bringToFront();\n\t\t\t\t// DOWN\n\t\t\t\ttheBlankTileView.startAnimation(AnimationUtils.loadAnimation(\n\t\t\t\t\t\tthis.context, R.anim.down_animation));\n\t\t\t}\n\t\t\ttheBlankTileView.setCurrentTile(tile);\n\t\t\ttv.setCurrentTile(theBlankTile);\n\n\t\t\tmoveCount++;\n\n\t\t\tmoveTextView.setText(\"Moves : \" + moveCount);\n\t\t}\n\n\t\tif (isCorrect()) {\n\t\t\t((Activity) context).showDialog(PuzzleActivity.DIALOG_COMPLETED_ID);\n\t\t}\n\n\t}", "public void moveTileBack()\n {\n if(!(activeTile-1 < 0) && activeTile > 0)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile-1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile-1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile-1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile-1].getEndColor());\n \n tiles[activeTile-1].setTileLevel(tiles[activeTile-1].getTileLevel()+1);\n tiles[activeTile] = tiles[activeTile-1];\n previews[activeTile] = previews[activeTile-1];\n previewGradients[activeTile] = previewGradients[activeTile-1];\n previewHover[activeTile] = previewHover[activeTile-1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()-1);\n tiles[activeTile-1] = tmpTile;\n tiles[activeTile-1].setStartColor(tiles[activeTile-1].getStartColor());\n previews[activeTile-1] = tmpPreview;\n previewGradients[activeTile-1] = tmpPreviewGradients;\n previewHover[activeTile-1] = tmpPreviewHover;\n \n activeTile -= 1;\n createPreviewGradients();\n }\n }", "public void moveRight() {\n this.position.addColumn(1);\n }", "public void moveRight() {\r\n\t\tif (x < space.getSize() - 1) x++; \r\n\t}", "public void moveRight() {\n\t\t\n\t}", "public void moveRight()\n\t{\n\t\tx = x + STEP_SIZE;\n\t}", "public void moveRight() {\n locX = locX + 1;\n }", "public void adjustRight() {\n\n for (int y = 0; y < MAP_HEIGHT; y++)\n for (int x = 0; x < MAP_WIDTH; x++) {\n tiles[x][y].x = tiles[x][y].x + 4;\n backGroundTiles[x][y].x = backGroundTiles[x][y].x + 4;\n grassTiles[x][y].x = grassTiles[x][y].x + 4;\n }\n\n }", "public void right () {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return;\n Location loc = getLocation();\n Location next = loc.getAdjacentLocation(Location.EAST);\n if (canMove(next)) {\n moveTo(next);\n }\n }", "private void moveTile()\n {\n int[] moveIndices = null;\n \n int sourceRow = moveIndices[0];\n int sourceCol = moveIndices[1];\n int destRow = moveIndices[2] - 1;\n int destCol = moveIndices[3];\n \n if (sourceRow == 0) \n {\n try\n {\n game.playTileFromHand(sourceCol, destRow, destCol);\n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n else\n {\n sourceRow--;\n try\n {\n game.moveTileInBoard(sourceRow, sourceCol, destRow, destCol); \n }\n catch(ArrayIndexOutOfBoundsException ex)\n {\n // TODO: ConsoleUtils.message(\"Unable to complete your play, wrong indices!\");\n }\n }\n }", "public void moveRight()\n {\n if (!this.search_zone.isRightBorder(this.x_position))\n {\n this.x_position = (this.x_position + 1);\n }\n }", "public void moveRight() {\r\n\t\r\n\t\tint rightSteps=10;\r\n\t\t\ttopX+= rightSteps;\r\n\t}", "private boolean slideRight()\n {\n if (blankCol == 0) {\n return false;\n }\n board[blankRow][blankCol] = board[blankRow][blankCol - 1];\n board[blankRow][blankCol - 1] = 0;\n blankCol -= 1;\n return true;\n }", "public void moveRight()\n\t{\n\t\tcol++;\n\t}", "public void moveRight()\n\t{\n\t\tmoveRight = true;\n\t}", "void moveRight();", "public void moveRight() {\n if (rec.getUpperLeft().getX() + rec.getWidth() + 5 > rightBorder) {\n rec.getUpperLeft().setX(rightBorder - rec.getWidth());\n } else {\n rec.getUpperLeft().setX(rec.getUpperLeft().getX() + 5);\n }\n }", "public void moveRight() {\n this.accelerateXR();\n this.moveX(this.getxSpeed());\n this.setPicX(0);\n this.setPicY(74);\n this.setLoopCells(true);\n }", "public void moveShiftRight();", "protected void right() {\n move(positionX + 1, positionY);\n orientation = 0;\n }", "public void moveRight() {\n\t\tsetPosX(getPosX() + steps);\n\t}", "public boolean moveRight() {\r\n\t\tif (this.x >= 1050 == true) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tthis.x += 5;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public void reset( )\n\t{\n\t\tint count = 1;\n\t\tthis.setMoves( 0 );\n\t\tfor( int i = 0; i < this.getSize(); i++ )\n\t\t{\n\t\t\tfor( int j = 0; j < this.getWidth(); j++ )\n\t\t\t{\n\t\t\t\tthis.setTile( count++, i, j );\n\t\t\t\tif( i == getSize( ) - 1 && j == getWidth( ) - 1 ) {\n\t\t\t\t\tthis.setTile( -1, i, j );\n\t\t\t\t\tlocationX = i;\n\t\t\t\t\tlocationY = j;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public void handleRightWall(){\n for(int i = 0; i < 15; i ++){\n if(i % 2 == 1 ){\n maze[18][i] = VISIBLESPACE;\n }\n }\n }", "public void moveTileForward()\n {\n if(!(activeTile+1 > tiles.length-1) && tiles[activeTile+1] != null)\n {\n Tile tmpTile = tiles[activeTile];\n PImage tmpPreview = previews[activeTile];\n PImage tmpPreviewGradients = previewGradients[activeTile];\n boolean tmpPreviewHover = previewHover[activeTile];\n \n tiles[activeTile+1].setStartColor(tmpTile.getStartColor());\n tiles[activeTile+1].setEndColor(tmpTile.getEndColor());\n tmpTile.setStartColor(tiles[activeTile+1].getStartColor());\n tmpTile.setEndColor(tiles[activeTile+1].getEndColor());\n \n tiles[activeTile+1].setTileLevel(tiles[activeTile+1].getTileLevel()-1);\n tiles[activeTile] = tiles[activeTile+1];\n previews[activeTile] = previews[activeTile+1];\n previewGradients[activeTile] = previewGradients[activeTile+1];\n previewHover[activeTile] = previewHover[activeTile+1];\n \n \n tmpTile.setTileLevel(tmpTile.getTileLevel()+1);\n tiles[activeTile+1] = tmpTile;\n tiles[activeTile+1].setStartColor(tiles[activeTile+1].getStartColor());\n previews[activeTile+1] = tmpPreview;\n previewGradients[activeTile+1] = tmpPreviewGradients;\n previewHover[activeTile+1] = tmpPreviewHover;\n \n activeTile += 1;\n createPreviewGradients();\n }\n }", "public void rotateRight() {\n// tileLogic = getRotateRight();\n tileLogic = getRotateLeft();\n// rotateRightTex();\n rotateLeftTex();\n }", "void move(Tile t);", "public void moveTileRight(float delta) {\n if (x < destinationX - COMBAT_MOVEMENT_SPEED * delta) speedX = COMBAT_MOVEMENT_SPEED;\n else {\n speedX = (destinationX - x) / delta;\n isMoving = false;\n isMovingRight = false;\n }\n direction = Direction.RIGHT;\n }", "public void moveRight() {\n if (xcoor <= Game.widthOfGameBoard - movingSpeed) {\n xcoor = xcoor + movingSpeed * 2;\n }\n }", "private void playerMoveRight()\n {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(false);\n this.setCurrentX(getCurrentX() + 1);\n if (this.getCurrentX() < 11) {\n if (!nextIsWall()) {\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n } else {\n this.setCurrentX(this.getCurrentX() - 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n }\n } else {\n this.setCurrentX(this.getCurrentX() - 1);\n this.getCurrentLevel().getInLevelLocation()[this.getCurrentX()][this.getCurrentY()].setHasPlayer(true);\n }\n }", "private void wrap() {\n if (myCurrentLeftX % (Grass.TILE_WIDTH * Grass.CYCLE) == 0) {\n if (myLeft) {\n myCowboy.move(Grass.TILE_WIDTH * Grass.CYCLE, 0);\n myCurrentLeftX += (Grass.TILE_WIDTH * Grass.CYCLE);\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i]\n .move(Grass.TILE_WIDTH * Grass.CYCLE, 0);\n }\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].move(Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n } else {\n myCowboy.move(-(Grass.TILE_WIDTH * Grass.CYCLE), 0);\n myCurrentLeftX -= (Grass.TILE_WIDTH * Grass.CYCLE);\n for (int i = 0; i < myLeftTumbleweeds.length; i++) {\n myLeftTumbleweeds[i].move(-Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n for (int i = 0; i < myRightTumbleweeds.length; i++) {\n myRightTumbleweeds[i].move(-Grass.TILE_WIDTH * Grass.CYCLE,\n 0);\n }\n }\n }\n }", "@Test\n void RookMoveRight() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 2, 2, 1);\n\n board.getBoard()[2][2] = rook;\n\n board.movePiece(rook, 4, 2);\n\n Assertions.assertEquals(rook, board.getBoard()[4][2]);\n Assertions.assertNull(board.getBoard()[2][2]);\n }", "public synchronized void moveDown(){\n if (!this.isAtBottom()){\n for (int j = 1; j < 25; j++){\n for (int i = 1; i < 13; i++){\n if (this.movable[i][j]){\n this.map[i][j - 1] = this.map[i][j];\n this.movable[i][j - 1] = this.movable[i][j];\n this.colors[i][j - 1] = this.colors[i][j];\n\n this.map[i][j] = false;\n this.movable[i][j] = false;\n this.colors[i][j] = null;\n\n }\n }\n }\n }\n this.piecePositionY--;\n repaint();\n }", "public void moveLeft()\n\t{\n\t\tcol--;\n\t}", "private void turnRight() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n switch (direction) {\n case EAST:\n direction = Position.Direction.SOUTH;\n break;\n case WEST:\n direction = Position.Direction.NORTH;\n break;\n case NORTH:\n direction = Position.Direction.EAST;\n break;\n case SOUTH:\n direction = Position.Direction.WEST;\n break;\n }\n\n currentPosition.setDirection(direction);\n }", "public void moveRight() {\r\n speedX = 6;\r\n Texture r1 = changeImg (\"./graphics/characters/player/rightWalk1.png\");\r\n img = new Sprite (r1);\r\n if (centerX > startScrolling)\r\n bg.setBackX (bg.getBackX () + 6);\r\n bg.update ();\r\n }", "void moveRight() {\n\t\tsetX(x+1);\r\n\t\tdx=1;\r\n\t\tdy=0;\r\n\t}", "void moveRight() {\n\t\ttry {\n\t\t\twhile(x + 60 < getWidth()) {\n\t\t\t\tx += 10;\n\t\t\t\twin.repaint();\n\t\t\t\tThread.sleep(100);\n\t\t\t}\n\t\t} catch(InterruptedException e) {\n\t\t}\n\t}", "public void MoveTileSelf(Integer position){\n /**\n * if opponent activated confusion - move to a random tile\n */\n if(confused){\n //random tile for confusion\n Integer tile;\n do{\n Integer tile1 = returnRandom(getNthDigit(position,1)-1,getNthDigit(position,1)+2);\n Integer tile2 = returnRandom(getNthDigit(position,2)-1,getNthDigit(position,2)+2); // between 0 and 2\n tile = Integer.parseInt(tile1.toString() + tile2.toString());\n }while (tile==myTile || tile==opponentTile || getNthDigit(tile,1)<1 || getNthDigit(tile,1)>7 || getNthDigit(tile,2)<1 || getNthDigit(tile,2)>7);\n position = tile;\n showTimedAlertDialog(\"You are confused!\", \"moving at a random direction\", 5);\n confused = false;\n }\n\n /**\n * send message to opponent\n */\n MultiplayerManager.getInstance().SendMessage(position.toString());\n\n if(!is_debug){\n HandleLejos(myTile, position);\n }\n\n ImageView player1 = findImageButton(\"square_\"+position.toString());\n ImageView player1_old = findImageButton(\"square_\"+myTile.toString());\n player1.setImageDrawable(getResources().getDrawable(R.drawable.tank_blue));\n player1_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n myTile = position;\n myTurn = false;\n turnNumber = turnNumber + 1;\n }", "protected void left() {\n move(positionX - 1, positionY);\n orientation = BattleGrid.RIGHT_ANGLE * 2;\n }", "public void right() {\n if (x + movementSpeed < 450) {\r\n x = x + movementSpeed;\r\n }\r\n }", "private void right() {\n lastMovementOp = Op.RIGHT;\n rotate(TURNING_ANGLE);\n }", "public void rightPressed()\r\n {\r\n worldPanel.newMapPos(zoom,0);\r\n miniMap.newMapPos(1,0);\r\n }", "private Coordinate tileCoordinateForTileRight(GuiTile tile) {\n\t\treturn new Coordinate(tile.getScreenBottomX() / GuiTile.getScale() + GuiTile.getHalfWidth() * 2 + tileSepWidth(),\n\t\t\t\ttile.getScreenBottomY() / GuiTile.getScale());\n\t}", "public void compactRight() {\n\t// Iteramos a través del tablero partiendo de la primera fila\n\t// y última columna. Si esta contiene un 0 y la columna anterior\n\t// de la misma fila es distinta de 0, el valor se intercambia.\n\t// El proceso se repite hasta que todas las posiciones susceptibles\n\t// al cambio se hayan comprobado.\n\n\tfor (int i = 0; i < board.length; i++) {\n\t for (int j = board.length - 1; j > 0; j--) {\n\t\tif (board[i][j] == EMPTY && board[i][j - 1] != EMPTY) {\n\t\t board[i][j] = board[i][j - 1];\n\t\t board[i][j - 1] = EMPTY;\n\t\t compactRight();\n\t\t}\n\t }\n\t}\n }", "public void moveRight(){\n myRectangle.setX(myRectangle.getX() + PADDLE_SPEED);\n }", "protected void down() {\n move(positionX, positionY + 1);\n orientation = BattleGrid.RIGHT_ANGLE;\n }", "public void moveRight()\n {\n if (xPos == xBound)\n {\n movementY = 0;\n movementX = 0;\n }\n\n // Set the movement factor - positive X because we are moving RIGHT! \n movementX = 0.5;\n movementY = 0;\n }", "@Override\n\tpublic void movment() {\n\t\tif(ghost.shot && fired) {\n\t\t\tif(direction == RIGHT)\n\t\t\t\tmove(RIGHT);\n\t\t\telse if(direction == LEFT)\n\t\t\t\tmove(LEFT);\n\t\t\telse if(direction == UP)\n\t\t\t\tmove(UP);\n\t\t\telse if(direction == DOWN)\n\t\t\t\tmove(DOWN);\n\t\t}\n\t}", "public void moveRight() {\n Coordinate rightCoord = new Coordinate(getX() + 1, getY());\n handleMove(rightCoord, InteractionHandler.RIGHT);\n }", "static public Boolean slideTile(int row, int col, FloorTile newTile) {\r\n FloorTile oldTile1 = newTile;\r\n FloorTile oldTile2;\r\n boolean isNotFixed = true;\r\n if(row == 0 || row == board.length-1){//determine that the columns will be changed\r\n for (int i = 0; i < board.length; i++) {//check if there are any fixed or frozen tiles in the col\r\n if(board[i][col].isFixedTile() || board[i][col].isFrozen){\r\n isNotFixed = false;\r\n }\r\n }\r\n //move the tiles\r\n if(row == 0 && isNotFixed) {\r\n\r\n for(int i = 0; i < board.length; i++) {\r\n oldTile2 = board[i][col];\r\n board[i][col] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n }else if(isNotFixed) {\r\n\r\n for(int i = board.length-1; i >= 0; i--) {\r\n oldTile2 = board[i][col];\r\n board[i][col] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n }else {\r\n return false;\r\n }\r\n }else {//determine that the rows will be changed\r\n\r\n for (int i = 0; i < board[row].length; i++) {\r\n if(board[row][i].isFixedTile() || board[i][col].isFrozen){\r\n isNotFixed = false;\r\n }\r\n }\r\n\r\n if(col == 0 && isNotFixed) {\r\n for(int i = 0; i < board[row].length; i++) {\r\n oldTile2 = board[row][i];\r\n board[row][i] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n\r\n }else if(isNotFixed) {\r\n for(int i = board[row].length-1; i >= 0; i--) {\r\n oldTile2 = board[row][i];\r\n board[row][i] = oldTile1;\r\n oldTile1 = oldTile2;\r\n }\r\n }else {\r\n return false;\r\n }\r\n\r\n }\r\n //if a player was standing on that tile it will be relocated to a new tile\r\n for(int i = 0; i < numOfPlayers; i++) {\r\n if(oldTile1 == players[i].getPosition()) {\r\n players[i].updateGetBackTiles(players[i].getPosition());\r\n players[i].setPosition(newTile);\r\n }\r\n }\r\n oldTile1.isFrozen = false;\r\n oldTile1.isOnFire = false;\r\n oldTile1.isFrozenForTheNextNTurns = 0;\r\n oldTile1.isOnFireForTheNextNTurns = 0;\r\n silkBag.add(oldTile1);\r\n return true;\r\n }", "public void moveRight() {\n if (!this.state.equals(\"onRightWall\")) {\n this.dir = 1;\n this.xTargetSpeed = this.X_MAX_SPEED;\n }\n }", "public void turnRight() {\r\n setDirection( modulo( myDirection+1, 4 ) );\r\n }", "public void goRight() {\n\t\tx += dx;\n\t\tbgBack.setDx(false);\n\t\tbgBack.move();\n\t\tif(x > Game.WIDTH - 200) {\n\t\t\tif(!bgBack.getReachEnd()) {\n\t\t\t\tx = Game.WIDTH - 200;\n\t\t\t\tbgFront.setDx(false);\n\t\t\t\tbgFront.move();\n\t\t\t}\n\t\t\telse if(x > Game.WIDTH - 50) {\n\t\t\t\tx = Game.WIDTH - 50;\n\t\t\t}\n\t\t}\n\t}", "private void goAcrossWall() {\n\t\t// TODO Auto-generated method stub\n\t\tthis.move();\n\t\tthis.turnRight();\n\t}", "public void horizontal_right_wp(int x, int y) {\n if (x == 7)\n return;\n\n if (chessBoard[x + 1][y] == status.BLACK) {\n // i e zoodtarin khaneye sefid ke mibinad\n int i_white_cell = -1;\n boolean change = false;\n for (int k = x + 1; k <= 7; k++) {\n if (chessBoard[k][y] == status.EMPTY)\n break;\n if (chessBoard[k][y] == status.WHITE) {\n i_white_cell = k;\n change = true;\n break;\n }\n }\n if (change) {\n for (int k = x + 1; k < i_white_cell; k++) {\n chessBoard[k][y] = status.WHITE;\n }\n }\n }\n }", "private void shiftLeftToRight(int colNum, int rowNum, FloorTile tile, int rotation) {\n shiftTilesLeftToRight(colNum, rowNum, tile, rotation);\n shiftPlayerPiecesLeftToRight(rowNum);\n }", "public void undoLastMove()\n {\n if (inProgress() && stackTiles.size() > 1)\n {\n // TAKE THE TOP 2 TILES\n MahjongSolitaireTile topTile = stackTiles.remove(stackTiles.size()-1);\n MahjongSolitaireTile nextToTopTile = stackTiles.remove(stackTiles.size() - 1);\n \n // SET THEIR DESTINATIONS\n float boundaryLeft = miniGame.getBoundaryLeft();\n float boundaryTop = miniGame.getBoundaryTop();\n \n // FIRST TILE 1\n int col = topTile.getGridColumn();\n int row = topTile.getGridRow();\n int z = tileGrid[col][row].size();\n float targetX = this.calculateTileXInGrid(col, z);\n float targetY = this.calculateTileYInGrid(row, z);\n topTile.setTarget(targetX, targetY);\n movingTiles.add(topTile);\n topTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(topTile);\n \n // AND THEN TILE 2\n col = nextToTopTile.getGridColumn();\n row = nextToTopTile.getGridRow();\n z = tileGrid[col][row].size();\n targetX = this.calculateTileXInGrid(col, z);\n targetY = this.calculateTileYInGrid(row, z);\n nextToTopTile.setTarget(targetX, targetY);\n movingTiles.add(nextToTopTile);\n nextToTopTile.startMovingToTarget(MAX_TILE_VELOCITY);\n tileGrid[col][row].add(nextToTopTile);\n \n // PLAY THE AUDIO CUE\n miniGame.getAudio().play(MahjongSolitairePropertyType.UNDO_AUDIO_CUE.toString(), false); \n }\n }", "public void dropNewTile() {\n ArrayList<Integer> emptyTilesX= new ArrayList<Integer>();\n ArrayList<Integer> emptyTilesY= new ArrayList<Integer>();\n\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n emptyTilesX.add(x);\n emptyTilesY.add(y);\n }\n }\n }\n\n int randTile= rand.nextInt(emptyTilesX.size());\n int percent= rand.nextInt(20);\n int newTileNumber= 2;\n if(percent==0 || percent==1 || percent==2) {\n newTileNumber= 4;\n }\n \n int dropX= emptyTilesX.get(randTile);\n int dropY= emptyTilesY.get(randTile);\n board[dropX][dropY]= newTileNumber;\n }", "public void removeTile(){\n\t\toccupied = false;\n\t\tcurrentTile = null;\n\t}", "private void moveToWall() {\n\t\t// TODO Auto-generated method stub\n\t\t// if front is clear then keep moving\n\t\twhile (this.frontIsClear()) {\n\t\t\tthis.move();\n\t\t}\n\t}", "@Override\r\n\tpublic String moveRight() {\n\t\tif((0<=x && x<50) && (0<=y && y<=10) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (40<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (0<=y && y<=50) && (0<=z && z<=10))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<10) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((0<=x && x<50) && (0<=y && y<=50) && (40<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\telse if((40<=x && x<50) && (0<=y && y<=50) && (0<=z && z<=50))\r\n\t\t{\r\n\t\t\tx++;\r\n\t\t}\r\n\t\treturn getFormatedCoordinates();\r\n\t}", "public void move()\r\n {\r\n if(goRight)\r\n {\r\n setLocation(getX()+10,getY()+3);\r\n if(contFall<8)\r\n contFall++;\r\n else contFall=0;\r\n switch(contFall)\r\n {\r\n case 0:setImage(im1);\r\n break;\r\n case 2:setImage(im2);\r\n break;\r\n case 4:setImage(im3);\r\n break;\r\n case 6:setImage(im4);\r\n break;\r\n }\r\n }else\r\n {\r\n setLocation(getX()-10,getY()+3);\r\n if(contFall<8)\r\n contFall++;\r\n else contFall=0;\r\n switch(contFall)\r\n {\r\n case 0:setImage(im1);\r\n break;\r\n case 2:setImage(im2);\r\n break;\r\n case 4:setImage(im3);\r\n break;\r\n case 6:setImage(im4);\r\n break;\r\n }\r\n }\r\n if(getY()>getWorld().getHeight())\r\n ((CaveWorld)(getWorld())).deleteAxe(this);\r\n }", "public void rotatePieceRight(){\r\n if (hasFalling()){\r\n FallingPiece test =falling.rotateRight();\r\n if (!moveIfNoConflict(test, falling))\r\n Kick(test, falling);\r\n if(isGhostActivated())\r\n \t\t\tgenerateGhost();\r\n }\r\n }", "public void addTileAtTheEnd(Tile tile);", "@Test\n void RookMoveOutOfBound() {\n Board board = new Board(8, 8);\n Piece rook = new Rook(board, 1, 5, 1);\n board.getBoard()[1][5] = rook;\n board.movePiece(rook, -1, 5);\n }", "@Test\n void RookMoveRightBlocked() {\n Board board = new Board(8, 8);\n Piece rook1 = new Rook(board, 2, 3, 1);\n Piece rook2 = new Rook(board, 6, 3, 1);\n\n board.getBoard()[2][3] = rook1;\n board.getBoard()[6][3] = rook2;\n\n board.movePiece(rook1, 7, 3);\n\n Assertions.assertEquals(rook1, board.getBoard()[2][3]);\n Assertions.assertEquals(rook2, board.getBoard()[6][3]);\n Assertions.assertNull(board.getBoard()[7][3]);\n }", "private void shiftRightToLeft(int colNum, int rowNum, FloorTile tile, int rotation) {\n shiftTilesRightToLeft(colNum, rowNum, tile, rotation);\n shiftPlayerPiecesRightToLeft(rowNum);\n }", "private void cursorMoveRightest() {\n\t\td(\"Warn cursorMoveRightest() NOT implemented\");\r\n\t}", "@Override\n\tpublic void run() {\n\t\tmoveRight();\n\t}", "public void MoveTileOpponent(Integer position){\n Integer position_inverted = revertTile(position);\n String position_inverted_str = String.valueOf(position_inverted);\n\n ImageView player2 = findImageButton(\"square_\"+position_inverted_str);\n ImageView player2_old = findImageButton(\"square_\"+opponentTile.toString());\n player2.setImageDrawable(getResources().getDrawable(R.drawable.tank_red));\n player2_old.setImageDrawable(getResources().getDrawable(android.R.color.transparent));\n\n opponentTile = position_inverted;\n myTurn = true;\n canPlaceBomb = true;\n turnNumber = turnNumber + 1;\n\n if(ShotsCaller){\n placePowerup(null);\n }\n }", "@Override\n\tpublic boolean moveRight() {\n\t\tboolean rs = super.moveRight();\n\t\tif(rs == true){\n\t\t}\n\t\treturn rs;\n\t}", "@Override\n\tpublic void moveRight()\n\t{\n\t\tif (!isAtEnd()) left.push(right.pop());\n\t}", "public void moveRight() {\n for(int i=0;i<this.body.size();i++){\n// TranslateTransition translate = new TranslateTransition();\n// translate.setNode(this.body.get(i));\n// smoothSnake obj=new smoothSnake();\n// obj.swiftSnake(translate,i,this,1);\n this.body.get(i).setCenterX(this.body.get(i).getCenterX()+10);\n }\n\n \tsetScoreText();\n }", "public FallingPiece moveRight(){\r\n return new FallingPiece(coord.moveRight(), innerPiece);\r\n }", "private void moveOffScreen(GObject element) {\r\n\t\tif (element != null && (element.getX() > getWidth()|| element.getX() + element.getWidth() < 0)) {\r\n\t\t\tremove(element);\r\n\t\t\telement = null;\r\n\t\t}\r\n\t}", "public void move() {\n\t\tx+= -1;\n\t\tif (x < 0) {\n\t\t\tx = (processing.width - 1);\n\t\t}\n\t\ty+= 1;\n\t\tif (y > processing.height-1)\n\t\t\ty=0;\n\t}", "private void moveShipRight()\r\n\t\t{\r\n\t\t\t\tboolean moved = true;\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n\r\n //if firstPlayer move unit right\r\n if(currentPlayer == 1)\r\n {\r\n int currentPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n int temp1 = (currentPos + 1) % mapWidth;\r\n if(temp1 == 0)\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos - mapWidth + 1);\r\n }\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos + 1);\r\n }\r\n }//end if\r\n\r\n //if secondPlayer move unit right\r\n if(currentPlayer == 2)\r\n {\r\n int currentPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n int temp1 = (currentPos + 1) % mapWidth;\r\n if(temp1 == 0)\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos - mapWidth + 1);\r\n }//end if\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos + 1);\r\n }//end else\r\n }//end if\r\n\r\n //set up new player once unit has moved\r\n playerMoved(currentPlayer,currentUnit,moved);\r\n\r\n //set up new mapPosition if player moved\r\n if(moved == true)\r\n setMapPos();\r\n\t\t}", "private void moveRight(GObject bottom) {\r\n\t\tif(!facingEast) {\r\n\t\t\tdouble x = player.getX();\r\n\t\t\tdouble y = player.getY();\r\n\t\t\tremove(player);\r\n\t\t\tplayer = new GImage(\"PlayerEast.png\");\r\n\t\t\tplayer.scale(.75);\r\n\t\t\tadd(player, x, y);\r\n\t\t\tfacingEast = true;\r\n\t\t}\r\n\t\tif(player.getX() < getWidth() - player.getWidth() - 5 && bottom != null)\r\n\t\t\tplayer.move(PLAYER_X_MOTION, 0);\r\n\t}", "public GameGridBuilder right(int distance) {\n return putNewGameTileToMap(distance, () -> columnIndex++);\n }", "public void move()\r\n\t{\r\n\t\ty-=8;\r\n\t}", "private Coordinate tileCoordinateForTileRightAbove(GuiTile tile) {\n\t\treturn new Coordinate(tile.getScreenBottomX() / GuiTile.getScale() + GuiTile.getHalfWidth() + 0.05 * GuiTile.getHalfWidth(),\n\t\t\t\ttile.getScreenBottomY() / GuiTile.getScale() - tile.getMid1Height() - GuiTile.getBaseHeight() - 0.05 * GuiTile.getHalfWidth());\n\t}", "public boolean moveTile(int row, int col) {\n //first make sure the parameters are reasonable values\n if (row < 0 || row > 2 || col < 0 || col > 2) {\n return false;\n }\n int tile = getTiles()[row][col];\n if (tile == 0) {\n return false;\n }\n boolean inBounds;\n //check from one row to the left, to one row to the right\n for (int i = row - 1; i <= row + 1; i++) {\n //check from one column above, to one column below\n for (int j = col - 1; j <= col + 1; j++) {\n //use this to make sure our indices are reasonable\n inBounds = ((i >= 0 && i < 3) && (j >= 0 && j < 3));\n if (inBounds) {\n int otherTile = getTiles()[i][j];\n //can't move a cell to itself\n if (otherTile != tile) {\n //we want to ignore diagonals\n if (!(i != row && j != col)) {\n //if otherTile is blank, swap tile and otherTile\n if (otherTile == 0) {\n setTile(i, j, tile);\n setTile(row, col, otherTile);\n return true;\n }\n }\n }\n }\n }\n }\n //if we didn't return true yet, there was no adjacent blank tile\n return false;\n }", "public void left(){\n\t\tmoveX=-1;\n\t\tmoveY=0;\n\t}", "public void resetPlayerPosition() {\n\t\tthis.tilePositionX = this.STARTING_X;\n\t\tthis.tilePositionY = this.STARTING_Y;\n\t}", "public void shuffleTiles() {\n\t\tdo {\n\t\t\tCollections.shuffle(tiles);\n\n\t\t\t// Place the blank tile at the end\n\t\t\ttiles.remove(theBlankTile);\n\t\t\ttiles.add(theBlankTile);\n\n\t\t\tfor (short row = 0; row < gridSize; row++) {\n\t\t\t\tfor (short column = 0; column < gridSize; column++) {\n\t\t\t\t\ttileViews.get(row * gridSize + column).setCurrentTile(\n\t\t\t\t\t\t\ttiles.get(row * gridSize + column));\n\t\t\t\t}\n\t\t\t}\n\t\t} while (!isSolvable());\n\t\tmoveCount = 0;\n\n\t}", "public void rightPressed() {\n System.out.println(\"rightPressed()\");\n current.translate(0, 1);\n display.showBlocks();\n }", "private void shiftDownTiles(boolean isBorder, int shiftAmount){\n List<Tile> listOfTilesToUpdate = new ArrayList<Tile>();\n int floorRowIndex;\n if(isBorder){\n floorRowIndex=this.board.gridHeight-2;\n } else {\n floorRowIndex=this.board.gridHeight-1;\n }\n\n\n //update all existing tiles y coordinates with shifted y coordinates\n //only shift tile above the row that is being removed\n for(int rowIndex=0; rowIndex<this.rowToBeRemovedIndex; rowIndex++){\n for(int colIndex=0; colIndex<this.board.gridWidth; colIndex++){\n if(this.board.getTile(colIndex,rowIndex)!=null){ //tile exist at coordinates\n if(isBorder){\n if(rowIndex<=floorRowIndex){ //Stop at floor wall\n int leftWallIndex=0;\n int rightWallIndex=this.board.gridWidth-1;\n if(colIndex>leftWallIndex && colIndex<rightWallIndex){ //Ignore the the left and right walls\n Tile tile = this.board.getTile(colIndex,rowIndex);\n tile.rowIndex+=shiftAmount;\n tile.setCoordinates(tile.columnIndex,tile.rowIndex);\n listOfTilesToUpdate.add(tile);\n }\n }\n } else {\n Tile tile = this.board.getTile(colIndex,rowIndex);\n tile.rowIndex+=shiftAmount;\n tile.setCoordinates(tile.columnIndex,tile.rowIndex);\n listOfTilesToUpdate.add(tile);\n }\n }\n }\n }\n\n //Clear Board Grid. Set every element in 2D array to null.\n for(int rowIndex=0; rowIndex<this.board.gridHeight; rowIndex++){\n for(int colIndex=0; colIndex<this.board.gridWidth; colIndex++){\n Tile tile = this.board.getTile(colIndex, rowIndex);\n this.board.removeTile(tile);\n }\n }\n\n //add back tetris border\n if(this.includeTetrisBorder) {\n addBorder();\n }\n\n //Insert new tiles\n for(Tile newTile : listOfTilesToUpdate){\n this.board.placeTile(newTile);\n }\n }", "public void empty() {\n\t\tempty.setPosition(sprite.getX(),sprite.getY());\n\t\tsprite = empty;\n\t}", "private void moveBack(){\r\n\t\tturnAround();\r\n\t\tmove();\r\n\t}", "public void blank() {\r\n\t\trunning = false;// sets the simulation to stopped\r\n\t\tfor (int i = 0; i < TOTAL_TILES; i++)// loops through all tiles\r\n\t\t\tnodes[i] = new Node(new Point(i / WIDTH_TILES * SIZE_TILES, i % HEIGHT_TILES * SIZE_TILES), new ImageIcon(\"empty.png\").getImage(), false, \"empty\");// sets empty tile\r\n\t}", "public boolean moveRIGHT() {\r\n\t\tint i,j,k;\r\n\t\tboolean flag = false;\r\n\t\t\r\n\t\tfor(i = (rows_size-1) ; i >= 0 ; i--) {\r\n\t\t\tfor( j = (columns_size-1); j >= 0 ; j--) {\r\n\t\t\t\tif( !isEmpty(i,j) ) {\r\n\t\t\t\t\tfor(k = j; k < columns_size && isEmpty(i,k+1); k++);\r\n\t\t\t\t\t\tif(k == (columns_size-1)) {\t\t\t\t\t\r\n\t\t\t\t\t\t\tif(k != j) {\r\n\t\t\t\t\t\t\tgame[i][k] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif(game[i][j].isEqual(game[i][k+1]) && game[i][k+1].getFlag() == false) {\r\n\t\t\t\t\t\t\t\tgame[i][k+1].setValue(game[i][k+1].getValue()*2);\r\n\t\t\t\t\t\t\t\tgame[i][k+1].setFlag(true);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tscore += game[i][k+1].getValue();\r\n\t\t\t\t\t\t\t\t--takenCells;\r\n\t\t\t\t\t\t\t\t++freeCells;\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tif(k != j) {\r\n\t\t\t\t\t\t\t\tgame[i][k] = new Cell2048(game[i][j]);\r\n\t\t\t\t\t\t\t\tgame[i][j].setValue(0);\r\n\t\t\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\tFalseFlag();\t\r\n\treturn flag;\r\n\t}", "public void left () {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return;\n Location loc = getLocation();\n Location next = loc.getAdjacentLocation(Location.WEST);\n if (canMove(next)) {\n moveTo(next);\n }\n }", "public void moveDown()\n\t{\n\t\trow--;\n\t}", "public void clearGotoFloor();", "public void moveLeft() {\n locX = locX - 1;\n }", "public void move() {\n\n int move_position_x = 0;\n int move_postion_y = 0;\n Random random = new Random();\n do {\n\n move_position_x = 0;\n move_postion_y = 0;\n int direction = random.nextInt(6);\n switch (direction) {\n case 0:\n move_postion_y = -1;\n break;\n case 1:\n case 4:\n move_postion_y = 1;\n break;\n case 2:\n case 5:\n move_position_x = 1;\n break;\n case 3:\n move_position_x = -1;\n }\n } while ((this.positionX + move_position_x < 0) || (this.positionX + move_position_x >= size_of_map) || (\n this.positionY + move_postion_y < 0) || (this.positionY + move_postion_y >= size_of_map));\n this.positionX += move_position_x;\n this.positionY += move_postion_y;\n }", "private void moveTileItemToOther(int i) {\n if (this.mTiles.size() > this.mSpanCount * 2) {\n ((SystemUIStat) Dependency.get(SystemUIStat.class)).handleControlCenterEvent(new QuickTilesRemovedEvent(this.mTiles.get(i).spec));\n this.mQSControlCustomizer.addInTileAdapter(this.mTiles.get(i), false);\n this.mTiles.remove(i);\n notifyItemRemoved(i);\n saveSpecs(this.mHost, false);\n }\n }", "@Override\r\n\tpublic boolean move(Tile newLocation){\r\n\t\tif(!newLocation.checkOccupied() && newLocation.attribute != Tile.typeAttributes.get(TileType.WALL_TILE)){\r\n\t\t\tcurrentPosition.pullUnit();\r\n\t\t\tthis.currentPosition = newLocation;\r\n\t\t\tthis.currentPosition.pushUnit(this);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\tthis.act();\r\n\t\t}\r\n\t\treturn false;\r\n\t}" ]
[ "0.71626955", "0.69342405", "0.68911755", "0.6831598", "0.6826928", "0.67889816", "0.67556167", "0.6752876", "0.67453307", "0.6719653", "0.6716576", "0.6709885", "0.6631989", "0.6624716", "0.6607565", "0.653932", "0.6527393", "0.64867187", "0.64763033", "0.6463521", "0.64633816", "0.6449952", "0.643393", "0.6404182", "0.63804847", "0.6363573", "0.6347108", "0.63249695", "0.6306625", "0.6299778", "0.62719464", "0.6255658", "0.62522787", "0.6245317", "0.62442786", "0.622788", "0.6221325", "0.6199296", "0.6172451", "0.6148353", "0.6147553", "0.61405206", "0.61284137", "0.61278844", "0.6101718", "0.60927945", "0.6076068", "0.6074642", "0.6070227", "0.60693485", "0.6056387", "0.60550433", "0.6055033", "0.60529244", "0.6052111", "0.604913", "0.60475105", "0.6043722", "0.60349816", "0.60346884", "0.60308856", "0.60136646", "0.6012948", "0.601075", "0.600465", "0.6002999", "0.6002058", "0.5995916", "0.5995764", "0.59939224", "0.59873563", "0.5986033", "0.59716094", "0.59693605", "0.5940563", "0.5932689", "0.59296983", "0.5929279", "0.59283227", "0.5926095", "0.5923569", "0.5911481", "0.5906437", "0.5905629", "0.59007883", "0.5892525", "0.5886507", "0.5877938", "0.58771634", "0.58615327", "0.5860756", "0.58543485", "0.5837064", "0.58286995", "0.58238715", "0.58238024", "0.5821001", "0.5819993", "0.5818692", "0.58079904", "0.5801473" ]
0.0
-1
This method takes a JSON string, extracts the results array and parses the elements needed to create new Movie objects. It adds the new Movie objects to the given ArrayList container.
public static void parseMovieJSONResult( String jsonResult, ArrayList<Movie> moviesList) { Movie newMovie; try { // Create the root JSONObject from the JSON string. JSONObject jsonRootObject = new JSONObject(jsonResult); Log.d(TAG, ".parseMovieJSONResult(): object parsed from JSON: " + jsonRootObject.toString()); //Get the instance of JSONArray that contains JSONObjects JSONArray jsonArray = jsonRootObject.optJSONArray(RESULT_ARRAY); //Iterate the jsonArray and print the info of JSONObjects for(int i=0; i < jsonArray.length(); i++){ JSONObject jsonObject = jsonArray.getJSONObject(i); // parse all elements of JSON object we are interested in int id = Integer.parseInt(jsonObject.optString(ID).toString()); String posterPath = jsonObject.optString(POSTER_PATH).toString(); String plotSynopsis = jsonObject.optString(PLOT_SYNOPSIS).toString(); String title = jsonObject.optString(TITLE).toString(); float rating = Float.parseFloat(jsonObject.optString(RATING).toString()); String releaseDate = jsonObject.optString(RELEASE_DATE).toString(); newMovie = new Movie(id, title, posterPath, plotSynopsis, rating, releaseDate); moviesList.add(newMovie); } Log.d(TAG, ".parseMovieJSONResult(): JSON parsed to movie array of length" + moviesList.size()); } catch (JSONException e) { Log.e(TAG, ".parseMovieJSONResult(): JSON parsing failed: " + e.getMessage()); e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ArrayList<MovieData> getMovieDatafromJson(String jsonStr)\n throws JSONException {\n ArrayList<MovieData> movieDataArrayList = new ArrayList<>();\n\n // Parse through JSON response and find array with results\n JSONObject json = new JSONObject(jsonStr);\n JSONArray results = json.getJSONArray(\"results\");\n for (int i = 0; i < results.length(); ++i) {\n MovieData movieData = new MovieData();\n\n // Find all corresponding movie data and set into movieData\n JSONObject currentResult = results.getJSONObject(i);\n movieData.setPosterPath(currentResult.getString(\"poster_path\"));\n movieData.setOverview(currentResult.getString(\"overview\"));\n movieData.setReleaseDate(currentResult.getString(\"release_date\"));\n movieData.setOriginalTitle(currentResult.getString(\"original_title\"));\n movieData.setVoteAverage(currentResult.getDouble(\"vote_average\"));\n\n // Add into list\n movieDataArrayList.add(movieData);\n }\n return movieDataArrayList;\n }", "private void extractIDsfromJson(String s) {\n\n ArrayList<MovieAPI> movieAPIArrayList = new ArrayList<>();\n\n try {\n JSONObject jsonObject = new JSONObject(s);\n\n JSONArray jsonArray = jsonObject.getJSONArray(\"results\");\n\n\n for (int i = 0; i < jsonArray.length(); i++) {\n\n\n String m_id = jsonArray.getJSONObject(i).getString(\"id\");\n String mtitle = jsonArray.getJSONObject(i).getString(\"title\");\n String m_img = jsonArray.getJSONObject(i).getString(\"image\");\n\n MovieAPI movieAPI = new MovieAPI(m_id, mtitle, m_img);\n\n movieAPIArrayList.add(movieAPI);\n\n }\n\n updateListView(movieAPIArrayList);\n\n\n\n } catch (Exception e) {\n\n // update the UI to show failed results.\n //updateUI(\"JSON Retrieval Failed\");\n\n e.printStackTrace();\n\n }\n }", "public static List<Movie> parseMovieJson(String movieJsonStr) throws JSONException {\n // If the JSON String is empty or null, then return early\n if (TextUtils.isEmpty(movieJsonStr)) {\n return null;\n }\n\n // Create an empty List of movies to hold each movie object\n List<Movie> movies = new ArrayList<>();\n\n // Create a JSONObject from the JSON response string\n JSONObject movieBaseJson = new JSONObject(movieJsonStr);\n\n /** Check if there is an error */\n if (movieBaseJson.has(KEY_STATUS_CODE)) {\n int errorCode = movieBaseJson.getInt(KEY_STATUS_CODE);\n\n switch (errorCode) {\n case HttpURLConnection.HTTP_OK:\n break;\n case HttpURLConnection.HTTP_NOT_FOUND:\n /* Invalid id: The pre-requisite id is invalid or not found.*/\n return null;\n default:\n return null;\n }\n }\n\n // Get the JSON array representing the result\n JSONArray resultsArray = movieBaseJson.getJSONArray(KEY_RESULTS);\n for (int i = 0; i < resultsArray.length(); i++) {\n // Get a single movie at position i within the list of movies\n JSONObject currentMovie = resultsArray.getJSONObject(i);\n\n // For a given movie, if it contains the key called \"poster_path\", extract the value for\n // the key\n String posterPath = null;\n if (currentMovie.has(KEY_POSTER_PATH)) {\n // Extract the value for the key called \"poster_path\"\n posterPath = currentMovie.getString(KEY_POSTER_PATH);\n }\n // Combining base image url, image file size and poster path to get a final thumbnail url\n String thumbnailUrl = IMAGE_BASE_URL + IMAGE_FILE_SIZE + posterPath;\n\n // For a given movie, if it contains the key called \"original_title\", extract the value for\n // the key\n String originalTitle = null;\n if (currentMovie.has(KEY_ORIGINAL_TITLE)) {\n // Extract the value for the key called \"original_title\"\n originalTitle = currentMovie.getString(KEY_ORIGINAL_TITLE);\n }\n\n // For a given movie, if it contains the key called \"overview\", extract the value for the key\n String overView = null;\n if (currentMovie.has(KEY_OVERVIEW)) {\n // Extract the value for the key called \"overview\"\n overView = currentMovie.getString(KEY_OVERVIEW);\n }\n\n // For a given movie, if it contains the key called \"vote_average\", extract the value for the key\n double voteAverage = 0;\n if (currentMovie.has(KEY_VOTE_AVERAGE)) {\n // Extract the value for the key called \"vote_average\"\n voteAverage = currentMovie.getDouble(KEY_VOTE_AVERAGE);\n }\n\n int id = 0;\n if (currentMovie.has(KEY_ID)) {\n // Extract the value for the key called \"vote_average\"\n voteAverage = currentMovie.getDouble(KEY_ID);\n }\n\n // For a given movie, if it contains the key called \"release_date\", extract the value for the key\n String releaseDate = null;\n if (currentMovie.has(KEY_RELEASE_DATE)) {\n // Extract the value for the key called \"release_date\"\n releaseDate = currentMovie.getString(KEY_RELEASE_DATE);\n }\n\n // Create a new {@link Movie} object\n Movie movie = new Movie(id,originalTitle, thumbnailUrl, overView, voteAverage, releaseDate);\n // Add the new {@link Movie} to the list of movies\n movies.add(movie);\n }\n\n // Return the list of movies\n return movies;\n }", "public static List<Movie> extractMoviesData(String stringUrl) {\n String jsonResponse = fetchResponse(stringUrl);\n if (jsonResponse == null) {\n return null;\n }\n List<Movie> movies = new ArrayList<>();\n try {\n JSONObject baseJsonResponse = new JSONObject(jsonResponse);\n JSONArray resultsJSONArray = baseJsonResponse.getJSONArray(RESULTS_KEY);\n for (int i = 0; i < resultsJSONArray.length(); i++) {\n JSONObject currentMovie = resultsJSONArray.getJSONObject(i);\n String originalTitle = currentMovie.optString(ORIGINAL_TITLE_KEY);\n String posterPath = currentMovie.optString(POSTER_PATH_KEY);\n String overview = currentMovie.optString(OVERVIEW_KEY);\n double userRating = currentMovie.getDouble(VOTE_AVERAGE_KEY);\n String releaseDate = currentMovie.optString(RELEASE_DATE_KEY);\n int movieId = currentMovie.optInt(MOVIE_ID_KEY);\n Movie movie = new Movie(originalTitle, posterPath, overview, userRating, releaseDate, movieId);\n movies.add(movie);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return movies;\n }", "@Override\n public void onResponse(JSONArray response) {\n List<Movie> tmp = new ArrayList<>();\n for (int i = 0; i < response.length(); i++) {\n try {\n JSONObject mov = response.getJSONObject(i);\n// Toast.makeText(MainActivity.this, mov.toString(), Toast.LENGTH_LONG).show();\n tmp.add(new Movie(mov.getString(\"title\"), \"15_12_2018\", mov.getString(\"Image\")));\n Toast.makeText(MainActivity.this, \"added!\", Toast.LENGTH_SHORT).show();\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n// tmp.add(new MovieInfo(\"Harry Potter and test\", \"15_12_2018\", Arrays.asList(\"13:00\",\"16:00\",\"18:00\",\"21:00\",\"22:00\",\"23:00\")));\n populateMovieList(tmp, \"15_12_2018\"); //TODO: REMOVE\n }", "private static void parseAndSave(String json, Context context) throws JSONException {\n dao = DAO.getInstance(context);\n ArrayList<MovieItem> movies = new ArrayList<>();\n //Decide if JSONObject Or JSONArray;\n JSONArray moviesArray = new JSONArray(json);\n for (int i = 0; i < moviesArray.length(); i++) {\n JSONObject movieObject = moviesArray.getJSONObject(i);\n String title = movieObject.getString(\"title\");\n String image = movieObject.getString(\"image\");\n int releaseYear = movieObject.getInt(\"releaseYear\");\n double rating = movieObject.getDouble(\"rating\");\n JSONArray genresArray = movieObject.getJSONArray(\"genre\");\n\n String genre1 = null;\n String genre2 = null;\n String genre3 = null;\n if (genresArray.length() == 1) {\n genre1 = genresArray.getString(0);\n }\n if (genresArray.length() == 2) {\n genre1 = genresArray.getString(0);\n genre2 = genresArray.getString(1);\n ;\n }\n if (genresArray.length() == 3) {\n genre1 = genresArray.getString(0);\n genre2 = genresArray.getString(1);\n genre3 = genresArray.getString(2);\n }\n\n dao.addMovieItem(title, releaseYear, rating, genre1, genre2, genre3, image);\n }\n }", "private void parseResult(String results){\n try {\n\n JSONObject forecast = new JSONObject(results);\n JSONArray response = forecast.getJSONArray(\"results\");\n Movie movie;\n\n for (int i = 0; i < response.length(); i++){\n JSONObject result = response.getJSONObject(i);\n String poster = result.getString(\"poster_path\");\n String title = result.getString(\"original_title\");\n String overView = result.getString(\"overview\");\n Double vote_Average = result.getDouble(\"vote_average\");\n String release_date = result.getString(\"release_date\");\n movie = new Movie();\n movie.setPosterUrl(poster);\n movie.setTitle(title);\n movie.setOverView(overView);\n movie.setVote_Average(vote_Average);\n movie.setRelease_date(release_date);\n gridData.add(movie);\n }\n\n mAdapter = new MovieAdapter(this, 0, gridData);\n gridview.setAdapter(mAdapter);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "public static ArrayList<Movie> getArrayListFromJSON(JSONArray lstMovies){\n ArrayList<Movie> lista = null;\n try {\n if(lstMovies!=null && lstMovies.length() > 0 ){\n lista = new ArrayList<Movie>();\n }\n for (int i = 0; i < lstMovies.length(); i++) {\n JSONObject json_data = lstMovies.getJSONObject(i);\n Movie movie = new Movie();\n\n movie.setId(json_data.getInt(ID));\n movie.setTitulo(json_data.getString(TITLE));\n movie.setSinopsis(json_data.getString(OVERVIEW));\n movie.setImage(json_data.getString(POSTER_PATH));\n\n lista.add(movie);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return lista;\n }", "@Override\n\tpublic List<MovieDTO> getNaverList(String jsonString) {\n\t\t\n\t\tJSONParser jParser = new JSONParser();\n\t\t\n\t\ttry {\n\t\t\tJSONObject jObject = (JSONObject) jParser.parse(jsonString);\n\t\t\t\n\t\t\tJSONArray items = (JSONArray) jObject.get(\"items\");\n\t\t\t\n\t\t\tint nSize = items.size();\n\t\t\tList<MovieDTO> mvList = new ArrayList<MovieDTO>();\n\t\t\tfor(int i = 0 ; i < nSize; i++) {\n\t\t\t\tJSONObject item = (JSONObject) items.get(i);\n\t\t\t\t\n\t\t\t\tString title = item.get(\"title\").toString();\n\t\t\t\tString link = item.get(\"link\").toString();\n\t\t\t\tString image = item.get(\"image\").toString();\n\t\t\t\tString subtitle = item.get(\"subtitle\").toString();\n\t\t\t\tString pubDate = item.get(\"pubDate\").toString();\n\t\t\t\tString director = item.get(\"director\").toString();\n\t\t\t\tString actor = item.get(\"actor\").toString();\n\t\t\t\tString userRating = item.get(\"userRating\").toString();\n\t\t\t\t\n\t\t\t\tMovieDTO mvDTO = MovieDTO.builder().title(title).link(link)\n\t\t\t\t\t\t.image(image).subtitle(subtitle)\n\t\t\t\t\t\t.pubDate(pubDate).director(director)\n\t\t\t\t\t\t.actor(actor).userRating(userRating).build();\n\t\t\t\t\n\t\t\t\tmvList.add(mvDTO);\n\t\t\t}\n\t\t\treturn mvList;\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}", "@Override\n public void onResponse(JSONObject response) {\n\n try {\n The_movies one_movie = new The_movies();\n JSONObject jsonObject = new JSONObject();\n JSONArray jsonArray = response.getJSONArray(\"results\");\n\n\n // use jsonArray.length to get all\n for (int i = 0; i < 5; i++) {\n one_movie = new The_movies();\n\n jsonObject = jsonArray.getJSONObject(i);\n // Retrieves the string labeled \"colorName\" and \"description\" from\n //the response JSON Object\n //and converts them into javascript objects\n\n // get values from URL\n boolean adult = jsonObject.getBoolean(\"adult\");\n String title = jsonObject.getString(\"title\");\n String average = jsonObject.getString(\"vote_average\");\n String release = jsonObject.getString(\"release_date\");\n String overview = jsonObject.getString(\"overview\");\n String original_language = jsonObject.getString(\"original_language\");\n int vote_count = jsonObject.getInt(\"vote_count\");\n\n\n // put values in class movies\n one_movie.setAdult(adult);\n one_movie.setTitle(title);\n one_movie.setVote_average(average);\n one_movie.setRelease_date(release);\n one_movie.setOverview(overview);\n one_movie.setOriginal_language(original_language);\n one_movie.setVote_count(vote_count);\n\n // after all in movies :\n\n theMoviesArrayList.add(one_movie);\n\n\n\n // Adds strings from object to the \"data\" string\n data = \"title Name: \" + title +\n \"average : \" + average;\n\n // Adds the data string to the TextView \"results\"\n Log.d(\"TAG\", \"onResponse3: \"+data);\n Log.d(\"TAG\", \"onResponse3: \\n\");\n\n //results.setText(data);\n\n }\n Log.d(\"size\", \"onResponse: \" + theMoviesArrayList.size());\n\n }\n // Try and catch are included to handle any errors due to JSON\n catch (JSONException e) {\n // If an error occurs, this prints the error to the log\n e.printStackTrace();\n }\n }", "private Movie getMovieDataFromJson(String jsonString) {\n Movie result = null;\n try {\n JSONObject jsonMovieObject = new JSONObject(jsonString);\n\n Movie.Builder movieBuilder = Movie.newBuilder(\n Integer.parseInt(jsonMovieObject.getString(Utility.TMDB_ID)),\n jsonMovieObject.getString(Utility.TMDB_TITLE))\n .setBackdropPath(jsonMovieObject.getString(Utility.TMDB_BACKDROP_PATH))\n .setOriginalTitle(jsonMovieObject.getString(Utility.TMDB_ORIGINAL_TITLE))\n .setPopularity(jsonMovieObject.getString(Utility.TMDB_POPULARITY))\n .setPosterPath(jsonMovieObject.getString(Utility.TMDB_POSTER_PATH))\n .setOverview(jsonMovieObject.getString(Utility.TMDB_OVERVIEW))\n .setReleaseDate(jsonMovieObject.getString(Utility.TMDB_RELEASE_DATE))\n .setVoteAverage(jsonMovieObject.getDouble(Utility.TMDB_VOTE_AVERAGE))\n .setRunTime(jsonMovieObject.getInt(Utility.TMDB_RUNTIME));\n result = movieBuilder.build();\n\n } catch (JSONException e) {\n System.err.println(e);\n Log.d(LOG_TAG, \"Error parsing JSON. String was: \" + jsonString);\n }\n return result;\n }", "private static ArrayList<ParsedRestaurant> parseResults(StringBuilder jsonResults){\r\n\t\tboolean validObject = true;\r\n\t\tArrayList<ParsedRestaurant> resultsList = null;\r\n\t\ttry{ \r\n\t\t\tJSONObject jsonObj = new JSONObject(jsonResults.toString());\r\n\r\n\t\t\t//CREATES results from array with tag \"results\" \r\n\t\t\tJSONArray prediJsonArr = jsonObj.getJSONArray(\"results\");\r\n\r\n\t\t\tif(prediJsonArr!=null){\r\n\t\t\t\tresultsList = new ArrayList<ParsedRestaurant>();\r\n\t\t\t\tfor(int i=0; i<prediJsonArr.length(); i++){\r\n\t\t\t\t\tJSONObject objInArr = prediJsonArr.getJSONObject(i);\r\n\r\n\t\t\t\t\t// Create Restaurant instance\r\n\t\t\t\t\tParsedRestaurant newRest = new ParsedRestaurant();\r\n\t\t\t\t\tnewRest.setName(objInArr.getString(\"name\"));\r\n\t\t\t\t\tnewRest.setId(objInArr.getString(\"place_id\"));\r\n\t\t\t\t\tif(objInArr.has(\"rating\"))\r\n\t\t\t\t\t\tnewRest.setRating(objInArr.getDouble(\"rating\"));\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\tnewRest.setRating(-1);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Here we can check for types and remove those who\r\n\t\t\t\t\t * are not of interest, that we have saved in UNWANTED_TYPES list.\r\n\t\t\t\t\t * else we set the id to 0\r\n\t\t\t\t\t */\r\n\t\t\t\t\tJSONArray taggedTypes = objInArr.getJSONArray(\"types\");\r\n\t\t\t\t\tfor(int j=0; j<taggedTypes.length(); j++){\r\n\t\t\t\t\t\tif(!UNWANTED_TYPES.contains(taggedTypes.getString(j)))\r\n\t\t\t\t\t\t\tnewRest.addTypes(taggedTypes.getString(j));\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tvalidObject = false;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * if the place id is not 0, the object is valid to add\r\n\t\t\t\t\t * else we don't add it.\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif(validObject){\r\n\t\t\t\t\t\t//Create location instance\r\n\t\t\t\t\t\tParsedLocation loc = new ParsedLocation();\r\n\t\t\t\t\t\tloc.setLattitude(objInArr.getJSONObject(\"geometry\").getJSONObject(\"location\").getDouble(\"lat\"));\r\n\t\t\t\t\t\tloc.setLongitude(objInArr.getJSONObject(\"geometry\").getJSONObject(\"location\").getDouble(\"lng\"));\r\n\t\t\t\t\t\tif(objInArr.has(\"vicinity\"))\r\n\t\t\t\t\t\t\tloc.setAddress(objInArr.getString(\"vicinity\")); //VICINITY OR FORMATTED ADDRESS\r\n\t\t\t\t\t\telse if (objInArr.has(\"formatted_address\"))\r\n\t\t\t\t\t\t\tloc.setAddress(objInArr.getString(\"formatted_address\"));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tloc.setAddress(\"not avaliable..\");\r\n\t\t\t\t\t\tnewRest.setLocation(loc);\r\n\t\t\t\t\t\tresultsList.add(newRest);\r\n\t\t\t\t\t\tLogger.debug(\"Pared restaurant: \"+ newRest.getId() +\" \"+ newRest.getName());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tvalidObject = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t/*\r\n\t\t\t * the time from the JSON results is delivered to when the next page is\r\n\t\t\t * created is slightly delayed, this allows the method to sleep for 1 second\r\n\t\t\t * and then runs search for the nextPage \r\n\t\t\t * \r\n\t\t\t * UNCOMMENT TO ALLOW +20 PLACES TO BE FETCHED\r\n\t\t\t */\r\n\t\t\ttry {\r\n\t\t\t\tTimeUnit.MILLISECONDS.sleep(2000);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\tSystem.out.println(\"TIMEUNIT REST ERROR \"+ e);\r\n\t\t\t}\r\n\r\n\t\t\tString nextPageToken = null;\r\n\r\n\t\t\tif (jsonObj.has(NEXT_PAGE_TOKEN)) {\r\n\t\t\t\tnextPageToken = jsonObj.getString(\"next_page_token\");\r\n\t\t\t\tresultsList.addAll(parseResults(searchNextPage(nextPageToken)));\r\n\t\t\t}\r\n\t\t}catch(JSONException e){\r\n\t\t\tSystem.out.println(\"JSON ERROR \"+ e);\r\n\t\t}\r\n\t\treturn resultsList;\r\n\t}", "public static Movie[] getMoviesArrayFromJson(Context context, String moviesJsonStr)\n throws JSONException {\n Movie[] parsedMovieData = null;\n JSONObject resultsJson = new JSONObject(moviesJsonStr);\n\n /* Is there an error? */\n if (resultsJson.has(\"code\")) {\n int errorCode = resultsJson.getInt(\"code\");\n\n switch (errorCode) {\n case HttpURLConnection.HTTP_OK:\n break;\n case HttpURLConnection.HTTP_NOT_FOUND:\n /* probably invalid url */\n return null;\n default:\n /* Server probably down */\n return null;\n }\n }\n\n JSONArray movieArray = resultsJson.getJSONArray(\"results\");\n parsedMovieData = new Movie[movieArray.length()];\n\n for (int i = 0; i < movieArray.length(); i++) {\n JSONObject movieObject = movieArray.getJSONObject(i);\n parsedMovieData[i] = new Movie(\n movieObject.getString(\"id\"),\n movieObject.getString(\"title\"),\n dateStringToDate(movieObject.getString(\"release_date\")),\n movieObject.getString(\"poster_path\"),\n movieObject.getString(\"backdrop_path\"),\n movieObject.getString(\"overview\"),\n Double.toString(movieObject.getDouble(\"vote_average\"))\n );\n }\n\n return parsedMovieData;\n }", "public MovieRowItem[] getMovieDataFromJson(String movieDetailStr) {\n final String RESULT = \"results\";\n final String TITLE = \"original_title\";\n final String OVER_VIEW = \"overview\";\n final String POSTER_PATH = \"poster_path\";\n final String RELEASE_DATE = \"release_date\";\n final String RATINGS = \"vote_average\";\n MovieRowItem[] movies = null;\n\n try {\n JSONObject movieJson = new JSONObject(movieDetailStr);\n JSONArray movieArray = movieJson.getJSONArray(RESULT);\n movies = new MovieRowItem[movieArray.length()];\n for (int i = 0; i < movieArray.length(); i++) {\n JSONObject movieObject = movieArray.getJSONObject(i);\n MovieRowItem temp_movie = new MovieRowItem();\n temp_movie.setTitle(movieObject.getString(TITLE));\n temp_movie.setImageUrl(movieObject.getString(POSTER_PATH));\n temp_movie.setOverview(movieObject.getString(OVER_VIEW));\n temp_movie.setRatings(movieObject.getDouble(RATINGS));\n temp_movie.setReleaseDate(movieObject.getString(RELEASE_DATE));\n movies[i] = temp_movie;\n }\n } catch (Exception e) {\n Log.e(LOG_TAG, e.getMessage());\n }\n return movies;\n }", "private String[] getMovieDataFromJson(String movieListJsonStr)\n throws JSONException {\n\n // These are the names of the JSON objects that need to be extracted.\n final String MDB_RESULTS = \"results\";\n final String MDB_ORIGINAL_TITLE = \"original_title\";\n final String MDB_MOVIE_POSTER = \"poster_path\";\n final String MDB_PLOT_SYNOPSIS = \"overview\";\n final String MDB_RATING = \"vote_average\";\n final String MDB_RELEASE_DATE = \"release_date\";\n\n JSONObject movieListJson = new JSONObject(movieListJsonStr);\n JSONArray movieArray = movieListJson.getJSONArray(MDB_RESULTS);\n\n String[] imageUrls = new String[movieArray.length()];\n for (int i = 0; i < movieArray.length(); i++){\n JSONObject movie = movieArray.getJSONObject(i);\n imageUrls[i] = formatImageURL(movie.getString(MDB_MOVIE_POSTER));\n }\n\n return imageUrls;\n }", "private Movie getMovie() {\n Gson gson = new Gson();\n return gson.fromJson(result, Movie.class);\n }", "public void parseJsonResponse(String result) {\n Log.i(TAG, result);\n\n try {\n JSONArray jsonArray = new JSONArray(result);\n\n for(int i=0; i<jsonArray.length(); i++){\n JSONObject jsonObject = jsonArray.getJSONObject(i);\n Song song = new Song();\n\n song.setSongName(jsonObject.getString(\"song\"));\n song.setSongUrl(jsonObject.getString(\"url\"));\n song.setArtists(jsonObject.getString(\"artists\"));\n song.setCoverUrl(jsonObject.getString(\"cover_image\"));\n\n songList.add(song);\n }\n songsAdapter.notifyDataSetChanged();\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "public void actorParse(){\n\n RequestQueue mQueue;\n mQueue = Volley.newRequestQueue(this);\n\n String tmdbUrl = \"https://api.themoviedb.org/3/movie/\" + movie.getId() + \"/credits?api_key=1e9f1e07ae99796a8c5c9932ada044ab\";\n\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, tmdbUrl, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n\n txtStory.append(\"\\n\\n\");\n txtStory.append(Html.fromHtml( \"<b>Actors:</b>\" ));\n txtStory.append(\"\\n\");\n\n String actor;\n JSONArray jsonArray = new JSONArray();\n\n //JSON wordt geparst gelijk in de textview gestopt\n try {\n jsonArray = response.getJSONArray(\"cast\");\n\n for(int i=0; i<jsonArray.length(); i++){\n actor = jsonArray.getJSONObject(i).getString(\"name\");\n Log.i(\"ID:\", actor);\n txtStory.append(actor);\n if(i == 5){\n break;\n }\n txtStory.append(\", \");\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }\n });\n mQueue.add(request);\n\n }", "ArrayList<Tour> parsearResultado(String JSONstr) throws JSONException {\n ArrayList<Tour> tours = new ArrayList<>();\n JSONArray jsonTours = new JSONArray(JSONstr);\n if (jsonTours.length()!=0) {\n for (int i = 0; i < jsonTours.length(); i++) {\n JSONObject jsonResultado = jsonTours.getJSONObject(i);\n int jsonId = jsonResultado.getInt(\"Id\");\n String jsonNombre = jsonResultado.getString(\"Nombre\");\n String jsonUbicacion = jsonResultado.getString(\"Ubicacion\");\n String jsonFoto = jsonResultado.getString(\"FotoURL\");\n String jsonLikes = jsonResultado.getString(\"Likes\");\n String jsonDescripcion = jsonResultado.getString(\"Descripcion\");\n\n JSONObject jsonResultadoUsuario = jsonResultado.getJSONObject(\"Usuario\");\n int idUsuario = jsonResultadoUsuario.getInt(\"Id\");\n String nomUsuario = jsonResultadoUsuario.getString(\"Nombre\");\n String fotoUsuario = jsonResultadoUsuario.getString(\"FotoURL\");\n\n Usuario usu = new Usuario(nomUsuario, fotoUsuario, idUsuario, \"\", null, null);\n\n gustosparc = new ArrayList<>();\n JSONArray jsongustos = jsonResultado.getJSONArray(\"Gustos\");\n for (int j = 0; j < jsongustos.length(); j++) {\n JSONObject jsonresultadoGustos = jsongustos.getJSONObject(j);\n int jsonIdGusto = jsonresultadoGustos.getInt(\"Id\");\n String jsonnombregustos = jsonresultadoGustos.getString(\"Nombre\");\n Gusto gus = new Gusto(jsonIdGusto, jsonnombregustos);\n gustosparc.add(gus);\n }\n\n Tour t = new Tour(jsonNombre, jsonDescripcion, jsonFoto, jsonUbicacion, jsonId, jsonLikes, usu, null, gustosparc);\n tours.add(t);\n }\n }\n return tours;\n }", "public static List<Review> extractReviewData(String stringUrl, int movieId) {\n String jsonResponse = fetchResponse(stringUrl);\n if (jsonResponse == null) {\n return null;\n }\n List<Review> reviews = new ArrayList<>();\n try {\n JSONObject baseJsonResponse = new JSONObject(jsonResponse);\n JSONArray resultsJSONArray = baseJsonResponse.getJSONArray(RESULTS_KEY);\n for (int i = 0; i < resultsJSONArray.length(); i++) {\n JSONObject currentMovie = resultsJSONArray.getJSONObject(i);\n String author = currentMovie.optString(REVIEW_AUTHOR_KEY);\n String content = currentMovie.optString(REVIEW_CONTENT_KEY);\n String reviewId = currentMovie.optString(REVIEW_ID_KEY);\n String reviewUrl = currentMovie.optString(REVIEW_URL_KEY);\n Review review = new Review(reviewId, movieId, author, content, reviewUrl);\n reviews.add(review);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return reviews;\n }", "static <T extends JSONSerializable> ArrayList<T> arrayListDeserialize(String json, Class<T> type) throws Exception {\n JSONArray serializableArrayList = new JSONArray(json);\n ArrayList<T> resultArrayList = new ArrayList<>();\n\n for(int idx = 0; idx < serializableArrayList.length(); idx++) {\n T result = type.newInstance();\n result.jsonDeserialize(serializableArrayList.getString(idx));\n resultArrayList.add(result);\n }\n\n return resultArrayList;\n }", "public static MilestoneListResponseAllOfResult fromJson(String jsonString) throws IOException {\n return JSON.getGson().fromJson(jsonString, MilestoneListResponseAllOfResult.class);\n }", "private String[] getMovieDataFromJson(String movieJsonStr)\n throws JSONException {\n final String API_RESULTS = \"results\";\n final String API_POSTER_PATH = \"poster_path\";\n\n JSONObject jsonObject = new JSONObject(movieJsonStr);\n JSONArray moviesArray = jsonObject.getJSONArray(API_RESULTS);\n\n int num_movies = moviesArray.length();\n\n String[] movie_result = new String[num_movies];\n for(int i=0; i<num_movies; i++) {\n String poster = moviesArray.getJSONObject(i).getString(API_POSTER_PATH);\n //Log.v(LOG_TAG, \"pathpos: \" + poster);\n movie_result[i] = poster;\n // Log.v(LOG_TAG, \"movie_res: \" + movie_result);\n }\n Log.v(LOG_TAG, \"Built URI: \" + movie_result[6]);\n\n return movie_result;\n }", "private void loadMovies() {\n try {\n SharedPreferences prefs = getActivity().getSharedPreferences(\n PREFS_NAME, 0);\n if (prefs.contains(SP_FEED)) {\n\n JSONObject jsonObject = new JSONObject(prefs.getString(SP_FEED,\n \"\"));\n\n JSONArray jsonMovieArray;\n jsonMovieArray = (JSONArray) ((JSONObject) jsonObject\n .get(\"feed\")).get(\"entry\");\n\n if (jsonMovieArray != null) {\n int len = jsonMovieArray.length();\n for (int i = 0; i < len; i++) {\n JSONObject jsonMovie = (JSONObject) jsonMovieArray\n .get(i);\n mList.add(new Movie(jsonMovie));\n }\n }\n }\n\n } catch (JSONException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n // Update adapter\n mArrayAdapter.notifyDataSetChanged();\n }", "public static void addResults(ArrayList<MovieInfoObject> moviesInfo) {\n mCurrentMovies.clear();\n for (MovieInfoObject mi : moviesInfo) {\n mCurrentMovies.add(mi);\n }\n if (mMovies.size() == 0) {\n for (MovieInfoObject mi : moviesInfo) {\n mMovies.add(mi);\n keywords.add(mi.getTitle());\n }\n return;\n }\n HashMap<Long, Integer> movieDup = new HashMap<Long, Integer>();\n for (MovieInfoObject a : mMovies) {\n movieDup.put(a.getId(), new Integer(1));\n }\n for (MovieInfoObject e : moviesInfo) {\n if (movieDup.get(e.getId()) == null) {\n mMovies.add(e);\n keywords.add(e.getTitle());\n }\n }\n\n }", "private static void listMovies(){\n\n\t\ttry{\n\t\t\tURL url = new URL(\"http://localhost:8080/listMovies\");\n\t\t\tString rawJSONList = getHTTPResponse(url);\n\t\t\tJSONArray JSONList = new JSONArray(rawJSONList);\n\t\t\tStringBuilder list = new StringBuilder();\n\t\t\t\n\t\t\tfor (int i=0 ; i<JSONList.length() ; i++){\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tJSONObject temp = JSONList.getJSONObject(i);\n\t\t\t\tsb.append(temp.getInt(\"id\"));\n\t\t\t\tsb.append(\". \");\n\t\t\t\tsb.append(temp.getString(\"name\"));\n\t\t\t\tsb.append(\"\\n\");\n\t\t\t\t\n\t\t\t\tlist.append(sb.toString());\n\t\t\t}\n\t\t\tSystem.out.println(list.toString());\n\t\t}catch(Exception e){System.out.println(\"Error - wrong input or service down\");}\n\t\t\n\t}", "public static ArrayList<NewsItem> parseNews(String jObject){\r\n\r\n ArrayList<NewsItem> newsItemList = new ArrayList<>();\r\n\r\n try {\r\n JSONObject mainJSONObject = new JSONObject(jObject);\r\n JSONArray items = mainJSONObject.getJSONArray(\"articles\");\r\n\r\n for(int i = 0; i < items.length(); i++){\r\n JSONObject item = items.getJSONObject(i);\r\n newsItemList.add(new NewsItem(item.getString(\"author\"), item.getString(\"title\"),\r\n item.getString(\"description\"), item.getString(\"url\"), item.getString(\"urlToImage\"), item.getString(\"publishedAt\") ));\r\n }\r\n } catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n return newsItemList;\r\n }", "private void manageSetsResult(String result) {\n try {\n JSONObject object_result = new JSONObject(result);\n JSONArray objects = object_result.getJSONArray(\"objects\");\n\n for(int i=0; i<objects.length(); i++){\n JSONObject object = objects.getJSONObject(i);\n Sets set = new Sets();\n\n if(object.has(\"title\")){\n set.setTitle(object.getString(\"title\"));\n }\n if(object.has(\"body\")){\n set.setBody(object.getString(\"body\"));\n }\n if(object.has(\"film_count\")){\n set.setFilmCount(object.getInt(\"film_count\"));\n }\n if(object.has(\"items\")){\n set.setItems(object.getJSONArray(\"items\"));\n }\n if(object.has(\"image_urls\")\n && object.getJSONArray(\"image_urls\").length() > 0\n && object.getJSONArray(\"image_urls\").get(0) != null){\n set.setPhotoArray(object.getJSONArray(\"image_urls\"));\n }\n\n this.sets.add(set);\n }\n\n listener.onSetsLoaded();\n\n }catch (JSONException e){\n e.printStackTrace();\n listener.onSetError();\n }\n }", "public static ArrayList<Recipe> convertJsonToRecipeObjects() throws JSONException {\n //Convert fullJsonMoviesData to JsonObject\n String urlResponse = null;\n URL jsonURL = buildUrl();\n try {\n urlResponse = getResponseFromHttpUrl(jsonURL);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n JSONArray bakingDataArray = new JSONArray(urlResponse);\n ArrayList<Recipe> results = new ArrayList<>();\n for (int i = 0; i < bakingDataArray.length(); i++) {\n Recipe recipe = new Recipe();\n recipe.setId(bakingDataArray.getJSONObject(i).getInt(ID));\n recipe.setName(bakingDataArray.getJSONObject(i).getString(NAME));\n recipe.setImage(getDefaultorActualImage(bakingDataArray.getJSONObject(i).getString(IMAGE)));\n recipe.setServings(bakingDataArray.getJSONObject(i).getString(SERVINGS));\n JSONArray ingredientsJSONArray = bakingDataArray.getJSONObject(i).getJSONArray(INGREDIENTS);\n ArrayList<Ingredient> ingredientsArray = new ArrayList<>();\n for (int j = 0; j < ingredientsJSONArray.length(); j++) {\n Ingredient ingredient = new Ingredient();\n ingredient.setIngredient(ingredientsJSONArray.getJSONObject(j).getString(INGREDIENT));\n ingredient.setMeasure(ingredientsJSONArray.getJSONObject(j).getString(MEASURE));\n ingredient.setQuantity(ingredientsJSONArray.getJSONObject(j).getString(QUANTITY));\n ingredientsArray.add(ingredient);\n }\n recipe.setIngredients(ingredientsArray);\n JSONArray stepJSONArray = bakingDataArray.getJSONObject(i).getJSONArray(STEPS);\n ArrayList<Step> stepArray = new ArrayList<>();\n for (int k = 0; k < stepJSONArray.length(); k++) {\n Step step = new Step();\n step.setId(stepJSONArray.getJSONObject(k).getString(STEP_ID));\n step.setDescription(stepJSONArray.getJSONObject(k).getString(DESCRIPTION));\n step.setShortDescription(stepJSONArray.getJSONObject(k).getString(SHORT_DESCRIPTION));\n step.setThumbnailURL(stepJSONArray.getJSONObject(k).getString(thumbnailURL));\n step.setVideoURL(stepJSONArray.getJSONObject(k).getString(videoURL));\n stepArray.add(step);\n }\n recipe.setSteps(stepArray);\n results.add(recipe);\n }\n return results;\n }", "public static ArrayList<Movie> getMoviesFromJson(String filename){\n ArrayList<Movie> movies = getJsonArray(filename);\n if (movies == null){\n return new ArrayList<>();\n }\n return movies;\n\n }", "public static List<Movie> getListOfMovies(JSONArray moviesJsonArray) throws JSONException {\n List<Movie> movies = new ArrayList<>();\n\n for(int i = 0; i < moviesJsonArray.length(); i++) {\n JSONObject movieJsonObject = moviesJsonArray.getJSONObject(i);\n\n double id = movieJsonObject.getDouble(\"id\");\n String posterPath = movieJsonObject.getString(\"poster_path\");\n String title = movieJsonObject.getString(\"title\");\n String overview = movieJsonObject.getString(\"overview\");\n double rating = movieJsonObject.getDouble(\"vote_average\");\n double popularity = movieJsonObject.getDouble(\"popularity\");\n\n movies.add(new Movie(id, posterPath, title, overview, rating, popularity));\n }\n\n return movies;\n }", "private static List<News> extractFeatureFromJson(String newsJSON){\n if (TextUtils.isEmpty(newsJSON)) {\n return null;\n }\n\n // Create an empty ArrayList that we can start adding news to\n ArrayList<News> news = new ArrayList<>();\n\n // Try to parse the SAMPLE_JSON_RESPONSE. If there's a problem with the way the JSON\n // is formatted, a JSONException exception object will be thrown.\n // Catch the exception so the app doesn't crash, and print the error message to the logs.\n try {\n\n JSONObject baseJsonObject = new JSONObject(newsJSON);\n\n JSONArray articlesJsonArray = baseJsonObject.getJSONArray(\"articles\");\n\n for (int i=0;i<articlesJsonArray.length();i++){\n JSONObject currentNews = articlesJsonArray.getJSONObject(i);\n\n String title = currentNews.getString(\"title\");\n String description = currentNews.getString(\"description\");\n String url = currentNews.getString(\"url\");\n String urlImage = currentNews.getString(\"urlToImage\");\n\n News exactNews = new News(title,description,url,urlImage);\n news.add(exactNews);\n }\n\n } catch (JSONException e) {\n Log.e(\"QueryUtils\", \"Problem parsing the earthquake JSON results\", e);\n }\n return news;\n }", "private void addMovieToArray(ArrayList<Movie> movies, String movieName, String directorName, String act1, String act2, String act3, int star)\n {\n Movie clip = new Movie(movieName, directorName, act1, act2, act3, star);\n movies.add(clip);\n }", "public void setMovieArrayList(MovieClass newMovieObject)\n {\n movieArrayList.add(newMovieObject);\n }", "private static ArrayList<Movie> getJsonArray(String fileName){\n String s = readJsonFile(fileName);\n return (ArrayList<Movie>) JSONObject.parseArray(s, Movie.class);\n }", "private static List<News> extractFeaturesFromJsonResponse(String jsonResponse) {\n List<News> newsList = new ArrayList<>();\n\n try {\n JSONObject baseJsonObject = new JSONObject(jsonResponse);\n // If JSON object does not contain \"response\" return null object\n if (!baseJsonObject.has(Keys.JSON_NEWS_OBJECT_KEY)) {\n return null;\n }\n\n JSONObject response = baseJsonObject.getJSONObject(Keys.JSON_NEWS_OBJECT_KEY);\n JSONArray resultsArray = response.getJSONArray(Keys.JSON_NEWS_ARRAY_KEY);\n\n for (int i = 0; i < resultsArray.length(); i++) {\n JSONObject newsObject = resultsArray.getJSONObject(i);\n\n // Get section name\n String sectionName = newsObject.getString(Keys.JSON_NEWS_SECTION_KEY);\n // Get Headline\n String newsHeadline = newsObject.getString(Keys.JSON_NEWS_HEADLINE_KEY);\n // Get published time\n String publishedTime = newsObject.getString(Keys.JSON_NEWS_PUBLISHED_TIME_KEY);\n // Get web Url\n String webUrl = newsObject.getString(Keys.JSON_NEWS_URL_KEY);\n\n // Get thumbnail URL string\n String newsThumbnailUrlString = null;\n if (newsObject.has(Keys.JSON_NEWS_FIELDS_KEY)) {\n JSONObject field = newsObject.getJSONObject(Keys.JSON_NEWS_FIELDS_KEY);\n\n if (field.has(Keys.JSON_NEWS_THUMBNAIL_KEY)) {\n newsThumbnailUrlString = field.getString(Keys.JSON_NEWS_THUMBNAIL_KEY);\n }\n }\n\n // Get author name\n String authorName = null;\n if (newsObject.has(Keys.JSON_NEWS_TAGS_KEY)) {\n JSONArray tags = newsObject.getJSONArray(Keys.JSON_NEWS_TAGS_KEY);\n if (!tags.isNull(0)) {\n // If first element of array is not null then get the author name\n JSONObject tagsObject = tags.getJSONObject(0);\n if (tagsObject.has(Keys.JSON_NEWS_AUTHOR_NAME_KEY)) {\n authorName = tagsObject.getString(Keys.JSON_NEWS_AUTHOR_NAME_KEY);\n }\n }\n }\n newsList.add(new News(newsHeadline, sectionName, authorName, publishedTime, webUrl, newsThumbnailUrlString));\n }\n } catch (JSONException e) {\n Log.e(LOG_TAG, \"Error creating JSON object : extractFeaturesFromJsonResponse() method\", e);\n }\n return newsList;\n }", "private void convertJSONtoArrayList(JSONArray players) {\n try {\n for (int i = 0; i < players.length(); i++) {\n JSONObject employee = players.getJSONObject(i);\n taskList.add(new MainTask(\n employee.getInt(\"id\"),\n employee.optString(\"description\", \"no name\"),\n employee.getInt(\"roomNumber\"),\n employee.optString(\"buildingName\", \"no email\"),\n employee.optString(\"comment\"),\n employee.getBoolean(\"isComplete\")\n ));\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "private void parse(){\n\t\tfor (Object res : book_results){\n\t\t\tString author = JsonPath.read(res,\"$.name\").toString();\n\t\t\tRole role = new Role(author, \"Author\");\n\t\t\tList<String> books = JsonPath.read(res,\"$./book/author/works_written[*].a:name\");\n\t\t\tmql_map.put(role, books);\n\t\t}\n\t\t\n\t\tfor (Object res : organization_results){\n\t\t\tString businessperson = JsonPath.read(res,\"$.name\").toString();\n\t\t\tRole role = new Role(businessperson, \"Businessperson\");\n\t\t\tList<String> organizations = JsonPath.read(res,\"$./organization/organization_founder/organizations_founded[*].a:name\");\n\t\t\tmql_map.put(role, organizations);\n\t\t}\n\t}", "@Override\n public ArrayList<Movie> loadInBackground() {\n\n\n URL movieRequestUrl = JsonUtils.createUrl(searchUrl);\n String movieSearchResults = null;\n ArrayList<Movie> movieResultData = new ArrayList<>();\n\n try {\n movieSearchResults = JsonUtils\n .getResponseFromHttpUrl(movieRequestUrl);\n movieResultData.addAll(OpenMovieJsonUtils.parseMovieJson(movieSearchResults));\n\n return movieResultData;\n\n } catch (Exception e) {\n e.printStackTrace();\n return null;\n }\n\n }", "@Override\n public void parse(String json) {\n JSONObject object = new JSONObject(json);\n id = object.getInt(\"dataset id\");\n name = object.getString(\"dataset name\");\n maxNumOfLabels = object.getInt(\"maximum number of labels per instance\");\n\n JSONArray labelsJSON = object.getJSONArray(\"class labels\");\n labels = new ArrayList<>();\n for (int i = 0; i < labelsJSON.length(); i++) {\n labels.add(new Label(labelsJSON.getJSONObject(i).toString()));\n }\n\n JSONArray instancesJSON = object.getJSONArray(\"instances\");\n instances = new ArrayList<>();\n for (int i = 0; i < instancesJSON.length(); i++) {\n instances.add(new Instance(instancesJSON.getJSONObject(i).toString()));\n }\n }", "public static String[] getMovieStringsFromJson(Context context, String movieJsonStr)\n throws JSONException {\n\n \n /* Weather information. Each day's forecast info is an element of the \"list\" array */\n final String OWM_PAGE = \"results\";\n final String ORIGINAL_TITLE = \"original_title\";\n\n // Poster Image of the movie\n final String POSTER_IMAGE = \"poster_path\";\n\n final String OVERVIEW = \"overview\";\n\n final String VOTE_AVG = \"vote_average\";\n\n final String RELEASE_DATE = \"release_date\";\n\n final String IMAGE_PATH = \"poster_path\";\n\n final String OWM_MESSAGE_CODE = \"cod\";\n\n final String MOVIE_ID = \"id\";\n\n\n\n /* String array to hold each day's weather String */\n String[] parsedMovieData = null;\n\n JSONObject movieJson = new JSONObject(movieJsonStr);\n\n /* Is there an error? */\n if (movieJson.has(OWM_MESSAGE_CODE)) {\n int errorCode = movieJson.getInt(OWM_MESSAGE_CODE);\n\n switch (errorCode) {\n case HttpURLConnection.HTTP_OK:\n break;\n case HttpURLConnection.HTTP_NOT_FOUND:\n /* Location invalid */\n return null;\n default:\n /* Server probably down */\n return null;\n }\n }\n\n JSONArray movieArray = movieJson.getJSONArray(OWM_PAGE);\n\n parsedMovieData = new String[movieArray.length()];\n\n // long localDate = System.currentTimeMillis();\n // long utcDate = SunshineDateUtils.getUTCDateFromLocal(localDate);\n // long startDay = SunshineDateUtils.normalizeDate(utcDate);\n\n for (int i = 0; i < movieArray.length(); i++) {\n String date;\n String highAndLow;\n\n /* These are the values that will be collected */\n String originalTitle;\n String synopsis;\n String voteAvg;\n String releaseDate;\n String imagePath;\n String movieId;\n\n /* Get the JSON object representing the day */\n JSONObject movieDetails = movieArray.getJSONObject(i);\n StringBuilder jsonResultString = new StringBuilder();\n\n\n originalTitle = movieDetails.getString(ORIGINAL_TITLE) + \",\";\n synopsis = movieDetails.getString(OVERVIEW);\n voteAvg = movieDetails.getString(VOTE_AVG);\n releaseDate = movieDetails.getString(RELEASE_DATE);\n imagePath = movieDetails.getString(IMAGE_PATH);\n Uri urlImage = buildImageUrl(imagePath);\n movieId = movieDetails.getString(MOVIE_ID);\n\n //Movie movie = new Movie();\n\n jsonResultString.append(originalTitle);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(synopsis);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(voteAvg);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(releaseDate);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(imagePath);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(movieId);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(urlImage);\n jsonResultString.append(\"\\\\n\");\n jsonResultString.append(urlImage);\n\n\n //parsedMovieData[i] = urlImage.toString();\n parsedMovieData[i] = urlImage.toString();\n\n }\n\n return parsedMovieData;\n }", "private static List<Article> extractFeatureFromJson(String jsonString) {\n\n // If Json string is empty or null, return early\n if (TextUtils.isEmpty(jsonString)) {\n return null;\n }\n\n List<Article> articles = new ArrayList<>();\n\n try {\n\n // Get json root string\n JSONObject jsonObjectString = new JSONObject(jsonString);\n\n // Get the response object in the root json string\n JSONObject responseObj = jsonObjectString.getJSONObject(\"response\");\n\n // Get th array that contains all the articles inside the response\n JSONArray articlesArray = responseObj.getJSONArray(\"results\");\n\n // Loop through every article object in the array\n for (int i = 0; i < articlesArray.length(); i++) {\n\n // get current article at the current index\n JSONObject currentArticle = articlesArray.getJSONObject(i);\n\n // Get the object that contains all fields of info on the currentArticle\n JSONObject feilds = currentArticle.getJSONObject(\"fields\");\n\n // Get the articles title\n String title = feilds.getString(\"headline\");\n\n // Get the articles webUrl\n String url = currentArticle.getString(\"webUrl\");\n\n // Get the articles picture\n String image = feilds.getString(\"thumbnail\");\n\n // Create bitmap from image url string\n Bitmap picture = readImageUrl(image);\n\n // Get Authors name\n String author = feilds.optString(\"byline\");\n\n // Get the date the article was published\n String datePublished = feilds.getString(\"firstPublicationDate\");\n\n // Get the articles section name\n String section = currentArticle.getString(\"sectionName\");\n\n // Create a new article and add it to the list\n articles.add(new Article(title, url, author, image, datePublished, section, picture));\n }\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n Log.v(LOG_TAG, \"Error parsing json:\" + e);\n }\n\n // Return list of articles\n return articles;\n\n }", "public static ArrayList<DigitalNewspapers> convertJson(String jsonSources){\n\n ArrayList<DigitalNewspapers> sources = new ArrayList<>();\n\n try {\n JSONObject data = new JSONObject(jsonSources);\n JSONArray jsonDigitalNewspapers = data.getJSONArray(\"sources\");\n\n\n for (int i = 0; i < jsonDigitalNewspapers.length(); i++) {\n\n JSONObject jsonDigitalNewspaper = jsonDigitalNewspapers.getJSONObject(i);\n\n DigitalNewspapers dn = new DigitalNewspapers();\n\n dn.setId(jsonDigitalNewspaper.getString(\"id\"));\n\n dn.setName(jsonDigitalNewspaper.getString(\"name\"));\n\n if(jsonDigitalNewspaper.has(\"urlsToLogos\")){\n dn.setUrlToLogos(jsonDigitalNewspaper.getJSONObject(\"urlsToLogos\").getString(\"small\"));\n }\n\n JSONArray jsonArraySortBys = jsonDigitalNewspaper.getJSONArray(\"sortBysAvailable\");\n\n for (int j = 0; j <jsonArraySortBys.length() ; j++) {\n if(jsonArraySortBys.getString(j).equals(\"top\")){\n dn.setTop(true);\n }else if(jsonArraySortBys.getString(j).equals(\"latest\")){\n dn.setLatest(true);\n }else if(jsonArraySortBys.getString(j).equals(\"popular\")){\n dn.setPopular(true);\n }\n }\n\n\n sources.add(dn);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return sources;\n\n }", "@Override\n public void success(Movie.MovieResult movieResult, Response response) {\n mAdapter.setmMovieList(movieResult.getResults());\n }", "private void storeFilesToCollection(String movieDetails, ArrayList<Movie> movies) \n {\n String[] allMovieInfo = movieDetails.split(\";\");\n \n for (int line = 0; line < allMovieInfo.length ; line++)\n {\n String[] details = allMovieInfo[line].split(\",\");\n String title = details[0];\n String director = details[1];\n String actorOne = details[2];\n String actorTwo = details[3];\n String actorThree = details[4];\n int rating = Integer.parseInt(details[5]);\n addMovieToArray(movies,title, director, actorOne, actorTwo, actorThree, rating);\n }\n }", "private List<Music> parseJSON(JSONArray ary)throws JSONException {\r\n\t\tList<Music> musics=new ArrayList<Music>();\r\n\t\tfor(int i=0; i<ary.length(); i++){\r\n\t\t\tJSONObject obj=ary.getJSONObject(i);\r\n\t\t\tMusic m=new Music();\r\n\t\t\tm.setId(obj.getInt(\"id\"));\r\n\t\t\tm.setAlbum(obj.getString(\"album\"));\r\n\t\t\tm.setAlbumpic(obj.getString(\"albumpic\"));\r\n\t\t\tm.setAuthor(obj.getString(\"author\"));\r\n\t\t\tm.setComposer(obj.getString(\"composer\"));\r\n\t\t\tm.setDowncount(obj.getString(\"downcount\"));\r\n\t\t\tm.setDurationtime(obj.getString(\"durationtime\"));\r\n\t\t\tm.setFavcount(obj.getString(\"favcount\"));\r\n\t\t\tm.setMusicpath(obj.getString(\"musicpath\"));\r\n\t\t\tm.setName(obj.getString(\"name\"));\r\n\t\t\tm.setSinger(obj.getString(\"singer\"));\r\n\t\t\tmusics.add(m);\r\n\t\t}\r\n\t\treturn musics;\r\n\t}", "private MovieReviews[] getReviewsDataFromJson(String reviewJsonStr)throws JSONException{\n\r\n final String RESULTS = \"results\";\r\n final String REVIEW_ID = \"id\";\r\n final String REVIEW_AUTHOR = \"author\";\r\n final String REVIEW_CONTENT = \"content\";\r\n\r\n JSONObject reviewJson = new JSONObject(reviewJsonStr);\r\n JSONArray reviewArray = reviewJson.getJSONArray(RESULTS);\r\n\r\n MovieReviews[] resultStr = new MovieReviews[reviewArray.length()];\r\n\r\n //Here statement to obtent the id of the movie!!!\r\n //Extract movie review data and build movie objects\r\n for (int i = 0; i<reviewArray.length();i++){\r\n\r\n String review_id;\r\n String review_author;\r\n String review_content;\r\n\r\n JSONObject reviewdata = reviewArray.getJSONObject(i);\r\n\r\n review_id = reviewdata.getString(REVIEW_ID);\r\n review_author = reviewdata.getString(REVIEW_AUTHOR);\r\n review_content = reviewdata.getString(REVIEW_CONTENT);\r\n\r\n MovieReviews element = new MovieReviews(review_id,review_author,review_content);\r\n resultStr[i]= element;\r\n\r\n\r\n }\r\n return resultStr;\r\n\r\n }", "ArrayList<Map<String,Object>> parseQueryResult(Object result) { return null;}", "@Override\n public void onResponse(JSONObject response) {\n Log.e(\"tag\", \"request\");\n movieAdapter.setMovieList(parseRequest(response));\n }", "public List<Song> parserListSong(JSONObject result) throws JSONException {\n List<Song> listSong = new ArrayList<>();\n JSONArray jsonCollections = result.getJSONArray(SongEntry.COLLECTION);\n for (int i = 0; i < jsonCollections.length(); i++) {\n JSONObject jsonChild = jsonCollections.getJSONObject(i);\n JSONObject jsonTrack = jsonChild.getJSONObject(SongEntry.TRACK);\n Song song = parserSong(jsonTrack);\n if (song != null) {\n listSong.add(song);\n }\n }\n return listSong;\n }", "public static List<Movie> fromJSONArray(JSONArray movieJSONArray) throws JSONException {\n List<Movie> movies = new ArrayList<>();\n for(int i = 0; i < movieJSONArray.length(); i++) {\n movies.add(new Movie(movieJSONArray.getJSONObject(i)));\n }\n\n return movies;\n }", "private ArrayList<WeatherStatus> parseJSON(String jsonString) {\n\t\t\t// convert JSON to ArrayList<WeatherStatus>\n\t\t\tArrayList<WeatherStatus> weatherStatusList = null;\n\n\t\t\ttry {\n\t\t\t\tweatherStatusList = new ArrayList<WeatherStatus>();\n\t\t\t\tJSONObject tokenerResult = (JSONObject)new JSONTokener(jsonString).nextValue();\n\t\t\t\tJSONArray jsonArray = tokenerResult.getJSONArray(WeatherAPI.WEATHER_ARRAY_TOKEN);\n\t\t\t\tfor (int i = 0; i < jsonArray.length(); ++i) {\n\t\t\t\t\t// WeatherStatus knows how to parse its JSON object\n\t\t\t\t\tWeatherStatus weatherStatus = new WeatherStatus(jsonArray.getJSONObject(i));\n\t\t\t\t\tString weatherIconString = weatherStatus.getWeatherIconString();\n\t\t\t\t\tWeatherIconTable.loadIconBitmap(weatherIconString);\n\t\t\t\t\tweatherStatusList.add(weatherStatus);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (JSONException e) {\n\t\t\t\tLog.e(TAG, \"Error parsing JSON: \" + e.getMessage());\n\t\t\t}\n\n\t\t\treturn weatherStatusList;\n\t\t}", "protected static ArrayList<Song> parse(Context ctx, String jsonStr) throws JSONException{\n\t\tJSONArray tracks;\n\t\tint len = 0;\n\t\tJSONObject json = new JSONObject(jsonStr);\n\t\tJSONObject root = json.getJSONObject(\"similartracks\");\n\n\t\ttracks = root.getJSONArray(\"track\");\n\n\t\tArrayList<Song> songs = new ArrayList<Song>();\n\t\tlen = tracks.length();\n\n\t\tfor(int i = 0; i < len; i++){\n\t\t\tJSONObject track = tracks.getJSONObject(i);\n\t\t\tSong song = new Song(track.getString(\"name\"), track.getJSONObject(\"artist\").getString(\"name\"));\n\n\t\t\ttry{\n\t\t\t\tsong.cover = getBitmap(track.getJSONArray(\"image\").getJSONObject(1).getString(\"#text\"));\n\t\t\t} catch (JSONException j){\n\t\t\t\tBitmap noIcon = BitmapFactory.decodeResource(ctx.getResources(), R.drawable.ic_no_icon);\n\t\t\t\tsong.cover = noIcon;\n\t\t\t}\n\n\t\t\tsongs.add(song);\n\t\t}\n\n\t\treturn songs;\n\t}", "public static List<Recipe> parseJson(String recipeJson) {\n //Verify Json is valid\n if (TextUtils.isEmpty(recipeJson)) {\n return null;\n }\n\n try {\n //Instantiate a JsonArray containing the response from the network request\n JSONArray baseJsonArray = new JSONArray(recipeJson);\n\n //Iterate through the list of objects inside the first array\n for (int i = 0; i < baseJsonArray.length(); i++) {\n\n //Get the first object in the list of objects from the baseJson\n JSONObject jsonObject = baseJsonArray.getJSONObject(i);\n\n //Get the name of the recipe\n String recipeName = jsonObject.optString(JSON_RECIPE_NAME);\n\n //Get the array listing the various ingredients\n JSONArray ingredients = jsonObject.optJSONArray(JSON_RECIPE_INGREDIENTS);\n\n //Generate a list of the amount, measure, and names of the ingredients\n ArrayList<String> ingredientList = ingredientParse(ingredients);\n\n //Get the array listing the recipe steps, and videos\n JSONArray steps = jsonObject.optJSONArray(JSON_RECIPE_STEPS);\n\n //Generate a list of short recipe steps\n ArrayList<String> briefList = briefDescriptionParse(steps);\n\n //Generate a list of detailed recipe steps\n ArrayList<String> detailedList = detailedDescriptionParse(steps);\n\n //Generate a list of video URLs\n ArrayList<String> videoUrlList = videoUrlParse(steps);\n\n //Generate a list of thumbnail URLs\n ArrayList<String> thumbnailUrlList = thumbnailParse(steps);\n\n recipes.add(new Recipe(\n recipeName,\n ingredientList,\n briefList,\n detailedList,\n videoUrlList,\n thumbnailUrlList));\n }\n } catch (JSONException e) {\n Log.e(LOG_TAG, \"JSON Error\", e);\n }\n\n return recipes;\n }", "private void ListarFilmes(String sURL, String classMovie) throws IOException {\n\t\tURL url = new URL(sURL);\n\t\tURLConnection json = url.openConnection();\n\t\tjson.connect();\n\n\t\t// Convert to a JSON object to print data\n\t\tJsonParser jp = new JsonParser();\n\t\tJsonElement root = jp.parse(new InputStreamReader((InputStream) json.getContent()));// {\"items\":[{\"id\":\"tt0111161\"\n\t\tJsonObject rootobj = root.getAsJsonObject();\n\t\tJsonElement code = rootobj;\n\t\tGson gson = new GsonBuilder().create();\n\t\tJsonArray jsonArray = rootobj.getAsJsonArray(\"results\");\n\n\t\t// Array de filmes convertido para Array\n\t\tTmdbRecomendados[] arrayFilmes = gson.fromJson(jsonArray, TmdbRecomendados[].class);\n\n\t\t// Lista para comparar cadastros no banco\n//\t\tArrayList<TmdbRecomendados> listaVerifica = recDao.selectAllrecs();\n\n\t\tif (classMovie == \"recomendados\") {\n\t\t\tlistaFilmes.LimparLista();\n\t\t} else if (classMovie == \"emAlta\") {\n\t\t\tlistaEmAlta.LimparLista();\n\t\t} else if (classMovie == \"originais\") {\n\t\t\tlistaOriginais.LimparLista();\n\t\t}\n\n\t\t// Adicionando filmes para uma lista e salvando no banco\n\t\tfor (int i = 0; i < arrayFilmes.length; i++) {\n\t\t\tTmdbRecomendados rec = new TmdbRecomendados();\n\t\t\trec.setId(arrayFilmes[i].getId());\n\t\t\trec.setMedia_type(arrayFilmes[i].getMedia_type());\n\t\t\trec.setOriginal_language(arrayFilmes[i].getOriginal_language());\n//\t\t\tif (arrayFilmes[i].getOriginal_title() == null || arrayFilmes[i].getOriginal_title() == \"\") {\n//\t\t\t\trec.setOriginal_title(arrayFilmes[i].getOriginal_name());\n//\t\t\t} else {\n//\t\t\t\trec.setOriginal_title(arrayFilmes[i].getOriginal_title());\n//\t\t\t}\n\t\t\trec.setOriginal_title(arrayFilmes[i].getOriginal_title());\n\t\t\trec.setOverview(arrayFilmes[i].getOverview());\n\t\t\trec.setPoster_path(arrayFilmes[i].getPoster_path());\n\t\t\trec.setRelease_date(arrayFilmes[i].getRelease_date());\n\t\t\trec.setVote_average(arrayFilmes[i].getVote_average());\n//\t\t\tif (arrayFilmes[i].getOriginal_name() == null || arrayFilmes[i].getOriginal_name() == \"\") {\n//\t\t\t\trec.setOriginal_name(arrayFilmes[i].getOriginal_title());\n//\t\t\t} else {\n//\t\t\t\trec.setOriginal_name(arrayFilmes[i].getOriginal_name());\n//\t\t\t}\n\t\t\trec.setOriginal_name(arrayFilmes[i].getOriginal_name());\n\n\t\t\tif (classMovie == \"recomendados\") {\n\t\t\t\tlistaFilmes.AddListaFilmes(rec);\n\t\t\t} else if (classMovie == \"emAlta\") {\n\t\t\t\tlistaEmAlta.AddListaFilmes(rec);\n\t\t\t} else if (classMovie == \"originais\") {\n\t\t\t\tlistaOriginais.AddListaFilmes(rec);\n\t\t\t}\n\n\t\t}\n\t}", "private void buildList(MovieResponse response) {\n if (null != response) {\n Log.d(TAG, \"Setting up list\");\n //Setup list\n RecyclerView mRecyclerView = findViewById(R.id.main_list_view);\n mRecyclerView.setHasFixedSize(true);\n RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(this);\n mRecyclerView.setLayoutManager(mLayoutManager);\n\n // specify an adapter (see also next example)\n RecyclerView.Adapter mAdapter = new ListAdapter(response.getResults(), new MovieClickCallback() {\n @Override\n public void onMovieClick(Movie movie) {\n Log.d(TAG, \"onMovieClick::\" + movie.getTitle());\n launchDetailsScreen(movie);\n }\n });\n mRecyclerView.setAdapter(mAdapter);\n } else {\n Snackbar.make(getWindow().getDecorView().getRootView(), \"No movie info found\", Snackbar.LENGTH_LONG).show();\n }\n }", "@Test\r\n public void wholeThingTest() {\r\n String inputString = \"Obama\";\r\n// listView.getItems().add(\"some new element\");\r\n URL url = null;\r\n try {\r\n url = new URL(\"https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&titles=\" + URLEncoder.encode(inputString,(\"utf-8\")) + \"&rvprop=timestamp|user&rvlimit=24&redirects\");\r\n } catch (MalformedURLException e) {\r\n e.printStackTrace();\r\n } catch (UnsupportedEncodingException e) {\r\n e.printStackTrace();\r\n }\r\n URLConnection connection = null;\r\n try {\r\n connection = url.openConnection();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n InputStream in = null;\r\n try{\r\n in = connection.getInputStream();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n Reader reader = new InputStreamReader(in);\r\n JsonParser jsonParser = new JsonParser();\r\n JsonElement rootElement = jsonParser.parse(reader);\r\n\r\n RevisionParser parser = new RevisionParser();\r\n List<Revision> revisions = parser.parse(rootElement);\r\n\r\n for (Revision r: revisions) {\r\n System.out.println(r);\r\n }\r\n }", "public static JSONArray getJSONArray(List<Movie> movies) {\n JSONArray result = new JSONArray();\n try {\n for (Movie movie : movies) {\n result.put(movie.toJSONObject());\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n return result;\n }", "@Override\n\tpublic void parseResponse(String result) {\n\t\ttry {\n\t\t\tJSONTokener jsonParser = new JSONTokener(result);\n\t\t\t// 此时还未读取任何json文本,直接读取就是一个JSONObject对象。\n\t\t\t// 如果此时的读取位置在\"name\" : 了,那么nextValue就是\"yuanzhifei89\"(String)\n\t\t\tJSONObject _ResultObject = (JSONObject) jsonParser.nextValue();\n\t\t\tint _ResultId = _ResultObject.optInt(\"result\");\n\t\t\t\n\t\t\tif (_ResultId == 0) {\t\n\t\t\t\tString _TextString = _ResultObject.optString(\"result_text\");\n\t\t\t\tmActivity.callBack(mActivity.CallbackError,_TextString);\n\t\t\t} else if (_ResultId == 1) {\n\t\t\t\tmList = new ArrayList<JobDept>();\n\t\t\t\tJSONArray _Array= _ResultObject.optJSONArray(\"jobdept\");\n\t\t\t\tfor(int i=0;i<_Array.length();i++){\n\t\t\t\t\tJSONObject proObject = _Array.optJSONObject(i);\n\t\t\t\t\tJobDept _JobDept = new JobDept();\n\t\t\t\t\t_JobDept.setmId(proObject.optString(\"JobDeptID\"));\n\t\t\t\t\t_JobDept.setmName(proObject.optString(\"JobDept\"));\n\t\t\t\t\tmList.add(_JobDept);\n\t\t\t\t}\n\t\t\t\tmActivity.callBack(mActivity.CallbackSuccess,null);\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\t// 异常处理代码\n\t\t\tmActivity.callBack(mActivity.CallbackError,MSGHANDLERESULTERROR_STRING);\n\t\t\tex.printStackTrace();\n\t\t}\n\t}", "public static List<List<String>> getFilmography(String actorID) throws IOException{\n\t\t\n\t\tList<List<String>> filmography = new ArrayList<List<String>>();\n\t\t\n\t\tURL url = new URL(\"https://api.themoviedb.org/3/person/\" + actorID + \"/movie_credits?api_key=cc10b91ab6be4842679242b80c13bb31&language=en-US\");\n\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setDoOutput(true);\n con.setRequestMethod(\"GET\");\n con.setRequestProperty(\"Content-Type\", \"application/json\");\n\n BufferedReader br = new BufferedReader(new InputStreamReader((con.getInputStream())));\n\n String filmResults = br.readLine(); //the raw results of all movies listed for that actor\n \n String beg = \"\\\"title\\\":\";\n String end = \"}\";\n String x = Pattern.quote(beg) + \"(.*?)\" + Pattern.quote(end); //returns just the titles in quotes\n //from the raw results\n String begChar = \",\\\"character\\\":\";\n String endChar = \",\\\"credit_id\";\n String xChar = Pattern.quote(begChar) + \"(.*?)\" + Pattern.quote(endChar);//returns character played\n \n String begJob = \",\\\"job\\\":\";\n String endJob = \",\\\"original_title\";\n String xJob = Pattern.quote(begJob) + \"(.*?)\" + Pattern.quote(endJob);//returns job title on film\n \n String begYR = \"release_date\\\":\";\n String endYR = \",\\\"title\";\n String xYR = Pattern.quote(begYR) + \"(.*?)\" + Pattern.quote(endYR);//returns just the release yrs\n //from the raw results\n String begID = \"\\\"id\\\":\";\n String endID = \",\";//\\\"original_title\\\":\";\n String xID = Pattern.quote(begID) + \"(.*?)\" + Pattern.quote(endID); //returns just the movie ID#s \n //from the raw results\n \n Pattern patternTitle = Pattern.compile(x);\n Pattern patternID = Pattern.compile(xID);\n Pattern patternYR = Pattern.compile(xYR);\n Pattern patternChar = Pattern.compile(xChar);\n Pattern patternJob = Pattern.compile(xJob);\n \n Matcher matcher = patternTitle.matcher(filmResults);\n Matcher matcherID = patternID.matcher(filmResults);\n Matcher matcherYR = patternYR.matcher(filmResults);\n Matcher matcherChar = patternChar.matcher(filmResults);\n Matcher matcherJob = patternJob.matcher(filmResults);\n \n List<String> filmArray = new ArrayList<String>();\n List<String> idArray = new ArrayList<String>(); \n List<String> yrArray = new ArrayList<String>(); \n List<String> charArray = new ArrayList<String>(); \n \n \n while (matcher.find()) { \t \n \tString titlesFound = matcher.group(1);\n \tfilmArray.add(titlesFound);\n }\n while(matcherID.find()){\t\n \tString IDsFound = matcherID.group(1);\n \tidArray.add(IDsFound);\n }\n while(matcherYR.find()){\n \tString yrsFound = matcherYR.group(1);\n \tyrArray.add(yrsFound);\t\n }\n while(matcherChar.find()){ \n \tString charsFound = matcherChar.group(1); //character names and job titles\n \tString chars2 = charsFound.replace(\"\\\\\", \"\"); //both get added to charArray\n \tcharArray.add(chars2);\t //because the raw results always\n } //print out crew credits after all\n while(matcherJob.find()){ // the acting credits\n \tString jobsFound = matcherJob.group(1);\n \tcharArray.add(jobsFound);\t\n }\n \n\t\tfor(int i = 0; i < filmArray.size(); i++){\n\t\t\tif(filmArray.get(i).length() > 40){\n\t\t\t\tString q = filmArray.get(i).substring(0, 30); \n\t\t\t\tfilmArray.set(i, q);\n\t\t\t}\n\t\t\tif(charArray.get(i).length() > 40){\n\t\t\t\tString z = charArray.get(i).substring(0, 30); \n\t\t\t\tcharArray.set(i, z);\n\t\t\t}\n\t\t}\n \n String chars = \"\";\n String yrss = \"\";\n String film = \"\";\n String ids = \"\";\n for(int i = 0; i < filmArray.size(); i++){\n\n \tString yrs = yrArray.get(i).replace(\"\\\"\", \"0\");\n \tString yrs2 = yrs.replace(\"-\", \"0\");\n\n \tif(yrArray.get(i).equals(\"null\") || yrArray.get(i) == null){\n \t\tyrss = yrArray.get(i) + \";000000000000\";\n \t\tfilm = filmArray.get(i) + \";000000000000\";\n \t\tchars = charArray.get(i) + \";000000000000\";\n \t\tids = idArray.get(i) + \";000000000000\";\n \t} else {\n \t\tyrss = yrArray.get(i) + \";\" + yrs2;\n \t\tfilm = filmArray.get(i) + \";\" + yrs2;\n \t\tchars = charArray.get(i) + \";\" + yrs2;\n \t\tids = idArray.get(i) + \";\" + yrs2;\n \t}\n \t\n \tfilmArray.set(i, film);\n \tcharArray.set(i, chars);\n \tyrArray.set(i, yrss);\n \tidArray.set(i, ids);\n }\n \n Collections.sort(filmArray, Comparator.comparing(s -> s.split(\";\")[1]));\n Collections.sort(charArray, Comparator.comparing(s -> s.split(\";\")[1]));\n Collections.sort(yrArray, Comparator.comparing(s -> s.split(\";\")[1]));\n Collections.sort(idArray, Comparator.comparing(s -> s.split(\";\")[1]));\n \n Collections.reverse(filmArray);\n Collections.reverse(charArray);\n Collections.reverse(yrArray);\n Collections.reverse(idArray);\n \n\t\tfor(int j = 0; j < filmArray.size(); j ++){\n\t\t\tString xx = filmArray.get(j);\n\t\t\tfilmArray.set(j, xx.substring( 0, xx.length() - 13));\n\t\t\tString y = yrArray.get(j);\n\t\t\tyrArray.set(j, y.substring( 0, y.length() - 13));\n\t\t\tString z = charArray.get(j);\n\t\t\tcharArray.set(j, z.substring( 0, z.length() - 13));\n\t\t\tString zz = idArray.get(j);\n\t\t\tidArray.set(j, zz.substring( 0, zz.length() - 13));\n\t\t}\t\n \n filmography.add(filmArray);\n filmography.add(idArray);\n filmography.add(yrArray);\n filmography.add(charArray);\n \n return filmography;\n\t\t\n\t}", "public static ArrayList<Category> ParseCategories(JSONObject jsonTotalObject)\n {\n ArrayList<Category> categoryArrayList = new ArrayList<>();\n try\n {\n JSONArray categories = jsonTotalObject.getJSONArray(\"categories\");\n\n // The recent categories\n Category recent = new Category();\n recent.setName(\"Recent\");\n recent.setId(0);\n categoryArrayList.add(recent);\n\n for(int i = 0;i<categories.length();i++)\n {\n JSONObject jsonObject = categories.getJSONObject(i);\n Category category = new Category();\n category.setName(jsonObject.getString(\"title\"));\n category.setId(jsonObject.getInt(\"id\"));\n category.setSlugName(jsonObject.getString(\"slug\"));\n categoryArrayList.add(category);\n }\n return categoryArrayList;\n } catch (JSONException e)\n {\n Log.e(TAG,\"JSONException when loading categories\",e);\n e.printStackTrace();\n return null;\n }\n }", "public static ArrayList<Movie> getMoviesFromCollectionSearch(String accessToken, String term) {\n final ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();\n if (term != null) {\n params.add(new BasicNameValuePair(PARAM_TERM, term));\n } // end if\n try {\n\n Log.i(Constants.TAG, \"MOVIES URI: \" + MOVIES_SEARCH_COLLECTION_URI);\n JsonObject moviesJson = getWebService(params, MOVIES_SEARCH_COLLECTION_URI, accessToken).getAsJsonObject();\n Log.i(Constants.TAG, \"MOVIES RESULT: \" + moviesJson.toString());\n if (moviesJson != null) {\n Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)\n .setDateFormat(\"yyyy-MM-dd HH:mm\")\n .create();\n\n ArrayList<Movie> movieList = gson.fromJson(\n moviesJson.get(\"movies\"),\n new TypeToken<ArrayList<Movie>>() {\n }.getType());\n return movieList;\n } else {\n return null;\n } // end if-else\n } catch (APICallException e) {\n Log.e(Constants.TAG, \"HTTP ERROR when searching movies - STATUS:\" + e.getMessage(), e);\n return null;\n } catch (IOException e) {\n Log.e(Constants.TAG, \"IOException when searching movies\", e);\n return null;\n } // end try-catch\n }", "public static void getMovies(final OnMoviesArrivedListener listener){\n //3.1) ExecutorService or Thread\n ExecutorService service = Executors.newSingleThreadExecutor();\n //3.2) Service.execute(Runnable)\n service.execute(new Runnable() {\n @Override\n public void run() {\n //3.2.0) try catch(exception e)\n try{\n //3.2.1) URL url = new...\n URL url = new URL(\"http://api.androidhive.info/json/movies.json\");\n //3.2.2)URLConnection con = url.openConnection\n URLConnection con = url.openConnection();\n //3.2.3)InputStream in = con.getInputStream\n InputStream in = con.getInputStream();\n\n //3.2.4) String json IO.getString(in)\n String json = IO.getString(in);\n\n //3.2.5) parse the json\n List<Movie> movies = parseJson(json);\n\n //3.2.6) notify the listener\n listener.onMoviesArrived(movies, null);\n }catch (Exception e){\n e.printStackTrace();\n listener.onMoviesArrived(null, e);\n }\n\n }\n });\n\n }", "public ArrayList<Product> parseJSONAction(String textJson){\n \n JSONParser j = new JSONParser();\n \n try {\n \n Map<String, Object> productsListJson = j.parseJSON(new CharArrayReader(textJson.toCharArray()));\n ArrayList<Map<String,Object>> productsList = (ArrayList<Map<String,Object>>) productsListJson.get(\"root\");\n //System.out.println(\"pdd \" + productsList.toString());\n Map<String, Object> cart = productsList.get(0);\n //System.out.println(\"cc \" + cart);\n //System.out.println(\"ggg\" + cart.get(\"cart\"));\n ArrayList<Map<String,Object>> lis = (ArrayList<Map<String,Object>>) cart.get(\"cart\");\n //System.out.println(\"lista \" + lis.toString());\n for(Map<String, Object> en : lis){\n Product p = new Product();\n p.setDetails(en.get(\"numProducts\").toString());\n p.setRef_product((int) Double.parseDouble(en.get(\"refProduct\").toString()));\n p.setPrice((int) Float.parseFloat(en.get(\"totalPrice\").toString()));\n products.add(p);\n }\n \n Map<String, Object> data = productsList.get(1);\n ArrayList<Map<String,Object>> llis = (ArrayList<Map<String,Object>>) data.get(\"data\");\n System.out.println(\"dddd\" + llis.toString());\n int i=0;\n for(Map<String, Object> en : llis){\n Product pro = products.get(i);\n pro.setName(en.get(\"name\").toString());\n pro.setPhoto(\"http://127.0.0.1/ftbb_web/ftbb_web/public/images/prod/\"+en.get(\"photo\").toString());\n i++;\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n \n return products; \n }", "private ArrayList<Mascota> deserializarTimelineJson(JsonArray arregloJson){\n\n ArrayList<Mascota> recentMedia = new ArrayList<>();\n\n //Para cada elemento del Json\n for (int i = 0; i < arregloJson.size() ; i++) {\n JsonObject recentMediaDataObject = arregloJson.get(i).getAsJsonObject();\n\n //Obteniendo los Datos de la Imagen Reciente\n String id = recentMediaDataObject.get(JsonKeys.ID).getAsString();\n JsonObject imageJson = recentMediaDataObject.getAsJsonObject(JsonKeys.MEDIA_IMAGES);\n JsonObject imagenStdJson = imageJson.getAsJsonObject(JsonKeys.MEDIA_STANDARD_RESOLUTION);\n String urlFoto = imagenStdJson.get(JsonKeys.MEDIA_URL).getAsString();\n\n //Obteniendo los Likes\n JsonObject likesJson = recentMediaDataObject.getAsJsonObject(JsonKeys.MEDIA_LIKES);\n int likes = likesJson.get(JsonKeys.MEDIA_LIKES_COUNT).getAsInt();\n\n //Obteniendo el Usuario\n JsonObject userJson = recentMediaDataObject.getAsJsonObject(JsonKeys.USER);\n String usuario = userJson.get(JsonKeys.USER_NAME).getAsString();\n String urlFotoPerfil = userJson.get(JsonKeys.SEARCH_PROFILEPICTURE).getAsString();\n\n //Llenando Datos\n Mascota recentMediaActual = new Mascota();\n recentMediaActual.setId(id);\n recentMediaActual.setNombre(usuario);\n recentMediaActual.setUrlFoto(urlFoto);\n recentMediaActual.setLikes(likes);\n recentMediaActual.setUrlFotoPerfil(urlFotoPerfil);\n\n recentMedia.add(recentMediaActual);\n\n }\n return recentMedia;\n }", "@Override\n public List<Movie> loadInBackground() {\n MovieDataExtractor movieDataExtractor = new MovieDataExtractor(getContext());\n List<Movie> movies = movieDataExtractor.extractFeatureFromJson();\n moviesList = movies;\n return moviesList;\n }", "public static List<Planet> extractPlanetFromJson(String jsonString) {\n List<Planet> planets = new ArrayList<>();\n\n try {\n JSONArray planetsArray = new JSONArray(jsonString);\n\n for (int i = 0; i < planetsArray.length(); i++){\n JSONObject currentPlanet = planetsArray.getJSONObject(i);\n\n\n int id = currentPlanet.getInt(\"id\");\n String name = currentPlanet.getString(\"name\");\n int distance = currentPlanet.getInt(\"distance\");\n\n Planet planet = new Planet(id, name, distance);\n planets.add(planet);\n }\n\n } catch (JSONException e) {\n System.out.println(\"Problem parsing the character JSON results\");\n }\n return planets;\n }", "public static Recipes[] ParseRecipeJson(String jsonresponse) throws JSONException {\n JSONArray recipesArray = new JSONArray(jsonresponse);\n Recipes[] recipe = new Recipes[recipesArray.length()];\n\n for (int i = 0; i < recipesArray.length(); i++) {\n recipe[i] = new Recipes();\n JSONObject currentRecipe = recipesArray.getJSONObject(i);\n\n recipe[i].setRecipeId(currentRecipe.getString(\"id\"));\n recipe[i].setRecipeItemName(currentRecipe.getString(\"name\"));\n recipe[i].setRecipeServings(currentRecipe.getString(\"servings\"));\n\n// PARSES INGREDIENTS ARRAY\n JSONArray ingredientsArray = currentRecipe.getJSONArray(\"ingredients\");\n ArrayList<String> ingredientsList = new ArrayList<>();\n ArrayList<String> ingredientsQtyList = new ArrayList<>();\n ArrayList<String> ingredientsMeasureList = new ArrayList<>();\n for (int j = 0; j < ingredientsArray.length(); j++) {\n\n JSONObject currentIngredients = ingredientsArray.getJSONObject(j);\n ingredientsList.add(currentIngredients.getString(\"ingredient\"));\n ingredientsQtyList.add(currentIngredients.getString(\"quantity\"));\n ingredientsMeasureList.add(currentIngredients.getString(\"measure\"));\n }\n\n recipe[i].setRecipeIngredient(ingredientsList);\n recipe[i].setIngredientQuantity(ingredientsQtyList);\n recipe[i].setIngredientMeasure(ingredientsMeasureList);\n\n// PARSES INGREDIENTS ARRAY\n JSONArray stepsArray = currentRecipe.getJSONArray(\"steps\");\n ArrayList<String> stepId = new ArrayList<>();\n ArrayList<String> shortDescription = new ArrayList<>();\n ArrayList<String> description = new ArrayList<>();\n ArrayList<String> videoURL = new ArrayList<>();\n ArrayList<String> thumbnailURL = new ArrayList<>();\n for (int k = 0; k < stepsArray.length(); k++) {\n\n JSONObject currentStep = stepsArray.getJSONObject(k);\n stepId.add(currentStep.getString(\"id\"));\n shortDescription.add(currentStep.getString(\"shortDescription\"));\n description.add(currentStep.getString(\"description\"));\n videoURL.add(currentStep.getString(\"videoURL\"));\n thumbnailURL.add(currentStep.getString(\"thumbnailURL\"));\n }\n\n recipe[i].setStepId(stepId);\n recipe[i].setShortDescription(shortDescription);\n recipe[i].setDescription(description);\n recipe[i].setVideoUrl(videoURL);\n recipe[i].setThumbnilUrl(thumbnailURL);\n }\n return recipe;\n }", "@Override\n public void onRequestSuccess(JSONObject jsonResponse) {\n\n try {\n\n ArrayList<Place> places = new ArrayList<>();\n JSONArray venueArray = jsonResponse.getJSONArray(\"venues\");\n\n // extract Place object from json response and put in array\n for (int i = 0; i < venueArray.length(); i++) {\n JSONObject jo = venueArray.getJSONObject(i);\n places.add(extractFromJSON(jo));\n }\n\n if (listener != null) {\n listener.onPlacesFetchSuccess(places);\n }\n db.addPlaces(places);\n\n\n } catch (JSONException e) {\n e.printStackTrace();\n if (listener != null) {\n listener.onPlaceFetchFail(\"Something went wrong parsing response\");\n }\n }\n\n }", "@Override\n public List<Movie> loadInBackground() {\n\n // obtain the Url, used for the http request\n URL url = AppUtilities.buildUrl(pageNumberBeingQueried, sortOrderOfResults,\n searchQuerySubmitted, preferredMovieGenre, preferredStartYear,\n preferredEndYear, preferenceValuesAreDefault);\n\n // perform the url request\n String jsonResponseString = null;\n try {\n jsonResponseString = AppUtilities.getResponseFromHttpUrl(url);\n } catch (IOException io_exception) {\n io_exception.printStackTrace();\n }\n\n // initialise the return object\n List<Movie> movieList = null;\n\n // if the response String is not null - parse it\n if (jsonResponseString != null) {\n // call helper method to parse JSON\n Pair<List<Movie>, Integer> result = JsonUtilities.extractFromJSONString(jsonResponseString);\n movieList = result.first;\n jsonResponseCode = result.second;\n }\n return movieList;\n }", "private ArrayList<Weather> parseJSON(String json) throws JSONException {\n ArrayList<Weather> forecast = new ArrayList<>();\n JSONArray jsonArray = new JSONObject(json).getJSONArray(\"list\");\n for (int i = 0; i < jsonArray.length(); i++) {\n Weather weather = new Weather();\n JSONObject jsonDay = jsonArray.getJSONObject(i);\n weather.setTimeStamp(jsonDay.getInt(\"dt\"));\n weather.setHigh(jsonDay.getJSONObject(\"temp\").getDouble(\"max\"));\n weather.setLow(jsonDay.getJSONObject(\"temp\").getDouble(\"min\"));\n JSONObject jsonWeather = jsonDay.getJSONArray(\"weather\").getJSONObject(0);\n weather.setWeathCondition(jsonWeather.getString(\"main\"));\n forecast.add(weather);\n }\n return forecast;\n }", "private void parseResponse(String response, List<NewsDetailItem> items) {\n\n Pattern pText = Pattern.compile(ITEM_TEXT_PREF + \".*?\" + ITEM_TEXT_POSTF);\n Pattern pTitle = Pattern.compile(TITLE_PREF + \".*?\" + TITLE_POSTF);\n Pattern pDate = Pattern.compile(\"class=\\\"metadata\\\">.*?</a>\");\n Pattern pDate2 = Pattern.compile(\"</strong>.*?<\");\n\n Pattern pImage2 = Pattern.compile(IMG_PREF + \".*?\" + IMG_POSTF);\n\n Pattern pVideo = Pattern.compile(VIDEO_PREF + \".*?\" + VIDEO_POSTF);\n\n Pattern pImageUrl = Pattern.compile(IMG_URL_PREF + \".*?\" + IMG_URL_POSTF);\n\n Pattern pComment = Pattern.compile(\"li class=\\\" item\\\" id=\\\"comment.*?</li>\");\n Pattern pAuthor = Pattern.compile(\"class=\\\"commentauthor\\\".*?</span>\");\n\n Pattern pAuthorName1 = Pattern.compile(\"'>.*?</span>\");\n Pattern pAuthorName2 = Pattern.compile(\"/>.*?</span>\");\n Pattern pAuthorImage = Pattern.compile(AUTHOR_IMAGE_PREF + \".*?\" + AUTHOR_IMAGE_POSTF);\n\n Pattern pCommentText = Pattern.compile(\"<span id=\\\"co_.*?</li>\");\n Pattern pCommentId = Pattern.compile(COMMENT_ID_PREFIX + \".*?\" + COMMENT_ID_POSTFIX);\n\n Pattern pCommentTex2t = Pattern.compile(\"dislike-counter.*?comment-toolbar\"); //Pattern.compile(COMMENT_PREFIX + \".*?\" + COMMENT_POSTFIX);\n Pattern pCommentText3 = Pattern.compile(COMMENT_PREFIX + \".*?\" + COMMENT_POSTFIX);\n Pattern pThumbsDown = Pattern.compile(\"dislike-counter-comment.*?</span>\");\n Pattern pThumbsUp = Pattern.compile(\"like-counter-comment.*?</span>\");\n Pattern pThumb2 = Pattern.compile(THUMB_PREF + \".*?\" + THUMB_POSTF);\n\n Pattern pCommentDate = Pattern.compile(COMMENTDATE_PREF + \".*?\" + COMMENTDATE_POSTF);\n Pattern pWidth = Pattern.compile(WIDTH_PREF + \".*?\" + WIDTH_POSTF);\n Pattern pHeight = Pattern.compile(HEIGHT_PREF + \".*?\" + HEIGHT_POSTF);\n\n Pattern pAkismet = Pattern.compile(\"vortex_ajax_comment\"+\".*?\"+\";\");\n\n Pattern pAkismet2 = Pattern\n .compile(\"\\\"nonce\\\":\\\".*?\"+\"\\\"\");\n\n Pattern pValue = Pattern.compile(\"value=\\\".*?\\\"\");\n\n Pattern pAk_js = Pattern\n .compile(\"id=\\\"ak_js\\\".*?/>\");\n\n\n String akismet = \"\";\n String ak_js = \"\";\n String postId = \"\";\n Matcher makismet_comment = pAkismet.matcher(response);\n if (makismet_comment.find()) {\n Matcher mvalue = pAkismet2.matcher(makismet_comment.group());\n if (mvalue.find()) {\n akismet = mvalue.group();\n akismet = akismet.replace(\"\\\"\", \"\");\n akismet = akismet.replace(\"nonce:\", \"\");\n }\n }\n\n Matcher mak_js = pAk_js.matcher(response);\n if (mak_js.find()) {\n Matcher mvalue = pValue.matcher(mak_js.group());\n if (mvalue.find()) {\n ak_js = mvalue.group();\n ak_js = ak_js.replace(\"\\\"\", \"\");\n ak_js = ak_js.replace(\"value=\", \"\");\n }\n }\n\n\n Pattern ppost_id = Pattern.compile(\"name=\\\"comment_post_ID\\\".*?/>\");\n Matcher mpost_id = ppost_id.matcher(response);\n if (mpost_id.find()) {\n Matcher mvalue = pValue.matcher(mpost_id.group());\n if (mvalue.find()) {\n postId = mvalue.group();\n postId = postId.replace(\"\\\"\", \"\");\n postId = postId.replace(\"value=\", \"\");\n }\n }\n\n Matcher itemMatcher;\n itemMatcher = pDate.matcher(response);\n String date = \"\";\n if (itemMatcher.find()) {\n itemMatcher = pDate2.matcher(itemMatcher.group());\n if (itemMatcher.find()) {\n date = itemMatcher.group().substring(10);\n date = date.substring(0, date.length() - 2);\n }\n }\n\n Matcher mTitle = pTitle.matcher(response);\n if (mTitle.find()) {\n String itemText = mTitle.group().substring(TITLE_PREF.length()); //(\" dc:title=\\\"\".length()).replace(\"\\\"\", \"\");\n itemText = itemText.substring(0, itemText.length() - TITLE_POSTF.length());\n NewsDetailItem item = new NewsDetailItem();\n item.setText(itemText);\n item.setDate(date);\n item.setContentType(NewsDetailDBHelper.NewsItemType.TITLE.ordinal());\n item.setPostUrl(mUrl);\n item.setCommentId(postId);\n item.setAkismet(akismet);\n item.setAk_js(ak_js);\n items.add(item);\n }\n\n Matcher mText = pText.matcher(response);\n int imageEnd = 0;\n int textStart;\n\n if (mText.find()) {\n String text = mText.group().substring(ITEM_TEXT_PREF.length());\n text = text.substring(0, text.length() - ITEM_TEXT_POSTF.length());\n Matcher mImage = pImage2.matcher(text);\n while (mImage.find()) {\n int textEnd = mImage.start();\n textStart = imageEnd;\n imageEnd = mImage.end();\n String itemText = text.substring(textStart, textEnd);\n addTextItem(items, itemText);\n processImageItem(items, mImage.group(), pImageUrl, pWidth, pHeight);\n }\n\n Matcher mVideo = pVideo.matcher(text);\n while (mVideo.find()) {\n int textEnd = mVideo.start();\n textStart = imageEnd;\n imageEnd = mVideo.end();\n String itemText = \"\";\n if (textEnd >= textStart) {\n itemText = text.substring(textStart, textEnd);\n }\n addTextItem(items, itemText);\n processVideoItem(items, mVideo.group(), pImageUrl, pWidth, pHeight);\n }\n\n text = text.substring(imageEnd);\n addTextItem(items, text);\n }\n\n\n NewsDetailItem item = new NewsDetailItem();\n item.setContentType(NewsDetailDBHelper.NewsItemType.REPLY_HEADER.ordinal());\n item.setPostUrl(mUrl);\n items.add(item);\n\n Matcher mComment = pComment.matcher(response);\n while (mComment.find()) {\n item = new NewsDetailItem();\n item.setContentType(NewsDetailDBHelper.NewsItemType.REPLY.ordinal());\n item.setPostUrl(mUrl);\n items.add(item);\n item.setAkismet(akismet);\n String comment = mComment.group();\n\n // if (comment.contains(CAN_CHANGE_KARMA_PREFIX)) {\n item.setCanChangeKarma(1);\n // } else {\n // item.setCanChangeKarma(0);\n // }\n\n Matcher mAuthor = pAuthor.matcher(comment);\n if (mAuthor.find()) {\n String authorText = mAuthor.group();\n item.setAuthorImage(getAuthorImgage(authorText, pAuthorImage));\n item.setAuthor(getAuthorName(authorText, pAuthorName1, pAuthorName2));\n }\n Matcher mCommentText = pCommentText.matcher(comment);\n if (mCommentText.find()) {\n String s = mCommentText.group();\n mCommentText = pCommentTex2t.matcher(s);\n if (mCommentText.find()) {\n mCommentText = pCommentText3.matcher(mCommentText.group());\n if (mCommentText.find()) {\n String commentText = mCommentText.group().substring(COMMENT_PREFIX.length());\n commentText = commentText.substring(0, commentText.length() - COMMENT_POSTFIX.length());\n commentText = commentText.replace(\"<p>\", \"\");\n commentText = commentText.replace(\"</p>\", \"\");\n item.setText(commentText);\n }\n }\n }\n Matcher mCommentId = pCommentId.matcher(comment);\n if (mCommentId.find()) {\n String commentId = mCommentId.group().substring(COMMENTDATE_PREF.length());\n commentId = commentId.substring(0, commentId.length() - COMMENT_ID_POSTFIX.length());\n item.setCommentId(commentId);\n }\n Matcher mCommentDate = pCommentDate.matcher(comment);\n if (mCommentDate.find()) {\n String commentDate = mCommentDate.group().substring(COMMENTDATE_PREF.length());\n commentDate = commentDate.substring(0, commentDate.length() - COMMENTDATE_POSTF.length());\n item.setDate(commentDate);\n }\n item.setKarmaUp(getKarma(comment, pThumbsUp, pThumb2));\n item.setkarmaDown(getKarma(comment, pThumbsDown, pThumb2));\n }\n }", "public static ArrayList<Movie> readMovie(String filename) throws IOException {\n\t\t// read String from text file\n\t\tArrayList<String> stringArray = (ArrayList)read(filename);\n\t\tArrayList<Movie> alr = new ArrayList<>() ;// to store Professors data\n\n for (int i = 0 ; i < stringArray.size() ; i++) {\n\t\t\t\tString st = (String)stringArray.get(i);\n\t\t\t\t// get individual 'fields' of the string separated by SEPARATOR\n\t\t\t\tStringTokenizer star = new StringTokenizer(st , SEPARATOR1);\t// pass in the string to the string tokenizer using delimiter \",\"\n while(star.hasMoreTokens()){\n int movieid = Integer.parseInt(star.nextToken().trim());\n\t\t\t\tString movietitle = star.nextToken().trim();\t// first token\n\t\t\t\tString type = star.nextToken().trim();\t// second token\n\t\t\t\tString rating = star.nextToken().trim();\t// third token\n\t\t\t\tString status = star.nextToken().trim();\t// fourth token\n\t\t\t\tString synopsis = star.nextToken().trim();\t// fifth token\n\t\t\t\tString director = star.nextToken().trim();\t// sixth token\n\t\t\t\tString cast = star.nextToken().trim();\t// seventh token\n\t\t\t\tString ticketSales = star.nextToken().trim();\t// eight token\n\t\t\t\tString totalRating = star.nextToken().trim();\t// ninth token\n\t\t\t\tString ratingNum = star.nextToken().trim();\t// seventh token\n\t\t\t\tString duration = star.nextToken().trim();\t// tenth token\n\t\t\t\t// create Professor object from file data\n\t\t\t\tMovie m = new Movie(movieid, movietitle, type, ratingNum, status, synopsis, director, cast, ticketSales\t, totalRating, ratingNum, duration);\n\t\t\t\t// add to Professors list\t\n\t\t\t\talr.add(m) ;\n }\n\t\t\t}\n\t\t\n\t\t\n\t\t\treturn alr ;\n\t\n\t}", "private void parseJsonFeed(JSONObject response) {\n try {\n JSONArray newsArray = response.getJSONArray(\"news\");\n hidePDialog();\n\n for (int i = 0; i < newsArray.length(); i++) {\n JSONObject feedObj = (JSONObject) newsArray.get(i);\n\n NewsItem news = new NewsItem();\n\n news.setId(feedObj.getString(\"id\"));\n news.setTitle(feedObj.getString(\"title\"));\n news.setDate(\"Posted on \" + feedObj.getString(\"created_at\"));\n news.setBrief(feedObj.getString(\"brief\"));\n\n //news.setDate(feedObj.getString(\"mdate\"));\n// String rd = feedObj.getString(\"mdate\");\n// news.setDate(\"Release date: \" + rd);\n\n mItems.add(news);\n }\n\n // notify data changes to list adapater\n newsAdapter.notifyDataSetChanged();\n\n } catch (JSONException e) {\n e.printStackTrace();\n hidePDialog();\n }\n }", "private ArrayList<Club> parseClubJSONInfo(String clubJSONInfo)\n\t{\n\t\tArrayList<Club> clubs = new ArrayList<Club>();\n\t\tClub c;\n\t\ttry\n\t\t{\n\t\t\tJSONObject jsonObject = new JSONObject(clubJSONInfo); //a big string of values\n\t\t\t\n\t\t\t//Club Data -- contains ALL clubs\n \t\tJSONArray clubsArray = jsonObject.getJSONArray(\"clubs\");\n \t\t\n \t\tif(clubsArray.length() > 0)\n \t\t{\n\t \t\t// Grab the first club\n \t\t\tfor(int y = 0; y < clubsArray.length(); y++) \n\t\t\t\t{\n \t\t\t\tJSONObject club = clubsArray.getJSONObject(y);\n\t\t\t\t\n\t\t\t\t\t// Take all the info from the club JSON file\n\t\t\t\t\t\n\t\t\t\t\t//get the geopoint from the lat and lon\n\t\t\t\t\tdouble latitude = Double.parseDouble(club.getString(\"lat\"));\n\t\t\t double lonitude = Double.parseDouble(club.getString(\"lon\"));\n\t\t\t LatLng marker = new LatLng(latitude, lonitude);\n\t\t\t\t\tGeoPoint geo = new GeoPoint((int) (latitude * 1E6), (int) (lonitude * 1E6));\n\t\t\t\t\t\n\t\t\t\t\tString name = club.getString(\"name\");\n\t\t\t\t\tString grounds = club.getString(\"grounds\");\n\t\t\t\t\tString description = club.getString(\"description\");\n\t\t\t\t\tString colours = club.getString(\"colours\");\n\t\t\t\t\tString website = club.getString(\"website\");\n\t\t\t\t\tString facebook = club.getString(\"facebook\");\n\t\t\t\t\tString twitter = club.getString(\"twitter\");\n\t\t\t\t\tString email = club.getString(\"email\");\n\t\t\t\t\tString phone = club.getString(\"phone\");\n\t\t\t\t\t\n\t\t\t\t\t//now fill out the description\n\t\t\t\t\tString info = \"\"; \n\t\t\t\t\tif(grounds.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Log.i(\"log_tag\", \"Grounds = \\\"\" + grounds + \"\\\"\");\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += grounds.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\n\" + grounds.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(description.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += description.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\n\" + description.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(colours.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Colours: \" + colours.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nColours: \" + colours.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(website.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Web: \" + website.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nWeb: \" + website.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(facebook.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Facebook: \" + facebook.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nFacebook: \" + facebook.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(twitter.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Twitter: \" + twitter.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nTwitter: \" + twitter.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(email.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Email: \" + email.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nEmail: \" + email.toString();\n\t\t\t\t\t}\n\t\t\t\t\tif(phone.length() != 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(info == \"\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinfo += \"Phone: \" + phone.toString();\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tinfo += \"\\nPhone: \" + phone.toString();\n\t\t\t\t\t}\n\t\t\t\t\t//Log.i(\"log_tag\", \"Info = \\\"\" + info + \"\\\"\");\n\t\t\t\t\tc = new Club(name.toString(), info, geo, marker);\n\t\t\t\t\tclubs.add(c);\n\t \t\t}\n \t\t\t\n \t\t\tCollections.sort(clubs);\n \t\t}\n\t\t\t\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tLog.e(\"log_tag\", \"Error creating JSON Objects:\" + e.toString());\n\t\t}\n\t\t\n\t\treturn clubs;\n\t}", "public void jsonIMDBParse(){\n\n RequestQueue mQueue;\n mQueue = Volley.newRequestQueue(this);\n\n String tmdbUrl = \"https://api.themoviedb.org/3/movie/\"+ movie.getId() + \"/external_ids?api_key=1e9f1e07ae99796a8c5c9932ada044ab\";\n\n JsonObjectRequest request = new JsonObjectRequest(Request.Method.GET, tmdbUrl, null,\n new Response.Listener<JSONObject>() {\n @Override\n public void onResponse(JSONObject response) {\n\n String imdbId = \"\";\n\n try {\n imdbId = response.getString(\"imdb_id\");\n Log.i(\"imdb code\", imdbId);\n jsonYifyParse(imdbId);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n error.printStackTrace();\n }\n });\n mQueue.add(request);\n\n }", "private void parseJSON(String jsonString) {\n mChatList.clear();\n try {\n JSONObject chats = new JSONObject(jsonString);\n JSONArray items = chats.getJSONArray(\"messages\");\n for (int i = 0; i < items.length(); i++) {\n JSONObject chat = items.getJSONObject(i);\n String client = chat.getString(\"client\");\n String date = chat.getString(\"date\");\n int likes = chat.getInt(\"likes\");\n int dislikes = chat.getInt(\"dislikes\");\n String message = chat.getString(\"message\");\n String _id = chat.getString(\"_id\");\n Chat current = new Chat();\n current.setUser(client);\n current.setDate(date);\n current.setmLikes(likes);\n current.setmDislikes(dislikes);\n current.setmContent(message);\n current.set_id(_id);\n //adds new chat to the list\n mChatList.add(current);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {\n super.onViewCreated(view, savedInstanceState);\n\n final EditText etInput = view.findViewById(R.id.etInput);\n Button searchBtn = view.findViewById(R.id.searchBtn);\n RecyclerView rvSearchRes = view.findViewById(R.id.rvSearchResults);\n\n searchResults = new ArrayList<>();\n\n // Create the adapter\n final MovieSearchAdapter movieAdapter = new MovieSearchAdapter(getContext(), searchResults);\n\n // Set the adapter on the recycler view\n rvSearchRes.setAdapter(movieAdapter);\n\n // Set a Layout Manager\n rvSearchRes.setLayoutManager(new LinearLayoutManager(getContext()));\n\n searchBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n String query = etInput.getText().toString();\n if (query.isEmpty()) {\n Toast.makeText(getContext(), \"Empty Field\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n Toast.makeText(getContext(), query, Toast.LENGTH_SHORT).show();\n\n String URL = String.format(\"https://api.themoviedb.org/3/search/movie?api_key=%s&language=en-US&query=%s&page=1&include_adult=false\", KEY, query);\n\n final AsyncHttpClient client = new AsyncHttpClient();\n client.get(URL, new JsonHttpResponseHandler() {\n @Override\n public void onSuccess(int i, Headers headers, JSON json) {\n Log.d(TAG, \"onSuccess\");\n JSONObject jsonObject = json.jsonObject;\n try {\n JSONArray results = jsonObject.getJSONArray(\"results\");\n Log.i(TAG, \"Releases: \" + results.toString());\n\n searchResults.addAll(Movie.fromJsonArray(results));\n movieAdapter.notifyDataSetChanged();\n Log.i(TAG, \"Movies: \" + searchResults.size());\n } catch (JSONException e) {\n Log.e(TAG, \"Hit JSON Exception\", e);\n }\n }\n\n @Override\n public void onFailure(int i, Headers headers, String s, Throwable throwable) {\n Log.d(TAG, \"onFailure\" + i);\n }\n });\n }\n });\n\n }", "@Override\n\tpublic List<Object> modifyMovies(JSONObject param) {\n\t\tString name =StringUtil.ToString(param.getString(\"movieName\"));\n\t\tSystem.out.println(name);\n\t\tMap<String, Object> movie = new HashMap<String, Object>();\n\t\tmovie.put(\"name\", name);\n\t\tList<Object> movies = this.queryForList(\"Movie.selectByName\", movie);\n\t\treturn movies;\n\t}", "public void parseSpotifyTracks(JSONArray res, int playlistPos){\n\n Song song;\n JSONObject jsonObject;\n\n for(int i = 0; i < res.length(); i++){\n try {\n jsonObject = res.getJSONObject(i);\n\n song = new Song(jsonObject.getJSONObject(\"track\").getJSONArray(\"artists\")\n .getJSONObject(0).getString(\"name\"),\n jsonObject.getJSONObject(\"track\").getString(\"name\"),\n jsonObject.getJSONObject(\"track\").getJSONObject(\"album\")\n .getString(\"name\"));\n\n playlists.get(playlistPos).addTrack(song);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n\n }", "public List<Movie> search() {\n keyword = URLEncoder.encode(keyword);\n String url = \"http://api.rottentomatoes.com/api/public/v1.0/movies.json?apikey=yedukp76ffytfuy24zsqk7f5&q=\"\n + keyword + \"&page_limit=20\";\n apicall(url);\n System.out.println(url);\n System.out.println(data);\n GsonBuilder builder = new GsonBuilder();\n Gson gson = builder.create();\n MovieResponse response = gson.fromJson(data, MovieResponse.class);\n List<Movie> movies = response.getMovies();\n movieData = movies;\n return movieData;\n }", "private void parseJsonAndReturnUrl(String jsonData){\n String videoUri, videoName;\n videos = new ArrayList<>();\n Video video = null;\n try {\n JSONObject root = new JSONObject(jsonData);\n JSONArray topicsArray = root.getJSONArray(\"topic_data\");\n if(topicsArray.length() == 0){\n return;\n }\n for(int i=0; i< topicsArray.length(); i++){\n JSONArray topics = topicsArray.getJSONArray(i);\n videoUri = topics.getString(3);\n\n Log.d(TAG, \"video path: \"+videoUri);\n\n videoName = topics.getString(0);\n\n Log.d(TAG, \"video name: \"+videoUri);\n\n video = new Video();\n\n video.setmVideoName(videoName);\n video.setmVideoUrl(videoUri);\n\n videos.add(video);\n\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }", "public static List<Ship> extractShipsFromJson(String jsonString) {\n List<Ship> ships = new ArrayList<>();\n\n try {\n JSONArray shipsArray = new JSONArray(jsonString);\n\n for (int i = 0; i < shipsArray.length(); i++){\n JSONObject currentShip = shipsArray.getJSONObject(i);\n\n\n int id = currentShip.getInt(\"id\");\n String name = currentShip.getString(\"name\");\n int speed = currentShip.getInt(\"speed\");\n String type = currentShip.getString(\"type\");\n int maxCargoWeight = currentShip.getInt(\"maxCargoWeight\");\n\n Ship ship = new Ship(id, name, speed, type, maxCargoWeight);\n ships.add(ship);\n }\n\n } catch (JSONException e) {\n System.out.println(\"Problem parsing the character JSON results\");\n }\n return ships;\n }", "public static ArrayList<PieceOfNews> convertPONJson(String jsonNews){\n\n ArrayList<PieceOfNews> allPon = new ArrayList<>();\n\n try {\n JSONObject data = new JSONObject(jsonNews);\n JSONArray jsonAllNews = data.getJSONArray(\"articles\");\n\n\n for (int i = 0; i < jsonAllNews.length(); i++) {\n\n JSONObject jsonPieceOfNews = jsonAllNews.getJSONObject(i);\n\n PieceOfNews pon = new PieceOfNews();\n\n if(jsonPieceOfNews.has(\"author\")){\n pon.setAuthor(jsonPieceOfNews.getString(\"author\"));\n }\n pon.setTitle(jsonPieceOfNews.getString(\"title\"));\n pon.setUrlToExtendedPOF(jsonPieceOfNews.getString(\"url\"));\n\n if(jsonPieceOfNews.has(\"urlToImage\")){\n pon.setUrlToImage(jsonPieceOfNews.getString(\"urlToImage\"));\n }\n\n allPon.add(pon);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n return allPon;\n\n }", "@Override\n public void onResponse(JSONObject response) {\n try {\n loading.dismiss();//hilangkan loading\n JSONArray array = response.getJSONArray(\"data\");\n\n for (int i = 0; i < array.length(); i++){\n JSONObject json = array.getJSONObject(i);\n Log.i(\"JSON \",\"\"+json); //nampilin info\n MovieList movie = new MovieList();\n movie.setMovie(json.getString(Config.TAG_MOVIE));\n movie.setPoster(json.getString(Config.TAG_POSTER));\n movie.setGenre(json.getString(Config.TAG_GENRE));\n movie.setDuration(json.getString(Config.TAG_DURATION));\n\n JSONArray arrayjadwal = json.getJSONArray(\"jadwal\");\n for (int ih = 0; ih < arrayjadwal.length(); ih++){\n JSONObject objectJadwal = arrayjadwal.getJSONObject(0);\n Log.i(\"JSON jadwal \",\"\"+objectJadwal); //nampilin info\n movie.setHarga(objectJadwal.getString(Config.TAG_HARGA));\n }\n\n listMovies.add(movie);\n }\n setAdapter(listMovies);\n\n } catch (JSONException e) {\n e.printStackTrace();\n Log.i(\"Errornya\",\"\"+e);\n Toast.makeText(MainActivity.this, \"Errornya\"+e.getMessage(), Toast.LENGTH_SHORT).show();\n }\n }", "public static ArrayList<MovieList> getMovieListsBySearch(String accessToken, String term) {\n final ArrayList<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();\n params.add(new BasicNameValuePair(PARAM_TERM, term));\n try {\n\n Log.i(Constants.TAG, \"MOVIES URI: \" + MOVIES_SEARCH_LISTS_URI);\n JsonObject moviesJson = getWebService(params, MOVIES_SEARCH_LISTS_URI, accessToken).getAsJsonObject();\n Log.i(Constants.TAG, \"MOVIES RESULT: \" + moviesJson.toString());\n if (moviesJson != null) {\n Gson gson = new GsonBuilder()\n .setDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\")\n .create();\n\n ArrayList<MovieList> movieList = gson.fromJson(\n moviesJson.get(\"lists\"),\n new TypeToken<ArrayList<MovieList>>() {\n }.getType());\n return movieList;\n } else {\n return null;\n } // end if-else\n } catch (APICallException e) {\n Log.e(Constants.TAG, \"HTTP ERROR when searching movies - STATUS:\" + e.getMessage(), e);\n return null;\n } catch (IOException e) {\n Log.e(Constants.TAG, \"IOException when searching movies\", e);\n return null;\n } // end try-catch\n }", "private void parseData(JSONArray array) {\n for (int i = 0; i <= array.length(); i++) {\n //Creating the exam object\n ExamsList exam = new ExamsList();\n JSONObject json = null;\n try {\n //Getting json\n json = array.getJSONObject(i);\n //Adding data to the exam object\n exam.setSubjectTitle(json.getString(Config.TAG_SUBJECT_TITLE));\n exam.setExamName(json.getString(Config.TAG_EXAM_NAME));\n exam.setExamScore(json.getString(Config.TAG_SCORE));\n exam.setExamItems(json.getString(Config.TAG_ITEMS));\n exam.setExamPercent(json.getString(Config.TAG_PERCENT));\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n //Adding the exam object to the list\n listExams.add(exam);\n }\n\n //Notifying the adapter that data has been added or changed\n adapter.notifyDataSetChanged();\n\n }", "public static void parseTheResponse(JSONArray jArray) {\n\t\t/*\n\t\t * we persist this response in the DataHolder\n\t\t * should we need the original response\n\t\t */\n\t\tDataHolder.getDataHolder().setApiResponse(jArray);\n\t\tCustomer customer = null;\n\t\tCustomerView view = null;\n\t\tJSONObject obj = null;\n\t\tList<Customer>customers = new ArrayList<Customer>();\n\t\tfor(int i = 0; i < jArray.length(); i++){\n\t\t\ttry {\n\t\t\t\tobj = jArray.getJSONObject(i);\n\t\t\t\t/*\n\t\t\t\t * create Customer objects and set\n\t\t\t\t * their properties from the JSONObject\n\t\t\t\t * data. Then add these object to a List\n\t\t\t\t */\n\t\t\t\tcustomer = new Customer();\n\t\t\t\tcustomer.setName(obj.getString(\"name\"));\n\t\t\t\tcustomer.setUserId(String.valueOf(obj.getInt(\"user_id\")));\n\t\t\t\tfloat lat = (float)obj.getDouble(\"latitude\");\n\t\t\t\tfloat lon = (float)obj.getDouble(\"longitude\");\n\t\t\t\tcustomer.setLatitude(lat);\n\t\t\t\tcustomer.setLongitude(lon);\n\t\t\t\tdouble distance = DistanceCalculator.distanceBetween(\n\t\t\t\t\t\tuserCoords[0], userCoords[1], lat, lon);\n\t\t\t\tcustomer.setDistanceFrom(distance);\n\t\t\t\tcustomers.add(customer);\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t}\n\t\t/*\n\t\t * use the view object to show the results\n\t\t */\n\t\tview = new CustomerView(SortByDistance.sortedList(customers));\n\t\tSystem.out.println(\"/// SORTED LIST BY DISTANCE ///\\n\");\n\t\tview.displayCustomers();\n\t\t\n\t\tSystem.out.println(\"\\n/// SORTED WITHIN 100KM ///\\n\");\n\t\t/*\n\t\t * use of the Criteria/Filter pattern to\n\t\t * sort the list of customers who are less than\n\t\t * 100Km from our office\n\t\t */\n\t\tCriteria criteria = new CriteriaDistance();\n\t\tList<Customer>sortedList = criteria.meetCriteria(customers);\n\t\tview = new CustomerView(SortByID.sortedList(sortedList));\n\t\tview.displayCustomers();\n\t\t/*\n\t\t * lets persist this new sorted list in the DataHolder\n\t\t */\n\t\tDataHolder.getDataHolder().setCustomers(SortByID.sortedList(sortedList));\n\t\t/*\n\t\t * Print the invitee List to a text doc.\n\t\t */\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor(Customer c : SortByID.sortedList(sortedList)){\n\t\t\tsb.append(c.toString() + \"\\n\");\n\t\t}\n\t\tFileWriterUtil.printToFile(sb.toString());\n\t}", "public Movie serializeToMovie (JSONObject jsonObject, int ID) {\n try{\n if(ID >= 0){\n String name = jsonObject.getString(\"Title\");\n String genre = jsonObject.getString(\"Genre\");\n String format = jsonObject.getString(\"Format\");\n int year = Integer.parseInt(jsonObject.getString(\"Year\"));\n String director = jsonObject.getString(\"Director\");\n String writersLine = jsonObject.getString(\"Writers\");\n String[] writers = writersLine.split(\",\");\n String starsLine = jsonObject.getString(\"Stars\");\n String[] stars = starsLine.split(\",\");\n return new Movie(ID, name, genre, format, year, director, writers, stars);\n } else {\n throw new IllegalArgumentException(\"ID must be positive.\");\n }\n } catch(JSONException e){\n throw new JSONException(\"JSON is incorrect\");\n }\n }", "public void addSearchFragment(String jString) throws JSONException {\n\n jObj = new JSONObject(jString)\n .getJSONObject(\"Similar\");\n jArr = new JSONArray();\n JSONArray newJArray = jObj.getJSONArray(\"Results\");\n if(V)System.out.println(\"jString = \" + jString);\n\n for (int i = 0; i < newJArray.length(); i++) {\n jObj = newJArray.getJSONObject(i);\n jArr.put(jObj);\n }\n\n if(V)System.out.println(\"jArr = \" + jArr.toString());\n addFragments(jArr, true);\n }", "public static List<TrailerVideo> extractTrailerVideoData(String stringUrl, int movieId) {\n String jsonResponse = fetchResponse(stringUrl);\n if (jsonResponse == null) {\n return null;\n }\n List<TrailerVideo> trailerVideos = new ArrayList<>();\n try {\n JSONObject baseJsonResponse = new JSONObject(jsonResponse);\n JSONArray resultsJSONArray = baseJsonResponse.getJSONArray(RESULTS_KEY);\n for (int i = 0; i < resultsJSONArray.length(); i++) {\n JSONObject currentTrailerVideo = resultsJSONArray.getJSONObject(i);\n String trailerVideoId = currentTrailerVideo.optString(TRAILER_VIDEO_ID_KEY);\n String key = currentTrailerVideo.optString(TRAILER_VIDEO_KEY_KEY);\n String name = currentTrailerVideo.optString(TRAILER_VIDEO_NAME_KEY);\n String site = currentTrailerVideo.optString(TRAILER_VIDEO_SITE_KEY);\n TrailerVideo trailerVideo = new TrailerVideo(movieId, trailerVideoId, key, name, site);\n trailerVideos.add(trailerVideo);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return trailerVideos;\n }", "public void addMovie(ArrayList<Movie> movies)\n {\n String title = \"\";\n String director = \"\";\n String actor1 = \"\";\n String actor2 = \"\";\n String actor3 = \"\";\n int rating = 0;\n \n title = insertTitle();\n boolean checkResult = checkMovieRedundancyByTitle(movies, title);\n if (checkResult == true)\n return;\n \n director = insertDirector();\n actor1 = insertActor(1);\n actor2 = insertActor(2);\n if (actor2.length() != 0)\n actor3 = insertActor(3);\n \n rating = insertRating();\n \n Movie film = createNewMovie(title,director,actor1,actor2,actor3,rating);\n movies.add(film);\n displayOneFilm(film);\n System.out.println(\"\\n\\t\\t\\t >>>>> Yeayy, \" + title.toUpperCase() + \" successfully ADD to database! <<<<< \");\n }", "public static OMDBJsonResponse getMoviesFromJSON(File jsonFile)\n {\n Gson gson = new Gson();\n OMDBJsonResponse searchResult = null;\n\n //using try \"with resources\"\n try(\n FileReader fileReader = new FileReader(jsonFile);\n JsonReader jsonReader = new JsonReader(fileReader);\n )\n {\n searchResult = gson.fromJson(jsonReader, OMDBJsonResponse.class);\n } catch (Exception e)\n {\n e.printStackTrace();\n }\n return searchResult;\n }", "@Override\n public void onResponse(String response) {\n Gson gson = new Gson();\n\n try {\n JSONObject jsonObject = new JSONObject(response);\n String result = jsonObject.getJSONArray(\"results\").toString();\n\n Type listType = new TypeToken<List<Pokemon>>() {\n }.getType(); //Setting up the type for the conversion\n\n pokemonList = gson.fromJson(result, listType);\n pokemonList = pokemonList.subList(0, POKEDEX_LENGTH);\n\n for (int i = 0; i < pokemonList.size(); i++) {\n pokemonList.get(i).setIdFromUrl();\n }\n\n getPokemonListWithTypes();\n } catch (JSONException exception) {\n exception.printStackTrace();\n }\n }", "private void parseMovie(String url) {\n\t\tBoolean is3D = false;\n\t\tDocument doc;\n\t\ttry {\n\t\t\tdoc = Jsoup.connect(WOLFF + url).get();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\t\t\n\n\t\tString movietitle = doc.select(\"#wrapper_left h2\").first().text().trim();\n\t\tSystem.out.println(\"Movie: \" + movietitle);\n\t\t\n\t\t// check if it is 3D movie\n\t\tif(url.contains(\"-3d\")) {\n\t\t\tis3D = true;\n\t\t}\n\n\t\t//create resource movie with the type 'Movie' and data property 'title'\n\t\tResource movie = m.createResource(MOVIE + url.replace(\"/film/\", \"\"));\n\t\tmovie.addProperty(RDF.type, m.getProperty(NS + \"Movie\"))\n\t\t\t .addProperty(m.getProperty(NS + \"title\"), movietitle);\n\n\t\t//if it is 3D movie..\n\t\tif(is3D)\n\t\t\tmovie.addProperty(m.getProperty(NS + \"hasPresentation\"), m.getResource(NS + \"3D\"));\n\n\t\t// does it have corresponding dbpedia resource?\n\t\tString mResult;\n\t\tif((mResult = SparqlQuery.movieInDbpediaEn(movietitle)) != null) {\n\t\t\ttemp = ResourceFactory.createResource(mResult);\n\t\t\tmovie.addProperty(OWL.sameAs, temp);\n\t\t} //else if((mResult = SparqlQuery.movieInDbpediaNl(movietitle)) != null) {\n//\t\t\ttemp = ResourceFactory.createResource(mResult);\n//\t\t\tmovie.addProperty(OWL.sameAs, temp);\n//\t\t}else if((mResult = SparqlQuery.movieInDbpediaDe(movietitle)) != null) {\n//\t\t\ttemp = ResourceFactory.createResource(mResult);\n//\t\t\tmovie.addProperty(OWL.sameAs, temp);\n//\t\t}\n//\t\t\n\t\t//parse sidebar information\n\t\tElements sidebar = doc.select(\".sidebar_container\").get(1).select(\".table_view tr td\");\n\t\t\n\t\tfor (Element element:sidebar) {\n\t\t\tswitch (element.select(\"strong\").text()) {\n\t\t\t//get all actors\n\t\t\tcase \"Acteurs\":\n\t\t\t\tString[] actors = element.text().substring(8).split(\", \"); //Remove \"Acteurs\" from string\n\t\t\t\tfor(String actor : actors) {\n\t\t\t\t\tResource person = m.createResource(PERSON + actor.replace(\" \", \"_\"));\n\t\t\t\t\tperson.addProperty(RDF.type, m.getProperty(NS + \"Person\"))\n\t\t\t\t\t\t .addProperty(m.getProperty(NS + \"name\"), actor.trim());\n\t\t\t\t\tmovie.addProperty(m.getProperty(NS + \"hasActor\"), person);\n\t\t\t\t\t\n\t\t\t\t\t//check if the actor has dbpedia page. Describe as sameAs if true\n\t\t\t\t\tString qResult;\n\t\t\t\t\tif((qResult = SparqlQuery.personInDbpediaEn(actor)) != null) { // in dbpedia.org\n\t\t\t\t\t\ttemp = ResourceFactory.createResource(qResult);\n\t\t\t\t\t\tperson.addProperty(OWL.sameAs, temp);\n\t\t\t\t\t} //else if((qResult = SparqlQuery.personInDbpediaNl(actor)) != null) { // in nl.dbpedia.org\n//\t\t\t\t\t\ttemp = ResourceFactory.createResource(qResult);\n//\t\t\t\t\t\tperson.addProperty(OWL.sameAs, temp);\n//\t\t\t\t\t} else if((qResult = SparqlQuery.personInDbpediaDe(actor)) != null) { // in de.dbpedia.org\n//\t\t\t\t\t\ttemp = ResourceFactory.createResource(qResult);\n//\t\t\t\t\t\tperson.addProperty(OWL.sameAs, temp);\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the director\n\t\t\tcase \"Regie\": //director\n\t\t\t\tString nameString = element.text().substring(6).toString().trim(); //Remove \"Regie\" from string\n\t\t\t\tResource person = m.createResource(PERSON + nameString.replace(\" \", \"_\"));\n\t\t\t\tperson.addProperty(m.getProperty(NS + \"name\"), nameString);\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"hasDirector\"), person);\n\t\t\t\t\n\t\t\t\t//check if the director has dbpedia page. Describe as sameAs if true \n\t\t\t\tString qResult;\n\t\t\t\tif((qResult = SparqlQuery.personInDbpediaEn(nameString)) != null) { // in dbpedia.org\n\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR + qResult);\n\t\t\t\t}// else if((qResult = SparqlQuery.personInDbpediaNl(nameString)) != null) { // in nl.dbpedia.org\n//\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR_NL + qResult);\n//\t\t\t\t} else if((qResult = SparqlQuery.personInDbpediaDe(nameString)) != null) { // in de.dbpedia.org\n//\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR_DE + qResult);\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// a little bit cheating for JJ Abrams\n\t\t\t\tif(nameString.equals(\"Jeffrey (J.J.) Abrams\")) {\n\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR + \"J._J._Abrams\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t//get the duration\n\t\t\tcase \"Speelduur\":\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"duration\"), last(element).toString().trim().split(\" \")[0], XSDDatatype.XSDint);\n\t\t\t\tbreak;\n\n\t\t\t//get the genre\n\t\t\tcase \"Genre\":\n\t\t\t\tString[] genres = last(element).toString().toLowerCase().split(\", \");\n\t\t\t\tfor (String genreName:genres) {\n\t\t\t\t\tif(GENRE_MAP.containsKey(genreName))\n\t\t\t\t\t\tgenreName = GENRE_MAP.get(genreName);\n\t\t\t\t\telse { //unknown genre; report it and create new resource to acommodate\n\t\t\t\t\t\tSystem.out.println(\"*) another genre found: \" + genreName);\n\t\t\t\t\t\tm.createResource(GENRE + genreName)\n\t\t\t\t\t\t .addProperty(RDF.type, m.getProperty(NS + \"Genre\"));\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\tmovie.addProperty(m.getProperty(NS + \"hasGenre\"), m.getResource(GENRE + genreName));\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the language presentation\n\t\t\tcase \"Taal\":\n\t\t\t\tString lang = last(element).toString().trim().toLowerCase();\n\t\t\t\tif(LANGUAGE.containsKey(lang)) {\n\t\t\t\t\tlang = LANGUAGE.get(lang);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"another language found: \" + lang);\n\t\t\t\t}\n\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"language\"), lang);\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the release date\n\t\t\tcase \"In de bioscoop sinds\":\n\t\t\t\tString[] releasedate = last(element).toString().trim().split(\" \");\n\t\t\t\tString day = releasedate[0];\n\t\t\t\tString month = String.valueOf((Arrays.asList(DUTCH_MONTH).indexOf(releasedate[1].toLowerCase()) + 1));\n\t\t\t\tString year = releasedate[2];\n\t\t\t\tString formatteddate = year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"releaseDate\"), formatteddate, XSDDatatype.XSDdateTime);\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the local distributor\n\t\t\tcase \"Distributeur\":\n\t\t\t\tNode distributorLink = (Node) last(element);\n\t\t\t\tResource distributorResource;\n\t\t\t\tif (distributorLink instanceof Element) {\n\t\t\t\t\tdistributorResource = m.createResource(COMPANY + ((Element) distributorLink).text().replace(\" \", \"_\"));\n\t\t\t\t\tdistributorResource.addProperty(m.getProperty(NS + \"companyURL\"), distributorLink.attr(\"href\"));\n\t\t\t\t\tdistributorResource.addProperty(m.getProperty(NS + \"companyName\"), ((Element) distributorLink).text());\n\t\t\t\t\tmovie.addProperty(m.getProperty(NS + \"isDistributedBy\"), distributorResource);\n\t\t\t\t} else {\n\t\t\t\t\tdistributorResource = m.createResource(COMPANY + distributorLink.toString().replace(\" \", \"_\"));\n\t\t\t\t\tdistributorResource.addProperty(m.getProperty(NS + \"companyName\"), distributorLink.toString());\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"isDistributedBy\"), distributorResource);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public GameInfo[] gamesListResponseFromJSON(JSONArray gameCreateResponseJSON){\n\n ArrayList<GameInfo> allActiveGames = new ArrayList<>();\n\n for (int g = 0; g < gameCreateResponseJSON.length(); g++)\n {\n if (gameCreateResponseJSON.getJSONObject(g) != null) {\n //currGameListItem represents a whole GameInfo object, not just a Player\n JSONObject currGameListItem = gameCreateResponseJSON.getJSONObject(g);\n String currGameListItemString = currGameListItem.toString();\n //GameInfo newGameInfo = gsonConverter.fromJson(currGameListItemString, GameInfo.class);\n\n // System.out.println(\">>>JSONTRANSLATOR: gamesListRespFromJSON: game \" + g + \"= \" + currGameListItemString);\n\n //we need to do this manually to remove all null/empty players:\n GameInfo newGameInfo = new GameInfo();\n\n newGameInfo.setTitle(currGameListItem.getString(\"title\"));\n newGameInfo.setId(currGameListItem.getInt(\"id\"));\n\n //we're checking on login that they don't have any blank names, null strings, etc.\n //so we can use the player Name to check if they're a real player or not.\n //only add players to the ArrayList if their name is NOT a null/empty string.\n //this should ensure that each GameInfo object's list of playerInfos only contains real players and not the default null PIs.\n JSONArray currGamePlayerInfosJSONArr = currGameListItem.getJSONArray(\"players\");\n\n ArrayList<PlayerInfo> tempPIArrayList = parsePlayerInfoList(currGamePlayerInfosJSONArr);\n\n // System.out.println(\"\\t ******* picking out real playerInfos:\");\n //go through array result from JSON, and add each REAL player to the ArrayList\n// for (int p = 0; p < currGamePlayerInfosJSONArr.length(); p++) {\n// JSONObject currPlayerInfoJSON = currGamePlayerInfosJSONArr.getJSONObject(p);\n// String currPlayerInfoStr = currPlayerInfoJSON.toString();\n// // System.out.println(\"\\t\\tCurrPlayerInfo= \" + currPlayerInfoStr);\n//\n// //check if it's a real player or just blank\n// if (!currPlayerInfoStr.equals(\"{}\")) {\n// //it's ok to make PlayerInfo object, since it's not blank\n// PlayerInfo newPlayerInfo = gsonConverter.fromJson(currPlayerInfoStr, PlayerInfo.class);\n// newPlayerInfo.setPlayerIndex(p); //their index is whatever number they are in the array\n// tempPIArrayList.add(newPlayerInfo);\n//\n// // System.out.println(\"\\t Player was good, added player: \" + newPlayerInfo);\n// } else {\n// //it was blank, so don't add it to the arraylist\n// // System.out.println(\"\\t Player was null, skipping add\");\n// }\n// }\n\n newGameInfo.setPlayers(tempPIArrayList);\n\n // System.out.println(\"\\t *******>FINAL GAMEINFO: \" + newGameInfo + \", playersArr size= \" + newGameInfo.getPlayers().size());\n\n\n allActiveGames.add(newGameInfo);\n }\n }\n\n //makes an array of GameInfos for the JoinGameView, based on the size of allActiveGames:\n GameInfo[] allGameInfos = allActiveGames.toArray(new GameInfo[allActiveGames.size()]);\n\n return allGameInfos;\n }", "List<MovieListing> searchMovieListingByFilmName(String movieName, List<MovieListing> allMoviesListing);", "@Override\n public void onResponse(JSONArray response) {\n articleList.clear();\n try{\n for(int i = 0; i < response.length(); i++){\n JSONObject obj = response.getJSONObject(i);\n\n Article article = new Article(\n obj.getInt(\"record_id\"),\n obj.getString(\"title\"),\n obj.getString(\"short_info\"),\n obj.getString(\"date\"),\n obj.getString(\"image_url\"),\n null,\n null\n\n );\n articleList.add(article);\n }\n\n } catch (JSONException e){\n //parsing error in json data\n }\n notifyListener();\n\n }", "private void convertJSONArrayToArrayList(JSONArray jsonArray){\n facilityArrayList.clear();\n for(int i = 0; i < jsonArray.length(); i++){\n try {\n if(jsonArray.getJSONObject(i).getString(\"type\").equals(\"Facility\")){\n Element element = new Element();\n element.setId(jsonArray.getJSONObject(i).getJSONObject(\"elementId\").getString(\"id\"));\n element.setName(jsonArray.getJSONObject(i).getString(\"name\"));\n element.setType(jsonArray.getJSONObject(i).getString(\"type\"));\n element.setActive(jsonArray.getJSONObject(i).getBoolean(\"active\"));\n element.setLocationUtil(new LocationUtil(\n jsonArray.getJSONObject(i).getJSONObject(\"location\").getDouble(\"lat\"),\n jsonArray.getJSONObject(i).getJSONObject(\"location\").getDouble(\"lng\")));\n element.getElementAttributes().put(\"description\", jsonArray.getJSONObject(i).getJSONObject(\"elementAttributes\").getJSONObject(\"Info\").getString(\"description\"));\n element.getElementAttributes().put(\"type\", jsonArray.getJSONObject(i).getJSONObject(\"elementAttributes\").getJSONObject(\"Info\").get(\"type\"));\n element.getElementAttributes().put(\"status\", jsonArray.getJSONObject(i).getJSONObject(\"elementAttributes\").getJSONObject(\"Info\").get(\"status\"));\n element.getElementAttributes().put(\"mus_group\", jsonArray.getJSONObject(i).getJSONObject(\"elementAttributes\").getJSONObject(\"Info\").get(\"mus_group\"));\n facilityArrayList.add(element);\n }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n }\n }", "private Ticket[] parseList(String HttpResponse){\n if(HttpResponse == null){\n return null;\n }\n //Parse JSON to Object\n Gson g = new GsonBuilder()\n .setDateFormat(\"yyyy-MM-dd'T'HH:mm:ssZ\")\n .create();\n JsonParser parser = new JsonParser();\n try{ // Try to parse the response\n JsonElement root = parser.parse(HttpResponse);\n if(root.isJsonObject()){\n JsonObject ob = root.getAsJsonObject();\n JsonArray ticketsArray = ob.get(\"tickets\").getAsJsonArray();\n Ticket[] tickets = g.fromJson(ticketsArray, Ticket[].class);\n prevPageURL = ob.getAsJsonObject(\"links\").get(\"prev\").getAsString();\n nextPageURL = ob.getAsJsonObject(\"links\").get(\"next\").getAsString();\n hasMore = ob.getAsJsonObject(\"meta\").get(\"has_more\").getAsBoolean();\n return tickets;\n }\n }\n catch(JsonSyntaxException jse){\n System.out.println(\"Not a valid Json String:\"+jse.getMessage());\n }\n return null;\n }" ]
[ "0.7740387", "0.71707314", "0.7030628", "0.6570496", "0.6548938", "0.65195274", "0.6462535", "0.6425319", "0.6284822", "0.6260613", "0.6126418", "0.61018646", "0.5968722", "0.5823273", "0.57549924", "0.5735151", "0.5715094", "0.5670793", "0.56704354", "0.566336", "0.5629869", "0.5612121", "0.55918354", "0.5585835", "0.55857116", "0.5562563", "0.5545414", "0.55170375", "0.5511095", "0.5491713", "0.5458309", "0.54393244", "0.5426141", "0.542137", "0.5392594", "0.53846735", "0.5380537", "0.53354776", "0.5331958", "0.52992386", "0.5297375", "0.5282511", "0.5278368", "0.5253303", "0.52497756", "0.52488875", "0.5237378", "0.52295184", "0.5228632", "0.52229416", "0.5205472", "0.51832986", "0.51701105", "0.51612324", "0.5157942", "0.5157808", "0.514504", "0.5128645", "0.51216495", "0.51148754", "0.51145875", "0.51135844", "0.51098216", "0.5102929", "0.5094385", "0.5092438", "0.50914574", "0.50888866", "0.507393", "0.50721574", "0.5070477", "0.5055914", "0.5038884", "0.5038774", "0.5032292", "0.50263584", "0.50207686", "0.49740243", "0.49700463", "0.49692628", "0.49681473", "0.4964242", "0.49511248", "0.4934093", "0.49210533", "0.49205515", "0.49137634", "0.49104005", "0.49001113", "0.48947504", "0.48884794", "0.48820233", "0.4869049", "0.4865232", "0.48549876", "0.48509243", "0.48505366", "0.48438907", "0.48391673", "0.48346215" ]
0.80553204
0
TODO Autogenerated method stub
public static void main(String[] args) { Connection conexion=null; try { Class.forName(DRIVER); //vamos a permitir la integridad referencial en sqlite //debemos establecer PRAGMA foreign_keys=ON SQLiteConfig config = new SQLiteConfig(); config.enforceForeignKeys(true); conexion = DriverManager.getConnection(DB_URL, config.toProperties()); System.out.println("Conectando a la BD....."); //Thread.sleep(3000); //simulo operaciones con la BD(3segunda en espera) //vamos a consultar la tabla libro. que tiene entre otros campos, nombre, autor, id categoria //creamos la consulta como String String sql= "select * from librosCategorias2"; //creamos un objeto Statement Statement statement = conexion.createStatement(); //recibimos datos de la consulta en un objeto ResultSet ResultSet resultset = statement.executeQuery(sql); //recorremos el resultset String nombre,autor,categoria; //int id_categoria; while (resultset.next()) { nombre=resultset.getString("nombre"); autor=resultset.getString("autor"); //id_categoria = resultset.getInt("id_categoria"); categoria = resultset.getString(4); System.out.printf("%35s, %10s, %3s%n",nombre,autor,categoria); } //vamos a cambiar el nombre del usuario id=2 sql="update usuarios set nombre='Diego' where id=2"; int filasAfectadas = statement.executeUpdate(sql); System.out.println("Nš filas afectadas "+filasAfectadas); //vamos a borrar el usuario de id = 3; sql="delete from usuarios where id=3"; filasAfectadas = statement.executeUpdate(sql); System.out.println("Nš filas afectadas "+filasAfectadas); System.out.println("--------------------------\n"); //vamos a usar PrepareStatement //vamos a consultar los 2 primeros libros sql = "select * from libros where id=?"; PreparedStatement preparedStatement =conexion.prepareStatement(sql); for (int i = 1; i < 3; i++) { preparedStatement.setInt(1,i); //el 1 hace referencia a id=? resultset = preparedStatement.executeQuery(); while(resultset.next()){ nombre = resultset.getString("nombre"); String editorial = resultset.getString("editorial"); System.out.printf("%15s %15s %n",editorial,nombre); } } //vamos a afrupar sentencias sql usando Batch sql = "insert into usuarios(nombre,apellido)values(?,?) "; preparedStatement= conexion.prepareStatement(sql); preparedStatement.setString(1,"luis felipe"); preparedStatement.setString(2, "Arriaga"); preparedStatement.addBatch(); preparedStatement.setString(1,"luis felipe2"); preparedStatement.setString(2, "Arriaga2"); preparedStatement.addBatch(); //Primero hacemos una cosa y luego hacemos otra /* sql = "update usuarios set nombre=? where apellido=?"; preparedStatement= conexion.prepareStatement(sql); preparedStatement.setString(1, "luis felipe"); preparedStatement.setString(2, "Marca"); preparedStatement.addBatch();*/ int[] affectedRecords = preparedStatement.executeBatch(); System.out.println("Registros afectados"+affectedRecords.length); //vamos a hacer transacciones //primero preparamos la Base de Datos conexion.setAutoCommit(false); String sql1 = "insert into usuarios(nombre,apellido)values('Joaquin','Buitrago')"; String sql2 = "insert into usuarios(nombre,apellido)values('Gracia','Cano')"; statement.execute(sql1); statement.execute(sql2); conexion.commit();//luego ponemos el rollback abajo en el catch donde le hacemos otro try/catch //con esto hacemos que si insertamos un dato que esta mal salta una excepcion y mos deshace lo que //previamente habias metido //cerramos conexion conexion.close(); System.out.println("-----------------\n"); System.out.println("Desconectado la BD"); } catch (ClassNotFoundException | SQLException e) { // TODO Auto-generated catch block try { conexion.rollback(); } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } e.printStackTrace(); } }
{ "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
/double latitude = 37.823689; double longitude = 145.121597;
public void CobaHitung() { PrayTimeCounter prayers = new PrayTimeCounter(); prayers.setTimeFormat(prayers.getTime24()); prayers.setCalcMethod(prayers.getMWL()); prayers.setAsrJuristic(prayers.getShafii()); prayers.setAdjustHighLats(prayers.getAngleBased()); int[] offsets = {0, 0, 0, 0, 0, 0, 0}; // {Fajr,Sunrise,Dhuhr,Asr,Sunset,Maghrib,Isha} prayers.tune(offsets); Date now = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(now); ArrayList<String> prayerTimes = prayers.getPrayerTimes(cal, Anshitu.getApp().getLatitude(), Anshitu.getApp().getLongitude(), Anshitu.getApp().getTimezone()); subuh.setText(prayerTimes.get(0)); terbit.setText(prayerTimes.get(1)); duhur.setText(prayerTimes.get(2)); ashar.setText(prayerTimes.get(3)); maghrib.setText(prayerTimes.get(4)); isya.setText(prayerTimes.get(prayerTimes.size()-1)); /*ArrayList<String> prayerNames = prayers.getTimeNames(); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,prayerNames); jeda.setAdapter(adapter); ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item,prayerTimes); durasi.setAdapter(adapter1);*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "double getLatitude();", "Double getLatitude();", "Double getLatitude();", "public double getLongitude_() { \n return longitude_; \n }", "public double getLatitude_() { \n return latitude_; \n }", "void mo5802a(LatLng latLng);", "BigDecimal getWgs84Latitude();", "private String getLocationForPrint(double latitude, double longitude) {\n int latDegree = (new Double(Math.floor(latitude))).intValue();\n int longDegree = (new Double(Math.floor(longitude))).intValue();\n String latEnd = getString(R.string.latitude_south);\n String longEnd = getString(R.string.longitude_west);\n if (latDegree > 0) {\n latEnd = getString(R.string.latitude_north);\n\n }\n if (longDegree > 0) {\n longEnd = getString(R.string.longitude_east);\n }\n double latSecond = (latitude - latDegree) * 100;\n double latMinDouble = (latSecond * 3d / 5d);\n int latMinute = new Double(Math.floor(latMinDouble)).intValue();\n\n double longSecond = (longitude - longDegree) * 100;\n double longMinDouble = (longSecond * 3d / 5d);\n int longMinute = new Double(Math.floor(longMinDouble)).intValue();\n// return String.format(getString(R.string.geo_location_info), latDegree,\n// latMinute, latEnd, longDegree, longMinute, longEnd);\n return getString(R.string.geo_location_info);\n\n }", "double getLongitude();", "public double getLatitude(){\n return latitude;\n }", "public double getLatitude() { return coordinates.latitude; }", "Report.LocationOuterClass.WGS84 getWgs84();", "long getLatitude();", "Double getLongitude();", "Double getLongitude();", "void setLatitude(Double latitude);", "public String getLocation() {\n\t\treturn \"-12.9990189,-38.5140298\";\n\t}", "@When(\"^we enter latitude as \\\"([^\\\"]*)\\\" and longitude as \\\"([^\\\"]*)\\\"$\")\n\tpublic void we_enter_latitude_as_and_longitude_as(String arg1, String arg2) {\n\ttry {\n\t//\tDouble d1=Double.parseDouble(arg1);\n\t\t//Double d2=Double.parseDouble(arg2);\n\t\t\n\t\t//System.out.println(\"D1 and D2::\"+d1+ \" \"+ d2);\n\t\tList<Product> response=productsApi.productsGet(15.0, 15.0);\n\t\tSystem.out.println(\"RESPONSE:::\"+response.get(0));\n\t} catch(ApiException ape) {\n\t\tSystem.out.println(ape.getCode());\n\t\tSystem.out.println(ape.getMessage());\n\t}\n\t \n\t}", "public int getLat();", "public double getLatitude()\n {\n \treturn latitude;\n }", "BigDecimal getWgs84EndingLatitude();", "public float getLatitude() { return latitude; }", "private String latitudeConversion() {\n int lat = record[1];\n if (lat >= 0) {\n lat = lat & 255;\n }\n lat = (lat << 8) + (record[0] & 255);\n float flat = Float.parseFloat((\"\" + lat + \".\" + (((record[3] & 255) << 8) + (record[2] & 255))));\n int degs = (int) flat / 100;\n float min = flat - degs * 100;\n String retVal = \"\" + (degs + min / 60);\n\n if (retVal.compareTo(\"200.0\") == 0) {\n return \"\";\n } else {\n return retVal;\n }\n }", "public void makeLatLong(String address){\n try {\n JSONObject jsonObject = new JSONObject(address);\n JSONObject result = jsonObject.getJSONObject(\"result\");\n JSONArray addressMatches = result.getJSONArray(\"addressMatches\");\n JSONObject firstResult = addressMatches.getJSONObject(0);\n JSONObject coordinates = firstResult.getJSONObject(\"coordinates\");\n latitude = coordinates.getDouble(\"y\");\n longitude = coordinates.getDouble(\"x\");\n\n Log.i(\"CoY \", Double.toString(latitude));\n Log.i(\"CoX\", Double.toString(longitude));\n } catch (JSONException e) {\n Log.i(\"Error\", e.getMessage());\n e.printStackTrace();\n latitude = 39.7392;\n longitude = -104.9903;\n mainActivity.apiFailed(alarmName);\n }\n }", "public float getLongitude() { return longitude; }", "void setLongitude(Double longitude);", "public void setLongitude(float longitude) { this.longitude = longitude; }", "void getReverInfo(int longitude,int latitude);", "int getLatitude();", "public double getLatitude() {\n return latitude_;\n }", "public void setLongitude(String longitude)\r\n {\r\n this.longitude = longitude; \r\n }", "private void updateGeo(Double latitude, Double longitude) {\n latitudeValue = latitude;\n longitudeValue = longitude;\n }", "long getLongitude();", "public Double getLatitude() {\n return latitude;\n }", "public Double getLatitude() {\n return latitude;\n }", "public Double getLatitude() {\n return latitude;\n }", "public void setLatitude(float latitude) { this.latitude = latitude; }", "int getLongitude();", "public void setLatitude (String strLatitude){\n this.latitude = strLatitude;\n }", "public void setLatitude(double latitude){\n this.latitude = latitude;\n }", "public double getLongitude()\n {\n \treturn longitude;\n }", "public Latitude getLatitude (){\n return trackLat;\n }", "public double getLatitude() {\n return latitude;\n }", "public double getLatitude() {\n return latitude;\n }", "public double getLatitude() {\n return latitude;\n }", "public double getLatitude() {\n return latitude;\n }", "public double getLatitude() {\n return latitude;\n }", "public static void main (String[] args)\r\n {\n Coordenada utm = new Coordenada(new Datum(6378388D, 6356911.94612795),\r\n\t\t\t 481742, 4770800, 700, (byte)29, true);\r\n //System.out.println(\"lon=\"+utm.getLon()+\" lat=\"+utm.getLat());\r\n //System.out.println(utm.getGrados(utm.getLon())+\"¦ \"+utm.getMinutos(utm.getLon())+\"' \"+utm.getSegundos(utm.getLon())+\"\\\" \"+utm.getGrados(utm.getLat())+\"¦ \"+utm.getMinutos(utm.getLat())+\"' \"+utm.getSegundos(utm.getLat())+\"\\\"\");\r\n @SuppressWarnings(\"unused\")\r\n Coordenada res;\r\n res = utm.CambioDeDatum(new Datum(6378137D, 6356752.31424518));\r\n\r\n //System.out.println(\"Coordenadas en Datum destino: X=\"+res.X+\" Y=\"+res.Y);\r\n //System.out.println(\"lon=\"+res.getLon()+\" lat=\"+res.getLat());\r\n //System.out.println(res.getGrados(res.getLon())+\"¦ \"+res.getMinutos(res.getLon())+\"' \"+res.getSegundos(res.getLon())+\"\\\" \"+res.getGrados(res.getLat())+\"¦ \"+res.getMinutos(res.getLat())+\"' \"+res.getSegundos(res.getLat())+\"\\\"\");\r\n\t\t\t\t \r\n }", "@AutoEscape\n\tpublic String getLatitud();", "public String getLatitude()\r\n {\r\n return latitude;\r\n }", "BigDecimal getWgs84Longitude();", "public float getLatitude() {\n return latitude;\n }", "public WGS84Point(double latitude, double longitude) {\r\n\t\tthis.latitude = latitude;\r\n\t\tthis.longitude = longitude;\r\n\t}", "public double getLongitude() {\n return longitude_;\n }", "public Coordinate (double longitude, double latitude) {\n this.longitude = new BigDecimal(longitude);\n this.latitude = new BigDecimal(latitude);\n }", "public double getLat() {\n return lat;\n }", "public double getLat() {\n return lat;\n }", "public double getLat() {\n return lat;\n }", "@Override\n\tpublic void getCoordinates() {\n\t\tSystem.out.println(\"Your Coordinates: 18.1124° N, 79.0193° E \");\n\t}", "int getLatE6();", "int getLatE6();", "public void setLat(double value) {\n lat = value;\n }", "public GpsCoordinate(double latitude, double longitude)\n\t{\n\t\tthis.latitude = latitude;\n\t\tthis.longitude = longitude;\n\t}", "public final flipsParser.latitudeLongitude_return latitudeLongitude() throws RecognitionException {\n flipsParser.latitudeLongitude_return retval = new flipsParser.latitudeLongitude_return();\n retval.start = input.LT(1);\n\n CommonTree root_0 = null;\n\n Token char_literal518=null;\n Token char_literal519=null;\n Token char_literal520=null;\n flipsParser.angularValue_return y1 = null;\n\n flipsParser.angularValue_return x1 = null;\n\n flipsParser.numericValue_return y2 = null;\n\n flipsParser.numericValue_return x2 = null;\n\n flipsParser.latitude_return y3 = null;\n\n flipsParser.longitude_return x3 = null;\n\n\n CommonTree char_literal518_tree=null;\n CommonTree char_literal519_tree=null;\n CommonTree char_literal520_tree=null;\n RewriteRuleTokenStream stream_120=new RewriteRuleTokenStream(adaptor,\"token 120\");\n RewriteRuleSubtreeStream stream_angularValue=new RewriteRuleSubtreeStream(adaptor,\"rule angularValue\");\n RewriteRuleSubtreeStream stream_longitude=new RewriteRuleSubtreeStream(adaptor,\"rule longitude\");\n RewriteRuleSubtreeStream stream_numericValue=new RewriteRuleSubtreeStream(adaptor,\"rule numericValue\");\n RewriteRuleSubtreeStream stream_latitude=new RewriteRuleSubtreeStream(adaptor,\"rule latitude\");\n try {\n // flips.g:754:2: (y1= angularValue ( ',' )? x1= angularValue -> ^( X $x1) ^( Y $y1) | y2= numericValue ( ',' )? x2= numericValue -> ^( X ^( ANGLE $x2 DEGREE ) ) ^( Y ^( ANGLE $y2 DEGREE ) ) | y3= latitude ( ',' )? x3= longitude -> ^( X $x3) ^( Y $y3) )\n int alt203=3;\n alt203 = dfa203.predict(input);\n switch (alt203) {\n case 1 :\n // flips.g:754:4: y1= angularValue ( ',' )? x1= angularValue\n {\n pushFollow(FOLLOW_angularValue_in_latitudeLongitude4379);\n y1=angularValue();\n\n state._fsp--;\n\n stream_angularValue.add(y1.getTree());\n // flips.g:754:20: ( ',' )?\n int alt200=2;\n int LA200_0 = input.LA(1);\n\n if ( (LA200_0==120) ) {\n alt200=1;\n }\n switch (alt200) {\n case 1 :\n // flips.g:754:20: ','\n {\n char_literal518=(Token)match(input,120,FOLLOW_120_in_latitudeLongitude4381); \n stream_120.add(char_literal518);\n\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_angularValue_in_latitudeLongitude4386);\n x1=angularValue();\n\n state._fsp--;\n\n stream_angularValue.add(x1.getTree());\n\n\n // AST REWRITE\n // elements: y1, x1\n // token labels: \n // rule labels: retval, y1, x1\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_y1=new RewriteRuleSubtreeStream(adaptor,\"rule y1\",y1!=null?y1.tree:null);\n RewriteRuleSubtreeStream stream_x1=new RewriteRuleSubtreeStream(adaptor,\"rule x1\",x1!=null?x1.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 755:2: -> ^( X $x1) ^( Y $y1)\n {\n // flips.g:755:5: ^( X $x1)\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(X, \"X\"), root_1);\n\n adaptor.addChild(root_1, stream_x1.nextTree());\n\n adaptor.addChild(root_0, root_1);\n }\n // flips.g:755:14: ^( Y $y1)\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(Y, \"Y\"), root_1);\n\n adaptor.addChild(root_1, stream_y1.nextTree());\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;\n }\n break;\n case 2 :\n // flips.g:756:4: y2= numericValue ( ',' )? x2= numericValue\n {\n pushFollow(FOLLOW_numericValue_in_latitudeLongitude4410);\n y2=numericValue();\n\n state._fsp--;\n\n stream_numericValue.add(y2.getTree());\n // flips.g:756:20: ( ',' )?\n int alt201=2;\n int LA201_0 = input.LA(1);\n\n if ( (LA201_0==120) ) {\n alt201=1;\n }\n switch (alt201) {\n case 1 :\n // flips.g:756:20: ','\n {\n char_literal519=(Token)match(input,120,FOLLOW_120_in_latitudeLongitude4412); \n stream_120.add(char_literal519);\n\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_numericValue_in_latitudeLongitude4417);\n x2=numericValue();\n\n state._fsp--;\n\n stream_numericValue.add(x2.getTree());\n\n\n // AST REWRITE\n // elements: y2, x2\n // token labels: \n // rule labels: retval, y2, x2\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_y2=new RewriteRuleSubtreeStream(adaptor,\"rule y2\",y2!=null?y2.tree:null);\n RewriteRuleSubtreeStream stream_x2=new RewriteRuleSubtreeStream(adaptor,\"rule x2\",x2!=null?x2.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 757:2: -> ^( X ^( ANGLE $x2 DEGREE ) ) ^( Y ^( ANGLE $y2 DEGREE ) )\n {\n // flips.g:757:5: ^( X ^( ANGLE $x2 DEGREE ) )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(X, \"X\"), root_1);\n\n // flips.g:757:9: ^( ANGLE $x2 DEGREE )\n {\n CommonTree root_2 = (CommonTree)adaptor.nil();\n root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ANGLE, \"ANGLE\"), root_2);\n\n adaptor.addChild(root_2, stream_x2.nextTree());\n adaptor.addChild(root_2, (CommonTree)adaptor.create(DEGREE, \"DEGREE\"));\n\n adaptor.addChild(root_1, root_2);\n }\n\n adaptor.addChild(root_0, root_1);\n }\n // flips.g:757:30: ^( Y ^( ANGLE $y2 DEGREE ) )\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(Y, \"Y\"), root_1);\n\n // flips.g:757:34: ^( ANGLE $y2 DEGREE )\n {\n CommonTree root_2 = (CommonTree)adaptor.nil();\n root_2 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(ANGLE, \"ANGLE\"), root_2);\n\n adaptor.addChild(root_2, stream_y2.nextTree());\n adaptor.addChild(root_2, (CommonTree)adaptor.create(DEGREE, \"DEGREE\"));\n\n adaptor.addChild(root_1, root_2);\n }\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;\n }\n break;\n case 3 :\n // flips.g:758:4: y3= latitude ( ',' )? x3= longitude\n {\n pushFollow(FOLLOW_latitude_in_latitudeLongitude4453);\n y3=latitude();\n\n state._fsp--;\n\n stream_latitude.add(y3.getTree());\n // flips.g:758:16: ( ',' )?\n int alt202=2;\n int LA202_0 = input.LA(1);\n\n if ( (LA202_0==120) ) {\n alt202=1;\n }\n switch (alt202) {\n case 1 :\n // flips.g:758:16: ','\n {\n char_literal520=(Token)match(input,120,FOLLOW_120_in_latitudeLongitude4455); \n stream_120.add(char_literal520);\n\n\n }\n break;\n\n }\n\n pushFollow(FOLLOW_longitude_in_latitudeLongitude4460);\n x3=longitude();\n\n state._fsp--;\n\n stream_longitude.add(x3.getTree());\n\n\n // AST REWRITE\n // elements: y3, x3\n // token labels: \n // rule labels: retval, y3, x3\n // token list labels: \n // rule list labels: \n // wildcard labels: \n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_y3=new RewriteRuleSubtreeStream(adaptor,\"rule y3\",y3!=null?y3.tree:null);\n RewriteRuleSubtreeStream stream_x3=new RewriteRuleSubtreeStream(adaptor,\"rule x3\",x3!=null?x3.tree:null);\n\n root_0 = (CommonTree)adaptor.nil();\n // 759:2: -> ^( X $x3) ^( Y $y3)\n {\n // flips.g:759:5: ^( X $x3)\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(X, \"X\"), root_1);\n\n adaptor.addChild(root_1, stream_x3.nextTree());\n\n adaptor.addChild(root_0, root_1);\n }\n // flips.g:759:14: ^( Y $y3)\n {\n CommonTree root_1 = (CommonTree)adaptor.nil();\n root_1 = (CommonTree)adaptor.becomeRoot((CommonTree)adaptor.create(Y, \"Y\"), root_1);\n\n adaptor.addChild(root_1, stream_y3.nextTree());\n\n adaptor.addChild(root_0, root_1);\n }\n\n }\n\n retval.tree = root_0;\n }\n break;\n\n }\n retval.stop = input.LT(-1);\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n \tretval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n\n }\n finally {\n }\n return retval;\n }", "public float getLongitude() {\n return longitude;\n }", "double lat(long v) {\n return world.get(v).lat;\n }", "public Float getLatitude() {\n return latitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "public Double getLongitude() {\n return longitude;\n }", "public void setLng(double value) {\n this.lng = value;\n }", "public static native double geoidh(double lat, double lon);", "public double getGpsLng() {\n return gpsLng;\n }", "public Longitude getLongitude (){\n return trackLon;\n }", "public String getGPS();", "public void set_longitude(double _longitude) {\r\n\t\tthis._longitude = _longitude;\r\n\t}", "public static LatLng degreeToDecimal(String latitude, String longitude)\n {\n String latFirstSplit [] = latitude.split(\"°\");\n String latSecondSplit [] = latFirstSplit[1].split(\"\\\\.\");\n System.out.println(latSecondSplit);\n String latCleanSecondSplit = latSecondSplit[1].replace(\"’\", \"\");\n\n double latDegree = Integer.parseInt(latFirstSplit[0]);\n double latDecimal = Integer.parseInt(latSecondSplit[0]);\n double latMinute = Integer.parseInt(latCleanSecondSplit);\n\n double latitudeDouble = latDegree + ((latDecimal+(latMinute/10000))/60);\n\n String lngFirstSplit [] = longitude.split(\"°\");\n String lngSecondSplit [] = lngFirstSplit[1].split(\"\\\\.\");\n String lngCleanSecondSplit = lngSecondSplit[1].replace(\"’\", \"\");\n\n double lngDegree = Integer.parseInt(lngFirstSplit[0]);\n double lngDecimal = Integer.parseInt(lngSecondSplit[0]);\n double lngMinute = Integer.parseInt(lngCleanSecondSplit);\n\n double longitudeDouble = lngDegree + ((lngDecimal+(lngMinute/10000))/60);\n\n return new LatLng(latitudeDouble, longitudeDouble);\n }", "public void setLatitude(Double latitude) {\n this.latitude = latitude;\n }", "public void setLatitude(Double latitude) {\n this.latitude = latitude;\n }", "public void set_latitude(double _latitude) {\r\n\t\tthis._latitude = _latitude;\r\n\t}", "public void setLat(double value) {\n this.lat = value;\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude;\n }", "public double getLongitude() {\n return longitude;\n }", "public void setLatitude(String latitude)\r\n {\r\n this.latitude = latitude;\r\n }", "public int getLon();", "public float getLatitudeValue (){\n return trackLat.getValue ();\n }", "public String getLocationString(){\n return \"(\" + x + \", \" + y + \")\";\n }", "public void displayCoordsInDegrees() {\n DecimalFormat formatter = new DecimalFormat(\"0.000\");\n\n String latFormat = formatter.format(posMarker.getPosition().latitude);\n String lonFormat = formatter.format(posMarker.getPosition().longitude);\n\n TextView latitude = (TextView) findViewById(R.id.image_latitude);\n TextView longitude = (TextView) findViewById(R.id.image_longitude);\n\n latitude.setText(latFormat); //Use posMarker location as field actually reflects marker position\n longitude.setText(lonFormat); //Use posMarker location as field actually reflects marker position\n }", "public Coordonnees(double _latitude, double _longitude) {\r\n\t\tsuper();\r\n\t\tthis._latitude = _latitude;\r\n\t\tthis._longitude = _longitude;\r\n\t}", "public float getLatitude() {\n return latitude;\n }", "public double getLat() {\r\n\t\treturn lat;\r\n\t}", "public double getLatitude() {\n\t\treturn latitude;\n\t}", "@JsonProperty(\"latitude\")\n public void setLatitude(Double latitude) {\n this.latitude = latitude;\n }", "public String getlat() {\n\t\treturn lat;\n\t}", "public double getLng() {\n return lng;\n }", "public String getLongitude()\r\n {\r\n return longitude;\r\n }", "public float getLongitudeValue (){\n return trackLon.getValue ();\n }", "@JsonProperty(\"latitude\")\n public Double getLatitude() {\n return latitude;\n }" ]
[ "0.65102774", "0.64752126", "0.64752126", "0.6398201", "0.6396456", "0.63140154", "0.62728035", "0.6265835", "0.6235887", "0.61539257", "0.6108374", "0.6087762", "0.6085234", "0.60739243", "0.60739243", "0.6043314", "0.60338056", "0.59863067", "0.59806824", "0.59790725", "0.59695596", "0.59358203", "0.5914209", "0.59140426", "0.5909477", "0.59061027", "0.59023577", "0.58669025", "0.58529997", "0.58317417", "0.57927835", "0.57912475", "0.5780882", "0.5764833", "0.5764833", "0.5764833", "0.57639676", "0.57585216", "0.57577974", "0.5749404", "0.5744175", "0.57325226", "0.5706507", "0.5706507", "0.5706507", "0.5706507", "0.5706507", "0.5706018", "0.5700043", "0.56967527", "0.5694982", "0.5652919", "0.5643959", "0.5643688", "0.5628542", "0.5627203", "0.5627203", "0.5627203", "0.5616647", "0.5614449", "0.5614449", "0.560787", "0.55998784", "0.5593184", "0.5589003", "0.5582797", "0.5575034", "0.556389", "0.556389", "0.556389", "0.556389", "0.5548338", "0.55303985", "0.5526103", "0.55238247", "0.5522408", "0.5522294", "0.5519297", "0.55183315", "0.55183315", "0.5508416", "0.5506352", "0.55055976", "0.55055976", "0.55055976", "0.55055976", "0.55045605", "0.54986", "0.5497331", "0.5491824", "0.54838306", "0.54816705", "0.5463159", "0.5461451", "0.5460624", "0.5458398", "0.5457198", "0.54543114", "0.5453467", "0.5446483", "0.5443144" ]
0.0
-1
TODO Autogenerated method stub
public boolean batchDelete(List<Serializable> articleClassIds) { for (Serializable id : articleClassIds) { delete((Long) id); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "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
Interaction with village elder to get assignment
public void getAssignment() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void assignIntoGrade() {\n }", "public Village getVillage() {\n/* 501 */ return this.village;\n/* */ }", "public void evolve_enviroment() {\r\n\r\n // this.main_population.update_population();\r\n // get the indices of the best individual in the main population\r\n int main_pop_best = this.main_population.getBest_indices();\r\n\r\n // create a new individua with the genes of the best individual\r\n this.pop_best = new individual(this.main_population.getPopulation()[main_pop_best].getGenes(), solutions, output); // best individual in population\r\n\r\n // perform selection, crossover and mutation\r\n this.roulette_selection();\r\n this.crossover();\r\n this.mutate(this.prob);\r\n this.tournament_selection(); // survivor selection\r\n\r\n // find the indices of the worst individual and replace it with the best from the last generation\r\n this.main_population.setIndividual(pop_best, this.main_population.find_Worst_indicies());\r\n this.main_population.update_population();\r\n\r\n }", "private void evaluateStage(){\n switch (currentStage){\n case EGG: if (getLifetime() >= ModelSettings.brood_lifetime_egg)\n currentStage = LARVAE;\n break;\n case LARVAE: if (getLifetime() >= ModelSettings.brood_lifetime_larvae)\n currentStage = PUPAE;\n break;\n case PUPAE: if (getLifetime() >= ModelSettings.brood_lifetime_pupae)\n System.out.println(\"This pupae is now an adult!\");\n //TODO trigger manager\n break;\n }\n }", "private void assignment() {\n\n\t\t\t}", "void setVillage(Village aVillage) {\n/* 380 */ MineDoorPermission md = MineDoorPermission.getPermission(this.tilex, this.tiley);\n/* 381 */ if (this.village == null || !this.village.equals(aVillage)) {\n/* */ \n/* 383 */ if (this.doors != null)\n/* */ {\n/* 385 */ for (Door door : this.doors) {\n/* */ \n/* 387 */ if (door instanceof FenceGate) {\n/* */ \n/* 389 */ if (aVillage != null) {\n/* 390 */ aVillage.addGate((FenceGate)door); continue;\n/* 391 */ } if (this.village != null)\n/* 392 */ this.village.removeGate((FenceGate)door); \n/* */ } \n/* */ } \n/* */ }\n/* 396 */ if (md != null)\n/* */ {\n/* 398 */ if (aVillage != null) {\n/* 399 */ aVillage.addMineDoor(md);\n/* 400 */ } else if (this.village != null) {\n/* 401 */ this.village.removeMineDoor(md);\n/* */ } } \n/* 403 */ if (this.creatures != null)\n/* */ {\n/* 405 */ for (Creature c : this.creatures) {\n/* */ \n/* 407 */ c.setCurrentVillage(aVillage);\n/* 408 */ if (c.isWagoner() && aVillage == null) {\n/* */ \n/* 410 */ Wagoner wagoner = c.getWagoner();\n/* 411 */ if (wagoner != null)\n/* 412 */ wagoner.clrVillage(); \n/* */ } \n/* 414 */ if (c.isNpcTrader() && c.getCitizenVillage() == null) {\n/* */ \n/* 416 */ Shop s = Economy.getEconomy().getShop(c);\n/* 417 */ if (s.getOwnerId() == -10L) {\n/* */ \n/* 419 */ if (aVillage != null) {\n/* */ \n/* */ \n/* */ try {\n/* 423 */ logger.log(Level.INFO, \"Adding \" + c.getName() + \" as citizen to \" + aVillage.getName());\n/* 424 */ aVillage.addCitizen(c, aVillage.getRoleForStatus((byte)3));\n/* */ }\n/* 426 */ catch (IOException iox) {\n/* */ \n/* 428 */ logger.log(Level.INFO, iox.getMessage());\n/* */ }\n/* 430 */ catch (NoSuchRoleException nsx) {\n/* */ \n/* 432 */ logger.log(Level.INFO, nsx.getMessage());\n/* */ } \n/* */ \n/* */ \n/* */ \n/* */ continue;\n/* */ } \n/* */ \n/* */ \n/* 441 */ c.setCitizenVillage(null);\n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* */ \n/* 447 */ if (this.vitems != null)\n/* */ {\n/* 449 */ for (Item i : this.vitems.getAllItemsAsSet()) {\n/* */ \n/* 451 */ if (i.getTemplateId() == 757) {\n/* */ \n/* 453 */ if (aVillage != null) {\n/* 454 */ aVillage.addBarrel(i); continue;\n/* 455 */ } if (this.village != null)\n/* 456 */ this.village.removeBarrel(i); continue;\n/* */ } \n/* 458 */ if (i.getTemplateId() == 1112) {\n/* */ \n/* 460 */ if (aVillage != null) {\n/* */ \n/* 462 */ Node node = Routes.getNode(i.getWurmId());\n/* 463 */ if (node != null)\n/* 464 */ node.setVillage(aVillage); continue;\n/* */ } \n/* 466 */ if (this.village != null) {\n/* */ \n/* 468 */ Node node = Routes.getNode(i.getWurmId());\n/* 469 */ if (node != null)\n/* 470 */ node.setVillage(null); \n/* */ } \n/* */ } \n/* */ } \n/* */ }\n/* 475 */ this.village = aVillage;\n/* */ \n/* */ }\n/* */ else {\n/* */ \n/* 480 */ if (this.doors != null)\n/* */ {\n/* 482 */ for (Door door : this.doors) {\n/* */ \n/* 484 */ if (door instanceof FenceGate)\n/* 485 */ aVillage.addGate((FenceGate)door); \n/* */ } \n/* */ }\n/* 488 */ if (md != null)\n/* */ {\n/* 490 */ aVillage.addMineDoor(md);\n/* */ }\n/* */ } \n/* */ }", "private void doVels() {\n\t\tthis.launchPerVel = Math.sqrt((2d * body.getGm() * this.launchApoAlt) / (this.launchPerAlt * this.a));\n\t\tthis.launchApoVel = Math.sqrt((2d * body.getGm() * this.launchPerAlt) / (this.launchApoAlt * this.a));\n\t}", "public\tElevator(){\t\t\t\t\t\t\n\t\tcurrentFloor = 1;\n\t\tcurrentDirection = \"UP\";\n\t\ttotalPassengers = 0;\n\t\ttotalPassDestFloor = new int[8];\n\t\tdestRequest = new char[8];\n\t\t \n\t}", "void opponentInRoom();", "public interface ElevatorSelectionStrategy {\n\tElevator getElevatorFor(Passenger passenger, Floor departureFloor, Environment env);\n}", "public void ovr() {\n\n\t}", "public int transferPeople(Elevator e)\n\t{\n\t\tint transfered = e.pList.size();\n\t\tfor(int i = 0; i < e.pList.size(); i++)\n\t\t{\n\t\t\tPerson p = e.pList.get(i);\n\t\t\tif(p.destination.floorNumber == this.floorNumber)\n\t\t\t{\n\t\t\t\tSystem.out.println(\"person leaving elevator \" + e.id + \" on floor \" + this.floorNumber);\n\t\t\t\te.pList.get(i).exit();\n\t\t\t\te.pList.remove(i);\n\t\t\t\te.getCurrentState().capacityState=ElevatorState.CapacityState.NOTFULL;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\ttransfered-=e.pList.size();\n\t\ttransfered+=this.pList.size();\n\t\tint available = e.getTotalCapacity()-e.getCurrentCapacity();\n\t\tif(e.getCurrentState().directionState == ElevatorState.DirectionState.IDLE)\n\t\t{\n\t\t\tif(pList.size()!=0&&pList.get(0).destination.floorNumber>this.floorNumber)\n\t\t\t{\n\t\t\t\tSystem.out.println(e.id + \" Now going up\");\n\t\t\t\te.getCurrentState().directionState = ElevatorState.DirectionState.GOINGUP;\n\t\t\t}\n\t\t\telse if(pList.size()!=0&&pList.get(0).destination.floorNumber<this.floorNumber)\n\t\t\t{\n\t\t\t\tSystem.out.println(e.id + \" Now going down\");\n\t\t\t\te.getCurrentState().directionState = ElevatorState.DirectionState.GOINGDOWN;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tfor(int i = 0; i < pList.size(); i++)\n\t\t{\n\t\t\t\n\t\t\tPerson p = pList.get(i);\n\t\t\tif(e.getCurrentState().directionState == ElevatorState.DirectionState.GOINGUP)\n\t\t\t{\n\t\t\t\tif(p.destination.floorNumber > this.floorNumber)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"person entering elevator \" + e.id + \" from floor \" + this.floorNumber + \n\t\t\t\t\t\t\t\" destination is \" + p.destination.floorNumber);\n\t\t\t\t\tpList.remove(p);\n\t\t\t\t\tp.enter();\n\t\t\t\t\ti--;\n\t\t\t\t\tp.current=e;\n\t\t\t\t\tp.state = Person.ELEVATOR;\n\t\t\t\t\te.pList.add(p);\n\t\t\t\t\tif(!e.getFloorsRequested().contains(p.destination))\n\t\t\t\t\t{\n\t\t\t\t\t\te.getFloorsRequested().add(p.destination);\n\t\t\t\t\t}\n\t\t\t\t\tavailable--;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(e.getCurrentState().directionState == ElevatorState.DirectionState.GOINGDOWN)\n\t\t\t{\n\t\t\t\tif(p.destination.floorNumber < this.floorNumber)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"person entering elevator \" + e.id + \" from floor \" + this.floorNumber + \n\t\t\t\t\t\t\t\" destination is \" + p.destination.floorNumber);\n\t\t\t\t\tpList.remove(p);\n\t\t\t\t\tp.enter();\n\t\t\t\t\ti--;\n\t\t\t\t\tp.current=e;\n\t\t\t\t\tp.state = Person.ELEVATOR;\n\t\t\t\t\te.pList.add(p);\n\t\t\t\t\tif(!e.getFloorsRequested().contains(p.destination))\n\t\t\t\t\t{\n\t\t\t\t\t\te.getFloorsRequested().add(p.destination);\n\t\t\t\t\t}\n\t\t\t\t\tavailable--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(available==0)\n\t\t\t{\n\t\t\t\te.getCurrentState().capacityState=ElevatorState.CapacityState.FULL;\n\t\t\t\tSystem.out.println(\"Elevator \" + e.id + \" is now full\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\ttransfered-=this.pList.size();\n\t\tSystem.out.println(\"transfered \" + transfered + \" on floor \" + this.floorNumber + \" number of people still on floor is \" + pList.size());\n\t\treturn transfered;\n\t}", "@Override\n public void enterRoom(Person x) {\n\n occupant = x;\n x.setxLoc(this.xLoc);\n x.setyLoc(this.yLoc);\n System.out.println(\"Aliens abduct you. You lose!\");\n System.out.println(\" .-\\\"\\\"\\\"\\\"-. .-\\\"\\\"\\\"\\\"-.\\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 \" \\\\ || / \\\\ || / \\\\ || /\\n\" +\n \" \\\\ / \\\\ / \\\\ /\\n\" +\n \" \\\\ __ / \\\\ __ / \\\\ __ /\\n\" +\n \" '.__.' '.__.' '.__.'\\n\" +\n \"jgs | | | | | |\\n\" +\n \" | | | | | |\");\n Runner.gameOff();\n }", "public void chooseFortifyGivers(){\n gameState = GameState.FORTIFYGIVER;\n currentTerritoriesOfInterest = Player.getTerritoryStringArray(currentPlayer.getFortifyGivers());\n notifyObservers();\n }", "public void setArrive(Village arrive) {\n\t\tthis.arrive = arrive;\n\t}", "public void placerEauSurVue() {\n\t\tif (partie.getJoueur().getIndiceBateauEnCours() != -1) {\n\t\t\tfor (int i : partie.getJoueur().getBateau()[partie.getJoueur().getIndiceBateauEnCours()].getCaseOnId()) {\n\t\t\t\tif (i != -1)\n\t\t\t\t\tvue.setWater(i);\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n Map map = Experiment.getAverageMapManyHoles();\n ArrayList<AbstractAgent> agents = new ArrayList<>();\n JFrame frame = new JFrame();\n Floor floor = map.getFloors().iterator().next();\n\n MapViewPanel panel = new MapViewPanel(map, agents);\n KeyboardInputListener l = new KeyboardInputListener();\n frame.addKeyListener(l);\n\n MinimalPathOverseer overseer = new MinimalPathOverseer(map);\n panel.setMinimalPathOverseer(overseer);\n for(int i = 0 ; i < overseer.getAmountOfAgents(); i++)\n {\n agents.add(overseer.getAgent(i));\n }\n\n Engine simulationEngine = new Engine(map, agents, panel, 60);\n\n// CoordinatorEvaderKillKillKillEmAll hunter = new CoordinatorEvaderKillKillKillEmAll(simulationEngine,map, floor, map.getEvaderSpawnLocation(), Direction.SOUTH, 5,\n// EngineConstants.VISION_RANGE, EngineConstants.VISION_ANGLE, agents,false);\n// hunter.setViewPort(panel);\n\n //agents.add(new RandomAgent(map, floor, new Vector2D(200.0, 100.0), Direction.NORTH, 5, 100, 120));\n agents.add(new UserAgent(map, floor, new Vector2D(200.0, 320.0), Direction.NORTH, 5, EngineConstants.VISION_RANGE, EngineConstants.VISION_ANGLE, l, true));\n //agents.add(new RandomAgent(map, floor, new Vector2D(200.0, 320.0), Direction.NORTH, 5, EngineConstants.VISION_RANGE, EngineConstants.VISION_ANGLE, true));\n// agents.add(new DistanceAgent(map, floor, map.getEvaderSpawnLocation(), Direction.NORTH, EngineConstants.AGENT_RADIUS, EngineConstants.VISION_RANGE, EngineConstants.VISION_ANGLE));\n\n\n frame.getContentPane().add(panel);\n frame.pack();\n frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);\n frame.setVisible(true);\n Future<Integer> f = simulationEngine.start();\n while (!f.isDone()){\n try{\n Thread.sleep(1000);\n }\n catch (Exception e){\n // lol\n }\n }\n try{\n System.out.printf(\"iterations: %d\", f.get());\n }\n catch (Exception lol){\n lol.printStackTrace();\n }\n\n\n //drawFrame(frame, map, visibilityGraph, null);\n }", "public void enterRoom(Person p) {\n if (p.poisoned) {\n System.out.println(\"The poison eats away at you. You take 5 damage.\");\n p.hp -= 5;\n System.out.println(\"You now have \" + p.hp + \"health\");\n if (p.hp <= 0) {\n\n gameOff();\n }\n }\n occupant = p;\n p.setxLoc(this.xLoc);\n p.setyLoc(this.yLoc);\n Scanner n = new Scanner(System.in);\n\n if (!m.sleep) {\n if (m.alive) {\n System.out.println(\"There's a monster in the room!\");\n } else {\n System.out.println(\"The monster's remains lies before you.\");\n }\n m.aggro = true;\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. No one knows you died.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n String re = n.nextLine();\n if (re.equalsIgnoreCase(\"run\")) {\n damage = (int) (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (re.equalsIgnoreCase(\"Fight\")) {\n double dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + p.gold + \" Gold\");\n p.gold += g;\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n }\n }\n if (m.alive) {\n if (m.sleep) {\n System.out.println(\"You find a sleeping monster. Do you attack it? (Y/N)\");\n\n String q = n.nextLine();\n if (q.equalsIgnoreCase(\"yes\") || q.equalsIgnoreCase(\"y\")) {\n\n double dam = p.str * (1.5) + p.str * Math.random();\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \" damage.\");\n m.aggro = true;\n if (m.hp <= 0) {\n System.out.println(\"The monster dies on the spot. Who's the real monster here?\");\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n while (m.alive && m.aggro) {\n if (m.hp <= 0) {\n m.alive = false;\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \"Gold\");\n }\n int damage = m.counterAttack(p);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n if (p.hp <= 0) {\n System.out.println(\"You died. Serves you right for hitting a sleeping monster.\");\n Runner.gameOff();\n }\n System.out.println(\"You have \" + p.hp + \" health.\");\n System.out.println(\"What do you do now? (Fight, Run)\");\n q = n.nextLine();\n if (q.equalsIgnoreCase(\"run\")) {\n damage = (m.counterAttack(p) / p.dex);\n System.out.println(\"The monster bites you. You take \" + damage + \" damage.\");\n p.hp -= damage;\n m.aggro = false;\n }\n if (q.equalsIgnoreCase(\"Fight\")) {\n dam = (p.str + p.str * Math.random()) / (m.resist + 1);\n m.hp -= dam;\n System.out.println(\"You deal \" + dam + \"damage.\");\n if (m.hp <= 0) {\n m.alive = false;\n System.out.println(\"The monster howls as you deal a finishing blow.\");\n int g = m.dropGold();\n System.out.println(\"You gain \" + g + \" Gold\");\n p.gold += g;\n System.out.println(\"You now have \" + p.gold + \" Gold\");\n m.threat = false;\n p.exp += (m.attack + m.resist) * floor;\n System.out.println(\"You gain \" + (m.attack + m.resist) * floor + \" EXP\");\n if (p.exp >= 100) {\n p.exp -= 100;\n p.level++;\n System.out.println(\"You leveled up! You gain +1 Strength and +1 Dexterity\");\n p.str++;\n p.dex++;\n }\n }\n }\n\n }\n } else {\n System.out.println(\"You let the sleeping monster be.\");\n m.threat = false;\n n.close();\n }\n\n }\n }\n else\n {\n System.out.println(\"The monster's remains are still here.\");\n }\n }", "public void reserveer() {\n System.out.println(\"de eigenaar van de auto is: \" + i.eigenaar());\n\n }", "public void userOrg() throws Exception\r\n {\r\n \t\r\n \tString[] messages={\"Depth \",\"Vertical Translation - Right Branches, Even Levels \",\r\n \t\"Horizontal Translation - Right Branches, Even Levels\",\"Vertical Translation - Right Branches, Odd Levels\",\r\n \t\"Horizontal Translation - Right Branches, Odd Levels\",\"Vertical Translation - Left Branches, Even Levels\",\r\n \t\"Horizontal Translation - Left Branches, Even Levels\",\"Vertical Translation - Left Branches, Odd Levels\",\r\n \t\"Horizontal Translation - Left Branches, Odd Levels\",\"Color\",\"Thickness\"};\r\n \tint[][] res=Organism.getRestrictions();\r\n \tint[] genesTemp=new int[11];\r\n \t\r\n \tString invalid=\"\",in=\"\";\r\n \t\r\n \tfor(int i=0; i<genesTemp.length; i++)\r\n \t{\r\n \t\tdo\r\n \t\t{\r\n \t\t\ttry\r\n \t\t\t{\r\n \t\t\t\tin=JOptionPane.showInputDialog(\"Gene \"+(i+1)+\": \"+messages[i]+\" ( \"+res[i][0]+\" to \"+res[i][1]+\" )\"+invalid);\r\n \t\t\t\tgenesTemp[i]=Integer.parseInt(in);\r\n \t\t\t\tinvalid=\"\"; //Set it back to normal\r\n \t\t\t\tif(genesTemp[i]<res[i][0]||genesTemp[i]>res[i][1])invalid=\"\\nOut of Range! Try again!\";\r\n \t\t\t}\r\n \t\t\tcatch(NumberFormatException e)\r\n \t\t\t{\r\n \t\t\t\tif(in==null)return; //If no input, then return\r\n \t\t\t\tinvalid=\"\\nInvalid Input!\"; //If incorrect input\r\n \t\t\t}\r\n \t\t}\r\n \t\twhile(genesTemp[i]<res[i][0]||genesTemp[i]>res[i][1]);\r\n \t}\r\n \t\r\n\t\te.setTree(new ArrayList<Organism>()); //Setting new succession tree to an empty tree\r\n\t\te.setParent(new Organism(genesTemp,1)); //Setting the curent parent organism to the default starting organism\r\n\t\trepaint();\r\n }", "private void enemyEncounter()\n {\n currentEnemies = currentRoom.getEnemies();\n \n if(currentEnemies.size() > 0)\n {\n for(Enemy e : currentEnemies)\n {\n System.out.println(\"\\n\" + \"A \" + e.getName() + \" stares menacingly!\" + \"\\n\");\n enemyName = e.getName();\n \n }\n enemyPresent = true;\n clearExits();\n }\n else{\n setExits(); \n }\n }", "public AIAssign2(){\n \n Scanner console = new Scanner(System.in);\n \n System.out.print(\"Input population size \");\n popsize = console.nextInt();\n \n System.out.print(\"Input tournament size \");\n tournysize = console.nextInt();\n \n System.out.print(\"Input crossover chance (%) \");\n crossprob = console.nextDouble();\n \n System.out.print(\"Input mutation chance (%) \");\n mutaprob = console.nextDouble();\n \n System.out.print(\"Input max generation size \");\n maxgen = console.nextInt();\n \n System.out.print(\"Input problem width \");\n width = console.nextInt();\n \n System.out.print(\"Input problem height \");\n height = console.nextInt();\n \n System.out.print(\"Input start location x-1 \");\n startx = console.nextInt();\n \n System.out.print(\"Input start location y-1 \");\n starty = console.nextInt();\n \n System.out.print(\"Input seed value \");\n seed = console.nextLong();\n \n Random rnd = new Random(seed);\n \n population = new int[popsize][height*width];\n population2 = new int[popsize][height*width];\n popfitness = new int[popsize];\n \n for (int i = 0 ; i<popsize ; i++){\n for (int j = 0 ; j<population[0].length ; j++){\n population[i][j] = (rnd.nextInt(4));\n }\n }\n Print(population);\n \n //the generation loop\n for (int gen = 0 ; gen < maxgen ; gen++){\n \n //fitness of individuals is stored\n int btemp = 0;\n for (int i = 0 ; i < popsize ; i++){\n \n problem = new char[width][height];\n problem[startx][starty] = 'S';\n \n popfitness[i] = Fitness(population[i], problem, startx, starty, 0);\n \n if (popfitness[i] > btemp){ btemp = popfitness[i];}\n }\n bestavg = bestavg + btemp;\n \n String line=\"\";\n int avg=0;\n for (int i = 0 ; i < popsize ; i++){\n line = line + \"[\" + popfitness[i] + \"] \"; \n avg = avg + popfitness[i];\n }\n avg = avg/popsize;\n avgavg = avgavg + avg;\n bestavg = bestavg / (gen+1);\n avgavg = avgavg / (gen+1);\n System.out.println(\"Gen: \"+gen + \" Fitness: \"+ line + \" Avg: \"+ avg + \" BestAvg: \" + bestavg + \" AvgAvg: \" + avgavg);\n bestavg = bestavg * (gen+1);\n avgavg = avgavg * (gen+1);\n \n //Tournament selection\n for (int i = 0 ; i < popsize ; i++){\n int best = 0; \n int rand = (int)(rnd.nextInt(popsize));\n best = rand;\n \n for (int k = 0 ; k < tournysize ; k++){\n if (popfitness[rand] > popfitness[best]){\n best = rand;\n }\n \n rand = (int)(rnd.nextInt(popsize));\n }\n population2[i] = Copy(population[best]); \n }\n \n //single-focus-flip and block exchange mutations\n for (int i = 0 ; i < popsize-1 ; i++){\n if (crossprob > rnd.nextInt(100)){\n int temp; \n for (int a = 0 ; a < 5 ; a++){\n temp = population2[i][a];\n population2[i][a] = population2[i+1][a];\n population2[i+1][a] = temp;\n }\n }\n }\n \n for (int i = 0 ; i < popsize ; i++){\n if (mutaprob > rnd.nextInt(200)){\n int temp = (int) (rnd.nextInt(population2[0].length)); \n population2[i][temp] = (int)(rnd.nextInt(4));\n }\n else if (mutaprob > rnd.nextInt(200)){\n for (int j = 0 ; j < population2[0].length/2 ; j++){\n int temp = population2[i][j];\n population2[i][j] = population2[i][population2[0].length-1-j];\n population2[i][population2[0].length-1-j] = temp;\n }\n }\n }\n \n population = population2;\n population2 = new int[popsize][population[0].length];\n \n }\n \n bestavg = bestavg / maxgen;\n avgavg = avgavg / maxgen;\n Print(population);\n System.out.println(\"Best Avg: \" + bestavg + \" Average of Avg: \" + avgavg);\n }", "public abstract void assign(ParameterVector pv) throws SolverException;", "public void assignLane() {\n\t\tIterator<Lane> it = lanes.iterator();\n\n\t\twhile (it.hasNext() && partyQueue.getPartyQueue().hasMoreElements()) {\n\t\t\tLane curLane = it.next();\n\n\t\t\tif (!curLane.isPartyAssigned()) {\n\t\t\t\tSystem.out.println(\"ok... assigning this party\");\n\t\t\t\tcurLane.assignParty(((Party) partyQueue.getPartyQueue().next()));\n\t\t\t}\n\t\t}\n\t\tif (cdView != null)\n\t\t\tcdView.receiveControlDeskEvent(new ControlDeskEvent(partyQueue.getPartyQueueDisplay()));\n\t}", "@Override\r\n\tpublic void getProbFrom(boolean stayInJail) {\r\n\t\tif (stayInJail)\r\n\t\t\tgetProbabilitiesStayInJail();\r\n\t\telse\r\n\t\t\tboard().getSpace(justVisitingID).getProbFrom(stayInJail);\r\n\t}", "public static void main(String[] args) {\n Elevator theElevator = new Elevator();\n\n theElevator.boardPassenger(2);\n theElevator.boardPassenger(2);\n theElevator.boardPassenger(3);\n\n System.out.println(theElevator);\n\n for(int i=1;i<21;i++){\n theElevator.move();\n }\n \n\n \n\n }", "public void action() throws Exception {\n // Cop move to another place\n move();\n\n // Search for agents nearby\n ArrayList<Position> occupiedNeighbor = this.getPosition().getOccupiedNeighborhood();\n ArrayList<Agent> arrestList = new ArrayList<>();\n for (Position neighbor : occupiedNeighbor) {\n Person person = neighbor.getOccupiedPerson();\n String className = person.getClass().getName();\n // if this is a agent and is active\n if (className.equals(Person.AGENT)) {\n if (((Agent) person).isActive()) {\n arrestList.add((Agent) person);\n }\n }\n }\n\n // If there at least one agent nearby\n if (0 != arrestList.size()) {\n // Randomly pick active agent to jail\n Random random = new Random();\n int maxIndex = arrestList.size();\n int randomIndex = random.nextInt(maxIndex);\n Agent arrestAgent = arrestList.get(randomIndex);\n int jailTerm = random.nextInt(getPersonEnvironment().getMaxJailTerm());\n arrestAgent.beArrested(jailTerm, this);\n }\n }", "public static void main(String args[]){\n\t\tElevator E1 = new Elevator();\n\t\tE1.F[3].setPassengersWaiting(4);\n\t\tE1.F[5].setPassengersWaiting(3);\n\t\tE1.F[6].setPassengersWaiting(4);\n\t\t\n\t\ttry {E1.boardPassengers(2,2,3);}\n\t\tcatch (ElevatorFullException exc){\n\t\t\tSystem.out.println(\"ELEVATOR IS AT ITS FULL CAPACITY\");\n\t\t\t}\n\t\tE1.registerRequest();\n\n\t\tE1.move();\n\t\tSystem.out.println(\"------------------------------------------------------------------------\");\n\t\tE1.move();\n\t\tSystem.out.println(\"------------------------------------------------------------------------\");\n\t\tE1.move();\n\t\tSystem.out.println(\"------------------------------------------------------------------------\");\n\t\tE1.move();\n\t}", "String getAssignmentApproaches();", "public Enemy getEnemy(int whichEnemy);", "public void getInfo () {\n int[] info = elevator.getInfo ();\n currFloor = info[0];\n maxCap = info[2];\n numFloors = info[3];\n currCap = info[5];\n state = info[6];\n }", "public void infect() {\n\t\tPlagueAgent current = this;\n\t\tif (!current.infected) {\n\t\t\tfor (PlagueAgent a : plagueWorld.getNeighbors(current, 5)) {\n\t\t\t\tif (a.infected) {\n\t\t\t\t\tint luck = Utilities.rng.nextInt(100);\n\t\t\t\t\tif (luck < plagueWorld.VIRULENCE) {\n\t\t\t\t\t\tthis.infected = true;\n\t\t\t\t\t\tplagueWorld.newInfection();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tplagueWorld.changed();\n\t}", "public void resolve(){\n logger.log(Level.FINE,attacker.getName()+\" withering attacked \"+defender.getName());\n AttackState state=new AttackState();\n state.weaponDamage=weapon.getDamage();\n state.initialAttackpool=baseAttackdice+baseAccuracy-woundpenalty;\n attacker.declareWitheringAttack(state); // If the attacker wants to change the pool, he modifies the state accordingly.\n defender.declareWitheringDV(state); // Defender declares their dv against this specific attack. This sets both initialdv and changedDv\n state.initialAttackRoll= new DiceThrow(state.changedAttackpool);\n attacker.modifyWitheringAttackRollAttacker(state); //This sets stuff like modifiedAttackRollAttacker and AttackerRollValuation\n defender.modifyWitheringAttackRollDefender(state); //This sets defender modifiedAttackRollDefender\n state.attackRollSuccesses=state.modifiedAttackRollDefender.evaluateResults(state.AttackRollValuationAttacker);\n state.threshholdSuccesses=state.attackRollSuccesses-state.changedDv;\n logger.log(Level.FINE,attacker.getName()+\" rolled \"+state.changedAttackpool+\" dice against \"+defender.getName()+\"'s dv of \"+state.changedDv+\" and gained \"+state.attackRollSuccesses+\" successes.\");\n attacker.changeWitheringThreshholdAttacker(state); //This sets thresholdModifiedAttacker\n defender.changeWitheringThreshholdDefender(state); //This sets thresholdModifiedDefender\n if(state.thresholdModifiedDefender>=0) {\n logger.log(Level.FINE,attacker.getName()+\" hit \"+defender.getName()+\" with \"+state.thresholdModifiedDefender+\" threshhold successes.\");\n attacker.modifyWitheringRawDamageAttacker(state); //Sets normal raw damageType, based on strength and weapon damageType, and then sets rawDamagemModifiedAttacker\n defender.modifyWitheringRawDamageDefender(state); //this sets rawDamageModifiedDefender, and sets up the various soak values, so natural soak and armor soak.\n logger.log(Level.FINE, \"The raw damage of the attack is: \"+state.rawDamageModifiedDefender);\n state.totalSoak = Math.max(state.defenderArmorSoak - ignoredArmorSoak, 0) + state.defenderNaturalSoak; //\n attacker.modifyTotalSoakAttacker(state); //This sets totalSoakmodifiedAttacker. Don't think this actually has support in the solar charmset, but giving opportunities to work with.\n defender.modifyTotalSoakDefender(state); // This sets totalSoakmodifiedDefender.\n state.postSoakSuccesses=Math.max(state.rawDamageModifiedDefender-state.totalSoakModifiedDefender,weapon.getOverwhelming());\n logger.log(Level.FINE,state.totalSoakModifiedDefender+\" damage is soaked, leading to post soak dice of \"+state.postSoakSuccesses);\n attacker.declarePostSoakAttacker(state); //sets postSoakSuccessesModifiedAttacker\n defender.declarePostSoakDefender(state); //sets postSoakSuccessesModifiedDefender\n DiceThrow droll=new DiceThrow(state.postSoakSuccessesModifiedDefender);\n state.damageRoll=droll;\n attacker.modifyWitheringDamageRollAttacker(state); //sets damageRollmodifiedAttacker and damageRollvValuation\n defender.modifyWitheringDamageRollDefender(state); //sets damageRollmodifiedDefender\n state.initiativeDamageDone=state.damageRollModifiedDefender.evaluateResults(state.damageRollValuation);\n logger.log(Level.FINE,attacker.getName()+\" rolls \"+state.postSoakSuccessesModifiedDefender+\" dice and achieves \"+state.initiativeDamageDone+\" successes.\");\n attacker.modifyInitiativeDamageAttacker(state);\n defender.modifyInitiativeDamageDefender(state); //Since this is the last change of initiative, we can check whether the defender was crashed here.\n attacker.updateInitiativeAttacker(state);\n defender.updateInitiativeDefender(state);//Here we should handle all the initiative changes respectively, with checking if people are crashed etc.\n }\n else{\n attacker.failedWitheringAttackAttacker(state);\n defender.failedWitheringAttackDefender(state);\n }\n\n }", "public void unloadPassengers(Elevator ev1) throws ElevatorFullException\n { \n // Unload passengers from elevator\n\t//---------------------------------- \n int unloading= ev1.passengersForFloor(floorNum);\n ev1.unloadPassenger(unloading);\n System.out.println(\"unloaded \" + unloading + \" passenger(s).\");\n\n\n\t// If the passengers are unloading onto floor #1, we assume that\n\t// they'll leave the building once they exit the elevator.\n\t//--------------------------------------------------------------- \n\tif(floorNum != 1)\n\t{ occupants+= unloading;\n\t}\n\n\n\t// With the exception of passengers that were just unloaded, load\n\t// current floor occupants onto the elevator. According to the spec,\n\t// every occupant on a floor will be boarded with a destination of\n\t// baseFloor.\n\t//---------------------------------------------------------------------- \n\tint boarding= occupants - unloading;\n\tif(boarding > 0)\n\t{ for(int i=1; i<=boarding; i++)\n\t { try\n\t { ev1.boardPassenger(ev1.baseFloor);\n\t occupants--;\n }\n\t\tcatch (ElevatorFullException e)\n\t\t{ System.out.print(\"ElevatorFullException Caught:\");\n\t\t System.out.print(\" leaving \" + occupants + \" occupants on the floor; \");\n\t\t System.out.print(\" will return later.\\n\");\n\t\t i=boarding+1; //break out of boarding loop. \n\t\t}\n\t }\n }\n\n\n\t// For this simulation, we assume that all unloaded passengers will\n\t// be ready to leave the building on the next elevator run. Thus we\n\t// will signal the elevator to return for them.\n\t//--------------------------------------------------------------------- \n\tif(occupants >= 1)\n\t{ ev1.registerRequest(floorNum);\n\t}\n\n\n // show status of floor before proceeding.\n System.out.println(this);\n System.out.println(ev1 + \"\\n\");\n }", "public void aGp() {\n am.bS(this.dvY);\n }", "@Test\n public void testAssignReinforcements() {\n IssueOrderPhase l_issueOrder = new IssueOrderPhase(d_gameEngine);\n l_issueOrder.d_gameData = d_gameData;\n l_issueOrder.assignReinforcements();\n d_gameData = l_issueOrder.d_gameData;\n int l_actualNoOfArmies = d_gameData.getD_playerList().get(0).getD_noOfArmies();\n int l_expectedNoOfArmies = 8;\n assertEquals(l_expectedNoOfArmies, l_actualNoOfArmies);\n }", "public void doMission(Connection connection) {\n final Unit unit = getUnit();\n if (unit.getTile() == null) {\n logger.finest(\"AI pioneer waiting to go to\"\n + getTransportDestination() + \": \" + unit);\n return;\n }\n\n if (!hasTools()) { // Try to equip.\n if (colonyWithTools != null\n && !checkColonyForTools(getAIUnit(), colonyWithTools)) {\n colonyWithTools = null;\n }\n if (colonyWithTools == null) { // Find a new colony.\n colonyWithTools = findColonyWithTools(getAIUnit());\n }\n if (colonyWithTools == null) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer can not find equipment: \" + unit);\n return;\n }\n\n // Go there, equip unit.\n if (travelToTarget(\"AI pioneer\", colonyWithTools.getTile())\n != Unit.MoveType.MOVE) return;\n getAIUnit().equipForRole(Unit.Role.PIONEER, false);\n if (!hasTools()) {\n abandonTileImprovementPlan();\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" but could not equip: \" + unit);\n return;\n }\n logger.finest(\"AI pioneer reached \" + colonyWithTools.getName()\n + \" and equips: \" + unit);\n colonyWithTools = null;\n }\n\n // Check the plan still makes sense.\n final Player player = unit.getOwner();\n final EuropeanAIPlayer aiPlayer = getEuropeanAIPlayer();\n if (tileImprovementPlan != null\n && !validateTileImprovementPlan(tileImprovementPlan, aiPlayer)) {\n tileImprovementPlan = null;\n }\n if (tileImprovementPlan == null) { // Find a new plan.\n AIUnit aiu = getAIUnit();\n tileImprovementPlan = findTileImprovementPlan(aiu);\n if (tileImprovementPlan == null) {\n logger.finest(\"AI pioneer could not find an improvement: \"\n + unit);\n return;\n }\n tileImprovementPlan.setPioneer(aiu);\n }\n \n // Go to target and take control of the land before proceeding\n // to build.\n Tile target = tileImprovementPlan.getTarget();\n if (travelToTarget(\"AI pioneer\", target) != Unit.MoveType.MOVE) return;\n if (!player.owns(target)) {\n // TODO: Better choice whether to pay or steal.\n // Currently always pay if we can, steal if we can not.\n boolean fail = false;\n int price = player.getLandPrice(target);\n if (price < 0) {\n fail = true;\n } else {\n if (price > 0 && !player.checkGold(price)) {\n price = NetworkConstants.STEAL_LAND;\n }\n if (!AIMessage.askClaimLand(aiPlayer.getConnection(), target,\n null, price)\n || !player.owns(target)) { // Failed to take ownership\n fail = true;\n }\n }\n if (fail) {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer can not claim land at \" + target\n + \": \" + unit);\n return;\n }\n }\n\n if (unit.getState() == UnitState.IMPROVING) {\n unit.setMovesLeft(0);\n logger.finest(\"AI pioneer improving \"\n + tileImprovementPlan.getType() + \": \" + unit);\n } else if (unit.checkSetState(UnitState.IMPROVING)) {\n // Ask to create the TileImprovement\n if (AIMessage.askChangeWorkImprovementType(getAIUnit(),\n tileImprovementPlan.getType())) {\n logger.finest(\"AI pioneer began improvement \"\n + tileImprovementPlan.getType()\n + \" at target \" + target\n + \": \" + unit);\n } else {\n aiPlayer.removeTileImprovementPlan(tileImprovementPlan);\n tileImprovementPlan.dispose();\n tileImprovementPlan = null;\n logger.finest(\"AI pioneer failed to improve \" + target\n + \": \" + unit);\n }\n } else { // Probably just out of moves.\n logger.finest(\"AI pioneer waiting to improve at \" + target.getId()\n + \": \" + unit);\n }\n }", "public void tournamentWithElitism(){\n\t\tEvolvable spring[] = new Evolvable[populationSize];\n\t\t\n\t\t//elite individuals go directly to new population\n\t\tfor (int i = 0; i < SNSLearningAgent.elitism; i++){\n\t\t\tspring[i] = population[i];\t\n\t\t}\n\t\t\n\t\t//other individuals are selected via tournament\n\t\tfor (int i = SNSLearningAgent.elitism; i < populationSize; i+=2) {\n\t\t\t//parents selected via tournament\n\t\t\tint p1 = tournament(SNSLearningAgent.tournamentSize);\t\n\t\t\tint p2 = tournament(SNSLearningAgent.tournamentSize);\n\t\t\twhile(p1 == p2)\tp2 = tournament(SNSLearningAgent.tournamentSize);\n\t\t\t\n\t\t\t//performs crossover if probability is matched\n\t\t\tif(R.nextFloat() < SNSLearningAgent.crossoverProb){\n\t\t\t\tif (crossBehavior.equals(\"freeSplitCross\")){\n\t\t\t\t\tint point = R.nextInt(SNSAgent.DNA_LENGTH);\n\t\t\t\t\t\n\t\t\t\t\tspring[i] = cross(population[p1], population[p2], point);\n\t\t\t\t\tif (i+1 < populationSize) spring[i+1] = cross(population[p2], population[p1], point);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tspring[i] = cross(population[p1], population[p2]);\n\t\t\t\t\tif (i+1 < populationSize) spring[i+1] = cross(population[p2], population[p1]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tspring[i] = population[p1];\n\t\t\t\tif (i+1 < populationSize) spring[i+1] = population[p2];\n\t\t\t}\n\t\t\t\n\t\t\t//performs mutation if probability is reached\n\t\t\tif(R.nextFloat() < SNSLearningAgent.mutationProb){\n\t\t\t\tspring[i].mutate();\n\t\t\t}\n\t\t\tif(i+1 < populationSize && R.nextFloat() < SNSLearningAgent.mutationProb){\n\t\t\t\tspring[i+1].mutate();\n\t\t\t}\n\t }\n\t\t\n\t\t//replaces old population with the new one\n\t\tfor(int i = 1; i < populationSize; i++) {\n\t\t\tpopulation[i] = spring[i];\n\t\t}\n\t}", "public EntityID getAssignedAgentID();", "private int[] getElite(int[][] population) {\n\t\tfloat[] fitnesses = new float[population.length];\n\n\t\tfor (int i = 0; i < population.length; i++) {\n\t\t\tfitnesses[i] = getFitness(population[i]);\n\t\t\tif (fitnesses[i] < eliteFitness) {\n\t\t\t\tSystem.out.println(getFitness(eliteChromosome) + \" old\" + getFitness(population[i]) + \" new\");\n\t\t\t\teliteFitness = fitnesses[i];\n\t\t\t\teliteChromosome = population[i];\n\t\t\t}\n\t\t}\n\t\treturn eliteChromosome;\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tApartment apartment1=new Apartment(1,true,2,10,4,\"high entrance\",\"Izmir-Bornova-Kazimdirik Mh.\");\n\t\t\n\t\tApartment apartment2=new Apartment();\n\t\tapartment2.id=2;\n\t\tapartment2.isFurnished=false;\n\t\tapartment2.buildingAge=4;\n\t\tapartment2.numberOfBalcony=1;\n\t\tapartment2.numberOfFloors=3;\n\t\tapartment2.floorLocation=\"fourth\";\n\t\tapartment2.Address=\"Istanbul-Sisli\";\n\t\t\n\t\tApartment apartment3=new Apartment(3,true,1,5,3,\"high entrance\",\"Ankara\");\n\t\t\n\t\tApartment[] apartments= {apartment1,apartment2,apartment3};\n\t\t\n\t\t\n\t\t for (Apartment apartment : apartments) {\n\t\t\tSystem.out.println(apartment.Address);\n\t\t }\n\t\t //\n\t\t EstateAgent agent1=new EstateAgent(1,\"Emlak1\",\"0534 111 11 11\");\n\t\t EstateAgent agent2=new EstateAgent(2,\"Emlak2\",\"0534 222 22 33\");\n\t\t EstateAgent agent3=new EstateAgent(3,\"Emlak3\",\"0534 333 33 33\");\n\t\t \n\t\t EstateAgent[] agents= {agent1,agent2,agent3};\n\t\t for (EstateAgent agent : agents) {\n\t\t\tSystem.out.println(agent.name);\n\t\t }\n\t\t \n\t\t ApartmentManager apartmentManager=new ApartmentManager();\n\t\t \n\t\t apartmentManager.detail(apartment1);\n\t\t apartmentManager.detail(apartment2);\n\t\t apartmentManager.detail(apartment3);\n\t\t \n\t\t apartmentManager.streetView(apartment1);\n\t\t apartmentManager.streetView(apartment2);\n\t\t apartmentManager.streetView(apartment3);\n\t}", "protected void attackEnemy(Path toOp) {\n int opX = toOp.getStep(toOp.getLength() - 1).getX();\n int opY = toOp.getStep(toOp.getLength() - 1).getY();\n if (this.player.getX() == opX || this.player.getY() == opY) {\n // in the same row or column\n if (toOp.getLength() <= this.player.getFirePower() + 1) {\n // and is reachable\n this.player.placeBomb(map);\n// System.out.println(\"Player #\"+player.getPID()+\" will attack block [\"+opX+\", \"+opY+\"]\");\n }\n }\n }", "@Override\n public void enterRoom(Person x) {\n occupant = x;\n x.setxLoc(this.xLoc);\n x.setyLoc(this.yLoc);\n System.out.println(\"Yay! You find an awesome disco room. \");\n }", "public void Elevator() {\n // Use these to get going:\n // setSetpoint() - Sets where the PID controller should move the system\n // to\n // enable() - Enables the PID controller.\n \t\n }", "public void actionPerformed(ActionEvent e) {\n\t\t\t\tPerson person = createNewPassenger(textCurrentFloor.getText(), textDestinationFloor.getText());\n\t\t\t\tif(person.getStartFloor() > 0 && person.getDestinationFloor() <= elevatorController.getTotalFloor()) {\n\t\t\t\t\televatorController.addNewPassenger(person);\n\t\t\t\t}else {\n\t\t\t\t\tJOptionPane.showMessageDialog(\n\t\t\t\t\t\t\tnull, \n\t\t\t\t\t\t\t\"Invalid Input\", \n\t\t\t\t\t\t\t\"Information of New Passenger is Invalid! Please Input Again.\", \n\t\t\t\t\t\t\tJOptionPane.INFORMATION_MESSAGE);\n\t\t\t\t}\n\t\t\t}", "public void evalInd() {\n\t\tif (ourIndEval.evaluateInd(anIndividual)) { \n\t\t\tLogger.logDebugConsole(\" success eval\");\n\t\t\tLogger.log(\"Eval success \" + anIndividual.getClassName() + \" = \"\n\t\t\t\t\t+ anIndividual.getClassName() + \" Time: \"+anIndividual.getRunningTime()+\" Fit:\" + anIndividual.getFitness()\n\t\t\t\t\t+ \" TestError:\" + anIndividual.getFunctionalityErrorCount()+ \" ASTNodes: \" + anIndividual.getNumNodes() \n\t\t\t\t\t+ \" GPNodes: \" \t+ anIndividual.getNumGPNodes()\n\t\t\t\t\t+ \" xoverApplied: \" \t+ anIndividual.crossoverApplied()\n\t\t\t\t\t+ \" xovers: \" \t+ anIndividual.getCrossoverAttempts()\n\t\t\t\t\t+ \" mutationApplied: \" \t+ anIndividual.mutationApplied()\n\t\t\t\t\t+ \" mutations: \" \t+ anIndividual.getMutationAttempts());\n\t\t} else {\n\t\t\tLogger.log(\"Eval failed \" + anIndividual.getClassName());\n\t\t}\n\t\t\t\t\n\t}", "public void turnOn(){\n Logger.getGlobal().log(Level.INFO,\" Turning On..\");\n vendingMachine = new VendingMachine();\n inventoryPopulation();\n idle();\n }", "public void pickUpHerd() {\n rounds.get(currentRound).currentPlayerPickUpHerd();\n }", "Elevage createElevage();", "public void reproduceVirus() {\n\t\tOrganism newOrg;\n\t\t\n\t\tfor (int i=0; i < 1; i++) {\n\t\t\tnewOrg = new Organism(_world);\n\t\t\tif (newOrg.inherit(this, i==0)) {\n\t\t\t\t// It can be created\n\t\t\t\t_nTotalChildren++;\n\t\t\t\t_world.addOrganism(newOrg,this);\n\t\t\t\t_infectedGeneticCode = null;\n\t\t\t}\n\t\t\t_timeToReproduce = 20;\n\t\t}\n\t}", "public void einde(){\n if(veld[speler.getY()][speler.getX()] == 6){\n System.exit(0);\n }\n }", "public Village getArrive() {\n\t\treturn arrive;\n\t}", "private double individualEvaluation() {\n\t\t//System.out.println(\"indE\"+ myValues.get(myAction.getPurpose()).getStrength(null));\n\t\treturn myValues.get(myAction.getPurpose()).getStrength(null);\n\t}", "public abstract void createAssignment(int p);", "private void tournament_selection() {\r\n\r\n individual[] temp_pop = new individual[this.pop_size];\r\n\r\n for (int i = 0; i < this.pop_size; i++) {\r\n\r\n // pick 2 random ints to for indices of parents\r\n int parent1 = new Random().nextInt(this.pop_size);\r\n int parent2 = new Random().nextInt(this.pop_size);\r\n\r\n individual p1 = new individual(main_population.getPopulation()[parent1].getGenes(), solutions, output);\r\n individual p2 = new individual(main_population.getPopulation()[parent2].getGenes(), solutions, output);\r\n\r\n if (p1.getFitness() >= p2.getFitness()) {\r\n temp_pop[i] = p1;\r\n } else {\r\n temp_pop[i] = p2;\r\n }\r\n }\r\n this.main_population.setPopulation(temp_pop);\r\n this.main_population.update_population();\r\n }", "@Override\n protected void execute() {\n System.out.println(\"Elevator PID Loop:\");\n System.out.println(\"\\t - Current Position: \" + Robot.m_elevator.getEncoder().getPosition());\n \n SmartDashboard.putNumber(\"elevator/pos\", Robot.m_elevator.getEncoder().getPosition());\n // SmartDashboard.putNumber(\"elevator/target\", pos);\n //SmartDashboard.putNumber(\"elevator/error\", Math.abs(Robot.m_elevator.getEncoder().getPosition() - pos));\n // System.out.println(\"\\t - Error: \" + Robot.m)\n }", "public void shootBabyInto(int x, int y) {\n home.world.cells[x][y].resident\n = new Omnivore(home.world.cells[x][y]);\n }", "private void setEnemy(){\n depths.setEnemy(scorpion);\n throne.setEnemy(rusch);\n ossuary.setEnemy(skeleton);\n graveyard.setEnemy(zombie);\n ramparts.setEnemy(ghoul);\n bridge.setEnemy(concierge);\n deathRoom1.setEnemy(ghost);\n deathRoom2.setEnemy(cthulu);\n deathRoom3.setEnemy(wookie); \n }", "private GRIDagent getTestAgent()\n {\n String agtID = \"testAgent001\",\n currentLink = \"401538273_2_r\", // 40963664_0 106292026_0 1to2 17005466_7_r\n currentIntrx = \"401538273_2_r\", // 1040921516 // 1to2\n destIntrx = \"17005466_7_r\"; // 72823276_0 99to99 24to25 401538273_2_r\n // 864162469 - 1400447055 99282649_0_r [72823276_0 problem link]\n\n GRIDagent myAgent = new GRIDagent(agtID,currentLink,currentIntrx,destIntrx, false, false);\n\n return myAgent;\n }", "public void update (Elevator e, int name) {\n elevator = e;\n // Update the numerical information\n getInfo ();\n // Create a label for its current condition\n buildStrings (name, currCap, maxCap, currFloor, state);\n slider.setValue (currFloor);\n }", "public void executeevaluate() {\n \t\tString board = conf.getProperty(\"gamesman.board\");\n \t\tif (board == null)\n \t\t\tUtil.fatalError(\"Please specify a hash to evaluate\");\n \t\tBigInteger val = new BigInteger(board);\n \t\tSystem.out.println(gm.primitiveValue(gm.hashToState(val)));\n \t}", "public void enterRoom(Person x)\n {\n System.out.println(\"You enter a plain old room\");\n occupant = x;\n x.setxLoc(this.xLoc);\n x.setyLoc(this.yLoc);\n\n if (beenthere = true) {\n System.out.println(\"You have visited this room\");\n }\n beenthere = true;\n\n }", "@Test(groups = {\"Regression\", \"IntakeLender\"})\t\n\tpublic void LoAssignment() throws InterruptedException, AWTException {\n\t\t// Login to the BLN with provided credentials\n\t\tHomePage homePage = new HomePage(d);\n\t\t// Login to BLN Application\n\t\thomePage.logIntoBLN();\n\t\t// Navigating to MyProfile Tab\n\t\tUsers Users1 = homePage.navigateToUsers();\n\t\tLender Lender1=Users1.select_RCNLender();\n\t\tLender1.RCN_loanOfficers();\n\t\t// Navigating to MyProfile Tab\n\t\tUsers Users2 = homePage.navigateToUsers();\n\t\tUsers2.select_intakeLender();\n\t\tApplication Application1 = homePage.createLoanRequest();\n\t\tApplication1.LoanOfficer();\n\t\tApplication1.LoanOfficerTest(Users1.sortedList1,Users2.sortedList1);\n\t\t\n\t}", "public void checkAvaliableElevators()\r\n\t{\r\n\t\tSystem.out.println(\"--------- Checking Elevators Current Status ------\");\t\r\n\t\t\r\n\t\tif(availableElevadors.isEmpty())\r\n\t\t{\r\n\t\t\tfor(int i=0; i <numberOfElevators-3; i++) {\r\n\t\t\t\tavailableElevadors.add(occupiedElevadors.remove(i));\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"--------- Elevators are available again ------\");\r\n\t\t\r\n\t\t}else {\r\n\t\t\tfor(int i=0;i<availableElevadors.size();i++) {\r\n\t\t\t\tSystem.out.println(\" Elevator no \" + availableElevadors.get(i).getElevatorNumber() +\" ready for Requests\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tfor(int i=0;i<occupiedElevadors.size();i++) {\r\n\t\t\t\tSystem.out.println(\" Elevator no \" + occupiedElevadors.get(i).getElevatorNumber() +\" is Occupied\");\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t}\r\n\r\n\t}", "protected abstract int evaluate(GameState state, String playername);", "public static Population evolvePopulation(Population pop) {\n Population newPopulation = new Population(pop.populationSize(), false);\n\n // Keep our best individual if elitism is enabled\n int elitismOffset = 0;\n if (elitism) {\n newPopulation.saveTour(0, pop.getFittest());\n elitismOffset = 1;\n }\n\n // Crossover population\n // Loop over the new population's size and create individuals from\n // Current population\n for (int i = elitismOffset; i < newPopulation.populationSize(); i++) {\n // Select parents\n // Tour parent1 = tournamentSelection(pop);\n //Tour parent2 = tournamentSelection(pop);\n\n\n\n\n Tour[] temp_a = roullet( newPopulation);\n if( temp_a == null )\n {\n System.out.println(\"no a\");\n //r//eturn temp;\n }\n // Tour parent1 = tournamentSelection(pop);\n //Tour parent2 = tournamentSelection(pop);\n Tour parent1 = temp_a[0];\n Tour parent2 = temp_a[1];\n\n\n\n\n\n\n\n\n // Crossover parents\n Tour child = crossover(parent1, parent2);\n // Add child to new population\n newPopulation.saveTour(i, child);\n }\n\n // Mutate the new population a bit to add some new genetic material\n for (int i = elitismOffset; i < newPopulation.populationSize(); i++) {\n mutate(newPopulation.getTour(i));\n }\n\n return newPopulation;\n }", "public MapLocation getEnemySwarmTarget() {\n\t\tdouble a = Math.sqrt(vecEnemyX * vecEnemyX + vecEnemyY * vecEnemyY) + .001;\n\n\t\treturn new MapLocation((int) (vecEnemyX * 7 / a) + br.curLoc.x,\n\t\t\t\t(int) (vecEnemyY * 7 / a) + br.curLoc.y);\n\n\t}", "abstract void assignOne();", "@Override\r\n public void doEdit ()\r\n throws DoEditException\r\n {\n List<StringWithProperties> criteria = probNet.getDecisionCriteria ();\r\n StringWithProperties criterion = null;\r\n switch (stateAction)\r\n {\r\n case ADD :\r\n if (criteria == null)\r\n {\r\n // agents = new StringsWithProperties();\r\n criteria = new ArrayList<StringWithProperties> ();\r\n }\r\n criterion = new StringWithProperties (criterionName);\r\n // agents.put(agentName);\r\n criteria.add (criterion);\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case REMOVE :\r\n for (StringWithProperties criterio : criteria)\r\n {\r\n if (criterio.getString ().equals (criterionName))\r\n {\r\n criterion = criterio;\r\n }\r\n }\r\n criteria.remove (criterion);\r\n // TODO assign criteria to node\r\n // it is also necessary to delete this criteria from the node it\r\n // was assigned to\r\n /*\r\n * if (criteria != null) { for (ProbNode node :\r\n * probNet.getProbNodes()) { if\r\n * (node.getVariable().getDecisionCriteria\r\n * ().getString().equals(criteriaName)) {\r\n * node.getVariable().setDecisionCriteria(null); } } }\r\n */\r\n if (criteria.size () == 0)\r\n {\r\n criteria = null;\r\n }\r\n probNet.setDecisionCriteria2 (criteria);\r\n break;\r\n case DOWN :\r\n // StringsWithProperties newAgentsDown = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasDown = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsDown.put((String)dataTable[i][0]);\r\n newCriteriasDown.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasDown);\r\n break;\r\n case UP :\r\n // StringsWithProperties newAgentsUp = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasUp = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsUp.put((String)dataTable[i][0]);\r\n newCriteriasUp.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasUp);\r\n break;\r\n case RENAME :\r\n // agents.rename(agentName, newName);\r\n // StringsWithProperties newAgentsRename = new\r\n // StringsWithProperties();\r\n ArrayList<StringWithProperties> newCriteriasRename = new ArrayList<StringWithProperties> ();\r\n for (int i = 0; i < dataTable.length; i++)\r\n {\r\n // newAgentsRename.put((String)dataTable[i][0]);\r\n newCriteriasRename.add (new StringWithProperties ((String) dataTable[i][0]));\r\n }\r\n probNet.setDecisionCriteria2 (newCriteriasRename);\r\n break;\r\n }\r\n }", "void EvolutionWithElitism(){\n\t\t \tint i, j, l, k;\n\t\t\t//individual[] temp;\n\t\t\tbyte _flippc=0,_flippm=0;\n//\t\t\tString _temp1=\"\", _temp2=\"\";\n\t\t\tint[] _cp;\n\t\t\tnode[] _nd,_nm;\n\t\t\t// Khoi tao quan the dau tien \n\t\t\tRampedInit(6, 0.5);\n\t\t\t//RampedInitOffLine(6, 0.5,15);\n\t\t\t\n//\t\t\tconstructiveRate = new double[NUMGEN];\n//\t\t\tsemanticDistance = new double[NUMGEN];\n\t\t\t\n\t\t\tgen = 0;\n\t\t\twhile(gen < generation) {\n\t\t\t\t\n\t\t\t\tComputeFitness();\n\t\t\t\t\n//\t\t\t\tint g_ncross = 0;\n//\t\t\t\tdouble g_sd = 0;\n//\t\t\t\tPrintToFile();\n\t//----------------------\n//\t\t\t\tFileInputStream instream = null;\n//\t\t\t\tPrintStream outstream = null;\n//\t\t\t\tPrintStream console = System.out;\n//\t\t\t\ttry {\n//\t\t\t\t\toutstream = new PrintStream(new FileOutputStream(\"c:/result/\" + \"detail_\"+ gen + \".txt\"));\n//\t\t\t\t\tSystem.setOut(outstream);\n//\t\t\t\t} catch(Exception e) {\n//\t\t\t\t\tSystem.err.println(\"Error Occurred.\");\n//\t\t\t\t}\n//\t\t\t\tfor(i = 0; i < poplen; i++) {\n//\t\t\t\t\tSystem.out.printf(\"%3.5f \",oldpop[i].fitness);\n//\t\t\t\t\tif((i+1) % 10 == 0) {\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(oldpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// copy anh tot nhat sang the he sau\t \t\n\t\t\t\tnewpop[0].CopyIndividual(bestcurrent[gen], TRUE);\n\t\t\t\t// dot bien anh thu 2\n\t\t\t \n\t\t\t\tl=1;\t\n\t\t\t\ti = TourSelect(TOURSIZE);\n//\t\t\t\t\n\t\t\t\t\n\t\t\t newpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\tindividual[] m_individual0=new individual[1];\n\t\t\t\tint[] _mt0=new int[1];\n\t\t\t\t_nm=new node[1];\n\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual0, 15, TRUE,_mt0,_nm);\n\t\t\t\tnewpop[l]=new individual();\n\t\t\t\tnewpop[l].CopyIndividual(m_individual0[0], TRUE);\t\t\t\n\t\t\t\tnewpop[l].evaluated=FALSE;\t\t\n//\t\t\t\t\n//\t\t\t\tm_individual0=null;\n\t\t\t\t\n\t//------------------------\t\t\n\t\t\t\tl = 2;\t\t\t\n\t\t\t\twhile(l < poplen) {\n\t\t\t\t//\tSystem.out.println(\"Generation \"+ String.valueOf(gen)+\":\");\n\t\t\t\t\t\t\t\t\t\t\n//\t\t\t\t\t\n\t\t\t\t\ti = TourSelect(TOURSIZE);\n\t\t\t\t\tj = TourSelect(TOURSIZE);\n\t\t\t\t\t\n//\t\t\t\t\t\n//\t\t\t\t\t\t\n\t\t\t\t _flippc=Flip(pcross);\n//\t\t\t\t System.out.printf(\"pcross:%d\", _flippc);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippc == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] i_temp=new individual[2];\n\t\t\t\t\t\t_cp=new int[2];\n\t\t\t\t\t\t_nd=new node[2];\n\t\t\t\t//\t\n\t\t\t\t//\t\tif(SubTreeSwapWithTTest(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(SubTreeSwap(oldpop[i], oldpop[j], i_temp,_cp,_nd) == TRUE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(i_temp[0],TRUE);\n\t\t\t\t\t\t\tnewpop[l+1].CopyIndividual(i_temp[1],TRUE);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tncross++;\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// semantic distance\n//\t\t\t\t\t\t\tg_sd += newpop[l].getSemanticDistance(oldpop[i]);\n//\t\t\t\t\t\t\tg_sd += newpop[l+1].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\n\t\t\t\t\t\t\t\n//\t\t\t\t\t\t\tg_sd += oldpop[i].getSemanticDistance(oldpop[j]);\t\t\t\t\t\n//\t\t\t\t\t\t\tg_ncross++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\t\t\t\t\t\t\n\t\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\t\ti_temp=null;\n\t\t\t\t\t\t} \n\t\t\t\t\t} \n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tnewpop[l].CopyIndividual(oldpop[i], TRUE);\n\t\t\t\t\t\tnewpop[l + 1].CopyIndividual(oldpop[j],TRUE);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"reproduction\");\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t// mutation test\n\t\t\t\t\t_flippm=Flip(pmutate);\n//\t\t\t\t\tSystem.out.printf(\"pmutation:%d\", _flippm);\n//\t\t\t\t System.out.println();\n\t\t\t\t\tif(_flippm == 1) {\t\t\t\t\t\n\t\t\t\t\t\tindividual[] m_individual=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l], m_individual, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l]=new individual();\n\t\t\t\t\t\tnewpop[l].CopyIndividual(m_individual[0], TRUE);\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l].evaluated=FALSE;\n\t\t\t\t\t\t\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+l+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual=null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n//\t\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t\t_temp1=newpop[l].chrom.TreeToStringN(newpop[l].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp1);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(Flip(pmutate) == 1) {\n\t\t\t\t\t\tindividual[] m_individual1=new individual[1];\n\t\t\t\t\t\tint[] _mt=new int[1];\n\t\t\t\t\t\t_nm=new node[1];\n\t\t\t\t\t\tthis.ReplaceSubTree(newpop[l + 1], m_individual1, 15, TRUE,_mt,_nm);\n\t\t\t\t\t\tnewpop[l+1]=new individual();\n\t\t\t\t\t\tnewpop[l+1].CopyIndividual(m_individual1[0], TRUE);\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tnewpop[l+1].evaluated=FALSE;\n//\t\t\t\t\t\tSystem.out.printf(\"%s\",\"mutation \"+(l+1)+\" replacepoint:\"+_mt[0]);\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(_nm[0]);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t\tnmutate++;\n\t\t\t\t\t\tm_individual1=null;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n//\t\t\t\t\t\t_temp2=\"\";\n//\t\t\t\t\t\t_temp2=newpop[l+1].chrom.TreeToStringN(newpop[l+1].chrom);\n//\t\t\t\t\t\tSystem.out.printf(\"%s\", _temp2);\t\t\t\n//\t\t\t\t\t\tSystem.out.println();\n\t\t\t\t\t}\n\t\t\t\t\tl += 2;\n\t\t\t\t}\n//\t\t\t\tfor(int ii = 0; ii < poplen; ii++) {\t\t\t\n//\t\t\t\t\t_temp1=\"\";\n//\t\t\t\t\t_temp1=oldpop[ii].chrom.TreeToStringN(newpop[ii].chrom);\n//\t\t\t\t\tSystem.out.printf(\"%s\",ii+\" \"+ _temp1);\t\t\t\n//\t\t\t\t\tSystem.out.println();\n//\t\t\t\t}\n//\t\t\t\toutstream.close();\n//\t\t\t\tSystem.setOut(console);\n\t\t\t\t// Thống kê tỷ lệ tTest\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t//\t\t\tsemanticDistance[gen] = g_sd / (2.0 * g_ncross);\n//\t\t\t\tsemanticDistance[gen] = g_sd /g_ncross;\n\t\t\t\t\n\t\t\t\tgen++;\n\t\t\t\tfor(k = 0; k < poplen; k++)\n\t\t\t\t{\n\t\t\t\t\toldpop[k]=null;\n\t\t\t\t\toldpop[k]=new individual();\n\t\t\t\t\toldpop[k].CopyIndividual(newpop[k], TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void program() throws Exception {\r\n int valg;\r\n skrivInn(\"dvdarkiv2.txt\");//leser inn fra dvd arkivet\r\n while(true) {\r\n meny();//kaller paa meny for a skrive ut menyen etter hvert fullforte valg\n System.out.println(\"Skriv inn valget ditt\");\n valg = sjekkOmTall();//kaller paa metoden for o sorge for aa faa valg\n if (valg == 1) {\n nyPerson();\n }\n else if (valg == 2) {\n kjop();\n }\n else if (valg == 3) {\n laan();\n }\n else if (valg == 4) {\n visPerson();\n }\n else if (valg == 5) {\n visOversikt();\n }\n else if (valg == 6){\n retur();\n }\n else if (valg == 7) {\n avslutt();\n }\n }\r\n }", "@Override\n\tpublic void visit(EquipmentToy e) {\n\t\t\n\t}", "static Object[] genTeamInvs(MatchTeam viewer, MatchTeam winner, MatchTeam loser) {\n return new Object[] {\n WINNER + (viewer == winner ? \" (Your team)\" : \" (Enemy team)\"),\n clickToViewLine(winner.getAllMembers()),\n LOSER + (viewer == loser ? \" (Your team)\" : \" (Enemy team)\"),\n clickToViewLine(loser.getAllMembers()),\n };\n }", "protected abstract void gatherTeam();", "public static void spawnEnemy(){\n RNG.D100();\n if(PlayerStats.LVL <= 2){\n if(RNG.num <= 90){\n enemy = \"imp\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 2 && PlayerStats.LVL <= 3){\n if(RNG.num <= 20){\n enemy = \"imp\";\n }else if(RNG.num > 20 && RNG.num <= 90){\n enemy = \"toadman\";\n }else{\n enemy = \"IMP LORD\";\n }\n }else if(PlayerStats.LVL > 3 && PlayerStats.LVL <= 5){\n if(RNG.num <= 10){\n enemy = \"toadman\";\n }else if(RNG.num > 10 && RNG.num <= 90){\n enemy = \"giant spider\";\n }else{\n enemy = \"BROODMOTHER\";\n }\n }else if (PlayerStats.LVL > 5 && PlayerStats.LVL <= 8){\n if(RNG.num <= 30){\n enemy = \"goblin sorceror\";\n }else if(RNG.num > 30 && RNG.num <= 60){\n enemy = \"goblin warrior\";\n }else if(RNG.num >60 && RNG.num <= 90){\n enemy = \"goblin archer\";\n }else if(RNG.num > 90 && RNG.num <= 100){\n enemy = \"GOBLIN CHIEFTAN\"; \n }\n } \n }", "void evoluer()\n {\n int taille = grille.length;\n int nbVivantes = 0;\n for(int i=-1; i<2; i++)\n {\n int xx = ((x+i)+taille)%taille; // si x+i=-1, xx=taille-1. si x+i=taille, xx=0\n for(int j=-1; j<2; j++)\n {\n if (i==0 && j==0) continue;\n int yy = ((y+j)+taille)%taille;\n if (grille[xx][yy].vivante) nbVivantes++;\n }\n }\n if (nbVivantes<=1 || nbVivantes>=4) {vientDeChanger = (vivante==true); vivante = false;}\n if (nbVivantes==3) {vientDeChanger = (vivante==false); vivante = true;}\n }", "public abstract void peel();", "default void interactWith(Lever lever) {\n\t}", "Assign createAssign();", "public void adjLocation(double l){this.PlayerLocation;}", "@Override\n public void enterRoom(Person x) {\n\n occupant = x;\n x.setxLoc(this.xLoc);\n x.setyLoc(this.yLoc);\n System.out.println(\"Edmund is too good at coding! You faint from his greatness!\");\n System.out.println(\" | _______________ |\\n\" +\n \" | |XXXXXXXXXXXXX| |\\n\" +\n \" | |XXXXXXXXXXXXX| |\\n\" +\n \" | |XXXXXXXXXXXXX| |\\n\" +\n \" | |XXXXXXXXXXXXX| |\\n\" +\n \" | |XXXXXXXXXXXXX| |\\n\" +\n \" |_________________|\\n\" +\n \" _[_______]_\\n\" +\n \" ___[___________]___\\n\" +\n \"| [_____] []|__\\n\" +\n \"| [_____] []| \\\\__\\n\" +\n \"L___________________J \\\\ \\\\___\\\\/\\n\" +\n \" ___________________ /\\\\\\n\" +\n \"/###################\\\\ (__)\");\n Runner.gameOff();\n }", "public int chooseElevator() {\n\t\tPair<Integer,Direction> eleLoc;\n\t\tHashMap<Integer, Pair<Integer, Direction>> mapClone = map.getElevatorsData(); //get map of up to date elevator locations\n\t\tint distance;\n\t\tint minDist=9999;\n\t\tint choice = -1;\n\t\t//iterate over all elevators in the system\n\t\tfor(int i = 1;i<=Constants.elevator;i++) {\n\t\t\teleLoc = mapClone.get(i);//get elevators current system\n\t\t\tdistance =calculateDistance(eleLoc);\n\t\t\t//System.out.println(\"Elevator \" + i + \" is \" + distance + \" away from next job\");\n\t\t\t//if distance is optimal\n\t\t\tif(distance >=0 && distance <minDist) {\n\t\t\t\tchoice = i;\n\t\t\t\tminDist = distance;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn choice;\n\t}", "public void niveauSuivant() {\n niveau = niveau.suivant();\n }", "void ponderhit();", "public void battleVampire() {\n\n\t \tPlayer playern = this.playern;\n\t\tcyborgVampire = new CyborgVampire(\"Cyborg Vampire\");\n\t\tSystem.out.println(\"*shivers* It is the evil Cyber Vampire\");\n\t\tSystem.out.println(\"[press enter to fight]\");\n\t\tsc.nextLine();\n\n\t\twhile (true) {\n\t\t\tcyborgVampire.takeDamage(playern.attack());\n\t\t\tif (!cyborgVampire.getisDead()) {\n\t\t\t\tSystem.out.println(\"You killed the Cyborg Vampire, earned \" + cyborgVampire.giveExp() + \" experience\");\n\t\t\t\tplayern.setExp(cyborgVampire.giveExp());\n\t\t\t\tplayern.afterBattleStats();\n\t\t\t\t//playern.restoreHpAfterBattle();\n\t\t\t\tSystem.out.println();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tGame.playern.takeDamage(cyborgVampire.attack());\n\t\t\tif (!Game.playern.getIsAlive()){\n\t\t\t\tSystem.out.println(\"You are killed\");\n\t\t\t\tSystem.out.println(\"You have lost the game and turn into warrior zombie\");\n\t\t\t\tplayern.afterBattleStats();\n\t\t\t\tbreak;\n\t\t\t\t//System.exit(0);\n\t\t\t}\n\n\t\t\tSystem.out.println(\"* \" + playern.getName() + \": \" + playern.getHp() + \" hp\");\n\t\t\tSystem.out.println(\"* \" + cyborgVampire.getName() + \": \" + cyborgVampire.getHp() + \" hp\");\n\t\t\tSystem.out.println(\"[press enter to continue]\");\n\t\t\tsc.nextLine();\n\t\t}\n\t\t topScore();\n\t}", "public interface GAIndividual\r\n{\r\n public void mutate(double rate);\r\n public GAIndividual directReproduce();\r\n public GAIndividual reproduce( GAIndividual i );\r\n \r\n public int getFitness();\r\n public void setFitness ( int fitness );\r\n public void setRoulette (int start, int finish);\r\n public boolean hasRouletteNumber (int winner);\r\n public String toString();\r\n}", "@Override\n public void visit(final Rogue rogue) {\n rogue.getFirstAbility().changeAllVictimModifier(DAMAGE_MODIFIER_FOR_ROGUE);\n rogue.getSecondAbility().changeAllVictimModifier(DAMAGE_MODIFIER_FOR_ROGUE);\n // anunt magicianul de ajutorul ingerului\n rogue.getEvent().anEventHappened(rogue, this, \"help\");\n // ofer Xp jucatorului pentru a trece la nivelul urmator\n rogue.gainXp(getNewXp(rogue));\n }", "public Village getLeave() {\n\t\treturn leave;\n\t}", "protected void getProbabilitiesStayInJail() {\t\t\r\n\t\tboard().dice().forEachPossibleRoll((roll, size) -> {\t\t\t\r\n\t\t\t//if doubles, we're forced to leave jail (but our doubles are accounted for, we don't roll again)\r\n\t\t\tif (roll.isDoubles())\r\n\t\t\t\tboard().nextSpace(board().getSpace(justVisitingID), roll.getTotal()).updateProbAndRoll(1, (double) 1 / size, false);\r\n\t\t\telse\r\n\t\t\t\tboard().getSpace(this.ID() + 1).updateProbAndRoll(0, (double)1 / size, false);\r\n\t\t});\r\n\t}", "protected Element evalAssurance(Assurance ass){\n\t\tRecord r1 = ass.getLeftRecord();\n\t\tRecord r2 = ass.getRightRecord();\n\t\tOperator op = ass.getOperator();\n\t\tElement an = el(\"bpws:assign\");\n\t\tif (r1.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r1.getFormular(), \"nswomoxsd:leftValue\"));\n\t\tif (r2.getType() == RecordType.FORMULAR)\n\t\t\tan.appendChild(setExpr(r2.getFormular(), \"nswomoxsd:rightValue\"));\n\t\tan.appendChild(\n\t\t\tsetExpr(\n\t\t\t\tgetMyVarPath(\"/nswomoxsd:leftValue\") + \n\t\t\t\top.value() +\n\t\t\t\tgetMyVarPath(\"nswomoxsd:rightValue\"),\n\t\t\t\t\"nswomoxsd:value\"\n\t\t\t)\n\t\t);\n\t\treturn an;\n\t}", "private int tournament()\r\n {\r\n\tint out = spinTheWheel();\r\n\tdouble max = ff.evaluate(chromos.get(out),generation());\r\n\tdouble temp_fitness = 0;\r\n\tint temp_index = 0;\r\n\r\n\tfor(int i = 0; i < selPara - 1 + tourStep*generation(); i++)\r\n\t {\r\n\t\ttemp_index = spinTheWheel();\r\n\t\ttemp_fitness = ff.evaluate(chromos.get(temp_index),generation());\r\n\t\tif(temp_fitness > max)\r\n\t\t {\r\n\t\t\tmax = temp_fitness;\r\n\t\t\tout = temp_index;\r\n\t\t }\r\n\t }\r\n\treturn out;\r\n }", "public Evolvable getIndividual(int index){\n\t\treturn population[index];\n\t}", "public interface Elevator {\n public static final int UP = 1, LEVEL = 0, DOWN = -1, ERROR = -2;\n /** Returns the minimal floor number to which this Elevator can reach(often a negative value).\n * This is the same value as the lowest floor in the building - this elevator belongs to. */\n public int getMinFloor();\n /** Returns the maximal floor number to which this Elevator can reach.\n * This is the same value as the highest floor in the building - this elevator belongs to. */\n public int getMaxFloor();\n /** Returns the time (in seconds it takes the Elevator to open its doors. */\n public double getTimeForOpen();\n /** Returns the time (in seconds it takes the Elevator to close its doors */\n public double getTimeForClose();\n /** Returns the Elavator's current state: {UP, DOWN, LEVEL, ERROR} the state \"LEVEL\" mark that the elevator has reached the floor -\n * and is now ready to load / unload and get new orders. */\n public int getState(); // UP, DOWN, LEVEL, ERROR\n /** Returns the Elevator's current position (floor) as an Integer. */\n public int getPos();\n /** Moves the elevator form the current position to the destination floor. */\n public boolean goTo(int floor);\n /** Allows the elevator to stop in an intermidiate floor between src and dest, assumeing the elevator has not yer pass the desired floor in which it needs to stop. */\n public boolean stop(int floor);\n /** Returns the speed (in floor per second), e.g. if the Elevator speed is 0.4 - it takes it 2.5 seconds to pass a single floor. */\n public double getSpeed();\n /** Return the time in seconds that it takes the elevator to start moving in full speed (assumed to be a fixed value). */\n public double getStartTime();\n /** Return the time in seconds that it takes the elevator to stop moving in full speed (assumed to be a fixed value).*/\n public double getStopTime();\n /**\n * @return the id of this elevator (simple index as in the building).\n * Note: this index should be the same as in the elevator allocation algorithm.\n */\n public int getID();\n}", "protected abstract void defineEnemy();", "void robPlayer(HexLocation location, int victimIndex);", "public void setEquipmentLng(Double equipmentLng) {\n this.equipmentLng = equipmentLng;\n }", "@Override\n\t\tpublic void alive() {\n\t\t\tSystem.out.println(\"liverId is: \" + liverId); //liver id is a static variable of the Liver class, so we CAN access it directly. \n\t\t\tSystem.out.println(new Animal().age); //Just like a static method, the only way to access NON static vars here is to create an animal object, then access that age..\n\t\t}", "public void runTournament() {\n\t\t//ArrayList<Gene> tournament = new ArrayList<Gene>();\n\t\tPriorityQueue<Gene> tournament = new PriorityQueue<Gene>(Collections.reverseOrder());\n\t\tint numContenders = (int)(FRAC_IN_TOURNAMENT * geneNumber);\n\t\tSet<Integer> chosenOnes = new HashSet<Integer>();\n\t\t\n\t\twhile(chosenOnes.size() < numContenders) {\n\t\t\tint randIndex = (int) (Math.random() * geneNumber);\n\t\t\tchosenOnes.add(randIndex);\n\t\t}\n\t\tfor(int i : chosenOnes){\n\t\t\ttournament.add(genepool.get(i));\n\t\t}\n\t\t//int firstIndex = getMax(tournament, -1);\n\t\t//int secondIndex = getMax(tournament, firstIndex);\n\t\t//Gene parent1 = tournament.get(firstIndex);\n\t\t//Gene parent2 = tournament.get(secondIndex);\n\t\tGene parent1 = tournament.poll();\n\t\tGene parent2 = tournament.poll();\n\t\t// Create a new gene from the 2 fittest genes\n\t\tGene newGene = parent1.waCrossover(parent2);\n\t\t\n\t\t// Calculate fitness for the new gene\n\t\tPlayerSkeleton.runGames(numGames, newGene);\n\t\toffspringPool.add(newGene);\n\t}", "public void equip();", "public void execute(Player player) {\n\t\tRoom currentRoom = player.getAdventureGame().currentRoom();\n\t\tList <Direction>neibourgh = new ArrayList<Direction>();\n\t\tneibourgh.addAll(currentRoom.getNeighbours().keySet());\n\t\tSystem.out.println(player);\n\t\tdisplayList(\"Items :\\t\", currentRoom.getItemsList());\n\t\tdisplayList(\"Monsters :\", currentRoom.getMonstersList());\n\t\tdisplayList(\"Neighbours :\", neibourgh);\n\t\tSystem.out.println(\"--------------------------------------------\");\n\t}" ]
[ "0.57547534", "0.5532584", "0.54211634", "0.5412363", "0.53861016", "0.5330479", "0.52862525", "0.52690905", "0.52628917", "0.5259916", "0.5236794", "0.5163232", "0.51334006", "0.5122734", "0.5117164", "0.5080557", "0.50727004", "0.50698763", "0.5062721", "0.5054349", "0.5048192", "0.50465345", "0.5026179", "0.5016121", "0.50086236", "0.500441", "0.50042194", "0.5002152", "0.49865443", "0.49863234", "0.49675617", "0.49644914", "0.4964327", "0.49505398", "0.4937994", "0.49325266", "0.492881", "0.4927122", "0.49212682", "0.49139023", "0.4907488", "0.49027127", "0.49008894", "0.48960912", "0.4894726", "0.48799616", "0.4879917", "0.48649055", "0.48640203", "0.48620048", "0.4854881", "0.48542297", "0.48534745", "0.48399097", "0.48365268", "0.48321128", "0.48316678", "0.48303", "0.48281544", "0.4823592", "0.48218292", "0.48202336", "0.48185036", "0.48141766", "0.48089084", "0.48080716", "0.48044395", "0.48024642", "0.48012835", "0.47964612", "0.47963277", "0.47927636", "0.4789895", "0.47891164", "0.47884288", "0.47864288", "0.47829834", "0.47816974", "0.4781145", "0.47770914", "0.4776266", "0.4775059", "0.47714633", "0.47693902", "0.47689772", "0.4767664", "0.4762067", "0.47619185", "0.47601384", "0.4744199", "0.47441882", "0.47420952", "0.47412986", "0.47403574", "0.4740053", "0.4735671", "0.47267386", "0.47261298", "0.47260353", "0.4724331" ]
0.57665503
0
Creamos el constructor para crear un objeto con datos de entrada
public Aeronave(int NoElises,int NoAlas, int NoPasajeros) { super(); this.NoElises=NoElises; this.NoAlas=NoAlas; this.NoPasajeros=NoPasajeros; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Datos(){\n }", "public Alojamiento() {\r\n\t}", "public Vehiculo() {\r\n }", "public Candidatura (){\n \n }", "public Caso_de_uso () {\n }", "public CampoModelo(String valor, String etiqueta, Integer longitud)\n/* 10: */ {\n/* 11:17 */ this.valor = valor;\n/* 12:18 */ this.etiqueta = etiqueta;\n/* 13:19 */ this.longitud = longitud;\n/* 14: */ }", "public Data() {\n \n }", "Data() {\n\t\t// dia = 01;\n\t\t// mes = 01;\n\t\t// ano = 1970;\n\t\tthis(1, 1, 1970); // usar um construtor dentro de outro\n\t}", "public Data() {\n }", "public Data() {\n }", "public CCuenta()\n {\n }", "public DesastreData() { //\r\n\t}", "public Data() {}", "public Carrera(){\n }", "public Pasien() {\r\n }", "public Corso() {\n\n }", "public Empleado() { }", "public Transportista() {\n }", "public prueba()\r\n {\r\n }", "public Estado() {\r\n }", "public Estado() {\r\n //Constructor vacio\r\n }", "public TradeData() {\r\n\r\n\t}", "private BaseDatos() {\n }", "public EstadosSql() {\r\n }", "public Estado() {\n }", "public AntrianPasien() {\r\n\r\n }", "public Respuesta() {\n }", "public Venda() {\n }", "public Ciudad()\n {\n\n }", "public CuentaDeposito() {\n super();\n }", "public CrearQuedadaVista() {\n }", "public InitialData(){}", "public Postoj() {}", "public Producto() {\r\n }", "public Busca(){\n }", "public Producto() {\r\n\t\tsuper();\r\n\t\tID = getIDnuevoProducto();\r\n\t\tnombre = \"\";\r\n\t\tvendedor = \"\";\r\n\t\tprecio = 0;\r\n\t\tcantidad = 0;\r\n\t\tenVenta = false;\r\n\t\tdescripcion = \"\";\r\n\t\tcategorias = new Categoria();\r\n\t\tcaracteristicas = null;//TODO CORREGIR\r\n\t}", "public Persona(){\n \n }", "public Persona(){\n \n }", "public Constructor(){\n\t\t\n\t}", "public Kullanici() {}", "public PersistenciaCMT() {\n\n }", "Constructor() {\r\n\t\t \r\n\t }", "public Tecnico(){\r\n\t\tthis.matricula = 0;\r\n\t\tthis.nome = \"NULL\";\r\n\t\tthis.email = \"NULL\";\r\n\t\tthis.telefone = \"TELEFONE\";\r\n\t\tlistaDeServicos = new ArrayList<Servico>();\r\n\t}", "public PersonaFisica() {}", "public Troco() {\n }", "public Exercicio(){\n \n }", "public Persona() {\n\t}", "public Estudiante(String nom) // Constructor 1: Se le asigna un valor al atributo nombre cuando se cree el objeto.\r\n {\r\n this.nombre = nom;\r\n }", "public AfiliadoVista() {\r\n }", "public Persona() {\n \t\n }", "public TCubico(){}", "public Cliente(){\r\n this.nome = \"\";\r\n this.email = \"\";\r\n this.endereco = \"\";\r\n this.id = -1;\r\n }", "public Documento() {\n\n\t}", "public Consulte()\n {\n }", "public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }", "public Persona() {\n }", "public Persona() { // constructor sin parámetros\r\n\t\t\r\n\t\tthis.nif = \"44882229Y\";\r\n\t\tthis.nombre=\"Anonimo\";\r\n\t\tthis.sexo = 'F';\r\n\t\tthis.fecha = LocalDate.now();\r\n\t\tthis.altura = 180;\r\n\t\tthis.madre = null;\r\n\t\tthis.padre = null;\r\n\t\tcontador++;\r\n\t}", "public Empleado(String nombre, String departamento, String posicion, int salario)\n {\n // initialise instance variables\n this.nombre=nombre;\n this.departamento=departamento;\n this.posicion=posicion;\n this.salario=salario;\n \n }", "public paciente()\n {\n con = new bdconexion(); //instancia la clase bdconexion\n }", "public Achterbahn() {\n }", "public Propuestas() {}", "public Carrinho() {\n\t\tsuper();\n\t}", "public Classe() {\r\n }", "public CompanyData() {\r\n }", "public Clade() {}", "public MPaciente() {\r\n\t}", "public Odontologo() {\n }", "public Producto (){\n\n }", "public PedidoRecord() {\n super(Pedido.PEDIDO);\n }", "protected Asignatura()\r\n\t{}", "public Valvula(){}", "public CreateData() {\n\t\t\n\t\t// TODO Auto-generated constructor stub\n\t}", "public Aritmetica(){ }", "public SensorData() {\n\n\t}", "public TebakNusantara()\n {\n }", "public datosTaller() {\n this.cedulaCliente = new int[100]; //Atributo de la clase\n this.nombreCliente = new String[100]; //Atributo de la clase\n this.compraRealizada = new String[100]; //Atributo de la clase\n this.valorCompra = new float[100]; //Atributo de la clase\n this.posicionActual = 0; //Inicializacion de la posicion en la que se almacenan datos\n }", "public Doc_estado() {\n }", "public ProductoCreable newInstance(int codigo, String nombre){\r\n \r\n }", "public Arquero(){\n this.vida = 75;\n this.danioAUnidad = 15;\n this.danioAEdificio = 10;\n this.rangoAtaque = 3;\n this.estadoAccion = new EstadoDisponible();\n }", "public LecturaPorEvento() \r\n {\r\n }", "public ValorVariavel() {\r\n }", "protected Persona (String nombre,String apellido, String fechaNac){\r\n this.nombre = nombre;\r\n this.apellido = apellido;\r\n this.fechaNac = fechaNac;\r\n }", "public cola_de_un_banco(){// se crea nuestro metodo costructor \r\n primero=null;//se crea el tipo de indicaciones con valor a null\r\n ultimo=null;\r\n}", "public SlanjePoruke() {\n }", "public Empresa() {\n super();\n this.nif = 0;\n this.raio = 0.0;\n this.precoPorKm = 0.0;\n this.precoPorPeso = 0.0;\n this.precoPorHora = 0.0;\n this.available = false;\n this.certificado = false;\n this.historico = new Historico();\n this.pe = null;\n }", "public Nodo(datos libro)\n {\n this.libro=libro;//LA VARIABLE LIBRO TENDRA LOS DATOS DE LA CLASE LIBRO\n }", "public Tarifa() {\n ;\n }", "public Aktie() {\n }", "public ChoixEntreprise() {\n\n }", "public Prova() {}", "public Firma() {\n }", "public Veiculo() {\r\n\r\n }", "public CambioComplementariosDTO() { }", "public Curso() {\r\n }", "public DataBean() {\r\n \r\n }", "public Produto() {}", "public Employee(String nama, int usia) {\r\n // Constructor digunakan untuk inisialisasi value, yang di inisiate saat melakukan instantiation\r\n this.nama = nama;\r\n this.usia = usia;\r\n }", "public AgenteEstAleatorio() {\r\n }", "public MorteSubita() {\n }", "public Asiento() {\n\t\tthis(\"asiento\", null);\n\t}", "public CorreoElectronico() {\n }" ]
[ "0.7241561", "0.72319096", "0.71385974", "0.7022022", "0.6995473", "0.69918185", "0.6985698", "0.6984074", "0.6973395", "0.6973395", "0.69474715", "0.6920862", "0.69032425", "0.68927497", "0.68851197", "0.6878922", "0.68684995", "0.6848049", "0.6841271", "0.67909634", "0.6764199", "0.67638767", "0.6760612", "0.6750737", "0.6732159", "0.67318934", "0.67284256", "0.6728399", "0.67189676", "0.67092013", "0.6705202", "0.6695822", "0.66727525", "0.6672216", "0.66555154", "0.6653263", "0.66432023", "0.66432023", "0.66340935", "0.66313976", "0.6630558", "0.66288847", "0.66270506", "0.6626206", "0.66180223", "0.6615193", "0.6614399", "0.6607533", "0.66010696", "0.6581511", "0.6575954", "0.6573834", "0.65671164", "0.6563783", "0.6562232", "0.6555608", "0.65537703", "0.6540361", "0.65329087", "0.65229934", "0.652035", "0.65155125", "0.6511296", "0.6508161", "0.65068275", "0.65051395", "0.65029424", "0.65018606", "0.65001523", "0.64897925", "0.6488086", "0.64865565", "0.64822817", "0.64766955", "0.64671504", "0.6465033", "0.6459064", "0.6458985", "0.64534754", "0.64453655", "0.6442511", "0.64394766", "0.64376634", "0.6427854", "0.642755", "0.6420761", "0.64200217", "0.6418468", "0.64112294", "0.6406742", "0.64042777", "0.6394835", "0.6392451", "0.63889825", "0.63862026", "0.6385702", "0.6384519", "0.6383136", "0.6372745", "0.6368436", "0.636651" ]
0.0
-1
metodos para imprimir los datos
public void ImprimirDatos(){ System.out.println("Número de elises: "+NoElises); System.out.println("Número de alas: "+NoAlas); System.out.println("Número de pasajeros: "+NoPasajeros); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void freshTheData() {\n mData.clear();\n mData.addAll(mDataOrg);\n }", "private void initializeData() {\n ListaOfertas.removeAll(ListaOfertas);\n for(Articulo listaJuegos: ArticuloRepository.getListArticulo()){\n if(listaJuegos.getOferta().contains(\"S\")){\n listaJuegos.setValorDescuento(String.valueOf(listaJuegos.getPrecioArticulo()-(listaJuegos.getPrecioArticulo()*listaJuegos.getPorcentajeDescuento()/100)));\n ListaOfertas.add(listaJuegos);\n }\n\n }\n }", "private void limpiarDatos() {\n\t\t\n\t}", "private void remplirMaterielData() {\n\t}", "private void recogerDatos() {\n\t\ttry {\n\t\t\tusuSelecc.setId(etId.getText().toString());\n\t\t\tusuSelecc.setName(etNombre.getText().toString());\n\t\t\tusuSelecc.setFirstName(etPApellido.getText().toString());\n\t\t\tusuSelecc.setLastName(etSApellido.getText().toString());\n\t\t\tusuSelecc.setEmail(etCorreo.getText().toString());\n\t\t\tusuSelecc.setCustomFields(etAuth.getText().toString());\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n\t\t\tmostrarException(e.getMessage());\n\t\t}\n\t}", "private void remplirPrestaraireData() {\n\t}", "private void fillData() {\n table.setRowList(data);\n }", "public void resetAppData() {\n this.materials = new ArrayList<String>();\n this.shoplistGroc = new ArrayList<String>();\n this.shopListMat = new ArrayList<String>();\n this.pantry = new ArrayList<String>();\n this.unassignedChores = new ArrayList<Chore>();\n this.finishedChores = new ArrayList<Chore>();\n this.regUsers= new ArrayList<User>();\n this.adminUsers= new ArrayList<AdminUser>();\n this.currentUserId = 0;\n this.serialNumber = 1;\n }", "private void clearData() {}", "private void remplirUtiliseData() {\n\t}", "private void fillData()\n {\n\n }", "private void limpiarCampos() {\n datoCriterio1.setText(\"\");\n ((DefaultTableModel)this.jTable1.getModel()).setRowCount(0);\n jBConcretarAccion.setEnabled(false);\n jBCancelar.setEnabled(false);\n jLObjetoSeleccionado.setText(\"\");\n this.unObjetoSeleccionado = null;\n }", "private void clearData() throws SQLException {\n//Lay chi so dong cuoi cung\n int n = tableModel.getRowCount() - 1;\n for (int i = n; i >= 0; i--) {\n tableModel.removeRow(i);//Remove tung dong\n }\n }", "private void loadData(){\n\t\t \n\t\t model.getDataVector().clear();\n\t\t ArrayList<Person> personList = DataBase.getInstance().getPersonList();\n\t\t for(Person person : personList){\n\t\t\t addRow(person.toBasicInfoStringArray());\n\t\t }\n\t\t \n\t }", "public void tukarData() {\n this.temp = this.data1;\n this.data1 = this.data2;\n this.data2 = this.temp;\n }", "void populateData();", "public void clearFields() {\n dataSearch = new Date();\n tbcliente = null;\n tbfuncionario = null;\n listTbagendamentos = agendamentoLogic.findAllTbagendamentoFromCurrentDay();\n }", "private void importarDatos() {\r\n // Cabecera\r\n System.out.println(\"Importación de Datos\");\r\n System.out.println(\"====================\");\r\n\r\n // Acceso al Fichero\r\n try (\r\n FileReader fr = new FileReader(DEF_NOMBRE_FICHERO);\r\n BufferedReader br = new BufferedReader(fr)) {\r\n // Colección Auxiliar\r\n final List<Item> AUX = new ArrayList<>();\r\n\r\n // Bucle de Lectura\r\n boolean lecturaOK = true;\r\n do {\r\n // Lectura Linea Actual\r\n String linea = br.readLine();\r\n\r\n // Procesar Lectura\r\n if (linea != null) {\r\n // String > Array\r\n String[] items = linea.split(REG_CSV_LECT);\r\n\r\n // Campo 0 - id ( int )\r\n int id = Integer.parseInt(items[DEF_INDICE_ID]);\r\n\r\n // Campo 1 - nombre ( String )\r\n String nombre = items[DEF_INDICE_NOMBRE].trim();\r\n\r\n // Campo 2 - precio ( double )\r\n double precio = Double.parseDouble(items[DEF_INDICE_PRECIO].trim());\r\n\r\n // Campo 3 - color ( Color )\r\n Color color = UtilesGraficos.generarColor(items[DEF_INDICE_COLOR].trim());\r\n\r\n // Generar Nuevo Item\r\n Item item = new Item(id, nombre, precio, color);\r\n\r\n // Item > Carrito\r\n AUX.add(item);\r\n// System.out.println(\"Importado: \" + item);\r\n } else {\r\n lecturaOK = false;\r\n }\r\n } while (lecturaOK);\r\n\r\n // Vaciar Carrito\r\n CARRITO.clear();\r\n\r\n // AUX > CARRITO\r\n CARRITO.addAll(AUX);\r\n\r\n // Mensaje Informativo\r\n UtilesEntrada.hacerPausa(\"Datos importados correctamente\");\r\n } catch (NumberFormatException | NullPointerException e) {\r\n // Mensaje Informativo\r\n UtilesEntrada.hacerPausa(\"ERROR: Formato de datos incorrecto\");\r\n\r\n // Vaciado Carrito\r\n CARRITO.clear();\r\n } catch (IOException e) {\r\n // Mensaje Informativo\r\n UtilesEntrada.hacerPausa(\"ERROR: Acceso al fichero\");\r\n }\r\n }", "public void limpiarDatos() {\r\n FormularioUtil.limpiarComponentes(groupboxEditar, idsExcluyentes);\r\n tbxNro_identificacion.setValue(\"\");\r\n tbxNro_identificacion.setDisabled(false);\r\n deshabilitarCampos(true);\r\n\r\n }", "public void imprimir_etiquetas() {\n\n\t\tLinkedList l = new LinkedList();\n\t\tString q=\"select id,isnull(idarticulo,''),isnull(descripcion,''),isnull(cantidad,0),isnull(especial,0),isnull(especial_width,0),isnull(especial_height,0),isnull(quitarprefijo,0) from b_etiquetas where isnull(impresa,0)=0 order by id \";\n\t\tList<String> ids=new ArrayList<String>();\t\n\t\tObject[][] results=data.getResults(q);\n\t\tif (results!=null){\n\t\t\tif (results.length>0){\n\t\t\t\tif (_debug>0) System.out.println(\"Etiquetas para imprimir=\"+results.length);\n\t\t\t\tfor (int i = 0; i < results.length; i++) {\n\t\t\t\t\tString idarticulo = \"\";\n\t\t\t\t\tString id = \"\";\n\t\t\t\t\tString descripcion = \"\";\n\t\t\t\t\tString cant = \"\";\n\t\t\t\t\tString width = \"\";\n\t\t\t\t\tString height = \"\";\n\t\t\t\t\tString prefijo = \"\";\n\t\t\t\t\tint _width=40;\n\t\t\t\t\tint _height=40;\n\t\t\t\t\tdouble _cant = 0.0;\n\t\t\t\t\tboolean especial=false;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tid = (String) results[i][0];\n\t\t\t\t\t\tidarticulo = (String) results[i][1];\n\t\t\t\t\t\tdescripcion = (String) results[i][2];\n\t\t\t\t\t\tcant = (String) results[i][3];\n\t\t\t\t\t\tespecial = ((String) results[i][4]).compareTo(\"1\")==0;\n\t\t\t\t\t\twidth = (String) results[i][5];\n\t\t\t\t\t\theight = (String) results[i][6];\n\t\t\t\t\t\tprefijo = (String) results[i][7];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t_width=new Integer(width);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t_height=new Integer(height);\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_cant = new Double(cant);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tids.add(id);\n\t\t\t\t\tif (_cant >= 1) {\n\t\t\t\t\t\tif (idarticulo.compareTo(\"\")!=0){\n\t\t\t\t\t\t\tif (descripcion.compareTo(\"\")!=0){\n\t\t\t\t\t\t\t\tdescripcion.replaceAll(\"'\", \"\");\n\t\t\t\t\t\t\t\tStrEtiqueta str_etiqueta = new StrEtiqueta();\n\t\t\t\t\t\t\t\tstr_etiqueta.setCodigo(idarticulo);\n\t\t\t\t\t\t\t\tstr_etiqueta.setDescripcion(descripcion);\n\t\t\t\t\t\t\t\tstr_etiqueta.setCantidad(new Double(_cant).intValue());\n\t\t\t\t\t\t\t\tstr_etiqueta.setEspecial(especial);\n\t\t\t\t\t\t\t\tstr_etiqueta.setWidth(_width);\n\t\t\t\t\t\t\t\tstr_etiqueta.setHeight(_height);\n\t\t\t\t\t\t\t\tstr_etiqueta.setQuitar_prefijo(prefijo.compareTo(\"1\")==0);\n\t\t\t\t\t\t\t\tl.add(str_etiqueta);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (l.size() > 0) {\n\n\t\t\t\t\t// ImpresionCodigoDeBarras PI=new ImpresionCodigoDeBarras();\n\n\t\t\t\t\t\tprinting pi = this.getPrintingInterface();\n\t\t\t\t\t\tpi.setPrintList(l);\n\t\t\t\t\t\tpi.setDebug(false);\n\t\t\t\t\t\tboolean ok = pi.print_job();\n\t\t\t\t\t\tif (ok){\n\t\t\t\t\t\t\tif (_printer_error>0){\n\t\t\t\t\t\t\t\tSystem.out.println(\"Se Enviaron las Etiquetas Pendientes a la Impresora\");\n\t\t\t\t\t\t\t\tthis.trayIcon.displayMessage(\"Beta Servidor de Impresion\", \"Se Enviaron las Etiquetas Pendientes a la Impresora\", TrayIcon.MessageType.INFO);\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tthis.trayIcon.displayMessage(\"Beta Servidor de Impresion\", \"Se Enviaron las Etiquetas a la Impresora\", TrayIcon.MessageType.INFO);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_printer_error=0;\n\t\t\t\t\t\t\tdata.beginTransaction();\n\t\t\t\t\t\t\tdata.clearBatch();\n\t\t\t\t\t\t\t\tfor (int i=0;i<ids.size();i++){\n\t\t\t\t\t\t\t\t\tq=\"update b_etiquetas set impresa=1 where id like '\"+ids.get(i)+\"'\";\n\t\t\t\t\t\t\t\t\tdata.addBatch(q);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdata.executeBatch();\n\t\t\t\t\t\t\t\tdata.commitTransaction();\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tif (_printer_error<=0){\n\t\t\t\t\t\t\t\tthis._clock_printer_error=this._clock_printer_error_reset;\n\t\t\t\t\t\t\t\tSystem.out.println(\"primer error\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_printer_error=1;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t// PI.armar_secuencia();\n\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "private void reset() {\n\t\tdata.clear();\n\t}", "public void preencherTabela(){\n imagemEnunciado.setImage(imageDefault);\n pergunta.setImagemEnunciado(caminho);\n imagemResposta.setImage(imageDefault);\n pergunta.setImagemResposta(caminho);\n ///////////////////////////////\n perguntas = dao.read();\n if(perguntas != null){\n perguntasFormatadas = FXCollections.observableList(perguntas);\n\n tablePerguntas.setItems(perguntasFormatadas);\n }\n \n }", "private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }", "public void resetData() {\r\n this.setName(\"\");\r\n this.setType(\"\");\r\n this.setContact(\"\");\r\n this.setAffiliatedResearchers(\"\");\r\n this.setCountry(\"\");\r\n this.setResearchKeywords(\"\");\r\n this.setResearchDescription(\"\");\r\n this.setHomePage(\"\");\r\n }", "public void LimpiarJTablaPorFecha()\n {\n for(int i=modeloPorFecha.getRowCount()-1;i>=0;i--)\n {\n modeloPorFecha.removeRow(i); \n }\n }", "private void procurarData() {\n if (jDateIni.getDate() != null && jDateFim.getDate() != null) {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n String data = sdf.format(jDateIni.getDate());\n String data2 = sdf.format(jDateFim.getDate());\n carregaTable(id, data, data2);\n JBreg.setEnabled(false);\n }\n }", "public void clearData()\r\n {\r\n \r\n }", "public datosTaller() {\n this.cedulaCliente = new int[100]; //Atributo de la clase\n this.nombreCliente = new String[100]; //Atributo de la clase\n this.compraRealizada = new String[100]; //Atributo de la clase\n this.valorCompra = new float[100]; //Atributo de la clase\n this.posicionActual = 0; //Inicializacion de la posicion en la que se almacenan datos\n }", "private void cargarDatosDefault() {\n\t\tPersonasJSON personas = new PersonasJSON();\n\t\tpersonas = personas.leerJSON(\"src/datosJSON/Personas.JSON\");\n\t\t\n\t\tfor(int i=0 ; i<personas.getCantidadPersonas(); i++) {\n\t\t\t\n\t\t\tString nombre = personas.getPersona(i).getNombre();\n\t\t\tint deporte = personas.getPersona(i).getDeporte();\n\t\t\tint musica = personas.getPersona(i).getMusica();\n\t\t\tint espectaculo = personas.getPersona(i).getEspectaculo();\n\t\t\tint ciencia = personas.getPersona(i).getCiencia();\n\t\t\t\n\t\t\tmodel.addRow(new String[]{ nombre, String.valueOf(deporte), String.valueOf(musica),\n\t\t\t\t\tString.valueOf(espectaculo), String.valueOf(ciencia) });\n\t\t}\n\t\t\n\t\tdatos.addAll(personas.getTodasLasPersonas());\n\t\t\n\t}", "private void clearData() {\n em.createQuery(\"delete from ViajeroEntity\").executeUpdate();\n }", "public void resetData() {\n user = new User();\n saveData();\n }", "public void reiniciarEstadoSalud(){\n EmpleadosPrioridadAlta.clear();\n EmpleadosPrioridadMediaAlta.clear();\n EmpleadosPrioridadMedia.clear();\n EmpleadosPrioridadBaja.clear();\n }", "private void inicializarTablero() {\r\n\t\t\r\n\t\tfor(int i = 0; i < filas; i++) {\r\n\t\t\tfor(int j = 0; j < columnas; j++) {\r\n\t\t\t\tsuperficie[i][j] = null;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void limpiarValores(){\n\t\tpcodcia = \"\";\n\t\tcedula = \"\";\n\t\tcoduser = \"\";\n\t\tcluser = \"\";\n\t\tmail = \"\";\n\t\taudit = \"\";\n\t\tnbr = \"\";\n\t\trol = \"\";\n\t}", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "private void remplirFabricantData() {\n\t}", "private void Limpiar() {\n txtEnunciado.setText(\"\");\n txtOpcionNumerica.setText(\"\");\n txtOpcionNominal.setText(\"\");\n controladorAgrePreguntas.limpiarArray();\n x = 0;\n }", "@Override\n public void clearData() {\n }", "private void reinitRowValues() {\n for (int i=0; i<rowValues.length; i++) {\n rowValues[i] = null;\n }\n }", "public void eraseData() {\n\t\tname = \"\";\n\t\tprice = 0.0;\n\t\tquantity = 0;\n\t}", "public void limparFiltroOfertas() {\n dataModel = null;\n }", "private void fillData() {\n jTextField1.setEnabled(false);\n jTextField11.setEnabled(false);\n\n if (owners != null && owners.get(\"editedOwner\") != null) {\n this.jTextField1.setText(owners.get(\"editedOwner\").getAsJsonObject().get(\"rc\").getAsString());\n this.jTextField11.setText(owners.get(\"editedOwner\").getAsJsonObject().get(\"share\").getAsString());\n }\n String[] header = new String[]{\"Rodné čislo\", \"Podiel v %\"};\n dtm.setColumnIdentifiers(header);\n jTableOwnerships.setModel(dtm);\n if (owners != null && owners.get(\"ownerships\") != null) {\n for (JsonElement jsonElement : owners.get(\"ownerships\").getAsJsonArray()) {\n JsonObject owner = (JsonObject) jsonElement;\n dtm.addRow(new Object[]{owner.get(\"rc\").getAsString(), owner.get(\"share\").getAsString()});\n }\n }\n }", "private void populateData() {\n\t\tList<TrafficRecord> l = TestHelper.getSampleData();\r\n\t\tfor(TrafficRecord tr: l){\r\n\t\t\tput(tr);\r\n\t\t}\r\n\t\t \r\n\t}", "void clearData();", "private void populateFields() {\n pedidos = pdao.listaTodos();\n cCliente = new HashSet();\n cEstado = new HashSet();\n cCidade = new HashSet();\n cFornecedor = new HashSet();\n\n for (int i = 0; i < pedidos.size(); i++) {\n cCliente.add(pedidos.get(i).getCliente().getNome());\n cEstado.add(pedidos.get(i).getCliente().getEstado());\n cCidade.add(pedidos.get(i).getCliente().getCidade());\n for (int j = 0; j < pedidos.get(i).getItens().size(); j++) {\n cFornecedor.add(pedidos.get(i).getItens().get(j).getProduto().getFornecedor().getNome());\n }\n }\n\n clientes = new ArrayList<>(cCliente);\n fornecedores = new ArrayList<>(cFornecedor);\n\n Iterator i = cCliente.iterator();\n while (i.hasNext()) {\n jCBCliente.addItem(i.next());\n }\n\n i = null;\n i = cEstado.iterator();\n while (i.hasNext()) {\n jCBEstado.addItem(i.next());\n }\n\n i = null;\n i = cCidade.iterator();\n while (i.hasNext()) {\n jCBCidade.addItem(i.next());\n }\n i = null;\n i = cFornecedor.iterator();\n while (i.hasNext()) {\n jCBFornecedor.addItem(i.next());\n }\n\n }", "private void clearInsertingValues() {\n mapFieldsIntegers.clear();\n mapFieldsStrings.clear();\n }", "void resetComponents() {\n Utilitarios.fechaActual(jdcFechaInicio);\n Utilitarios.fechaActual(jdcFechaFin);\n if (oMedicoAtiendeReal != null) {\n oMedicoAtiendeReal = null;\n }\n if (oComprobanteDetalle != null) {\n oComprobanteDetalle = null;\n }\n oModeloRegistrarPagoMedicos.clear();\n personalizaVistaTabla();\n txfMedicoDeriva.setText(\"\");\n txfMedicoAtiende.setText(\"\");\n if(oMedico != null){\n oMedico = null;\n }\n txfMedico.setText(\"\");\n }", "private void importData() {\n // if alarmAdapter null it's means data have not imported, yet or database is empty\n if (alarmAdapter == null) {\n // initialize database manager\n dataBaseManager = new DataBaseManager(this);\n // get Alarm ArrayList from database\n ArrayList<Alarm> arrayList = dataBaseManager.getAlarmList();\n // create Alarm adapter to display detail through RecyclerView\n alarmAdapter = new AlarmAdapter(arrayList, this);\n\n }\n }", "public void reloadTable() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (list.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Balanza object = list.get(i);\n this.AddtoTable(object);\n }\n\n }", "private void prepareData() throws InputException {\n String dia_db = getDate(dia.getValue());\n int semana_db = getWeek(dia_db);\n hrs = horas.getText();\n\n if (hrs.length() > 0) {\n horasDB = Integer.parseInt(String.valueOf(horas.getText()));\n } else {\n throw new InputException(\"Hora deve ser um valor entre 0 e 24\");\n }\n\n if( horasDB <= 0 || horasDB > 24 || hrs == null){\n throw new InputException(\"Hora deve ser um valor entre 0 e 24\");\n }\n\n TI ti_db = new TI(dia_db, semana_db, horasDB);\n Atividade atividade_db = null;\n int operation = INVALIDO;\n\n atividadeEscolhida = atividade.getSelectedItem().toString();\n if (atividadeEscolhida.equals(getString(R.string.nova_atividade))) {\n nomeAtividadeDB = nomeAtividade.getText().toString();\n if(nomeAtividadeDB.trim().equals(\"\")){\n throw new InputException(\"Nome da Atividade Inválido!\");\n }\n Categoria categoria_db = null;\n if(categoria.getValue() == TRABALHO) {\n categoria_db = Categoria.TRABALHO;\n } else if (categoria.getValue() == LAZER) {\n categoria_db = Categoria.LAZER;\n }\n\n Prioridade prioridade_db = null;\n int item_prioridade = prioridade.getSelectedItemPosition();\n if(item_prioridade == BAIXA) {\n prioridade_db = Prioridade.BAIXA;\n } else if (item_prioridade == MEDIA) {\n prioridade_db = Prioridade.MEDIA;\n } else if (item_prioridade == ALTA) {\n prioridade_db = Prioridade.ALTA;\n }\n\n operation = INSERIR;\n atividade_db = new Atividade(nomeAtividadeDB, categoria_db, prioridade_db, null);\n } else {\n operation = ATUALIZAR;\n atividade_db = mAtividade;\n }\n\n saveData(operation, atividade_db, ti_db);\n }", "public void datosIniciales() {\n try {\n nombre.setCellValueFactory(new PropertyValueFactory<>(\"nombre\"));\n subTipo.setCellValueFactory(new PropertyValueFactory<>(\"subTipo\"));\n tipo.setCellValueFactory(new PropertyValueFactory<>(\"tipo\"));\n editar.setCellValueFactory(new PropertyValueFactory<>(\"imagenEditar\"));\n listaSubTipoDAO = subTipoDAO.hacerConsulta();\n listaSubTipo = FXCollections.observableArrayList(listaSubTipoDAO);\n valoresSubtipo = new ListSpinnerValueFactory(listaSubTipo);\n spinnerSubtipo.setValueFactory(valoresSubtipo);\n\n puntuacion = new SpinnerValueFactory.IntegerSpinnerValueFactory(1, 5, 1, 1);\n\n editar.getStyleClass().add(\"cursorMano\");\n refrescarDatos();\n\n } catch (SQLException ex) {\n alarmaFalloSQL();\n }\n }", "public void clearData(){\n\r\n\t}", "public void imprimir() {\r\n NodoPila reco=raiz;\r\n System.out.println(\"Listado de todos los elementos de la pila:\");\r\n while (reco!=null) {\r\n System.out.print(reco.dato+\" \");\r\n reco=reco.sig;\r\n System.out.println();\r\n }\r\n System.out.println();\r\n }", "public void initializeData() {\n _currentDataAll = _purityReportData.getAll();\n }", "private void initDatas(){\r\n \t\r\n \tjTable1.setModel(ViewUtil.transferBeanList2DefaultTableModel(discountService.getAllDiscountInfo(),\"Discount\"));\r\n }", "public void LimpiarCampos() {\n\n txtIdAsignarPer.setText(\"\");\n txtNombreusu.setText(\"\");\n pswConfCont.setText(\"\");\n combPerf.setSelectedItem(\"\");\n pswContra.setText(\"\");\n txtDocumento.setText(\"\");\n }", "private void clearData() {\r\n em.createQuery(\"delete from MonitoriaEntity\").executeUpdate();\r\n }", "public void excluirDados() {\n\n int linha;\n\n if (verificarAbaAtiva() == 0) {\n linha = HorarioDeTrabalho.getSelectedRow();\n modHT = (DefaultTableModel) HorarioDeTrabalho.getModel();\n tratDados.excluirDadosTabela(modHT, linha);\n txtEntrada_Horario.requestFocus();\n } else {\n linha = MarcacoesFeitas.getSelectedRow();\n modMF = (DefaultTableModel) MarcacoesFeitas.getModel();\n tratDados.excluirDadosTabela(modMF, linha);\n txtEntrada_Marcacoes.requestFocus();\n }\n \n //Limpa as tabelas de Atraso e Extras\n modAt.setRowCount(0);\n modEx.setRowCount(0);\n }", "private void insertData() \n {\n for(int i = 0; i < 2; i++){\n RazaEntity razaEntity = factory.manufacturePojo(RazaEntity.class);\n em.persist(razaEntity);\n razaData.add(razaEntity);\n }\n for (int i = 0; i < 3; i++) {\n EspecieEntity especieEntity = factory.manufacturePojo(EspecieEntity.class);\n if(i == 0)\n {\n especieEntity.setRazas(razaData);\n }\n em.persist(especieEntity);\n especieData.add(especieEntity);\n }\n }", "private void fillData() {\n String[] from = new String[] {\n NOMBRE_OBJETO,\n DESCRIPCION,\n TEXTURA\n };\n // Campos de la interfaz a los que mapeamos\n int[] to = new int[] {\n R.id.txtNombreObjeto,\n R.id.txtDescripcion,\n R.id.imgIconoObjeto\n };\n getLoaderManager().initLoader(OBJETOS_LOADER, null, this);\n ListView lvObjetos = (ListView) findViewById(R.id.listaObjetos);\n adapter = new SimpleCursorAdapter(this, R.layout.activity_tiendaobjetos_filaobjeto, null, from, to, 0);\n lvObjetos.setAdapter(adapter);\n }", "public void inicializaEntradas(){\n\t\tentrada = TipoMotivoEntradaEnum.getList();\n\t\tentrada.remove(0);\n\t}", "private void populaUnidade()\n {\n Unidade unidade = new Unidade(\"Unidade Santo Amaro\", \"Horario de funcionamento: 6:00 as 23:00\");\n unidadeDAO.insert(unidade);\n unidade = new Unidade(\"Unidade Aclimação\", \"Horario de funcionamento: 7:00 as 22:00\");\n unidadeDAO.insert(unidade);\n unidade = new Unidade(\"Unidade Vinhedo\", \"Horario de funcionamento: 6:00 as 22:00\");\n unidadeDAO.insert(unidade);\n }", "@Override\n public void resetAllValues() {\n }", "public static void populateData() {\n\n }", "private void limpiarCampos() {\n\t\tthis.campoClave.setText(\"\");\n\t\tthis.campoClaveNueva.setText(\"\");\n\t\tthis.campoClaveRepita.setText(\"\");\n\t}", "public void editarData(){\n\t\talunoTurmaService.inserirAlterar(alunoTurmaAltera);\n\t\t\n\t\t\n\t\tmovimentacao.setDataMovimentacao(alunoTurmaAltera.getDataMudanca());\n\t\tmovimentacaoService.inserirAlterar(movimentacao);\n\t\t\n\t\tFecharDialog.fecharDialogDATAAluno();\n\t\tExibirMensagem.exibirMensagem(Mensagem.SUCESSO);\n\t\talunoTurmaAltera = new AlunoTurma();\n\t\tmovimentacao = new Movimentacao();\n\t\t\n\t\tatualizarListas();\n\t}", "protected void clearData() {\n any.type(any.type());\n }", "public void preencherDisponibilidadesOferta() {\n\n //List<Disponibilidade> disponibilidades;\n List<Disp> disponibilidades;\n \n if (oferta != null) {\n //disponibilidades = new ArrayList<>(oferta.getDisponibilidades());\n disponibilidades = new ArrayList<>(oferta.getDispo());\n } else {\n disponibilidades = new ArrayList<>();\n }\n //dispDataModel = new DisponibilidadeDataModel(disponibilidades);\n dispDataModel = new DispDataModel(disponibilidades);\n }", "private void fillObservationsData() {\n\n // retrieve all oindex records\n// List<Oindex> oindexList = this.servicioApp.getMeasurementOindexListByStudy(workbookStudy.getStudy().getStudyid(), effectid);\n\n Integer studyId = this.workbookStudy.getStudy().getStudyid();\n\n int variateCount = this.workbookStudy.getVariates().size();\n\n List<Measurement> measurementList = new ArrayList<Measurement>();\n //todo quitar no se usa\n// int observationsCount = this.servicioApp.getObservationsCount(studyId);\n log.info(\"Getting Data Trial ...\");\n List<Object> dataList = this.servicioApp.getObservationsDataMeasurementEffect(studyId, effectid);\n log.info(\"Getting Data Trial Done...\");\n \n log.info(\"Getting List of Obsunit ...\");\n List<Obsunit> obsunits = this.servicioApp.getObsunitListByEffectid(studyId, effectid);\n log.info(\"Getting List of Obsunit...\");\n for (Obsunit obsUnit : obsunits){\n Measurement measurement = new Measurement();\n\n measurement.initMeasurementData(variateCount);\n\n assignMeasurementData(measurement, obsUnit, dataList);\n\n measurementList.add(measurement);\n }\n\n\n workbookStudy.setMeasurements(measurementList);\n\n List<String> factorsReturn = getFactoresReturnList();\n log.info(\"Getting Trial Randomization ...\");\n ResultSet rst = servicioApp.getTrialRandomization(studyId, 0, getFactoresKeyList(), factorsReturn, factorTrial.getFname());\n log.info(\"Getting Trial Randomization done\");\n fillFactorLabelData(rst, factorsReturn);\n }", "public void postOpenInit() {\n logger = Logger.getLogger(Dataset.class);\n clear();\n for (DataPoint point : persistentData) {\n addPoint(point);\n }\n }", "private void esvaziaMensageiro() {\n\t\tMensageiro.arquivo=null;\n\t\tMensageiro.lingua = linguas.indexOf(lingua);\n\t\tMensageiro.linguas=linguas;\n\t\tMensageiro.nomeArquivo=null;\n\t}", "@Override\n\tpublic void fillData() {\n\t}", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }", "public void readdata(ArrayList<AddData> daftar){\n Cursor crsr = this.getReadableDatabase().rawQuery(\"select todo, description, priority from \"+nama_tabel, null);\n while (crsr.moveToNext()){\n daftar.add(new AddData(crsr.getString(0), crsr.getString(1), crsr.getString(2)));\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ServicioEntity entity = factory.manufacturePojo(ServicioEntity.class);\n em.persist(entity);\n dataServicio.add(entity);\n }\n for (int i = 0; i < 3; i++) {\n QuejaEntity entity = factory.manufacturePojo(QuejaEntity.class);\n if (i == 0) {\n entity.setServicio(dataServicio.get(0));\n }\n em.persist(entity);\n data.add(entity);\n }\n }", "protected void clearData() {\n getValues().clear();\n getChildIds().clear();\n getBTreeMetaData().setDirty(this);\n }", "public void removeAllData() {\n dbHelper.removeAllData(db);\n }", "private void clearTemporaryData() {\n\n numbers.stream().forEach(n -> {\n n.setPossibleValues(null);\n n.setUsedValues(null);\n });\n }", "public void inicializar() {\n\t\t// TODO Auto-generated method stub\n\t\tIDISFICHA=\"\";\n\t\tNOTAS=\"\";\n\t\tANOTACIONES=\"\";\n\t\tNOTAS_EJERCICIOS=\"\";\n\t}", "private RowData() {\n initFields();\n }", "private void loadData() {\n this.financeDataList = new ArrayList<>();\n }", "public void limpiarMesa() {\n for (int i = 0; i < mesa.length; i++) {\n mesa[i][1] = 0;\n }\n }", "public void reloadTableEmpleado() {\n\n this.removeAllData();// borramos toda la data \n for (int i = 0; i < (listae.size()); i++) { // este for va de la primera casilla hast ael largo del arreglo \n Empleado object = listae.get(i);\n this.AddtoTableEmpleado(object);\n }\n\n }", "public listaAlumnos()\r\n\t{\r\n\t\tinicio = fin = null; \r\n\t}", "public void inicializar() {\n\t\t// TODO Auto-generated method stub\n\t\tISHORARIO_IDISHORARIO=\"\";\n\t\tISAULA_IDISAULA=\"\";\n\t\tISCURSO_IDISCURSO=\"\";\n\t\t\n\t}", "private void insertData() {\n \n for (int i = 0; i < 3; i++) {\n ClienteEntity editorial = factory.manufacturePojo(ClienteEntity.class);\n em.persist(editorial);\n ClienteData.add(editorial);\n }\n \n for (int i = 0; i < 3; i++) {\n ContratoPaseoEntity paseo = factory.manufacturePojo(ContratoPaseoEntity.class);\n em.persist(paseo);\n contratoPaseoData.add(paseo);\n }\n \n for (int i = 0; i < 3; i++) {\n ContratoHotelEntity editorial = factory.manufacturePojo(ContratoHotelEntity.class);\n em.persist(editorial);\n contratoHotelData.add(editorial);\n }\n \n for (int i = 0; i < 3; i++) {\n PerroEntity perro = factory.manufacturePojo(PerroEntity.class);\n //perro.setCliente(ClienteData.get(0));\n //perro.setEstadias((List<ContratoHotelEntity>) contratoHotelData.get(0));\n //perro.setPaseos((List<ContratoPaseoEntity>) contratoPaseoData.get(0));\n em.persist(perro);\n Perrodata.add(perro);\n }\n\n }", "public void clearData(){\n\t\t\n\t\tclearTable(conditionTableModel);\n\t\tclearTable(faultTableModel);\n\t}", "private void limparCampos() {\n\t\ttxtCidade.setText(\"\");\n\t\tlblId.setText(\"0\");\n\t\tcboEstado.getSelectionModel().select(0);\n\t}", "void resetData(ReadOnlyEntryBook newData);", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }", "public void generTirarDados() {\n\r\n\t}", "@Override\n\tpublic void imprimirBancoDados() {\n\t\tSystem.out.println(\"Nome do Banco: \"+nomeBanco);\n\t\tSystem.out.println(\"Tipo do Banco: \"+tipoBanco);\n\t\tSystem.out.println(\"Lista de Metodos: \"+listaMetodos);\n\t}", "private void insertData() {\n \n for (int i = 0; i < 4; i++) {\n EmpleadoEntity entity = factory.manufacturePojo(EmpleadoEntity.class);\n entity.setSolicitudes(new ArrayList<>());\n entity.setPropuestas(new ArrayList<>());\n entity.setInvitaciones(new ArrayList<>());\n entity.setTipoEmpleado(TipoEmpleado.TRADUCTOR);\n if(i == 0)\n {\n SolicitudEntity solicitud = factory.manufacturePojo(SolicitudEntity.class);\n em.persist(solicitud);\n entity.getSolicitudes().add(solicitud);\n solicitud.setEmpleado(entity);\n solicitudesData.add(solicitud);\n }\n else if (i == 1)\n {\n InvitacionEntity invitacion = factory.manufacturePojo(InvitacionEntity.class);\n em.persist(invitacion);\n entity.getInvitaciones().add(invitacion); \n invitacion.setEmpleado(entity);\n invitacionesData.add(invitacion);\n }\n else if (i == 2){\n PropuestaEntity propuesta = factory.manufacturePojo(PropuestaEntity.class);\n em.persist(propuesta);\n entity.getPropuestas().add(propuesta);\n propuesta.setEmpleado(entity);\n propuestasData.add(propuesta);\n }\n em.persist(entity);\n data.add(entity);\n }\n }", "private void prepareData() {\n devices.clear();\n\n Set<String> s = Blue.getInstance().devices.keySet();\n Iterator<String> it = s.iterator();\n String address;\n while (it.hasNext()) {\n address = it.next();\n devices.add(new Device(address, Blue.getInstance().devices.get(address)));\n }\n }", "private void LimpiarCampos(){\n \n txtClave.setText(null);\n txtNombre.setText(null);\n txtPaterno.setText(null);\n txtMaterno.setText(null);\n txtTelefono.setText(null);\n txtCorreo.setText(null);\n cbxGenero.setSelectedIndex(0);\n cbxRol.setSelectedIndex(0);\n }", "public void limpiar(){\n\t\tfCargaI=new Date();\n\t\tfCargaF=new Date();\n\t\tlistaMarcacion=null;\n\t\tlistaMarcacionPDF=null;\n\t}", "public void imprimirBilletes()\n {\n maquina1.insertarDinero(800);\n maquina2.insertarDinero(800);\n maquina1.imprimirTicket();\n maquina2.imprimirTicket();\n }", "private void insertData() {\n for (int i = 0; i < 3; i++) {\n PodamFactory factory = new PodamFactoryImpl();\n VisitaEntity entity = factory.manufacturePojo(VisitaEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }", "private void resetAll() // resetAll method start\n\t{\n\t\theader.reset();\n\t\tdebit.reset();\n\t\tcredit.reset();\n\t}", "private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }" ]
[ "0.6959229", "0.6716509", "0.664467", "0.6545379", "0.65071607", "0.64739746", "0.63939476", "0.6375178", "0.63679713", "0.63565844", "0.63229966", "0.63045937", "0.6289924", "0.6286406", "0.62854856", "0.62402016", "0.6225299", "0.62045556", "0.61716866", "0.6155231", "0.6151309", "0.6126867", "0.61259544", "0.6097289", "0.60931396", "0.606816", "0.6065021", "0.6064364", "0.6047262", "0.60452527", "0.6041917", "0.6041102", "0.6022011", "0.6018977", "0.59851146", "0.5970628", "0.5965557", "0.5963113", "0.59520346", "0.5951484", "0.59513223", "0.5947568", "0.59456784", "0.5935552", "0.59266126", "0.5923547", "0.59207743", "0.5911182", "0.59061974", "0.5901414", "0.58904314", "0.5885336", "0.58843875", "0.5878695", "0.5876786", "0.5873599", "0.58730733", "0.58692914", "0.58660454", "0.5858752", "0.58479947", "0.5846398", "0.5844458", "0.5833154", "0.5830871", "0.5830493", "0.58299154", "0.58288133", "0.5828717", "0.58220816", "0.5815217", "0.5814778", "0.580569", "0.58031493", "0.58011687", "0.5798531", "0.57984316", "0.5782721", "0.5779356", "0.57785296", "0.5777565", "0.5776562", "0.57753116", "0.5763708", "0.5759724", "0.5754582", "0.57409096", "0.573947", "0.57308203", "0.57245946", "0.57229805", "0.5720517", "0.57188797", "0.57169807", "0.5715629", "0.5709454", "0.57047313", "0.57042915", "0.5704028", "0.5696203" ]
0.64846295
5
metodo set para insertar datos enteros en la variable NoElises
public void SetNoElises(int noelises) { this.NoElises=noelises; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }", "public void inserisciValore()throws Exception {\r\n\r\n\t\t\r\n\t\t\tif (!valore.getInserito()) {\r\n\t\t\t\tboolean inserimento = InputOutput.richiestaInserimento(nome);\r\n\t\t\t\tif (inserimento) {\r\n\t\t\t\t\tvalore.inserisciValore(nome);\r\n\t\t\t\t\tvalore.setInserito(true);\t\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}", "private void limpiarValores(){\n\t\tpcodcia = \"\";\n\t\tcedula = \"\";\n\t\tcoduser = \"\";\n\t\tcluser = \"\";\n\t\tmail = \"\";\n\t\taudit = \"\";\n\t\tnbr = \"\";\n\t\trol = \"\";\n\t}", "public void setar_campos()\n {\n int setar = tblCliNome.getSelectedRow();\n txtCliId.setText(tblCliNome.getModel().getValueAt(setar, 0).toString());\n txtCliNome.setText(tblCliNome.getModel().getValueAt(setar, 1).toString());\n txtCliRua.setText(tblCliNome.getModel().getValueAt(setar, 2).toString());\n txtCliNumero.setText(tblCliNome.getModel().getValueAt(setar, 3).toString());\n txtCliComplemento.setText(tblCliNome.getModel().getValueAt(setar, 4).toString());\n txtCliBairro.setText(tblCliNome.getModel().getValueAt(setar, 5).toString());\n txtCliCidade.setText(tblCliNome.getModel().getValueAt(setar, 6).toString());\n txtCliUf.setText(tblCliNome.getModel().getValueAt(setar, 7).toString());\n txtCliFixo.setText(tblCliNome.getModel().getValueAt(setar, 8).toString());\n txtCliCel.setText(tblCliNome.getModel().getValueAt(setar, 9).toString());\n txtCliMail.setText(tblCliNome.getModel().getValueAt(setar, 10).toString());\n txtCliCep.setText(tblCliNome.getModel().getValueAt(setar, 11).toString());\n \n // A LINHA ABAIXO DESABILITA O BOTÃO ADICIONAR PARA QUE O CADASTRO NÃO SEJA DUPLICADO\n btnAdicionar.setEnabled(true);\n \n }", "public void insertarcola(){\n Cola_banco nuevo=new Cola_banco();// se declara nuestro metodo que contendra la cola\r\n System.out.println(\"ingrese el nombre que contendra la cola: \");// se pide el mensaje desde el teclado\r\n nuevo.nombre=teclado.next();// se ingresa nuestro datos por consola yse almacena en la variable nombre\r\n if (primero==null){// se usa una condicional para indicar si primer dato ingresado es igual al null\r\n primero=nuevo;// se indica que el primer dato ingresado pasa a ser nuestro dato\r\n primero.siguiente=null;// se indica que el el dato ingresado vaya al apuntador siguente y que guarde al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo en la cabeza de nuestro cola\r\n }else{// se usa la condicon sino se cumple la primera\r\n ultimo.siguiente=nuevo;//se indica que ultimo dato ingresado apunte hacia siguente si es que hay un nuevo dato ingresado y que vaya aser el nuevo dato de la cola\r\n nuevo.siguiente=null;// se indica que el nuevo dato ingresado vaya y apunete hacia siguente y quees igual al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo dato\r\n }\r\n System.out.println(\"\\n dato ingresado correctamente\");// se imprime enl mensaje que el dato ha sido ingresado correctamente\r\n}", "public void inserisciValore()throws Exception {\n\n\t\tif (!valore.getInserito()) {\n\n\t\t\tif (!valore.getInserito()) {\n\t\t\t\tint inserimento = Utility.leggiIntero(0, 1, \"Vuoi inserire \" + nome + \"? Digita 1 per SI e 0 pre NO\");\n\t\t\t\tif (inserimento == 0) {\n\n\t\t\t\t} else {\n\t\t\t\t\tswitch (valore.getTipo()) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tvalore.setValore(Utility.leggiLinea(\"inserisci \" + nome));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tvalore.setValore(Utility.leggiIntero(0, 9999999, \"inserisci \" + nome));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tString data = Utility.leggiData(\"inserisci \" + nome + \"(gg/mm/aaaa)\");\n\t\t\t\t\t\t\tDate date = new SimpleDateFormat(\"dd/MM/yyyy\").parse(data);\n\t\t\t\t\t\t\tvalore.setValore(date);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tString ora = Utility.leggiOra(\"Inserisci \" + nome + \" (hh:mm)\");\n\t\t\t\t\t\t\tvalore.setValore(ora);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tArrayList<Integer> eta = Utility.leggiFasciaEta(\"Inserisci\" + nome);\n\t\t\t\t\t\t\tvalore.setEta(eta);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "public void cargarNotas() {\n\n notas.add(null);\n notas.add(null);\n notas.add(null);\n\n int nota, cont = 0;\n for (int i = 0; i <= 2; i++) {\n\n System.out.println(\"Indique nota \" + (i + 1));\n nota = leer.nextInt();\n notas.set(cont, nota);\n cont++;\n\n }\n\n cont = 0;\n\n }", "public void ImprimirDatos(){\n\t\tSystem.out.println(\"Número de elises: \"+NoElises);\n\t\tSystem.out.println(\"Número de alas: \"+NoAlas);\n\t\tSystem.out.println(\"Número de pasajeros: \"+NoPasajeros);\n\t}", "public void insertar() {\r\n if (vista.jTNombreempresa.getText().equals(\"\") || vista.jTTelefono.getText().equals(\"\") || vista.jTRFC.getText().equals(\"\") || vista.jTDireccion.getText().equals(\"\")) {\r\n JOptionPane.showMessageDialog(null, \"Faltan Datos: No puedes dejar cuadros en blanco\");//C.P.M Verificamos si las casillas esta vacia si es asi lo notificamos\r\n } else {//C.P.M de lo contrario prosegimos\r\n modelo.setNombre(vista.jTNombreempresa.getText());//C.P.M mandamos las variabes al modelo \r\n modelo.setDireccion(vista.jTDireccion.getText());\r\n modelo.setRfc(vista.jTRFC.getText());\r\n modelo.setTelefono(vista.jTTelefono.getText());\r\n \r\n Error = modelo.insertar();//C.P.M Ejecutamos el metodo del modelo \r\n if (Error.equals(\"\")) {//C.P.M Si el modelo no regresa un error es que todo salio bien\r\n JOptionPane.showMessageDialog(null, \"Se guardo exitosamente la configuracion\");//C.P.M notificamos a el usuario\r\n vista.dispose();//C.P.M y cerramos la vista\r\n } else {//C.P.M de lo contrario \r\n JOptionPane.showMessageDialog(null, Error);//C.P.M notificamos a el usuario el error\r\n }\r\n }\r\n }", "public void Nouvelleligne() {\n int maxEleve = retourneMaxNumber() + 1;\n try {\n Connector1.statement.executeUpdate(\"Insert INTO eleve(id_el) VALUES (\" + maxEleve + \")\");\n Object[] val = {maxEleve, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"};\n effaceTable(jTable2, mode);\n mode.addRow(val);\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"ERROR \\n\" + e.getMessage());\n\n }\n\n }", "private void limpaCampos() {\r\n\t\tnome.setText(\"\");\r\n\t\tsituacao.setSelectedIndex(0);\r\n\t\tidade.setText(\"\");\r\n\t\terroNome.setText(\"\");\r\n\t\terroIdade.setText(\"\");\r\n\t}", "public void insertarInicio(E dato) {\n\t\tprimero=new Nodo<E>(dato,primero);\n\t\tif (estaVacia()) {\n\t\t\tultimo=primero;\n\t\t}\n\t\tcantidad++;\n\t}", "private void insertar() {\n try {\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.insertar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Ingresado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para guardar registro!\");\n }\n }", "public void insereFinal(String elemento) {\n No novoNo = new No(elemento, null);\n No temp = ini;\n \n //Caso a lista esteja vazia\n if (temp == null){\n ini = novoNo;\n } else {\n //Caminha ate o ultimo No, dentre todos os nos dessa listaa\n while (temp.getProx() != null) {\n temp = temp.getProx();\n }\n\n //Se chegou ate o ultimo no, adicionar o elemento desejado\n temp.setProx(novoNo);\n }\n }", "boolean setDadosInsercao(Object dados);", "public void insereInicio(String elemento) {\n No novoNo = new No(elemento, ini);\n ini = novoNo;\n }", "private void limpiarCampos() {\n datoCriterio1.setText(\"\");\n ((DefaultTableModel)this.jTable1.getModel()).setRowCount(0);\n jBConcretarAccion.setEnabled(false);\n jBCancelar.setEnabled(false);\n jLObjetoSeleccionado.setText(\"\");\n this.unObjetoSeleccionado = null;\n }", "public void saveValue() {\n String[] idCol = assignedDataObject.getIdentifyTemplate().getIdentifyColumnNames();\n if (!(idCol.length == 1 && name.equals(idCol[0]))) { // method \"copy\" must not change unique key name! For any other methods it is not needed to save from frame.\n if (this.getText().equals(\"\")) {\n assignedDataObject.setInt(name, 0);\n } else {\n assignedDataObject.setInt(name, this.getIntValue());\n }\n }\n }", "public void limpiarCampos()\n {\n jtfNumero.setText(\"\");\n jtfNombre.setText(\"\");\n jtfSaldo.setText(\"\");\n this.jbEliminar.setEnabled(false);\n }", "private void limparCampos() {\n\t\ttxtCidade.setText(\"\");\n\t\tlblId.setText(\"0\");\n\t\tcboEstado.getSelectionModel().select(0);\n\t}", "private void setNumeros(Set<Integer> numeros) {\n\t\tthis.numeros = new Vector<Integer>(numeros);\n\t}", "public void setar_campos() {\n int setar = tblEmpresas.getSelectedRow();\n txtEmpId.setText(tblEmpresas.getModel().getValueAt(setar, 0).toString());\n txtEmpNome.setText(tblEmpresas.getModel().getValueAt(setar, 1).toString());\n txtEmpCNPJ.setText(tblEmpresas.getModel().getValueAt(setar, 2).toString());\n txtEmpEnd.setText(tblEmpresas.getModel().getValueAt(setar, 3).toString());\n txtEmpTel.setText(tblEmpresas.getModel().getValueAt(setar, 4).toString());\n txtEmpEmail.setText(tblEmpresas.getModel().getValueAt(setar, 5).toString());\n\n // a linha abaixo desabilita o botao add\n btnAdicionar.setEnabled(false);\n }", "public void insertar(int x, String nombre) {\n \tNodo nuevo;\n nuevo = new Nodo();\n nuevo.edad = x;\n nuevo.nombre = nombre;\n //Validar si la lista esta vacia\n if (raiz==null)\n {\n nuevo.sig = null;\n raiz = nuevo;\n }\n else\n {\n nuevo.sig = raiz;\n raiz = nuevo;\n }\n }", "public void LimpiarCampos() {\n\n txtIdAsignarPer.setText(\"\");\n txtNombreusu.setText(\"\");\n pswConfCont.setText(\"\");\n combPerf.setSelectedItem(\"\");\n pswContra.setText(\"\");\n txtDocumento.setText(\"\");\n }", "private void limpiarCampos() {\n\t\tthis.campoClave.setText(\"\");\n\t\tthis.campoClaveNueva.setText(\"\");\n\t\tthis.campoClaveRepita.setText(\"\");\n\t}", "public CensoSeccionE() {\n this.columnName1=\"\";\n this.columnName2=\"\";\n this.Total_institu=0;\n this.Total_severo=0;\n }", "private void esvaziaMensageiro() {\n\t\tMensageiro.arquivo=null;\n\t\tMensageiro.lingua = linguas.indexOf(lingua);\n\t\tMensageiro.linguas=linguas;\n\t\tMensageiro.nomeArquivo=null;\n\t}", "public void setNulo(boolean nulo) {\n if (autoIncrement && nulo) {\n try {\n throw new ExcepcionPersonalizada(\n \"El campo esta definido como autoincrement y no puede ser nulo.\",\n this,\n \"isNulo\");\n } catch (ExcepcionPersonalizada ex) {\n Logger.getLogger(ParametrosDeCampo.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n this.nulo = nulo;\n }", "public static void IngresoDatos(){\n int IFila=0,ICol=0;\n int INota;\n for(IFila=0;IFila<10;IFila++)\n {\n StrNotas[IFila][0]=JOptionPane.showInputDialog(null, \"Ingrse nombre del alumno:\");\n INota=LlenadoRandom(0,100);\n StrNotas[IFila][1]=Integer.toString(INota);\n if(INota<61)\n StrNotas[IFila][2]=\"Perdio\";\n else\n StrNotas[IFila][2]=\"gano\";\n }\n }", "public void LimpiarCampos(){\n txtNombre.setText(\"\");\n txtCantidad.setText(\"0\");\n txtMora.setText(\"0\");\n txtDescuento.setText(\"0\");\n this.IDactual=0;\n this.modo=\"agregar\";\n }", "@Override\n\tpublic MensajeBean inserta(Tramite_informesem nuevo) {\n\t\treturn tramite_informesemDao.inserta(nuevo);\n\t}", "private void saveRazonNoData(String estado) {\n int c = mRazonNoData.size();\n for (RazonNoData rnd : mRazonNoData) {\n rnd.setEstado(estado);\n estudioAdapter.updateRazonNoDataSent(rnd);\n publishProgress(\"Actualizando Razones No Datos\", Integer.valueOf(mRazonNoData.indexOf(rnd)).toString(), Integer\n .valueOf(c).toString());\n }\n //actualizar.close();\n }", "public void setTitolo(String titolo) {\n if (titolo == null) {\n System.out.println(\"Hai inserito un titolo errato!!\");\n } else {\n this.titolo = titolo;\n }\n }", "public void inserirFinal(int elemento) {\n No novo = new No(elemento, null);\n No temp = ini;\n\n if (eVazia()) {\n ini = novo;\n } else {\n //Percorrer até chegar no ultimo Nó\n while (temp.getProximo() != null) {\n temp = temp.getProximo();\n }\n temp.setProximo(novo);\n }\n\n }", "public void SalvarNovaPessoa(){\r\n \r\n\t\tpessoaModel.setUsuarioModel(this.usuarioController.GetUsuarioSession());\r\n \r\n\t\t//INFORMANDO QUE O CADASTRO FOI VIA INPUT\r\n\t\tpessoaModel.setOrigemCadastro(\"I\");\r\n \r\n\t\tpessoaRepository.SalvarNovoRegistro(this.pessoaModel);\r\n \r\n\t\tthis.pessoaModel = null;\r\n \r\n\t\tUteis.MensagemInfo(\"Registro cadastrado com sucesso\");\r\n \r\n\t}", "public void almacenoDatos(){\n BaseDatosSecundaria administrador= new BaseDatosSecundaria(this);\n SQLiteDatabase bdsecunadaria= administrador.getWritableDatabase();\n _valuesPedido.put(\"Producto\", this._productoNombre);\n _valuesPedido.put(\"Precio\",this._productoPrecio);\n _valuesPedido.put(\"Cantidad\",this._etAdquirir.getText().toString());\n _valuesPedido.put(\"Vendedor\",this.username);\n _valuesPedido.put(\"Id_Producto\",this._productoId);\n bdsecunadaria.insert(\"DATOS\",null,this._valuesPedido);\n bdsecunadaria.close();\n }", "public void inicializar() {\n\t\t// TODO Auto-generated method stub\n\t\tIDISFICHA=\"\";\n\t\tNOTAS=\"\";\n\t\tANOTACIONES=\"\";\n\t\tNOTAS_EJERCICIOS=\"\";\n\t}", "public void inicializar() {\n\t\t// TODO Auto-generated method stub\n\t\tISHORARIO_IDISHORARIO=\"\";\n\t\tISAULA_IDISAULA=\"\";\n\t\tISCURSO_IDISCURSO=\"\";\n\t\t\n\t}", "private void insertar() {\n String nombre = edtNombre.getText().toString();\n String telefono = edtTelefono.getText().toString();\n String correo = edtCorreo.getText().toString();\n // Validaciones\n if (!esNombreValido(nombre)) {\n TextInputLayout mascaraCampoNombre = (TextInputLayout) findViewById(R.id.mcr_edt_nombre_empresa);\n mascaraCampoNombre.setError(\"Este campo no puede quedar vacío\");\n } else {\n mostrarProgreso(true);\n String[] columnasFiltro = {Configuracion.COLUMNA_EMPRESA_NOMBRE, Configuracion.COLUMNA_EMPRESA_TELEFONO\n , Configuracion.COLUMNA_EMPRESA_CORREO, Configuracion.COLUMNA_EMPRESA_STATUS};\n String[] valorFiltro = {nombre, telefono, correo, estado};\n Log.v(\"AGET-ESTADO\", \"ENVIADO: \" + estado);\n resultado = new ObtencionDeResultadoBcst(this, Configuracion.INTENT_EMPRESA_CLIENTE, columnasFiltro, valorFiltro, tabla, null, false);\n if (ID.isEmpty()) {\n resultado.execute(Configuracion.PETICION_EMPRESA_REGISTRO, tipoPeticion);\n } else {\n resultado.execute(Configuracion.PETICION_EMPRESA_MODIFICAR_ELIMINAR + ID, tipoPeticion);\n }\n }\n }", "public void inicializaEntradas(){\n\t\tentrada = TipoMotivoEntradaEnum.getList();\n\t\tentrada.remove(0);\n\t}", "private void recogerDatos() {\n\t\ttry {\n\t\t\tusuSelecc.setId(etId.getText().toString());\n\t\t\tusuSelecc.setName(etNombre.getText().toString());\n\t\t\tusuSelecc.setFirstName(etPApellido.getText().toString());\n\t\t\tusuSelecc.setLastName(etSApellido.getText().toString());\n\t\t\tusuSelecc.setEmail(etCorreo.getText().toString());\n\t\t\tusuSelecc.setCustomFields(etAuth.getText().toString());\n\t\t} catch (Exception e) {\n\t\t\t// Auto-generated catch block\n\t\t\tmostrarException(e.getMessage());\n\t\t}\n\t}", "public static void edit() {\n int dump;\n String dumps;\n System.out.println(\"Silahkan Pilih Index data ke-\");\n System.out.print(\"Index Ke = \");\n dump = input.nextInt();\n try {\n System.out.print(\"\");\n dumps = input.nextLine();\n if (dumps.isBlank() && dumps.isEmpty()){\n System.out.print(\"Input Tugas : \");\n }\n dumps = input.nextLine();\n todolist.set(dump, dumps);\n kembali(\"Data Berhasil Dirubah\");\n\n }catch (IndexOutOfBoundsException e){\n kembali(\"Index Yang Anda Input Salah\");\n }\n }", "public void GuardarPersonas()\r\n {\r\n System.out.print(\"Inserte su numero de cedula: \");\r\n setNumeroId(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Nombre: \");\r\n setNombre(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Apellido: \");\r\n setPrimerApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su Segundo Apellido: \");\r\n setSegundoApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su edad: \");\r\n setEdad(Integer.parseInt(entrada.nextLine()));\r\n System.out.print(\"Inserte su peso: \");\r\n setPeso(Float.valueOf(entrada.nextLine()));\r\n \r\n }", "private void limpiarCampos() {\n campoNombre.setText(\"\");\n campoNumLibro.setText(\"\");\n campoNumPagina.setText(\"\");\n }", "private void limpaCampos() {\n txtNome.setText(\"\");\n txtRG.setText(\"\");\n txtFCpf.setText(\"\");\n txtFNascimento.setText(\"\");\n txtEmail.setText(\"\");\n txtFCelular.setText(\"\");\n txtFTelefone.setText(\"\");\n txtRua.setText(\"\");\n txtComplemento.setText(\"\");\n txtFCep.setText(\"\");\n txtBairro.setText(\"\");\n txtCidade.setText(\"\");\n }", "public void agregarAlInicio(String valor){\r\n // Define un nuevo nodo.\r\n Nodo nuevo = new Nodo();\r\n // Agrega al valor al nodo.\r\n nuevo.setValor(valor);\r\n // Consulta si la lista esta vacia.\r\n if (esVacia()) {\r\n // Inicializa la lista agregando como inicio al nuevo nodo.\r\n inicio = nuevo;\r\n // Caso contrario va agregando los nodos al inicio de la lista.\r\n } else{\r\n // Une el nuevo nodo con la lista existente.\r\n nuevo.setSiguiente(inicio);\r\n // Renombra al nuevo nodo como el inicio de la lista.\r\n inicio = nuevo;\r\n }\r\n // Incrementa el contador de tamaño de la lista.\r\n tamanio++;\r\n }", "@Override\n public void setPrimeraEntrada(Componente entrada) {\n if(Name.equals(\"NOT\")){\n Entrada1=entrada;\n Entrada2=entrada;\n }else {\n this.Entrada1 = entrada;\n }\n }", "public void InsertarNodo(int nodo) {\r\n Nodo nuevo_nodo = new Nodo(nodo);\r\n nuevo_nodo.siguiente = UltimoValorIngresado;\r\n UltimoValorIngresado = nuevo_nodo;\r\n tamaño++;\r\n }", "private void setValoresDoAluno(String[] nomes, int[]notas, int[]conceitos)\n\t{\n\t\tif( nomes.length > 0 && notas.length > 0)\n\t\t{\n\t\t\tfor(int a=0; a < nomes.length || a < numMaxDeAluno; a++)\n\t\t\t{\n\t\t\t\tgradeNomes[a] = nomes[a];\n\t\t\t\tgradeNotas[a] = notas[a];\n\t\t\t\tgradeConceitos[a] = conceitos[a];\n\t\t\t}\n\t\t}\n\t}", "public void setInsertarSaldo() {\r\n\t\tSystem.out.println(\"Insertar saldo:\");\r\n\t\tScanner scanner = new Scanner (System.in);\r\n\t\tsaldo = scanner.nextDouble();\r\n\t}", "public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugador(dato));\r\n }\r\n }", "public void setNotifica(Set<Notifica> aNotifica) {\n notifica = aNotifica;\n }", "private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }", "public void insertarOrden(Object dato) {\n Nodo nuevo = new Nodo(dato);\n int res = 0;\n // System.out.println(\"esxa\"+res);\n if (primero == null) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n // System.out.println(\"Es nulo\");\n// System.out.println(\"sss\"+primero.getDato());\n } else {\n res = comp.evaluar(dato, primero.getDato());\n // System.out.println(\"\"+res);\n if (res == -1) {\n nuevo.setReferencia(primero);\n primero = nuevo;\n } else {\n int auxres = 0;\n Nodo anterior, actual;\n anterior = actual = primero;\n auxres = comp.evaluar(dato, actual.getDato());\n while ((actual.getReferencia() != null) && (auxres == 1)) {\n anterior = actual;\n actual = actual.getReferencia();\n auxres = comp.evaluar(dato, actual.getDato());\n }\n if (auxres == 1) {\n anterior = actual;\n }\n nuevo.setReferencia(anterior.getReferencia());\n anterior.setReferencia(nuevo);\n\n }\n }\n\n }", "public static void InsertarAutos(Session sesion){\n String[] colores = \"rojo,azul,amarillo,rojo,azul,verde\".split(\",\");\n String[] marca = \"peugeot,mazda,mercedes,fiat,ford,audi\".split(\",\");\n String[] modelo = \"308,tornado,1114,siena,fiesta,tt\".split(\",\");\n String[] precio = \"100000,100000,1000,1000,1000,10000\".split(\",\");\n \n Transaction tx = sesion.beginTransaction();\n \n for (int i = 0; i < colores.length; i++) {\n Autos auto = new Autos();\n auto.setColor(colores[i]);\n auto.setConcesionario(\"1\");\n auto.setMarca(marca[i]);\n auto.setModelo(modelo[i]);\n sesion.save(auto);\n }\n \n tx.commit();\n }", "public void Mendaftar(Pasien pasien) {\r\n // mengisi data variabel daftarPasien dengan variabel lokal daftarPasien \r\n daftarPasien.add(pasien);\r\n }", "@Override\n\tpublic void set(Medicamento novo) {\n\t\t\n\n\t\t\tcon = ConexaoSingleton.getInstance();\n\t\t\ttry {\n\t\t\t\tpst = con.prepareStatement(\"INSERT INTO Medicamento (nome,mg) VALUES (?,?)\");\n\t\t\t\tpst.setString(1, novo.getDesc());\n\t\t\t\tpst.setDouble(2, novo.getmg());\n\t\t\t\tpst.execute();\n\t\t\t}catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t}", "private void InsetarEstudiantes() {\n new Insertar_Estudiantes(arreglo).setVisible(true); // CONECTA LA VENTANA Y LE PASA LA REFERENCIA DEL ARREGLO A INSERTAR ESTUDIANTE\n this.hide(); // Esconde la ventana anterior,\n // this.setVisible(false); // Otra forma de Eliminar - Esconder la ventana anterior.\n }", "private void deshabilitarCamposCrear() {\n txtCodBockFoto.setEnabled(false);\n txtCodBockFoto.setText(\"\");\n\n txtCodPromotor.setEnabled(false);\n txtCodPromotor.setText(\"\");\n txtDNIPromotor.setText(\"\");\n\n //limpiarListaCrear();\n }", "public Sesiones() {\n\t\tentradasVendidas = 0;\n\t}", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }", "public void limpiar()\n {\n nombre = null;\n descripcion = null;\n estado = null;\n primerNivel = true;\n }", "public void setNumero(int numero) { this.numero = numero; }", "public void setwoorden()\n {\n String[] woorden = taInput.getText().split(\" |\\n\");\n \n for (int i = 0; i < woorden.length; i++) {\n if(!woorden[i].isEmpty())\n {\n AllText.add(woorden[i]); \n }\n } \n }", "public void ordenarXNombreInsercion() {\r\n\t\tfor (int i = 1; i < datos.size(); i++) {\r\n\t\t\tfor (int j = i; j>0 && ( (datos.get(j-1).compare(datos.get(j-1), datos.get(j)))==(1) ); j--) {\r\n\t\t\t\tJugador temp = datos.get(j);\r\n\t\t\t\tdatos.set(j, datos.get(j-1));\r\n\t\t\t\tdatos.set(j-1, temp);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void insertar(ArrayList<Estado> hijos) {\r\n\t\tfor (Estado p : hijos) { // Añado hijos a nodos abiertos\r\n\t\t\tabiertos.add(p);\r\n\t\t\tif (abiertos.size() > estados_abiertos)\r\n\t\t\t\testados_abiertos = abiertos.size(); // Variable para contar el numero maximo de estados abiertos\r\n\t\t}\r\n\t}", "public void insere(Pessoa pessoa){\n\t\tdb.save(pessoa);\n\t}", "private void LimpiarCampos(){\n \n txtClave.setText(null);\n txtNombre.setText(null);\n txtPaterno.setText(null);\n txtMaterno.setText(null);\n txtTelefono.setText(null);\n txtCorreo.setText(null);\n cbxGenero.setSelectedIndex(0);\n cbxRol.setSelectedIndex(0);\n }", "public void setKelas(String sekolah){\n\t\ttempat = sekolah;\n\t}", "private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }", "public void asignar_Nodo(Nodo e) {\n\t\tthis.elem = e;\n\t}", "@Override\n protected void carregaObjeto() throws ViolacaoRegraNegocioException {\n entidade.setNome( txtNome.getText() );\n entidade.setDescricao(txtDescricao.getText());\n entidade.setTipo( txtTipo.getText() );\n entidade.setValorCusto(new BigDecimal((String) txtCusto.getValue()));\n entidade.setValorVenda(new BigDecimal((String) txtVenda.getValue()));\n \n \n }", "public Aeronave(int NoElises,int NoAlas, int NoPasajeros) {\n\t\tsuper();\n\t\tthis.NoElises=NoElises;\n\t\tthis.NoAlas=NoAlas;\n\t\tthis.NoPasajeros=NoPasajeros;\n\t}", "public void alterarDadosCadastraisNumeroInvalido() {\n\t\tAlterarDadosCadastraisPage alterarDadosCadastraisPage = new AlterarDadosCadastraisPage(driver);\n\t\talterarDadosCadastraisPage.getInputCel().clear();\n\t\talterarDadosCadastraisPage.getButtonSalvar().click();\n\t}", "public void adicionar() {\n String sql = \"insert into empresa(empresa, cnpj, endereco, telefone, email) values (?,?,?,?,?)\";\n try {\n pst = conexao.prepareStatement(sql);\n pst.setString(1, txtEmpNome.getText());\n pst.setString(2, txtEmpCNPJ.getText());\n pst.setString(3, txtEmpEnd.getText());\n pst.setString(4, txtEmpTel.getText());\n pst.setString(5, txtEmpEmail.getText());\n // validacao dos campos obrigatorios\n if ((txtEmpNome.getText().isEmpty()) || (txtEmpCNPJ.getText().isEmpty())) {\n JOptionPane.showMessageDialog(null, \"Preencha todos os campos obrigatórios\");\n } else {\n //a linha abaixo atualiza a tabela usuarios com os dados do formulario\n // a esttrutura abaixo confirma a inserção na tabela\n int adicionado = pst.executeUpdate();\n if (adicionado > 0) {\n JOptionPane.showMessageDialog(null, \"Empresa adicionada com sucesso\");\n txtEmpNome.setText(null);\n txtEmpEnd.setText(null);\n txtEmpTel.setText(null);\n txtEmpEmail.setText(null);\n txtEmpCNPJ.setText(null);\n }\n }\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }", "public void setNumero(int numero) {\n this.dado1 = numero;\n }", "private void llenarEntidadConLosDatosDeLosControles() {\n clienteActual.setNombre(txtNombre.getText());\n clienteActual.setApellido(txtApellido.getText());\n clienteActual.setDui(txtDui.getText());\n //clienteActual.setNumero(txtNumero.getText());\n //clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n clienteActual.setNumero(Integer.parseInt(this.txtNumero.getText()));\n }", "private void inserirQuests(){\n try {\n methods.InsereQuestsOnBD();\n //Toast.makeText(this,\"Inseridos dados com sucesso\",Toast.LENGTH_LONG).show();\n\n }\n catch (SQLException ex){\n AlertDialog.Builder dlg = new AlertDialog.Builder(this);\n dlg.setTitle(\"Erro\");\n dlg.setMessage(ex.getMessage());\n dlg.setNeutralButton(\"OK\",null);\n dlg.show();\n }\n }", "private void InsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_InsertActionPerformed\n try{\n if(isEmpty())\n throw new Exception(\"Introdu toate datele!\");\n\n // if phone is frequency dont insert\n if(isExitsPhone())\n throw new Exception(\"Eroare nr telefon!\");\n\n boolean ok = insert();\n if(ok){\n Vector data = getData(\"\");\n showData(data);\n } else\n throw new Exception(\"Eroare la inserare!\");\n\n }catch(Exception e){\n JOptionPane.showMessageDialog(this, e.getMessage());\n }\n }", "private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }", "public CensoCCVnoREMExcluidos() {\n this.nombre = \"\";\n this.apellidom = \"\";\n this.apellidop = \"\";\n this.rut = \"\";\n this.edad = 0;\n this.razon_exclusion = \"\";\n }", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }", "private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }", "public void setAllMissing();", "public CensoPSAMExcluidos() {\n this.nombre = \"\";\n this.apellidom = \"\";\n this.apellidop = \"\";\n this.rut = \"\";\n this.edad = 0;\n this.razon_exclusion = \"\";\n }", "public void limpiarProcesoBusqueda() {\r\n parametroEstado = 1;\r\n parametroNombre = null;\r\n parametroApellido = null;\r\n parametroDocumento = null;\r\n parametroTipoDocumento = null;\r\n parametroCorreo = null;\r\n parametroUsuario = null;\r\n parametroEstado = 1;\r\n parametroGenero = 1;\r\n listaTrabajadores = null;\r\n inicializarFiltros();\r\n }", "public void setSeguros(Set<Integer> seguros){\n\tthis.seguros.clear();\n\tfor(Integer i : seguros){\n\t this.seguros.add(i);\n\t}\n }", "@Test\n public void testSetNota() {\n System.out.println(\"setNota\");\n ArrayList<Notas> nota = null;\n Alumno instance = null;\n instance.setNota(nota);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public Nodo() {\r\n this.dato = null;\r\n this.siguiente = null;\r\n }", "public void limpiar() {\r\n\t\t\t\tid.setText(\"\");\r\n\t\t\t\ttitulo.setText(\"\");\r\n\t\t\t\tdirector.setText(\"\");\r\n\t\t\t\tidCliente.setText(\"\");\r\n\t\t\t}", "public void SetNoPasajeros(int nopasajeros) {\n\t\ttry {\n\t\t\tthis.NoPasajeros=nopasajeros;\n\t\t} catch (NumberFormatException e) {\n\t\t\tthis.NoPasajeros=0;\n\t\t}\n\t}", "public void CadastarNotas(NotasBean nb) {\r\n\r\n\t\tString sql = \"INSERT INTO notas(idNota,nota,idAluno,idProfessor,idMateria) VALUES (?,?,?,?,?)\";\r\n\t\ttry {\r\n\t\t\tPreparedStatement pstmt = this.conexao.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, nb.getIdAluno());\r\n\t\t\tpstmt.setDouble(2, nb.getNota());\r\n\t\t\tpstmt.setInt(3, nb.getIdAluno());\r\n\t\t\tpstmt.setInt(4, nb.getIdProfessor());\r\n\t\t\tpstmt.setInt(5, nb.getIdMateria());\r\n\t\t\tpstmt.execute();\r\n\t\t\tpstmt.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Falha ao cadastrar um registro na tabela notas\");\r\n\t\t}\r\n\t}", "private void esqueceu() {\n\n //Declaração de Objetos\n Veterinario veterinario = new Veterinario();\n\n //Declaração de Variaveis\n int crmv;\n String senha;\n\n //Atribuição de Valores\n try {\n crmv = Integer.parseInt(TextCrmv.getText());\n senha = TextSenha.getText();\n \n //Atualizando no Banco\n veterinario.Vdao.atualizarAnimalSenhaPeloCrmv(senha, crmv);\n \n } catch (NumberFormatException ex) {\n JOptionPane.showMessageDialog(null, \"APENAS NUMEROS NO CRMV!\");\n }\n JOptionPane.showMessageDialog(null, \"SUCESSO AO ALTERAR SENHA!\");\n\n }", "private void initializeData() {\n ListaOfertas.removeAll(ListaOfertas);\n for(Articulo listaJuegos: ArticuloRepository.getListArticulo()){\n if(listaJuegos.getOferta().contains(\"S\")){\n listaJuegos.setValorDescuento(String.valueOf(listaJuegos.getPrecioArticulo()-(listaJuegos.getPrecioArticulo()*listaJuegos.getPorcentajeDescuento()/100)));\n ListaOfertas.add(listaJuegos);\n }\n\n }\n }", "public void setPrenotazione(Set<Prenotazione> aPrenotazione) {\n prenotazione = aPrenotazione;\n }", "public void guardar(int sel){\n \n if (modelo.getRowCount() == 0) {\n JOptionPane.showMessageDialog(this, \"Necesitas agregar elementos.\");\n } else{\n Producto prod[] = new Producto[modelo.getRowCount()];\n for (int i = 0; i < modelo.getRowCount(); i++) { \n prod[i] = new Producto(Integer.parseInt(modelo.getValueAt(i, 0)+\"\"),\n (String)modelo.getValueAt(i, 1),\n (String)modelo.getValueAt(i, 2),\n Integer.parseInt(modelo.getValueAt(i, 3)+\"\"),\n Double.parseDouble(modelo.getValueAt(i, 4)+\"\"));\n }\n \n \n //Ordenamos\n if (sel == 0) {\n ArchivosBinarios.ordQS_A_ID(prod, 0, prod.length-1);\n } else if (sel == 1){\n ArchivosBinarios.ord_QS_Dsc_Asc(prod, 0, prod.length-1);\n } else if (sel == 2) {\n JOptionPane.showMessageDialog(null, \"La informacipón se guardo.\");\n }\n\n \n for (int i = 0; i < prod.length; i++) {\n modelo.setValueAt(prod[i].getId(), i, 0);\n modelo.setValueAt(prod[i].getTipo(), i, 1);\n modelo.setValueAt(prod[i].getMarca(), i, 2);\n modelo.setValueAt(prod[i].getCantidad(), i, 3);\n modelo.setValueAt(prod[i].getPrecio(), i, 4);\n }\n }\n }", "public void inseriPessoa() throws IOException {\n\t\tString r;\n\t\tvetPessoas[nPessoas] = new Pessoa();\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tvetPessoas[nPessoas].setNome(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Cpf \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setCpf(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Data de Nascimento fomanto (dd/mm/aaaa)\");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setDataNascimento(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Estado Civil \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEstadoCivil(r);\n\t\t\n\t\tthis.nPessoas+=1;\n\t}", "public void salvarNoBanco() {\n\n try {\n ofertaDisciplinaFacade.save(oferta);\n// JsfUtil.addSuccessMessage(\"Pessoa \" + pessoa.getNome() + \" criado com sucesso!\");\n oferta= null;\n// recriarModelo();\n } catch (Exception e) {\n JsfUtil.addErrorMessage(e, \"Ocorreu um erro de persistência\");\n }\n }", "private void insertData() \n {\n for(int i = 0; i < 2; i++){\n RazaEntity razaEntity = factory.manufacturePojo(RazaEntity.class);\n em.persist(razaEntity);\n razaData.add(razaEntity);\n }\n for (int i = 0; i < 3; i++) {\n EspecieEntity especieEntity = factory.manufacturePojo(EspecieEntity.class);\n if(i == 0)\n {\n especieEntity.setRazas(razaData);\n }\n em.persist(especieEntity);\n especieData.add(especieEntity);\n }\n }" ]
[ "0.6349942", "0.6251066", "0.62326753", "0.6156306", "0.60752565", "0.60623735", "0.6061118", "0.6051987", "0.59529555", "0.5894368", "0.5890504", "0.58866704", "0.58581275", "0.5815127", "0.57859486", "0.5768861", "0.57405424", "0.5729895", "0.57264924", "0.5721686", "0.5719691", "0.57176524", "0.57144356", "0.57035214", "0.56846154", "0.5680663", "0.5678852", "0.5678713", "0.5673573", "0.5662002", "0.56453305", "0.56433856", "0.5630944", "0.56194174", "0.56132877", "0.56115854", "0.5596537", "0.55930406", "0.5588498", "0.5571049", "0.5564148", "0.55608946", "0.55539286", "0.55332625", "0.5525416", "0.551436", "0.55005467", "0.54961914", "0.5494719", "0.5476687", "0.5474665", "0.54644084", "0.5462687", "0.5460828", "0.5456046", "0.5450795", "0.5443199", "0.5428306", "0.54267037", "0.5426678", "0.54012245", "0.53981614", "0.5395801", "0.53903776", "0.53889066", "0.53848326", "0.5383845", "0.53827107", "0.5377483", "0.5376628", "0.5371592", "0.5371247", "0.53681296", "0.53596526", "0.53590953", "0.5352349", "0.53515685", "0.5348401", "0.5346548", "0.5345516", "0.53448355", "0.53350455", "0.53350455", "0.5330515", "0.53237575", "0.53211313", "0.5320697", "0.531593", "0.5311027", "0.53090864", "0.5307324", "0.5297787", "0.52974665", "0.5297291", "0.5294938", "0.52939004", "0.52908415", "0.5290421", "0.5280549", "0.52798754" ]
0.55507165
43
metodo set para insertar datos enteros en la variable NoPasajeros con un exception NumberFormatException
public void SetNoPasajeros(int nopasajeros) { try { this.NoPasajeros=nopasajeros; } catch (NumberFormatException e) { this.NoPasajeros=0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alterarDadosCadastraisNumeroInvalido() {\n\t\tAlterarDadosCadastraisPage alterarDadosCadastraisPage = new AlterarDadosCadastraisPage(driver);\n\t\talterarDadosCadastraisPage.getInputCel().clear();\n\t\talterarDadosCadastraisPage.getButtonSalvar().click();\n\t}", "public void inserisciValore()throws Exception {\n\n\t\tif (!valore.getInserito()) {\n\n\t\t\tif (!valore.getInserito()) {\n\t\t\t\tint inserimento = Utility.leggiIntero(0, 1, \"Vuoi inserire \" + nome + \"? Digita 1 per SI e 0 pre NO\");\n\t\t\t\tif (inserimento == 0) {\n\n\t\t\t\t} else {\n\t\t\t\t\tswitch (valore.getTipo()) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tvalore.setValore(Utility.leggiLinea(\"inserisci \" + nome));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tvalore.setValore(Utility.leggiIntero(0, 9999999, \"inserisci \" + nome));\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tString data = Utility.leggiData(\"inserisci \" + nome + \"(gg/mm/aaaa)\");\n\t\t\t\t\t\t\tDate date = new SimpleDateFormat(\"dd/MM/yyyy\").parse(data);\n\t\t\t\t\t\t\tvalore.setValore(date);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tString ora = Utility.leggiOra(\"Inserisci \" + nome + \" (hh:mm)\");\n\t\t\t\t\t\t\tvalore.setValore(ora);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tArrayList<Integer> eta = Utility.leggiFasciaEta(\"Inserisci\" + nome);\n\t\t\t\t\t\t\tvalore.setEta(eta);\n\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "@Test\n public void testSetNumero() {\n System.out.println(\"setNumero\");\n try {\n asientoTested.setNumero(0);\n fail();\n } catch (IllegalArgumentException e) {\n assertTrue(\"0 no es un valor valido\", true);\n }\n try {\n asientoTested.setNumero(-1);\n fail();\n } catch (IllegalArgumentException e) {\n assertTrue(\"-1 no es un valor valido\", true);\n }\n try {\n asientoTested.setNumero(30);\n } catch (IllegalArgumentException e) {\n fail(\"30 es un valor valido\");\n }\n try {\n asientoTested.setNumero(31);\n fail();\n } catch (IllegalArgumentException e) {\n assertTrue(\"31 no es un valor valido\", true);\n }\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"The test case is a prototype.\");\n }", "public void novoUtente()\r\n {\r\n Scanner input=new Scanner(System.in);\r\n System.out.print(\"nome:-\");\r\n setNome(input.nextLine());\r\n try\r\n {\r\n System.out.print(\"idade:-\");\r\n setIdade(input.nextInt());\r\n }\r\n catch(InputMismatchException ae)\r\n {\r\n System.out.println(\"o valor inserido nao foi um inteiro!\");\r\n System.out.println(\"volte a efetuar o registo\");\r\n }\r\n numUnico = geraNumeroUnico();\r\n }", "public void setInsertarSaldo() {\r\n\t\tSystem.out.println(\"Insertar saldo:\");\r\n\t\tScanner scanner = new Scanner (System.in);\r\n\t\tsaldo = scanner.nextDouble();\r\n\t}", "public void inserisciValore()throws Exception {\r\n\r\n\t\t\r\n\t\t\tif (!valore.getInserito()) {\r\n\t\t\t\tboolean inserimento = InputOutput.richiestaInserimento(nome);\r\n\t\t\t\tif (inserimento) {\r\n\t\t\t\t\tvalore.inserisciValore(nome);\r\n\t\t\t\t\tvalore.setInserito(true);\t\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}", "public void setNumero(int numero) {\n this.dado1 = numero;\n }", "public void setNumero(int numero) { this.numero = numero; }", "private void limpiarValores(){\n\t\tpcodcia = \"\";\n\t\tcedula = \"\";\n\t\tcoduser = \"\";\n\t\tcluser = \"\";\n\t\tmail = \"\";\n\t\taudit = \"\";\n\t\tnbr = \"\";\n\t\trol = \"\";\n\t}", "public NoDigitException(){\r\n\r\n\t}", "public void ingresar() \r\n\t{\r\n\r\n\t\tString numeroCasilla = JOptionPane.showInputDialog(this, \"Ingresar numero en la casilla \" + sudoku.darFilaActual() + \",\" +sudoku.darColumnaActual());\r\n\t\tif (numeroCasilla == null || numeroCasilla ==\"\")\r\n\t\t{}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\tint numeroCasillaInt = Integer.parseInt(numeroCasilla);\r\n\t\t\t\tif(numeroCasillaInt > sudoku.darCantidadColumnasZona()*sudoku.darCantidadFilasZona() || numeroCasillaInt < 1)\r\n\t\t\t\t{\r\n\t\t\t\t\tJOptionPane.showMessageDialog( this, \"El numero ingresado no es valido. Debe ser un valor entre 1 y \" + sudoku.darCantidadColumnasZona()*sudoku.darCantidadFilasZona(), \"Error\", JOptionPane.ERROR_MESSAGE );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(Exception e)\r\n\t\t\t{\r\n\t\t\t\tJOptionPane.showMessageDialog( this, \"Debe ingresar un valor numerico entre 1 y \" + sudoku.darCantidadColumnasZona()*sudoku.darCantidadFilasZona(), \"Error\", JOptionPane.ERROR_MESSAGE );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void setNumeros(Set<Integer> numeros) {\n\t\tthis.numeros = new Vector<Integer>(numeros);\n\t}", "public void insertarPaciente ( String dni, String nombre, String apellidos, String telefono,String emaail,float peso_actual, float peso_objetivo, float altura, int edad, String sexo, String password,String complexion);", "public void setM_Splitting_ID (int M_Splitting_ID)\n{\nset_ValueNoCheck (\"M_Splitting_ID\", new Integer(M_Splitting_ID));\n}", "public void insertarcola(){\n Cola_banco nuevo=new Cola_banco();// se declara nuestro metodo que contendra la cola\r\n System.out.println(\"ingrese el nombre que contendra la cola: \");// se pide el mensaje desde el teclado\r\n nuevo.nombre=teclado.next();// se ingresa nuestro datos por consola yse almacena en la variable nombre\r\n if (primero==null){// se usa una condicional para indicar si primer dato ingresado es igual al null\r\n primero=nuevo;// se indica que el primer dato ingresado pasa a ser nuestro dato\r\n primero.siguiente=null;// se indica que el el dato ingresado vaya al apuntador siguente y que guarde al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo en la cabeza de nuestro cola\r\n }else{// se usa la condicon sino se cumple la primera\r\n ultimo.siguiente=nuevo;//se indica que ultimo dato ingresado apunte hacia siguente si es que hay un nuevo dato ingresado y que vaya aser el nuevo dato de la cola\r\n nuevo.siguiente=null;// se indica que el nuevo dato ingresado vaya y apunete hacia siguente y quees igual al null\r\n ultimo=nuevo;// se indica que el ultimo dato ingresado pase como nuevo dato\r\n }\r\n System.out.println(\"\\n dato ingresado correctamente\");// se imprime enl mensaje que el dato ha sido ingresado correctamente\r\n}", "private void validaDados(int numeroDePacientes, double gastosEmCongressos) throws Exception{\n\t\tif(numeroDePacientes >= 0) {\n\t\t\tthis.numeroDePacientes = numeroDePacientes;\n\t\t}else {\n\t\t\tthrow new Exception(\"O numero de pacientes atendidos pelo medico nao pode ser negativo.\");\n\t\t}\n\t\tif(gastosEmCongressos >= 0) {\n\t\t\tthis.gastosEmCongressos = gastosEmCongressos;\n\t\t}else {\n\t\t\tthrow new Exception(\"O total de gastos em congressos do medico nao pode ser negativo.\");\n\t\t}\n\t}", "@Test\n public void deve_aceitar_tamanho_com_8_numeros() {\n telefone.setTamanho(8);\n assertTrue(isValid(telefone, String.valueOf(telefone.getTamanho()), Find.class));\n }", "@Test\n public void deve_aceitar_tamanho_com_9_numeros() {\n telefone.setTamanho(9);\n assertTrue(isValid(telefone, String.valueOf(telefone.getTamanho()), Find.class));\n }", "@Override\n protected void carregaObjeto() throws ViolacaoRegraNegocioException {\n entidade.setNome( txtNome.getText() );\n entidade.setDescricao(txtDescricao.getText());\n entidade.setTipo( txtTipo.getText() );\n entidade.setValorCusto(new BigDecimal((String) txtCusto.getValue()));\n entidade.setValorVenda(new BigDecimal((String) txtVenda.getValue()));\n \n \n }", "@Test(expected = BusinessLogicException.class)\n public void updateTarjetaPrepagoConNumeroInvalidoTest() throws BusinessLogicException \n {\n TarjetaPrepagoEntity entity = data.get(0);\n TarjetaPrepagoEntity pojoEntity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n pojoEntity.setNumTarjetaPrepago(null);\n pojoEntity.setId(entity.getId());\n tarjetaPrepagoLogic.updateTarjetaPrepago(pojoEntity.getId(), pojoEntity);\n }", "public void validarPostagem() {\n\t\t// validando se o nome motorista ou carona foram preenchidos\n\t\tint verif = 0;\n\t\ttry {\n\t\t\tif (txtCarona.getText() == null\n\t\t\t\t\t|| txtCarona.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (txtMotorista.getText() == null\n\t\t\t\t\t|| txtMotorista.getText().trim().equals(\"\")) {\n\n\t\t\t\tverif++;\n\n\t\t\t}\n\t\t\tif (verif == 2) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t\tif (txtDestino.getText() == null\n\t\t\t\t\t|| txtDestino.getText().trim().equals(\"\")) {\n\t\t\t\tthrow new IllegalArgumentException();\n\t\t\t}\n\n\t\t} catch (IllegalArgumentException e) {\n\t\t\tJOptionPane\n\t\t\t\t\t.showMessageDialog(\n\t\t\t\t\t\t\tnull,\n\t\t\t\t\t\t\t\"Para postar no quadro é necessário informar nome (motorista ou passageiro) \"\n\t\t\t\t\t\t\t\t\t+ \"\t\t\t\t\t\t\te local. \\n Por favor certifique se os campos foram preenchidos e tente novamente.\");\n\t\t}\n\n\t}", "@Test\n public void nao_deve_aceitar_tamanho_telefone_fixo_com_mais_de_9_numeros() {\n telefone.setTamanho(10);\n assertFalse(isValid(telefone, \"O tamanho do telefone não pode ser maior que 9.\", Find.class));\n }", "private void validateValue()\r\n {\r\n try\r\n {\r\n Long.parseLong(getText());\r\n }\r\n catch (NumberFormatException ex)\r\n {\r\n setText(\"\");\r\n }\r\n \r\n }", "@Test\n public void testSetNumSoin() {\n \n assertNull(soin3.getNumSoin());\n soin3.setNumSoin(\"200\");\n assertNotNull(soin3.getNumSoin());\n assertEquals(\"200\", soin3.getNumSoin());\n \n }", "public static void provjeriValutu(String valuta) {\r\n\t\tif (Podrzana_Valuta.equals(valuta) == false) {\r\n\t\t\tthrow new NepodrzanaValutaException(\"unijeli ste valutu \" + valuta\r\n\t\t\t\t\t+ \"koja nije podrzana.\");\r\n\t\t}\r\n\t}", "@Test\r\n\tpublic void testSetGetNhsNumberInvalid() {\r\n\t\tDoctor doctor = new Doctor();\r\n\t\tdoctor.setNhsNumber(nhsNumberInvalid);\r\n\t\tassertEquals(nhsNumberInvalid, doctor.getNhsNumber());\r\n\t}", "public void setCantidad(Integer cantidad) {\n this.cantidad.set(cantidad);\n }", "public static void stinException(String nameField,Editable number) throws Exceptions {\n if(nameField.equals(\"stock\") && number.toString().isEmpty()){\n numberObtained=0;\n }\n if(nameField.equals(\"stock\") && number.toString().isEmpty()==false) {\n try {\n if (Integer.parseInt(number.toString()) < 0) {\n throw new Exceptions(\"You need to insert positive integer numbers\");\n }\n } catch (Exception e) {\n throw new Exceptions(\"Insert correctly the number of the stock\");\n }\n }\n try {\n if (nameField.equals(\"cost\") && Double.parseDouble(number.toString()) <= 0) {\n throw new Exceptions(\"You need to insert positive decimal numbers\");\n }\n }catch (Exceptions fs){\n throw new Exceptions(\"You need to insert positive decimal numbers\");\n }catch (Exception e){\n throw new Exceptions(\"The cost is a decimal number\");\n }\n\n\n }", "public void setCantidad(int value) {\n this.cantidad = value;\n }", "@Test(timeout = 4000)\n public void test128() throws Throwable {\n // Undeclared exception!\n try { \n SQLUtil.parseColumnTypeAndSize(\"create unique indedeltesetciisteam(int, inputstream, long)\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"int\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "public void setCantidadInforme(Long cantidadInforme) {\r\n\t\tthis.cantidadInforme = cantidadInforme;\r\n\t}", "@Test\n public void testSetSiirSuunta() {\n Scanner l;\n ByteArrayInputStream bais = new ByteArrayInputStream(\"sana\\nvastine\\n\".getBytes());\n l = new Scanner(bais);\n KyselyLogiikka k = new KyselyLogiikka(l);\n try {\n k.setSiirSuunta(-1);\n } catch (Exception e) {\n assertTrue(\"Sirtymissuunnan muutos aiheuttaa virheen\", true);\n }\n }", "public void Nodo(){\r\n this.valor = \"\";\r\n this.siguiente = null;\r\n }", "public void setPeso(int peso) {\r\n\t\tif(peso < 0){\r\n\t\t\tSystem.out.println(\"Error peso\");\r\n\t\t}else{\r\n\t\tthis.peso = peso;\r\n\t\t}\r\n\t}", "private void validationMotDePasse( String motDePasse ) throws Exception {\n if ( motDePasse != null ) {\n if ( motDePasse.length() < 3 ) {\n throw new Exception( \"Le mot de passe doit contenir au moins 3 caractères.\" );\n }\n } else {\n throw new Exception( \"Merci de saisir votre mot de passe.\" );\n }\n }", "@Test\n public void nao_deve_aceitar_tamanho_telefone_fixo_com_menos_de_8_numeros() {\n telefone.setTamanho(7);\n assertFalse(isValid(telefone, \"O tamanho do telefone não pode ser menor que 8.\", Find.class));\n }", "public void exibeDataNascimentoInvalida() {\n JOptionPane.showMessageDialog(\n null,\n Constantes.GERENCIAR_FUNCIONARIO_DATA_NASCIMENTO_INVALIDA,\n Constantes.GERENCIAR_FUNCIONARIO_TITULO,\n JOptionPane.PLAIN_MESSAGE\n );\n }", "public void setInvalid();", "public void guardar() {\n String msj = \"\";\n int idpagoanulado = daoPagoCuotaAnulado.nuevoID();\n Date SYSDATE = new Date();\n java.sql.Timestamp fechaPagoCuotaAnuladoSQL = new java.sql.Timestamp(SYSDATE.getTime());\n String observacion = txtObservacion.getText();\n int idmotivo = Integer.parseInt(txtCodigoMotivo.getText());\n int idusuario = appLogin.IDUSUARIO;\n int idpago =Integer.parseInt(txtNumeroPago.getText());\n Date fechapago = daoCotizacion.parseFecha(txtFechaPago.getText());\n java.sql.Date fechapagoSQL = new java.sql.Date(fechapago.getTime());\n double mPago = montoPago;\n String numerocomprobante = txtComprobante.getText();\n String numerorecibo = txtRecibo.getText();\n //VALIDACIONES\n if (idmotivo == 0) {\n msj += \"CODIGO DEL MOTIVO DE ANULACION ESTA VACIO.\\n\";\n }\n if (idpago == 0) {\n msj += \"NO HA SELECCIONADO NINGUN PAGO PARA LA ANULACIÓN.\\n\";\n }\n if (msj.isEmpty()) {\n cpca.setIdpagoanulado(idpagoanulado);\n cpca.setFechahoranulado(fechaPagoCuotaAnuladoSQL);\n cpca.setObservacion(observacion);\n cpca.setIdmotivo(idmotivo);\n cpca.setIdusuario(idusuario);\n cpca.setIdpago(idpago);\n cpca.setFechapago(fechapagoSQL);\n cpca.setMonto(mPago);\n cpca.setNumerocomprobante(numerocomprobante);\n cpca.setNumerorecibo(numerorecibo);\n daoPagoCuotaAnulado.agregar(cpca);\n } else {\n JOptionPane.showMessageDialog(null, msj, \"ERRORES\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public void insertar() {\r\n if (vista.jTNombreempresa.getText().equals(\"\") || vista.jTTelefono.getText().equals(\"\") || vista.jTRFC.getText().equals(\"\") || vista.jTDireccion.getText().equals(\"\")) {\r\n JOptionPane.showMessageDialog(null, \"Faltan Datos: No puedes dejar cuadros en blanco\");//C.P.M Verificamos si las casillas esta vacia si es asi lo notificamos\r\n } else {//C.P.M de lo contrario prosegimos\r\n modelo.setNombre(vista.jTNombreempresa.getText());//C.P.M mandamos las variabes al modelo \r\n modelo.setDireccion(vista.jTDireccion.getText());\r\n modelo.setRfc(vista.jTRFC.getText());\r\n modelo.setTelefono(vista.jTTelefono.getText());\r\n \r\n Error = modelo.insertar();//C.P.M Ejecutamos el metodo del modelo \r\n if (Error.equals(\"\")) {//C.P.M Si el modelo no regresa un error es que todo salio bien\r\n JOptionPane.showMessageDialog(null, \"Se guardo exitosamente la configuracion\");//C.P.M notificamos a el usuario\r\n vista.dispose();//C.P.M y cerramos la vista\r\n } else {//C.P.M de lo contrario \r\n JOptionPane.showMessageDialog(null, Error);//C.P.M notificamos a el usuario el error\r\n }\r\n }\r\n }", "public void ImprimirDatos(){\n\t\tSystem.out.println(\"Número de elises: \"+NoElises);\n\t\tSystem.out.println(\"Número de alas: \"+NoAlas);\n\t\tSystem.out.println(\"Número de pasajeros: \"+NoPasajeros);\n\t}", "private void valida(String str)throws Exception{\n\t\t\t\n\t\t\tif(str == null || str.trim().isEmpty()){\n\t\t\t\tthrow new Exception(\"Nao eh possivel trabalhar com valores vazios ou null.\");\n\t\t\t}\n\t\t\n\t\t}", "private void insertar() {\n try {\n cvo.setNombre_cliente(vista.txtNombre.getText());\n cvo.setApellido_cliente(vista.txtApellido.getText());\n cvo.setDireccion_cliente(vista.txtDireccion.getText());\n cvo.setCorreo_cliente(vista.txtCorreo.getText());\n cvo.setClave_cliente(vista.txtClave.getText());\n cdao.insertar(cvo);\n vista.txtNombre.setText(\"\");\n vista.txtApellido.setText(\"\");\n vista.txtDireccion.setText(\"\");\n vista.txtCorreo.setText(\"\");\n vista.txtClave.setText(\"\");\n JOptionPane.showMessageDialog(null, \"Registro Ingresado\");\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Debe ingresar Datos para guardar registro!\");\n }\n }", "public void setNumero(int numero)\r\n/* 195: */ {\r\n/* 196:206 */ this.numero = numero;\r\n/* 197: */ }", "@Override\n\tpublic void procesar() throws WrongValuesException, ExcEntradaInconsistente {\n\n\t}", "@Test (expected = IllegalArgumentException.class)\n\tpublic void testSetTelephone() {\n\t\tUser user = new User();\n\t\tuser.setTelephone(\"\");\n\t\t//user.setTelephone(\"3393937210\");\n\t\t//assertEquals(\"3393937210\", user.getTelephone());\n\t\t}", "public void setNulo(boolean nulo) {\n if (autoIncrement && nulo) {\n try {\n throw new ExcepcionPersonalizada(\n \"El campo esta definido como autoincrement y no puede ser nulo.\",\n this,\n \"isNulo\");\n } catch (ExcepcionPersonalizada ex) {\n Logger.getLogger(ParametrosDeCampo.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n this.nulo = nulo;\n }", "public void GuardarPersonas()\r\n {\r\n System.out.print(\"Inserte su numero de cedula: \");\r\n setNumeroId(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Nombre: \");\r\n setNombre(entrada.nextLine());\r\n System.out.print(\"Inserte su Primer Apellido: \");\r\n setPrimerApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su Segundo Apellido: \");\r\n setSegundoApellido(entrada.nextLine());\r\n System.out.print(\"Inserte su edad: \");\r\n setEdad(Integer.parseInt(entrada.nextLine()));\r\n System.out.print(\"Inserte su peso: \");\r\n setPeso(Float.valueOf(entrada.nextLine()));\r\n \r\n }", "public void setCantidad(java.lang.Integer cantidad) {\r\n this.cantidad = cantidad;\r\n }", "private void esqueceu() {\n\n //Declaração de Objetos\n Veterinario veterinario = new Veterinario();\n\n //Declaração de Variaveis\n int crmv;\n String senha;\n\n //Atribuição de Valores\n try {\n crmv = Integer.parseInt(TextCrmv.getText());\n senha = TextSenha.getText();\n \n //Atualizando no Banco\n veterinario.Vdao.atualizarAnimalSenhaPeloCrmv(senha, crmv);\n \n } catch (NumberFormatException ex) {\n JOptionPane.showMessageDialog(null, \"APENAS NUMEROS NO CRMV!\");\n }\n JOptionPane.showMessageDialog(null, \"SUCESSO AO ALTERAR SENHA!\");\n\n }", "public void inseriPessoa() throws IOException {\n\t\tString r;\n\t\tvetPessoas[nPessoas] = new Pessoa();\n\t\tSystem.out.println(\"Inseri o nome \");\n\t\tr = EntradaTeclado.leString();\n\t\tvetPessoas[nPessoas].setNome(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Cpf \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setCpf(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Endereco \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEndereco(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Email \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEmail(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Data de Nascimento fomanto (dd/mm/aaaa)\");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setDataNascimento(r);\n\t\t\n\t\tSystem.out.println(\"Inseri o Estado Civil \");\n\t\tr = EntradaTeclado.leString();\n\t\tthis.vetPessoas[this.nPessoas].setEstadoCivil(r);\n\t\t\n\t\tthis.nPessoas+=1;\n\t}", "@Test\n public void testInsertarNota() {\n System.out.println(\"insertarNota\");\n String tipoNota = \"\";\n Double nota = null;\n Alumno instance = null;\n instance.insertarNota(tipoNota, nota);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public void setCantidadFaltanteAnunciado(java.math.BigInteger param){\n \n this.localCantidadFaltanteAnunciado=param;\n \n\n }", "public void setC_POSDocType_ID (int C_POSDocType_ID)\n{\nif (C_POSDocType_ID < 1) throw new IllegalArgumentException (\"C_POSDocType_ID is mandatory.\");\nset_ValueNoCheck (COLUMNNAME_C_POSDocType_ID, Integer.valueOf(C_POSDocType_ID));\n}", "public void LimpiarCampos(){\n txtNombre.setText(\"\");\n txtCantidad.setText(\"0\");\n txtMora.setText(\"0\");\n txtDescuento.setText(\"0\");\n this.IDactual=0;\n this.modo=\"agregar\";\n }", "@Test\n\tpublic void testSet_Out_Range() {\n\t\t try {\n\t\t\t SET setarray= new SET( new int[]{-1,1002});\n\t\t }\n\t\t catch (Exception e) {\n\t\t\t assertEquals(\"Value out of range\", e.getMessage());\n\t\t }\n\t}", "public void setM_Inventory_ID (int M_Inventory_ID)\n{\nif (M_Inventory_ID <= 0) set_Value (\"M_Inventory_ID\", null);\n else \nset_Value (\"M_Inventory_ID\", new Integer(M_Inventory_ID));\n}", "public void cargarNotas() {\n\n notas.add(null);\n notas.add(null);\n notas.add(null);\n\n int nota, cont = 0;\n for (int i = 0; i <= 2; i++) {\n\n System.out.println(\"Indique nota \" + (i + 1));\n nota = leer.nextInt();\n notas.set(cont, nota);\n cont++;\n\n }\n\n cont = 0;\n\n }", "public void setCantidadCUVErrado(java.math.BigInteger param){\n \n this.localCantidadCUVErrado=param;\n \n\n }", "public void CadastarNotas(NotasBean nb) {\r\n\r\n\t\tString sql = \"INSERT INTO notas(idNota,nota,idAluno,idProfessor,idMateria) VALUES (?,?,?,?,?)\";\r\n\t\ttry {\r\n\t\t\tPreparedStatement pstmt = this.conexao.prepareStatement(sql);\r\n\t\t\tpstmt.setInt(1, nb.getIdAluno());\r\n\t\t\tpstmt.setDouble(2, nb.getNota());\r\n\t\t\tpstmt.setInt(3, nb.getIdAluno());\r\n\t\t\tpstmt.setInt(4, nb.getIdProfessor());\r\n\t\t\tpstmt.setInt(5, nb.getIdMateria());\r\n\t\t\tpstmt.execute();\r\n\t\t\tpstmt.close();\r\n\t\t} catch (Exception e) {\r\n\t\t\tJOptionPane.showMessageDialog(null, \"Falha ao cadastrar um registro na tabela notas\");\r\n\t\t}\r\n\t}", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }", "public void setUsuarioInsercion(String p) { this.usuarioInsercion = p; }", "public static void IngresoDatos(){\n int IFila=0,ICol=0;\n int INota;\n for(IFila=0;IFila<10;IFila++)\n {\n StrNotas[IFila][0]=JOptionPane.showInputDialog(null, \"Ingrse nombre del alumno:\");\n INota=LlenadoRandom(0,100);\n StrNotas[IFila][1]=Integer.toString(INota);\n if(INota<61)\n StrNotas[IFila][2]=\"Perdio\";\n else\n StrNotas[IFila][2]=\"gano\";\n }\n }", "@Override\n\tpublic void setValues(Factura factura, PreparedStatement ps) throws SQLException {\n\t\tps.setInt(1, factura.getNumero());\n\t\tps.setString(2, factura.getConcepto());\n\t\tps.setDouble(3, factura.getImporte());\n\t\t\n\t}", "public void setNumeroInicial(int numeroInicial)\r\n/* 185: */ {\r\n/* 186:198 */ this.numeroInicial = numeroInicial;\r\n/* 187: */ }", "public void setNumeroAsientosPorFila(int nuevoNumAsientosFila) {\n\t\tnumeroDeAsientosPorFila = nuevoNumAsientosFila;\n\t}", "@Test(expected = IllegalArgumentException.class)\n public void testGetPropertyValueSetEmptyPropertyName1(){\n List<User> list = toList(new User(2L), new User(5L), new User(5L));\n CollectionsUtil.getPropertyValueSet(list, \" \", Integer.class);\n }", "public void leerNumero() {\r\n\t\tdo {\r\n\t\t\tnumeroDNI=Integer.parseInt(JOptionPane.showInputDialog(\"Numero de DNI: \"));\r\n\t\t\tSystem.out.println(\"Numero de 8 digitos...\");\r\n\t\t}while(numeroDNI<9999999||numeroDNI>99999999);\r\n\t\tletra=hallarLetra();\r\n\t}", "Aluno(String dataNascimento) {\n this.dataNascimento = dataNascimento;\n }", "public void adicionar() {\n String sql = \"insert into empresa(empresa, cnpj, endereco, telefone, email) values (?,?,?,?,?)\";\n try {\n pst = conexao.prepareStatement(sql);\n pst.setString(1, txtEmpNome.getText());\n pst.setString(2, txtEmpCNPJ.getText());\n pst.setString(3, txtEmpEnd.getText());\n pst.setString(4, txtEmpTel.getText());\n pst.setString(5, txtEmpEmail.getText());\n // validacao dos campos obrigatorios\n if ((txtEmpNome.getText().isEmpty()) || (txtEmpCNPJ.getText().isEmpty())) {\n JOptionPane.showMessageDialog(null, \"Preencha todos os campos obrigatórios\");\n } else {\n //a linha abaixo atualiza a tabela usuarios com os dados do formulario\n // a esttrutura abaixo confirma a inserção na tabela\n int adicionado = pst.executeUpdate();\n if (adicionado > 0) {\n JOptionPane.showMessageDialog(null, \"Empresa adicionada com sucesso\");\n txtEmpNome.setText(null);\n txtEmpEnd.setText(null);\n txtEmpTel.setText(null);\n txtEmpEmail.setText(null);\n txtEmpCNPJ.setText(null);\n }\n }\n\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, e);\n }\n }", "public void ingresar(double cantidad) throws Exception {\r\n if (cantidad < 0) {\r\n throw new Exception(\"No se puede ingresar una cantidad negativa\");\r\n }\r\n setSaldo(getSaldo() + cantidad);\r\n }", "public void setVoid_Inventory_ID (int Void_Inventory_ID)\n{\nif (Void_Inventory_ID <= 0) set_Value (\"Void_Inventory_ID\", null);\n else \nset_Value (\"Void_Inventory_ID\", new Integer(Void_Inventory_ID));\n}", "public void setCodigo(int Codigo)\r\n {\r\n try\r\n {\r\n this.Codigo = Codigo;\r\n }catch(NumberFormatException e)\r\n {\r\n JOptionPane.showMessageDialog(null, e.toString());\r\n }\r\n \r\n \r\n }", "@Test\n public void nao_deve_aceitar_descricao_com_numeros() {\n telefone.setDescricao(random(10, true, true));\n assertFalse(isValid(telefone, \"A descrição não pode conter acentos, caracteres especiais e números.\", Find.class));\n }", "public void prepararPago(){\n pago = (float) 0.00;\n nuevoSaldo = (float) 0.00;\n intereses = (float) 0.00;\n mora = (float) 0.00;\n pagoValido = false;\n }", "public telefono(){\n this.telefono =\"00000000\";\n this.saldo = 0.0;\n this.marca= \"Sin Marca\";\n }", "public void insertar(String dato){\r\n \r\n if(estaVacia()){\r\n \r\n primero = new NodoJugador(dato);\r\n }else{\r\n NodoJugador temporal = primero;\r\n while(temporal.getSiguiente()!=null){\r\n temporal = temporal.getSiguiente();\r\n }\r\n \r\n temporal.setSiguiente(new NodoJugador(dato));\r\n }\r\n }", "public Integer inserir(String tabela, ArrayList<String> campos, ArrayList<String> valores);", "public void setTitolo(String titolo) {\n if (titolo == null) {\n System.out.println(\"Hai inserito un titolo errato!!\");\n } else {\n this.titolo = titolo;\n }\n }", "private void insertar() {\n String nombre = edtNombre.getText().toString();\n String telefono = edtTelefono.getText().toString();\n String correo = edtCorreo.getText().toString();\n // Validaciones\n if (!esNombreValido(nombre)) {\n TextInputLayout mascaraCampoNombre = (TextInputLayout) findViewById(R.id.mcr_edt_nombre_empresa);\n mascaraCampoNombre.setError(\"Este campo no puede quedar vacío\");\n } else {\n mostrarProgreso(true);\n String[] columnasFiltro = {Configuracion.COLUMNA_EMPRESA_NOMBRE, Configuracion.COLUMNA_EMPRESA_TELEFONO\n , Configuracion.COLUMNA_EMPRESA_CORREO, Configuracion.COLUMNA_EMPRESA_STATUS};\n String[] valorFiltro = {nombre, telefono, correo, estado};\n Log.v(\"AGET-ESTADO\", \"ENVIADO: \" + estado);\n resultado = new ObtencionDeResultadoBcst(this, Configuracion.INTENT_EMPRESA_CLIENTE, columnasFiltro, valorFiltro, tabla, null, false);\n if (ID.isEmpty()) {\n resultado.execute(Configuracion.PETICION_EMPRESA_REGISTRO, tipoPeticion);\n } else {\n resultado.execute(Configuracion.PETICION_EMPRESA_MODIFICAR_ELIMINAR + ID, tipoPeticion);\n }\n }\n }", "@Test(timeout = 4000)\n public void test115() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\" DEFAULT \");\n DefaultDBColumn defaultDBColumn0 = null;\n try {\n defaultDBColumn0 = new DefaultDBColumn(\"&,%da8$gQuP-Y,i\", defaultDBTable0, 3393, \"(org.apache.derby.impl.store.raw.data.ContainerHandleActionOnCommit)\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"org.apache.derby.impl.store.raw.data.ContainerHandleActionOnCommit\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "public ModificarVenta() {\n initComponents();\n txt_boletas.setValue((long)0);\n txt_transbank.setValue((long)0);\n txt_total.setValue((long)0);\n \n }", "@Test(timeout = 4000)\n public void test22() throws Throwable {\n NaiveBayesMultinomialText naiveBayesMultinomialText0 = new NaiveBayesMultinomialText();\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"8[n4t6W3u@is@hW\";\n stringArray0[1] = \"-P\";\n stringArray0[2] = \"\\tThe number of date attributes (default 0).\";\n try { \n naiveBayesMultinomialText0.setOptions(stringArray0);\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"\\tThe number of date attributes (default 0).\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "public void LimpiarCampos() {\n\n txtIdAsignarPer.setText(\"\");\n txtNombreusu.setText(\"\");\n pswConfCont.setText(\"\");\n combPerf.setSelectedItem(\"\");\n pswContra.setText(\"\");\n txtDocumento.setText(\"\");\n }", "@Test(timeout = 4000)\n public void test117() throws Throwable {\n DefaultDBTable defaultDBTable0 = new DefaultDBTable(\" DEFAULT \");\n DefaultDBColumn defaultDBColumn0 = null;\n try {\n defaultDBColumn0 = new DefaultDBColumn(\"&,%da8$gQuP-Y,i\", defaultDBTable0, 3393, \"(org.apache.derby.impl.store.raw.data.ContainerHandleActionOnCommit, , , , , , , , , , , , , , )\");\n fail(\"Expecting exception: NumberFormatException\");\n \n } catch(NumberFormatException e) {\n //\n // For input string: \\\"org.apache.derby.impl.store.raw.data.ContainerHandleActionOnCommit\\\"\n //\n verifyException(\"java.lang.NumberFormatException\", e);\n }\n }", "@Test(expectedExceptions=NumberFormatException.class)\r\n\tpublic void chkNumberFrmtExcep(){\r\n\t\tString x=\"100A\";\r\n\t\tint f=Integer.parseInt(x);//it will throw exception bcoz x=100A, if it is 100 it will not throw exception\r\n\t}", "public int InsertarAnuncioTematico(AnuncioTematicoDTO anuncio){\n int status=0;\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is); \n PreparedStatement ps= conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioTematico\"));\n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2, anuncio.getTitulo());\n ps.setString(3, anuncio.getCuerpo());\n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n ps.setDate(4, fechaPublicacion);\n ps.setString(5, anuncio.getPropietario().getEmail());\n ps.setString(6, anuncio.getEstadoAnuncio().toString());\n String intereses=\"\"; \n \n for(String interes : anuncio.getTemas()){\n intereses+=interes.toLowerCase()+\",\";\n }\n \n if(intereses.length()>0){\n \n intereses=intereses.substring(0,intereses.length()-1);\n }\n \n ps.setString(7, intereses);\n\n status=ps.executeUpdate();\n\n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n\n }catch(Exception e){\n e.printStackTrace();\n }\n return status;\n }", "public int pedirNIF(){\n int NIF = 0;\n boolean validado = false;\n do{\n System.out.println(\"Introduce la NIF:\");\n try {\n NIF = Integer.parseInt(lector.nextLine());\n validado = true;\n\n if(NIF <= 0){\n validado = false;\n System.out.println(\"El NIF no puede ser un numero negativo\");\n }\n }catch (NumberFormatException nfe){\n System.out.println(\"Por favor, introduce un numero.\");\n }\n\n }while(!validado);\n return NIF;\n }", "public BadTrackingNumberFormatException(){\n super(\"That tracking number is not correct.\");\n }", "public void setDia(int dia){\n if(dia > 31 || dia < 0){\n System.out.println(\"Dia inválido\");\n }else {\n this.dia = dia;\n }\n }", "public void setPeti_numero(java.lang.Long newPeti_numero);", "public void setPeti_numero(java.lang.Long newPeti_numero);", "public String InsertarAnuncioGeneral(AnuncioGeneralDTO anuncio){\n int status=0;\n String message=\"Funciona bien\";\n try{\n Connection conect = getConection();\n Properties sqlProp = new Properties();\n InputStream is = new FileInputStream(sqlPropertiesPath);\n sqlProp.load(is);\n PreparedStatement ps = conect.prepareStatement(sqlProp.getProperty(\"insertar.AnuncioGeneral\"));\n \n ps.setString(1, anuncio.getTipoAnuncio().toString());\n ps.setString(2,anuncio.getTitulo());\n ps.setString(3,anuncio.getCuerpo());\n \n java.sql.Date fechaPublicacion=new java.sql.Date(anuncio.getFechaPublicacion().getTime());\n // DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss dd/MM/yyyy\");\n // String fecha = dateFormat.format(anuncio.getFechaPublicacion());\n // java.sql.Date fechaPublicacion=new java.sql.Date(dateFormat.parse(fecha).getTime());\n ps.setDate(4, fechaPublicacion);\n message=\"Cargo bien la fecha\";\n ps.setString(5,anuncio.getPropietario().getEmail());\n ps.setString(6,anuncio.getEstadoAnuncio().toString());\n status=ps.executeUpdate();\n\n \n int idAnuncio=GetMaxID();\n for(Contacto c : anuncio.getDestinatarios()){\n PreparedStatement psDestinatario=conect.prepareStatement(sqlProp.getProperty(\"insertar.Destinatario\"));\n psDestinatario.setInt(1, idAnuncio);\n psDestinatario.setString(2, c.getEmail());\n psDestinatario.executeUpdate();\n }\n message=\"funciona bien\";\n }catch(Exception e){\n e.toString();\n }\n\n return message;\n }", "public static void OrdenarNumeros(){\n\t\t//Variables\n\t\tint a;\n\t\tint b;\n\t\tint c;\n\t\tString tomar;\n\n\t\tScanner reader = new Scanner(System.in);\n\t\tSystem.out.println(\"Ingrese tres numeros numero\");\n\t\ta=reader.nextInt();\n\t\tb=reader.nextInt();\n\t\tc=reader.nextInt();\n\t\tif(a>b && b>c){\n\t\t\tTexto=a+\",\"+b+\",\"+c;\n\t\t}else if(a>c && c>b){\n\t\t\tTexto=a+\",\"+c+\",\"+b;\n\t\t}else if(b>a && a>c){\n\t\t\tTexto=b+\",\"+a+\",\"+c;\n\t\t}else if(b>c && c>a){\n\t\t\tTexto=b+\",\"+c+\",\"+a;\n\t\t}else if(c>a && a>b){\n\t\t\tTexto=c+\",\"+a+\",\"+b;\n\t\t}else if(c>b && b>a ){\n\t\t\tTexto=c+\",\"+b+\",\"+a;\n\t\t}\n\t\tSystem.out.println(Texto);\n\t\tSystem.out.println(\"Desea regresar al menu anterior?\");\n\t\treader.nextLine();\n\t\ttomar=reader.nextLine();\n\t\tif(tomar.equals(\"si\")){\n\t\t\trepetidor=true;\n\t\t}else{\n\t\t\trepetidor=false;\n\t\t}\n\t}", "public void setDocumentNo (String DocumentNo)\n{\nif (DocumentNo == null) throw new IllegalArgumentException (\"DocumentNo is mandatory\");\nif (DocumentNo.length() > 30)\n{\nlog.warning(\"Length > 30 - truncated\");\nDocumentNo = DocumentNo.substring(0,30);\n}\nset_Value (\"DocumentNo\", DocumentNo);\n}", "public void setSeccion(Integer seccion) {\r\n this.seccion = seccion;\r\n }", "private boolean camposNumCorrectos() {\n\t\t return Utilidades.isPositiveNumber(anioText.getText().trim());\n\t}", "private void limpiarCampos() {\n campoNombre.setText(\"\");\n campoNumLibro.setText(\"\");\n campoNumPagina.setText(\"\");\n }", "public void ingresarNumero() {\n do {\r\n System.out.print(\"\\nIngrese un numero entre 0 y 100000: \");\r\n numero = teclado.nextInt();\r\n if (numero < 0 || numero > 100000){\r\n System.out.println(\"Error, rango invalido. Intentelo de nuevo.\");\r\n }\r\n } while(numero < 0 || numero > 100000);\r\n contarDigitos(numero); //el numero ingresado se manda como parametro al metodo\r\n menu();\r\n }", "@Override\n\tpublic void set(Medicamento novo) {\n\t\t\n\n\t\t\tcon = ConexaoSingleton.getInstance();\n\t\t\ttry {\n\t\t\t\tpst = con.prepareStatement(\"INSERT INTO Medicamento (nome,mg) VALUES (?,?)\");\n\t\t\t\tpst.setString(1, novo.getDesc());\n\t\t\t\tpst.setDouble(2, novo.getmg());\n\t\t\t\tpst.execute();\n\t\t\t}catch (SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t}" ]
[ "0.625907", "0.6157341", "0.57983637", "0.5680758", "0.5677278", "0.5592303", "0.55823994", "0.5582036", "0.5576092", "0.5493746", "0.54795814", "0.54293394", "0.5421777", "0.5410041", "0.5407452", "0.5397092", "0.5395663", "0.5393432", "0.5386172", "0.5350108", "0.5348963", "0.5335304", "0.53141636", "0.5309958", "0.5269477", "0.525506", "0.5248554", "0.5233579", "0.5229597", "0.52207714", "0.5216058", "0.5214549", "0.52086216", "0.5183107", "0.51637536", "0.5159861", "0.51587045", "0.5157993", "0.5129752", "0.5127194", "0.51090074", "0.51089865", "0.5108055", "0.5103908", "0.50923806", "0.50920707", "0.50899315", "0.508792", "0.5087317", "0.50863534", "0.5080468", "0.50774896", "0.50723404", "0.507108", "0.5069903", "0.5067231", "0.50479484", "0.50462574", "0.50436074", "0.5042487", "0.50379944", "0.50379944", "0.50360566", "0.50270844", "0.5023691", "0.5019945", "0.50081", "0.5005137", "0.4996451", "0.49920696", "0.499157", "0.4990811", "0.4988143", "0.4981981", "0.49813005", "0.49786353", "0.49773195", "0.49737185", "0.49611816", "0.49587834", "0.49519882", "0.49469364", "0.49428868", "0.49405143", "0.49403787", "0.49369958", "0.49339113", "0.4930369", "0.49246424", "0.49239457", "0.4921484", "0.4921484", "0.49212015", "0.49195462", "0.4915255", "0.4914194", "0.491391", "0.49080107", "0.4905075", "0.49038807" ]
0.59875643
2
metodo Get para obtener los datos de NoElises
public int GetNoElises(){ return NoElises; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getRazonNoData(){\n mRazonNoData = estudioAdapter.getListaRazonNoDataSinEnviar();\n //ca.close();\n }", "public abstract List<GnNotaria> getAllGnNotaria() throws Exception;", "@Override\n\tpublic List<Nodo> obtenerNodos() {\n\t\treturn nodos;\n\t}", "public static List<Noeud> getNoeud() {\n\n Noeud Noeud1 = new Noeud(\"Entree\");\n Noeud Noeud2 = new Noeud(\"Accueil\");\n Noeud Noeud3 = new Noeud(\"Urgences\");\n Noeud Noeud4 = new Noeud(\"Séjour\");\n Noeud Noeud5 = new Noeud(\"Consultation\");\n Noeud Noeud6 = new Noeud(\"Imagerie\");\n Noeud Noeud7 = new Noeud(\"Ophtalmologie\");\n Noeud Noeud8 = new Noeud(\"Pharmacie\");\n Noeud Noeud9 = new Noeud(\"Local\");\n Noeud Noeud10 = new Noeud(\"Oncologie\");\n Noeud Noeud11 = new Noeud(\"LongSejour\");\n Noeud Noeud12 = new Noeud(\"Ambulatoire\");\n Noeud Noeud13 = new Noeud(\"EscalierBas\");\n Noeud Noeud14 = new Noeud(\"EscalierHaut\");\n\n ListeNoeud.add(Noeud1);\n ListeNoeud.add(Noeud2);\n ListeNoeud.add(Noeud3);\n ListeNoeud.add(Noeud4);\n ListeNoeud.add(Noeud5);\n ListeNoeud.add(Noeud6);\n ListeNoeud.add(Noeud7);\n ListeNoeud.add(Noeud8);\n ListeNoeud.add(Noeud9);\n ListeNoeud.add(Noeud10);\n ListeNoeud.add(Noeud11);\n ListeNoeud.add(Noeud12);\n ListeNoeud.add(Noeud13);\n ListeNoeud.add(Noeud14);\n return ListeNoeud;\n }", "@RequestMapping(value = \"/lotes/lotesDisponiveis\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Lote> getAllLotesDisponiveis() {\n log.debug(\"REST retorna todos os lotes com situacao disponivel\");\n SituacaoLote situacao = situacaoLote.findOne(1L);\n return loteService.findBySituacaoLoteIs(situacao);\n }", "@Override\n\tpublic List<Map<String, String>> getData() throws Exception{\n\t\tqueryForList(\"\", null);\n\t\treturn null;\n\t}", "@Override\r\n\tpublic List<Ngo> getAll() {\n\t\treturn null;\r\n\t}", "public List<DocumentoVinculadoDTO> getListaNoEspecifico() {\n System.out.println(\"entrei getListaNoEspecifico \");\n listar1Produto();\n return listaNoEspecifico;\n }", "@Override\r\n\tpublic NoticeVO read(int no) {\n\t\treturn sqlSession.selectOne(namespace + \".read\", no);\r\n\t}", "@RequestMapping(value = \"/tiposdiscapacidad/\", \n\t method = RequestMethod.GET, \n\t headers=\"Accept=application/json\"\n\t ) \n\tpublic List<TipoDiscapacidad> getTipos(){\n\t\treturn tipoDiscapacidadRepository.findAll();\n\t}", "@Override\r\npublic List<Map<String, Object>> readAll() {\n\treturn detalle_pedidoDao.realAll();\r\n}", "public void Get() { ob = ti.Get(currentrowi, \"persoana\"); ID = ti.ID; CNP = ob[0]; Nume = ob[1]; Prenume = ob[2]; }", "Object getDados(long id);", "public List<Noeud> getNoeuds()\t{\r\n \treturn new LinkedList<Noeud>(this.noeuds.values());\r\n }", "private void getObsequios(){\n mObsequios = estudioAdapter.getListaObsequiosSinEnviar();\n //ca.close();\n }", "@Override\r\npublic Detalle_pedido read(int id) {\n\treturn detalle_pedidoDao.read(id);\r\n}", "@GET\n\t@Path(\"/\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic List<Tela> getTelas(){\n\t\treturn new TelaDAO().readAllTelas();\n\t}", "public ArrayList<L3_D4_Noeud> getNoeuds() {\n return noeuds;\n }", "@Override\n\tpublic List<Nota> getListNotas(int userid)\n\t{\n\t\tList<Nota> listnotas= null; //new ArrayList<Usuario>();\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tTransaction transaction = null;\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\t\t\tlistnotas = session.createQuery(\"FROM Nota where Usuario_userid = '\" +userid+\"'\").list();\n \t\t\t\n\t\t\ttransaction.commit();\n\t\t\t\n\t\t} catch (HibernateException e) {\n\t\t\ttransaction.rollback();\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint i = 0;\n\t\twhile(i<listnotas.size())\n\t\t{\n\t\t\tSystem.out.println(\"*\" + listnotas.get(i).getIdNota() );\n\t\t\ti++;\n\t\t}\n\t\treturn listnotas;\n\t}", "Reserva Obtener();", "private No<T> getNo(int index){\n validaIndice(index);\n No<T> noAuxiliar = referenciaEntrada;\n No<T> noRetorno = null;\n for(int i =0; i <= index ; i++){\n noRetorno = noAuxiliar;\n noAuxiliar = noAuxiliar.getProximoNo();\n }\n return noRetorno;\n }", "@GET\n\t@Produces({ MediaType.APPLICATION_JSON })\n\tpublic Response getTipos() {\n\t\tRotondAndesTM tm = new RotondAndesTM(getPath());\n\t\tList<Tipo> Tipos;\n\t\ttry {\n\t\t\tTipos = tm.darTipos();\n\t\t} catch (Exception e) {\n\t\n\t\t\treturn Response.status(500).entity(doErrorMessage(e)).build();\n\t\t}\n\t\treturn Response.status(200).entity(Tipos).build();\n\t}", "@Override\n\tpublic List<OaAutoInfo> getDataList() throws Exception {\n\t\treturn null;\n\t}", "public NodoListaObjetos getSiguiente(){\r\n return siguiente;\r\n }", "public static List<PolovniAutomobili> readAll() {\n List<PolovniAutomobili> listaUsera = new ArrayList<>();\n try {\n CONNECTION = DriverManager.getConnection(URL, USERNAME, PASSWORD);\n String query = \"SELECT * FROM polovni WHERE 1\";\n try (Statement st = (Statement) CONNECTION.createStatement()) {\n ResultSet rs = st.executeQuery(query);\n while (rs.next()) {\n String imgUrl = rs.getString(\"imgUrl\");\n String naziv = rs.getString(\"naziv\");\n int godiste = rs.getInt(\"godiste\");\n int cena = rs.getInt(\"cena\");\n String url = rs.getString(\"url\");\n listaUsera.add(new PolovniAutomobili(imgUrl, naziv, godiste,cena,url));\n }\n }\n CONNECTION.close();\n } catch (SQLException ex) {\n System.out.println(\"MySql Connection error...\");\n ex.printStackTrace();\n }\n return listaUsera;\n }", "public List<Ejemplar> getAll();", "public List<SiteNoticia> listarPorData() {\n List<SiteNoticia> result = new ArrayList<SiteNoticia>();\n EntityManager em1 = getEM();\n em1.getTransaction().begin();\n CriteriaBuilder builder = em1.getCriteriaBuilder();\n CriteriaQuery query = builder.createQuery(SiteNoticia.class);\n //EntityType type = em1.getMetamodel().entity(SiteNoticia.class);\n Root root = query.from(SiteNoticia.class);\n query.orderBy(builder.desc(root.get(\"hora2\")));\n result = em1.createQuery(query).getResultList();\n em1.close();\n return result;\n }", "@Named(\"Notas\")\n\t@Render(Type.EAGERLY)\n\t@Disabled\n\t@MemberOrder(sequence = \"10\")\n\t@MultiLine(numberOfLines = 10)\n\t\n\tpublic List<Nota> getAllNotas() {\n\t\treturn notaRepositorio.listar();\n\t}", "@GetMapping(\"/jelos\")\n @Timed\n public List<Jelo> getAllJelos() {\n log.debug(\"REST request to get all Jelos\");\n return jeloRepository.findAll();\n }", "public List<LocoDataFois> getdata(LocoDataFois unlocos) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\tSystem.out.println(\"getuncleasedlocos\");\n\t\t\tint locono= unlocos.getLoco_No();\n\t\t\tList<LocoDataFois> locos= new ArrayList<>();\n\t\t\tobj_uncleansedrepo.getallLocodata(locono)\n\t\t\t.forEach(locos::add);\t\t\n\t\t\tif(locos.isEmpty()) {\n\t\t\t\treturn locos ;\n\t\t\t}\n\t\t\telse\n\t\t\t\tSystem.out.println(\"data\" +locos);\n\t\t\t\treturn locos;\n\t\t\t\n\t\t\n\t\t}", "@Override\n\tpublic DatosNit obtenerDatos(DatosNit datos) {\n\t\tnit = datos.getNit();\n\t\treturn null;\n\t}", "List<Especialidad> getEspecialidades();", "public Nodo getNodoDerecho(){\n return der;\n }", "private List<Object[]> getModelo() throws Exception {\n\t\treturn getModelo(null);\n\t}", "public int getAyudantes(){\n return ayudantes; \n }", "public ArrayList<Note> pedirTodasLasNotas(){\n ArrayList<Note> todasLasNotas = new ArrayList<>();\n Note nota;\n HashMap<Integer,String> misNotas = new HashMap<Integer,String>();\n ArrayList<String> tituloTratamiento = new ArrayList<String>();\n String[] campos = {\"_id\",\"titulo\",\"fecha\"};\n Cursor c = db.query(\"nota\",campos,null,null,null,null,null);\n if(c.moveToFirst()){\n\n do{\n nota = new Note();\n nota.setId(c.getInt(0));\n nota.setTitulo(c.getString(1));\n nota.setFechaFormateada(c.getString(2));\n todasLasNotas.add(nota);\n }while(c.moveToNext());\n return todasLasNotas;\n }\n\n return todasLasNotas;\n\n }", "@Override\n\t\tpublic Nota getNota(int notaid) {\n\n\t\t\tNota nota = null;\n\t\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\t\tTransaction transaction = null;\n\n\t\t\ttry {\n\t\t\t\ttransaction = session.beginTransaction();\n\t\t\t\tQuery query = session.createQuery(\"from Nota where NOTAS_ID = ' \"\n\t\t\t\t\t\t+ notaid + \"'\");\n\t\t\t\tSystem.out.println(query);\n\t\t\t\tnota = (Nota) query.uniqueResult();\n\t\t\t\t\n\t\t\t\tif (nota != null) {\n\t\t\t\t\ttransaction.commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//System.out.println(\"EEEEEEEEOOOOOOOOOO\");\n\t\t\t\tSystem.out.println(nota.getNota());\n\n\t\t\t} catch (HibernateException e) {\n\t\t\t\ttransaction.rollback();\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tsession.close();\n\t\t\t}\n\t\t\treturn nota;\n\t\t}", "@Override\n\tpublic TradeVO get(int no) {\n\t\treturn dao.get(no);\n\t}", "@GET\r\n public List<DocumentoDTO> obtenerDocumento(){\r\n List<DocumentoEntity> documento= logic.obtenerDocumento(); \r\n return DocumentoDTO.toZooList(documento);\r\n }", "public String obtenerDetalles(){\r\n return \"Nombre: \" + this.nombre + \", sueldo = \" + this.sueldo;\r\n }", "public int getDato() {\r\n return dato;\r\n }", "@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Curso.findAll\", null);\n }", "public List<Tipousr> findAllTipos(){\n\t\t List<Tipousr> listado;\n\t\t Query q;\n\t\t em.getTransaction().begin();\n\t\t q=em.createQuery(\"SELECT u FROM Tipousr u ORDER BY u.idTipousr\");\n\t\t listado= q.getResultList();\n\t\t em.getTransaction().commit();\n\t\t return listado;\n\t\t \n\t\t}", "public ArrayList<Articulo> dameArticulo(){\n\t\t\n\t\t\n\t\treturn null;\n\t}", "public List<NodoRuta> getElementos() { \n \n return new ArrayList<NodoRuta>(nodos);\n }", "public List<Arresto> getArresto(String dni);", "public List<Modelo> obtenModelos() {\r\n try {\r\n IntAdmInventario adm = new FacAdmInventario();\r\n\r\n return adm.obtenListaModelos();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return null;\r\n }", "@Override\n public Retorno_MsgObj obtenerLista() {\n PerManejador perManager = new PerManejador();\n\n return perManager.obtenerLista(\"Inscripcion.findAll\", null);\n }", "@Override\n\tpublic ArrayList<Domanda> getDomande() {\n\t\tDB db = getDB();\n\t\tArrayList<Domanda> domande = new ArrayList<Domanda>();\n\t\tMap<Long, Domanda> list = db.getTreeMap(\"domande\");\n\t\tfor(Map.Entry<Long, Domanda> domanda : list.entrySet())\n\t\t\tif(domanda.getValue() instanceof Domanda)\n\t\t\t\tdomande.add((Domanda)domanda.getValue());\n\t\treturn domande;\n\t}", "public List<EfectoSimple> getEfectos() {\n\t\tthrow new NotImplementedException();\r\n\t}", "private void listar() throws Exception{\n int resId=1;\n List<PlatoDia> lista = this.servicioRestaurante.listarMenuDia(resId);\n this.modelListEspecial.clear();\n lista.forEach(lse -> {\n this.modelListEspecial.addElement(\"ID: \" + lse.getId() \n + \" NOMBRE: \" + lse.getNombre()\n + \" DESCRIPCION: \" + lse.getDescripcion()\n + \" PRECIO: \" + lse.getPrecio()\n + \" ENTRADA: \"+lse.getEntrada() \n + \" PRINCIPIO: \"+lse.getPrincipio()\n + \" CARNE: \"+lse.getCarne()\n + \" BEBIDA: \"+lse.getBebida()\n + \" DIA: \"+lse.getDiaSemana());\n });\n }", "List<Videogioco> retriveByNome(String nome);", "public LazyDataModel<MotivoLlamadoAtencion> getListaMotivoLlamadoAtencion()\r\n/* 124: */ {\r\n/* 125:131 */ return this.listaMotivoLlamadoAtencion;\r\n/* 126: */ }", "@Override\n\tpublic List<Materia> recuperarTodo() throws DataAccessException {\n\t\treturn null;\n\t}", "public int getIdNoeud() {\n return idNoeud;\n }", "@RequestMapping(value = \"/lotes\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Lote> getAllLotes() {\n log.debug(\"REST request to get all Lotes\");\n return loteService.findAll();\n }", "public List<DaftarhunianDtl> getDaftarhunianDtl(int no) {\n //return daftarhunianDtls.stream().filter(t -> t.getId().equals(id)).findFirst().get();\n String s = String.valueOf(no);\n// String[] as = {s};\n// return daftarhunianDtlRepository.findOne(s); //ambil banyak row: bukan satu row.\n List<DaftarhunianDtl> daftarhunianDtls = new ArrayList<>();\n// daftarhunianDtlRepository.findByNoTrx(as).forEach(daftarhunianDtls::add);\n daftarhunianDtlRepository.findByNoTrx(s).forEach(daftarhunianDtls::add); \n //\n //Query query = createNamedQuery(\"DaftarhunianDtl.findByNoTrx\");\n //\n \n return daftarhunianDtls;\n }", "public Evento getEvento() { \n\t\t Evento evento = new Evento();\n\t\t List<Prenda> Lprendas = new ArrayList<Prenda>();\n\t\t Sugerencia sug = new Sugerencia();\n\t Prenda prend = new Prenda();\n Categoria categoria = new Categoria();\n\n categoria.setCodCategoria(1);\n categoria.setDescripcion(\"Zapatillas\");\n TipoPrenda tp = new TipoPrenda();\n tp.setDescripcion(\"lalal\");\n tp.setCategoria(categoria);\n tp.setCodTipoPrenda(1);\n \n \n Guardarropa guard = new Guardarropa();\n guard.setCompartido(false);\n guard.setDescripcion(\"guardarropa\");\n guard.setId(0); \n prend.setGuardarropa(guard);\n prend.setColorPrimario(\"rojo\");\n prend.setTipoPrenda(tp);\n prend.setColorSecundario(\"azul\");\n prend.setDescripcion(\"prenda 1\");\n prend.setNumeroDeCapa(EnumCapa.Primera);\n \tfor( int i = 0 ; i <= 4; i++) {\n prend.setCodPrenda(i);\n\t\t\tLprendas.add(prend);\t\t\t\n\t\t}\n \tsug.setIdSugerencia(1);\n \tsug.setMaxCapaInferior(0);\n \tsug.setMaxCapaSuperior(2);\t\n \tsug.setUsuario(new Usuario());\n \tsug.setListaPrendasSugeridas(Lprendas);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n \tevento.AgregarSugerenciaAEvento(sug);\n\n \t return evento;\n\t }", "@GetMapping\n public List<Tipovehiculo>listar(){\n return service.listar();\n }", "public List<? extends OggettoCeleste> read(OggettoCeleste oggetto) throws SQLException, DAOException {\n\t\tthrow new DAOException(\"Not implemented\");\n\t}", "public ObservableList<Cliente> getClienteData() {\r\n return clienteData;\r\n }", "private List<Arbeitspaket> retrieveData() {\r\n\t\treturn Arrays.asList(new Arbeitspaket(\"A\", 0, 0, 0, 0, 0, 0, 0), new Arbeitspaket(\"B\", 0, 0, 0, 0, 0, 0, 0),\r\n\t\t\t\tnew Arbeitspaket(\"C\", 0, 0, 0, 0, 0, 0, 0), new Arbeitspaket(\"D\", 0, 0, 0, 0, 0, 0, 0));\r\n\t}", "public List<FornecedorResource> getListaFornecedores()\r\n {\r\n return fornecedorBusiness.listarFornecedores();\r\n }", "@GET\n public List<TrayectoDetail> darTrayectos() {\n \n List<TrayectoDetail> listaTrayecto = listEntity2DetailDTO(trayectoLogic.getTrayectos());\n LOGGER.log(Level.INFO, \"BookResource getBooks: output: {0}\", listaTrayecto);\n return listaTrayecto;\n }", "public List<PessoasEspacosDeCafe> read() {\n\n Connection con = null;\n\n PreparedStatement stmt = null;\n\n ResultSet rs = null;\n\n List<PessoasEspacosDeCafe> mostrarEspacosDeCafe = new ArrayList<>();\n\n try {\n con = ConnectionFactory.getConnection();\n stmt = con.prepareStatement(\"SELECT * FROM PessoasEspacosDeCafe\");\n rs = stmt.executeQuery();\n\n while (rs.next()) {\n\n PessoasEspacosDeCafe EspacosDeCafeDoBanco = new PessoasEspacosDeCafe();\n\n EspacosDeCafeDoBanco.setPessoasIdPessoas(rs.getInt(\"pessoasIdPessoas\"));\n EspacosDeCafeDoBanco.setEspacosDeCafeIdEspacosDeCafe(rs.getInt(\"espacosDeCafeIdEspacosDeCafe\"));\n mostrarEspacosDeCafe.add(EspacosDeCafeDoBanco);\n\n }\n } catch (SQLException ex) {\n Logger.getLogger(PessoasDAO.class.getName()).log(Level.SEVERE, null, ex);\n } finally {\n ConnectionFactory.closeConnection(con, stmt, rs);\n }\n\n return mostrarEspacosDeCafe;\n\n }", "public List<KodtvaDao> getKoder();", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String obtener() {\n logger.debug(\"Obteniendo todos los equipos\");\n Set<Sala> salas= salaService.buscarTodasLasSalasSimples();\n logger.debug(\"Obtenidas.\");\n Genson genson = new Genson();\n String retorno = genson.serialize(salas);\n logger.debug(retorno);\n return retorno;\n }", "public LinkedList Navegantes () {\r\n LinkedList lista = new LinkedList();\r\n String query = \"SELECT identificacion FROM socio WHERE eliminar = false\";\r\n try {\r\n Statement st = con.createStatement();\r\n ResultSet rs = st.executeQuery(query);\r\n while (rs.next()) { \r\n lista.add(rs.getString(\"identificacion\"));\r\n }\r\n query = \"SELECT identificacion FROM capitan WHERE eliminar = false\";\r\n rs = st.executeQuery(query);\r\n while (rs.next()) { \r\n lista.add(rs.getString(\"identificacion\"));\r\n }\r\n st.close();\r\n rs.close();\r\n } catch (SQLException ex) {\r\n Logger.getLogger(PSocio.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n return lista;\r\n }", "private Dati getDatiRMP() {\n /* variabili e costanti locali di lavoro */\n Dati dati = null;\n Modulo modRMP = RMPModulo.get();\n Modulo modPiatto = PiattoModulo.get();\n Modulo modCategoria = CategoriaModulo.get();\n Query query;\n Filtro filtro;\n\n try { // prova ad eseguire il codice\n\n query = new QuerySelezione(modRMP);\n query.addCampo(modRMP.getCampoChiave());\n query.addCampo(modRMP.getCampo(RMP.CAMPO_PIATTO));\n query.addCampo(modRMP.getCampo(RMP.CAMPO_MENU));\n query.addCampo(modPiatto.getCampo(Piatto.CAMPO_NOME_ITALIANO));\n query.addCampo(modCategoria.getCampo(Categoria.CAMPO_SIGLA));\n filtro = new Filtro();\n filtro.add(this.getFiltroMenu());\n filtro.add(this.getFiltroPiattiComandabili());\n query.setFiltro(filtro);\n dati = modRMP.query().querySelezione(query);\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n /* valore di ritorno */\n return dati;\n }", "private List<PreDocumentoEntrata> getPreDocumentiEntrata() {\t\n\t\tif(req.getRicercaSinteticaPreDocumentoEntrata()!=null){\n\t\t\treturn ricercaSinteticaPreDocumentoEntrata();\n\t\t}\n\t\t\n\t\treturn req.getPreDocumentiEntrata();\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic List<Trainee> getAll() {\n\t\treturn dao.getAll();\r\n\t}", "public List<Tripulante> obtenerTripulantes();", "@Override\n\tpublic List<OaAutoInfo> getDataList(String param) throws Exception {\n\t\treturn null;\n\t}", "@SuppressWarnings({ \"unchecked\", \"static-access\" })\n\t@Override\n\t/**\n\t * Leo todos los empleados.\n\t */\n\tpublic List<Employees> readAll() {\n\t\tList<Employees> ls = null;\n\n\t\tls = ((SQLQuery) sm.obtenerSesionNueva().createQuery(\n\t\t\t\tInstruccionesSQL.CONSULTAR_TODOS)).addEntity(Employees.class)\n\t\t\t\t.list();// no creo que funcione, revisar\n\n\t\treturn ls;\n\t}", "public ArrayList consultarTodo() {\n Cursor cursor = this.myDataBase.rawQuery(\"SELECT des_invfisico_tmp._id,des_invfisico_tmp.cod_ubicacion,des_invfisico_tmp.cod_referencia,des_invfisico_tmp.cod_plu,plu.descripcion FROM des_invfisico_tmp LEFT OUTER JOIN plu ON plu.cod_plu = des_invfisico_tmp.cod_plu \", null);\n ArrayList arrayList = new ArrayList();\n new ArrayList();\n if (cursor.moveToFirst()) {\n do {\n for (int i = 0; i <= 4; ++i) {\n if (cursor.isNull(i)) {\n arrayList.add(\"\");\n continue;\n }\n arrayList.add(cursor.getString(i));\n }\n } while (cursor.moveToNext());\n }\n\n return arrayList;\n }", "List<NovedadAdapter> getAll();", "public List<Aflevering> readAll() {\n List<Aflevering> lijst = new ArrayList<>();\n try {\n ResultSet rs = sqlConnection.executeSql(\"SELECT * FROM AFLEVERING\");\n while(rs.next()) {\n lijst.add(new Aflevering(rs.getString(\"ID\"),\n rs.getString(\"Serie\"),\n rs.getString(\"Seizoen\"),\n rs.getString(\"Titel\"),\n rs.getString(\"Tijdsduur\")));\n }\n }\n catch(Exception e) {\n System.out.println(e);\n }\n return lijst;\n }", "public ArrayList<Note> pedirTodasLasNotasPorTratamiento(int id){\n ArrayList<Note> todasLasNotas = new ArrayList<>();\n Note nota;\n HashMap<Integer,String> misNotas = new HashMap<Integer,String>();\n ArrayList<String> tituloTratamiento = new ArrayList<String>();\n String[] campos = {\"_id\",\"titulo\",\"fecha\"};\n String[] argumentos = {Integer.toString(id)};\n Cursor c = db.query(\"nota\",campos,\"examenAsociado=?\",argumentos,null,null,null);\n if(c.moveToFirst()){\n do{\n nota = new Note();\n nota.setId(c.getInt(0));\n nota.setTitulo(c.getString(1));\n nota.setFechaFormateada(c.getString(2));\n todasLasNotas.add(nota);\n }while(c.moveToNext());\n return todasLasNotas;\n }\n return null;\n }", "public int getNrLoja() {\n return nrLoja;\n }", "public List<Empleado> getAll();", "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 List<Clientes> read(){\n Connection con = ConectionFactory.getConnection();\n PreparedStatement pst = null;\n ResultSet rs = null;\n \n List<Clientes> cliente = new ArrayList<>();\n \n try {\n pst = con.prepareStatement(\"SELECT * from clientes ORDER BY fantasia\");\n rs = pst.executeQuery();\n \n while (rs.next()) { \n Clientes clientes = new Clientes();\n clientes.setCodigo(rs.getInt(\"codigo\"));\n clientes.setFantasia(rs.getString(\"fantasia\"));\n clientes.setCep(rs.getString(\"cep\"));\n clientes.setUf(rs.getString(\"uf\"));\n clientes.setLogradouro(rs.getString(\"logradouro\"));\n clientes.setNr(rs.getString(\"nr\"));\n clientes.setCidade(rs.getString(\"cidade\"));\n clientes.setBairro(rs.getString(\"bairro\"));\n clientes.setContato(rs.getString(\"contato\"));\n clientes.setEmail(rs.getString(\"email\"));\n clientes.setFixo(rs.getString(\"fixo\"));\n clientes.setCelular(rs.getString(\"celular\"));\n clientes.setObs(rs.getString(\"obs\"));\n cliente.add(clientes); \n }\n } catch (SQLException ex) {\n \n }finally{\n ConectionFactory.closeConnection(con, pst, rs);\n }\n return cliente;\n}", "@Override\n\tpublic List<Trainee> getAll() {\n\t\tQuery q=em.createQuery(\"select m from Trainee m\");\n\t\tList<Trainee> l=q.getResultList();\n\t\treturn l;\n\t}", "public List<Evento> getEventos() {\r\n\t\treturn eventos;\r\n\t}", "public int getbno(){\r\n return this.bno;\r\n }", "@RequestMapping(value = \"/obtenerVeredas\", method = RequestMethod.GET)\n\tpublic Iterable<Vereda> obtenerListaVeredas() {\n\t\treturn veredaRepository.findAll();\n\t\t//return JsonManager.toJson(veredaRepository.findAll());\n\t}", "@Override\r\n\tpublic ReviewVO read(int no) {\n\t\treturn sqlSession.selectOne(namespace + \".read\", no);\r\n\t}", "@Override\r\n\tpublic Dinero getDinero() {\n\t\treturn super.getDinero();\r\n\t}", "public List<Usuario> listar() {\n return listaUse;\n }", "public static List<Nota>getAllNota(){\n List <Nota> l = new ArrayList<>();\n for(Nota n : repoNote.findAll()){\n l.add(n);\n }\n\n return l;\n }", "public List<Data> getData() {\n return data;\n }", "@GET\n\t@Path(\"/tipos\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic ArrayList<TipoAutoDTO> listarTipos(){\n\t\tSystem.out.println(\"ini: listarTipos()\");\n\t\t\n\t\tTipoAutoService tipoService = new TipoAutoService();\n\t\tArrayList<TipoAutoDTO> lista = tipoService.ListadoTipoAuto();\n\t\t\n\t\tif (lista == null) {\n\t\t\tSystem.out.println(\"Listado Vacío\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Consulta Exitosa\");\n\t\t}\n\n\t\tSystem.out.println(\"fin: listarTipos()\");\n\t\t\n\t\treturn lista;\n\t}", "@RequestMapping(value = \"/perimetros/\", \n\t method = RequestMethod.GET, \n\t headers=\"Accept=application/json\"\n\t ) \n\tpublic List<PerimetroSensado> getPerimetros(){\n\t\treturn perimetroRepository.findAll();\n\t}", "public int getLoonie () {\n return NLoonie;\n }", "public List<Note> getNotes(){\n return notes;\n }", "String getDataNascimento();", "@GetMapping(\"/huespedes\")\n public List<Huesped> getHuespedes(@RequestParam(value = \"nombre\", required = false) String nombre) {\n List<Huesped> lh;\n\n if (nombre == null) {\n lh = huespedService.buscarTodosOrdenadoPorNombre();\n } else {\n lh = huespedService.buscarTodosPorNombre(nombre);\n }\n\n return lh;\n }", "public ArrayList<KelasDicoding> getListKelas(){ return listKelas; }", "public List<Integer> getNumeroPavimento(int sitioID) {\n List<Integer> listPavimento = new ArrayList<>();\n query = \"SELECT SitioID, Numero FROM SUELO_PavimentoErosion WHERE SitioID= \" + sitioID;\n Connection conn = LocalConnection.getConnection();\n\n try {\n Statement st = conn.createStatement();\n ResultSet rs = st.executeQuery(query);\n while (rs.next()) {\n listPavimento.add(rs.getInt(\"Numero\"));\n }\n } catch (SQLException e) {\n JOptionPane.showMessageDialog(null,\n \"Error! al obtener los numeros de pavimento de erosion \",\n \"Conexion BD\", JOptionPane.ERROR_MESSAGE);\n return null;\n } finally {\n try {\n conn.close();\n } catch (SQLException e) {\n JOptionPane.showMessageDialog(null, \"Error! al cerrar la base de datos en los numeros de pavimento de erosion \", \"Conexion BD\", JOptionPane.ERROR_MESSAGE);\n }\n }\n listPavimento.add(0, null);\n return listPavimento;\n }", "public String getLasagna(){\n return \"ID: \"+this.ID+\"\\nNombre: \"+this.nombre+\"\\nTipo: \"+this.tipo+\"\\nPrecio: \"+this.precio; //Devuelve todos los datos de la lasagna\n }" ]
[ "0.6581226", "0.6283009", "0.6243769", "0.61739856", "0.6020506", "0.59954524", "0.5989481", "0.59541976", "0.5949122", "0.5896577", "0.58808666", "0.58696735", "0.58653843", "0.58570826", "0.5834065", "0.58234096", "0.58123547", "0.5807702", "0.58058566", "0.5801665", "0.5791704", "0.5773887", "0.5772525", "0.57358176", "0.5734652", "0.57329404", "0.57230175", "0.5722865", "0.5711184", "0.5700081", "0.56796616", "0.5667932", "0.56536657", "0.5650488", "0.56501865", "0.56386125", "0.5635672", "0.56303525", "0.56269866", "0.56263256", "0.5621452", "0.56097615", "0.5606664", "0.5604048", "0.5591555", "0.55902773", "0.55805886", "0.5576664", "0.5564975", "0.5558195", "0.5556545", "0.55502284", "0.55487365", "0.5547159", "0.55471206", "0.5546848", "0.5538597", "0.55383056", "0.5519959", "0.5511763", "0.55029833", "0.5501034", "0.5498478", "0.5498182", "0.54953766", "0.5493752", "0.5483323", "0.5483186", "0.5480264", "0.5477978", "0.547533", "0.5474886", "0.5473834", "0.54676914", "0.54674256", "0.5467261", "0.5466078", "0.5458594", "0.545701", "0.5454809", "0.5454018", "0.54441017", "0.5426865", "0.54253954", "0.5416296", "0.5413719", "0.54124707", "0.5411849", "0.5411843", "0.54115117", "0.54115087", "0.5410957", "0.5409462", "0.5408704", "0.54069895", "0.540196", "0.5400754", "0.5400684", "0.53972423", "0.5396487" ]
0.60675913
4
constructor de la clase
public conectar(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Constructor() {\r\n\t\t \r\n\t }", "public Constructor(){\n\t\t\n\t}", "public Clade() {}", "public Pasien() {\r\n }", "public Classe() {\r\n }", "public Carrera(){\n }", "public CyanSus() {\n\n }", "public AntrianPasien() {\r\n\r\n }", "public Alojamiento() {\r\n\t}", "public SlanjePoruke() {\n }", "public Chauffeur() {\r\n\t}", "public Aritmetica(){ }", "public Curso() {\r\n }", "public Lanceur() {\n\t}", "public Corso() {\n\n }", "public Cohete() {\n\n\t}", "public Cgg_jur_anticipo(){}", "public Kullanici() {}", "public Caso_de_uso () {\n }", "public Supercar() {\r\n\t\t\r\n\t}", "private Instantiation(){}", "public Achterbahn() {\n }", "public Trening() {\n }", "public Rol() {}", "public Coche() {\n super();\n }", "public Libro() {\r\n }", "public TTau() {}", "public Odontologo() {\n }", "public prueba()\r\n {\r\n }", "public TCubico(){}", "private TMCourse() {\n\t}", "public PSRelation()\n {\n }", "public Livro() {\n\n\t}", "public Pitonyak_09_02() {\r\n }", "public CSSTidier() {\n\t}", "public Phl() {\n }", "public Vehiculo() {\r\n }", "public Ov_Chipkaart() {\n\t\t\n\t}", "public DetArqueoRunt () {\r\n\r\n }", "public Tigre() {\r\n }", "private BaseDatos() {\n }", "public Troco() {\n }", "public EnsembleLettre() {\n\t\t\n\t}", "public _355() {\n\n }", "public Lotto2(){\n\t\t\n\t}", "public Chick() {\n\t}", "public Postoj() {}", "public OOP_207(){\n\n }", "public Aktie() {\n }", "public Mitarbeit() {\r\n }", "public TebakNusantara()\n {\n }", "protected Asignatura()\r\n\t{}", "public JSFOla() {\n }", "public Propuestas() {}", "public NhanVien()\n {\n }", "public Orbiter() {\n }", "public Corrida(){\n\n }", "public Busca(){\n }", "public Sobre() {\n\t\tsuper();\n\t\tinitialize();\n\t}", "public OVChipkaart() {\n\n }", "public Manusia() {}", "public Carrinho() {\n\t\tsuper();\n\t}", "public Banco(){}", "public Persona() {\n\t}", "public Tarifa() {\n ;\n }", "public SgaexpedbultoImpl()\n {\n }", "public Mannschaft() {\n }", "public Anschrift() {\r\n }", "public Excellon ()\n {}", "public Student(){}", "public Datos(){\n }", "public MorteSubita() {\n }", "public Candidatura (){\n \n }", "public Car(){\n\t\t\n\t}", "public Gasto() {\r\n\t}", "public Aanbieder() {\r\n\t\t}", "public Prova() {}", "public Demo() {\n\t\t\n\t}", "public Exercicio(){\n \n }", "public Venda() {\n }", "defaultConstructor(){}", "public Plato(){\n\t\t\n\t}", "public Respuesta() {\n }", "public Tbdtokhaihq3() {\n super();\n }", "public Persona() {\n }", "public Mueble() {\n }", "public Classroom() {\n\t}", "public Magazzino() {\r\n }", "public Producto() {\r\n }", "public StudentChoresAMImpl() {\n }", "public Persona() {\n \t\n }", "public AllOne() {\n \n }", "public Persona(){\n \n }", "public Persona(){\n \n }", "public CCuenta()\n {\n }", "private SingleObject(){}", "public Data() {\n \n }", "public YonetimliNesne() {\n }", "public Valvula(){}", "public Documento() {\n\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }" ]
[ "0.8238812", "0.7915219", "0.7732909", "0.76823485", "0.7591926", "0.75492096", "0.74967504", "0.74887085", "0.74848735", "0.74786437", "0.74367607", "0.73924965", "0.73894495", "0.7377169", "0.7344392", "0.7342144", "0.7318385", "0.7305079", "0.72876424", "0.7284493", "0.72825325", "0.72812223", "0.7271819", "0.7270579", "0.72679764", "0.72619325", "0.72477114", "0.7233145", "0.7230006", "0.72257656", "0.7210719", "0.7203513", "0.7197356", "0.71913254", "0.71779627", "0.71672744", "0.71468204", "0.71431494", "0.7143095", "0.713633", "0.7122687", "0.7107718", "0.7101966", "0.70993584", "0.7096837", "0.70947146", "0.70725656", "0.70687336", "0.7053991", "0.7049641", "0.70455754", "0.7045338", "0.7043727", "0.7041829", "0.7041411", "0.70405483", "0.70388865", "0.703857", "0.7024111", "0.7019752", "0.7015322", "0.70149493", "0.7008869", "0.7008345", "0.700464", "0.69995344", "0.6997325", "0.699232", "0.69915336", "0.69877636", "0.6984506", "0.69839203", "0.69738615", "0.69689184", "0.6966855", "0.69663155", "0.69574916", "0.6956217", "0.6950771", "0.69436395", "0.6943241", "0.69353545", "0.69329596", "0.6930547", "0.6926216", "0.69180185", "0.69125885", "0.6911045", "0.69100356", "0.68989325", "0.6896882", "0.68874514", "0.688635", "0.688635", "0.68855906", "0.6883278", "0.68768924", "0.68768704", "0.6872307", "0.6871807", "0.6871096" ]
0.0
-1
Rearranges AUs according to the plugin
public static TreeMap<Plugin, TreeSet<ArchivalUnit>> orderAusByPlugin(Collection<ArchivalUnit> allAus) { Iterator itr = allAus.iterator(); TreeMap<Plugin, TreeSet<ArchivalUnit>> ausMap = new TreeMap<Plugin, TreeSet<ArchivalUnit>>(new PluginComparator()); while (itr.hasNext()) { ArchivalUnit au = (ArchivalUnit) itr.next(); Plugin plugin = au.getPlugin(); if (ausMap.containsKey(plugin)) { TreeSet<ArchivalUnit> auSet = (TreeSet) ausMap.get(plugin); auSet.add(au); } else { TreeSet<ArchivalUnit> auSet = new TreeSet<ArchivalUnit>(new AuOrderComparator()); auSet.add(au); ausMap.put(plugin, auSet); } } return ausMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void transformToACORDSimplified(APDataCollection apData) throws APDataCollectionTransformationException {\n\n\t\tlocationAddresses = collectLocationAddresses(apData);\n\n\t\ttransformSymbols(apData);\n\n\t\t// Perform all transformations involving CommlVeh element iteration\n\t\ttransformVehicles(apData);\n\n\t\tmoveVehicleToRateState(apData);\n\t\t\n\t\tupdateBISPLPropDam(apData);\n\t\t\n\t\tsetVehicleUMISPCoverages(apData);\n\t\t\n\t\tsetVehicleMEDPMCoverages(apData);\n\t}", "private void addApartmentNames() {\n apartmentNamesAdapter.clear();\n for (ApartmentNamesInUnivs university : apartmentNamesInUnivs) {\n\n if (university.getUniversityName().equals(universityNamesSpinner.getSelectedItem().toString())) {\n\n for (ApartmentNamesWithType aptName : university.getApartmentNames()) {\n\n if (aptName.getApartmentType().equals(UrlGenerator.getApartmentTypeCodeMap().get(apartmentTypeSpinner.getSelectedItem().toString())))\n\n apartmentNamesAdapter.add(aptName.getApartmentName());\n }\n }\n }\n }", "@Override\n\tpublic void reorganize() {\n\n\t}", "public static TreeMap<String, TreeSet<ArchivalUnit>> orderAusByPublisher(Collection<ArchivalUnit> allAus) {\n Iterator<ArchivalUnit> itr = allAus.iterator();\n TreeMap<String, TreeSet<ArchivalUnit>> ausMap =\n new TreeMap<String, TreeSet<ArchivalUnit>>();\n while (itr.hasNext()) {\n ArchivalUnit au = itr.next();\n String publisher = AuUtil.getTitleAttribute(au, \"publisher\");\n if (publisher == null) {\n publisher = \"unknown publisher\";\n }\n if (ausMap.containsKey(publisher)) {\n TreeSet<ArchivalUnit> auSet = (TreeSet) ausMap.get(publisher);\n auSet.add(au);\n } else {\n TreeSet<ArchivalUnit> auSet =\n new TreeSet<ArchivalUnit>(new AuOrderComparator());\n auSet.add(au);\n ausMap.put(publisher, auSet);\n }\n }\n return ausMap;\n }", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "public void carregarAno() {\n\t\tif (usuario.getOrganizacaoMilitar().toString().equals(\"AMAN\")){\n\t\t\tano.addAll(Arrays.asList(Ano.values()));\n\t\t}\n\t\telse if (usuario.getOrganizacaoMilitar().toString().equals(\"ECEME\")){\n\t\t\tano.addAll(Arrays.asList(Ano.values()));\n\t\t\tano.remove(Ano.TERCEIRO);\n\t\t\tano.remove(Ano.QUARTO);\n\t\t}\n\t\telse{\n\t\t\tcarregarRegistroDoPrimeiroAno();\n\t\t}\n\t}", "private void rearrangeSolution() {\r\n List<Integer> trinity = new ArrayList<Integer>();\r\n trinity.add(0); trinity.add(1); trinity.add(2);\r\n permutateDigits();\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapRow(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapCol(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n }", "public void convertHashtoArray(ArrayList<Manufacturer> manu){\r\n\t\tfor(Manufacturer d: manu){\r\n\t\tManlist.add(t.get(d.code));\r\n\t\t}\r\n\t}", "private void convertCldrItems(String outDirname, String pathPrefix)\n throws IOException, ParseException {\n // zone and timezone items are queued for sorting first before they are\n // processed.\n\n for (JSONSection js : sections) {\n ArrayList<CldrItem> sortingItems = new ArrayList<CldrItem>();\n ArrayList<CldrItem> arrayItems = new ArrayList<CldrItem>();\n\n ArrayList<String> out = new ArrayList<String>();\n ArrayList<CldrNode> nodesForLastItem = new ArrayList<CldrNode>();\n String lastLeadingArrayItemPath = null;\n String leadingArrayItemPath = \"\";\n int valueCount = 0;\n String previousIdentityPath = null;\n List<CldrItem> theItems = sectionItems.get(js);\n if (theItems == null || theItems.size() == 0) {\n continue;\n }\n for (CldrItem item : theItems) {\n // items in the identity section of a file should only ever contain the lowest level, even if using\n // resolving source, so if we have duplicates ( caused by attributes used as a value ) then suppress\n // them here.\n if (item.getPath().contains(\"/identity/\")) {\n String[] parts = item.getPath().split(\"\\\\[\");\n if (parts[0].equals(previousIdentityPath)) {\n continue;\n } else {\n previousIdentityPath = parts[0];\n }\n }\n\n // some items need to be split to multiple item before processing. None\n // of those items need to be sorted.\n CldrItem[] items = item.split();\n if (items == null) {\n items = new CldrItem[1];\n items[0] = item;\n }\n valueCount += items.length;\n\n for (CldrItem newItem : items) {\n // alias will be dropped in conversion, don't count it.\n if (newItem.isAliasItem()) {\n valueCount--;\n }\n\n // Items like zone items need to be sorted first before write them out.\n if (newItem.needsSort()) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n sortingItems.add(newItem);\n } else {\n Matcher matcher = LdmlConvertRules.ARRAY_ITEM_PATTERN.matcher(\n newItem.getPath());\n if (matcher.matches()) {\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n leadingArrayItemPath = matcher.group(1);\n if (lastLeadingArrayItemPath != null &&\n !lastLeadingArrayItemPath.equals(leadingArrayItemPath)) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n lastLeadingArrayItemPath = leadingArrayItemPath;\n arrayItems.add(newItem);\n } else {\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n outputCldrItem(out, nodesForLastItem, newItem);\n lastLeadingArrayItemPath = \"\";\n }\n }\n }\n }\n\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n\n closeNodes(out, nodesForLastItem.size() - 2, 0);\n String outFilename;\n outFilename = js.section + \".json\";\n writeToFile(outDirname, outFilename, out);\n\n System.out.println(String.format(\" %s = %d values\", outFilename, valueCount));\n }\n }", "private void prepare()\n {\n AmbulanceToLeft ambulanceToLeft = new AmbulanceToLeft();\n addObject(ambulanceToLeft,717,579);\n Car2ToLeft car2ToLeft = new Car2ToLeft();\n addObject(car2ToLeft,291,579);\n Car3 car3 = new Car3();\n addObject(car3,45,502);\n CarToLeft carToLeft = new CarToLeft();\n addObject(carToLeft,710,262);\n Car car = new Car();\n addObject(car,37,190);\n AmbulanceToLeft ambulanceToLeft2 = new AmbulanceToLeft();\n addObject(ambulanceToLeft2,161,264);\n }", "private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }", "public void extracAcronyms() {\n\t\tExtractAbbrev extractAbbrv = new ExtractAbbrev();\n\t\tthis.abbreviations = extractAbbrv.extractAbbrPairs(this.supportDocument);\t\t\t\n\t\t\n\t\tboolean acronym = true;\n\t\t\n\t\tfor (int j = 0; j < this.name.length(); j++) {\n\t\t\tif (Character.isLowerCase(this.name.charAt(j))) {\n\t\t\t\tacronym = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (acronym) {\n\t\t\t for (Abbreviations abbreviation : this.abbreviations) {\t\t\t\t\t\n\t\t\t\tif (abbreviation.getShortForm().equalsIgnoreCase(this.name)) {\n\t\t\t\t\tthis.alternative_names.add(abbreviation.getLongForm());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }", "void sortUI();", "java.lang.String getUa();", "public void updatAttackArmies(){\n\t\t\n\t\tfinal String s = attackToComboBox.getSelectedItem().toString();\n\t\tCountry country = MainPlayScreen.this.game.getBoard().getCountryByName(s);\n\t\t\t\n\t\tfinal int armies = MainPlayScreen.this.game.countryArmies.get(country);\n\t\tSystem.out.println(s + \" Defender Armies: \" + armies);\n\t\t\n\t\tif( armies == 1){\n\t\t\tnumberOfArmies[5].removeAllItems();\n\t\t\tnumberOfArmies[5].addItem(1);\n\t\t}// end of if statement\n\t\t\n\t\telse if( armies == 2){\n\t\t\tnumberOfArmies[5].removeAllItems();\n\t\t\tnumberOfArmies[5].addItem(1);\n\t\t\tnumberOfArmies[5].addItem(2);\n\t\t\t\n\t\t} // end of else if statement\n\t\t\n\t\telse{\n\t\t\tnumberOfArmies[5].removeAllItems();\n\t\t\tnumberOfArmies[5].addItem(1);\n\t\t\tnumberOfArmies[5].addItem(2);\n\t\t\tnumberOfArmies[5].addItem(3);\n\t\t\t\n\t\t}// end of else statement\n\t\tnumberOfArmies[5].repaint();\n\t}", "public void analize() {\n\t\t//clearing dropping rules\n\t\tthis.droppingRules.clear();\n\t\t//analysing new rules\n\t\tanalizeParts();\n\t}", "private void changeOrderPhase() {\n for (int i = 0; i < 4; i++)\n System.out.print(playerList[i].getName() + \" ,\");\n Player tmp = playerList[0];\n playerList[0] = playerList[1];\n playerList[1] = playerList[2];\n playerList[2] = playerList[3];\n playerList[3] = tmp;\n System.out.println();\n for (int i = 0; i < 4; i++)\n System.out.print(playerList[i].getName() + \" ,\");\n System.out.println();\n }", "private void fetchAPNamesForModel(UiAirplaneModel model) {\r\n\t\tuiAirplaneModel.setApNamesList(new ArrayList<UiAirplaneModel>());\r\n\t\tList<UiAirplaneModel> apList = new ArrayList<UiAirplaneModel>();\r\n\t\tList<AirplaneName> list = wsrdAdminService.fetchAPNames(model.getAirplaneID());\r\n\t\tStringBuilder joinValues = new StringBuilder();\r\n\t\tif(ObjectUtil.isListNotEmpty(list)){\r\n\t\t\tfor(AirplaneName ap : list){\r\n\t\t\t\tjoinValues.append(ap.getAirplaneNames().trim()).append(NEWLINE);\r\n\t\t\t\t\r\n\t\t\t\tUiAirplaneModel uimodel = new UiAirplaneModel();\r\n\t\t\t\tuimodel.setAirplaneNames(ap.getAirplaneNames().trim());\r\n\t\t\t\tuimodel.setAirplaneID(ap.getApNameID());\r\n\t\t\t\tapList.add(uimodel);\r\n\t\t\t}\r\n\t\t}\r\n\t\tString str2 = \"\";\r\n\t\tstr2 = joinValues.toString();\r\n\t\tif(!str2.isEmpty()){\r\n\t\t\tstr2 = str2.substring(0, str2.length()-1);\r\n\t\t}\r\n\t\t\r\n\t\tmodel.setApNamesList(apList);\r\n\t\tmodel.setAirplaneNames(str2);\r\n\t}", "public void copyFrom(SAUAL50S_OA orig)\n {\n OutUnqassGrp_MA = orig.OutUnqassGrp_MA;\n for(int a = 0; a < 100; a++)\n {\n OutUnqassGrp_AC[a] = orig.OutUnqassGrp_AC[a];\n OutGUniqueAssignmentYear_AT[a] = orig.OutGUniqueAssignmentYear_AT[a];\n OutGUniqueAssignmentYear_AS[a] = orig.OutGUniqueAssignmentYear_AS[a];\n OutGUniqueAssignmentYear[a] = orig.OutGUniqueAssignmentYear[a];\n OutGUniqueAssignmentPeriod_AT[a] = orig.OutGUniqueAssignmentPeriod_AT[a];\n OutGUniqueAssignmentPeriod_AS[a] = orig.OutGUniqueAssignmentPeriod_AS[a];\n OutGUniqueAssignmentPeriod[a] = orig.OutGUniqueAssignmentPeriod[a];\n OutGUniqueAssignmentUniqueNr_AT[a] = orig.OutGUniqueAssignmentUniqueNr_AT[\n a];\n OutGUniqueAssignmentUniqueNr_AS[a] = orig.OutGUniqueAssignmentUniqueNr_AS[\n a];\n OutGUniqueAssignmentUniqueNr[a] = orig.OutGUniqueAssignmentUniqueNr[a];\n OutGUniqueAssignmentMkStudyUnitCode_AT[a] = \n orig.OutGUniqueAssignmentMkStudyUnitCode_AT[a];\n OutGUniqueAssignmentMkStudyUnitCode_AS[a] = \n orig.OutGUniqueAssignmentMkStudyUnitCode_AS[a];\n OutGUniqueAssignmentMkStudyUnitCode[a] = \n orig.OutGUniqueAssignmentMkStudyUnitCode[a];\n OutGUniqueAssignmentAssignmentNr_AT[a] = \n orig.OutGUniqueAssignmentAssignmentNr_AT[a];\n OutGUniqueAssignmentAssignmentNr_AS[a] = \n orig.OutGUniqueAssignmentAssignmentNr_AS[a];\n OutGUniqueAssignmentAssignmentNr[a] = \n orig.OutGUniqueAssignmentAssignmentNr[a];\n OutGUniqueAssignmentNrOfQuestions_AT[a] = \n orig.OutGUniqueAssignmentNrOfQuestions_AT[a];\n OutGUniqueAssignmentNrOfQuestions_AS[a] = \n orig.OutGUniqueAssignmentNrOfQuestions_AS[a];\n OutGUniqueAssignmentNrOfQuestions[a] = \n orig.OutGUniqueAssignmentNrOfQuestions[a];\n OutGUniqueAssignmentType_AT[a] = orig.OutGUniqueAssignmentType_AT[a];\n OutGUniqueAssignmentType_AS[a] = orig.OutGUniqueAssignmentType_AS[a];\n OutGUniqueAssignmentType[a] = orig.OutGUniqueAssignmentType[a];\n OutGUniqueAssignmentNegativeMarkFactor_AT[a] = \n orig.OutGUniqueAssignmentNegativeMarkFactor_AT[a];\n OutGUniqueAssignmentNegativeMarkFactor_AS[a] = \n orig.OutGUniqueAssignmentNegativeMarkFactor_AS[a];\n OutGUniqueAssignmentNegativeMarkFactor[a] = \n orig.OutGUniqueAssignmentNegativeMarkFactor[a];\n OutGUniqueAssignmentMaxCredits_AT[a] = \n orig.OutGUniqueAssignmentMaxCredits_AT[a];\n OutGUniqueAssignmentMaxCredits_AS[a] = \n orig.OutGUniqueAssignmentMaxCredits_AS[a];\n OutGUniqueAssignmentMaxCredits[a] = orig.OutGUniqueAssignmentMaxCredits[a]\n ;\n OutGUniqueAssignmentCreditSystem_AT[a] = \n orig.OutGUniqueAssignmentCreditSystem_AT[a];\n OutGUniqueAssignmentCreditSystem_AS[a] = \n orig.OutGUniqueAssignmentCreditSystem_AS[a];\n OutGUniqueAssignmentCreditSystem[a] = \n orig.OutGUniqueAssignmentCreditSystem[a];\n OutGUniqueAssignmentPassMarkPercentage_AT[a] = \n orig.OutGUniqueAssignmentPassMarkPercentage_AT[a];\n OutGUniqueAssignmentPassMarkPercentage_AS[a] = \n orig.OutGUniqueAssignmentPassMarkPercentage_AS[a];\n OutGUniqueAssignmentPassMarkPercentage[a] = \n orig.OutGUniqueAssignmentPassMarkPercentage[a];\n OutGUniqueAssignmentClosingDate_AT[a] = \n orig.OutGUniqueAssignmentClosingDate_AT[a];\n OutGUniqueAssignmentClosingDate_AS[a] = \n orig.OutGUniqueAssignmentClosingDate_AS[a];\n OutGUniqueAssignmentClosingDate[a] = orig.OutGUniqueAssignmentClosingDate[\n a];\n OutGUniqueAssignmentCompulsory_AT[a] = \n orig.OutGUniqueAssignmentCompulsory_AT[a];\n OutGUniqueAssignmentCompulsory_AS[a] = \n orig.OutGUniqueAssignmentCompulsory_AS[a];\n OutGUniqueAssignmentCompulsory[a] = orig.OutGUniqueAssignmentCompulsory[a]\n ;\n OutGUniqueAssignmentTsaUniqueNr_AT[a] = \n orig.OutGUniqueAssignmentTsaUniqueNr_AT[a];\n OutGUniqueAssignmentTsaUniqueNr_AS[a] = \n orig.OutGUniqueAssignmentTsaUniqueNr_AS[a];\n OutGUniqueAssignmentTsaUniqueNr[a] = orig.OutGUniqueAssignmentTsaUniqueNr[\n a];\n OutGYearMarkCalculationType_AT[a] = orig.OutGYearMarkCalculationType_AT[a]\n ;\n OutGYearMarkCalculationType_AS[a] = orig.OutGYearMarkCalculationType_AS[a]\n ;\n OutGYearMarkCalculationType[a] = orig.OutGYearMarkCalculationType[a];\n OutGYearMarkCalculationNormalWeight_AT[a] = \n orig.OutGYearMarkCalculationNormalWeight_AT[a];\n OutGYearMarkCalculationNormalWeight_AS[a] = \n orig.OutGYearMarkCalculationNormalWeight_AS[a];\n OutGYearMarkCalculationNormalWeight[a] = \n orig.OutGYearMarkCalculationNormalWeight[a];\n OutGYearMarkCalculationOptionalityGc3_AT[a] = \n orig.OutGYearMarkCalculationOptionalityGc3_AT[a];\n OutGYearMarkCalculationOptionalityGc3_AS[a] = \n orig.OutGYearMarkCalculationOptionalityGc3_AS[a];\n OutGYearMarkCalculationOptionalityGc3[a] = \n orig.OutGYearMarkCalculationOptionalityGc3[a];\n }\n }", "static void sort (String[] A, int L, int U) {\n\t\tif (L < U) {\n\t\t\tint k = indexOfLargest(A, L, U);\n\t\t\tString tmp = A[k]; A[k] = A[U]; A[U] = tmp;\n\t\t\tsort(A, L, U-1);\n\t\t}\n\t}", "private void cargarAutorizaciones() {\r\n\t\tif (parametros_empresa != null) {\r\n\t\t\tif (parametros_empresa.getTrabaja_autorizacion()) {\r\n\t\t\t\tMap<String, Object> parametros = new HashMap<String, Object>();\r\n\t\t\t\tparametros.put(\"nro_identificacion\",\r\n\t\t\t\t\t\tadmision_seleccionada.getNro_identificacion());\r\n\t\t\t\tparametros.put(\"nro_ingreso\",\r\n\t\t\t\t\t\tadmision_seleccionada.getNro_ingreso());\r\n\t\t\t\tparametros.put(\"estado\", admision_seleccionada.getEstado());\r\n\t\t\t\tparametros.put(\"tipo_hc\", \"\");\r\n\t\t\t\tparametros.put(IVias_ingreso.ADMISION_PACIENTE,\r\n\t\t\t\t\t\tadmision_seleccionada);\r\n\r\n\t\t\t\ttabboxContendor.abrirPaginaTabDemanda(false,\r\n\t\t\t\t\t\tIRutas_historia.PAGINA_AUTORIZACIONES,\r\n\t\t\t\t\t\t\"AUTORIZACIONES\", parametros);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void automerge() {\n\t\tif (automerge) {\n\t\t\tfor(int i = 0; i<create_modifier+1;i++) {\n\t\t\t\tmerge();\n\t\t\t}\n\t\tif(autoidentify) {\n\t\t\tauto_identify_crystal(autoIdentifyTier); // replace this eventually\n\t\t}\n\t\t\t//collection();\n\t\t}\n\t}", "public void sortCompetitors(){\n\t\t}", "private void prepareAchievements(User user,\n HttpServletRequest req,\n Language lang) {\n List<Achievement> achievements = achService.findAllAchForUser(\n user.getUserId(), lang);\n req.getSession().setAttribute(\"currentUserAch\", achievements);\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 static void viewPatientsStoredInAlphabetical() {\n\r\n String[] alphabeticalOrder = new String[6]; //Creates an array called 'alphabeticalOrder'\r\n for (int y=0; y<firstName.length; y++) {\r\n alphabeticalOrder[y] = firstName[y]; //Getting values from the 'vaccinationCenter' array and passing them to the 'alphabeticalOrder' array\r\n }\r\n for(int a=0; a<(alphabeticalOrder.length-1); a++)\r\n {\r\n for(int b=a+1; b<alphabeticalOrder.length; b++)\r\n {\r\n if((alphabeticalOrder[a].toLowerCase(Locale.ROOT)).compareTo(alphabeticalOrder[b].toLowerCase(Locale.ROOT))> 0)\r\n {\r\n String temp = alphabeticalOrder[a];\r\n alphabeticalOrder[a] = alphabeticalOrder[b];\r\n alphabeticalOrder[b] = temp;\r\n //Sorted elements of the array to alphabetical order\r\n }\r\n }\r\n }\r\n System.out.println(Arrays.toString(alphabeticalOrder));\r\n }", "private void createAA() {\r\n\r\n\t\tfor( int x = 0 ; x < dnasequence.size(); x++) {\r\n\t\t\tString str = dnasequence.get(x);\r\n\t\t\t//put catch for missing 3rd letter\r\n\t\t\tif(str.substring(0, 1).equals(\"G\")) {\r\n\t\t\t\taasequence.add(getG(str));\r\n\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"C\")) {\r\n\t\t\t\taasequence.add(getC(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"A\")) {\r\n\t\t\t\taasequence.add(getA(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"T\")) {\r\n\t\t\t\taasequence.add(getT(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0,1).equals(\"N\")) {\r\n\t\t\t\taasequence.add(\"ERROR\");\r\n\t\t\t}else\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t}\r\n\t}", "public void reorganizeNote() {\n note = Position.orderList(note);\n }", "public void avoidBotAndOtherASs(Set<Integer> ASesToLieAbout, Set<AS> advertiseToTheseASes) {\n BGPPath pathOfMerit = new BGPPath(this.asn * -1);\n\n /*\n * Lying reverse poison, prepend bot ASes\n */\n for (Integer tAS : this.botSet) {\n pathOfMerit.appendASToPath(tAS);\n }\n\n /*\n * If we have ASs to lie about apart from the critical side AS, do it here\n */\n if (ASesToLieAbout != null && !(ASesToLieAbout.isEmpty())) {\n for (Integer tAS : ASesToLieAbout) {\n pathOfMerit.appendASToPath((tAS));\n }\n }\n\n pathOfMerit.prependASToPath(this.asn);\n\n // If we don't have a specific AS set to advertise out to, advertise to all interfaces.\n if (advertiseToTheseASes == null || advertiseToTheseASes.isEmpty()) {\n\n /*\n * Advertise to all of our customers\n */\n for (AS tCust : this.customers) {\n tCust.advPath(pathOfMerit);\n }\n\n /*\n * Since this is a hole punched route, we always advertise to peers and prov\n */\n for (AS tPeer : this.peers) {\n tPeer.advPath(pathOfMerit);\n }\n\n for (AS tProv : this.providers) {\n tProv.advPath(pathOfMerit);\n }\n\n /*\n * Update the adj-out-rib with the correct set of ASes we have\n * adverstised the current best path to\n */\n\n Set<AS> newAdvTo = new HashSet<>();\n\n newAdvTo.addAll(this.customers);\n newAdvTo.addAll(this.peers);\n newAdvTo.addAll(this.providers);\n\n this.adjOutRib.put(this.asn * -1, newAdvTo);\n } else {\n for (AS tAS : advertiseToTheseASes) {\n tAS.advPath(pathOfMerit);\n }\n\n Set<AS> newAdvTo = new HashSet<>();\n\n newAdvTo.addAll(advertiseToTheseASes);\n\n this.adjOutRib.put(this.asn * -1, newAdvTo);\n }\n }", "private void assignAssistants(Player owner, Assistant a) {\n\t\towner.setAssistants(owner.getAssistants() + a.getNumber());\n\t}", "void rezervasyonYap(String name, String surname, String islem);", "private ArchivalUnit createAu(String auId, PluginManager pluginMgr,\n Map<String, String> properties, CIProperties headers) {\n log.debug2(\"auId = {}\", auId);\n log.debug2(\"properties = {}\", properties);\n log.debug2(\"headers = {}\", headers);\n\n ArchivalUnit au = null;\n\n // Get the plugin identifier.\n String pluginId = null;\n\n try {\n pluginId = PluginManager.pluginIdFromAuId(auId);\n log.trace(\"pluginId = {}\", pluginId);\n } catch (Exception e) {\n throw new RuntimeException(\"Error getting the plugin identifier: \", e);\n }\n\n Plugin plugin = null;\n\n if (PLUGIN_KEY.equals(pluginId)) {\n // Get the plugin.\n plugin = pluginMgr.getImportPlugin();\n\n if (plugin == null) {\n\tthrow new RuntimeException(\"Invalid pluginId '\" + pluginId + \"'\");\n }\n\n // Now that the Import plugin has been loaded, get the archival unit\n // again, if it exists.\n au = pluginMgr.getAuFromId(auId);\n log.trace(\"au = {}\", au);\n\n // Check whether the archival unit now exists.\n if (au != null) {\n\tprocessProperties(properties, null, headers);\n }\n } else {\n // Get the plugin.\n plugin = pluginMgr.getPlugin(pluginId);\n\n if (plugin == null) {\n\tboolean pluginLoaded = pluginMgr.ensurePluginLoaded(pluginId);\n\tlog.trace(\"pluginLoaded = {}\", pluginLoaded);\n\n\tif (pluginLoaded) {\n\t plugin = pluginMgr.getPlugin(pluginId);\n\t}\n\n\tif (plugin == null) {\n\t throw new RuntimeException(\"Invalid pluginId '\" + pluginId + \"'\");\n\t}\n }\n }\n \n // Check whether the archival unit still does not exist.\n if (au == null) {\n // Yes: Get the archival unit key.\n String auKey = null;\n\n try {\n\tauKey = PluginManager.auKeyFromAuId(auId);\n\tlog.trace(\"auKey = {}\", auKey);\n } catch (IllegalArgumentException iae) {\n\tthrow new RuntimeException(\"Error getting AuKey: \", iae);\n }\n\n // Get the properties encoded in the archival unit key.\n Properties props = null;\n\n try {\n\tprops = PropUtil.canonicalEncodedStringToProps(auKey);\n\tlog.trace(\"props = \" + props);\n } catch (IllegalArgumentException iae) {\n\tthrow new RuntimeException(\"Invalid AuKey: \", iae);\n }\n\n // Initialize the archival unit configuration.\n Configuration auConfig = null;\n\n try {\n\tauConfig = ConfigManager.fromPropertiesUnsealed(props);\n\tlog.trace(\"auConfig = {}\", auConfig);\n } catch (RuntimeException re) {\n\tthrow new RuntimeException(\"Invalid AuKey properties: \", re);\n }\n\n processProperties(properties, auConfig, headers);\n\n // Add the archival unit.\n try {\n\tau = pluginMgr.createAndSaveAuConfiguration(plugin, auConfig);\n\tlog.trace(\"au = {}\", au);\n } catch (Exception e) {\n\tthrow new RuntimeException(\"Error creating AU: \", e);\n }\n }\n\n log.debug2(\"au = {}\", au);\n return au;\n }", "public void cleanUp() {\n\t\tfor (int i = 0; i < 24; i++) {\r\n\t\t\tPlayerAssistant.itemOnInterface(c, 26099, i, -1, -1);\r\n\t\t}\r\n\t\tc.getPA().sendNewString(\"0\", 26013);\r\n\t}", "private void aretes_aG(){\n\t\tthis.cube[31] = this.cube[14]; \n\t\tthis.cube[14] = this.cube[5];\n\t\tthis.cube[5] = this.cube[41];\n\t\tthis.cube[41] = this.cube[50];\n\t\tthis.cube[50] = this.cube[31];\n\t}", "private void updateVslaInformation() {\n VslaInfo vslaInfo = new VslaInfo();\n vslaInfo.setGroupName(vslaName);\n vslaInfo.setMemberName(representativeName);\n vslaInfo.setMemberPost(representativePost);\n vslaInfo.setMemberPhoneNumber(repPhoneNumber);\n vslaInfo.setGroupAccountNumber(grpBankAccount);\n vslaInfo.setPhysicalAddress(physAddress);\n vslaInfo.setRegionName(regionName);\n vslaInfo.setLocationCordinates(locCoordinates);\n vslaInfo.setIssuedPhoneNumber(grpPhoneNumber);\n vslaInfo.setIsDataSent(\"1\");\n vslaInfo.setSupportType(grpSupportType);\n vslaInfo.setNumberOfCycles(numberOfCycles);\n databaseHandler.upDateGroupData(vslaInfo, currentDatabaseId);\n }", "protected ArrayList<String> convertUeToNamesList(ArrayList<UE> ueList2) {\n\t\tArrayList<String> ueList = new ArrayList<String>();\n\t\tfor (UE ue : ueList2) {\n\t\t\tueList.add(\"UE\" + ue.getName().replaceAll(\"\\\\D+\", \"\").trim());\n\t\t}\n\t\treturn ueList;\n\t}", "protected void transformSymbols(APDataCollection apData) {\n\n\t\tString uninsuredSymbol = apData.getFieldValue(ICommlAutoConstants.UNINSURED_MOTORIST_SYMBOL_PATH, \"\");\n\t\tString underinsuredSymbol = apData.getFieldValue(ICommlAutoConstants.UNDERINSURED_MOTORIST_SYMBOL_PATH, \"\");\n\n\t\t// The uninsured and underinsured symbols must be the same. If we get\n\t\t// one, but not the other prefil the empty symbol.\n\t\tif (StringUtilities.isEmpty(uninsuredSymbol) && !StringUtilities.isEmpty(underinsuredSymbol)) {\n\t\t\tapData.setFieldValue(ICommlAutoConstants.UNINSURED_MOTORIST_SYMBOL_PATH, underinsuredSymbol);\n\t\t}\n\t\tif (StringUtilities.isEmpty(underinsuredSymbol) && !StringUtilities.isEmpty(uninsuredSymbol)) {\n\t\t\tapData.setFieldValue(ICommlAutoConstants.UNDERINSURED_MOTORIST_SYMBOL_PATH, uninsuredSymbol);\n\t\t}\n\n\t\t// NJ & NY utilize a combined symbol element from ACORD & Turnstile\n\t\tString combinedUMSymbol = apData.getFieldValue(ICommlAutoConstants.COMBINED_UM_UIM_SYMBOL_PATH, \"\");\n\t\tif (!StringUtilities.isEmpty(combinedUMSymbol) && StringUtilities.isEmpty(uninsuredSymbol) && StringUtilities.isEmpty(underinsuredSymbol)) {\n\t\t\tapData.setFieldValue(ICommlAutoConstants.UNINSURED_MOTORIST_SYMBOL_PATH, combinedUMSymbol);\n\t\t\tapData.setFieldValue(ICommlAutoConstants.UNDERINSURED_MOTORIST_SYMBOL_PATH, combinedUMSymbol);\n\t\t}\n\t}", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "private void populateOrganizations() {\n\t\tMatContext.get().getAdminService().getAllOrganizations(new AsyncCallback<ManageOrganizationSearchModel>() {\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ManageOrganizationSearchModel model) {\n\t\t\t\tList<Result> results = model.getData();\n\t\t\t\tdetailDisplay.populateOrganizations(results);\n\t\t\t\t\n\t\t\t\tMap<String, Result> orgMap = new HashMap<String, Result>();\n\t\t\t\tfor(Result organization : results) {\n\t\t\t\t\torgMap.put(organization.getId(), organization);\n\t\t\t\t}\n\t\t\t\tdetailDisplay.setOrganizationsMap(orgMap);\n\t\t\t\t\n\t\t\t\tsetUserDetailsToView();\n\t\t\t}\n\t\t});\n\t}", "public void setUpPlayers(){\n\t\tTreeMap<String,Integer> turnsDetails = new TreeMap<>();\n\t\tint e = 0;\n\t\tfor(Player i : allplayers) {\n\t\t\ti.fillHand();\n\t\t\tturnsDetails.put(i.getFirstLetter()+String.valueOf(e),e);\n\t\t\te++;\n\t\t}\n\t\t// populate the turn list\n //entryset returns a set view of mappings contained\n\t\tfor(Map.Entry<String,Integer> i : turnsDetails.entrySet())\n\t\t\tturns.add(i.getValue());\n\t}", "private void startUpPhase()\n\t{\n\t\tmap.distributeCountries(); /* Randomly split the countries between the players */\n\t\tArrayList<Player> remainingPlayers = new ArrayList<Player>(map.players);\n\t\t\n\t\tdo \n\t\t{\n\t\t\tIterator<Player> i = remainingPlayers.iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) \n\t\t\t{\n\t\t\t\tPlayer p = i.next();\n\t\t\t\tif(p.getArmies() == 0) \n\t\t\t\t{\n\t\t\t\t\ti.remove();\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tp.placeOneArmy();\n\t\t\t\t}\n\t\t\t}\n\t\t}while(remainingPlayers.size() != 0);\n\t}", "public void applyTo(NewOrReplaceOrder inOrder)\n {\n if(algoTags == null) {\n return;\n }\n Map<String,String> customFields = inOrder.getCustomFields();\n if(customFields == null) {\n customFields = new HashMap<String,String>();\n }\n for(BrokerAlgoTag algoTag : algoTags) {\n customFields.put(String.valueOf(algoTag.getTagSpec().getTag()),\n algoTag.getValue());\n }\n inOrder.setCustomFields(customFields);\n }", "public final void mo4425a() {\n boolean z = true;\n int i = this.f1102b.f1100a.getResources().getConfiguration().orientation;\n PurchaseActivity purchaseActivity = this.f1102b.f1100a;\n C1033g c1033g = this.f1101a;\n if (i != 1) {\n z = false;\n }\n PurchaseActivity.m791a(purchaseActivity, c1033g, z);\n }", "private void shiftElements() {\n RadarContent[] tempArr = new RadarContent[length - 1];\n for (int i = 0; i < length - 1; i++) {\n tempArr[i] = arrProfiles[i + 1];\n }\n arrProfiles = tempArr;\n length--;\n }", "private static void copyToPNU(ParsedAuthorship pn, ParsedNameUsage pnu, IssueContainer issues){\n pnu.getName().setCombinationAuthorship(pn.getCombinationAuthorship());\n pnu.getName().setSanctioningAuthor(pn.getSanctioningAuthor());\n pnu.getName().setBasionymAuthorship(pn.getBasionymAuthorship());\n // propagate notes and unparsed bits found in authorship if not already existing\n setIfNull(pn.getNomenclaturalNote(), pnu.getName()::getNomenclaturalNote, pnu.getName()::setNomenclaturalNote);\n setIfNull(pn.getPublishedIn(), pnu::getPublishedIn, pnu::setPublishedIn);\n setIfNull(pn.getTaxonomicNote(), pnu::getTaxonomicNote, pnu::setTaxonomicNote);\n if (pn.getUnparsed() != null) {\n pnu.getName().setUnparsed(pn.getUnparsed());\n }\n if (pn.isExtinct()) {\n pnu.setExtinct(pn.isExtinct());\n }\n if (pn.isManuscript()) {\n pnu.getName().setNomStatus(NomStatus.MANUSCRIPT);\n }\n\n // issues\n switch (pn.getState()) {\n case PARTIAL:\n issues.addIssue(Issue.PARTIALLY_PARSABLE_NAME);\n break;\n case NONE:\n issues.addIssue(Issue.UNPARSABLE_NAME);\n break;\n }\n\n if (pn.isDoubtful()) {\n issues.addIssue(Issue.DOUBTFUL_NAME);\n }\n // translate warnings into issues\n for (String warn : pn.getWarnings()) {\n if (WARN_TO_ISSUE.containsKey(warn)) {\n issues.addIssue(WARN_TO_ISSUE.get(warn));\n } else {\n LOG.debug(\"Unknown parser warning: {}\", warn);\n }\n }\n }", "protected void sortCode() {\n for (int i = 1; i < codeCount; i++) {\n int who = i;\n for (int j = i + 1; j < codeCount; j++) {\n if (code[j].getFileName().compareTo(code[who].getFileName()) < 0) {\n who = j; // this guy is earlier in the alphabet\n }\n }\n if (who != i) { // swap with someone if changes made\n SketchCode temp = code[who];\n code[who] = code[i];\n code[i] = temp;\n }\n }\n }", "public static void unResolveIdents() {\n\t\tint i;\n\t\tfor (i = 0; i < count; i++) {\n\t\t\t((IdentifierResolver) bIdents.get(i)).unsetShortName();\n\t\t}\n\t}", "@Override\n public void align(@NonNull PbVnAlignment alignment) {\n boolean noAgentiveA0 = alignment.proposition().predicate().ancestors(true).stream()\n .allMatch(s -> s.roles().stream()\n .map(r -> ThematicRoleType.fromString(r.type()).orElse(ThematicRoleType.NONE))\n .noneMatch(ThematicRoleType::isAgentive));\n\n for (PropBankPhrase phrase : alignment.sourcePhrases(false)) {\n List<NounPhrase> unaligned = alignment.targetPhrases(false).stream()\n .filter(i -> i instanceof NounPhrase)\n .map(i -> ((NounPhrase) i))\n .collect(Collectors.toList());\n if (phrase.getNumber() == ArgNumber.A0) {\n // TODO: seems like a hack\n if (alignment.proposition().predicate().verbNetId().classId().startsWith(\"51\") && noAgentiveA0) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (EnumSet.of(ThematicRoleType.AGENT, ThematicRoleType.CAUSER,\n ThematicRoleType.STIMULUS, ThematicRoleType.PIVOT)\n .contains(unalignedPhrase.thematicRoleType())) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A1) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME\n || unalignedPhrase.thematicRoleType() == ThematicRoleType.PATIENT) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A3) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isStartingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A4) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isEndingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n\n\n }\n }", "@Override\n\tpublic void transform(APDataCollection apData, TargetFormat targetFormat, Element customParameters)\n\t\t\tthrows APDataCollectionTransformationException {\n\n\t\tif (targetFormat.equals(TargetFormat.ACORDSimplified)) {\n\t\t\ttransformToACORDSimplified(apData);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(rearrangeString(\"aab\", 3));\n\t}", "public void inicialAleatorio() {\n //aqui adiciona naquele vetor que de auxilio\n alocacao.add(Estados.ELETRICISTAS);\n alocacao.add(Estados.ELETRICISTAS2);\n alocacao.add(Estados.QUALIDADE);\n alocacao.add(Estados.QUALIDADE2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL3);\n alocacao.add(Estados.PLANEJAMENTO);\n\n //biblioteca que sorteia aleatoriamente os departamentos\n Collections.shuffle(alocacao);\n\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = alocacao.get(i);\n\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = alocacao.get(i + 4);\n }\n\n }", "private void flipnav(int[] nav) {\r\n\r\n // first word is always the satellite id in ASCII\r\n // check on which type:\r\n\r\n if (nav[0] == AREAnav.GVAR) {\r\n\r\n McIDASUtil.flip(nav,2,126);\r\n McIDASUtil.flip(nav,129,254);\r\n McIDASUtil.flip(nav,257,382);\r\n McIDASUtil.flip(nav,385,510);\r\n McIDASUtil.flip(nav,513,638);\r\n }\r\n\r\n else if (nav[0] == AREAnav.DMSP) {\r\n McIDASUtil.flip(nav,1,43);\r\n McIDASUtil.flip(nav,45,51);\r\n }\r\n\r\n else if (nav[0] == AREAnav.POES) {\r\n McIDASUtil.flip(nav,1,119);\r\n }\r\n\r\n else {\r\n McIDASUtil.flip(nav,1,nav.length-1);\r\n }\r\n\r\n return;\r\n }", "public void initVuforiaNavigation() {\n int cameraMonitorViewId = hardwareMap.appContext.getResources().getIdentifier(\"cameraMonitorViewId\", \"id\", hardwareMap.appContext.getPackageName());\n VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters(cameraMonitorViewId);\n\n // VuforiaLocalizer.Parameters parameters = new VuforiaLocalizer.Parameters();\n\n parameters.vuforiaLicenseKey = VUFORIA_KEY;\n parameters.cameraDirection = CAMERA_CHOICE;\n\n // Make sure extended tracking is disabled for this example.\n parameters.useExtendedTracking = false;\n\n // Instantiate the Vuforia engine\n vuforia = ClassFactory.getInstance().createVuforia(parameters);\n\n // Load the data sets for the trackable objects. These particular data\n // sets are stored in the 'assets' part of our application.\n targetsUltimateGoal = this.vuforia.loadTrackablesFromAsset(\"UltimateGoal\");\n VuforiaTrackable blueTowerGoalTarget = targetsUltimateGoal.get(0);\n blueTowerGoalTarget.setName(\"Blue Tower Goal Target\");\n VuforiaTrackable redTowerGoalTarget = targetsUltimateGoal.get(1);\n redTowerGoalTarget.setName(\"Red Tower Goal Target\");\n VuforiaTrackable redAllianceTarget = targetsUltimateGoal.get(2);\n redAllianceTarget.setName(\"Red Alliance Target\");\n VuforiaTrackable blueAllianceTarget = targetsUltimateGoal.get(3);\n blueAllianceTarget.setName(\"Blue Alliance Target\");\n VuforiaTrackable frontWallTarget = targetsUltimateGoal.get(4);\n frontWallTarget.setName(\"Front Wall Target\");\n\n // For convenience, gather together all the trackable objects in one easily-iterable collection */\n allTrackables = new ArrayList<VuforiaTrackable>();\n allTrackables.addAll(targetsUltimateGoal);\n\n /**\n * In order for localization to work, we need to tell the system where each target is on the field, and\n * where the phone resides on the robot. These specifications are in the form of <em>transformation matrices.</em>\n * Transformation matrices are a central, important concept in the math here involved in localization.\n * See <a href=\"https://en.wikipedia.org/wiki/Transformation_matrix\">Transformation Matrix</a>\n * for detailed information. Commonly, you'll encounter transformation matrices as instances\n * of the {@link OpenGLMatrix} class.\n *\n * If you are standing in the Red Alliance Station looking towards the center of the field,\n * - The X axis runs from your left to the right. (positive from the center to the right)\n * - The Y axis runs from the Red Alliance Station towards the other side of the field\n * where the Blue Alliance Station is. (Positive is from the center, towards the BlueAlliance station)\n * - The Z axis runs from the floor, upwards towards the ceiling. (Positive is above the floor)\n *\n * Before being transformed, each target image is conceptually located at the origin of the field's\n * coordinate system (the center of the field), facing up.\n */\n\n //Set the position of the perimeter targets with relation to origin (center of field)\n redAllianceTarget.setLocation(OpenGLMatrix\n .translation(0, -halfField, mmTargetHeight)\n .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 180)));\n\n blueAllianceTarget.setLocation(OpenGLMatrix\n .translation(0, halfField, mmTargetHeight)\n .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, 0)));\n frontWallTarget.setLocation(OpenGLMatrix\n .translation(-halfField, 0, mmTargetHeight)\n .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0 , 90)));\n\n // The tower goal targets are located a quarter field length from the ends of the back perimeter wall.\n blueTowerGoalTarget.setLocation(OpenGLMatrix\n .translation(halfField, quadField, mmTargetHeight)\n .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0 , -90)));\n redTowerGoalTarget.setLocation(OpenGLMatrix\n .translation(halfField, -quadField, mmTargetHeight)\n .multiplied(Orientation.getRotationMatrix(EXTRINSIC, XYZ, DEGREES, 90, 0, -90)));\n\n //\n // Create a transformation matrix describing where the phone is on the robot.\n //\n // NOTE !!!! It's very important that you turn OFF your phone's Auto-Screen-Rotation option.\n // Lock it into Portrait for these numbers to work.\n //\n // Info: The coordinate frame for the robot looks the same as the field.\n // The robot's \"forward\" direction is facing out along X axis, with the LEFT side facing out along the Y axis.\n // Z is UP on the robot. This equates to a bearing angle of Zero degrees.\n //\n // The phone starts out lying flat, with the screen facing Up and with the physical top of the phone\n // pointing to the LEFT side of the Robot.\n // The two examples below assume that the camera is facing forward out the front of the robot.\n\n // We need to rotate the camera around it's long axis to bring the correct camera forward.\n if (CAMERA_CHOICE == BACK) {\n phoneYRotate = -90;\n } else {\n phoneYRotate = 90;\n }\n\n // Rotate the phone vertical about the X axis if it's in portrait mode\n if (PHONE_IS_PORTRAIT) {\n phoneXRotate = 90 ;\n }\n\n // Next, translate the camera lens to where it is on the robot.\n // In this example, it is centered (left to right), but forward of the middle of the robot, and above ground level.\n final float CAMERA_FORWARD_DISPLACEMENT = 7.0f * mmPerInch; // eg: Camera is 7 Inches in front of robot center\n final float CAMERA_VERTICAL_DISPLACEMENT = 6.0f * mmPerInch; // eg: Camera is 6 Inches above ground\n final float CAMERA_LEFT_DISPLACEMENT = -4.0f * mmPerInch; // eg: Camera is 4 inches to the RIGHT the robot's center line\n\n OpenGLMatrix robotFromCamera = OpenGLMatrix\n .translation(CAMERA_FORWARD_DISPLACEMENT, CAMERA_LEFT_DISPLACEMENT, CAMERA_VERTICAL_DISPLACEMENT)\n .multiplied(Orientation.getRotationMatrix(EXTRINSIC, YZX, DEGREES, phoneYRotate, phoneZRotate, phoneXRotate));\n\n /** Let all the trackable listeners know where the phone is. */\n for (VuforiaTrackable trackable : allTrackables) {\n ((VuforiaTrackableDefaultListener) trackable.getListener()).setPhoneInformation(robotFromCamera, parameters.cameraDirection);\n }\n targetsUltimateGoal.activate();\n }", "private void justifyCargo() {\n TradeGoods[] temp = new TradeGoods[cargo.length];\n int current = 0;\n for (TradeGoods t:cargo) {\n if (t != null) {\n temp[current] = t;\n current++;\n }\n }\n }", "private void fillAdjective1a()\n {\n adjective1a.add(\"Epic\");\n adjective1a.add(\"Brilliant\");\n adjective1a.add(\"Mighty\");\n adjective1a.add(\"Great\");\n adjective1a.add(\"Wonderful\");\n adjective1a.add(\"Crazy\");\n adjective1a.add(\"Sparkling\");\n adjective1a.add(\"Shiny\");\n adjective1a.add(\"Lustful\");\n adjective1a.add(\"Precious\");\n\n }", "private static void sortHelperMSD(String[] asciis, int start, int end, int index) {\n // Optional MSD helper method for optional MSD radix sort\n return;\n }", "public static JwComparator<AcPost> getUpuShortNameComparator()\n {\n return AcPostTools.instance.getUpuShortNameComparator();\n }", "private void mergeUltraDuoPlusSetup(UltraDuoPlusType tmpUltraDuoPlusSetup) {\n\t\tif (!this.ultraDuoPlusSetup.getIdentifierName().equals(tmpUltraDuoPlusSetup.getIdentifierName())) {\n\t\t\tthis.deviceIdentifierName = (tmpUltraDuoPlusSetup.getIdentifierName() + UltraDuoPlusDialog.STRING_16_BLANK).substring(0, 16);\n\t\t\tthis.ultraDuoPlusSetup.setIdentifierName(this.deviceIdentifierName);\n\t\t\tthis.ultraDuoPlusSetup.setChanged(true);\n\t\t\tthis.userNameText.setText(this.deviceIdentifierName);\n\t\t}\n\n\t\t//channel base setup\n\t\tif (!this.ultraDuoPlusSetup.getChannelData1().getValue().equals(tmpUltraDuoPlusSetup.getChannelData1().getValue())) {\n\t\t\tthis.ultraDuoPlusSetup.getChannelData1().setValue(tmpUltraDuoPlusSetup.getChannelData1().getValue());\n\t\t\tthis.ultraDuoPlusSetup.getChannelData1().setChanged(true);\n\t\t\tthis.device.convert2IntArray(this.channelValues1, this.ultraDuoPlusSetup.channelData1.getValue());\n\t\t\tfor (int i = 0; i < UltramatSerialPort.SIZE_CHANNEL_1_SETUP; i++) {\n\t\t\t\tif (this.channelParameters[i] != null) {\n\t\t\t\t\tthis.channelParameters[i].setSliderSelection(this.channelValues1[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (this.device.getDeviceTypeIdentifier() != GraupnerDeviceType.UltraDuoPlus45 && !this.ultraDuoPlusSetup.getChannelData2().getValue().equals(tmpUltraDuoPlusSetup.getChannelData2().getValue())) {\n\t\t\tthis.ultraDuoPlusSetup.getChannelData2().setValue(tmpUltraDuoPlusSetup.getChannelData2().getValue());\n\t\t\tthis.ultraDuoPlusSetup.getChannelData2().setChanged(true);\n\t\t\tthis.device.convert2IntArray(this.channelValues2, this.ultraDuoPlusSetup.channelData2.getValue());\n\t\t\tfor (int i = 0; i < UltramatSerialPort.SIZE_CHANNEL_2_SETUP; i++) {\n\t\t\t\tif (this.channelParameters[UltramatSerialPort.SIZE_CHANNEL_2_SETUP + i] != null) {\n\t\t\t\t\tthis.channelParameters[UltramatSerialPort.SIZE_CHANNEL_2_SETUP + i].setSliderSelection(this.channelValues2[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//battery memories\n\t\tList<MemoryType> cellMemories = this.ultraDuoPlusSetup.getMemory();\n\t\tList<MemoryType> tmpCellMemories = tmpUltraDuoPlusSetup.getMemory();\n\t\tIterator<MemoryType> iterator = cellMemories.iterator();\n\t\tIterator<MemoryType> tmpIterator = tmpCellMemories.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMemoryType cellMemory = iterator.next();\n\t\t\tMemoryType tmpCellMemory = tmpIterator.next();\n\t\t\t//memory name\n\t\t\tif (!cellMemory.getName().equals(tmpCellMemory.getName())) {\n\t\t\t\tcellMemory.setName((tmpCellMemory.getName() + UltraDuoPlusDialog.STRING_16_BLANK).substring(0, 16));\n\t\t\t\tcellMemory.setChanged(true);\n\t\t\t}\n\n\t\t\t//memory setup data\n\t\t\tif (tmpCellMemory.getSetupData() != null && cellMemory.getSetupData() != null && !cellMemory.getSetupData().getValue().equals(tmpCellMemory.getSetupData().getValue())) {\n\t\t\t\tcellMemory.getSetupData().setValue(tmpCellMemory.getSetupData().getValue());\n\t\t\t\tcellMemory.getSetupData().setChanged(true);\n\t\t\t}\n\t\t\t//memory step charge data\n\t\t\tif (tmpCellMemory.getStepChargeData() == null && cellMemory.getStepChargeData() != null) {\n\t\t\t\tcellMemory.setStepChargeData(null);\n\t\t\t}\n\t\t\tif (tmpCellMemory.getStepChargeData() != null && cellMemory.getStepChargeData() == null) {\n\t\t\t\tcellMemory.setStepChargeData(new ObjectFactory().createMemoryTypeStepChargeData());\n\t\t\t\tcellMemory.getStepChargeData().setValue(tmpCellMemory.getStepChargeData().getValue());\n\t\t\t\tcellMemory.getStepChargeData().setChanged(true);\n\t\t\t}\n\t\t\tif (tmpCellMemory.getStepChargeData() != null && cellMemory.getStepChargeData() != null && !cellMemory.getStepChargeData().getValue().equals(tmpCellMemory.getStepChargeData().getValue())) {\n\t\t\t\tcellMemory.getStepChargeData().setValue(tmpCellMemory.getStepChargeData().getValue());\n\t\t\t\tcellMemory.getStepChargeData().setChanged(true);\n\t\t\t}\n\n\t\t\t//memory trace data\n\t\t\tif (tmpCellMemory.getTraceData() == null && cellMemory.getTraceData() != null) {\n\t\t\t\tcellMemory.setTraceData(null);\n\t\t\t}\n\t\t\tif (tmpCellMemory.getTraceData() != null && cellMemory.getTraceData() == null) {\n\t\t\t\tcellMemory.setTraceData(new ObjectFactory().createMemoryTypeTraceData());\n\t\t\t\tcellMemory.getTraceData().setValue(tmpCellMemory.getTraceData().getValue());\n\t\t\t\tcellMemory.getTraceData().setChanged(true);\n\t\t\t}\n\t\t\tif (tmpCellMemory.getTraceData() != null && cellMemory.getTraceData() != null && !cellMemory.getTraceData().getValue().equals(tmpCellMemory.getTraceData().getValue())) {\n\t\t\t\tcellMemory.getTraceData().setValue(tmpCellMemory.getTraceData().getValue());\n\t\t\t\tcellMemory.getTraceData().setChanged(true);\n\t\t\t}\n\n\t\t\t//memory cycle data\n\t\t\tif (tmpCellMemory.getCycleData() == null && cellMemory.getCycleData() != null) {\n\t\t\t\tcellMemory.setCycleData(null);\n\t\t\t}\n\t\t\tif (tmpCellMemory.getCycleData() != null && cellMemory.getCycleData() == null) {\n\t\t\t\tcellMemory.setCycleData(new ObjectFactory().createMemoryTypeCycleData());\n\t\t\t\tcellMemory.getCycleData().setValue(tmpCellMemory.getCycleData().getValue());\n\t\t\t\tcellMemory.getCycleData().setChanged(true);\n\t\t\t}\n\t\t\tif (tmpCellMemory.getCycleData() != null && cellMemory.getCycleData() != null && !cellMemory.getCycleData().getValue().equals(tmpCellMemory.getCycleData().getValue())) {\n\t\t\t\tcellMemory.getCycleData().setValue(tmpCellMemory.getCycleData().getValue());\n\t\t\t\tcellMemory.getCycleData().setChanged(true);\n\t\t\t}\n\t\t}\n\n\t\t//tire heater data\n\t\tList<TireHeaterData> tireHeaters = this.ultraDuoPlusSetup.getTireHeaterData();\n\t\tList<TireHeaterData> tmpTireHeaters = tmpUltraDuoPlusSetup.getTireHeaterData();\n\t\tIterator<TireHeaterData> tireIterator = tireHeaters.iterator();\n\t\tIterator<TireHeaterData> tmpTireIterator = tmpTireHeaters.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tTireHeaterData tireHeaterData = tireIterator.next();\n\t\t\tTireHeaterData tmpTireHeaterData = tmpTireIterator.next();\n\n\t\t\tif (tmpTireHeaterData == null && tireHeaterData != null) {\n\t\t\t\ttireHeaterData = null;\n\t\t\t}\n\t\t\tif (tmpTireHeaterData != null && tireHeaterData == null) {\n\t\t\t\ttireHeaterData = new ObjectFactory().createUltraDuoPlusTypeTireHeaterData();\n\t\t\t\ttireHeaterData.setValue(tmpTireHeaterData.getValue());\n\t\t\t\ttireHeaterData.setChanged(true);\n\t\t\t}\n\t\t\tif (tmpTireHeaterData != null && tireHeaterData != null && !tireHeaterData.getValue().equals(tmpTireHeaterData.getValue())) {\n\t\t\t\ttireHeaterData.setValue(tmpTireHeaterData.getValue());\n\t\t\t\ttireHeaterData.setChanged(true);\n\t\t\t}\n\t\t}\n\n\t\t//motor run data\n\t\tList<MotorRunData> motorRunDatas = this.ultraDuoPlusSetup.getMotorRunData();\n\t\tList<MotorRunData> tmpMotorRunDatas = tmpUltraDuoPlusSetup.getMotorRunData();\n\t\tIterator<MotorRunData> motorRunIterator = motorRunDatas.iterator();\n\t\tIterator<MotorRunData> tmpMotorRunIterator = tmpMotorRunDatas.iterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tMotorRunData motorRunData = motorRunIterator.next();\n\t\t\tMotorRunData tmpMotorRunData = tmpMotorRunIterator.next();\n\n\t\t\tif (tmpMotorRunData == null && motorRunData != null) {\n\t\t\t\tmotorRunData = null;\n\t\t\t}\n\t\t\tif (tmpMotorRunData != null && motorRunData == null) {\n\t\t\t\tmotorRunData = new ObjectFactory().createUltraDuoPlusTypeMotorRunData();\n\t\t\t\tmotorRunData.setValue(tmpMotorRunData.getValue());\n\t\t\t\tmotorRunData.setChanged(true);\n\t\t\t}\n\t\t\tif (tmpMotorRunData != null && motorRunData != null && !motorRunData.getValue().equals(tmpMotorRunData.getValue())) {\n\t\t\t\tmotorRunData.setValue(tmpMotorRunData.getValue());\n\t\t\t\tmotorRunData.setChanged(true);\n\t\t\t}\n\t\t}\n\t}", "private void moverCarroLujo() {\n for (Auto auto : arrEnemigosAuto) {\n auto.render(batch);\n\n auto.moverIzquierda();\n }\n }", "public void ar() {\n Object object = this.li;\n synchronized (object) {\n if (this.ly) {\n this.av();\n this.aq();\n try {\n this.a(this.ax());\n }\n catch (JSONException var2_2) {\n dw.b(\"JSON Failure while processing active view data.\", var2_2);\n }\n this.ly = false;\n this.as();\n dw.x(\"Untracked ad unit: \" + this.lo.ao());\n }\n return;\n }\n }", "@BeforeEach\n\tpublic void steUp()\n\t{\n\t\tClientAchievementManager.getAquiredScoreAchievements().clear();\n\t\tClientAchievementManager.getPlayedGamesAchievements().clear();\n\t\tClientAchievementManager.getWonGamesAchievements().clear();\n\t}", "private static void alphabetize() {\r\n Collections.sort(kwicIndex, String.CASE_INSENSITIVE_ORDER);\r\n }", "private void adjustMessierData()\n\t{\n\t\tfor(int i = 0; i < messierList.size(); i++)\n\t\t{\n\t\t\tMessier aMessier = messierList.get(i);\n\t\t\tdouble rightAsc = aMessier.getRADecimalHour();\n\t\t\tdouble hourAngle = theCalculator.findHourAngle(rightAsc, userLocalTime);\n\t\t\taMessier.setHourAngle(hourAngle);\n\t\t\tmessierList.set(i, aMessier);\n\t\t}\n\t}", "public void cleanUp()\r\n {\r\n m_aaiNumTris = null;\r\n m_aafRelativeLengths = null;\r\n m_aafMaxDist = null;;\r\n m_aakCurvePos = null;\r\n m_aakTangent = null;\r\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 extractAliases(XMLElement pluginDescriptor) {\n XMLElement aliasesDescriptor = findExtension(pluginDescriptor, AliasManager.ALIASES_EP_NAME);\n if (aliasesDescriptor == null) {\n return;\n }\n for (XMLElement aliasDescriptor : aliasesDescriptor.getChildren()) {\n if (aliasDescriptor.getName().equals(\"alias\")) {\n String alias = aliasDescriptor.getStringAttribute(\"name\");\n String className = aliasDescriptor.getStringAttribute(\"class\");\n aliasMgr.add(alias, className);\n }\n }\n }", "private void fixupLanguageCodes() {\n long timer = -System.currentTimeMillis();\n\n // Hack to fix ssl1->sil. If we ever have more, abstract this a bit more.\n String from = \"ssl1\";\n String to = \"sil\";\n RFC3066LanguageCode abstractLanguageCode = new RFC3066LanguageCode(to);\n MetadataValue<RFC3066LanguageCode> abstractMetadataLanguageCode = new MetadataValue<>(\n abstractLanguageCode);\n\n Transaction transaction = this.store.newTransaction();\n Collection<AudioItem> items = this.store.getAudioItems();\n int itemsFixed = 0;\n\n boolean success = false;\n try {\n for (AudioItem audioItem : items) {\n if (audioItem.getLanguageCode().equalsIgnoreCase(from)) {\n audioItem.getMetadata().putMetadataField(DC_LANGUAGE, abstractMetadataLanguageCode);\n transaction.add(audioItem);\n itemsFixed++;\n }\n }\n if (transaction.size() > 0) {\n transaction.commit();\n } else {\n transaction.rollback();\n }\n success = true;\n } catch (IOException e1) {\n e1.printStackTrace();\n } finally {\n if (!success) {\n try {\n transaction.rollback();\n } catch (IOException e) {\n LOG.log(Level.SEVERE, \"Unable to rollback transaction.\", e);\n }\n }\n }\n\n timer += System.currentTimeMillis();\n // If we did anything, or if the delay was perceptable (1/10th second), show the time.\n if (itemsFixed > 0 || timer > 100) {\n System.out.printf(\"Took %d ms to fix %d language codes%n\", timer, itemsFixed);\n }\n }", "void decreaseSortLetter();", "private void populateAltitudes()\r\n {\r\n for(int i=0; i<9; i++)\r\n {\r\n cboAltitude.addItem(aryAltitudes[i]);\r\n }\r\n }", "public void distribuirAportes2(){\n\n if(comprobanteSeleccionado.getAporteorganismo().floatValue() > 0f){\n comprobanteSeleccionado.setAportecomitente(comprobanteSeleccionado.getMontoaprobado().subtract(comprobanteSeleccionado.getAporteuniversidad().add(comprobanteSeleccionado.getAporteorganismo())));\n }\n }", "public static void alphabetize() {\r\n\t\tArrayList<Patron> alphabetic = dblogic.getAlphabetic();\r\n\t\tresetTable();\r\n\t\tfor (int i = 0; i < alphabetic.size(); i++) {\r\n\t\t\ttable.setValueAt(alphabetic.get(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(alphabetic.get(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(alphabetic.get(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(alphabetic.get(i).getPatronDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(alphabetic.get(i).getPatronSince(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(alphabetic.get(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}", "public static void userSort(ArrayList<FileData> fromFile, int primary_sort, int secondary_sort, int primary_order, int secondary_order)\n {\n \n // user wants to sort by primary = state code and secondary = county code\n if(primary_sort == 1 && secondary_sort == 2) \n {\n if(primary_order == 1 && secondary_order == 1){// user wants both primary and secondary in ascending order\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order == 2 && secondary_order == 2){ // user wants both primary and secondary in decending order\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){// primary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n // user wants to sort by primary = county code and secondary = state code\n if(primary_sort == 2 && secondary_sort == 1){\n if(primary_order == 1 && secondary_order == 1){\n //primary and seconary is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2 && secondary_order == 2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){//primary is ascending\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n Collections.sort(fromFile,new Sort_County_Code()); // primary sort\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){//primary is descending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Code().reversed()); // primary sort\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==1&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Code()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==1&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n for(int i=0; i<fromFile.size(); i++){\n System.out.println(fromFile.get(i).printInfo());\n } \n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information \n } \n } \n }\n \n \n if(primary_sort==1&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); \n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo()); // print the sorted information by state and county code\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==1&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n \n if(primary_sort==8&&secondary_sort==1){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile, new Sort_State_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile,new Sort_State_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_State_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_County_Code().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new Sort_County_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new Sort_County_Name().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==6&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==2&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==7&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==2&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Code());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Code());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n if(primary_sort==8&&secondary_sort==2){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Code());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Code().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Code().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Code());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed()); \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n } \n \n if(primary_sort==3&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==4&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==5&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==3&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n \n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_State_Name());\n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n \n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_State_Name());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==3){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_State_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_State_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_State_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_State_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==4&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new Sort_County_Name());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new Sort_County_Name());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==4){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new Sort_County_Name());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new Sort_County_Name().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new Sort_County_Name().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new Sort_County_Name());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==6&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==7&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==5&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortFirstConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n \n if(primary_sort==8&&secondary_sort==5){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFirstConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFirstConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFirstConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==6&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortSecondConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==6){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortSecondConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortSecondConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortSecondConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==7&&secondary_sort==8){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortFourthConfirmCount());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n Collections.sort(fromFile,new SortThirdConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order==2){\n //primary is descending\n Collections.sort(fromFile,new SortFourthConfirmCount());\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n if(primary_sort==8&&secondary_sort==7){\n if(primary_order==1&&secondary_order==1){\n //primary and second is ascending\n \n Collections.sort(fromFile, new SortThirdConfirmCount());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==2&&secondary_order==2){\n //both descending\n Collections.sort(fromFile,new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n \n for(int i=0; i<fromFile.size(); i++){ \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n \n else if(primary_order==1){\n //secondary is descending\n Collections.sort(fromFile, new SortThirdConfirmCount().reversed());\n Collections.sort(fromFile,new SortFourthConfirmCount());\n \n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n }\n }\n else if(primary_order == 2){\n //primary is descending\n Collections.sort(fromFile,new SortThirdConfirmCount());\n Collections.sort(fromFile, new SortFourthConfirmCount().reversed());\n \n for(int i=0; i<fromFile.size(); i++){\n \n System.out.println(fromFile.get(i).printInfo());\n } \n } \n }\n }", "private void translateElements (){\n translate(heading, \"LOGIN_BANNER\");\n translate(typeAndMonthTab, \"TYPE\");\n translate(ScheduleTab, \"CONTACT\");\n translate(LocationTab, \"LOCATION\");\n translate(aidTableColumn, \"ID\");\n translate(titleTableColumn, \"TITLE\");\n translate(descriptionTableColumn, \"DESCRIPTION\");\n translate(typeTableColumn, \"TYPE\");\n translate(startTableColumn, \"START_DATE\");\n translate(endTableColumn, \"END_DATE\");\n translate(cuidTableColumn, \"CUSTOMER_ID\");\n translate(rTypeTotalTableColumn, \"TOTAL\");\n translate(rTypeTableColumn, \"TYPE\");\n translate(rMonthTableColumn, \"MONTH\");\n translate(backButton, \"BACK\");\n translate(headTitle, \"REPORTS\");\n }", "private static String fixSorts(String strIn){\r\n\t // get a matcher object\r\n\t matches = ptrnNumbers.matcher(strIn);\r\n\t while (matches.find()){\r\n\t \tstrIn = strIn.substring(0,matches.start())+\" \"+strPrepend+strIn.substring(matches.start()+1);\r\n\t }\r\n\t //System.out.println(\">>>\"+strIn);\r\n\t\treturn strIn;\r\n\t}", "private void setAtomsToPlace(IAtomContainer ac) {\n\t\tfor (int i = 0; i < ac.getAtomCount(); i++) {\n\t\t\tac.getAtom(i).setFlag(CDKConstants.ISPLACED, true);\n\t\t}\n\t}", "public void populateUtilities(){\n\t\tMainScreen.groups = getGroups();\t//Populate Groups\n\t\tMainScreen.umArray = getUMs();\t\t//Populate Units of Measurement (UMs)\n\t\tMainScreen.locations = new WarehouseLocations();\t//Populate the Locations\n\t\tMainScreen.codeIndexTree = new IndexBTree();\n\t\tMainScreen.nameIndexTree = new IndexBTree();\n\t\tpopulateBinaryTrees();\n\t}", "public void manageTuList() throws Exception\r\n\t\t{\r\n\t\tif(UsefulMethod.isNotEmpty(distributionAlgorithm))tuList.add(RouteGroupLinker.toUpdate.distributionAlgorithm);\r\n\t\tif((members == null) || (members.size() == 0))\r\n\t\t\t{\r\n\t\t\t//Nothing to do\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\ttuList.add(RouteGroupLinker.toUpdate.members);\r\n\t\t\t}\r\n\t\t}", "private void asignarDestinosAScannersHijos() {\n\t\tPasadaPorScanner pasadaPorScannerHija = crearPasadaPorScannerHija();\n\t\tthis.pasadasPorScannerHijas.add(pasadaPorScannerHija);\n\n\t\tfor (Destino destinoAAsignar : this.destinos) {\n\t\t\tPasadaPorScanner ultimaPasadaPorScanner = this.pasadasPorScannerHijas\n\t\t\t\t\t.get(this.pasadasPorScannerHijas.size() - 1);\n\t\t\tif (!this.estaLlenoElScanner(ultimaPasadaPorScanner, destinoAAsignar) || esElUltimoScanner()) {\n\t\t\t\tultimaPasadaPorScanner.agregarDestinoAProcesar(destinoAAsignar);\n\t\t\t\tdestinoAAsignar.agregarNodoPorDondePaso(ultimaPasadaPorScanner.getId());\n\t\t\t} else {\n\t\t\t\tPasadaPorScanner nuevaPasadaPorScanner = crearPasadaPorScannerHija();\n\t\t\t\tnuevaPasadaPorScanner.agregarDestinoAProcesar(destinoAAsignar);\n\t\t\t\tthis.pasadasPorScannerHijas.add(nuevaPasadaPorScanner);\n\t\t\t\tdestinoAAsignar.agregarNodoPorDondePaso(nuevaPasadaPorScanner.getId());\n\t\t\t}\n\t\t}\n\t}", "public ImmutableList<ModuleSplit> mergeApex(\n ImmutableList<ImmutableList<ModuleSplit>> unfusedShards) {\n return unfusedShards.stream().map(this::mergeSingleApexShard).collect(toImmutableList());\n }", "public void sacuvajUFajl(String putanja) {\r\n\t\tSOSacuvajUFajl.izvrsi(putanja, lista);\r\n\t}", "public void metodoInstanciaArbitrariaDeUnTipo2() {\n\t\tString[] lista= {\"cielo\",\"agua\",\"papa\",\"carpintero\",\"taza\",\"ciencia\",\"dedo\",\"mamut\",\"telefono\",\"computadora\",\"maniqui\",\"zapato\"};\n\t\tList<String> palabras=Arrays.asList(lista);\n\t\tpalabras.forEach(String::length);// \n\t\t//forEach recibe un consumidor de solo un parametro, es decir puede ser de la siguiente forma: (palabra)->{}\n\t\t//Pero tambien puede recibir un metodo referencia, en este caso, por ejemplo recibe el metodo length, pero el metodo length se opera sobre una instancia de String.\n\t\t//la firma del metodo length es: public int length() , es decir no recibe parametros, es operado sobre la instanacia del objeto.\n\t\t\n\t\t//Otro caso de referencia arbitraria seria\n\t\tArrays.sort(lista, String::compareToIgnoreCase);\n\t\t//Donde el segundo parametro es un Comparator, en este caso el metodo compareToIgnoreCase es un metodo de instancia, y recibe como parametro otro String para compararse \n\t\t//sobre la instancia del mismo.\n\t\t//definicion del Comparator: int compare(T o1, T o2);\n\t\t//definicion del compareToIgnoreCase: public int compareToIgnoreCase(String str)\n\t\t//La definicion compareToIgnoreCase esta muy cerca de Comparator pero el primero parametro es una instancia y el segundo parametro otra instancia. \n\t}", "private void useInventoryByAI() {\n\t\tChampion AI = currentTask.getCurrentChamp();\n\t\tArrayList<Collectible> inventory = ((Wizard)AI).getInventory();\n\t\tif(inventory.size()>0){\n\t\t\tint randomPotion = (int)(Math.random()*inventory.size());\n\t\t\tcurrentTask.usePotion((Potion)inventory.get(randomPotion));\n\t\t}\n\n\t\t\n\t}", "public void ordenarEquipoPorCiudad(){\n Collections.sort(listaEquipos, Equipo.CompararPorCiudad);\n }", "private void actualizarEnemigosItems() {\n if(estadoMapa== EstadoMapa.RURAL || estadoMapa== EstadoMapa.RURALURBANO ){\n moverCamionetas();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.URBANO || estadoMapa == EstadoMapa.URBANOUNIVERSIDAD){\n moverCarroLujo();\n moverAves();\n }\n if(estadoMapa== EstadoMapa.UNIVERSIDAD){\n moverCarritoGolf();\n moverAves();\n }\n if (estadoMapa == EstadoMapa.SALONES){\n moverLamparas();\n moverSillas();\n }\n actualizaPuntuacion();\n moverTareas();\n moverItemCorazon();\n verificarColisiones();\n verificarMuerte();\n moverItemRayo();\n /*\n IMPLEMENTAR\n\n //moverPajaro();\n //etc\n */\n }", "public static void main(String[] args) {\n\t\tString[] input = {\"wrt\",\"wrf\",\"er\",\"ett\",\"rftt\"};\n\t\tString[] input2 = {\"a\",\"b\",\"a\"};\n\t\tString[] input3 = {\"za\",\"zb\",\"ca\",\"cb\"};\n\t\tSystem.out.println(alienOrder(input3));\n\t}", "private void setProfileUNr(){\n Set<Hole> holeSet = createHoleSetWithUNr();\n\n for (Profile profile:profiles){\n\n for (Hole hole:profile.getHoles()) {\n setHoleUNr(hole,holeSet);\n }\n\n }\n }", "public void avoidBotASs(Set<AS> advertiseToTheseASes) {\n avoidBotAndOtherASs(null, advertiseToTheseASes);\n }", "private void syncProfileNames() {\r\n\t\tfor (int i = 0; i < parsedProfiles.size(); i++) {\r\n\t\t\tparsedProfiles.get(i).setName(tableSelectionPD.getProfileName(i));\r\n\t\t}\r\n\t}", "private void prepareBoard(){\n gameBoard.arrangeShips();\n }", "public void updateACUI() {\n CanDataInfo.CAN_ACInfo mAcInfo = Can.mACInfo;\n Can.mACInfo.Update = 0;\n this.mLeftTemp.setText(mAcInfo.szLtTemp);\n setWindValue(mAcInfo.nWindValue);\n int footWind = mAcInfo.fgDownWind;\n int headWind = mAcInfo.fgParallelWind;\n int winWind = mAcInfo.fgForeWindMode;\n if (i2b(footWind) && i2b(headWind)) {\n setAcMode(1);\n } else if (i2b(headWind)) {\n setAcMode(0);\n } else if (i2b(footWind) && i2b(winWind)) {\n setAcMode(3);\n } else if (i2b(footWind)) {\n setAcMode(2);\n } else if (i2b(winWind)) {\n setAcMode(4);\n } else {\n setAcMode(-1);\n }\n this.mStatusWindow.SetSel(mAcInfo.fgDFBL);\n this.mStatusWindowRear.SetSel(mAcInfo.fgRearLight);\n this.mStatusAc.SetSel(mAcInfo.fgAC);\n this.mStatusAuto.SetSel(mAcInfo.nAutoLight);\n this.mStatusClosed.SetSel(mAcInfo.PWR);\n if (mAcInfo.fgInnerLoop != 0) {\n this.mStatusOutLoop.setStateDrawable(R.drawable.can_rh7_nxh_up, R.drawable.can_rh7_nxh_dn, R.drawable.can_rh7_nxh_dn);\n } else {\n this.mStatusOutLoop.setStateDrawable(R.drawable.can_rh7_wxh_up, R.drawable.can_rh7_wxh_dn, R.drawable.can_rh7_wxh_dn);\n }\n this.mStatusOutLoop.setSelected(true);\n }", "public void sortByAndser() {\r\n\t\tQuestion[][] question2DArray = new Question[displayingList.size()][];\r\n\t\tfor (int i = 0; i < displayingList.size(); i++) {\r\n\t\t\tquestion2DArray[i] = new Question[1];\r\n\t\t\tquestion2DArray[i][0] = displayingList.get(i);\r\n\t\t}\r\n\r\n\t\twhile (question2DArray.length != 1) {\r\n\t\t\tquestion2DArray = (Question[][]) merge2DArray(question2DArray);\r\n\t\t}\r\n\t\tdisplayingList.removeAll(displayingList);\r\n\t\tfor (int i = 0; i < question2DArray[0].length; i++) {\r\n\t\t\tdisplayingList.add(question2DArray[0][i]);\r\n\t\t}\r\n\t}", "public void doAnonymisation() throws Exception {\r\n\t\tDocumentReader csvReader = DocumentReaderFactory.getDocumentReader(\"CSV\",this.in);\r\n\t\tWriter csvWriter = WriterFactory.getDocumentWriter(\"CSV\", out);\r\n\t\tCfgReader descReader = CfgReaderFactory.getCfgReader(\"JSON\",descFilePath);\r\n\t\tCfgReader anonRuleReader = CfgReaderFactory.getCfgReader(\"JSON\",anonFilePath);\r\n\r\n\r\n\t\tLineMetaData lineInit=descReader.initMetaData();\r\n\r\n\t\tLineMetaData lineRef=anonRuleReader.initAnonymisationMetaData(lineInit);\r\n\r\n\t\twhile(csvReader.checkContainingData()==true){\r\n\t\t\tArrayList<String[]> tempLine = csvReader.readMultipleLine(MainPg.blockSize);\r\n\r\n\t\t\tList<String[]> beforWrite = tempLine.stream()\r\n\t\t\t\t.filter((e)->{\r\n\t\t\t\treturn DescTypeMapper.verificationMatchWithDesc(lineRef,e);})\r\n\t\t\t\t.map((e)-> {\r\n\t\t\t\treturn AnonymisationRuleMapper.lineAnonymisation(lineRef,e);})\r\n\t\t\t\t.collect(Collectors.toList());\r\n\t\t\t\r\n\t\t\t//beforWrite.stream().map((e)-> {\r\n\t\t\t//\treturn AnonymisationRuleMapper.lineAnonymisation(lineRef,e);\r\n\t\t\t//}).collect(Collectors.toList());\r\n\t\t\t\r\n\t\t\t/*old version */\r\n\t\t\t//for(int i=0;i<beforWrite.size();i++) {\r\n\t\t\t//\tbeforWrite.set(i, AnonymisationRuleMapper.lineAnonymisation(lineRef,beforWrite.get(i)));\r\n\t\t\t//}\r\n\t\t\tcsvWriter.writeFileFromList(beforWrite);\r\n\t\t}\r\n\r\n\t}", "public void sortYear(){\r\n\r\n\t\t// sort magazines by year inside the items array\r\n Magazine temp; // used for swapping magazines in the array\r\n\t for(int i=0; i<items.size(); i++) {\r\n\r\n\t\t// Check to see the item is a magazine. We will only\r\n\t\t//use magazines.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.MAGAZINE)\r\n\t continue;\r\n\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.MAGAZINE)\r\n\t\t continue;\r\n\t\t // Compare the years of the two magazines\r\n\t if(((Magazine)items.get(i)).getYear() < \r\n\t \t((Magazine)items.get(j)).getYear()) {\r\n\t\t // Swap the items\r\n\t\t temp = (Magazine)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n\t\tfor(int i=0; i<items.size(); i++)\r\n\t\t\tif(items.get(i).getItemType() == Item.ItemTypes.MAGAZINE)\r\n\t\t\t\tSystem.out.println(items.get(i).toString());\r\n }", "private void aretes_aO(){\n\t\tthis.cube[40] = this.cube[7]; \n\t\tthis.cube[7] = this.cube[25];\n\t\tthis.cube[25] = this.cube[46];\n\t\tthis.cube[46] = this.cube[34];\n\t\tthis.cube[34] = this.cube[40];\n\t}", "private void aretes_aR(){\n\t\tthis.cube[13] = this.cube[52]; \n\t\tthis.cube[52] = this.cube[19];\n\t\tthis.cube[19] = this.cube[1];\n\t\tthis.cube[1] = this.cube[28];\n\t\tthis.cube[28] = this.cube[13];\n\t}", "private void updateBattleSides() {\n ArrayList<MovingEntity> convertedEnemies = new ArrayList<MovingEntity>();\n ArrayList<MovingEntity> convertedAllies = new ArrayList<MovingEntity>();\n for (MovingEntity e: battleEnemies) {\n // check converting enemies to allies\n if (e.isFriendly() == true) {\n convertedEnemies.add(e);\n }\n }\n // convert here to avoid ConcurrentModificationException\n for (MovingEntity converted: convertedEnemies) {\n checkSideSwap(converted, true, battleAllies, targetAllies, battleEnemies, targetEnemies);\n }\n for (MovingEntity e: battleAllies) {\n // check converting allies to enemies\n if (e.isFriendly() == false) {\n convertedAllies.add(e);\n }\n }\n for (MovingEntity converted: convertedAllies) {\n checkSideSwap(converted, false, battleEnemies, targetEnemies, battleAllies, targetAllies);\n }\n }", "public void orderAlphabet(){\n market.orderAlphabet();\n car = market.products;\n }", "private void aumentaCapacidade(){\n\t\tif(this.tamanho == this.elementos.length){\n\t\t\tObject[] elementosNovos = new Object[this.elementos.length*2];\n\t\t\tfor(int i =0; i<this.elementos.length;i++){\n\t\t\t\telementosNovos[i]=this.elementos[i];\n\t\t\t}\n\t\t\tthis.elementos=elementosNovos;\n\t\t}\n\t}", "private void kasvata() {\n T[] uusi = (T[]) new Object[this.arvot.length * 3 / 2 + 1];\n for (int i = 0; i < this.arvot.length; i++) {\n uusi[i] = this.arvot[i];\n }\n this.arvot = uusi;\n }" ]
[ "0.567464", "0.5586399", "0.52081966", "0.5181528", "0.505425", "0.49554828", "0.49282646", "0.49146596", "0.491059", "0.48640376", "0.4855576", "0.4850782", "0.4842501", "0.48289612", "0.48173115", "0.47900292", "0.47395033", "0.4730408", "0.47192115", "0.46937966", "0.4672301", "0.46541703", "0.46452016", "0.46352303", "0.46290213", "0.45937684", "0.4586894", "0.4581552", "0.45806545", "0.45760837", "0.45637602", "0.4543915", "0.4542315", "0.45237345", "0.45170817", "0.45170084", "0.4504611", "0.45010528", "0.44993475", "0.44981077", "0.44978184", "0.4494662", "0.4492814", "0.44843793", "0.4483654", "0.4480565", "0.44743538", "0.44740984", "0.44666272", "0.44628477", "0.44589752", "0.4456561", "0.44561788", "0.4449875", "0.4447216", "0.44401857", "0.4430962", "0.44278845", "0.4415141", "0.4414922", "0.44134435", "0.44099453", "0.44000894", "0.43990037", "0.43958393", "0.43918756", "0.43875083", "0.4376634", "0.43761304", "0.43747807", "0.43732628", "0.43712804", "0.43692416", "0.43649837", "0.436304", "0.43622938", "0.43609363", "0.43543795", "0.43533587", "0.43508956", "0.43421307", "0.4341317", "0.4340291", "0.4339143", "0.43303615", "0.43277058", "0.43272167", "0.4319383", "0.4318561", "0.43182892", "0.4318119", "0.43156752", "0.43152204", "0.43147302", "0.430854", "0.43070972", "0.43051922", "0.4304602", "0.43042442", "0.4302571" ]
0.60102755
0
Rearranges AUs according to the publisher
public static TreeMap<String, TreeSet<ArchivalUnit>> orderAusByPublisher(Collection<ArchivalUnit> allAus) { Iterator<ArchivalUnit> itr = allAus.iterator(); TreeMap<String, TreeSet<ArchivalUnit>> ausMap = new TreeMap<String, TreeSet<ArchivalUnit>>(); while (itr.hasNext()) { ArchivalUnit au = itr.next(); String publisher = AuUtil.getTitleAttribute(au, "publisher"); if (publisher == null) { publisher = "unknown publisher"; } if (ausMap.containsKey(publisher)) { TreeSet<ArchivalUnit> auSet = (TreeSet) ausMap.get(publisher); auSet.add(au); } else { TreeSet<ArchivalUnit> auSet = new TreeSet<ArchivalUnit>(new AuOrderComparator()); auSet.add(au); ausMap.put(publisher, auSet); } } return ausMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void transformToACORDSimplified(APDataCollection apData) throws APDataCollectionTransformationException {\n\n\t\tlocationAddresses = collectLocationAddresses(apData);\n\n\t\ttransformSymbols(apData);\n\n\t\t// Perform all transformations involving CommlVeh element iteration\n\t\ttransformVehicles(apData);\n\n\t\tmoveVehicleToRateState(apData);\n\t\t\n\t\tupdateBISPLPropDam(apData);\n\t\t\n\t\tsetVehicleUMISPCoverages(apData);\n\t\t\n\t\tsetVehicleMEDPMCoverages(apData);\n\t}", "private void addApartmentNames() {\n apartmentNamesAdapter.clear();\n for (ApartmentNamesInUnivs university : apartmentNamesInUnivs) {\n\n if (university.getUniversityName().equals(universityNamesSpinner.getSelectedItem().toString())) {\n\n for (ApartmentNamesWithType aptName : university.getApartmentNames()) {\n\n if (aptName.getApartmentType().equals(UrlGenerator.getApartmentTypeCodeMap().get(apartmentTypeSpinner.getSelectedItem().toString())))\n\n apartmentNamesAdapter.add(aptName.getApartmentName());\n }\n }\n }\n }", "public void sortDNAs() {\n DNAs = TLArrayList.sort(DNAs);\n }", "public void convertHashtoArray(ArrayList<Manufacturer> manu){\r\n\t\tfor(Manufacturer d: manu){\r\n\t\tManlist.add(t.get(d.code));\r\n\t\t}\r\n\t}", "private static void getSortedusinStream(String[]...array) {\n\t\t\n\n\n\t\tList<String> result = new ArrayList<>();\n\n\t\tStream.of(array)\n\t\t\t\t.flatMap(Stream::of)\n\t\t\t\t.map(x -> (String)x)\n\t\t\t\t.sorted()\n\t\t\t\t.forEach(result::add);\n\n\t\tSystem.out.println(Arrays.toString(result.toArray(new String[0])));\n\t\t\n//\t\tList<String> list = new ArrayList<>();\n//\n//\t\tfor (String[] arra : array)\n//\t\t\tCollections.addAll(list, arra);\n//\n//\t\tCollections.sort(list);\n//\t\tSystem.out.println(Arrays.toString( list.toArray(new String[0])));\n\t\t\n\t\t\n\t\t // Function to merge two arrays of \n// // same type \n// return Stream.concat(Arrays.stream(a), \n// Arrays.stream(b)) \n// .toArray();\n\t\t\n\t\t\n//\t\treturn IntStream.concat(Arrays.stream(array1), Arrays.stream(array2))\n// .sorted()\n// .toArray();\n\n\t}", "private static void copyToPNU(ParsedAuthorship pn, ParsedNameUsage pnu, IssueContainer issues){\n pnu.getName().setCombinationAuthorship(pn.getCombinationAuthorship());\n pnu.getName().setSanctioningAuthor(pn.getSanctioningAuthor());\n pnu.getName().setBasionymAuthorship(pn.getBasionymAuthorship());\n // propagate notes and unparsed bits found in authorship if not already existing\n setIfNull(pn.getNomenclaturalNote(), pnu.getName()::getNomenclaturalNote, pnu.getName()::setNomenclaturalNote);\n setIfNull(pn.getPublishedIn(), pnu::getPublishedIn, pnu::setPublishedIn);\n setIfNull(pn.getTaxonomicNote(), pnu::getTaxonomicNote, pnu::setTaxonomicNote);\n if (pn.getUnparsed() != null) {\n pnu.getName().setUnparsed(pn.getUnparsed());\n }\n if (pn.isExtinct()) {\n pnu.setExtinct(pn.isExtinct());\n }\n if (pn.isManuscript()) {\n pnu.getName().setNomStatus(NomStatus.MANUSCRIPT);\n }\n\n // issues\n switch (pn.getState()) {\n case PARTIAL:\n issues.addIssue(Issue.PARTIALLY_PARSABLE_NAME);\n break;\n case NONE:\n issues.addIssue(Issue.UNPARSABLE_NAME);\n break;\n }\n\n if (pn.isDoubtful()) {\n issues.addIssue(Issue.DOUBTFUL_NAME);\n }\n // translate warnings into issues\n for (String warn : pn.getWarnings()) {\n if (WARN_TO_ISSUE.containsKey(warn)) {\n issues.addIssue(WARN_TO_ISSUE.get(warn));\n } else {\n LOG.debug(\"Unknown parser warning: {}\", warn);\n }\n }\n }", "private void convertCldrItems(String outDirname, String pathPrefix)\n throws IOException, ParseException {\n // zone and timezone items are queued for sorting first before they are\n // processed.\n\n for (JSONSection js : sections) {\n ArrayList<CldrItem> sortingItems = new ArrayList<CldrItem>();\n ArrayList<CldrItem> arrayItems = new ArrayList<CldrItem>();\n\n ArrayList<String> out = new ArrayList<String>();\n ArrayList<CldrNode> nodesForLastItem = new ArrayList<CldrNode>();\n String lastLeadingArrayItemPath = null;\n String leadingArrayItemPath = \"\";\n int valueCount = 0;\n String previousIdentityPath = null;\n List<CldrItem> theItems = sectionItems.get(js);\n if (theItems == null || theItems.size() == 0) {\n continue;\n }\n for (CldrItem item : theItems) {\n // items in the identity section of a file should only ever contain the lowest level, even if using\n // resolving source, so if we have duplicates ( caused by attributes used as a value ) then suppress\n // them here.\n if (item.getPath().contains(\"/identity/\")) {\n String[] parts = item.getPath().split(\"\\\\[\");\n if (parts[0].equals(previousIdentityPath)) {\n continue;\n } else {\n previousIdentityPath = parts[0];\n }\n }\n\n // some items need to be split to multiple item before processing. None\n // of those items need to be sorted.\n CldrItem[] items = item.split();\n if (items == null) {\n items = new CldrItem[1];\n items[0] = item;\n }\n valueCount += items.length;\n\n for (CldrItem newItem : items) {\n // alias will be dropped in conversion, don't count it.\n if (newItem.isAliasItem()) {\n valueCount--;\n }\n\n // Items like zone items need to be sorted first before write them out.\n if (newItem.needsSort()) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n sortingItems.add(newItem);\n } else {\n Matcher matcher = LdmlConvertRules.ARRAY_ITEM_PATTERN.matcher(\n newItem.getPath());\n if (matcher.matches()) {\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n leadingArrayItemPath = matcher.group(1);\n if (lastLeadingArrayItemPath != null &&\n !lastLeadingArrayItemPath.equals(leadingArrayItemPath)) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n lastLeadingArrayItemPath = leadingArrayItemPath;\n arrayItems.add(newItem);\n } else {\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n outputCldrItem(out, nodesForLastItem, newItem);\n lastLeadingArrayItemPath = \"\";\n }\n }\n }\n }\n\n resolveSortingItems(out, nodesForLastItem, sortingItems);\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n\n closeNodes(out, nodesForLastItem.size() - 2, 0);\n String outFilename;\n outFilename = js.section + \".json\";\n writeToFile(outDirname, outFilename, out);\n\n System.out.println(String.format(\" %s = %d values\", outFilename, valueCount));\n }\n }", "public void sortYear(){\r\n\r\n\t\t// sort magazines by year inside the items array\r\n Magazine temp; // used for swapping magazines in the array\r\n\t for(int i=0; i<items.size(); i++) {\r\n\r\n\t\t// Check to see the item is a magazine. We will only\r\n\t\t//use magazines.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.MAGAZINE)\r\n\t continue;\r\n\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.MAGAZINE)\r\n\t\t continue;\r\n\t\t // Compare the years of the two magazines\r\n\t if(((Magazine)items.get(i)).getYear() < \r\n\t \t((Magazine)items.get(j)).getYear()) {\r\n\t\t // Swap the items\r\n\t\t temp = (Magazine)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n\t\tfor(int i=0; i<items.size(); i++)\r\n\t\t\tif(items.get(i).getItemType() == Item.ItemTypes.MAGAZINE)\r\n\t\t\t\tSystem.out.println(items.get(i).toString());\r\n }", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "public void reorganizeNote() {\n note = Position.orderList(note);\n }", "private static void addToPublisherTable(String publisher, String bookTitle) {\n\t\tif(ALL_PUBLISHERS.containsKey(publisher))\n\t\t\tALL_PUBLISHERS.get(publisher).add(bookTitle);\n\t\t/*put publisher as a new key in ALL_AUTHORS*/\n\t\telse{\n\t\t\tHashSet<String> bookTitles_list = new HashSet<String>();\n\t\t\tbookTitles_list.add(bookTitle);\n\t\t\tALL_PUBLISHERS.put(publisher, bookTitles_list);\n\t\t}\n\t\t\n\t}", "public void topicsAdvertisedByPub() {\r\n int index = 1;\r\n System.out.println(\"Topics advertised by this publisher: \");\r\n for(Topic topic: pubTopics){\r\n System.out.println(index + \"->\" + topic + \"\\n\");\r\n index++;\r\n }\r\n }", "public void sortAuthor(){\r\n \r\n Book temp; // used for swapping books in the array\r\n for(int i=0; i<items.size(); i++) {\r\n\r\n\t // Check to see the item is a book. We will only\r\n //use books.\r\n\t if(items.get(i).getItemType() != Item.ItemTypes.BOOK)\r\n\t continue;\r\n\t\t\t\t\t\r\n\t for(int j=i+1; j<items.size(); j++) {\r\n\t\t // We consider only books\r\n\t // We consider only magazines\r\n\t if(items.get(j).getItemType() != Item.ItemTypes.BOOK)\r\n\t\t continue;\r\n\t\t // Compare the authors of the two books\r\n\t if(((Book)items.get(i)).getAuthor().compareTo(((Book)items.get(j)).getAuthor()) > 0) {\r\n\t\t // Swap the items\r\n\t\t temp = (Book)items.get(i);\r\n\t\t items.remove(i);\r\n\t\t items.add(i, items.get(j-1));\r\n\t\t items.remove(j);\r\n\t\t items.add(j, temp);\r\n\t }\r\n\t }\r\n\t }\r\n\t\t// Print the magazines\r\n for(int i=0; i<items.size(); i++)\r\n\t if(items.get(i).getItemType() == Item.ItemTypes.BOOK)\r\n\t\tSystem.out.println(items.get(i).toString());\r\n \t\r\n }", "public static TreeMap<Plugin, TreeSet<ArchivalUnit>> orderAusByPlugin(Collection<ArchivalUnit> allAus) {\n Iterator itr = allAus.iterator();\n TreeMap<Plugin, TreeSet<ArchivalUnit>> ausMap =\n new TreeMap<Plugin, TreeSet<ArchivalUnit>>(new PluginComparator());\n while (itr.hasNext()) {\n ArchivalUnit au = (ArchivalUnit) itr.next();\n Plugin plugin = au.getPlugin();\n if (ausMap.containsKey(plugin)) {\n TreeSet<ArchivalUnit> auSet = (TreeSet) ausMap.get(plugin);\n auSet.add(au);\n } else {\n TreeSet<ArchivalUnit> auSet =\n new TreeSet<ArchivalUnit>(new AuOrderComparator());\n auSet.add(au);\n ausMap.put(plugin, auSet);\n }\n }\n return ausMap;\n }", "@Override\n\tpublic void reorganize() {\n\n\t}", "public void rotateMopubId() {\n if (this.mAdInfo.mAdvertisingId.endsWith(\"10ca1ad1abe1\")) {\n MoPubLog.setLogLevel(MoPubLog.LogLevel.DEBUG);\n }\n if (!this.mAdInfo.isRotationRequired()) {\n setAdvertisingInfo(this.mAdInfo);\n } else {\n setAdvertisingInfo(AdvertisingId.generateFreshAdvertisingId());\n }\n }", "private void justifyCargo() {\n TradeGoods[] temp = new TradeGoods[cargo.length];\n int current = 0;\n for (TradeGoods t:cargo) {\n if (t != null) {\n temp[current] = t;\n current++;\n }\n }\n }", "static void sort (String[] A, int L, int U) {\n\t\tif (L < U) {\n\t\t\tint k = indexOfLargest(A, L, U);\n\t\t\tString tmp = A[k]; A[k] = A[U]; A[U] = tmp;\n\t\t\tsort(A, L, U-1);\n\t\t}\n\t}", "public void manageTuList() throws Exception\r\n\t\t{\r\n\t\tif(UsefulMethod.isNotEmpty(distributionAlgorithm))tuList.add(RouteGroupLinker.toUpdate.distributionAlgorithm);\r\n\t\tif((members == null) || (members.size() == 0))\r\n\t\t\t{\r\n\t\t\t//Nothing to do\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\ttuList.add(RouteGroupLinker.toUpdate.members);\r\n\t\t\t}\r\n\t\t}", "public void copyFrom(SAUAL50S_OA orig)\n {\n OutUnqassGrp_MA = orig.OutUnqassGrp_MA;\n for(int a = 0; a < 100; a++)\n {\n OutUnqassGrp_AC[a] = orig.OutUnqassGrp_AC[a];\n OutGUniqueAssignmentYear_AT[a] = orig.OutGUniqueAssignmentYear_AT[a];\n OutGUniqueAssignmentYear_AS[a] = orig.OutGUniqueAssignmentYear_AS[a];\n OutGUniqueAssignmentYear[a] = orig.OutGUniqueAssignmentYear[a];\n OutGUniqueAssignmentPeriod_AT[a] = orig.OutGUniqueAssignmentPeriod_AT[a];\n OutGUniqueAssignmentPeriod_AS[a] = orig.OutGUniqueAssignmentPeriod_AS[a];\n OutGUniqueAssignmentPeriod[a] = orig.OutGUniqueAssignmentPeriod[a];\n OutGUniqueAssignmentUniqueNr_AT[a] = orig.OutGUniqueAssignmentUniqueNr_AT[\n a];\n OutGUniqueAssignmentUniqueNr_AS[a] = orig.OutGUniqueAssignmentUniqueNr_AS[\n a];\n OutGUniqueAssignmentUniqueNr[a] = orig.OutGUniqueAssignmentUniqueNr[a];\n OutGUniqueAssignmentMkStudyUnitCode_AT[a] = \n orig.OutGUniqueAssignmentMkStudyUnitCode_AT[a];\n OutGUniqueAssignmentMkStudyUnitCode_AS[a] = \n orig.OutGUniqueAssignmentMkStudyUnitCode_AS[a];\n OutGUniqueAssignmentMkStudyUnitCode[a] = \n orig.OutGUniqueAssignmentMkStudyUnitCode[a];\n OutGUniqueAssignmentAssignmentNr_AT[a] = \n orig.OutGUniqueAssignmentAssignmentNr_AT[a];\n OutGUniqueAssignmentAssignmentNr_AS[a] = \n orig.OutGUniqueAssignmentAssignmentNr_AS[a];\n OutGUniqueAssignmentAssignmentNr[a] = \n orig.OutGUniqueAssignmentAssignmentNr[a];\n OutGUniqueAssignmentNrOfQuestions_AT[a] = \n orig.OutGUniqueAssignmentNrOfQuestions_AT[a];\n OutGUniqueAssignmentNrOfQuestions_AS[a] = \n orig.OutGUniqueAssignmentNrOfQuestions_AS[a];\n OutGUniqueAssignmentNrOfQuestions[a] = \n orig.OutGUniqueAssignmentNrOfQuestions[a];\n OutGUniqueAssignmentType_AT[a] = orig.OutGUniqueAssignmentType_AT[a];\n OutGUniqueAssignmentType_AS[a] = orig.OutGUniqueAssignmentType_AS[a];\n OutGUniqueAssignmentType[a] = orig.OutGUniqueAssignmentType[a];\n OutGUniqueAssignmentNegativeMarkFactor_AT[a] = \n orig.OutGUniqueAssignmentNegativeMarkFactor_AT[a];\n OutGUniqueAssignmentNegativeMarkFactor_AS[a] = \n orig.OutGUniqueAssignmentNegativeMarkFactor_AS[a];\n OutGUniqueAssignmentNegativeMarkFactor[a] = \n orig.OutGUniqueAssignmentNegativeMarkFactor[a];\n OutGUniqueAssignmentMaxCredits_AT[a] = \n orig.OutGUniqueAssignmentMaxCredits_AT[a];\n OutGUniqueAssignmentMaxCredits_AS[a] = \n orig.OutGUniqueAssignmentMaxCredits_AS[a];\n OutGUniqueAssignmentMaxCredits[a] = orig.OutGUniqueAssignmentMaxCredits[a]\n ;\n OutGUniqueAssignmentCreditSystem_AT[a] = \n orig.OutGUniqueAssignmentCreditSystem_AT[a];\n OutGUniqueAssignmentCreditSystem_AS[a] = \n orig.OutGUniqueAssignmentCreditSystem_AS[a];\n OutGUniqueAssignmentCreditSystem[a] = \n orig.OutGUniqueAssignmentCreditSystem[a];\n OutGUniqueAssignmentPassMarkPercentage_AT[a] = \n orig.OutGUniqueAssignmentPassMarkPercentage_AT[a];\n OutGUniqueAssignmentPassMarkPercentage_AS[a] = \n orig.OutGUniqueAssignmentPassMarkPercentage_AS[a];\n OutGUniqueAssignmentPassMarkPercentage[a] = \n orig.OutGUniqueAssignmentPassMarkPercentage[a];\n OutGUniqueAssignmentClosingDate_AT[a] = \n orig.OutGUniqueAssignmentClosingDate_AT[a];\n OutGUniqueAssignmentClosingDate_AS[a] = \n orig.OutGUniqueAssignmentClosingDate_AS[a];\n OutGUniqueAssignmentClosingDate[a] = orig.OutGUniqueAssignmentClosingDate[\n a];\n OutGUniqueAssignmentCompulsory_AT[a] = \n orig.OutGUniqueAssignmentCompulsory_AT[a];\n OutGUniqueAssignmentCompulsory_AS[a] = \n orig.OutGUniqueAssignmentCompulsory_AS[a];\n OutGUniqueAssignmentCompulsory[a] = orig.OutGUniqueAssignmentCompulsory[a]\n ;\n OutGUniqueAssignmentTsaUniqueNr_AT[a] = \n orig.OutGUniqueAssignmentTsaUniqueNr_AT[a];\n OutGUniqueAssignmentTsaUniqueNr_AS[a] = \n orig.OutGUniqueAssignmentTsaUniqueNr_AS[a];\n OutGUniqueAssignmentTsaUniqueNr[a] = orig.OutGUniqueAssignmentTsaUniqueNr[\n a];\n OutGYearMarkCalculationType_AT[a] = orig.OutGYearMarkCalculationType_AT[a]\n ;\n OutGYearMarkCalculationType_AS[a] = orig.OutGYearMarkCalculationType_AS[a]\n ;\n OutGYearMarkCalculationType[a] = orig.OutGYearMarkCalculationType[a];\n OutGYearMarkCalculationNormalWeight_AT[a] = \n orig.OutGYearMarkCalculationNormalWeight_AT[a];\n OutGYearMarkCalculationNormalWeight_AS[a] = \n orig.OutGYearMarkCalculationNormalWeight_AS[a];\n OutGYearMarkCalculationNormalWeight[a] = \n orig.OutGYearMarkCalculationNormalWeight[a];\n OutGYearMarkCalculationOptionalityGc3_AT[a] = \n orig.OutGYearMarkCalculationOptionalityGc3_AT[a];\n OutGYearMarkCalculationOptionalityGc3_AS[a] = \n orig.OutGYearMarkCalculationOptionalityGc3_AS[a];\n OutGYearMarkCalculationOptionalityGc3[a] = \n orig.OutGYearMarkCalculationOptionalityGc3[a];\n }\n }", "@Override\n public void align(@NonNull PbVnAlignment alignment) {\n boolean noAgentiveA0 = alignment.proposition().predicate().ancestors(true).stream()\n .allMatch(s -> s.roles().stream()\n .map(r -> ThematicRoleType.fromString(r.type()).orElse(ThematicRoleType.NONE))\n .noneMatch(ThematicRoleType::isAgentive));\n\n for (PropBankPhrase phrase : alignment.sourcePhrases(false)) {\n List<NounPhrase> unaligned = alignment.targetPhrases(false).stream()\n .filter(i -> i instanceof NounPhrase)\n .map(i -> ((NounPhrase) i))\n .collect(Collectors.toList());\n if (phrase.getNumber() == ArgNumber.A0) {\n // TODO: seems like a hack\n if (alignment.proposition().predicate().verbNetId().classId().startsWith(\"51\") && noAgentiveA0) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (EnumSet.of(ThematicRoleType.AGENT, ThematicRoleType.CAUSER,\n ThematicRoleType.STIMULUS, ThematicRoleType.PIVOT)\n .contains(unalignedPhrase.thematicRoleType())) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A1) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME\n || unalignedPhrase.thematicRoleType() == ThematicRoleType.PATIENT) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A3) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isStartingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A4) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isEndingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n\n\n }\n }", "public static void viewPatientsStoredInAlphabetical() {\n\r\n String[] alphabeticalOrder = new String[6]; //Creates an array called 'alphabeticalOrder'\r\n for (int y=0; y<firstName.length; y++) {\r\n alphabeticalOrder[y] = firstName[y]; //Getting values from the 'vaccinationCenter' array and passing them to the 'alphabeticalOrder' array\r\n }\r\n for(int a=0; a<(alphabeticalOrder.length-1); a++)\r\n {\r\n for(int b=a+1; b<alphabeticalOrder.length; b++)\r\n {\r\n if((alphabeticalOrder[a].toLowerCase(Locale.ROOT)).compareTo(alphabeticalOrder[b].toLowerCase(Locale.ROOT))> 0)\r\n {\r\n String temp = alphabeticalOrder[a];\r\n alphabeticalOrder[a] = alphabeticalOrder[b];\r\n alphabeticalOrder[b] = temp;\r\n //Sorted elements of the array to alphabetical order\r\n }\r\n }\r\n }\r\n System.out.println(Arrays.toString(alphabeticalOrder));\r\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 void avoidBotAndOtherASs(Set<Integer> ASesToLieAbout, Set<AS> advertiseToTheseASes) {\n BGPPath pathOfMerit = new BGPPath(this.asn * -1);\n\n /*\n * Lying reverse poison, prepend bot ASes\n */\n for (Integer tAS : this.botSet) {\n pathOfMerit.appendASToPath(tAS);\n }\n\n /*\n * If we have ASs to lie about apart from the critical side AS, do it here\n */\n if (ASesToLieAbout != null && !(ASesToLieAbout.isEmpty())) {\n for (Integer tAS : ASesToLieAbout) {\n pathOfMerit.appendASToPath((tAS));\n }\n }\n\n pathOfMerit.prependASToPath(this.asn);\n\n // If we don't have a specific AS set to advertise out to, advertise to all interfaces.\n if (advertiseToTheseASes == null || advertiseToTheseASes.isEmpty()) {\n\n /*\n * Advertise to all of our customers\n */\n for (AS tCust : this.customers) {\n tCust.advPath(pathOfMerit);\n }\n\n /*\n * Since this is a hole punched route, we always advertise to peers and prov\n */\n for (AS tPeer : this.peers) {\n tPeer.advPath(pathOfMerit);\n }\n\n for (AS tProv : this.providers) {\n tProv.advPath(pathOfMerit);\n }\n\n /*\n * Update the adj-out-rib with the correct set of ASes we have\n * adverstised the current best path to\n */\n\n Set<AS> newAdvTo = new HashSet<>();\n\n newAdvTo.addAll(this.customers);\n newAdvTo.addAll(this.peers);\n newAdvTo.addAll(this.providers);\n\n this.adjOutRib.put(this.asn * -1, newAdvTo);\n } else {\n for (AS tAS : advertiseToTheseASes) {\n tAS.advPath(pathOfMerit);\n }\n\n Set<AS> newAdvTo = new HashSet<>();\n\n newAdvTo.addAll(advertiseToTheseASes);\n\n this.adjOutRib.put(this.asn * -1, newAdvTo);\n }\n }", "public static void main(String[] args) {\n\t\tString[] input = {\"wrt\",\"wrf\",\"er\",\"ett\",\"rftt\"};\n\t\tString[] input2 = {\"a\",\"b\",\"a\"};\n\t\tString[] input3 = {\"za\",\"zb\",\"ca\",\"cb\"};\n\t\tSystem.out.println(alienOrder(input3));\n\t}", "static List<AffinityGroup> setsToAffinityGroups(Set<Set<Guid>> uag) {\n List<AffinityGroup> output = new ArrayList<>();\n\n for(Set<Guid> s : uag) {\n AffinityGroup temp = new AffinityGroup();\n temp.setVmAffinityRule(EntityAffinityRule.POSITIVE);\n List<Guid> entities = new ArrayList<>();\n\n entities.addAll(s);\n temp.setVmIds(entities);\n output.add(temp);\n }\n\n return output;\n }", "private void rearrangeSolution() {\r\n List<Integer> trinity = new ArrayList<Integer>();\r\n trinity.add(0); trinity.add(1); trinity.add(2);\r\n permutateDigits();\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapRow(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapCol(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n }", "java.lang.String getUa();", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "@Override\n\tpublic void transform(APDataCollection apData, TargetFormat targetFormat, Element customParameters)\n\t\t\tthrows APDataCollectionTransformationException {\n\n\t\tif (targetFormat.equals(TargetFormat.ACORDSimplified)) {\n\t\t\ttransformToACORDSimplified(apData);\n\t\t}\n\t}", "public void setPublisher(String publisher) {\n\tthis.publisher = publisher;\n}", "public String[] getPublisher() {\n/* 254 */ return getStringArray(\"publisher\");\n/* */ }", "private void adjustMessierData()\n\t{\n\t\tfor(int i = 0; i < messierList.size(); i++)\n\t\t{\n\t\t\tMessier aMessier = messierList.get(i);\n\t\t\tdouble rightAsc = aMessier.getRADecimalHour();\n\t\t\tdouble hourAngle = theCalculator.findHourAngle(rightAsc, userLocalTime);\n\t\t\taMessier.setHourAngle(hourAngle);\n\t\t\tmessierList.set(i, aMessier);\n\t\t}\n\t}", "public void carregarAno() {\n\t\tif (usuario.getOrganizacaoMilitar().toString().equals(\"AMAN\")){\n\t\t\tano.addAll(Arrays.asList(Ano.values()));\n\t\t}\n\t\telse if (usuario.getOrganizacaoMilitar().toString().equals(\"ECEME\")){\n\t\t\tano.addAll(Arrays.asList(Ano.values()));\n\t\t\tano.remove(Ano.TERCEIRO);\n\t\t\tano.remove(Ano.QUARTO);\n\t\t}\n\t\telse{\n\t\t\tcarregarRegistroDoPrimeiroAno();\n\t\t}\n\t}", "private void setUpRelations() {\n g[0].getAuthorities().add(a[0]);\n g[1].getAuthorities().add(a[0]);\n g[1].getAuthorities().add(a[1]);\n g[2].getAuthorities().add(a[2]);\n\n u[0].getGroups().add(g[0]);\n u[0].getOwnAuthorities().add(a[2]);\n u[1].getGroups().add(g[1]);\n u[1].getOwnAuthorities().add(a[2]);\n u[2].getOwnAuthorities().add(a[2]);\n u[2].getOwnAuthorities().add(a[3]);\n u[3].getGroups().add(g[1]);\n u[3].getGroups().add(g[2]);\n merge();\n }", "private void combineUids(@NonNull NetworkCapabilities nc) {\n if (null == nc.mUids || null == mUids) {\n mUids = null;\n return;\n }\n mUids.addAll(nc.mUids);\n }", "public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }", "public void updateOwners() {\n\t\tbuyOrder.getOwner().executedOrder(buyOrder,this);\n\t\tsellOrder.getOwner().executedOrder(sellOrder,this);\n\t}", "private static void changeSubjectOrder(ArrayList<Integer> index_order) {\n for(Subject subject: subjects) {\n subject.setIndex(index_order.indexOf(subject.getIndex()));\n }\n }", "private void populateOrganizations() {\n\t\tMatContext.get().getAdminService().getAllOrganizations(new AsyncCallback<ManageOrganizationSearchModel>() {\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\t\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void onSuccess(ManageOrganizationSearchModel model) {\n\t\t\t\tList<Result> results = model.getData();\n\t\t\t\tdetailDisplay.populateOrganizations(results);\n\t\t\t\t\n\t\t\t\tMap<String, Result> orgMap = new HashMap<String, Result>();\n\t\t\t\tfor(Result organization : results) {\n\t\t\t\t\torgMap.put(organization.getId(), organization);\n\t\t\t\t}\n\t\t\t\tdetailDisplay.setOrganizationsMap(orgMap);\n\t\t\t\t\n\t\t\t\tsetUserDetailsToView();\n\t\t\t}\n\t\t});\n\t}", "private static void assignMembersOwnersToMemberships(Collection<Object[]> membershipArrays) {\r\n for (Object[] membershipArray : GrouperUtil.nonNull(membershipArrays)) {\r\n assignMemberOwnerToMembership(membershipArray);\r\n } \r\n }", "protected void arrangeBestOrder ()\n \t{\n \t\tObject[] duplLoans = null;\n \t\ttry\n \t\t{\n \t\t\tduplLoans = theLoanList.popFirstDuplicates();\n \t\t}\n \t\tcatch (NoSuchElementException ex)\n \t\t{\n \t\t\tlog.error(\"The list of duplicate loan lists is empty\");\n \t\t\treturn;\n \t\t}\n \n \t\tDuplicateLoanDataVO bestSourceLoan = null;\n \t\tDuplicateLoanDataVO firstDataVO = null;\n \t\tDuplicateLoanDataVO nextDataVO = null;\n \t\tString xmlValue = null;\n \t\tString apsId1 = null;\n \t\tString providerType1 = null;\n \t\tString apsId2 = null;\n \t\tString providerType2 = null;\n \n \t\tfor (int ndx = 1; ndx < duplLoans.length; ndx++)\n \t\t{\n \t\t\tfirstDataVO = (DuplicateLoanDataVO)duplLoans[0];\n \t\t\tnextDataVO = (DuplicateLoanDataVO)duplLoans[ndx];\n \n \t\t\tapsId1 = firstDataVO.getAwardId();\n \t\t\tproviderType1 = firstDataVO.getProviderType();\n \t\t\tapsId2 = nextDataVO.getAwardId();\n \t\t\tproviderType2 = nextDataVO.getProviderType();\n \n \t\t\tif (apsId1 == null)\n \t\t\t{\n \t\t\t\tapsId1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tfirstDataVO.setAwardId(apsId1);\n \t\t\t}\n \n \t\t\tif (providerType1 == null)\n \t\t\t{\n \t\t\t\tproviderType1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tfirstDataVO.setProviderType(providerType1);\n \t\t\t}\n \n \t\t\tif (apsId2 == null)\n \t\t\t{\n \t\t\t\tapsId2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tnextDataVO.setAwardId(apsId2);\n \t\t\t}\n \n \t\t\tif (providerType2 == null)\n \t\t\t{\n \t\t\t\tproviderType2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tnextDataVO.setProviderType(providerType2);\n \t\t\t}\n \n \t\t\tif (log.isDebugEnabled())\n \t\t\t{\n \t\t\t\tlog.debug(\"Comparing Award ID: \" + apsId1 + \" with provider type '\" + providerType1 +\n \t\t\t\t \"' to Award ID: \" + apsId2 + \" with provider type '\" + providerType2 + \"' \");\n \t\t\t}\n \n \t\t\tbestSourceLoan = determineBestSource(firstDataVO, nextDataVO);\n \t\t\tif (bestSourceLoan != null && bestSourceLoan == nextDataVO)\n \t\t\t{\n \t\t\t\t// we need to rearrange things so that the \"best\" is at\n \t\t\t\t// the \"head\" of the array (element 0).\n \n \t\t\t\tDuplicateLoanDataVO best = (DuplicateLoanDataVO)duplLoans[ndx];\n \t\t\t\tduplLoans[ndx] = duplLoans[0];\n \t\t\t\tduplLoans[0] = best;\n \n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = nextDataVO.getAwardId();\n \t\t\t\t\tString providerType = nextDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is now the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = firstDataVO.getAwardId();\n \t\t\t\t\tString providerType = firstDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is still the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\ttheLoanList.pushLastDuplicates(duplLoans);\n \t}", "public void automerge() {\n\t\tif (automerge) {\n\t\t\tfor(int i = 0; i<create_modifier+1;i++) {\n\t\t\t\tmerge();\n\t\t\t}\n\t\tif(autoidentify) {\n\t\t\tauto_identify_crystal(autoIdentifyTier); // replace this eventually\n\t\t}\n\t\t\t//collection();\n\t\t}\n\t}", "public void parseAuthorshipIntoName(ParsedNameUsage pnu, final String authorship, IssueContainer v){\n // try to add an authorship if not yet there\n if (!Strings.isNullOrEmpty(authorship)) {\n if (pnu.getName().isParsed()) {\n ParsedAuthorship pnAuthorship = parseAuthorship(authorship).orElseGet(() -> {\n LOG.info(\"Unparsable authorship {}\", authorship);\n v.addIssue(Issue.UNPARSABLE_AUTHORSHIP);\n // add the full, unparsed authorship in this case to not lose it\n ParsedName pn = new ParsedName();\n pn.getCombinationAuthorship().getAuthors().add(authorship);\n return pn;\n });\n\n // we might have already parsed an authorship from the scientificName string which does not match up?\n if (pnu.getName().hasAuthorship()) {\n String prevAuthorship = NameFormatter.authorship(pnu.getName());\n if (!prevAuthorship.equalsIgnoreCase(pnAuthorship.authorshipComplete())) {\n v.addIssue(Issue.INCONSISTENT_AUTHORSHIP);\n LOG.info(\"Different authorship found in name {} than in parsed version: [{}] vs [{}]\",\n pnu.getName(), prevAuthorship, pnAuthorship.authorshipComplete());\n }\n }\n\n // keep authorship issues in a separate container\n // so we can filter out non authorship related issues before we add them to the verbatim record\n IssueContainer ic = new IssueContainer.Simple();\n copyToPNU(pnAuthorship, pnu, ic);\n // ignore issues related to the epithet - we only parse authorships here\n removeEpithetIssues(ic);\n ic.getIssues().forEach(v::addIssue);\n\n // use original authorship string but normalize whitespace\n pnu.getName().setAuthorship( normalizeAuthorship(authorship, pnAuthorship.getTaxonomicNote()) );\n\n } else {\n // unparsed name might still not have any authorship\n String sciName = AuthorshipNormalizer.normalize(pnu.getName().getScientificName());\n if (sciName == null) {\n pnu.getName().setAuthorship(authorship);\n } else {\n String authNormed = AuthorshipNormalizer.normalize(authorship);\n if (authNormed != null && !sciName.contains(authNormed)) {\n pnu.getName().setAuthorship(authorship);\n }\n }\n }\n }\n }", "public void setupSubscriptions()\n {\n String debug = System.getProperty(\"SAFE.debug\");\n if (debug != null && debug.equalsIgnoreCase(\"true\")) {\n _debug = true;\n }\n \n // get handle to message transport service \n try {\n MessageTransportService mts = (MessageTransportService) this.getBindingSite().getServiceBroker().getService(this,\n MessageTransportService.class,\n null);\n \n // get the name of the domain we are managing\n String domainName = System.getProperty(\"org.cougaar.safe.domainName\");\n if (domainName == null) {\n throw new NullPointerException(\"System property org.cougaar.safe.domainName is not set\");\n } \n\n // create MessageSender and MessageReceiver for DM\n // create local locator and bind MessageReceiver to it\n CougaarMessageTransportService messageTransport = new CougaarMessageTransportService(mts);\n MessageSender sender = messageTransport.newMessageSender();\n MessageReceiver receiver = messageTransport.newMessageReceiver(); \n CougaarLocator myLocator = new CougaarLocator(domainName);\n receiver.bindToLocalLocator(myLocator);\n \n // create Domain Manager\n _dm = new MyDomainManager(domainName,\n receiver,\n sender);\n \n }\n catch (Exception xcp) {\n xcp.printStackTrace();\n }\n \n // BEGIN rehydrate \n \n // rehydrate: get entity descriptions from the blackboard and register them\n // with the domain manager\n Iterator entityDescriptions = query(_entityDescriptionPredicate).iterator();\n Vector nonGuardDescrips = new Vector();\n while (entityDescriptions.hasNext()) { \n KAoSEntityDescription entityDescrip = (KAoSEntityDescription) entityDescriptions.next();\n // register all the guards first\n if (entityDescrip.getEntityType().equals(KAoSConstants.GUARD)) { \n _dm.register(entityDescrip, true);\n }\n else {\n nonGuardDescrips.addElement(entityDescrip);\n }\n }\n // then register the other entities\n for (int i=0; i<nonGuardDescrips.size(); i++) {\n _dm.register((KAoSEntityDescription) nonGuardDescrips.elementAt(i), true);\n }\n \n // rehydrate: get policies from the blackboard and give\n // them to the domain manager\n Iterator policyMsgs = query(_policyMsgPredicate).iterator();\n Vector policyMsgsV = new Vector();\n while (policyMsgs.hasNext()) {\n policyMsgsV.addElement(policyMsgs.next());\n }\n _dm.rehydratePolicies(policyMsgsV);\n \n // END rehydrate\n \n _proposedPolicyUpdate = (IncrementalSubscription) subscribe(_proposedPolicyUpdatePredicate); \n }", "public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}", "private void createAA() {\r\n\r\n\t\tfor( int x = 0 ; x < dnasequence.size(); x++) {\r\n\t\t\tString str = dnasequence.get(x);\r\n\t\t\t//put catch for missing 3rd letter\r\n\t\t\tif(str.substring(0, 1).equals(\"G\")) {\r\n\t\t\t\taasequence.add(getG(str));\r\n\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"C\")) {\r\n\t\t\t\taasequence.add(getC(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"A\")) {\r\n\t\t\t\taasequence.add(getA(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"T\")) {\r\n\t\t\t\taasequence.add(getT(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0,1).equals(\"N\")) {\r\n\t\t\t\taasequence.add(\"ERROR\");\r\n\t\t\t}else\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t}\r\n\t}", "public void setAuids(List<String> auids) {\n this.auids = auids;\n }", "public Voice transpose(int semitonesUp){\n List<Bar> temp= new ArrayList<>();\n for(Bar bar:voices){\n temp.add(bar.transpose(semitonesUp));\n }\n checkRep();\n return new Voice(temp);\n }", "private void populateIssuingUserAndLocation(MarriageRegister notice, User user) {\n List<Location> userLocationList = user.getActiveLocations();\n //set first (primary) location as issuing location\n int locationId = userLocationList.get(0).getLocationUKey();\n Location location = userLocationList.get(0);\n /* issueLocation.getLocationName()*/\n notice.setLicenseIssueLocation(location);\n //get first user from above location\n //no need to check first user's permission for issuing certificate because any DS office can issue license\n notice.setLicensePrintUser(userLocationDAO.getMarriageCertificateSignUsersByLocationId(locationId, true).get(0));\n\n\n }", "private void fixupLanguageCodes() {\n long timer = -System.currentTimeMillis();\n\n // Hack to fix ssl1->sil. If we ever have more, abstract this a bit more.\n String from = \"ssl1\";\n String to = \"sil\";\n RFC3066LanguageCode abstractLanguageCode = new RFC3066LanguageCode(to);\n MetadataValue<RFC3066LanguageCode> abstractMetadataLanguageCode = new MetadataValue<>(\n abstractLanguageCode);\n\n Transaction transaction = this.store.newTransaction();\n Collection<AudioItem> items = this.store.getAudioItems();\n int itemsFixed = 0;\n\n boolean success = false;\n try {\n for (AudioItem audioItem : items) {\n if (audioItem.getLanguageCode().equalsIgnoreCase(from)) {\n audioItem.getMetadata().putMetadataField(DC_LANGUAGE, abstractMetadataLanguageCode);\n transaction.add(audioItem);\n itemsFixed++;\n }\n }\n if (transaction.size() > 0) {\n transaction.commit();\n } else {\n transaction.rollback();\n }\n success = true;\n } catch (IOException e1) {\n e1.printStackTrace();\n } finally {\n if (!success) {\n try {\n transaction.rollback();\n } catch (IOException e) {\n LOG.log(Level.SEVERE, \"Unable to rollback transaction.\", e);\n }\n }\n }\n\n timer += System.currentTimeMillis();\n // If we did anything, or if the delay was perceptable (1/10th second), show the time.\n if (itemsFixed > 0 || timer > 100) {\n System.out.printf(\"Took %d ms to fix %d language codes%n\", timer, itemsFixed);\n }\n }", "private void changeOrderPhase() {\n for (int i = 0; i < 4; i++)\n System.out.print(playerList[i].getName() + \" ,\");\n Player tmp = playerList[0];\n playerList[0] = playerList[1];\n playerList[1] = playerList[2];\n playerList[2] = playerList[3];\n playerList[3] = tmp;\n System.out.println();\n for (int i = 0; i < 4; i++)\n System.out.print(playerList[i].getName() + \" ,\");\n System.out.println();\n }", "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 }", "private void updateSubjectsSourceFlag(OpBroker broker) {\r\n OpQuery allSubjectsQuery = broker.newQuery(\"from OpSubject\");\r\n Iterator<OpSubject> subjectsIterator = broker.iterate(allSubjectsQuery);\r\n while (subjectsIterator.hasNext()) {\r\n OpSubject subject = subjectsIterator.next();\r\n subject.setSource(OpSubject.INTERNAL);\r\n broker.updateObject(subject);\r\n }\r\n }", "public String publicationAnonymization(String publicationXml) {\n\t\t\n\t\treturn \"\";\n\t}", "private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }", "@Override\n public void spustiAkciu(StavBounce bounce, Lopta lopta) {\n lopta.prepichlaSiSa();\n }", "public abstract AttributeBasedAddress makeABA(String communityName);", "private void aretes_aW(){\n\t\tthis.cube[4] = this.cube[16]; \n\t\tthis.cube[16] = this.cube[23];\n\t\tthis.cube[23] = this.cube[37];\n\t\tthis.cube[37] = this.cube[30];\n\t\tthis.cube[30] = this.cube[4];\n\t}", "private void aretes_aG(){\n\t\tthis.cube[31] = this.cube[14]; \n\t\tthis.cube[14] = this.cube[5];\n\t\tthis.cube[5] = this.cube[41];\n\t\tthis.cube[41] = this.cube[50];\n\t\tthis.cube[50] = this.cube[31];\n\t}", "void removePublisherQueueEntries(String publisherName);", "private void shiftElements() {\n RadarContent[] tempArr = new RadarContent[length - 1];\n for (int i = 0; i < length - 1; i++) {\n tempArr[i] = arrProfiles[i + 1];\n }\n arrProfiles = tempArr;\n length--;\n }", "public void mergeAlignment() {\n \n SAMFileReader unmappedSam = null;\n if (this.unmappedBamFile != null) {\n unmappedSam = new SAMFileReader(IoUtil.openFileForReading(this.unmappedBamFile));\n }\n \n // Write the read groups to the header\n if (unmappedSam != null) header.setReadGroups(unmappedSam.getFileHeader().getReadGroups());\n \n int aligned = 0;\n int unmapped = 0;\n \n final PeekableIterator<SAMRecord> alignedIterator = \n new PeekableIterator(getQuerynameSortedAlignedRecords());\n final SortingCollection<SAMRecord> alignmentSorted = SortingCollection.newInstance(\n SAMRecord.class, new BAMRecordCodec(header), new SAMRecordCoordinateComparator(),\n MAX_RECORDS_IN_RAM);\n final ClippedPairFixer pairFixer = new ClippedPairFixer(alignmentSorted, header);\n \n final CloseableIterator<SAMRecord> unmappedIterator = unmappedSam.iterator();\n SAMRecord nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n SAMRecord lastAligned = null;\n \n final UnmappedReadSorter unmappedSorter = new UnmappedReadSorter(unmappedIterator);\n while (unmappedSorter.hasNext()) {\n final SAMRecord rec = unmappedSorter.next();\n rec.setReadName(cleanReadName(rec.getReadName()));\n if (nextAligned != null && rec.getReadName().compareTo(nextAligned.getReadName()) > 0) {\n throw new PicardException(\"Aligned Record iterator (\" + nextAligned.getReadName() +\n \") is behind the umapped reads (\" + rec.getReadName() + \")\");\n }\n rec.setHeader(header);\n \n if (isMatch(rec, nextAligned)) {\n if (!ignoreAlignment(nextAligned)) {\n setValuesFromAlignment(rec, nextAligned);\n if (programRecord != null) {\n rec.setAttribute(ReservedTagConstants.PROGRAM_GROUP_ID,\n programRecord.getProgramGroupId());\n }\n aligned++;\n }\n nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n }\n else {\n unmapped++;\n }\n \n // Add it if either the read or its mate are mapped, unless we are adding aligned reads only\n final boolean eitherReadMapped = !rec.getReadUnmappedFlag() || (rec.getReadPairedFlag() && !rec.getMateUnmappedFlag());\n \n if (eitherReadMapped || !alignedReadsOnly) {\n pairFixer.add(rec);\n }\n }\n unmappedIterator.close();\n alignedIterator.close();\n \n final SAMFileWriter writer =\n new SAMFileWriterFactory().makeBAMWriter(header, true, this.targetBamFile);\n int count = 0;\n CloseableIterator<SAMRecord> it = alignmentSorted.iterator();\n while (it.hasNext()) {\n SAMRecord rec = it.next();\n if (!rec.getReadUnmappedFlag()) {\n if (refSeq != null) {\n byte referenceBases[] = refSeq.get(rec.getReferenceIndex()).getBases();\n rec.setAttribute(SAMTag.NM.name(),\n SequenceUtil.calculateSamNmTag(rec, referenceBases, 0, bisulfiteSequence));\n rec.setAttribute(SAMTag.UQ.name(),\n SequenceUtil.sumQualitiesOfMismatches(rec, referenceBases, 0, bisulfiteSequence));\n }\n }\n writer.addAlignment(rec);\n if (++count % 1000000 == 0) {\n log.info(count + \" SAMRecords written to \" + targetBamFile.getName());\n }\n }\n writer.close();\n \n \n log.info(\"Wrote \" + aligned + \" alignment records and \" + unmapped + \" unmapped reads.\");\n }", "private static String getAgents(ArrayList<Agent> auth){\n String agents =\"\";\n try{\n Iterator<Agent> it = auth.iterator();\n int i = 1;\n while(it.hasNext()){\n Agent currAuth = it.next();\n String authorName = currAuth.getName(); //the name should be always there\n if(authorName==null || \"\".equals(authorName)){\n authorName = \"Author\"+i;\n i++;\n }\n if(currAuth.getURL()!=null &&!\"\".equals(currAuth.getURL())){\n agents+=\"<dd><a property=\\\"dc:creator schema:author prov:wasAttributedTo\\\" resource=\\\"\"+currAuth.getURL()+\"\\\" href=\\\"\"+currAuth.getURL()+\"\\\">\"+authorName+\"</a>\";\n }else{\n agents+=\"<dd>\"+authorName;\n }\n if(currAuth.getInstitutionName()!=null && !\"\".equals(currAuth.getInstitutionName()))\n agents+=\", \"+currAuth.getInstitutionName();\n agents+=\"</dd>\";\n } \n }catch(Exception e){\n System.out.println(\"Error while writing authors, their urls or their instititions.\");\n }\n return agents;\n }", "protected ArrayList<String> convertUeToNamesList(ArrayList<UE> ueList2) {\n\t\tArrayList<String> ueList = new ArrayList<String>();\n\t\tfor (UE ue : ueList2) {\n\t\t\tueList.add(\"UE\" + ue.getName().replaceAll(\"\\\\D+\", \"\").trim());\n\t\t}\n\t\treturn ueList;\n\t}", "public static void main(String[] args) {\n\t\tPaixu[] paixus = new Paixu[6];\n\t\tpaixus[0] = new Paixu(3, 1);\n\t\tpaixus[1] = new Paixu(1, 1);\n\t\tpaixus[2] = new Paixu(5, 1);\n\t\tpaixus[3] = new Paixu(1,2);\n\t\tpaixus[4] = new Paixu(5,3);\n\t\tpaixus[5] = new Paixu(3,2);\n//\t\tCollections.sort(paixus,0,6);\n\t\tArrays.sort(paixus,0,6);\n\t\tSystem.out.println();\n\t}", "public void inicialAleatorio() {\n //aqui adiciona naquele vetor que de auxilio\n alocacao.add(Estados.ELETRICISTAS);\n alocacao.add(Estados.ELETRICISTAS2);\n alocacao.add(Estados.QUALIDADE);\n alocacao.add(Estados.QUALIDADE2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL3);\n alocacao.add(Estados.PLANEJAMENTO);\n\n //biblioteca que sorteia aleatoriamente os departamentos\n Collections.shuffle(alocacao);\n\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = alocacao.get(i);\n\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = alocacao.get(i + 4);\n }\n\n }", "public void avoidBotASs(Set<AS> advertiseToTheseASes) {\n avoidBotAndOtherASs(null, advertiseToTheseASes);\n }", "public BinaarinenPuusolmu(int avain) {\n this.avain = avain;\n vasen = null;\n oikea = null;\n vanhempi = null;\n }", "private void sortClients()\n {\n System.out.println(\"clients items (alphabetically):\");\n Set<Client> clients = ctrl.sortClientsAlphabetically();\n clients.stream().forEach(System.out::println);\n }", "public NbaProcReinsurerOrdered() {\n\t\tsuper();\n\t}", "private void fetchAPNamesForModel(UiAirplaneModel model) {\r\n\t\tuiAirplaneModel.setApNamesList(new ArrayList<UiAirplaneModel>());\r\n\t\tList<UiAirplaneModel> apList = new ArrayList<UiAirplaneModel>();\r\n\t\tList<AirplaneName> list = wsrdAdminService.fetchAPNames(model.getAirplaneID());\r\n\t\tStringBuilder joinValues = new StringBuilder();\r\n\t\tif(ObjectUtil.isListNotEmpty(list)){\r\n\t\t\tfor(AirplaneName ap : list){\r\n\t\t\t\tjoinValues.append(ap.getAirplaneNames().trim()).append(NEWLINE);\r\n\t\t\t\t\r\n\t\t\t\tUiAirplaneModel uimodel = new UiAirplaneModel();\r\n\t\t\t\tuimodel.setAirplaneNames(ap.getAirplaneNames().trim());\r\n\t\t\t\tuimodel.setAirplaneID(ap.getApNameID());\r\n\t\t\t\tapList.add(uimodel);\r\n\t\t\t}\r\n\t\t}\r\n\t\tString str2 = \"\";\r\n\t\tstr2 = joinValues.toString();\r\n\t\tif(!str2.isEmpty()){\r\n\t\t\tstr2 = str2.substring(0, str2.length()-1);\r\n\t\t}\r\n\t\t\r\n\t\tmodel.setApNamesList(apList);\r\n\t\tmodel.setAirplaneNames(str2);\r\n\t}", "public static void main(String arg[]) {\n String nombres[] = {\"Pepe\", \"Juan\", \"María\", \"Antonio\", \"Luisa\"};\n\n String inter;\n for (int x = 0; x < nombres.length - 1; x++) {\n for (int i = nombres.length - 1; i > x; i--) {\n if (nombres[i].compareTo(nombres[i - 1]) < 0) {\n inter = nombres[i];\n nombres[i] = nombres[i - 1];\n nombres[i - 1] = inter;\n }\n }\n }\n for (int i = 0; i < nombres.length; i++) {\n System.out.println(nombres[i]);\n }\n }", "private void swapTransforms() {\n Transform tmp = workTransform;\n workTransform = userTransform;\n userTransform = tmp;\n }", "private void handleEarlySubscribeReceived()\n {\n for(Jid from : earlySubscriptions.keySet())\n {\n handleSubscribeReceived(from, earlySubscriptions.get(from));\n }\n\n earlySubscriptions.clear();\n }", "private void sortOutlines() {\r\n Collections.sort(outlines, reversSizeComparator);\r\n }", "private static Map<String, String> organizeTransducer () {\n Map<String, String> properTransducerName = new HashMap<String, String>();\n\n properTransducerName.put(\"TEMP\", \"temperature\");\n properTransducerName.put(\"LIGHT\", \"light\");\n properTransducerName.put(\"HUMI\", \"humidity\");\n properTransducerName.put(\"PRES\", \"pressure\");\n properTransducerName.put(\"VBAT\", \"voltage\");\n properTransducerName.put(\"DOOR\", \"door\");\n properTransducerName.put(\"RSSI\", \"RSSI\");\n\n return properTransducerName;\n }", "private static void crearAlmacenes(Almacen[] almacen) {\n\t\talmacen[0] = new Almacen(\"Muebles SA\", \"Poligono Industrial 34, Madrid\");\n\t\talmacen[1] = new Almacen(\"Leroy Merlin\", \"Plaza España 20, Zaragoza\");\n\t\talmacen[2] = new Almacen(\"Bricomania\", \"Gran Via 77, Barcelona\");\n\t\talmacen[3] = new Almacen(\"Ikea\", \"Calle Mayor 42, Murcia\");\n\t}", "private void _generateAUniv(int index) {\n writer_.startSection(CS_C_UNIV, _getId(CS_C_UNIV, index));\n writer_.addProperty(CS_P_NAME, _getRelativeName(CS_C_UNIV, index), false);\n writer_.endSection(CS_C_UNIV);\n }", "private static void sortHelperMSD(String[] asciis, int start, int end, int index) {\n // Optional MSD helper method for optional MSD radix sort\n return;\n }", "public void distribuirAportes2(){\n\n if(comprobanteSeleccionado.getAporteorganismo().floatValue() > 0f){\n comprobanteSeleccionado.setAportecomitente(comprobanteSeleccionado.getMontoaprobado().subtract(comprobanteSeleccionado.getAporteuniversidad().add(comprobanteSeleccionado.getAporteorganismo())));\n }\n }", "public void clearAuthors() {\r\n\t\tauthorsNum = 0;\r\n\t}", "public void sortMarc()\r\n {\r\n\t/* Make sure each element in marc_out is a complete string with more than 4 characters */\r\n\tfor(int a = 0; a < marc_out.size(); a++)\r\n\t {\r\n\t\tif(marc_out.get(a).length() < 5){\r\n\t\t System.out.println(\"Warning (sortMarc): marc line \" + marc_out.get(a) + \" too short, must have least 4 characters.\");\r\n\t\t return;\r\n\t\t}\r\n\t }\r\n\r\n\tfor(int a = 0; a < (marc_out.size() - 1); a++)\r\n\t {\r\n\t\tint field_a = 0;\r\n\t\tString value_a = (marc_out.get(a)).substring(1, 4);\r\n\t\ttry{\r\n\t\t field_a = (Integer.valueOf(value_a)).intValue();\r\n\t\t}\r\n\t\tcatch(NumberFormatException nfe) { }\r\n\r\n\t\tfor(int b = a + 1; b < marc_out.size(); b++)\r\n\t\t {\r\n\t\t\tint field_b = 0;\r\n\t\t\tString value_b = (marc_out.get(b)).substring(1, 4);\r\n\t\t\ttry{\r\n\t\t\t field_b = (Integer.valueOf(value_b)).intValue();\r\n\t\t\t}\r\n\t\t\tcatch(NumberFormatException nfe){ }\r\n\r\n\t\t\tif(field_b < field_a)\r\n\t\t\t {\r\n\t\t\t\tString temp_field = marc_out.get(b);\r\n\t\t\t\tmarc_out.set(b, marc_out.get(a));\r\n\t\t\t\tmarc_out.set(a, temp_field);\r\n\r\n\t\t\t\tfield_a = field_b;\r\n\t\t\t }\r\n\t\t }\r\n \t }\r\n }", "public HL7Group processNK1s_ToUFD() throws ICANException {\n\n HL7Segment aNK1SegIN = new HL7Segment(\"NK1\");\n HL7Segment aNK1SegOUT = new HL7Segment(\"NK1\");\n HL7Group aNK1GroupIN = new HL7Group();\n HL7Group aNK1GroupOUT = new HL7Group();\n CodeLookUp aRelationship = new CodeLookUp(\"NOK_Relationship.table\", mEnvironment);\n\n aNK1GroupIN = processGroup(HL7_23.Repeat_NK1);\n int i;\n for (i=1; i <= aNK1GroupIN.countSegments(); i++) {\n\n aNK1SegIN = new HL7Segment(aNK1GroupIN.getSegment(i));\n aNK1SegOUT = new HL7Segment(\"NK1\");\n aNK1SegOUT.linkTo(aNK1SegIN);\n aNK1SegOUT.copy(HL7_23.NK1_1_set_ID);\n aNK1SegOUT.copy(HL7_23.NK1_2_next_of_kin_name);\n if (mFacility.equalsIgnoreCase(\"BHH\") ||\n mFacility.equalsIgnoreCase(\"MAR\") ||\n mFacility.equalsIgnoreCase(\"ANG\") ||\n mFacility.equalsIgnoreCase(\"PJC\")) {\n //Perform no translation just copy NOK\n aNK1SegOUT.copy(HL7_23.NK1_3_next_of_kin_relationship);\n } else {\n aNK1SegOUT.set(HL7_23.NK1_3_next_of_kin_relationship,\n aRelationship.getValue(aNK1SegIN.getField(HL7_23.NK1_3_next_of_kin_relationship)));\n }\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_street_1);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_street_2);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_city);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_state_or_province);\n aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_zip);\n// aNK1SegOUT.copy(HL7_23.NK1_4_next_of_kin__address, HL7_23.XAD_type);\n aNK1SegOUT.copy(HL7_23.NK1_5_next_of_kin__phone, HL7_23.XTN_telephone_number);\n aNK1SegOUT.copy(HL7_23.NK1_5_next_of_kin__phone, HL7_23.XTN_telecom_use);\n aNK1SegOUT.copy(HL7_23.NK1_6_business_phone_num, HL7_23.XTN_telephone_number);\n aNK1SegOUT.copy(HL7_23.NK1_6_business_phone_num, HL7_23.XTN_telecom_use);\n aNK1SegOUT.copy(HL7_23.NK1_7_contact_role);\n\n aNK1GroupOUT.append(aNK1SegOUT);\n }\n\n return aNK1GroupOUT;\n }", "private void setProperlyOrderedPrefixNamePairs(String[] prefixMatchArray){\n prefixMatchArray[0] = repositoryWithDualKeyNCategory.isKey2(prefixMatchArray[0]) ? repositoryWithDualKeyNCategory.getKey1FromKey2(prefixMatchArray[0]) : prefixMatchArray[0];\n prefixMatchArray[1] = repositoryWithDualKeyNCategory.isKey2(prefixMatchArray[0]) ? prefixMatchArray[0] : repositoryWithDualKeyNCategory.getKey2FromKey1(prefixMatchArray[0]);\n }", "public void createManufacturerSynonyms() {\n\t\t\n\t\tfor (String m : productsByManufacturer.keySet() ) {\n\t\t\t\n\t\t\tString mWords[] = m.split(\"\\\\s+\");\n\t\t\t\n\t\t\tif (mWords.length > 1) {\n\t\t\t\tSet<Product> products = productsByManufacturer.get(m);\n\t\t\t\tfor (String mw: mWords) {\n\t\t\t\t manufacturerSynonyms.put(mw, products);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void sortTravelContactsByCitizenship() {\n Collections.sort(this.contacts, new Comparator<User>(){\n public int compare(User obj1, User obj2) {\n // ## Ascending order\n return obj1.getSortingStringName().compareToIgnoreCase(obj2.getSortingStringName());\n }\n });\n }", "private void resolveSortingItems(ArrayList<String> out,\n ArrayList<CldrNode> nodesForLastItem,\n ArrayList<CldrItem> sortingItems)\n throws IOException, ParseException {\n ArrayList<CldrItem> arrayItems = new ArrayList<CldrItem>();\n String lastLeadingArrayItemPath = null;\n\n if (!sortingItems.isEmpty()) {\n Collections.sort(sortingItems);\n for (CldrItem item : sortingItems) {\n Matcher matcher = LdmlConvertRules.ARRAY_ITEM_PATTERN.matcher(\n item.getPath());\n if (matcher.matches()) {\n String leadingArrayItemPath = matcher.group(1);\n if (lastLeadingArrayItemPath != null &&\n !lastLeadingArrayItemPath.equals(leadingArrayItemPath)) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n lastLeadingArrayItemPath = leadingArrayItemPath;\n arrayItems.add(item);\n } else {\n outputCldrItem(out, nodesForLastItem, item);\n }\n }\n sortingItems.clear();\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n }", "public static void main(String[] args) {\n\t\tSystem.out.println(rearrangeString(\"aab\", 3));\n\t}", "private void setup() {\n Collections.sort(samples);\n this.pos = 0;\n }", "protected Collection<ArticleMetadata> modifyAMList(SourceXmlSchemaHelper helper,\n CachedUrl datasetCu, List<ArticleMetadata> allAMs) {\n\n Matcher mat = TOP_METADATA_PATTERN.matcher(datasetCu.getUrl());\n Pattern ARTICLE_METADATA_PATTERN = null;\n if (mat.matches()) {\n // must create this here because it is specific to this tar set\n String pattern_string = \"^\" + mat.group(1) + mat.group(2) + \"[A-Z]\\\\.tar!/\" + mat.group(2) + \"/.*/main\\\\.xml$\";\n log.debug3(\"Iterate and find the pattern: \" + pattern_string);\n ARTICLE_METADATA_PATTERN = Pattern.compile(pattern_string, Pattern.CASE_INSENSITIVE);\n\n // Limit the scope of the iteration to only those TAR archives that share this tar number\n List<String> rootList = createRootList(datasetCu, mat);\n // Now create the map of files to the tarfile they're in\n ArchivalUnit au = datasetCu.getArchivalUnit();\n SubTreeArticleIteratorBuilder articlebuilder = new SubTreeArticleIteratorBuilder(au);\n SubTreeArticleIterator.Spec artSpec = articlebuilder.newSpec();\n // Limit it just to this group of tar files\n artSpec.setRoots(rootList); \n artSpec.setPattern(ARTICLE_METADATA_PATTERN); // look for url-ending \"main.xml\" files\n artSpec.setExcludeSubTreePattern(NESTED_ARCHIVE_PATTERN); //but do not descend in to any underlying archives\n artSpec.setVisitArchiveMembers(true);\n articlebuilder.setSpec(artSpec);\n articlebuilder.addAspect(MAIN_XML_PATTERN,\n XML_REPLACEMENT,\n ArticleFiles.ROLE_ARTICLE_METADATA);\n\n for (SubTreeArticleIterator art_iterator = articlebuilder.getSubTreeArticleIterator();\n art_iterator.hasNext(); ) {\n // because we haven't set any roles, the AF will be what the iterator matched\n String article_xml_url = art_iterator.next().getFullTextCu().getUrl();\n log.debug3(\"tar map iterator found: \" + article_xml_url);\n int tarspot = StringUtil.indexOfIgnoreCase(article_xml_url, \".tar!/\");\n int dividespot = StringUtil.indexOfIgnoreCase(article_xml_url, \"/\", tarspot+6);\n TarContentsMap.put(article_xml_url.substring(dividespot + 1), article_xml_url);\n log.debug3(\"TarContentsMap add key: \" + article_xml_url.substring(dividespot + 1));\n }\n } else {\n log.warning(\"ElsevierDTD5: Unable to create article-level map for \" + datasetCu.getUrl() + \" - metadata will not include article titles or useful access.urls\");\n }\n return allAMs;\n }", "private ArchivalUnit createAu(String auId, PluginManager pluginMgr,\n Map<String, String> properties, CIProperties headers) {\n log.debug2(\"auId = {}\", auId);\n log.debug2(\"properties = {}\", properties);\n log.debug2(\"headers = {}\", headers);\n\n ArchivalUnit au = null;\n\n // Get the plugin identifier.\n String pluginId = null;\n\n try {\n pluginId = PluginManager.pluginIdFromAuId(auId);\n log.trace(\"pluginId = {}\", pluginId);\n } catch (Exception e) {\n throw new RuntimeException(\"Error getting the plugin identifier: \", e);\n }\n\n Plugin plugin = null;\n\n if (PLUGIN_KEY.equals(pluginId)) {\n // Get the plugin.\n plugin = pluginMgr.getImportPlugin();\n\n if (plugin == null) {\n\tthrow new RuntimeException(\"Invalid pluginId '\" + pluginId + \"'\");\n }\n\n // Now that the Import plugin has been loaded, get the archival unit\n // again, if it exists.\n au = pluginMgr.getAuFromId(auId);\n log.trace(\"au = {}\", au);\n\n // Check whether the archival unit now exists.\n if (au != null) {\n\tprocessProperties(properties, null, headers);\n }\n } else {\n // Get the plugin.\n plugin = pluginMgr.getPlugin(pluginId);\n\n if (plugin == null) {\n\tboolean pluginLoaded = pluginMgr.ensurePluginLoaded(pluginId);\n\tlog.trace(\"pluginLoaded = {}\", pluginLoaded);\n\n\tif (pluginLoaded) {\n\t plugin = pluginMgr.getPlugin(pluginId);\n\t}\n\n\tif (plugin == null) {\n\t throw new RuntimeException(\"Invalid pluginId '\" + pluginId + \"'\");\n\t}\n }\n }\n \n // Check whether the archival unit still does not exist.\n if (au == null) {\n // Yes: Get the archival unit key.\n String auKey = null;\n\n try {\n\tauKey = PluginManager.auKeyFromAuId(auId);\n\tlog.trace(\"auKey = {}\", auKey);\n } catch (IllegalArgumentException iae) {\n\tthrow new RuntimeException(\"Error getting AuKey: \", iae);\n }\n\n // Get the properties encoded in the archival unit key.\n Properties props = null;\n\n try {\n\tprops = PropUtil.canonicalEncodedStringToProps(auKey);\n\tlog.trace(\"props = \" + props);\n } catch (IllegalArgumentException iae) {\n\tthrow new RuntimeException(\"Invalid AuKey: \", iae);\n }\n\n // Initialize the archival unit configuration.\n Configuration auConfig = null;\n\n try {\n\tauConfig = ConfigManager.fromPropertiesUnsealed(props);\n\tlog.trace(\"auConfig = {}\", auConfig);\n } catch (RuntimeException re) {\n\tthrow new RuntimeException(\"Invalid AuKey properties: \", re);\n }\n\n processProperties(properties, auConfig, headers);\n\n // Add the archival unit.\n try {\n\tau = pluginMgr.createAndSaveAuConfiguration(plugin, auConfig);\n\tlog.trace(\"au = {}\", au);\n } catch (Exception e) {\n\tthrow new RuntimeException(\"Error creating AU: \", e);\n }\n }\n\n log.debug2(\"au = {}\", au);\n return au;\n }", "public void prepare() {\n for (IMixinPlatformAgent agent : this.agents) {\n MixinContainer.logger.debug(\"Processing prepare() for {}\", agent);\n agent.prepare();\n }\n }", "private void startUpPhase()\n\t{\n\t\tmap.distributeCountries(); /* Randomly split the countries between the players */\n\t\tArrayList<Player> remainingPlayers = new ArrayList<Player>(map.players);\n\t\t\n\t\tdo \n\t\t{\n\t\t\tIterator<Player> i = remainingPlayers.iterator();\n\t\t\t\n\t\t\twhile (i.hasNext()) \n\t\t\t{\n\t\t\t\tPlayer p = i.next();\n\t\t\t\tif(p.getArmies() == 0) \n\t\t\t\t{\n\t\t\t\t\ti.remove();\n\t\t\t\t} \n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\tp.placeOneArmy();\n\t\t\t\t}\n\t\t\t}\n\t\t}while(remainingPlayers.size() != 0);\n\t}", "public void removeAllOntologies20070510nid3Publisher() {\r\n\t\tBase.removeAll(this.model, this.getResource(), ONTOLOGIES20070510NID3PUBLISHER);\r\n\t}", "private void writePubAuthArcs(PrintWriter pubAuthArcsWriter) {\n\t\tint pubId;\n\t\tint authorId;\n\t\tIterator pubIterator;\n\t\tIterator authIterator;\n\t\tPublication tempPub;\n\t\tAuthorGroup authorGroup;\n\n\t\tpubIterator = publications.getIterator();\n\n\t\twhile (pubIterator.hasNext()) {\n\t\t\ttempPub = (DefaultPublication)pubIterator.next();\n\t\t\tpubId = tempPub.getId();\n\t\t\tauthorGroup = tempPub.getAuthors();\n\t\t\tauthIterator = authorGroup.getIterator();\n\n\t\t\twhile (authIterator.hasNext()) {\n\t\t\t\tauthorId = ((DefaultAuthor)authIterator.next()).getId();\n\t\t\t\tpubAuthArcsWriter.println(\" \"\n\t\t\t\t + (authorMap[authorId] + authorOffset + 1) + \" \"\n\t\t\t\t + (publicationMap[pubId] + 1) + \" 1 c Aquamarine\");\n\t\t\t}\n\t\t}\n\t}", "static int[][] packU(int n, int[] from, int[] to) {\n// this part of code is taken from \"uwi\" submission of codechef problem KNODES \n int[][] g = new int[n][];\n int[] p = new int[n];\n for (int f : from) {\n p[f]++;\n }\n for (int t : to) {\n p[t]++;\n }\n for (int i = 0; i < n; i++) {\n g[i] = new int[p[i]];\n }\n for (int i = 0; i < from.length; i++) {\n g[from[i]][--p[from[i]]] = to[i];\n g[to[i]][--p[to[i]]] = from[i];\n }\n return g;\n }", "public void sortCompetitors(){\n\t\t}", "public void updatAttackArmies(){\n\t\t\n\t\tfinal String s = attackToComboBox.getSelectedItem().toString();\n\t\tCountry country = MainPlayScreen.this.game.getBoard().getCountryByName(s);\n\t\t\t\n\t\tfinal int armies = MainPlayScreen.this.game.countryArmies.get(country);\n\t\tSystem.out.println(s + \" Defender Armies: \" + armies);\n\t\t\n\t\tif( armies == 1){\n\t\t\tnumberOfArmies[5].removeAllItems();\n\t\t\tnumberOfArmies[5].addItem(1);\n\t\t}// end of if statement\n\t\t\n\t\telse if( armies == 2){\n\t\t\tnumberOfArmies[5].removeAllItems();\n\t\t\tnumberOfArmies[5].addItem(1);\n\t\t\tnumberOfArmies[5].addItem(2);\n\t\t\t\n\t\t} // end of else if statement\n\t\t\n\t\telse{\n\t\t\tnumberOfArmies[5].removeAllItems();\n\t\t\tnumberOfArmies[5].addItem(1);\n\t\t\tnumberOfArmies[5].addItem(2);\n\t\t\tnumberOfArmies[5].addItem(3);\n\t\t\t\n\t\t}// end of else statement\n\t\tnumberOfArmies[5].repaint();\n\t}", "public void orderAlphabet(){\n market.orderAlphabet();\n car = market.products;\n }" ]
[ "0.54375046", "0.5169564", "0.5007214", "0.4975354", "0.49209368", "0.4886654", "0.48782963", "0.4876603", "0.481291", "0.48010972", "0.47977805", "0.47952232", "0.47917637", "0.4756278", "0.47065493", "0.46274063", "0.46225", "0.46187207", "0.46090522", "0.4604045", "0.4603931", "0.4587494", "0.45855367", "0.45708054", "0.45675677", "0.45557228", "0.45375416", "0.45281953", "0.45201302", "0.4505771", "0.44780347", "0.4472993", "0.4471695", "0.44698116", "0.44660366", "0.44528973", "0.4433245", "0.44133082", "0.44056422", "0.43902063", "0.43816784", "0.43758172", "0.43729794", "0.43724295", "0.43702328", "0.43639395", "0.43535763", "0.43417227", "0.43201292", "0.43045473", "0.43027556", "0.43018928", "0.42943072", "0.42933506", "0.42908368", "0.428481", "0.4271868", "0.4269494", "0.42587426", "0.42579883", "0.4257926", "0.42573887", "0.42566794", "0.42559436", "0.4251354", "0.42446613", "0.42400557", "0.4234831", "0.42322618", "0.42263973", "0.42259407", "0.4222743", "0.42214805", "0.42113188", "0.42013192", "0.41952217", "0.41931516", "0.4188722", "0.4188314", "0.41882956", "0.41853568", "0.41841987", "0.41811273", "0.41746655", "0.41695642", "0.41614684", "0.41520354", "0.4151135", "0.41442367", "0.4141691", "0.4140988", "0.413583", "0.4129727", "0.41201216", "0.4111934", "0.41097558", "0.41077778", "0.4106911", "0.41012496", "0.41010863" ]
0.6215383
0
Adds required CSS to the page header
private void addCss() { StyleLink jqueryLink = new StyleLink("http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"); page.addHeader(jqueryLink); StyleLink jqueryTooltipLink = new StyleLink("/css/jquery.ui.tooltip.css"); page.addHeader(jqueryTooltipLink); StyleLink cssLink = new StyleLink("/css/lockss-new.css"); page.addHeader(cssLink); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void init()\n\t{\n\t\tResourceReference css = getCSS();\n\t\tif (css != null)\n\t\t{\n\t\t\tadd(HeaderContributor.forCss(css.getScope(), css.getName()));\n\t\t}\n\t}", "private void validatedHeader() {\n\t\tif(loginView != null){\n\t\t\tLabel greeting = new Label(T.get(\"LABEL_TOP_BAR_GREETING\") + T.get(\"LABEL_GUEST_USER\"));\n\t\t\tLanguageSelector languageSelector = new LanguageSelector(loginView);\n\t\t\tThemeSelector themeSelector = new ThemeSelector();\n\t\t\tbuildHeader(greeting ,null, languageSelector, themeSelector);\n\t\t}\n\t\telse if(registerView != null){\n\t\t\tLabel greeting = new Label(T.get(\"LABEL_TOP_BAR_GREETING\") + T.get(\"LABEL_GUEST_USER\"));\n\t\t\tLanguageSelector languageSelector = new LanguageSelector(registerView);\n\t\t\tThemeSelector themeSelector = new ThemeSelector();\n\t\t\tbuildHeader(greeting ,null, languageSelector, themeSelector);\n\t\t}\n\t\telse if(mainView != null){\n\t\t\tString username = UI.getCurrent().getSession().getAttribute(T.system(\"SESSION_NAME\")).toString();\n\t\t\tLabel greeting = new Label(T.get(\"LABEL_TOP_BAR_GREETING\") + username);\n\t\t\tLanguageSelector languageSelector = new LanguageSelector(mainView);\n\t\t\tThemeSelector themeSelector = new ThemeSelector();\n\t\t\tLogoutButton logout = new LogoutButton();\n\t\t\tbuildHeader(greeting ,logout, languageSelector, themeSelector);\n\t\t}\n\t\tsetStyleName(T.system(\"STYLE_VIEW_TOP_BAR\"));\n\t}", "public void renderHead(IHeaderResponse response) {\n\n\n\t\t//get Sakai skin\n\t\tString skinRepo = sakaiProxy.getSkinRepoProperty();\n\t\tString toolCSS = sakaiProxy.getToolSkinCSS(skinRepo);\n\t\tString toolBaseCSS = skinRepo + \"/tool_base.css\";\n\n\t\t//Sakai additions\n\t\tresponse.renderJavascriptReference(\"/library/js/headscripts.js\");\n\t\tresponse.renderCSSReference(toolBaseCSS);\n\t\tresponse.renderCSSReference(toolCSS);\n\t\tresponse.renderOnLoadJavascript(\"setMainFrameHeight( window.name )\");\n\n\t\t//Tool additions (at end so we can override if required)\n\t\tresponse.renderString(\"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=UTF-8\\\" />\");\n\t\t//response.renderCSSReference(\"css/my_tool_styles.css\");\n\t\t//response.renderJavascriptReference(\"js/my_tool_javascript.js\");\n\n\t}", "protected void updateHeader() {\n\t}", "private static void outputHeaderMainPage(SimpleWriter out) {\n out.print(\"<html>\\n\" + \"<head>\\n\" + \"\\t<title>\" + \"Index\" + \"</title>\\n\"\n + \"<font size = '10' >\" + \"Glossary Homepage\" + \"</font>\"\n + \"</head>\\n\" + \"<body>\\n\" + \"<head>\\n\" + \"\\t<h1>\\n\"\n + \"<font size = '6' >\" + \"Index\" + \"</font>\" + \"\\t</h1>\\n\"\n + \"</head>\\n\" + \"</body>\\n\" + \"</html>\");\n }", "@Override\r\n\tpublic void loadHeader() {\n\r\n\t}", "private void addHeader(Section catPart) throws BadElementException, IOException{\r\n PdfPTable header = new PdfPTable(1);\r\n PdfPCell c = new PdfPCell(Image.getInstance(\"res/brandogredninglogo.png\"));\r\n c.setBackgroundColor(COLOR_BLUE);\r\n //c.setBorderColor(BaseColor.RED);\r\n header.setHeaderRows(0);\r\n header.addCell(c);\r\n header.setWidthPercentage(100.0f);\r\n \r\n catPart.add(header);\r\n }", "protected void addDynamicHeaders() {\n }", "public List<Element> getHeadElements() {\n if (headElements == null) { \n // Get the head elements from the super implementation \n headElements = super.getHeadElements(); \n\n CssImport cssImport = new CssImport(\"/css/admin.css\"); \n headElements.add(cssImport); \n } \n return headElements; \n }", "@Override\n\tpublic void renderHead(IHeaderResponse response)\n\t{\n\t\tfinal JavaScriptResourceReference topJsReference = new JavaScriptResourceReference(\n\t\t\tFilteredHeaderPage.class, \"top.js\");\n\t\tresponse.render(new FilteredHeaderItem(JavaScriptHeaderItem.forReference(topJsReference),\n\t\t\tFilteringHeaderResponse.DEFAULT_HEADER_FILTER_NAME));\n\n\t\t// rendered at the bottom of the body bucket\n\t\tJQueryPluginResourceReference bottomJs = new JQueryPluginResourceReference(\n\t\t\tFilteredHeaderPage.class, \"bottom.js\")\n\t\t{\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic List<HeaderItem> getDependencies()\n\t\t\t{\n\t\t\t\tList<HeaderItem> dependencies = super.getDependencies();\n\n\t\t\t\t// WICKET-4566 : depend on a resource which is rendered in a different bucket\n\t\t\t\tdependencies.add(JavaScriptHeaderItem.forReference(topJsReference));\n\t\t\t\treturn dependencies;\n\t\t\t}\n\t\t};\n\t\tresponse.render(JavaScriptHeaderItem.forReference(bottomJs));\n\t}", "private static StyleBuilder getHeaderStyle(ExportData metaData){\n \n /*pour la police des entàtes de HARVESTING*/\n if(metaData.getTitle().equals(ITitle.HARVESTING)){\n return stl.style().setBorder(stl.pen1Point().setLineColor(Color.BLACK))\n .setPadding(5)\n .setHorizontalAlignment(HorizontalAlignment.CENTER)\n .setVerticalAlignment(VerticalAlignment.MIDDLE)\n .setForegroundColor(Color.WHITE)\n .setFontSize(7)\n .setBackgroundColor(new Color(60, 91, 31))\n .bold(); \n\n }/*pour la police des entetes de SERVICING*/\n if(metaData.getTitle().equals(ITitle.SERVICING)){\n return stl.style().setBorder(stl.pen1Point().setLineColor(Color.BLACK))\n .setPadding(5)\n .setHorizontalAlignment(HorizontalAlignment.CENTER)\n .setVerticalAlignment(VerticalAlignment.MIDDLE)\n .setForegroundColor(Color.WHITE)\n .setFontSize(7)\n .setBackgroundColor(new Color(60, 91, 31))\n .bold(); \n\n }/*pour la police des entetes de FERTILIZATION*/\n if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n return stl.style().setBorder(stl.pen1Point().setLineColor(Color.BLACK))\n .setPadding(5)\n .setHorizontalAlignment(HorizontalAlignment.CENTER)\n .setVerticalAlignment(VerticalAlignment.MIDDLE)\n .setForegroundColor(Color.WHITE)\n .setFontSize(7)\n .setBackgroundColor(new Color(60, 91, 31))\n .bold(); \n\n }/*pour la police des entetes de CONTROL_PHYTO*/\n if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n return stl.style().setBorder(stl.pen1Point().setLineColor(Color.BLACK))\n .setPadding(5)\n .setHorizontalAlignment(HorizontalAlignment.CENTER)\n .setVerticalAlignment(VerticalAlignment.MIDDLE)\n .setForegroundColor(Color.WHITE)\n .setFontSize(7)\n .setBackgroundColor(new Color(60, 91, 31))\n .bold(); \n\n }else{\n return stl.style().setBorder(stl.pen1Point().setLineColor(Color.BLACK))\n .setPadding(5)\n .setHorizontalAlignment(HorizontalAlignment.CENTER)\n .setVerticalAlignment(VerticalAlignment.MIDDLE)\n .setForegroundColor(Color.WHITE)\n .setBackgroundColor(new Color(60, 91, 31))\n .bold(); \n }\n \n }", "void setPageHeader(PageHeader pageHeader);", "void setPageHeader(PageHeader pageHeader);", "@Override\n public void addHeader(Div headerDiv)\n {\n getHeaders().add(headerDiv);\n headerDiv.addClass(JQLayoutCSSThemeBlockNames.UI_Layout_Header.toString());\n //getChildren().add(headers.size() - 1, headerDiv);\n }", "public void setPageHeader(String header)\n {\n // ignore\n }", "protected void init() {\r\n\t\tgetPage().addWgtCSS(\"standard/jquery-ui.css\");\r\n\t\tgetPage().addWgtCSS(\"standard/ui.jqgrid.css\");\r\n\t\tgetPage().addControllerJS( JSResourceProcessor.GRID_JS );\r\n\t}", "public static void loadStyleSheet()\n {\n StyleManager.getInstance().addUserAgentStylesheet(ResourceLoader.loadComponent(USER_AGENT_STYLESHEET));\n }", "public void addKieHeaders() {\n\t\tHeaderManager headerManager = new HeaderManager();\n\t\theaderManager.add(new Header(\"content-type\", \"application/json\"));\n\t\theaderManager.add(new Header(\"accept\", \"application/json\"));\n\t\theaderManager.add(new Header(\"X-KIE-ContentType\", \"JSON\"));\n\t\theaderManager.setName(\"HTTP Header Manager\");\n\t\theaderManager.setProperty(TestElement.TEST_CLASS, HeaderManager.class.getName());\n\t\theaderManager.setProperty(TestElement.GUI_CLASS, HeaderPanel.class.getName());\n\t\tthis.testPlanHashTree.add(headerManager);\n\t}", "private void loadStyles() {\n ShowcaseResources.INSTANCE.showcaseCss().ensureInjected();\n RoundedCornersResource.INSTANCE.roundCornersCss().ensureInjected();\n }", "PageHeader getPageHeader();", "PageHeader getPageHeader();", "@Override\n\tprotected void createCompHeader() {\n\t\tString headerTxt = \"Add a New Pharmacy\";\n\t\tiDartImage icoImage = iDartImage.PHARMACYUSER;\n\t\tbuildCompHeader(headerTxt, icoImage);\n\t}", "private void writeCss(HttpServletRequest request,\n HttpServletResponse response) throws IOException, QuickFixException {\n AuraContext context = Aura.getContextService().getCurrentContext();\n response.setCharacterEncoding(AuraBaseServlet.UTF_ENCODING);\n List<String> namespaces = Lists.newArrayList(context.getPreloads());\n DefinitionService definitionService = Aura.getDefinitionService();\n Client.Type type = Aura.getContextService().getCurrentContext().getClient().getType();\n Mode mode = context.getMode();\n StringBuffer sb = new StringBuffer();\n \n for (String ns : namespaces) {\n String key = type.name() + \"$\" + ns;\n \n String nsCss = !mode.isTestMode() ? cssCache.get(key) : null;\n if (nsCss == null) {\n DefDescriptor<ThemeDef> matcher = definitionService.getDefDescriptor(String.format(\"css://%s.*\", ns),\n ThemeDef.class);\n Set<DefDescriptor<ThemeDef>> descriptors = definitionService.find(matcher);\n List<ThemeDef> nddefs = new ArrayList<ThemeDef>();\n \n sb.setLength(0);\n for(DefDescriptor<ThemeDef> descriptor : descriptors){\n //\n // This could use the generic routine above except for this brain dead little\n // gem.\n //\n if(!descriptor.getName().toLowerCase().endsWith(\"template\")){\n ThemeDef def = descriptor.getDef();\n if(def != null){\n nddefs.add(def);\n }\n }\n }\n \n context.setPreloading(true);\n Appendable tmp = mode.isTestMode() ? response.getWriter() : sb;\n preloadSerialize(nddefs, ThemeDef.class, tmp);\n if (!mode.isTestMode()) {\n nsCss = sb.toString();\n cssCache.put(key, nsCss);\n }\n }\n \n if (nsCss != null) {\n \tresponse.getWriter().append(nsCss);\n }\n }\n }", "private void headerContribution(final Component component) {\r\n\r\n\t\tfinal StringBuffer contribution = new StringBuffer();\r\n\t\tthis.contributeToHead(contribution);\r\n\r\n\t\tfinal List<PackageResourceReference> jsReferences = new ArrayList<PackageResourceReference>();\r\n\t\tthis.addJavaScriptReference(jsReferences);\r\n\r\n\t\tfinal List<PackageResourceReference> cssReferences = new ArrayList<PackageResourceReference>();\r\n\t\tthis.addCssReference(cssReferences);\r\n\r\n\t\tcomponent.add(new Behavior() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void renderHead(final Component component, final IHeaderResponse response) {\r\n\t\t\t\tsuper.renderHead(component, response);\r\n\t\t\t\tresponse.render(OnDomReadyHeaderItem.forScript(contribution.toString()));\r\n\t\t\t\tfor (final PackageResourceReference resourceReference : jsReferences) {\r\n\t\t\t\t\tresponse.render(JavaScriptHeaderItem.forReference(resourceReference));\r\n\t\t\t\t}\r\n\t\t\t\tfor (final PackageResourceReference resourceReference : cssReferences) {\r\n\t\t\t\t\tresponse.render(CssHeaderItem.forReference(resourceReference));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}", "@Override public String getUserAgentStylesheet() {\r\n return getClass().getResource(\"switch.css\").toExternalForm();\r\n }", "protected void BuildHtmlHeader(PrintWriter out, String title) throws IOException\n {\n out.println(\"<HTML>\");\n out.println(\"<head>\");\n out.println(\"<link rel=\\\"stylesheet\\\" href=\\\"/css/nny.css\\\" type=\\\"text/css\\\">\");\n out.println(\"<TITLE>\");\n out.println(title);\n out.println(\"</TITLE>\");\n out.println(\"<SCRIPT LANGUAGE=\\\"JavaScript\\\" SRC=\\\"/javascript/data_validation.js\\\"></SCRIPT>\");\n out.println(\"</head>\");\n /*\n if (navbarTemplate != null)\n {\n if (header_tp == null)\n {\n header_tp = new TemplateProcessor(template_path_ + navbarTemplate);\n }\n out.println(header_tp.process().toString());\n }*/\n out.flush();\n }", "private static UINode _createGlobalHeaders()\n {\n MarlinBean globalHeaders = new MarlinBean(FLOW_LAYOUT_NAME);\n\n //\n // add the client header\n //\n globalHeaders.addIndexedChild(\n ContextPoppingUINode.getUINode(NAVIGATION2_CHILD));\n\n //\n // create and add the default header\n //\n MarlinBean defaultHeader = new MarlinBean(GLOBAL_HEADER_NAME);\n\n defaultHeader.setAttributeValue(\n RENDERED_ATTR,\n new NotBoundValue(\n PdaHtmlLafUtils.createIsRenderedBoundValue(NAVIGATION2_CHILD)));\n\n globalHeaders.addIndexedChild(defaultHeader);\n\n return globalHeaders;\n }", "abstract public void header();", "public abstract String getDefaultStylesheet ();", "private static String header() {\r\n String output = \"\";\r\n output += \"\\\\documentclass[a4paper,10pt]{article}\\n\";\r\n output += \"\\\\title{Wilcoxon Signed Ranks test.}\\n\";\r\n output += \"\\\\date{\\\\today}\\n\\\\author{KEEL non-parametric statistical module}\\n\\\\begin{document}\\n\\n\\\\pagestyle{empty}\\n\\\\maketitle\\n\\\\thispagestyle{empty}\\n\\n\";\r\n\r\n return output;\r\n\r\n }", "private void initHorPageTitle() {\n\t\tLabel pageTitle = new Label(\"Reports\");\n\t\tpageTitle.setSizeFull();\n\t\tpageTitle.setWidth(\"800px\");\n\t\tpageTitle.setHeight(\"45px\");\n\t\tpageTitle.addStyleName(\"posPageTitle\");\n\t\thorPageTitle.addComponent(pageTitle);\n\t\troot.addComponent(horPageTitle);\n\t\troot.setComponentAlignment(horPageTitle, Alignment.TOP_CENTER);\n\t}", "private void createHeaders(WritableSheet sheet)\r\n\t\t\tthrows WriteException {\n\t\taddHeader(sheet, 0, 0, reportProperties.getProperty(\"header1\"));\r\n\t\taddHeader(sheet, 1, 0, reportProperties.getProperty(\"header2\"));\r\n\t\taddHeader(sheet, 2, 0, reportProperties.getProperty(\"header3\"));\r\n\t\taddHeader(sheet, 3, 0, reportProperties.getProperty(\"header4\"));\r\n\t\t\r\n\r\n\t}", "public BlockUIThemedCSS()\n\t{\n\t\t//No config required\n\t}", "public HeaderSettingsPage()\n {\n initialize();\n }", "private void manageHeaderView() {\n PickupBoyDashboard.getInstance().manageHeaderVisibitlity(false);\n HeaderViewManager.getInstance().InitializeHeaderView(null, view, manageHeaderClick());\n HeaderViewManager.getInstance().setHeading(true, mActivity.getResources().getString(R.string.bokings));\n HeaderViewManager.getInstance().setLeftSideHeaderView(true, R.drawable.left_arrow);\n HeaderViewManager.getInstance().setRightSideHeaderView(false, R.drawable.left_arrow);\n HeaderViewManager.getInstance().setLogoView(false);\n HeaderViewManager.getInstance().setProgressLoader(false, false);\n\n }", "private void initialiseHeader()\n\t{\n\t ListHead head = null;\n\n\t head = super.getListHead();\n\n\t //init only once\n\t if (head != null)\n\t {\n\t \treturn;\n\t }\n\n\t head = new ListHead();\n\n\t // render list head\n\t if (this.getItemRenderer() instanceof WListItemRenderer)\n\t {\n\t \t((WListItemRenderer)this.getItemRenderer()).renderListHead(head);\n\t }\n\t else\n\t {\n\t \tthrow new ApplicationException(\"Rendering of the ListHead is unsupported for \"\n\t \t\t\t+ this.getItemRenderer().getClass().getSimpleName());\n\t }\n\n\t //attach the listhead\n\t head.setParent(this);\n\n\t return;\n\t}", "private void loadCssForThisClass() {\n\t\tString className = getClass().getName();\n\t\tString cssPath = className.replace(\".\", \"/\") + \".css\";\n\t\tURL cssUrl = getClass().getClassLoader().getResource(cssPath);\n\t\tloadCss(cssUrl);\n\n\t\t// System.out.println(\"CSS:\\n\" + getCssContent(cssUrl) );\n\t}", "private org.gwtbootstrap3.client.ui.PageHeader get_f_PageHeader3() {\n return build_f_PageHeader3();\n }", "private void setUpHeader() {\n header = new JPanel();\n header.setLayout(new BorderLayout());\n header.setBackground(Color.darkGray);\n highscoreTitle = new JLabel();\n highscoreTitle.setText(\"Highscores:\");\n highscoreTitle.setForeground(Color.white);\n highscoreTitle.setHorizontalAlignment(JLabel.CENTER);\n highscoreTitle.setFont(new Font(\"Arial Black\", Font.BOLD, 24));\n header.add(highscoreTitle, BorderLayout.CENTER);\n setUpSortingBtn();\n\n rootPanel.add(header, BorderLayout.NORTH);\n }", "public String getPageStyle()\n {\n if (this.pageStyle == null) {\n StringBuffer sb = new StringBuffer();\n sb.append(\"<style type='text/css'>\\n\");\n sb.append(\" a:hover { color:#00CC00; }\\n\");\n sb.append(\" h1 { font-family:Arial; font-size:16pt; white-space:pre; }\\n\");\n sb.append(\" h2 { font-family:Arial; font-size:14pt; white-space:pre; }\\n\");\n sb.append(\" h3 { font-family:Arial; font-size:12pt; white-space:pre; }\\n\");\n sb.append(\" h4 { font-family:Arial; font-size:10pt; white-space:pre; }\\n\");\n sb.append(\" form { margin-top:0px; margin-bottom:0px; }\\n\");\n sb.append(\" body { font-size:8pt; font-family:verdena,sans-serif; }\\n\");\n sb.append(\" td { font-size:8pt; font-family:verdena,sans-serif; }\\n\");\n sb.append(\" input { font-size:8pt; font-family:verdena,sans-serif; }\\n\");\n sb.append(\" input:focus { background-color: #FFFFC9; }\\n\");\n sb.append(\" select { font-size:7pt; font-family:verdena,sans-serif; }\\n\");\n sb.append(\" select:focus { background-color: #FFFFC9; }\\n\"); \n sb.append(\" textarea { font-size:8pt; font-family:verdena,sans-serif; }\\n\");\n sb.append(\" textarea:focus { background-color: #FFFFC9; }\\n\"); \n sb.append(\" .\"+CommonServlet.CSS_TEXT_INPUT+\" { border-width:2px; border-style:inset; border-color:#DDDDDD #EEEEEE #EEEEEE #DDDDDD; padding-left:2px; background-color:#FFFFFF; }\\n\");\n sb.append(\" .\"+CommonServlet.CSS_TEXT_READONLY+\" { border-width:2px; border-style:inset; border-color:#DDDDDD #EEEEEE #EEEEEE #DDDDDD; padding-left:2px; background-color:#E7E7E7; }\\n\");\n sb.append(\" .\"+CommonServlet.CSS_CONTENT_FRAME[1]+\" { padding:5px; width:300px; border-style:double; border-color:#555555; background-color:white; }\\n\");\n sb.append(\" .\"+CommonServlet.CSS_CONTENT_MESSAGE+\" { padding-top:5px; font-style:oblique; text-align:center; }\\n\");\n sb.append(\"</style>\\n\");\n this.pageStyle = sb.toString();\n } \n return this.pageStyle;\n }", "void enableAutomaticHeaderImage();", "private void setupUIElements() {\n setBadgeDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.company_logo));\n //setTitle(getString(R.string.browse_title));\n\n setHeadersState(HEADERS_ENABLED);\n setHeadersTransitionOnBackEnabled(true);\n\n // Set headers and rows background color\n setBrandColor(ContextCompat.getColor(getActivity(), R.color.browse_headers_bar));\n mBackgroundManager.setColor(ContextCompat.getColor(getActivity(),\n R.color.browse_background_color));\n\n // Disables the scaling of rows when Headers bar is in open state.\n enableRowScaling(false);\n\n // Here is where a header presenter can be set to customize the look\n // of the headers list.\n setHeaderPresenterSelector(new PresenterSelector() {\n @Override\n public Presenter getPresenter(Object o) {\n\n return new RowHeaderPresenter();\n }\n });\n }", "public void setHeader() {\n tvHeader.setText(getResources().getString(R.string.text_skill));\n tvDots.setVisibility(View.INVISIBLE);\n }", "@Override\n\tprotected void createCompHeader() {\n\t\tString headerTxt = \"Cohorts Report\";\n\t\tiDartImage icoImage = iDartImage.PAVAS;\n\t\tbuildCompdHeader(headerTxt, icoImage);\n\t}", "Header createHeader();", "private void buildHeader(Layout parent) {\n\n }", "private void buildHeader(Label greeting, LogoutButton logout, LanguageSelector languageSelector, ThemeSelector themeSelector) {\n\n//\t\tAdd a style name for the greeting label\n\t\tgreeting.setStyleName(T.system(\"STYLE_LABEL_GREETING\"));\n\t\t\n//\t\tAdd components to the layout\n\t\taddComponent(greeting);\n\t\tif(logout != null){\n\t\t\taddComponent(logout);\n\t\t}\n\t\taddComponent(languageSelector);\n\t\taddComponent(themeSelector);\n\t\t\n\t\tsetIds(greeting, logout, languageSelector, themeSelector);\n\t}", "private HorizontalLayout getHeader() {\n HorizontalLayout header = new HorizontalLayout();\n header.setWidth(\"100%\");\n header.setHeight(\"100px\");\n // TODO move this into a separate HeaderView class\n header.addComponent(new Label(\"Patient Management System Team Green\"));\n return header;\n }", "private HeaderUtil() {}", "@Override\n public void addHeader(HeaderText headerDivString)\n {\n Div headerDiv = new Div();\n headerDiv.add(headerDivString);\n addHeader(headerDiv);\n }", "@Override\n\tprotected NSArray<String> additionalCSSFiles() {\n\t\treturn new NSMutableArray<String>( new String[] { \"modalbox.css\" } );\n\t}", "private String getCSS() {\r\n StringBuffer css = new StringBuffer();\r\n css.append(\"<style type='text/css'>\");\r\n css.append(\"<!--\");\r\n css.append(\"\tA.pagina:link, A.pagina:visited, A.pagina:active, A.pagina:hover {\");\r\n css.append(\"\t\tFONT-SIZE: 10pt;\");\r\n css.append(\"\t\tFONT-FAMILY: verdana;\");\r\n css.append(\"\t\tFONT-STYLE: normal;\");\r\n css.append(\"\t\tFONT-WEIGHT: bold;\");\r\n css.append(\"\t\tTEXT-DECORATION: none ;\");\r\n css.append(\"\t}\");\r\n css.append(\"\tA.pagina:link {\");\r\n css.append(\"\t\tCOLOR: #0039ba;\");\r\n css.append(\"\t}\");\r\n css.append(\"\tA.pagina:visited {\");\r\n css.append(\"\t\tCOLOR: #6c8bc3;\");\r\n css.append(\"\t}\");\r\n css.append(\"\tA.pagina:active {\");\r\n css.append(\"\t\tCOLOR: #ff6d00;\");\r\n css.append(\"\t}\");\r\n css.append(\"\tA.pagina:hover {\");\r\n css.append(\"\t\tCOLOR: #ff6d00;\");\r\n css.append(\"\t}\");\r\n css.append(\"\tTR.pagina{\");\r\n css.append(\"\t\tFONT-FAMILY: verdana;\");\r\n css.append(\"\t\tFONT-SIZE: 10pt;\");\r\n css.append(\"\t\tFONT-WEIGHT: bold;\");\r\n css.append(\"\t\tTEXT-ALIGN: center;\");\r\n css.append(\"\t\tCOLOR: gray;\");\r\n css.append(\"\t}\");\r\n css.append(\"-->\");\r\n css.append(\"</style>\");\r\n return (css.toString());\r\n }", "public void buildClassHeader() {\n\t\tString key;\n\t\tif (isInterface) {\n\t\t\tkey = \"doclet.Interface\";\n\t\t} else if (isEnum) {\n\t\t\tkey = \"doclet.Enum\";\n\t\t} else {\n\t\t\tkey = \"doclet.Class\";\n\t\t}\n\n\t\twriter.writeHeader(configuration.getText(key) + \" \" + classDoc.name());\n\t}", "public static void setCSSLink(VpePageContext pageContext, String cssHref, String ext) {\r\n String pluginPath = RichFacesTemplatesActivator.getPluginResourcePath();\r\n IPath pluginFile = new Path(pluginPath);\r\n File cssFile = pluginFile.append(cssHref).toFile();\r\n if (cssFile.exists()) {\r\n String cssPath = \"file:///\" + cssFile.getPath().replace('\\\\', '/'); //$NON-NLS-1$\r\n pageContext.getVisualBuilder().replaceLinkNodeToHead(cssPath, ext, true);\r\n }\r\n }", "private void loadNavHeader() {\n\t\t// name, Email\n\t\ttxtName.setText(\"Tester\");\n\t\ttxtEmail.setText(\"[email protected]\");\n\t}", "public void createHeader() throws DocumentException\n {\n createHeader(100f, Element.ALIGN_LEFT);\n }", "private void writeHEADER() throws IOException {\n\t\tmeta.compute_checksum();\n\t\tmeta.write();\n\t\t\n\t\t// We could also generate a non-aldus metafile :\n\t\t// writeClipboardHeader(meta);\n\t\t\n\t\t// Generate the standard header common to all metafiles.\n\t\thead.write();\n\t}", "protected ResourceReference getCSS()\n\t{\n\t\treturn CSS;\n\t}", "protected String getPageHeader()\n {\n if (this.pageHeader == null) {\n String title = (this.privateLabel != null)? this.privateLabel.getPageTitle() : \"\";\n StringBuffer sb = new StringBuffer();\n sb.append(\"<center>\");\n sb.append(\"<span style='font-size:14pt;'><b>\" + title + \"</b></span>\");\n sb.append(\"<hr>\");\n sb.append(\"</center>\");\n this.pageHeader = sb.toString();\n }\n return this.pageHeader;\n }", "public void createHeader() {\n\t\tHBox box = new HBox();\n\t\tButton printBtn = new Button(\"Print\");\n\t\tprintBtn.getStyleClass().addAll(\"btn\", \"btn-primary\");\n\t\tButton printAllBtn = new Button(\"Print allemaal\");\n\t\tprintAllBtn.getStyleClass().addAll(\"btn\", \"btn-primary\");\n\t\tButton cancelBtn = new Button(\"Annuleer\");\n\t\tcancelBtn.getStyleClass().addAll(\"btn\", \"btn-danger\");\n\t\tbox.getChildren().addAll(createTitle(), printBtn, printAllBtn, cancelBtn);\n\t\t\n\t\tprintBtn.setOnAction(e -> {\n\t\t\ttry {\n\t\t\t\tprintController.printSelected(debiteuren);\n\t\t\t} catch (Exception e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t\tSystem.out.println(\"Nothing selected mate\");\n\t\t\t}\n\t\t});\n\t\t\n\t\tprintAllBtn.setOnAction(e -> {\n\t\t\ttry {\n\t\t\t\tprintController.printAll(debiteuren);\n\t\t\t} catch (Exception e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t\tSystem.out.println(\"Nothing selected mate\");\n\t\t\t}\n\t\t});\n\t\t\n\t\tcancelBtn.setOnAction(e -> {\n\t\t\tprintController.cancel();\n\t\t});\n\t\t\n\t\tsetTop(box);\n\t}", "Rule Header() {\n // Push 1 HeaderNode onto the value stack\n return Sequence(\n FirstOf(\n Include(),\n CppInclude(),\n Namespace()),\n actions.pushHeaderNode());\n }", "public void addMPLSheader(MPLS header){\r\n\t\tMPLSheader.add(header);\r\n\t}", "private static void writeHtmlHeader(SimpleWriter out, String inputName,\n int n) {\n out.println(\"<html>\");\n out.println(\"<head>\");\n out.println(\"<title> Top \" + n + \"words in \" + inputName);\n out.println(\"</title>\");\n out.println(\n \"<link href='http://cse.osu.edu/software/2231/web-sw2/assignments/projects/tag-cloud-generator/data/tagcloud.css' rel=\\\"stylesheet\\\" type=\\\"text/css\\\">\");\n out.println(\"</head>\");\n }", "private static String headerSummary() {\r\n\r\n String output = \"\";\r\n output += \"\\\\documentclass[a4paper,10pt]{article}\\n\";\r\n output += \"\\\\title{Wilcoxon Signed Ranks test.}\\n\";\r\n output += \"\\\\usepackage{rotating}\\n\";\r\n output += \"\\\\usepackage{textcomp}\\n\";\r\n output += \"\\\\date{\\\\today}\\n\\\\author{KEEL non-parametric statistical module}\\n\\\\begin{document}\\n\\n\\\\pagestyle{empty}\\n\\\\maketitle\\n\\\\thispagestyle{empty}\\n\\n\";\r\n\r\n return output;\r\n\r\n }", "@Override\n\tpublic String getCustomHtmlHeaders()\n\t{\n\t\treturn null;\n\t}", "public void start() {\n \tupdateHeader();\n }", "protected void addXmlHeader()\n {\n addString(XmlUtil.formattedPaginatedResultSetXmlDtd());\n }", "public void addHeaders() {\n TableLayout tl = findViewById(R.id.table);\n TableRow tr = new TableRow(this);\n tr.setLayoutParams(getLayoutParams());\n if (!haverford) {\n tr.addView(getTextView(0, \"Leave Bryn Mawr\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n tr.addView(getTextView(0, \"Arrive Haverford\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n } else {\n tr.addView(getTextView(0, \"Leave Haverford\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n tr.addView(getTextView(0, \"Arrive Bryn Mawr\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n }\n tl.addView(tr, getTblLayoutParams());\n }", "protected void initializeHeader() throws PiaRuntimeException, IOException{\n try{\n super.initializeHeader();\n if( firstLineOk && headersObj == null ){\n\t// someone just give us the first line\n\theadersObj = new Headers();\n }\n }catch(PiaRuntimeException e){\n throw e;\n }catch(IOException ioe){\n throw ioe;\n }\n }", "@Override\n public void renderHead(final IHeaderResponse response) {\n // select bootstrap tab for current theme selected\n int selectedTab = this.getSelectedTab();\n response.render(OnDomReadyHeaderItem.forScript(\"$('#themes li:eq(\"\n + selectedTab + \") a').tab('show');\"));\n }", "public CSSImportWizard() {\n\t\tsuper();\n\t\tsetNeedsProgressMonitor(true);\n\t}", "private void initHeader() {\r\n\r\n Typeface friendNameTypeface = UIUtils.getFontTypeface(this,\r\n UIUtils.Fonts.ROBOTO_CONDENSED);\r\n contactNameTextView.setTypeface(friendNameTypeface);\r\n contactNameTextView.setText(friendFeed.getContact().toString());\r\n\r\n Typeface lastMessageSentDateTypeface = UIUtils.getFontTypeface(\r\n this, UIUtils.Fonts.ROBOTO_LIGHT);\r\n lastMessageSentDateTextView.setTypeface(lastMessageSentDateTypeface);\r\n lastMessageSentDateTextView.setText(StringUtils\r\n .normalizeDifferenceDate(friendFeed.getLastMessageTime()));\r\n\r\n typingStatusTextView.setTypeface(lastMessageSentDateTypeface);\r\n\r\n ImageLoaderManager imageLoaderManager = new ImageLoaderManager(getApplicationContext());\r\n imageLoaderManager.loadContactAvatarImage(contactImageView, friendFeed.getContact(), false);\r\n }", "public abstract String header();", "public void setPageStyle(String style)\n {\n // ignore\n }", "private String cssFileForHtml() {\r\n\t\treturn \"<style>table, td, th {\"\r\n\t\t\t\t+ \"border: 1px solid #ddd;\"\r\n\t\t\t\t+ \"text-align: left;}\"\r\n\t\t\t\t+ \"table {\"\r\n\t\t\t\t+ \"border-collapse: collapse;\"\r\n\t\t\t\t+ \"width: 100%;}\"\r\n\t\t\t\t+ \"th, td {\"\r\n\t\t\t\t+ \"padding: 10px;\"\r\n\t\t\t\t+ \"color:#000000;\"\r\n\t\t\t\t+ \"font-family: 'Roboto', sans-serif;}td{\"\r\n\t\t\t\t+ \"font-size: smaller;}\"\r\n\t\t\t\t+ \"th{background-color:#EEEEEE;color:#000000;}tr{background-color:#FFFFFF;}\"\r\n\t\t\t\t+ \"tr:hover{background-color:#EEEEEE}</style>\";\r\n\t}", "public String getPageHeaderParagraph() {\r\n\t\treturn controls.getText(\"eVisit\", \"CSS_header_paragraph\");\r\n\t}", "public void updateHeader() {\n if (this.mBarState == 1) {\n updateHeaderKeyguardAlpha();\n }\n updateQsExpansion();\n }", "void paintHeader(Graphics g);", "private void rewriteRepHeader() {\r\n\t\t// assume that the value of headVersionNum has been \r\n\t\t// incremented before coming here\r\n\t\ttry {\r\n\t\t\t// 1. delete current header\r\n\t\t\tif (client==null) this.initAnnoteaClient();\r\n\t\t\tclient.delete(this.repHeaderLoc);\r\n\t\t\t// 2. post new header\r\n\t\t\tDescription header = new Description();\r\n\t\t\tURI[] headerURI = new URI[1];\r\n\t\t\theaderURI[0] = new URI(this.repositoryURI.toString() + \"#header\");\r\n\t\t\theader.setAnnotates(headerURI);\r\n\t\t\theader.setAuthor(this.repositoryAuthor);\r\n\t\t\theader.setCreated(this.reposityCreatedDate);\r\n\t\t\theader.setAnnotatedEntityDefinition(this.baseOntologyURI.toString());\r\n\t\t\theader.setBody(String.valueOf(this.headVersionNumber));\r\n\t\t\theader.setBodyType(\"text/html\");\r\n\t\t\theader.setAnnotationType(this.annotType);\r\n\t\t\t// 3. update new header location URL\r\n\t\t\trepHeaderLoc = client.post(header);\r\n\t\t\t// 4. update value in versionDescriptions array and update swoopModel' versionRepository\r\n\t\t\tthis.versionDescriptions[0] = header;\r\n\t\t\tswoopModel.updateVersionRepository(this.repositoryURI, versionDescriptions);\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t}", "HeaderSettingsPage(SettingsContainer container)\n {\n super(container);\n initialize();\n }", "private void updateDisplayName() {\n String path;\n FileObject webRoot = ProjectWebRootQuery.getWebRoot(styleSheet);\n if(webRoot == null) {\n path = styleSheet.getNameExt();\n } else {\n path = FileUtil.getRelativePath(webRoot, styleSheet);\n }\n setDisplayName(path);\n }", "public Header() {\n\t\tsuper(tag(Header.class)); \n\t}", "private void loadNavHeader() {\n // name, website\n txtName.setText(StoreData.LoadString(Constants.NAME,\"Anonymous\",getApplicationContext()));\n txtWebsite.setText(StoreData.LoadString(Constants.EMAIL,\"anonymous\",getApplicationContext()));\n urlProfileImg = StoreData.LoadString(Constants.IMGURL,\"\",getApplicationContext());\n // loading header background image\n Glide.with(this).load(urlNavHeaderBg)\n .crossFade()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .into(imgNavHeaderBg);\n\n // Loading profile image\n Glide.with(this).load(urlProfileImg)\n .crossFade()\n .placeholder(R.drawable.anonymous_profile_pic)\n .error(R.drawable.anonymous_profile_pic)\n .thumbnail(0.5f)\n .bitmapTransform(new CircleTransform(this))\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .into(imgProfile);\n\n // showing dot next to notifications label\n navigationView.getMenu().getItem(3).setActionView(R.layout.menu_dot);\n }", "public void addHeader(String headerDivString)\n {\n Div headerDiv = new Div();\n headerDiv.add(headerDivString);\n addHeader(headerDiv);\n }", "@Source(\"SearchBoxUserRecord.css\")\n Style searchBoxUserRecordStyle();", "public final void setMxSheet_HeaderStyle(xlsreport.proxies.MxCellStyle mxsheet_headerstyle)\r\n\t{\r\n\t\tsetMxSheet_HeaderStyle(getContext(), mxsheet_headerstyle);\r\n\t}", "public void setupHistoTableHeader() {\r\n\t\tif (this.histoTableTabItem != null && !this.histoTableTabItem.isDisposed()) this.histoTableTabItem.setHeader();\r\n\t}", "private void prnHEADER()\n\t{ \n\t try\n\t {\n\t\t\tcl_dat.M_PAGENO +=1;\n\t\t\tcl_dat.M_intLINNO_pbst=0;\n\t\t\t\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\tprnFMTCHR(dosREPORT,M_strBOLD);\n\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\tdosREPORT.writeBytes(\"<B>\");\n\t\t\tdosREPORT.writeBytes(\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(\"------------------------------\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(strISODC1+\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(strISODC2+\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(strISODC3+\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(\"------------------------------\\n\");\n\t\t\t\n\t\t\tdosREPORT.writeBytes(padSTRING('R',cl_dat.M_strCMPNM_pbst ,100));\n\t\t\tdosREPORT.writeBytes(\"Report Date:\"+ cl_dat.M_strLOGDT_pbst + \"\\n\");\t\n\t\t\t\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"Stock Statement as on \"+(rdbDYOPN.isSelected() ? strREFDT+\" at 07:00 Hrs\" : cl_dat.M_txtCLKDT_pbst.getText()+\" \"+cl_dat.M_txtCLKTM_pbst.getText()+\" Hrs\"),100));\t\t\t\n\t\t\tdosREPORT.writeBytes(\"Page No. :\" + String.valueOf(cl_dat.M_PAGENO) + \"\\n\");\t\t\t\t\t\t\n\t\t\tdosREPORT.writeBytes(\"---------------------------------------------------------------------------------------------------------------------------------------\\n\");\n\t\t\t\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\" \",12));\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"Product & Size\",28));\n\t\t\t//System.out.println(\"LM_COUNT = \"+LM_COUNT);\n\t\t\tfor(i=0;i<LM_COUNT;i++)\n\t\t\t\tdosREPORT.writeBytes(padSTRING('L',staMNLDS[i],12));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Tot.Sq.Mts\",12));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"S/Rtn\",12));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Res.Qty\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Q/Hold\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Cub.Mtrs\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"M.Tons\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Pcs\",10));\n\t\t\tdosREPORT.writeBytes(\"\\n\");\n\t\t\t//crtLINE(136);\n\t\t\t//dosREPORT.writeBytes(\"\\n\");\n\t\t\tdosREPORT.writeBytes(\"---------------------------------------------------------------------------------------------------------------------------------------\\n\");\t\t\n\t\t\t\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\tprnFMTCHR(dosREPORT,M_strNOBOLD);\n\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\tdosREPORT.writeBytes(\"</B>\");\n\t\t\tcl_dat.M_intLINNO_pbst += 11;\n\t }\n\t catch(Exception L_EX)\n\t {\n\t\t\tsetMSG(L_EX + \" prnHEADER\",'E');\n\t\t}\n\t}", "public Headline() {\n }", "private void addHeaderForSummary(Workbook p_workBook, Sheet p_sheet)\n {\n int col = 0;\n int row = SUMMARY_HEADER_ROW;\n Row summaryHeaderRow = getRow(p_sheet, row);\n\n Cell cell_A = getCell(summaryHeaderRow, col);\n cell_A.setCellValue(m_bundle.getString(\"lb_company\"));\n cell_A.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_B = getCell(summaryHeaderRow, col);\n cell_B.setCellValue(m_bundle.getString(\"lb_job_id\"));\n cell_B.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_C = getCell(summaryHeaderRow, col);\n cell_C.setCellValue(m_bundle.getString(\"lb_job_name\"));\n cell_C.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 30 * 256);\n col++;\n\n Cell cell_D = getCell(summaryHeaderRow, col);\n cell_D.setCellValue(m_bundle.getString(\"lb_language\"));\n cell_D.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_E = getCell(summaryHeaderRow, col);\n cell_E.setCellValue(m_bundle.getString(\"lb_workflow_state\"));\n cell_E.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_F = getCell(summaryHeaderRow, col);\n cell_F.setCellValue(m_bundle.getString(\"lb_mt_word_count\"));\n cell_F.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n if (usePerplexity)\n {\n Cell cell = getCell(summaryHeaderRow, col);\n cell.setCellValue(m_bundle.getString(\"lb_perplexity_wordcount\"));\n cell.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n }\n\n Cell cell_G = getCell(summaryHeaderRow, col);\n cell_G.setCellValue(m_bundle.getString(\"lb_total_word_count\"));\n cell_G.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_H = getCell(summaryHeaderRow, col);\n cell_H.setCellValue(m_bundle.getString(\"lb_average_edit_distance\"));\n cell_H.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 30 * 256);\n col++;\n\n Cell cell_I = getCell(summaryHeaderRow, col);\n cell_I.setCellValue(m_bundle.getString(\"lb_translation_error_rate\"));\n cell_I.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n\n Cell cell_J = getCell(summaryHeaderRow, col);\n cell_J.setCellValue(m_bundle.getString(\"lb_engine_name\"));\n cell_J.setCellStyle(m_style.getHeaderStyle());\n p_sheet.setColumnWidth(col, 20 * 256);\n col++;\n }", "void setHeaderMargin(double headermargin);", "@Override\n\tprotected String getHeaderTitle() {\n\t\treturn \"\";\n\t}", "public Head() {\r\n\t\tLog.debug(\"new Head\");\r\n\t\tsetStyleName(\"resHead\");\r\n\t\tsetWidth(WIDTH);\r\n\t\tsetAutoHeight();\r\n\t\tsetPadding(0);\r\n\r\n\t\ttitleRow = new HLayout();\r\n\t\ttitle = new Label();\r\n\t\tbreadcrumbs = new Breadcrumbs();\r\n\r\n\t\ttitleRow.setHeight(TITLE_HEIGHT);\r\n\t\ttitleRow.setWidth(WIDTH);\r\n\t\ttitle.setAutoFit(true);\r\n\t\ttitle.setWrap(false);\r\n\t\ttitle.setStyleName(\"resHeadTitle\");\r\n\t\ttitleRow.addMember(title);\r\n\r\n\t\taddMember(titleRow);\r\n\t\taddMember(breadcrumbs);\r\n\r\n\t}", "private void initializeKnownHeaders() {\r\n needParceHeader = true;\r\n \r\n addMainHeader(\"city\", getPossibleHeaders(DataLoadPreferences.NH_CITY));\r\n addMainHeader(\"msc\", getPossibleHeaders(DataLoadPreferences.NH_MSC));\r\n addMainHeader(\"bsc\", getPossibleHeaders(DataLoadPreferences.NH_BSC));\r\n addMainIdentityHeader(\"site\", getPossibleHeaders(DataLoadPreferences.NH_SITE));\r\n addMainIdentityHeader(\"sector\", getPossibleHeaders(DataLoadPreferences.NH_SECTOR));\r\n addMainHeader(INeoConstants.PROPERTY_SECTOR_CI, getPossibleHeaders(DataLoadPreferences.NH_SECTOR_CI));\r\n addMainHeader(INeoConstants.PROPERTY_SECTOR_LAC, getPossibleHeaders(DataLoadPreferences.NH_SECTOR_LAC));\r\n addMainHeader(INeoConstants.PROPERTY_LAT_NAME, getPossibleHeaders(DataLoadPreferences.NH_LATITUDE));\r\n addMainHeader(INeoConstants.PROPERTY_LON_NAME, getPossibleHeaders(DataLoadPreferences.NH_LONGITUDE));\r\n // Stop statistics collection for properties we will not save to the sector\r\n addNonDataHeaders(1, mainHeaders);\r\n \r\n // force String types on some risky headers (sometimes these look like integers)\r\n useMapper(1, \"site\", new StringMapper());\r\n useMapper(1, \"sector\", new StringMapper());\r\n \r\n // Known headers that are sector data properties\r\n addKnownHeader(1, \"beamwidth\", getPossibleHeaders(DataLoadPreferences.NH_BEAMWIDTH), false);\r\n addKnownHeader(1, \"azimuth\", getPossibleHeaders(DataLoadPreferences.NH_AZIMUTH), false);\r\n }", "protected void createHeadingsAnnotations() {\n\t\tString source = \"https://tabatkins.github.io/bikeshed/headings\";\n\t\taddAnnotation\n\t\t (this,\n\t\t source,\n\t\t new String[] {\n\t\t\t \"Elements\", \"\",\n\t\t\t \"Literals\", \"\",\n\t\t\t \"Vocabularies\", \"\",\n\t\t\t \"Types\", \"\",\n\t\t\t \"Properties\", \"\",\n\t\t\t \"Relations\", \"\",\n\t\t\t \"Predicates\", \"\",\n\t\t\t \"Axioms\", \"\",\n\t\t\t \"Descriptions\", \"\",\n\t\t\t \"Instances\", \"\",\n\t\t\t \"Assertions\", \"\",\n\t\t\t \"Enumerations\", \"\"\n\t\t });\n\t}", "abstract protected AbstractCSSStyleSheet getUserImportantStyleSheet();", "public CSGStyle(AppTemplate initApp) {\r\n // KEEP THIS FOR LATER\r\n app = initApp;\r\n\r\n // LET'S USE THE DEFAULT STYLESHEET SETUP\r\n super.initStylesheet(app);\r\n\r\n // INIT THE STYLE FOR THE FILE TOOLBAR\r\n app.getGUI().initFileToolbarStyle();\r\n\r\n // AND NOW OUR WORKSPACE STYLE\r\n initTAWorkspaceStyle();\r\n }", "private void initRowHeaders() {\n TableColumn aColumn = jTable1.getColumnModel().getColumn(0);\n TableCellRenderer aRenderer = jTable1.getTableHeader().getDefaultRenderer();\n if (aRenderer == null) {\n System.out.println(\" Aouch !\");\n aColumn = jTable1.getColumnModel().getColumn(0);\n aRenderer = aColumn.getHeaderRenderer();\n if (aRenderer == null) {\n System.out.println(\" Aouch Aouch !\");\n // System.exit(3);\n exitForm(null);\n }\n }\n Component aComponent = aRenderer.getTableCellRendererComponent(jTable1, aColumn.getHeaderValue(), false, false, -1, 0);\n aFont = aComponent.getFont();\n aBackground = aComponent.getBackground();\n aForeground = aComponent.getForeground();\n\n border = (Border) UIManager.getDefaults().get(\"TableHeader.cellBorder\");\n insets = border.getBorderInsets(jTable1.getTableHeader());\n metrics = jTable1.getFontMetrics(aFont);\n }", "public void forceNotInsideHeader() {\n insideHeader = false;\n }", "private String collectHeading(Document doc) {\n String heading = doc.select(\"[class^=header1 style]\").first().text();\r\n\r\n return heading;\r\n }" ]
[ "0.67099154", "0.6020701", "0.5968012", "0.5917604", "0.572058", "0.56861717", "0.56859124", "0.5685042", "0.5680912", "0.56603986", "0.56563044", "0.56333905", "0.56333905", "0.5625366", "0.5612425", "0.558431", "0.5566656", "0.55312353", "0.55310404", "0.5526896", "0.5526896", "0.551842", "0.5517658", "0.5495078", "0.5491561", "0.5403877", "0.5394875", "0.5391992", "0.53728026", "0.53198415", "0.5273241", "0.5260502", "0.5255969", "0.5244634", "0.52424425", "0.52328277", "0.52218646", "0.5204159", "0.5202907", "0.51904684", "0.51872027", "0.51845944", "0.5153475", "0.5146835", "0.5145624", "0.513413", "0.51317286", "0.5130377", "0.5128335", "0.5121076", "0.5113844", "0.5090681", "0.50775594", "0.50713617", "0.5070372", "0.5063137", "0.50590485", "0.50439733", "0.50404763", "0.5032375", "0.5024736", "0.49944288", "0.49895668", "0.49629703", "0.49322662", "0.49163985", "0.49138245", "0.4912722", "0.49082753", "0.4905274", "0.48955634", "0.48945206", "0.4890641", "0.4889392", "0.4871685", "0.4871033", "0.48662138", "0.48639333", "0.48622054", "0.48604527", "0.4860028", "0.48556334", "0.4850112", "0.48486462", "0.48455492", "0.48441827", "0.48404282", "0.48248103", "0.48244333", "0.48200175", "0.4795276", "0.47945842", "0.4775579", "0.4775105", "0.47730973", "0.47685724", "0.47678876", "0.47627464", "0.4760533", "0.47563994" ]
0.71963364
0
Adds JQuery Javascript to the header of the page object
private void addJQueryJS() { addJS("http://code.jquery.com/jquery-1.9.1.js"); addJS("http://code.jquery.com/ui/1.10.3/jquery-ui.js"); addJS("js/auDetails-new.js"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addJS(String jsLocation) {\n Script ajaxScript = new Script(\"\");\n ajaxScript.attribute(\"src\", jsLocation);\n ajaxScript.attribute(\"type\", \"text/javascript\");\n page.addHeader(ajaxScript);\n }", "public static void Javascript() {\n\n\t}", "@Given(\"I am on the jquery homepage\")\n public void i_am_on_the_jquery_homepage() {\n System.out.println(\"inside given\");\n // baseUrl= \"https://jqueryui.com/\";\n driver= DriverMgr.getDriver();\n jQueryHPage= new JQueryHPage(driver);\n datePickerPage= new DatePickerPage(driver);\n// driver.manage().window().maximize();---> moved to @Before hook\n// driver.get(baseUrl);---> moved to @Before hook\n }", "public void renderHead(IHeaderResponse response) {\n\n\n\t\t//get Sakai skin\n\t\tString skinRepo = sakaiProxy.getSkinRepoProperty();\n\t\tString toolCSS = sakaiProxy.getToolSkinCSS(skinRepo);\n\t\tString toolBaseCSS = skinRepo + \"/tool_base.css\";\n\n\t\t//Sakai additions\n\t\tresponse.renderJavascriptReference(\"/library/js/headscripts.js\");\n\t\tresponse.renderCSSReference(toolBaseCSS);\n\t\tresponse.renderCSSReference(toolCSS);\n\t\tresponse.renderOnLoadJavascript(\"setMainFrameHeight( window.name )\");\n\n\t\t//Tool additions (at end so we can override if required)\n\t\tresponse.renderString(\"<meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html; charset=UTF-8\\\" />\");\n\t\t//response.renderCSSReference(\"css/my_tool_styles.css\");\n\t\t//response.renderJavascriptReference(\"js/my_tool_javascript.js\");\n\n\t}", "@Override\n\tpublic void renderHead(IHeaderResponse response)\n\t{\n\t\tfinal JavaScriptResourceReference topJsReference = new JavaScriptResourceReference(\n\t\t\tFilteredHeaderPage.class, \"top.js\");\n\t\tresponse.render(new FilteredHeaderItem(JavaScriptHeaderItem.forReference(topJsReference),\n\t\t\tFilteringHeaderResponse.DEFAULT_HEADER_FILTER_NAME));\n\n\t\t// rendered at the bottom of the body bucket\n\t\tJQueryPluginResourceReference bottomJs = new JQueryPluginResourceReference(\n\t\t\tFilteredHeaderPage.class, \"bottom.js\")\n\t\t{\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\t@Override\n\t\t\tpublic List<HeaderItem> getDependencies()\n\t\t\t{\n\t\t\t\tList<HeaderItem> dependencies = super.getDependencies();\n\n\t\t\t\t// WICKET-4566 : depend on a resource which is rendered in a different bucket\n\t\t\t\tdependencies.add(JavaScriptHeaderItem.forReference(topJsReference));\n\t\t\t\treturn dependencies;\n\t\t\t}\n\t\t};\n\t\tresponse.render(JavaScriptHeaderItem.forReference(bottomJs));\n\t}", "void heading(JavaScriptObject source, JavaScriptObject error, JavaScriptObject code, JavaScriptObject type, JavaScriptObject success, JavaScriptObject heading);", "public JavaScript append(String javaScriptPartToAppend) {\n return js(javaScript + javaScriptPartToAppend);\n }", "@Override\n public void renderHead(final IHeaderResponse response) {\n // select bootstrap tab for current theme selected\n int selectedTab = this.getSelectedTab();\n response.render(OnDomReadyHeaderItem.forScript(\"$('#themes li:eq(\"\n + selectedTab + \") a').tab('show');\"));\n }", "@Override\n public void addHeader(Div headerDiv)\n {\n getHeaders().add(headerDiv);\n headerDiv.addClass(JQLayoutCSSThemeBlockNames.UI_Layout_Header.toString());\n //getChildren().add(headers.size() - 1, headerDiv);\n }", "public void toJs(StringBuilder js, PageGeneratorContext pageContext) {\n\t\tif (this.isDefaultButton) {\n\t\t\tjs.append(\"// this is the default button\\nP2.defaultButtonName = '\"\n\t\t\t\t\t+ this.name + \"';\\n\");\n\t\t}\n\t}", "private void renderScript(Tag headTag, String context, String dojoPath) {\n Tag scriptTag = headTag.addChild(new CompositeTag(HtmlElement.SCRIPT));\n scriptTag.addAttribute(\"type\", \"text/javascript\");\n scriptTag.addAttribute(\"src\", context + dojoPath + \"/dojo/dojo.js\");\n scriptTag.addAttribute(\"djConfig\", config);\n }", "native void addHeaderNotification(String s)/*-{\n\t\t$doc.getElementById(\"alert\").innerHTML=s;\t\t\n\t\tsetTimeout('$doc.getElementById(\"alert\").innerHTML=\"\"', 3000);\n\t\t\t\t\n\t\t\n\t}-*/;", "public void widget(AjaxRequestTarget ajaxRequestTarget)\n\t{\n\t\tajaxRequestTarget.appendJavaScript(this.widget().render().toString());\n\t}", "private void addCss() {\n StyleLink jqueryLink = new StyleLink(\"http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css\");\n page.addHeader(jqueryLink);\n StyleLink jqueryTooltipLink = new StyleLink(\"/css/jquery.ui.tooltip.css\");\n page.addHeader(jqueryTooltipLink);\n StyleLink cssLink = new StyleLink(\"/css/lockss-new.css\");\n page.addHeader(cssLink);\n }", "public void removeHeader() throws Exception {\n\t\tSystem.out.println(\"removing Header...\");\n\t\tQTiumAutomation.waitForPageToBeReady();\n\t\tBy element = By.xpath(\"//header//div[@class='fshop-mainbox']\");\n\t\tString js = \"arguments[0].remove();\";\n\t\tQTiumAutomation.executeJavaScript(js, element);\n\t}", "private void headerContribution(final Component component) {\r\n\r\n\t\tfinal StringBuffer contribution = new StringBuffer();\r\n\t\tthis.contributeToHead(contribution);\r\n\r\n\t\tfinal List<PackageResourceReference> jsReferences = new ArrayList<PackageResourceReference>();\r\n\t\tthis.addJavaScriptReference(jsReferences);\r\n\r\n\t\tfinal List<PackageResourceReference> cssReferences = new ArrayList<PackageResourceReference>();\r\n\t\tthis.addCssReference(cssReferences);\r\n\r\n\t\tcomponent.add(new Behavior() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void renderHead(final Component component, final IHeaderResponse response) {\r\n\t\t\t\tsuper.renderHead(component, response);\r\n\t\t\t\tresponse.render(OnDomReadyHeaderItem.forScript(contribution.toString()));\r\n\t\t\t\tfor (final PackageResourceReference resourceReference : jsReferences) {\r\n\t\t\t\t\tresponse.render(JavaScriptHeaderItem.forReference(resourceReference));\r\n\t\t\t\t}\r\n\t\t\t\tfor (final PackageResourceReference resourceReference : cssReferences) {\r\n\t\t\t\t\tresponse.render(CssHeaderItem.forReference(resourceReference));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}", "private void renderRequire(Tag headTag) {\n if (!dojoTypes.isEmpty()) {\n Tag scriptTag = headTag.addChild(new CompositeTag(HtmlElement.SCRIPT));\n scriptTag.addAttribute(\"type\", \"text/javascript\");\n StringBuilder body = new StringBuilder();\n for (String type : dojoTypes) {\n body.append(\" dojo.require(\\\"\");\n body.append(type);\n body.append(\"\\\");\\n\");\n }\n ContentTag contentTag = scriptTag.addChild(new ContentTag(body.toString()));\n contentTag.setContentType(ContentType.COMMENTED_CDATA);\n }\n }", "protected void init() {\r\n\t\tgetPage().addWgtCSS(\"standard/jquery-ui.css\");\r\n\t\tgetPage().addWgtCSS(\"standard/ui.jqgrid.css\");\r\n\t\tgetPage().addControllerJS( JSResourceProcessor.GRID_JS );\r\n\t}", "@AfterRender\n\tpublic void afterRender() {\n\t\trenderSupport.addScript(String.format(\"new Tabber('%s', '%d');\", element.getClientId(), activeTabNum));\n\t}", "@Override\n\tpublic void appendToResponse( WOResponse response, WOContext context ) {\n\t\tAjaxUtils.addScriptResourceInHead( context, response, \"prototype.js\" );\n\t\tAjaxUtils.addScriptResourceInHead( context, response, \"effects.js\" );\n\t\tsuper.appendToResponse( response, context );\n\t}", "public void addedToDom() {\n activateTab();\n }", "public static String loadCrollBottom() {\r\n\t\treturn \"var bottomPosition = $(document).height(); $('body,html').animate({scrollTop:bottomPosition},800);\";\r\n\t}", "protected void writeAjaxPageHtmlMainDiv(RenderRequest request,\n RenderResponse response, final BufferedWriter writer, String id,\n String classNames, String divStyle) throws IOException {\n writer.write(\"<div id=\\\"\" + id + \"\\\" class=\\\"\" + classNames + \"\\\" \"\n + divStyle + \"></div>\\n\");\n writer.write(\"<noscript>\" + getNoScriptMessage() + \"</noscript>\");\n }", "public static void jQ(JavascriptExecutor executor, String cmd, WebElement element) {\n Preconditions.checkNotNull(executor, \"The executor cannot be null.\");\n Preconditions.checkNotNull(cmd, \"The command cannot be null.\");\n Preconditions.checkNotNull(element, \"The element cannot be null.\");\n String jQueryCmd = String.format(\"jQuery(arguments[0]).%s\", cmd);\n executor.executeScript(jQueryCmd, unwrap(element));\n }", "@Override\r\n\tpublic void beforeScript(String arg0, WebDriver arg1) {\n\t\t\r\n\t}", "protected void clickJs(WebElement elemento) {\n\t\texecuteJavaScript(elemento, \"click()\");\n\t}", "@Override\n public void addHeader(HeaderText headerDivString)\n {\n Div headerDiv = new Div();\n headerDiv.add(headerDivString);\n addHeader(headerDiv);\n }", "public WebElement headerDiv() {\r\n return driver.findElement(By.id(\"header\"));\r\n }", "public void webControlLoaded() {\n scriptExecutor.setJavaScriptMember(\"app\", this);\n }", "public void addHeader(String headerDivString)\n {\n Div headerDiv = new Div();\n headerDiv.add(headerDivString);\n addHeader(headerDiv);\n }", "void setPageHeader(PageHeader pageHeader);", "void setPageHeader(PageHeader pageHeader);", "@Override\n\tpublic void beforeScript(String arg0, WebDriver arg1) {\n\n\t}", "protected void writeAjaxPageScriptWidgetset(RenderRequest request,\n RenderResponse response, final BufferedWriter writer)\n throws IOException {\n String requestWidgetset = getApplicationOrSystemProperty(\n PARAMETER_WIDGETSET, null);\n String sharedWidgetset = getPortalProperty(\n PORTAL_PARAMETER_VAADIN_WIDGETSET, request.getPortalContext());\n \n String widgetset;\n if (requestWidgetset != null) {\n widgetset = requestWidgetset;\n } else if (sharedWidgetset != null) {\n widgetset = sharedWidgetset;\n } else {\n widgetset = DEFAULT_WIDGETSET;\n }\n String widgetsetURL = getWidgetsetURL(widgetset, request);\n writer.write(\"document.write('<iframe tabIndex=\\\"-1\\\" id=\\\"__gwt_historyFrame\\\" \"\n + \"style=\\\"position:absolute;width:0;height:0;border:0;overflow:\"\n + \"hidden;opacity:0;top:-100px;left:-100px;\\\" src=\\\"javascript:false\\\"></iframe>');\\n\");\n writer.write(\"document.write(\\\"<script language='javascript' src='\"\n + widgetsetURL + \"'><\\\\/script>\\\");\\n}\\n\");\n }", "@Override\r\npublic void beforeScript(String arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "abstract public void header();", "@Override\n\tpublic final native HeadElement getHead() /*-{\n // IE8 does not have document.head\n // when removing IE8 support we remove the second statement\n return this.head || this.getElementsByTagName('head')[0];\n\t}-*/;", "public void setPageHeader(String header)\n {\n // ignore\n }", "public JavaScript(String javaScript) {\n this.javaScript = javaScript;\n }", "public void LoadedHomePage()\r\n {\r\n //Generating Alert Using Javascript Executor\r\n if (driver instanceof JavascriptExecutor) \r\n ((JavascriptExecutor) driver).executeScript(\"alert('Loaded Home Page');\");\r\n \r\n WaitTime(2000);\r\n driver.switchTo().alert().accept();\r\n driver.switchTo().defaultContent();\r\n }", "public HeaderSettingsPage()\n {\n initialize();\n }", "public int doStartTag() throws JspException {\r\n try {\r\n JspWriter out = pageContext.getOut();\r\n \r\n //out.println(\"<script language='javascript' type='text/javascript' src='com/js/solarcalendar.js'></script>\");\r\n out.println(\"<a class='CALENDRIER'>\" + title + \"</a>\");\r\n // I(Reza Ghaffaripour) moved the text field out of this component.user should have a layout:text for date. property of this layout:text should be the name of calendar:solar_dare tag.\r\n // out.println(\"<input type='text' id='\"+name+\"' class='clsDateBox' name='\"+name+\"' />\");\r\n out.println(\"<a href=javascript:NewCal('\" + name + \"')><img border=0 src='\" + srcKey + \"' alt='\" + altKey + \"'></a>\");\r\n }\r\n catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return SKIP_BODY;\r\n }", "public static JavaScript js(String javaScript) {\n return js(javaScript);\n }", "public LandingPage(WebDriver driver) throws IOException {\n\n\t\tthis.driver = driver;\n\t\tPageFactory.initElements(driver, this);\n\t\tjs = (JavascriptExecutor) driver;\n\t\t\t\n\t}", "private String getJGrowlAfterOpenJavaScript() {\n StringBuilder javaScript = new StringBuilder();\n javaScript.append(\"function(e,m,o) {\");\n javaScript.append(\"var link = e.find('a');\");\n javaScript.append(\"if (link.size() > 0) {\");\n// javaScript.append(\"window.open(link.attr('href'), '_blank');\");\n javaScript.append(\"link[0].click();\");\n javaScript.append(\"}\");\n javaScript.append(\"}\");\n\n return javaScript.toString();\n }", "@Override\r\n public void beforeScript(final String arg0, final WebDriver arg1) {\n\r\n }", "public Type show_head() {\n\t return(head.show_element());\n\n }", "public Header(String headerCode, String id, String domClass, String Styles, String jsCallout) {\n\t\tsuper(tag(Header.class), headerCode, id, domClass, Styles, jsCallout); \n\t}", "public void Showbarang_gudang() {\n initComponents();\n setHeader();\n }", "public static void preLoadInjectHeader(WebView mWebView) {\n mWebView.setBackgroundColor(Color.TRANSPARENT);\n mWebView.setVisibility(View.INVISIBLE);\n }", "@Given(\"User lands in jqueryui Home page\")\n public void user_lands_in_jqueryui_Home_page() {\n homePage.user_lands_in_jqueryui_Home_pag_Test();\n }", "@Override\r\n\t\t\tprotected void respond(AjaxRequestTarget target) {\n\t\t\t\tchangePage.setDefaultModelObject(\"changed\");\r\n\t\t\t\ttarget.add(changePage);\r\n\t\t\t\t\r\n\t\t\t\t// voeg een stukje javascript toe aan het begin van de bestaande javascript\r\n\t\t\t\ttarget.prependJavaScript(\"window.location.href='\"+ urlFor(HomePage.class, null) +\"';\");\r\n\t\t\t\t\r\n\r\n\t\t\t}", "public void executeScript(String js) {\n try {\n this.webView.getEngine().executeScript(js);\n } catch (RuntimeException ex) {\n ex.printStackTrace();\n if (!this.pdfJsLoaded) this.toExecuteWhenPDFJSLoaded += String.format(\"%s;\", js);\n }\n }", "HeaderSettingsPage(SettingsContainer container)\n {\n super(container);\n initialize();\n }", "public static void waitForPageLoad(WebDriver driver) {\n\t \n\t // wait for Javascript to load\n\t \n\t try {\n\t\t\t(new WebDriverWait(driver, jsciptLoadTime)).until(new ExpectedCondition<Boolean>() {\n\t\t\t public Boolean apply(WebDriver d) {\n\t\t\t JavascriptExecutor js = (JavascriptExecutor) d;\n\t\t\t String javascriptsreadyState = js.executeScript(\"return document.readyState\").toString();\t\t\t \n\t\t\t return (Boolean) javascriptsreadyState.equals(\"complete\");\n\t\t\t }\n\t\t\t});\n\t\t\t\n\t\t\t// wait for jQuery to load\n\t\t\t(new WebDriverWait(driver, jQueryLoadTime)).until(new ExpectedCondition<Boolean>() {\n\t\t\t public Boolean apply(WebDriver d) {\n\t\t\t JavascriptExecutor js = (JavascriptExecutor) d;\n\t\t\t String jqueryLoad = js.executeScript(\"return window.jQuery != undefined && jQuery.active === 0\").toString();\t\t\t \n\t\t\t return (Boolean) jqueryLoad.equals(\"true\");\n\t\t\t }\n\t\t\t});\n\t\t} catch (TimeoutException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.getMessage();\n\n\t\t}\n\t}", "public static void click_DOM(WebElement clickElement, String sLog, WebElement addJS_to_Element)\n\t{\n\t\tclick_DOM(clickElement, sLog, addJS_to_Element, bException);\n\t}", "public static void writeJavaScript(final Response response, final CharSequence text)\n\t{\n\t\tAttributeMap attributes = new AttributeMap();\n\t\tattributes.putAttribute(ATTR_TYPE, \"text/javascript\");\n\t\twriteInlineScript(response, text, attributes);\n\t}", "@Override\n public void doneRendering(SRenderEvent renderEvent) {\n SessionManager.getSession().getScriptManager().addScriptListener(new JavaScriptListener(null, null, \"initSearchField('searchField');\"));\n }", "public void clickOnElement (String locator){\n String jQuerySelector = \"return $(\\\"\" + locator + \"\\\").get(0);\";\n WebElement element = (WebElement) js.executeScript(jQuerySelector);\n element.click();\n }", "public void addKieHeaders() {\n\t\tHeaderManager headerManager = new HeaderManager();\n\t\theaderManager.add(new Header(\"content-type\", \"application/json\"));\n\t\theaderManager.add(new Header(\"accept\", \"application/json\"));\n\t\theaderManager.add(new Header(\"X-KIE-ContentType\", \"JSON\"));\n\t\theaderManager.setName(\"HTTP Header Manager\");\n\t\theaderManager.setProperty(TestElement.TEST_CLASS, HeaderManager.class.getName());\n\t\theaderManager.setProperty(TestElement.GUI_CLASS, HeaderPanel.class.getName());\n\t\tthis.testPlanHashTree.add(headerManager);\n\t}", "@When(\"I click on datepicker\")\n public void i_click_on_datepicker() {\n System.out.println(\"inside date picker landing page\");\n jQueryHPage.clickDatePicker();\n }", "Container moreJavaScript(){\n\n Container con = new Container();\n con.addItem(\"/*****************************************************************/\\n\");\n con.addItem(\"function writeIt(the_long,the_lat,the_table)\\n\" +\n \"{\\n\" +\n \" var new_long = the_long - 0;\\n\" +\n \" var new_lat = the_lat - 0;\\n\" +\n \" var new_table = the_table - 0;\\n\" +\n \" var word_long_return = new_long + new_table;\\n\" +\n \" window.document.myForm.plongitudeeast.value = word_long_return;\\n\" +\n \" var word_lat_return = new_lat + new_table;\\n\" +\n \" window.document.myForm.platitudesouth.value = word_lat_return;\\n\" +\n \"}\\n\");\n con.addItem(\"function updatePTable(what)\\n\" +\n \"{\\n\" +\n \" var n = what.selectedIndex;\\n\" +\n \" /* window.alert(\\\"n = \\\" + n); */\\n\" +\n \" what.form.ptable.value = what.form.ptablesize.options[n].value;\\n\" +\n \"}\\n\");\n con.addItem(\"/*****************************************************************/\\n\");\n\n con.addItem(\"var menu = new Array (\\n\");\n for (int i = 0; i < sc.MAX1; i++) {\n con.addItem(\"\\\"\" + (i+1) + \"|\" + (i+1) + \"|\" + trueFalse[i] + \"*\");\n for (int j = 0; j < sc.MAX2; j ++) {\n if (sc.BSIZE[i][j] != 0) {\n String quote = \"\\\"\";\n if (j == 0) quote = \"\";\n String truef = \"\";\n if (j == 5) truef = \"|true\";\n String plus = \"+\";\n if (sc.MINSQ[i][j] == 20) plus = \",\";\n if ((i == (sc.MAX1-1)) && (sc.MINSQ[i][j] == 20)) plus = \")\";\n con.addItem(quote + i + \"-\" + j + \"|\" + sc.BSIZE[i][j] + \"(\" +\n sc.MINSQ[i][j] + \"x\" + sc.MINSQ[i][j] + \")\" +\n truef + \"#\\\"\" + plus + \"\\n\");\n } // if (sc.BSIZE[i][j] != 0)\n } // for (int j = 0; j < MAX2; j ++)\n } // for (int i = 0; i < MAX1; i++)\n\n return con;\n\n }", "public void handleScript(HtmlObjects.Script t)\n {\n }", "private void loadNavHeader() {\n\t\t// name, Email\n\t\ttxtName.setText(\"Tester\");\n\t\ttxtEmail.setText(\"[email protected]\");\n\t}", "public String getPageUrl() {\n return JS_URL;\n }", "void doAfterEndTag() {\r\n }", "public void clickOnTableHeading() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-table-column-has-actions.ant-table-column-has-sorters.ant-table-column-sort\"), SHORTWAIT);\r\n\t}", "@Override\r\n\tpublic void afterScript(String arg0, WebDriver arg1) {\n\t\t\r\n\t}", "private org.gwtbootstrap3.client.ui.PageHeader get_f_PageHeader3() {\n return build_f_PageHeader3();\n }", "@Override\n public void fw_javascriptClick() {\n WrapsDriver wd = (WrapsDriver) element;\n ((JavascriptExecutor) wd.getWrappedDriver()).executeScript(\"arguments[0].click();\", element);\n }", "private void createTabsDiv() {\n tabsDiv = new Block(Block.Div, \"id='tabs'\");\n page.add(tabsDiv);\n }", "protected void BuildHtmlHeader(PrintWriter out, String title) throws IOException\n {\n out.println(\"<HTML>\");\n out.println(\"<head>\");\n out.println(\"<link rel=\\\"stylesheet\\\" href=\\\"/css/nny.css\\\" type=\\\"text/css\\\">\");\n out.println(\"<TITLE>\");\n out.println(title);\n out.println(\"</TITLE>\");\n out.println(\"<SCRIPT LANGUAGE=\\\"JavaScript\\\" SRC=\\\"/javascript/data_validation.js\\\"></SCRIPT>\");\n out.println(\"</head>\");\n /*\n if (navbarTemplate != null)\n {\n if (header_tp == null)\n {\n header_tp = new TemplateProcessor(template_path_ + navbarTemplate);\n }\n out.println(header_tp.process().toString());\n }*/\n out.flush();\n }", "public void onAddHeading(View view){\n setPage(view);\n int index = deleteView(view);\n addHeadingField(\"HEADING\", index);\n Toast.makeText(this, \"Heading Added\", Toast.LENGTH_LONG).show();\n }", "public void jsContructor() {\n }", "void setJs(final String js) {\n this.js = js;\n }", "protected void updateHeader() {\n\t}", "private static void prePageFetch() {\n WEB_CLIENT.getOptions().setJavaScriptEnabled(false);\n WEB_CLIENT.getOptions().setThrowExceptionOnFailingStatusCode(false);\n\n // just turns off all the red stuff from the console\n java.util.logging.Logger.getLogger(\"com.gargoylesoftware.htmlunit\").setLevel(Level.OFF);\n }", "@Override\n\tprotected NSArray<String> additionalJavascriptFiles() {\n\t\treturn new NSMutableArray<String>( new String[] { \"modalbox.js\" } );\n\t}", "public HomePage() {\n\t\tPageFactory.initElements(driver, this);\n\t\t\n\t}", "@Override\n\tpublic void afterScript(String arg0, WebDriver arg1) {\n\n\t}", "protected String getNoScriptMessage() {\n return \"You have to enable javascript in your browser to use an application built with Vaadin.\";\n }", "public CalendarPage() {\n\t\t\n\t\tPageFactory.initElements(driver, this);\n\t}", "@Override\r\n\tpublic void loadHeader() {\n\r\n\t}", "public void clickJS(WebElement element) {\n\t\tgetExecutor().executeScript(\"arguments[0].click();\", element);\n\t\t\n\t}", "public void onModuleLoad() {\n VueGWT.init();\n\n // Inject JS Components\n HTMLScriptElement scriptElement =\n (HTMLScriptElement) DomGlobal.document.createElement(\"script\");\n scriptElement.text = JsFilesResources.INSTANCE.jsComponents().getText();\n DomGlobal.document.body.appendChild(scriptElement);\n\n MelisandreComponentClientBundle.INSTANCE.melisandreComponentStyle().ensureInjected();\n Vue.customElement(\"animal-selector\", AnimalSelectorComponentFactory.get());\n\n VueGwtExamplesService.initExamples();\n }", "@BeforeTest\n\tpublic void LaunchBrowser() {\n\t\t driver = init(\"URL_JQuery\");\n\t\t// driver.get(\"https://jqueryui.com/autocomplete/\");\n\t\t driver.switchTo().frame(0);\n\t\t jq = new JQueryAutocompletePage(driver);\n\t\t \n\t}", "@Override\n public void PageFistLoad() {\n }", "public void beforeScript(String script, WebDriver driver) {\n\t\t\n\t}", "public void jsScroll(By locator) {\n int elementLocation = find(locator).getLocation().getY();\n JavascriptExecutor js = (JavascriptExecutor) driver;\n js.executeScript(\"window.scrollTo(0,\" + elementLocation + \")\");\n }", "private static void outputHeaderMainPage(SimpleWriter out) {\n out.print(\"<html>\\n\" + \"<head>\\n\" + \"\\t<title>\" + \"Index\" + \"</title>\\n\"\n + \"<font size = '10' >\" + \"Glossary Homepage\" + \"</font>\"\n + \"</head>\\n\" + \"<body>\\n\" + \"<head>\\n\" + \"\\t<h1>\\n\"\n + \"<font size = '6' >\" + \"Index\" + \"</font>\" + \"\\t</h1>\\n\"\n + \"</head>\\n\" + \"</body>\\n\" + \"</html>\");\n }", "public static String returningJQ(JavascriptExecutor executor, String cmd, WebElement element) {\n Preconditions.checkNotNull(executor, \"The executor cannot be null.\");\n Preconditions.checkNotNull(cmd, \"The command cannot be null.\");\n Preconditions.checkNotNull(element, \"The element cannot be null.\");\n String jQueryCmd = String.format(\"return jQuery(arguments[0]).%s;\", cmd);\n return String.valueOf(executor.executeScript(jQueryCmd, unwrap(element)));\n }", "@SuppressWarnings(\"unchecked\")\n public static void addScriptResourceToLiferayHead(Object liferayPortlet, String resourceURL, String id) {\n\n // Note: Use Java Reflection in order to avoid a compile-time dependency.\n try {\n Method getHeaderPortalJavaScriptMethod = liferayPortlet.getClass().getMethod(\"getHeaderPortalJavaScript\",\n (Class[]) null);\n boolean added = false;\n\n if (getHeaderPortalJavaScriptMethod != null) {\n List<String> headerPortalJavaScriptList = (List<String>) getHeaderPortalJavaScriptMethod.invoke(\n liferayPortlet, (Object[]) null);\n\n PortalActionURL resurl = new PortalActionURL(resourceURL);\n resurl.addParameter(LIFERAY_RESOURCE_UID, id);\n resourceURL = resurl.toString();\n\n if (headerPortalJavaScriptList != null) {\n if (headerPortalJavaScriptList.contains(resourceURL)) {\n added = true;\n }\n if (!added) {\n ListIterator<String> iter = headerPortalJavaScriptList.listIterator();\n while (iter.hasNext()) {\n String foundURL = iter.next();\n PortalActionURL fresurl = new PortalActionURL(foundURL);\n String fuid = fresurl.getParameter(LIFERAY_RESOURCE_UID);\n if (fuid != null && fuid.equals(id)) {\n //iter.set(resourceURL);\n added = true;\n break;\n }\n }\n }\n if (!added) {\n headerPortalJavaScriptList.add(resourceURL);\n added = true;\n }\n }\n\n }\n\n if (!added) {\n logger.log(Level.WARNING,\n \"Unable to add <script /> resource to <head>...</head> section using Liferay mechanism: url=[{}]\",\n resourceURL);\n }\n } catch (Exception e) {\n logger.log(Level.SEVERE, e.getMessage(), e);\n }\n }", "@Override\r\n public void afterScript(final String arg0, final WebDriver arg1) {\n\r\n }", "public void LoadBanner(){\n }", "@Override\r\npublic void afterScript(String arg0, WebDriver arg1) {\n\tSystem.out.println(\"as\");\r\n}", "@Override\r\n\tpublic void renderHead(IHeaderResponse response) {\n\t\tresponse.renderJavascriptReference(new ResourceReference(NgController.class, \"angular.js\"));\r\n\r\n\t\tGson gson = new GsonBuilder().create();\r\n\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tline(sb, MessageFormat.format(\"<!-- AngularJS {0} data controller -->\", name));\r\n\t\tline(sb, MessageFormat.format(\"function {0}($scope) '{'\", name));\r\n\t\tfor (Map.Entry<String, Object> entry : variables.entrySet()) {\r\n\t\t\tString var = entry.getKey();\r\n\t\t\tObject o = entry.getValue();\r\n\t\t\tString json = gson.toJson(o);\r\n\t\t\tline(sb, MessageFormat.format(\"\\t$scope.{0} = {1};\", var, json));\r\n\t\t}\r\n\t\tline(sb, \"}\");\r\n\r\n\t\tresponse.renderJavascript(sb.toString(), null);\r\n\t}", "@Override\n protected void onLoad() {\n Element element = DOM.getElementById(BANDNAME_LISTBOX_ROW);\n element.setId(BANDNAME_LISTBOX_ROW + radioGroupId);\n\n this.pageLoaded = true;\n quicklookNone.setValue(true, true);\n buildBandNameListBox();\n }", "public HomePage(){\r\n\t\tPageFactory.initElements(driver, this);\r\n\r\n\r\n\t}", "protected void addDynamicHeaders() {\n }", "public void beforeScript(String script, WebDriver driver) {\n\t\t\r\n\t}" ]
[ "0.61523813", "0.60406613", "0.5375932", "0.52549195", "0.5246699", "0.52242523", "0.51936674", "0.5117142", "0.49679524", "0.49325395", "0.489408", "0.48248369", "0.48135084", "0.4801364", "0.47030807", "0.4667011", "0.4652811", "0.46249887", "0.4597355", "0.45882207", "0.45813105", "0.4576936", "0.457303", "0.45534074", "0.45065922", "0.44816253", "0.44758853", "0.44678226", "0.44649014", "0.44599286", "0.44580403", "0.44580403", "0.4445408", "0.44430786", "0.4441676", "0.4424295", "0.44163078", "0.44148678", "0.44131562", "0.43818936", "0.43801293", "0.43719563", "0.43553346", "0.43344632", "0.43328106", "0.43079486", "0.4296857", "0.42922023", "0.42908508", "0.4287884", "0.4276661", "0.42693838", "0.42553028", "0.42484888", "0.4236072", "0.42327344", "0.4230335", "0.42294618", "0.42289788", "0.42210913", "0.42152393", "0.42029262", "0.41897085", "0.41725066", "0.41686386", "0.4165293", "0.41645372", "0.41641816", "0.41604665", "0.4157495", "0.41539338", "0.4148592", "0.4146615", "0.41447148", "0.41352215", "0.41134512", "0.4106257", "0.41050267", "0.4100139", "0.40999317", "0.40947974", "0.4093963", "0.4093336", "0.4088298", "0.4086781", "0.40765572", "0.4072725", "0.4062346", "0.40616214", "0.4061175", "0.40609002", "0.40596837", "0.4054775", "0.40406185", "0.4039052", "0.40298808", "0.40278655", "0.40270206", "0.40235874", "0.40216163" ]
0.6731503
0
Adds a link to the top of the table to allow switching between a publisher or pluginsorted list
private void createSortLink() { String newGrouping; if ("plugin".equals(grouping)) { newGrouping = "publisher"; } else { newGrouping = "plugin"; } String timeString = ""; if ("accurate".equals(timeKey)) { timeString = "&amp;timeKey=" + timeKey; } String linkHref = "/DisplayContentStatus?group=" + newGrouping + timeString; String linkText = "Order by " + newGrouping; Link sortLink = new Link(linkHref); sortLink.attribute("class", "filters"); sortLink.add(linkText); page.add(sortLink); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void onButtonClicked() {\n\t\tclientFactory.getPlaceController().goTo(\r\n\t\t\t\tnew CellTableSortingPlace(\"sortingtable\"));\r\n\t}", "public void syncTableTop() {\n\t\tsetVerticalScrollPosition(rowHeader.getTop());\n\t}", "private void getMarkAsTopNewsLinkPanel() {\n\t\ttry{\n\t\t\tMarkAsTopNewsLinkPanel asTopNewsLinkPanel = new MarkAsTopNewsLinkPanel(newsItem,feedNewsPresenter);\n\t\t\toptionPanel.add(asTopNewsLinkPanel);\n\t\t}catch(Exception e){\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "public void clickOnTableHeading() {\r\n\t\tsafeClick(addMarkerOkButton.replace(\".ant-modal-footer button.ant-btn.ant-btn-primary\",\r\n\t\t\t\t\".ant-table-column-has-actions.ant-table-column-has-sorters.ant-table-column-sort\"), SHORTWAIT);\r\n\t}", "public void addMouseListenerToHeaderInTable(JTable table) {\n final JTable tableView = table;\r\n tableView.setColumnSelectionAllowed(false);\r\n MouseAdapter listMouseListener = new MouseAdapter() {\r\n public void mouseClicked(MouseEvent e) {\r\n TableColumnModel columnModel = tableView.getColumnModel();\r\n int viewColumn = columnModel.getColumnIndexAtX(e.getX());\r\n int column = tableView.convertColumnIndexToModel(viewColumn);\r\n if (e.getClickCount() == 1 && column != -1) {\r\n //System.out.println(\"Sorting ...\");\r\n int shiftPressed = e.getModifiers()&InputEvent.SHIFT_MASK;\r\n int controlPressed = e.getModifiers()&InputEvent.CTRL_MASK;\r\n //boolean ascending = (shiftPressed == 0);\r\n boolean originalOrder = (controlPressed != 0);\r\n //sortedAscending[column] = !(sortedAscending[column]);\r\n //sortByColumn(column, ascending, originalOrder);\r\n sortByColumn(column, !(sortedAscending[column]), originalOrder);\r\n sortedAscending[column] = !(sortedAscending[column]);\r\n //System.out.println(\"sortedAscending[\" + column + \"] = \" + sortedAscending[column]);\r\n if (originalOrder) {\r\n for (int i = 0; i < pAndRModel.getColumnCount(); i++)\r\n sortedAscending[i] = false;\r\n } \r\n //System.out.println(\"sortedAscending[\" + column + \"] = \" + sortedAscending[column]); \r\n }\r\n }\r\n };\r\n JTableHeader th = tableView.getTableHeader();\r\n th.addMouseListener(listMouseListener);\r\n }", "@Override\r\n public void onInserted(ParserItemLink link) {\r\n tableAdd(link);\r\n selectedLink = link;\r\n tableSelect(link);\r\n }", "public void updateTable() {\n tabelModel.setRowCount(0);\n Link current = result.first;\n for (int i = 0; current != null; i++) {\n Object[] row = {current.getMasjid(), current.getAlamat()};\n tabelModel.addRow(row);\n current = current.next;\n }\n }", "@Override\n\tpublic String selectTableList(int top) {\n\t\treturn \"select sqltext,pointid,type from history_table_view where rownum <= \"+top+\" order by id desc\";\n\t}", "public static void displayTableTitle()\r\n {\n }", "public void addRow(ShareLink shareLink) {\n\t\tint row = flexTable.getRowCount();\r\n\t\tButton sharebtn = new Button(shareLink.getShareName());\r\n\t\tsharebtn.setTitle(shareLink.getId().toString());\r\n\t\tsharebtn.addClickHandler(new ShareLinkClickHander());\r\n\t\t// if (myFile.getFileType() == MyFile.TYPE_DIR) {\r\n\t\tsharebtn.setStyleName(\"fileButton\");\r\n\t\t// }\r\n\r\n\t\tflexTable.setWidget(row, 0, sharebtn);\r\n\t\tflexTable.setWidget(row, 1, new Label(\"ShareLink\"));\r\n\t\tflexTable.setWidget(row, 2, new Label(shareLink.getOwner()));\r\n\t}", "public void setupHistoTableHeader() {\r\n\t\tif (this.histoTableTabItem != null && !this.histoTableTabItem.isDisposed()) this.histoTableTabItem.setHeader();\r\n\t}", "private void createIndexLink()\r\n \t{\r\n \t\tif (pageTitle.contains(\"Ruby on Rails\")) {\r\n \t\t\tSimpleLogger.verbose(\" TOC file: not creating index link (no stichwort.htm*\");\r\n \t\t\treturn;\r\n \t\t}\r\n \t\tSimpleLogger.verbose(\" TOC file: creating index link...\");\r\n \t\tElement indexLink = (Element) xPathQuery(XPath.TOC_HEADING_2.query).get(0).copy();\r\n \t\tString fileExtension = \".htm\";\r\n \t\tif (((Element) indexLink.getChild(0)).getAttribute(\"href\").getValue().contains(\".html\"))\r\n \t\t\tfileExtension = \".html\";\r\n \t\t((Element) indexLink.getChild(0)).getAttribute(\"href\").setValue(\"stichwort\" + fileExtension);\r\n \t\t((Text) indexLink.getChild(0).getChild(0)).setValue(\"Index\");\r\n \t\tbodyTag.appendChild(indexLink);\r\n \r\n \t}", "@Override\n public void addLoadHistoryHeader(boolean showLoader) throws RemoteException {\n }", "public void updateTable(){\n this.tableModel = (DefaultTableModel) sitesTable.getModel();\n while( this.tableModel.getRowCount() != 0 ){\n this.tableModel.removeRow(0);\n }\n \n if( Console.isAdmin ){\n for( int i = 0 ; i < this.websites.size() ; i++ ){\n Website website = this.websites.get(i);\n this.tableModel.addRow(new Object[]{ website.name , website.IP , website.isRouted() , website.Description });\n }\n }else{\n for( int i = 0 ; i < this.websites.size() ; i++ ){\n Website website = this.websites.get(i);\n this.tableModel.addRow(new Object[]{ website.name , website.IP , website.wasRerouted , website.Description });\n }\n }\n\n sitesTable.setModel(this.tableModel);\n }", "public void addMouseListenerToHeaderInTable(JTable table) {\n final TableSorter sorter = this;\n final JTable tableView = table;\n tableView.setColumnSelectionAllowed(false);\n MouseAdapter listMouseListener = new MouseAdapter() {\n\n public void mouseClicked(MouseEvent e) {\n TableColumnModel columnModel = tableView.getColumnModel();\n int viewColumn = columnModel.getColumnIndexAtX(e.getX());\n int clickedColumn = tableView.convertColumnIndexToModel(viewColumn);\n if (e.getClickCount() == 1 && clickedColumn != -1) {\n TableSorter.this.sortingColumn = clickedColumn;\n int shiftPressed = e.getModifiers() & InputEvent.SHIFT_MASK;\n boolean ascending = (shiftPressed == 0);\n sorter.sortByColumn(clickedColumn, ascending);\n TableSorter.this.sorted = true;\n int colIndex = tableView.getColumnCount();\n javax.swing.table.TableColumn tc;\n for (int i = 0; i < colIndex; i++) {\n tc = columnModel.getColumn(i);\n if (i != viewColumn) {\n tc.setHeaderRenderer(null);\n }\n }\n tc = columnModel.getColumn(viewColumn);\n System.out.println(\" the clicked column name is \" + tableView.getColumnName(viewColumn));\n DefaultTableCellRenderer headerRenderer = TableSorter.this.createTableCellRenderer(ascending);\n tc.setHeaderRenderer(headerRenderer);\n }\n }\n };\n JTableHeader th = tableView.getTableHeader();\n th.addMouseListener(listMouseListener);\n }", "private void displayAllTable() {\n\n nhacungcap = new NhaCungCap();\n nhacungcap.setVisible(true);\n jDestopTable.add(nhacungcap);\n\n thuoc = new SanPham();\n thuoc.setVisible(true);\n jDestopTable.add(thuoc);\n\n khachHang = new KhachHang();\n khachHang.setVisible(true);\n jDestopTable.add(khachHang);\n\n hoaDon = new HoaDon();\n hoaDon.setVisible(true);\n jDestopTable.add(hoaDon);\n\n }", "public JP1Table( TableModel model )\n {\n super( model );\n setSelectionMode( ListSelectionModel.SINGLE_SELECTION );\n // getSelectionModel().addListSelectionListener( this );\n setCellSelectionEnabled( true );\n setSurrendersFocusOnKeystroke( true );\n setAutoResizeMode( JTable.AUTO_RESIZE_LAST_COLUMN );\n tableHeader.setReorderingAllowed( false );\n DefaultCellEditor e = ( DefaultCellEditor )getDefaultEditor( String.class );\n new TextPopupMenu( ( JTextComponent )e.getComponent() );\n }", "public interface TableSortable {\n int getTableNumber();\n}", "public void setBamLink(String linkText) {\n\t\tvarTable.getHeader().setBAMLink(linkText);\n\t}", "@Override\n\tpublic void onToggleSort(String header) {\n\t\tsynapseClient.toggleSortOnTableQuery(this.startingQuery.getSql(), header, new AsyncCallback<String>(){\n\t\t\t@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tshowError(caught);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onSuccess(String sql) {\n\t\t\t\trunSql(sql);\n\t\t\t}});\n\t}", "private void intiPlanTable(){\n //gets all plans that are linked with the current profile\n List<Plan> planList = profile.getPlans().getPlans();\n //now add all plans to the table\n DefaultTableModel model = (DefaultTableModel) this.jTable1.getModel();\n model.setRowCount(0);\n planList.forEach((p) -> {\n model.addRow(new Object[]{p.getPlanName(),p});\n });\n }", "public LinkDisplay()\n\t{\n\t\treturn;\n\t}", "private void sendTableHeader(CommandType type) {\n switch (type) {\n case LECTURER:\n sendMsgToClient(\"@|bold,cyan \" + String.format(\"%-25s %s\", \"Name\", \"Subject\" + \"|@\"));\n sendMsgToClient(\"@|cyan -------------------------------- |@\");\n break;\n case SUBJECT:\n sendMsgToClient(\"@|bold,cyan \" +\n String.format(\"%-30s %-10s %-10s %s\", \"Subject\", \"Code\", \"Enrolled\", \"Lecturer(s)|@\"));\n sendMsgToClient(\"@|cyan ----------------------------------------------------------------------------- |@\");\n break;\n }\n }", "public void navigateToExternalLinks() {\n\t\tjse.executeScript(\"arguments[0].scrollIntoView(true);\", externalArticlesHdr);\n\t}", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\tTableColumn workflowName = new TableColumn(\"Name\");\r\n\t\t\r\n\t\tworkflowName.setCellValueFactory(\r\n new PropertyValueFactory<WorkflowEntry, String>(\"name\"));\r\n\t\t\r\n\t\tTableColumn info = new TableColumn(\"Info\");\r\n\t\t\r\n\t info.setCellValueFactory(\r\n new PropertyValueFactory<WorkflowEntry, String>(\"info\"));\r\n\t \r\n\t // Adding a button to tableView\r\n\t \r\n\t TableColumn actionCol = new TableColumn( \"Action\" );\r\n actionCol.setCellValueFactory( new PropertyValueFactory<>( \"DUMMY\" ) );\r\n \r\n\t\ttableView.getColumns().addAll(workflowName,info,actionCol);\r\n\r\n\t}", "public void scrollToTop()\n {\n ensureIndexIsVisible(0);\n }", "public String hyperlink1_action() {\n try {\n String primaryid = (String)hyperlink1.getValue();\n getSessionBean1().getProcesseddatasetRowSet().setObject(\n 1, primaryid);\n //dbssearch.Page1.processeddatasetDataProvider.refresh();\n }catch (Exception e) {\n log(\"Exception Raised:\" + e.getMessage());\n }\n return \"case1\";\n }", "private void onShowTableDetail(ViewNodeJSO viewNode) { \n TableTools.createDataProvider(viewNode).addDataDisplay(cellTable);\n }", "@Override\n\tpublic int addLink(Link link) {\n\t\treturn 0;\n\t}", "public void installPopup(JTable table) {\n\t\t// Must trigger the popup menu\n\t\ttable.getTableHeader().addMouseListener(mouseListener);\n\t}", "public void displayTable() {\n\t\tcontent.addComponent(tableDisplay.getGrid());\n\t\tthis.removeStyleName(\"fr_map_component_no_table\");\n\t}", "public void addTableToTabelNavigation(String tableTitle, final String subTableTitle, Object[] header) {\n\t\tfinal ConsoleTableNavigation table = (ConsoleTableNavigation) getBoard(tableTitle);\n\t\ttable.getTabbedPane().addTable(subTableTitle, header);\n\t}", "private void changeToSearchTable() {\n\t\ttableView.setItems(presentationSearchData);\n\n\t\tif(fileType == FileType.UNASSIGNED) {\n\t\t\ttableView.getColumns().clear();\n\t\t\ttableView.getColumns().addAll(rfid,campus,building,room,lastScannedOn,lastScannedBy,purchaseOrder,serviceTag,comments);\n\t\t} // End if statement\n\t}", "public TablesPanel() {\n\n tableModel = new TablesTableModel(); \n matchesModel = new MatchesTableModel();\n gameChooser = new GameChooser();\n\n initComponents();\n // tableModel.setSession(session);\n\n // formater\n // change default just now from 60 to 30 secs\n // see workaround for 4.0 versions: https://github.com/ocpsoft/prettytime/issues/152\n TimeFormat timeFormat = timeFormater.removeUnit(JustNow.class);\n JustNow newJustNow = new JustNow();\n newJustNow.setMaxQuantity(1000L * 30L); // 30 seconds gap (show \"just now\" from 0 to 30 secs)\n timeFormater.registerUnit(newJustNow, timeFormat);\n\n // 1. TABLE CURRENT\n tableTables.createDefaultColumnsFromModel();\n ((MageTable)tableTables).setTableInfo(tableInfo);\n \n activeTablesSorter = new MageTableRowSorter(tableModel) {\n @Override\n public void toggleSortOrder(int column) {\n // special sort for created and seat column\n if (column == TablesTableModel.COLUMN_CREATED || column == TablesTableModel.COLUMN_SEATS) {\n List<? extends SortKey> sortKeys = getSortKeys();\n if (sortKeys.size() == 2) {\n // clear sort on second click\n setSortKeys(null);\n } else {\n // setup sort on first click\n List<SortKey> list = new ArrayList<>();\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_SEATS, SortOrder.ASCENDING));\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_CREATED, SortOrder.DESCENDING));\n setSortKeys(list);\n }\n } else {\n super.toggleSortOrder(column);\n }\n }\n };\n tableTables.setRowSorter(activeTablesSorter);\n\n // time ago\n tableTables.getColumnModel().getColumn(TablesTableModel.COLUMN_CREATED).setCellRenderer(timeAgoCellRenderer);\n // skill level\n tableTables.getColumnModel().getColumn(TablesTableModel.COLUMN_SKILL).setCellRenderer(skillCellRenderer);\n // seats\n tableTables.getColumnModel().getColumn(TablesTableModel.COLUMN_SEATS).setCellRenderer(seatsCellRenderer);\n\n /* date sorter (not need, default is good - see getColumnClass)\n activeTablesSorter.setComparator(TablesTableModel.COLUMN_CREATED, new Comparator<Date>() {\n @Override\n public int compare(Date v1, Date v2) {\n return v1.compareTo(v2);\n }\n\n });*/\n\n // seats sorter (free tables must be first)\n activeTablesSorter.setComparator(TablesTableModel.COLUMN_SEATS, new Comparator<String>() {\n @Override\n public int compare(String v1, String v2) {\n int[] seats1 = parseSeatsInfo(v1);\n int[] seats2 = parseSeatsInfo(v2);\n boolean free1 = seats1[0] != seats1[1];\n boolean free2 = seats2[0] != seats2[1];\n\n // free seats go first\n if (free1 || free2) {\n return Boolean.compare(free2, free1);\n }\n\n // all other seats go without sorts\n return 0;\n }\n });\n\n // default sort by created date (last games from above)\n ArrayList list = new ArrayList<>();\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_SEATS, SortOrder.ASCENDING));\n list.add(new RowSorter.SortKey(TablesTableModel.COLUMN_CREATED, SortOrder.DESCENDING));\n activeTablesSorter.setSortKeys(list);\n\n TableUtil.setColumnWidthAndOrder(tableTables, DEFAULT_COLUMNS_WIDTH, KEY_TABLES_COLUMNS_WIDTH, KEY_TABLES_COLUMNS_ORDER);\n\n // 2. TABLE COMPLETED\n completedTablesSorter = new MageTableRowSorter(matchesModel);\n tableCompleted.setRowSorter(completedTablesSorter);\n\n // duration\n tableCompleted.getColumnModel().getColumn(MatchesTableModel.COLUMN_DURATION).setCellRenderer(durationCellRenderer);\n // start-end\n tableCompleted.getColumnModel().getColumn(MatchesTableModel.COLUMN_START).setCellRenderer(datetimeCellRenderer);\n tableCompleted.getColumnModel().getColumn(MatchesTableModel.COLUMN_END).setCellRenderer(datetimeCellRenderer);\n // default sort by ended date (last games from above)\n ArrayList list2 = new ArrayList<>();\n list2.add(new RowSorter.SortKey(MatchesTableModel.COLUMN_END, SortOrder.DESCENDING));\n completedTablesSorter.setSortKeys(list2);\n\n // 3. CHAT\n chatPanelMain.getUserChatPanel().useExtendedView(ChatPanelBasic.VIEW_MODE.NONE);\n chatPanelMain.getUserChatPanel().setBorder(null);\n chatPanelMain.getUserChatPanel().setChatType(ChatPanelBasic.ChatType.TABLES);\n\n // 4. BUTTONS (add new buttons to the end of the list -- if not then users lost their filter settings)\n filterButtons = new JToggleButton[]{btnStateWaiting, btnStateActive, btnStateFinished,\n btnTypeMatch, btnTypeTourneyConstructed, btnTypeTourneyLimited,\n btnFormatBlock, btnFormatStandard, btnFormatModern, btnFormatLegacy, btnFormatVintage, btnFormatPremodern, btnFormatCommander, btnFormatTinyLeader, btnFormatLimited, btnFormatOther,\n btnSkillBeginner, btnSkillCasual, btnSkillSerious, btnRated, btnUnrated, btnOpen, btnPassword, btnFormatOathbreaker, btnFormatPioneer};\n\n JComponent[] components = new JComponent[]{chatPanelMain, jSplitPane1, jScrollPaneTablesActive, jScrollPaneTablesFinished, jPanelTop, jPanelTables};\n for (JComponent component : components) {\n component.setOpaque(false);\n }\n\n jScrollPaneTablesActive.getViewport().setBackground(new Color(255, 255, 255, 50));\n jScrollPaneTablesFinished.getViewport().setBackground(new Color(255, 255, 255, 50));\n\n restoreFilters();\n setGUISize();\n\n Action openTableAction;\n openTableAction = new AbstractAction() {\n @Override\n public void actionPerformed(ActionEvent e) {\n String searchID = e.getActionCommand();\n int modelRow = TablesUtil.findTableRowFromSearchId(tableModel, searchID);\n if (modelRow == -1) {\n return;\n }\n UUID tableId = (UUID) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 3);\n UUID gameId = (UUID) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 2);\n String action = (String) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN);\n String gameType = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_GAME_TYPE);\n boolean isTournament = (Boolean) tableModel.getValueAt(modelRow, TablesTableModel.ACTION_COLUMN + 1);\n String owner = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_OWNER);\n String pwdColumn = (String) tableModel.getValueAt(modelRow, TablesTableModel.COLUMN_PASSWORD);\n switch (action) {\n case \"Join\":\n if (owner.equals(SessionHandler.getUserName()) || owner.startsWith(SessionHandler.getUserName() + ',')) {\n try {\n JDesktopPane desktopPane = (JDesktopPane) MageFrame.getUI().getComponent(MageComponents.DESKTOP_PANE);\n JInternalFrame[] windows = desktopPane.getAllFramesInLayer(javax.swing.JLayeredPane.DEFAULT_LAYER);\n for (JInternalFrame frame : windows) {\n if (frame.getTitle().equals(\"Waiting for players\")) {\n frame.toFront();\n frame.setVisible(true);\n try {\n frame.setSelected(true);\n } catch (PropertyVetoException ve) {\n LOGGER.error(ve);\n }\n }\n\n }\n } catch (InterruptedException ex) {\n LOGGER.error(ex);\n }\n return;\n }\n if (isTournament) {\n LOGGER.info(\"Joining tournament \" + tableId);\n if (!gameType.startsWith(\"Constructed\")) {\n if (TablesTableModel.PASSWORD_VALUE_YES.equals(pwdColumn)) {\n joinTableDialog.showDialog(roomId, tableId, true, !gameType.startsWith(\"Constructed\"));\n } else {\n SessionHandler.joinTournamentTable(roomId, tableId, SessionHandler.getUserName(), PlayerType.HUMAN, 1, null, \"\");\n }\n } else {\n joinTableDialog.showDialog(roomId, tableId, true, !gameType.startsWith(\"Constructed\"));\n }\n } else {\n LOGGER.info(\"Joining table \" + tableId);\n joinTableDialog.showDialog(roomId, tableId, false, false);\n }\n break;\n case \"Remove\":\n UserRequestMessage message = new UserRequestMessage(\"Removing table\", \"Are you sure you want to remove table?\");\n message.setButton1(\"No\", null);\n message.setButton2(\"Yes\", PlayerAction.CLIENT_REMOVE_TABLE);\n MageFrame.getInstance().showUserRequestDialog(message);\n break;\n case \"Show\":\n if (isTournament) {\n LOGGER.info(\"Showing tournament table \" + tableId);\n SessionHandler.watchTable(roomId, tableId);\n }\n break;\n case \"Watch\":\n if (!isTournament) {\n LOGGER.info(\"Watching table \" + tableId);\n SessionHandler.watchTable(roomId, tableId);\n }\n break;\n case \"Replay\":\n LOGGER.info(\"Replaying game \" + gameId);\n SessionHandler.replayGame(gameId);\n break;\n }\n }\n };\n\n Action closedTableAction;\n closedTableAction = new AbstractAction() {\n @Override\n public void actionPerformed(ActionEvent e) {\n String searchID = e.getActionCommand();\n int modelRow = TablesUtil.findTableRowFromSearchId(matchesModel, searchID);\n if (modelRow == -1) {\n return;\n }\n String action = (String) matchesModel.getValueAt(modelRow, MatchesTableModel.COLUMN_ACTION);\n switch (action) {\n case \"Replay\":\n java.util.List<UUID> gameList = matchesModel.getListofGames(modelRow);\n if (gameList != null && !gameList.isEmpty()) {\n if (gameList.size() == 1) {\n SessionHandler.replayGame(gameList.get(0));\n } else {\n gameChooser.show(gameList, MageFrame.getDesktop().getMousePosition());\n }\n }\n // MageFrame.getDesktop().showTournament(tournamentId);\n break;\n case \"Show\":\n if (matchesModel.isTournament(modelRow)) {\n LOGGER.info(\"Showing tournament table \" + matchesModel.getTableId(modelRow));\n SessionHandler.watchTable(roomId, matchesModel.getTableId(modelRow));\n }\n break;\n }\n }\n };\n\n // !!!! adds action buttons to the table panel (don't delete this)\n actionButton1 = new TablesButtonColumn(tableTables, openTableAction, tableTables.convertColumnIndexToView(TablesTableModel.ACTION_COLUMN));\n actionButton2 = new TablesButtonColumn(tableCompleted, closedTableAction, tableCompleted.convertColumnIndexToView(MatchesTableModel.COLUMN_ACTION));\n // selection\n tablesLastSelection.put(tableTables, \"\");\n tablesLastSelection.put(tableCompleted, \"\");\n addTableSelectListener(tableTables);\n addTableSelectListener(tableCompleted);\n // double click\n addTableDoubleClickListener(tableTables, openTableAction);\n addTableDoubleClickListener(tableCompleted, closedTableAction);\n }", "public void setTop_actif(String top_actif) {\r\n\t\tthis.top_actif = top_actif;\r\n\t}", "private static void drawTableCompenents() {\n\t\ttopColumn = new JLabel(\"location\");\r\n\t\ttopColumn.setLocation(200, 0);\r\n\t\tExtension.instance.add(topColumn);\r\n\t}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jToggleButton2 = new javax.swing.JToggleButton();\n jScrollPane1 = new javax.swing.JScrollPane();\n JTSimpleTable = new javax.swing.JTable();\n jPPag = new javax.swing.JPanel();\n jBTFirst = new javax.swing.JButton();\n jBTPrev = new javax.swing.JButton();\n pageLabel = new javax.swing.JLabel();\n JBtNext = new javax.swing.JButton();\n jBTLast = new javax.swing.JButton();\n\n jToggleButton2.setText(\"jToggleButton2\");\n\n JTSimpleTable.setAutoCreateRowSorter(true);\n JTSimpleTable.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 jScrollPane1.setViewportView(JTSimpleTable);\n\n jBTFirst.setText(\"<<\");\n jBTFirst.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBTFirstActionPerformed(evt);\n }\n });\n\n jBTPrev.setText(\"<\");\n jBTPrev.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBTPrevActionPerformed(evt);\n }\n });\n\n pageLabel.setText(\"jLabel1\");\n\n JBtNext.setText(\">\");\n JBtNext.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n JBtNextActionPerformed(evt);\n }\n });\n\n jBTLast.setText(\">>\");\n jBTLast.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n jBTLastActionPerformed(evt);\n }\n });\n\n javax.swing.GroupLayout jPPagLayout = new javax.swing.GroupLayout(jPPag);\n jPPag.setLayout(jPPagLayout);\n jPPagLayout.setHorizontalGroup(\n jPPagLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPPagLayout.createSequentialGroup()\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(jBTFirst)\n .addGap(0, 0, 0)\n .addComponent(jBTPrev)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(pageLabel)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(JBtNext)\n .addGap(0, 0, 0)\n .addComponent(jBTLast))\n );\n jPPagLayout.setVerticalGroup(\n jPPagLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPPagLayout.createSequentialGroup()\n .addGroup(jPPagLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(jBTFirst)\n .addComponent(jBTPrev)\n .addComponent(pageLabel)\n .addComponent(JBtNext)\n .addComponent(jBTLast))\n .addGap(0, 0, Short.MAX_VALUE))\n );\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(322, Short.MAX_VALUE)\n .addComponent(jPPag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(319, 319, 319))\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(jPPag, 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 }", "@Override\r\n\tpublic void goToShowList() {\n\t\t\r\n\t}", "private void renderArticleTable(){\r\n\t\tarticleTable.setContainerDataSource(loadLatestArticles());\r\n\t\tif(articleDto.isEmpty()){\r\n\t\t\tlabel.setVisible(true);\r\n\t\t\tarticleTable.setVisible(false);\r\n\t\t}else {\r\n\t\t\tlabel.setVisible(false);\r\n\t\t\tarticleTable.setVisible(true);\r\n\t\t}\r\n\t}", "public adminhome() {\n initComponents();\n jButton7.setVisible(false);\n addtopic.setVisible(false);\n addDatatoTable();\n }", "@Override\n\tpublic void addSort(SortBean sb) {\n\t\tsql=\"insert into news_sort values(?,?,?)\";\n\t\tDBUtil db = new DBUtil(sql);\n\t\ttry {\n\t\t\tdb.ps.setInt(1, sb.getSort_id());\n\t\t\tdb.ps.setString(2, sb.getSort_name());\n\t\t\tdb.ps.setString(3, sb.getRSS());\n\t\t\tdb.ps.executeUpdate();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}finally{db.close();}\n\t}", "public void setDoubleClickOnTable(){\n tableView.setRowFactory(tableView-> {\n TableRow<String[]> row = new TableRow<>();\n row.setOnMouseClicked(event -> {\n displayHistory(event, row);\n });\n return row;\n });\n }", "public Home() {\n initComponents();\n DefaultTableModel modelo = (DefaultTableModel) tbl_dados_livros.getModel();\n tbl_dados_livros.setRowSorter(new TableRowSorter(modelo));\n setLocationRelativeTo(null);\n btn_editar.setEnabled(false);\n btn_deletar.setEnabled(false);\n \n \n \n recuperarTabela();\n \n }", "@Override\r\n\tpublic void initializeTableContents() {\n\t\t\r\n\t}", "@When(\"I click on add to compare list link\")\n public void i_click_on_add_to_compare_list_link() {\n BasePage.driverUtils.waitForWebElementToBeClickable(BasePage.htcOneMiniBluePage.getHtcOneMiniBlueAddToCompareListButton());\n BasePage.htcOneMiniBluePage.getHtcOneMiniBlueAddToCompareListButton().click();\n }", "private void createLinkedInTable(){\n cellTableOfLinkedIn.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);\n\n // Add a text columns to show the details.\n TextColumn<LinkedInProfile> firstName = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getFirstName();\n }\n };\n cellTableOfLinkedIn.addColumn(firstName, \"First Name\");\n\n TextColumn<LinkedInProfile> lastName = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getLastName();\n }\n };\n cellTableOfLinkedIn.addColumn(lastName, \"Last Name\");\n\n TextColumn<LinkedInProfile> emailAddress = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getEmailAddress();\n }\n };\n cellTableOfLinkedIn.addColumn(emailAddress, \"Email Address\");\n\n TextColumn<LinkedInProfile> industry = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getIndustry();\n }\n };\n cellTableOfLinkedIn.addColumn(industry, \"Industry\");\n\n TextColumn<LinkedInProfile> currentPositionCompany = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getCurrentPositionCompany();\n }\n };\n cellTableOfLinkedIn.addColumn(currentPositionCompany, \"Current Company\");\n\n TextColumn<LinkedInProfile> pictureUrl = new TextColumn<LinkedInProfile>() {\n @Override\n public String getValue(LinkedInProfile object) {\n return object.getPictureUrl();\n }\n };\n cellTableOfLinkedIn.addColumn(pictureUrl, \"Picture URL\");\n\n final SingleSelectionModel<LinkedInProfile> selectionModel = new SingleSelectionModel<>();\n cellTableOfLinkedIn.setSelectionModel(selectionModel);\n }", "private void addTable()\r\n {\r\n // Create the table\r\n table = new JTable();\r\n table.setAutoCreateRowSorter(true);\r\n table.setColumnSelectionAllowed(false);\r\n table.getTableHeader().setReorderingAllowed(false);\r\n table.setModel(new JarModel());\r\n \r\n // Center the column headings\r\n ((DefaultTableCellRenderer) table.getTableHeader().\r\n getDefaultRenderer()).setHorizontalAlignment(SwingConstants.CENTER);\r\n \r\n // Set the column widths\r\n table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);\r\n table.getColumnModel().getColumn(0).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(0).setMaxWidth(250);\r\n table.getColumnModel().getColumn(2).setPreferredWidth(140);\r\n table.getColumnModel().getColumn(2).setMaxWidth(250);\r\n table.getColumnModel().getColumn(3).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(3).setMaxWidth(250);\r\n table.getColumnModel().getColumn(4).setPreferredWidth(100);\r\n table.getColumnModel().getColumn(4).setMaxWidth(250);\r\n \r\n // Sort on the first column\r\n table.getRowSorter().toggleSortOrder(0);\r\n \r\n table.getColumnModel().getColumn(0).setCellRenderer(new BooleanColorCellRenderer());\r\n table.getColumnModel().getColumn(2).setCellRenderer(new DateCellRenderer());\r\n \r\n // Add the table to the panel\r\n add(new JScrollPane(table), BorderLayout.CENTER);\r\n }", "public static void printSubTableRecipients() {\n System.out.println(\"\\n\\t(I) - Sort by ID\");\n System.out.println(\"\\t(N) - Sort by Number of Donors\");\n System.out.println(\"\\t(B) - Sort by Blood Type\");\n System.out.println(\"\\t(O) - Sort by Organ Needed\");\n System.out.println(\"\\t(Q) - Back to Main Menu\");\n }", "public void hyperlinkUpdate(HyperlinkEvent event) {\r\n\t\t// TODO add open link in default browser\r\n\t\tif (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {\r\n\t\t\ttry {\r\n\t\t\t\th.setPage(event.getURL());\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tioe.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "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 }", "public void AddLink() {\n snake.add(tail + 1, new Pair(snake.get(tail).GetFirst(), snake.get(tail).GetSecond())); //Set the new link to the current tail link\n tail++;\n new_link = true;\n }", "public void addHeaders() {\n TableLayout tl = findViewById(R.id.table);\n TableRow tr = new TableRow(this);\n tr.setLayoutParams(getLayoutParams());\n if (!haverford) {\n tr.addView(getTextView(0, \"Leave Bryn Mawr\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n tr.addView(getTextView(0, \"Arrive Haverford\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n } else {\n tr.addView(getTextView(0, \"Leave Haverford\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n tr.addView(getTextView(0, \"Arrive Bryn Mawr\", Color.WHITE, Typeface.BOLD, Color.BLUE));\n }\n tl.addView(tr, getTblLayoutParams());\n }", "public AdminPanel() {\n Object paint[][] = {};\n jtModel = new DefaultTableModel(paint,columnNames)\n {\n @Override\n public boolean isCellEditable(int row, int column) {\n return false;\n } \n @Override\n public Class getColumnClass(int column) {\n switch (column) {\n case 2:\n /* This is for the price column sorting */\n return Integer.class;\n default:\n return String.class;//This is for the name column sorting.\n }\n }\n \n };\n initComponents();\n jt.getTableHeader().setResizingAllowed(false);\n jt.getTableHeader().setReorderingAllowed(false);\n \n TableRowSorter<TableModel> sorting = new TableRowSorter<>(jt.getModel());\n jt.setRowSorter(sorting); \n \n // These column can't be sorted.\n sorting.setSortable(0, false);\n sorting.setSortable(3, false);\n sorting.setSortable(4, false);\n sorting.setSortable(5, false);\n sorting.setSortable(6, false);\n sorting.setSortable(7, false);\n sorting.setSortable(8, false);\n addFile();\n }", "protected void displayOrderTable(List<ArticleStock> articles) {\n\t\tOrderViewModel model = new OrderViewModel(articles);\n\t\ttable.setModel(model);\n\t}", "private void fillTableWithLinkResult(List<LinkSimulationResult> results, boolean showAsTimeSerie) {\n\n TableView<LinkSimulationResult> table = new TableView<>();\n table.getItems().addAll(results);\n\n TableColumn<LinkSimulationResult,String> idOrTimeCol;\n TableColumn<LinkSimulationResult,String> flowCol = new TableColumn<>(\"Flow\");\n TableColumn<LinkSimulationResult,String> velocityCol = new TableColumn<>(\"Velocity\");\n TableColumn<LinkSimulationResult,String> headlossCol = new TableColumn<>(\"Headloss\");\n TableColumn<LinkSimulationResult,String> statusCol = new TableColumn<>(\"Status\");\n\n if (!showAsTimeSerie){\n idOrTimeCol = new TableColumn<>(\"Node ID\");\n idOrTimeCol.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getId()));\n } else {\n idOrTimeCol = new TableColumn<>(\"Time\");\n idOrTimeCol.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getTimeString()));\n }\n flowCol.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(Double.toString(param.getValue().getFlow())));\n velocityCol.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(Double.toString(param.getValue().getVelocity())));\n headlossCol.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(Double.toString(param.getValue().getHeadloss())));\n statusCol.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getStatus().getName()));\n\n table.getColumns().clear();\n table.getColumns().addAll(idOrTimeCol, flowCol, velocityCol, headlossCol, statusCol);\n\n this.tablePane.getChildren().clear(); // remove the previus table\n this.tablePane.getChildren().addAll(table);\n }", "public static void printSubTableDonors() {\n System.out.println(\"\\n\\t(I) - Sort by ID\");\n System.out.println(\"\\t(N) - Sort Number of Recipients\");\n System.out.println(\"\\t(B) - Sort by Blood Type\");\n System.out.println(\"\\t(O) - Sort by Organ Donated\");\n System.out.println(\"\\t(Q) - Back to Main Menu\");\n }", "private void buildTablePanel() {\n \t\tJPanel panel = new JPanel();\n \t\t\n \t\t// settings:\n \t\theader.setReorderingAllowed(false); // no moving.\n \t\ttable.setColumnSelectionAllowed(true);\n \t\ttable.setRowSelectionAllowed(true);\n \t\ttable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\n \t\t\n \t\theader.addMouseListener(tableModel.new SortColumnAdapter());\n \t\t\t\n \t\tTableCellRenderer renderer = new TableCellRenderer() {\n \n \t\t\tJLabel label = new JLabel();\n \t\t\t\n \t\t\t@Override\n \t public JComponent getTableCellRendererComponent(JTable table,\n \t Object value, boolean isSelected, boolean hasFocus,\n \t int row, int column) {\n \t \n \t\t\t\tif (table.isRowSelected(row)) {\n \t\t\t\t\tlabel.setBackground(Color.RED);\n \t\t\t\t} else {\n \t\t\t\t\tlabel.setBackground(UIManager.getColor(\"Table.background\"));\n \t\t\t\t}\n \t\t\t\t\n \t\t\t\tlabel.setOpaque(true);\n \t\t\t\tlabel.setText(\"\" + value);\n \t\t\t\t\n \t return label;\n \t }\n \n \t };\n \t table.setDefaultRenderer(Object.class, renderer);\n \t \n \t JScrollPane scroll = new JScrollPane(table);\n \t\t\n \t\tpanel.setLayout(new BorderLayout(5, 5));\n \t\tpanel.add(scroll, BorderLayout.CENTER);\n \t \n \t add(panel, BorderLayout.CENTER);\n \t}", "private void populateTable() {\n Collections.sort(this.player.arr, new SortByLevel());\n achievementLabel.setText(player.toString() + \" at \" + new SimpleDateFormat(\"dd/MM/yy HH:mm:ss\").format(new Date()));\n for(int i = 0; i < this.player.arr.size(); i++) {\n Achievement temp = this.player.arr.get(i);\n resultsTable.addRow(new Object[] {temp.getDescription(), temp.getLevel(), temp.getOutOfPossible()});\n }\n }", "private void addCards(){\n\t\tDeck deck = new BasicDeckBuilder().getDeck();\r\n\t\tTabletop table = new Tabletop(deck);\r\n\t\tcardtable.getChildren().addAll(table);\r\n\t\tAnchorPane.setTopAnchor(table, 30.0);\r\n\t\tAnchorPane.setBottomAnchor(table, 30.0);\r\n\t\tAnchorPane.setLeftAnchor(table, 30.0);\r\n\t\tAnchorPane.setRightAnchor(table, 30.0);\r\n\t}", "public Home() {\n this.tracker = new Tracker(this);\n initComponents();\n \n \n String[] columnNamesPeers = {\"IP\",\"State\"};\n \n this.modelPeers = new DefaultTableModel(columnNamesPeers, 0);\n this.jTable1.setModel(modelPeers);\n \n String[] columnNamesFiles = { \"Name File\", \"IP - Client\",\"State\"};\n \n this.modelFiles = new DefaultTableModel(columnNamesFiles, 0);\n this.jTable2.setModel(modelFiles);\n \n \n }", "@Override\r\n\tpublic void editSort() {\n\t\t\r\n\t}", "private void UpdateTable() {\n\t\t\t\t\n\t\t\t}", "public void showHistorySwitchAction() {\n\t\tanimalsListPanel.switchToPast();\n\t}", "public void addTableNavigation(String title) {\n\n\t\t// Create panel\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setLayout(new BorderLayout());\n\n\t\t// Create and add text editor to panel\n\t\tConsoleTableNavigation table = new ConsoleTableNavigation();\n\t\tJScrollPane scrollPane = new JScrollPane(table);\n\t\tpanel.add(scrollPane, BorderLayout.CENTER);\n\n\t\t// Add the tab\n\t\taddTab(title, null, scrollPane);\n\n\t\t// Store it in the map\n\t\tthis.tabPanelsMap.put(title, table);\n\t}", "public LinkButton() {\n\t\tsuper();\n\t\tinit();\n\t}", "@Override\r\n\t\t\tpublic void partBroughtToTop(IWorkbenchPartReference partRef) {\n\t\t\t\t\r\n\t\t\t}", "public void linkRecords();", "private void initializePanel(PlaylistsTableModel tablemodel) {\n\t\tmyTable = new MyTable(tablemodel);\n\t\t\n\t\tthis.setBackground(sURLBACK);\t\n\t\tthis.setLayout(new GridBagLayout());\n\t}", "private void setUpTable()\n {\n //Setting the outlook of the table\n bookTable.setColumnReorderingAllowed(true);\n bookTable.setColumnCollapsingAllowed(true);\n \n \n bookTable.setContainerDataSource(allBooksBean);\n \n \n //Setting up the table data row and column\n /*bookTable.addContainerProperty(\"id\", Integer.class, null);\n bookTable.addContainerProperty(\"book name\",String.class, null);\n bookTable.addContainerProperty(\"author name\", String.class, null);\n bookTable.addContainerProperty(\"description\", String.class, null);\n bookTable.addContainerProperty(\"book genres\", String.class, null);\n */\n //The initial values in the table \n db.connectDB();\n try{\n allBooks = db.getAllBooks();\n }catch(SQLException ex)\n {\n ex.printStackTrace();\n }\n db.closeDB();\n allBooksBean.addAll(allBooks);\n \n //Set Visible columns (show certain columnes)\n bookTable.setVisibleColumns(new Object[]{\"id\",\"bookName\", \"authorName\", \"description\" ,\"bookGenreString\"});\n \n //Set height and width\n bookTable.setHeight(\"370px\");\n bookTable.setWidth(\"1000px\");\n \n //Allow the data in the table to be selected\n bookTable.setSelectable(true);\n \n //Save the selected row by saving the change Immediately\n bookTable.setImmediate(true);\n //Set the table on listener for value change\n bookTable.addValueChangeListener(new Property.ValueChangeListener()\n {\n public void valueChange(ValueChangeEvent event) {\n \n }\n\n });\n }", "public void OrderHistoryInit() {\n orderId = -1;\n ArrayList<Orders> orders = new OrdersBean().getFromUsername(Global.getUsername());\n setDataModel(orders);\n orderTable.setModel(dtm);\n setVisible(true);\n }", "public void changeSortOrder();", "public void displayTable() {\n System.out.print(\"\\nSpreadsheet Table Details :\\nRows : \" + rowHeaders + \"\\nColumns:\" + colHeaders);\n new SheetParser(tableData).displaySheet();\n }", "private void appendPrimaryTableName() {\n super.appendTableName(Constants.FROM, joinQueryInputs.primaryTableName);\n }", "public void addEntry(int source, NetworkDistancePair netDist, int nextHop)\n\t{\n\t\ttable.add(new RouteTableEntry(source, netDist, nextHop));\n\t\t\n\t\tparentActivity.runOnUiThread(new Runnable()\n\t\t{ \n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\tuiManager.resetRoutingListAdapter();\n\t\t\t} // end public method run\n\t\t}); // end runOnUiThread\n\t}", "private void setUpTable() {\n setSizeFull();\n // expand the table\n table.setSizeFull();\n\n // Allow selecting items from the table.\n table.setSelectionMode(SelectionMode.SINGLE);\n\n // set custom style\n table.addStyleName(\"example-queries-table\");\n\n // configure columns\n Column<Entry, ?> corpusBrowserColumn = table.addComponentColumn(e -> {\n return getOpenCorpusPanel(e.corpus);\n });\n corpusBrowserColumn.setId(COLUMN_OPEN_CORPUS_BROWSER);\n corpusBrowserColumn.setCaption(\"open corpus browser\");\n\n Column<Entry, ?> exampleQueryColumn = table.addComponentColumn(e -> {\n Button btn = new Button();\n btn.setDescription(\"show corpus browser for \" + e.corpus);\n btn.addStyleName(ValoTheme.BUTTON_LINK);\n btn.setIcon(SEARCH_ICON);\n btn.setCaption(e.example.getQuery());\n btn.setDescription(\"show results for \\\"\" + e.example.getQuery() + \"\\\" in \" + e.corpus);\n btn.addStyleName(Helper.CORPUS_FONT_FORCE);\n\n btn.addClickListener(event -> {\n if (ui != null) {\n ControlPanel controlPanel = ui.getSearchView().getControlPanel();\n QueryPanel queryPanel;\n\n if (controlPanel == null) {\n log.error(\"controlPanel is not initialized\");\n return;\n }\n\n queryPanel = controlPanel.getQueryPanel();\n if (queryPanel == null) {\n log.error(\"queryPanel is not initialized\");\n return;\n }\n\n Set<String> corpusNameSet = new HashSet<>();\n corpusNameSet.add(e.corpus);\n if (ui.getQueryController() != null) {\n QueryLanguage ql = QueryLanguage.AQL;\n if (e.example\n .getQueryLanguage() == org.corpus_tools.annis.api.model.QueryLanguage.AQLQUIRKSV3) {\n ql = QueryLanguage.AQL_QUIRKS_V3;\n }\n ui.getQueryController()\n .setQuery(new Query(e.example.getQuery(), ql, corpusNameSet));\n // execute query\n ui.getQueryController().executeSearch(true, true);\n }\n }\n });\n return btn;\n });\n exampleQueryColumn.setId(COLUMN_EXAMPLE_QUERY);\n exampleQueryColumn.setCaption(\"Example Query\");\n\n Column<Entry, ?> descriptionColumn = table.addComponentColumn(e -> {\n Label l = new Label(e.example.getDescription());\n l.setContentMode(ContentMode.TEXT);\n l.addStyleName(Helper.CORPUS_FONT_FORCE);\n return l;\n });\n descriptionColumn.setCaption(\"Description\");\n descriptionColumn.setId(COLUMN_DESCRIPTION);\n\n table.setColumns(COLUMN_EXAMPLE_QUERY, COLUMN_DESCRIPTION, COLUMN_OPEN_CORPUS_BROWSER);\n\n exampleQueryColumn.setExpandRatio(1);\n descriptionColumn.setExpandRatio(1);\n\n }", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\n\t\tLinkLikeButton source = (LinkLikeButton) e.getSource();\r\n\t\tif(e.getClickCount()==1){\r\n\t\tif (source.getName().equals(\"TableLinkLikeButton\")) {\r\n\t\t\tif (source.getText().equals(\"Tags\") || source.getText().equals(\"Ingress\") || source.getText().equals(\"Egress\") || source.getText().equals(\"Rules\") || source.getText().equals(\"All Actions\") || source.getText().equals(\"All Conditions\")\r\n\t\t\t\t\t|| source.getText().equals(\"Redirect\") || source.getText().startsWith(\"ELBs\") || source.getText().contains(\"targetgroup\") || source.getText().contains(\"Method Settings\")) {\r\n\t\t\t\t// Do nothing\r\n\t\t\t} else {\r\n\t\t\t\tsource.getCustomAWSObject().showDetailesFrame(getAccount(), source.getCustomAWSObject(), jScrollableDesktopPan);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsource.getCustomAWSObject().showDetailesFrame(getAccount(), source.getCustomAWSObject(), jScrollableDesktopPan);\r\n\t\t}\r\n\t\t}\r\n\t}", "public void populateTable(){\n displayTable.addMouseListener(new MouseAdapter(){\n //listen for when a row is doubleclicked \n @Override\n public void mouseClicked(MouseEvent e) {\n if (e.getClickCount() == 2) { \n openScheduleTable(); \n }\n }\n });\n }", "@UiHandler(\"talksLink\")\r\n\tprotected void onClickTalksLink(ClickEvent event) {\r\n\t\tnavigation.goTo(TalkListPage.class, PageStates.empty());\r\n\t}", "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}", "@SuppressWarnings(\"unchecked\")\n // <editor-fold defaultstate=\"collapsed\" desc=\"Generated Code\">//GEN-BEGIN:initComponents\n private void initComponents() {\n\n jScrollPane1 = new javax.swing.JScrollPane();\n tblAuthorList = new javax.swing.JTable();\n jPanel1 = new javax.swing.JPanel();\n txtAuthorName = new javax.swing.JTextField();\n txtAuthorID = new javax.swing.JTextField();\n lblAuthorName = new javax.swing.JLabel();\n lblID = new javax.swing.JLabel();\n backPage = new javax.swing.JButton();\n jPanel2 = new javax.swing.JPanel();\n btnList = new javax.swing.JButton();\n btnUpdate = new javax.swing.JButton();\n btnDelete = new javax.swing.JButton();\n btnAdd = new javax.swing.JButton();\n\n setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);\n setTitle(new texts().panelAuthor());\n setIconImages(null);\n setLocation(new java.awt.Point(0, 0));\n setResizable(false);\n\n tblAuthorList.setModel(new javax.swing.table.DefaultTableModel(\n new Object [][] {\n\n },\n new String [] {\n \"\", \"\"\n }\n ) {\n boolean[] canEdit = new boolean [] {\n false, false\n };\n\n public boolean isCellEditable(int rowIndex, int columnIndex) {\n return canEdit [columnIndex];\n }\n });\n tblAuthorList.setSelectionForeground(new java.awt.Color(255, 0, 204));\n tblAuthorList.addMouseListener(new java.awt.event.MouseAdapter() {\n public void mouseClicked(java.awt.event.MouseEvent evt) {\n tblAuthorListMouseClicked(evt);\n }\n });\n jScrollPane1.setViewportView(tblAuthorList);\n if (tblAuthorList.getColumnModel().getColumnCount() > 0) {\n tblAuthorList.getColumnModel().getColumn(0).setResizable(false);\n tblAuthorList.getColumnModel().getColumn(0).setHeaderValue(new texts().ID()\n );\n tblAuthorList.getColumnModel().getColumn(1).setResizable(false);\n tblAuthorList.getColumnModel().getColumn(1).setHeaderValue(new texts().authorName());\n }\n\n txtAuthorID.setEnabled(false);\n txtAuthorID.setFocusable(false);\n\n lblAuthorName.setText(new texts().authorName());\n\n lblID.setText(new texts().ID()\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(38, Short.MAX_VALUE)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(lblID)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)\n .addComponent(txtAuthorID, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()\n .addComponent(lblAuthorName)\n .addGap(33, 33, 33)\n .addComponent(txtAuthorName, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap())\n );\n jPanel1Layout.setVerticalGroup(\n jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGap(83, 83, 83)\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)\n .addComponent(lblAuthorName)\n .addGroup(jPanel1Layout.createSequentialGroup()\n .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)\n .addComponent(txtAuthorID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(lblID))\n .addGap(18, 18, 18)\n .addComponent(txtAuthorName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(117, Short.MAX_VALUE))\n );\n\n txtAuthorID.getAccessibleContext().setAccessibleName(\"\");\n\n backPage.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/back.png\"))); // NOI18N\n backPage.setToolTipText(\"\");\n backPage.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n backPageActionPerformed(evt);\n }\n });\n\n btnList.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/liste.png\"))); // NOI18N\n btnList.setText(new texts().btnList());\n btnList.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnListActionPerformed(evt);\n }\n });\n\n btnUpdate.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/book-update.png\"))); // NOI18N\n btnUpdate.setText(new texts().btnUpdate());\n btnUpdate.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnUpdateActionPerformed(evt);\n }\n });\n\n btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/book-delete.png\"))); // NOI18N\n btnDelete.setText(new texts().btnDelete());\n btnDelete.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnDeleteActionPerformed(evt);\n }\n });\n\n btnAdd.setIcon(new javax.swing.ImageIcon(getClass().getResource(\"/Images/book-add.png\"))); // NOI18N\n btnAdd.setText(new texts().btnAdd());\n btnAdd.addActionListener(new java.awt.event.ActionListener() {\n public void actionPerformed(java.awt.event.ActionEvent evt) {\n btnAddActionPerformed(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(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()\n .addContainerGap(36, Short.MAX_VALUE)\n .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(btnAdd)\n .addComponent(btnDelete)\n .addComponent(btnUpdate)\n .addComponent(btnList))\n .addGap(27, 27, 27))\n );\n jPanel2Layout.setVerticalGroup(\n jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(jPanel2Layout.createSequentialGroup()\n .addGap(28, 28, 28)\n .addComponent(btnList)\n .addGap(18, 18, 18)\n .addComponent(btnUpdate)\n .addGap(18, 18, 18)\n .addComponent(btnDelete)\n .addGap(18, 18, 18)\n .addComponent(btnAdd)\n .addContainerGap(38, 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 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(407, 407, 407)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 600, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGroup(layout.createSequentialGroup()\n .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(48, 48, 48)\n .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))\n .addGroup(layout.createSequentialGroup()\n .addGap(25, 25, 25)\n .addComponent(backPage, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)))\n .addContainerGap(193, 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(backPage)\n .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap(101, Short.MAX_VALUE)\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))\n .addGap(18, 18, 18)\n .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)\n .addGap(53, 53, 53))\n );\n\n pack();\n setLocationRelativeTo(null);\n }", "public void setMainTableComponent(EMCMergeJTable mainJTable) {\n super.setMainTableComponent(mainJTable);\n }", "public JfAeroports() {\n initComponents();\n tableUpdate();\n }", "public void buildExistingRoutesTable() {\n\t\tTableLayout waypointList = (TableLayout) addRoute.findViewById(R.id.routeList);\n\t\tfor (int i = 0; i < addRoute.maxRouteIndex; i++) {\n\t\t\tTableRow newRow = new TableRow(addRoute);\n\t\t\twaypointList.addView(newRow);\n\t\t\tTextView newTextView = new TextView(addRoute);\n\t\t\tnewRow.addView(newTextView);\n\t\t\tnewTextView.setText(\"Route \" + i);\n\t\t\tnewRow.setClickable(true);\n\t\t\tnewRow.setTag(i);\n\t\t\tif (addRoute.selectedRoute == i) {\n\t\t\t\tnewRow.setBackgroundColor(Color.BLUE);\n\t\t\t}\n\t\t\tnewRow.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t @Override\n\t\t\t public void onClick(View v) {\n\t\t\t TableRow tableRow = (TableRow) v;\n\t\t\t tableRow.setBackgroundColor(Color.BLUE);\n\t\t\t TableLayout waypointList = (TableLayout) addRoute.findViewById(R.id.routeList);\n\t\t\t if (addRoute.selectedRoute != -1)\n\t\t\t \t waypointList.getChildAt(addRoute.selectedRoute).setBackgroundColor(Color.TRANSPARENT);\n\t\t\t addRoute.selectedRoute = (Integer) tableRow.getTag();\n\t\t\t }\n\t\t\t});\n\t\t}\n\t}", "public SlammerTable(boolean selectTable, boolean isSlammer) throws Exception\n \t{\n \t\tsortList = getSortList();\n \t\tprimarySort = new JComboBox(sortList);\n \t\tsecondarySort = new JComboBox(sortList);\n \t\tsecondarySort.setSelectedIndex(1); // station\n \n \t\tthis.selectTable = selectTable;\n \t\tselectStr = \"select\" + (selectTable ? 2 : 1);\n \n \t\tprimarySort.setActionCommand(\"sort\");\n \t\tprimarySort.addActionListener(this);\n \t\tsecondarySort.setActionCommand(\"sort\");\n \t\tsecondarySort.addActionListener(this);\n \n \t\torder.addItem(\"A/A\");\n \t\torder.addItem(\"A/D\");\n \t\torder.addItem(\"D/A\");\n \t\torder.addItem(\"D/D\");\n \t\torder.setActionCommand(\"sort\");\n \t\torder.addActionListener(this);\n \n \t\tmodel = new SlammerTableModel(selectTable, isSlammer, primarySort, secondarySort, order);\n \t\ttable = new JTable(model);\n \n \t\trecordButton.setActionCommand(\"record\");\n \t\trecordButton.addActionListener(this);\n \t\tstationButton.setActionCommand(\"station\");\n \t\tstationButton.addActionListener(this);\n \t\tdisplayGroup.add(recordButton);\n \t\tdisplayGroup.add(stationButton);\n \n \t\tsetLayout(new BorderLayout());\n \t\tadd(BorderLayout.CENTER, new JScrollPane(table));\n \n \t\tJPanel north = new JPanel(new BorderLayout());\n \n \t\tArrayList west = new ArrayList();\n \t\twest.add(new JLabel(\"Sort by \"));\n \t\twest.add(primarySort);\n \t\twest.add(new JLabel(\" then \"));\n \t\twest.add(secondarySort);\n \t\twest.add(order);\n \t\tnorth.add(BorderLayout.WEST, GUIUtils.makeRecursiveLayoutRight(west));\n \n \t\tArrayList east = new ArrayList();\n \t\teast.add(new JLabel(\"Display properties of: \"));\n \t\teast.add(recordButton);\n \t\teast.add(stationButton);\n \t\tnorth.add(BorderLayout.EAST, GUIUtils.makeRecursiveLayoutRight(east));\n \n \t\tadd(BorderLayout.NORTH, north);\n \t}", "protected String newLinkName(){\n\t\treturn \"WomoEvtLnk_\" + linkNr++;\n\t}", "private void updateTable()\n\t{\n\t\ttable = new StringBuilder(String.format(\"%-7s %-30s %-30s %-5s\\n\", \"Song#\", \"Title\", \"Artist\", \"Time\"));\n\t\tdouble time = 0.0;\n\t\tfor(int i = 0; i < numOfSongs; i++)\n\t\t{\n\t\t\ttime = (double)song[i].getMinLength() + (song[i].getSecLength()/100.0); \n\t\t\ttable.append(String.format(\"%-7d %-30s %-30s %-5s\", (i+1), song[i].getTitle(), song[i].getArtist(), time));\n\t\t\tif(i < (numOfSongs-1))\n\t\t\t\ttable.append(\"\\n\");\n\t\t}\n\t}", "public SMplace_order() {\n initComponents();\n table();\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n // TODO\n \n ACSIController acsi = new ACSIController();\n currentUser = acsi.getUtilisateur();\n welcomeMessage.setText(\"Bonjour \"+currentUser.ucfirst(currentUser.getUtPrenom()) + \" (\"+ currentUser.getUtCp()+\")\");\n if(currentUser.getUtIsadmin() == 1){\n newArticleLink.setVisible(true);\n }\n \n listArticle = articleDAO.listArticle();\n articleNameColumn.setCellValueFactory(new PropertyValueFactory<Article, String>(\"arLabel\"));\n articleRefColumn.setCellValueFactory(new PropertyValueFactory<Article, String>(\"arRef\"));\n articlePriceColumn.setCellValueFactory(new PropertyValueFactory<Article, String>(\"arPrixWithEuro\"));\n articleImageColumn.setCellValueFactory(new PropertyValueFactory<Article, Image>(\"arImageView\"));\n \n\n articleTable.getItems().setAll(listArticle);\n \n articleTable.setRowFactory( tv -> {\n TableRow<Article> row = new TableRow<>();\n row.setOnMouseClicked(event -> {\n if (event.getClickCount() == 2 && (! row.isEmpty()) ) {\n Article article = row.getItem();\n try {\n showArticleView(event, article);\n } catch (IOException ex) {\n Logger.getLogger(MainViewController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n });\n return row ;\n });\n }", "public void performHEAD(String command)\n {\n int currow;\n\n ASPManager mgr = getASPManager();\n ASPTransactionBuffer trans = mgr.newASPTransactionBuffer();\n\n currow = headset.getCurrentRowNo();\n if (headlay.isMultirowLayout())\n headset.storeSelections();\n else\n headset.selectRow();\n headset.markSelectedRows(command);\n mgr.submit(trans);\n headset.goTo(currow);\n }", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n // TODO\n getBeneficTable();\n addBenefBtn.setTooltip(new Tooltip(\"Ajouter des nouveaux locataires\"));\n beneficiaryBtn.setTooltip(new Tooltip(\"La liste des locataires\"));\n\n }", "public final void setTableHeader() {\n this.addColumn(java.util.ResourceBundle.\n getBundle(\"swt/client/module/game/resources/GameLogTableModel\").\n getString(\"column.date\"));\n this.addColumn(java.util.ResourceBundle.\n getBundle(\"swt/client/module/game/resources/GameLogTableModel\").\n getString(\"column.percent.solved\"));\n this.addColumn(java.util.ResourceBundle.\n getBundle(\"swt/client/module/game/resources/GameLogTableModel\").\n getString(\"column.log.type\"));\n }", "public void sortTable() {\n\t\tlist = new TableSorter<Attribute>().sortByAttrNameTranslation(getList());\n\t\tdataProvider.flush();\n\t\tdataProvider.refresh();\n\t}", "public static void main_printList(){\n\n table.printApplicantTable();\n\n }", "public void partBroughtToTop(IWorkbenchPartReference partRef) {\n\t\t\t\t\n\t\t\t}", "private void selectTableRow () {\n int selectedRow = itemTable.getSelectedRow();\n if (selectedRow >= 0 && selectedRow < clubEventList.size()) {\n boolean modOK = modIfChanged();\n if (modOK) {\n position = clubEventList.positionUsingListIndex (selectedRow);\n positionAndDisplay();\n }\n }\n }", "protected JTableHeader createDefaultTableHeader() {\n return new JTableHeader(columnModel) {\n public String getToolTipText(MouseEvent e) {\n java.awt.Point p = e.getPoint();\n int index = columnModel.getColumnIndexAtX(p.x);\n int realIndex = columnModel.getColumn(index).getModelIndex();\n return columnToolTips[realIndex];\n }\n };\n }", "public void addTableGui() {\n\t\tDefaultTableModel mTableModel = new DefaultTableModel();\r\n\t\tmTable = new JTable(mTableModel);\r\n\r\n\t\tmTableModel.addColumn(\"MSSV\");\r\n\t\tmTableModel.addColumn(\"HoTen\");\r\n\t\tmTableModel.addColumn(\"GioiTinh\");\r\n\t\tmTableModel.addColumn(\"NTNS\");\r\n\t\tJScrollPane mJScrollPane = new JScrollPane(mTable);\r\n\t\tmJScrollPane.setPreferredSize(new Dimension(760, 310));\r\n\t\tc.fill = GridBagConstraints.HORIZONTAL;\r\n\t\tc.ipady = 40; //make this component tall\r\n\t\tc.weightx = 0.0;\r\n\t\tc.gridwidth = 3;\r\n\t\tc.gridx = 0;\r\n\t\tc.gridy = 1;\r\n\t\tpanel.add(mJScrollPane,c);\r\n\t}", "public void sortieBloc() {\n this.tableLocaleCourante = this.tableLocaleCourante.getTableLocalPere();\n }", "private void refreashTableView() {\n this.scoreboard.refresh();\n sortScoreboard();\n }", "private ConfigurationHTMLPrinter startTable() {\n return println(\"<table border='0' cellspacing='0' cellpadding='0'>\").incrementIndent();\n }" ]
[ "0.5893926", "0.5788779", "0.57618004", "0.5531233", "0.5521322", "0.5517903", "0.5473902", "0.54079723", "0.53209263", "0.5236328", "0.5218629", "0.5186779", "0.5161805", "0.5156922", "0.5155521", "0.51483", "0.5147478", "0.51453733", "0.5126317", "0.51212054", "0.5068813", "0.50542766", "0.5053835", "0.50400555", "0.5019727", "0.50093347", "0.5008329", "0.50030684", "0.49936885", "0.49733225", "0.49693212", "0.4963915", "0.49541992", "0.49459726", "0.49433166", "0.49319237", "0.49312785", "0.4897341", "0.48896766", "0.4888512", "0.48845997", "0.4874865", "0.48612228", "0.4857174", "0.4855813", "0.48397222", "0.4838754", "0.48316061", "0.482935", "0.4827642", "0.48253393", "0.48196396", "0.48057604", "0.4805255", "0.48034063", "0.478735", "0.47848397", "0.4778449", "0.47780135", "0.47683832", "0.4763668", "0.475594", "0.4754997", "0.47484967", "0.4745565", "0.4744351", "0.47396287", "0.47333068", "0.47330174", "0.47327456", "0.47296527", "0.472717", "0.47237122", "0.47190762", "0.47182173", "0.47177464", "0.4711835", "0.47098634", "0.47084934", "0.47008967", "0.4700523", "0.46953812", "0.469357", "0.46918377", "0.4689162", "0.46871504", "0.46849412", "0.46845534", "0.46743327", "0.46738082", "0.46721587", "0.4667516", "0.46656692", "0.46634668", "0.46622422", "0.4662124", "0.46596706", "0.46538827", "0.46432197", "0.4635467" ]
0.6255201
0
Adds the div required by jQuery tabs
private void createTabsDiv() { tabsDiv = new Block(Block.Div, "id='tabs'"); page.add(tabsDiv); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void initTabs() {\n\t\tJPanel newTab = new JPanel();\r\n\t\taddTab(\"\", newTab); //$NON-NLS-1$\r\n\t\tsetTabComponentAt(0, new NewPaneButton());\r\n\t\tsetEnabledAt(0, false);\r\n\t\t// Add a new pane\r\n\t\taddPane();\r\n }", "private void addTabs() {\n TabsPagerAdapter tabsAdapter = new TabsPagerAdapter(getSupportFragmentManager());\n viewPager = (ViewPager) findViewById(R.id.pager);\n viewPager.setAdapter(tabsAdapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);\n tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\n tabLayout.setupWithViewPager(viewPager);\n\n tabLayout.getTabAt(0).setIcon(R.drawable.connect);\n tabLayout.getTabAt(1).setIcon(R.drawable.speak);\n tabLayout.getTabAt(2).setIcon(R.drawable.walk);\n tabLayout.getTabAt(3).setIcon(R.drawable.camera);\n tabLayout.getTabAt(4).setIcon(R.drawable.moves);\n }", "private void setupTabs() {\n }", "public void addNewTab() {\n int count = workspaceTabs.getComponentCount() + 1;\n String title = \"Workspace \" + count;\n WorkspacePanel panel = new WorkspacePanel(title);\n DropHandler dropHandler = searchMenu.createDropHandler(panel.getBaseLayout());\n panel.setDropHandler(dropHandler);\n workspaceTabs.addTab(panel).setCaption(title);\n }", "public void add(TabLike tab){\n TabLabel btn = tabLabelCreator.create(tab.getName(), this);\n\n tab.setVisible(tabs.isEmpty());\n btn.setDisable(tabs.isEmpty());\n if (tabs.isEmpty()){\n selected = btn;\n }\n\n tabs.add(tab);\n nameTab.getChildren().add(btn);\n tabContent.getChildren().add(tab);\n tab.setContainer(this);\n }", "@Override\n\tpublic void addTab(Tab tab) {\n\t\t\n\t}", "protected void addTab(Tab tab) {\n mUi.addTab(tab);\n }", "@Override public void addTab(String title, Component content) {\n super.addTab(title, new JLabel(\"Loading...\"));\n JProgressBar bar = new JProgressBar();\n int currentIndex = getTabCount() - 1;\n JLabel label = new JLabel(title);\n Dimension dim = label.getPreferredSize();\n int w = Math.max(80, dim.width);\n label.setPreferredSize(new Dimension(w, dim.height));\n Insets tabInsets = UIManager.getInsets(\"TabbedPane.tabInsets\");\n bar.setPreferredSize(new Dimension(w, dim.height - tabInsets.top - 1));\n // bar.setString(title);\n // bar.setUI(new BasicProgressBarUI());\n setTabComponentAt(currentIndex, bar);\n SwingWorker<String, Integer> worker = new BackgroundTask() {\n @Override protected void process(List<Integer> chunks) {\n if (!isDisplayable()) {\n // System.out.println(\"process: DISPOSE_ON_CLOSE\");\n cancel(true);\n }\n }\n\n @Override protected void done() {\n if (!isDisplayable()) {\n // System.out.println(\"done: DISPOSE_ON_CLOSE\");\n cancel(true);\n return;\n }\n setTabComponentAt(currentIndex, label);\n setComponentAt(currentIndex, content);\n String txt;\n try {\n txt = get();\n } catch (InterruptedException ex) {\n txt = \"Interrupted\";\n Thread.currentThread().interrupt();\n } catch (ExecutionException ex) {\n txt = \"Exception\";\n }\n label.setToolTipText(txt);\n }\n };\n worker.addPropertyChangeListener(new ProgressListener(bar));\n // executor.execute(worker);\n worker.execute();\n }", "@Override\n\tpublic void addTab(Tab tab, int position, boolean setSelected) {\n\t\t\n\t}", "private void addControl() {\n // Gan adapter va danh sach tab\n PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager());\n // Them noi dung cac tab\n adapter.AddFragment(new TourMapTab());\n adapter.AddFragment(new TourInfoTab());\n adapter.AddFragment(new TourMapImageTab());\n // Set adapter danh sach tab\n ViewPager viewPager = ActivityManager.getInstance().activityTourTabsBinding.viewpager;\n TabLayout tabLayout = ActivityManager.getInstance().activityTourTabsBinding.tablayout;\n viewPager.setAdapter(adapter);\n tabLayout.setupWithViewPager(viewPager);\n // Them vach ngan cach cac tab\n View root = tabLayout.getChildAt(0);\n if (root instanceof LinearLayout) {\n ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);\n GradientDrawable drawable = new GradientDrawable();\n drawable.setColor(getResources().getColor(R.color.colorPrimaryDark));\n drawable.setSize(2, 1);\n ((LinearLayout) root).setDividerPadding(10);\n ((LinearLayout) root).setDividerDrawable(drawable);\n }\n // Icon cac tab\n tabLayout.getTabAt(0).setIcon(R.drawable.tour_map_icon_select);\n tabLayout.getTabAt(1).setIcon(R.mipmap.tour_info_icon);\n tabLayout.getTabAt(2).setIcon(R.mipmap.tour_map_image_icon);\n\n // Doi mau tab icon khi click\n tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager) {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n super.onTabSelected(tab);\n switch (tab.getPosition()){\n case 0:\n tab.setIcon(R.drawable.tour_map_icon_select);\n break;\n case 1:\n tab.setIcon(R.drawable.tour_info_icon_select);\n break;\n case 2:\n tab.setIcon(R.mipmap.tour_map_image_icon_select);\n break;\n default:\n break;\n }\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n super.onTabUnselected(tab);\n switch (tab.getPosition()){\n case 0:\n tab.setIcon(R.mipmap.tour_map_icon);\n break;\n case 1:\n tab.setIcon(R.mipmap.tour_info_icon);\n break;\n case 2:\n tab.setIcon(R.mipmap.tour_map_image_icon);\n break;\n default:\n break;\n }\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n super.onTabReselected(tab);\n }\n }\n );\n }", "@Override\n\tpublic void addTab(Tab tab, int position) {\n\t\t\n\t}", "private void addTab(String label, int drawableId, Intent i) {\n \tTabHost.TabSpec spec = tabHost.newTabSpec(label);\r\n \tView tabIndicator = LayoutInflater.from(this).inflate(R.layout.tabs, getTabWidget(), false);\r\n \tTextView title = (TextView) tabIndicator.findViewById(R.id.title);\r\n \ttitle.setText(label);\r\n// \tImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);\r\n// \ticon.setImageResource(drawableId);\r\n \tspec.setIndicator(tabIndicator).setContent(i);\r\n \ttabHost.addTab(spec);\r\n }", "public void addedToDom() {\n activateTab();\n }", "@Override\n\tpublic void addTab(Tab tab, boolean setSelected) {\n\t\t\n\t}", "public Tabs() {\n initComponents();\n }", "private void createView() {\n\t\tTabWidget tWidget = (TabWidget) findViewById(android.R.id.tabs);\r\n\t\tshowLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView = (ImageView) showLayout.getChildAt(0);\r\n\t\tTextView textView = (TextView) showLayout.getChildAt(1);\r\n\t\timageView.setImageResource(R.drawable.main_selector);\r\n\t\ttextView.setText(R.string.show);\r\n\r\n\t\taddLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView1 = (ImageView) addLayout.getChildAt(0);\r\n\t\tTextView textView1 = (TextView) addLayout.getChildAt(1);\r\n\t\timageView1.setImageResource(R.drawable.add_selector);\r\n\t\ttextView1.setText(R.string.add_record);\r\n\r\n\t\tchartLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView2 = (ImageView) chartLayout.getChildAt(0);\r\n\t\tTextView textView2 = (TextView) chartLayout.getChildAt(1);\r\n\t\timageView2.setImageResource(R.drawable.chart_selector);\r\n\t\ttextView2.setText(R.string.chart_show);\r\n\t}", "private void setTab() {\n\t\tTabHost.TabSpec showSpec = host.newTabSpec(ShowFragment.TAG);\r\n\t\tshowSpec.setIndicator(showLayout);\r\n\t\tshowSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(showSpec);\r\n\r\n\t\tTabHost.TabSpec addSpec = host.newTabSpec(AddRecordFrag.TAG);\r\n\t\taddSpec.setIndicator(addLayout);\r\n\t\taddSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(addSpec);\r\n\r\n\t\tTabHost.TabSpec chartSpec = host.newTabSpec(ChartShowFrag.TAG);\r\n\t\tchartSpec.setIndicator(chartLayout);\r\n\t\tchartSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(chartSpec);\r\n\t}", "private void createTabList() throws UnsupportedEncodingException {\n\n org.mortbay.html.List tabList =\n new org.mortbay.html.List(org.mortbay.html.List.Unordered);\n tabsDiv.add(tabList);\n Integer tabCount = 1;\n for (Map.Entry letterPairs : startLetterList.entrySet()) {\n Character startLetter = (Character) letterPairs.getKey();\n Character endLetter = (Character) letterPairs.getValue();\n Link tabLink = new Link(\"DisplayContentTab?start=\" + startLetter + \"&amp;end=\" + endLetter + \"&amp;group=\"\n + grouping + \"&amp;type=\" + type + \"&amp;filter=\" + filterKey +\n \"&amp;timeKey=\" + timeKey, startLetter + \" - \" + endLetter);\n Composite tabListItem = tabList.newItem();\n tabListItem.add(tabLink);\n Block loadingDiv = new Block(Block.Div, \"id='ui-tabs-\" + tabCount++ + \"'\");\n Image loadingImage = new Image(LOADING_SPINNER);\n loadingImage.alt(\"Loading...\");\n loadingDiv.add(loadingImage);\n loadingDiv.add(\" Loading...\");\n tabsDiv.add(loadingDiv);\n }\n }", "public void addTab (String tabname, boolean closeable, Widget widget, final String key) {\n\n\n\t\tPanel localTP = new Panel();\n\t\tlocalTP.setClosable(closeable);\n\t\tlocalTP.setTitle(tabname);\n\t\tlocalTP.setId(key + id);\n\t\tlocalTP.setAutoScroll(true);\n\t\tlocalTP.add(widget);\n\n\t\ttp.add(localTP, this.centerLayoutData);\n\n\t\tlocalTP.addListener(new PanelListenerAdapter() {\n\n\t\t\tpublic void onDestroy(Component component) {\n\t\t\t\topenedTabs.remove(key);\n\t\t\t}\n\t\t});\n\n\n\t\ttp.activate(localTP.getId());\n\n\n\n\n\t\topenedTabs.put(key, localTP);\n\t}", "private void initTabs() {\n\t\tmContainer.removeAllViews();\n\n\t\tif(mAdapter==null||mViewPager==null){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<mViewPager.getAdapter().getCount();i++){\n\t\t\tfinal int index=i;\n\t\t\tButton tabs= (Button) mAdapter.getView(index);\n\t\t\tLayoutParams layoutParams=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n\t\t\tlayoutParams.weight=1;\n\t\t\tmContainer.addView(tabs,layoutParams);\n\t\t\t\n\t\t\ttabs.setOnClickListener(new OnClickListener(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tif(mViewPager.getCurrentItem()==index){\n\t\t\t\t\t\tselectTab(index);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmViewPager.setCurrentItem(index, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\tselectTab(0);\n\t}", "private void initTab()\n {\n \n }", "private void insertarTabs(ViewGroup container) {\n View padre = (View) container.getParent();\n pestanas = (TabLayout)padre.findViewById(R.id.tabs);\n }", "private void addNewTab(SingleDocumentModel model) {\n\t\tString title = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().getFileName().toString();\n\t\tImageIcon icon = createIcon(\"icons/green.png\");\n\t\tJScrollPane component = new JScrollPane(model.getTextComponent());\n\t\tString toolTip = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().toAbsolutePath().toString();\n\t\taddTab(title, icon, component, toolTip);\n\t\tsetSelectedComponent(component);\n\t}", "private void layoutTabs() {\n\tJTabbedPane tabs = new JTabbedPane();\n\ttabs.add(\"MAIN MENU\", mainMenu);\n\ttabs.add(\"LEVEL EDITOR\", levelEditor);\n\tthis.getContentPane().add(tabs);\n }", "public void addTab(String filename) {\n\t\t\n\t\tMinLFile nminl = new MinLFile(filename);\n\t\tJComponent panel = nminl;\n\t\t\n\t\ttabbedPane.addTab(filename, null, panel,\n\t\t\t\tfilename);\t\t\n\t\ttabbedPane.setMnemonicAt(0, 0);\n\t}", "private void addScheduleTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_VISIBLE_TRACKS);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_SCHEDULE);\n spec.setIndicator(mResources.getString(R.string.schedule), mResources\n .getDrawable(R.drawable.ic_tab_schedule));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "private void setupTabLayout() {\n tabLayout = (TabLayout) findViewById(R.id.tabs);\n tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n onTabTapped(tab.getPosition());\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n onTabTapped(tab.getPosition());\n }\n });\n tabLayout.getTabAt(0).select();\n View root = tabLayout.getChildAt(0);\n //create divider between the tabs\n if (root instanceof LinearLayout) {\n ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);\n GradientDrawable drawable = new GradientDrawable();\n drawable.setColorFilter(0xffff0000, PorterDuff.Mode.MULTIPLY);\n drawable.setSize(2, 1);\n ((LinearLayout) root).setDividerPadding(10);\n ((LinearLayout) root).setDividerDrawable(drawable);\n }\n }", "protected void showTabs() {\r\n\t\tif (getPageCount() > 1) {\r\n\t\t\tsetPageText(0, getString(\"_UI_SelectionPage_label\"));\r\n\t\t\tif (getContainer() instanceof CTabFolder) {\r\n\t\t\t\t((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT);\r\n\t\t\t\tPoint point = getContainer().getSize();\r\n\t\t\t\tgetContainer().setSize(point.x, point.y - 6);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void setTabLayout() {\n View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n TextView title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n ImageView imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.MOVIES);\n imgIcon.setImageResource(R.mipmap.ic_home);\n mTabLayout.getTabAt(0).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n count = (TextView) view.findViewById(R.id.item_tablayout_count_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.FAVOURITE);\n imgIcon.setImageResource(R.mipmap.ic_favorite);\n count.setVisibility(View.VISIBLE);\n mTabLayout.getTabAt(1).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.SETTINGS);\n imgIcon.setImageResource(R.mipmap.ic_settings);\n mTabLayout.getTabAt(2).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.ABOUT);\n imgIcon.setImageResource(R.mipmap.ic_info);\n mTabLayout.getTabAt(3).setCustomView(view);\n }", "private void addStarredTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_STARRED);\n spec.setIndicator(mResources.getString(R.string.starred), mResources\n .getDrawable(R.drawable.ic_tab_starred));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "void addTab(Type<RequestTabsHandler> requestTabsEventType,\n Type<RevealContentHandler<?>> revealContentEventType,\n String label, String historyToken, boolean isMainTab,\n String contentUrl, TabOptions options) {\n dynamicUrlContentTabProxyFactory.create(\n requestTabsEventType, revealContentEventType,\n label, historyToken, isMainTab, contentUrl,\n options.getAlignRight() ? Align.RIGHT : Align.LEFT);\n\n // Redraw the corresponding tab container\n RedrawDynamicTabContainerEvent.fire(this, requestTabsEventType);\n }", "protected abstract void doAddTab(GridTab tab, JPiereIADTabpanel tabPanel);", "public void addTab(Tab tab)\n\t{\n\t\ttabs.add(tab);\n\t}", "TabbelPane() {\r\n\t\t\tpanelDB = new JPanelCluster(\"mine\", new EventFromDb());\r\n\t\t\tpanelFile = new JPanelCluster(\"store from file\", new EventFromFile());\r\n\t\t\tImageIcon icon = new ImageIcon(\"database.png\");\r\n\t\t\tImage image = icon.getImage();\r\n\t\t\tImage newimage = image.getScaledInstance(20, 20, java.awt.Image.SCALE_SMOOTH);\r\n\t\t\ticon.setImage(newimage);\r\n\t\t\tschermata.addTab(\"DB\", icon, panelDB);\r\n\t\t\ticon = new ImageIcon(\"file.png\");\r\n\t\t\timage = icon.getImage();\r\n\t\t\tnewimage = image.getScaledInstance(20, 20, java.awt.Image.SCALE_SMOOTH);\r\n\t\t\ticon.setImage(newimage);\r\n\t\t\tschermata.addTab(\"file\", icon, panelFile);\r\n\t\t\tsetVisible(true);\r\n\t\t}", "private void createTabs() {\r\n\t\ttabbedPane = new JTabbedPane();\r\n\t\t\r\n\t\t//changes title and status bar \r\n\t\ttabbedPane.addChangeListener((l) -> { \r\n\t\t\tint index = tabbedPane.getSelectedIndex();\r\n\t\t\tif (index < 0) {\r\n\t\t\t\tcurrentFile = \"-\";\r\n\t\t\t} else {\r\n\t\t\t\tcurrentFile = tabbedPane.getToolTipTextAt(index);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (currentFile.isEmpty()) {\t//file not yet saved\r\n\t\t\t\tcurrentFile = tabbedPane.getTitleAt(tabbedPane.getSelectedIndex());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTitle(currentFile + \" - JNotepad++\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tJTextArea current = getSelectedTextArea();\r\n\t\t\tif (current == null) return;\r\n\t\t\tCaretListener[] listeners = current.getCaretListeners();\r\n\t\t\tlisteners[0].caretUpdate(new CaretEvent(current) {\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Serial UID.\r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getMark() {\r\n\t\t\t\t\treturn 0;\t//not used\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getDot() {\r\n\t\t\t\t\treturn current.getCaretPosition();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t\r\n\t\tcreateSingleTab(null, null);\r\n\t\tgetContentPane().add(tabbedPane, BorderLayout.CENTER);\t\r\n\t}", "@Override\n public void addTab(String title, Component component) {\n this.addTab(title, null, component, null, null);\n }", "public void initializeTabs() {\n\n\t\tTabHost.TabSpec spec;\n\n\t\tspec = mTabHost.newTabSpec(Const.EVENTS);\n\t\tmTabHost.setCurrentTab(0);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_events_selector));\n\t\tmTabHost.addTab(spec);\n\n\t\tmTabHost.setCurrentTab(1);\n\t\tspec = mTabHost.newTabSpec(Const.FEED);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_feed_selector));\n\t\tmTabHost.addTab(spec);\n\n\t\tmTabHost.setCurrentTab(2);\n\t\tspec = mTabHost.newTabSpec(Const.INFO);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_info_selector));\n\t\tmTabHost.addTab(spec);\n\n\t}", "private IcsLinearLayout createTabLayout() {\n\t\tfinal IcsLinearLayout tabLayout = (IcsLinearLayout) LayoutInflater\n\t\t\t\t.from(getContext()).inflate(\n\t\t\t\t\t\tR.layout.abs__action_bar_tab_bar_view, null);\n\t\ttabLayout.setMeasureWithLargestChildEnabled(true);\n\t\ttabLayout.setLayoutParams(new LinearLayout.LayoutParams(\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT,\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.MATCH_PARENT));\n\t\treturn tabLayout;\n\t}", "public CloseableTabbedPane(String name, JPanel component, Supplier<Void> addListener) {\n super();\n this.addListener = addListener;\n super.addTab(name, new JScrollPane(component, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER));\n JPanel empty = new JPanel();\n iconCallback.put(empty, addListener);\n super.addTab(\"\", null, empty, \"Click here to create new script\");\n initializeMouseListener();\n setEnabledAt(1, false);\n setDisabledIconAt(1, new NewTabIcon());\n /*addChangeListener((l)->{\n if (getTabCount() -1 == getSelectedIndex()) {\n addListener.get();\n }\n });*/\n }", "private void addTracksTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n //intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n // SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_TWITTER);\n spec.setIndicator(mResources.getString(R.string.tracks), mResources\n .getDrawable(R.drawable.ic_menu_archive));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "public CategoryNew(JTabbedPane tabs,JPanel parent) {\n this.parent=parent;\n this.tabs=tabs;\n initComponents();\n ErrorLabel.setVisible(false);\n }", "private void showTab() {\n if (parentTab != null) {\n tab = parentTab.getTab(this);\n if (tab != null) {\n // FIXME: this should be added by the constructor or by the panel that adds this\n // tab\n // tab.getComponent().addStyleName(\"example-queries-tab\");\n tab.setEnabled(true);\n\n if (!(parentTab.getSelectedTab() instanceof ResultViewPanel)) {\n parentTab.setSelectedTab(tab);\n }\n }\n }\n\n }", "public KonTabbedPane() {\n // Initialize the ArrayList\n graphInterfaces = new ArrayList<DrawingLibraryInterface>();\n\n DirectedGraph<String, DefaultEdge> graph = CreateTestGraph();\n\n /*\n * Adds a tab\n */\n DrawingLibraryInterface<String, DefaultEdge> graphInterface =\n DrawingLibraryFactory.createNewInterface(graph);\n \n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n addTab(\"First Tab\", graphInterface.getPanel());\n\n /*\n * Adds a tab\n */\n graphInterface = DrawingLibraryFactory.createNewInterface(graph);\n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n\n graphInterface.getGraphManipulationInterface().highlightNode(graph\n .vertexSet().iterator().next(), true);\n\n addTab(\"Second Tab\", graphInterface.getPanel());\n }", "private void setupTab(final View view, final String tag) {\r\n\t\tView tabview = createTabView(mTabHost.getContext(), tag);\r\n\r\n\t\tTabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview)\r\n\t\t\t\t.setContent(new TabContentFactory() {\r\n\t\t\t\t\tpublic View createTabContent(String tag) {\r\n\t\t\t\t\t\tView view;\r\n\t\t\t\t\t\tif (tag.contains(\"EXTENDED\")) {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_2_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t\t// --Assembling Widgets\r\n\t\t\t\t\t\t\tedNO = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET1);\r\n\t\t\t\t\t\t\tedNIO = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET2);\r\n\t\t\t\t\t\t\tedNP = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET3);\r\n\t\t\t\t\t\t\tedNIP = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET4);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tedNO.setEnabled(false);\r\n\t\t\t\t\t\t\tedNIO.setEnabled(false);\r\n\t\t\t\t\t\t\tedNP.setEnabled(false);\r\n\t\t\t\t\t\t\tedNIP.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tNO= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB1);\r\n\t\t\t\t\t\t\tNIO= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB2);\r\n\t\t\t\t\t\t\tNP= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB3);\r\n\t\t\t\t\t\t\tNIP= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB4);\r\n\t\t\t\t\t\t\tNO.setEnabled(false); \r\n\t\t\t\t\t\t\tNIO.setEnabled(false);\r\n\t\t\t\t\t\t\tNP.setEnabled(false);\r\n\t\t\t\t\t\t\tNIP.setEnabled(false);\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\textended = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB0);\r\n\t\t\t\t\t\t\textended.setOnClickListener(S3R4Listener2);\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} else if (tag.contains(\"CUSTOM\")) {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_3_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_1_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t\t// --Assembling Widgets\r\n\t\t\t\t\t\t\tedlevels = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET1);\r\n\t\t\t\t\t\t\tedSons = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET2);\r\n\t\t\t\t\t\t\tedlevel = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET3);\r\n\t\t\t\t\t\t\tedpruduct = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET4);\r\n\t\t\t\t\t\t\tedcampaign = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET5);\r\n\t\t\t\t\t\t\tedadd = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET6);\r\n\t\t\t\t\t\t\tedlevels.setEnabled(false);\r\n\t\t\t\t\t\t\tedSons.setEnabled(false);\r\n\t\t\t\t\t\t\tedlevel.setEnabled(false);\r\n\t\t\t\t\t\t\tedpruduct.setEnabled(false);\r\n\t\t\t\t\t\t\tedcampaign.setEnabled(false);\r\n\t\t\t\t\t\t\tedadd.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tlevel= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB3);\r\n\t\t\t\t\t\t\tpruduct= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB4);\r\n\t\t\t\t\t\t\tcampaign= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB5);\r\n\t\t\t\t\t\t\tadd= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB6);\r\n\t\t\t\t\t\t\tlevel.setEnabled(false); \r\n\t\t\t\t\t\t\tpruduct.setEnabled(false);\r\n\t\t\t\t\t\t\tcampaign.setEnabled(false);\r\n\t\t\t\t\t\t\tadd.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tStructure = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB1);\r\n\t\t\t\t\t\t\tRules = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB2);\r\n\t\t\t\t\t\t\tStructure.setOnClickListener(S3R4Listener);\r\n\t\t\t\t\t\t\tRules.setOnClickListener(S3R4Listener);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn view;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\tmTabHost.addTab(setContent);\r\n\r\n\t}", "private void setupTab() {\n setLayout(new BorderLayout());\n JSplitPane mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);\n mainSplit.setDividerLocation(160);\n mainSplit.setBorder(BorderFactory.createEmptyBorder());\n\n // set up the MBean tree panel (left pane)\n tree = new XTree(this);\n tree.setCellRenderer(new XTreeRenderer());\n tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n tree.addTreeSelectionListener(this);\n tree.addTreeWillExpandListener(this);\n tree.addMouseListener(ml);\n JScrollPane theScrollPane = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,\n JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n JPanel treePanel = new JPanel(new BorderLayout());\n treePanel.add(theScrollPane, BorderLayout.CENTER);\n mainSplit.add(treePanel, JSplitPane.LEFT, 0);\n\n // set up the MBean sheet panel (right pane)\n viewer = new XDataViewer(this);\n sheet = new XSheet(this);\n mainSplit.add(sheet, JSplitPane.RIGHT, 0);\n\n add(mainSplit);\n }", "public void onCreateTabClicked(View view) {\n if (mAdapter.isEmpty()) {\n Toast.makeText(this, R.string.you_must_create_at_least_one_tab, Toast.LENGTH_LONG).show();\n return;\n }\n ArrayList<TabInformation> list = new ArrayList<>(mAdapter.getTabInformation());\n startActivity(new Intent(this, DisplayTabsActivity.class).putExtra(TAB_CONTENT, list));\n }", "private void createTabs(){\n canvasPanel = new JPanel();\n canvasPanel.setLayout(new BorderLayout());\n canvasPanel.add(mCanvas, BorderLayout.CENTER);\n canvasPanel.setMinimumSize(new Dimension(100,50));\n \n // Create the options and properties panel\n optionPanel = new JPanel();\n optionPanel.setLayout(new FlowLayout());\n\n // Set the size\n optionPanel.setMinimumSize(new Dimension(30,30));\t\n optionPanel.setPreferredSize(new Dimension(200,10));\n\n // Create the log area\n mLogArea = new JTextArea(5,20);\n mLogArea.setMargin(new Insets(5,5,5,5));\n mLogArea.setEditable(false);\n JScrollPane logScrollPane = new JScrollPane(mLogArea);\n \n // Das SplitPanel wird in optionPanel (links) und canvasPanel (rechts) unterteilt\n JSplitPane split = new JSplitPane();\n split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n split.setLeftComponent(canvasPanel);\n split.setRightComponent(optionPanel);\n \n JSplitPane splitLog = new JSplitPane();\n splitLog.setOrientation(JSplitPane.VERTICAL_SPLIT);\n splitLog.setBottomComponent(logScrollPane);\n splitLog.setTopComponent(split);\n splitLog.setResizeWeight(1);\n \n mMainFrame.add(splitLog, BorderLayout.CENTER); \n }", "private void $$$setupUI$$$() {\n panel1 = new JPanel();\n panel1.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));\n rootTabControl = new JTabbedPane();\n panel1.add(rootTabControl, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false));\n }", "private static void addPanelInMainTabView(TabComponent tc, PlotPanel pnl) {\n EDACCPlotTabView tabView = getMainTabView();\n if (tc == null) {\n tabView.addPanel(pnl);\n } else {\n tabView.addPanel(tc, pnl);\n }\n }", "private static void AddTab(MenuActivity activity, TabHost tabHost,\n TabHost.TabSpec tabSpec, TabInfo tabInfo) {\n tabSpec.setContent(activity.new TabFactory(activity));\n tabHost.addTab(tabSpec);\n Log.i(\"LOG\",\"Cria Aba\");\n }", "@AfterRender\n\tpublic void afterRender() {\n\t\trenderSupport.addScript(String.format(\"new Tabber('%s', '%d');\", element.getClientId(), activeTabNum));\n\t}", "private void addChatTab(ChatPanel chatPanel)\n {\n ChatSession chatSession = chatPanel.getChatSession();\n String chatName = chatSession.getChatName();\n\n ChatPanel currentChatPanel = getCurrentChat();\n\n if (currentChatPanel == null)\n {\n this.mainPanel.add(chatPanel, BorderLayout.CENTER);\n }\n else if (getChatTabCount() == 0)\n {\n ChatSession firstChatSession = currentChatPanel.getChatSession();\n\n // Add first two tabs to the tabbed pane.\n chatTabbedPane.addTab( firstChatSession.getChatName(),\n firstChatSession.getChatStatusIcon(),\n currentChatPanel);\n\n chatTabbedPane.addTab( chatName,\n chatSession.getChatStatusIcon(),\n chatPanel);\n\n // When added to the tabbed pane, the first chat panel should\n // rest the selected component.\n chatTabbedPane.setSelectedComponent(currentChatPanel);\n\n //add the chatTabbedPane to the window\n this.mainPanel.add(chatTabbedPane, BorderLayout.CENTER);\n this.mainPanel.validate();\n }\n else\n {\n // The tabbed pane already contains tabs.\n\n chatTabbedPane.addTab(\n chatName,\n chatSession.getChatStatusIcon(),\n chatPanel);\n\n chatTabbedPane.getParent().validate();\n }\n }", "private void initView() {\n\n LinearLayout bar = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.bottom_bar, null);\n LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\n addView(bar, lp);\n tab1= (LinearLayout) bar.findViewById(R.id.tab1);\n tab2= (LinearLayout) bar.findViewById(R.id.tab2);\n tab3= (LinearLayout) bar.findViewById(R.id.tab3);\n tab4= (LinearLayout) bar.findViewById(R.id.tab4);\n ivTab1= (ImageView) bar.findViewById(R.id.ivTab1);\n tvTab1= (TextView) bar.findViewById(R.id.tvTab1);\n ivTab2= (ImageView) bar.findViewById(R.id.ivTab2);\n tvTab2= (TextView) bar.findViewById(R.id.tvTab2);\n ivTab3= (ImageView) bar.findViewById(R.id.ivTab3);\n tvTab3= (TextView) bar.findViewById(R.id.tvTab3);\n ivTab4= (ImageView) bar.findViewById(R.id.ivTab4);\n tvTab4= (TextView) bar.findViewById(R.id.tvTab4);\n\n tab1.setOnClickListener(this);\n tab2.setOnClickListener(this);\n tab3.setOnClickListener(this);\n tab4.setOnClickListener(this);\n\n }", "private Component setTabPanel(){\n String componentKey = Integer.toString(focusL1) + \"-\" + Integer.toString(focusL2);\n\n Component wrapper = getComponentById(wrapperName);\n Component replacedPanel = getComponentById(panelName);\n\n Component panel;\n panel = panelMap.getPanelMap().get(componentKey);\n replacedPanel.replaceWith( panel );\n\n return wrapper;\n }", "private void configure_tabs() {\n Objects.requireNonNull(tabs.getTabAt(0)).setIcon(R.drawable.baseline_map_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(0)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n Objects.requireNonNull(tabs.getTabAt(1)).setIcon(R.drawable.baseline_view_list_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(1)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n Objects.requireNonNull(tabs.getTabAt(2)).setIcon(R.drawable.baseline_people_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(2)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n swipeRefreshLayout.setEnabled(false);\n\n // Set on Tab selected listener\n tabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n // Change color of the tab -> orange\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n\n // set the current page position\n current_page = tab.getPosition();\n\n // if the current page is the ListMatesFragment, remove the searchView\n if(mToolbar_navig_utils!=null){\n if(current_page==2)\n mToolbar_navig_utils.getSearchView().setVisibility(View.GONE);\n else\n mToolbar_navig_utils.getSearchView().setVisibility(View.VISIBLE);\n }\n\n // refresh title toolbar (different according to the page selected)\n if(mToolbar_navig_utils !=null)\n mToolbar_navig_utils.refresh_text_toolbar();\n\n // Disable pull to refresh when mapView is displayed\n if(tab.getPosition()==0)\n swipeRefreshLayout.setEnabled(false);\n else\n swipeRefreshLayout.setEnabled(true);\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n // if the searchView is opened, close it\n if(mToolbar_navig_utils !=null) {\n if (mToolbar_navig_utils.getSearchView() != null) {\n if (!mToolbar_navig_utils.getSearchView().isIconified()) {\n mToolbar_navig_utils.getSearchView().setIconified(true);\n\n // Recover the previous list of places nearby generated\n switch (current_page) {\n case 0:\n getPageAdapter().getMapsFragment().recover_previous_state();\n break;\n case 1:\n getPageAdapter().getListRestoFragment().recover_previous_state();\n break;\n }\n }\n }\n }\n\n // Change color of the tab -> black\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n }\n });\n }", "private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void addCompositeToTab(String tabName){\r\n\t\tTabItem item = new TabItem(folderReference, SWT.NONE);\r\n\t\titem.setText(tabName);\r\n\t\t\r\n\t\tfolderReference.getItem(compositeIndex).setControl(compositeMap.get(compositeIndex));\r\n\t\t++compositeIndex;\r\n\t}", "private VTabSheet initTabLayout() {\r\n VTabSheet tabs = new VTabSheet();\r\n Map<Component, Integer> tabComponentMap = new HashMap<Component, Integer>();\r\n Binder<Report> binder = new Binder<>(Report.class);\r\n fireEventTypeComponent = new FireEventTypeDataTab(report,userNeedToPrepare, binder, tabComponentMap);\r\n boolean basicEditRight = !report.getStatus().equals(ReportStatus.APPROVED) && (organizationIsCreator || userNeedToPrepare);\r\n tabs.addTab(getTranslation(\"reportView.tab.basicData.label\"), new ReportBasicDataTab(report, binder, basicEditRight, tabComponentMap, addressServiceRef.get(), this));\r\n tabs.addTab(getTranslation(\"reportView.tab.forcesData.label\"), new ReportForcesTab(report, userNeedToPrepare, organizationServiceRef.get(), vechileServiceRef.get(), reportServiceRef.get()));\r\n fireEventTab = tabs.addTab(getTranslation(\"reportView.tab.fireEventData.label\"), fireEventTypeComponent);\r\n tabs.addTab(getTranslation(\"reportView.tab.authorizationData.label\"), new ReportAuthorizationTab(report, binder, userNeedToPrepare, (userNeedToPrepare || userNeedToApprove), tabs, tabComponentMap, organizationServiceRef.get(), reportServiceRef.get(), notificationServiceRef.get()));\r\n return tabs;\r\n }", "public JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "void init() {\n tabHost = findViewById(android.R.id.tabhost);\n tabHost.setup(this, getSupportFragmentManager(), android.R.id.tabcontent);\n tabHost.addTab(tabHost.newTabSpec(\"Login\").setIndicator(\"Login\", null), LoginFragment.class, null);\n tabHost.addTab(tabHost.newTabSpec(\"Register\").setIndicator(\"Register\", null), RegisterFragment.class, null);\n }", "private void addPanel(TabComponent tabComp, PlotPanel pnl) {\n tabbedPanePlots.addTab(null, null, pnl, tabComp.getTitle());\n pnl.setParent(this);\n // replace the tab component and select this new tab\n tabbedPanePlots.setTabComponentAt(tabbedPanePlots.getTabCount() - 1, tabComp);\n tabbedPanePlots.setSelectedIndex(tabbedPanePlots.getTabCount() - 1);\n requestFocus();\n }", "private void createTabFolder() {\r\n\t\tGridData gridData1 = new GridData();\r\n\t\tgridData1.grabExcessHorizontalSpace = true;\r\n\t\tgridData1.heightHint = 500;\r\n\t\tgridData1.grabExcessVerticalSpace = true;\r\n\t\tgridData1.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;\r\n\t\tgridData1.widthHint = 600;\r\n\t\ttabFolder = new TabFolder(sShell, SWT.NONE);\r\n\t\ttabFolder.setLayoutData(gridData1);\r\n\t\tcreateCompositeRoomMange();\r\n\t\tcreateCompositeGoodsMange();\r\n\t\tcreateCompositeStaffMange();\r\n\t\tcreateCompositeUserMange();\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"房间管理\");\r\n\t\ttabItem.setControl(compositeRoomMange);\r\n\t\tTabItem tabItem1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem1.setText(\"商品管理\");\r\n\t\ttabItem1.setControl(compositeGoodsMange);\r\n\t\tTabItem tabItem2 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem2.setText(\"员工管理\");\r\n\t\ttabItem2.setControl(compositeStaffMange);\r\n\t\tTabItem tabItem3 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem3.setText(\"系统用户管理\");\r\n\t\ttabItem3.setControl(compositeUserMange);\r\n\t}", "@Override\n protected void init(VaadinRequest request) {\n final ClosableAccordion component = new ClosableAccordion() {\n {\n setSizeUndefined();\n setWidth(\"100%\");\n\n for (numTab = 1; numTab < 4; numTab++) {\n Tab tab = addTab(new VerticalLayout() {\n\n {\n setMargin(true);\n setSpacing(true);\n\n addComponent(new Label(loremIpsum));\n }\n });\n tab.setClosable(true);\n tab.setCaption(\"Tab #\" + numTab);\n tab.setStyleName(\"trash\");\n }\n\n // Close handler\n setCloseHandler(new CloseHandler() {\n\n @Override\n public void onTabClose(TabSheet tabsheet,\n Component tabContent) {\n Tab tab = tabsheet.getTab(tabContent);\n Notification.show(\"Closing \" + tab.getCaption());\n // We need to close it explicitly in the handler\n tabsheet.removeTab(tab);\n }\n });\n\n // For adding new tabs\n final Label addNewTabContent = new Label();\n Tab addNewTab = addTab(addNewTabContent, \"+ Add a new tab\");\n addNewTab.setStyleName(\"addnew\");\n\n addSelectedTabChangeListener(new SelectedTabChangeListener() {\n\n @Override\n public void selectedTabChange(SelectedTabChangeEvent event) {\n if (event.getTabSheet().getSelectedTab()\n .equals(addNewTabContent)) {\n removeTab(getTab(addNewTabContent));\n\n Tab newTab = addTab(new VerticalLayout() {\n\n {\n setMargin(true);\n setSpacing(true);\n\n addComponent(new Label(loremIpsum));\n }\n });\n newTab.setClosable(true);\n newTab.setCaption(\"Tab #\" + numTab++);\n newTab.setStyleName(\"trash\");\n\n event.getTabSheet().setSelectedTab(newTab);\n\n addTab(addNewTabContent, \"+ Add a new tab\")\n .setStyleName(\"addnew\");\n }\n }\n });\n }\n };\n\n setContent(new VerticalLayout() {\n {\n setSizeUndefined();\n setWidth(\"100%\");\n\n setMargin(false);\n\n setId(\"demo-base-layout\");\n\n addComponent(new Panel() {\n {\n setSizeUndefined();\n setWidth(\"100%\");\n\n setCaption(\"Accordion w/ closable tabs\");\n\n // Show it in the middle of the screen\n setContent(new HorizontalLayout() {\n {\n setStyleName(\"demoContentLayout\");\n\n setSizeUndefined();\n setWidth(\"100%\");\n\n setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);\n\n addComponent(component);\n }\n });\n }\n });\n }\n });\n }", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\t\tshell.setLayout(new FillLayout(SWT.HORIZONTAL));\r\n\t\t\r\n\t\tfinal TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\r\n\t\ttabFolder.setToolTipText(\"\");\r\n\t\t\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"欢迎使用\");\r\n\t\t\r\n\t\tTabItem tabItem_1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem_1.setText(\"员工查询\");\r\n\t\t\r\n\t\tMenu menu = new Menu(shell, SWT.BAR);\r\n\t\tshell.setMenuBar(menu);\r\n\t\t\r\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.NONE);\r\n\t\tmenuItem.setText(\"系统管理\");\r\n\t\t\r\n\t\tMenuItem menuItem_1 = new MenuItem(menu, SWT.CASCADE);\r\n\t\tmenuItem_1.setText(\"员工管理\");\r\n\t\t\r\n\t\tMenu menu_1 = new Menu(menuItem_1);\r\n\t\tmenuItem_1.setMenu(menu_1);\r\n\t\t\r\n\t\tMenuItem menuItem_2 = new MenuItem(menu_1, SWT.NONE);\r\n\t\tmenuItem_2.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tTabItem tbtmNewItem = new TabItem(tabFolder,SWT.NONE);\r\n\t\t\t\ttbtmNewItem.setText(\"员工查询\");\r\n\t\t\t\t//创建自定义组件\r\n\t\t\t\tEmpQueryCmp eqc = new EmpQueryCmp(tabFolder, SWT.NONE);\r\n\t\t\t\t//设置标签显示的自定义组件\r\n\t\t\t\ttbtmNewItem.setControl(eqc);\r\n\t\t\t\t\r\n\t\t\t\t//选中当前标签页\r\n\t\t\t\ttabFolder.setSelection(tbtmNewItem);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tmenuItem_2.setText(\"员工查询\");\r\n\r\n\t}", "public static void patchTabs() throws NoSuchFieldException, IllegalAccessException {\n LegacySupportUtility.INSTANCE.invokeClassSafely(\"com.intellij.ide.ui.laf.darcula.ui.DarculaSeparatorUI\", () -> {\n final int baseHeight = JBUI.scale(6);\n final int tabsHeight = MTConfig.getInstance().getTabsHeight() / 2 - baseHeight;\n StaticPatcher.setFinalStatic(TabsUtil.class, \"TAB_VERTICAL_PADDING\", new JBValue.Float(tabsHeight));\n });\n }", "private void initialiseTabHost(Bundle args) {\n\t\tmTabHost = (TabHost)findViewById(android.R.id.tabhost);\n mTabHost.setup();\n TabInfo tabInfo = null;\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab1\").setIndicator(\"Waveform\"), ( tabInfo = new TabInfo(\"Tab1\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab2\").setIndicator(\"FFT\"), ( tabInfo = new TabInfo(\"Tab2\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab3\").setIndicator(\"AC\"), ( tabInfo = new TabInfo(\"Tab3\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab4\").setIndicator(\"Pitch\"), ( tabInfo = new TabInfo(\"Tab4\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n // Default to first tab\n this.onTabChanged(\"Tab1\");\n //\n mTabHost.setOnTabChangedListener(this);\n\t}", "public void init() {\n\t\ttabbed = new JTabbedPane();\n\t\ttabbed.insertTab(\"Sesion\", null, getPanelSesion(), \"Control de la sesion\", 0);\n\t\ttabbed.insertTab(\"Evolución bolsa\", null, new JPanel(), \"Control de los usuarios\", 1);\n\t\ttabbed.insertTab(\"Eventos\", null, new JPanel(), \"Control de los eventos\", 2);\n\t\ttabbed.insertTab(\"Control de Agentes\", null, getPanelAgentes(), \"Control de los agentes\", 3);\n\t\tgetContentPane().add(tabbed);\n\t\ttabbed.setEnabledAt(1, false);\n\t\ttabbed.setEnabledAt(2, false);\n\t\tsetSize(new Dimension(800, 600));\n\t}", "private JPanel getContents(final JTabbedPane jtp,\n final MyTabPreviewPainter mainTabPreviewPainter) {\n FormBuilder builder = FormBuilder.create().\n columns(\"right:pref, 4dlu, fill:min:grow(1), 2dlu, fill:min:grow(1)\").\n rows(\"p, 2dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, \"\n + \"p, 3dlu, p, 7dlu, p, 2dlu, p, 0dlu, p, 0dlu, p, 0dlu, p, 7dlu,\"\n + \"p, 2dlu, p, 3dlu, p, 0dlu, p, 3dlu, p, 3dlu, p, 7dlu, \"\n + \"p, 2dlu, p, 0dlu, p, 0dlu, p, 0dlu, p, 7dlu, p, 2dlu, p, 3dlu, p\").\n columnGroups(new int[][] { { 3, 5 } });\n\n int row = 1;\n builder.addSeparator(\"General\").xyw(1, row, 5);\n\n final JComboBox<String> addKindCombo = new JComboBox<>(\n new String[] { \"regular\", \"null\", \"modified\" });\n JButton addNewTabButton = new JButton(\"Add\");\n addNewTabButton.addActionListener(actionEvent -> {\n String selectedKind = (String) addKindCombo.getSelectedItem();\n if (\"null\".equals(selectedKind)) {\n SwingUtilities.invokeLater(() -> jtp.addTab(\"null tab\", null));\n return;\n }\n\n final int count = 1 + jtp.getTabCount();\n final JComponent tabComp = new NumberedPanel(count);\n if (\"modified\".equals(selectedKind)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified(tabComp, true);\n }\n SwingUtilities.invokeLater(() -> jtp.addTab(\"tab\" + count, tabComp));\n });\n row += 2;\n\n builder.addLabel(\"Add tab\").xy(1, row);\n builder.add(addKindCombo).xy(3, row);\n builder.add(addNewTabButton).xy(5, row);\n\n final JComboBox<String> placementCombo = new JComboBox<>(\n new String[] { \"top\", \"bottom\", \"left\", \"right\" });\n placementCombo.addActionListener(actionEvent -> {\n String selected = (String) placementCombo.getSelectedItem();\n if (\"top\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.TOP);\n if (\"bottom\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.BOTTOM);\n if (\"left\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.LEFT);\n if (\"right\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.RIGHT);\n });\n row += 2;\n builder.addLabel(\"Placement\").xy(1, row);\n builder.add(placementCombo).xyw(3, row, 3);\n\n try {\n final JComboBox<TabOverviewKind> overviewKindCombo = new FlexiComboBox<>(\n TabOverviewKind.GRID, TabOverviewKind.MENU_CAROUSEL,\n TabOverviewKind.ROUND_CAROUSEL) {\n @Override\n public String getCaption(TabOverviewKind item) {\n return item.getName();\n }\n };\n overviewKindCombo.addActionListener(actionEvent -> mainTabPreviewPainter\n .setTabOverviewKind((TabOverviewKind) overviewKindCombo.getSelectedItem()));\n row += 2;\n builder.addLabel(\"Overview kind\").xy(1, row);\n builder.add(overviewKindCombo).xyw(3, row, 3);\n } catch (NoClassDefFoundError ncdfe) {\n }\n\n final JCheckBox useScrollLayout = new JCheckBox(\"Uses scroll layout\");\n useScrollLayout.setSelected(false);\n useScrollLayout.addActionListener(actionEvent -> jtp\n .setTabLayoutPolicy(useScrollLayout.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT\n : JTabbedPane.WRAP_TAB_LAYOUT));\n row += 2;\n builder.addLabel(\"Layout\").xy(1, row);\n builder.add(useScrollLayout).xyw(3, row, 3);\n\n final JComboBox<TabContentPaneBorderKind> contentBorderCombo = new JComboBox<>(new TabContentPaneBorderKind[] {\n TabContentPaneBorderKind.DOUBLE_PLACEMENT,\n TabContentPaneBorderKind.SINGLE_PLACEMENT });\n contentBorderCombo.setSelectedItem(TabContentPaneBorderKind.DOUBLE_PLACEMENT);\n contentBorderCombo.addActionListener(actionEvent -> {\n TabContentPaneBorderKind contentBorderKind = (TabContentPaneBorderKind) contentBorderCombo\n .getSelectedItem();\n RadianceThemingCortex.ComponentScope.setTabContentPaneBorderKind(jtp, contentBorderKind);\n jtp.updateUI();\n jtp.repaint();\n });\n row += 2;\n builder.addLabel(\"Content border\").xy(1, row);\n builder.add(contentBorderCombo).xyw(3, row, 3);\n\n JButton enableAll = new JButton(\"+ all\");\n enableAll.addActionListener(actionEvent -> {\n for (int i = 0; i < jtp.getTabCount(); i++) {\n jtp.setEnabledAt(i, true);\n }\n });\n\n JButton disableAll = new JButton(\"- all\");\n disableAll.addActionListener(actionEvent -> {\n for (int i = 0; i < jtp.getTabCount(); i++) {\n jtp.setEnabledAt(i, false);\n }\n });\n\n row += 2;\n builder.addLabel(\"Enable all\").xy(1, row);\n builder.add(enableAll).xy(3, row);\n builder.add(disableAll).xy(5, row);\n\n JButton closeAllEnabled = new JButton(\"Close\");\n closeAllEnabled.addActionListener(actionEvent -> {\n Set<Component> toRemove = new HashSet<>();\n for (int i = 0; i < jtp.getTabCount(); i++) {\n if (jtp.isEnabledAt(i))\n toRemove.add(jtp.getComponentAt(i));\n }\n for (Component comp : toRemove)\n jtp.remove(comp);\n });\n\n JButton restoreClosed = new JButton(\"Restore\");\n restoreClosed.addActionListener(actionEvent -> {\n for (Component tnp : closed) {\n jtp.addTab(\"restored\", tnp);\n }\n });\n\n row += 2;\n builder.addLabel(\"Close all\").xy(1, row);\n builder.add(closeAllEnabled).xy(3, row);\n builder.add(restoreClosed).xy(5, row);\n\n row += 2;\n builder.addSeparator(\"Single Tab\").xyw(1, row, 5);\n\n final JComboBox<Integer> tabSelectorCombo = new JComboBox<>(new TabComboBoxModel(this.jtp));\n //tabSelectorCombo.setRenderer(new TabCellRenderer());\n jtp.addContainerListener(new ContainerAdapter() {\n @Override\n public void componentAdded(ContainerEvent e) {\n ((TabComboBoxModel) tabSelectorCombo.getModel()).changed();\n }\n\n @Override\n public void componentRemoved(ContainerEvent e) {\n ((TabComboBoxModel) tabSelectorCombo.getModel()).changed();\n }\n });\n\n row += 2;\n builder.addLabel(\"Select\").xy(1, row);\n builder.add(tabSelectorCombo).xyw(3, row, 3);\n\n final JButton markAsModified = new JButton(\"-> modified\");\n markAsModified.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified((JComponent) comp, true);\n }\n });\n final JButton markAsUnmodified = new JButton(\"-> unmodified\");\n markAsUnmodified.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified((JComponent) comp, false);\n }\n });\n row += 2;\n builder.addLabel(\"Modified\").xy(1, row);\n builder.add(markAsModified).xy(3, row);\n builder.add(markAsUnmodified).xy(5, row);\n\n final JButton runModifiedAnimOnClose = new JButton(\"Animate on X\");\n runModifiedAnimOnClose.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setRunModifiedAnimationOnTabCloseButton(jc, true);\n }\n });\n final JButton runModifiedAnimOnTab = new JButton(\"Animate on tab\");\n runModifiedAnimOnTab.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setRunModifiedAnimationOnTabCloseButton(jc, false);\n }\n });\n row += 2;\n builder.add(runModifiedAnimOnClose).xy(3, row);\n builder.add(runModifiedAnimOnTab).xy(5, row);\n\n final JButton showCloseButton = new JButton(\"+ close button\");\n showCloseButton.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setTabCloseButtonVisible(jc, true);\n jtp.repaint();\n }\n });\n final JButton hideCloseButton = new JButton(\"- close button\");\n hideCloseButton.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setTabCloseButtonVisible(jc, false);\n jtp.repaint();\n }\n });\n\n JButton closeButton = new JButton(\"Close\");\n closeButton.addActionListener(actionEvent -> SwingUtilities.invokeLater(() -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n jtp.removeTabAt((Integer) tabSelectorCombo.getSelectedItem());\n closed.add(comp);\n jtp.repaint();\n }));\n\n JButton selectButton = new JButton(\"Select\");\n selectButton.addActionListener(actionEvent -> SwingUtilities.invokeLater(() -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n jtp.setSelectedIndex((Integer) tabSelectorCombo.getSelectedItem());\n }));\n row += 2;\n builder.addLabel(\"Tab op\").xy(1, row);\n builder.add(closeButton).xy(3, row);\n builder.add(selectButton).xy(5, row);\n\n row += 2;\n builder.addSeparator(\"Close Button Single\").xyw(1, row, 5);\n\n row += 2;\n builder.addLabel(\"Visible\").xy(1, row);\n builder.add(showCloseButton).xy(3, row);\n builder.add(hideCloseButton).xy(5, row);\n\n return builder.getPanel();\n }", "private static void addPanel(MouseEvent evt, TabComponent tabComp, PlotPanel pnl) {\n EDACCPlotTabView tabView = new EDACCPlotTabView();\n tabView.setLocation(evt.getXOnScreen(), evt.getYOnScreen());\n if (tabViews.size() > 0) {\n tabView.setSize(tabViews.get(0).getSize());\n } else {\n tabView.updateTitle(\"\");\n }\n tabViews.add(tabView);\n tabComp.setParent(tabView);\n tabView.addPanel(tabComp, pnl);\n tabView.updateAdditionalInformations(pnl);\n tabView.updateTitle(pnl.getPlot().getPlotTitle());\n tabViewCountChanged();\n }", "@Override\n\tpublic JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "private void addMenuItems() {\n menuBar.setLayout(new FlowLayout(FlowLayout.CENTER));\n menuBar.setBackground(Color.BLUE);\n JMenuItem newTabButton = new JMenuItem(\"New Tab\");\n newTabButton.addActionListener(e ->\n {\n String tabName = \"Space \";\n Random rand = new Random();\n float r = (float) (rand.nextFloat() / 2f + 0.5);\n float g = (float) (rand.nextFloat() / 2f + 0.5);\n float b = (float) (rand.nextFloat() / 2f + 0.5);\n Color backgroundColor = new Color(r, g, b);\n tabName += tabIndex;\n tabIndex += 1;\n WorkingPanel workingPanel = new WorkingPanel();\n workingPanel.setBackground(backgroundColor);\n jTabbedPane.add(tabName, workingPanel);\n addIconToTab(workingPanel, \"(\");\n addIconToTab(workingPanel, \")\");\n });\n JMenuItem saveButton = new JMenuItem(\"Save\");\n fileManager = new FileManager(this);\n saveButton.addActionListener(e -> {\n try {\n fileManager.saveFile();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n } catch (NullPointerException nullPointerException){\n JOptionPane.showMessageDialog(null, \"No file selected\");\n }\n });\n JMenuItem loadButton = new JMenuItem(\"Load\");\n loadButton.addActionListener(e -> {\n try {\n fileManager.loadFile();\n } catch (IOException | ClassNotFoundException ioException) {\n ioException.printStackTrace();\n }\n });\n JMenuItem compileButton = new JMenuItem(\"Compile\");\n compileButton.addActionListener(e -> {\n visited = new HashSet<>();\n boolean compileFlag = true;\n for (int idx = 0; idx < jTabbedPane.getTabCount(); idx++) {\n WorkingPanel workingPanel = (WorkingPanel) jTabbedPane.getComponent(idx);\n boolean isSuccessfullyCompiled = compileTab(workingPanel.getConnections(), workingPanel, idx);\n if (!isSuccessfullyCompiled) {\n compileFlag = false;\n }\n }\n if (compileFlag) {\n generateGraphCode();\n }\n });\n newTabButton.setPreferredSize(new Dimension(150, 40));\n loadButton.setPreferredSize(new Dimension(150, 40));\n saveButton.setPreferredSize(new Dimension(150, 40));\n compileButton.setPreferredSize(new Dimension(150, 40));\n menuBar.add(newTabButton);\n menuBar.add(saveButton);\n menuBar.add(loadButton);\n menuBar.add(compileButton);\n }", "public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft)\n {\n // Check if the fragment is already initialized\n if (mFragment == null)\n {\n // If not, instantiate and add it to the activity\n mFragment = Fragment.instantiate(mActivity, mClass.getName());\n ft.add(android.R.id.content, mFragment, mTag);\n }\n else\n {\n // If it exists, simply attach it in order to show it\n ft.attach(mFragment);\n }\n\n if(mTag.equals(MiNoteConstants.NOTES_TAB))\n {\n createNotes(true);\n\n isNoteTabSelected = true;\n\n if(areNoteButtonCreated)\n {\n makeNoteButtonsInvisible();\n }\n }\n else if(mTag.equals(MiNoteConstants.EVENTS_TAB))\n {\n createNotes(false);\n\n isNoteTabSelected = false;\n\n if(areNoteButtonCreated)\n {\n makeNoteButtonsInvisible();\n }\n }\n }", "public MainUiPanel() {\n initComponents();\n// initializeTable();\n ArrayList<Client> loc = LocationAction.getLocationList();\n for(Client cl: loc){\n// column.add(cl.getClientName());\n// }\n \n jTabbedPane1.addTab(\"OrderList for \"+cl.getClientName(), new OrderNotificationUi(cl.getClientId()));\n// jTabbedPane1.addTab(\"OrderList for \"+cl.getClientName(), new OrderNotificationUi());\n }\n }", "@Override\r\n\tpublic void onTabSelected(Tab tab, FragmentTransaction ft) {\n\t\t if (mFragment == null) {\r\n\t\t // If not, instantiate and add it to the activity\r\n\t\t mFragment = Fragment.instantiate(mActivity, mClass.getName());\r\n\t\t ft.add(android.R.id.content, mFragment, mTag);\r\n\t\t } else {\r\n\t\t // If it exists, simply attach it in order to show it\r\n\t\t ft.show(mFragment);//选择的时候,让之前隐藏的显示出来\r\n\t\t }\r\n\r\n\t}", "@Override\r\n protected Control createContents( final Composite parent ) {\r\n TabFolder folder = new TabFolder( parent, SWT.NONE );\r\n\r\n Tab appearanceTab = new AppearanceTab( overlayStore );\r\n createTab( folder, \"Appeara&nce\", appearanceTab.createControl( folder ) );\r\n\r\n Tab syntaxTab = new SyntaxTab( overlayStore );\r\n createTab( folder, \"Synta&x\", syntaxTab.createControl( folder ) );\r\n\r\n Tab annotationsTab = new AnnotationsTab( overlayStore );\r\n createTab( folder, \"Annotation&s\", annotationsTab.createControl( folder ) );\r\n\r\n Tab typingTab = new TypingTab( overlayStore );\r\n createTab( folder, \"T&yping\", typingTab.createControl( folder ) );\r\n\r\n return folder;\r\n }", "public void setupScroll() {\n\t\ttabs = new JLayeredPane();\n\t\tscroll = new JScrollPane(panel);\n\t\tchampions = new ArrayList<JButton>();\n\t\taddChampions(panel, CHAMPIONLIST);\n\t\ttabs = new JLayeredPane();\n\t\tURL url = getClass().getResource(\".coredata/background/ChampionsTab.png\");\n\t\tImageIcon tabIcon = new ImageIcon(Toolkit.getDefaultToolkit().getImage(url));\n\t\ttabs.setPreferredSize(new Dimension(724, 53));\n\t\tJLabel championTab = new JLabel();\n\t\tchampionTab.setIcon(tabIcon);\n\t\ttabs.add(championTab, 50);\n\t\tchampionTab.setBounds(0, 0, tabIcon.getIconWidth(), tabIcon.getIconHeight());\n\t\tsearch = new JTextField(10);\n\t\tsearch.addFocusListener(new FocusListener() {\n\t\t\tpublic void focusGained(FocusEvent e) {search.setText(\"\");}\n\t\t\tpublic void focusLost(FocusEvent e) {}\n\t\t});\n\t\ttabs.add(search, 1000);\n\t\tsearch.setBounds(600, 10, 100, 25);\n\t}", "public void addMainTab(String label, String historyToken, String contentUrl, TabOptions options) {\n addTab(MainTabPanelPresenter.TYPE_RequestTabs,\n MainTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, true, contentUrl, options);\n }", "private JTabbedPane getJTabbedPane() {\r\n\t\tif (jTabbedPane == null) {\r\n\t\t\tjTabbedPane = new JTabbedPane();\r\n\t\t\tjTabbedPane.addTab(\"Basic Info\", null, getBasicInfo(), null);\r\n\t\t\tjTabbedPane.addTab(\"Configuration Info\", null, getConfigurationInfo(), null);\r\n\t\t}\r\n\t\treturn jTabbedPane;\r\n\t}", "private void addTabs(List<TemplateAttribute> templateAttributes, TemplateRelation tr) {\n ObjectGroupTab otv = null;\n int prevTgId = 0;\n for (TemplateAttribute ta : templateAttributes) {\n if (ta.getTgId() != prevTgId) {\n prevTgId = ta.getTgId();\n if (ta.getTg().getSubRank() == 0) {\n otv = tr == null ? new ObjectGroupTab(this, ta.getTg())\n : new ObjectRelationGroupTab(this, tr, ta.getTg());\n add(otv, ta.getTg().getName());\n final int iTab = getTabBar().getTabCount() - 1;\n getTabBar().getTab(iTab).addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n getModel().setTemplateRelation(null);\n }\n });\n }\n otv.displayGroupLabel(ta.getTg());\n }\n\n TemplateWidget tw = otv.display(ta);\n if (tw != null)\n tw.initialize();\n }\n if (getTabBar().getTabCount() > 0)\n selectTab(0);\n }", "private void addAdditionalFieldsTab()\n {\n\t\t// START OF ADDITIONAL FIELDS TAB ///\n\t\t// ////////////////////////\n \twAdditionalFieldsTab = new CTabItem(wTabFolder, SWT.NONE);\n \twAdditionalFieldsTab.setText(BaseMessages.getString(PKG, \"AccessInputDialog.AdditionalFieldsTab.TabTitle\"));\n\n \twAdditionalFieldsComp = new Composite(wTabFolder, SWT.NONE);\n\t\tprops.setLook(wAdditionalFieldsComp);\n\n\t\tFormLayout fieldsLayout = new FormLayout();\n\t\tfieldsLayout.marginWidth = 3;\n\t\tfieldsLayout.marginHeight = 3;\n\t\twAdditionalFieldsComp.setLayout(fieldsLayout);\n\t\t\n\t\t// ShortFileFieldName line\n\t\twlShortFileFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlShortFileFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.ShortFileFieldName.Label\"));\n\t\tprops.setLook(wlShortFileFieldName);\n\t\tfdlShortFileFieldName = new FormData();\n\t\tfdlShortFileFieldName.left = new FormAttachment(0, 0);\n\t\tfdlShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);\n\t\tfdlShortFileFieldName.right = new FormAttachment(middle, -margin);\n\t\twlShortFileFieldName.setLayoutData(fdlShortFileFieldName);\n\n\t\twShortFileFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wShortFileFieldName);\n\t\twShortFileFieldName.addModifyListener(lsMod);\n\t\tfdShortFileFieldName = new FormData();\n\t\tfdShortFileFieldName.left = new FormAttachment(middle, 0);\n\t\tfdShortFileFieldName.right = new FormAttachment(100, -margin);\n\t\tfdShortFileFieldName.top = new FormAttachment(wInclRownumField, margin);\n\t\twShortFileFieldName.setLayoutData(fdShortFileFieldName);\n\t\t\n\t\t\n\t\t// ExtensionFieldName line\n\t\twlExtensionFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlExtensionFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.ExtensionFieldName.Label\"));\n\t\tprops.setLook(wlExtensionFieldName);\n\t\tfdlExtensionFieldName = new FormData();\n\t\tfdlExtensionFieldName.left = new FormAttachment(0, 0);\n\t\tfdlExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);\n\t\tfdlExtensionFieldName.right = new FormAttachment(middle, -margin);\n\t\twlExtensionFieldName.setLayoutData(fdlExtensionFieldName);\n\n\t\twExtensionFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wExtensionFieldName);\n\t\twExtensionFieldName.addModifyListener(lsMod);\n\t\tfdExtensionFieldName = new FormData();\n\t\tfdExtensionFieldName.left = new FormAttachment(middle, 0);\n\t\tfdExtensionFieldName.right = new FormAttachment(100, -margin);\n\t\tfdExtensionFieldName.top = new FormAttachment(wShortFileFieldName, margin);\n\t\twExtensionFieldName.setLayoutData(fdExtensionFieldName);\n\t\t\n\t\t\n\t\t// PathFieldName line\n\t\twlPathFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlPathFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.PathFieldName.Label\"));\n\t\tprops.setLook(wlPathFieldName);\n\t\tfdlPathFieldName = new FormData();\n\t\tfdlPathFieldName.left = new FormAttachment(0, 0);\n\t\tfdlPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);\n\t\tfdlPathFieldName.right = new FormAttachment(middle, -margin);\n\t\twlPathFieldName.setLayoutData(fdlPathFieldName);\n\n\t\twPathFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wPathFieldName);\n\t\twPathFieldName.addModifyListener(lsMod);\n\t\tfdPathFieldName = new FormData();\n\t\tfdPathFieldName.left = new FormAttachment(middle, 0);\n\t\tfdPathFieldName.right = new FormAttachment(100, -margin);\n\t\tfdPathFieldName.top = new FormAttachment(wExtensionFieldName, margin);\n\t\twPathFieldName.setLayoutData(fdPathFieldName);\n\t\t\n\n\n \t\t// SizeFieldName line\n\t\twlSizeFieldName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlSizeFieldName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.SizeFieldName.Label\"));\n\t\tprops.setLook(wlSizeFieldName);\n\t\tfdlSizeFieldName = new FormData();\n\t\tfdlSizeFieldName.left = new FormAttachment(0, 0);\n\t\tfdlSizeFieldName.top = new FormAttachment(wPathFieldName, margin);\n\t\tfdlSizeFieldName.right = new FormAttachment(middle, -margin);\n\t\twlSizeFieldName.setLayoutData(fdlSizeFieldName);\n\n\t\twSizeFieldName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wSizeFieldName);\n\t\twSizeFieldName.addModifyListener(lsMod);\n\t\tfdSizeFieldName = new FormData();\n\t\tfdSizeFieldName.left = new FormAttachment(middle, 0);\n\t\tfdSizeFieldName.right = new FormAttachment(100, -margin);\n\t\tfdSizeFieldName.top = new FormAttachment(wPathFieldName, margin);\n\t\twSizeFieldName.setLayoutData(fdSizeFieldName);\n\t\t\n\t\t\n\t\t// IsHiddenName line\n\t\twlIsHiddenName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlIsHiddenName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.IsHiddenName.Label\"));\n\t\tprops.setLook(wlIsHiddenName);\n\t\tfdlIsHiddenName = new FormData();\n\t\tfdlIsHiddenName.left = new FormAttachment(0, 0);\n\t\tfdlIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);\n\t\tfdlIsHiddenName.right = new FormAttachment(middle, -margin);\n\t\twlIsHiddenName.setLayoutData(fdlIsHiddenName);\n\n\t\twIsHiddenName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wIsHiddenName);\n\t\twIsHiddenName.addModifyListener(lsMod);\n\t\tfdIsHiddenName = new FormData();\n\t\tfdIsHiddenName.left = new FormAttachment(middle, 0);\n\t\tfdIsHiddenName.right = new FormAttachment(100, -margin);\n\t\tfdIsHiddenName.top = new FormAttachment(wSizeFieldName, margin);\n\t\twIsHiddenName.setLayoutData(fdIsHiddenName);\n\t\t\n\t\t// LastModificationTimeName line\n\t\twlLastModificationTimeName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlLastModificationTimeName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.LastModificationTimeName.Label\"));\n\t\tprops.setLook(wlLastModificationTimeName);\n\t\tfdlLastModificationTimeName = new FormData();\n\t\tfdlLastModificationTimeName.left = new FormAttachment(0, 0);\n\t\tfdlLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);\n\t\tfdlLastModificationTimeName.right = new FormAttachment(middle, -margin);\n\t\twlLastModificationTimeName.setLayoutData(fdlLastModificationTimeName);\n\n\t\twLastModificationTimeName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wLastModificationTimeName);\n\t\twLastModificationTimeName.addModifyListener(lsMod);\n\t\tfdLastModificationTimeName = new FormData();\n\t\tfdLastModificationTimeName.left = new FormAttachment(middle, 0);\n\t\tfdLastModificationTimeName.right = new FormAttachment(100, -margin);\n\t\tfdLastModificationTimeName.top = new FormAttachment(wIsHiddenName, margin);\n\t\twLastModificationTimeName.setLayoutData(fdLastModificationTimeName);\n\t\t\n\t\t// UriName line\n\t\twlUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlUriName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.UriName.Label\"));\n\t\tprops.setLook(wlUriName);\n\t\tfdlUriName = new FormData();\n\t\tfdlUriName.left = new FormAttachment(0, 0);\n\t\tfdlUriName.top = new FormAttachment(wLastModificationTimeName, margin);\n\t\tfdlUriName.right = new FormAttachment(middle, -margin);\n\t\twlUriName.setLayoutData(fdlUriName);\n\n\t\twUriName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wUriName);\n\t\twUriName.addModifyListener(lsMod);\n\t\tfdUriName = new FormData();\n\t\tfdUriName.left = new FormAttachment(middle, 0);\n\t\tfdUriName.right = new FormAttachment(100, -margin);\n\t\tfdUriName.top = new FormAttachment(wLastModificationTimeName, margin);\n\t\twUriName.setLayoutData(fdUriName);\n\t\t\n\t\t// RootUriName line\n\t\twlRootUriName = new Label(wAdditionalFieldsComp, SWT.RIGHT);\n\t\twlRootUriName.setText(BaseMessages.getString(PKG, \"AccessInputDialog.RootUriName.Label\"));\n\t\tprops.setLook(wlRootUriName);\n\t\tfdlRootUriName = new FormData();\n\t\tfdlRootUriName.left = new FormAttachment(0, 0);\n\t\tfdlRootUriName.top = new FormAttachment(wUriName, margin);\n\t\tfdlRootUriName.right = new FormAttachment(middle, -margin);\n\t\twlRootUriName.setLayoutData(fdlRootUriName);\n\n\t\twRootUriName = new TextVar(transMeta, wAdditionalFieldsComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER);\n\t\tprops.setLook(wRootUriName);\n\t\twRootUriName.addModifyListener(lsMod);\n\t\tfdRootUriName = new FormData();\n\t\tfdRootUriName.left = new FormAttachment(middle, 0);\n\t\tfdRootUriName.right = new FormAttachment(100, -margin);\n\t\tfdRootUriName.top = new FormAttachment(wUriName, margin);\n\t\twRootUriName.setLayoutData(fdRootUriName);\n\t\n\n\t\tfdAdditionalFieldsComp = new FormData();\n\t\tfdAdditionalFieldsComp.left = new FormAttachment(0, 0);\n\t\tfdAdditionalFieldsComp.top = new FormAttachment(wStepname, margin);\n\t\tfdAdditionalFieldsComp.right = new FormAttachment(100, 0);\n\t\tfdAdditionalFieldsComp.bottom = new FormAttachment(100, 0);\n\t\twAdditionalFieldsComp.setLayoutData(fdAdditionalFieldsComp);\n\n\t\twAdditionalFieldsComp.layout();\n\t\twAdditionalFieldsTab.setControl(wAdditionalFieldsComp);\n\n\t\t// ///////////////////////////////////////////////////////////\n\t\t// / END OF ADDITIONAL FIELDS TAB\n\t\t// ///////////////////////////////////////////////////////////\n\n\t\t\n \t\n }", "private void initTabs()\n {\n updateDayTab();\n\n // Set initial time on time tab\n updateTimeTab();\n }", "private void addControl() {\n if(getActivity()!=null){\n ((DrawerLocker ) getActivity()).setDrawerEnabled(true);\n }\n //get Bundle\n Bundle args = getArguments();\n lessonIDItem = 1;\n if(args!=null && args.containsKey(\"lesson_item_id\")){\n lessonIDItem = args.getInt(\"lesson_item_id\");\n lesson_item_name =args.getString(\"lesson_item_name\");\n }\n toolbar = root.findViewById(R.id.contentLesson_toolbar);\n ((AppCompatActivity ) getActivity()).setSupportActionBar(toolbar);\n ((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(\"Lesson\");\n ((AppCompatActivity) getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n\n progressBarContent = root.findViewById(R.id.progressBarContent);\n progressBarContent.setMax(100);\n progressBarContent.setProgress(1);\n progressBarContent.incrementProgressBy(2);\n\n wv_lesson_content = root.findViewById(R.id.wv_lesson_content);\n wv_lesson_content.setWebViewClient(new WebViewClientCustomer());\n WebSettings settings = wv_lesson_content.getSettings();\n settings.setSupportZoom(true);\n settings.setBuiltInZoomControls(true);\n settings.setDisplayZoomControls(false);\n settings.setJavaScriptEnabled(true);\n wv_lesson_content.loadUrl(url + lessonIDItem);\n }", "public RSMLGUI() {\r\n\t super(\"RSML Exporter\");\r\n\t instance = this;\r\n\t tp = new JTabbedPane();\r\n\t tp.setFont(font);\r\n\t tp.setSize(300, 600);\r\n\t getContentPane().add(tp);\r\n\t tp.addTab(\"Data transfer\", getDataTransfersTab()); \r\n\t \t\r\n\t pack();\r\n\t setVisible(true);\r\n }", "public JTabbedPaneDemo() {\n\t\ttabbedPane = new JTabbedPane(JTabbedPane.TOP);\n\t\t// panel=new Panel();\n\t\t// panel.setBackground(Color.RED);\n\t\t// music=new JPanel();\n\t\t// music.setBackground(Color.green);\n\t\ttabbedPane.addTab(\"panel\", new JLabel(\"标签\"));\n\t\ttabbedPane.addTab(\"music\", new Button(\"按钮\"));\n\t\tadd(tabbedPane);\n\t\tsetBounds(500, 100, 500, 500);\n\t\tsetVisible(true);\n\t\tsetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t}", "private void addTheTab(final String title, final Component comp) {\n\t\tif (comp==null) {\n\t\t\tthrow new IllegalArgumentException(\"The component can't be null\");\n\t\t}\n\t\tSwingUtilities.invokeLater(new Runnable() {\n\t\t\tpublic void run() {\n\t\t\t\tint i = indexOfComponent(errorTab);\n\t\t\t\tif (i!=-1) {\n\t\t\t\t\tinsertTab(title, null, comp, null, i);\n\t\t\t\t} else {\n\t\t\t\t\taddTab(title,null,comp);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "private void initComponents() {\n tabbedPane = new javax.swing.JTabbedPane();\n statusLabel = new javax.swing.JLabel();\n\n statusLabel.setText(\" \");\n\n javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);\n this.setLayout(layout);\n layout.setHorizontalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(layout.createSequentialGroup()\n .addGap(12, 12, 12)\n .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE))\n .addGroup(layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(statusLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 376, Short.MAX_VALUE)))\n .addContainerGap())\n );\n layout.setVerticalGroup(\n layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)\n .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()\n .addContainerGap()\n .addComponent(tabbedPane, javax.swing.GroupLayout.DEFAULT_SIZE, 267, Short.MAX_VALUE)\n .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)\n .addComponent(statusLabel))\n );\n }", "public ScrollingTabContainerView(Context context) {\n\t\tsuper(context);\n\t\tsetHorizontalScrollBarEnabled(false);\n\n\t\tTypedArray a = getContext().obtainStyledAttributes(null,\n\t\t\t\tR.styleable.SherlockActionBar, R.attr.actionBarStyle, 0);\n\t\tsetContentHeight(a.getLayoutDimension(\n\t\t\t\tR.styleable.SherlockActionBar_height, 0));\n\t\ta.recycle();\n\n\t\tmInflater = LayoutInflater.from(context);\n\n\t\tmTabLayout = createTabLayout();\n\t\taddView(mTabLayout, new ViewGroup.LayoutParams(\n\t\t\t\tViewGroup.LayoutParams.WRAP_CONTENT,\n\t\t\t\tViewGroup.LayoutParams.MATCH_PARENT));\n\t}", "private void addTab(String title, File file, String contents) {\n \tTextPane newTextPane = new TextPane(parentFrame,TextPane.getProperties(false), false);\r\n\r\n \t// 2nd create the tab\r\n \tStyledTab tab = new StyledTab(title);\r\n \tTextPaneTab paneTab = new TextPaneTab(file, newTextPane, tab);\r\n\r\n \t// 3rd add contents if any\r\n \tif (contents != null) {\r\n \t\tnewTextPane.getBuffer().insert(0, contents);\r\n \t\tnewTextPane.setCaretPosition(0);\r\n \t\tpaneTab.setModified(false);\r\n \t}\r\n\r\n \t// 4th add new TextPaneTab\r\n \tpanes.add(paneTab);\r\n\r\n \t// 5th create the pane and add it to manager\r\n \tJPanel pane = new JPanel();\r\n \tpane.setLayout(new BorderLayout());\r\n\t\tJPanel textPaneContainer = new JPanel();\r\n\t\ttextPaneContainer.setBorder(BorderFactory.createLineBorder(new Color(102, 102, 102), 1));\r\n\t\ttextPaneContainer.setLayout(new BorderLayout());\r\n\t\ttextPaneContainer.add(newTextPane, BorderLayout.CENTER);\r\n \tpane.add(textPaneContainer, BorderLayout.CENTER);\r\n \tpane.add(makePrgButtonPanel(), BorderLayout.EAST);\r\n \tint index = getTabCount()-1;\r\n \tinsertTab(title, null, pane, null, index);\r\n \tsetTabComponentAt(index,tab);\r\n \tif (!file.isDirectory())\r\n \t\tsetToolTipTextAt(index, file.getAbsolutePath());\r\n }", "private void createNetworksPanel() {\n\t\ttabs = new ArrayList<>();\n\t\tnetworksPanel = new JTabbedPane();\n\t\tthis.add(networksPanel, BorderLayout.CENTER);\n\t}", "protected WMSLayersPanel addTab(int position, String server) {\n\t\ttry {\n\t\t\tWMSLayersPanel layersPanel = new WMSLayersPanel(this.getWwd(), server, wmsPanelSize);\n\t\t\tthis.tabbedPane.add(layersPanel, BorderLayout.CENTER);\n\t\t\tString title = layersPanel.getServerDisplayString();\n\t\t\tthis.tabbedPane.setTitleAt(position, title != null && title.length() > 0 ? title : server);\n\n\t\t\t// Add a listener to notice wms layer selections and tell the layer\n\t\t\t// panel to reflect the new state.\n\t\t\tlayersPanel.addPropertyChangeListener(\"LayersPanelUpdated\", new PropertyChangeListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void propertyChange(PropertyChangeEvent propertyChangeEvent) {\n\t\t\t\t\tLayer newLayer = (Layer) propertyChangeEvent.getNewValue();\n\t\t\t\t\t// AppFrame.this.getLayerPanel().update(WMSLayerManager.this.getWwd());\n\t\t\t\t\tTacsitManager.getInstance().getWorldWindowJPanel().getModel().getLayers().add(newLayer);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn layersPanel;\n\t\t} catch (URISyntaxException e) {\n\t\t\tJOptionPane.showMessageDialog(null, \"Server URL is invalid\", \"Invalid Server URL\",\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\n\t\t\ttabbedPane.setSelectedIndex(previousTabIndex);\n\t\t\treturn null;\n\t\t}\n\t}", "private void barLayoutManager(int sTab) {\n\n Fragment fragment = null;\n String title = \"\";\n\n if (selectedTab != sTab) {\n selectedTab = sTab;\n barDisableAll();\n\n switch (sTab) {\n\n case TAB_NINJA:\n fragment = NinjaFragment.newInstance();\n title = resources.getString(R.string.tab_ninja);\n imgNinja.setImageDrawable(resources.getDrawable(R.drawable.ic_banana_sel));\n tvNinja.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n case TAB_FRUITER:\n fragment = FruiterFragment.newInstance();\n title = resources.getString(R.string.tab_fruiter);\n imgFruiter.setImageDrawable(resources.getDrawable(R.drawable.ic_like_sel));\n tvFruiter.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n case TAB_HACK:\n fragment = HackXORFragment.newInstance();\n title = resources.getString(R.string.tab_hack);\n imgHack.setImageDrawable(resources.getDrawable(R.drawable.ic_lock_sel));\n tvHack.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n case TAB_NEWS:\n fragment = NewsFragment.newInstance();\n title = resources.getString(R.string.tab_news);\n imgNews.setImageDrawable(resources.getDrawable(R.drawable.ic_news_sel));\n tvNews.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n default:\n break;\n }\n\n getSupportActionBar().setTitle(title);\n\n if (fragment != null) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.frame_container, fragment, \"frag\" + sTab).commit();\n supportInvalidateOptionsMenu();\n }\n }\n }", "public void addSubTab(EntityType entityType, String label, String historyToken, String contentUrl,\n TabOptions options) {\n switch (entityType) {\n case DataCenter:\n addTab(DataCenterSubTabPanelPresenter.TYPE_RequestTabs,\n DataCenterSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Cluster:\n addTab(ClusterSubTabPanelPresenter.TYPE_RequestTabs,\n ClusterSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Host:\n addTab(HostSubTabPanelPresenter.TYPE_RequestTabs,\n HostSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Storage:\n addTab(StorageSubTabPanelPresenter.TYPE_RequestTabs,\n StorageSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Disk:\n addTab(DiskSubTabPanelPresenter.TYPE_RequestTabs,\n DiskSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case VirtualMachine:\n addTab(VirtualMachineSubTabPanelPresenter.TYPE_RequestTabs,\n VirtualMachineSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n case Template:\n addTab(TemplateSubTabPanelPresenter.TYPE_RequestTabs,\n TemplateSubTabPanelPresenter.TYPE_SetTabContent,\n label, historyToken, false, contentUrl, options);\n break;\n }\n }", "private void initView() {\n\t\tmTabHost = (AnimationTabHost) findViewById(android.R.id.tabhost);\n\t\tmTabWidget = (TabWidget) findViewById(android.R.id.tabs);\n\t\tmTabHost.setOnTabChangedListener(this);\n\n\t\tsetIndicator(R.drawable.tab_recommend, 0, new Intent(this,\n\t\t\t\tRecommendActivity.class), R.string.recommend);\n\t\tsetIndicator(R.drawable.tab_channel, 1, new Intent(this,\n\t\t\t\tChannelActivity.class), R.string.channel);\n//\t\tsetIndicator(R.drawable.tab_search, 2, new Intent(this,\n//\t\t\t\tSearchActivity.class), R.string.search);\n\t\tsetIndicator(R.drawable.tab_personal, 3, new Intent(this,\n\t\t\t\tPersonalActivity.class), R.string.peraonal);\n\n\t\tmTabHost.setOpenAnimation(true);\n\n\n\t}", "public void addTab(ActionBar.Tab tab, Class<?> fragmentClass, Bundle args) {\r\n\t\t\tTabInfo info = new TabInfo(fragmentClass, args);\r\n\t\t\ttab.setTag(info);\r\n\t\t\ttab.setTabListener(this);\r\n\t\t\tgetTabs().add(info);\r\n\t\t\tgetActionBar().addTab(tab);\r\n\t\t\tnotifyDataSetChanged();\r\n\t\t}", "private void fuenteTab() {\n\n\n View view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n TextView tv=(TextView) view.findViewById(R.id.pestanias_txt);\n ImageView imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.detalles);\n tv.setTypeface(fuente2);\n tv.setText(\"Detalles\");\n tabLayout.getTabAt(0).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.marciano);\n tv.setTypeface(fuente2);\n tv.setText(\"Juegos\");\n tabLayout.getTabAt(1).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.tienda);\n tv.setTypeface(fuente2);\n tv.setText(\"Tienda\");\n tabLayout.getTabAt(2).setCustomView(view);\n\n }", "@Override\n\tpublic View onCreateView(LayoutInflater inflater, ViewGroup container,\n\t\t\tBundle savedInstanceState) {\n\t\tv = inflater.inflate(R.layout.fragment1_tabs, container, false);\n\t\tmTabHost = (TabHost)v.findViewById(R.id.TabHost01);\n mTabHost.setup();\n \n mTabManager = new TabManager(getActivity(), mTabHost, R.id.realtabcontents);\n mTabHost.setCurrentTab(0);\n mTabManager.addTab(mTabHost.newTabSpec(\"Tab1\").setIndicator(\"Tab1\",this.getResources().getDrawable(R.drawable.car1)),\n \t\tFragment1_Tab1.class, null);\n mTabManager.addTab(mTabHost.newTabSpec(\"Tab2\").setIndicator(\"Tab2\",this.getResources().getDrawable(R.drawable.car2)),\n \t\tFragment1_Tab2.class, null);\n mTabManager.addTab(mTabHost.newTabSpec(\"Tab3\").setIndicator(\"Tab3\",this.getResources().getDrawable(R.drawable.car3)),\n \t\tFragment3.class, null);\n mTabManager.addTab(mTabHost.newTabSpec(\"Tab4\").setIndicator(\"Tab4\",this.getResources().getDrawable(R.drawable.car4)),\n \t\tFragment4.class, null);\n \n DisplayMetrics dm = new DisplayMetrics(); \n getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm); //先取得螢幕解析度 \n int screenWidth = dm.widthPixels; //取得螢幕的寬\n \n \n TabWidget tabWidget = mTabHost.getTabWidget(); //取得tab的物件\n int count = tabWidget.getChildCount(); //取得tab的分頁有幾個\n if (count > 3) { //如果超過三個就來處理滑動\n for (int i = 0; i < count; i++) { \n tabWidget.getChildTabViewAt(i).setMinimumWidth((screenWidth) / 4);//設定每一個分頁最小的寬度 \n } \n }\n\t\treturn v;\n\t}", "protected void beforeBody(final XMLOutput output) throws JellyTagException, SAXException\n\t{\n\t\t//Does it have valid name\n\t\tString name = getName() ;\n\t\tif (isEmpty(name))\n\t\t\tthrow new JellyTagException(\"name is a required parameter for this tag\") ;\n\t\t\n\t\tString text = (String)getAttribute(TEXT) ;\n\t\t\n\t\t//Is an active tab panel name\n\t\tif (isEmpty(getCurrentTabPanelName()))\n\t\t\tthrow new JellyTagException(\"There is no tab pane active panel tag open at this time\") ;\n\t\t\n\t\t//Is there a valid tab label\n\t\tif (isEmpty(text))\n\t\t\tthrow new JellyTagException(\"text is a required parameter for this tag\") ;\n\t\t\n\t\t//Generate th div for the tab panel item\n\t\toutput.write(\"<div id=\\\"\" + \"tabitem-\" + name + \"-id\" + \"\\\">\\n\") ;\n\t\t\n\t\t//Generate a tab Panel Item creation\n\t\tscriptBuffer.appendln(\" \" + name + \" = \" + getCurrentTabPanelName() + \".addTab(\\\"tabitem-\" + name + \"-id\\\",\\\"\" + text + \"\\\");\") ;\n\t\t\n\t\t//Does this tab need to be active\n\t\tString active = (String) getAttribute(ACTIVE) ;\n\t\tif (!isEmpty(active))\n\t\t\tscriptBuffer.appendln(\" \" + getCurrentTabPanelName() + \".activate(\\\"tabitem-\" + name + \"-id\\\")\") ;\n\t\t\n\t\t//Does this tab need to be hidden\n\t\tString hidden = (String) getAttribute(HIDDEN) ;\n\t\tif (!isEmpty(hidden))\n\t\t\tscriptBuffer.appendln(\" \" + getCurrentTabPanelName() + \".hideTab(\\\"tabitem-\" + name + \"-id\\\")\") ;\n\t\t\n\t\t//Does this tab need to be disabled\n\t\tString disable = (String) getAttribute(DISABLE) ;\n\t\tif (!isEmpty(disable))\n\t\t\tscriptBuffer.appendln(\" \" + getCurrentTabPanelName() + \".disableTab(\\\"tabitem-\" + name + \"-id\\\")\") ;\n\t\t\n\t\t//If the tab item has a url where the tab content will be loaded from\n\t\tString contentURL = (String) getAttribute(CONTENTURL) ;\n\t\tif (!isEmpty(contentURL))\n\t\t{\n\t\t\tscriptBuffer.appendln(\" Ext.get(\\\"tabitem-\" + name + \"-id\\\").load({\") ;\n\t\t\tscriptBuffer.appendln(\" url:'\" + webContext + contentURL + \"',\") ;\n\t\t\tscriptBuffer.appendln(\" scripts:true,\") ;\n\t\t\tscriptBuffer.appendln(\" text:'Loading tab pane...'\") ;\n\t\t\tscriptBuffer.appendln(\" });\") ;\n\t\t}\n\t}", "@Override\n\tpublic void onViewCreated(View view, Bundle savedInstanceState)\n {\n\t\tsuper.onViewCreated(view, savedInstanceState);\n\t\t\n\t\tfinal RuntimeApplication runtimeApp = new RuntimeApplication();\n// \t\t\t(RuntimeApplication) this.getActivity().getApplication();\n\t\t\n\t\tfinal int color;\n\t\tif(runtimeApp.switcher!=null)\n\t\tcolor= runtimeApp.switcher.getSelectedColorSwitcher();\n\t\telse color = Color.parseColor(\"#ffffff\");\n\t\tString[] tabNames = {\"Near\", \"Featured\", \"Price\"};\n TabHeader tabHeader = (TabHeader) this.getActivity().findViewById(R.id.tabHeader);\n tabHeader.setOnTabHeaderListener(this);\n tabHeader.setTab(tabNames, R.layout.tab_entry, R.id.btnTab, LayoutConfig.INNER_TAB_WEIGHT);\n \n // set the empty view colors when the list doesnt show any data.\n TextView emptyView = (TextView) this.getActivity().findViewById(R.id.tvEmpty);\n TextTint.tintTextView(this.getActivity(), emptyView, color);\n \n \n createSlider(runtimeApp.globalEntryListSlider);\n if(runtimeApp.globalEntryListApartments!=null)\n if(runtimeApp.globalEntryListApartments.size() == 0)\n {\n \tdownloadApartmentsData();\n }\n else\n {\n \ttabHeader.setSelectedTab(selectedIndex);\n \tsetListDataTab(runtimeApp.globalEntryListApartments, selectedIndex);\n } \n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n // Inflate the layout for this fragment\n View root = inflater.inflate(R.layout.fragment_trips, container, false);\n FragmentTabHost tabHost = root.findViewById(android.R.id.tabhost);\n tabHost.setup(getActivity(), getChildFragmentManager(), android.R.id.tabcontent);\n\n Bundle arg1 = new Bundle();\n arg1.putString(ListTripsFragment.TRIP_TYPE_KEY, \"Confirmed\");\n tabHost.addTab(tabHost.newTabSpec(\"ConfirmedTab\").setIndicator(\"Confirmed\"),\n ListTripsFragment.class, arg1);\n\n Bundle arg2 = new Bundle();\n arg2.putString(ListTripsFragment.TRIP_TYPE_KEY, \"Pending\");\n tabHost.addTab(tabHost.newTabSpec(\"PendingTab\").setIndicator(\"Pending\"),\n ListTripsFragment.class, arg2);\n\n Bundle arg3 = new Bundle();\n arg3.putString(ListTripsFragment.TRIP_TYPE_KEY, \"Posted\");\n tabHost.addTab(tabHost.newTabSpec(\"PostedTab\").setIndicator(\"Posted\"),\n ListTripsFragment.class, arg3);\n\n return root;\n }", "@Override\n public void renderHead(final IHeaderResponse response) {\n // select bootstrap tab for current theme selected\n int selectedTab = this.getSelectedTab();\n response.render(OnDomReadyHeaderItem.forScript(\"$('#themes li:eq(\"\n + selectedTab + \") a').tab('show');\"));\n }" ]
[ "0.702123", "0.6740658", "0.6668066", "0.65537393", "0.65536594", "0.6507343", "0.6462852", "0.64023906", "0.638104", "0.6378662", "0.6330688", "0.6294628", "0.6294117", "0.6253865", "0.6250902", "0.61562216", "0.61315626", "0.6126876", "0.61119705", "0.6095141", "0.60846955", "0.60813534", "0.6072785", "0.6042274", "0.6042076", "0.60387343", "0.6012688", "0.59856683", "0.597929", "0.5978983", "0.5965657", "0.595642", "0.5951043", "0.59278363", "0.5924813", "0.5910542", "0.5875447", "0.58740896", "0.58663595", "0.5865375", "0.58593726", "0.5855871", "0.58503544", "0.5819955", "0.58015513", "0.57994056", "0.57939905", "0.5788362", "0.5778793", "0.5766307", "0.5753719", "0.57524145", "0.572571", "0.5715542", "0.5713718", "0.57052684", "0.5703826", "0.5687821", "0.5677838", "0.5671208", "0.56707954", "0.56621575", "0.5660933", "0.56480736", "0.5632484", "0.56302494", "0.5626388", "0.5620088", "0.5612861", "0.56000495", "0.55883133", "0.5587988", "0.558571", "0.5585422", "0.5582024", "0.55764693", "0.5564242", "0.5546883", "0.5528057", "0.55220246", "0.5515516", "0.5513891", "0.5513735", "0.5510072", "0.54985046", "0.5495122", "0.5489822", "0.548348", "0.5482308", "0.5476631", "0.54719657", "0.54671764", "0.5457024", "0.5456776", "0.54505444", "0.5449493", "0.5445398", "0.54434955", "0.5439208", "0.5438219" ]
0.8089092
0
Populates the treemap with start and end letters based on how many letters should be present in each group
private void populateLetterList() { int numberOfTabs = LETTERS_IN_ALPHABET / numberInGroup; if (LETTERS_IN_ALPHABET % numberInGroup != 0) { numberOfTabs++; } for (int i = 0; i < numberOfTabs; i++) { Character startLetter = (char) ((i * numberInGroup) + 65); Character endLetter = (char) (startLetter + numberInGroup - 1); if ((int) endLetter > (25 + 65)) { endLetter = (char) (25 + 65); } startLetterList.put(startLetter, endLetter); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void buildMap()\n {\n for(int letterNum=0; letterNum < myText.length()-myNum; letterNum++) {\n String key = myText.substring(letterNum,letterNum+myNum);\n String nextLetter = String.valueOf(myText.charAt(letterNum + myNum));\n if (!map.containsKey(key)) {\n ArrayList<String> lettersArray = new ArrayList<String>();\n lettersArray.add(nextLetter);\n map.put(key,lettersArray);\n }else\n {\n map.get(key).add(nextLetter);\n }\n }\n }", "private static Map<String, List<Pair<String, Integer>>> regroup(List<List<Pair<String, Integer>>> pairsList) {\n // Exercise 31.3 groups\n char g1 = 'a';\n char g2 = 'f';\n char g3 = 'k';\n char g4 = 'p';\n char g5 = 'u';\n Map<String, List<Pair<String, Integer>>> result = new HashMap<>();\n for (List<Pair<String, Integer>> pairs : pairsList) {\n for (Pair<String, Integer> p : pairs) {\n char group;\n char firstLetter = p.first().charAt(0);\n if (firstLetter >= g1 && firstLetter < g2) {\n group = g1;\n } else if (firstLetter >= g2 && firstLetter < g3) {\n group = g2;\n } else if (firstLetter >= g3 && firstLetter < g4) {\n group = g3;\n } else if (firstLetter >= g4 && firstLetter < g5) {\n group = g4;\n } else {\n // Everything else (including numeric \"words\", e.g., \"2008\") goes in group 5.\n group = g5;\n }\n result.computeIfAbsent(String.valueOf(group), k -> new ArrayList<>()).add(p);\n }\n }\n return result;\n }", "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 }", "public List<Integer> partitionLabels(String S) {\n List<Integer> sizes = new ArrayList<>();\n\n int[] lastIndex = new int[26]; //cuz only lower case letters will be given to us\n\n //finding the lastIndexes of all the characters in the given string so that inside the loop start->end, we don't have to\n //do S.lastIndexOf('someCharacter') over & over cuz if we do that than the solution will be O(n^2) cuz string.lastIndexOf loops\n //through the string everytime it needs to find the last occurance & if the character happens to be at the end of the string\n //than it'll string.lastIndexOf would have to loop through the entire string over and over inside the start->end loop\n for(int i=0; i< S.length(); i++) {\n //subtracting the current character from a that's how we can map the lower case letters to an array of 26 Eg. 'a' -'a' = 0, 'b' -'a' = 1 so on and so forth. Otherwise we can also use an array of length 128 and loop from 97->122 but the array slots from 0->97 & 123->128 will be taking memory for nothing\n lastIndex[S.charAt(i) - 'a'] = i;\n }\n\n int start=0, end = 0, extendedEnd = 0;\n while(start < S.length()) {\n char startCharacter = S.charAt(start);\n end = lastIndex[startCharacter - 'a'];\n extendedEnd = end;\n\n for(int i=start; i<end; i++) {\n\n //checking if the current character that lies in the window start till end has last occurance index that's greater than current end, than we extend end.\n //NOTE: if we don't check the occurance like lastIndex[S.charAt(i)- 'a'] instead we check it like lastIndex[i], we won't be getting correct answer cuz lastIndex[] contains last occurances of characters from a-z\n //the characters in String S might not occur in the order a-z. They'll be jumbled across the string.\n //therefore in order to get the last occurance of current character, we do it like lastIndex[S.charAt(i)- 'a']\n if(lastIndex[S.charAt(i)- 'a'] > end) {\n extendedEnd = lastIndex[S.charAt(i)- 'a'];\n end = extendedEnd;\n }\n }\n\n sizes.add((extendedEnd - start + 1));\n start = extendedEnd + 1;\n }\n\n return sizes;\n }", "private static void createMap()\r\n {\r\n position = new String[8][8];\r\n for(int i=0;i<8;i++)\r\n {\r\n int z=0;\r\n for(int j=72;j>=65;j--)\r\n {\r\n position[i][z]=(char)j+\"\"+(i+1); //uses ascii char placement for letters\r\n z++;\r\n }\r\n }\r\n \r\n }", "public static void groupingByTest3(){\r\n\t\tStream<String> ohMy = Stream.of(\"lions\", \"tigers\", \"tears\",\"tasssss\");\r\n\t\tMap<Integer, Set<String>> map = ohMy.collect(Collectors.groupingBy(String::length, TreeMap::new ,Collectors.toSet()));\r\n\t\tSystem.out.println(map);//{5=[tears, lions], 6=[tigers], 7=[tasssss]}\r\n\t\tSystem.out.println(map.getClass());//class java.util.TreeMap\r\n\t}", "public static void main (String[] args) throws Exception {\n BufferedReader br = new BufferedReader(new InputStreamReader(System.in));\n StringTokenizer st;\n StringBuilder sb = new StringBuilder();\n\n int n=Integer.parseInt(br.readLine());\n st=new StringTokenizer(br.readLine());\n int x0=Integer.parseInt(st.nextToken()),\n y0=Integer.parseInt(st.nextToken());\n ArrayList<Map.Entry<Integer,Character>> ulist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> dlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> llist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> rlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> ullist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> urlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> drlist=new ArrayList<>();\n ArrayList<Map.Entry<Integer,Character>> dllist=new ArrayList<>();\n Comparator asct=new Comparator<Map.Entry<Integer, Character>>() {\n @Override\n public int compare(Map.Entry<Integer, Character> e1, Map.Entry<Integer, Character> e2) {\n return e1.getKey() - e2.getKey();\n }\n };\n Comparator dsct=new Comparator<Map.Entry<Integer, Character>>() {\n @Override\n public int compare(Map.Entry<Integer, Character> e1, Map.Entry<Integer, Character> e2) {\n return e2.getKey() - e1.getKey();\n }\n };\n for (int i=0;i<n;i++){\n st=new StringTokenizer(br.readLine());\n char c=st.nextToken().charAt(0);\n int xi=Integer.parseInt(st.nextToken());\n int yi=Integer.parseInt(st.nextToken());\n if (xi==x0){\n if (yi>y0) ulist.add(new AbstractMap.SimpleEntry<>(yi,c));\n else dlist.add(new AbstractMap.SimpleEntry<>(yi,c));\n } else if (yi==y0){\n if (xi>x0) rlist.add(new AbstractMap.SimpleEntry<>(xi,c));\n else llist.add(new AbstractMap.SimpleEntry<>(xi,c));\n } else if (Math.abs(xi-x0)==Math.abs(yi-y0)){\n if (xi<x0){\n if (yi<y0) dllist.add(new AbstractMap.SimpleEntry<>(xi,c));\n else ullist.add(new AbstractMap.SimpleEntry<>(xi,c));\n } else {\n if (yi<y0) drlist.add(new AbstractMap.SimpleEntry<>(xi,c));\n else urlist.add(new AbstractMap.SimpleEntry<>(xi,c));\n }\n }\n }\n Collections.sort(ulist,asct);\n Collections.sort(dlist,dsct);\n Collections.sort(rlist,asct);\n Collections.sort(llist,dsct);\n Collections.sort(dllist,dsct);\n Collections.sort(ullist,dsct);\n Collections.sort(urlist,asct);\n Collections.sort(drlist,asct);\n //boolean uf,df,lf,rf,ulf,urf,drf,dlf;\n //uf=df=lf=rf=ulf=urf=drf=dlf=false;\n boolean check=false;\n for (int i=0;i<ulist.size();i++){\n char c=ulist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<dlist.size();i++){\n char c=dlist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<llist.size();i++){\n char c=llist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<rlist.size();i++){\n char c=rlist.get(i).getValue();\n if (c=='B') break;\n else check=true;\n }\n for (int i=0;i<dllist.size();i++){\n char c=dllist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n for (int i=0;i<ullist.size();i++){\n char c=ullist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n for (int i=0;i<drlist.size();i++){\n char c=drlist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n for (int i=0;i<urlist.size();i++){\n char c=urlist.get(i).getValue();\n if (c=='R') break;\n else check=true;\n }\n if (check) System.out.println(\"YES\");\n else System.out.println(\"NO\");\n }", "public void getCounts() {\t\r\n\t\t\r\n\t\tfor(int i = 0; i < 4; i++)\r\n\t\t\tfor(int j = 0; j < 3; j++)\r\n\t\t\t\tthecounts[i][j] = 0;\r\n\t\t\r\n\t\tfor(int i=0;i<maps.length-1;i++) {\r\n\t\t\tif(maps.Array1.charAt(i) == 'H' && maps.Array1.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[0][0]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == 'E' && maps.Array1.charAt(i+1) =='-') \r\n\t\t\t\tthecounts[0][1]++;\r\n\t\t\telse if(maps.Array1.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[0][2]++;\r\n\t\t\tif(maps.Array2.charAt(i) == 'H' && maps.Array2.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[1][0]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == 'E' && maps.Array2.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[1][1]++;\r\n\t\t\telse if(maps.Array2.charAt(i) == '-' && maps.Array2.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[1][2]++;\r\n\t\t\tif(maps.Array3.charAt(i) == 'H' && maps.Array3.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[2][0]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == 'E' && maps.Array3.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[2][1]++;\r\n\t\t\telse if(maps.Array3.charAt(i) == '-' && maps.Array3.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[2][2]++;\r\n\t\t\tif(maps.Array4.charAt(i) == 'H' && maps.Array4.charAt(i+1) == 'E')\r\n\t\t\t\tthecounts[3][0]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == 'E'&&maps.Array4.charAt(i+1) == '-') \r\n\t\t\t\tthecounts[3][1]++;\r\n\t\t\telse if(maps.Array4.charAt(i) == '-' && maps.Array1.charAt(i+1) == 'H')\r\n\t\t\t\tthecounts[3][2]++;\r\n\t\t}\r\n\t\t\r\n\t\t//Getting transition value between 1 and 0\r\n\t\tfor(int i=0;i<4;i++) {\r\n\t\t\tfor(int j=0;j<3;j++) {\r\n\t\t\t\tthecounts[i][j]/=maps.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Displaying the obtained values\r\n\t\tSystem.out.println(\"\\nTRANSITION\");\r\n\t\tSystem.out.println(\"HYDROPHOBICITY: 1->2: \" + thecounts[0][0] + \" 2->3: \" + thecounts[0][1] + \" 3->1: \" + thecounts[0][2]);\r\n\t\tSystem.out.println(\"POLARIZABILITY: 1->2: \" + thecounts[1][0] + \" 2->3: \" + thecounts[1][1] + \" 3-1: \" + thecounts[1][2]);\r\n\t\tSystem.out.println(\"POLARITY: 1->2: \" + thecounts[2][0] + \" 2->3: \" + thecounts[2][1] + \" 3->1: \" + thecounts[2][2]);\r\n\t\tSystem.out.println(\"VAN DER WALLS VOLUME: 1->2: \" + thecounts[3][0] + \" 2->3: \" + thecounts[3][1] + \" 3->1: \" + thecounts[3][2]);\r\n\t\t\r\n\t}", "private List<Tuple> charCountMap(Tuple input) {\n \n String[] words = input.snd().replaceAll(\"[^a-zA-Z ]\", \"\").toLowerCase().split(\"\\\\s+\");\n \n List<Tuple> output = new ArrayList<Tuple>();\n \n for(String word : words) {\n Integer chars = word.length();\n output.add(new Tuple(chars.toString(),\"1\"));\n }\n \n lolligag();\n \n //<charCount, 1>, <charCount, 1> ...\n return output;\n }", "private static List<List<String>> groupAnagrams(String[] strs) {\n List<List<String>> result = new ArrayList<List<String>>();\n\n HashMap<Integer, ArrayList<String>> map = new HashMap<Integer, ArrayList<String>>();\n for(String str: strs){\n int key = 0;\n for(int i=0; i<str.length(); i++){\n key = key + (str.charAt(i)-'a');\n }\n\n if(map.containsKey(key)){\n map.get(key).add(str);\n }else{\n ArrayList<String> al = new ArrayList<String>();\n al.add(str);\n map.put(key, al);\n }\n }\n\n result.addAll(map.values());\n\n return result;\n }", "public void countByAlpha() {\n if (super.getInput() == null) {\n return;\n }\n FileInputStream is;\n try {\n is = new FileInputStream(super.getInput());\n NxParser nxp = new NxParser();\n System.out.println(\"Parsing \" + super.getInput() + \"...\");\n nxp.parse(is);\n for (Node[] nx : nxp) {\n String nodeid = nx[0].toString();\n String predicate = nx[1].getLabel();\n if (!PredicateUtils.isSchemaOrgEvent(predicate)) {\n continue;\n }\n predicate = PredicateUtils.fixSchemaOrg(predicate);\n if (!ATTR.equalsIgnoreCase(PredicateUtils.getEventProperty(predicate))) {\n continue;\n }\n String obj = nx[2].getLabel();\n obj = NGramUtils.removePunctuaion(obj);\n int length = obj.length();\n Integer count = mapEvents.get(nodeid);\n mapEvents.put(nodeid, (count == null ? length : count + length));\n Integer countLength = mapLengths.get(String.valueOf(length));\n mapLengths.put(String.valueOf(length), (countLength == null ? 1 : countLength + 1));\n }\n System.out.println(\"The total number of lines: \" + nxp.lineNumber());\n System.out.println(\"The total number of events: \" + mapEvents.size());\n System.out.println(\"Start sorting mapEvents...\");\n Map<String, Integer> mapEvent = VectorUtils.sortByValue(mapEvents, VectorUtils.SortBy.DESC);\n FileUtils.writeMapdataToFile(this.getOutput(\"event\"), mapEvent);\n System.out.println(\"Start sorting mapLengths...\");\n Map<String, Integer> mapLength = VectorUtils.sortByValue(mapLengths, VectorUtils.SortBy.DESC);\n FileUtils.writeMapdataToFile(this.getOutput(\"length\"), mapLength);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public List<List<String>> groupAnagrams_var2(String[] strs) {\n Map<Map<Character, Integer>, List<String>> map = new HashMap<>();\n for (String currStr : strs) {\n Map<Character, Integer> currMap = new HashMap<>();\n for (int i = 0; i < currStr.length(); i++)\n currMap.put(currStr.charAt(i), currMap.getOrDefault(currStr.charAt(i), 0) + 1);\n map.computeIfAbsent(currMap, k -> new LinkedList<>()).add(currStr);\n }\n\n return new LinkedList<>(map.values());\n }", "public static int[][] fillMap(List<String> lines){\n int[][] map=new int[lines.size()][lines.get(0).length()];\n //find values of each spot\n for(int i=0;i<lines.size();i++){\n for(int j=0;j<lines.get(i).length();j++){\n char c=lines.get(i).charAt(j);\n switch (c) {\n case '_': //empty\n map[i][j]=0;\n break;\n case 'B': //Blue\n map[i][j]=1;\n break;\n case 'A': //Cyan\n map[i][j]=2;\n break;\n case 'W': //white\n map[i][j]=3;\n break;\n case 'R': //red\n map[i][j]=4;\n break;\n case 'P': //pink\n map[i][j]=5;\n break;\n case 'D': //magenta\n map[i][j]=6;\n break;\n case 'O': //orange\n map[i][j]=7;\n break;\n case 'G': //Green\n map[i][j]=8;\n break;\n case 'Y': //Yellow\n map[i][j]=9;\n break;\n case 'K': //Seafoam\n map[i][j]=10;\n break;\n case 'Q': //purple\n map[i][j]=11;\n break;\n default:\n map[i][j]=12; //shouldn't happen\n break;\n }\n }\n }\n return map;\n }", "private TreeMap<String, ArrayList<String>> fillLists (char guess) {\r\n \t//Tree Map to Return\r\n \tTreeMap <String, ArrayList<String>> lists = new TreeMap<String, ArrayList<String>>();\r\n \t\r\n \t//Loop through the Active Words\r\n \tfor (int word = 0; word < activeWords.size(); word ++) {\r\n \t\tStringBuilder currentPattern = new StringBuilder();\r\n \t\t//Use existing pattern as base\r\n \t\tcurrentPattern.append(pattern);\r\n \t\t\r\n \t\t//New pattern is created based on each Active Word's relation to guess\r\n \t\tfor (int letter = 0; letter < activeWords.get(word).length(); letter++) {\r\n \t\t\t//If match, update pattern\r\n \t\t\tif (activeWords.get(word).charAt(letter) == guess) {\r\n \t\t\t\tcurrentPattern.setCharAt(letter, guess);\r\n \t\t\t}\r\n \t\t}\t\r\n \t\t//Convert Builder to String here for simplicity\r\n \t\tString newPattern = currentPattern.toString();\r\n \t\t\r\n \t\t//Each temp is the ArrayList of words for each pattern\r\n \t\tArrayList <String> temp = new ArrayList <String>();\r\n \t\t//Below takes into account if this key's list already has other words in it.\r\n \t\tif (lists.containsKey(newPattern)) {\r\n \t\t\ttemp = lists.get(newPattern);\r\n \t\t}\t\r\n \t\t\r\n \t\t//Add current word\r\n\t\t\ttemp.add(activeWords.get(word));\r\n\t\t\t//Add updated list to key (pattern created)\r\n\t\t\tlists.put(newPattern, temp);\r\n \t} \t\r\n \treturn lists;\r\n }", "private static Map<String, List<String>> getCustomStringStructure(@NotNull String s) {\n String[] arr = s.split(\" \");\n // the storage\n Map<String, List<String>> map = new TreeMap<>();\n // put the first element in the storage\n List<String> l = new ArrayList<>();\n l.add(arr[0]);\n map.put(arr[0].substring(0, 1), l);\n\n for (int i = 1; i < arr.length; i++) {\n String sub = arr[i].substring(0, 1);\n // if map contains key put String arr[i] in the List\n if (map.containsKey(sub)) {\n map.get(sub).add(arr[i]);\n } else {\n // if not put first letter as a key and arr[i] as a value in the map\n List<String> list = new ArrayList<>();\n list.add(arr[i]);\n map.put(sub, list);\n }\n }\n\n // sort by size, by string's length and alphabetically\n Map<String, List<String>> collect = map.entrySet()\n .stream()\n .filter(k -> k.getValue().size() > 1)\n .collect(Collectors.toMap(\n Map.Entry::getKey,\n e -> e.getValue().stream().sorted((o1, o2) -> {\n if (o2.length() != o1.length()) {\n return o2.length() - o1.length();\n } else {\n return o1.compareTo(o2);\n }\n })\n .collect(Collectors.toList())\n ));\n\n // return TreeMap to sort keys\n return new TreeMap<>(collect);\n }", "public static Map<Integer, TreeSet<Character>> buildT9Map() {\n Map<Integer, TreeSet<Character>> mapOfT9 = new HashMap<Integer, TreeSet<Character>>();\n \n mapOfT9.put(2, new TreeSet<Character>(Arrays.asList('a', 'b', 'c')));\n mapOfT9.put(3, new TreeSet<Character>(Arrays.asList('d', 'e', 'f')));\n mapOfT9.put(4, new TreeSet<Character>(Arrays.asList('g', 'h', 'i')));\n mapOfT9.put(5, new TreeSet<Character>(Arrays.asList('j', 'k', 'l')));\n mapOfT9.put(6, new TreeSet<Character>(Arrays.asList('m', 'n', 'o')));\n mapOfT9.put(7, new TreeSet<Character>(Arrays.asList('p', 'q', 'r', 's')));\n mapOfT9.put(8, new TreeSet<Character>(Arrays.asList('t', 'u', 'v')));\n mapOfT9.put(9, new TreeSet<Character>(Arrays.asList('w', 'x', 'y', 'z')));\n \n return mapOfT9;\n }", "private TreeMap<Character, Character> generateMap() {\r\n this.charMap = new TreeMap<Character, Character>();\r\n // generates an array of characters representing the alphabet\r\n char[] alphabet = \"abcdefghijklmnopqrstuvwxyz\".toCharArray();\r\n\r\n for (int i=0; i<26; i++) {\r\n this.charMap.put(alphabet[i], alphabet[(i+key) % 26]);\r\n }\r\n\r\n return this.charMap;\r\n }", "public int getGroup(char letter);", "public static void main(String args[]) throws Exception{\n Pattern patron = Pattern.compile(\"\\\\s+\");\n\n //leer todas las lineas del archivo\n Stream<String> lineas = Files.lines(Paths.get(\"./data/alicia.txt\"),StandardCharsets.ISO_8859_1);\n\n //eliminamos signos de puntuacion\n Stream<String> lineasProcesadas = lineas.map(linea -> linea.replaceAll(\"(?!')\\\\p{Punct}\", \"\"));\n\n //trocear las lineas para tratar con palabras\n\n Stream<String> palabras = lineasProcesadas.flatMap(linea -> patron.splitAsStream(linea));\n\n //filtrar palabras vacias\n\n Stream<String> sinVacias = palabras.filter(palabra -> !palabra.isEmpty());\n\n // generar un diccionario con entradas tipo <palabra, numero de ocurrencias>\n // queremos que el diccionario sea tipo TreeMap\n\n TreeMap<String,Long> mapa = sinVacias.collect(Collectors.groupingBy(String::toLowerCase, TreeMap::new,Collectors.counting()));\n\n\n //Ahora todo compactado\n\n TreeMap<String,Long> mapa2 = Files.lines(Paths.get(\"./data/alicia.txt\"),StandardCharsets.ISO_8859_1).\n map(linea -> linea.replaceAll(\"(?!')\\\\p{Punct}\", \"\")).\n flatMap(linea -> patron.splitAsStream(linea)).\n filter(palabra -> !palabra.isEmpty()).\n collect(Collectors.groupingBy(String::toLowerCase, TreeMap::new,Collectors.counting()));\n\n\n mapa2.forEach(\n (palabra, numero) -> System.out.println(palabra + \" : \" + numero)\n );\n\n //Con esto pedo crear un stream\n //mapa2.entrySet().stream().forEach();\n\n\n //agrupamiento por inicales, todas las palabras con dicha inicial y contadores\n\n TreeMap<Character, List<Map.Entry<String,Long>>> mapa3 = mapa2.\n entrySet().\n stream().\n collect(Collectors.groupingBy(entrada -> entrada.getKey().charAt(0),TreeMap::new,Collectors.toList()));\n\n mapa3.forEach((inicial,listaPalabras) -> {\n System.out.printf(\"%n%c%n\", inicial);\n listaPalabras.stream().forEach( entrada -> {\n System.out.printf(\"%13s: %d%n\", entrada.getKey(), entrada.getValue());\n });\n });\n\n\n\n\n }", "private void calculateNGrams() {\n\t\t\n\t\t\n\t\t// determine n grams\n\t\tSet<Suffix> cityNames = properties.getCityNames();\n\t\tfor (Suffix cityName : cityNames) {\n\t\t\tString str = cityName.getStr();\n\t\t\tchar[] letters = new char[str.length()+4];\n\t\t\tletters[0] = sow;\n\t\t\tletters[1] = sow;\n\t\t\tletters[letters.length-2] = eow;\n\t\t\tletters[letters.length-1] = eow;\t\t\t\n\t\t\tstr.getChars(0, str.length(), letters, 2);\n\t\t\t\n\t\t\t// iterate over the letters of a city name\n\t\t\tfor (int i=2; i<letters.length; i++) {\n\t\t\t\t// 1: letter distribution (eow's are ignored)\n\t\t\t\tif (i < letters.length - 2) {\n\t\t\t\t\tInteger oldValueLetter = this.letterDistribution.get(letters[i]);\n\t\t\t\t\tif (oldValueLetter == null)\t\t\t\t\t\n\t\t\t\t\t\tthis.letterDistribution.put(letters[i], 1); // add the the new letter to the distribution\n\t\t\t\t\telse\t\t\t\t\t\n\t\t\t\t\t\tthis.letterDistribution.put(letters[i], oldValueLetter + 1); // increment counter\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// 2: bigram distribution ([eow, eow] is ignored)\n\t\t\t\tif (i < letters.length - 1) {\n\t\t\t\t\tchar[] bigramArray = {letters[i-1], letters[i]};\n\t\t\t\t\tString bigram = String.copyValueOf(bigramArray);\n\t\t\t\t\tInteger oldValueBigram = this.bigramDistribution.get(bigram);\n\t\t\t\t\tif (oldValueBigram == null)\n\t\t\t\t\t\tthis.bigramDistribution.put(bigram, 1); // add the new bigram to the distribution\n\t\t\t\t\telse\n\t\t\t\t\t\tthis.bigramDistribution.put(bigram, oldValueBigram + 1); // increment counter\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t// 3: trigram distribution\n\t\t\t\tchar[] trigramArray = {letters[i-2], letters[i-1], letters[i]};\n\t\t\t\tString trigram = String.copyValueOf(trigramArray);\n\t\t\t\tInteger oldValueTrigram = this.trigramDistribution.get(trigram);\n\t\t\t\tif (oldValueTrigram == null)\n\t\t\t\t\tthis.trigramDistribution.put(trigram, 1); // add the new trgram to the distribution\n\t\t\t\telse\n\t\t\t\t\tthis.trigramDistribution.put(trigram, oldValueTrigram + 1); // increment counter\n\t\t\t\t\n\t\t\t} // end iteration over letters\n\t\t\t\n\t\t\tthis.numberLetterTokens += str.length();\n\t\t\tthis.numberBigramTokens += str.length() + 1;\n\t\t\tthis.numberTrigramTokens += str.length() + 2;\n\t\t} // end iteration over city names\n\t}", "private void start(Substring sub) {\n\t\tint i=0,j=0,k=0,l=0,m=0,n=0,sum=sub.n;\n\t\tfor(i=1;i<sub.n;i++)\n\t\t{\n\t\t\tfor(j=0,l=i;l<sub.n;j++,l++)\n\t\t\t{\n\t\t\t\t//HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();\n\t\t\t\tint[]count=new int[10000];\n\t\t\t\t\t\tfor(m=j;m<=l;m++) {\n\t\t\t\t\t\t\tcount[sub.arr[m]]++;\n\t\t\t\t\t\t\tif(count[sub.arr[m]]<=1) {continue;}\n\t\t\t\t\t\t\telse break;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\tif(m==l+1)sum=sum+i+1;\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(sum);\n\t\t\n\t}", "private static Map<Character, Integer> createKey(String subString) {\n Map map = new HashMap<Character, Integer>();\n for (int i = 0; i < subString.length(); i++) {\n Character c = subString.charAt(i);\n\n if (map.containsKey(c)) {\n int count = (int) map.get(c);\n map.put(c, ++count);\n } else {\n map.put(c, 1);\n }\n }\n return map;\n }", "private void createAA() {\r\n\r\n\t\tfor( int x = 0 ; x < dnasequence.size(); x++) {\r\n\t\t\tString str = dnasequence.get(x);\r\n\t\t\t//put catch for missing 3rd letter\r\n\t\t\tif(str.substring(0, 1).equals(\"G\")) {\r\n\t\t\t\taasequence.add(getG(str));\r\n\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"C\")) {\r\n\t\t\t\taasequence.add(getC(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"A\")) {\r\n\t\t\t\taasequence.add(getA(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0, 1).equals(\"T\")) {\r\n\t\t\t\taasequence.add(getT(str));\r\n\t\t\t\t\r\n\t\t\t}else if(str.substring(0,1).equals(\"N\")) {\r\n\t\t\t\taasequence.add(\"ERROR\");\r\n\t\t\t}else\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t}\r\n\t}", "private static Map<Character, Set<Character>> genLessMap(String[] words) throws Exception {\n Map<Character, Set<Character>> map = new HashMap<>();\n for (int i = 1; i < words.length; i ++) {\n String a = words[i - 1];\n String b = words[i];\n boolean allEqual = true;\n for (int j = 0; j < a.length() && j < b.length(); j ++) {\n if (a.charAt(j) == b.charAt(j))\n continue;\n allEqual = false;\n Set<Character> sb = map.get(a.charAt(j));\n if (sb == null) {\n sb = new HashSet<Character>();\n map.put(a.charAt(j), sb);\n }\n sb.add(b.charAt(j));\n break;\n }\n if (allEqual && a.length() > b.length())\n throw new Exception(\"Invalid.\");\n }\n return map;\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}", "public static void hashMapEx() {\n\t\tString str = \"habiletechE\";\n\t\tstr = str.toLowerCase();\n\t\tchar[] ch = str.toCharArray();\n\t\tint size = ch.length;\n\n\t\tHashMap<Character, Integer> hmap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (!hmap.containsKey(ch[i]))\n\t\t\t\thmap.put(ch[i], 1);\n\t\t\telse {\n\t\t\t\tint val = hmap.get(ch[i]) + 1;\n\t\t\t\thmap.put(ch[i], val);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Duplicate Charaacters :\");\n\t\tfor (Map.Entry<Character, Integer> hm : hmap.entrySet()) {\n\t\t\tif (hm.getValue() > 1)\n\t\t\t\tSystem.out.println(hm.getKey() + \" \" + hm.getValue());\n\t\t}\n\t}", "private void addAllComposedGlyphsToSubset() {\n int newIndex = this.subset.size();\n for (final int composedGlyph : this.composedGlyphs) {\n this.subset.put(composedGlyph, newIndex++);\n }\n }", "private void treeMapDemo() {\n TreeMap intMap = new TreeMap();\n TreeMap abcMap = new TreeMap();\n \n // Add values to tMap\n intMap.put(1, \"Jonathan\");\n intMap.put(3, \"Kevin\");\n intMap.put(4, \"Craig\");\n \n abcMap.put(\"Name\", \"Jonathan\");\n abcMap.put(\"Age\", 26);\n abcMap.put(\"Hometown\", \"Denham Springs\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n // Add new value to fill the 2 position\n intMap.put(2, \"Jasmine\");\n \n // Add new value to abcMap\n abcMap.put(\"Acrobatic Skill\", \"Bad\");\n abcMap.put(\"Zoology Skill\", \"Decent\");\n \n System.out.println(intMap.toString());\n \n System.out.println(abcMap.toString());\n \n }", "private void fillActiveLevels() \n\t{\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor(int i=0;i<level[0].length+2;i++){\n\t\t\tsb.append(\"-\");\n\t\t}\n\t\tString lineStartEnd = sb.toString();\n\t\tchar[] startEnd = lineStartEnd.toCharArray();\n\t\tlevelActive[0] = startEnd;\n\t\tlevelActive[levelActive.length-1] = startEnd;\n\t\tfor (int i = 1; i <= level.length; i++) \n\t\t{\n\t\t\tlevelActive[i][0] = '-';\n\t\t\tSystem.arraycopy(level[i - 1], 0, levelActive[i], 1, level[0].length);\n\t\t\tlevelActive[i][level[0].length+1] = '-';\n\t\t}\n\t}", "public static void groupingByTest2(){\r\n\t\tStream<String> ohMy = Stream.of(\"lions\", \"tigers\", \"tears\",\"tasssss\");\r\n\t\tMap<Integer, Set<String>> map = ohMy.collect(Collectors.groupingBy(String::length, Collectors.toSet()));\r\n\t\tSystem.out.println(map);//{5=[tears, lions], 6=[tigers], 7=[tasssss]}\r\n\t\tSystem.out.println(map.getClass());//class java.util.HashMap\r\n\t}", "@Override\n public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {\n ArrayList<String> cache = new ArrayList<String>();\n String groupId = \"\";\n String earlist = \"\";\n int earlistTime = 999999;\n int latestTime = 0;\n for (Text e : values) {\n cache.add(e.toString());\n String[] input = e.toString().split(\",\");\n int time = Integer.parseInt(input[1]);\n //find the eaelistTime and latestTime of Typhoon\n if (time < earlistTime)\n earlistTime = time;\n if (time > latestTime)\n latestTime = time;\n }\n\n for (String e : cache) {\n String[] input1 = e.split(\",\");\n if (Integer.parseInt(input1[1]) == earlistTime) {\n String[] coordE = input1[2].trim().split(\"\\\\s+\");\n double tyLatE = Double.parseDouble(coordE[0]);\n double tyLngE = Double.parseDouble(coordE[2]);\n //if the start point of typhoon is west of 123E, then it may be group 2 or group 3\n if (tyLngE < 123) {\n for (String s : cache) {\n String[] input2 = s.split(\",\");\n if (Integer.parseInt(input2[1]) == latestTime) {\n String[] coordL = input2[2].trim().split(\"\\\\s+\");\n double tyLatL = Double.parseDouble(coordL[0]);\n double tyLngL = Double.parseDouble(coordL[2]);\n //if the end point of typhoon is west of 115E, then it belongs to group 3\n if (tyLngL < 115)\n groupId = \"3\";\n //if the end point of typhoon is east of 115E, then it belongs to group 2\n if (tyLngL > 115)\n groupId = \"2\";\n }\n }\n }\n //if the start point of typhoon is east of 123E, then it may be group 2 or group 3\n if (tyLngE > 123)\n groupId = \"1\";\n }\n }\n for (String e : cache) {\n context.write(null, new Text(groupId + \",\" + e));\n }\n\n }", "protected void storeLetterPositions () {\n letterLocations.clear();\n\n for (int row = 0; row < height; row++) {\n for (int col = 0; col < length; col++) {\n char c = board[row][col];\n if (letterLocations.containsKey(c)) {\n letterLocations.get(c).add(new ImmutablePair<>(row, col));\n } else {\n letterLocations.put(c, new HashSet<>(Arrays.asList(new ImmutablePair<>(row, col))));\n }\n }\n }\n }", "public void processFile(File rootFile) throws IOException {\n\t\tBufferedReader bf=new BufferedReader(new FileReader(rootFile));\r\n\t\tString lineTxt = null;\r\n\t\tint pos=1;\r\n\t\twhile((lineTxt = bf.readLine()) != null){\r\n String[] line=lineTxt.split(\" \");\r\n// System.out.println(line[0]);\r\n String hscode=line[0];\r\n \r\n \r\n TreeMap<String,Integer> word=null;\r\n if(!map.containsKey(hscode)){\r\n word=new TreeMap<String,Integer>();\r\n for(int i=1;i<line.length;i++){\r\n \tString key=line[i];\r\n \tif (word.get(key)!=null){\r\n \t\tint value= ((Integer) word.get(key)).intValue();\r\n \t\tvalue++;\r\n \t\tword.put(key, value);\r\n \t}else{\r\n \t\tword.put(key, new Integer(1));\r\n \t}\r\n }\r\n map.put(hscode, word);\r\n }\r\n else{\r\n //\tSystem.out.println(\"sss\");\r\n \tword = map.get(hscode);\r\n \tfor(int i=1;i<line.length;i++){\r\n \t\tString key=line[i];\r\n \tif (word.get(key)!=null){\r\n \t\tint value= ((Integer) word.get(key)).intValue();\r\n \t\tvalue++;\r\n \t\tword.put(key, value);\r\n \t}else{\r\n \t\tword.put(key, new Integer(1));\r\n \t}\r\n \t}\r\n \t\r\n \tmap.put(hscode, word);\r\n \t\r\n }\r\n\t\t}\r\n\t\tbf.close();\r\n//\t\tfor(Entry<String, TreeMap<String, Integer>> entry:map.entrySet()){\r\n//// \tSystem.out.println(\"hscode:\"+entry.getKey());\r\n// \tTreeMap<String, Integer> value = entry.getValue();\r\n// \tfor(Entry<String,Integer> e:value.entrySet()){\r\n//// \tSystem.out.println(\"单词\"+e.getKey()+\" 词频是\"+e.getValue());\r\n// \t}\r\n// }\r\n\t}", "private static void addEntriesToMap(\n\t\tMap<Character,Integer> map,String toSort, String poolOfOccurances\n\t\t){\n\n\t\t//Loop the toStort\n\t\tfor(int i=0;i<toSort.length();i++){\n\t\t\tmap.put(toSort.charAt(i),new Integer(getCharacterFrequence(toSort.charAt(i),poolOfOccurances)));\n\t\t}\n\n\t}", "public static Hashtable<Integer, Integer> BuildSectionForPositionMap(Passagem[] passagens)\n {\n Hashtable results = new Hashtable<Integer, Integer>();\n TreeSet<String> used = new TreeSet<>();\n int section = -1;\n\n if(passagens != null) {\n for (int i = 0; i < passagens.length; i++) {\n String letter = passagens[i].getNome().substring(0, 1);\n\n if (!used.contains(letter)) {\n section++;\n used.add(letter);\n }\n\n results.put(i, section);\n }\n }\n return results;\n }", "public static void cuentaLetras(char[] c)\n{\n for(int k=0; k < c.length; k++)\n {\n char currentChar = c[k]; \n //to check that currentChar is not in map, if not will add 1 count for firsttime\n if(map1.get(currentChar) == null){\n map1.put(currentChar, 1); \n } \n /*If it is repeating then simply we will increase the count of that key(character) by 1*/\n else {\n map1.put(currentChar, map1.get(currentChar) + 1);\n }\n } //todo el parrafo\n\n}", "private void genRunwayName(Group root, String runwayId, Integer helperHeight){\n Point runwayPos = controller.getRunwayPos(runwayId);\n Dimension runwayDim = controller.getRunwayDim(runwayId);\n\n //text color and text font\n javafx.scene.text.Font font = new javafx.scene.text.Font(\"SansSerif\", runwayDim.height/2);\n Color fontColor = convertToJFXColour(Settings.RUNWAY_NAME_COLOUR);\n\n // rotate to make the string flat on the runway\n Rotate flatRotation = new Rotate(-90,0,-1,0, Rotate.X_AXIS);\n\n //offset for the id\n Integer idOffset = 16;\n //offset for the letter;\n Double letterOffset = 30.5;\n //offset for putting the letter which has a smaller font higher\n Integer letterHeightOffset = 10;\n\n if(runwayId.length() == 2){\n Text text = new Text(runwayId);\n text.setFill(fontColor);\n text.setFont(font);\n text.setTranslateX(runwayPos.x - runwayDim.height/2 + idOffset);\n text.setTranslateZ(-runwayPos.y + runwayNameOffset);\n text.setTranslateY(-helperHeight);\n\n Rotate rotate = new Rotate(controller.getBearing(runwayId), runwayDim.height/2 - idOffset,0, -runwayNameOffset, Rotate.Y_AXIS);\n text.getTransforms().add(rotate);\n text.getTransforms().add(flatRotation);\n\n text.setCache(true);\n text.setCacheHint(CacheHint.QUALITY);\n root.getChildren().add(text);\n\n }else{\n Text newRunwayId = new Text(runwayId.substring(0,2));\n newRunwayId.setFill(fontColor);\n newRunwayId.setFont(font);\n Text letter = new Text(runwayId.charAt(2) + \"\");\n letter.setFill(fontColor);\n letter.setFont(new javafx.scene.text.Font(\"SansSerif\", runwayDim.height/2-10));\n\n newRunwayId.setTranslateX(runwayPos.x - runwayDim.height/2 + idOffset);\n newRunwayId.setTranslateZ(-runwayPos.y + runwayNameOffset);\n newRunwayId.setTranslateY(-helperHeight);\n\n Rotate IdRotate = new Rotate(controller.getBearing(runwayId), runwayDim.height/2 - idOffset,0, - runwayNameOffset, Rotate.Y_AXIS);\n newRunwayId.getTransforms().add(IdRotate);\n\n letter.setTranslateX(runwayPos.x - runwayDim.height/2 + letterOffset);\n letter.setTranslateZ(-runwayPos.y + runwayNameOffset - runwayDim.height/2 + letterHeightOffset);\n letter.setTranslateY(-helperHeight);\n\n Rotate letterRotate = new Rotate(controller.getBearing(runwayId), runwayDim.height/2 - letterOffset,0, - runwayNameOffset + runwayDim.height/2 - letterHeightOffset, Rotate.Y_AXIS);\n letter.getTransforms().add(letterRotate);\n\n newRunwayId.getTransforms().add(flatRotation);\n letter.getTransforms().add(flatRotation);\n\n newRunwayId.setCache(true);\n newRunwayId.setCacheHint(CacheHint.QUALITY);\n\n letter.setCache(true);\n letter.setCacheHint(CacheHint.QUALITY);\n\n root.getChildren().add(newRunwayId);\n root.getChildren().add(letter);\n }\n }", "public static void main(String[] args) throws FileNotFoundException {\n\r\n\t\tRandom random = new Random();\r\n\t\tMap<String, String[][]> mapTM = new HashMap<String, String[][]>();\r\n\t\tMap<String, List<String>> map = new HashMap<String, List<String>>();\r\n\r\n\t\tArrayList<String> list1 = new ArrayList<String>();\r\n\t\tlist1.add(\"T\");\r\n\t\tlist1.add(\"E\");\r\n\t\tlist1.add(\"M\");\r\n\t\tlist1.add(\"P\");\r\n\t\tlist1.add(\"C\");\r\n\t\tlist1.add(\"SS\");\r\n\r\n\t\tArrayList<String> list2 = new ArrayList<String>();\r\n\t\tlist2.add(\"T\");\r\n\t\tlist2.add(\"E\");\r\n\t\tlist2.add(\"M\");\r\n\t\tlist2.add(\"P\");\r\n\t\tlist2.add(\"C\");\r\n\t\tlist2.add(\"SS\");\r\n\r\n\t\tArrayList<String> list3 = new ArrayList<String>();\r\n\t\tlist3.add(\"T\");\r\n\t\tlist3.add(\"E\");\r\n\t\tlist3.add(\"M\");\r\n\t\tlist3.add(\"P\");\r\n\t\tlist3.add(\"C\");\r\n\t\tlist3.add(\"SS\");\r\n\t\t\r\n\t\tArrayList<String> list4 = new ArrayList<String>();\r\n\t\tlist4.add(\"T\");\r\n\t\tlist4.add(\"Ex\");\r\n\t\tlist4.add(\"M\");\r\n\t\tlist4.add(\"Px\");\r\n\t\tlist4.add(\"C\");\r\n\t\tlist4.add(\"ScS\");\r\n\r\n\t\tArrayList<String> list5 = new ArrayList<String>();\r\n\t\tlist5.add(\"Tf\");\r\n\t\tlist5.add(\"E\");\r\n\t\tlist5.add(\"M\");\r\n\t\tlist5.add(\"Pd\");\r\n\t\tlist5.add(\"C\");\r\n\t\tlist5.add(\"SS\");\r\n\r\n\t\tArrayList<String> list6 = new ArrayList<String>();\r\n\t\tlist6.add(\"Tf\");\r\n\t\tlist6.add(\"E\");\r\n\t\tlist6.add(\"Mf\");\r\n\t\tlist6.add(\"P\");\r\n\t\tlist6.add(\"Cd\");\r\n\t\tlist6.add(\"SS\");\r\n\r\n\t\tmap.put(\"C1\", list1);\r\n\t\tmap.put(\"C2\", list2);\r\n\t\tmap.put(\"C3\", list3);\r\n\t\tmap.put(\"C4\", list4);\r\n\t\tmap.put(\"C5\", list5);\r\n\t\tmap.put(\"C6\", list6);\r\n\t\t\r\n\t\tList<String> keys = new ArrayList<String>(map.keySet());\r\n\t\tCollections.shuffle(keys);\r\n\r\n\t\tfor (Object string : keys) {\r\n\t\t\tint row = 6;\r\n\t\t\tint column = 8;\r\n\t\t\tint i = 0;\r\n\t\t\tint j = 0;\r\n\t\t\tboolean reset =false;\r\n\t\t\tString[][] stringArray = new String[row][column];\r\n\t\t\tList<String> temp = map.get(string);\r\n\t\t\tCollections.shuffle(temp);\r\n\t\t\tfor (int iterator = 0; iterator < column; iterator++) {\r\n\t\t\t\t\r\n\t\t\t\tif(iterator >= temp.size()){\r\n\t\t\t\t\tint randomInteger = random.nextInt(temp.size());\r\n\t\t\t\t\tstringArray[i][j] = temp.get(randomInteger);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tstringArray[i][j] = temp.get(iterator);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor(Object string01 : keys){\r\n\t\t\t\t\tif(mapTM.get(string01) != null && !string01.equals(string)){\r\n\t\t\t\t\t\tString[][] temp01 = mapTM.get(string01);\r\n\t\t\t\t\t\tif(temp01[i][j] != null && temp01[i][j].equals(stringArray[i][j])){\r\n\t\t\t\t\t\t\tj = 0;\r\n\t\t\t\t\t\t\tCollections.shuffle(temp);\r\n\t\t\t\t\t\t\titerator = -1;\r\n\t\t\t\t\t\t\treset = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(reset){\r\n\t\t\t\t\treset = false;\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (j < column && j != column - 1) {\r\n\t\t\t\t\tj++;\r\n\t\t\t\t} else if (j == column - 1 && i != row - 1) {\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tj = 0;\r\n\t\t\t\t\tCollections.shuffle(temp);\r\n\t\t\t\t\titerator = -1;\r\n\t\t\t\t} else if (j == column - 1 && i == row - 1) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tmapTM.put((String) string, stringArray);\r\n\t\t}\r\n\t\t\r\n\t\tfor (Map.Entry<String, String[][]> entry : mapTM.entrySet()) {\r\n\t\t\tSystem.out.println(entry.getKey());\r\n\t\t\tSystem.out.println(Arrays.deepToString(entry.getValue()));\r\n\t\t}\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\t\n\t\t\tString input=\"ABCGRETCABCG\";\n\t\t\tint n = 3;\n\t\t\t\n\t\t\tMap<String,Integer> substrMap=new HashMap<String,Integer>();\n\t\t\t\n\t\t\tfor(int i=0;i+n<=input.length();i++){\n\t\t\t\t\n\t\t\t\tString substr=input.substring(i, i+n);\n\t\t\t\t\n\t\t\t\tint frequency=1;\n\t\t\t\t\n\t\t\t\tif(substrMap.containsKey(substr)){\n\t\t\t\t\t\n\t\t\t\t\tfrequency=substrMap.get(substr);\n\t\t\t\t\tfrequency++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsubstrMap.put(substr, frequency);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(substrMap.toString());\n\t\t}", "public static Hashtable<Integer, Integer> BuildPositionForSectionMap(Passagem[] passagens)\n {\n Hashtable results = new Hashtable<Integer, Integer>();\n TreeSet<String> used = new TreeSet<>();\n int section = -1;\n\n if(passagens != null) {\n for (int i = 0; i < passagens.length; i++) {\n String letter = passagens[i].getNome().substring(0, 1);\n\n if (!used.contains(letter)) {\n section++;\n used.add(letter);\n results.put(section, i);\n }\n }\n }\n return results;\n }", "private static Map countStringOccurences(String[] strArray, AdminJdbcService adminJdbcService) {\n logger.debug(\"Count String Occurences method found\");\n\n Map<String, Integer> countMap = new TreeMap<String, Integer>();\n Map<String, Integer> controlIdsMap = new TreeMap<String, Integer>();\n Set<String> controlIdsSet = new TreeSet<String>();\n Set<String> keySet = countMap.keySet();\n List list = new ArrayList();\n\n for (String string : strArray) {\n String control[] = string.split(\":\");\n if ( !Utils.isNullOrEmpty(control[1]) && Integer.parseInt(control[1].trim()) == 2 ) {\n if (!countMap.containsKey(control[0])) {\n countMap.put(control[0], 1);\n } else {\n Integer count = countMap.get(control[0]);\n count = count + 1;\n countMap.put(control[0], count);\n }\n }\n }\n\n\n return countMap;\n }", "public String alienOrder(String[] words) {\n // HashMap to maintain the map relationship between letters\n HashMap<Character, HashSet<Character>> hashMap = new HashMap<Character, HashSet<Character>>();\n // Store the indegree of each letter\n HashMap<Character, Integer> degree = new HashMap<Character, Integer>();\n StringBuilder ret = new StringBuilder();\n if (words == null || words.length < 1) return ret.toString();\n\n // Init indegree for every letter\n for (int i = 0; i < words.length; i++) {\n String word = words[i];\n for (int j = 0; j < word.length(); j++) {\n degree.put(word.charAt(j), 0);\n }\n }\n\n // Build graph\n for (int i = 0; i < words.length - 1; i++) {\n String currentWord = words[i];\n String nextWord = words[i + 1];\n int diffCharIndex = 0;\n int minLength = Math.min(currentWord.length(), nextWord.length());\n while (diffCharIndex < minLength && currentWord.charAt(diffCharIndex) == nextWord.charAt(diffCharIndex))\n diffCharIndex++;\n if (diffCharIndex < minLength) {\n Character currentChar = currentWord.charAt(diffCharIndex);\n Character nextChar = nextWord.charAt(diffCharIndex);\n // Add next letter to the map of current letter\n HashSet<Character> setForCurrentLetter = hashMap.get(currentChar);\n if (setForCurrentLetter == null) {\n setForCurrentLetter = new HashSet<Character>();\n }\n if (!setForCurrentLetter.contains(nextChar)) {\n setForCurrentLetter.add(nextChar);\n hashMap.put(currentChar, setForCurrentLetter);\n // Add 1 to next letter's indegree\n degree.put(nextChar, degree.get(nextChar) + 1);\n }\n }\n }\n\n Queue<Character> queue = new LinkedList<Character>();\n for (Character c: degree.keySet()) {\n if (degree.get(c) == 0) {\n queue.add(c);\n }\n }\n while (!queue.isEmpty()) {\n Character c = queue.poll();\n ret.append(c);\n\n HashSet<Character> setForCurrentChar = hashMap.get(c);\n if (setForCurrentChar != null) {\n for (Character ch: setForCurrentChar) {\n int indegree = degree.get(ch);\n degree.put(ch, indegree - 1);\n if (indegree - 1 == 0) {\n queue.add(ch);\n }\n }\n }\n }\n String retString = ret.toString();\n if (retString.length() != degree.size()) return \"\";\n return retString;\n }", "public void generatePositionGroups(){\n for (int i = 0; i < Input.length()+1; i++){\n PositionGroup pg = generatePositionGroupAt(i);\n PositionGroupList.add(pg);\n }\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tString s =\"hhpddlnnsjfoyxpciioigvjqzfbpllssuj\";\r\n\t\tint noOfChange=0;\r\n\t\r\n\t\t\r\n\t\tif(s.length()%2!=0){\r\n\t\t\t\r\n\t\t\tnoOfChange=-1;\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\tString sub1=s.substring(0, (s.length()/2));\r\n\t\t\tString sub2=s.substring((s.length()/2), (s.length()));\r\n\t\t\tHashMap<Character, Integer>map = new HashMap<Character,Integer>();\r\n\t\t\t\r\n\t\t\tfor(int i=0;i<sub1.length();i++){\r\n\t\t\t\tif(map.containsKey(sub1.charAt(i))){\r\n\t\t\t\t\t\r\n\t\t\t\t\tint count =map.get(sub1.charAt(i));\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tmap.put(sub1.charAt(i), count);\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\t\t\t\t\t\r\n\t\t\t\t\tmap.put(sub1.charAt(i), 1);\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\tSystem.out.println(sub1);\r\n\t\t\tSystem.out.println(sub2);\r\n\t\t\tfor(int i=0;i<map.size();i++){\r\n\t\t\t\r\n\t\t\t\tif(map.containsKey(sub2.charAt(i))){\r\n\t\t\t\t\tint count =map.get(sub2.charAt(i));\r\n\t\t\t\t\tcount--;\r\n\t\t\t\t\tif(count<0){\r\n\t\t\t\t\t\tnoOfChange++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmap.put(sub2.charAt(i), count);\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tnoOfChange++;\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}\r\n\t\t\r\n\t\tSystem.out.println(noOfChange);\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tString s = \"asdfasdfafk asd234asda\";\n\t //Map<Character, Integer> charMap = new HashMap<Character, Integer>();\n\t \n\t Map<Character,Integer> map = new HashMap<Character,Integer>();\n\t for (int i = 0; i < s.length(); i++) {\n\t char c = s.charAt(i);\n\t System.out.println(c);\n\t //if (Character.isAlphabetic(c)) {\n\t if (map.containsKey(c)) {\n\t int cnt = map.get(c);\n\t System.out.println(cnt);\n\t map.put(c,++cnt);\n\t } else {\n\t map.put(c, 1);\n\t }\n\t \n\t }\n\t // }\n\t System.out.println(map);\n\t \n\t \n\t /* char[] arr = str.toCharArray();\n\t System.out.println(arr);\n\t \n\n\t\t\n\t\tfor (char value: arr) {\n\t\t \n\t\t if (Character.isAlphabetic(value)) { \n\t\t\t if (charMap.containsKey(value)) {\n\t\t charMap.put(value, charMap.get(value) + 1);\n\t\t \n\t\t } \n\t\t\t else { charMap.put(value, 1); \n\t\t } \n\t\t\t } \n\t\t }\n\t\t \n\t\t System.out.println(charMap);*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t \n \t}", "public void countByCharacter() {\n if (super.getInput() == null) {\n return;\n }\n FileInputStream is;\n try {\n is = new FileInputStream(super.getInput());\n NxParser nxp = new NxParser();\n System.out.println(\"Parsing \" + super.getInput() + \"...\");\n nxp.parse(is);\n for (Node[] nx : nxp) {\n String nodeid = nx[0].toString();\n String predicate = nx[1].getLabel();\n if (!PredicateUtils.isSchemaOrgEvent(predicate)) {\n continue;\n }\n predicate = PredicateUtils.fixSchemaOrg(predicate);\n if (!ATTR.equalsIgnoreCase(PredicateUtils.getEventProperty(predicate))) {\n continue;\n }\n String obj = nx[2].getLabel();\n int length = obj.length();\n Integer count = mapEvents.get(nodeid);\n mapEvents.put(nodeid, (count == null ? length : count + length));\n Integer countLength = mapLengths.get(String.valueOf(length));\n mapLengths.put(String.valueOf(length), (countLength == null ? 1 : countLength + 1));\n }\n System.out.println(\"The total number of lines: \" + nxp.lineNumber());\n System.out.println(\"The total number of events: \" + mapEvents.size());\n System.out.println(\"Start sorting mapEvents...\");\n Map<String, Integer> mapEvent = VectorUtils.sortByValue(mapEvents, VectorUtils.SortBy.DESC);\n FileUtils.writeMapdataToFile(this.getOutput(\"event\"), mapEvent);\n System.out.println(\"Start sorting mapLengths...\");\n Map<String, Integer> mapLength = VectorUtils.sortByValue(mapLengths, VectorUtils.SortBy.DESC);\n FileUtils.writeMapdataToFile(this.getOutput(\"length\"), mapLength);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public List<List<String>> groupAnagrams(String[] strs) {\n Map<String, List<String>> map = new HashMap<>();\n StringBuilder sb = new StringBuilder();\n for (String currStr : strs) {\n int[] counts = new int[26];\n for (int i = 0; i < currStr.length(); i++)\n counts[currStr.charAt(i) - 97]++;\n sb.setLength(0);\n for (int i = 0; i < counts.length; i++)\n for (int j = 0; j < counts[i]; j++)\n sb.append('a' + i);\n\n map.computeIfAbsent(sb.toString(), k -> new LinkedList<>()).add(currStr);\n }\n\n return new LinkedList<>(map.values());\n }", "public static void main(String[] args) {\n\t\tString2Int.put(\"Location1\", new Integer(0));\n\t\tString2Int.put(\"Location2\", new Integer(1));\n\t\tString2Int.put(\"Location3\", new Integer(2));\n\t\tString2Int.put(\"Location4\", new Integer(3));\n\t\t\n\t\t\n\t\t// populate it\n\t\tInt2String.put(new Integer(0), \"Location1\");\n\t\tInt2String.put(new Integer(1), \"Location2\");\n\t\tInt2String.put(new Integer(2), \"Location3\");\n\t\tInt2String.put(new Integer(3), \"Location4\");\n\t\t\n\t\t\n\t\t//HashMap<String,List<Integer>> NHMap = new HashMap<String,List<Integer>>();\n\t\tArrayList<Integer[]> NHMap = new ArrayList<Integer[]>();\n\t\tInteger[] NHMapedge1 ={String2Int.get(\"Location1\"),100,30};\n\t\tInteger[] NHMapedge2 ={String2Int.get(\"Location2\"),20,40};\n\t\tInteger[] NHMapedge3 ={String2Int.get(\"Location4\"),30,15};\n\t\tInteger[] NHMapedge4 ={String2Int.get(\"Location3\"),140,60};\n\t\t//edges.add(edge);\n\t\tNHMap.add(NHMapedge1);\n\t\tNHMap.add(NHMapedge2);\n\t\tNHMap.add(NHMapedge3);\n\t\tNHMap.add(NHMapedge4);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//HashMap<String,List<Integer>> EHMap = new HashMap<String,List<Integer>>();\n\t\tArrayList<Integer[]> EHMap = new ArrayList<Integer[]>();\n\t\tInteger[] EHMapedge1 ={String2Int.get(\"Location1\"),String2Int.get(\"Location2\"),10,30};\n\t\tInteger[] EHMapedge2 ={String2Int.get(\"Location2\"),String2Int.get(\"Location3\"),20,40};\n\t\tInteger[] EHMapedge3 ={String2Int.get(\"Location4\"),String2Int.get(\"Location4\"),30,50};\n\t\tInteger[] EHMapedge4 ={String2Int.get(\"Location3\"),String2Int.get(\"Location2\"),40,60};\n\t\t//edges.add(edge);\n\t\tEHMap.add(EHMapedge1);\n\t\tEHMap.add(EHMapedge2);\n\t\tEHMap.add(EHMapedge3);\n\t\tEHMap.add(EHMapedge4);\n\t\t\n\t\tArrayList<Integer[]> edges = new ArrayList<Integer[]>();\n\t\tInteger[] edge ={String2Int.get(\"Location1\"),String2Int.get(\"Location2\"),10};\n\t\tInteger[] edge1 ={String2Int.get(\"Location2\"),String2Int.get(\"Location3\"),20};\n\t\tInteger[] edge2 ={String2Int.get(\"Location1\"),String2Int.get(\"Location3\"),30};\n\t\tInteger[] edge4 ={String2Int.get(\"Location3\"),String2Int.get(\"Location4\"),40};\n\t\tInteger[] edge5 ={String2Int.get(\"Location4\"),String2Int.get(\"Location3\"),40};\n\t\t\n\t\t\n\t\tedges.add(edge);\n\t\tedges.add(edge1);\n\t\tedges.add(edge2);\n\t\tedges.add(edge4);\n\t\tedges.add(edge5);\n\t\t\n\t\t\n \n\t //int[][] adj_matrix = MapArrayList(edges1);\n int[][] adj_matrix = MapArrayList(edges);\n\t\tfor(int i=0;i<5;i++){\n\t\t\t//System.out.println(\"\");\n\t\t\tfor(int j=0;j<5;j++){\n\t\t\t\t\n\t\t\t\t//System.out.print(adj_matrix[i][j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t//dijkstra(edges1);\n\t\t//System.out.print(edges2);\n\t\t//System.out.println(\"Ehtesham\");\n\t\tArrayList<ArrayList<Integer>> finalpaths = dijkstra(adj_matrix);\n\t\t for (ArrayList<Integer> item : finalpaths) { \n\t\t\t System.out.println(\"\");\n\t\t\t \tfor(Integer node: item)\n\t\t\t \t{\t\n\t\t\t \t\tSystem.out.print(Int2String.get(node)+\"->\");\n\t\t\t \t}\n\t\t\n\t\t }\n\t\t int cost = 210;\n\t\t int time = 190;\n\t\t //ArrayList<ArrayList<Integer>> finalp1aths1 = Pathinbound(finalp1aths1);\n\t\t ArrayList<ArrayList<Integer>> finalp1aths1 = Pathinbound(NHMap,EHMap,finalpaths,cost,time);\n\t\t System.out.println(\"\");\n\t\t System.out.println(\"-----------------------------Final answer-------------------------------\");\n\t\t for (ArrayList<Integer> item : finalp1aths1) { \n\t\t\t\tSystem.out.println(item);\n\t\t\t\t\n\t\t }\n\t\t\t\t \n\t}", "public static void main(String[] args) {\n\n\t\tint[] a = {1,2,3,8,8,9,6,4};\n\t String s = \"hello2java\"; \n\t\tHashMap<Integer,Integer> countMap1 = new HashMap<Integer,Integer>();\n\t\tHashMap<Character,Integer> countMap2 = new HashMap<Character,Integer>();\n \n\t\tchar[] ch = s.toCharArray();\n\t\t\n\t\t\tfor(int i=0;i<a.length;i++){\n\t\t\t\tif(countMap1.containsKey(a[i])){\n\t\t\t\t\tcountMap1.put(a[i], countMap1.get(a[i])+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcountMap1.put(a[i],1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t//}\n\t\tSystem.out.println(countMap1);\n\t\t\n\t\tfor(int i=0;i<ch.length;i++){\n\t\t\tif(countMap2.containsKey(ch[i])){\n\t\t\t\tcountMap2.put(ch[i], countMap2.get(ch[i])+1);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap2.put(ch[i],1);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tSystem.out.println(countMap2);\n\t\t\n\t\tSet<Character> ket = countMap2.keySet();\n for(Character c:ket){\n \tif(countMap2.get(c)>1){\n \t\tSystem.out.println(c+\"-->\"+countMap2.get(c));\n \t}\n }\n\t}", "public void createHashTable() {\n\n String[] tempArray = new String[words.size()];\n\n for (int i = 0; i < words.size(); i++) {\n char[] word = words.get(i).toCharArray(); // char[] snarf\n Arrays.sort(word); // char[] afnrs\n tempArray[i] = toString(word); // String afnrs\n }\n\n for (int i = 0; i < words.size(); i++) {\n String word = tempArray[i];\n hashTable.put(word.substring(0, 4), i); // plocka bort bokstav nr 5\n String subString4 = (word.substring(0, 3) + word.substring(4, 5)); // plocka bort bokstav nr 4\n hashTable.put(subString4, i);\n String subString3 = (word.substring(0, 2) + word.substring(3, 5)); // plocka bort bokstav nr 3\n hashTable.put(subString3, i);\n String subString2 = (word.substring(0, 1) + word.substring(2, 5)); // plocka bort bokstav nr 2\n hashTable.put(subString2, i);\n hashTable.put(word.substring(1, 5), i); // plocka bort bokstav nr 1\n }\n }", "public static List<Integer> partitionLabels(String s) {\n Map<Character, Interval> charInterval = new HashMap<>();\n for (int i = 0;i<s.length();i++) {\n char c = s.charAt(i);\n Interval interval = charInterval.getOrDefault(c, null);\n if (interval == null) {\n interval = new Interval(i, i);\n charInterval.put(c, interval);\n }\n interval.e = i;\n }\n //merge the intervals\n List<Interval> intervals = new ArrayList<>(charInterval.values());\n Collections.sort(intervals);\n System.out.println(\"Intervals: \" + intervals);\n List<Interval> mergedIntervals = new ArrayList<>();\n List<Integer> partitions = new ArrayList<>();\n Interval nextInterval = new Interval();\n for (Interval interval: intervals) {\n if (nextInterval == null) {\n nextInterval = interval;\n continue;\n }\n if (interval.s > nextInterval.e) {\n mergedIntervals.add(nextInterval);\n partitions.add(nextInterval.e - nextInterval.s + 1);\n nextInterval = new Interval(interval.s, interval.e);\n } else if (interval.e > nextInterval.e) {\n nextInterval.e = interval.e;\n }\n }\n if (nextInterval != null) {\n mergedIntervals.add(nextInterval);\n partitions.add(nextInterval.e - nextInterval.s + 1);\n }\n System.out.println(\"Merged intervals: \" + mergedIntervals);\n System.out.println(\"Partitions: \" + partitions);\n return partitions;\n }", "private void fill() {\r\n\t\tmap = new TreeMap<String, String>();\r\n\t\tlist = new ArrayList<String>();\r\n\t\ttry {\r\n\r\n\t\t\tFileInputStream ExcelFileToRead = new FileInputStream(\"V:\\\\Public\\\\Venatorx Employee and Conference Room Phone List.xlsx\");\r\n\r\n\t\t\tXSSFWorkbook wb = new XSSFWorkbook(ExcelFileToRead);\r\n\t\t\tXSSFSheet sheet = wb.getSheetAt(0);\r\n\t\t\tXSSFRow row; \r\n\t\t\tXSSFCell cell;\r\n\t\t\t\r\n\t\t\tarr = new String[9];\r\n\t\t\tIterator<Row> rows = sheet.rowIterator();\r\n\t\t\tString temp = \"\";\r\n\t\t\r\n\t\t\twhile (temp.equals(\"\"))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\trow=(XSSFRow) rows.next();\r\n\t\t\t\tIterator<Cell> cells = row.cellIterator();\r\n\t\t\t\tfor (int i = 0; i < 9; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tcell=(XSSFCell) cells.next();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (cell.getCellType() == XSSFCell.CELL_TYPE_STRING)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString check = cell.getStringCellValue();\r\n\t\t\t\t\t\tif(check.equals(\"First Name\")) {\r\n\t\t\t\t\t\t\ttemp = \"First\";\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tarr[i] = cell.getStringCellValue();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//System.out.println(arr[i]);\r\n\t\t\t\t\t\t//System.out.print(cell.getStringCellValue()+\", \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(cell.getCellType() == XSSFCell.CELL_TYPE_NUMERIC)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tCell tempCell = cell;\r\n\t\t\t\t\t\tDataFormatter formatter = new DataFormatter();\r\n\t\t\t\t\t\tString strValue = formatter.formatCellValue(tempCell);\r\n\t\t\t\t\t\tarr[i] = strValue;\r\n\t\t\t\t\t\t//System.out.println(arr[i]);\r\n\t\t\t\t\t\t//System.out.print(cell.getNumericCellValue()+\", \");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if((i == 0) && (cell.getCellType() == XSSFCell.CELL_TYPE_BLANK)) {\r\n\t\t\t\t\t\ttemp = \"Final line\";\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString unknown = \"Unknown\";\r\n\t\t\t\t\t\tarr[i] = unknown;\r\n\t\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\tif(temp.equals(\"Final line\")) {\r\n\t\t\t\t\ttemp = \"\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\telse if(temp.equals(\"First\")) {\r\n\t\t\t\t\ttemp = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t\r\n\t\t\t\t\tString name = arr[0].trim() + \" \" + arr[1].trim();\r\n\t\t\t\t\tString accreditions = arr[2].trim();\r\n\t\t\t\t\tString title = arr[3].trim();\r\n\t\t\t\t\tString extension = arr[4].trim();\r\n\t\t\t\t\tString directNumber = arr[5].trim();\r\n\t\t\t\t\tString cellNumber = arr[6].trim();\r\n\t\t\t\t\tString email = arr[7].trim();\r\n\t\t\t\t\tString location = arr[8].trim();\r\n\t\t\t\t\t\r\n\t\t\t\t\tString info = accreditions + \":\" + title + \":\" + extension + \":\" + directNumber + \":\" + cellNumber + \":\" + email + \":\" + location;\r\n\t\t\t\t\t//System.out.println(name + info);\r\n\t\t\t\t\tmap.put(name, info);\r\n\t\t\t\t\t//set.add(name);\r\n\t\t\t\t\tlist.add(name);\r\n\t\t\t\t\t\r\n\t\t\t\t\tarr = new String[9];\r\n\t\t\t\t\t//System.out.println();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t \r\n\t\t } catch (FileNotFoundException e2) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te2.printStackTrace();\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}", "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 static String alienOrder(String[] words) {\n if(words.length==0){\n return \"\";\n }\n else if(words.length==1){\n return words[0];\n }\n else{\n HashMap<Character,HashSet<Character>> graph = new HashMap<Character,HashSet<Character>>();\n //Use this array to denote each node's indegree\n int[] indegree = new int[26];\n Arrays.fill(indegree,-1);\n //****Initialize indegree array, '0' means exits****\n for(String x : words){\n for(char c : x.toCharArray()){\n indegree[c-'a'] = 0;\n }\n }\n int first = 0;\n int second = 1;\n //****Build the graph****\n while(second<words.length){\n int minLen = Math.min(words[first].length(),words[second].length());\n for(int i = 0; i<minLen; i++){\n char f = words[first].charAt(i);\n char s = words[second].charAt(i);\n if(f!=s){\n if(graph.containsKey(s)==true){\n HashSet<Character> hs = graph.get(s);\n if(hs.contains(f)==false){\n indegree[f-'a']++;\n hs.add(f);\n graph.replace(s,hs);\n }\n }\n else{\n HashSet<Character> hs = new HashSet<Character>();\n hs.add(f);\n graph.put(s,hs);\n indegree[f-'a']++;\n }\n break;\n }\n }\n first++;\n second++;\n }\n StringBuilder result = new StringBuilder();\n Queue<Character> topo = new LinkedList<Character>();\n int numOfChar = 0;\n for(int i = 0; i<26; i++){\n if(indegree[i]>=0){\n numOfChar++;\n if(indegree[i]==0){\n topo.offer((char)('a'+i));\n } \n }\n }\n if(topo.size()==0){\n return \"\";\n //Means circle exits\n }\n while(topo.size()>0){\n char c = topo.poll();\n result.append(c);\n if(graph.containsKey(c)==false){\n \tcontinue;\n }\n HashSet<Character> hs = graph.get(c);\n for(char x : hs){\n indegree[x-'a']--;\n if(indegree[x-'a']<0){\n return \"\";\n }\n else if(indegree[x-'a']==0){\n topo.offer(x);\n }\n }\n }\n return result.reverse().toString();\n //return result.length()==numOfChar?result.reverse().toString():\"HAHA\";\n }\n }", "@NotNull\n private static List<TableLabel> generateLabelsForGroup(final List<EditedStyleItem> source, final List<EditedStyleItem> sink) {\n Multimap<String, EditedStyleItem> classes =\n Multimaps.newListMultimap(new TreeMap<String, Collection<EditedStyleItem>>(), new Supplier<List<EditedStyleItem>>() {\n @Override\n public List<EditedStyleItem> get() {\n return new ArrayList<EditedStyleItem>();\n }\n });\n for (EditedStyleItem item : source){\n String group = item.getAttrGroup();\n classes.put(group, item);\n }\n\n final List<TableLabel> labels = new ArrayList<TableLabel>();\n int offset = 0;\n sink.clear();\n for (String group : classes.keySet()) {\n final int size = classes.get(group).size();\n sink.addAll(classes.get(group));\n if (size != 0) {\n labels.add(new TableLabel(group, offset));\n }\n offset += size;\n }\n return labels;\n }", "public static void main(String[] args){\n\t\tString str = \"level\";\n\t\t\n\t\t// Approach-1\n\t\tfor(int i=0;i<str.length();i++){\n\t\t\tboolean unique = true;\n\t\t\t\n\t\t\tfor(int j=0;j<str.length();j++){\n\t\t\t\tif(i!=j && str.charAt(i)==str.charAt(j)){\n\t\t\t\t\tunique = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(unique){\n\t\t\t\tSystem.out.println(str.charAt(i));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Approach-2\n\t\tMap<Character, Integer> map = new HashMap<>();\n\t\t\n\t\tfor(int i=0;i<str.length();i++){\n\t\t\tchar ch = str.charAt(i);\n\t\t\tif(map.containsKey(ch)){\n\t\t\t\tmap.put(ch, map.get(ch)+1);\t\n\t\t\t}else{\n\t\t\t\tmap.put(ch,1);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tfor(Map.Entry<Character, Integer> entryset : map.entrySet()){\n\t\t\tif(entryset.getValue()==1){\n\t\t\t\tSystem.out.println(entryset.getKey());\n\t\t\t\tbreak;\n\t\t\t}\n\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\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n HashMap<Integer, Character> hashMap = new HashMap<Integer, Character>();\n hashMap.put(0,'F');hashMap.put(1,'G');hashMap.put(2,'R');\n hashMap.put(3,'S');hashMap.put(4,'T');hashMap.put(5,'L');\n hashMap.put(6,'M');hashMap.put(7,'N');hashMap.put(8,'O');\n hashMap.put(9,'P');hashMap.put(10,'Q');hashMap.put(11,'W');\n hashMap.put(12,'X');hashMap.put(13,'Y');hashMap.put(14,'Z');\n hashMap.put(15,'U');hashMap.put(16,'A');hashMap.put(17,'G');\n hashMap.put(18,'H');hashMap.put(19,'I');hashMap.put(20,'J');\n hashMap.put(21,'K');hashMap.put(22,'B');hashMap.put(23,'C');\n hashMap.put(24,'D');hashMap.put(25,'E');hashMap.put(26,'l');\n hashMap.put(27,'m');hashMap.put(28,'n');hashMap.put(29,'o');\n hashMap.put(30,'p');hashMap.put(31,'i');hashMap.put(32,'j');\n hashMap.put(33,'k');hashMap.put(34,'f');hashMap.put(35,'g');\n hashMap.put(36,'h');hashMap.put(37,'a');hashMap.put(38,'b');\n hashMap.put(39,'c');hashMap.put(40,'d');hashMap.put(41,'e');\n hashMap.put(42,'q');hashMap.put(43,'r');hashMap.put(44,'w');\n hashMap.put(45,'x');hashMap.put(46,'y');hashMap.put(47,'z');\n hashMap.put(48,'s');hashMap.put(49,'t');hashMap.put(50,'u');\n hashMap.put(51,'v');\n while(in.hasNext()){\n String str = in.next();\n\n String[] arr = str.split(\"[#]+\");\n\n StringBuffer ss = new StringBuffer();\n\n for (int i = 0; i < arr.length; i++) {\n\n //System.out.println(arr[i]);\n\n StringBuffer sb = new StringBuffer();\n\n for (int j = 0; j < arr[i].length(); j++) {\n\n int a = arr[i].charAt(j)=='-'?0:1;\n sb.append(a);\n }\n\n long b = Long.valueOf(sb.toString(),2);\n\n if (b>51||b<0){\n ss.replace(0,ss.length(),\"\");\n ss.append(\"ERROR\");\n break;\n }else {\n ss.append(hashMap.get((int)b));\n }\n }\n System.out.println(ss);\n\n }\n }", "private void kbuild(String input) {\n\r\n\t\tArrayList<String> a = new ArrayList<String>();\r\n\t\tHashMap<String, Integer> counts = new HashMap<String, Integer>();\r\n\t\tSet<String> k = new HashSet<String>();\r\n\t\tPattern p = Pattern.compile(\"(\\\\w+)\\\\s*\\\\[([a-zA-Z-0-9,]+)\\\\]\");\r\n\t\tMatcher m = p.matcher(input);\r\n\r\n\t\twhile (m.find()) {\r\n\t\t\tString[] temp = m.group(2).split(\",\");\r\n\r\n\t\t\tfor (int j = 0; j < temp.length; j++) {\r\n\t\t\t\ta.add(temp[j]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < a.size(); i++) {\r\n\t\t\tif (counts.containsKey(a.get(i))) {\r\n\t\t\t\tcounts.put(a.get(i), counts.get(a.get(i)) + 1);\r\n\t\t\t} else {\r\n\t\t\t\tcounts.put(a.get(i), 1);\r\n\t\t\t}\r\n\t\t}\r\n\t\tObject[] ckeys = counts.keySet().toArray();\r\n\t\tfor (int i = 0; i < counts.size(); i++) {\r\n\t\t\tif (counts.get(ckeys[i]) > 1) {\r\n\t\t\t\tk.add((String) ckeys[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tkeys.addAll(k);\r\n\t}", "private void RecalculateCharDistribution() {\r\n\t\tMap<Character, Integer> temp = new HashMap<>();\r\n\t\tfor (String s : sameWordLength) {\r\n\t\t\tfor (int i = 0; i < s.length(); i++) {\r\n\r\n\t\t\t\tchar ch = s.charAt(i);\r\n\t\t\t\tif (guessedCharacter.contains(ch)) {\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!temp.containsKey(ch)) {\r\n\t\t\t\t\t\ttemp.put(ch, 1);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tint t = temp.get(ch) + 1;\r\n\t\t\t\t\t\ttemp.put(ch, t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tcharCount = temp;\r\n\r\n\t}", "public static List<List<String>> groupAnagrams(String[] strs) {\n Map<List<Integer>, List<String>> map = new HashMap<>();\n for(String s : strs){\n List<Integer> curr = transform(s);\n if(map.containsKey(curr)) map.get(curr).add(s);\n else{\n List<String> newGrp = new ArrayList<>();\n newGrp.add(s);\n map.put(curr, newGrp);\n }\n }\n\n return new ArrayList<>(map.values());\n }", "private int[] addLetterAroundPosition(int[] pos, String[][] level, String c) throws Exception{\r\n\t\tfor(int i = 0; i<200; i++){\r\n\t\t\t// Start at a random tile\r\n\t\t\tint x = rng.nextInt(3)-1;\r\n\t\t\tint y = rng.nextInt(3)-1;\r\n\t\t\r\n\t\t\tint newx = pos[0]-x;\r\n\t\t\tint newy = pos[1]-y;\r\n\t\t\t\r\n\t\t\tif(newx < 0 || newx > 5 || newy < 0 || newy > 5){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\r\n\t\t\tif(level[newx][newy] == \"_\"){\r\n\t\t\t\t// If blank, just put in the char\r\n\t\t\t\tlevel[newx][newy] = c;\r\n\t\t\t\tint[] ret = {newx,newy};\r\n\t\t\t\treturn ret;\r\n\t\t\t} \r\n\t\t}\r\n\t\tthrow new Exception(\"Letter could not be placed around other tile\");\r\n\t}", "private void grouping(int[] indexes) {\n\n\t\tfinal int[][] groups = new int[128][0];\n\t\tfor (int i = 0; i < indexes.length; i++) {\n\t\t\tfinal int charV = getFirstChar(strings[indexes[i]]); // get the first char ascii\n\t\t\tstrings[indexes[i]] = charV > 0 ? strings[indexes[i]].substring(1) : strings[indexes[i]]; // remove the first letter\n\t\t\tgroups[charV] = AlgUtil.appendIntArray(groups[charV], indexes[i]); // grouping strings (using index) by first char\n\t\t}\n\t\t// add element index if ascii=0\n\t\tfor (int o = 0; o < groups[0].length; o++) {\n\t\t\tresult = AlgUtil.appendIntArray(result, groups[0][o]);\n\t\t}\n\t\tfor (int i = 1; i < groups.length; i++) {\n\t\t\tif (groups[i].length > 0) {\n\t\t\t\tif (groups[i].length == 1) {\n\t\t\t\t\t// add element to result if there it is only element in certain group\n\t\t\t\t\tresult = AlgUtil.appendIntArray(result, groups[i][0]);\n\t\t\t\t} else {\n\t\t\t\t\t// recursively call grouping method for each group\n\t\t\t\t\tgrouping(groups[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "TrieSet(String[] items, int start, int stop, int c) {\n \t // keep this -- it initializes the children array\n \t // (note all positions are initially null)\n this();\n \n //begin solution, replace with: //add code here\n if (items[start].length() == c) {\n terminal = true;\n start++;\n }\n for (char letter = 'A'; letter <= 'Z'; letter++) {\n int end = start;\n while (end < stop && items[end].charAt(c) == letter) end++;\n if (start != end)\n children[c2i(letter)] = new TrieSet(items, start, end, c+1);\n start = end;\n }\n //end solution\n }", "public String getMountains() {\n return \" YYYY Y YY Y YY YYYY \\n\" +\n \" YYYYYY YYYY YYYY YY YYYYY YYYYYY \\n\" +\n \" YYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY \\n\" +\n \" YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY \\n\" +\n \" YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY \\n\" +\n \" YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY \\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY \\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\" +\n \"YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY\\n\";\n\n }", "void populateGlyphsWithComposites() throws IOException {\n for (final int indexInOriginal : this.subset.keySet()) {\n scanGlyphsRecursively(indexInOriginal);\n }\n\n addAllComposedGlyphsToSubset();\n\n for (final int compositeGlyph : this.compositeGlyphs) {\n final long offset = this.tableOffset\n + this.mtxTab[compositeGlyph].getOffset() + 10;\n if (!this.remappedComposites.contains(offset)) {\n remapComposite(offset);\n }\n }\n }", "private void count(Entry curr)\n {\n \t//Increase Prefix count if any word is found.\n \tif (curr.EndOfWord == true)\n \t\tprefixCnt += 1;\n \t\n \tfor (HashMap.Entry<Character, Entry> entry : curr.child.entrySet())\n \t{\n \t\tcount(entry.getValue());\n \t}\n }", "private void createUsedSubTreeRefMap() {\n\n\t\tXmlProcessor simpleXmlProcessor = measureExport.getSimpleXMLProcessor();\n\t\tString typeXpathString = \"\";\n\t\tList<String> usedSubTreeRefIdsPop = new ArrayList<>();\n\t\tList<String> usedSubTreeRefIdsMO = new ArrayList<>();\n\t\tList<String> usedSubTreeRefIDsRA = new ArrayList<>();\n\t\tfor (String typeString : POPULATION_NAME_LIST) {\n\t\t\ttypeXpathString += \"@type = '\" + typeString + \"' or\";\n\t\t}\n\t\ttypeXpathString = typeXpathString.substring(0, typeXpathString.lastIndexOf(\" or\"));\n\t\tString xpathForSubTreeInPOPClause = \"/measure/measureGrouping//clause[\" + typeXpathString + \"]//subTreeRef/@id\";\n\t\tString xpathForSubTreeInMOClause = \"/measure/measureGrouping//clause[@type='measureObservation']//subTreeRef/@id\";\n\t\tString xpathForSubTreeInRAClause = \"/measure//riskAdjustmentVariables/subTreeRef/@id\";\n\t\ttry {\n\n\t\t\t// creating used Subtree Red Map in Populations\n\t\t\tNodeList populationsSubTreeNode = simpleXmlProcessor.findNodeList(simpleXmlProcessor.getOriginalDoc(),\n\t\t\t\t\txpathForSubTreeInPOPClause);\n\t\t\tfor (int i = 0; i < populationsSubTreeNode.getLength(); i++) {\n\t\t\t\tString uuid = populationsSubTreeNode.item(i).getNodeValue();\n\t\t\t\tuuid = checkIfQDMVarInstanceIsPresent(uuid, simpleXmlProcessor);\n\t\t\t\tif (!usedSubTreeRefIdsPop.contains(uuid)) {\n\t\t\t\t\tusedSubTreeRefIdsPop.add(uuid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tusedSubTreeRefIdsPop = checkUnUsedSubTreeRef(simpleXmlProcessor, usedSubTreeRefIdsPop);\n\t\t\tfor (String uuid : usedSubTreeRefIdsPop) {\n\t\t\t\tNode subTreeNode = createUsedSubTreeRefMap(simpleXmlProcessor, uuid);\n\t\t\t\tsubTreeNodeInPOPMap.put(uuid, subTreeNode);\n\t\t\t}\n\n\t\t\t// creating used Subtree Red Map in Measure Observations\n\t\t\tNodeList measureObsSubTreeNode = simpleXmlProcessor.findNodeList(simpleXmlProcessor.getOriginalDoc(),\n\t\t\t\t\txpathForSubTreeInMOClause);\n\t\t\tfor (int i = 0; i < measureObsSubTreeNode.getLength(); i++) {\n\t\t\t\tString uuid = measureObsSubTreeNode.item(i).getNodeValue();\n\t\t\t\tuuid = checkIfQDMVarInstanceIsPresent(uuid, simpleXmlProcessor);\n\t\t\t\tif (!usedSubTreeRefIdsMO.contains(uuid)) {\n\t\t\t\t\tusedSubTreeRefIdsMO.add(uuid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tusedSubTreeRefIdsMO = checkUnUsedSubTreeRef(simpleXmlProcessor, usedSubTreeRefIdsMO);\n\t\t\tfor (String uuid : usedSubTreeRefIdsMO) {\n\t\t\t\tNode subTreeNode = createUsedSubTreeRefMap(simpleXmlProcessor, uuid);\n\t\t\t\tsubTreeNodeInMOMap.put(uuid, subTreeNode);\n\t\t\t}\n\t\t\t// creating used Subtree Red in Risk Adjustment\n\t\t\tNodeList riskAdjSubTreeNode = simpleXmlProcessor.findNodeList(simpleXmlProcessor.getOriginalDoc(),\n\t\t\t\t\txpathForSubTreeInRAClause);\n\t\t\tfor (int i = 0; i < riskAdjSubTreeNode.getLength(); i++) {\n\t\t\t\tString uuid = riskAdjSubTreeNode.item(i).getNodeValue();\n\t\t\t\tuuid = checkIfQDMVarInstanceIsPresent(uuid, simpleXmlProcessor);\n\t\t\t\tif (!usedSubTreeRefIDsRA.contains(uuid)) {\n\t\t\t\t\tusedSubTreeRefIDsRA.add(uuid);\n\t\t\t\t}\n\t\t\t}\n\t\t\tusedSubTreeRefIDsRA = checkUnUsedSubTreeRef(simpleXmlProcessor, usedSubTreeRefIDsRA);\n\t\t\tfor (String uuid : usedSubTreeRefIDsRA) {\n\t\t\t\tNode subTreeNode = createUsedSubTreeRefMap(simpleXmlProcessor, uuid);\n\t\t\t\tsubTreeNodeInRAMap.put(uuid, subTreeNode);\n\t\t\t}\n\n\t\t} catch (XPathExpressionException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void mappingTest(){\r\n\t\tStream<String> ohMy = Stream.of(\"lions\", \"tigers\", \"bears\");\r\n\t\tMap<Integer, Optional<Character>>map = ohMy.collect(Collectors.groupingBy(s->s.length(), Collectors.mapping(s->s.charAt(0), Collectors.minBy(Comparator.naturalOrder()))));\r\n\t\tSystem.out.println(map);//{5=Optional[b], 6=Optional[t]}\r\n\t}", "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}", "void find(String digits) {\n Map<Character, char[]> map = buildMap();\n List<String> res = new ArrayList<String>();\n \n for (int i = 0; i < map.get(digits.charAt(0)).length; i++) {\n \tres.add(map.get(digits.charAt(0))[i] + \"\");\n }\n \n int size = res.size();\n for (int i = 1; i < digits.length(); i++) { // Every digit\n \tList<String> next = new ArrayList<String>();\n \tchar[] arr = map.get(digits.charAt(i));\n \t\n \tfor (int j = 0; j < size; j++) { // Every existing string prefix\n \t\tString prefix = res.get(j);\n \t\tfor (char c : arr) { // Every possible next char\n \t\t\tnext.add(prefix + c);\n \t\t}\n \t}\n \t\n \tres = next;\n }\n \n for (String s : res) {\n \tSystem.out.println(s);\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tHashMap <Character, Integer> lhmap = new LinkedHashMap<Character, Integer>();\n\t\t\n\t\t\tString nom = \"Javier del Moral Asensio\";\n\t\t\tchar[] myName= nom.toLowerCase().toCharArray();\n\t\t\n\t\t//for loop to check characters one by one and sum it if are repeated\n\t\t\t\t\n\t\t\tfor(int c=0; c < nom.length(); c++) {\n\t\t\t\n\t\t\t\tint value=1;\n\t\t\n\t\t//if the char is new store it\n\t\t\t\t\n\t\t\t\tif(lhmap.containsKey(myName[c]) == false) {\n\t\t\t\t\tlhmap.put(myName[c], value);\n\t\t\t\t\t\n\t\t//if is not +1 to the original char\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\tvalue = lhmap.get(myName[c]);\n\t\t\t\t\tlhmap.put(myName[c], value+1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\tSystem.out.println(lhmap);\t\t\n\n\t}", "public void wordMap(StringBuilder line, String path) {\r\n\t\tHashMap<String, ArrayList<Integer>> subIndex = new HashMap<String, ArrayList<Integer>> ();\r\n//\t\tFile file = new File(path);\r\n\t\tBufferedReader reader = null;\r\n\r\n\t\t\t\r\n//\t\t\t\treader = new BufferedReader(new FileReader(file));\r\n\t\t\t\tString textLine = line.toString();\r\n//\t\t\t\tSystem.out.println(textLine);\r\n\t\t\t\tint position = 0;\r\n\t\t\t\t// reads lines in and splits them into an array.\r\n\t\t\t\ttextLine = textLine.toLowerCase();\r\n\r\n\t\t\t\tString[] lines = textLine.split(\"\\\\s\");\r\n\t\t\t\tfor (int i = 0; i < lines.length; i++) {\r\n\t\t\t\t\tlines[i] = lines[i].replaceAll(\"\\\\W\", \"\");\r\n\r\n\t\t\t\t\t// Skips empty lines that are read in\r\n\t\t\t\t\tif (lines[i].isEmpty()) {\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tposition += 1;\r\n\r\n\t\t\t\t\taddEntry(lines[i], path, position, subIndex);\r\n\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\r\n\t\t\t\tfor(String word : subIndex.keySet()){\r\n\r\n\t\t\t\t\tfor(Integer count : subIndex.get(word)){\r\n\t\t\t\t\t\tindex.addEntry(word, path, count);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\treturn;\r\n\t}", "void buildTable(){\n HashMap<String, Integer> map = new HashMap<String, Integer>();\n while (first.hasNext()){\n String s = first.next();\n for(String key: s.split(SPLIT)) {\n int val = map.getOrDefault(key, 0);\n map.put(key, val + 1);\n }\n }\n ArrayList<Tuple> arr = new ArrayList<>();\n for (String key: map.keySet()){\n int num = map.get(key);\n //filter the unusual items\n if (num >= this.support){\n arr.add(new Tuple(key, num));\n }\n }\n //descending sort\n arr.sort((Tuple t1, Tuple t2)->{\n if (t1.num <= t2.num)\n return 1;\n else\n return -1;\n });\n\n int idx = 0;\n for(Tuple t: arr){\n this.table.add(new TableEntry(t.item, t.num));\n this.keyToNum.put(t.item, t.num);\n this.keyToIdx.put(t.item, idx);\n idx += 1;\n }\n /*\n for(TableEntry e: table){\n System.out.println(e.getItem()+ \" \"+ e.getNum());\n }*/\n }", "public static void main(String[] args) {\n\t\tArrayList<String> givenArray = new ArrayList<String>();\n\t\tArrayList<String> listOfNamesStartingWithA = new ArrayList<String>();\n\t\tArrayList<String> listOfNamesStartingWithG = new ArrayList<String>();\n\t\tgivenArray.add(\"apple\");\n\t\tgivenArray.add(\"appleinc\");\n\t\tgivenArray.add(\"applemac\");\n\t\tgivenArray.add(\"google\");\n\t\t\n\t\tHashMap<String, ArrayList> map = new HashMap<String, ArrayList>();\n\t\tmap.clone();\n\t\tIterator<String> itr = givenArray.iterator();\n\t\t\n\t\twhile(itr.hasNext()) {\n\t\t\tString arrayListOb = itr.next();\n\n\t\t\tString key =arrayListOb.substring(0, 1);\n\t\t\tif(key.startsWith(\"a\")) {\n\t\t\t\tlistOfNamesStartingWithA.add(arrayListOb);\t\n\t\t\t\tmap.put(key, listOfNamesStartingWithA);\t\n\t\t\t}\n\t\t\tif(key.startsWith(\"g\")) {\n\t\t\t\tlistOfNamesStartingWithG.add(arrayListOb);\n\t\t\t\tmap.put(key, listOfNamesStartingWithG);\n\t\t\t}\t\t\t\t\n\t\t\tSystem.out.println(key);\n\t\t\tSystem.out.println(map.get(key));\n\t\t}\n\t\tSystem.out.println(map.size());\n\t\t//System.out.println(map.get(\"g\"));\n\t\t//System.out.println(map.get(\"a\"));\n\t\t/*for(Map.Entry<String,ArrayList> entry: map.entrySet())\n\t\t{\n\t\t\tSystem.out.println(map.get(\"a\"));\n\t\t}*/\n\t}", "private void processGroup(List<ResolveInfo> rList, int start, int end, ResolveInfo ro,\r\n CharSequence roLabel) {\r\n // Process labels from start to i\r\n int num = end - start+1;\r\n if (num == 1) {\r\n // No duplicate labels. Use label for entry at start\r\n mList.add(new DisplayResolveInfo(ro, roLabel, null, null));\r\n } else {\r\n boolean usePkg = false;\r\n CharSequence startApp = ro.activityInfo.applicationInfo.loadLabel(mPm);\r\n if (startApp == null) {\r\n usePkg = true;\r\n }\r\n if (!usePkg) {\r\n // Use HashSet to track duplicates\r\n HashSet<CharSequence> duplicates = new HashSet<CharSequence>();\r\n duplicates.add(startApp);\r\n for (int j = start+1; j <= end ; j++) {\r\n ResolveInfo jRi = rList.get(j);\r\n CharSequence jApp = jRi.activityInfo.applicationInfo.loadLabel(mPm);\r\n if ( (jApp == null) || (duplicates.contains(jApp))) {\r\n usePkg = true;\r\n break;\r\n } else {\r\n duplicates.add(jApp);\r\n } // End of if\r\n } // End of if\r\n // Clear HashSet for later use\r\n duplicates.clear();\r\n } // End of if\r\n for (int k = start; k <= end; k++) {\r\n ResolveInfo add = rList.get(k);\r\n if (usePkg) {\r\n // Use application name for all entries from start to end-1\r\n mList.add(new DisplayResolveInfo(add, roLabel,\r\n add.activityInfo.packageName, null));\r\n } else {\r\n // Use package name for all entries from start to end-1\r\n mList.add(new DisplayResolveInfo(add, roLabel,\r\n add.activityInfo.applicationInfo.loadLabel(mPm), null));\r\n } // End of if\r\n } // End of for\r\n } // End of if \r\n }", "@Override\n\tpublic void setTraining(String text) {\n\t\tmyWords = text.split(\"\\\\s+\");\n\t\tmyMap = new HashMap<String , ArrayList<String>>();\n\t\t\n\t\tfor (int i = 0; i <= myWords.length-myOrder; i++)\n\t\t{\n\t\t\tWordGram key = new WordGram(myWords, i, myOrder);\n\t\t\tif (!myMap.containsKey(key))\n\t\t\t{\n\t\t\t\tArrayList<String> list = new ArrayList<String>();\n\t\t\t\tif (i+myOrder != myWords.length)\n\t\t\t\t{\n\t\t\t\t\tlist.add(myWords[i+myOrder]);\n\t\t\t\t\tmyMap.put(key, list);\n\t\t\t\t} else {\n\t\t\t\t\tlist.add(PSEUDO_EOS);\n\t\t\t\t\tmyMap.put(key, list);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (i+myOrder != myWords.length)\n\t\t\t\t{\n\t\t\t\t\t((ArrayList<String>) myMap.get(key)).add(myWords[i+myOrder]);\n\t\t\t\t} else {\n\t\t\t\t\t((ArrayList<String>) myMap.get(key)).add(PSEUDO_EOS);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static char[] groupBy(char[] values){\n\t\tString result = \"\";\n\t\tchar last = 0;\n\t\tchar counter=0;\n\t\tfor(char i=0;i<values.length;i++){\n\t\t\tif(i==0) {\n\t\t\t\tlast=values[0];\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(values[i]!=last){\n\t\t\t\t\tresult+=last;\n\t\t\t\t\tresult+=counter;\n\t\t\t\t\tcounter=1;\n\t\t\t\t\tlast=values[i];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tresult+=last;\n\t\tresult+=counter;\n\t\treturn result.toCharArray();\n\t}", "public int ladderLength(String start, String end, HashSet<String> dict) {\n\t\tif ((start == null && end == null) || start.equals(end))\n\t\t\treturn 1;\n\n\t\tif (start == null || end == null)\n\t\t\treturn 0;\n\n\t\tQueue<WordNode> que = new LinkedList<WordNode>();\n\t\tHashMap<String, WordNode> map = new HashMap<String, WordNode>();\n\t\tWordNode root = new WordNode(start, 1);\n\t\tmap.put(start, root);\n\n\t\tque.add(root);\n\n\t\tint i;\n\t\tchar c;\n\n\t\twhile (!que.isEmpty()) {\n\t\t\tWordNode w = que.remove();\n\t\t\tString s = w.word;\n\n\t\t\tfor (i = 0; i < s.length(); i++) {\n\t\t\t\tStringBuilder sb = new StringBuilder(s);\n\t\t\t\tfor (c = 'a'; c <= 'z'; c++) {\n\t\t\t\t\tif (s.charAt(i) == c)\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tsb.setCharAt(i, c);\n\t\t\t\t\tString tmp = sb.toString();\n\t\t\t\t\tif (!dict.contains(tmp))\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tWordNode node = map.get(tmp);\n\t\t\t\t\tif (node == null) {\n\t\t\t\t\t\tnode = new WordNode(tmp, w.depth + 1);\n\t\t\t\t\t\tif (tmp.equals(end))\n\t\t\t\t\t\t\treturn node.depth;\n\t\t\t\t\t\tmap.put(tmp, node);\n\t\t\t\t\t\tque.add(node);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "public static String groupify(String text, int groupSize) {\r\n String newText = \"\";\r\n int textLength = text.length();\r\n int amountXNeeded = groupSize - (textLength % groupSize);\r\n\r\n for (int i = 0; i < textLength; i += groupSize) {\r\n int range = groupSize + i;\r\n if (range > textLength) {\r\n range = textLength;\r\n }\r\n newText += text.substring(i, range);\r\n if (range != textLength) {\r\n newText += \" \";\r\n }\r\n }\r\n if( amountXNeeded != groupSize){\r\n for (int i = 0; i < amountXNeeded; i++) {\r\n newText += \"x\";\r\n }\r\n }\r\n\r\n return newText;\r\n }", "private static Map<Integer, List<String>> getIpPatternMap()\n\t{\n\t\tMap<Integer, List<String>> map = new HashMap<>();\n\t\tfor(int a = 1; a <= 3; a++)\n\t\t{\n\t\t\tfor( int b = 1; b <= 3; b++)\n\t\t\t{\n\t\t\t\tfor(int c = 1 ; c <= 3; c++)\n\t\t\t\t{\n\t\t\t\t\tfor( int d = 1; d <= 3; d++)\n\t\t\t\t\t{\n\t\t\t\t\t\tfinal int patternCount = a + b + c + d;\n\t\t\t\t\t\tList<String> patterns;\n\t\t\t\t\t\tif(!map.containsKey(patternCount))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpatterns = new ArrayList<>();\n\t\t\t\t\t\t\tmap.put(patternCount, patterns);\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\tpatterns = map.get(patternCount);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpatterns.add(String.format(\"%1$d%2$d%3$d%4$d\", a,b,c,d));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn map;\n\t}", "public Alphabet()\n {\n \tthis.growing = true;\n this.map = new TObjectIntHashMap<T>();\n this.entries = new ArrayList<T>();\n }", "private void buildLabelLocs() {\n this.labelLocs = new HashMap<String, Integer>();\n for (int n = 0; n < this.code.size(); n++) {\n TACOp op = this.code.get(n);\n if (op.getType() == TACOpType.LABEL) {\n this.labelLocs.put(op.getLabel(), n);\n }\n }\n }", "private static HashMap<String, Double> ComputeRelativeFrequencyDigraphs(String text) {\n\tlong length = text.length();\n\n\t//We need at least 2 characters.\n\tif (length <= 1) {\n\t return new HashMap<String, Double>();\n\t}\n\n\tHashMap<String, Integer> freqMap = new HashMap<String, Integer>();\n\n\t//Look at this character, and the next one to determine digraphs.\n\tfor (int i = 0; i < length - 1; i++) {\n\t char character1 = text.charAt(i);\n\t char character2 = text.charAt(i+1);\n\n\t if (((character1 >= 'A' && character1 <= 'Z')) &&\n\t\t((character2 >= 'A' && character2 <= 'Z')))\n\t {\n\t\tint freq;\n\t\t//If we haven't seen this combination yet, add it with a frequency of 1.\n\t\tif (freqMap.get(\"\" + character1 + character2) == null) {\n\t\t freq = 1;\n\t\t}\n\t\telse {\n\t\t freq = freqMap.get(\"\" + character1 + character2) + 1;\n\t\t}\n\t\t\n\t\tfreqMap.put((\"\" + character1 + character2), freq);\n\t }\n\t}\n\n\tHashMap<String, Double> relativeFreqMap = new HashMap<String, Double>();\n\tlong totalFreq = 0;\n\n\t//Find total frequency by adding all frequencies together.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t totalFreq += entry.getValue();\n\t}\n\n\t//Find relative frequency of all letters.\n\tfor (Entry<String, Integer> entry : freqMap.entrySet()) {\n\t double relativeFreq = (double)entry.getValue() / (double)totalFreq;\n\t relativeFreqMap.put(entry.getKey(), relativeFreq);\n\t}\n\n\treturn relativeFreqMap;\n }", "private void setLevelUpChars() {\n /*\n * check this if you need more symbol set's\n * TODO do this right @me\n\t\t */\n String charset = KeyboardHandler.current_charset;\n if (charset.length() == 36) {\n for (int i = 0; i < 6; ++i) {\n characterAreas.get(i).setChars(\n charset.substring(i * 6, (i + 1) * 6));\n }\n }\n\n if (charset.length() == 40) {\n Log.d(\"main\",charset);\n characterAreas.get(0).setChars(charset.substring(0, 6));\n characterAreas.get(1).setChars(charset.substring(6, 14));\n characterAreas.get(2).setChars(charset.substring(14, 20));\n characterAreas.get(3).setChars(charset.substring(20, 26));\n characterAreas.get(4).setChars(charset.substring(26, 34));\n characterAreas.get(5).setChars(charset.substring(34, 40));\n }\n }", "public void tempArray() {\n for (int i = 0; i < newWord.length(); i++) {\n for (String c : keySetNewWord) {\n if(String.valueOf(newWord.charAt(i)).equals(c)) {\n int p = mapNewWord.get(c) + 1;\n mapNewWord.put(c, p);\n }\n }\n }\n }", "public static void main(String[] args) {\n ArrayList<Character> actual=new ArrayList<>();\n actual.add('R');\n actual.add('G');\n actual.add('B');\n actual.add('Y');\n ArrayList<Character> guess=new ArrayList<>();\n guess.add('G');\n guess.add('G');\n guess.add('R');\n guess.add('R');\n ArrayList<Character> hitLists=new ArrayList<>();\n ArrayList<Character> pseudoLists=new ArrayList<>();\n int hits=0;\n int pseudoHits=0;\n for(int i=0;i<4;i++)\n {\n \t if(actual.get(i)==guess.get(i))\n \t {\n \t\t hits++;\n \t\t hitLists.add(actual.get(i));\n \t }\n }\n for(int i=0;i<4;i++)\n {\n \t char g=guess.get(i);\n \t if(g!=actual.get(i)&&!hitLists.contains(g)&&actual.contains(g))\n { \n\t pseudoLists.add(g);\n }\n }\n for(int i=0;i<pseudoLists.size();i++)\n { char g=pseudoLists.get(i);\n \t int actualOccs=numOccurences(g,actual);\n \t int guessOccs=numOccurences(g,guess);\n \t \n\t\tif(guessOccs==actualOccs)\n \t {\n \t\t pseudoHits++; \n \t }\n\t\telse{\n\t\t\tpseudoHits+=Math.min(guessOccs,actualOccs);\n\t\t}\t \n System.out.println(g);\n }\n \n \n System.out.println(hits+\" hits \"+pseudoHits+\" pseudoHits\");\n\t}", "private HashMap<String, ArrayList<Integer>> createTonyParkerTestMap() {\n HashMap<String, ArrayList<Integer>> knownYearSeasonActivityMap = new HashMap<>();\n knownYearSeasonActivityMap.put(\"2001-02\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2002-03\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2003-04\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2004-05\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2005-06\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2006-07\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2007-08\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2008-09\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2009-10\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2010-11\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2011-12\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2012-13\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2013-14\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2014-15\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2015-16\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2016-17\", new ArrayList<>(Arrays.asList(1, 1, 1)));\n knownYearSeasonActivityMap.put(\"2017-18\", new ArrayList<>(Arrays.asList(1, -1, 1)));\n knownYearSeasonActivityMap.put(\"2018-19\", new ArrayList<>(Arrays.asList(1, 1, -1)));\n return knownYearSeasonActivityMap;\n }", "private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }", "private void buildBoundary(Set<String> dict) {\n for (String s : dict) {\n int len = s.length();\n min = Math.min(min, len);\n max = Math.max(max, len);\n }\n }", "public static void main(String[] args) {\n MapDictionary<String> dictionary = new MapDictionary<String>();\r\n dictionary.addEntry(new DictionaryEntry<String>(\"50 Cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"XYZ120 DVD Player\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"cent\",\"\"));\r\n dictionary.addEntry(new DictionaryEntry<String>(\"dvd player\",\"\"));\r\n\r\n // build the dictionary-chunker:\r\n // dictionary, tokenizer factory, flag1, flag2\r\n // tokenizer will ignore thre blank space in the matching process\r\n // all matches flag:\r\n // sensitive flag: when case sensitivity is enabled, \r\n ExactDictionaryChunker dictionaryChunkerTT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerTF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n true,false);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFT\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,true);\r\n\r\n ExactDictionaryChunker dictionaryChunkerFF\r\n = new ExactDictionaryChunker(dictionary,\r\n IndoEuropeanTokenizerFactory.INSTANCE,\r\n false,false);\r\n\r\n\r\n\r\n System.out.println(\"\\nDICTIONARY\\n\" + dictionary);\r\n \r\n String text = \"50 Cent is hard to distinguish from 50 cent and just plain cent without case.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n \r\n text = \"The product xyz120 DVD player won't match unless it's exact like XYZ120 DVD Player.\";\r\n System.out.println(\"TEXT=\" + text);\r\n chunk(dictionaryChunkerFF,text);\r\n\r\n }", "public void calculate() {\n int result = 0;\n hashMap.clear();\n numOfLetters.clear(); // numOfLetters contains number of letters from the line\n controlList.clear(); // controlList contains the unique number of letters\n\n findNumberOfLetters();\n\n for (int count : numOfLetters) {\n for (int i = count; i > 0 ; i--) { // starting the count of first letter, control the controlList elements\n if(controlList.contains(i)) { // if controlList contains the number, that means we must delete one letter\n result++; // we increment result while deleting letter\n }\n else {\n controlList.add(i); // if the controlList does not contain the number, we dont need delete letter\n break; // when we find the number that controlList does not contain, it means we find the unique number for a letter.\n }\n }\n }\n\n System.out.println(lineNumber + \"- \" + result); // print the result\n lineNumber++;\n }", "public static void main(String[] args) {\n\t\t\tList<String> hrLeaders = new ArrayList<>();\n\t\t\thrLeaders.add(\"762 - Barry Bonds\");\n\t\t\thrLeaders.add(\"755 - Hank Aaron\");\n\t\t\thrLeaders.add(\"714 - Babe Ruth\");\n\t\t\thrLeaders.add(\"687 - Alex Rodriquez\");\n\t\t\thrLeaders.add(\"686 - Brandon Davis\");\n\t\t\thrLeaders.add(\"686 - Brandon Davis\");\n\t\t\thrLeaders.add(\"660 - Willie Mays\");\n\t\t\t\n\t\t\tSystem.out.println(\"*****LIST EXAMPLE*****\");\n\t\t\tSystem.out.println(\"Here are the top \" + hrLeaders.size() + \" homerun leaders of all time!\");\n\t\t\tSystem.out.print(hrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\thrLeaders.set(0, \"763 - Mike Trout\");\n\t\t\tSystem.out.println(\"Updated Home Run List \\n\" + hrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\t\t\t\n\t\t\tSystem.out.print(\"Sorted Set after passing into TreeSet: \\n\"); \n\t Set<String> tree_Set1 = new TreeSet<String>(hrLeaders); \n\t System.out.println(tree_Set1);\n\t \n\t System.out.print( \"\\n\\n\" );\t\n\t\t\t\n\t\t\tSystem.out.print( \"_______________________________________________________________________\" );\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n\n//Map EXAMPLE//\t\t\n\t\t\tSystem.out.println(\"*****Map EXAMPLE*****\");\n\t\t\tMap<Integer, String> AhrLeaders = new HashMap<>();\n\t\t\tAhrLeaders.put(762, \"Barry Bonds\");\n\t\t\tAhrLeaders.put(755, \"Hank Aaron\");\n\t\t\tAhrLeaders.put(714, \"Babe Ruth\");\n\t\t\tAhrLeaders.put(687, \"Alex Rodriquez\");\n\t\t\tAhrLeaders.put(686, \"Brandon Davis\");\n\t\t\tAhrLeaders.put(686, \"Brandon Davis\");\n\t\t\tAhrLeaders.put(660, \"Willie Mays\");\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Here are the top \" + AhrLeaders.size() + \" homerun leaders of all time!\");\n\t\t\tSystem.out.print(AhrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n\t\t\tArrayList<Integer> keyList = new ArrayList<Integer>(AhrLeaders.keySet());\n\t\t ArrayList<String> valueList = new ArrayList<String>(AhrLeaders.values());\n\n\t\t System.out.println(\"Top Homerun Leaders by number of Homeruns ::\"+keyList);\n\t\t System.out.println(\"Top Homerun Leaders by Name ::\"+valueList);\n\t\t\t\n\t\t System.out.print( \"_______________________________________________________________________\" );\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n//Set EXAMPLE and Treeset//\t\t\n\t\t\tSystem.out.println(\"*****Set EXAMPLE*****\");\n\t\t\tSet<String> BhrLeaders = new HashSet<String>();\n\t\t\tBhrLeaders.add(\"762 - Barry Bonds\");\n\t\t\tBhrLeaders.add(\"755 - Hank Aaron\");\n\t\t\tBhrLeaders.add(\"714 - Babe Ruth\");\n\t\t\tBhrLeaders.add(\"687 - Alex Rodriquez\");\n\t\t\tBhrLeaders.add(\"686 - Brandon Davis\");\n\t\t\tBhrLeaders.add(\"686 - Brandon Davis\");\n\t\t\tBhrLeaders.add(\"660 - Willie Mays\");\n\t\t\t\n\t\t\t\n\t\t\tSystem.out.println(\"Here are the top \" + BhrLeaders.size() + \" homerun leaders of all time!\");\n\t\t\tSystem.out.print(BhrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\n\t\t\tBhrLeaders.add(\"661 - Mike Trout\"); \n\t\t\tSystem.out.println(\"Updated Home Run List: \\n\" + BhrLeaders);\n\t\t\t\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\t\t\t\n\t\t\tSystem.out.print(\"Sorted Set after passing into TreeSet: \\n\"); \n\t Set<String> tree_Set = new TreeSet<String>(BhrLeaders); \n\t System.out.println(tree_Set);\n\t\t\t\n\t System.out.print( \"_______________________________________________________________________\" );\n\t\t\tSystem.out.print( \"\\n\\n\" );\n\n//Queue EXAMPLE//\t\t\n\t\t\tSystem.out.println(\"*****QUEUE EXAMPLE*****\");\n\t\t\t\n\t\t\tList<String> listhrLeaders = Arrays.asList(\"Barry Bond - 762\", \"Hank Aaron - 755\", \"Babe Ruth - 714\", \"Alex Rodriequez - 687\", \"Brandon Davis - 686\", \"Brandon Davis - 686\", \"Willie Mays - 660\");\n\t\t\tQueue<String> queueNames = new LinkedList<>(listhrLeaders);\n\t\t\tSystem.out.println(queueNames);\n\t\t\t\n\t\t\tqueueNames.add(\"661 - Mike Trout\");\n\t\t\tqueueNames.add(\"660 - Bryce Harper\");\n\t\t\tSystem.out.println(queueNames);\n\t\t\t\n\t\t\t\t\t\n\t\n\t}", "public static void main(String[] args) throws IOException {\n\n String file = \"C:/Java Projects/java-web-dev-exercises/src/exercises/CountingCharsSentence.txt\";\n Path path = Paths.get(file);\n List<String> lines = Files.readAllLines(path);\n Object[] string = lines.toArray();\n String string2 = Arrays.toString(string);\n\n String[] wordsInString = string2.toLowerCase().split(\"\\\\W+\");\n String rejoinedString = String.join(\"\", wordsInString);\n char[] charactersInString = rejoinedString.toCharArray();\n\n HashMap<Character, Integer> letterMap = new HashMap<>();\n\n\n for (char letter : charactersInString) {\n if (!letterMap.containsKey(letter)) {\n int letterCount = 1;\n letterMap.put(letter, letterCount);\n } else if (letterMap.containsKey(letter)) {\n letterMap.put(letter, letterMap.get(letter) + 1);\n }\n }\n\n\n System.out.println(letterMap);\n }", "private int[] addRandomLetter(String[][] level, String l) throws Exception{\r\n\t\t\r\n\t\tl = l.substring(0, 1); // FIX TO AVOID CRASHING\r\n\t\tfor(int i = 0; i<300; i++){\r\n\t\t\t// Start at a random tile\r\n\t\t\tint x = rng.nextInt(6);\r\n\t\t\tint y = rng.nextInt(6);\r\n\t\t\r\n\t\t\tif(level[x][y] == \"_\"){\r\n\t\t\t\t// If blank, just put in the char\r\n\t\t\t\tlevel[x][y] = l;\r\n\t\t\t\tint[] ret = {x,y};\r\n\t\t\t\treturn ret;\r\n\t\t\t} \r\n\t\t}\r\n\t\tthrow new Exception(\"Letter could not be placed\");\r\n\t\t\r\n\t}", "public void dfs(ArrayList<String> ans, String digits, int level, String str) {\n\t\tif (level == digits.length()) {\n ans.add(str);\n return;\n }\n \n \n //change it to ASCII code, and then get the string\n String letters = mapping[digits.charAt(level) - '0'];\n \n for (int i = 0; i < letters.length(); i++) {\n \tdfs(ans, digits, level+1, str+letters.charAt(i));\n }\n }", "private Map<String,List<String>> createExtentionMap()\r\n\t{\r\n\t\tMap<String,List<String>> extMap = new HashMap<String, List<String>>();\t\r\n\t\t\r\n\t\tfor(String material :this.materialWorkflow.getMaterial())\r\n\t\t{\r\n\t\t\tString extentions = material.substring(material.indexOf(\".\")+1,material.length());\r\n\t\t\t\r\n\t\t\tif(!extMap.containsKey(extentions))\r\n\t\t\t{\r\n\t\t\t\tList<String> materialList = new ArrayList<String>();\t\t\r\n\t\t\t\tmaterialList.add(material);\r\n\t\t\t\t\r\n\t\t\t\textMap.put(extentions, materialList);\r\n\t\t\t}else\t\t\t\r\n\t\t\t\textMap.get(extentions).add(material);\t\t\t\r\n\t\t}\t\r\n\t\t\r\n\t\treturn extMap;\t\t\r\n\t}", "public static void getPerms(HashMap<Character,Integer> freqMap,String prefix,int length,ArrayList<String> result) {\n if(length==0) {\n result.add(prefix);\n return;\n }\n for(Character c:freqMap.keySet()){\n Integer count= freqMap.get(c);\n if(count>0){\n freqMap.put(c,count-1);\n getPerms(freqMap,prefix+c,length-1,result);\n freqMap.put(c,count);\n }\n\n }\n }", "private static HashMap<String, Integer> generateWordIndex()\n\t{\n\t\tHashMap<String, Integer> wordIndex = new HashMap<String, Integer>();\n\t\tint currIndex = 0;\n\t\tStringBuffer combinedHeaders;\n\t\tfor (MP mp : Capone.getInstance().getParliament().getMPList())\n\t\t{\n\t\t\tfor (Speech sp : mp.returnSpeeches())\n\t\t\t{\n\t\t\t\tcombinedHeaders = new StringBuffer();\n\t\t\t\tcombinedHeaders.append(sp.getHeader1());\n\t\t\t\tcombinedHeaders.append(sp.getHeader2());\n\t\t\t\tfor (String str : combinedHeaders.toString().split(\" \"))\n\t\t\t\t{\n\t\t\t\t\tif (!wordIndex.containsKey(str))\n\t\t\t\t\t{\n\t\t\t\t\t\twordIndex.put(str, currIndex);\n\t\t\t\t\t\tcurrIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn wordIndex;\n\t}", "private void mapSetUp() {\n\t\tfor (int i = 0; i < allChar.length; i++) {\n\t\t\tmap.put(allChar[i], shuffledChar[i]);\n\t\t}\n\t}", "public void generateWithTrigramModel (String start) {\n\t\tRandom r = new Random();\n\t\tList<String> biList = new ArrayList<>();\n\t\tfor (Map.Entry<String, Integer> entry : this.bi.entrySet()) {\n\t\t\tif (entry.getKey().startsWith(start)) {\n\t\t\t\tfor (int i = 0; i < entry.getValue(); i++) {\n\t\t\t\t\tbiList.add(entry.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tint maxLen = 200;\n\t\tstart = biList.get(r.nextInt(biList.size()));\n\t\tStringBuilder sb = new StringBuilder(start);\n\t\tList<String> triList = null;\n\t\twhile (sb.charAt(0) != '$' || maxLen > 0) {\n\t\t\tSystem.out.print(sb.charAt(0));\n\t\t\tsb.deleteCharAt(0);\n\t\t\ttriList = new ArrayList<>();\n\t\t\tfor (Map.Entry<String, Integer> entry : this.tri.entrySet()) {\n\t\t\t\tif (entry.getKey().startsWith(sb.toString())) {\n\t\t\t\t\tfor (int i = 0; i < entry.getValue(); i++) {\n\t\t\t\t\t\ttriList.add(entry.getKey());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (triList.size() > 0) {\n\t\t\t\tsb = new StringBuilder(triList.get(r.nextInt(triList.size())));\n\t\t\t}\n\t\t\t\n\t\t\tmaxLen--;\n\t\t}\n\t\tSystem.out.println();\n\t}" ]
[ "0.64649516", "0.6243607", "0.5911263", "0.58134633", "0.5662403", "0.54527014", "0.5417487", "0.5306911", "0.52528954", "0.52515846", "0.51859325", "0.5121079", "0.51195544", "0.5109276", "0.5086711", "0.50818187", "0.5081784", "0.5080015", "0.50792855", "0.5057529", "0.50518996", "0.49826184", "0.49789897", "0.49634004", "0.49473137", "0.49457285", "0.4940968", "0.49168918", "0.49110323", "0.4908126", "0.4906872", "0.4902136", "0.4900644", "0.48960724", "0.48932883", "0.48809338", "0.48797446", "0.48739442", "0.48674724", "0.48660323", "0.48583907", "0.48577872", "0.48509413", "0.48487228", "0.4847153", "0.4841757", "0.48412478", "0.48356754", "0.48327568", "0.4831212", "0.4826602", "0.48122174", "0.48091397", "0.48075646", "0.48061907", "0.48050252", "0.4802602", "0.479833", "0.47884116", "0.47854033", "0.47817174", "0.4776979", "0.47729567", "0.47646716", "0.4758046", "0.47569484", "0.47498602", "0.47483847", "0.47480327", "0.47442845", "0.47395653", "0.47385657", "0.4728786", "0.47274247", "0.47236547", "0.4718023", "0.47148138", "0.47117713", "0.47111437", "0.47085118", "0.47083122", "0.47036275", "0.47015154", "0.46992898", "0.46974614", "0.468543", "0.4682219", "0.4673288", "0.46714237", "0.46677613", "0.46553823", "0.46535438", "0.4646395", "0.46455064", "0.46442634", "0.46397936", "0.46387535", "0.46361202", "0.463204", "0.46282774" ]
0.6559422
0
Creates the spans required for jQuery tabs to build the desired tabs
private void createTabList() throws UnsupportedEncodingException { org.mortbay.html.List tabList = new org.mortbay.html.List(org.mortbay.html.List.Unordered); tabsDiv.add(tabList); Integer tabCount = 1; for (Map.Entry letterPairs : startLetterList.entrySet()) { Character startLetter = (Character) letterPairs.getKey(); Character endLetter = (Character) letterPairs.getValue(); Link tabLink = new Link("DisplayContentTab?start=" + startLetter + "&amp;end=" + endLetter + "&amp;group=" + grouping + "&amp;type=" + type + "&amp;filter=" + filterKey + "&amp;timeKey=" + timeKey, startLetter + " - " + endLetter); Composite tabListItem = tabList.newItem(); tabListItem.add(tabLink); Block loadingDiv = new Block(Block.Div, "id='ui-tabs-" + tabCount++ + "'"); Image loadingImage = new Image(LOADING_SPINNER); loadingImage.alt("Loading..."); loadingDiv.add(loadingImage); loadingDiv.add(" Loading..."); tabsDiv.add(loadingDiv); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createTabsDiv() {\n tabsDiv = new Block(Block.Div, \"id='tabs'\");\n page.add(tabsDiv);\n }", "private void createTabs() {\r\n\t\ttabbedPane = new JTabbedPane();\r\n\t\t\r\n\t\t//changes title and status bar \r\n\t\ttabbedPane.addChangeListener((l) -> { \r\n\t\t\tint index = tabbedPane.getSelectedIndex();\r\n\t\t\tif (index < 0) {\r\n\t\t\t\tcurrentFile = \"-\";\r\n\t\t\t} else {\r\n\t\t\t\tcurrentFile = tabbedPane.getToolTipTextAt(index);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (currentFile.isEmpty()) {\t//file not yet saved\r\n\t\t\t\tcurrentFile = tabbedPane.getTitleAt(tabbedPane.getSelectedIndex());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTitle(currentFile + \" - JNotepad++\");\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tJTextArea current = getSelectedTextArea();\r\n\t\t\tif (current == null) return;\r\n\t\t\tCaretListener[] listeners = current.getCaretListeners();\r\n\t\t\tlisteners[0].caretUpdate(new CaretEvent(current) {\r\n\t\t\t\t\r\n\t\t\t\t/**\r\n\t\t\t\t * Serial UID.\r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = 1L;\r\n\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getMark() {\r\n\t\t\t\t\treturn 0;\t//not used\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic int getDot() {\r\n\t\t\t\t\treturn current.getCaretPosition();\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t});\r\n\t\t\r\n\t\tcreateSingleTab(null, null);\r\n\t\tgetContentPane().add(tabbedPane, BorderLayout.CENTER);\t\r\n\t}", "private void createView() {\n\t\tTabWidget tWidget = (TabWidget) findViewById(android.R.id.tabs);\r\n\t\tshowLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView = (ImageView) showLayout.getChildAt(0);\r\n\t\tTextView textView = (TextView) showLayout.getChildAt(1);\r\n\t\timageView.setImageResource(R.drawable.main_selector);\r\n\t\ttextView.setText(R.string.show);\r\n\r\n\t\taddLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView1 = (ImageView) addLayout.getChildAt(0);\r\n\t\tTextView textView1 = (TextView) addLayout.getChildAt(1);\r\n\t\timageView1.setImageResource(R.drawable.add_selector);\r\n\t\ttextView1.setText(R.string.add_record);\r\n\r\n\t\tchartLayout = (LinearLayout) LayoutInflater.from(this).inflate(\r\n\t\t\t\tR.layout.tab_layout, tWidget, false);\r\n\t\tImageView imageView2 = (ImageView) chartLayout.getChildAt(0);\r\n\t\tTextView textView2 = (TextView) chartLayout.getChildAt(1);\r\n\t\timageView2.setImageResource(R.drawable.chart_selector);\r\n\t\ttextView2.setText(R.string.chart_show);\r\n\t}", "private void setupTabs() {\n }", "private void addTabs() {\n TabsPagerAdapter tabsAdapter = new TabsPagerAdapter(getSupportFragmentManager());\n viewPager = (ViewPager) findViewById(R.id.pager);\n viewPager.setAdapter(tabsAdapter);\n\n TabLayout tabLayout = (TabLayout) findViewById(R.id.tabLayout);\n tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);\n tabLayout.setupWithViewPager(viewPager);\n\n tabLayout.getTabAt(0).setIcon(R.drawable.connect);\n tabLayout.getTabAt(1).setIcon(R.drawable.speak);\n tabLayout.getTabAt(2).setIcon(R.drawable.walk);\n tabLayout.getTabAt(3).setIcon(R.drawable.camera);\n tabLayout.getTabAt(4).setIcon(R.drawable.moves);\n }", "private void initTabs() {\n\t\tmContainer.removeAllViews();\n\n\t\tif(mAdapter==null||mViewPager==null){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tfor(int i=0;i<mViewPager.getAdapter().getCount();i++){\n\t\t\tfinal int index=i;\n\t\t\tButton tabs= (Button) mAdapter.getView(index);\n\t\t\tLayoutParams layoutParams=new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);\n\t\t\tlayoutParams.weight=1;\n\t\t\tmContainer.addView(tabs,layoutParams);\n\t\t\t\n\t\t\ttabs.setOnClickListener(new OnClickListener(){\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\tif(mViewPager.getCurrentItem()==index){\n\t\t\t\t\t\tselectTab(index);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmViewPager.setCurrentItem(index, true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t\tselectTab(0);\n\t}", "private void initTabs() {\n\t\tJPanel newTab = new JPanel();\r\n\t\taddTab(\"\", newTab); //$NON-NLS-1$\r\n\t\tsetTabComponentAt(0, new NewPaneButton());\r\n\t\tsetEnabledAt(0, false);\r\n\t\t// Add a new pane\r\n\t\taddPane();\r\n }", "private void createTab() {\n tab = new char[tabSize];\n for (int i = 0; i < tabSize; i++) {\n tab[i] = tabChar;\n }\n }", "private void setupTabLayout() {\n tabLayout = (TabLayout) findViewById(R.id.tabs);\n tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n onTabTapped(tab.getPosition());\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n onTabTapped(tab.getPosition());\n }\n });\n tabLayout.getTabAt(0).select();\n View root = tabLayout.getChildAt(0);\n //create divider between the tabs\n if (root instanceof LinearLayout) {\n ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);\n GradientDrawable drawable = new GradientDrawable();\n drawable.setColorFilter(0xffff0000, PorterDuff.Mode.MULTIPLY);\n drawable.setSize(2, 1);\n ((LinearLayout) root).setDividerPadding(10);\n ((LinearLayout) root).setDividerDrawable(drawable);\n }\n }", "private void setTabLayout() {\n View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n TextView title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n ImageView imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.MOVIES);\n imgIcon.setImageResource(R.mipmap.ic_home);\n mTabLayout.getTabAt(0).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n count = (TextView) view.findViewById(R.id.item_tablayout_count_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.FAVOURITE);\n imgIcon.setImageResource(R.mipmap.ic_favorite);\n count.setVisibility(View.VISIBLE);\n mTabLayout.getTabAt(1).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.SETTINGS);\n imgIcon.setImageResource(R.mipmap.ic_settings);\n mTabLayout.getTabAt(2).setCustomView(view);\n\n view =\n LayoutInflater.from(getApplicationContext()).inflate(R.layout.tab_layout_item, null);\n title = (TextView) view.findViewById(R.id.item_tablayout_title_txt);\n imgIcon = (ImageView) view.findViewById(R.id.item_tablayout_img);\n title.setText(Constants.ABOUT);\n imgIcon.setImageResource(R.mipmap.ic_info);\n mTabLayout.getTabAt(3).setCustomView(view);\n }", "SPAN createSPAN();", "private void addTabs(List<TemplateAttribute> templateAttributes, TemplateRelation tr) {\n ObjectGroupTab otv = null;\n int prevTgId = 0;\n for (TemplateAttribute ta : templateAttributes) {\n if (ta.getTgId() != prevTgId) {\n prevTgId = ta.getTgId();\n if (ta.getTg().getSubRank() == 0) {\n otv = tr == null ? new ObjectGroupTab(this, ta.getTg())\n : new ObjectRelationGroupTab(this, tr, ta.getTg());\n add(otv, ta.getTg().getName());\n final int iTab = getTabBar().getTabCount() - 1;\n getTabBar().getTab(iTab).addClickHandler(new ClickHandler() {\n\n @Override\n public void onClick(ClickEvent event) {\n getModel().setTemplateRelation(null);\n }\n });\n }\n otv.displayGroupLabel(ta.getTg());\n }\n\n TemplateWidget tw = otv.display(ta);\n if (tw != null)\n tw.initialize();\n }\n if (getTabBar().getTabCount() > 0)\n selectTab(0);\n }", "public void initializeTabs() {\n\n\t\tTabHost.TabSpec spec;\n\n\t\tspec = mTabHost.newTabSpec(Const.EVENTS);\n\t\tmTabHost.setCurrentTab(0);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_events_selector));\n\t\tmTabHost.addTab(spec);\n\n\t\tmTabHost.setCurrentTab(1);\n\t\tspec = mTabHost.newTabSpec(Const.FEED);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_feed_selector));\n\t\tmTabHost.addTab(spec);\n\n\t\tmTabHost.setCurrentTab(2);\n\t\tspec = mTabHost.newTabSpec(Const.INFO);\n\t\tspec.setContent(new TabHost.TabContentFactory() {\n\t\t\tpublic View createTabContent(String tag) {\n\t\t\t\treturn findViewById(R.id.realtabcontent);\n\t\t\t}\n\t\t});\n\t\tspec.setIndicator(createTabView(R.drawable.tab_info_selector));\n\t\tmTabHost.addTab(spec);\n\n\t}", "private VTabSheet initTabLayout() {\r\n VTabSheet tabs = new VTabSheet();\r\n Map<Component, Integer> tabComponentMap = new HashMap<Component, Integer>();\r\n Binder<Report> binder = new Binder<>(Report.class);\r\n fireEventTypeComponent = new FireEventTypeDataTab(report,userNeedToPrepare, binder, tabComponentMap);\r\n boolean basicEditRight = !report.getStatus().equals(ReportStatus.APPROVED) && (organizationIsCreator || userNeedToPrepare);\r\n tabs.addTab(getTranslation(\"reportView.tab.basicData.label\"), new ReportBasicDataTab(report, binder, basicEditRight, tabComponentMap, addressServiceRef.get(), this));\r\n tabs.addTab(getTranslation(\"reportView.tab.forcesData.label\"), new ReportForcesTab(report, userNeedToPrepare, organizationServiceRef.get(), vechileServiceRef.get(), reportServiceRef.get()));\r\n fireEventTab = tabs.addTab(getTranslation(\"reportView.tab.fireEventData.label\"), fireEventTypeComponent);\r\n tabs.addTab(getTranslation(\"reportView.tab.authorizationData.label\"), new ReportAuthorizationTab(report, binder, userNeedToPrepare, (userNeedToPrepare || userNeedToApprove), tabs, tabComponentMap, organizationServiceRef.get(), reportServiceRef.get(), notificationServiceRef.get()));\r\n return tabs;\r\n }", "private void initTab()\n {\n \n }", "private void eric_function()\n\t{\n \ttabHost = (TabHost) findViewById(R.id.mytab1);\n \ttabHost.setup();\n \t \n \t//tabHost.setBackgroundColor(Color.argb(150, 20, 80, 150));\n \ttabHost.setBackgroundResource(R.drawable.ic_launcher);\n \t\n \t\n \t//\n \tTabSpec tabSpec;\n \t// 1\n \ttabSpec = tabHost.newTabSpec(tab_list[0]);\n \ttabSpec.setIndicator(\"a.1\");\n \ttabSpec.setContent(R.id.widget_layout_blue2);\n \ttabHost.addTab(tabSpec);\n \t// 2\n \ttabSpec = tabHost.newTabSpec(tab_list[1]);\n \ttabSpec.setIndicator(\"a2\");\n \ttabSpec.setContent(R.id.widget_layout_green2);\n \ttabHost.addTab(tabSpec); \t\n \t// 3\n \ttabSpec = tabHost.newTabSpec(tab_list[2]);\n \ttabSpec.setIndicator(\"a3\");\n \ttabSpec.setContent(R.id.widget_layout_red2);\n \ttabHost.addTab(tabSpec); \t\n \t//\n\t\ttabHost.setOnTabChangedListener(listener1);\n \t//\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public NumericTextController createTabs(ControllerCore genCode) {\n\t\ttabsNTXT = new NumericTextController(\"tabs\", getParentController(controlItemSCSCLC), genCode) {\n\t\t\t@Override\n\t\t\tpublic void initialize() {\n\t\t\t\tsetLinkedController(tabs$1LBL);\n\t\t\t\tsetProperty(\"tabs\");\n\t\t\t\tsuper.initialize();\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic void createControl() {\n\t\t\t\tsuper.createControl();\n\t\t\t\tif (isValid()) {\n\t\t\t\t\tgetNumericText().setFormatter(\"######\");\n\t\t\t\t\tsetStyle(SWT.BORDER | SWT.SINGLE | SWT.RIGHT);\n\t\t\t\t\tgetControl().setLayoutData(\"width min:100:150, growx\");\n\t\t\t\t\tif (null != fieldBindManager)\n\t\t\t\t\t\tfieldBindManager = new XjcFieldBindingManager(this);\n\t\t\t\t\tgetControl().addFocusListener(new XjcFocusListener(this));\n\t\t\t\t}\n\t\t\t}\n\t\t\t@Override\n\t\t\tpublic Object convertTargetToModel(Object fromObject) {\n\t\t\t\tif (fromObject instanceof Number)\n\t\t\t\t\treturn ((BigDecimal) fromObject).intValue();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\t\treturn tabsNTXT;\n\t}", "private void createTabs(){\n canvasPanel = new JPanel();\n canvasPanel.setLayout(new BorderLayout());\n canvasPanel.add(mCanvas, BorderLayout.CENTER);\n canvasPanel.setMinimumSize(new Dimension(100,50));\n \n // Create the options and properties panel\n optionPanel = new JPanel();\n optionPanel.setLayout(new FlowLayout());\n\n // Set the size\n optionPanel.setMinimumSize(new Dimension(30,30));\t\n optionPanel.setPreferredSize(new Dimension(200,10));\n\n // Create the log area\n mLogArea = new JTextArea(5,20);\n mLogArea.setMargin(new Insets(5,5,5,5));\n mLogArea.setEditable(false);\n JScrollPane logScrollPane = new JScrollPane(mLogArea);\n \n // Das SplitPanel wird in optionPanel (links) und canvasPanel (rechts) unterteilt\n JSplitPane split = new JSplitPane();\n split.setOrientation(JSplitPane.HORIZONTAL_SPLIT);\n split.setLeftComponent(canvasPanel);\n split.setRightComponent(optionPanel);\n \n JSplitPane splitLog = new JSplitPane();\n splitLog.setOrientation(JSplitPane.VERTICAL_SPLIT);\n splitLog.setBottomComponent(logScrollPane);\n splitLog.setTopComponent(split);\n splitLog.setResizeWeight(1);\n \n mMainFrame.add(splitLog, BorderLayout.CENTER); \n }", "private void setTab() {\n\t\tTabHost.TabSpec showSpec = host.newTabSpec(ShowFragment.TAG);\r\n\t\tshowSpec.setIndicator(showLayout);\r\n\t\tshowSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(showSpec);\r\n\r\n\t\tTabHost.TabSpec addSpec = host.newTabSpec(AddRecordFrag.TAG);\r\n\t\taddSpec.setIndicator(addLayout);\r\n\t\taddSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(addSpec);\r\n\r\n\t\tTabHost.TabSpec chartSpec = host.newTabSpec(ChartShowFrag.TAG);\r\n\t\tchartSpec.setIndicator(chartLayout);\r\n\t\tchartSpec.setContent(new Dumm(getBaseContext()));\r\n\t\thost.addTab(chartSpec);\r\n\t}", "public AttributedStringBuilder tabs(int tabsize) {\n/* 378 */ if (tabsize < 0) {\n/* 379 */ throw new IllegalArgumentException(\"Tab size must be non negative\");\n/* */ }\n/* 381 */ return tabs(Arrays.asList(new Integer[] { Integer.valueOf(tabsize) }));\n/* */ }", "private IcsLinearLayout createTabLayout() {\n\t\tfinal IcsLinearLayout tabLayout = (IcsLinearLayout) LayoutInflater\n\t\t\t\t.from(getContext()).inflate(\n\t\t\t\t\t\tR.layout.abs__action_bar_tab_bar_view, null);\n\t\ttabLayout.setMeasureWithLargestChildEnabled(true);\n\t\ttabLayout.setLayoutParams(new LinearLayout.LayoutParams(\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.WRAP_CONTENT,\n\t\t\t\tandroid.view.ViewGroup.LayoutParams.MATCH_PARENT));\n\t\treturn tabLayout;\n\t}", "private void addTab(String label, int drawableId, Intent i) {\n \tTabHost.TabSpec spec = tabHost.newTabSpec(label);\r\n \tView tabIndicator = LayoutInflater.from(this).inflate(R.layout.tabs, getTabWidget(), false);\r\n \tTextView title = (TextView) tabIndicator.findViewById(R.id.title);\r\n \ttitle.setText(label);\r\n// \tImageView icon = (ImageView) tabIndicator.findViewById(R.id.icon);\r\n// \ticon.setImageResource(drawableId);\r\n \tspec.setIndicator(tabIndicator).setContent(i);\r\n \ttabHost.addTab(spec);\r\n }", "private org.gwtbootstrap3.client.ui.NavTabs get_f_NavTabs42() {\n return build_f_NavTabs42();\n }", "public void applyTab();", "private void addScheduleTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n SessionsExpandableListActivity.CHILD_MODE_VISIBLE_TRACKS);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_SCHEDULE);\n spec.setIndicator(mResources.getString(R.string.schedule), mResources\n .getDrawable(R.drawable.ic_tab_schedule));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "private void createTabFolder() {\r\n\t\tGridData gridData1 = new GridData();\r\n\t\tgridData1.grabExcessHorizontalSpace = true;\r\n\t\tgridData1.heightHint = 500;\r\n\t\tgridData1.grabExcessVerticalSpace = true;\r\n\t\tgridData1.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;\r\n\t\tgridData1.widthHint = 600;\r\n\t\ttabFolder = new TabFolder(sShell, SWT.NONE);\r\n\t\ttabFolder.setLayoutData(gridData1);\r\n\t\tcreateCompositeRoomMange();\r\n\t\tcreateCompositeGoodsMange();\r\n\t\tcreateCompositeStaffMange();\r\n\t\tcreateCompositeUserMange();\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"房间管理\");\r\n\t\ttabItem.setControl(compositeRoomMange);\r\n\t\tTabItem tabItem1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem1.setText(\"商品管理\");\r\n\t\ttabItem1.setControl(compositeGoodsMange);\r\n\t\tTabItem tabItem2 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem2.setText(\"员工管理\");\r\n\t\ttabItem2.setControl(compositeStaffMange);\r\n\t\tTabItem tabItem3 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem3.setText(\"系统用户管理\");\r\n\t\ttabItem3.setControl(compositeUserMange);\r\n\t}", "public KonTabbedPane() {\n // Initialize the ArrayList\n graphInterfaces = new ArrayList<DrawingLibraryInterface>();\n\n DirectedGraph<String, DefaultEdge> graph = CreateTestGraph();\n\n /*\n * Adds a tab\n */\n DrawingLibraryInterface<String, DefaultEdge> graphInterface =\n DrawingLibraryFactory.createNewInterface(graph);\n \n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n addTab(\"First Tab\", graphInterface.getPanel());\n\n /*\n * Adds a tab\n */\n graphInterface = DrawingLibraryFactory.createNewInterface(graph);\n graphInterfaces.add(graphInterface);\n\n // Adds the graph to the tab and adds the tab to the pane\n add(graphInterface.getPanel());\n\n graphInterface.getGraphManipulationInterface().highlightNode(graph\n .vertexSet().iterator().next(), true);\n\n addTab(\"Second Tab\", graphInterface.getPanel());\n }", "private void layoutTabs() {\n\tJTabbedPane tabs = new JTabbedPane();\n\ttabs.add(\"MAIN MENU\", mainMenu);\n\ttabs.add(\"LEVEL EDITOR\", levelEditor);\n\tthis.getContentPane().add(tabs);\n }", "@Override\n\tpublic void addTab(Tab tab, int position) {\n\t\t\n\t}", "private void fuenteTab() {\n\n\n View view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n TextView tv=(TextView) view.findViewById(R.id.pestanias_txt);\n ImageView imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.detalles);\n tv.setTypeface(fuente2);\n tv.setText(\"Detalles\");\n tabLayout.getTabAt(0).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.marciano);\n tv.setTypeface(fuente2);\n tv.setText(\"Juegos\");\n tabLayout.getTabAt(1).setCustomView(view);\n\n view=LayoutInflater.from(this).inflate(R.layout.vista_pestanias,null);\n tv=(TextView) view.findViewById(R.id.pestanias_txt);\n imv=(ImageView) view.findViewById(R.id.imagenPestanias);\n imv.setImageResource(R.drawable.tienda);\n tv.setTypeface(fuente2);\n tv.setText(\"Tienda\");\n tabLayout.getTabAt(2).setCustomView(view);\n\n }", "public void buildStagingPanel() {\n if (tabbedPane == null) {\n tabbedPane = new JTabbedPane(SwingConstants.TOP);\n tabbedPane.addTab(\"Query\", _widgetPanel);\n tabbedPane.addTab(om.getProgramName(), om.getTreePanel());\n tabbedPane.addTab(\"Calibrations\", calibrationMenu);\n tabbedPane.setVisible(true);\n } else {\n tabbedPane.setTitleAt(1, om.getProgramName());\n }\n\n tabbedPane.setSelectedIndex(1);\n }", "protected void createContents() {\r\n\t\tshell = new Shell();\r\n\t\tshell.setSize(450, 300);\r\n\t\tshell.setText(\"SWT Application\");\r\n\t\tshell.setLayout(new FillLayout(SWT.HORIZONTAL));\r\n\t\t\r\n\t\tfinal TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\r\n\t\ttabFolder.setToolTipText(\"\");\r\n\t\t\r\n\t\tTabItem tabItem = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem.setText(\"欢迎使用\");\r\n\t\t\r\n\t\tTabItem tabItem_1 = new TabItem(tabFolder, SWT.NONE);\r\n\t\ttabItem_1.setText(\"员工查询\");\r\n\t\t\r\n\t\tMenu menu = new Menu(shell, SWT.BAR);\r\n\t\tshell.setMenuBar(menu);\r\n\t\t\r\n\t\tMenuItem menuItem = new MenuItem(menu, SWT.NONE);\r\n\t\tmenuItem.setText(\"系统管理\");\r\n\t\t\r\n\t\tMenuItem menuItem_1 = new MenuItem(menu, SWT.CASCADE);\r\n\t\tmenuItem_1.setText(\"员工管理\");\r\n\t\t\r\n\t\tMenu menu_1 = new Menu(menuItem_1);\r\n\t\tmenuItem_1.setMenu(menu_1);\r\n\t\t\r\n\t\tMenuItem menuItem_2 = new MenuItem(menu_1, SWT.NONE);\r\n\t\tmenuItem_2.addSelectionListener(new SelectionAdapter() {\r\n\t\t\t@Override\r\n\t\t\tpublic void widgetSelected(SelectionEvent e) {\r\n\t\t\t\tTabItem tbtmNewItem = new TabItem(tabFolder,SWT.NONE);\r\n\t\t\t\ttbtmNewItem.setText(\"员工查询\");\r\n\t\t\t\t//创建自定义组件\r\n\t\t\t\tEmpQueryCmp eqc = new EmpQueryCmp(tabFolder, SWT.NONE);\r\n\t\t\t\t//设置标签显示的自定义组件\r\n\t\t\t\ttbtmNewItem.setControl(eqc);\r\n\t\t\t\t\r\n\t\t\t\t//选中当前标签页\r\n\t\t\t\ttabFolder.setSelection(tbtmNewItem);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\tmenuItem_2.setText(\"员工查询\");\r\n\r\n\t}", "private void initTabs()\n {\n updateDayTab();\n\n // Set initial time on time tab\n updateTimeTab();\n }", "private void setupTab() {\n setLayout(new BorderLayout());\n JSplitPane mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);\n mainSplit.setDividerLocation(160);\n mainSplit.setBorder(BorderFactory.createEmptyBorder());\n\n // set up the MBean tree panel (left pane)\n tree = new XTree(this);\n tree.setCellRenderer(new XTreeRenderer());\n tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);\n tree.addTreeSelectionListener(this);\n tree.addTreeWillExpandListener(this);\n tree.addMouseListener(ml);\n JScrollPane theScrollPane = new JScrollPane(tree, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,\n JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);\n JPanel treePanel = new JPanel(new BorderLayout());\n treePanel.add(theScrollPane, BorderLayout.CENTER);\n mainSplit.add(treePanel, JSplitPane.LEFT, 0);\n\n // set up the MBean sheet panel (right pane)\n viewer = new XDataViewer(this);\n sheet = new XSheet(this);\n mainSplit.add(sheet, JSplitPane.RIGHT, 0);\n\n add(mainSplit);\n }", "public void createTabs(ILaunchConfigurationDialog dialog, String mode) {\n setTabs(new ILaunchConfigurationTab[] { new JavaArgumentsTab(),\n new JavaJRETab(), new JavaClasspathTab(), new CommonTab() });\n }", "public void SlidingTab(){\n adapter = new ViewPagerShoppingAdapter(getSupportFragmentManager(),Titles,Numboftabs);\r\n\r\n // Assigning ViewPager View and setting the adapter\r\n pager = (ViewPager) findViewById(R.id.pager);\r\n pager.setAdapter(adapter);\r\n\r\n // Assiging the Sliding Tab Layout View\r\n tabs = (SlidingTabLayout) findViewById(R.id.tabs);\r\n tabs.setDistributeEvenly(true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in Available width\r\n\r\n // Setting Custom Color for the Scroll bar indicator of the Tab View\r\n tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {\r\n @Override\r\n public int getIndicatorColor(int position) {\r\n return getResources().getColor(R.color.tabsScrollColor);\r\n }\r\n });\r\n\r\n // Setting the ViewPager For the SlidingTabsLayout\r\n tabs.setViewPager(pager);\r\n }", "@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tLog.e(tag,tag+\"=>onCreate \");\n\t\t// Define the Tab structure\n\t\tsetContentView(R.layout.main);\n\t\t// Retrieve the ressource to access to the icon\n\t\tResources resources = getResources(); // Resource object to get Drawables\n\t\t// Set the tabHost (set it has final to use it in the OnTabChangeListener)\n\t\tfinal TabHost tabHost = getTabHost();\n\t\t// Define the tabSpec that can be thought has the content of the TabPanel\n\t\tTabHost.TabSpec tabSpec;\n\t\t// Define the intent that is used to populate the tabSpec\n\t\tIntent intent;\n\n\t\t// Create an Intent to launch an Activity for the tab\n\t\tintent = new Intent().setClass(this, Android2eeWebSTI.class);\n\n\t\t// Initialize a TabSpec for each tab and add it to the TabHost\n\t\t// Get a new TabHost.TabSpec associated with this tab host.\n\t\ttabSpec = tabHost.newTabSpec(\"Android2ee\");\n\t\t// Define its indicator the label displayed (it should be\n\t\t// ressources.getString(R.string.stringId)\n\t\ttabSpec.setIndicator(\"Android2EE\", resources.getDrawable(R.drawable.ic_tab));\n\t\t// Define the content of the Spec (the TabPanel)\n\t\ttabSpec.setContent(intent);\n\t\t// Add it to the tab container\n\t\ttabHost.addTab(tabSpec);\n\n\t\t// Do the same with the tab that displays a simple TextView:\n\t\t// Define the intent that will be displayed\n\t\tintent = new Intent().setClass(this, TextViewActivity.class);\n\t\t// Get a new TabHost.TabSpec associated with this tab host.\n\t\ttabSpec = tabHost.newTabSpec(\"textView\");\n\t\t// Define its indicator the label displayed (it should be\n\t\t// ressources.getString(R.string.stringId)\n\t\ttabSpec.setIndicator(\"TextView\", resources.getDrawable(R.drawable.ic_tab));\n\t\t// Define the content of the Spec (the TabPanel)\n\t\ttabSpec.setContent(intent);\n\t\t// Add it to the tab container\n\t\ttabHost.addTab(tabSpec);\n\t\t\n\t\t// Do the same with the tab that displays a simple Clock (analogic and digital):\n\t\t// Define the intent that will be displayed\n\t\tintent = new Intent().setClass(this, ClockAD.class);\n\t\t// Get a new TabHost.TabSpec associated with this tab host.\n\t\ttabSpec = tabHost.newTabSpec(\"clock\");\n\t\t// Define its indicator the label displayed\n\t\ttabSpec.setIndicator(\"Clock\", resources.getDrawable(R.drawable.ic_tab));\n\t\t// Define the content of the Spec (the TabPanel)\n\t\ttabSpec.setContent(intent);\n\t\t// Add it to the tab container\n\t\ttabHost.addTab(tabSpec);\n\t\t\n\t\t\n\t\t//Define the current tab displayed (here the clock)\n\t\ttabHost.setCurrentTab(2);\n\t\t//Add a listener that just displays a Toast with the tag of the new selected tab\n\t\ttabHost.setOnTabChangedListener(new OnTabChangeListener() {\n\t\t\t@Override\n\t\t\tpublic void onTabChanged(String tabId) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"New tab selection : \" + tabHost.getCurrentTabTag(),\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t}\n\t\t});\n\n\t}", "@Override\r\n protected Control createContents( final Composite parent ) {\r\n TabFolder folder = new TabFolder( parent, SWT.NONE );\r\n\r\n Tab appearanceTab = new AppearanceTab( overlayStore );\r\n createTab( folder, \"Appeara&nce\", appearanceTab.createControl( folder ) );\r\n\r\n Tab syntaxTab = new SyntaxTab( overlayStore );\r\n createTab( folder, \"Synta&x\", syntaxTab.createControl( folder ) );\r\n\r\n Tab annotationsTab = new AnnotationsTab( overlayStore );\r\n createTab( folder, \"Annotation&s\", annotationsTab.createControl( folder ) );\r\n\r\n Tab typingTab = new TypingTab( overlayStore );\r\n createTab( folder, \"T&yping\", typingTab.createControl( folder ) );\r\n\r\n return folder;\r\n }", "public TabPaneLike(TabSide side, TabLabelCreator tabLabelCreator){\n BorderPane bp = new BorderPane();\n\n this.tabLabelCreator = tabLabelCreator;\n\n getChildren().add(bp);\n\n bp.maxWidthProperty().bind(widthProperty());\n bp.minWidthProperty().bind(widthProperty());\n bp.prefWidthProperty().bind(widthProperty());\n\n bp.maxHeightProperty().bind(heightProperty());\n bp.minHeightProperty().bind(heightProperty());\n bp.prefHeightProperty().bind(heightProperty());\n\n\n tabContent = new StackPane();\n tabs = new LinkedList<>();\n\n switch(side){\n case TOP -> {\n nameTab = new HBox();\n tabLabelCreator.setHeights(nameTab);\n bp.setTop(nameTab);\n }\n case BOTTOM -> {\n nameTab = new HBox();\n tabLabelCreator.setHeights(nameTab);\n bp.setBottom(nameTab);\n }\n case RIGHT -> {\n nameTab = new VBox();\n tabLabelCreator.setWidths(nameTab);\n bp.setRight(nameTab);\n }\n case LEFT -> {\n nameTab = new VBox();\n tabLabelCreator.setWidths(nameTab);\n bp.setLeft(nameTab);\n }\n default -> nameTab = new VBox();\n\n }\n\n bp.setCenter(tabContent);\n\n nameTab.setStyle(\"-fx-background-color: lightgrey\");\n }", "private void addTracksTab() {\n Intent intent = new Intent(this, SessionsExpandableListActivity.class);\n intent.setData(Blocks.CONTENT_URI);\n //intent.putExtra(SessionsExpandableListActivity.EXTRA_CHILD_MODE,\n // SessionsExpandableListActivity.CHILD_MODE_STARRED);\n \n TabSpec spec = mTabHost.newTabSpec(TAG_TWITTER);\n spec.setIndicator(mResources.getString(R.string.tracks), mResources\n .getDrawable(R.drawable.ic_menu_archive));\n spec.setContent(intent);\n \n mTabHost.addTab(spec);\n }", "private static View createTabView(final Context context, final String text) {\r\n\t\tView view;\r\n\t\tview = LayoutInflater.from(context).inflate(\r\n\t\t\t\tR.layout.generic_tabs_custom_layout, null);\r\n\t\tTextView tv = (TextView) view.findViewById(R.id.tabsText);\r\n\t\ttv.setText(text);\r\n\t\treturn view;\r\n\t}", "private void changesetTabSelection(int i) {\n\t\tif (i == 1)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 2)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_120_name));\r\n\t\t}\r\n\t\tif (i == 3)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_60_name));\r\n\t\t}\r\n\t\tif (i == 4)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_30_name));\r\n\t\t}\r\n\t\tif (i == 5)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_20_name));\r\n\t\t}\r\n\t\tif (i == 6)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_10_name));\r\n\t\t}\r\n\t\tif (i == 7)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_group_5_name));\r\n\t\t}\r\n\t\tif (i == 8)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 9)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_24_name));\r\n\t\t}\r\n\t\tif (i == 10)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_12_name));\r\n\t\t}\r\n\t\tif (i == 11)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 12)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_three_name));\r\n\t\t}\r\n\t\tif (i == 13)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_six_name));\r\n\t\t}\r\n\t\tif (i == 14)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_sum_name));\r\n\t\t}\r\n\t\tif (i == 15)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_container_name));\r\n\t\t}\r\n\t\tif (i == 16)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_direct_double_name));\r\n\t\t}\r\n\t\tif (i == 17)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_span_name));\r\n\t\t}\r\n\t\tif (i == 18)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_three_name));\r\n\t\t}\r\n\t\tif (i == 19)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_six_name));\r\n\t\t}\r\n\t\tif (i == 20)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_sum_name));\r\n\t\t}\r\n\t\tif (i == 21)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_group_container_name));\r\n\t\t}\r\n\t\tif (i == 22)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_double_name));\r\n\t\t}\r\n\t\tif (i == 23)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 24)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_span_name));\r\n\t\t}\r\n\t\tif (i == 25)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_double_name));\r\n\t\t}\r\n\t\tif (i == 26)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_span_name));\r\n\t\t}\r\n\t\tif (i == 27)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_double_name));\r\n\t\t}\r\n\t\tif (i == 28)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_double_name));\r\n\t\t}\r\n\t\tif (i == 29)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.fixed_position_name));\r\n\t\t}\r\n\t\tif (i == 30)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_bottomthree_one_notposition_name));\r\n\t\t}\r\n\t\tif (i == 31)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_bottomthree_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 32)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_topthree_one_notposition_name));\r\n\t\t}\r\n\t\tif (i == 33)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.three_topthree_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 34)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_bottomfour_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 35)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_bottomfive_two_notposition_name));\r\n\t\t}\r\n\t\tif (i == 36)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_bottomfive_three_notposition_name));\r\n\t\t}\r\n\t\tif (i == 37)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 38)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_6_name));\r\n\t\t}\r\n\t\tif (i == 39)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_group_4_name));\r\n\t\t}\r\n\t\tif (i == 40)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_direct_sum_name));\r\n\t\t}\r\n\t\tif (i == 41)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_sum_name));\r\n\t\t}\r\n\t\tif (i == 42)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_span_name));\r\n\t\t}\r\n\t\tif (i == 43)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_sum_end_name));\r\n\t\t}\r\n\t\tif (i == 44)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_sum_end_name));\r\n\t\t}\r\n\t\tif (i == 45)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 46)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_container_name));\r\n\t\t}\r\n\t\tif (i == 47)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_container_name));\r\n\t\t}\r\n\t\tif (i == 48)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_sum_name));\r\n\t\t}\r\n\t\tif (i == 49)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_bottomfour_one_notposition_name));\r\n\t\t}\r\n\t\tif (i == 50)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_bottomtwo_name));\r\n\t\t}\r\n\t\tif (i == 51)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_bottomthree_name));\r\n\t\t}\r\n\t\tif (i == 52)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_toptwo_name));\r\n\t\t}\r\n\t\tif (i == 53)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.maxmin_topthree_name));\r\n\t\t}\r\n\t\tif (i == 54)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.five_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 55)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.four_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 56)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_three_single_name));\r\n\t\t}\r\n\t\tif (i == 57)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_group_six_single_name));\r\n\t\t}\r\n\t\tif (i == 58)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 59)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottomthree_direct_single_name));\r\n\t\t}\r\n\t\tif (i == 60)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottompthree_group_three_single_name));\r\n\t\t}\r\n\t\tif (i == 61)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottompthree_group_six_single_name));\r\n\t\t}\r\n\t\tif (i == 62)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_toptwo_single_name));\r\n\t\t}\r\n\t\tif (i == 63)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_toptwo_single_name));\r\n\t\t}\r\n\t\tif (i == 64)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_group_bottomtwo_single_name));\r\n\t\t}\r\n\t\tif (i == 65)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.two_direct_bottomtwo_single_name));\r\n\t\t}\r\n\t\tif (i == 66)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.topthree_mix_group_name));\r\n\t\t}\r\n\t\tif (i == 67)\r\n\r\n\t\t{\r\n\t\t\tsetTabSelection(getString(R.string.bottompthree_mix_group_name));\r\n\t\t}\r\n\t\twrite(i);\r\n\t}", "public void initTab(ArrayList<CircuitUsageModel> modelList) {\n\t\ttabHost = getTabHost();\n\t\tResources res = getResources();\n\n\t\t// energy\n\t\tenergySpec = tabHost.newTabSpec(\"energy\");\n\t\tenergySpec.setIndicator(getString(R.string.energy),\n\t\t\t\tres.getDrawable(R.drawable.ic_tab_energy));\n\t\t// power\n\t\tpowerSpec = tabHost.newTabSpec(\"power\");\n\t\tpowerSpec.setIndicator(getString(R.string.power),\n\t\t\t\tres.getDrawable(R.drawable.ic_tab_power));\n\t\t// credit\n\t\tcreditSpec = tabHost.newTabSpec(\"credit\");\n\t\tcreditSpec.setIndicator(getString(R.string.credit),\n\t\t\t\tres.getDrawable(R.drawable.ic_tab_credit));\n\n\t\t// set tab content\n\t\tsetTabContent(modelList);\n\t\t\n\t\t// auto refresh\n\t\tautoRefresh();\n\t}", "private void configure_tabs() {\n Objects.requireNonNull(tabs.getTabAt(0)).setIcon(R.drawable.baseline_map_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(0)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n Objects.requireNonNull(tabs.getTabAt(1)).setIcon(R.drawable.baseline_view_list_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(1)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n Objects.requireNonNull(tabs.getTabAt(2)).setIcon(R.drawable.baseline_people_white_24);\n Objects.requireNonNull(Objects.requireNonNull(tabs.getTabAt(2)).getIcon()).setColorFilter(getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n swipeRefreshLayout.setEnabled(false);\n\n // Set on Tab selected listener\n tabs.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n // Change color of the tab -> orange\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconSelected), PorterDuff.Mode.SRC_IN);\n\n // set the current page position\n current_page = tab.getPosition();\n\n // if the current page is the ListMatesFragment, remove the searchView\n if(mToolbar_navig_utils!=null){\n if(current_page==2)\n mToolbar_navig_utils.getSearchView().setVisibility(View.GONE);\n else\n mToolbar_navig_utils.getSearchView().setVisibility(View.VISIBLE);\n }\n\n // refresh title toolbar (different according to the page selected)\n if(mToolbar_navig_utils !=null)\n mToolbar_navig_utils.refresh_text_toolbar();\n\n // Disable pull to refresh when mapView is displayed\n if(tab.getPosition()==0)\n swipeRefreshLayout.setEnabled(false);\n else\n swipeRefreshLayout.setEnabled(true);\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n // if the searchView is opened, close it\n if(mToolbar_navig_utils !=null) {\n if (mToolbar_navig_utils.getSearchView() != null) {\n if (!mToolbar_navig_utils.getSearchView().isIconified()) {\n mToolbar_navig_utils.getSearchView().setIconified(true);\n\n // Recover the previous list of places nearby generated\n switch (current_page) {\n case 0:\n getPageAdapter().getMapsFragment().recover_previous_state();\n break;\n case 1:\n getPageAdapter().getListRestoFragment().recover_previous_state();\n break;\n }\n }\n }\n }\n\n // Change color of the tab -> black\n if (tab.getIcon() != null)\n tab.getIcon().setColorFilter(getApplicationContext().getResources().getColor(R.color.colorIconNotSelected), PorterDuff.Mode.SRC_IN);\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n }\n });\n }", "private void barLayoutManager(int sTab) {\n\n Fragment fragment = null;\n String title = \"\";\n\n if (selectedTab != sTab) {\n selectedTab = sTab;\n barDisableAll();\n\n switch (sTab) {\n\n case TAB_NINJA:\n fragment = NinjaFragment.newInstance();\n title = resources.getString(R.string.tab_ninja);\n imgNinja.setImageDrawable(resources.getDrawable(R.drawable.ic_banana_sel));\n tvNinja.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n case TAB_FRUITER:\n fragment = FruiterFragment.newInstance();\n title = resources.getString(R.string.tab_fruiter);\n imgFruiter.setImageDrawable(resources.getDrawable(R.drawable.ic_like_sel));\n tvFruiter.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n case TAB_HACK:\n fragment = HackXORFragment.newInstance();\n title = resources.getString(R.string.tab_hack);\n imgHack.setImageDrawable(resources.getDrawable(R.drawable.ic_lock_sel));\n tvHack.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n case TAB_NEWS:\n fragment = NewsFragment.newInstance();\n title = resources.getString(R.string.tab_news);\n imgNews.setImageDrawable(resources.getDrawable(R.drawable.ic_news_sel));\n tvNews.setTextColor(resources.getColor(R.color.barTextEnabled));\n break;\n\n default:\n break;\n }\n\n getSupportActionBar().setTitle(title);\n\n if (fragment != null) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.frame_container, fragment, \"frag\" + sTab).commit();\n supportInvalidateOptionsMenu();\n }\n }\n }", "private void setupTab(final View view, final String tag) {\r\n\t\tView tabview = createTabView(mTabHost.getContext(), tag);\r\n\r\n\t\tTabSpec setContent = mTabHost.newTabSpec(tag).setIndicator(tabview)\r\n\t\t\t\t.setContent(new TabContentFactory() {\r\n\t\t\t\t\tpublic View createTabContent(String tag) {\r\n\t\t\t\t\t\tView view;\r\n\t\t\t\t\t\tif (tag.contains(\"EXTENDED\")) {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_2_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t\t// --Assembling Widgets\r\n\t\t\t\t\t\t\tedNO = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET1);\r\n\t\t\t\t\t\t\tedNIO = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET2);\r\n\t\t\t\t\t\t\tedNP = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET3);\r\n\t\t\t\t\t\t\tedNIP = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_ET4);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tedNO.setEnabled(false);\r\n\t\t\t\t\t\t\tedNIO.setEnabled(false);\r\n\t\t\t\t\t\t\tedNP.setEnabled(false);\r\n\t\t\t\t\t\t\tedNIP.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tNO= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB1);\r\n\t\t\t\t\t\t\tNIO= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB2);\r\n\t\t\t\t\t\t\tNP= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB3);\r\n\t\t\t\t\t\t\tNIP= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB4);\r\n\t\t\t\t\t\t\tNO.setEnabled(false); \r\n\t\t\t\t\t\t\tNIO.setEnabled(false);\r\n\t\t\t\t\t\t\tNP.setEnabled(false);\r\n\t\t\t\t\t\t\tNIP.setEnabled(false);\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\textended = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules2_CB0);\r\n\t\t\t\t\t\t\textended.setOnClickListener(S3R4Listener2);\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} else if (tag.contains(\"CUSTOM\")) {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_3_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tview = LayoutInflater\r\n\t\t\t\t\t\t\t\t\t.from(mTabHost.getContext())\r\n\t\t\t\t\t\t\t\t\t.inflate(\r\n\t\t\t\t\t\t\t\t\t\t\tR.layout.appa_business_rules_1_layout,\r\n\t\t\t\t\t\t\t\t\t\t\tnull);\r\n\t\t\t\t\t\t\t// --Assembling Widgets\r\n\t\t\t\t\t\t\tedlevels = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET1);\r\n\t\t\t\t\t\t\tedSons = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET2);\r\n\t\t\t\t\t\t\tedlevel = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET3);\r\n\t\t\t\t\t\t\tedpruduct = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET4);\r\n\t\t\t\t\t\t\tedcampaign = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET5);\r\n\t\t\t\t\t\t\tedadd = (EditText) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_ET6);\r\n\t\t\t\t\t\t\tedlevels.setEnabled(false);\r\n\t\t\t\t\t\t\tedSons.setEnabled(false);\r\n\t\t\t\t\t\t\tedlevel.setEnabled(false);\r\n\t\t\t\t\t\t\tedpruduct.setEnabled(false);\r\n\t\t\t\t\t\t\tedcampaign.setEnabled(false);\r\n\t\t\t\t\t\t\tedadd.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tlevel= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB3);\r\n\t\t\t\t\t\t\tpruduct= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB4);\r\n\t\t\t\t\t\t\tcampaign= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB5);\r\n\t\t\t\t\t\t\tadd= (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB6);\r\n\t\t\t\t\t\t\tlevel.setEnabled(false); \r\n\t\t\t\t\t\t\tpruduct.setEnabled(false);\r\n\t\t\t\t\t\t\tcampaign.setEnabled(false);\r\n\t\t\t\t\t\t\tadd.setEnabled(false);\r\n\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tStructure = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB1);\r\n\t\t\t\t\t\t\tRules = (CheckBox) view\r\n\t\t\t\t\t\t\t\t\t.findViewById(R.id.business_rules1_CB2);\r\n\t\t\t\t\t\t\tStructure.setOnClickListener(S3R4Listener);\r\n\t\t\t\t\t\t\tRules.setOnClickListener(S3R4Listener);\r\n\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn view;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\tmTabHost.addTab(setContent);\r\n\r\n\t}", "private void wordMultiTabEkle(XWPFRun r, int adet)\n {\n for (int i = 0; i < adet; i++)\n r.addTab();\n }", "public JTabbedPane createPanel()\r\n {\r\n\r\n /** LoadTabPaneData Thread - Inner class that will load the historic data on the AWT\r\n * Thread as to not muck up things on the GUI thread\r\n * The Thread will die after it loads everything.\r\n */\r\n class LoadTabPaneDataTask extends TimerTask\r\n {\r\n // Handle to main outer class\r\n WatchListTableModule watchListTableModule = null;\r\n\r\n /** \r\n * LoadTabPaneDataTask constructor\r\n */\r\n public LoadTabPaneDataTask(WatchListTableModule watchListTableModule)\r\n {\r\n this.watchListTableModule = watchListTableModule;\r\n }\r\n\r\n /** \r\n * LoadTabPaneDataTask::run() this method simply invokes. \r\n * WatchListTableModule::loadPersistantWatchLists() method.\r\n * The method will populate all watchlists to be loaded on\r\n * the JTabbedPane then it dies off\r\n */\r\n public void run()\r\n {\r\n debug(\"LoadTabPaneDataTask::run() - calling watchListTableModule.loadPersistantWatchLists()\");\r\n watchListTableModule.loadPersistantWatchLists();\r\n this.cancel();\r\n }\r\n }\r\n\r\n // Create an Application Properties instance\r\n appProps = new AppProperties(getString(\"WatchListTableModule.application_ini_filename\"));\r\n // Setup our Time Delays\r\n standardDelay = ONE_SECOND * ParseData.parseNum(getString(\"WatchListTableModule.standard_time_delay\"), ONE_MINUTE);\r\n extendedDelay = ONE_SECOND * ParseData.parseNum(getString(\"WatchListTableModule.extended_time_delay\"), ONE_HOUR);\r\n\r\n // Create our Basic Tabbed Pane and Listener ( inner class )\r\n tabPane = new JTabbedPane();\r\n tabPane.addChangeListener(new TabPaneListener());\r\n\r\n // Load the Tab Pane Data on the Util Event Thread as \r\n // to get our screen up and going as fast as possible\r\n // So we can get out of here - This Inner class thread\r\n // invokes method\r\n // loadPersistantWatchLists();\r\n TimerTask tabPaneTask = new LoadTabPaneDataTask(this);\r\n Timer timer = new Timer(true); // Deamon\r\n timer.schedule(tabPaneTask, ONE_SECOND);\r\n\r\n return tabPane;\r\n }", "public JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n start =0;\n setContentView(R.layout.tabs);\n th = (TabHost)findViewById(R.id.tabHost);\n Button newtab = (Button)findViewById(R.id.bAddTab);\n Button bStart = (Button)findViewById(R.id.bStartWatch);\n Button bStop = (Button)findViewById(R.id.bStopWatch);\n showResults = (TextView)findViewById(R.id.textView);\n bStart.setOnClickListener(this);\n bStop.setOnClickListener(this);\n newtab.setOnClickListener(this);\n th.setup();\n TabHost.TabSpec specs = th.newTabSpec(\"tag1\");\n specs.setContent(R.id.tab1); //the linear layout we set up in tabhost\n specs.setIndicator(\"StopWatch\");\n th.addTab(specs);\n specs = th.newTabSpec(\"tag2\");\n specs.setContent(R.id.tab2); //the linear layout we set up in tabhost\n specs.setIndicator(\"Tab 2\");\n th.addTab(specs);\n specs = th.newTabSpec(\"tag3\");\n specs.setContent(R.id.tab3); //the linear layout we set up in tabhost\n specs.setIndicator(\"Add a tab\");\n th.addTab(specs);\n\n }", "public void addNewTab() {\n int count = workspaceTabs.getComponentCount() + 1;\n String title = \"Workspace \" + count;\n WorkspacePanel panel = new WorkspacePanel(title);\n DropHandler dropHandler = searchMenu.createDropHandler(panel.getBaseLayout());\n panel.setDropHandler(dropHandler);\n workspaceTabs.addTab(panel).setCaption(title);\n }", "Span createSpan();", "private void initView() {\n\n LinearLayout bar = (LinearLayout) LayoutInflater.from(mContext).inflate(R.layout.bottom_bar, null);\n LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\n addView(bar, lp);\n tab1= (LinearLayout) bar.findViewById(R.id.tab1);\n tab2= (LinearLayout) bar.findViewById(R.id.tab2);\n tab3= (LinearLayout) bar.findViewById(R.id.tab3);\n tab4= (LinearLayout) bar.findViewById(R.id.tab4);\n ivTab1= (ImageView) bar.findViewById(R.id.ivTab1);\n tvTab1= (TextView) bar.findViewById(R.id.tvTab1);\n ivTab2= (ImageView) bar.findViewById(R.id.ivTab2);\n tvTab2= (TextView) bar.findViewById(R.id.tvTab2);\n ivTab3= (ImageView) bar.findViewById(R.id.ivTab3);\n tvTab3= (TextView) bar.findViewById(R.id.tvTab3);\n ivTab4= (ImageView) bar.findViewById(R.id.ivTab4);\n tvTab4= (TextView) bar.findViewById(R.id.tvTab4);\n\n tab1.setOnClickListener(this);\n tab2.setOnClickListener(this);\n tab3.setOnClickListener(this);\n tab4.setOnClickListener(this);\n\n }", "private ArrayList<Tab> getTabs() {\n ArrayList<Tab> res = new ArrayList<Tab>();\n res.add(getRegisterTab());\n res.add(getRouleauTab());\n res.add(getCoinageTab());\n res.add(getBillTab());\n return res;\n }", "private void createNetworksPanel() {\n\t\ttabs = new ArrayList<>();\n\t\tnetworksPanel = new JTabbedPane();\n\t\tthis.add(networksPanel, BorderLayout.CENTER);\n\t}", "public void onCreateTabClicked(View view) {\n if (mAdapter.isEmpty()) {\n Toast.makeText(this, R.string.you_must_create_at_least_one_tab, Toast.LENGTH_LONG).show();\n return;\n }\n ArrayList<TabInformation> list = new ArrayList<>(mAdapter.getTabInformation());\n startActivity(new Intent(this, DisplayTabsActivity.class).putExtra(TAB_CONTENT, list));\n }", "@AfterRender\n\tpublic void afterRender() {\n\t\trenderSupport.addScript(String.format(\"new Tabber('%s', '%d');\", element.getClientId(), activeTabNum));\n\t}", "public void init(){\n tabHost = (TabHost)findViewById(android.R.id.tabhost);\n\n //Creating tab menu.\n TabHost.TabSpec TabMenu1 = tabHost.newTabSpec(\"First tab\");\n TabHost.TabSpec TabMenu2 = tabHost.newTabSpec(\"Second tab\");\n TabHost.TabSpec TabMenu3 = tabHost.newTabSpec(\"Third tab\");\n\n //Setting up tab 1 name.\n TabMenu1.setIndicator(getResources().getString(R.string.map));\n //Set tab 1 activity to tab 1 menu.\n Intent intent = new Intent(this, MapsActivity.class);\n intent.putExtra(\"studentObj\", student);\n TabMenu1.setContent(intent);\n\n\n //Setting up tab 2 name.\n TabMenu2.setIndicator(getResources().getString(R.string.people));\n intent = new Intent(this, PeopleActivity.class);\n TabMenu2.setContent(intent);\n\n //Setting up tab 2 name.\n TabMenu3.setIndicator(getResources().getString(R.string.setting));\n intent = new Intent(this, SettingActivity.class);\n TabMenu3.setContent(intent);\n\n //\n tabHost.addTab(TabMenu1);\n tabHost.addTab(TabMenu2);\n tabHost.addTab(TabMenu3);\n }", "private void initStandingTab() throws IOException {\n // THESE ARE THE CONTROLS FOR THE BASIC SCHEDULE PAGE HEADER INFO\n // WE'LL ARRANGE THEM IN A VBox\n standingsTab = new Tab();\n standingsWorkspacePane = new VBox();\n standingsWorkspacePane.getStyleClass().add(CLASS_DRAFT_PANE);\n \n // ADD PAGE LABEL & BUTTON\n Label standing = new Label();\n standing = initChildLabel(standingsWorkspacePane, DraftKit_PropertyType.STANDINGS_HEADING_LABEL, CLASS_HEADING_LABEL);\n \n PropertiesManager props = PropertiesManager.getPropertiesManager();\n String imagePath = \"file:\" + PATH_IMAGES + props.getProperty(DraftKit_PropertyType.STANDINGS_ICON);\n Image buttonImage = new Image(imagePath);\n standingsTab.setGraphic(new ImageView(buttonImage));\n \n // CREATE THE STANDINGS TABLE\n standingTable = new TableView();\n\n teamName = new TableColumn<>(\"Team Name\");\n teamName.setCellValueFactory(new PropertyValueFactory<>(\"TeamName\"));\n pNeeded = new TableColumn<>(\"Players Needed\");\n pNeeded.setCellValueFactory(new PropertyValueFactory<>(\"PlayersNeeded\"));\n moneyLeft = new TableColumn<>(\"$ Left\");\n moneyLeft.setCellValueFactory(new PropertyValueFactory<>(\"MoneyLeft\"));\n moneyPP = new TableColumn<>(\"$ PP\");\n moneyPP.setCellValueFactory(new PropertyValueFactory<>(\"MoneyPP\"));\n rEst = new TableColumn<>(\"R\");\n rEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalR\"));\n hrEst = new TableColumn<>(\"HR\");\n hrEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalHR\"));\n rbiEst = new TableColumn<>(\"RBI\");\n rbiEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalRBI\"));\n sbEst = new TableColumn<>(\"SB\");\n sbEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalSB\"));\n baEst = new TableColumn<>(\"BA\");\n baEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalBA\"));\n wEst = new TableColumn<>(\"W\");\n wEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalW\"));\n svEst = new TableColumn<>(\"SV\");\n svEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalSV\"));\n kEst = new TableColumn<>(\"K\");\n kEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalK\"));\n eraEst = new TableColumn<>(\"ERA\");\n eraEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalERA\"));\n whipEst = new TableColumn<>(\"WHIP\");\n whipEst.setCellValueFactory(new PropertyValueFactory<>(\"TotalWHIP\"));\n totalPoints = new TableColumn<>(\"Total Points\");\n totalPoints.setCellValueFactory(new PropertyValueFactory<>(\"TotalPoints\"));\n \n standingTable.getColumns().addAll(teamName, pNeeded, moneyLeft, moneyPP, rEst,\n hrEst, rbiEst, sbEst, baEst, wEst, svEst, kEst, eraEst, whipEst, totalPoints);\n \n standingTable = resetStandingTable(dataManager.getDraft().getFantasyTeams());\n \n // SET TOOLTIP\n Tooltip t = new Tooltip(\"Fantasy Standings Page\");\n standingsTab.setTooltip(t);\n \n // PUT IN TAB PANE\n standingsWorkspacePane.getChildren().add(standingTable);\n standingsTab.setContent(standingsWorkspacePane);\n mainWorkspacePane.getTabs().add(standingsTab);\n }", "private org.gwtbootstrap3.client.ui.NavTabs get_f_NavTabs52() {\n return build_f_NavTabs52();\n }", "private void createLayout () {\n \t\n \tBorderPane border = new BorderPane();\n \t\n \t\n \t tabPane = new TabPane();\n ArrayList <ScrollPane> tabs = new ArrayList <ScrollPane>();\n \t\n //create column 1 - need to refactor this and make more generic\n TilePane col1 = new TilePane();\n \tcol1.setPrefColumns(2);\n \tcol1.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n \tcol1.setAlignment(Pos.TOP_LEFT);\n \tcol1.getChildren().addAll(createElements ());\n \tScrollPane scrollCol1 = new ScrollPane(col1);\n \ttabs.add(scrollCol1);\n \t\n \tTilePane col2 = new TilePane();\n \tcol2.setPrefColumns(2);\n \tcol2.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n \tcol2.setAlignment(Pos.TOP_LEFT);\n \tcol2.getChildren().addAll(createElements ());\n \tScrollPane scrollCol2 = new ScrollPane(col2);\n \ttabs.add(scrollCol2);\n \t\n \t\n \t\n for (int i = 0; i < tabs.size(); i++) {\n Tab tab = new Tab();\n String tabLabel = \"Col-\" + i;\n tab.setText(tabLabel);\n keywordsList.put(tabLabel, new ArrayList <String>());\n \n tab.setContent(tabs.get(i));\n tabPane.getTabs().add(tab);\n }\n \t\n \t\n \t\n \t\n \t\n \t\n //System.out.println(controller.getScene());\n border.prefHeightProperty().bind(controller.primaryStage.heightProperty());\n border.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n ToolBar toolbar = createtoolBar();\n toolbar.setPrefHeight(50);\n \n border.setTop(toolbar);\n\t\t\n\n\t scrollCol1.prefHeightProperty().bind(controller.primaryStage.heightProperty());\n\t scrollCol1.prefWidthProperty().bind(controller.primaryStage.widthProperty());\n border.setCenter(tabPane);\n\t Group root = (Group)this.getRoot();\n root.getChildren().add(border);\n\t}", "private void insertarTabs(ViewGroup container) {\n View padre = (View) container.getParent();\n pestanas = (TabLayout)padre.findViewById(R.id.tabs);\n }", "protected void beforeBody(final XMLOutput output) throws JellyTagException, SAXException\n\t{\n\t\t//Does it have valid name\n\t\tString name = getName() ;\n\t\tif (isEmpty(name))\n\t\t\tthrow new JellyTagException(\"name is a required parameter for this tag\") ;\n\t\t\n\t\tString text = (String)getAttribute(TEXT) ;\n\t\t\n\t\t//Is an active tab panel name\n\t\tif (isEmpty(getCurrentTabPanelName()))\n\t\t\tthrow new JellyTagException(\"There is no tab pane active panel tag open at this time\") ;\n\t\t\n\t\t//Is there a valid tab label\n\t\tif (isEmpty(text))\n\t\t\tthrow new JellyTagException(\"text is a required parameter for this tag\") ;\n\t\t\n\t\t//Generate th div for the tab panel item\n\t\toutput.write(\"<div id=\\\"\" + \"tabitem-\" + name + \"-id\" + \"\\\">\\n\") ;\n\t\t\n\t\t//Generate a tab Panel Item creation\n\t\tscriptBuffer.appendln(\" \" + name + \" = \" + getCurrentTabPanelName() + \".addTab(\\\"tabitem-\" + name + \"-id\\\",\\\"\" + text + \"\\\");\") ;\n\t\t\n\t\t//Does this tab need to be active\n\t\tString active = (String) getAttribute(ACTIVE) ;\n\t\tif (!isEmpty(active))\n\t\t\tscriptBuffer.appendln(\" \" + getCurrentTabPanelName() + \".activate(\\\"tabitem-\" + name + \"-id\\\")\") ;\n\t\t\n\t\t//Does this tab need to be hidden\n\t\tString hidden = (String) getAttribute(HIDDEN) ;\n\t\tif (!isEmpty(hidden))\n\t\t\tscriptBuffer.appendln(\" \" + getCurrentTabPanelName() + \".hideTab(\\\"tabitem-\" + name + \"-id\\\")\") ;\n\t\t\n\t\t//Does this tab need to be disabled\n\t\tString disable = (String) getAttribute(DISABLE) ;\n\t\tif (!isEmpty(disable))\n\t\t\tscriptBuffer.appendln(\" \" + getCurrentTabPanelName() + \".disableTab(\\\"tabitem-\" + name + \"-id\\\")\") ;\n\t\t\n\t\t//If the tab item has a url where the tab content will be loaded from\n\t\tString contentURL = (String) getAttribute(CONTENTURL) ;\n\t\tif (!isEmpty(contentURL))\n\t\t{\n\t\t\tscriptBuffer.appendln(\" Ext.get(\\\"tabitem-\" + name + \"-id\\\").load({\") ;\n\t\t\tscriptBuffer.appendln(\" url:'\" + webContext + contentURL + \"',\") ;\n\t\t\tscriptBuffer.appendln(\" scripts:true,\") ;\n\t\t\tscriptBuffer.appendln(\" text:'Loading tab pane...'\") ;\n\t\t\tscriptBuffer.appendln(\" });\") ;\n\t\t}\n\t}", "private void createSingleTab(String text, Path path) {\r\n\t\tif (text == null) {\r\n\t\t\ttext = \"\";\r\n\t\t}\r\n\t\t\r\n\t\tJTextArea txtArea = new JTextArea(text);\r\n\t\ttxtArea.getDocument().addDocumentListener(new DocumentListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void removeUpdate(DocumentEvent e) {\t\t\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void insertUpdate(DocumentEvent e) {\t\t\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void changedUpdate(DocumentEvent e) {\r\n\t\t\t\tchangeIcon();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tprivate void changeIcon() {\r\n\t\t\t\ttabbedPane.setIconAt(tabbedPane.getSelectedIndex(), redIcon);\r\n\t\t\t}\r\n\t\t});\r\n\t\ttxtArea.addCaretListener(new CaretListener() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void caretUpdate(CaretEvent e) {\r\n\t\t\t\tlengthLab.setText(\"Length: \"+txtArea.getText().length());\r\n\t\t\t\t\r\n\t\t\t\tint offset = txtArea.getCaretPosition();\r\n\t int line= 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tline = txtArea.getLineOfOffset(offset);\r\n\t\t\t\t} catch (BadLocationException ignorable) {}\r\n\t\t\t\tlnLab.setText(\"Ln: \"+(line+1));\r\n\t\t\t\t\r\n\t\t\t\tint col = 1;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tcol = offset - txtArea.getLineStartOffset(line);\r\n\t\t\t\t} catch (BadLocationException ignorable) {}\r\n\t\t\t\tcolLab.setText(\"Col: \"+ (col+1));\r\n\t\t\t\t\r\n\t\t\t\tint sel = Math.abs(txtArea.getSelectionStart() - txtArea.getSelectionEnd());\t\r\n\t\t\t\tselLab.setText(\"sel: \"+sel);\r\n\t\t\t\tfor (JMenuItem i : toggable) {\r\n\t\t\t\t\tboolean enabled;\r\n\t\t\t\t\tenabled = sel != 0;\r\n\t\t\t\t\ti.setEnabled(enabled);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\t\r\n\t\tJScrollPane scrPane = new JScrollPane(txtArea);\r\n\t\tif (path == null) {\t//create empty tab\t\r\n\t\t\tString name = \"New \" + (count +1);\r\n\t\t\ttabbedPane.addTab(name, greenIcon, scrPane, \"\");\r\n\t\t\tcount++;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\ttabbedPane.addTab(path.getFileName().toString(), greenIcon, scrPane, path.toString());\r\n\t\tcount++;\r\n\t}", "public void addTab (String tabname, boolean closeable, Widget widget, final String key) {\n\n\n\t\tPanel localTP = new Panel();\n\t\tlocalTP.setClosable(closeable);\n\t\tlocalTP.setTitle(tabname);\n\t\tlocalTP.setId(key + id);\n\t\tlocalTP.setAutoScroll(true);\n\t\tlocalTP.add(widget);\n\n\t\ttp.add(localTP, this.centerLayoutData);\n\n\t\tlocalTP.addListener(new PanelListenerAdapter() {\n\n\t\t\tpublic void onDestroy(Component component) {\n\t\t\t\topenedTabs.remove(key);\n\t\t\t}\n\t\t});\n\n\n\t\ttp.activate(localTP.getId());\n\n\n\n\n\t\topenedTabs.put(key, localTP);\n\t}", "public void setupIcons() {\n try {\n tabLayout.getTabAt(0).setCustomView(getTabView(R.string.ic_user_black_bg, 0));\n tabLayout.getTabAt(1).setCustomView(getTabView(R.string.ic_hot_or_burn, 1));\n tabLayout.getTabAt(2).setCustomView(getTabView(R.string.ic_chat_1, 0));\n\n viewPager.addOnPageChangeListener(this);\n } catch (NullPointerException e) {\n e.printStackTrace();\n }\n }", "private void initTab() {\n\n linearLayoutCookingMethod = (AdvancedPagerSlidingTabStrip) findViewById(R.id.linearLayoutCookingMethod);\n mViewPager = (ViewPager) findViewById(R.id.viewPager_main_activity);\n if (mFragments != null)\n mFragments.clear();\n else\n mFragments = new ArrayList<>();\n for (int i = 0; i < SanyiSDK.rest.queues.size(); i++) {\n FragmentTable fragmentTable = new FragmentTable();\n fragmentTable.setQueueId(i);\n mFragments.add(fragmentTable);\n }\n historyFragment = new FragmentHistory();\n mFragments.add(historyFragment);\n myPagerAdapter = new PagerAdapter(getSupportFragmentManager(), mFragments);\n mViewPager.setAdapter(myPagerAdapter);\n mViewPager.setOffscreenPageLimit(SanyiSDK.rest.queues.size()); //SanyiSDK.rest.queues.size()这个的值不包含历史队伍\n mViewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n //每次滑动viewpager都要请求一次数据\n @Override\n public void onPageSelected(int position) {\n queryTicket();\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n });\n linearLayoutCookingMethod.setViewPager(mViewPager);\n linearLayoutCookingMethod.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n @Override\n public void onPageSelected(int position) {\n// if (position < mFragments.size() - 1) {\n// ((FragmentTable) mFragments.get(position)).refresh();\n// } else {\n// ((FragmentHistory) mFragments.get(position)).refresh();\n// }\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n });\n\n }", "private void addNewTab(SingleDocumentModel model) {\n\t\tString title = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().getFileName().toString();\n\t\tImageIcon icon = createIcon(\"icons/green.png\");\n\t\tJScrollPane component = new JScrollPane(model.getTextComponent());\n\t\tString toolTip = model.getFilePath()==null ? \"unnamed\" : model.getFilePath().toAbsolutePath().toString();\n\t\taddTab(title, icon, component, toolTip);\n\t\tsetSelectedComponent(component);\n\t}", "static Extractor byTabs() {\n\t\t\treturn Splitter.TAB_EXTRACTOR;\n\t\t}", "@Override\n\tpublic JTabbedPane initTabs() {\n\t\treturn null;\n\t}", "@Override\n public void onViewCreated(View view, Bundle savedInstanceState) {\n adapter = new ViewPagerAdapter(getChildFragmentManager(),Titles,Numboftabs);\n\n // Assigning ViewPager View and setting the adapter\n pager = (ViewPager) getView().findViewById(R.id.pager);\n pager.setAdapter(adapter);\n\n // Assiging the Sliding Tab Layout View\n tabs = (SlidingTabLayout) getView().findViewById(R.id.tabs);\n tabs.setDistributeEvenly(true); // To make the Tabs Fixed set this true, This makes the tabs Space Evenly in Available width\n\n // Setting Custom Color for the Scroll bar indicator of the Tab View\n tabs.setCustomTabColorizer(new SlidingTabLayout.TabColorizer() {\n @Override\n public int getIndicatorColor(int position) {\n return getResources().getColor(R.color.tabsScrollColor);\n }\n });\n\n // Setting the ViewPager For the SlidingTabsLayout\n tabs.setViewPager(pager);\n }", "@Override\n public int getCount() {\n return tabTitles.length;\n }", "private void addTab(String title, File file, String contents) {\n \tTextPane newTextPane = new TextPane(parentFrame,TextPane.getProperties(false), false);\r\n\r\n \t// 2nd create the tab\r\n \tStyledTab tab = new StyledTab(title);\r\n \tTextPaneTab paneTab = new TextPaneTab(file, newTextPane, tab);\r\n\r\n \t// 3rd add contents if any\r\n \tif (contents != null) {\r\n \t\tnewTextPane.getBuffer().insert(0, contents);\r\n \t\tnewTextPane.setCaretPosition(0);\r\n \t\tpaneTab.setModified(false);\r\n \t}\r\n\r\n \t// 4th add new TextPaneTab\r\n \tpanes.add(paneTab);\r\n\r\n \t// 5th create the pane and add it to manager\r\n \tJPanel pane = new JPanel();\r\n \tpane.setLayout(new BorderLayout());\r\n\t\tJPanel textPaneContainer = new JPanel();\r\n\t\ttextPaneContainer.setBorder(BorderFactory.createLineBorder(new Color(102, 102, 102), 1));\r\n\t\ttextPaneContainer.setLayout(new BorderLayout());\r\n\t\ttextPaneContainer.add(newTextPane, BorderLayout.CENTER);\r\n \tpane.add(textPaneContainer, BorderLayout.CENTER);\r\n \tpane.add(makePrgButtonPanel(), BorderLayout.EAST);\r\n \tint index = getTabCount()-1;\r\n \tinsertTab(title, null, pane, null, index);\r\n \tsetTabComponentAt(index,tab);\r\n \tif (!file.isDirectory())\r\n \t\tsetToolTipTextAt(index, file.getAbsolutePath());\r\n }", "private void addControl() {\n // Gan adapter va danh sach tab\n PagerAdapter adapter = new PagerAdapter(getSupportFragmentManager());\n // Them noi dung cac tab\n adapter.AddFragment(new TourMapTab());\n adapter.AddFragment(new TourInfoTab());\n adapter.AddFragment(new TourMapImageTab());\n // Set adapter danh sach tab\n ViewPager viewPager = ActivityManager.getInstance().activityTourTabsBinding.viewpager;\n TabLayout tabLayout = ActivityManager.getInstance().activityTourTabsBinding.tablayout;\n viewPager.setAdapter(adapter);\n tabLayout.setupWithViewPager(viewPager);\n // Them vach ngan cach cac tab\n View root = tabLayout.getChildAt(0);\n if (root instanceof LinearLayout) {\n ((LinearLayout) root).setShowDividers(LinearLayout.SHOW_DIVIDER_MIDDLE);\n GradientDrawable drawable = new GradientDrawable();\n drawable.setColor(getResources().getColor(R.color.colorPrimaryDark));\n drawable.setSize(2, 1);\n ((LinearLayout) root).setDividerPadding(10);\n ((LinearLayout) root).setDividerDrawable(drawable);\n }\n // Icon cac tab\n tabLayout.getTabAt(0).setIcon(R.drawable.tour_map_icon_select);\n tabLayout.getTabAt(1).setIcon(R.mipmap.tour_info_icon);\n tabLayout.getTabAt(2).setIcon(R.mipmap.tour_map_image_icon);\n\n // Doi mau tab icon khi click\n tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(viewPager) {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n super.onTabSelected(tab);\n switch (tab.getPosition()){\n case 0:\n tab.setIcon(R.drawable.tour_map_icon_select);\n break;\n case 1:\n tab.setIcon(R.drawable.tour_info_icon_select);\n break;\n case 2:\n tab.setIcon(R.mipmap.tour_map_image_icon_select);\n break;\n default:\n break;\n }\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n super.onTabUnselected(tab);\n switch (tab.getPosition()){\n case 0:\n tab.setIcon(R.mipmap.tour_map_icon);\n break;\n case 1:\n tab.setIcon(R.mipmap.tour_info_icon);\n break;\n case 2:\n tab.setIcon(R.mipmap.tour_map_image_icon);\n break;\n default:\n break;\n }\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n super.onTabReselected(tab);\n }\n }\n );\n }", "private Component setTabPanel(){\n String componentKey = Integer.toString(focusL1) + \"-\" + Integer.toString(focusL2);\n\n Component wrapper = getComponentById(wrapperName);\n Component replacedPanel = getComponentById(panelName);\n\n Component panel;\n panel = panelMap.getPanelMap().get(componentKey);\n replacedPanel.replaceWith( panel );\n\n return wrapper;\n }", "public String toStringTabbed(int tabs){\n StringBuilder b = new StringBuilder();\n for(int i = 0; i < tabs; i++){\n b.append(\"\\t\");\n }\n b.append(\"while (\" + bExpression.toString() + \")\\n\" + s1.toStringTabbed(tabs+1));\n return b.toString();\n \n }", "private void initialiseTabHost(Bundle args) {\n\t\tmTabHost = (TabHost)findViewById(android.R.id.tabhost);\n mTabHost.setup();\n TabInfo tabInfo = null;\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab1\").setIndicator(\"Waveform\"), ( tabInfo = new TabInfo(\"Tab1\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab2\").setIndicator(\"FFT\"), ( tabInfo = new TabInfo(\"Tab2\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab3\").setIndicator(\"AC\"), ( tabInfo = new TabInfo(\"Tab3\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n MainActivity.addTab(this, this.mTabHost, this.mTabHost.newTabSpec(\"Tab4\").setIndicator(\"Pitch\"), ( tabInfo = new TabInfo(\"Tab4\", DrawFragment.class, args)));\n this.mapTabInfo.put(tabInfo.tag, tabInfo);\n // Default to first tab\n this.onTabChanged(\"Tab1\");\n //\n mTabHost.setOnTabChangedListener(this);\n\t}", "private void addMenuItems() {\n menuBar.setLayout(new FlowLayout(FlowLayout.CENTER));\n menuBar.setBackground(Color.BLUE);\n JMenuItem newTabButton = new JMenuItem(\"New Tab\");\n newTabButton.addActionListener(e ->\n {\n String tabName = \"Space \";\n Random rand = new Random();\n float r = (float) (rand.nextFloat() / 2f + 0.5);\n float g = (float) (rand.nextFloat() / 2f + 0.5);\n float b = (float) (rand.nextFloat() / 2f + 0.5);\n Color backgroundColor = new Color(r, g, b);\n tabName += tabIndex;\n tabIndex += 1;\n WorkingPanel workingPanel = new WorkingPanel();\n workingPanel.setBackground(backgroundColor);\n jTabbedPane.add(tabName, workingPanel);\n addIconToTab(workingPanel, \"(\");\n addIconToTab(workingPanel, \")\");\n });\n JMenuItem saveButton = new JMenuItem(\"Save\");\n fileManager = new FileManager(this);\n saveButton.addActionListener(e -> {\n try {\n fileManager.saveFile();\n } catch (IOException ioException) {\n ioException.printStackTrace();\n } catch (NullPointerException nullPointerException){\n JOptionPane.showMessageDialog(null, \"No file selected\");\n }\n });\n JMenuItem loadButton = new JMenuItem(\"Load\");\n loadButton.addActionListener(e -> {\n try {\n fileManager.loadFile();\n } catch (IOException | ClassNotFoundException ioException) {\n ioException.printStackTrace();\n }\n });\n JMenuItem compileButton = new JMenuItem(\"Compile\");\n compileButton.addActionListener(e -> {\n visited = new HashSet<>();\n boolean compileFlag = true;\n for (int idx = 0; idx < jTabbedPane.getTabCount(); idx++) {\n WorkingPanel workingPanel = (WorkingPanel) jTabbedPane.getComponent(idx);\n boolean isSuccessfullyCompiled = compileTab(workingPanel.getConnections(), workingPanel, idx);\n if (!isSuccessfullyCompiled) {\n compileFlag = false;\n }\n }\n if (compileFlag) {\n generateGraphCode();\n }\n });\n newTabButton.setPreferredSize(new Dimension(150, 40));\n loadButton.setPreferredSize(new Dimension(150, 40));\n saveButton.setPreferredSize(new Dimension(150, 40));\n compileButton.setPreferredSize(new Dimension(150, 40));\n menuBar.add(newTabButton);\n menuBar.add(saveButton);\n menuBar.add(loadButton);\n menuBar.add(compileButton);\n }", "private org.gwtbootstrap3.client.ui.NavTabs get_f_NavTabs8() {\n return build_f_NavTabs8();\n }", "@Override\n\tpublic void addTab(Tab tab, int position, boolean setSelected) {\n\t\t\n\t}", "private JPanel getContents(final JTabbedPane jtp,\n final MyTabPreviewPainter mainTabPreviewPainter) {\n FormBuilder builder = FormBuilder.create().\n columns(\"right:pref, 4dlu, fill:min:grow(1), 2dlu, fill:min:grow(1)\").\n rows(\"p, 2dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, \"\n + \"p, 3dlu, p, 7dlu, p, 2dlu, p, 0dlu, p, 0dlu, p, 0dlu, p, 7dlu,\"\n + \"p, 2dlu, p, 3dlu, p, 0dlu, p, 3dlu, p, 3dlu, p, 7dlu, \"\n + \"p, 2dlu, p, 0dlu, p, 0dlu, p, 0dlu, p, 7dlu, p, 2dlu, p, 3dlu, p\").\n columnGroups(new int[][] { { 3, 5 } });\n\n int row = 1;\n builder.addSeparator(\"General\").xyw(1, row, 5);\n\n final JComboBox<String> addKindCombo = new JComboBox<>(\n new String[] { \"regular\", \"null\", \"modified\" });\n JButton addNewTabButton = new JButton(\"Add\");\n addNewTabButton.addActionListener(actionEvent -> {\n String selectedKind = (String) addKindCombo.getSelectedItem();\n if (\"null\".equals(selectedKind)) {\n SwingUtilities.invokeLater(() -> jtp.addTab(\"null tab\", null));\n return;\n }\n\n final int count = 1 + jtp.getTabCount();\n final JComponent tabComp = new NumberedPanel(count);\n if (\"modified\".equals(selectedKind)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified(tabComp, true);\n }\n SwingUtilities.invokeLater(() -> jtp.addTab(\"tab\" + count, tabComp));\n });\n row += 2;\n\n builder.addLabel(\"Add tab\").xy(1, row);\n builder.add(addKindCombo).xy(3, row);\n builder.add(addNewTabButton).xy(5, row);\n\n final JComboBox<String> placementCombo = new JComboBox<>(\n new String[] { \"top\", \"bottom\", \"left\", \"right\" });\n placementCombo.addActionListener(actionEvent -> {\n String selected = (String) placementCombo.getSelectedItem();\n if (\"top\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.TOP);\n if (\"bottom\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.BOTTOM);\n if (\"left\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.LEFT);\n if (\"right\".equals(selected))\n jtp.setTabPlacement(JTabbedPane.RIGHT);\n });\n row += 2;\n builder.addLabel(\"Placement\").xy(1, row);\n builder.add(placementCombo).xyw(3, row, 3);\n\n try {\n final JComboBox<TabOverviewKind> overviewKindCombo = new FlexiComboBox<>(\n TabOverviewKind.GRID, TabOverviewKind.MENU_CAROUSEL,\n TabOverviewKind.ROUND_CAROUSEL) {\n @Override\n public String getCaption(TabOverviewKind item) {\n return item.getName();\n }\n };\n overviewKindCombo.addActionListener(actionEvent -> mainTabPreviewPainter\n .setTabOverviewKind((TabOverviewKind) overviewKindCombo.getSelectedItem()));\n row += 2;\n builder.addLabel(\"Overview kind\").xy(1, row);\n builder.add(overviewKindCombo).xyw(3, row, 3);\n } catch (NoClassDefFoundError ncdfe) {\n }\n\n final JCheckBox useScrollLayout = new JCheckBox(\"Uses scroll layout\");\n useScrollLayout.setSelected(false);\n useScrollLayout.addActionListener(actionEvent -> jtp\n .setTabLayoutPolicy(useScrollLayout.isSelected() ? JTabbedPane.SCROLL_TAB_LAYOUT\n : JTabbedPane.WRAP_TAB_LAYOUT));\n row += 2;\n builder.addLabel(\"Layout\").xy(1, row);\n builder.add(useScrollLayout).xyw(3, row, 3);\n\n final JComboBox<TabContentPaneBorderKind> contentBorderCombo = new JComboBox<>(new TabContentPaneBorderKind[] {\n TabContentPaneBorderKind.DOUBLE_PLACEMENT,\n TabContentPaneBorderKind.SINGLE_PLACEMENT });\n contentBorderCombo.setSelectedItem(TabContentPaneBorderKind.DOUBLE_PLACEMENT);\n contentBorderCombo.addActionListener(actionEvent -> {\n TabContentPaneBorderKind contentBorderKind = (TabContentPaneBorderKind) contentBorderCombo\n .getSelectedItem();\n RadianceThemingCortex.ComponentScope.setTabContentPaneBorderKind(jtp, contentBorderKind);\n jtp.updateUI();\n jtp.repaint();\n });\n row += 2;\n builder.addLabel(\"Content border\").xy(1, row);\n builder.add(contentBorderCombo).xyw(3, row, 3);\n\n JButton enableAll = new JButton(\"+ all\");\n enableAll.addActionListener(actionEvent -> {\n for (int i = 0; i < jtp.getTabCount(); i++) {\n jtp.setEnabledAt(i, true);\n }\n });\n\n JButton disableAll = new JButton(\"- all\");\n disableAll.addActionListener(actionEvent -> {\n for (int i = 0; i < jtp.getTabCount(); i++) {\n jtp.setEnabledAt(i, false);\n }\n });\n\n row += 2;\n builder.addLabel(\"Enable all\").xy(1, row);\n builder.add(enableAll).xy(3, row);\n builder.add(disableAll).xy(5, row);\n\n JButton closeAllEnabled = new JButton(\"Close\");\n closeAllEnabled.addActionListener(actionEvent -> {\n Set<Component> toRemove = new HashSet<>();\n for (int i = 0; i < jtp.getTabCount(); i++) {\n if (jtp.isEnabledAt(i))\n toRemove.add(jtp.getComponentAt(i));\n }\n for (Component comp : toRemove)\n jtp.remove(comp);\n });\n\n JButton restoreClosed = new JButton(\"Restore\");\n restoreClosed.addActionListener(actionEvent -> {\n for (Component tnp : closed) {\n jtp.addTab(\"restored\", tnp);\n }\n });\n\n row += 2;\n builder.addLabel(\"Close all\").xy(1, row);\n builder.add(closeAllEnabled).xy(3, row);\n builder.add(restoreClosed).xy(5, row);\n\n row += 2;\n builder.addSeparator(\"Single Tab\").xyw(1, row, 5);\n\n final JComboBox<Integer> tabSelectorCombo = new JComboBox<>(new TabComboBoxModel(this.jtp));\n //tabSelectorCombo.setRenderer(new TabCellRenderer());\n jtp.addContainerListener(new ContainerAdapter() {\n @Override\n public void componentAdded(ContainerEvent e) {\n ((TabComboBoxModel) tabSelectorCombo.getModel()).changed();\n }\n\n @Override\n public void componentRemoved(ContainerEvent e) {\n ((TabComboBoxModel) tabSelectorCombo.getModel()).changed();\n }\n });\n\n row += 2;\n builder.addLabel(\"Select\").xy(1, row);\n builder.add(tabSelectorCombo).xyw(3, row, 3);\n\n final JButton markAsModified = new JButton(\"-> modified\");\n markAsModified.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified((JComponent) comp, true);\n }\n });\n final JButton markAsUnmodified = new JButton(\"-> unmodified\");\n markAsUnmodified.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n RadianceThemingCortex.ComponentScope.setTabContentsModified((JComponent) comp, false);\n }\n });\n row += 2;\n builder.addLabel(\"Modified\").xy(1, row);\n builder.add(markAsModified).xy(3, row);\n builder.add(markAsUnmodified).xy(5, row);\n\n final JButton runModifiedAnimOnClose = new JButton(\"Animate on X\");\n runModifiedAnimOnClose.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setRunModifiedAnimationOnTabCloseButton(jc, true);\n }\n });\n final JButton runModifiedAnimOnTab = new JButton(\"Animate on tab\");\n runModifiedAnimOnTab.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setRunModifiedAnimationOnTabCloseButton(jc, false);\n }\n });\n row += 2;\n builder.add(runModifiedAnimOnClose).xy(3, row);\n builder.add(runModifiedAnimOnTab).xy(5, row);\n\n final JButton showCloseButton = new JButton(\"+ close button\");\n showCloseButton.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setTabCloseButtonVisible(jc, true);\n jtp.repaint();\n }\n });\n final JButton hideCloseButton = new JButton(\"- close button\");\n hideCloseButton.addActionListener(actionEvent -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n if ((comp != null) && (comp instanceof JComponent)) {\n JComponent jc = (JComponent) comp;\n RadianceThemingCortex.ComponentScope.setTabCloseButtonVisible(jc, false);\n jtp.repaint();\n }\n });\n\n JButton closeButton = new JButton(\"Close\");\n closeButton.addActionListener(actionEvent -> SwingUtilities.invokeLater(() -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n Component comp = jtp.getComponentAt((Integer) tabSelectorCombo.getSelectedItem());\n jtp.removeTabAt((Integer) tabSelectorCombo.getSelectedItem());\n closed.add(comp);\n jtp.repaint();\n }));\n\n JButton selectButton = new JButton(\"Select\");\n selectButton.addActionListener(actionEvent -> SwingUtilities.invokeLater(() -> {\n if (tabSelectorCombo.getSelectedItem() == null)\n return;\n jtp.setSelectedIndex((Integer) tabSelectorCombo.getSelectedItem());\n }));\n row += 2;\n builder.addLabel(\"Tab op\").xy(1, row);\n builder.add(closeButton).xy(3, row);\n builder.add(selectButton).xy(5, row);\n\n row += 2;\n builder.addSeparator(\"Close Button Single\").xyw(1, row, 5);\n\n row += 2;\n builder.addLabel(\"Visible\").xy(1, row);\n builder.add(showCloseButton).xy(3, row);\n builder.add(hideCloseButton).xy(5, row);\n\n return builder.getPanel();\n }", "public void init() {\n\t\ttabbed = new JTabbedPane();\n\t\ttabbed.insertTab(\"Sesion\", null, getPanelSesion(), \"Control de la sesion\", 0);\n\t\ttabbed.insertTab(\"Evolución bolsa\", null, new JPanel(), \"Control de los usuarios\", 1);\n\t\ttabbed.insertTab(\"Eventos\", null, new JPanel(), \"Control de los eventos\", 2);\n\t\ttabbed.insertTab(\"Control de Agentes\", null, getPanelAgentes(), \"Control de los agentes\", 3);\n\t\tgetContentPane().add(tabbed);\n\t\ttabbed.setEnabledAt(1, false);\n\t\ttabbed.setEnabledAt(2, false);\n\t\tsetSize(new Dimension(800, 600));\n\t}", "public void createPage3(){\n tabAbout = new JPanel();\n tabAbout.setLayout( null );\n \n\n JLabel lblGuidText_syn = new JLabel( \"<html><h1>Useless Dictionary</h1><p>Sulochana Kodituwakku<br>2014/CS/066<br>14000662</p></html>\" ); //html can be used in JLables\n lblGuidText_syn.setHorizontalAlignment(JLabel.LEFT);\n lblGuidText_syn.setVerticalAlignment(JLabel.TOP);\n lblGuidText_syn.setBounds( 10, 200, 750, 380 );\n tabAbout.add( lblGuidText_syn );\n \n btnImport.setBounds(10,10,125,25);\n tabAbout.add(btnImport);\n \n \n //set conlick event for Import button\n event_buttonImport ebd = new event_buttonImport();\n btnImport.addActionListener(ebd);\n }", "private void createTabMenu(Tab tab, MenuItem saveItemTab) {\n Menu tabMenu = new Menu();\n MenuItem closeItem = new MenuItem(\"Close\");\n closeItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n tabCloseEvent(tab);\n }\n });\n MenuItem closeOtersItem = new MenuItem(\"Close Others\");\n closeOtersItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n if (editorTabSet.getTabNumber(closeTab.getID()) != editorTabSet.getTabNumber(tab.getID())) {\n tabCloseEvent(closeTab);\n }\n }\n }\n });\n MenuItem closeLeftItem = new MenuItem(\"Close Tabs to the Left\");\n closeLeftItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n if (editorTabSet.getTabNumber(closeTab.getID()) < editorTabSet.getTabNumber(tab.getID())) {\n tabCloseEvent(closeTab);\n }\n }\n }\n });\n MenuItem closeRightItem = new MenuItem(\"Close Tabs to the Right\");\n closeRightItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n if (editorTabSet.getTabNumber(closeTab.getID()) > editorTabSet.getTabNumber(tab.getID())) {\n tabCloseEvent(closeTab);\n }\n }\n }\n });\n MenuItem closeAllItem = new MenuItem(\"Close All\");\n closeAllItem.addClickHandler(new ClickHandler() {\n @Override\n public void onClick(MenuItemClickEvent event) {\n for (Tab closeTab : editorTabSet.getTabs()) {\n tabCloseEvent(closeTab);\n }\n }\n });\n MenuItemSeparator sep = new MenuItemSeparator();\n if (saveItemTab != null) {\n MenuItemIfFunction enableCondition = new MenuItemIfFunction() {\n public boolean execute(Canvas target, Menu menu, MenuItem item) {\n return tab == editorTabSet.getSelectedTab();\n }\n };\n\n saveItemTab.setEnableIfCondition(enableCondition);\n saveItemTab.setKeyTitle(\"Ctrl + S\");\n\n // If you use addItem, the association with the shortcut key is lost.\n tabMenu.setItems(saveItemTab, sep, closeItem, closeOtersItem, closeLeftItem, closeRightItem, sep, closeAllItem);\n } else {\n tabMenu.setItems(closeItem, closeOtersItem, closeLeftItem, closeRightItem, sep, closeAllItem);\n }\n tab.setContextMenu(tabMenu);\n }", "@Override\n\tpublic View createTabContent(String tag) {\n\t\tView result = View.inflate(mContext, R.layout.effect_main, null);\n\t\teffectWorkspace = (GridView) (View.inflate(mContext,\n\t\t\t\tR.layout.lock_grid, null));\n\t\teffectWorkspace.setColumnWidth(Tools.dip2px(mContext, 86));\n\t\tworkspaceAdapter = new GridViewAdapter(mContext, INDEX_WORKSPACE);\n\t\teffectWorkspace.setAdapter(workspaceAdapter);\n\t\teffectWorkspace.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View v,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tIntent it = new Intent(ACTION_EFFECT_PREVIEW);\n\t\t\t\tit.putExtra(ACTION_EFFECT_PREVIEW_EXTRA_TYPE, INDEX_WORKSPACE);\n\t\t\t\tit.putExtra(ACTION_EFFECT_PREVIEW_EXTRA_INDEX, position);\n\t\t\t\tmContext.sendBroadcast(it);\n\t\t\t\tActivityManager.KillActivity();\n\t\t\t}\n\t\t});\n\t\teffectApp = (GridView) View.inflate(mContext, R.layout.lock_grid, null);\n\t\teffectApp.setColumnWidth(Tools.dip2px(mContext, 86));\n\t\tappAdaper = new GridViewAdapter(mContext, INDEX_APP);\n\t\teffectApp.setAdapter(appAdaper);\n\t\t// ViewPager\n\t\teffectGridPager = (ViewPager) result.findViewById(R.id.effectGridPager);\n\t\teffectPagerAdapter = new GridPagerAdapter(effectWorkspace, effectApp);\n\t\teffectGridPager.setAdapter(effectPagerAdapter);\n\t\teffectApp.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View v,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tIntent it = new Intent(ACTION_EFFECT_PREVIEW);\n\t\t\t\tit.putExtra(ACTION_EFFECT_PREVIEW_EXTRA_TYPE, INDEX_APP);\n\t\t\t\tit.putExtra(ACTION_EFFECT_PREVIEW_EXTRA_INDEX, position);\n\t\t\t\tmContext.sendBroadcast(it);\n\t\t\t\tActivityManager.KillActivity();\n\t\t\t}\n\t\t});\n\t\teffectGridPager.setOverScrollMode(View.OVER_SCROLL_NEVER);\n\t\tfinal RadioButton effectWorkspaceButton = (RadioButton) result\n\t\t\t\t.findViewById(R.id.btnWorkspaceEffect);\n\t\tfinal RadioButton effectAppButton = (RadioButton) result\n\t\t\t\t.findViewById(R.id.btnApplistEffect);\n\t\teffectGridPager.setOnPageChangeListener(new OnPageChangeListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onPageScrollStateChanged(int arg0) {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onPageScrolled(int arg0, float arg1, int arg2) {\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void onPageSelected(int index) {\n\t\t\t\tif (index == INDEX_WORKSPACE) {\n\t\t\t\t\teffectWorkspaceButton.toggle();\n\t\t\t\t} else if (index == INDEX_APP) {\n\t\t\t\t\teffectAppButton.toggle();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\teffectWorkspaceButton.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\teffectGridPager.setCurrentItem(INDEX_WORKSPACE, true);\n\t\t\t}\n\t\t});\n\t\teffectAppButton.setOnClickListener(new View.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\teffectGridPager.setCurrentItem(INDEX_APP, true);\n\t\t\t}\n\t\t});\n\t\tif (index != -1 && (index == 0 || index == 1)) {\n\t\t\teffectGridPager.setCurrentItem(index);\n\t\t\teffectWorkspace.setSelection(workspaceAdapter.getCurrentEffect());\n\t\t\teffectApp.setSelection(appAdaper.getCurrentEffect());\n\t\t}\n\t\tmReceiver = new BroadcastReceiver() {\n\n\t\t\t@Override\n\t\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tif (intent == null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tString action = intent.getAction();\n\t\t\t\tif (DEFAULT_CHANGE.equals(action)) {\n\t\t\t\t\tappAdaper.reloadDefault();\n\t\t\t\t\tworkspaceAdapter.reloadDefault();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tIntentFilter screenFilter1 = new IntentFilter();\n\t\tscreenFilter1.addAction(DEFAULT_CHANGE);\n\t\tmContext.registerReceiver(mReceiver, screenFilter1);\n\t\treturn result;\n\t}", "public Tabs() {\n initComponents();\n }", "protected void showTabs() {\r\n\t\tif (getPageCount() > 1) {\r\n\t\t\tsetPageText(0, getString(\"_UI_SelectionPage_label\"));\r\n\t\t\tif (getContainer() instanceof CTabFolder) {\r\n\t\t\t\t((CTabFolder) getContainer()).setTabHeight(SWT.DEFAULT);\r\n\t\t\t\tPoint point = getContainer().getSize();\r\n\t\t\t\tgetContainer().setSize(point.x, point.y - 6);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void addTab(Tab tab) {\n\t\t\n\t}", "public int getTabindex();", "private void createContents() {\n shell = new Shell(getParent(), SWT.BORDER | SWT.TITLE | SWT.APPLICATION_MODAL);\n shell.setSize(FORM_WIDTH, 700);\n shell.setText(getText());\n shell.setLayout(new GridLayout(1, false));\n\n TabFolder tabFolder = new TabFolder(shell, SWT.NONE);\n tabFolder.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n // STRUCTURE PARAMETERS\n\n TabItem tbtmStructure = new TabItem(tabFolder, SWT.NONE);\n tbtmStructure.setText(\"Structure\");\n\n Composite grpStructure = new Composite(tabFolder, SWT.NONE);\n tbtmStructure.setControl(grpStructure);\n grpStructure.setLayout(TAB_GROUP_LAYOUT);\n grpStructure.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n ParmDialogText.load(grpStructure, parms, \"meta\");\n ParmDialogText.load(grpStructure, parms, \"col\");\n ParmDialogText.load(grpStructure, parms, \"id\");\n ParmDialogChoices.load(grpStructure, parms, \"init\", Activation.values());\n ParmDialogChoices.load(grpStructure, parms, \"activation\", Activation.values());\n ParmDialogFlag.load(grpStructure, parms, \"raw\");\n ParmDialogFlag.load(grpStructure, parms, \"batch\");\n ParmDialogGroup cnn = ParmDialogText.load(grpStructure, parms, \"cnn\");\n ParmDialogGroup filters = ParmDialogText.load(grpStructure, parms, \"filters\");\n ParmDialogGroup strides = ParmDialogText.load(grpStructure, parms, \"strides\");\n ParmDialogGroup subs = ParmDialogText.load(grpStructure, parms, \"sub\");\n if (cnn != null) {\n if (filters != null) cnn.setGrouped(filters);\n if (strides != null) cnn.setGrouped(strides);\n if (subs != null) cnn.setGrouped(subs);\n }\n ParmDialogText.load(grpStructure, parms, \"lstm\");\n ParmDialogGroup wGroup = ParmDialogText.load(grpStructure, parms, \"widths\");\n ParmDialogGroup bGroup = ParmDialogText.load(grpStructure, parms, \"balanced\");\n if (bGroup != null && wGroup != null) {\n wGroup.setExclusive(bGroup);\n bGroup.setExclusive(wGroup);\n }\n\n // SEARCH CONTROL PARAMETERS\n\n TabItem tbtmSearch = new TabItem(tabFolder, SWT.NONE);\n tbtmSearch.setText(\"Training\");\n\n ScrolledComposite grpSearch0 = new ScrolledComposite(tabFolder, SWT.V_SCROLL);\n grpSearch0.setLayout(new FillLayout());\n grpSearch0.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n tbtmSearch.setControl(grpSearch0);\n Composite grpSearch = new Composite(grpSearch0, SWT.NONE);\n grpSearch0.setContent(grpSearch);\n grpSearch.setLayout(TAB_GROUP_LAYOUT);\n grpSearch.setLayoutData(TAB_GROUP_LAYOUT_DATA);\n\n Enum<?>[] preferTypes = (this.modelType == TrainingProcessor.Type.CLASS ? RunStats.OptimizationType.values()\n : RunStats.RegressionType.values());\n ParmDialogChoices.load(grpSearch, parms, \"prefer\", preferTypes);\n ParmDialogChoices.load(grpSearch, parms, \"method\", Trainer.Type.values());\n ParmDialogText.load(grpSearch, parms, \"bound\");\n ParmDialogChoices.load(grpSearch, parms, \"lossFun\", LossFunctionType.values());\n ParmDialogText.load(grpSearch, parms, \"weights\");\n ParmDialogText.load(grpSearch, parms, \"iter\");\n ParmDialogText.load(grpSearch, parms, \"batchSize\");\n ParmDialogText.load(grpSearch, parms, \"testSize\");\n ParmDialogText.load(grpSearch, parms, \"maxBatches\");\n ParmDialogText.load(grpSearch, parms, \"earlyStop\");\n ParmDialogChoices.load(grpSearch, parms, \"regMode\", Regularization.Mode.values());\n ParmDialogText.load(grpSearch, parms, \"regFactor\");\n ParmDialogText.load(grpSearch, parms, \"seed\");\n ParmDialogChoices.load(grpSearch, parms, \"start\", WeightInit.values());\n ParmDialogChoices.load(grpSearch, parms, \"gradNorm\", GradientNormalization.values());\n ParmDialogChoices.load(grpSearch, parms, \"updater\", GradientUpdater.Type.values());\n ParmDialogText.load(grpSearch, parms, \"learnRate\");\n ParmDialogChoices.load(grpSearch, parms, \"bUpdater\", GradientUpdater.Type.values());\n ParmDialogText.load(grpSearch, parms, \"updateRate\");\n\n grpSearch.setSize(grpSearch.computeSize(FORM_WIDTH - 50, SWT.DEFAULT));\n\n // BOTTOM BUTTON BAR\n\n Composite grpButtonBar = new Composite(shell, SWT.NONE);\n grpButtonBar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false, 1, 1));\n grpButtonBar.setLayout(new FillLayout(SWT.HORIZONTAL));\n\n Button btnSave = new Button(grpButtonBar, SWT.NONE);\n btnSave.setText(\"Save\");\n btnSave.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n try {\n parms.save(parmFile);\n } catch (IOException e) {\n ShellUtils.showErrorBox(getParent(), \"Error Saving Parm File\", e.getMessage());\n }\n }\n });\n\n Button btnClose = new Button(grpButtonBar, SWT.NONE);\n btnClose.setText(\"Cancel\");\n btnClose.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n shell.close();\n }\n });\n\n Button btnOK = new Button(grpButtonBar, SWT.NONE);\n btnOK.setText(\"Save and Close\");\n btnOK.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(SelectionEvent evt) {\n try {\n parms.save(parmFile);\n shell.close();\n } catch (IOException e) {\n ShellUtils.showErrorBox(getParent(), \"Error Saving Parm File\", e.getMessage());\n }\n }\n });\n\n }", "public void add(TabLike tab){\n TabLabel btn = tabLabelCreator.create(tab.getName(), this);\n\n tab.setVisible(tabs.isEmpty());\n btn.setDisable(tabs.isEmpty());\n if (tabs.isEmpty()){\n selected = btn;\n }\n\n tabs.add(tab);\n nameTab.getChildren().add(btn);\n tabContent.getChildren().add(tab);\n tab.setContainer(this);\n }", "public static FragmentHistoryVerticalTabbed newInstance() {\n return new FragmentHistoryVerticalTabbed();\n }", "@Override\n public int getCount() {\n return tabs.length;\n }", "@SuppressWarnings(\"UnusedParameters\")\n private void initInstances(View rootView, Bundle savedInstanceState) {\n ViewPager viewPager = (ViewPager) rootView.findViewById(R.id.viewPager);\n viewPager.setAdapter(new FragmentStatePagerAdapter(getChildFragmentManager()) {\n @Override\n public Fragment getItem(int position) {\n switch (position) {\n case 0:\n return PhotoSummaryFlagment.newInstance(dao);\n case 1:\n return PhotoInfoFlagment.newInstance(dao);\n case 2:\n return PhotoTagsFlagment.newInstance(dao);\n default: return null;\n }\n }\n\n @Override\n public int getCount() {\n return 3;\n }\n\n @Override\n public CharSequence getPageTitle(int position) {\n switch (position) {\n case 0:\n return \"Summary\";\n case 1:\n return \"Info\";\n case 2:\n return \"Tags\";\n default: return \"\";\n }\n }\n });\n slidingTabLayout = (SlidingTabLayout) rootView.findViewById(R.id.slidingTabLayout);\n slidingTabLayout.setViewPager(viewPager);\n }", "@Override\r\n public int getCount() {\n return TAB_TITLES.length;\r\n }", "public interface TabBuilder {\n View getView(int position);\n}", "public interface MenuTabButtonFactory {\n public void createTabButtonForMenuPanel(SplitControlPanel controlPanel, SplitPanel splitPanel, MenuPanel menuPanel, int orientation, MenuTabButtonAlternateAction alternateAction);\n}", "private View getTabView(int title, int type) {\n RelativeLayout tabView = (RelativeLayout) LayoutInflater.from(HomeActivity.this).inflate(R.layout.igniter_tab_view, null);\n CustomTextView tabtext = tabView.findViewById(R.id.tv_igniter_tab_view);\n ImageView tabImage = tabView.findViewById(R.id.iv_igniter_tab_indicator);\n RelativeLayout tablay = tabView.findViewById(R.id.rlt_igniter_tab_indicator);\n RelativeLayout rltLogo = tabView.findViewById(R.id.rlt_logo);\n ImageView ivLogo = tabView.findViewById(R.id.iv_logo);\n tabtext.setText(title);\n\n if (type == 1) {\n tabtext.setVisibility(View.INVISIBLE);\n ivLogo.setVisibility(View.VISIBLE);\n rltLogo.setVisibility(View.INVISIBLE);\n } else {\n tabtext.setVisibility(View.VISIBLE);\n ivLogo.setVisibility(View.INVISIBLE);\n rltLogo.setVisibility(View.VISIBLE);\n }\n tabImage.setVisibility(View.GONE);\n tablay.setVisibility(View.GONE);\n\n return tabView;\n }", "@Override\r\n public CharSequence getPageTitle(int position) {\n\r\n return tabs[position];\r\n }", "public AutomatedTestingTabbedPane()\r\n\t{\r\n\t\tsuper();\r\n\t\t\r\n\t\tthis.setBackground(Constants.WHITE);\r\n\t\tthis.setForeground(Constants.BLUE);\r\n\t\t\r\n\t\tthis.setFont(new Font(\"sans-serif\", Font.PLAIN, 16));\r\n\t\tthis.addTab(\"CXCParticipant\", participantPanel);\r\n\t\tthis.setMnemonicAt(0, KeyEvent.VK_1);\r\n\t\t\r\n\t\tthis.addTab(\"CXCToken\", tokenPanel);\r\n\t\tthis.setMnemonicAt(1, KeyEvent.VK_2);\r\n\t\t\r\n\t\tthis.addTab(\"CXCRecipient\", recipientPanel);\r\n\t\tthis.setMnemonicAt(2, KeyEvent.VK_3);\r\n\t\t\r\n\t\tthis.addTab(\"CXCPayment\", paymentPanel);\r\n\t\tthis.setMnemonicAt(3, KeyEvent.VK_4);\r\n\t\t\r\n\t\tthis.addTab(\"CXCPaymentRequest\", paymentRequestPanel);\r\n\t\tthis.setMnemonicAt(4, KeyEvent.VK_5);\r\n\t\t\r\n//\t\tthis.addTab(\"Export\", exportPanel);\r\n//\t\tthis.setMnemonicAt(5, KeyEvent.VK_6);\r\n\r\n\t}" ]
[ "0.6716681", "0.63711506", "0.63357335", "0.62854505", "0.62235147", "0.6101115", "0.6006216", "0.59709877", "0.58444923", "0.5837202", "0.5822562", "0.57927465", "0.5785772", "0.57027465", "0.5618826", "0.5611504", "0.5561321", "0.5554566", "0.5554556", "0.5476348", "0.5468237", "0.54592353", "0.5453925", "0.54424524", "0.5432421", "0.5432062", "0.54167783", "0.5413763", "0.53990966", "0.53982586", "0.5394243", "0.53934586", "0.5386029", "0.538219", "0.53525525", "0.5351145", "0.53407824", "0.53319484", "0.5330175", "0.52931035", "0.5278768", "0.5276291", "0.5242734", "0.5232489", "0.52317303", "0.5231016", "0.5228329", "0.52254826", "0.5223535", "0.522268", "0.52153295", "0.5197021", "0.51924026", "0.51664025", "0.5151267", "0.5148645", "0.5138574", "0.5138134", "0.51349944", "0.5122937", "0.5119365", "0.5114669", "0.51123023", "0.51064664", "0.5105542", "0.51048696", "0.5095538", "0.5079682", "0.5069238", "0.5067983", "0.50620747", "0.50618243", "0.5057587", "0.50574523", "0.5053728", "0.5050782", "0.5048628", "0.5041018", "0.5034769", "0.50335175", "0.50305927", "0.502458", "0.5010455", "0.500556", "0.50017333", "0.49968207", "0.49919835", "0.4990809", "0.49767348", "0.49671525", "0.4962648", "0.496173", "0.49611315", "0.49556318", "0.49529892", "0.4949187", "0.4930629", "0.49272797", "0.49236557", "0.49212268" ]
0.67669636
0
Sanitises a string so that it can be used as a div id
public static String cleanName(String name) { return name.replace(" ", "_").replace("&", "").replace("(", "") .replace(")", "").replaceAll(",", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String getIdFromConsiderList(String str) {\n return str.trim();\n }", "private static String sanitize(String input) {\n input = input.replaceAll(\"[^A-Za-z0-9_]\", \"\").toLowerCase();\n if (input.matches(\"[0-9]+\") || input.startsWith(\"href\")) {\n return \"\";\n }\n return input;\n }", "public static String getTagID(String str){\n\t\tString tag = str.substring(0, 8);\n\t\tString regEx = \"(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])+(\\\\d{1}|[A-F])\";\n\t\tPattern pattern = Pattern.compile(regEx);\n\t\tMatcher matcher = pattern.matcher(tag);\n\t\t\n\n\t\tif(!matcher.find()){\n\t\t\t\n\t\t\treturn \"\";\n\t\t}\n\t\n\t\treturn tag;\n\t}", "public void testStringID() {\n String testID = generator.generatePrefixedIdentifier(\"test\");\n assertNotNull(testID);\n assertTrue(testID.matches(\"test\" + ID_REGEX));\n }", "static boolean verifyIDRelaxed(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif(Character.isLetterOrDigit(c)) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ' || c == '_' || c == '-')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn id.length() > 0;\r\n\t}", "private String normolize(String str) {\n String str1 = str.replaceAll(\"<div class=\\\"cl\\\"/></div>\", \"\");\n //str1 = new String(str1.getBytes(), \"\");\n return str1;\n }", "public static String sanitize(String input){\n\t\tinput.replaceAll(\"&\", \"&amp;\");\n\t\tinput.replaceAll(\"<\", \"&lt;\");\n\t\tinput.replaceAll(\">\", \"&gt;\");\n\t\tinput.replaceAll(\"/\", \"&frasl;\");\n\t\treturn input;\n\t}", "private String cleanXSS(String unsafe) {\n String safe = Jsoup.clean(unsafe, Whitelist.basic());\n return safe;\n }", "static boolean verifyID(String id)\r\n\t{\r\n\t\tfor(int i = 0; i < id.length(); i++)\r\n\t\t{\r\n\t\t\tchar c = id.charAt(i);\r\n\t\t\tif((c <= 'Z' && c >= 'A') || (c >= 'a' && c <= 'z')) //isAlpha\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c >= '0' && c <= '9' || c == '_' || c == '-') //is digit or _ or -\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse if(c == ' ')\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn id.length() > 0;\r\n\t}", "protected static String sanitise(final String name) {\n // Replace illegal chars with\n return name.replaceAll(\"[^\\\\w\\\\.\\\\s\\\\-#&_]\", \"_\");\n }", "private String normalizeDiseaseId(String diseaseId) {\n String[] tokens = diseaseId.split(\":\");\n if (\"ORPHANET\".equals(tokens[0])) {\n diseaseId = \"ORPHA:\" + tokens[1];\n }\n return diseaseId;\n }", "private static boolean isLegalIdentifier(String str) {\n if (\"\".equals(str)) {\n return false;\n }\n if (str.charAt(0) >= '0' & str.charAt(0) <= '9') {\n return false;\n }\n\n return str.matches(\"^\\\\w+$\");\n }", "public static String createValidContent(final String string) {\n\t\treturn Strings.replace(string, XML_ENTITY_CHARS, XML_ENTITY_REPLACMENTS); //do the replacements for the special XML symbols and return the results\n\t}", "private static String toWebSafe(String str) {\n final var result = PATTERN_COLON.matcher(str)\n .replaceAll(DASH);\n return result;\n }", "private String escape(String str) {\n String result = null; // replace(str, \"&\", \"&amp;\");\n\n while (str.indexOf(\"&\") != -1) {\n str = replace(str, \"&\", \"&amp;\");\n }\n result = str;\n while (result.indexOf(\"-\") != -1) {\n result = replace(result, \"-\", \"\");\n }\n return result;\n }", "private String sanitizeSpecialChars(String value) {\n return value.replaceAll(\"[^a-zA-Z0-9_]\", \"_\");\n }", "public interface Sanitizer {\n String sanitize(String input);\n }", "private boolean CheckID(String id) {\n\t\tif ((!id.matches(\"([0-9])+\") || id.length() != 9) && (!id.matches(\"S([0-9])+\") || id.length() != 10)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Override\n\tprotected String _id(String id) {\n\t\tif (id != null) {\n\t\t\tid = id.replaceAll(\"([^a-zA-Z0-9_]{1,1})\", \"_\");\n\n\t\t\tString cacheIdPrefix = (String)_options.get(\"cache_id_prefix\");\n\t\t\tif (cacheIdPrefix != null) {\n\t\t\t\tid = cacheIdPrefix + id;\n\t\t\t}\n\t\t}\n\n\t\treturn id;\n\t}", "protected static String goodSearchID(String IDCheck) throws Exception\n {\n String[] ID; \n try{\n ID = IDCheck.split(\"\\\\s+\");\n if (ID.length > 1 ) {\n throw new Exception(\"ERROR: The ID must be 1 word only\\n\");\n }\n if (!(ID[0].equals(\"\")) && ID[0].length() != 6) {\n throw new Exception(\"ERROR: ID entered but it is not 6 digits\\n\");\n }\n if (!(ID[0].matches(\"[0-9]+\"))) {\n throw new Exception(\"ERROR: ID must only contain numbers\");\n }\n return ID[0];\n } catch (Exception e){\n throw new Exception(e.getMessage());\n }\n }", "private void validateId(String id) {\n if (!id.matches(\"[0-9]+\")) {\n throw new IllegalArgumentException(\"Invaild Tweet Id\");\n }\n return;\n }", "public ID(String id) {\n this.type = id.charAt(0);\n this.UID = id;\n }", "public void setString_entries_id(String s) { \n int len = s.length();\n int i;\n for (i = 0; i < len; i++) {\n setElement_entries_id(i, (short)s.charAt(i));\n }\n setElement_entries_id(i, (short)0); //null terminate\n }", "public static String fmtSqlIdentifier(String toClean) {\n\t\tString regex = \"[^0-9a-zA-Z_]+\";\n\t\tString ret = toClean.replaceAll(regex, \"_\");\n\t\tif(ret.length() > 50)\n\t\t\tret = ret.substring(0, 50);\n\t\treturn ret;\n\t}", "private String replace(String persistentId) {\n\t\tlog.info(\"calling replace() ...\");\n\t\tif (persistentId.contains(\"/\") || persistentId.contains(\"+\")\n\t\t\t\t|| persistentId.contains(\"=\")) {\n\t\t\tString aepst;\n\t\t\tif (persistentId.contains(\"/\")) {\n\t\t\t\taepst = persistentId.replaceAll(\"/\", \"_\");\n\t\t\t\tpersistentId = aepst;\n\t\t\t}\n\n\t\t\tif (persistentId.contains(\"+\")) {\n\t\t\t\taepst = persistentId.replaceAll(\"\\\\+\", \"-\");\n\t\t\t\tpersistentId = aepst;\n\t\t\t}\n\n\t\t\tif (persistentId.contains(\"=\")) {\n\t\t\t\taepst = persistentId.replaceAll(\"=\", \"\");\n\t\t\t\tpersistentId = aepst;\n\t\t\t}\n\t\t}\n\n\t\treturn persistentId;\n\t}", "private static String m1475b(String str) {\n return \"<!DOCTYPE html>\\n<html>\\n<head lang=\\\"en\\\">\\n <meta charset=\\\"UTF-8\\\">\\n <title></title>\\n</head>\\n<body style=\\\"margin:0;padding:0;\\\">\\n <script src=\\\"https://z.moatads.com/\" + str + \"/moatad.js\\\" type=\\\"text/javascript\\\"></script>\\n\" + \"</body>\\n\" + \"</html>\";\n }", "public static String cleanImdbId(Resource url) {\n String imdbId = \"\";\n if(!(url == null)) {\n imdbId = url.getURI().toString();\n }\n Pattern p = Pattern.compile(\"tt[\\\\d]+\");\n Matcher m = p.matcher(imdbId);\n if(m.find()) {\n imdbId = m.group();\n }\n return imdbId;\n }", "public String replaceIdentifiers(String str) {\n\t\t\n\t\t//If input is null, return null\n\t\tif(str == null) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t//Map to store the identifiers and their first occurrence index\n\t\tMap<String, Integer> identifierMap = new HashMap<String, Integer>();\n\t\t\n\t\t//Other temporary variables\n\t\tStringBuilder finalOutput = new StringBuilder();\n\t\tStringBuilder currIdentifier = new StringBuilder();\t \n\t\tint identifierIndex = 0; \t\t\t//keeps a count of identifier index\n\t\tboolean isIdentifier = false;\t\t//a flag to track if current char is part of an identifier\n\t\t\n\t\t//Loop on input string\n\t\tfor(Character ch : str.toCharArray()) {\n\t\t\t\n\t\t\t//If current char is a letter, append char to currIdentifier, else process currIdentifier \n\t\t\tif(Character.isUpperCase(ch) || Character.isLowerCase(ch)) {\n\t\t\t\tcurrIdentifier.append(ch);\n\t\t\t\tisIdentifier = true;\n\t\t\t} else {\t\t\t\t\n\t\t\t\tif(isIdentifier) {\n\t\t\t\t\t//If new identifier, add to map; else get index\n\t\t\t\t\tif(!identifierMap.containsKey(currIdentifier.toString())) {\t\t\t\t\t\t\n\t\t\t\t\t\tidentifierMap.put(currIdentifier.toString(), identifierIndex);\n\t\t\t\t\t\tfinalOutput.append(currIdentifier);\t//first occurrence, so no $ sign\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\tInteger existingIdentifierId = identifierMap.get(currIdentifier.toString());\n\t\t\t\t\t\tfinalOutput.append(\"$\" + existingIdentifierId); //$ sign for subsequent occurrences\n\t\t\t\t\t}\n\t\t\t\t\tidentifierIndex++;\n\t\t\t\t\tcurrIdentifier = new StringBuilder(); //start fresh for next identifier\n\t\t\t\t} \n\t\t\t\t//Append the current char, and set isIdentifier to false\n\t\t\t\tfinalOutput.append(ch);\n\t\t\t\tisIdentifier = false;\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t/* This block of code handles the case, when the input string ends in a character. Alternatively, \n\t\t * we can add a unique non-alphabetic character at the end of the input string (just before \n\t\t * the for loop), and remove that char from the finalOutput, just before returning it to \n\t\t * the calling method. \n\t\t */\n\t\tif(isIdentifier) {\n\t\t\tif(!identifierMap.containsKey(currIdentifier.toString())) {\t\t\t\t\t\t\n\t\t\t\t//Adding this last identifier to the map, is not needed as we have already reached the end. \n\t\t\t\t//But in case, we want to use this map for future processing, it is needed.\n\t\t\t\tidentifierMap.put(currIdentifier.toString(), identifierIndex);\n\t\t\t\tfinalOutput.append(currIdentifier);\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tInteger existingWordId = identifierMap.get(currIdentifier.toString());\n\t\t\t\tfinalOutput.append(\"$\" + existingWordId);\n\t\t\t}\t\t\t\n\t\t}\n\t\treturn finalOutput.toString();\n\t}", "private String modifyValue(String id) {\n\n String[] split = id.split(\"\\\"\");\n return split[1];\n }", "private String process(String str) {\r\n\t\t\tArrayList a = new ArrayList();\r\n\t\t\tArrayList b = new ArrayList();\r\n\t\t\tchar[] qq = str.toCharArray();\r\n\t\t\tfor (int i = 0; i < qq.length; i++) { \r\n\t\t\t\tif (((int)qq[i])==159 || ((int)qq[i])==143) a.add(i);\r\n\t\t\t if (((int)qq[i])==150) b.add(i);\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < a.size(); i++) {\r\n\t\t\t\tstr = str.replace(str.charAt(Integer.valueOf(a.get(i).toString())), '\\\"');\r\n\t\t\t}\r\n\t\t\tfor (int i = 0; i < b.size(); i++) {\r\n\t\t\t\tstr = str.replace(str.charAt(Integer.valueOf(b.get(i).toString())), '-');\r\n\t\t\t}\r\n\t\t\treturn str;\r\n\t\t}", "public static String sanitize(String inputString) {\n\t\tif(inputString == null) {\n\t\t\treturn new String();\n\t\t}\n\t\treturn inputString.toLowerCase()\n\t\t\t\t.replaceAll(\"[#%&*'\\\"/\\\\+\\\\-\\\\.]\",\" \")\n\t\t\t\t.replaceAll(\"[^a-z0-9 ]\", \"\")\n\t\t\t\t.replaceAll(\"\\\\s+\",\" \").trim();\n\t}", "static String re_screen(String str) {\n String screened = str.replaceAll(\"([\\\\\\\\\\\\^\\\\$\\\\.\\\\[\\\\]\\\\|\\\\(\\\\)\\\\?\\\\*\\\\+\\\\{\\\\}])\", \"\\\\\\\\$1\");\n //System.err.println(\"screened: \"+screened);\n return screened;\n }", "private static String normalizeID(String id) {\r\n\t\tint hashcode = id.hashCode();\r\n\t\tboolean positive = hashcode >= 0;\r\n\t\tlong longcode = positive ? (long) hashcode : -(long) hashcode;\r\n\t\tStringBuffer hexstring = new StringBuffer(Long.toHexString(longcode));\r\n\t\twhile (hexstring.length() < 8) {\r\n\t\t\thexstring.insert(0, '0');\r\n\t\t}\r\n\t\tif (positive) {\r\n\t\t\thexstring.insert(0, '0');\r\n\t\t} else {\r\n\t\t\thexstring.insert(0, '1');\r\n\t\t}\r\n\t\treturn hexstring.toString();\r\n\t}", "private String sanitizeString(String string) {\n if (string == null) {\n return \"\";\n }\n return string.toLowerCase().trim();\n }", "protected String validAnchor(String id) {\n if (!DoxiaUtils.isValidId(id)) {\n String linkAnchor = DoxiaUtils.encodeId(id);\n\n LOGGER.debug(\"Modified invalid link '{}' to '{}'\", id, linkAnchor);\n\n return linkAnchor;\n }\n\n return id;\n }", "private String findXID(String s) {\n\t\tint firstP = s.indexOf(\"(\");\n\t\tint lastP = s.indexOf(\")\");\n\n\t\treturn s.substring(firstP + 1, lastP);\n\t}", "private boolean isValidTagName(String s) {\n if (s.equals(\"=\")) {\n return true;\n }\n\n char[] array = s.toCharArray();\n if (Character.isLetter(array[0])) {\n for (int i = 1; i < array.length; i++) {\n if (!(Character.isLetterOrDigit(array[i]) || array[i] == '_')) {\n return false;\n }\n }\n return true;\n }\n\n return false;\n }", "@NonNull\n public String normalizeIdentifier(@NonNull String identifier) {\n return UuidAdapter.UUID_PATTERN.matcher(identifier).matches()\n ? ObjectUtils.notNull(identifier.toLowerCase(Locale.ROOT))\n : identifier;\n }", "public static Value makeAnyStrIdent() {\n return theStrIdent;\n }", "public String getId(String s){\n for (int i = 0; i<length; i++){\n if(wallList.get(i).getName().equalsIgnoreCase(s))\n id = wallList.get(i).getId();\n }\n return id;\n }", "private String generateId(String input) {\n\t\treturn StringUtil.hashSHA256(input);\n\t}", "private boolean isValidId(String id) {\r\n\t\tboolean result = false;\r\n\t\tif (id.length() >= 1) {\r\n\t\t\tif (Character.isLetter(id.charAt(0))) {\r\n\t\t\t\tif (id.contains(\".\")) {\r\n\t\t\t\t\tString[] tokens = id.split(\"\\\\.\");\r\n\t\t\t\t\tif (tokens.length == 2) {\r\n\t\t\t\t\t\tfor (int i = 0; i < tokens[0].length(); i++) {\r\n\t\t\t\t\t\t\tif (!(tokens[0].charAt(i) == '.'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '_'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '-' || Character\r\n\t\t\t\t\t\t\t\t\t\t.isLetterOrDigit(tokens[0].charAt(i)))) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfor (int i = 0; i < tokens[1].length(); i++) {\r\n\t\t\t\t\t\t\tif (!(tokens[0].charAt(i) == '.'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '_'\r\n\t\t\t\t\t\t\t\t\t|| tokens[0].charAt(i) == '-' || Character\r\n\t\t\t\t\t\t\t\t\t\t.isLetterOrDigit(tokens[0].charAt(i)))) {\r\n\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public static String sanitizeForMRS(String in) {\r\n\t\treturn in.replaceAll(\"[\\\"\\u2018\\u2019\\u201c\\u201d]\", \"'\").replaceAll(\"[\\u2026\\u22ef]\", \"...\").replaceAll(\"[\\u2010\\u2011\\u2012\\u2013\\u2014\\u2015]\", \"-\").replaceAll(\"[&+]\", \"and\");\r\n\t}", "protected String secureWindowId(String windowId)\n {\n if (windowId != null && windowId.length() > this.maxWindowIdLength)\n {\n windowId = windowId.substring(0, this.maxWindowIdLength);\n }\n return windowId;\n }", "public WorkerId(String idStr) throws UnvalidIdStrException {\n if (idStr == null) {\n throw new UnvalidIdStrException(\"id str can not be null\");\n }\n\n String[] idElemts = idStr.split(SEPARATOR);\n if (idElemts.length != 3 || !idElemts[0].equals(WORKER)) {\n throw new UnvalidIdStrException(\"unvalid id str \" + idStr + \", must be like this:\" + WORKER\n + SEPARATOR + \"workerGroupIndex\" + SEPARATOR + \"workerIndex\");\n }\n\n try {\n workerGroupId = new WorkerGroupId(Integer.valueOf(idElemts[1]));\n index = Integer.valueOf(idElemts[2]);\n } catch (Exception x) {\n throw new UnvalidIdStrException(\"unvalid id str \" + idStr + \" \" + x.getMessage()\n + \", must be like this:\" + WORKER + SEPARATOR + \"workerGroupIndex\" + SEPARATOR\n + \"workerIndex\");\n }\n }", "private String sanitize(String str) {\n\t\tstr = str.replace(COMPLETION_LEFT_SEP, \n\t\t\t\tCOMPLETION_LEFT_SEP + COMPLETION_LEFT_SEP);\n\t\tstr = str.replace(COMPLETION_RIGHT_SEP, \n\t\t\t\tCOMPLETION_RIGHT_SEP + COMPLETION_RIGHT_SEP);\n\t\treturn str;\n\t}", "public static java.lang.String getCanonicalID(java.lang.String id) { throw new RuntimeException(\"Stub!\"); }", "public static String escapeString(String str) {\n return escapeString(str, 0xf423f);\n\t}", "private String renderSpecific( String strHTML )\n {\n String strRender = strHTML;\n strRender = strRender.replaceAll( \"\\\\[lt;\", \"&lt;\" );\n strRender = strRender.replaceAll( \"\\\\[gt;\", \"&gt;\" );\n strRender = strRender.replaceAll( \"\\\\[nbsp;\", \"&nbsp;\" );\n strRender = strRender.replaceAll( \"\\\\[quot;\", \"&quot;\" );\n strRender = strRender.replaceAll( \"\\\\[amp;\", \"&amp;\" );\n strRender = strRender.replaceAll( \"\\\\[hashmark;\", \"#\" );\n\n if ( _strPageUrl != null )\n {\n strRender = strRender.replaceAll( \"#page_url\", _strPageUrl );\n }\n\n return strRender;\n }", "static String m9939c(String str) throws C2579j {\n if (str == null || str.isEmpty()) {\n throw new C2579j(\"Authorization response does not contain the signed_request\");\n }\n try {\n String[] split = str.split(\"\\\\.\");\n if (split.length == 2) {\n return new JSONObject(new String(Base64.decode(split[1], 0), C2793C.UTF8_NAME)).getString(\"user_id\");\n }\n } catch (UnsupportedEncodingException | JSONException unused) {\n }\n throw new C2579j(\"Failed to retrieve user_id from signed_request\");\n }", "String idProvider();", "private static String fromHtmlEntity(String str) {\n Character ch = map.get(str);\n return (ch != null) ? ch.toString() : str;\n }", "static String hideString(String input) {\n if (input == null || input.isEmpty()) {\n return input;\n }\n if (input.length() <= 2) {\n return Strings.repeat(\"X\", input.length());\n }\n\n return new StringBuilder(input).replace(1, input.length() - 1,\n Strings.repeat(\"X\", input.length() - 2))\n .toString();\n }", "@Override\n\tpublic void insertString(int offs, String str, AttributeSet a) throws BadLocationException {\n\t\tsuper.insertString(offs, str.replaceAll(\"[^0-9]\", \"\"), a);\n\t}", "public static String getId(String val, String pattern) {\n String str[] = val.split(pattern);\n if (str.length > 0) { \n for (String s: str) {\n if (s != null && s.contains(\"!\")) {\n String id = pattern + s.split(\"!\")[0].trim();\n log.info(\"id \" + id);\n return id;\n }\n }\n }\n return null;\n }", "public static String escapeHTML(String str){\r\n\t\treturn FuzzyXMLUtil.escape(str, true);\r\n\t}", "public static boolean isValidId(String test) {\n return test.matches(VALIDATION_REGEX);\n }", "public static boolean isValidId(String test) {\n return test.matches(VALIDATION_REGEX);\n }", "public static java.lang.String getCanonicalID(java.lang.String id, boolean[] isSystemID) { throw new RuntimeException(\"Stub!\"); }", "public void setIdAuthority(String theString) {\n\t \r\n }", "static String composeDocumentId(String elementUuid) {\n\t\tObjects.requireNonNull(elementUuid, \"A elementUuid must be provided.\");\n\t\treturn elementUuid;\n\t}", "public static String normalizeString(String str) {\n\t\tlog.trace(\"Entering normalizeString: str='\" + str + \"'\");\n\t\treturn str.replace(':', '-').replace(' ', '_');\n\t}", "public void setID(String value) {\n tokenString_ID = value;\n }", "public Builder setStringId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n stringId_ = value;\n onChanged();\n return this;\n }", "public Builder setStringId(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n stringId_ = value;\n onChanged();\n return this;\n }", "private String createId() {\n int idLength = 5;\n String possibleChars = \"1234567890\";\n Random random = new Random();\n StringBuilder newString = new StringBuilder();\n\n for (int i = 0; i < idLength; i++) {\n int randomInt = random.nextInt(10);\n newString.append(possibleChars.charAt(randomInt));\n }\n\n return newString.toString();\n }", "private String encodeXSS(String s) { \n if (s == null || \"\".equals(s)) { \n return s; \n } \n StringBuilder sb = new StringBuilder(s.length() + 16); \n for (int i = 0; i < s.length(); i++) { \n char c = s.charAt(i); \n switch (c) { \n \n //handle the '<' and '>' which can be used for constructing <script> and </script> \n case '>': \n sb.append('>'); \n break; \n case '<': \n sb.append('<'); \n break; \n \n //since the html can support the characters using $#number format \n //so here also need to escape '#','&' and quote symbol \n case '\\'': \n sb.append('‘'); \n break; \n case '\\\"': \n sb.append('“'); \n break; \n case '&': \n sb.append('&'); \n break; \n case '\\\\': \n sb.append('\'); \n break; \n case '#': \n sb.append('#'); \n break; \n //if not the special characters ,then output it directly \n default: \n sb.append(c); \n break; \n } \n } \n return sb.toString(); \n }", "public static String sanitizeInput(String input) {\n\t\t\n\t\tStringBuffer sb = new StringBuffer();\n\t\tfor (int i = 0 ; i < input.length(); i++) {\n\t\t\tchar c = input.charAt(i);\n\t\t\tif (c >= 48 && c <= 57) {\n\t\t\t\tsb.append(c);\n\t\t\t} else if (c >= 65 && c <= 90) {\n\t\t\t\tsb.append(c);\n\t\t\t} else if (c >= 97 && c <= 122) {\n\t\t\t\tsb.append(c);\n\t\t\t}\n\t\t}\n\t\treturn sb.toString();\n\t\t\n\t}", "public String getUserIdEscaped(final String userId) {\n return userId.replaceAll(\"\\\\@\", \"\\\\%40\");\n }", "private String cleanText(String str) {\r\n\t\tString clean = str.replace(\" \", \"\");\r\n\t\tclean = clean.replace(\":\", \"\");\r\n\t\tclean = clean.replace(\"$\", \"\");\r\n\t\tclean = clean.replace(\".\", \"\");\r\n\t\tclean = clean.replace(\"\\\"\", \"\");\r\n\t\tclean = clean.replace(\"'\", \"\");\r\n\t\tclean = clean.replace(\"&\", \"\");\r\n\t\treturn clean;\r\n\t}", "protected Identifier toIdentifier(String stringForm, MetadataBuildingContext buildingContext) {\n\t\treturn buildingContext.getMetadataCollector()\n\t\t\t\t.getDatabase()\n\t\t\t\t.getJdbcEnvironment()\n\t\t\t\t.getIdentifierHelper()\n\t\t\t\t.toIdentifier( addUnderscores(stringForm) );\n\t}", "public String htmlSpecialChar(String string){\n String res = string.replaceAll(\"&\",\"&amp;\");\n res = res.replace(\"'\",\"&#039;\");\n res = res.replace(\"\\\"\",\"&qout;\");\n res = res.replace(\"$\",\"&#036;\");\n res = res.replace(\"%\",\"&#037;\");\n res = res.replace(\"<\",\"&lt;\");\n res = res.replace(\">\",\"&gt;\");\n res = res.replace(\"\\n\",\"\\\\n\");\n return res;\n }", "public static String prepareText(String s)\n {\n return StringEscapeUtils.escapeHtml4(s);\n }", "private String m7158b(String str) {\n Matcher matcher = f5714e.matcher(str);\n if (matcher.find()) {\n return matcher.group(1);\n }\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Invalid request `\");\n stringBuilder.append(str);\n stringBuilder.append(\"`: url not found!\");\n throw new IllegalArgumentException(stringBuilder.toString());\n }", "public String getValidIdentifier(String baseName, boolean truncateUsingRandomDigits);", "void setID(java.lang.String id);", "static String filterString(Object o, String str) {\r\n // if (o instanceof Named) {\r\n // Named n = (Named) o;\r\n // str = str.replace(\"$name\", n.getName());\r\n // // System.out.println(n.getName());\r\n // }\r\n // if (o instanceof Described) {\r\n // Described n = (Described) o;\r\n // str = str.replace(\"$description\", n.getDescription());\r\n // }\r\n return str;\r\n }", "String parseUID(long uid);", "public String sanitize(String amount) {\n return amount.replaceAll(\"[^\\\\d.,]\", \"\");\n }", "java.lang.String getStringId();", "java.lang.String getStringId();", "void mo85415a(String str);", "public void setID(final String id)\n {\n this.id = id.substring(6, id.length());\n }", "@org.junit.Test\n public static final void testDigitsInAttrNames() {\n junit.framework.TestCase.assertEquals(\"<div>Hello</div>\", eu.stamp_project.reneri.instrumentation.StateObserver.observe(\"org.owasp.html.HtmlSanitizerTest|testDigitsInAttrNames()|0\", org.owasp.html.HtmlSanitizerTest.sanitize(\"<div style1=\\\"expression(\\'alert(1)\\\")\\\">Hello</div>\")));\n }", "private native void addUniqueIdsForLocations(Element e, String idPrefix) /*-{\n \ttry {\n \t var divs = e.getElementsByTagName(\"div\"); \n \t for (var i = 0; i < divs.length; i++) {\n \t var div = divs[i];\n \t var location = div.getAttribute(\"location\");\n \t if (location != null) {\n \t div.setAttribute(\"id\",idPrefix + location);\n \t div.innerHTML=\"\";\n \t }\n \t }\t\n \t \t } catch (e) {}\n \t\t\n \t }-*/;", "private String clean(String in) {\n return (in == null ? \"\" : in.replaceAll(\"'\", \"\\\\'\"));\n }", "protected String quoteIdentifiers(String s) {\n return databasePlatform.convertQuotedIdentifiers(s);\n }", "private String computeHeaderIdForText(String header) {\n\t\tString id = header.replaceAll(\"[^a-zA-Z0-9]+\", \"-\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tid = id.toLowerCase();\n\t\tid = id.replaceFirst(\"^[^a-zA-Z0-9]+\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tid = id.replaceFirst(\"[^a-zA-Z0-9]+$\", \"\"); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tif (Strings.isEmpty(id)) {\n\t\t\treturn \"section\"; //$NON-NLS-1$\n\t\t}\n\t\treturn id;\n\t}", "public String cleanupUserStrings(String userSubmittedString, boolean cleanupHtml) {\n // this just returns it back, so tests for malicious strings won't be caught\n return userSubmittedString;\n }", "public void m6639d(String str) {\n String f = C1383b.m6746f(this.f5390J.getText().toString());\n C0938a.m5002a(\"SR/SoundRecorder\", \"<setEntryName> after removeIllChar: \" + f);\n if (f == null || f.length() <= 0) {\n this.f5390J.setText(str);\n return;\n }\n String trim = f.trim();\n if (trim == null || trim.length() <= 0) {\n this.f5390J.setText(str);\n } else {\n this.f5390J.setText(trim);\n }\n }", "public void setIdByString(String uuid) {\n mId = UUID.fromString(uuid);\n }", "public static String toUserPresentable(String id)\n {\n StringBuilder builder = new StringBuilder(id.length() * 2);\n \n char[] chars = id.toCharArray();\n boolean postSpace = true;\n boolean upcaseNext = true;\n \n for (char ch : chars)\n {\n if (upcaseNext)\n {\n builder.append(Character.toUpperCase(ch));\n upcaseNext = false;\n \n continue;\n }\n \n if (ch == '_')\n {\n builder.append(' ');\n upcaseNext = true;\n continue;\n }\n \n boolean upperCase = Character.isUpperCase(ch);\n \n if (upperCase && !postSpace)\n builder.append(' ');\n \n builder.append(ch);\n \n postSpace = upperCase;\n }\n \n return builder.toString();\n }", "public String reFormatStringForURL(String string) {\n\t\t string = string.toLowerCase().replaceAll(\" \", \"-\").replaceAll(\"--\", \"-\");\n\t\t if(string.endsWith(\"-\")) { string = string.substring(0, (string.length() - 1)); }\n\t\t return string;\n\t\t }", "@Override\n\tpublic void insertString(FilterBypass fb, int offset, String string, AttributeSet attr)\n\t\t\tthrows BadLocationException {\n\t\tif((fb.getDocument().getLength() + string.length()) <= MAX_NUMBER_DIGITS && string.matches(REGEX)) {\n\t\t\t//replace in string to append only characters that are digits \n\t\t\tfb.insertString(offset, string, attr);\n\t\t}else {\n\t\t\tToolkit.getDefaultToolkit().beep();\n\t\t}\n\t}", "public void setTextDivEdicion(String text) { doSetText(this.$element_DivEdicion, text); }", "public static boolean empidValidate(String emp_id){\n if(emp_id.matches(\"\\\\p{IsAlphabetic}{2}-\\\\d{4}\"))\n return true;\n\n else {\n System.out.println(\"The employee ID must be in the format of AA-1234.\");\n return false;\n }\n\n }", "void mo41089d(String str);", "private String fixSlashes(String str) {\n\t\tstr = str.replace('\\\\', '/');\r\n\t\t// compress multiples into singles;\r\n\t\t// do in 2 steps with dummy string\r\n\t\t// to avoid infinte loop\r\n\t\tstr = replaceString(str, \"//\", \"_____\");\r\n\t\tstr = replaceString(str, \"_____\", \"/\");\r\n\t\treturn str;\r\n\t}", "private static UUID uuidFromDSUID(String dsuid) {\n return UUID.fromString(\n dsuid.substring(0, 8) + \"-\" +\n dsuid.substring(8, 12) + \"-\" +\n dsuid.substring(12, 16) + \"-\" +\n dsuid.substring(16, 20) + \"-\" +\n dsuid.substring(20, 32));\n }", "public static String hackerSpeak(String str) {\n\n String replace = str.replace(\"a\", \"4\").replace(\"e\", \"3\").replace(\"i\", \"1\").replace(\"o\", \"0\").replace(\"s\", \"5\");\n return replace;\n }", "public String escapeIdentifier(String identifierName);" ]
[ "0.5694769", "0.567416", "0.5566309", "0.54859424", "0.5460938", "0.5404283", "0.53871316", "0.53431875", "0.53209877", "0.5262356", "0.523826", "0.52299315", "0.5188462", "0.51469797", "0.5132282", "0.5131323", "0.5113651", "0.5094696", "0.5071911", "0.50538087", "0.5053045", "0.50340176", "0.50222147", "0.49556804", "0.49346265", "0.4934258", "0.4921399", "0.4903025", "0.49023354", "0.48979187", "0.4894682", "0.48883897", "0.48820686", "0.48706526", "0.48628277", "0.48566416", "0.48531386", "0.48424047", "0.48151106", "0.48059627", "0.48021466", "0.47932315", "0.47928998", "0.47832996", "0.4764386", "0.47552526", "0.4755229", "0.4751258", "0.47504213", "0.47408855", "0.47389925", "0.47311366", "0.472934", "0.47242686", "0.4710691", "0.47072563", "0.47064564", "0.47064564", "0.47051585", "0.47048298", "0.46920505", "0.46832326", "0.4681367", "0.46772882", "0.46772882", "0.46729997", "0.46615884", "0.46548477", "0.46481448", "0.46470305", "0.4640625", "0.46281293", "0.46271595", "0.46226513", "0.46217653", "0.4615705", "0.46118858", "0.460627", "0.4605587", "0.46002626", "0.46002626", "0.45938388", "0.45899144", "0.45665437", "0.4561748", "0.4561275", "0.4558196", "0.45580205", "0.45566052", "0.45481962", "0.45462817", "0.45441863", "0.45413435", "0.45202708", "0.45055178", "0.45045587", "0.45019877", "0.44930884", "0.4492118", "0.44918662", "0.44911864" ]
0.0
-1
Adds javascript to the page based on the URL provided
private void addJS(String jsLocation) { Script ajaxScript = new Script(""); ajaxScript.attribute("src", jsLocation); ajaxScript.attribute("type", "text/javascript"); page.addHeader(ajaxScript); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void addJQueryJS() {\n addJS(\"http://code.jquery.com/jquery-1.9.1.js\");\n addJS(\"http://code.jquery.com/ui/1.10.3/jquery-ui.js\");\n addJS(\"js/auDetails-new.js\");\n }", "public void loadJavaScript(String javascript) {\n if (TextUtils.isEmpty(javascript)) {\n return;\n }\n\n if (Build.VERSION.SDK_INT >= 19) { //Build.VERSION_CODES.KITKAT\n String newJS = clipJacaScriptUrlString(javascript);\n if (!newJS.startsWith(\"javascript:\")) {\n try{\n super.evaluateJavascript(newJS, null);\n }catch (Exception | Error e){\n super.loadUrl(javascript);\n e.printStackTrace();\n }\n } else {\n super.loadUrl(javascript);\n }\n } else {\n super.loadUrl(javascript);\n }\n }", "public static void Javascript() {\n\n\t}", "public JavaScript append(String javaScriptPartToAppend) {\n return js(javaScript + javaScriptPartToAppend);\n }", "protected void doScript(Set<String> scripts, JspWriter out, HttpServletRequest request, HttpServletResponse response, String location) throws IOException {\n\t\tif( scripts.contains(location)){\n\t\t\treturn;\n\t\t}\n\t\tscripts.add(location);\n\t\tif( location.startsWith(\"/\")){\n\t\t\t// script file\n\t\t\tout.print(\"<script type=\\\"text/javascript\\\" charset=\\\"utf8\\\" src=\\\"\");\n\t\t\tif( location.startsWith(\"//\")){\n\t\t\t\t// remote script file\n\t\t\t\tout.print(location);\n\t\t\t}else {\n\t\t\t\t// local script file\n\t\t\t\t// no sessionid needed\n\t\t\t\tout.print(request.getContextPath()+location);\t\t\n\t\t\t}\n\t\t\tout.println(\"\\\"></script>\");\n\t\t}else{\n\t\t\t// in-line script\n\t\t\tout.print(\"<script type=\\\"text/javascript\\\" charset=\\\"utf8\\\" >\");\n\t\t\tout.print(location);\n\t\t\tout.println(\"</script>\");\n\t\t}\n\t}", "public String getPageUrl() {\n return JS_URL;\n }", "@Override\n public void onLoad(String url) {\n \n }", "@Override\n\t\t public void onPageFinished(WebView view, String url) {\n\t\t webView.loadUrl(\"javascript:HTMLOUT.processHTML(document.documentElement.outerHTML);\");\n\t\t }", "public void onPageFinished(WebView view, String url) {\n webView.loadUrl(\"javascript:HTMLOUT.processHTML(document.documentElement.outerHTML);\");\n }", "@Override\n\t\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\t\turl_load = url;\n\t\t\t\tLog.i(TAG, \"WEBVIEW FINISH== \" + url);\n\t\t\t\tview.loadUrl(\"javascript:window.injs.getHtmlContentOrImg(1,document.body.innerText)\");\n\t\t\t\tview.loadUrl(\"javascript:window.injs.getHtmlContentOrImg(2,document.getElementsByTagName('img')[0].src)\");\n\n\t\t\t\tview.evaluateJavascript(\"javascript:getShareInfo()\",\n\t\t\t\t\t\tnew ValueCallback<String>() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void onReceiveValue(String value) {\n\t\t\t\t\t\t\t\tif (value != null) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tvalue = value.replace(\"\\\\\", \"\");\n\t\t\t\t\t\t\t\t\t\tvalue = value.substring(1,\n\t\t\t\t\t\t\t\t\t\t\t\tvalue.length() - 1);\n\t\t\t\t\t\t\t\t\t\tLog.i(TAG, \" value== \" + value);\n\t\t\t\t\t\t\t\t\t\tJSONObject json = new JSONObject(value);\n\t\t\t\t\t\t\t\t\t\ttitle = json.optString(\"title\", \"\");\n\t\t\t\t\t\t\t\t\t\tdesc = json.optString(\"desc\", \"\");\n\t\t\t\t\t\t\t\t\t\timgUrl = json.optString(\"imgUrl\", \"\");\n\t\t\t\t\t\t\t\t\t\tlink = json.optString(\"link\", \"\");\n\t\t\t\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\tsuper.onPageFinished(view, url);\n\t\t\t}", "public void loadJavaScript(String javascript, final ValueCallback<String> resultCallback) {\n if (TextUtils.isEmpty(javascript)) {\n return;\n }\n\n if(Build.VERSION.SDK_INT >= 19) { //Build.VERSION_CODES.KITKAT\n String newJS = clipJacaScriptUrlString(javascript);\n if (!newJS.startsWith(\"javascript:\")) {\n try{\n super.evaluateJavascript(newJS, resultCallback);\n }catch (Exception | Error e){\n super.loadUrl(javascript);\n e.printStackTrace();\n }\n } else {\n super.loadUrl(javascript);\n }\n } else {\n super.loadUrl(javascript);\n }\n }", "void loadScript(URL url) throws IOException, ScriptRunnerException;", "private void loadWeb() {\n\t\tweb.getSettings().setJavaScriptEnabled(true);\r\n\t\t//\r\n\t\tweb.setWebViewClient(new WebViewClient() {\r\n\t\t\t@Override\r\n\t\t\tpublic boolean shouldOverrideUrlLoading(WebView view, String url) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\treturn super.shouldOverrideUrlLoading(web, url);\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageFinished(WebView view, String url) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tsuper.onPageFinished(view, url);\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageStarted(WebView view, String url, Bitmap favicon) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tsuper.onPageStarted(view, url, favicon);\r\n\t\t\t}\r\n\t\t});\r\n\t\tweb.loadUrl(url);\r\n\t}", "@Override\n public void onPageFinished(WebView view, String url) {\n view.loadUrl(\"javascript:calcRoute()\");\n }", "public static void addScript(AppContext conn,HttpServletRequest request, String script){\n\t\tif( script == null || script.trim().isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tSet<String> scripts = (Set<String>) request.getAttribute(REQUEST_SCRIPT_ATTR);\n\t\tif( scripts == null ){\n\t\t\tscripts=new LinkedHashSet<>();\n\t\t\trequest.setAttribute(REQUEST_SCRIPT_ATTR, scripts);\n\t\t}\n\t\tscripts.add(conn.expandText(script));\n\t}", "public void onLoadResource(WebView view, String url) {\n\n }", "public void displayUrl(String url)\n {\n //Create a new WebView to clear the old data\n createNewWebView();\n\n //Enable JavaScript\n WebSettings webSettings = webView.getSettings();\n webSettings.setJavaScriptEnabled(true);\n\n //Display website to user\n webView.setWebViewClient(new WebViewClient());\n webView.loadUrl(url);\n }", "@Override\n public void onPageFinished(WebView view, String url) {\n browser.loadUrl(\"javascript:HtmlOut.processHTML\" +\n \"('<html>'+document.getElementsByTagName('html')[0].innerHTML+'</html>');\");\n }", "public void executeScript(String js) {\n try {\n this.webView.getEngine().executeScript(js);\n } catch (RuntimeException ex) {\n ex.printStackTrace();\n if (!this.pdfJsLoaded) this.toExecuteWhenPDFJSLoaded += String.format(\"%s;\", js);\n }\n }", "@Override\n public void onPageFinished(WebView view, String url) {\n\n Log.d(\"webb \", \"onPageFinished \" + url);\n Log.d(\"webb \", \"webview \" + view.toString());\n if (url.equals(\"http://www.mawared.badee.com.sa/api/v1/payment/return\")||url.contains(\".payfort.com/FortAPI/general/backToMerchant\")) {\n // Toast.makeText(activity, \"please wait\", Toast.LENGTH_SHORT).show();\n showDialog();\n //startActivity(new Intent(activity,MainActivity.class));\n }\n\n Log.e(\"console\",\"url is \"+url);\n webView.loadUrl(\"javascript:console.log(document.body.getElementsByTagName('pre')[0].innerHTML);\");\n\n }", "protected void writeAjaxPageHtmlVaadinScripts(RenderRequest request,\n RenderResponse response, final BufferedWriter writer,\n Application application, String themeName) throws IOException,\n PortletException {\n String themeURI = getThemeURI(themeName, request);\n \n // fixed base theme to use - all portal pages with Vaadin\n // applications will load this exactly once\n String portalTheme = getPortalProperty(PORTAL_PARAMETER_VAADIN_THEME,\n request.getPortalContext());\n \n writer.write(\"<script type=\\\"text/javascript\\\">\\n\");\n writer.write(\"if(!vaadin || !vaadin.vaadinConfigurations) {\\n \"\n + \"if(!vaadin) { var vaadin = {}} \\n\"\n + \"vaadin.vaadinConfigurations = {};\\n\"\n + \"if (!vaadin.themesLoaded) { vaadin.themesLoaded = {}; }\\n\");\n if (!isProductionMode()) {\n writer.write(\"vaadin.debug = true;\\n\");\n }\n \n writeAjaxPageScriptWidgetset(request, response, writer);\n \n Map<String, String> config = getVaadinConfigurationMap(request,\n response, application, themeURI);\n writeAjaxPageScriptConfigurations(request, response, writer, config);\n \n writer.write(\"</script>\\n\");\n \n writeAjaxPageHtmlTheme(request, writer, themeName, themeURI,\n portalTheme);\n \n // TODO Warn if widgetset has not been loaded after 15 seconds\n }", "public void addScripture(Scripture toAdd) {\n scriptures.add(toAdd);\n }", "@SuppressWarnings(\"unchecked\")\n public static void addScriptResourceToLiferayHead(Object liferayPortlet, String resourceURL, String id) {\n\n // Note: Use Java Reflection in order to avoid a compile-time dependency.\n try {\n Method getHeaderPortalJavaScriptMethod = liferayPortlet.getClass().getMethod(\"getHeaderPortalJavaScript\",\n (Class[]) null);\n boolean added = false;\n\n if (getHeaderPortalJavaScriptMethod != null) {\n List<String> headerPortalJavaScriptList = (List<String>) getHeaderPortalJavaScriptMethod.invoke(\n liferayPortlet, (Object[]) null);\n\n PortalActionURL resurl = new PortalActionURL(resourceURL);\n resurl.addParameter(LIFERAY_RESOURCE_UID, id);\n resourceURL = resurl.toString();\n\n if (headerPortalJavaScriptList != null) {\n if (headerPortalJavaScriptList.contains(resourceURL)) {\n added = true;\n }\n if (!added) {\n ListIterator<String> iter = headerPortalJavaScriptList.listIterator();\n while (iter.hasNext()) {\n String foundURL = iter.next();\n PortalActionURL fresurl = new PortalActionURL(foundURL);\n String fuid = fresurl.getParameter(LIFERAY_RESOURCE_UID);\n if (fuid != null && fuid.equals(id)) {\n //iter.set(resourceURL);\n added = true;\n break;\n }\n }\n }\n if (!added) {\n headerPortalJavaScriptList.add(resourceURL);\n added = true;\n }\n }\n\n }\n\n if (!added) {\n logger.log(Level.WARNING,\n \"Unable to add <script /> resource to <head>...</head> section using Liferay mechanism: url=[{}]\",\n resourceURL);\n }\n } catch (Exception e) {\n logger.log(Level.SEVERE, e.getMessage(), e);\n }\n }", "private void renderScript(Tag headTag, String context, String dojoPath) {\n Tag scriptTag = headTag.addChild(new CompositeTag(HtmlElement.SCRIPT));\n scriptTag.addAttribute(\"type\", \"text/javascript\");\n scriptTag.addAttribute(\"src\", context + dojoPath + \"/dojo/dojo.js\");\n scriptTag.addAttribute(\"djConfig\", config);\n }", "protected void onLoad() {\n \t\tsuper.onLoad();\n \t\teval(scripts);\n \t}", "public void addURL(String url) {\n pageURLs.add(url);\n }", "public void handleScript(HtmlObjects.Script t)\n {\n }", "@Override\n protected void afterActivityLaunched() {\n onWebView().forceJavascriptEnabled();\n }", "public void load(String url);", "public static JavaScript js(String javaScript) {\n return js(javaScript);\n }", "@NotNull\n\tpublic StringBuilder renderAngularJavascript(Page<?> page)\n\t{\n\t\tStringBuilder sb = new StringBuilder();\n\t\tAngularFeature af = new AngularFeature(page);\n\t\taf.configureTemplateVariables();\n\t\tsb.append(FileTemplates.renderTemplateScripts(\"jwangular\"));\n\t\tAngularPageConfigurator.log.finest(\"Rendering the angular script\");\n\t\treturn sb;\n\t}", "public JavaScript(String javaScript) {\n this.javaScript = javaScript;\n }", "@Override\n public void onLoadResource(WebView view, String url) {\n super.onLoadResource(view, url);\n }", "@Override\n public void onLoadResource(WebView view, String url) {\n super.onLoadResource(view, url);\n }", "public void onPageFinished(WebView view, String url){\n wb.loadUrl(\"javascript:(function(){\"+\"document.getElementById('show').style.display ='none';\"+\"})()\");\n //Call to a function defined on my myJavaScriptInterface\n wb.loadUrl(\"javascript: window.CallToAnAndroidFunction.setVisible()\");\n }", "public void loadUrl(String url, Map<String, String> additionalHttpHeaders, CallBackFunction returnCallback) {\n mWebView.loadUrl(url, additionalHttpHeaders, returnCallback);\n }", "public static void writeJavaScript(final Response response, final CharSequence text)\n\t{\n\t\tAttributeMap attributes = new AttributeMap();\n\t\tattributes.putAttribute(ATTR_TYPE, \"text/javascript\");\n\t\twriteInlineScript(response, text, attributes);\n\t}", "protected void writeAjaxPageScriptWidgetset(RenderRequest request,\n RenderResponse response, final BufferedWriter writer)\n throws IOException {\n String requestWidgetset = getApplicationOrSystemProperty(\n PARAMETER_WIDGETSET, null);\n String sharedWidgetset = getPortalProperty(\n PORTAL_PARAMETER_VAADIN_WIDGETSET, request.getPortalContext());\n \n String widgetset;\n if (requestWidgetset != null) {\n widgetset = requestWidgetset;\n } else if (sharedWidgetset != null) {\n widgetset = sharedWidgetset;\n } else {\n widgetset = DEFAULT_WIDGETSET;\n }\n String widgetsetURL = getWidgetsetURL(widgetset, request);\n writer.write(\"document.write('<iframe tabIndex=\\\"-1\\\" id=\\\"__gwt_historyFrame\\\" \"\n + \"style=\\\"position:absolute;width:0;height:0;border:0;overflow:\"\n + \"hidden;opacity:0;top:-100px;left:-100px;\\\" src=\\\"javascript:false\\\"></iframe>');\\n\");\n writer.write(\"document.write(\\\"<script language='javascript' src='\"\n + widgetsetURL + \"'><\\\\/script>\\\");\\n}\\n\");\n }", "@Override\n\t\tpublic void onLoadResource(WebView view, String url) {\n\t\t\tsuper.onLoadResource(view, url);\n\t\t}", "private void startWebView(String url) {\n\n webView.setWebViewClient(new WebViewClient() {\n\n //If you will not use this method url links are opeen in new brower not in webview\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\n view.loadUrl(url);\n return true;\n }\n\n //Show loader on url load\n public void onLoadResource(WebView view, String url) {\n\n }\n\n @Override\n public void onPageStarted(WebView view, String url, Bitmap favicon) {\n DialogClass.showDialog(LocationTrackerActivity.this, getResources().getString(R.string.please_wait));\n super.onLoadResource(view, url);\n super.onPageStarted(view, url, favicon);\n }\n\n public void onPageFinished(WebView view, String url) {\n DialogClass.dismissDialog(LocationTrackerActivity.this);\n isLoadComplete = true;\n super.onPageFinished(view, url);\n }\n\n @Override\n public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) {\n DialogClass.dismissDialog(LocationTrackerActivity.this);\n super.onReceivedError(view, request, error);\n }\n });\n webView.loadUrl(url);\n\n }", "@Override\n\t\t\tpublic void onLoadResource(WebView view, String url) {\n\t\t\t\tsuper.onLoadResource(view, url);\n\t\t\t}", "@Override\n public void onPageFinished(WebView view, String url)\n {\n }", "@Override\n public void onPageFinished(final WebView view, final String url) {\n super.onPageFinished(view, url);\n \n }", "public void onModuleLoad() {\n VueGWT.init();\n\n // Inject JS Components\n HTMLScriptElement scriptElement =\n (HTMLScriptElement) DomGlobal.document.createElement(\"script\");\n scriptElement.text = JsFilesResources.INSTANCE.jsComponents().getText();\n DomGlobal.document.body.appendChild(scriptElement);\n\n MelisandreComponentClientBundle.INSTANCE.melisandreComponentStyle().ensureInjected();\n Vue.customElement(\"animal-selector\", AnimalSelectorComponentFactory.get());\n\n VueGwtExamplesService.initExamples();\n }", "public void getURL(String url, String target)\n throws IOException {\n if (url.startsWith(JSSTRING)) {\n linkCount += ExtractorJS.considerStrings(uriErrors, curi, url, \n false);\n } else {\n int max = uriErrors.getMaxOutlinks(curi);\n Link.addRelativeToVia(curi, max, url, LinkContext.EMBED_MISC,\n Hop.EMBED);\n linkCount++;\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n\n WebView webView = (WebView) findViewById(R.id.webView);\n webView.getSettings().setJavaScriptEnabled(true);\n webView.loadUrl(urls[0]);\n\n return null;\n }", "private void hitURL(String URL){\n Log.v(\".hitURL\", \" now crawling at: \" + URL);\n String refinedURL = NetworkUtils.makeURL(URL).toString();\n visitedLinks.add(refinedURL);\n browser.loadUrl(refinedURL);\n\n\n // OR, you can also load from an HTML string:\n// String summary = \"<html><body>You scored <b>192</b> points.</body></html>\";\n// webview.loadData(summary, \"text/html\", null);\n // ... although note that there are restrictions on what this HTML can do.\n // See the JavaDocs for loadData() and loadDataWithBaseURL() for more info.\n }", "public boolean shouldOverrideUrlLoading(WebView view, String url){\n Log.d(\"debug\",\"url to open:\"+url);\n if(url.contains(\"?code=\")){\n String[] codepiece = url.split(\"code=\");\n String code=codepiece[1];\n Log.d(\"debug\",\"code is :\"+code+\":\");\n }else {\n view.loadUrl(url);\n }\n return false; // then it is not handled by default action\n }", "void setJs(final String js) {\n this.js = js;\n }", "private void removeJavascript(ServletContext scontext)\r\n {\r\n String webApp = scontext.getContextPath();\r\n javascriptService.remove(scontext);\r\n }", "public int doStartTag() throws JspException {\r\n try {\r\n JspWriter out = pageContext.getOut();\r\n \r\n //out.println(\"<script language='javascript' type='text/javascript' src='com/js/solarcalendar.js'></script>\");\r\n out.println(\"<a class='CALENDRIER'>\" + title + \"</a>\");\r\n // I(Reza Ghaffaripour) moved the text field out of this component.user should have a layout:text for date. property of this layout:text should be the name of calendar:solar_dare tag.\r\n // out.println(\"<input type='text' id='\"+name+\"' class='clsDateBox' name='\"+name+\"' />\");\r\n out.println(\"<a href=javascript:NewCal('\" + name + \"')><img border=0 src='\" + srcKey + \"' alt='\" + altKey + \"'></a>\");\r\n }\r\n catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n return SKIP_BODY;\r\n }", "@Override\n public List<String> extractLibraryNameByUrl(String url) {\n List<String> javascriptLibaries = new ArrayList<>();\n\n try {\n Optional<Document> doc = parser.downloadPage(url);\n\n if (doc.isPresent()) {\n //Extract List of JavaScript Libraries used by the page\n javascriptLibaries = parser.parseDocument(String.valueOf(doc.get()))\n .select(\"script\")\n .stream()\n .map(element -> element.attr(\"src\"))\n .filter(src -> !StringUtil.isBlank(src) && src.endsWith(\".js\"))\n .map(r -> r.substring(r.lastIndexOf('/') + 1, r.length()))\n .collect(Collectors.toList());\n }\n\n } catch (Exception exception) {\n logger.error(\"Unable to Extract JavaScript Library Names\", exception);\n }\n\n return javascriptLibaries;\n }", "@Override\n public void onPageFinished(WebView view, String url) {\n super.onPageFinished(view, url);\n\n \n }", "public void addScriptPath(String path) throws IOException {\r\n File file = new File(path);\r\n if (file.isDirectory()) {\r\n loader = new DirectoryScriptLoader(loader, file);\r\n } else if (file.isFile()) {\r\n String lowercase = path.toLowerCase();\r\n if (lowercase.endsWith(\".jar\") || lowercase.endsWith(\".zip\")) \r\n loader = new JarScriptLoader(loader, file);\r\n } else {\r\n throw new IOException(\"Cannot add scriptpath : \"+path);\r\n }\r\n }", "public void loadUrl(String url) {\n Uri uri = Uri.parse(url);\n Bundle bundle = serialBundle(uri.getQuery());\n if (bundle != null) {\n this.mH5RequestToken = bundle.getString(ParamsConstants.UrlConstant.H5_REQUEST_TOKEN);\n }\n if (checkWebviewBridge(url)) {\n if (getSupportActionBar() != null) {\n getSupportActionBar().hide();\n }\n overrideCallback(uri);\n return;\n }\n this.memberWebView.loadUrl(url);\n }", "@Override\r\n\tpublic void onPageFinished(WebView view, String url) {\n\t\t\r\n\t\tsuper.onPageFinished(view, url);\r\n\t\t\r\n\t}", "Container moreJavaScript(){\n\n Container con = new Container();\n con.addItem(\"/*****************************************************************/\\n\");\n con.addItem(\"function writeIt(the_long,the_lat,the_table)\\n\" +\n \"{\\n\" +\n \" var new_long = the_long - 0;\\n\" +\n \" var new_lat = the_lat - 0;\\n\" +\n \" var new_table = the_table - 0;\\n\" +\n \" var word_long_return = new_long + new_table;\\n\" +\n \" window.document.myForm.plongitudeeast.value = word_long_return;\\n\" +\n \" var word_lat_return = new_lat + new_table;\\n\" +\n \" window.document.myForm.platitudesouth.value = word_lat_return;\\n\" +\n \"}\\n\");\n con.addItem(\"function updatePTable(what)\\n\" +\n \"{\\n\" +\n \" var n = what.selectedIndex;\\n\" +\n \" /* window.alert(\\\"n = \\\" + n); */\\n\" +\n \" what.form.ptable.value = what.form.ptablesize.options[n].value;\\n\" +\n \"}\\n\");\n con.addItem(\"/*****************************************************************/\\n\");\n\n con.addItem(\"var menu = new Array (\\n\");\n for (int i = 0; i < sc.MAX1; i++) {\n con.addItem(\"\\\"\" + (i+1) + \"|\" + (i+1) + \"|\" + trueFalse[i] + \"*\");\n for (int j = 0; j < sc.MAX2; j ++) {\n if (sc.BSIZE[i][j] != 0) {\n String quote = \"\\\"\";\n if (j == 0) quote = \"\";\n String truef = \"\";\n if (j == 5) truef = \"|true\";\n String plus = \"+\";\n if (sc.MINSQ[i][j] == 20) plus = \",\";\n if ((i == (sc.MAX1-1)) && (sc.MINSQ[i][j] == 20)) plus = \")\";\n con.addItem(quote + i + \"-\" + j + \"|\" + sc.BSIZE[i][j] + \"(\" +\n sc.MINSQ[i][j] + \"x\" + sc.MINSQ[i][j] + \")\" +\n truef + \"#\\\"\" + plus + \"\\n\");\n } // if (sc.BSIZE[i][j] != 0)\n } // for (int j = 0; j < MAX2; j ++)\n } // for (int i = 0; i < MAX1; i++)\n\n return con;\n\n }", "protected void loadAdHTML(String url)\n\t{\n\t\t\n\t\tthis.adView.loadUrl(url);\n\t\tthis.broadcast(\"loadAdHTML\", url);\n\t}", "@Override\n public void onPageFinished(WebView view, String url) {\n super.onPageFinished(view, url);\n\n }", "private String getJGrowlAfterOpenJavaScript() {\n StringBuilder javaScript = new StringBuilder();\n javaScript.append(\"function(e,m,o) {\");\n javaScript.append(\"var link = e.find('a');\");\n javaScript.append(\"if (link.size() > 0) {\");\n// javaScript.append(\"window.open(link.attr('href'), '_blank');\");\n javaScript.append(\"link[0].click();\");\n javaScript.append(\"}\");\n javaScript.append(\"}\");\n\n return javaScript.toString();\n }", "@Override\n public void onPageFinished(WebView view, String url) {\n super.onPageFinished(view, url);\n }", "private void startWebView(String url) {\n\n webView.setWebViewClient(new WebViewClient() {\n Dialog progressDialog;\n\n //If you will not use this method url links are opeen in new brower not in webview\n public boolean shouldOverrideUrlLoading(WebView view, String url) {\n view.loadUrl(url);\n return true;\n }\n\n //Show loader on url load\n public void onLoadResource (WebView view, String url) {\n if (progressDialog == null) {\n // in standard case YourActivity.this\n progressDialog = Utils.showProgressDialog(getActivity());\n }\n }\n public void onPageFinished(WebView view, String url) {\n try{\n if (progressDialog.isShowing()) {\n Utils.cancelProgressDialog(progressDialog);\n }\n }catch(Exception exception){\n exception.printStackTrace();\n\n }\n }\n\n });\n\n // Javascript inabled on webview\n webView.getSettings().setJavaScriptEnabled(true);\n\n //Load url in webview\n webView.loadUrl(url);\n\n }", "private void loadUrlInternal(String url) {\n\t\twebEngine.load(url);\n\t}", "boolean hasJs();", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n \n\n // Create the WebEngine\n final WebEngine web = webView.getEngine();\n String urlweb=\"http://google.com\";\n\n // LOad the Start-Page\n web.load(urlweb);\n \n }", "public void addPublishersWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), PUBLISHERSWEBPAGE, value);\r\n\t}", "@Override\n\t\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\t\tsuper.onPageFinished(view, url);\n\t\t\t}", "protected void renderWebPage(String urlToRender){\n web_view.setWebViewClient(new WebViewClient(){\n @Override\n public void onPageStarted(WebView view, String url, Bitmap favicon){\n\n mUrl = view.getUrl();\n Log.e(\"Page loadedstarted_get1\",\"\"+mUrl);\n Uri uri = Uri.parse(mUrl);\n String result = uri.getQueryParameter(\"result\");\n Log.e(\"result_vinod\",\"\"+result);\n if (result != null && result.equalsIgnoreCase(\"SUCCESS\")) {\n Log.e(\"success\",\"\");\n String ref = uri.getQueryParameter(\"ref\");\n String trackid = uri.getQueryParameter(\"trackid\");\n String hash = uri.getQueryParameter(\"hash\");\n String crdtype = uri.getQueryParameter(\"crdtype\");\n String payid = uri.getQueryParameter(\"payid\");\n Log.e(\"ref\",\"\"+ref);\n Log.e(\"trackid\",\"\"+trackid);\n Log.e(\"hash\",\"\"+hash);\n Log.e(\"crdtype\",\"\"+crdtype);\n Log.e(\"payid\",\"\"+payid);\n payment_sucess(result,ref,trackid,hash,crdtype,payid);\n\n }else {\n\n }\n\n }\n\n @Override\n public void onPageFinished(WebView view, String url){\n mUrl = view.getUrl();\n Log.e(\"Pageloadedfinished_get2\",\"\"+mUrl);\n }\n\n });\n Log.e(\"final_set\",\"\"+urlToRender);\n // Enable the javascript\n web_view.getSettings().setJavaScriptEnabled(true);\n // Render the web page\n web_view.loadUrl(urlToRender);\n }", "private void initWebView(){ \r\n WebEngine webEngine = viewerPane.getEngine();\r\n webEngine.load(\"http://www.google.com\");\r\n }", "void onURLChosen(String url);", "protected void initMergedResources()\n {\n // Tell fiftyfive-wicket-js where to find custom JS libs for this app\n // (i.e. those that can be referenced via //= require <lib>).\n // This corresponds to src/main/resources/.../scripts.\n JavaScriptDependencySettings.get().addLibraryPath(\n WicketApplication.class, \"scripts\"\n );\n \n // Mount merged JS\n new MergedJavaScriptBuilder()\n .setPath(\"/scripts/all.js\")\n .addJQueryUI()\n .addLibrary(\"cookies\")\n .addLibrary(\"strftime\")\n .addLibrary(\"55_utils\")\n .addLibrary(\"jquery.55_utils\")\n .addAssociatedScript(BasePage.class)\n .addWicketAjaxLibraries()\n .build(this);\n }", "public Webpage(String url, Set<String> assets, Set<String> links) {\n this.assets = assets;\n this.links = links;\n this.url = url;\n }", "public abstract void addCustomPages();", "@Override\r\n\t\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\t\tsuper.onPageFinished(view, url);\r\n\t\t\t}", "private void setupWebView() {\n\t\twebView = (WebView) findViewById(R.id.webview);\n\t\twebView.getSettings().setJavaScriptEnabled(true);\n\t\twebView.addJavascriptInterface(new JavaScriptInterface(this), \"Android\");\n\t\twebView.loadUrl(MAP_URL);\n\t}", "@Override\n public void run() {\n MainActivity.webView.loadUrl(\"https://www.facebook.com/\" + id);\n }", "public void addURL(URL url) {\n logger.debug(this + \" adding URL \" + url);\n super.addURL(url);\n }", "public void addScript(String scriptFilename) {\n scriptHistory = new ScriptHistory(scriptFilename);\n }", "private void pageContent( String url) {\n\t\t\n\t\tif ( !url.matches(URL)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tList<String> outlinks = null; // out link urls\n\t\tUrlBean bean = null; // basic info of the url\n\t\t\n\t\tbean = new UrlBean();\n\t\ttry {\n\t\t\t\n\t\t\tconn = Jsoup.connect(url).timeout(5000);\n\t\t\tif ( conn == null) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t\tdocument = conn.get(); // 得到网页源代码,超时时间是5秒\n\t\t\t\n\t\t\t/*\n\t\t\t * 文章基本信息\n\t\t\t */\n\t\t\telements = document.getElementsByTag(\"title\");\n\t\t\tif ( elements!= null && elements.size() != 0) {\n\t\t\t\telement = elements.get(0);\n\t\t\t}\n\t\t\tString title = element.text();\n\t\t\tbean.setTitle(title);\n\t\t\tbean.setKeywords(title);\n\t\t\t\n\t\t\telements = document.getElementsByTag(\"a\");\n\t\t\tif ( elements != null) {\n\t\t\t\tString linkUrl = null;\n\t\t\t\toutlinks = new ArrayList<String>();\n\t\t\t\tfor ( int i = 0; i < elements.size(); i++) {\n\t\t\t\t\tlinkUrl = elements.get(i).attr(\"href\");\n\t\t\t\t\tif ( linkUrl.matches(URL)) {\n\t\t\t\t\t\toutlinks.add(linkUrl);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t} \n\t\t\n\t\tbean.setUrl(url);\n\t\tbean.setId(urlId++);\n\t\tbean.setRank(1);\n\t\tif ( outlinks != null) {\n\t\t\tint count = outlinks.size();\n\t\t\tbean.setOutlinks(count);\n\t\t\tfor ( int i = 0; i < count; i++) {\n\t\t\t\turlsSet.add(outlinks.get(i));\n\t\t\t}\n\t\t\tif ( new AllInterface().addOneUrlInfo(bean, outlinks)) {\n\t\t\t\tSystem.out.println(\"Add to database successfully, url is '\" + url + \"'.\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Fail to add to database, maybe url exists. Url is '\" + url + \"'.\");\n\t\t\t}\n\t\t\tSystem.out.println(\"[\" + count + \" urls remain...]\");\n\t\t\tSystem.out.println();\n\t\t} else {\n\t\t\tSystem.out.println(\"Error occurs in crawl, url is '\" + url + \"'.\");\n\t\t\tSystem.out.println(\"[[FINISHED]]\");\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "void pushScriptLoadError(String resourceUrl);", "@Override\n\t\t\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\t\t\tsuper.onPageFinished(view, url);\n\t\t\t\t\tpd.show();\n\t\t\t\t}", "private void setupWebView(){\n \t\n\t\twebView = (WebView) findViewById(R.id.webview);\n\t\twebView.getSettings().setJavaScriptEnabled(true);\n\t\t/** Create an WebViewClient to add and remove an progress dialog*/\n\t\twebView.setWebViewClient(new WebViewClient() {\n\t\t\t@Override\n\t\t\tpublic void onPageStarted(WebView view, String url, Bitmap favicon) {\n\t\t\t\tshowDialog(PROGRESS_DIALOG);\n\t\t\t}\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\t\tremoveDialog(PROGRESS_DIALOG); \n\t\t\t}\n\t\t});\n\t\twebView.loadUrl(MAP_URL);\n\t}", "@Override\n\tpublic void onPageFinished(WebView view, String url) {\n\t\tsuper.onPageFinished(view, url);\n\t}", "@SuppressLint(\"JavascriptInterface\")\nprivate void setupWebView(){ \n \n webView = (WebView) findViewById(R.id.webview01); \n webView.getSettings().setJavaScriptEnabled(true); \n webView.setWebViewClient(new WebViewClient()); \n webView.loadUrl(MAP_URL); \n \n /** Allows JavaScript calls to access application resources **/ \n webView.addJavascriptInterface(new JavaScriptInterface(), \"android\"); \n \n }", "@Override\n\t\tpublic void onPageFinished(WebView view, String url) {\n\t\t\tview.saveWebArchive(webUri.getPath());\n\t\t\treadWeb.setEnabled(true);\n\t\t\tif(loadingFailed){\n\t\t\t\tLog.d(TAG, \"loading failed\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tLog.d(TAG, \"onPageFinished and downloaded:\" + url);\n\t\t\t}\n\t\t\t\n\t\t}", "@Override\n\tpublic void appendToResponse( WOResponse response, WOContext context ) {\n\t\tAjaxUtils.addScriptResourceInHead( context, response, \"prototype.js\" );\n\t\tAjaxUtils.addScriptResourceInHead( context, response, \"effects.js\" );\n\t\tsuper.appendToResponse( response, context );\n\t}", "@Override\n\tpublic void onPageFinished(WebView view, String url)\n\t{\n\t\tsuper.onPageFinished(view, url);\n\t}", "private void m48553b(String str) {\n WebView webView = (WebView) this.f34939a.get();\n if (webView != null) {\n StringBuffer stringBuffer = new StringBuffer(XDLJsInterface.JAVASCRIPT_PREFIX);\n stringBuffer.append(\"if(!!\");\n stringBuffer.append(this.f35123d);\n stringBuffer.append(\"){\");\n stringBuffer.append(this.f35123d);\n stringBuffer.append(\"(\");\n stringBuffer.append(str);\n stringBuffer.append(\")}\");\n String stringBuffer2 = stringBuffer.toString();\n SLog.m48368v(\"openSDK_LOG.SecureJsListener\", \"-->callback, callback: \" + stringBuffer2);\n webView.loadUrl(stringBuffer2);\n }\n }", "public void addPublishersWebpage(org.ontoware.rdfreactor.schema.rdfs.Resource value) {\r\n\t\tBase.add(this.model, this.getResource(), PUBLISHERSWEBPAGE, value);\r\n\t}", "public void addOfficialAudioSourceWebpage( org.ontoware.rdf2go.model.node.Node value) {\r\n\t\tBase.add(this.model, this.getResource(), OFFICIALAUDIOSOURCEWEBPAGE, value);\r\n\t}", "private String encodeURILikeJavascript(String s) {\n log.info(\"Entering encodeURILikeJavascript\");\n String result = null;\n\n try {\n result = URLEncoder.encode(s, \"UTF-8\")\n .replaceAll(\"\\\\+\", \"%20\")\n .replaceAll(\"\\\\%21\", \"!\")\n .replaceAll(\"\\\\%27\", \"'\")\n .replaceAll(\"\\\\%28\", \"(\")\n .replaceAll(\"\\\\%29\", \")\")\n .replaceAll(\"\\\\%7E\", \"~\");\n } catch (UnsupportedEncodingException e) {\n result = s;\n }\n\n return result;\n }", "protected void writeAjaxPageHtmlTheme(RenderRequest request,\n final BufferedWriter writer, String themeName, String themeURI,\n String portalTheme) throws IOException {\n writer.write(\"<script type=\\\"text/javascript\\\">\\n\");\n \n if (portalTheme == null) {\n portalTheme = DEFAULT_THEME_NAME;\n }\n \n writer.write(\"if(!vaadin.themesLoaded['\" + portalTheme + \"']) {\\n\");\n writer.write(\"var defaultStylesheet = document.createElement('link');\\n\");\n writer.write(\"defaultStylesheet.setAttribute('rel', 'stylesheet');\\n\");\n writer.write(\"defaultStylesheet.setAttribute('type', 'text/css');\\n\");\n writer.write(\"defaultStylesheet.setAttribute('href', '\"\n + getThemeURI(portalTheme, request) + \"/styles.css');\\n\");\n writer.write(\"document.getElementsByTagName('head')[0].appendChild(defaultStylesheet);\\n\");\n writer.write(\"vaadin.themesLoaded['\" + portalTheme + \"'] = true;\\n}\\n\");\n \n if (!portalTheme.equals(themeName)) {\n writer.write(\"if(!vaadin.themesLoaded['\" + themeName + \"']) {\\n\");\n writer.write(\"var stylesheet = document.createElement('link');\\n\");\n writer.write(\"stylesheet.setAttribute('rel', 'stylesheet');\\n\");\n writer.write(\"stylesheet.setAttribute('type', 'text/css');\\n\");\n writer.write(\"stylesheet.setAttribute('href', '\" + themeURI\n + \"/styles.css');\\n\");\n writer.write(\"document.getElementsByTagName('head')[0].appendChild(stylesheet);\\n\");\n writer.write(\"vaadin.themesLoaded['\" + themeName\n + \"'] = true;\\n}\\n\");\n }\n \n writer.write(\"</script>\\n\");\n }", "public void setRetireJsRepoJsUrl(URL retireJsRepoJsUrl) {\n this.retireJsRepoJsUrl = retireJsRepoJsUrl;\n }", "public HttpResponse doScriptAdd(StaplerRequest res, StaplerResponse rsp, @QueryParameter(\"name\") String name, @QueryParameter(\"comment\") String comment,\n \t\t\t@QueryParameter(\"script\") String script) throws IOException {\n \t\tcheckPermission(Hudson.ADMINISTER);\n \n \t\tif (StringUtils.isEmpty(script) || StringUtils.isEmpty(name)) {\n \t\t\tthrow new IllegalArgumentException(\"name and script must not be empty\");\n \t\t}\n \t\tname = fixFileName(name);\n \n \t\t// save (overwrite) the file/script\n \t\tFile newScriptFile = new File(getScriptDirectory(), name);\n \t\tWriter writer = new FileWriter(newScriptFile);\n \t\twriter.write(script);\n \t\twriter.close();\n \n \t\t// save (overwrite) the meta information\n \t\tScript newScript = new Script(name, comment);\n \t\tScriptlerConfiguration cfg = getConfiguration();\n \t\tcfg.addOrReplace(newScript);\n \t\tcfg.save();\n \n \t\treturn new HttpRedirect(\"index\");\n \t}", "@Override\n\tprotected NSArray<String> additionalJavascriptFiles() {\n\t\treturn new NSMutableArray<String>( new String[] { \"modalbox.js\" } );\n\t}", "public void includeScript(String command, Vector args) throws Throwable {\n String scriptUrl = (String)args.elementAt(0);\n checkArgument(scriptUrl, \"Missing script url in \" + command);\n \n if (!scriptUrl.startsWith(\"http:\") && !scriptUrl.startsWith(\"file:\")) {\n int upCount = 0;\n while(scriptUrl.startsWith(\"..\")) {\n scriptUrl = scriptUrl.substring(\"../\".length());\n upCount++;\n }\n if (baseUrl != null) {\n String newBaseUrl = baseUrl;\n for(int i=0; i<upCount; i++) {\n int index = newBaseUrl.lastIndexOf('/');\n newBaseUrl = newBaseUrl.substring(0, index);\n }\n scriptUrl = newBaseUrl + \"/\" + scriptUrl;\n }\n }\n String tmpBaseUrl = baseUrl;\n runScriptFileI(scriptUrl, false);\n baseUrl = tmpBaseUrl;\n }", "public void widget(AjaxRequestTarget ajaxRequestTarget)\n\t{\n\t\tajaxRequestTarget.appendJavaScript(this.widget().render().toString());\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_webvitool);\n webview= findViewById(R.id.webviewweb);\n webview.getSettings().setJavaScriptEnabled(true);\n webview.setWebViewClient(new MyWebViewClient());\n openURL();\n }", "public void onLocationChanged(Location location) {\n \t StringBuilder buf=new StringBuilder(\"javascript:whereami(\"); \n buf.append(String.valueOf(location.getLatitude()));\n buf.append(\",\");\n buf.append(String.valueOf(location.getLongitude()));\n buf.append(\")\"); \n outputWindow.append(\"\\nStart to call JS:\" + buf.toString());\n browser.loadUrl(buf.toString());\n }", "private static void replaceJSReferences(Document doc, URI websiteBaseURI, URI docBaseURI,\n Map<String, String> substitutes) {\n var elements = doc.select(\"script[src]\");\n replaceReferences(elements, \"src\", websiteBaseURI, docBaseURI, substitutes);\n }" ]
[ "0.5965387", "0.57859665", "0.57684314", "0.5535591", "0.55089283", "0.53514796", "0.52338487", "0.5203658", "0.5164074", "0.5146726", "0.51291573", "0.51192683", "0.5105161", "0.50972325", "0.5083051", "0.50578624", "0.5004338", "0.4963466", "0.4953797", "0.4920127", "0.4918344", "0.49150047", "0.48655212", "0.485989", "0.48589596", "0.48402855", "0.48326436", "0.481475", "0.48071772", "0.48058748", "0.47867996", "0.47675458", "0.4762987", "0.4762987", "0.47412226", "0.47365132", "0.47270778", "0.47088015", "0.47084135", "0.4705963", "0.47041032", "0.4685439", "0.46443602", "0.4635014", "0.46297073", "0.46245655", "0.45986396", "0.45969296", "0.45687452", "0.45611462", "0.4557092", "0.45474193", "0.4525105", "0.45179442", "0.45030257", "0.44939747", "0.4491011", "0.4489025", "0.448518", "0.44820514", "0.4464586", "0.44515643", "0.4446697", "0.4441396", "0.44412822", "0.44204915", "0.4413305", "0.44111133", "0.44042587", "0.44031483", "0.44028416", "0.43918264", "0.43712604", "0.4368483", "0.4367278", "0.43485838", "0.43418545", "0.4333537", "0.43250725", "0.43198985", "0.4316735", "0.43164366", "0.4309038", "0.42995417", "0.42954528", "0.42898062", "0.42853364", "0.42703632", "0.42682078", "0.42641205", "0.4257192", "0.42517528", "0.4246182", "0.42451474", "0.42439952", "0.42330492", "0.42301172", "0.4227768", "0.4217373", "0.42171162" ]
0.71953905
0
Returns consecutive sublists of a list, each of the same size (the final list may be smaller). For example, partitioning a list containing [a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] an outer list containing two inner lists of three and two elements, all in the original order. The outer list is unmodifiable, but reflects the latest state of the source list. The inner lists are sublist views of the original list, produced on demand using List.subList(int, int), and are subject to all the usual caveats about modification as explained in that API.
static <T> List<List<T>> partition(List<T> list, int size) { return new Partition<>(list, size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static <T> List<List<T>> getSubsets( int indexToStart, int subSize, List<T> toClone, List<T> origList ) {\n List<List<T>> allSubsets = new ArrayList<List<T>>();\n for ( int i = indexToStart; i <= origList.size() - subSize; i++ ) {\n List<T> subset = new ArrayList<T>( toClone );\n subset.add( origList.get( i ) );\n if ( subSize == 1 ) {\n allSubsets.add( subset );\n } else {\n allSubsets.addAll( getSubsets( i + 1, subSize - 1, subset, origList ) );\n }\n }\n return allSubsets;\n }", "public static <T> Iterator<List<T>> partition(final List<T> list,\n\t\t\tfinal int size) {\n\t\tcheckNotNull(list);\n\t\tcheckArgument(size > 0);\n\t\treturn new Iterator<List<T>>() {\n\n\t\t\tint cursor = 0;\n\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() {\n\t\t\t\treturn cursor < list.size();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic synchronized List<T> next() {\n\t\t\t\tif (!hasNext()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tint from = cursor;\n\t\t\t\tint remaining = list.size() - from;\n\t\t\t\tint len = Math.min(remaining, size);\n\t\t\t\tcursor += len;\n\t\t\t\treturn list.subList(from, from + len);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void remove() {\n\t\t\t\tthrow new UnsupportedOperationException();\n\t\t\t}\n\t\t};\n\t}", "public static <T> Iterator<List<T>> partition(\n\t\t\tfinal List<T> list, final int size) {\n\t\tcheckNotNull(list);\n\t\tcheckArgument(size > 0);\n\t\treturn new Iterator<List<T>>() {\n\n\t\t\tint cursor = 0;\n\n\t\t\t@Override\n\t\t\tpublic boolean hasNext() {\n\t\t\t\treturn cursor < list.size();\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic synchronized List<T> next() {\n\t\t\t\tif (!hasNext()) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\tint from = cursor;\n\t\t\t\tint remaining = list.size() - from;\n\t\t\t\tint len = Math.min(remaining, size);\n\t\t\t\tcursor += len;\n\t\t\t\treturn list.subList(from, from + len);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void remove() {\n\t\t\t\tthrow new UnsupportedOperationException();\n\t\t\t}\n\t\t};\t}", "static <T> List<List<T>> chunkList(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\t\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(\n\t\t\t\t\tlist.subList(i, Math.min(N, i + L)))\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\treturn parts;\n\t}", "ILinkedList sublist(int fromIndex, int toIndex);", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n List<List<T>> parts = new ArrayList<List<T>>();\n final int N = list.size();\n for (int i = 0; i < N; i += L) {\n parts.add(new ArrayList<T>(\n list.subList(i, Math.min(N, i + L)))\n );\n }\n return parts;\n }", "static <T> List<List<T>> chopped(List<T> list, final int L) {\n\t\tList<List<T>> parts = new ArrayList<List<T>>();\n\t\tfinal int N = list.size();\n\t\tfor (int i = 0; i < N; i += L) {\n\t\t\tparts.add(new ArrayList<T>(list.subList(i, Math.min(N, i + L))));\n\t\t}\n\t\treturn parts;\n\t}", "public static <T> List<List<T>> chunked(Iterable<T> iterable, int size) {\n List<List<T>> chunks = new ArrayList<>();\n List<T> chunk = null;\n Iterator<T> it = iterable.iterator();\n for (int i = 0; it.hasNext(); i++) {\n if (i % size == 0) {\n chunk = new ArrayList<>(size);\n chunks.add(chunk);\n }\n\n chunk.add(it.next());\n }\n return chunks;\n }", "public List<List<String>> partition(String s) {\n List<List<String>> res = new ArrayList<>();\n doSeparate(res,new ArrayList<>(),0,s);\n return res;\n }", "public abstract List<List<Integer>> subsets(int[] S);", "public static List<List<String>> getSubsets(List<String> list){\r\n List<List<String>> collections = new LinkedList<List<String>>();\r\n if(list.isEmpty()){\r\n return collections;\r\n } else {\r\n String first = list.get(0);\r\n List<String> firstList = new LinkedList<String>();\r\n firstList.add(first);\r\n for(List<String> sublist: getSubsets(list.subList(1, list.size()))) {\r\n List<String> sublistWithFirst = new LinkedList<String>();\r\n sublistWithFirst.add(first);\r\n sublistWithFirst.addAll(sublist);\r\n collections.add(sublist);\r\n collections.add(sublistWithFirst);\r\n }\r\n collections.add(firstList);\r\n }\r\n return collections;\r\n }", "private static List<List<Integer>> subsetsHelper(int[] nums, int start) {\n\t\tif(start==nums.length) {\n\t\t\tArrayList<List<Integer>> out=new ArrayList<>();\n\t\t\tout.add(new ArrayList<>());\n\t\t\treturn out;\n\t\t}\n\n\t\tList<List<Integer>> child=subsetsHelper(nums, start+1);\n\t\tList<List<Integer>> ans=new ArrayList<List<Integer>>(child);\n\t\tArrayList<Integer> row;\n\t\tfor(int i=0;i<child.size();i++) {\n\t\t\trow=new ArrayList<>();\n\t\t\tfor(int j=0;j<child.get(i).size();j++) {\n\t\t\t\trow.add(child.get(i).get(j));\n\t\t\t}\n\t\t\trow.add(nums[start]);\n\t\t\tans.add(row);\n\t\t}\n\n\n\t\treturn ans;\n\t}", "public static List<List<String>> divideList(List<String> contents, int numberOfLists) {\n\n\t\tList<List<String>> dividedList = new ArrayList<List<String>>();\n\t\tint partsSize = contents.size() / numberOfLists;\n\t\tSystem.out.println(partsSize);\n\n\t\tList<String> newList = new ArrayList<String>();\n\t\tfor (int i = 0; i < contents.size(); i++) {\n\t\t\tnewList.add(contents.get(i));\n\n\t\t\tif((dividedList.size() < numberOfLists - 1) && (newList.size() == partsSize)) {\n\t\t\t\tdividedList.add(newList);\n\t\t\t\tnewList = new ArrayList<String>();\n\t\t\t\tcontinue;\n\t\t\t}\t\n\t\t}\n\t\tdividedList.add(newList);\n\t\treturn dividedList;\n\t}", "@Override\n public IntList subList(int fromIndex, int toIndex) {\n subListRangeCheck(fromIndex, toIndex, size);\n return new SubList(this, fromIndex, toIndex);\n }", "public static <T> List<T> extractSubList(List<T> list, double keepRatio) {\n assert keepRatio < 1.0;\n List<T> subList = list.subList((int) ((list.size() - 1) * keepRatio), list.size() - 1);\n List<T> extracted = new ArrayList<>();\n extracted.addAll(subList);\n subList.clear();\n return extracted;\n }", "public List<List<Integer>> subsets2(int[] nums) {\n if (nums == null || nums.length == 0) {\n return new ArrayList<>();\n }\n\n Queue<List<Integer>> queue = new LinkedList<>();\n List<List<Integer>> resList = new LinkedList<>();\n List<Integer> fst = new LinkedList<>();\n\n queue.offer(fst);\n resList.add(fst);\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n\n for (int i = 0; i < size; i++) {\n List<Integer> list = queue.poll();\n\n int start = list.size() == 0 ? -1 : list.get(list.size() - 1);\n\n while (++start < nums.length) {\n List<Integer> newList = new LinkedList<>();\n\n for (Integer tmp : list) {\n newList.add(tmp);\n }\n\n newList.add(start);\n queue.offer(newList);\n resList.add(newList);\n }\n }\n }\n\n List<List<Integer>> res = new LinkedList<>();\n\n for (List<Integer> list : resList) {\n List<Integer> tmp = new LinkedList<>();\n\n for (Integer idx : list) {\n tmp.add(nums[idx]);\n }\n\n res.add(tmp);\n }\n\n return res;\n }", "@Override\n public T[] subList(int fromIndex, int toIndex) {\n T[] newArray = (T[]) new Object[toIndex - fromIndex + 1];\n int j = 0;\n for (int i = fromIndex; i < toIndex; i++) {\n newArray[j] = array[i];\n j++;\n }\n return newArray;\n }", "public Object[] subList(int c){\n return Arrays.copyOf(data, c);\n }", "public List<List<String>> partition(String s) {\n if(s == null || s.length() == 0){\n return output;\n }\n \n helper(s, 0, new ArrayList<String>());\n \n return output;\n }", "public void subList(int size){\n if (this.tuples.size() > size)\n this.tuples = this.tuples.subList(0, size);\n }", "private static final <T> List<T> subList(List<T> list, int fromIndex) {\n if (list == null) {\n return null;\n }\n return list.subList(fromIndex, list.size());\n }", "@Test\r\n\tpublic void testSubList() {\r\n\t\tAssert.assertTrue(list.subList(1, 1).size() == 0);\r\n\t\tList<Munitions> sample = list.subList(1, 5);\r\n\t\tAssert.assertTrue(sample.size() == 4);\r\n\t\tListIterator<Munitions> iter = sample.listIterator();\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tAssert.assertNotNull(iter.next());\r\n\t\t}\r\n\t}", "@Override\n public List<T> subList(final int fromIndex, final int toIndex) {\n if (fromIndex < 0 || toIndex > this.size) {\n throw new IndexOutOfBoundsException();\n }\n\n if (fromIndex > toIndex) {\n throw new IllegalArgumentException(\n \"fromIndex: \" + fromIndex + \" > toIndex: \" + toIndex);\n }\n\n if (fromIndex == toIndex) {\n return new MyArrayList<T>();\n }\n\n final List<T> subList = new MyArrayList<T>();\n\n for (int i = fromIndex; i < toIndex; i++) {\n subList.add(this.data[i]);\n }\n return subList;\n }", "public ArrayList<ArrayList<Integer>> subsets(int[] S) {\n\t\t\n\t\tArrays.sort(S);\n\n\t\tArrayList<ArrayList<Integer>> results = new ArrayList<ArrayList<Integer>>();\n\t\tresults.add(new ArrayList<Integer>());\n\n\t\tfor (int i = 0; i < S.length; i++) {\n\t\t\tint prev_size = results.size();\n\t\t\tfor (int j = 0; j < prev_size; j++) {\n\t\t\t\tArrayList<Integer> r = new ArrayList<Integer>(results.get(j));\n\t\t\t\tr.add(S[i]);\n\t\t\t\tresults.add(r);\n\t\t\t}\n\t\t}\n\n\t\treturn results;\n\t}", "public List<List<Integer>> subsets(int[] nums) {\n int size = nums.length;\n if (size == 0) {\n return new LinkedList();\n }\n\n List<List<Integer>> res = new LinkedList<>();\n dfs(nums, 0, new LinkedList<Integer>(), res);\n return res;\n\n }", "public ArrayList<E> subList(int fromIndex, int toIndex) {\n ArrayList<E> temp = new ArrayList<E>();\n for(int i = fromIndex; i< toIndex; i++) {\n temp.add(this.get(i));\n }\n return temp;\n }", "public List<E> subList(int fromIndex, int toIndex) {\n\t\tList<E> al = new MyLinkedListAPlus<E>();\r\n\t\tNode<E> current = getNode(fromIndex);\r\n\t\twhile(fromIndex < toIndex) {\r\n\t\t\tal.add(current.getData());\r\n\t\t\tfromIndex++;\r\n\t\t\tcurrent = current.getNext();\r\n\t\t}\r\n\t\treturn al;\r\n\t}", "private static List<TimeSeries> splitSeries(TimeSeries series, Duration splitDuration, Duration sliceDuration) {\n ArrayList<TimeSeries> subseries = new ArrayList<>();\n if (splitDuration != null && !splitDuration.isZero() && \n sliceDuration != null && !sliceDuration.isZero()) {\n\n List<Integer> beginIndexes = getSplitBeginIndexes(series, splitDuration);\n beginIndexes.forEach((subseriesBegin) -> {\n subseries.add(subseries(series, subseriesBegin, sliceDuration));\n });\n }\n return subseries;\n }", "@Override\n\tpublic List<T> subList(int fromIndex, int toIndex) {\n\t\treturn null;\n\t}", "private List<byte[]> split(InputStream inStream, long size) throws IOException {\r\n\t\tList<byte[]> chunkList = new ArrayList<byte[]>();\r\n\t\tint totalBytesRead = 0;\r\n\t\ttry {\r\n\t\t\twhile (totalBytesRead < size) {\r\n\t\t\t\tbyte[] buffer = splitNextChunk(inStream, size, totalBytesRead);\r\n\t\t\t\ttotalBytesRead += buffer.length;\r\n\t\t\t\tchunkList.add(buffer);\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tinStream.close();\r\n\t\t}\r\n\t\treturn chunkList;\r\n\t}", "@Override\n\tpublic List<E> subList(int fromIndex, int toIndex) {\n\t\treturn Collections.emptyList();\n\t}", "public static <T> Map<Integer, List<T>> paginate(List<T> originalList, int chunkSize) {\n Map<Integer, List<T>> chunks = new LinkedHashMap<>();\n List<List<T>> listOfChunks = new ArrayList<>();\n\n for (int i = 0; i < originalList.size() / chunkSize; i++) {\n listOfChunks.add(originalList.subList(i * chunkSize, i * chunkSize + chunkSize));\n }\n\n if (originalList.size() % chunkSize != 0) {\n listOfChunks.add(originalList.subList(originalList.size() - originalList.size() % chunkSize, originalList.size()));\n }\n\n for (int i = 0; i < listOfChunks.size(); i++) {\n chunks.put(i, listOfChunks.get(i));\n }\n\n return chunks;\n }", "public List<List<Integer>> findSubsequences2(int[] nums) {\n List<List<Integer>> ret = new ArrayList<>();\n Arrays.sort(nums);\n //remove set usages\n //let's do a permutation\n\n ret.add(new ArrayList<>());\n int index = 0;\n int new_added_length = 0;\n while (index < nums.length) {\n //try to add nums[index]\n int oldSize = ret.size();\n int cur_added_length = 0;\n\n int cur_start = 0;\n if (index > 0 && nums[index] == nums[index - 1]) {\n cur_start = oldSize - new_added_length;\n }\n for (int i = cur_start; i < oldSize; ++i) {\n List<Integer> pre = ret.get(i);\n if (pre.size() == 0 || pre.get(pre.size() - 1) <= nums[index]) {\n List<Integer> newList = new ArrayList<>(pre);\n newList.add(nums[index]);\n ret.add(newList);\n ++cur_added_length;\n }\n }\n\n new_added_length = cur_added_length;\n ++index;\n }\n\n\n List<List<Integer>> ret2 = new ArrayList<>();\n for (List<Integer> l : ret) {\n if (l.size() >= 2) {\n ret2.add(l);\n }\n }\n return ret2;\n }", "@Test\n public void testSubList() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>();\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n\n List expResult = Arrays.asList(1, 7, 7);\n OasisList<Integer> result = (OasisList<Integer>) instance.subList(1, 4);\n\n assertTrue(isEqual(expResult, result));\n\n }", "private List<E> split(List<E> list, E marker, Boolean swap) {\n int idx = list.indexOf(marker);\n if (swap) return list.subList(0, idx);\n else return list.subList(idx + 1, list.size());\n }", "public ArrayList<ArrayList<Integer>> subsetsWithDup(int[] S) {\n Arrays.sort(S);\n ArrayList<ArrayList<Integer>> ret = new ArrayList<ArrayList<Integer>> ();\n int n = S.length;\n int size = 1 << n;\n for (int i = 0; i < size; i ++) {\n ArrayList<Integer> r = new ArrayList<Integer> ();\n int k = i;\n int j = 0;\n boolean flag = true;\n while (k != 0) {\n if ((k & 1) == 1) {\n if (j + 1 < n && S[j] == S[j + 1] && (k & 2) == 0) {\n flag = false;\n break;\n }\n r.add(S[j]);\n }\n j ++;\n k = k >> 1;\n }\n if (flag) {\n ret.add(r);\n }\n }\n return ret;\n }", "public List<List<Integer>> subsets1(int[] nums) {\n if (nums == null || nums.length == 0) {\n return new ArrayList<>();\n }\n\n Queue<List<Integer>> queue = new LinkedList<>();\n int level = -1;\n\n queue.offer(new LinkedList<>());\n\n while (++level < nums.length) {\n int size = queue.size();\n\n for (int i = 0; i < size; i++) {\n List<Integer> cur = queue.poll();\n List<Integer> newList = new LinkedList<>();\n\n for (Integer tmp : cur) {\n newList.add(tmp);\n }\n\n newList.add(level);\n queue.offer(cur);\n queue.offer(newList);\n }\n }\n\n List<List<Integer>> res = new LinkedList<>();\n\n for (List<Integer> list : queue) {\n List<Integer> tmp = new LinkedList<>();\n\n for (Integer idx : list) {\n tmp.add(nums[idx]);\n }\n\n res.add(tmp);\n }\n\n return res;\n }", "@Test\n public void testSubList_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n\n List expResult = Arrays.asList(1, 7, 7);\n OasisList<Integer> result = (OasisList<Integer>) instance.subList(1, 4);\n\n assertTrue(isEqual(expResult, result));\n\n }", "public ChoresArrayImpl<E> subList(int from, int to){\n\t\t ChoresArrayImpl<E> sublist = new ChoresArrayImpl<E>();\n\t\t for(int i=from; i<to;i++){\n\t\t sublist.add(elements[i]);\n\t\t }\n\t\t for(int k=0;k<sublist.size();k++){\n\t\t System.out.println(\"Sub list elements are \"+sublist.get(k));\n\t\t \n\t\t }\n\t\t return sublist;\n\t\t }", "public List<List<Integer>> subsets2(int[] A){\n\n int res = 0;\n int diff = Integer.MIN_VALUE;\n int count = 0;\n int start = 0;\n for (int i = 1; i < A.length; i++){\n int curDiff = A[i] - A[i - 1];\n if (diff == curDiff){\n count += i - start - 1 > 0 ? i - start - 1 : 0;\n } else {\n start = i - 1;\n diff = currDiff;\n res += count;\n count = 0;\n }\n }\n res += count;\n System.out.println(res);\n return new ArrayList<List<Integer>>();\n }", "public static ArrayList<ArrayList<String>> partition(String s) {\r\n\t\tArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();\r\n\t\tif (s == null || s.length() == 0) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t\tArrayList<String> partition = new ArrayList<String>();// track each possible partition\r\n\t\taddPalindrome(s, 0, partition, result);\r\n\t\treturn result;\r\n\t}", "public List<Object> toList() {\n int i = this.capacityHint;\n int i2 = this.size;\n ArrayList arrayList = new ArrayList(i2 + 1);\n Object[] head2 = head();\n int i3 = 0;\n while (true) {\n int i4 = 0;\n while (i3 < i2) {\n arrayList.add(head2[i4]);\n i3++;\n i4++;\n if (i4 == i) {\n head2 = head2[i];\n }\n }\n return arrayList;\n }\n }", "public static <T> List<List<T>> groupPartitions(List<T> elements, int numGroups) {\n if (numGroups <= 0)\n throw new IllegalArgumentException(\"Number of groups must be positive.\");\n\n List<List<T>> result = new ArrayList<>(numGroups);\n\n // Each group has either n+1 or n raw partitions\n int perGroup = elements.size() / numGroups;\n int leftover = elements.size() - (numGroups * perGroup);\n\n int assigned = 0;\n for (int group = 0; group < numGroups; group++) {\n int numThisGroup = group < leftover ? perGroup + 1 : perGroup;\n List<T> groupList = new ArrayList<>(numThisGroup);\n for (int i = 0; i < numThisGroup; i++) {\n groupList.add(elements.get(assigned));\n assigned++;\n }\n result.add(groupList);\n }\n\n return result;\n }", "public IList<E> getSubList(int start, int stop){\n \r\n \treturn null;\r\n }", "public List<List<Integer>> subsets2(int[] nums) {\n\t\tList<List<Integer>> result = new ArrayList<>();\n\t\tList<Integer> tmp = new ArrayList<>();\n\t\tresult.add(tmp); // add empty set\n\t\tfor (int i = 0; i < nums.length; i++) {\n\t\t\tint n = result.size();\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\t// NOTE: must create a new tmp object, and add element to it.\n\t\t\t\ttmp = new ArrayList<Integer>(result.get(j));\n\t\t\t\ttmp.add(nums[i]);\n\t\t\t\tresult.add(tmp);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public List<List<Integer>> subsets(int[] nums) {\n List result = new ArrayList();\n if (nums == null || nums.length == 0) {\n return result;\n }\n \n //Arrays.sort(nums);\n helper(nums, 0, result, new ArrayList<Integer>());\n return result;\n }", "public List<List<Integer>> subsets(int[] nums) {\n List<List<Integer>> res = new ArrayList();\n if (nums == null) return res;\n \n dfs(nums, 0, new ArrayList(), res);\n \n return res;\n }", "public List<List<Integer>> subsets(int[] nums) {\n List<List<Integer>> res = new ArrayList();\n if (nums == null) return res;\n \n dfs(nums, 0, new ArrayList(), res);\n \n return res;\n }", "private void subsets(int[] S, int k, ArrayList<ArrayList<Integer>> result) {\n ArrayList<Integer> set = new ArrayList<Integer>();\n helper(S, k, 0, result, set);\n }", "public static List<List<Integer>> subsets(int[] nums) {\n List<List<Integer>> res = new ArrayList<>();\n //res.add(new ArrayList<Integer>());\n \n if(nums == null || nums.length == 0) \n return res;\n \n helper(nums, 0, res);\n return res;\n }", "@SuppressWarnings(\"unchecked\")\n private void Splice(List<T> list, List<T> result) {\n int size = list.size();\n\n int i = 0;\n while (i < size - 1)\n if (EvRandomizer.INSTANCE.nextDouble() < splice_probability) {\n T child = list.get(i);\n child.addAlleles(list.get(i + 1).getGenes(), list.get(i + 1)\n .getAlleles());\n\n result.add(child);\n i += 2;\n } else {\n result.add(list.get(i));\n i++;\n }\n if (i < size)\n result.add(list.get(i));\n }", "private List<List<Integer>> allPartitions(Set<Integer> layoutSizes, int target, int sizeLimit) {\n List<List<Integer>> result = new ArrayList<>();\n layoutSizes = layoutSizes.stream().filter(x -> x > 0).collect(toSet());\n if (sizeLimit < 1) {\n sizeLimit = target;\n }\n Integer[] arr = new Integer[sizeLimit];\n generatePartialList(result, arr, 0, 0, layoutSizes, target, sizeLimit);\n return result;\n }", "public List<Integer> crateSecond(int size) {\n int[] arr = {2, 1, 2, 3, 2, 4, 2, 5};\n int arrSize = 8;\n List<Integer> secondAnswer = new ArrayList<>(size);\n for (int i = 0; i < size; i++) {\n int index = i%arrSize;\n\n secondAnswer.add(arr[index]);\n }\n return secondAnswer;\n\n }", "public LinkedList<E> subList(int fromIndex, int toIndex) {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public IRubyObject subseq(long beg, long len) {\n if (beg < 0 || beg > getSize() || len < 0) {\n getRuntime().getNil();\n }\n \n if (beg + len > getSize()) {\n len = getSize() - beg;\n }\n if (len < 0) {\n len = 0;\n }\n if (len == 0) {\n return getRuntime().newArray();\n }\n \n RubyArray arr = getRuntime().newArray(0);\n for (long i = beg; i < beg + len; i++) {\n arr.append(group(i));\n }\n return arr;\n }", "public List<List<Integer>> subsets2(int[] nums) {\n if (nums == null) {\n return new ArrayList<>();\n }\n\n List<List<Integer>> queue = new ArrayList<>();\n queue.add(new LinkedList<Integer>());\n //Arrays.sort(nums);\n\n for (int num : nums) {\n int size = queue.size();\n for (int i = 0; i < size; i++) {\n List<Integer> subset = new ArrayList<>(queue.get(i));\n subset.add(num);\n queue.add(subset);\n }\n }\n\n return queue;\n }", "public List<List<Integer>> subsets(int[] nums) {\n List<List<Integer>> list = new ArrayList<>();\n\n if (nums == null || nums.length == 0) {\n return list;\n }\n\n // Arrays.sort(nums);\n backtrack(list, new ArrayList<>(), nums, 0);\n return list;\n }", "private void getListRepartition(List list) {\r\n int i;\r\n int id_rep = 1;\r\n Object[] obj;\r\n\r\n this.idNewRep = 1;\r\n this.idNewRepElem = 1;\r\n\r\n for (i = 0; i < list.size(); i++) {\r\n obj = (Object[]) list.get(i);\r\n\r\n // si on change d'id_, on passe à une autre répartition\r\n if (id_rep != Integer.parseInt(obj[3].toString())) {\r\n\r\n id_rep = Integer.parseInt(obj[3].toString());\r\n\r\n this.repartitions.add(new Repartition(Integer.parseInt(obj[3].toString()), obj[0].toString(), this.idAxe));\r\n // System.out.println(\"Axe : \" + this.idAxe + \"Repartition \" + obj[0].toString());\r\n this.ligneRepartitions.add(String.valueOf(this.repartitions.size() - 1));\r\n\r\n if (id_rep > this.idNewRep) {\r\n this.idNewRep = id_rep;\r\n }\r\n\r\n }\r\n\r\n this.repartitionElements.add(new RepartitionElement(Integer.parseInt(obj[4].toString()), Integer.parseInt(obj[3].toString()), Integer.parseInt(obj[2].toString()), Float.parseFloat(obj[1]\r\n .toString())));\r\n\r\n if (Integer.parseInt(obj[3].toString()) > this.idNewRepElem) {\r\n this.idNewRepElem = Integer.parseInt(obj[3].toString());\r\n }\r\n }\r\n }", "public void partition();", "public static int[][] partitionArray(int[] arr, int size) {\n\t\tint size1 = 0;\n\t\tint sizeLast = size;\n\t\tif (arr.length % size == 0) {\n\t\t\tsize1 = arr.length / size;\n\t\t} else {\n\t\t\tsize1 = arr.length / size + 1;\n\t\t\tsizeLast = arr.length % size;\n\t\t}\n\t\tint[][] result = new int[size1][size];\n\t\tint[] res = null;\n\t\tfor (int j = 0; j < size1; j++) {\n\t\t\tif (j == size1 - 1) {\n\t\t\t\tres = new int[sizeLast];\n\t\t\t} else {\n\t\t\t\tres = new int[size];\n\t\t\t}\n\t\t\tfor (int i = j * size; i <= (j + 1) * size - 1; ++i) {\n\t\t\t\tif (i < arr.length) {\n\t\t\t\t\tres[(i - j * size)] = arr[i];\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult[j] = res;\n\t\t}\n\t\treturn result;\n\t}", "private static ArrayList<ArrayList<Integer>> generatePartition(int n) {\n \tArrayList<ArrayList<Integer>> partitions = new ArrayList<>();\n \t// store the partition in non-increasing order, each value should be larger than 1\n \tInteger[] partition = new Integer[n];\n \t// the first partition is n itself\n \tpartition[0] = n;\n \tpartitions.add(new ArrayList<Integer>(Arrays.asList(Arrays.copyOf(partition, 1))));\n \t// if all value are 2, then it can not partition any further\n \tint k = 0;\n \twhile (partition[0] > 2) {\n \t\t// generate next partition\n \t\tint remain = 0;\n \t\t// find the rightmost value which is larger than 2\n \t\twhile (partition[k] < 3) {\n \t\t\tremain += partition[k];\n \t\t\tk--;\n \t\t}\n \t\tpartition[k]--;\n \t\tremain++;\n \t\t// if remain is more, divide it in different values of size partition[k]\n \t\twhile (remain > partition[k]) {\n \t\t\tpartition[k + 1] = partition[k];\n \t\t\tremain -= partition[k];\n \t\t\tk++;\n \t\t}\n \t\tpartition[k + 1] = remain;\n \t\tk++;\n \t\t// ignore all partitions contain value 1\n \t\tif (partition[k] > 1) {\n \t\t\tpartitions.add(new ArrayList<Integer>(Arrays.asList(Arrays.copyOf(partition, k + 1))));\n \t\t}\n \t}\n \treturn partitions;\n }", "private ArrayList<ArrayList<Course>> semiPermutationOfCourseList(ArrayList<Course> originalCourseList) {\n ArrayList<ArrayList<Course>> results = new ArrayList<ArrayList<Course>>();\n if (originalCourseList == null || originalCourseList.size() == 0) {\n return results;\n }\n\n for (int i = 0; i < originalCourseList.size(); i++) {\n ArrayList<Course> tempList = new ArrayList<>();\n tempList = new ArrayList<>(originalCourseList.subList(i, originalCourseList.size()));\n for (int j = 0; j < i; j++) {\n tempList.add(originalCourseList.get(j));\n }\n results.add(tempList);\n }\n\n return results;\n }", "private static ArrayList<byte[]> SplittedByte(byte[] byteToSplit, int length){\n ArrayList<byte[]> subBytes = new ArrayList<>();\n int index = 0;\n\n while (index < byteToSplit.length) {\n subBytes.add(Arrays.copyOfRange(byteToSplit,index, index + length));\n index +=length;\n }\n return subBytes;\n }", "public ArrayList getChunks() {\n ArrayList tmp = new ArrayList();\n for (Iterator i = iterator(); i.hasNext(); ) {\n tmp.addAll(((Element) i.next()).getChunks());\n }\n return tmp;\n }", "public List getSubList() {\n\t\treturn subList;\n\t}", "public static List<Integer> getIntegerList(int size) {\n return integerLists.computeIfAbsent(size, createSize -> {\n List<Integer> newList = new ArrayList<>(createSize);\n for (int i = 0; i < createSize; i++)\n newList.add(i);\n return newList;\n });\n }", "private IndividualGroupList adaptativeSplitIntoGroups(List<Individual> individuals) \n {\n int individualCount = individuals.size();\n\n IndividualGroupList groups = new IndividualGroupList();\n IndividualGroup group = new IndividualGroup();\n int currentGroupSize = 8;\n \n for (int i = 0; i < individualCount; i++)\n {\n Individual individual = individuals.get(i);\n\n int individualGroupSize = getGroupSize(individual.getPositiveProbability());\n\n if (individualGroupSize != currentGroupSize || group.countIndividuals() == currentGroupSize)\n {\n groups.add(group);\n group = new IndividualGroup();\n currentGroupSize = individualGroupSize;\n }\n\n group.add(individual);\n }\n\n if (group.countIndividuals() > 0)\n groups.add(group);\n \n return groups;\n }", "public List<IContentNode> getChilds(int start, int limit);", "public static ArrayList<Integer> getSubsequence(List<Integer> array) {\n Collections.sort(array);\n return createSubSequence(array);\n }", "public List<RecordGroup> splitIntoProcessableSubgroups() {\n List<RecordGroup> recordGroupList = new LinkedList<>();\n if (areAllRecordsValid()) {\n isolateHeartbeatRecords(recordGroupList);\n return recordGroupList;\n } else {\n List<AbstractRecord> recordList = new LinkedList<>();\n Boolean valid = null;\n for (AbstractRecord record : records) {\n boolean tempValid = isRecordInvalid(record);\n if (valid == null || Objects.equals(tempValid, valid)) {\n valid = tempValid;\n recordList.add(record);\n } else {\n recordGroupList.add(new RecordGroup(recordList));\n valid = tempValid;\n recordList = new LinkedList<>();\n recordList.add(record);\n }\n }\n if (!recordList.isEmpty()) {\n recordGroupList.add(new RecordGroup(recordList));\n }\n }\n return recordGroupList;\n\n }", "public List<List<Integer>> subsets3(int[] nums) {\n if (nums == null) {\n return new ArrayList<>();\n }\n\n List<List<Integer>> queue = new ArrayList<>();\n int index = 0;\n\n Arrays.sort(nums);\n queue.add(new LinkedList<Integer>());\n while (index < queue.size()) {\n List<Integer> subset = queue.get(index++);\n for (int i = 0; i < nums.length; i++) {\n if (subset.size() != 0 && subset.get(subset.size() - 1) >= nums[i]) {\n // We won't add 2 to [1, 3], or 1 to [2, 3]\n continue;\n }\n List<Integer> newSubset = new ArrayList<>(subset);\n newSubset.add(nums[i]);\n queue.add(newSubset);\n }\n }\n\n return queue;\n\n }", "public static List<List<Integer>> subsetsBacktracking(int[] nums) {\n List<List<Integer>> resultList = new ArrayList<>();\n Arrays.sort(nums);\n backtrack(resultList, new ArrayList<>(), nums, 0);\n return resultList;\n }", "public static ArrayList<ArrayList<String>> allSubsets(ArrayList<String> parent) {\n\t\tArrayList<ArrayList<String>> result = new ArrayList<ArrayList<String>>();\n\t\t\n\t\tboolean mask[] = new boolean[parent.size()];\n\t\tfor(int i=0;i<mask.length;i++) {\n\t\t\tmask[i] = false;\n\t\t}\n\t\t\n\t\t//We increment the mask once before using it, hence avoid adding the empty set\n\t\twhile(incrementMask(mask)) {\n\t\t\tArrayList<String> subset = properSubsetFromMask(parent, mask); \n\t\t\tif(subset != null) {\n\t\t\t\tif(subset.size() > 0) {\n\t\t\t\t\tresult.add(subset);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public int[][] subSum(int[] list){\n\tint n=list.length;\n\tS=new int[n][n];\n\t//initialize S from list values\n\tfor (int i = 0; i < n; i++) {\n\t\tS[i][i]=list[i];\n\t}\n\t//calculate the values by bottom up fashion\n\tfor (int k = 1; k < n; k++) {\n\t\tint i=0;\n\t\tint j=i+k;\n\t\twhile(j<n && i<j){\n\t\t if(i!=j)\n\t\t\tS[i][j]=S[i][i]+S[i+1][j];\n\t\t i=i+1;\n\t\t j=i+k;\n\t\t}\n\t}\n\treturn S;\n}", "public static List<int[]> getPermutations( int start, int end, int arraySize )\n {\n ArrayList<int[]> permutations = new ArrayList<int[]>( );\n List<int[]> singles = getArrays( start, end );\n permutations.addAll( singles );\n \n List<int[]> lastArrays = singles;\n for ( int i = 2; i <= arraySize; i++ )\n {\n List<int[]> nextArrays = getArrays( lastArrays, end );\n permutations.addAll( nextArrays );\n lastArrays = nextArrays;\n }\n \n return permutations;\n }", "public Chunks chunkDivide(List<Integer> S, int c) {\n\t\tdouble chunks = Math.ceil(c/2.0);\n\t\tList<Integer> S1 = new ArrayList<Integer>();\n\t\tList<Integer> S2 = new ArrayList<Integer>();\n\t\tint j = 0;\n\t\twhile(j < chunks) {\t\n\t\t\twhile(comps(S.get(0), S.get(1)) && S.size() > 1 && (S.get(0) < S.get(1))){\t\t//comparisons\n\t\t\t\tS1.add(S.remove(0));\n\t\t\t}\n\t\t\tS1.add(S.remove(0));\n\t\t\tj++;\n\t\t} \n\t\twhile(S.size() != 0) {\n\t\t\tS2.add(S.remove(0));\n\t\t}\t\n\t\tChunks p = new Chunks(S1, S2);\n\t\treturn p;\n\t}", "public static <T> List<List<T>> permutations(List<T> l) {\n List<List<T>> recursionBase = new ArrayList<List<T>>();\n if (l.isEmpty()) {\n recursionBase.add(new ArrayList<T>(Collections.emptyList()));\n return recursionBase;\n } else {\n T head = l.get(0);\n List<List<T>> recursionStep = permutations(l.subList(1, l.size()));\n List<List<T>> permutation = new ArrayList<List<T>>(recursionStep.size() + 1);\n for (List<T> eachL : recursionStep) {\n for (int i = 0; i <= eachL.size(); i++) {\n List<T> copyOfList = new ArrayList<T>(eachL);\n copyOfList.add(i, head);\n permutation.add(copyOfList);\n }\n }\n return Collections.unmodifiableList(new ArrayList<>(permutation));\n }\n }", "public static String[] getAllLists(String[] elements, int lengthOfList)\r\n\t{\n\t String[] allLists = new String[(int)Math.pow(elements.length, lengthOfList)];\r\n\r\n\t //lists of length 1 are just the original elements\r\n\t if(lengthOfList == 1) return elements; \r\n\t else {\r\n\t //the recursion--get all lists of length 3, length 2, all the way up to 1\r\n\t String[] allSublists = getAllLists(elements, lengthOfList - 1);\r\n\r\n\t //append the sublists to each element\r\n\t int arrayIndex = 0;\r\n\r\n\t for(int i = 0; i < elements.length; i++){\r\n\t for(int j = 0; j < allSublists.length; j++){\r\n\t //add the newly appended combination to the list\r\n\t allLists[arrayIndex] = elements[i] + allSublists[j];\r\n\t arrayIndex++;\r\n\t }\r\n\t }\r\n\t return allLists;\r\n\t }\r\n\t}", "public List<List<Integer>> subsetsWithDup(int[] nums) {\n \n if (nums == null || nums.length == 0) {\n res.add(new ArrayList()); \n return res; \n } \n \n Arrays.sort(nums); \n \n List<Integer> buffer = new ArrayList(); \n normalDFS(nums, 0, buffer); \n \n return res; \n }", "public int[] subList(int fromIndex, int toIndex)\n\t{\t\n\t\tif (fromIndex > -1 && toIndex < arraySize && fromIndex < toIndex)\n\t\t{\n\t\t\tint[] newArray = new int[toIndex - fromIndex];\n\t\t\tfor (int index = fromIndex; index < toIndex; index++)\n\t\t\t{\n\t\t\t\tnewArray[index - fromIndex] = array[index];\n\t\t\t}\n\t\t\treturn newArray;\t\n\t\t}\n\t\t\n\t\treturn null;\n\t\t\n\t}", "public int[] chunkSize(ArrayList<ArrayList<String>> listOfFIDList, int size){\n\t\tint[] chunkInfo = new int[2];\n\t\tint minLength = listOfFIDList.get(0).size();\n\t\tboolean isChunk = false;\n\t\tint numberOfChunks = 0;\n\t\tint chunkSize = 0;\t\n\t\tfor(int i = 0; i < listOfFIDList.size(); i++){ //determine minLength\n\t\t\tif(listOfFIDList.get(i).size() < minLength){\n\t\t\t\tminLength = listOfFIDList.get(i).size();\n\t\t\t}\n\t\t}\t\n\t\tfor(int i = 0; i < listOfFIDList.size(); i++){ //determine individual chunksizes and number of chunks\n\t\t\tint currentSize = listOfFIDList.get(i).size();\n\t\t\tif(currentSize == minLength){\n\t\t\t\tif(!isChunk){\n\t\t\t\t\tnumberOfChunks++;\n\t\t\t\t}\n\t\t\t\tisChunk = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tisChunk = false;\n\t\t\t}\n\t\t\tif(isChunk){\n\t\t\t\tchunkSize++;\n\t\t\t}\n\t\t}\n\t\tchunkInfo[0] = chunkSize;\n\t\tchunkInfo[1] = numberOfChunks;\n\t\t\n\t\treturn chunkInfo;\n\t}", "public List<List<Integer>> getLevelSequences(int sfactor) {\n\n List<List<Integer>> sequences = new ArrayList<List<Integer>>();\n List<Integer> al = new ArrayList<Integer>();\n\n if (selectedLevelIndices.size() > 0) {\n int previous = selectedLevelIndices.get(0);\n al.add(previous);\n for (int i = 1; i < selectedLevelIndices.size(); i++) {\n int next = selectedLevelIndices.get(i);\n if (next - previous == 1 && al.size() <= sfactor) {\n al.add(next);\n previous = next;\n } else {\n sequences.add(al);\n al = new ArrayList<Integer>();\n al.add(next);\n previous = next;\n }\n }\n\n sequences.add(al);\n }\n\n return sequences;\n }", "public static <T> Splitted<T> split(Collection<T> list, Predicate<? super T> predicate) {\n final Splitted<T> splitted = new Splitted<>();\n\n for (T elem : list) {\n if (predicate.test(elem)) {\n splitted.inCondition.add(elem);\n } else {\n splitted.others.add(elem);\n }\n }\n return splitted;\n }", "Entry<V>[][] getList() {\n @SuppressWarnings(\"unchecked\")\n Entry<V>[][] res = new Entry[4][2 * sizeCache];\n int i = 0;\n for (Entry<V> e = list1.next; e != mid1.next; e = e.next) {\n res[0][i++] = e;\n }\n\n i = 0;\n for (Entry<V> e = mid1.next; e != list1; e = e.next) {\n res[1][i++] = e;\n }\n\n i = 0;\n for (Entry<V> e = list2.next; e != mid2.next; e = e.next) {\n res[2][i++] = e;\n }\n\n i = 0;\n for (Entry<V> e = mid2.next; e != list2; e = e.next) {\n res[3][i++] = e;\n }\n\n\n return res;\n }", "@Split\n public List<InputMapper> split(@PartitionSize final long bundles) {\n\t\tfinal List<InputMapper> partitions = new ArrayList<>();\n\t final Collection<Member> members = new ArrayList<>();\n\t long current = 0;\n\t for (final Map.Entry<Member, Future<Long>> entries : getSizeByMembers().entrySet()) {\n\t final long memberSize = getFutureValue(entries.getValue());\n\t if (members.isEmpty()) {\n\t members.add(entries.getKey());\n\t current += memberSize;\n\t } else if (current + memberSize > bundles) {\n\t partitions.add(\n\t new InputMapper(configuration, jsonFactory, jsonb, service, toIdentifiers(members)));\n\t // reset current iteration\n\t members.clear();\n\t current = 0;\n\t }\n\t }\n\t if (!members.isEmpty()) {\n\t partitions.add(new InputMapper(configuration, jsonFactory, jsonb, service, toIdentifiers(members)));\n\t }\n\n\t if (partitions.isEmpty()) { // just execute this if no plan (= no distribution)\n\t partitions.add(this);\n\t }\n\t return partitions;\n }", "public ArrayList<ArrayList<Integer>> subsetsWithDup(int[] num) {\n Arrays.sort(num);\n ArrayList<ArrayList<Integer>> ret = new ArrayList<ArrayList<Integer>>();\n ret.add(new ArrayList<Integer>());\n \n int start = 0;\n for(int i = 0; i < num.length; i++)\n {\n int size = ret.size();\n for(int j = start; j < size; j++)\n {\n ArrayList<Integer> sub = new ArrayList<Integer>(ret.get(j));\n sub.add(num[i]);\n ret.add(sub);\n }\n if(i < num.length - 1 && num[i + 1] == num[i])\n start = size;\n else\n start = 0;\n }\n \n return ret;\n }", "public static String[] getAllLists(String[] elements, int lengthOfList) {\n int n = (int) Math.pow(elements.length, lengthOfList);\n System.out.println(\"n :\"+n);\n String[] allLists = new String[(int) Math.pow(elements.length, lengthOfList)];\n\n //lists of length 1 are just the original elements\n if (lengthOfList == 1) return elements;\n else {\n //the recursion--get all lists of length 3, length 2, all the way up to 1\n String[] allSublists = getAllLists(elements, lengthOfList - 1);\n\n //append the sublists to each element\n int arrayIndex = 0;\n\n for (int i = 0; i < elements.length; i++) {\n for (int j = 0; j < allSublists.length; j++) {\n //add the newly appended combination to the list\n allLists[arrayIndex] = elements[i] + allSublists[j];\n arrayIndex++;\n }\n }\n return allLists;\n }\n }", "private ArrayIntList buildList(int size) {\n\t\tArrayIntList list = new ArrayIntList();\n\t\tfor (int i=1;i<=size;i++)\n\t\t\tlist.add(i);\n\t\treturn list; \n\t}", "@Test @Ignore\r\n public void testSubListSetAll() {\r\n ObservableList list = createObservableList(true);\r\n int from = 2;\r\n int to = 6;\r\n List subList = list.subList(from, to);\r\n int subSize = subList.size();\r\n List itemsOfSubList = new ArrayList(subList);\r\n// itemsOfSubList.remove(0);\r\n ListChangeReport report = new ListChangeReport(list);\r\n subList.retainAll(itemsOfSubList);\r\n assertEquals(\"wrong assumption: implementation is clever enough to detect retain same\",\r\n 1, report.getEventCount());\r\n Change c = report.getLastChange();\r\n LOG.info(\"changed list: \" + list);\r\n prettyPrint(c);\r\n assertEquals(\"single change\" , 1, getChangeCount(c));\r\n assertEquals(\"removed\", subSize, getRemovedSize(c));\r\n assertEquals(\"added\" , subSize, getAddedSize(c));\r\n assertTrue(\"single replace\" + c, wasSingleReplaced(c));\r\n }", "public static List<String> splitEqually(String text, int size) {\n\t List<String> ret = new ArrayList<String>((text.length() + size - 1) / size);\n\n\t for (int start = 0; start < text.length(); start += size) {\n\t ret.add(text.substring(start, Math.min(text.length(), start + size)));\n\t }\n\t return ret;\n\t}", "public List<List<Integer>> subsetsWithDup(int[] nums) {\r\n\t\tMap<Integer, Integer> map = new HashMap<Integer, Integer>();\r\n\t\tList<List<Integer>> rst = new LinkedList<List<Integer>>();\r\n\t\trst.add(new ArrayList<Integer>());\r\n\r\n\t\tfor (int num : nums) {\r\n\t\t\tmap.put(num, map.get(num) == null ? 1 : map.get(num) + 1);\r\n\t\t}\r\n\r\n\t\tIterator<Entry<Integer, Integer>> iter = map.entrySet().iterator();\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tEntry<Integer, Integer> entry = iter.next();\r\n\t\t\tint num = entry.getKey();\r\n\t\t\tint count = entry.getValue();\r\n\t\t\tint size = rst.size();\r\n\t\t\tList<Integer> next = new ArrayList<Integer>();\r\n\t\t\tfor (int i = 1; i <= count; i++) {\r\n\t\t\t\tnext.add(num);\r\n\t\t\t\tfor (int s = 0; s < size; s++) {\r\n\t\t\t\t\tList<Integer> list = new ArrayList<Integer>();\r\n\t\t\t\t\tlist.addAll(rst.get(s));\r\n\t\t\t\t\tlist.addAll(next);\r\n\t\t\t\t\trst.add(list);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn rst;\r\n\t}", "public List<Integer> generateList(int size){\n List<Integer> data = new ArrayList<>();\n for (int i = 0; i < size; i++){\n data.add(i);\n }\n return data;\n }", "public List<List<RecordBean>> splitRecordBeans(List<RecordBean> recordBeans){\n\n recordBeans.sort(RecordBeanComparator);\n List<List<RecordBean>> totalList = new ArrayList();\n for (int i = 0; i < recordBeans.size(); i++){\n Time beginTime = getTimeValueFromRecordBean(recordBeans.get(i));\n if(beginTime != null){\n List<RecordBean> tempList = new ArrayList<>();\n tempList.add(recordBeans.get(i));\n for (int j = i+1; j < recordBeans.size(); j++){\n Time currentTime = getTimeValueFromRecordBean(recordBeans.get(j));\n if(currentTime != null){\n long timeDifference = getTimeDifference(beginTime, currentTime);\n if(timeDifference >= 2){\n totalList.add(new ArrayList<>(tempList));\n beginTime = currentTime;\n tempList.clear();\n tempList.add(recordBeans.get(j));\n }else{\n tempList.add(recordBeans.get(j));\n }\n }\n }\n break;\n }\n }\n return totalList;\n }", "public static Triplet<Integer, Integer, Integer> subArraySum(List<Integer> list) {\n\n int left;\n int right;\n int min = MAX_VALUE;\n\n List<Pair<Integer, Integer>> pairs = build(list);\n Pair<Integer, Integer> prev = pairs.get(0);\n int start = prev.getRight();\n int end = prev.getRight();\n for (int i = 1; i < pairs.size(); i++) {\n Pair<Integer, Integer> pair = pairs.get(i);\n int diff = pair.getLeft() - prev.getLeft();\n if (diff <= min) {\n min = diff;\n start = prev.getRight();\n end = pair.getRight();\n }\n prev = pair;\n }\n left = min(start, end) + 1;\n right = max(start, end);\n return Triplet.build(left, right, min);\n }", "public List<List<Integer>> findSubsequences3(int[] nums) {\n //below set is not working\n Set<List<Integer>> ret = new HashSet<>();\n\n ret.add(new ArrayList<>());\n int index = 0;\n while (index < nums.length) {\n //try to add nums[index]\n\n Set<List<Integer>> newly_added_set = new HashSet<>();\n\n for (List<Integer> l : ret) {\n if (l.size() <= 0 || l.get(l.size() - 1) <= nums[index]) {\n List<Integer> newList = new ArrayList<>(l);\n newList.add(nums[index]);\n newly_added_set.add(newList);\n }\n }\n\n ret.addAll(newly_added_set);\n\n ++index;\n }\n\n List<List<Integer>> ret2 = new ArrayList<>();\n for (List<Integer> l : ret) {\n if (l.size() >= 2) {\n ret2.add(l);\n }\n }\n return ret2;\n }", "private Object[] buildList(int size) {\n list.clear();\n int expectedSize = ArrayList.INITIAL_CAPACITY;\n while (expectedSize < size) {\n expectedSize *= 2;\n }\n Object[] expected = new Object[expectedSize];\n\n for (int i = 0; i < size; i++) {\n String data = i + \"a\";\n list.addToBack(data);\n expected[i] = data;\n }\n return expected;\n }", "private ArrayList<TTC> generateSegmentsHelper(ArrayList<TTC> reference_list) {\n\n ArrayList<TTC> copy = new ArrayList<> (reference_list);\n int start = 0;\n int end = 0;\n\n while (!copy.get(start).equals(START_STATION)) {\n start += 1;\n }\n while (!copy.get(end).equals(endStation)) {\n end += 1;\n }\n if (start < end) {\n return new ArrayList<>(copy.subList(start, end + 1));\n } else if (start == end) {\n return new ArrayList<>(); // if enter and exit at the same station.\n } else {\n Collections.reverse(copy);\n return new ArrayList<>(copy.subList(end, start + 1));\n }\n }", "public List<T> subList(int arg0, int arg1) {\n\t\treturn null;\n\t}", "LinkList subList(int leftIndex,int rightIndex){\n\t\tLinkList newList=new LinkList();\n\t\tNode temp=this.head;\n\t\tint count=1;\n\t\twhile(temp!=null){\n\t\t\tif(count >= leftIndex && count <= rightIndex ){\n\t\t\t\tnewList.insert(temp.getValue());\n\t\t\t}\n\t\t\ttemp=temp.getNext();\n\t\t\tcount++;\n\t\t}\n\t\treturn newList;\n\t}", "public List<List<T>> getAllPermutations(List<T> elements, int lengthOfPermutation) {\n if (lengthOfPermutation == 1) {\n List<List<T>> permutations = new ArrayList<>();\n for (int i = 0; i < elements.size(); i++) {\n List<T> permutation = new ArrayList<>();\n permutation.add(elements.get(i));\n permutations.add(permutation);\n }\n return permutations;\n }\n\n List<List<T>> permutations = new ArrayList<>();\n\n for (int i = 0; i < elements.size(); i++) {\n List<T> elemenstAfterThisElementIsRemoved = new ArrayList<>(elements);\n elemenstAfterThisElementIsRemoved.remove(elements.get(i));\n List<List<T>> smallerPermutations = getAllPermutations(elemenstAfterThisElementIsRemoved, lengthOfPermutation - 1);\n\n for (List<T> smallerPermutation : smallerPermutations) {\n List<T> permutation = new ArrayList<>(smallerPermutation);\n permutation.add(0, elements.get(i));\n permutations.add(permutation);\n }\n }\n\n return permutations;\n }" ]
[ "0.6566955", "0.6458244", "0.64263827", "0.64143044", "0.63529867", "0.595147", "0.594155", "0.580288", "0.56444496", "0.5582479", "0.55539846", "0.54853255", "0.5385434", "0.5295916", "0.529018", "0.5267217", "0.5252707", "0.5247907", "0.5225411", "0.5214609", "0.52066404", "0.51763326", "0.5155477", "0.5134587", "0.5093925", "0.50749123", "0.5056993", "0.50050753", "0.5004636", "0.4999295", "0.4986951", "0.49728265", "0.49651626", "0.49508432", "0.49439538", "0.49239904", "0.49030575", "0.49014726", "0.48963633", "0.48944974", "0.48916602", "0.48605305", "0.48447782", "0.48121142", "0.47877884", "0.47630557", "0.4760953", "0.4760953", "0.47536722", "0.47476527", "0.47382817", "0.47344643", "0.47065628", "0.47043875", "0.46801203", "0.46749058", "0.4641986", "0.4632083", "0.46299836", "0.4627679", "0.46136734", "0.46071038", "0.4590126", "0.45769656", "0.45540896", "0.455029", "0.45492062", "0.45404562", "0.4527743", "0.45183703", "0.45114326", "0.45061162", "0.4490061", "0.4483333", "0.44808492", "0.44781193", "0.44740367", "0.44697425", "0.44545496", "0.44543326", "0.44537008", "0.44536737", "0.44529226", "0.44401276", "0.44360954", "0.44355845", "0.4434764", "0.4429613", "0.44203818", "0.44166508", "0.4414345", "0.44122782", "0.4408846", "0.44038838", "0.43960556", "0.43809092", "0.4374693", "0.4365408", "0.43577138", "0.43564126" ]
0.6917392
0
Verifies that providing an empty predicate array evaluates to true.
@SuppressWarnings({"unchecked"}) @Test public void emptyArrayToGetInstance() { assertTrue(getPredicateInstance(new Predicate[] {}).evaluate(null), "empty array not true"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneFalsePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(false);\n assertFalse(allPredicate(predicate).evaluate(getTestValue()),\n \"single false predicate evaluated to true\");\n }", "@Test\n public void testPredicateAlwaysFalse() {\n Predicate<Integer> predicate = Predicate.alwaysFalse();\n\n assertFalse(predicate.apply(10));\n assertFalse(predicate.apply(null));\n assertFalse(predicate.apply(0));\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneTruePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(true);\n\n assertTrue(allPredicate(predicate).evaluate(getTestValue()), \"single true predicate evaluated to false\");\n }", "public static boolean isNotNullOrEmpty(Object[] array) {\n return array != null && array.length > 0;\n }", "@Test\n public void emptyCollectionToGetInstance() {\n final Predicate<Integer> allPredicate = getPredicateInstance(\n Collections.<Predicate<Integer>>emptyList());\n assertTrue(allPredicate.evaluate(getTestValue()), \"empty collection not true\");\n }", "public void isNotEmpty() {\n if (Iterables.isEmpty(getSubject())) {\n // TODO(user): \"Not true that <[]> is not empty\" doesn't really need the <[]>,\n // since it's empty. But would the bulkier \"the subject\" really be better?\n // At best, we could *replace* <[]> with a given label (rather than supplementing it).\n // Perhaps the right failure message is just \"<[]> should not have been empty\"\n fail(\"is not empty\");\n }\n }", "public static boolean isEmpty(Object[] array) {\r\n return (array == null || array.length == 0);\r\n }", "public boolean isEmpty( Object[] array ){\n if( array == null || array.length == 0 ){\n return true;\n }\n return false;\n }", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "boolean isEmpty(int[] array) {\n return array.length == 0;\n }", "public boolean isEmpty() { return this.filterExpression.length()==0; }", "@Test\n public void testPredicateAlwaysTrue() {\n Predicate<Integer> predicate = Predicate.alwaysTrue();\n\n assertTrue(predicate.apply(10));\n assertTrue(predicate.apply(null));\n assertTrue(predicate.apply(0));\n }", "public static boolean isEmpty(Object[] array) {\n return array == null || array.length == 0;\n }", "public static boolean isEmpty(Object[] array) {\n if (array == null || array.length == 0) {\n return true;\n }\n return false;\n }", "public static boolean isNotEmpty(byte... array) {\r\n\t\treturn array != null && array.length > 0;\r\n\t}", "public void assertNotEmpty(Object[] objArr) {\n if (objArr == null || objArr.length == 0) {\n throw new IllegalArgumentException(\"Arguments is null or its length is empty\");\n }\n }", "protected boolean arrayIsEmpty(Object arr[]) {\n boolean empty = true;\n \n for (Object obj : arr) {\n \tif (obj != null) {\n \t\tempty = false;\n \t\tbreak;\n \t}\n }\n \treturn empty;\n }", "public static boolean isEmpty(Object[] values) {\n return values == null || values.length == 0;\n }", "public static boolean isNullOrEmpty(Object[] array) {\n return !isNotNullOrEmpty(array);\n }", "@Test\r\n public void testempty() {\r\n assertEquals(true, fm.empty());\r\n fm.collect(\"Dampymon\");\r\n fm.collect(\"Dampymon\");\r\n assertEquals(false, fm.empty());\r\n }", "public static boolean isArrayEmpty(Player[] array) {\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (array[i] != Player.EMPTY) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static boolean arrayNotEmpty(String[] a) {\n return a != null && a.length > 0;\n }", "private boolean isEmpty() {\n/* 547 */ return (this.filters.isEmpty() && this.maxArrayLength == Long.MAX_VALUE && this.maxDepth == Long.MAX_VALUE && this.maxReferences == Long.MAX_VALUE && this.maxStreamBytes == Long.MAX_VALUE);\n/* */ }", "public static boolean arrayEmpty(String[] a) {\n return a == null || a.length == 0;\n }", "public static boolean isNotEmpty(Object[] array) {\n return !isEmpty(array);\n }", "private boolean isEmpty() {\n/* 549 */ return (this.filters.isEmpty() && this.maxArrayLength == Long.MAX_VALUE && this.maxDepth == Long.MAX_VALUE && this.maxReferences == Long.MAX_VALUE && this.maxStreamBytes == Long.MAX_VALUE);\n/* */ }", "boolean isEmpty() {\n\t\t\n\t\t// array is empty if no elements can be polled from it\n\t\t// \"canPoll\" flag shows if any elements can be polled from queue\n\t\t// NOT \"canPoll\" means - empty\n\t\t\n\t\treturn !canPoll;\n\t}", "default boolean none( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return !predicate.test( this.item() );\n return stream().noneMatch(predicate);\n }", "public static boolean emptyArray(String[] x) {\n for (String entry : x) {\n if (entry.trim().length() > 0) {\n return false;\n }\n }\n\n return true;\n }", "public boolean isEmpty() {\n\t\treturn array.isEmpty();\n\t}", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "protected boolean checkEmpty(String[] parameters) {\n return parameters == null || parameters.length == 0;\n }", "public boolean isEmpty()\n\t{\n\t\treturn arraySize == 0;\n\t}", "private boolean checkEmpty() {\n\t\treturn this.array[0] == null;\n\t}", "public boolean isAListEmpty(){\r\n\t\tif((programChairs.size() > 0) && (committeeMembers.size() > 0)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty() { return count == 0; }", "public boolean isEmpty() {\n\t\tboolean empty = true;\n\t\tfor(int i = 0; i < contains.length && empty; i++) {\n\t\t\tif (contains[i]) {\n\t\t\t\tempty = false;\n\t\t\t}\n\t\t}\n\t\treturn empty;\n\t}", "Boolean isEmpty();", "Boolean isEmpty();", "public static boolean areAllFalse(boolean[] array)\n {\n for(boolean b : array)\n if(b)\n return false;\n return true;\n }", "boolean checkIfEmpty();", "public boolean isEmpty()\r\n {\r\n if (count > 0) return false;\r\n else return true;\r\n }", "public boolean isEmpty(){\n for(int i = 0; i < arrayList.length; i++) {\n if (arrayList[i] != null)\n return false;\n }\n return true;\n }", "public boolean isEmpty() {\n\t\treturn (op == null && dval == null);\n\t}" ]
[ "0.6512737", "0.649856", "0.61924106", "0.6054374", "0.6038946", "0.60323304", "0.6011351", "0.5996907", "0.5988679", "0.59481204", "0.5933951", "0.5932421", "0.5899778", "0.58139056", "0.5777797", "0.5739317", "0.5738496", "0.57340854", "0.5667354", "0.56293887", "0.56169486", "0.56105244", "0.5593662", "0.55864006", "0.5582147", "0.5579436", "0.5554273", "0.55537164", "0.55442876", "0.5540172", "0.5514787", "0.5514787", "0.5514787", "0.54958355", "0.54933304", "0.5487018", "0.546749", "0.54611933", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5454187", "0.5438558", "0.54231113", "0.54176176", "0.54176176", "0.5397481", "0.53937", "0.53837854", "0.5382585", "0.5380784" ]
0.6905487
0
Verifies that providing an empty predicate collection evaluates to true.
@Test public void emptyCollectionToGetInstance() { final Predicate<Integer> allPredicate = getPredicateInstance( Collections.<Predicate<Integer>>emptyList()); assertTrue(allPredicate.evaluate(getTestValue()), "empty collection not true"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public CollectionPreconditions toBeEmpty() {\n return customMatcher(new Matcher<Collection>() {\n @Override\n public boolean match(final Collection value, final String label) {\n return expect(value, label).not().toBeNull().check().isEmpty();\n }\n\n @Override\n public PreconditionException getException(final Collection value, final String label) {\n return new CollectionNotEmptyPreconditionException(value, label);\n }\n\n @Override\n public PreconditionException getNegatedException(Collection value, String label) {\n return new CollectionEmptyPreconditionException(value, label);\n }\n });\n }", "public boolean isEmpty( Collection<?> collection ){\n if( collection == null || collection.isEmpty() ){\n return true;\n }\n return false;\n }", "public static boolean isEmpty(Collection<?> collection) {\n return collection == null || collection.isEmpty();\n }", "@Test\n public void testPredicateAlwaysFalse() {\n Predicate<Integer> predicate = Predicate.alwaysFalse();\n\n assertFalse(predicate.apply(10));\n assertFalse(predicate.apply(null));\n assertFalse(predicate.apply(0));\n }", "public static boolean isNotEmpty(Collection<?> collection) {\n return !isEmpty(collection);\n }", "@Test\r\n public void testempty() {\r\n assertEquals(true, fm.empty());\r\n fm.collect(\"Dampymon\");\r\n fm.collect(\"Dampymon\");\r\n assertEquals(false, fm.empty());\r\n }", "public static boolean isEmpty(final Collection<?> collection) {\n\n return collection == null || collection.isEmpty();\n }", "public void isNotEmpty() {\n if (Iterables.isEmpty(getSubject())) {\n // TODO(user): \"Not true that <[]> is not empty\" doesn't really need the <[]>,\n // since it's empty. But would the bulkier \"the subject\" really be better?\n // At best, we could *replace* <[]> with a given label (rather than supplementing it).\n // Perhaps the right failure message is just \"<[]> should not have been empty\"\n fail(\"is not empty\");\n }\n }", "public static <\n T> boolean isEmpty(Collection<T> collection) {\n return collection != null && collection.isEmpty();\n }", "public boolean isAListEmpty(){\r\n\t\tif((programChairs.size() > 0) && (committeeMembers.size() > 0)){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean isEmpty() {\n return collection.isEmpty();\n }", "public static <T> boolean m6262a(Collection<T> collection) {\n return collection == null || collection.isEmpty();\n }", "public boolean isEmpty() { return this.filterExpression.length()==0; }", "public static boolean isNotEmpty(final Collection<?> collection) {\n\n return !isEmpty(collection);\n }", "public boolean isEmpty() {\r\n\t\t\r\n\t\tint i = 0;\r\n\t\tStudent emptyChecker;\r\n\t\tint size = sizeOfList(list);\r\n\t\twhile (i < size) {\r\n\t\t\temptyChecker = list[i];\r\n\t\t\tif (emptyChecker != null) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\tnumStudents = 0;\r\n\t return true;\r\n\t}", "public void isEmpty() {\n if (!Iterables.isEmpty(getSubject())) {\n fail(\"is empty\");\n }\n }", "@Test\n public void testPredicateAlwaysTrue() {\n Predicate<Integer> predicate = Predicate.alwaysTrue();\n\n assertTrue(predicate.apply(10));\n assertTrue(predicate.apply(null));\n assertTrue(predicate.apply(0));\n }", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "@Test\r\n public void test_containEmpty_False1() {\r\n Collection<?> collection = Arrays.asList(new Object[] {1, TestsHelper.EMPTY_STRING});\r\n boolean trimStrings = false;\r\n\r\n boolean res = Helper.containEmpty(collection, trimStrings);\r\n\r\n assertFalse(\"'containEmpty' should be correct.\", res);\r\n }", "@Test\r\n public void test_containNull_False() {\r\n Collection<?> collection = Arrays.asList(new Object[] {1, TestsHelper.EMPTY_STRING});\r\n\r\n boolean res = Helper.containNull(collection);\r\n\r\n assertFalse(\"'containNull' should be correct.\", res);\r\n }", "public boolean isEmpty() {\n return attestationsByValidatorCount.isEmpty();\n }", "public boolean containsAll(Collection<?> arg0) {\n\t\treturn false;\n\t}", "@SuppressWarnings({\"unchecked\"})\n @Test\n public void emptyArrayToGetInstance() {\n assertTrue(getPredicateInstance(new Predicate[] {}).evaluate(null), \"empty array not true\");\n }", "public static <\n T> boolean isNotEmpty(Collection<T> collection) {\n return !isEmptyOrNull(collection);\n }", "private void testIsEmpty() {\n init();\n assertTrue(\"empty\", FListInteger.isEmpty(l0));\n assertFalse(\"nonempty\", FListInteger.isEmpty(l1));\n }", "public boolean checkIsEmpty() {\n return isEmpty(minimumInstances) && isEmpty(maximumInstances) && isEmpty(dependentProfiles);\n }", "private static void testIsEmpty(ArrayList list, boolean empty) {\n System.out.print(\"\\nTesting isEmpty with \");\n if (empty) {\n System.out.println(\"an empty list:\");\n } else {\n System.out.println(\"a list that is not empty:\");\n }\n System.out.print(\"isEmpty finds the list \");\n if (empty && list.isEmpty()) {\n System.out.println(\"empty: OK.\");\n } else if (empty) {\n System.out.println(\"not empty, but it is: ERROR.\");\n } else if (!empty && list.isEmpty()) {\n System.out.println(\"empty, but it is not empty: ERROR.\");\n } else {\n System.out.println(\"not empty: OK.\");\n } // end if\n }", "public boolean isEmpty()\r\n {\r\n if (count > 0) return false;\r\n else return true;\r\n }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "public boolean isEmpty() { return size == 0; }", "@Override\n public boolean isEmpty() {\n return filtered.isEmpty();\n }", "public boolean empty() {\n\t\treturn (size() <= 0);\n\t}", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneFalsePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(false);\n assertFalse(allPredicate(predicate).evaluate(getTestValue()),\n \"single false predicate evaluated to true\");\n }", "public boolean isEmpty() { return count == 0; }", "public boolean isEmpty()\r\n {\r\n return (size() == 0);\r\n }", "public boolean isEmpty() {\n return size() == 0;\n }", "private boolean isEmpty() {\n\t\treturn size() == 0;\n\t}", "public boolean isEmpty() {\n\t\treturn allItems.size() == 0;\n\t}", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public boolean isEmpty();", "public static boolean isNullOrEmpty( final Collection< ? > c ) {\n return c == null || c.isEmpty();\n }", "@Test \r\n\t\tpublic void testIsEmpty() {\n\t\ttestingSet= new IntegerSet();\r\n\t\tassertTrue(testingSet.isEmpty()); // empty list = true \r\n\t\tassertFalse(!testingSet.isEmpty());// !empty list = false\r\n\t\t}", "Boolean isEmpty();", "Boolean isEmpty();", "public boolean isEmpty() \r\n\t{\r\n\t\treturn size() == 0;\r\n\t}", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "@Test\r\n public void test_containEmpty_False2() {\r\n List<Object> list = new ArrayList<Object>();\r\n list.add(new Object());\r\n Map<Object, Object> map = new HashMap<Object, Object>();\r\n map.put(new Object(), new Object());\r\n Collection<?> collection = Arrays.asList(new Object[] {1, list, map});\r\n boolean trimStrings = true;\r\n\r\n boolean res = Helper.containEmpty(collection, trimStrings);\r\n\r\n assertFalse(\"'containEmpty' should be correct.\", res);\r\n }", "public void testIsEmpty() {\r\n assertTrue( list.isEmpty());\r\n list.add(\"A\");\r\n assertFalse(list.isEmpty());\r\n }" ]
[ "0.68394464", "0.66069376", "0.6575465", "0.6360986", "0.63328993", "0.62544674", "0.62507665", "0.62390447", "0.61688834", "0.6122284", "0.6094034", "0.60798484", "0.6032282", "0.598914", "0.5966752", "0.5966091", "0.5964374", "0.5934673", "0.59273225", "0.5924617", "0.58699363", "0.5853007", "0.5846274", "0.5839789", "0.5834523", "0.5832995", "0.58213097", "0.5819555", "0.58117634", "0.58117634", "0.58117634", "0.5804768", "0.5794313", "0.57918614", "0.5790686", "0.5789262", "0.57872534", "0.5767533", "0.5766737", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57663834", "0.57629687", "0.5751085", "0.5745345", "0.5745345", "0.57449", "0.57378703", "0.57272893", "0.5724612" ]
0.707851
0
Tests whether a single true predicate evaluates to true.
@SuppressWarnings("unchecked") @Test public void oneTruePredicate() { // use the constructor directly, as getInstance() returns the original predicate when passed // an array of size one. final Predicate<Integer> predicate = createMockPredicate(true); assertTrue(allPredicate(predicate).evaluate(getTestValue()), "single true predicate evaluated to false"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPredicateAlwaysTrue() {\n Predicate<Integer> predicate = Predicate.alwaysTrue();\n\n assertTrue(predicate.apply(10));\n assertTrue(predicate.apply(null));\n assertTrue(predicate.apply(0));\n }", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "@Test\n public void testCaseIsPredicateBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(s -> true, () -> success.set(true));\n assertTrue(success.get());\n }", "public static boolean oneIsTrue(boolean... a){\n\t\tfor (int i=0; i<a.length; i++){\n\t\t\tif (a[i])\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "public static UnaryExpression isTrue(Expression expression) { throw Extensions.todo(); }", "Boolean exists(Predicate<X> p);", "public boolean satisfies(Predicate p){\r\n\t\tif(selfSatisfied)\r\n\t\t\treturn isSatisfied();\r\n\t\telse return ((type.equals(p.type))&&(id.equals(p.id) || p.id.equals(\"?\"))&&(value.equals(p.value)));\r\n\t}", "@Test\n public void trueAndFalseCombined() {\n assertFalse(getPredicateInstance(false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(false, null, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneFalsePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(false);\n assertFalse(allPredicate(predicate).evaluate(getTestValue()),\n \"single false predicate evaluated to true\");\n }", "@Test\n public void testPredicateAlwaysFalse() {\n Predicate<Integer> predicate = Predicate.alwaysFalse();\n\n assertFalse(predicate.apply(10));\n assertFalse(predicate.apply(null));\n assertFalse(predicate.apply(0));\n }", "boolean hasBool();", "@Nonnull\r\n\tpublic static <T> Observable<Boolean> any(\r\n\t\t\t@Nonnull final Observable<T> source,\r\n\t\t\t@Nonnull final Func1<? super T, Boolean> predicate) {\r\n\t\treturn new Containment.Any<T>(source, predicate);\r\n\t}", "public static boolean isTrue(Object value) {\n\t\treturn isBool(value) && (Boolean) value;\n\t}", "@Test\n public void testCaseOfBooleanSupplier() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "boolean hasBoolValue();", "@SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\")\n\tpublic static <T> boolean matches(Optional<T> optional, Predicate<T> predicate) {\n\t\treturn optional.filter(predicate).isPresent();\n\t}", "boolean isAlwaysTrue();", "private final boolean isTrue(final Variable key) {\n return data.containsKey(key) && Boolean.TRUE.equals(data.get(key));\n }", "public static Predicate<Boolean> identity() {\n return new Predicate<Boolean>() {\n\n @Override\n public boolean test(Boolean b) {\n return b;\n }\n\n };\n }", "private boolean isTrue(final Variable key) {\n return data.containsKey(key) && Boolean.TRUE.equals(data.get(key));\n }", "@Test\n public void testCaseOfBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(true, s -> success.set(true));\n assertTrue(success.get());\n }", "@Test\n public void testCaseIsBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(true, () -> success.set(true));\n assertTrue(success.get());\n }", "public boolean isTrue(PartialWorld w) {\n return (observedValue.equals(observedVar.getValue(w)));\n }", "default boolean any( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return predicate.test( this.item() );\n return stream().anyMatch(predicate);\n }", "@Nonnull\r\n\tpublic static <T> Observable<Boolean> any(\r\n\t\t\t@Nonnull final Observable<T> source) {\r\n\t\treturn any(source, Functions.alwaysTrue1());\r\n\t}", "public static <T> Function<T, Boolean> asFunction(Predicate<T> predicate) {\n\t\treturn predicate::test;\n\t}", "public boolean C_trueCond(ListOfParameterLists parameterLists) {\n if(debug)\n System.out.println(\"Condition: TRUE\");\n return true;\n }", "public static boolean getBooleanTrue() {\n boolean returnValue = false;\n return returnValue;\n }", "@Test\n public void boolean_true_assert() throws Exception {\n check(\"boolean_true_assert.c\",\n ImmutableMap.of(\"cpa.stator.policy.generateOctagons\", \"true\",\n \"CompositeCPA.cpas\",\n \"cpa.location.LocationCPA, cpa.callstack.CallstackCPA, cpa.functionpointer.FunctionPointerCPA, cpa.loopstack.LoopstackCPA, cpa.value.ValueAnalysisCPA, cpa.policyiteration.PolicyCPA\",\n \"precision.trackIntAddVariables\", \"false\",\n \"precision.trackVariablesBesidesEqAddBool\", \"false\"));\n }", "public static boolean isTrue( String expression, Map<String, Object> vars )\n {\n Boolean result = (Boolean) evaluate( expression, vars );\n \n return result != null ? result : false;\n }", "public static UnaryExpression isTrue(Expression expression, Method method) { throw Extensions.todo(); }", "public final void mRULE_BOOLEAN_TRUE() throws RecognitionException {\n try {\n int _type = RULE_BOOLEAN_TRUE;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:16695:19: ( 'true' )\n // InternalDSL.g:16695:21: 'true'\n {\n match(\"true\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "@Test\n public void testCaseOfBooleanSupplier() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "private boolean isAssertionTrue(ComputedVariableInstance computedVariables) {\n\t\tIExpression parsedAssertion = agentType.getParsedAssertion();\n\n\t\t// no assertion, always true\n\t\tif (parsedAssertion == null) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn (Boolean)parsedAssertion.evaluate(computedVariables); \n\t}", "public final BooleanLiteral true_() throws RecognitionException {\n\t\tBooleanLiteral b = null;\n\n\n\t\tToken TRUE16=null;\n\n\t\ttry {\n\t\t\t// ul.g:223:33: ( TRUE )\n\t\t\t// ul.g:224:2: TRUE\n\t\t\t{\n\t\t\tTRUE16=(Token)match(input,TRUE,FOLLOW_TRUE_in_true_974); if (state.failed) return b;\n\t\t\tif ( state.backtracking==0 ) {b = new BooleanLiteral(true, (TRUE16!=null?TRUE16.getLine():0), TRUE16.getCharPositionInLine());}\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn b;\n\t}", "public final void rule__XBooleanLiteral__IsTrueAssignment_1_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:18790:1: ( ( ( 'true' ) ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:18791:1: ( ( 'true' ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:18791:1: ( ( 'true' ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:18792:1: ( 'true' )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:18793:1: ( 'true' )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:18794:1: 'true'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n match(input,132,FOLLOW_132_in_rule__XBooleanLiteral__IsTrueAssignment_1_137977); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "Boolean forAll(Predicate<X> p);", "public static final Function<Object,Boolean> isNotNull() {\r\n return FnObject.isNotNull();\r\n }", "@ParameterizedTest\n @ValueSource(booleans = { true, false })\n public void testRunConditionalWorkflowSuccessPreviousResponse(Boolean predicateTest) {\n StepWorkflow.ConditionalBuilder<Integer, Integer> andSometimesConditional = successfulBuilderOfSupplierDataOne.andSometimes(subStepSupplierDataTwo);\n StepWorkflow.Builder<Object> butOnlyIfBuilder = andSometimesConditional.butOnlyIf(new Object(), ignored -> predicateTest);\n assertEquals(subStepSupplierDataOne, butOnlyIfBuilder.start.step);\n assertNotNull(butOnlyIfBuilder.start.next);\n assertEquals(butOnlyIfBuilder.start.next.step, butOnlyIfBuilder.end.step);\n assertNull(butOnlyIfBuilder.end.next);\n\n // Create and validate then() Builder\n StepWorkflow.Builder<Integer> thenBuilder = butOnlyIfBuilder.then(subStepSupplierDataThree);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertNotNull(thenBuilder.start.next);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertEquals(subStepSupplierDataThree, thenBuilder.end.step);\n assertNotNull(thenBuilder.start.next.step);\n assertNull(thenBuilder.end.next);\n\n // Run and validate build()\n StepWorkflow<Integer> buildStepWorkflow = thenBuilder.build();\n assertEquals(thenBuilder.start, buildStepWorkflow.start);\n assertEquals(thenBuilder.end, buildStepWorkflow.end);\n\n // Call run() and validate return StepWorkflowResponse\n StepWorkflowResponse<Integer> response = buildStepWorkflow.run();\n assertTrue(response.wasSuccessful());\n assertEquals(DATA_THREE, response.getData());\n assertNull(response.getException());\n }", "@Test\n\tpublic void testBooleanTrueSingleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "public static <T> Predicate<Predicate<T>> test(T t) {\n\t\treturn pred -> pred.test(t);\n\t}", "public final void rule__XBooleanLiteral__IsTrueAssignment_1_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13281:1: ( ( ( 'true' ) ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13282:1: ( ( 'true' ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13282:1: ( ( 'true' ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13283:1: ( 'true' )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13284:1: ( 'true' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:13285:1: 'true'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \n }\n match(input,69,FOLLOW_69_in_rule__XBooleanLiteral__IsTrueAssignment_1_126690); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \n }\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \n }\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 <T> Predicate<T> asPredicate(Function<T, Boolean> function) {\n\t\treturn function::apply;\n\t}", "boolean hasCondition();", "public boolean isBoolean();", "public boolean evaluate(Object feature) {\n \tif (nullCheck == null) {\n return false;\n } else {\n return (nullCheck.evaluate(feature) == null);\n }\n }", "public final boolean\n isOutcomeSuccess() { return hasOutcome_ && outcome_ == true; }", "public static boolean isTrue(Object o) {\n if(o instanceof SBoolean)\n return ((SBoolean)o).getValue();\n else\n return true;\n }", "protected boolean test(IRecipe recipe) {\n\t\tfor (Predicate<IRecipe> filter : filters) {\n\t\t\tif (!filter.test(recipe))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public boolean lambda26(Object x) {\n return ((Scheme.applyToArgs.apply2(this.pred, x) != Boolean.FALSE ? 1 : 0) + 1) & true;\n }", "public boolean conditionFulfilled();", "boolean booleanOf();", "public boolean contradicts(Predicate p){\r\n\t\treturn (type.equals(p.type) && (id.equals(p.id)) && !(value.equals(p.value)));\r\n\t}", "Boolean conditionResult();", "public boolean evaluate(P object)\n\t{\n\t\treturn !m_predicate.evaluate(object);\n\t}", "private boolean evaluateBooleanExpression(String expression)\n {\n CoreInstance value = (CoreInstance) evaluateExpression(expression, M3Paths.Boolean, true);\n if (value instanceof BooleanCoreInstance)\n {\n return ((BooleanCoreInstance) value).getValue();\n }\n\n String valueName = value.getName();\n if (ModelRepository.BOOLEAN_TRUE.equals(valueName))\n {\n return true;\n }\n if (ModelRepository.BOOLEAN_FALSE.equals(valueName))\n {\n return false;\n }\n\n throw new RuntimeException(\"Expected boolean value, got: \" + valueName);\n }", "@Test\n public void testCaseIsBool() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseIs(true, () -> success.set(true));\n assertTrue(success.get());\n }", "private boolean predicateCheck(Game game) {\n boolean showOnTextFilter;\n if (txtFilter.getText().isEmpty()) {\n showOnTextFilter = true;\n } else {\n showOnTextFilter = game.getName().toLowerCase().contains(txtFilter.getText().toLowerCase());\n }\n\n boolean showOnCheckBoxFilter;\n if (!cbFilterNonAchievement.isSelected()) {\n showOnCheckBoxFilter = true;\n } else {\n showOnCheckBoxFilter = game.getHasStats();\n }\n\n return showOnTextFilter && showOnCheckBoxFilter;\n }", "public static Predicate<String> any() {\n return (each) -> true;\n }", "boolean isValidBoolean(boolean value);", "public boolean evaluate();", "public void ifThen(final Predicate<Boolean> cond, final Statement f) {\n synchronized (this) {\n if (cond.test(this.val)) {\n f.execute();\n }\n }\n }", "public boolean lambda27(Object x) {\n return ((Scheme.applyToArgs.apply2(this.pred, x) != Boolean.FALSE ? 1 : 0) + 1) & true;\n }", "@Test\n public void testCaseOfBool() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseOf(true, s -> success.set(true));\n assertTrue(success.get());\n }", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public void isTrue(String message, boolean expression)\n {\n assertTrue(expression, message);\n }", "boolean evaluate(T target);", "public boolean evaluatesToTrue(final String jsExpression);", "public static boolean bVal( Boolean value ) {\n return value != null && value; \n }", "@Test\n public void observableGetBooleanLogicOperationAndReturnBooleanValue() {\n assertTrue(Observable.just(10)\n .map(intValue -> intValue == 10)\n .toBlocking()\n .single());\n }", "@Test\n public void testCaseIsInputEqualsMatchPredicateBool() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseIs(s -> s == o, () -> success.set(true));\n assertTrue(success.get());\n }", "public void check(final Predicate<T> property);", "public boolean containsLiteralBoolean(Boolean literalData);", "public static boolean checkTrueOrFalse(Properties attributes, String key) {\n\t\treturn \"true\".equalsIgnoreCase(attributes.getProperty(key));\n\t}", "public static boolean isTrue(double percentage) {\n\t\tdouble d = Math.random();\n\t\tpercentage = percentage / 100.0;\n\t\tif(d <= percentage) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "default boolean every( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return predicate.test( this.item() );\n return stream().allMatch(predicate);\n }", "public final void rule__XBooleanLiteral__IsTrueAssignment_1_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:18992:1: ( ( ( 'true' ) ) )\r\n // InternalDroneScript.g:18993:2: ( ( 'true' ) )\r\n {\r\n // InternalDroneScript.g:18993:2: ( ( 'true' ) )\r\n // InternalDroneScript.g:18994:3: ( 'true' )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n // InternalDroneScript.g:18995:3: ( 'true' )\r\n // InternalDroneScript.g:18996:4: 'true'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n match(input,99,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public boolean execute( Object first, Object second )\n {\n return ifPredicate.execute( first, second )\n ? thenPredicate.execute( first, second )\n : elsePredicate.execute( first, second );\n }", "private static UnaryPredicate bepred() {\n return new UnaryPredicate() {\n public boolean execute(Object o) {\n\tif (o instanceof BulkEstimate) {\n\t return ((BulkEstimate)o).isComplete();\n }\n\treturn false;\n }\n };\n }", "public boolean nextBoolean(){\r\n\t\treturn (nextInt() & 0x10) == 0;\r\n\t}", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "boolean hasX();", "public boolean lambda36(Object x) {\n return ((Scheme.applyToArgs.apply2(this.pred, x) != Boolean.FALSE ? 1 : 0) + 1) & true;\n }" ]
[ "0.6992189", "0.67414427", "0.6605045", "0.6288894", "0.6287236", "0.6278205", "0.6276555", "0.62594926", "0.6202073", "0.6170033", "0.6138757", "0.6101801", "0.5985093", "0.59826565", "0.59580135", "0.58957744", "0.5866204", "0.5832583", "0.56990623", "0.56927073", "0.5681425", "0.5668392", "0.56373537", "0.5635917", "0.5630568", "0.56208265", "0.55977416", "0.5565398", "0.55634224", "0.5554137", "0.5550642", "0.55499315", "0.55314964", "0.55294704", "0.55289006", "0.5513482", "0.54616076", "0.5418724", "0.5363756", "0.5351893", "0.5337441", "0.53221005", "0.5319731", "0.5310125", "0.5306172", "0.5291033", "0.52701104", "0.5260526", "0.52546877", "0.52443826", "0.5234977", "0.5226063", "0.5212769", "0.52100277", "0.5203967", "0.51962495", "0.51953375", "0.516466", "0.5161165", "0.51571184", "0.51504344", "0.5138097", "0.5127887", "0.5123011", "0.5120201", "0.5106263", "0.5089016", "0.5088198", "0.50801927", "0.5075286", "0.50732183", "0.50573355", "0.5046687", "0.50446755", "0.50425875", "0.5036308", "0.50339574", "0.5018096", "0.5015669", "0.5004946", "0.50018406", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49957436", "0.49942756" ]
0.7065524
0
Tests whether a single false predicate evaluates to true.
@SuppressWarnings("unchecked") @Test public void oneFalsePredicate() { // use the constructor directly, as getInstance() returns the original predicate when passed // an array of size one. final Predicate<Integer> predicate = createMockPredicate(false); assertFalse(allPredicate(predicate).evaluate(getTestValue()), "single false predicate evaluated to true"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testPredicateAlwaysFalse() {\n Predicate<Integer> predicate = Predicate.alwaysFalse();\n\n assertFalse(predicate.apply(10));\n assertFalse(predicate.apply(null));\n assertFalse(predicate.apply(0));\n }", "@Test\n public void trueAndFalseCombined() {\n assertFalse(getPredicateInstance(false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(false, null, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n }", "public static UnaryExpression isFalse(Expression expression) { throw Extensions.todo(); }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneTruePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(true);\n\n assertTrue(allPredicate(predicate).evaluate(getTestValue()), \"single true predicate evaluated to false\");\n }", "@Test\n public void testPredicateNot() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n\n assertTrue(isEven.apply(10));\n assertFalse(isEven.not().apply(10));\n }", "@Test\n public void testPredicateAlwaysTrue() {\n Predicate<Integer> predicate = Predicate.alwaysTrue();\n\n assertTrue(predicate.apply(10));\n assertTrue(predicate.apply(null));\n assertTrue(predicate.apply(0));\n }", "public static UnaryExpression isFalse(Expression expression, Method method) { throw Extensions.todo(); }", "boolean hasBool();", "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "public boolean evaluate(P object)\n\t{\n\t\treturn !m_predicate.evaluate(object);\n\t}", "default boolean none( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return !predicate.test( this.item() );\n return stream().noneMatch(predicate);\n }", "@Test\n public void testCaseIsPredicateBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(s -> true, () -> success.set(true));\n assertTrue(success.get());\n }", "public boolean contradicts(Predicate p){\r\n\t\treturn (type.equals(p.type) && (id.equals(p.id)) && !(value.equals(p.value)));\r\n\t}", "public static <T> Predicate<T> not(Predicate<T> predicate) { return object -> !predicate.test(object); }", "@Test\n public void testOtherwise() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).otherwise(s -> success.set(true));\n\n assertTrue(success.get());\n }", "public final BooleanLiteral false_() throws RecognitionException {\n\t\tBooleanLiteral b = null;\n\n\n\t\tToken FALSE17=null;\n\n\t\ttry {\n\t\t\t// ul.g:227:34: ( FALSE )\n\t\t\t// ul.g:228:2: FALSE\n\t\t\t{\n\t\t\tFALSE17=(Token)match(input,FALSE,FOLLOW_FALSE_in_false_989); if (state.failed) return b;\n\t\t\tif ( state.backtracking==0 ) {b = new BooleanLiteral(false, (FALSE17!=null?FALSE17.getLine():0), FALSE17.getCharPositionInLine());}\n\t\t\t}\n\n\t\t}\n\t\tcatch (RecognitionException re) {\n\t\t\treportError(re);\n\t\t\trecover(input,re);\n\t\t}\n\t\tfinally {\n\t\t\t// do for sure before leaving\n\t\t}\n\t\treturn b;\n\t}", "@Test\n\tpublic void testBooleanFalse() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query04.rq\", \"/tests/basic/query04.srx\", false);\n\t}", "public static UnaryExpression isTrue(Expression expression) { throw Extensions.todo(); }", "@Test\n public void testOtherwise() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(\"foo\").otherwise(s -> success.set(true));\n\n assertTrue(success.get());\n }", "public TestCase assertFalse( boolean passIfFalse);", "public static Predicate<Boolean> identity() {\n return new Predicate<Boolean>() {\n\n @Override\n public boolean test(Boolean b) {\n return b;\n }\n\n };\n }", "boolean hasBoolValue();", "public static boolean areAllFalse(boolean[] array)\n {\n for(boolean b : array)\n if(b)\n return false;\n return true;\n }", "boolean hasPossiblyBad();", "boolean booleanOf();", "public static Predicate<String> none() {\n return (each) -> false;\n }", "public static boolean method_1147() {\r\n boolean var0 = method_1146();\r\n return !var0;\r\n }", "Boolean exists(Predicate<X> p);", "String getBooleanFalseExpression();", "static <T> Predicate<T> not(Predicate<T> predicate) {\n return predicate.negate();\n }", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "public final void mRULE_BOOLEAN_FALSE() throws RecognitionException {\n try {\n int _type = RULE_BOOLEAN_FALSE;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:16697:20: ( 'false' )\n // InternalDSL.g:16697:22: 'false'\n {\n match(\"false\"); \n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "boolean isNoop();", "default boolean any( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return predicate.test( this.item() );\n return stream().anyMatch(predicate);\n }", "public static <T> Predicate<T> not(final Predicate<T> predicate) {\n return new Predicate<T>() {\n\n @Override\n public boolean test(T t) {\n return !predicate.test(t);\n }\n\n };\n }", "public final boolean\n isOutcomeFailed() { return hasOutcome_ && outcome_ == false; }", "public void isFalse(String message, boolean expression)\n {\n assertFalse(expression, message);\n }", "public final void rule__XBooleanLiteral__Alternatives_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2976:1: ( ( 'false' ) | ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) ) )\r\n int alt28=2;\r\n int LA28_0 = input.LA(1);\r\n\r\n if ( (LA28_0==40) ) {\r\n alt28=1;\r\n }\r\n else if ( (LA28_0==132) ) {\r\n alt28=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 28, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt28) {\r\n case 1 :\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2977:1: ( 'false' )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2977:1: ( 'false' )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2978:1: 'false'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n match(input,40,FOLLOW_40_in_rule__XBooleanLiteral__Alternatives_16455); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2985:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2985:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2986:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2987:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2987:2: rule__XBooleanLiteral__IsTrueAssignment_1_1\r\n {\r\n pushFollow(FOLLOW_rule__XBooleanLiteral__IsTrueAssignment_1_1_in_rule__XBooleanLiteral__Alternatives_16474);\r\n rule__XBooleanLiteral__IsTrueAssignment_1_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public final void rule__XBooleanLiteral__Alternatives_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:3339:1: ( ( 'false' ) | ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) ) )\r\n int alt35=2;\r\n int LA35_0 = input.LA(1);\r\n\r\n if ( (LA35_0==50) ) {\r\n alt35=1;\r\n }\r\n else if ( (LA35_0==99) ) {\r\n alt35=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 35, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt35) {\r\n case 1 :\r\n // InternalDroneScript.g:3340:2: ( 'false' )\r\n {\r\n // InternalDroneScript.g:3340:2: ( 'false' )\r\n // InternalDroneScript.g:3341:3: 'false'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n match(input,50,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalDroneScript.g:3346:2: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n {\r\n // InternalDroneScript.g:3346:2: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n // InternalDroneScript.g:3347:3: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n // InternalDroneScript.g:3348:3: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n // InternalDroneScript.g:3348:4: rule__XBooleanLiteral__IsTrueAssignment_1_1\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__XBooleanLiteral__IsTrueAssignment_1_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public boolean satisfies(Predicate p){\r\n\t\tif(selfSatisfied)\r\n\t\t\treturn isSatisfied();\r\n\t\telse return ((type.equals(p.type))&&(id.equals(p.id) || p.id.equals(\"?\"))&&(value.equals(p.value)));\r\n\t}", "private Object eval(NotFact expr) {\n if (expr.getOpt() != null) {\n Object res = eval(expr.getExpr());\n if (res instanceof Boolean) {\n return !(Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: NotFact result is no boolean\");\n }\n } else {\n return eval(expr.getExpr());\n }\n }", "boolean isEBoolean();", "@Override // io.reactivex.functions.Predicate\n public boolean test(RxWebSocketState rxWebSocketState) {\n RxWebSocketState rxWebSocketState2 = rxWebSocketState;\n Intrinsics.checkNotNullParameter(rxWebSocketState2, \"it\");\n return !(rxWebSocketState2 instanceof RxWebSocketState.Connecting);\n }", "public static boolean oneIsTrue(boolean... a){\n\t\tfor (int i=0; i<a.length; i++){\n\t\t\tif (a[i])\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private Predicate<Response> shouldErrorFailBuild(boolean skipFailures){\n return x -> skipFailures || x.isSuccessful();\n }", "protected boolean ifnot(boolean b) {\r\n\t\tif(not) {\r\n\t\t\treturn !b;\r\n\t\t}\r\n\t\treturn b;\r\n\t}", "@Test\n public void testCaseOfBooleanSupplier() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "Boolean conditionResult();", "@Test\n public void testBooleanLiteralFalse2() throws Exception {\n Boolean expected = Boolean.FALSE;\n String sql = \"SELECT {b'false'}\";\n Node fileNode = sequenceSql(sql, TSQL_QUERY);\n\n Node queryNode = verify(fileNode, Query.ID, Query.ID);\n\n Node selectNode = verify(queryNode, Query.SELECT_REF_NAME, Select.ID);\n Node constantNode = verifyExpressionSymbol(selectNode, Select.SYMBOLS_REF_NAME, Constant.ID);\n verifyProperty(constantNode, Constant.VALUE_PROP_NAME, expected);\n verifyProperty(constantNode, Expression.TYPE_CLASS_PROP_NAME, DataTypeName.BOOLEAN.name());\n\n verifySql(\"SELECT FALSE\", fileNode);\n }", "public static Predicate not(Predicate predicate)\n {\n return new LogicPredicate(Type.NOT, predicate);\n }", "public static final Function<Object,Boolean> isNotNull() {\r\n return FnObject.isNotNull();\r\n }", "public BooleanLit createFalse(Position pos) {\n return (BooleanLit) xnf.BooleanLit(pos, false).type(xts.Boolean());\n }", "boolean isNoOp();", "public boolean isNEVER()\n {\n return equiv(NEVER);\n }", "@Override\n\tpublic boolean canBeFalsey() {\n\t\treturn false;\n\t}", "boolean isAlwaysTrue();", "public final void rule__XBooleanLiteral__Alternatives_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2354:1: ( ( 'false' ) | ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) ) )\n int alt20=2;\n int LA20_0 = input.LA(1);\n\n if ( (LA20_0==32) ) {\n alt20=1;\n }\n else if ( (LA20_0==69) ) {\n alt20=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 20, 0, input);\n\n throw nvae;\n }\n switch (alt20) {\n case 1 :\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2355:1: ( 'false' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2355:1: ( 'false' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2356:1: 'false'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \n }\n match(input,32,FOLLOW_32_in_rule__XBooleanLiteral__Alternatives_15079); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \n }\n\n }\n\n\n }\n break;\n case 2 :\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2363:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2363:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2364:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2365:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2365:2: rule__XBooleanLiteral__IsTrueAssignment_1_1\n {\n pushFollow(FOLLOW_rule__XBooleanLiteral__IsTrueAssignment_1_1_in_rule__XBooleanLiteral__Alternatives_15098);\n rule__XBooleanLiteral__IsTrueAssignment_1_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \n }\n\n }\n\n\n }\n break;\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 boolean isTruth() {\n return truth;\n }", "@Test\n public void testCaseOfBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(true, s -> success.set(true));\n assertTrue(success.get());\n }", "@Test\n\tpublic void test_returnBooleanFoo_false() {\n\t}", "default DoublePredicate negate() {\n/* 81 */ return paramDouble -> !test(paramDouble);\n/* */ }", "public final void mRULE_BOOLEAN() throws RecognitionException {\n try {\n int _type = RULE_BOOLEAN;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // ../org.xtext.example.webgme_mtl/src-gen/org/xtext/example/webgme/parser/antlr/internal/InternalMTL.g:2527:14: ( ( 'true' | 'false' ) )\n // ../org.xtext.example.webgme_mtl/src-gen/org/xtext/example/webgme/parser/antlr/internal/InternalMTL.g:2527:16: ( 'true' | 'false' )\n {\n // ../org.xtext.example.webgme_mtl/src-gen/org/xtext/example/webgme/parser/antlr/internal/InternalMTL.g:2527:16: ( 'true' | 'false' )\n int alt5=2;\n int LA5_0 = input.LA(1);\n\n if ( (LA5_0=='t') ) {\n alt5=1;\n }\n else if ( (LA5_0=='f') ) {\n alt5=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 5, 0, input);\n\n throw nvae;\n }\n switch (alt5) {\n case 1 :\n // ../org.xtext.example.webgme_mtl/src-gen/org/xtext/example/webgme/parser/antlr/internal/InternalMTL.g:2527:17: 'true'\n {\n match(\"true\"); \n\n\n }\n break;\n case 2 :\n // ../org.xtext.example.webgme_mtl/src-gen/org/xtext/example/webgme/parser/antlr/internal/InternalMTL.g:2527:24: 'false'\n {\n match(\"false\"); \n\n\n }\n break;\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public void testCompareBoolean() {\n\t\tboolean one = true;\n\t\tboolean two = false;\n\t\t//false ist kleiner wie true\n\t\tassertTrue(comp.compareBoolean(two, one) == -1);\n\t\tassertTrue(comp.compareBoolean(one, one) == 0);\n\t\tassertTrue(comp.compareBoolean(two, two) == 0);\n\t\tassertTrue(comp.compareBoolean(one, two) == 1);\n\t}", "boolean isValidBoolean(boolean value);", "public Value restrictToBool() {\n checkNotPolymorphicOrUnknown();\n if (isMaybeAnyBool())\n return theBoolAny;\n else if (isMaybeTrueButNotFalse())\n return theBoolTrue;\n else if (isMaybeFalseButNotTrue())\n return theBoolFalse;\n else\n return theNone;\n }", "public static <T> Predicate<Predicate<T>> test(T t) {\n\t\treturn pred -> pred.test(t);\n\t}", "@ParameterizedTest\n @ValueSource(booleans = { true, false })\n public void testRunConditionalWorkflowSuccessPreviousResponse(Boolean predicateTest) {\n StepWorkflow.ConditionalBuilder<Integer, Integer> andSometimesConditional = successfulBuilderOfSupplierDataOne.andSometimes(subStepSupplierDataTwo);\n StepWorkflow.Builder<Object> butOnlyIfBuilder = andSometimesConditional.butOnlyIf(new Object(), ignored -> predicateTest);\n assertEquals(subStepSupplierDataOne, butOnlyIfBuilder.start.step);\n assertNotNull(butOnlyIfBuilder.start.next);\n assertEquals(butOnlyIfBuilder.start.next.step, butOnlyIfBuilder.end.step);\n assertNull(butOnlyIfBuilder.end.next);\n\n // Create and validate then() Builder\n StepWorkflow.Builder<Integer> thenBuilder = butOnlyIfBuilder.then(subStepSupplierDataThree);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertNotNull(thenBuilder.start.next);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertEquals(subStepSupplierDataThree, thenBuilder.end.step);\n assertNotNull(thenBuilder.start.next.step);\n assertNull(thenBuilder.end.next);\n\n // Run and validate build()\n StepWorkflow<Integer> buildStepWorkflow = thenBuilder.build();\n assertEquals(thenBuilder.start, buildStepWorkflow.start);\n assertEquals(thenBuilder.end, buildStepWorkflow.end);\n\n // Call run() and validate return StepWorkflowResponse\n StepWorkflowResponse<Integer> response = buildStepWorkflow.run();\n assertTrue(response.wasSuccessful());\n assertEquals(DATA_THREE, response.getData());\n assertNull(response.getException());\n }", "public final EObject ruleBooleanUnit() throws RecognitionException {\r\n EObject current = null;\r\n\r\n EObject this_Negation_0 = null;\r\n\r\n EObject this_RelationalExpression_1 = null;\r\n\r\n EObject this_BooleanLiteral_2 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2425:28: ( (this_Negation_0= ruleNegation | this_RelationalExpression_1= ruleRelationalExpression | this_BooleanLiteral_2= ruleBooleanLiteral ) )\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2426:1: (this_Negation_0= ruleNegation | this_RelationalExpression_1= ruleRelationalExpression | this_BooleanLiteral_2= ruleBooleanLiteral )\r\n {\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2426:1: (this_Negation_0= ruleNegation | this_RelationalExpression_1= ruleRelationalExpression | this_BooleanLiteral_2= ruleBooleanLiteral )\r\n int alt33=3;\r\n switch ( input.LA(1) ) {\r\n case 58:\r\n case 59:\r\n {\r\n alt33=1;\r\n }\r\n break;\r\n case RULE_ID:\r\n case RULE_STRING:\r\n case RULE_INT:\r\n case RULE_POSITIVE_SMALL_DECIMAL:\r\n case RULE_NULL:\r\n case RULE_SMALL_DECIMAL:\r\n case RULE_EBIGDECIMAL:\r\n case 42:\r\n case 43:\r\n case 46:\r\n case 68:\r\n case 69:\r\n case 70:\r\n case 71:\r\n case 72:\r\n case 73:\r\n case 74:\r\n case 75:\r\n {\r\n alt33=2;\r\n }\r\n break;\r\n case RULE_EBOOLEAN:\r\n {\r\n alt33=3;\r\n }\r\n break;\r\n default:\r\n if (state.backtracking>0) {state.failed=true; return current;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 33, 0, input);\r\n\r\n throw nvae;\r\n }\r\n\r\n switch (alt33) {\r\n case 1 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2427:5: this_Negation_0= ruleNegation\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBooleanUnitAccess().getNegationParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleNegation_in_ruleBooleanUnit5148);\r\n this_Negation_0=ruleNegation();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_Negation_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2437:5: this_RelationalExpression_1= ruleRelationalExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBooleanUnitAccess().getRelationalExpressionParserRuleCall_1()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleRelationalExpression_in_ruleBooleanUnit5175);\r\n this_RelationalExpression_1=ruleRelationalExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_RelationalExpression_1; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 3 :\r\n // ../eu.artist.postmigration.nfrvt.lang.gml/src-gen/eu/artist/postmigration/nfrvt/lang/gml/parser/antlr/internal/InternalGML.g:2447:5: this_BooleanLiteral_2= ruleBooleanLiteral\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBooleanUnitAccess().getBooleanLiteralParserRuleCall_2()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleBooleanLiteral_in_ruleBooleanUnit5202);\r\n this_BooleanLiteral_2=ruleBooleanLiteral();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_BooleanLiteral_2; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public boolean isClosed(Predicate predicate) {\n return closedPredicates.contains(predicate);\n }", "public boolean isBoolean();", "@Nonnull\r\n\tpublic static <T> Observable<Boolean> any(\r\n\t\t\t@Nonnull final Observable<T> source,\r\n\t\t\t@Nonnull final Func1<? super T, Boolean> predicate) {\r\n\t\treturn new Containment.Any<T>(source, predicate);\r\n\t}", "default Predicate<T> negate() {\n/* 80 */ return paramObject -> !test((T)paramObject);\n/* */ }", "@Test\n public void testCaseIsBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(true, () -> success.set(true));\n assertTrue(success.get());\n }", "public final void mRULE_BOOL_VAL() throws RecognitionException {\r\n try {\r\n int _type = RULE_BOOL_VAL;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:19802:15: ( ( 'true' | 'false' ) )\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:19802:17: ( 'true' | 'false' )\r\n {\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:19802:17: ( 'true' | 'false' )\r\n int alt10=2;\r\n int LA10_0 = input.LA(1);\r\n\r\n if ( (LA10_0=='t') ) {\r\n alt10=1;\r\n }\r\n else if ( (LA10_0=='f') ) {\r\n alt10=2;\r\n }\r\n else {\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 10, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt10) {\r\n case 1 :\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:19802:18: 'true'\r\n {\r\n match(\"true\"); \r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../org.openmodelica.modelicaml.editor.xtext.modification.ui/src-gen/org/openmodelica/modelicaml/editor/xtext/modification/ui/contentassist/antlr/internal/InternalModification.g:19802:25: 'false'\r\n {\r\n match(\"false\"); \r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n }\r\n }", "public static <T> Function<T, Boolean> asFunction(Predicate<T> predicate) {\n\t\treturn predicate::test;\n\t}", "public boolean isMaybeAbsent() {\n checkNotUnknown();\n return (flags & ABSENT) != 0;\n }", "public boolean isNotAbsent() {\n return !isMaybeAbsent() && isMaybePresent();\n }", "public boolean isProjectionOnly(Predicate p_pred){\n\t\tint num_ms = this.numStatements();\n\t\tfor (int j = 0; j < num_ms; j++)\n\t\t{\n\t\t\tStatement state = (Statement)this.statementI(j);\n\t\t\tif (state.containsPredicateName(p_pred.getFunctionHead()) &&\n\t\t\t\t\tstate.isProjectionOnly()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "boolean getNegated();", "public final F<S, Boolean> exist(final F<A, Boolean> p) {\n return foldMap(Monoid.disjunctionMonoid, p);\n }", "@Test @Ignore\n public void testUfWithBoolArg() throws SolverException, InterruptedException {\n\n UninterpretedFunctionDeclaration<IntegerFormula> uf = fmgr.declareUninterpretedFunction(\"fun_bi\", FormulaType.IntegerType, FormulaType.BooleanType);\n IntegerFormula ufTrue = fmgr.callUninterpretedFunction(uf, ImmutableList.of(bmgr.makeBoolean(true)));\n IntegerFormula ufFalse = fmgr.callUninterpretedFunction(uf, ImmutableList.of(bmgr.makeBoolean(false)));\n\n BooleanFormula f = bmgr.not(imgr.equal(ufTrue, ufFalse));\n assertThat(f.toString()).isEmpty();\n assert_().about(BooleanFormula()).that(f).isSatisfiable();\n }", "BooleanExpression createBooleanExpression();", "BooleanExpression createBooleanExpression();", "public void negateIf(final Predicate<Boolean> cond, final Statement f) {\n this.ifThen(cond, () -> {\n this.val = !this.val;\n f.execute();\n });\n }", "public StatementNode getStatementNodeOnFalse();", "public TruthExpression() {\r\n\t\tsuper(new Expression[]{});\r\n\t\tthis.truthValue = TruthValue.FALSE;\r\n\t}", "@Override\n public boolean isMaybeAnyBool() {\n checkNotPolymorphicOrUnknown();\n return (flags & BOOL) == BOOL;\n }", "public final void mRULE_BOOLEAN() throws RecognitionException {\n try {\n int _type = RULE_BOOLEAN;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:2282:14: ( ( 'true' | 'false' ) )\n // InternalDSL.g:2282:16: ( 'true' | 'false' )\n {\n // InternalDSL.g:2282:16: ( 'true' | 'false' )\n int alt1=2;\n int LA1_0 = input.LA(1);\n\n if ( (LA1_0=='t') ) {\n alt1=1;\n }\n else if ( (LA1_0=='f') ) {\n alt1=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 1, 0, input);\n\n throw nvae;\n }\n switch (alt1) {\n case 1 :\n // InternalDSL.g:2282:17: 'true'\n {\n match(\"true\"); \n\n\n }\n break;\n case 2 :\n // InternalDSL.g:2282:24: 'false'\n {\n match(\"false\"); \n\n\n }\n break;\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public boolean monkeyTrouble(boolean aSmile, boolean bSmile) {\n return (aSmile && bSmile || !aSmile && !bSmile);\n}", "T getFalseValue();", "public boolean sawNonboolean() {\n return nonboolean;\n }", "@Override\n\tpublic Object visitBooleanLiteral(BooleanLiteral literal) {\n\t\treturn null;\n\t}", "public final EObject ruleBooleanLiteral() throws RecognitionException {\n EObject current = null;\n\n Token otherlv_1=null;\n Token lv_isTrue_2_0=null;\n\n enterRule(); \n \n try {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1918:28: ( ( () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) ) ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:1: ( () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) ) )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:1: ( () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:2: () (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1919:2: ()\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1920:5: \n {\n if ( state.backtracking==0 ) {\n\n current = forceCreateModelElement(\n grammarAccess.getBooleanLiteralAccess().getBooleanLiteralAction_0(),\n current);\n \n }\n\n }\n\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1925:2: (otherlv_1= 'false' | ( (lv_isTrue_2_0= 'true' ) ) )\n int alt25=2;\n int LA25_0 = input.LA(1);\n\n if ( (LA25_0==48) ) {\n alt25=1;\n }\n else if ( (LA25_0==49) ) {\n alt25=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return current;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 25, 0, input);\n\n throw nvae;\n }\n switch (alt25) {\n case 1 :\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1925:4: otherlv_1= 'false'\n {\n otherlv_1=(Token)match(input,48,FOLLOW_48_in_ruleBooleanLiteral4564); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n \tnewLeafNode(otherlv_1, grammarAccess.getBooleanLiteralAccess().getFalseKeyword_1_0());\n \n }\n\n }\n break;\n case 2 :\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1930:6: ( (lv_isTrue_2_0= 'true' ) )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1930:6: ( (lv_isTrue_2_0= 'true' ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1931:1: (lv_isTrue_2_0= 'true' )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1931:1: (lv_isTrue_2_0= 'true' )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:1932:3: lv_isTrue_2_0= 'true'\n {\n lv_isTrue_2_0=(Token)match(input,49,FOLLOW_49_in_ruleBooleanLiteral4588); if (state.failed) return current;\n if ( state.backtracking==0 ) {\n\n newLeafNode(lv_isTrue_2_0, grammarAccess.getBooleanLiteralAccess().getIsTrueTrueKeyword_1_1_0());\n \n }\n if ( state.backtracking==0 ) {\n\n \t if (current==null) {\n \t current = createModelElement(grammarAccess.getBooleanLiteralRule());\n \t }\n \t\tsetWithLastConsumed(current, \"isTrue\", true, \"true\");\n \t \n }\n\n }\n\n\n }\n\n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "@SuppressWarnings(\"OptionalUsedAsFieldOrParameterType\")\n\tpublic static <T> boolean matches(Optional<T> optional, Predicate<T> predicate) {\n\t\treturn optional.filter(predicate).isPresent();\n\t}", "boolean getPossiblyBad();", "@Test\n public void testCaseOfBooleanSupplier() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "@FunctionalInterface\n/* */ public interface DoublePredicate\n/* */ {\n/* */ default DoublePredicate and(DoublePredicate paramDoublePredicate) {\n/* 69 */ Objects.requireNonNull(paramDoublePredicate);\n/* 70 */ return paramDouble -> (test(paramDouble) && paramDoublePredicate.test(paramDouble));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default DoublePredicate negate() {\n/* 81 */ return paramDouble -> !test(paramDouble);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default DoublePredicate or(DoublePredicate paramDoublePredicate) {\n/* 101 */ Objects.requireNonNull(paramDoublePredicate);\n/* 102 */ return paramDouble -> (test(paramDouble) || paramDoublePredicate.test(paramDouble));\n/* */ }\n/* */ \n/* */ boolean test(double paramDouble);\n/* */ }", "boolean isIsNotNull();", "boolean isFail();", "public static BooleanConstantFalse getFalse()\n {\n return new BooleanConstant.BooleanConstantFalse();\n }" ]
[ "0.73911226", "0.684543", "0.67486", "0.62202287", "0.62096", "0.6101904", "0.59921366", "0.59846395", "0.59039336", "0.5887656", "0.58639973", "0.585532", "0.5851935", "0.5803737", "0.5789473", "0.57678676", "0.5713994", "0.5681695", "0.56497395", "0.56214434", "0.5614114", "0.55998033", "0.55778134", "0.5562871", "0.5540615", "0.55255467", "0.552006", "0.5496144", "0.54626244", "0.54296523", "0.54236853", "0.54151016", "0.5402107", "0.5395785", "0.53701824", "0.53689384", "0.53429586", "0.5330425", "0.53289187", "0.5283669", "0.5273231", "0.5245497", "0.52310175", "0.52298695", "0.5225852", "0.5220258", "0.5216971", "0.5211421", "0.5182192", "0.51807207", "0.51705784", "0.5162968", "0.5157346", "0.5152753", "0.5140411", "0.51390463", "0.51350963", "0.51291883", "0.5122741", "0.51135814", "0.5113237", "0.51097465", "0.5107872", "0.51027584", "0.50852275", "0.5084436", "0.5069686", "0.5069674", "0.5068144", "0.5064485", "0.50408024", "0.5039058", "0.50343645", "0.5033172", "0.5030605", "0.5028735", "0.502818", "0.5014888", "0.50144833", "0.5010606", "0.5003705", "0.4992719", "0.4992719", "0.49854082", "0.49840143", "0.49839857", "0.49774978", "0.49622744", "0.4961822", "0.49475852", "0.49460235", "0.49410182", "0.49408537", "0.49219117", "0.491781", "0.49173868", "0.4914961", "0.49115774", "0.49097914", "0.49049595" ]
0.72052336
1
Tests whether multiple true predicates evaluates to true.
@Test public void allTrue() { assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()), "multiple true predicates evaluated to false"); assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()), "multiple true predicates evaluated to false"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void trueAndFalseCombined() {\n assertFalse(getPredicateInstance(false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(false, null, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n }", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "public static boolean oneIsTrue(boolean... a){\n\t\tfor (int i=0; i<a.length; i++){\n\t\t\tif (a[i])\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static void run(Runnable run, List<Boolean> bools) {\n if (bools.stream().allMatch(b -> b == true)) // Check if all booleans are true\n run.run(); // Ran if the above condition is met\n }", "private static boolean testGetAllowedValues(boolean a[]) {\r\n return a[0] && a[1] && a[2] && a[3] && !a[4] && a[5] && a[6] && a[7] && !a[8];\r\n }", "private boolean isAllTrue(HashMap<Integer, Boolean> messages)\r\n {\r\n // Iterate through each value for each key in the map.\r\n for(boolean value : messages.values())\r\n {\r\n // If a value is false, then return false.\r\n if(!value)\r\n {\r\n return false;\r\n }\r\n }\r\n // If all values are true, then return true.\r\n return true;\r\n }", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneTruePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(true);\n\n assertTrue(allPredicate(predicate).evaluate(getTestValue()), \"single true predicate evaluated to false\");\n }", "static boolean test(List<Condition> conditions) {\n for (Condition cond : conditions) {\n if (!cond.test()) {\n return false;\n }\n }\n return true;\n }", "@Test\n\tpublic void testBooleanTrueMultipleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03a.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "static <T> Predicate<T> compose(Predicate<T>... functions) {\n return Stream.of(functions).reduce(__ -> true, Predicate::and);\n }", "private int countTrue(boolean... cases) {\n int result = 0;\n for (boolean c : cases) {\n if (c) {\n result++;\n }\n }\n return result;\n }", "@Test\n public void testPredicateAnd() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n Predicate<Integer> isDivSeven = (x) -> (x % 7) == 0;\n\n Predicate<Integer> evenOrDivSeven = isEven.and(isDivSeven);\n\n assertTrue(evenOrDivSeven.apply(14));\n assertFalse(evenOrDivSeven.apply(21));\n assertFalse(evenOrDivSeven.apply(8));\n assertFalse(evenOrDivSeven.apply(5));\n }", "boolean hasAll();", "boolean hasAll();", "static boolean any(EnumSet<Trait> traits, Trait... args)\n {\n return Arrays.stream(args).anyMatch(traits::contains);\n }", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "@Test\n public void testCaseIsPredicateBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(s -> true, () -> success.set(true));\n assertTrue(success.get());\n }", "protected boolean test(IRecipe recipe) {\n\t\tfor (Predicate<IRecipe> filter : filters) {\n\t\t\tif (!filter.test(recipe))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "Boolean forAll(Predicate<X> p);", "public boolean isSatisfied(Set<String> enabledFeatures) {\n for (Set<String> filter : filters) {\n boolean filterSatisfied = false;\n for (String filterCondition : filter) {\n if (enabledFeatures.contains(filterCondition)) {\n filterSatisfied = true;\n break;\n }\n }\n if (!filterSatisfied)\n return false;\n }\n return true;\n }", "protected static boolean areAllPreconditionsMet(HashSet<GoapState> preconditions, HashSet<GoapState> effects) {\r\n\t\tboolean preconditionsMet = true;\r\n\r\n\t\tfor (GoapState precondition : preconditions) {\r\n\t\t\tboolean currentPreconditionMet = false;\r\n\r\n\t\t\tfor (GoapState effect : effects) {\r\n\t\t\t\tif (precondition.effect.equals(effect.effect)) {\r\n\t\t\t\t\tif (precondition.value.equals(effect.value)) {\r\n\t\t\t\t\t\tcurrentPreconditionMet = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpreconditionsMet = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!preconditionsMet || !currentPreconditionMet) {\r\n\t\t\t\tpreconditionsMet = false;\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn preconditionsMet;\r\n\t}", "public final F<S, Boolean> all(final F<A, Boolean> p) {\n return foldMap(Monoid.conjunctionMonoid, p);\n }", "static boolean test(List<Condition> conditions) {\n return true; // REPLACE WITH SOLUTION \n }", "public boolean satisfiedBasedOnChildrenValues(boolean[] childValues)\r\n {\r\n boolean result = !this.isSome;\r\n if (this.isSome)\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result || childValues[i];\r\n }\r\n } else\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result && childValues[i];\r\n }\r\n }\r\n return result;\r\n }", "public boolean satisfiedBasedOnChildrenValues(boolean[] childValues)\r\n {\r\n boolean result = !this.isSome;\r\n if (this.isSome)\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result || childValues[i];\r\n }\r\n } else\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result && childValues[i];\r\n }\r\n }\r\n return result;\r\n }", "private boolean isAllIngredientOk(ArrayList<Boolean> listOfBool) {\n if (listOfBool.isEmpty() || listOfBool.contains(false))\n return false;\n return true;\n }", "@Test\n public void testPredicateAlwaysTrue() {\n Predicate<Integer> predicate = Predicate.alwaysTrue();\n\n assertTrue(predicate.apply(10));\n assertTrue(predicate.apply(null));\n assertTrue(predicate.apply(0));\n }", "public boolean checkBoolExpr(ArrayList<BoolExpr> exprs){\r\n\t\tif (exprs == null || exprs.isEmpty()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tfor (BoolExpr expr : exprs) {\r\n\t\t\tboolean flag = false;\r\n\r\n\t\t\tString op = expr.getOp();\r\n\t\t\tint testValue = expr.getValue();\r\n\t\t\tint realValue = this.cvMap.getValue(expr.getCvName());\r\n\t\t\t\r\n\t\t\tif (op.equals(\">\") && realValue > testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\">=\") && realValue >= testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"<\") && realValue < testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"<=\") && realValue <= testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"==\") && realValue == testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"!=\") && realValue != testValue)\r\n\t\t\t\tflag = true;\r\n\r\n\t\t\tif (flag == false)// one false, all false\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneFalsePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(false);\n assertFalse(allPredicate(predicate).evaluate(getTestValue()),\n \"single false predicate evaluated to true\");\n }", "public static boolean multiProve(Tableau tableau) {\n // Alphas\n boolean retVal = expandAllAlphas(tableau);\n // Deltas\n retVal = expandAllDeltas(tableau) || retVal;\n // expand comprehension triggers before doing comprehension stuff\n retVal = expandComprehensionTriggers(tableau) || retVal;\n // Comprehension Schema\n retVal = expandClassMemberPredicates(tableau) || retVal;\n // Brown's rule\n retVal = tableau.applyAllBrowns() || retVal;\n // Beta or Gamma\n if (expandOneBeta(tableau))\n return true;\n if (Prover.unifyEquality(tableau) != null)\n return false;\n return expandOneGamma(tableau) || retVal;\n }", "public boolean C_trueCond(ListOfParameterLists parameterLists) {\n if(debug)\n System.out.println(\"Condition: TRUE\");\n return true;\n }", "private boolean predicateCheck(Game game) {\n boolean showOnTextFilter;\n if (txtFilter.getText().isEmpty()) {\n showOnTextFilter = true;\n } else {\n showOnTextFilter = game.getName().toLowerCase().contains(txtFilter.getText().toLowerCase());\n }\n\n boolean showOnCheckBoxFilter;\n if (!cbFilterNonAchievement.isSelected()) {\n showOnCheckBoxFilter = true;\n } else {\n showOnCheckBoxFilter = game.getHasStats();\n }\n\n return showOnTextFilter && showOnCheckBoxFilter;\n }", "@FunctionalInterface\n/* */ public interface Predicate<T>\n/* */ {\n/* */ default Predicate<T> and(Predicate<? super T> paramPredicate) {\n/* 68 */ Objects.requireNonNull(paramPredicate);\n/* 69 */ return paramObject -> (test((T)paramObject) && paramPredicate.test(paramObject));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default Predicate<T> negate() {\n/* 80 */ return paramObject -> !test((T)paramObject);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default Predicate<T> or(Predicate<? super T> paramPredicate) {\n/* 100 */ Objects.requireNonNull(paramPredicate);\n/* 101 */ return paramObject -> (test((T)paramObject) || paramPredicate.test(paramObject));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ static <T> Predicate<T> isEqual(Object paramObject) {\n/* 115 */ return (null == paramObject) ? Objects::isNull : (paramObject2 -> paramObject1.equals(paramObject2));\n/* */ }\n/* */ \n/* */ boolean test(T paramT);\n/* */ }", "default boolean every( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return predicate.test( this.item() );\n return stream().allMatch(predicate);\n }", "public static void main(final String[] args) {\n\t\tfinal Predicate<Integer> p1 = i -> i > 10;\n\t\tSystem.out.println(p1.test(10)); // OP: false\n\n\t\t// i>10 && number is even then return true\n\t\tfinal Predicate<Integer> p2 = i -> i % 2 == 0;\n\t\tSystem.out.println(p1.and(p2).test(20)); // OP: true\n\n\t\t// i>10 || number is even then return true\n\t\tSystem.out.println(p1.or(p2).test(21)); // OP: true\n\n\t\t// i>10 && number is odd then return true\n\t\tSystem.out.println(p1.and(p2.negate()).test(21)); // OP: true\n\t}", "@Test\n public void testPredicateOr() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n Predicate<Integer> isDivSeven = (x) -> (x % 7) == 0;\n\n Predicate<Integer> evenOrDivSeven = isEven.or(isDivSeven);\n\n assertTrue(evenOrDivSeven.apply(14));\n assertTrue(evenOrDivSeven.apply(21));\n assertTrue(evenOrDivSeven.apply(8));\n assertFalse(evenOrDivSeven.apply(5));\n }", "public boolean any(Trait... flags)\n {\n return any(traits, flags);\n }", "boolean isSetMultiple();", "public static void main(String[] args) { , or , not\n // truth table -> t=1 f=0\n // a =t b= f c = a and b => a.b =0=>f\n\n // except 0 every no. is treated as true\n // int a=1 int b=2 a and b => a.b\n // and -> a=1 , b=2, a and b => a.b\n\n\n // and\n boolean a= false;\n boolean b= false;\n\n boolean c= a && b; // a.b\n System.out.println(c);\n\n //or\n boolean f= true;\n boolean d= true;\n\n boolean e= f || d; // a+b\n System.out.println(e);\n\n // not\n boolean g =true;\n boolean h= !g;\n System.out.println(h);\n\n }", "static boolean is(EnumSet<Trait> traits, Trait... args)\n {\n return Arrays.stream(args).allMatch(traits::contains);\n }", "default boolean areRelated(Triple... elements) {\n return witnesses(elements).anyMatch(x -> true);\n }", "public static Predicate and(Predicate... predicates)\n {\n return new LogicPredicate(Type.AND, predicates);\n }", "public ArrayList<SimplifyResult> doAND(String predicates[]) throws IOException {\n\t\tString formula = new String();\n\t\t\n\t\tformula += \"(AND \";\n\t\tfor (String p : predicates) {\n\t\t\tformula += p + \" \";\n\t\t}\n\t\tformula += \")\";\t\t\n\t\t\n\t\treturn doFormula(formula);\n\t}", "public static Predicate<String> any() {\n return (each) -> true;\n }", "boolean isAny();", "public boolean isSatisfied() {\n for (IntegerVariable v : integerVariables) {\n if (!v.isSatisfied()) {\n // Logger.fine(v.toString() + \" is not satisfied\");\n return false;\n }\n }\n for (Clause clause : clauses) {\n if (!clause.isSatisfied()) {\n // Logger.fine(clause.toString() + \" is not satisfied\");\n return false;\n }\n }\n return true;\n }", "boolean hasOnlyProceduresInAnyValues();", "public static void main(String[] args) {\n\t\tPredicate<Integer> fun1= x-> x>5;\r\n\t\tSystem.out.println(fun1.test(5));\r\n\t\t\r\n\t\tPredicate<String> fun2 = x-> x.isEmpty();\r\n\t\tSystem.out.println(fun2.test(\"\"));\r\n\t\t\r\n\t\tList<Integer> numbers = Arrays.asList(1,2,3,4,6,5,7,8,0);\r\n\t\tSystem.out.println(numbers.stream().filter(fun1).collect(Collectors.toList()));\r\n\t\t\r\n\t\t//predicate with and\r\n\t\tSystem.out.println(numbers.stream().filter(x-> x>5 && x<8).collect(Collectors.toList()));\r\n\t\t\r\n\t\t//predicate with negate\r\n\t\tList<String> names = Arrays.asList(\"Nayeem\", \"John\", \"SDET\");\r\n\t\tPredicate<String> fun3 = x -> x.contains(\"e\");\r\n\t\tSystem.out.println(names.stream().filter(fun3.negate()).collect(Collectors.toList()));\r\n\t\t\r\n\t}", "boolean hasConditionList();", "default boolean any( Predicate<V> predicate ) {\n if ( ((Tensor<V>)this).isVirtual() ) return predicate.test( this.item() );\n return stream().anyMatch(predicate);\n }", "public final Predicate predicates() throws RecognitionException {\n Predicate pred = null;\n\n\n Predicate p = null;\n\n\n try {\n // parser/flatzinc/FlatzincFullExtWalker.g:157:5: (p= predicate | ^( AND (p= predicates )+ ) | ^( OR (p= predicates )+ ) )\n int alt9 = 3;\n switch (input.LA(1)) {\n case CARITY:\n case CNAME:\n case CSTR:\n case IN:\n case NOT:\n case PARITY:\n case PPRIO:\n case PPRIOD:\n case PROP:\n case TRUE:\n case VAR:\n case VCARD:\n case VNAME: {\n alt9 = 1;\n }\n break;\n case AND: {\n alt9 = 2;\n }\n break;\n case OR: {\n alt9 = 3;\n }\n break;\n default:\n NoViableAltException nvae =\n new NoViableAltException(\"\", 9, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt9) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:157:9: p= predicate\n {\n pushFollow(FOLLOW_predicate_in_predicates178);\n p = predicate();\n\n state._fsp--;\n\n\n pred = p;\n\n\n }\n break;\n case 2:\n // parser/flatzinc/FlatzincFullExtWalker.g:162:5: ^( AND (p= predicates )+ )\n {\n\n ArrayList<Predicate> preds = new ArrayList();\n\n\n match(input, AND, FOLLOW_AND_in_predicates203);\n\n match(input, Token.DOWN, null);\n // parser/flatzinc/FlatzincFullExtWalker.g:165:11: (p= predicates )+\n int cnt7 = 0;\n loop7:\n do {\n int alt7 = 2;\n switch (input.LA(1)) {\n case AND:\n case CARITY:\n case CNAME:\n case CSTR:\n case IN:\n case NOT:\n case OR:\n case PARITY:\n case PPRIO:\n case PPRIOD:\n case PROP:\n case TRUE:\n case VAR:\n case VCARD:\n case VNAME: {\n alt7 = 1;\n }\n break;\n\n }\n\n switch (alt7) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:165:12: p= predicates\n {\n pushFollow(FOLLOW_predicates_in_predicates208);\n p = predicates();\n\n state._fsp--;\n\n\n preds.add(p);\n\n }\n break;\n\n default:\n if (cnt7 >= 1) break loop7;\n EarlyExitException eee =\n new EarlyExitException(7, input);\n throw eee;\n }\n cnt7++;\n } while (true);\n\n\n match(input, Token.UP, null);\n\n\n pred = new BoolPredicate(preds, BoolPredicate.TYPE.AND);\n\n\n }\n break;\n case 3:\n // parser/flatzinc/FlatzincFullExtWalker.g:170:5: ^( OR (p= predicates )+ )\n {\n\n ArrayList<Predicate> preds = new ArrayList();\n\n\n match(input, OR, FOLLOW_OR_in_predicates237);\n\n match(input, Token.DOWN, null);\n // parser/flatzinc/FlatzincFullExtWalker.g:173:10: (p= predicates )+\n int cnt8 = 0;\n loop8:\n do {\n int alt8 = 2;\n switch (input.LA(1)) {\n case AND:\n case CARITY:\n case CNAME:\n case CSTR:\n case IN:\n case NOT:\n case OR:\n case PARITY:\n case PPRIO:\n case PPRIOD:\n case PROP:\n case TRUE:\n case VAR:\n case VCARD:\n case VNAME: {\n alt8 = 1;\n }\n break;\n\n }\n\n switch (alt8) {\n case 1:\n // parser/flatzinc/FlatzincFullExtWalker.g:173:11: p= predicates\n {\n pushFollow(FOLLOW_predicates_in_predicates242);\n p = predicates();\n\n state._fsp--;\n\n\n preds.add(p);\n\n }\n break;\n\n default:\n if (cnt8 >= 1) break loop8;\n EarlyExitException eee =\n new EarlyExitException(8, input);\n throw eee;\n }\n cnt8++;\n } while (true);\n\n\n match(input, Token.UP, null);\n\n\n pred = new BoolPredicate(preds, BoolPredicate.TYPE.OR);\n\n\n }\n break;\n\n }\n } catch (RecognitionException re) {\n reportError(re);\n recover(input, re);\n } finally {\n // do for sure before leaving\n }\n return pred;\n }", "private Object eval(AndExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = true;\n for (RelExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result && (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (!result) {\n return false;\n }\n }\n return true;\n }", "@FunctionalInterface\n/* */ public interface DoublePredicate\n/* */ {\n/* */ default DoublePredicate and(DoublePredicate paramDoublePredicate) {\n/* 69 */ Objects.requireNonNull(paramDoublePredicate);\n/* 70 */ return paramDouble -> (test(paramDouble) && paramDoublePredicate.test(paramDouble));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default DoublePredicate negate() {\n/* 81 */ return paramDouble -> !test(paramDouble);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default DoublePredicate or(DoublePredicate paramDoublePredicate) {\n/* 101 */ Objects.requireNonNull(paramDoublePredicate);\n/* 102 */ return paramDouble -> (test(paramDouble) || paramDoublePredicate.test(paramDouble));\n/* */ }\n/* */ \n/* */ boolean test(double paramDouble);\n/* */ }", "private boolean factPresent(Fact req, ArrayList<Fact> facts) {\n boolean conditionMet = false;\n for (Fact fact: facts) {\n if (req.equals(fact)) {\n conditionMet = true;\n break;\n }\n }\n return conditionMet;\n }", "public boolean satisfies(Predicate p){\r\n\t\tif(selfSatisfied)\r\n\t\t\treturn isSatisfied();\r\n\t\telse return ((type.equals(p.type))&&(id.equals(p.id) || p.id.equals(\"?\"))&&(value.equals(p.value)));\r\n\t}", "private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}", "public boolean interestedCheck(boolean[] bitfield){\n List<Integer> ones = new ArrayList<>();\n for(int x=0; x<bitfield.length; x++){\n if(bitfield[x]){\n return true;\n }\n }\n\n if(ones.size() == 0){\n return false;\n }\n else{\n return true;\n }\n }", "private boolean runMultiSampleCase() {\n\t\tArrayList<Candidate> candidates = collectTrioCandidates();\n\n\t\t// Then, check the candidates for all trios around affected individuals.\n\t\tfor (Candidate c : candidates)\n\t\t\tif (isCompatibleWithTriosAroundAffected(c))\n\t\t\t\treturn true;\n\t\treturn false;\n\t}", "@Test\n public void testOr() {\n if (true || addValue()) {\n assertThat(flag, equalTo(0));\n }\n\n // first not satisfied, invoke second\n if (false || addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public static void main( final String[] args ) {\n final BooleanSetEvaluator evaluator = new BooleanSetEvaluator();\n final BitSetEvaluationContext context = new BitSetEvaluationContext( 4 );\n doIt( evaluator, \"0011 * 1010\", context );\n doIt( evaluator, \"true * 1100\", context );\n doIt( evaluator, \"-false\", context );\n }", "@ParameterizedTest\n @ValueSource(booleans = { true, false })\n public void testRunConditionalWorkflowSuccessPreviousResponse(Boolean predicateTest) {\n StepWorkflow.ConditionalBuilder<Integer, Integer> andSometimesConditional = successfulBuilderOfSupplierDataOne.andSometimes(subStepSupplierDataTwo);\n StepWorkflow.Builder<Object> butOnlyIfBuilder = andSometimesConditional.butOnlyIf(new Object(), ignored -> predicateTest);\n assertEquals(subStepSupplierDataOne, butOnlyIfBuilder.start.step);\n assertNotNull(butOnlyIfBuilder.start.next);\n assertEquals(butOnlyIfBuilder.start.next.step, butOnlyIfBuilder.end.step);\n assertNull(butOnlyIfBuilder.end.next);\n\n // Create and validate then() Builder\n StepWorkflow.Builder<Integer> thenBuilder = butOnlyIfBuilder.then(subStepSupplierDataThree);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertNotNull(thenBuilder.start.next);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertEquals(subStepSupplierDataThree, thenBuilder.end.step);\n assertNotNull(thenBuilder.start.next.step);\n assertNull(thenBuilder.end.next);\n\n // Run and validate build()\n StepWorkflow<Integer> buildStepWorkflow = thenBuilder.build();\n assertEquals(thenBuilder.start, buildStepWorkflow.start);\n assertEquals(thenBuilder.end, buildStepWorkflow.end);\n\n // Call run() and validate return StepWorkflowResponse\n StepWorkflowResponse<Integer> response = buildStepWorkflow.run();\n assertTrue(response.wasSuccessful());\n assertEquals(DATA_THREE, response.getData());\n assertNull(response.getException());\n }", "@Test\n public void boolean_true_assert() throws Exception {\n check(\"boolean_true_assert.c\",\n ImmutableMap.of(\"cpa.stator.policy.generateOctagons\", \"true\",\n \"CompositeCPA.cpas\",\n \"cpa.location.LocationCPA, cpa.callstack.CallstackCPA, cpa.functionpointer.FunctionPointerCPA, cpa.loopstack.LoopstackCPA, cpa.value.ValueAnalysisCPA, cpa.policyiteration.PolicyCPA\",\n \"precision.trackIntAddVariables\", \"false\",\n \"precision.trackVariablesBesidesEqAddBool\", \"false\"));\n }", "@Test\n public void testPredicateAlwaysFalse() {\n Predicate<Integer> predicate = Predicate.alwaysFalse();\n\n assertFalse(predicate.apply(10));\n assertFalse(predicate.apply(null));\n assertFalse(predicate.apply(0));\n }", "boolean hasMatchedElements();", "private boolean isAssertionTrue(ComputedVariableInstance computedVariables) {\n\t\tIExpression parsedAssertion = agentType.getParsedAssertion();\n\n\t\t// no assertion, always true\n\t\tif (parsedAssertion == null) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn (Boolean)parsedAssertion.evaluate(computedVariables); \n\t}", "public boolean isApplicable(ActionSchema a) {\n return this.getFluents().containsAll(a.getPrecondition());\n }", "public static final boolean m64573a(@C6003d boolean[] zArr, @C6003d C6080l<? super Boolean, Boolean> lVar) {\n C14445h0.m62478f(zArr, \"$receiver\");\n C14445h0.m62478f(lVar, \"predicate\");\n for (boolean valueOf : zArr) {\n if (!((Boolean) lVar.invoke(Boolean.valueOf(valueOf))).booleanValue()) {\n return false;\n }\n }\n return true;\n }", "@Test\n\tpublic void testBooleanTrueSingleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "@Override\r\n public boolean evaluate(Map<Integer, Boolean> vars) {\n for (Formula formula : getParts()){\r\n if(formula.evaluate(vars)==false){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static boolean doTestsPass()\r\n {\r\n\r\n boolean result = true;\r\n result = result && FindMin(new int[]{3,4,5,6,1,2}) == 1;\r\n result = result && FindMin(new int[]{2,1}) == 1;\r\n result = result && FindMin(new int[]{1}) == 1;\r\n\r\n try {\r\n FindMin(null);\r\n result = false;\r\n }\r\n catch(Exception e)\r\n {\r\n result = result && true;\r\n }\r\n\r\n if(result)\r\n {\r\n System.out.println(\"All tests pass\\n\");\r\n }\r\n else\r\n {\r\n System.out.println(\"There are test failures\\n\");\r\n }\r\n return result;\r\n }", "public boolean monkeyTrouble(boolean aSmile, boolean bSmile) {\n return (aSmile && bSmile || !aSmile && !bSmile);\n}", "public static boolean areAllFalse(boolean[] array)\n {\n for(boolean b : array)\n if(b)\n return false;\n return true;\n }", "public boolean execute( Object first, Object second )\n {\n return ifPredicate.execute( first, second )\n ? thenPredicate.execute( first, second )\n : elsePredicate.execute( first, second );\n }", "public boolean isSatisfied(int a, int b, int c) {\n return (value(a, b, c) != 0);\n }", "public static UnaryExpression isTrue(Expression expression) { throw Extensions.todo(); }", "private boolean isAllInputValid() {\n for (Map.Entry<EditText, Validator> e : mValidators.entrySet()) {\n if (e.getKey().isEnabled()) {\n if (!e.getValue().test(e.getKey().getText().toString()))\n return false;\n }\n }\n return true;\n }", "public static void main(String[] args) {\n HashMap<String, Boolean> casesToAction = new HashMap<>();\n casesToAction.put(\"a\", true);\n casesToAction.put(\"b\", true);\n casesToAction.put(\"c\", false);\n casesToAction.put(\"d\", true);\n casesToAction.put(\"e\", false);\n\n int expectedSuccessCount = Collections.frequency(casesToAction.values(), true);\n System.out.println(expectedSuccessCount);\n }", "boolean isEvaluable();", "boolean any(String collection);", "boolean has(final Flag... flags) {\n if(dontEnter || expr == null) return false;\n dontEnter = true;\n final boolean has = expr.has(flags);\n dontEnter = false;\n return has;\n }", "private ValidationResult allCriteriaSatisfied(FormCheckerElement elem) {\n\t\tfor (Criterion criterion : elem.getCriteria()) {\n\t\t\tValidationResult vr = criterion.validate(elem);\n\t\t\tif (!vr.isValid()) {\n\t\t\t\treturn vr;\n\t\t\t}\n\t\t}\n\n\t\treturn ValidationResult.ok();\n\t}", "private Object eval(OrExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = false;\n for (AndExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result || (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (result) {\n return true;\n }\n }\n return false;\n }", "private boolean getTests() {\n boolean genderTest = genderSpinner.getValue().equals(currentContact.getGender());\n boolean birthdayTest = dateModel.getValue().equals(currentContact.getBirthday());\n boolean emailTest = emailField.getText().equals(currentContact.getEmail());\n boolean mobileTest = mobileField.getText().equals(currentContact.getMobile());\n boolean homeTest = homeField.getText().equals(currentContact.getHome());\n boolean motherTest = motherField.getText().equals(currentContact.getMother());\n boolean fatherTest = fatherField.getText().equals(currentContact.getFather());\n boolean addressTest = addressArea.getText().equals(currentContact.getAddress());\n return genderTest && birthdayTest && emailTest && mobileTest && homeTest && motherTest && fatherTest && addressTest;\n }", "@Test\n public void test_containsKeywords_returnsTrue() {\n ContainsKeywordsPredicate predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"wallet\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"Nike wallet\").build()));\n\n // One keyword in finder field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"Alice\"));\n assertTrue(predicate.test(new ArticleBuilder().withFinder(\"Alice Bob\").build()));\n\n // One keyword in description field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"12pm\"));\n assertTrue(predicate.test(new ArticleBuilder().withDescription(\"12pm Library\").build()));\n\n // One keyword in phone field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"88888888\"));\n assertTrue(predicate.test(new ArticleBuilder().withPhone(\"88888888\").build()));\n\n // One keyword in email field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"[email protected]\"));\n assertTrue(predicate.test(new ArticleBuilder().withEmail(\"[email protected]\").build()));\n\n // One keyword in tag field\n predicate = new ContainsKeywordsPredicate(Collections.singletonList(\"black\"));\n assertTrue(predicate.test(new ArticleBuilder().withTags(\"black\", \"blue\").build()));\n\n // Multiple keywords in name field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"Alice\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"Alice Bob\").build()));\n\n // Multiple keywords in finder field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"Alice\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withFinder(\"Alice Bob\").build()));\n\n // Multiple keywords in description field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"12pm\", \"Bob\"));\n assertTrue(predicate.test(new ArticleBuilder().withDescription(\"12pm Bob\").build()));\n\n // Multiple keywords in tag field\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"black\", \"Blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withTags(\"black\", \"Blue\").build()));\n\n // Multiple keywords in different fields\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"waLLet\", \"bOB\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"wallet\").withFinder(\"Bob\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"waLLet\", \"bOB\", \"raining\"));\n assertTrue(predicate.test(new ArticleBuilder().withName(\"wallet\").withFinder(\"Bob\")\n .withDescription(\"Raining heavily\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"[email protected]\", \"bOB\", \"blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withEmail(\"[email protected]\")\n .withTags(\"blue\", \"sticker\").withFinder(\"Bob\").build()));\n predicate = new ContainsKeywordsPredicate(Arrays.asList(\"66666666\", \"blue\"));\n assertTrue(predicate.test(new ArticleBuilder().withPhone(\"66666666\")\n .withTags(\"blue\", \"sticker\").withDescription(\"blue wallet\").build()));\n }", "boolean isSetProbables();", "@Test\n public void testCaseOfBooleanSupplier() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "private boolean canMatchConditions(Puzzle puzzle) {\n //this method is responsible for check some conditions and decide that the current case is solution or not.\n for (Condition condition : CONDITIONS) {\n if (!condition.isMatchCondition(puzzle)) {\n return false;\n }\n }\n return true;\n }", "public static boolean evalExtract(SpItem[] spItems) {\n for (int i = 0; i < spItems.length; ++i) {\n if (!evalExtract(spItems[i])) {\n return false;\n }\n }\n\n return true;\n }", "public boolean contradicts(Predicate p){\r\n\t\treturn (type.equals(p.type) && (id.equals(p.id)) && !(value.equals(p.value)));\r\n\t}", "private static void andify(List<ExternalizedStateComponent> inputs, ExternalizedStateComponent output, ExternalizedStateConstant trueProp) {\n\t\tfor(ExternalizedStateComponent c : inputs) {\n\t\t\tif(c instanceof ExternalizedStateConstant && !((ExternalizedStateConstant)c).getValue()) {\n\t\t\t\t//Connect false (c) to the output\n\t\t\t\toutput.addInput(c);\n\t\t\t\tc.addOutput(output);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t//For reals... just skip over any true constants\n\t\tExternalizedStateAnd and = new ExternalizedStateAnd();\n\t\tfor(ExternalizedStateComponent in : inputs) {\n\t\t\tif(!(in instanceof ExternalizedStateConstant)) {\n\t\t\t\tin.addOutput(and);\n\t\t\t\tand.addInput(in);\n\t\t\t}\n\t\t}\n\t\t//What if they're all true? (Or inputs is empty?) Then no inputs at this point...\n\t\tif(and.getInputs().isEmpty()) {\n\t\t\t//Hook up to \"true\"\n\t\t\ttrueProp.addOutput(output);\n\t\t\toutput.addInput(trueProp);\n\t\t\treturn;\n\t\t}\n\t\t//If there's just one, on the other hand, don't use the and gate\n\t\tif(and.getInputs().size() == 1) {\n\t\t\tExternalizedStateComponent in = and.getSingleInput();\n\t\t\tin.removeOutput(and);\n\t\t\tand.removeInput(in);\n\t\t\tin.addOutput(output);\n\t\t\toutput.addInput(in);\n\t\t\treturn;\n\t\t}\n\t\tand.addOutput(output);\n\t\toutput.addInput(and);\n\t}", "public boolean isComplete() {\r\n for (GoalInterface g: goals) {\r\n if (type == GoalType.AND && !g.isComplete()) {\r\n return false;\r\n } else if (type == GoalType.OR && g.isComplete()) {\r\n return true;\r\n }\r\n }\r\n\r\n if (type == GoalType.AND) {\r\n return true;\r\n } else if (type == GoalType.OR) {\r\n return false;\r\n }\r\n return false;\r\n }", "public static final boolean m64093A(@C6003d boolean[] zArr, @C6003d C6080l<? super Boolean, Boolean> lVar) {\n C14445h0.m62478f(zArr, \"$receiver\");\n C14445h0.m62478f(lVar, \"predicate\");\n Boolean bool = null;\n boolean z = false;\n for (boolean z2 : zArr) {\n if (((Boolean) lVar.invoke(Boolean.valueOf(z2))).booleanValue()) {\n if (!z) {\n bool = Boolean.valueOf(z2);\n z = true;\n } else {\n throw new IllegalArgumentException(\"Array contains more than one matching element.\");\n }\n }\n }\n if (!z) {\n throw new NoSuchElementException(\"Array contains no element matching the predicate.\");\n } else if (bool != null) {\n return bool.booleanValue();\n } else {\n throw new TypeCastException(\"null cannot be cast to non-null type kotlin.Boolean\");\n }\n }", "public boolean isAnswered() {\n\t\tfor (boolean b : this.checked) {\n\t\t\tif (b)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void testSuccesiveConjunctiveTermsOk() throws Exception\n {\n resolveAndAssertSolutions(\"[[f(a), g(b), h(c)], (?- f(X), g(Y), h(Z)), [[X <-- a, Y <-- b, Z <-- c]]]\");\n }", "public boolean conditionFulfilled();", "public RdfPredicateObjectListCollection andHas(RdfPredicate predicate, RdfObject... objects) {\n\t\treturn andHas(Rdf.predicateObjectList(predicate, objects));\n\t}", "public boolean isExceptionRule(ArrayList<AttributeValue> others) {\r\n if (getPremises().size() <= others.size()) {\r\n return false;\r\n }\r\n\r\n boolean[] contains = new boolean[others.size()];\r\n for (int i = 0; i < contains.length; i++) {\r\n contains[i] = false;\r\n }\r\n\r\n for (int i = 0; i < others.size(); i++) {\r\n for (AttributeValue premise : getPremises()) {\r\n if (others.get(i).toString().equals(premise.toString())) {\r\n contains[i] = true;\r\n }\r\n }\r\n }\r\n\r\n for (int i = 0; i < contains.length; i++) {\r\n if (!contains[i]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "Boolean exists(Predicate<X> p);", "@Nonnull\r\n\tpublic static <T> Observable<Boolean> all(\r\n\t\t\t@Nonnull final Observable<? extends T> source,\r\n\t\t\t@Nonnull final Func1<? super T, Boolean> predicate) {\r\n\t\treturn new Containment.All<T>(source, predicate);\r\n\t}", "public static final boolean m65427y(@C6003d boolean[] zArr, @C6003d C6080l<? super Boolean, Boolean> lVar) {\n C14445h0.m62478f(zArr, \"$receiver\");\n C14445h0.m62478f(lVar, \"predicate\");\n for (boolean valueOf : zArr) {\n if (((Boolean) lVar.invoke(Boolean.valueOf(valueOf))).booleanValue()) {\n return false;\n }\n }\n return true;\n }" ]
[ "0.7191953", "0.7092514", "0.6880489", "0.66638213", "0.6505118", "0.6428561", "0.6245753", "0.6173272", "0.6147212", "0.6032302", "0.60256463", "0.6010144", "0.59705836", "0.59705836", "0.5911274", "0.5905144", "0.5895261", "0.58618945", "0.5847779", "0.58175707", "0.57894844", "0.57845354", "0.57830465", "0.5779497", "0.57319856", "0.57302535", "0.5719262", "0.57032996", "0.5678672", "0.5658246", "0.56223077", "0.56108963", "0.5601088", "0.5580955", "0.55661017", "0.5561699", "0.55277926", "0.55166847", "0.550398", "0.55030066", "0.5487504", "0.54813963", "0.5474311", "0.54377836", "0.54199696", "0.5403315", "0.53936887", "0.53867006", "0.5368896", "0.5358937", "0.53532755", "0.5338121", "0.53336245", "0.5312312", "0.5311856", "0.5308417", "0.52976406", "0.5283871", "0.52825516", "0.52767926", "0.5259886", "0.52577984", "0.52378577", "0.5224082", "0.52120197", "0.52055395", "0.51978064", "0.5194593", "0.5194026", "0.51929635", "0.51928216", "0.5188442", "0.51706797", "0.5143463", "0.5102422", "0.50822914", "0.50764275", "0.5075636", "0.5062691", "0.5051367", "0.50497544", "0.5047348", "0.5043907", "0.5040225", "0.5039769", "0.5036324", "0.5021671", "0.5016856", "0.5016144", "0.5013936", "0.500241", "0.50018686", "0.49982113", "0.49950913", "0.49949306", "0.4991925", "0.49903324", "0.49866694", "0.49862897", "0.4979753" ]
0.83863485
0
Tests whether combining some true and one false evaluates to false. Also verifies that only the first false predicate is actually evaluated
@Test public void trueAndFalseCombined() { assertFalse(getPredicateInstance(false, null).evaluate(getTestValue()), "false predicate evaluated to true"); assertFalse(getPredicateInstance(false, null, null).evaluate(getTestValue()), "false predicate evaluated to true"); assertFalse(getPredicateInstance(true, false, null).evaluate(getTestValue()), "false predicate evaluated to true"); assertFalse(getPredicateInstance(true, true, false).evaluate(getTestValue()), "false predicate evaluated to true"); assertFalse(getPredicateInstance(true, true, false, null).evaluate(getTestValue()), "false predicate evaluated to true"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void allTrue() {\n assertTrue(getPredicateInstance(true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n assertTrue(getPredicateInstance(true, true, true).evaluate(getTestValue()),\n \"multiple true predicates evaluated to false\");\n }", "private static boolean testGetAllowedValues(boolean a[]) {\r\n return a[0] && a[1] && a[2] && a[3] && !a[4] && a[5] && a[6] && a[7] && !a[8];\r\n }", "@Test\n public void testOr() {\n if (true || addValue()) {\n assertThat(flag, equalTo(0));\n }\n\n // first not satisfied, invoke second\n if (false || addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public void testCompareBoolean() {\n\t\tboolean one = true;\n\t\tboolean two = false;\n\t\t//false ist kleiner wie true\n\t\tassertTrue(comp.compareBoolean(two, one) == -1);\n\t\tassertTrue(comp.compareBoolean(one, one) == 0);\n\t\tassertTrue(comp.compareBoolean(two, two) == 0);\n\t\tassertTrue(comp.compareBoolean(one, two) == 1);\n\t}", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneFalsePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(false);\n assertFalse(allPredicate(predicate).evaluate(getTestValue()),\n \"single false predicate evaluated to true\");\n }", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public static boolean oneIsTrue(boolean... a){\n\t\tfor (int i=0; i<a.length; i++){\n\t\t\tif (a[i])\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public boolean monkeyTrouble(boolean aSmile, boolean bSmile) {\n return (aSmile && bSmile || !aSmile && !bSmile);\n}", "public boolean satisfiedBasedOnChildrenValues(boolean[] childValues)\r\n {\r\n boolean result = !this.isSome;\r\n if (this.isSome)\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result || childValues[i];\r\n }\r\n } else\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result && childValues[i];\r\n }\r\n }\r\n return result;\r\n }", "public boolean satisfiedBasedOnChildrenValues(boolean[] childValues)\r\n {\r\n boolean result = !this.isSome;\r\n if (this.isSome)\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result || childValues[i];\r\n }\r\n } else\r\n {\r\n for (int i = 0; i < childValues.length; i++)\r\n {\r\n result = result && childValues[i];\r\n }\r\n }\r\n return result;\r\n }", "@ParameterizedTest\n @ValueSource(booleans = { true, false })\n public void testRunConditionalWorkflowSuccessPreviousResponse(Boolean predicateTest) {\n StepWorkflow.ConditionalBuilder<Integer, Integer> andSometimesConditional = successfulBuilderOfSupplierDataOne.andSometimes(subStepSupplierDataTwo);\n StepWorkflow.Builder<Object> butOnlyIfBuilder = andSometimesConditional.butOnlyIf(new Object(), ignored -> predicateTest);\n assertEquals(subStepSupplierDataOne, butOnlyIfBuilder.start.step);\n assertNotNull(butOnlyIfBuilder.start.next);\n assertEquals(butOnlyIfBuilder.start.next.step, butOnlyIfBuilder.end.step);\n assertNull(butOnlyIfBuilder.end.next);\n\n // Create and validate then() Builder\n StepWorkflow.Builder<Integer> thenBuilder = butOnlyIfBuilder.then(subStepSupplierDataThree);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertNotNull(thenBuilder.start.next);\n assertEquals(subStepSupplierDataOne, thenBuilder.start.step);\n assertEquals(subStepSupplierDataThree, thenBuilder.end.step);\n assertNotNull(thenBuilder.start.next.step);\n assertNull(thenBuilder.end.next);\n\n // Run and validate build()\n StepWorkflow<Integer> buildStepWorkflow = thenBuilder.build();\n assertEquals(thenBuilder.start, buildStepWorkflow.start);\n assertEquals(thenBuilder.end, buildStepWorkflow.end);\n\n // Call run() and validate return StepWorkflowResponse\n StepWorkflowResponse<Integer> response = buildStepWorkflow.run();\n assertTrue(response.wasSuccessful());\n assertEquals(DATA_THREE, response.getData());\n assertNull(response.getException());\n }", "private boolean allTrue(CompositeTrue predicate) {\n if (kids.isEmpty()) {\n return false;\n }\n\n Iterator<E> i = kids.iterator();\n while (i.hasNext()) {\n E future = i.next();\n if (!predicate.isTrue(future)) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testPredicateAlwaysFalse() {\n Predicate<Integer> predicate = Predicate.alwaysFalse();\n\n assertFalse(predicate.apply(10));\n assertFalse(predicate.apply(null));\n assertFalse(predicate.apply(0));\n }", "private boolean isAllTrue(HashMap<Integer, Boolean> messages)\r\n {\r\n // Iterate through each value for each key in the map.\r\n for(boolean value : messages.values())\r\n {\r\n // If a value is false, then return false.\r\n if(!value)\r\n {\r\n return false;\r\n }\r\n }\r\n // If all values are true, then return true.\r\n return true;\r\n }", "@Test\n public void testCaseIsPredicateBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(s -> true, () -> success.set(true));\n assertTrue(success.get());\n }", "public static UnaryExpression isFalse(Expression expression) { throw Extensions.todo(); }", "public static boolean areAllFalse(boolean[] array)\n {\n for(boolean b : array)\n if(b)\n return false;\n return true;\n }", "@Test\n\tpublic void testBooleanFalse() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query04.rq\", \"/tests/basic/query04.srx\", false);\n\t}", "private Predicate<Response> shouldErrorFailBuild(boolean skipFailures){\n return x -> skipFailures || x.isSuccessful();\n }", "public boolean checkBoolExpr(ArrayList<BoolExpr> exprs){\r\n\t\tif (exprs == null || exprs.isEmpty()) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tfor (BoolExpr expr : exprs) {\r\n\t\t\tboolean flag = false;\r\n\r\n\t\t\tString op = expr.getOp();\r\n\t\t\tint testValue = expr.getValue();\r\n\t\t\tint realValue = this.cvMap.getValue(expr.getCvName());\r\n\t\t\t\r\n\t\t\tif (op.equals(\">\") && realValue > testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\">=\") && realValue >= testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"<\") && realValue < testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"<=\") && realValue <= testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"==\") && realValue == testValue)\r\n\t\t\t\tflag = true;\r\n\t\t\telse if (op.equals(\"!=\") && realValue != testValue)\r\n\t\t\t\tflag = true;\r\n\r\n\t\t\tif (flag == false)// one false, all false\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@SuppressWarnings(\"unchecked\")\n @Test\n public void oneTruePredicate() {\n // use the constructor directly, as getInstance() returns the original predicate when passed\n // an array of size one.\n final Predicate<Integer> predicate = createMockPredicate(true);\n\n assertTrue(allPredicate(predicate).evaluate(getTestValue()), \"single true predicate evaluated to false\");\n }", "static boolean test(List<Condition> conditions) {\n for (Condition cond : conditions) {\n if (!cond.test()) {\n return false;\n }\n }\n return true;\n }", "@Test\n public void testOtherwise() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).otherwise(s -> success.set(true));\n\n assertTrue(success.get());\n }", "private boolean isAllIngredientOk(ArrayList<Boolean> listOfBool) {\n if (listOfBool.isEmpty() || listOfBool.contains(false))\n return false;\n return true;\n }", "public static void run(Runnable run, List<Boolean> bools) {\n if (bools.stream().allMatch(b -> b == true)) // Check if all booleans are true\n run.run(); // Ran if the above condition is met\n }", "Boolean conditionResult();", "@Test\n public void testOtherwise() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(\"foo\").otherwise(s -> success.set(true));\n\n assertTrue(success.get());\n }", "public static void main(String[] args) { , or , not\n // truth table -> t=1 f=0\n // a =t b= f c = a and b => a.b =0=>f\n\n // except 0 every no. is treated as true\n // int a=1 int b=2 a and b => a.b\n // and -> a=1 , b=2, a and b => a.b\n\n\n // and\n boolean a= false;\n boolean b= false;\n\n boolean c= a && b; // a.b\n System.out.println(c);\n\n //or\n boolean f= true;\n boolean d= true;\n\n boolean e= f || d; // a+b\n System.out.println(e);\n\n // not\n boolean g =true;\n boolean h= !g;\n System.out.println(h);\n\n }", "public boolean contradicts(Predicate p){\r\n\t\treturn (type.equals(p.type) && (id.equals(p.id)) && !(value.equals(p.value)));\r\n\t}", "boolean hasBool();", "boolean hasPossiblyBad();", "private Object eval(OrExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = false;\n for (AndExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result || (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (result) {\n return true;\n }\n }\n return false;\n }", "public static UnaryExpression isTrue(Expression expression) { throw Extensions.todo(); }", "protected boolean test(IRecipe recipe) {\n\t\tfor (Predicate<IRecipe> filter : filters) {\n\t\t\tif (!filter.test(recipe))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testAndConjunctionInvalidValidations() {\n final String anotherMessage = \"This is also invalid\";\n Validation<Pv> anotherInvalid = (pv) -> Result.failure(anotherMessage);\n\n Validation<Pv> conjunction = anotherInvalid.and(invalidResult);\n Result<Pv, String> result = conjunction.validate(new Pv());\n\n assertThat(result.isFailure(), is(true));\n assertThat(result.failure().get(), is(anotherMessage));\n }", "public static void main(String[] args) {\nboolean a, b, c;\na =true;\nb = false;\nc =a && b;\n\nSystem.out.println(\"c = a&&B:\" + c);\nc = a||b;\nSystem.out.println(\"c = a||b:\" + c);\nc = a==b;\nSystem.out.println(\"c = a==b:\" + c);\nc = a!=b;\nSystem.out.println(\"c = a!=b:\" + c);\n\n\n\n\t}", "@Test\n public void testAndConjunctionValidFollowedByInvalid() {\n Validation<Pv> conjunction = validResult.and(invalidResult);\n Result<Pv, String> result = conjunction.validate(new Pv());\n\n assertThat(result.isFailure(), is(true));\n assertThat(result.failure().get(), is(message));\n }", "@Test\n public void testCaseOfBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(true, s -> success.set(true));\n assertTrue(success.get());\n }", "public static void main(String ... aa)\n {\n \n boolean a1 = 3 == 4; // false ;because 3 is different than 4\n boolean a2 = 4 != 5 ; // true ; because 4 is different than 5\n boolean a3 = 4 < 3.2 ; // false ;because 4 is greater than 3.2\n \n\n /* Logical operators have as results boolean values , however the operands\n are boolean values as well */\n \n boolean a4 = !(4<3.2); // true ; (4<3.2) is false and !false is true\n boolean a5 = true & (3==4); // false; (3==4) is false and true & false is false\n boolean a6 = false | true ; // true \n boolean a7 = false ^ false ; // false\n \n /**************EXTRA CONCEPTS************/\n \n /* & is the and operator , | is the or operator , ^ is the xor operator\n ! is the negation operator , so these operators fulfill the rules of\n logic */\n \n /* Short-circuit logical operators are || and && , they act as the normal\n | and & ,however , if the first operand is enough to know the final result,\n the second operand will not be evaluated */\n \n boolean a8 = false && (3<4); // this is false , however (3<4) was not evaluated\n \n /* a compile error will appar if we try to use relational and logical operators with\n different types of operators */\n \n // boolean a9 = 3 < true; this will not compile \n \n }", "@Test\n public void testPredicateOr() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n Predicate<Integer> isDivSeven = (x) -> (x % 7) == 0;\n\n Predicate<Integer> evenOrDivSeven = isEven.or(isDivSeven);\n\n assertTrue(evenOrDivSeven.apply(14));\n assertTrue(evenOrDivSeven.apply(21));\n assertTrue(evenOrDivSeven.apply(8));\n assertFalse(evenOrDivSeven.apply(5));\n }", "public void checkCondition(Environment env, Context ctx, Vset vset,\n Hashtable exp, ConditionVars cvars) {\n // Find out when the left side is true/false\n left.checkCondition(env, ctx, vset, exp, cvars);\n left = convert(env, ctx, Type.tBoolean, left);\n Vset vsTrue = cvars.vsTrue.copy();\n Vset vsFalse = cvars.vsFalse.copy();\n\n // Only look at the right side if the left side is true\n right.checkCondition(env, ctx, vsTrue, exp, cvars);\n right = convert(env, ctx, Type.tBoolean, right);\n\n // cvars.vsTrue already reports when both returned true\n // cvars.vsFalse must be set to either the left or right side\n // returning false\n cvars.vsFalse = cvars.vsFalse.join(vsFalse);\n }", "@Test\n public void testAndConjunctionInvalidFollowedByValid() {\n Validation<Pv> conjunction = invalidResult.and(validResult);\n Result<Pv, String> result = conjunction.validate(new Pv());\n\n assertThat(result.isFailure(), is(true));\n assertThat(result.failure().get(), is(message));\n }", "public static boolean isAllFalse (String[] focusedState)\n {\n for(String s:focusedState) {\n boolean focused = Boolean.parseBoolean(s);\n if (focused)\n return false; //not all are false\n }\n return true; // all are false\n }", "@Test\n public void testCaseOfBooleanSupplier() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "@Test\n public void boolean_true_assert() throws Exception {\n check(\"boolean_true_assert.c\",\n ImmutableMap.of(\"cpa.stator.policy.generateOctagons\", \"true\",\n \"CompositeCPA.cpas\",\n \"cpa.location.LocationCPA, cpa.callstack.CallstackCPA, cpa.functionpointer.FunctionPointerCPA, cpa.loopstack.LoopstackCPA, cpa.value.ValueAnalysisCPA, cpa.policyiteration.PolicyCPA\",\n \"precision.trackIntAddVariables\", \"false\",\n \"precision.trackVariablesBesidesEqAddBool\", \"false\"));\n }", "public static boolean doTestsPass()\r\n {\r\n\r\n boolean result = true;\r\n result = result && FindMin(new int[]{3,4,5,6,1,2}) == 1;\r\n result = result && FindMin(new int[]{2,1}) == 1;\r\n result = result && FindMin(new int[]{1}) == 1;\r\n\r\n try {\r\n FindMin(null);\r\n result = false;\r\n }\r\n catch(Exception e)\r\n {\r\n result = result && true;\r\n }\r\n\r\n if(result)\r\n {\r\n System.out.println(\"All tests pass\\n\");\r\n }\r\n else\r\n {\r\n System.out.println(\"There are test failures\\n\");\r\n }\r\n return result;\r\n }", "@Test\n public void testCaseIsBool() {\n AtomicBoolean success = new AtomicBoolean(false);\n match(42L).caseIs(true, () -> success.set(true));\n assertTrue(success.get());\n }", "@Test\n\tprivate void checkPossibilityTest() {\n\t\tint[] input = new int[] {1,1,1};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {0,0,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {4,2,3};\n Assertions.assertThat(checkPossibility(input)).isTrue();\n\n input = new int[] {2,3,4,2,3};\n Assertions.assertThat(checkPossibility(input)).isFalse();\n\t}", "public boolean interestedCheck(boolean[] bitfield){\n List<Integer> ones = new ArrayList<>();\n for(int x=0; x<bitfield.length; x++){\n if(bitfield[x]){\n return true;\n }\n }\n\n if(ones.size() == 0){\n return false;\n }\n else{\n return true;\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tint num = 20;\n\t\t\n\t\tnum = 25; \n\t\t\n\t\t//\" == \" sign or comparison boolean kullanilir \n\t\t\n\t\tboolean isTrue = 5 + 2 == 7;\n\t\t\n\t\tboolean isFalse = 5 + 2 == 8;\n\t\t\n\t\tSystem.out.println(isTrue == isFalse); // this says True equals False. it doesnt so it gives False result \n\t\t\n\n\t\t\n\t\t//!= Not Equal Sing\n\t\t\n\t\t\n\t\tboolean isTrue1 = 5+2 != 8;\n\t\t\n\t\tboolean noteq = 5+2 != 23;\n\t\t\n\t\tSystem.out.println(isTrue1);\n\t\tSystem.out.println(noteq);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// \">\" , \">=\" , \"<\" , \"<=\" ==> All returns boolean\n\t\t\n\t\t// && and operator .... If you have at least one false result \n\t\t// || Or operation ... If you have just one true the result will be true \n\t\t\n\t\tSystem.out.println(5>8); //False\n\t\t\n\t\tSystem.out.println(8>11-5); // True \n\t\t\n\t\t\n\t\tboolean b1 = 5>2;\t // true \n\t\tboolean b2 = 5==2+3;\t// true \n\t\tboolean b3 = 5==2;\t // false\n\t\tboolean b4 = 5<2; \t\t//false\n\t\t\n\t\t\n\t\t\n\t\t// to get true && all variables must ben true \n\t\t\n\t\tSystem.out.println(b1 && b2); // both true so result rue \n\t\t\n\t\tSystem.out.println(b1 && b3); //false \n\t\t\n\t\tSystem.out.println(b3 && b4); // false \n\t\t\n\t\t\n\t\t// || Or \n\t\tSystem.out.println(b2 || b1); // true bec at least one of the variables is true \n\t\t\n\t\tSystem.out.println(b3 || b4); // false bec all everything is false \n\t\t\n\t\tSystem.out.println(b1 || b2 || b3 || b4); // True bec at least one variable is true \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\n\t}", "Boolean getPartiallyCorrect();", "private static void validateChainingMethods(SelfPredicate<String> one , SelfPredicate<String> two) {\n\t\n\tSystem.out.println(\"final result \"+one.not().test(\"jai shree ram\")); // true\n\t\n\tSystem.out.println(\"final result \"+one.not().test(\"20\")); // false\n\t\n\tSystem.out.println(\"final result \"+one.not().test(\"23\")); // flase\n\t\nSystem.out.println(\"final result \"+two.not().test(\"jai shree ram\")); // true\n\t\n\tSystem.out.println(\"final result \"+two.not().test(\"20\")); // true\n\t\n\tSystem.out.println(\"final result \"+two.not().test(\"23\")); // false\n\t\n}", "public final void rule__XBooleanLiteral__Alternatives_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \r\n try {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2976:1: ( ( 'false' ) | ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) ) )\r\n int alt28=2;\r\n int LA28_0 = input.LA(1);\r\n\r\n if ( (LA28_0==40) ) {\r\n alt28=1;\r\n }\r\n else if ( (LA28_0==132) ) {\r\n alt28=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 28, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt28) {\r\n case 1 :\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2977:1: ( 'false' )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2977:1: ( 'false' )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2978:1: 'false'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n match(input,40,FOLLOW_40_in_rule__XBooleanLiteral__Alternatives_16455); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2985:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n {\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2985:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2986:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2987:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n // ../de.nie.fin.ui/src-gen/de/nie/fin/ui/contentassist/antlr/internal/InternalFin.g:2987:2: rule__XBooleanLiteral__IsTrueAssignment_1_1\r\n {\r\n pushFollow(FOLLOW_rule__XBooleanLiteral__IsTrueAssignment_1_1_in_rule__XBooleanLiteral__Alternatives_16474);\r\n rule__XBooleanLiteral__IsTrueAssignment_1_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public boolean C_trueCond(ListOfParameterLists parameterLists) {\n if(debug)\n System.out.println(\"Condition: TRUE\");\n return true;\n }", "@RepeatedTest(20)\n void logicalOperatorsTest() {\n assertEquals(bi.or(bot), new Binary(\"1\"));\n assertEquals(bi.or(bof), bi);\n assertEquals(bi.and(bot), bi);\n assertEquals(bi.and(bof), new Binary(\"0\"));\n assertEquals(bot.or(bi), new Binary(\"1\"));\n assertEquals(bof.or(bi), bi);\n assertEquals(bot.and(bi), bi);\n assertEquals(bof.and(bi), new Binary(\"0\"));\n assertEquals(bot.and(bot), bot);\n assertEquals(bot.and(bof),bof);\n assertEquals(bof.and(bot),bof);\n assertEquals(bof.and(bof),bof);\n assertEquals(bot.or(bot), bot);\n assertEquals(bot.or(bof),bot);\n assertEquals(bof.or(bot),bot);\n assertEquals(bof.or(bof),bof);\n Binary b1 = new Binary(\"10001\");\n Binary b2 = new Binary(\"1001011\");\n assertEquals(b1.or(b2), new Binary(\"1111011\"));\n assertEquals(b1.and(b2), new Binary(\"1000001\"));\n assertEquals(b1.or(b2), b2.or(b1));\n assertEquals(b1.and(b2),b2.and(b1));\n assertEquals(bi.or(bi), bi);\n assertEquals(bi.and(bi),bi);\n Binary notbi = bi.neg();\n assertEquals(bi.or(notbi), new Binary(\"1\"));\n assertEquals(bi.and(notbi), new Binary(\"0\"));\n\n //nulls\n //Bool or ITypes \\ {Logicals}\n assertEquals(bot.or(st),Null);\n assertEquals(bof.or(st),Null);\n assertEquals(bot.or(f), Null);\n assertEquals(bof.or(i), Null);\n //Float or ITypes\n assertEquals(f.or(st), Null);\n assertEquals(f.or(bot), Null);\n assertEquals(f.or(bof), Null);\n assertEquals(f.or(i), Null);\n assertEquals(f.or(g), Null);\n assertEquals(f.or(bi), Null);\n //Int or ITypes\n assertEquals(i.or(st), Null);\n assertEquals(i.or(bot),Null);\n assertEquals(i.or(bof), Null);\n assertEquals(i.or(j), Null);\n assertEquals(i.or(f), Null);\n assertEquals(i.or(bi), Null);\n //Binary or ITypes \\ {Logicals}\n assertEquals(bi.or(st), Null);\n assertEquals(bi.or(f), Null);\n assertEquals(bi.or(i), Null);\n //NullType or ITypes\n assertEquals(Null.or(st), Null);\n assertEquals(Null.or(bof), Null);\n assertEquals(Null.or(f), Null);\n assertEquals(Null.or(i), Null);\n assertEquals(Null.or(bi), Null);\n assertEquals(Null.or(Null), Null);\n assertEquals(st.or(Null), Null);\n assertEquals(bot.or(Null), Null);\n assertEquals(f.or(Null), Null);\n assertEquals(i.or(Null), Null);\n assertEquals(bi.or(Null), Null);\n\n //Bool and ITypes \\ {Logicals}\n assertEquals(bot.and(st),Null);\n assertEquals(bof.and(st),Null);\n assertEquals(bot.and(f), Null);\n assertEquals(bof.and(i), Null);\n //Float and ITypes\n assertEquals(f.and(st), Null);\n assertEquals(f.and(bot), Null);\n assertEquals(f.and(bof), Null);\n assertEquals(f.and(i), Null);\n assertEquals(f.and(g), Null);\n assertEquals(f.and(bi), Null);\n //Int and ITypes\n assertEquals(i.and(st), Null);\n assertEquals(i.and(bot),Null);\n assertEquals(i.and(bof), Null);\n assertEquals(i.and(j), Null);\n assertEquals(i.and(f), Null);\n assertEquals(i.and(bi), Null);\n //Binary and ITypes \\ {Logicals}\n assertEquals(bi.and(st), Null);\n assertEquals(bi.and(f), Null);\n assertEquals(bi.and(i), Null);\n //NullType and ITypes\n assertEquals(Null.and(st), Null);\n assertEquals(Null.and(bof), Null);\n assertEquals(Null.and(f), Null);\n assertEquals(Null.and(i), Null);\n assertEquals(Null.and(bi), Null);\n assertEquals(Null.and(Null), Null);\n assertEquals(st.and(Null), Null);\n assertEquals(bot.and(Null), Null);\n assertEquals(f.and(Null), Null);\n assertEquals(i.and(Null), Null);\n assertEquals(bi.and(Null), Null);\n\n }", "public static boolean checkIfGameDone(){\nboolean a=checkDiagonal();\r\nboolean b=false;\r\nif(a==false)\r\n\t b = checkSides(0)||checkSides(1)||checkSides(2);\r\n\treturn a||b;\t\r\n}", "@Override\n\tpublic String visitBoolExpr(BoolExprContext ctx) {\n\t\tint childrenNo=ctx.children.size();\n\t\tif (childrenNo == 3 )\n\t\t{\n\t\t\tParseTree n=ctx.getChild(1);\t\t\t\n\t\t\tif (!(n instanceof TerminalNode)) return visit(n); //( boolExpr ) \n\t\t\telse if(n.equals(ctx.COMP())) {\n\t\t\t\tString firstOpType=visit(ctx.getChild(0)); //|arExpr COMP arExpr\n\t\t\t\tString secondOpType=visit(ctx.getChild(2)); \n\t\t\t\tif(!((firstOpType.equals(\"int\"))&&(secondOpType.equals(\"int\")))) throw new RuntimeException(\"you can only compare integer types\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}else if(n==ctx.EQ()){\t\t\t\t\t\t\t\t\t\t\t//|arExpr EQ arExpr\n\t\t\t\tString firstOpType=visit(ctx.getChild(0)); \n\t\t\t\tString secondOpType=visit(ctx.getChild(2)); \t\t\t\t\n\t\t\t\tif(!(((firstOpType.equals(\"int\"))&&(secondOpType.equals(\"int\")))||((firstOpType.equals(\"char\"))&&(secondOpType.equals(\"char\"))))) throw new RuntimeException(\"you can only use\"\n\t\t\t\t\t\t+ \"\\\"==\\\" operator on integer or character types\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}else if(n==ctx.AND()||n==ctx.OR()){ //|boolExpr (AND|OR)boolExpr\n\t\t\t\tString firstOpType=visit(ctx.getChild(0));\n\t\t\t\tString secondOpType=visit(ctx.getChild(2));\n\t\t\t\tif(!(firstOpType.equals(\"boolean\"))&&(secondOpType.equals(\"boolean\"))) throw new RuntimeException(\"you can only use boolean operators on boolean expressions\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}\n\t\t} else if (childrenNo == 2 ) { //|NOT boolExpr\n\t\t\tString exprType=visit(ctx.getChild(1));\n\t\t\tif (!exprType.equals(\"boolean\")) throw new RuntimeException(\"NOT operator works only with boolean expresssions\");\n\t\t\t\treturn \"boolean\";\n\t\t}else {\t\t\t\t\t\t\t\t//|(ID|property|BOOLEANLIT|arrIdExpr|methodCall)\n\t\t\tParseTree n=ctx.getChild(0);\n\t\t\tif (n instanceof TerminalNode) {\t\t\t\t\n\t\t\t\tif (n==ctx.BOOLEANLIT()) return \"boolean\";\n\t\t\t\telse if(n==ctx.ID()){\n\t\t\t\t\tString key=visitTerminal((TerminalNode)n);\n\t\t\t\t\tRecord id= table.lookup(key);\n\t\t\t\t\tif (id==null) throw new RuntimeException(\"Identifier \"+key+\" is not declared\");\t\t\t\t\t\n\t\t\t\t\treturn id.getReturnType();\n\t\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t}else {\n\t\t\t\tString type=visit(ctx.getChild(0));\n\t\t\t\treturn type;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn null; //for debug\n\t}", "@Test\n\tpublic void testBooleanTrueMultipleSource() throws Exception {\n\t\tprepareTest(Arrays.asList(\"/tests/basic/data01endpoint1.ttl\", \"/tests/basic/data01endpoint2.ttl\"));\n\t\texecute(\"/tests/basic/query03a.rq\", \"/tests/basic/query03.srx\", false);\n\t}", "public final void rule__XBooleanLiteral__Alternatives_1() throws RecognitionException {\r\n\r\n \t\tint stackSize = keepStackSize();\r\n \t\r\n try {\r\n // InternalDroneScript.g:3339:1: ( ( 'false' ) | ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) ) )\r\n int alt35=2;\r\n int LA35_0 = input.LA(1);\r\n\r\n if ( (LA35_0==50) ) {\r\n alt35=1;\r\n }\r\n else if ( (LA35_0==99) ) {\r\n alt35=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return ;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 35, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt35) {\r\n case 1 :\r\n // InternalDroneScript.g:3340:2: ( 'false' )\r\n {\r\n // InternalDroneScript.g:3340:2: ( 'false' )\r\n // InternalDroneScript.g:3341:3: 'false'\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n match(input,50,FOLLOW_2); if (state.failed) return ;\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n case 2 :\r\n // InternalDroneScript.g:3346:2: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n {\r\n // InternalDroneScript.g:3346:2: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\r\n // InternalDroneScript.g:3347:3: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n {\r\n if ( state.backtracking==0 ) {\r\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n // InternalDroneScript.g:3348:3: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\r\n // InternalDroneScript.g:3348:4: rule__XBooleanLiteral__IsTrueAssignment_1_1\r\n {\r\n pushFollow(FOLLOW_2);\r\n rule__XBooleanLiteral__IsTrueAssignment_1_1();\r\n\r\n state._fsp--;\r\n if (state.failed) return ;\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n finally {\r\n\r\n \trestoreStackSize(stackSize);\r\n\r\n }\r\n return ;\r\n }", "public static boolean doTestsPass() {\r\n // todo: implement more tests, please\r\n // feel free to make testing more elegant\r\n boolean testsPass = true;\r\n double result = power(2,-2);\r\n return testsPass && result==0.25;\r\n }", "private boolean CheckAllRequiredFields() {\n\t\tboolean res = true;\n\t\tres &= CheckParkSelection();\n\t\tres &= CheckDateSelection();\n\t\tres &= CheckVisitorHour();\n\t\tres &= CheckEmail();\n\t\tres &= CheckPhoneNumber();\n\t\treturn res;\n\t}", "private Object eval(AndExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = true;\n for (RelExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result && (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (!result) {\n return false;\n }\n }\n return true;\n }", "boolean check(Env env) {\n boolean leftOK = leftOperand.check (env);\n boolean rightOK = rightOperand.check (env);\n return leftOK && rightOK;\n }", "public static void main(String[] args) {\n\n int x =55; //fales || false || true --->>true\n System.out.println( x==50 || x==51 || x==55 );\n\n //check\n //x is more than 50 and\n // x is not 52 or\n // x equal to 57\n // == is checking for equality != is checking for inequality\n //true && true\n // true || false ---->>>>true\n System.out.println( x > 50 && x != 52 || x==57);\n\n System.out.println(false || true && false);\n\n\n\n\n\n\n }", "@Test\n public void testCaseOfBooleanSupplier() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseOf(() -> true, s -> success.set(true));\n assertTrue(success.get());\n }", "@Test\n public void testPredicateAnd() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n Predicate<Integer> isDivSeven = (x) -> (x % 7) == 0;\n\n Predicate<Integer> evenOrDivSeven = isEven.and(isDivSeven);\n\n assertTrue(evenOrDivSeven.apply(14));\n assertFalse(evenOrDivSeven.apply(21));\n assertFalse(evenOrDivSeven.apply(8));\n assertFalse(evenOrDivSeven.apply(5));\n }", "static boolean test(List<Condition> conditions) {\n return true; // REPLACE WITH SOLUTION \n }", "boolean hasBoolValue();", "@Test @Ignore\n public void testUfWithBoolArg() throws SolverException, InterruptedException {\n\n UninterpretedFunctionDeclaration<IntegerFormula> uf = fmgr.declareUninterpretedFunction(\"fun_bi\", FormulaType.IntegerType, FormulaType.BooleanType);\n IntegerFormula ufTrue = fmgr.callUninterpretedFunction(uf, ImmutableList.of(bmgr.makeBoolean(true)));\n IntegerFormula ufFalse = fmgr.callUninterpretedFunction(uf, ImmutableList.of(bmgr.makeBoolean(false)));\n\n BooleanFormula f = bmgr.not(imgr.equal(ufTrue, ufFalse));\n assertThat(f.toString()).isEmpty();\n assert_().about(BooleanFormula()).that(f).isSatisfiable();\n }", "public final void rule__XBooleanLiteral__Alternatives_1() throws RecognitionException {\n\n \t\tint stackSize = keepStackSize();\n \n try {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2354:1: ( ( 'false' ) | ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) ) )\n int alt20=2;\n int LA20_0 = input.LA(1);\n\n if ( (LA20_0==32) ) {\n alt20=1;\n }\n else if ( (LA20_0==69) ) {\n alt20=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return ;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 20, 0, input);\n\n throw nvae;\n }\n switch (alt20) {\n case 1 :\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2355:1: ( 'false' )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2355:1: ( 'false' )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2356:1: 'false'\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \n }\n match(input,32,FOLLOW_32_in_rule__XBooleanLiteral__Alternatives_15079); if (state.failed) return ;\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXBooleanLiteralAccess().getFalseKeyword_1_0()); \n }\n\n }\n\n\n }\n break;\n case 2 :\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2363:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\n {\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2363:6: ( ( rule__XBooleanLiteral__IsTrueAssignment_1_1 ) )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2364:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\n {\n if ( state.backtracking==0 ) {\n before(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \n }\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2365:1: ( rule__XBooleanLiteral__IsTrueAssignment_1_1 )\n // ../org.xtext.lwc.instances.ui/src-gen/org/xtext/lwc/instances/ui/contentassist/antlr/internal/InternalInstances.g:2365:2: rule__XBooleanLiteral__IsTrueAssignment_1_1\n {\n pushFollow(FOLLOW_rule__XBooleanLiteral__IsTrueAssignment_1_1_in_rule__XBooleanLiteral__Alternatives_15098);\n rule__XBooleanLiteral__IsTrueAssignment_1_1();\n\n state._fsp--;\n if (state.failed) return ;\n\n }\n\n if ( state.backtracking==0 ) {\n after(grammarAccess.getXBooleanLiteralAccess().getIsTrueAssignment_1_1()); \n }\n\n }\n\n\n }\n break;\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 }", "private boolean predicateCheck(Game game) {\n boolean showOnTextFilter;\n if (txtFilter.getText().isEmpty()) {\n showOnTextFilter = true;\n } else {\n showOnTextFilter = game.getName().toLowerCase().contains(txtFilter.getText().toLowerCase());\n }\n\n boolean showOnCheckBoxFilter;\n if (!cbFilterNonAchievement.isSelected()) {\n showOnCheckBoxFilter = true;\n } else {\n showOnCheckBoxFilter = game.getHasStats();\n }\n\n return showOnTextFilter && showOnCheckBoxFilter;\n }", "public static UnaryExpression isFalse(Expression expression, Method method) { throw Extensions.todo(); }", "@Test\n public void testCaseOfBool() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseOf(true, s -> success.set(true));\n assertTrue(success.get());\n }", "public boolean isExceptionRule(ArrayList<AttributeValue> others) {\r\n if (getPremises().size() <= others.size()) {\r\n return false;\r\n }\r\n\r\n boolean[] contains = new boolean[others.size()];\r\n for (int i = 0; i < contains.length; i++) {\r\n contains[i] = false;\r\n }\r\n\r\n for (int i = 0; i < others.size(); i++) {\r\n for (AttributeValue premise : getPremises()) {\r\n if (others.get(i).toString().equals(premise.toString())) {\r\n contains[i] = true;\r\n }\r\n }\r\n }\r\n\r\n for (int i = 0; i < contains.length; i++) {\r\n if (!contains[i]) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "@Test\n public void testPredicateNot() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n\n assertTrue(isEven.apply(10));\n assertFalse(isEven.not().apply(10));\n }", "@Override\n\tpublic boolean isCovered() {\n\t\treturn (falseCount > 0) && (trueCount > 0);\n\t}", "public final boolean\n isOutcomeFailed() { return hasOutcome_ && outcome_ == false; }", "private boolean checkTrainingCondition(){\n //if one sample validation was negative, so trainingCondition will be false.\n for(Sample s: samples){\n if(!s.getValidation())\n return false;\n }\n return true;\n }", "@FunctionalInterface\n/* */ public interface DoublePredicate\n/* */ {\n/* */ default DoublePredicate and(DoublePredicate paramDoublePredicate) {\n/* 69 */ Objects.requireNonNull(paramDoublePredicate);\n/* 70 */ return paramDouble -> (test(paramDouble) && paramDoublePredicate.test(paramDouble));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default DoublePredicate negate() {\n/* 81 */ return paramDouble -> !test(paramDouble);\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ default DoublePredicate or(DoublePredicate paramDoublePredicate) {\n/* 101 */ Objects.requireNonNull(paramDoublePredicate);\n/* 102 */ return paramDouble -> (test(paramDouble) || paramDoublePredicate.test(paramDouble));\n/* */ }\n/* */ \n/* */ boolean test(double paramDouble);\n/* */ }", "@Test\n public void testAndConjunctionValidValidations() {\n Validation<Pv> conjunction = validResult.and(validResult);\n Result<Pv, String> result = conjunction.validate(new Pv());\n\n assertThat(result.isSuccess(), is(true));\n assertThat(result.success().get(), is(successPv));\n }", "@Override\n public Node typeCheck() {\n if (!(FOOLlib.isSubtype(left.typeCheck(), new BoolTypeNode()) &&\n FOOLlib.isSubtype(right.typeCheck(), new BoolTypeNode()))) {\n if(operator.equals(\"and\") || operator.equals(\"&&\")) {\n System.out.println(\"Non boolean in AND\");\n }\n else {\n System.out.println(\"Non boolean in OR\");\n }\n System.exit(0);\n }\n //se i tipi sono corretti restituisco bool\n return new BoolTypeNode();\n }", "@Test\n public void testPredicateAlwaysTrue() {\n Predicate<Integer> predicate = Predicate.alwaysTrue();\n\n assertTrue(predicate.apply(10));\n assertTrue(predicate.apply(null));\n assertTrue(predicate.apply(0));\n }", "private boolean canMatchConditions(Puzzle puzzle) {\n //this method is responsible for check some conditions and decide that the current case is solution or not.\n for (Condition condition : CONDITIONS) {\n if (!condition.isMatchCondition(puzzle)) {\n return false;\n }\n }\n return true;\n }", "public void testX1andX2orNotX1() {\n \tCircuit circuit = new Circuit();\n \t\n \tBoolean b1 = Boolean.TRUE;\n \tBoolean b2 = Boolean.FALSE;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tOr or = (Or) circuit.getFactory().getGate(Gate.OR);\n\t\tand.setLeftInput(b1);\n\t\tand.setRightInput(b2);\n\t\tand.eval();\n\t\tnot.setInput(b1);\n\t\tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n\t\tassertEquals(Boolean.FALSE, or.eval());\n\t\tassertEquals(Boolean.FALSE, circuit.eval());\n//\t\t==========================================\n\t\tb1 = Boolean.FALSE;\n \tb2 = Boolean.TRUE;\n// \tand.eval();\n// \tnot.eval();\n \tassertEquals(Boolean.FALSE, circuit.eval());\n// \t============================================\n \tDouble d1 = 0.0;\n \tDouble d2 = 1.0;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n\t\tnot.setInput(d1);\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(1.0), or.eval());\n// \t============================================\n \td1 = 0.5;\n \td2 = 0.5;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n// \t============================================\n \ttry {\n \td1 = 0.5;\n \td2 = 2.0;\n \tand.setLeftInput(d1);\n \t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n \t\tor.setLeftInput(and.getOutput());\n \t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n \t} catch (IllegalArgumentException e) {\n \t\tSystem.err.println(\"IllegalArgumentException: \" + e.getMessage());\n \t}\n\n }", "@Test\n public void testCaseIsBool() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseIs(true, () -> success.set(true));\n assertTrue(success.get());\n }", "public final boolean\n isOutcomeSuccess() { return hasOutcome_ && outcome_ == true; }", "@Test\n\tpublic void testNotAMatchOfAnyKind() {\n\t\tassertFalse(s4.equals(s3));\n\t\tassertFalse(streetAddresses.contains(s4));\n\t\tassertFalse(streetAddresses.stream().anyMatch(s -> comparator.compare(s4, s) == 0));\n\t}", "boolean hasPass();", "boolean hasPass();", "@Test\n public void testCaseIsInputEqualsMatchPredicateBool() {\n String o = \"\";\n AtomicBoolean success = new AtomicBoolean(false);\n match(o).caseIs(s -> s == o, () -> success.set(true));\n assertTrue(success.get());\n }", "public final F<S, Boolean> all(final F<A, Boolean> p) {\n return foldMap(Monoid.conjunctionMonoid, p);\n }", "public boolean hasPassed()\n {\n return status == Status.PASSED || status == Status.SKIPPED;\n }", "public TestCase assertFalse( boolean passIfFalse);", "public static boolean fullSheep(boolean [] arr) {\n\t\tfor (int i = 0; i < arr.length; i ++) {\n\t\t\tif (arr[i] == false) \n\t\t\t\treturn false; \n\t\t}\n\t\treturn true;\n\t}", "public static boolean MarklogicBooleanNodeTest(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"MarklogicBooleanNodeTest\")) return false;\n if (!nextTokenIs(b, K_BOOLEAN_NODE)) return false;\n boolean r, p;\n Marker m = enter_section_(b, l, _NONE_, MARKLOGIC_BOOLEAN_NODE_TEST, null);\n r = consumeTokens(b, 2, K_BOOLEAN_NODE, L_PAR);\n p = r; // pin = 2\n r = r && report_error_(b, MarklogicBooleanNodeTest_2(b, l + 1));\n r = p && consumeToken(b, R_PAR) && r;\n exit_section_(b, l, m, r, p, null);\n return r || p;\n }", "String getBooleanFalseExpression();", "boolean arrCompleted(Boolean[] boolarray) {\n for (int i=0; i < boolarray.length; i++) {\n if (boolarray[i] == false) {\n return false;\n }\n }\n return true;\n }", "BooleanExpression createBooleanExpression();", "BooleanExpression createBooleanExpression();", "boolean booleanOf();" ]
[ "0.717221", "0.66255754", "0.640839", "0.6343776", "0.63394934", "0.63388395", "0.628853", "0.61839086", "0.61488914", "0.61100906", "0.607447", "0.6072688", "0.6040951", "0.6039815", "0.6024284", "0.59820294", "0.5970555", "0.5887005", "0.58714855", "0.58480084", "0.57768697", "0.57642084", "0.57522196", "0.57221884", "0.57196444", "0.5692806", "0.56800044", "0.5667874", "0.56557953", "0.56167716", "0.5598935", "0.55988586", "0.5591632", "0.5587091", "0.55577224", "0.5542598", "0.55111283", "0.54983586", "0.549297", "0.5468958", "0.546798", "0.54630554", "0.5440675", "0.54311746", "0.54260564", "0.5419264", "0.54086494", "0.53957653", "0.5387117", "0.5383381", "0.53799576", "0.5379276", "0.5363821", "0.5361479", "0.535831", "0.5357445", "0.5340947", "0.533353", "0.5325437", "0.5324385", "0.53225386", "0.5321486", "0.5320993", "0.53166366", "0.5313095", "0.5312868", "0.5302588", "0.52881104", "0.52768636", "0.52750593", "0.5250246", "0.52487326", "0.5246618", "0.5241844", "0.5240717", "0.52225566", "0.52174604", "0.5208354", "0.5205412", "0.51987326", "0.5198251", "0.51968884", "0.51904863", "0.5185362", "0.5180901", "0.5176683", "0.5169522", "0.5168125", "0.5168125", "0.5165246", "0.5152621", "0.5149265", "0.51472783", "0.51460725", "0.51439327", "0.51404727", "0.5138396", "0.51347977", "0.51347977", "0.5132432" ]
0.7671863
0
Abstrakte Methoden koennen von den Kindern ueberschrieben werden, muessen aber nicht! jede Pizza hat versch. Zutaten, muss also selber wissen welche um welche Zutaten es geht, verwaltet jedes Kind dann selber in dem "zutaten" Attribut, deshalb kann die Methode selbest hier zentral gefuehrt werden! getZutaten ist von der Syntax her in jeder Kindklasse genau gleich!
public String[] getZutaten() { return zutaten; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract String dohvatiKontakt();", "public Farbe letztesKamel();", "public Order getOrderZonderKorting() {\n return orderZonderKorting;\n }", "public final zzgol<zzgop<?>> zzn() {\n zzr();\n return this.zzae;\n }", "@Override\n\tpublic String dohvatiKontakt() {\n\t\treturn \"Naziv tvrtke: \" + naziv + \", mail: \" + getEmail() + \", tel: \" + getTelefon() + \", web: \" + web;\n\t}", "public String getZt() {\n return zt;\n }", "@Override\r\n\tpublic void zjedz(Kost k) {\n\t}", "protected abstract String getZ();", "public abstract void zza(zzk zzk, zzk zzk2);", "String getVorlesungKennung();", "public void test6(){\r\n\t\tZug zug1 = st.zugErstellen(2, 0, \"Zug 1\");\r\n\t\tZug zug2 = st.zugErstellen(2, 0, \"Zug 2\");\r\n\t\tst.fahren();\r\n\t}", "public void wuerfeln() {\n if (istGefängnis) {\n setIstGefängnis(false);\n if (aktuellesFeldName instanceof GefängnisFeld && !(aktuellesFeldName instanceof NurZuBesuchFeld)) {\n GefängnisFeld g = (GefängnisFeld) aktuellesFeldName;\n g.gefaengnisAktion(this);\n \n return;\n }\n\n } else {\n String[] worte = {\"Eins\", \"Zwei\", \"Drei\", \"Vier\", \"Fünf\", \"Sechs\", \"Sieben\", \"Acht\", \"Neun\", \"Zehn\", \"Elf\", \"Zwölf\"};\n\n wuerfelZahl = getRandomInteger(12, 1);\n\n this.aktuellesFeld = this.aktuellesFeld + wuerfelZahl + 1;\n if (this.aktuellesFeld >= 40) {\n setAktuellesFeld(0);\n\n }\n\n System.out.println(worte[wuerfelZahl] + \" gewürfelt\");\n\n aktuellesFeldName = spielfigurSetzen(this.aktuellesFeld);\n System.out.println(\"Du befindest dich auf Feld-Nr: \" + (this.aktuellesFeld));\n boolean check = false;\n for (Spielfelder s : felderInBesitz) {\n if (aktuellesFeldName.equals(s)) {\n check = true;\n }\n }\n\n if (!check) {\n aktuellesFeldName.spielfeldAktion(this, aktuellesFeldName);\n } else {\n System.out.println(\"Das Feld: \" + aktuellesFeldName.getFeldname() + \"(Nr: \" + aktuellesFeldName.getFeldnummer() + \")gehört dir!\");\n if (aktuellesFeldName instanceof Straße) {\n Straße strasse = (Straße) aktuellesFeldName;\n System.out.println(\"Farbe: \" + strasse.getFarbe());\n try {\n strasse.hausBauen(this, strasse);\n } catch (IOException ex) {\n Logger.getLogger(Spieler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n\n }\n }\n }", "public void test5(){\r\n\t\tZug zug1 = st.zugErstellen(1, 0, \"Zug 1\");\r\n\t\tZug zug2 = st.zugErstellen(0, 3, \"Zug 2\"); \r\n\t}", "public void test2(){\r\n\t\tZug zug1 = st.zugErstellen(2, 2, \"Zug 1\");\r\n\t\tst.fahren();\r\n\t}", "public final zzgol<Class<?>> zzm() {\n zzr();\n return this.zzad;\n }", "public String getZt() {\n\t\treturn zt;\n\t}", "private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}", "public Kunde kundenAnlegen()\n {\n Kunde kunde = Kunde.kundeAnlegen(); //TODO static\n return kundenListe.put(kunde.getKundenNummer(), kunde);\n }", "@Override\n\tpublic String getZona() {\n\t\treturn model.getZona();\n\t}", "public void sendeZug(String zug);", "@Override // Métodos que fazem a anulação\n\tpublic void getBonificação() {\n\t\t\n\t}", "public final zzgol<Object> zzo() {\n zzr();\n return this.zzaf;\n }", "public Farbe fuehrendesKamel();", "@Override\n public String getDeskripsi() {\n return deskripsi;\n }", "@Override\n public String getDeskripsi() {\n return deskripsi;\n }", "public void trenneVerbindung();", "public Input getLetzteZahlung() throws RemoteException\n\t{\n\t\tif (letzteZahlung != null)\n\t\t\treturn letzteZahlung;\n\n\t\tSepaDauerauftrag t = getTransfer();\n Date d = t.getLetzteZahlung();\n\n letzteZahlung = new DateInput(d,HBCI.DATEFORMAT);\n letzteZahlung.setComment(\"\");\n letzteZahlung.setTitle(i18n.tr(\"Datum der letzten Zahlung\"));\n letzteZahlung.setText(i18n.tr(\"Bitte geben Sie das Datum der letzten Zahlung ein\"));\n letzteZahlung.addListener(new Listener() {\n public void handleEvent(Event event)\n {\n // Nur, um den Parser zu triggern\n letzteZahlung.getValue();\n }\n \n });\n\n if (t.isActive())\n letzteZahlung.setEnabled(getBPD().getBoolean(\"lastexeceditable\",true));\n \n return letzteZahlung;\n\t}", "public String ausgebenBestandsListe(){\n final String nr = \"ArtNr\";\n final String desc = \"Beschreibung\";\n final String preis = \"Preis\";\n final String bestand = \"Bestand\";\n final String total = \"Gesamt\";\n final String type = \"Typ\";\n final String gesamtwert = \"Gesamtwert:\";\n\n StringBuilder sb = new StringBuilder();\n sb.append(\"\\nLagerort: Alt-Saarbrücken\\n\\n\");\n sb.append(String.format(\"%-8s\", nr))\n .append(String.format(\"%-32s\", desc))\n .append(String.format(\"%-8s\", preis))\n .append(String.format(\"%-8s\", bestand))\n .append(String.format(\"%-10s\", total))\n .append(type + \"\\n\")\n .append(\"-------------------------------------------------------------------------------------------------------\\n\");\n for (int i = 0; i < key; i++){\n Artikel artikel = getArtikel(i);\n sb.append(String.format(\"%-8d\", artikel.getArtikelNr()));\n if(getArtikel(i).getClass().getSimpleName().equals(\"Artikel\")) {\n sb.append(String.format(\"%-32s\", artikel.getBezeichnung()));\n }else{\n sb.append(String.format(\"%-32s\", artikel.getBeschreibung()));\n }\n sb.append(String.format(\"%-8.2f\", artikel.getPreis()))\n .append(String.format(\"%-8d\", artikel.getBestand()))\n .append(String.format(\"%-10.2f\", artikel.getGesamt()))\n .append(artikel.getClass().getSimpleName()).append(\"\\n\");\n }\n sb.append(\"\\n-------------------------------------------------------------------------------------------------------\")\n .append(String.format(\"\\n%-56s\", gesamtwert)).append(getGesamtwert());\n return sb.toString();\n }", "private String nalozZvieraNaVozidlo() {\r\n if (zoo.getPracovneVozidlo() == null) {\r\n return \"Pracovne vozidlo nie je pristavene\";\r\n }\r\n\r\n Integer pozicia = MojeMetody.vlozInt(\"Vloz cislo zvierata\");\r\n if (pozicia == null) return \"\";\r\n\r\n try {\r\n Prepravitelny z = (Prepravitelny) zoo.getZvierataZOO(pozicia - 1);\r\n zoo.nalozZivocicha(z);\r\n zoo.odstranZivocicha(pozicia - 1);\r\n return \"Zviera \" + z + \"\\n\\tbolo nalozene na prepravne vozidlo\";\r\n } catch (ClassCastException exCC) {\r\n return \"Zviera c. \" + pozicia + \" nemozno prepravit\\n\\t\";\r\n } catch (NullPointerException exNP) {\r\n return \"Zviera c. \" + pozicia + \" nie je v ZOO\";\r\n } catch (Exception ex) {\r\n return \"Neznama chyba:\\n\\t\" + ex;\r\n }\r\n }", "public void klikkaa(Tavarat tavarat, Klikattava klikattava);", "@Override\n public String toString() {\n return String.format(\"Pizza %s, prezzo %f€\", this.gusto, this.prezzo);\n }", "private zza.zza()\n\t\t{\n\t\t}", "@Override // prekrytie danej metody predka\r\n public String toString() {\r\n return super.toString()\r\n + \" vaha: \" + String.format(\"%.1f kg,\", dajVahu())\r\n + \" farba: \" + dajFarbu() + \".\";\r\n }", "Debut getDebut();", "public int getZgrada() {\n return zgrada;\n }", "public int getZahl()//Der Wert von Zahl wird zurueckgegeben\n {\n return zahl;\n }", "void zmniejszBieg();", "public double getVerdienst()\n {\n return gehalt;\n }", "zzebg(zzebe zzebe, Class cls) {\n super(cls);\n this.zzhzx = zzebe;\n }", "public Zutaten(final long menge, final String zutat) {\n this.menge = menge;\n this.zutat = zutat;\n }", "public Fahrzeug erzeuge() {\n\t\t\n\t\treturn new DieselAuto();\n\t\t\n\t}", "@Override\n\tpublic List zhye(String name) {\n\t\treturn deal.zhye(name);\n\t}", "public Dete(String ime, String prezime, int god, int klikeri) { //kontruktor 1 \r\n\r\n\t\tthis.ime = ime;\r\n\t\tthis.prezime = prezime;\r\n\t\tthis.god = god;\r\n\t\tthis.klikeri = klikeri;\r\n\t}", "public final Field zze() {\n int i = this.zzaa << 1;\n Object obj = this.zzb[i];\n if (obj instanceof Field) {\n return (Field) obj;\n }\n Field zza2 = zza(this.zzc, (String) obj);\n this.zzb[i] = zza2;\n return zza2;\n }", "@Override\n\tpublic List zd() {\n\t\treturn deal.zd();\n\t}", "public void mieteZahlen(BesitzrechtFeld feld) {\n System.out.println(\"Dein aktueller Kontostand beträgt: \" + getKontostand());\n Spieler spieler = feld.getSpieler();\n boolean einzahlen = einzahlen(feld.getMiete());\n if (!einzahlen) {\n MonopolyMap.spielerVerloren(spielfigur);\n } else {\n System.out.println(\"Du musst an \" + feld.getSpieler().getSpielfigur() + \" Miete in Höhe von \" + feld.getMiete() + \" zahlen (\" + feld.getFeldname() + \")\");\n spieler.auszahlen(feld.getMiete());\n System.out.println(\"Dein neuer Kontostand beträgt: \" + getKontostand());\n }\n\n }", "public Vector<MakhlukHidup> get_daftar();", "TipeLayanan(String deskripsi)\r\n {\r\n this.deskripsi = deskripsi;\r\n }", "public final String zza() {\n return this.description;\n }", "public Pojazd dostepDoPojazdu()\n\t{\n\t\treturn pojazd;\n\t}", "public String getZahlart() {\n\t\treturn this.zahlart;\n\t}", "public void test1(){\r\n\t\tZug zug1 = st.zugErstellen(3, 2, \"Zug 1\");\r\n\t\tst.blockFahren();\r\n\t\tst.blockFahren();\r\n\t\tZug zug2 = st.zugErstellen(2, 3, \"Zug 2\");\r\n\t\tg.textAusgeben(\"Position Zug1: \"+zug1.getPosition()+\"\\n\"+\"Position Zug2: \"+zug2.getPosition());\r\n\t\tst.fahren();\r\n\t}", "public void MieiOrdini()\r\n {\r\n getOrdini();\r\n\r\n }", "public AutomatZustand()\r\n\t{\r\n\t\tthis.ew_lokal = Automat.eingabewort;\r\n\t}", "@Override\r\n\tpublic String getIzena() {\n\t\treturn super.getIzena();\r\n\t}", "@Override\n\tpublic int getDikte() {\n\t\treturn this.dikttte;\n\t}", "public String getz()\n\t{\n\t\treturn z.getText();\n\t}", "@Test\r\n public void testGetterMethodSucess() throws Exception {\r\n Method m = GetterMethod.getGetter(Tumor.class, \"tumorId\");\r\n assertNotNull(m);\r\n assertEquals(\"getTumorId\", m.getName());\r\n }", "public RuimteFiguur() {\n kleur = \"zwart\";\n }", "public Parentezco getParentezco()\r\n/* 153: */ {\r\n/* 154:280 */ return this.parentezco;\r\n/* 155: */ }", "public Input getErsteZahlung() throws RemoteException\n\t{\n\t\tif (ersteZahlung != null)\n\t\t\treturn ersteZahlung;\n \n final SepaDauerauftrag t = getTransfer();\n Date d = t.getErsteZahlung();\n if (d == null)\n {\n d = new Date();\n t.setErsteZahlung(d);\n }\n\n ersteZahlung = new DateInput(d);\n ersteZahlung.setComment(\"\");\n\t\tersteZahlung.setTitle(i18n.tr(\"Datum der ersten Zahlung\"));\n ersteZahlung.setText(i18n.tr(\"Bitte geben Sie das Datum der ersten Zahlung ein\"));\n ersteZahlung.setMandatory(true);\n ersteZahlung.addListener(this.nextDate);\n \n if (t.isActive())\n ersteZahlung.setEnabled(getBPD().getBoolean(\"firstexeceditable\",true));\n \n this.nextDate.handleEvent(null); // einmal ausloesen fuer initialen Text\n\t\treturn ersteZahlung;\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"Anfangsdatum: \" + this.get_Datum() \n\t\t\t\t+ \", Thema: \" + this.get_thema() \n\t\t\t\t+ \", Art: Theoriestunde\";\n\t}", "public final zzgv<String> zzd() {\n String[] strArr = this.types;\n if (strArr != null) {\n return zzgv.zza((E[]) strArr);\n }\n return null;\n }", "@Override//sobrescribir metodo\n public String getDescripcion(){\n return hamburguesa.getDescripcion()+\" + lechuga\";//retorna descripcion del oobj hamburguesa y le agrega +lechuga\n }", "public void setZt(String zt) {\n\t\tthis.zt = zt;\n\t}", "public Pizza orderPizza(String type) {\n //hier wird Factory methode aufgerufen/ Code ändert sich öfters\n Pizza pizza = createPizza(type);\n\n if (pizza != null){\n System.out.printf(\"Making a \" + pizza.getName() + \"---------\");\n pizza.prepare();\n pizza.bake();\n pizza.cut();\n pizza.box();\n }\n\n return pizza;\n }", "public MaschinenVerwaltung() {\r\n setMaschinenListe();\r\n setEinKopfMaschinenListe();\r\n setZweiBisAchtKopfMaschine();\r\n setZehnUndMehrKopfMaschine();\r\n }", "void order() {\n\n\t\tSystem.out.println(\"In Zomato order method\");\n\t\tclass Hotels {\n\t\t\tString name;\n\t\t\tHotels(String name ) {\n\t\t\t\tthis.name = name;\n\t\t\t}\n\n\t\t\tvoid orderPlaced() {\n\t\t\t\tSystem.out.println(\"Order placd at hotel \"+ name);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void verkaufen() {\n\t}", "public MessageType zzu() {\n if (this.zzb) {\n return this.zza;\n }\n MessageType messagetype = this.zza;\n zzjy.zza().zza((zzjy) messagetype).zzc(messagetype);\n this.zzb = true;\n return this.zza;\n }", "Restaurant getRestaurant();", "public void zeichnen_kavalier() {\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /**\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /**Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2] || (A[2]==B[2] && C[2]==D[2])) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n /** Transformiert x,y,z Koordinaten zu x,y Koordinaten */\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax = (A[0] + (A[2] / 2));\n ay = (A[1] + (A[2] / 2));\n bx = (B[0] + (B[2] / 2));\n by = (B[1] + (B[2] / 2));\n cx = (C[0] + (C[2] / 2));\n cy = (C[1] + (C[2] / 2));\n dx = (D[0] + (D[2] / 2));\n dy = (D[1] + (D[2] / 2));\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "zzkf(zzkc zzkc, zzgz zzgz) {\n super(zzgz);\n this.zza = zzkc;\n }", "@ReflectiveMethod(name = \"z\", types = {})\n public String z(){\n return (String) NMSWrapper.getInstance().exec(nmsObject);\n }", "@Override\r\n\tpublic String getDesc() {\n\t\treturn pizza.getDesc()+\" , RomaTomatoes(12.88)\";\r\n\t}", "public abstract AddressComponent zza();", "private Zivocich vytvorZivocicha() {\r\n final String[] zFarba = {\"cervena\", \"zelena\", \"modra\", \"zlta\", \"zlto-zelena\"};\r\n Zivocich zviera = null;\r\n double kolkoVazi = 0.0;\r\n\r\n //-- Vygenerujeme zviera\r\n int vygenerovane = 1 + generator.nextInt(4); //cislo <1,4>\r\n\r\n switch (vygenerovane) {\r\n case 1: //blcha \r\n double kolkoDoskoci=3 * generator.nextDouble() ; //cislo <0;2.99>\r\n double kolkoVyskoci=3 * generator.nextDouble() ; //cislo <0;2.99>\r\n zviera=new Blcha(6,kolkoDoskoci,kolkoVyskoci);\r\n break;\r\n case 2: //simpanz\r\n kolkoVazi=3 + (97 * generator.nextDouble()); //cislo <3;99.9>\r\n boolean cviceny;\r\n cviceny=generator.nextBoolean(); \r\n zviera=new Simpanz(kolkoVazi,cviceny);\r\n break;\r\n case 3: //papagaj\r\n kolkoVazi = 0.1 + (5*generator.nextDouble()); // cislo <0.1; 6>\r\n String farba = zFarba[generator.nextInt(5)]; // farba zo zoznamu\r\n zviera = new Papagaj(\"Ara\", 2, kolkoVazi, farba); \r\n break;\r\n case 4: //slon\r\n kolkoVazi=20 + (480*generator.nextDouble()); //cislo <20;500> \r\n int pocet=generator.nextInt(50); //pocet zubov bude <0,49>\r\n zviera=new Slon(kolkoVazi,pocet);\r\n break;\r\n } //------------------------------------------------------------- switch --\r\n return zviera;\r\n }", "public Artikel erstelleArtikel(String bezeichnung, int bestand, double preis, int packungsgroesse, Person p) throws AccessRestrictedException, InvalidAmountException{\r\n\t\tif(istMitarbeiter(p)){\r\n\t\t\tArtikel art = av.erstelleArtikel(bezeichnung, bestand, preis, packungsgroesse);\r\n\t\t\t//Ereignis erzeugen\r\n\t\t\tev.ereignisErstellen(p, Typ.NEU, art, bestand);\r\n\t\t\treturn art;\r\n\t\t} else {\r\n\t\t\tthrow new AccessRestrictedException(p, \"\\\"Artikel anlegen\\\"\");\r\n\t\t}\r\n\t}", "public String getGeslacht(){\n if(geslacht == \"man\" || geslacht == \"vrouw\"){\n return geslacht;\n }\n else {\n return \"onbekent\";\n }\n }", "private String getDuzMetinSozlukForm(Kok kok) {\n String icerik = kok.icerik();\r\n if (kok.asil() != null)\r\n icerik = kok.asil();\r\n\r\n StringBuilder res = new StringBuilder(icerik).append(\" \");\r\n\r\n // Tipi ekleyelim.\r\n if (kok.tip() == null) {\r\n System.out.println(\"tipsiz kok:\" + kok);\r\n return res.toString();\r\n }\r\n\r\n if (!tipAdlari.containsKey(kok.tip())) {\r\n System.out.println(\"tip icin dile ozel kisa ad bulunamadi.:\" + kok.tip().name());\r\n return \"#\" + kok.icerik();\r\n }\r\n\r\n res.append(tipAdlari.get(kok.tip()))\r\n .append(\" \")\r\n .append(getOzellikString(kok.ozelDurumDizisi()));\r\n return res.toString();\r\n }", "public String getBeizhu() {\n return beizhu;\n }", "public List<Karte> getHandKarte(){\n return listKartenInhand;\n }", "@Override\r\n\tpublic double getPrezzo() {\n\t\treturn prezzo;\r\n\t}", "public String gibZustand(){\n String out = anzahl+QwirkleServer.SEP;\n String aktiv = \"\";\n int[] punkte = new int[anzahl];\n String[] spielerSteine = new String[anzahl];\n String spielfeldString = \"\";\n\n //sammle Daten\n int count = 0;\n while (count<anzahl){\n Spieler spieler = this.spielerRing.getContent();\n if (spieler.istAktiv()) aktiv = spieler.gibIndex()+\"\";\n punkte[spieler.gibIndex()] = spieler.gibPunkteStand();\n spielerSteine[spieler.gibIndex()]=spieler.gibSteineString();\n this.spielerRing.next();\n count++;\n }\n\n if (spielEnde) aktiv = \"-1\";\n\n out += beutel.gibAnzahl()+QwirkleServer.SEP;\n out += aktiv;\n for (int i = 0; i < anzahl; i++)\n out+=QwirkleServer.SEP+punkte[i];\n\n for (int i = 0; i < anzahl; i++)\n out+=QwirkleServer.SEP+spielerSteine[i];\n\n\n spielfeld.toFirst();\n while(spielfeld.hasAccess()) {\n Stein stein = spielfeld.getContent();\n out += QwirkleServer.SEP + stein.toString();\n spielfeld.next();\n }\n\n return out;\n }", "public int getOperacion()\r\n/* 22: */ {\r\n/* 23:45 */ return this.operacion;\r\n/* 24: */ }", "@Test\n public void apiKundenViewGetInaktiveGetTest() throws ApiException {\n List<CmplxKunden> response = api.apiKundenViewGetInaktiveGet();\n\n // TODO: test validations\n }", "public Rechnung warenkorbKaufen(Person p) throws AccessRestrictedException, InvalidAmountException{\r\n\t\tif(istKunde(p)){\r\n\t\t\r\n\t\t\t//Warenkorb des Benutzers abfragen\r\n\t\t\tWarenkorb wk = kv.gibWarenkorbVonKunde(p);\r\n\t\t\t\r\n\t\t\t//Bestand der Artikel im Warenkorb reduzieren und Gesamtpreis errechnen\r\n\t\t\tint gesamt = 0;\r\n\t\t\tMap<Artikel,Integer> inhalt = wk.getArtikel();\r\n\t\t\tfor(Map.Entry<Artikel, Integer> ent : inhalt.entrySet()){\r\n\t\t\t\ttry{\r\n\t\t\t\t\tav.erhoeheBestand(ent.getKey().getArtikelnummer(), -1 * ent.getValue());\r\n\t\t\t\t\t//Ereignis erstellen\r\n\t\t\t\t\tev.ereignisErstellen(p, Typ.KAUF, ent.getKey(), (int) ent.getValue());\r\n\t\t\t\t} catch (ArticleNonexistantException anne){\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tgesamt += (ent.getValue() * ent.getKey().getPreis());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Warenkorb für Rechnung erzeugen\r\n\t\t\tWarenkorb temp = new Warenkorb();\r\n\t\t\ttemp.setArtikel(wk.getArtikel());\r\n\t\t\t\r\n\t\t\t//Rechnung erzeugen\r\n\t\t\tRechnung re = rv.rechnungErzeugen((Kunde) p, new Date(), temp, gesamt);\r\n\t\t\t\r\n\t\t\t//Warenkorb von Kunde leeren\r\n\t\t\twv.leereWarenkorb(wk);\r\n\t\t\t\r\n\t\t\t//Rechnungsobjekt an C/GUI zurückgeben\r\n\t\t\treturn re;\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\tthrow new AccessRestrictedException(p, \"\\\"Warenkorb bezahlen\\\"\");\r\n\t\t}\r\n\t}", "public MakhlukHidup get_daftar(int i);", "public Integer getAnzplaetze() {\n\t\treturn this.anzplaetze;\n\t}", "public Integer getAnzplaetze() {\n\t\treturn this.anzplaetze;\n\t}", "public int zugBerechnen(int gegnerZug){\n\t\t\n\t\tsetzeGegnerStein(gegnerZug);\n\t\t\n\t\tif(gegnerZug == -1){\n\t\t\thatAngefangen = eigenerStein;\n\t\t\tsetzeEigenenStein(3);\n\t\t\treturn 3;\n\t\t}\n\t\t\n\t\tkeineZuegeMehr();\n\t\t\n\t\tint spalte = (int)(Math.random()*6);\n\t\t\n\t\tfor(int i=0; i < moeglicheZuege.length; i++){\n\t\t\tspalte = (i+spalte)%7;\n\t\t\tif(siegMuster(spalte, moeglicheZuege[spalte]) && moeglicheZuege[spalte] < 6){\n\t\t\t\tsetzeEigenenStein(spalte);\n\t\t\t\treturn spalte;\n\t\t\t}\n\t\t}\n/*\t\n\t\tfor(int i=0; i < moeglicheZuege.length; i++){\n\t\t\tspalte = (i+spalte)%7;\n\t\t\tif(gegnerSiegMuster(spalte, moeglicheZuege[spalte]) && moeglicheZuege[spalte] < 6){\n\t\t\t\tsetzeEigenenStein(spalte);\n\t\t\t\treturn spalte;\n\t\t\t}\n\t\t}\n*/\t\t\n\t\tfor(int i = 0; i < moeglicheZuege.length; i++){\n\t\t\tspalte = (i+spalte)%7;\n\t\t\tif(moeglicheZuege[spalte] < 6){\n\t\t\t\tsetzeEigenenStein(spalte);\n\t\t\t\treturn spalte;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn -1; //Kein Spielzug mehr moeglich\n\t}", "public List<Artikel> getArtikelBestandSortiertNachBezeichnung() {\n\t\tList<Artikel> ergebnis = new Vector<Artikel>();\n\t\tergebnis.addAll(artikelBestand);\n\t\tCollections.sort(ergebnis, new SortierungNachBezeichnung());\n\t\treturn ergebnis;\n\t}", "protected ElementDoppeltVerkettet gehe(int anzahlSchritte) {\n\t\tElementDoppeltVerkettet aktuell = this;\n\t\tint aS = anzahlSchritte;\n\t\tif (aS < 0) {\n\t\t\twhile (aS < 0 && aktuell.zurück != null) {\n\t\t\t\taktuell = aktuell.zurück;\n\t\t\t\taS++;\n\t\t\t}\n\t\t} else {\n\t\t\twhile (aS > 0 && aktuell.vor != null) { aktuell = (ElementDoppeltVerkettet) aktuell.vor; aS--; }\n\t\t}\n\t\tif (aS == 0) {\n\t\t\treturn aktuell;\n\t\t} else {\n\t\t\tthrow new IndexOutOfBoundsException(\"Die Grenzen der Liste sollten überschritten werden\");\n\t\t}\n\t}", "public void test4(){\r\n\t\tZug zug0 = st.zugErstellen(0, 3, \"Zug 0\");\r\n\t\tst.blockFahren();\r\n\t\td.getSignal(21).setStellung(true);\r\n\t\td.getWeiche(17).setStellung(false);\r\n\t\tst.blockFahren();\r\n\t\td.getSignal(18).setStellung(true);\r\n\t\td.getWeiche(39).setStellung(false);\r\n\t\tst.blockFahren();\r\n\t\tst.fahren();\r\n\t}", "public void sendeSpielfeld();", "@Override\r\n\tpublic String getFood() {\n\t\treturn \"banana\";\r\n\t}", "public abstract String getBeschreibung();", "public void ergebnis(TrefferTyp ergebnisTyp, Koordinate position) {}", "@Override\n\tpublic List<KinderGarten> getKinderGartenByPlace(String p) {\n\t\treturn kindergartenRepo.getKindergartenByPlace(p);\n\t}", "String getNetzanbieter();" ]
[ "0.5752487", "0.57028633", "0.5620122", "0.5561062", "0.55071944", "0.54908526", "0.54801285", "0.54679", "0.54359144", "0.54326034", "0.5424792", "0.53735185", "0.5365886", "0.53284967", "0.53240186", "0.5287369", "0.5281997", "0.52696717", "0.52542716", "0.5249401", "0.52378446", "0.52359456", "0.5202026", "0.5181699", "0.5181699", "0.5163279", "0.514091", "0.5136798", "0.5134593", "0.50995046", "0.5094972", "0.5076936", "0.5073538", "0.50527436", "0.5052017", "0.504008", "0.5035198", "0.5021854", "0.5007769", "0.5005797", "0.49978194", "0.499663", "0.4986085", "0.49854016", "0.4984982", "0.49729344", "0.49717265", "0.49712288", "0.49704343", "0.4950247", "0.49423113", "0.49384478", "0.49362433", "0.49236363", "0.4911965", "0.4905699", "0.4903474", "0.4902152", "0.48975578", "0.48836702", "0.48799923", "0.48754925", "0.48678163", "0.48643655", "0.48632297", "0.48573625", "0.48528302", "0.48524725", "0.48471847", "0.4844619", "0.48408848", "0.48400834", "0.48385662", "0.48384538", "0.48375276", "0.48355326", "0.483458", "0.48323745", "0.48301798", "0.48285243", "0.48247328", "0.48243847", "0.48129904", "0.48039427", "0.47986516", "0.47938818", "0.47934127", "0.47930506", "0.47921926", "0.47921926", "0.4787005", "0.47829616", "0.47826752", "0.478094", "0.4779762", "0.47785333", "0.47746712", "0.47717902", "0.4770733", "0.47701767" ]
0.5448306
8
ohne body, da abstract jede Pizza hat einen anderen preis, muss also selber wissen welchen die Preisberechung ist in jeder Kindklasse voellig anders!
public abstract double getPreis();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Pizza orderPizza(String type) {\n //hier wird Factory methode aufgerufen/ Code ändert sich öfters\n Pizza pizza = createPizza(type);\n\n if (pizza != null){\n System.out.printf(\"Making a \" + pizza.getName() + \"---------\");\n pizza.prepare();\n pizza.bake();\n pizza.cut();\n pizza.box();\n }\n\n return pizza;\n }", "@Override\n\tpublic Pizza crearPizza(FactoriaIngredientes fi) {\n\t\treturn null;\n\t}", "public interface IPizzaBaker {\n\n String getName();\n IntermediatePizza bakePiza(IntermediatePizza intermediatePizza);\n\n IntermediatePizza addToppings(IntermediatePizza IntermediatePizza);\n\n IntermediatePizza addSauce(IntermediatePizza IntermediatePizza);\n\n IntermediatePizza startBakingYourPizza();\n\n Set<IRecipe> getPizzaSkills();\n\n}", "public Pizza() {\n pizzaSize = \"small\";\n cheeseToppings = 0;\n pepperoniToppings = 0;\n veggieToppings = 0;\n }", "public Pizza(Pizza pizza) {\n this.pizzaSize = pizza.pizzaSize;\n this.cheeseToppings = pizza.cheeseToppings;\n this.pepperoniToppings = pizza.pepperoniToppings;\n this.veggieToppings = pizza.veggieToppings;\n }", "public Pizza getPizza() {\n return this.pizzaType;\n }", "public static void main(String[] args) {\n\t\tPizza pizzaM = new Mozzarella();\n\t\tpizzaM = new Catupiry(pizzaM);\n\t\tpizzaM = new Tomato (pizzaM);\n\t\t\n\t\tSystem.out.println(\"Pizza: \" + pizzaM.getDescricao() + \"\\n R$: \" + pizzaM.getPreco());\n\t\t\n\t\t// Pizza Pepperoni + Catupiry + Oregano + Bacon\n\t\tPizza pizzaP = new Pepperoni();\n\t\tpizzaP = new Catupiry(pizzaP);\n\t\tpizzaP = new Oregano(pizzaP);\n\t\tpizzaP = new Bacon (pizzaP);\n\t\t\n\t\tSystem.out.println(\"Pizza: \" + pizzaP.getDescricao() + \"\\n R$: \" + pizzaP.getPreco());\n\t\t\n\t\t// Pizza Frango + Catupiry + Tomato + Oregano + Bacon + CreamCheese\n\t\tPizza pizzaF = new Frango();\n\t\tpizzaF = new Catupiry(pizzaF);\n\t\tpizzaF = new Tomato(pizzaF);\n\t\tpizzaF = new Oregano(pizzaF);\n\t\tpizzaF = new Bacon(pizzaF);\n\t\tpizzaF = new CreamCheese(pizzaF);\n\t\t\n\t\tSystem.out.println(\"Pizza: \" + pizzaF.getDescricao() + \"\\n R$: \" + pizzaF.getPreco());\n\n\t}", "public LineItem(Pizza type) throws IllegalPizza {\n setNumber(1);\n setPizza(type);\n }", "public static void main(String[] args) {\n PizzaOrderer po = new PizzaOrderer();\r\n po.addProduct(new Gavaian())\r\n .addProduct(new GoldFeather(new Margarita()));\r\n\r\n Product pizza = new Gavaian();\r\n pizza.productDescribtion();\r\n\r\n pizza = new GoldFeather(new Margarita());\r\n\r\n pizza.productDescribtion();\r\n\r\n //System.out.println(po.getTotalCharge());\r\n //Gavaian pizza = new Gavaian();\r\n //pizza.productBuilder();\r\n }", "private static void kapazitaetPruefen(){\n\t\tList<OeffentlichesVerkehrsmittel> loev = new ArrayList<OeffentlichesVerkehrsmittel>();\n\t\t\n\t\tLinienBus b1 = new LinienBus();\n\t\tFaehrschiff f1 = new Faehrschiff();\n\t\tLinienBus b2 = new LinienBus();\t\n\t\t\n\t\tloev.add(b1);\n\t\tloev.add(b2);\n\t\tloev.add(f1);\n\t\t\n\t\tint zaehlung = 500;\n\t\tboolean ausreichend = kapazitaetPruefen(loev,500);\n\t\tp(\"Kapazitaet ausreichend? \" + ausreichend);\n\t\t\n\t}", "@Override\n\tprotected Pizza createPizza(String type) {\n\t\tPizza pizza = null;\n\t\tPizzaIngredientFactory pizzaIngredientFactory = new NYPizzaIngredientFactory();\n\t\tif(type.equals(\"cheese\")){\n\t\t\tpizza = new CheesePizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Cheese Pizza\");\n\t\t} else if(type.equals(\"veggie\")){\n\t\t\tpizza = new VeggiePizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Veggie Pizza\");\n\t\t} else if(type.equals(\"clam\")) {\n\t\t\tpizza = new ClamPizza(pizzaIngredientFactory);\n\t\t\tpizza.setName(\"NY Style Clam Pizza\");\n\t\t} return pizza;\n\t}", "public static void main(String[] args) {\n\t\tPizza p =new Pizza.Builder()\r\n\t\t\t\t .size(12)\r\n\t\t\t\t .olives(true)\r\n\t\t\t\t .extra_cheese(true)\r\n\t\t\t\t .boiled_egg(true)\r\n\t\t\t\t .anchovi(true)\r\n\t\t\t\t .build();\r\n\t\t\r\n\t\tSystem.out.println(\"p\");\r\n\t\tSystem.out.println(\" Size? \"+p.getSize());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p.hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p.hasPepperoni());\r\n\t\t\r\n\t\t\r\n\t\tPizza p1 = new PizzaMenu(TypePizza.Maison, PizzaSize.large).getPizza();\r\n\t\tSystem.out.println(\"p1\");\r\n\t\tSystem.out.println(\" Size? \"+p1.getSize());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p1.hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p1.hasPepperoni());\r\n\t\t\r\n\t\tPizza p3 = new PizzaMenu(TypePizza.Pepperoni, PizzaSize.large).getPizza();\r\n\t\tSystem.out.println(\"p3\");\r\n\t\tSystem.out.println(\" Size? \"+p3.getSize());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p3.hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p3.hasPepperoni());\r\n\t\t\r\n\t\tPizzaMenu[]p2=new PizzaPromo(PizzaPromotion.PromoPepperoni).getPromo();\r\n\t\tSystem.out.println(\"p2[0]\");\r\n\t\tSystem.out.println(\" Size? \"+p2[0].getPizza().getSize());\r\n\t\tSystem.out.println(\" Type = \"+p2[0].getType());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p2[0].getPizza().hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p2[0].getPizza().hasPepperoni());\r\n\t\tSystem.out.println(\"p2[1]\");\r\n\t\tSystem.out.println(\" Size? \"+p2[1].getPizza().getSize());\r\n\t\tSystem.out.println(\" Type = \"+p2[1].getType());\r\n\t\tSystem.out.println(\" Extra cheese? \"+p2[1].getPizza().hasExtra_Cheese());\r\n\t\tSystem.out.println(\" Pepperoni? \"+p2[1].getPizza().hasPepperoni());\r\n\t\t\r\n\t\t\r\n\r\n\t}", "@Override\r\n\tprotected Pizza createPizza(String type) {\n\t\tif(type.equals(\"cheese\")) {\r\n\t\t\treturn new NYStyleCheesePizza();\r\n\t\t}\r\n\t\telse return null;\r\n\t}", "public Pizza() {\n this(\"small\", 1, 1, 1);\n }", "@Override\n public void perish() {\n \n }", "protected abstract void composeSnare(final Phrase snare);", "private void setPizza(Pizza type) throws IllegalPizza {\n if(type == null)\n throw new IllegalPizza(\"Invalid pizza!\");\n pizzaType = type;\n }", "public static void main(String[] args) {\n\r\n Ingredient ingredient=new Ingredient();\r\n\r\n Food pasta=new Pasta();\r\n String pastaItems=ingredient.getPastaItems();\r\n pasta.prepareFood(pastaItems);\r\n System.out.println(pasta.deliverFood());\r\n\r\n\r\n System.out.println(\"------------FACADE---------------\");\r\n\r\n System.out.println(Waiter.deliveryFood(FoodType.PASTA));\r\n\r\n\r\n\r\n\r\n\r\n\r\n }", "public TipoPrestamo() {\n\t\tsuper();\n\t}", "@Override\n public String toString() {\n return String.format(\"Pizza %s, prezzo %f€\", this.gusto, this.prezzo);\n }", "@Override\n public void bake() {\n System.out.println(\"Bake Pepporonie Pizza !!\");\n }", "public LineItem(int num, Pizza type) throws IllegalPizza {\n setNumber(num);\n setPizza(type);\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tPizza p1 = new Pizza(\"large\", 1, 1, 2);\r\n\t\tPizza p2 = new Pizza(\"small\", 2, 1, 1);\r\n\t\tPizza p3 = new Pizza(\"medium\", 1, 2, 1);\r\n\t\t\r\n\t\tSystem.out.println(p1.getDescription());\r\n\t\tSystem.out.println(p2.getDescription());\r\n\t\tSystem.out.println(p3.getDescription());\r\n\r\n\t}", "public Pizza(){\n this.name = \"Plain Pizza\";\n this.toppings = new ArrayList<String>(Arrays.asList(\"Olive\", \"Cheese\"));\n }", "public PizzaDecorator(IPizza pizza) {\n mPizza = pizza;\n }", "@Override\n public String getDescription() {\n\t return \"Mexican Pizza\";\n }", "public Pizza(String size, int cheese, int pepperoni, int veggie) {\n pizzaSize = size;\n cheeseToppings = cheese;\n pepperoniToppings = pepperoni;\n veggieToppings = veggie;\n }", "public static void main(String[] args) {\n Ator a = new Ator(\"Alberto\");\r\n Ator b = new Ator(\"Vagner moura\");\r\n Ator c = new Ator(\"Ator 1\");\r\n\r\n Filme f= new Filme(\"Tropa de elite\", 2011);\r\n\r\n f.addPapel(a,\"papel 1\", false);\r\n f.addPapel(b,\"papel 2\", true);\r\n f.addPapel(c,\"papel 3\", true);\r\n\r\n\r\n System.out.println(a.getFilmes());\r\n /*System.out.println(f.getProtagonista());\r\n System.out.println(f);\r\n System.out.println(a);\r\n System.out.println(b);\r\n System.out.println(c);*/\r\n\r\n\r\n }", "public Pizza(String code, String nom, CategoriePizza catPizza, double prix) {\n\t\tthis.code = code;\n\t\tthis.nom = nom;\n\t\tthis.prix = prix;\n\t\tthis.catPizza = catPizza;\n\t}", "public void prepare() {\n\t\tSystem.out.println(\"NYStyleCheesePizza prepared!!\");\r\n\t}", "@Test\n\tpublic void testPurachase() {\n\t\tassertTrue(order.purachaseCheeseMeal().getMeal().get(0) instanceof CheeseSandwich);\n\t\tassertTrue(order.purachaseCheeseMeal().getMeal().get(1) instanceof OrangeJuice);\n\n\t\tassertTrue(order.purachaseTunaMeal().getMeal().get(0) instanceof TunaSandwich);\n\t\tassertTrue(order.purachaseTunaMeal().getMeal().get(1) instanceof OrangeJuice);\n\t}", "private void asignSpecial() {\n\t\tpizza = new Special();\n\t\tBaguette pz = new PizzaAdapter(pizza);\n\t\tSystem.out.println(pz.getDescription() + \". Total: $\" + pz.cost());\n\t}", "@Test\n public void Oriental()throws ParseException\n {\n System.out.println(\"Oriental Dish\");\n //Elementos del plato\n OrientalDish platoOriental;\n platoOriental = new OrientalDish(\"Arroz Oriental\", \"Arroz Estilo Oriental\", \"\", \"\", 5500d, new ArrayList(), Size.ALL);\n platoOriental.addPart(new Dish(\"ShopSuey\",\"\",\"\",5000d, new ArrayList(), Size.ALL));\n \n DishBuilder orientalBuilder = new OrientalDishBuilder();\n orientalBuilder.setDish(platoOriental);\n \n DishDirector director = new DishDirector(orientalBuilder);\n //director.create();\n Dish dish = director.getDish();\n assertEquals(10500, dish.getPrice()); \n }", "void order(Pizza pizza) {\n order.add(pizza);\n }", "public static void main(String[] args) {\n\t\tPizza pizza = new Pizza();\r\n\t\tSystem.out.println(\"Order a pizza\\n\");\r\n\t\tSystem.out.println(pizza.getDescription());\r\n\t\tSystem.out.println(\"Changing my order\\n\");\r\n\t\tpizza.setSize(PizzaSize.large); \r\n\t\tpizza.setPepTops(4); \r\n\t\tpizza.setBeefTops(1);\r\n\t\tpizza.setCheeseTops(2);\r\n\t\tSystem.out.println(pizza.getDescription());\r\n\t\tSystem.out.println(\"Order a special pizza\"); \r\n\t\tSpecialPizza specialPizza = new SpecialPizza();\r\n\t\tspecialPizza.setSize(PizzaSize.small);\r\n\t\tspecialPizza.setCheeseTops(3);\r\n\t\tspecialPizza.setBeefTops(4);\r\n\t\tspecialPizza.setPepTops(1); \r\n\t\tSystem.out.println(specialPizza.bellsAndWhistles());\r\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "public void trykkPaa() throws TrykketPaaBombe {\n // Ingenting skal skje dersom en av disse er true;\n if (brettTapt || trykketPaa || flagget) {\n return;\n }\n\n // Om ruten er en bombe taper man brettet\n if (bombe) {\n trykketPaa = true;\n setText(\"x\");\n setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));\n throw new TrykketPaaBombe();\n }\n // Om ruten har null naboer skal et stoerre omraade aapnes\n else if (bombeNaboer == 0) {\n Lenkeliste<Rute> besokt = new Lenkeliste<Rute>();\n Lenkeliste<Rute> aapneDisse = new Lenkeliste<Rute>();\n aapneDisse.leggTil(this);\n // Rekursiv metode som fyller aapneDisse med riktige ruter\n finnAapentOmraade(besokt, aapneDisse);\n for (Rute r : aapneDisse) {\n r.aapne();\n }\n } else {\n aapne();\n }\n }", "@Override\n public float calculaPreu(PreuTipusHabitacio p) {\n return p.getPreu() * this.perc;\n }", "public void setPrezzo (float prezzo) {\r\n\t\tthis.prezzo=prezzo;\r\n\t}", "public Pizza build(){\n Pizza pizza = new Pizza(this);\n return pizza;\n }", "public void setPrenotazione(Set<Prenotazione> aPrenotazione) {\n prenotazione = aPrenotazione;\n }", "public void rebajoIngredientes() {\n }", "@Test\n public void Oriental()throws ParseException\n {\n System.out.println(\"Oriental Dish\");\n //Elementos del plato\n OrientalDish platoOriental;\n platoOriental = new OrientalDish(0.0);\n platoOriental.setBase(new Product(1, \"Shop Suey\", 5000d));\n platoOriental.addOption(new Product(4, \"Pollo Agridulce\", 5800d));\n platoOriental.setSize(Size.FAMILY);\n \n DishBuilder orientalBuilder = new OrientalDishBuilder();\n orientalBuilder.setDish(platoOriental);\n \n DishDirector director = new DishDirector(orientalBuilder);\n //director.create();\n Dish dish = director.getDish();\n assertEquals(32400, dish.getPrice()); \n }", "public PizzaCutter()\r\n {\r\n //intentionally left blank\r\n }", "private static void createTestBestellungHorizontal(){\n\t\ta = new Artikel(\"ASPIRIN Tabl 500 mg Ad 20 Stk\", \"Medikament\", \"0\");\n\t\ta.setEAN(\"7680085370118\");\n\t\tsetPharmacode(a, \"0058910\");\n\t\tAnwender anwender = new Anwender(\"007\", \"topsecret\");\n\t\torder = new Bestellung(\"Test-Bestellung\", anwender);\n\t\torder.addItem(a, 1);\n\t\t\n\t}", "void cook(Food food) {\n //cook in pressure cooker\n }", "public PregledPoruka() {\n preuzmiMape();\n preuzmiPoruke();\n }", "@Test //vege\n\t\t\tpublic void CorrectQuantityPizzaVege() throws PizzaException, LogHandlerException{\n\t\t\t\tString line = \"21:17:00,21:28:00,Emma Brown,0602547760,DVC,-1,0,PZV,5\";\n\t\t\t\tpizza = LogHandler.createPizza(line);\n\t\t\t\tassertEquals(pizza.getQuantity(), 5, 0);\n\t\t\t}", "public Artikel erstelleArtikel(String bezeichnung, int bestand, double preis, int packungsgroesse, Person p) throws AccessRestrictedException, InvalidAmountException{\r\n\t\tif(istMitarbeiter(p)){\r\n\t\t\tArtikel art = av.erstelleArtikel(bezeichnung, bestand, preis, packungsgroesse);\r\n\t\t\t//Ereignis erzeugen\r\n\t\t\tev.ereignisErstellen(p, Typ.NEU, art, bestand);\r\n\t\t\treturn art;\r\n\t\t} else {\r\n\t\t\tthrow new AccessRestrictedException(p, \"\\\"Artikel anlegen\\\"\");\r\n\t\t}\r\n\t}", "public Pizza(String size, int cheese, int pepperoni, int ham) {\n setSize(size);\n setNumberOfCheese(cheese);\n setNumberOfPepperoni(pepperoni);\n setNumberOfHam(ham);\n }", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "public Pizza makePizza(String newPizzaType){\n if(newPizzaType.equals(\"a\")){\r\n return new CheesePizza();\r\n }\r\n else if(newPizzaType.equals(\"b\")){\r\n return new VeggiePizza();\r\n }\r\n else if(newPizzaType.equals(\"c\")){\r\n return new ChickenPizza(); \r\n }\r\n else{ \r\n return null; \r\n }\r\n \r\n }", "public Pizza createPizza(String type) {\n\t\tPizza pizza = null;\n\t\tif(type.equals(\"cheese\")) {\n\t\t\tpizza = new CheesePizza();\n\t\t}\n\t\telse if(type.equals(\"pepperoni\")) {\n\t\t\tpizza = new PepperoniPizza();\n\t\t}\n\t\treturn pizza;\n\t}", "public static void main(String[] args) {\n\n PlantFactory pf = new PlantFactory();\n for(int number = 0; number < 5; number++) {\n Corn newCorn = pf.getCorn();\n if(newCorn == null) break;\n\n PlantField.cornList.add(newCorn);\n }\n for(int number = 0;number < 10; number++) {\n Rice newRice = pf.getRice();\n if(newRice == null) break;\n\n PlantField.riceList.add(newRice);\n }\n for(int number = 0;number < 2;number++) {\n Pasture newPasture = pf.getPasture();\n if(newPasture == null) break;\n\n PlantField.pastureList.add(newPasture);\n }\n\n // Now we got different plants!\n show();\n\n // Let's fertilize those plants!\n for (Corn item : PlantField.cornList) {\n item.fertilized();\n }\n for (Pasture item : PlantField.pastureList) {\n item.fertilized();\n }\n\n // Let's try to fertilize them again.\n for (Corn item : PlantField.cornList) {\n item.fertilized();\n }\n for (Rice item : PlantField.riceList) {\n item.fertilized();\n }\n for (Pasture item : PlantField.pastureList) {\n item.fertilized();\n }\n System.out.println(\"\\nLet's harvest them!\");\n for(Corn item : PlantField.cornList){\n item.harvested();\n }\n for(Rice item : PlantField.riceList){\n item.harvested();\n }\n for(Pasture item : PlantField.pastureList){\n item.harvested();\n }\n\n show();\n\n // Maybe we need to buy some seeds.\n\n // Oops, those corns and rices need to be pollinated.\n for(Corn item : PlantField.cornList){ // corn and rise need to be poll\n PollinationStrategy ps = new SpontaneousPollination();\n ps.pollinate(item);\n }\n\n // We just pollinated those corns. Let's harvest them!\n for(Corn item : PlantField.cornList){\n item.harvested();\n }\n\n show();\n// ------\n // Take a look at those dead plant.\n for(Corn item : PlantField.cornList){\n item.harvested();\n item.fertilized();\n PollinationStrategy ps = new ArtificialPollination();\n ps.pollinate(item);\n }\n\n // plantTest completed successfully\n }", "public void setPreco(Float preco) { this.preco = preco; }", "public double berechnePreis(){\r\n\t\tdouble gesamtpreis = 0;\r\n\t\tfor (Titel tmp : this){\r\n\t\t\tgesamtpreis = gesamtpreis + tmp.getPreis();\r\n\t\t}\r\n\t\treturn gesamtpreis;\r\n\t}", "Paranormal(String name, String origin, int dangerrating, String foodType, int foodAmt){\n super(name, origin, dangerrating);\n foodType = \"meat\";\n foodAmt = 5;\n }", "public void aggiungiPiatto(String nome_piatto, double prezzo_piatto, int porzioni) {\n\t\tPiatto nuovo_piatto= new Piatto(nome_piatto,prezzo_piatto, porzioni);\n\t\tquantita.add(nuovo_piatto);\n\t\tquantita.sort();\n\t}", "public Produto(String nome, String descricao, double preco, String tipo) {\n\t\tthis.nome = nome;\n\t\tthis.descricao = descricao;\n\t\tthis.preco = preco;\n\t\tthis.tipo = tipo;\n\t}", "@Override\n public int pizzaPrice() {\n if (size.equals(\"Small\"))\n return SMALLPIZZA;\n else if (size.equals(\"Medium\"))\n return SMALLPIZZA + 2;\n else\n return SMALLPIZZA + 4;\n }", "private void aktualisierePreisanzeige(Set<Platz> plaetze)\r\n\t{\r\n\r\n\t\tif (istVerkaufenMoeglich(plaetze))\r\n\t\t{\r\n\t\t\tGeldbetrag preis = _vorstellung.getPreisFuerPlaetze(plaetze);\r\n\t\t\t_ui.getPreisLabel().setText(\"Gesamtpreis: \" + preis.toString() + \" €\");\r\n\t\t\t_preisFuerAuswahl = preis;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t_ui.getPreisLabel().setText(\"Gesamtpreis:\");\r\n\t\t}\r\n\t}", "public void aenderePreisAllerArtikel(double prozent){\n Validator.check(prozent < -100, MSG_PREIS);\n for (Map.Entry<Integer, Artikel> integerArtikelEntry : lager.entrySet()) {\n integerArtikelEntry.getValue().aenderePreis(prozent);\n }\n }", "public void create(Pizza pizza){\n pizza.setID(counter++);\n pizzas.add(pizza);\n }", "public Produto(String nome, String descricao, double preco, String tipo, double precoTotal) {\n\t\tthis.nome = nome;\n\t\tthis.descricao = descricao;\n\t\tthis.preco = preco;\n\t\tthis.tipo = tipo;\n\t\tthis.precoTotal = precoTotal;\n\t}", "private void asignUltraThin() {\n\t\tpizza = new UltraThin();\n\t\tBaguette pz = new PizzaAdapter(pizza);\n\t\tSystem.out.println(pz.getDescription() + \". Total: $\" + pz.cost());\n\t}", "@Override\r\n\tpublic double getPrezzo() {\n\t\treturn prezzo;\r\n\t}", "public boolean isPredeterminado()\r\n/* 154: */ {\r\n/* 155:264 */ return this.predeterminado;\r\n/* 156: */ }", "private void remplirPrestaraireData() {\n\t}", "@Test\n public void Italian()throws ParseException\n {\n System.out.println(\"Oriental Dish\");\n //Elementos del palto\n ItalianDish platoItalian;\n platoItalian = new ItalianDish(0.0);\n platoItalian.setBase(new Product(2, \"Carpaccio\", 6000d));\n platoItalian.addOption(new Product(5, \"Albondigas a la italiana\", 6500d));\n platoItalian.addOption(new Product(6, \"Pollo picante cacciatore\", 7000d));\n platoItalian.setSize(Size.PERSONAL);\n DishBuilder ItalianBuilder = new ItalianDishBuilder();\n ItalianBuilder.setDish(platoItalian);\n \n DishDirector director = new DishDirector(ItalianBuilder);\n \n Dish dish = director.getDish();\n assertEquals(19500, dish.getPrice()); \n \n //Cambiano el tamaño \n platoItalian.setSize(Size.DOUBLE);\n ItalianBuilder.setDish(platoItalian);\n dish = director.getDish();\n assertEquals(35100, dish.getPrice());\n \n \n }", "private void asignExtraGross() {\n\t\tpizza = new ExtraGross();\n\t\tBaguette pz = new PizzaAdapter(pizza);\n\t\tSystem.out.println(pz.getDescription() + \". Total: $\" + pz.cost());\n\t}", "private void prepare()\n {\n Block block = new Block(10);\n addObject(block,372,150);\n Wall wall = new Wall();\n addObject(wall,52,167);\n Wall wall2 = new Wall();\n addObject(wall2,160,167);\n Wall wall3 = new Wall();\n addObject(wall3,550,167);\n Wall wall4 = new Wall();\n addObject(wall4,650,167);\n Wall wall5 = new Wall();\n addObject(wall5,750,167);\n block.setLocation(306,171);\n Robot robot = new Robot();\n addObject(robot,48,51);\n Pizza pizza = new Pizza();\n addObject(pizza,550,60);\n Pizza pizza2 = new Pizza();\n addObject(pizza2,727,53);\n Pizza pizza3 = new Pizza();\n addObject(pizza3,364,303);\n Pizza pizza4 = new Pizza();\n addObject(pizza4,224,400);\n Pizza pizza5 = new Pizza();\n addObject(pizza5,622,395);\n ScorePanel scorePanel = new ScorePanel();\n addObject(scorePanel,106,525);\n Home home = new Home();\n addObject(home,717,521);\n\n block.setLocation(344,173);\n pizza3.setLocation(394,297);\n Pizza pizza6 = new Pizza();\n addObject(pizza6,711,265);\n Pizza pizza7 = new Pizza();\n addObject(pizza7,68,276);\n\n }", "public Perro() {\n// super(\"No define\", \"NN\", 0); en caso el constructor de animal tenga parametros\n this.pelaje = \"corto\";\n }", "public Pizza clone(){\n\t\tPizza otherP = null;\n\t\ttry { \n\t\t\totherP = new Pizza(Size, Cheese, Ham, Pepperoni);\n\t\t} catch (IllegalPizza ite) {\n\t\t\t//shouldn't get here\n\t\t}\n\t\treturn otherP;\n\t}", "@Test (expected = PizzaException.class)// wrong code\n\t\t\tpublic void InocrrectCodeCreatePizza() throws PizzaException, LogHandlerException{\n\t\t\t\tString line = \"21:17:00,21:27:00,Emma Brown,0602547760,DVC,-1,0,KKK,5\";\n\t\t\t\tpizza = LogHandler.createPizza(line);\n\t\t\t}", "public void precio4e(){\n precioHabitaciones = precioHabitaciones + (cantidadHabitaciones * numeroCamas);\n\n //Restaurante\n if(capacidadRestaurant < 30){\n precioHabitaciones = precioHabitaciones + 10;\n } else if (capacidadRestaurant > 29 && capacidadRestaurant < 51){\n precioHabitaciones = precioHabitaciones + 30;\n } else if (capacidadRestaurant > 50){\n precioHabitaciones = precioHabitaciones + 50;\n }\n\n //Gimnasio\n switch (gimnasio){\n case \"A\":\n precioHabitaciones = precioHabitaciones + 50;\n break;\n case \"B\":\n precioHabitaciones = precioHabitaciones + 30;\n break;\n }\n\n }", "@Override\n\tpublic void preorder() {\n\n\t}", "@Override\r\n\tpublic void insertPrestito(Prestito p) {\n\t\t\r\n\t}", "@Test (expected = PizzaException.class)\n\tpublic void PizzaFactoryExceptionDeliverytimeDeliveryBeforOrder () throws PizzaException {\n\t\tPizzaFactory.getPizza(\"PZV\", 3, LocalTime.of(19, 30), LocalTime.of(16, 32));\n\t}", "public String toString()\r\n {\r\n return super.toString() + \"\\nPrice: $\" + this.pizzaPrice();\r\n }", "public BigDecimal premiacaoAberturaProduto(Produto p) {\n\t\tfor (PoliticaVendaConsignacaoTipoVendedorProduto politica : tipoVendedor.getPoliticasVCTVP()) {\n\t\t\tif (p.equals(politica.getProduto())) {\n\t\t\t\treturn politica.getAberturaPremiacao();\n\t\t\t}\n\t\t}\n\t\treturn BigDecimal.ZERO;\n\t}", "public Fish() {\r\n\t}", "private void prepare()\n {\n Victoria victoria = new Victoria();\n addObject(victoria,190,146);\n Salir salir = new Salir();\n addObject(salir,200,533);\n Volver volver = new Volver();\n addObject(volver,198,401);\n }", "@Test\n\tpublic void constructortest4() {\n\t\tMainDish dessertTest = new MainDish(\"quiche\");\n\t\tassertTrue(dessertTest.isVegetarian()==false);\n\t}", "public void finePartita() {\n\r\n }", "PRE createPRE();", "public float getPreis() {\r\n\t\treturn preis;\r\n\t}", "Petunia() {\r\n\t\t}", "@Test\n public void Italian()throws ParseException\n {\n System.out.println(\"Italian Dish\");\n //Elementos del palto\n ItalianDish platoItalian;\n platoItalian = new ItalianDish();\n platoItalian = new ItalianDish(\"Pasta\", \"Pasta Estilo Italiano\", \"\", \"\", 3000d, new ArrayList(), Size.ALL);\n platoItalian.addPart(new Dish(\"Carpaccio\",\"\",\"\",4000d, new ArrayList(), Size.HALF));\n platoItalian.addPart(new Dish(\"Rissotto\",\"\",\"\",4500d, new ArrayList(), Size.ALL));\n DishBuilder ItalianBuilder = new ItalianDishBuilder();\n ItalianBuilder.setDish(platoItalian);\n \n DishDirector director = new DishDirector(ItalianBuilder);\n \n Dish dish = director.getDish();\n assertEquals(9500, dish.getPrice()); \n\n }", "@Override\r\n\tpublic String getDesc() {\n\t\treturn pizza.getDesc()+\" , RomaTomatoes(12.88)\";\r\n\t}", "public Set<Prenotazione> getPrenotazione() {\n return prenotazione;\n }", "public float getPrezzo() {\n\t\treturn prezzo;\n\t}", "public Prekladiste(int id, UzelTyp typ, int x, int y, Simulator sim)\n\t{\n\t\tsuper(id, typ, x, y, sim);\n\t\t\n\t\tsklad = PRIPRAVENE_SUDY;\n\t\tthis.vozy = new LinkedList<Auto>();\n\t}", "public void setToppings(int cheese, int ham, int pepperoni) throws IllegalPizza{\n\t\tif (ham < 0 || pepperoni < 0 || cheese < 0)\n\t\t\tthrow new IllegalPizza(\"Illegal pizza, negative input!\");\n\t\tif (ham + pepperoni > 3)\n\t\t\tthrow new IllegalPizza(\"Illegal pizza, too much meat!\");\n\t\telse if (cheese == 0)\n\t\t\tthrow new IllegalPizza(\"Illegal pizza, there's no cheese!\");\n\t\telse if (cheese > 3)\n\t\t\tthrow new IllegalPizza(\"Illegal pizza, too much cheese!\");\n\t\telse\n\t\t\tCheese = cheese;\n\t\t\tHam = ham;\n\t\t\tPepperoni = pepperoni;\n\t}", "@Test //marg\n\t\t\tpublic void CorrectCreatePizzaMarg() throws PizzaException, LogHandlerException{\n\t\t\t\tString line = \"21:17:00,22:10:00,Emma Brown,0602547760,DVC,-1,0,PZM,5\";\n\t\t\t\tpizza = LogHandler.createPizza(line);\n\t\t\t\tassertEquals(pizza.getPizzaType(), \"Margherita\");\n\t\t\t}", "public void pizzaFight(Pizza otherPizza) {\n otherPizza.setSlices(otherPizza.getSlices() - 1);\n System.out.println(\n Arrays.toString(this.toppings) + \" pizza just cut 1 slice from \" + Arrays.toString(otherPizza.toppings));\n System.out.println(\"Other pizza now has \" + otherPizza.getSlices());\n }", "void removePizza(Pizza p) {\n pizzas.remove(p);\n }", "public interface DrinksFactory {\n //饮料\n Drinks dBuild();\n\n //面包\n Bread bBuild();\n\n void buyWhat();\n}", "Items(int quantidade,String nome,double preco){\n\t\tthis.qntd=quantidade;\n\t\tthis.produto = new Produto(nome,preco);\n\t}", "public void macheAngebot(RaumschiffTyp raumschiffTyp, double preis) {\r\n\t\tint menge = unternehmen.getLager().getAnzahl(raumschiffTyp);\r\n\t\tAngebot angebot = new Angebot(raumschiffTyp, unternehmen, menge, preis);\r\n\t\tunternehmen.getSpielWelt().getRaumschiffMarkt().fuegeAngebotHinzu(angebot);\r\n\t}", "public PizzaException() {\n super(\"That pizza has been eaten.\");\n }" ]
[ "0.66276187", "0.63159406", "0.62978923", "0.6152934", "0.6093962", "0.60910994", "0.6064479", "0.60631585", "0.60516304", "0.59779644", "0.5920351", "0.58663225", "0.58561265", "0.58532685", "0.58315104", "0.580155", "0.57372534", "0.5723171", "0.5716148", "0.5709251", "0.5692591", "0.5673408", "0.5658913", "0.5633841", "0.56305486", "0.5626407", "0.56089664", "0.55890113", "0.558507", "0.5569606", "0.55659103", "0.5552629", "0.55504394", "0.5539725", "0.55372906", "0.552555", "0.55137235", "0.5509347", "0.5505836", "0.5500572", "0.5493392", "0.5485724", "0.5482226", "0.54820883", "0.5480729", "0.5480595", "0.54793745", "0.54753596", "0.547347", "0.54518384", "0.54490775", "0.5448851", "0.54478246", "0.5442041", "0.5424527", "0.5421517", "0.54144037", "0.5410192", "0.5409479", "0.54087144", "0.5397257", "0.53867966", "0.5383451", "0.5383162", "0.53746015", "0.5374486", "0.5367737", "0.53483933", "0.5345777", "0.5345012", "0.5344963", "0.53441024", "0.5342712", "0.5342683", "0.53325367", "0.5315902", "0.5310729", "0.5305368", "0.5304222", "0.5297996", "0.52962667", "0.52940995", "0.5289985", "0.528796", "0.52872545", "0.5284948", "0.52828515", "0.5279623", "0.52731776", "0.5266949", "0.52618986", "0.5256609", "0.5255569", "0.5254407", "0.52538246", "0.525151", "0.5249214", "0.52472675", "0.5245015", "0.52383053", "0.52363193" ]
0.0
-1
This method will be called everytime a test fails. It will return TRUE if a test fails and need to be retried, else it returns FALSE
public boolean retry(ITestResult result) { //You could mentioned maxRetryCnt (Maximiun Retry Count) as per your requirement. Here I took 2, If any failed testcases then it runs two times int maxRetryCnt = 1; if (retryCnt < maxRetryCnt) { System.out.println("Retrying " + result.getName() + " again and the count is " + (retryCnt+1)); retryCnt++; return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic boolean retry(ITestResult result) \n\t{\n\t\treturn false;\n\t}", "@Override\n\tpublic boolean retry(ITestResult result) {\n\n if (!result.isSuccess()) { //Check if test not succeed\n if (count < maxTry) { //Check if maxtry count is reached\n count++; //Increase the maxTry count by 1\n System.out.println(\"is this working?\"); \n result.setStatus(ITestResult.FAILURE); //Mark test as failed\n return true; //Tells TestNG to re-run the test\n } else {\n result.setStatus(ITestResult.FAILURE); //If maxCount reached,test marked as failed\n }\n }\n else {\n result.setStatus(ITestResult.SUCCESS); //If test passes, TestNG marks it as passed\n }\n return false;\n\t}", "@Override\npublic boolean retry(ITestResult result) {\n\tif(minretryCount<=maxretryCount){\n\t\t\n\t\tSystem.out.println(\"Following test is failing====\"+result.getName());\n\t\t\n\t\tSystem.out.println(\"Retrying the test Count is=== \"+ (minretryCount+1));\n\t\t\n\t\t//increment counter each time by 1  \n\t\tminretryCount++;\n\n\t\treturn true;\n\t}\n\treturn false;\n}", "public boolean isRetried ()\r\n {\r\n return hasFailed () && retried_;\r\n }", "@Test\n public void testCanRetry() {\n assertEquals(0, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(1, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(2, rc.getAttempts());\n assertTrue(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n assertFalse(rc.attempt());\n assertEquals(3, rc.getAttempts());\n }", "public boolean retry(ITestResult result) {\n\t\tif (counter < retryMaxLimit) {\n\t\t\tcounter++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\n boolean isFailed() {\n return false;\n }", "public boolean isRetry();", "@Override\n\t\tpublic boolean wasRetried()\n\t\t{\n\t\t\treturn false;\n\t\t}", "@Override\n boolean canFail() {\n return true;\n }", "public boolean retry() {\n return tries++ < MAX_TRY;\n }", "boolean isFailure();", "boolean isFail();", "@Test\n public void testResetAndCanRetry() {\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n rc.reset();\n\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n }", "@Override\n\t\tpublic boolean isRetry() { return false; }", "@Override\n\t\tpublic boolean isRetry() { return true; }", "@Override\r\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\t\r\n\t}", "public boolean hasFail() {\n return result.hasFail();\n }", "@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\n\t}", "public TestCase fail();", "void onTestFailure(ITestResult result) throws IOException;", "public boolean isFailure( ) {\n\t\treturn failed;\n\t}", "@Test\n void fail_the_test() {\n }", "@Override\npublic void onTestFailure(ITestResult result) {\n\t\n}", "@Test\r\n\t public void feelingLucky() {\r\n\t \t Assert.fail();\r\n\t Assert.fail();\r\n\t }", "@Override\n\t\t\t\tpublic void doFail() {\n\t\t\t\t}", "public void testGetCleanupOnPutFailure() {\n System.out.println(\"getCleanupOnPutFailure\");\n \n boolean expResult = false;\n boolean result = instance.getCleanupOnPutFailure();\n assertEquals(expResult, result);\n \n }", "public final boolean isFailed() {\n return failed;\n }", "@Override\n\tpublic void onTestFailedWithTimeout(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedWithTimeout(ITestResult result) {\n\t\t\n\t}", "@Test\n public void testRecursionsFailure() throws Exception {\n assertTrue(doRecursions(false));\n }", "public boolean hasFailed ()\r\n {\r\n return exception_ != null;\r\n }", "public boolean shouldRetryOnTimeout() {\r\n return configuration.shouldRetryOnTimeout();\r\n }", "public boolean willRetry() {\n return willRetry;\n }", "public boolean tryFailure(Throwable cause)\r\n/* 341: */ {\r\n/* 342:424 */ if (setFailure0(cause))\r\n/* 343: */ {\r\n/* 344:425 */ notifyListeners();\r\n/* 345:426 */ return true;\r\n/* 346: */ }\r\n/* 347:428 */ return false;\r\n/* 348: */ }", "@Override\n\tpublic boolean isFailureMode() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void onTestFailedWithTimeout(ITestResult result) {\n\t}", "public boolean hasFailed() {\n\t\treturn failed;\n\t}", "public void testCheckAndRestoreIfNeeded_failure()\n {\n // SETUP\n String host = \"localhost\";\n int port = 1234;\n String service = \"doesn'texist\";\n MockCacheEventLogger cacheEventLogger = new MockCacheEventLogger();\n\n RegistryKeepAliveRunner runner = new RegistryKeepAliveRunner( host, port, service );\n runner.setCacheEventLogger( cacheEventLogger );\n\n // DO WORK\n runner.checkAndRestoreIfNeeded();\n\n // VERIFY\n // 1 for the lookup, one for the rebind since the server isn't created yet\n assertEquals( \"error tally\", 2, cacheEventLogger.errorEventCalls );\n //System.out.println( cacheEventLogger.errorMessages );\n }", "boolean fail(int rc) {\n if (complete.compareAndSet(false, true)) {\n this.rc = rc;\n submitCallback(rc);\n return true;\n } else {\n return false;\n }\n }", "@Test\n public void testFail() {\n fail();\n }", "@Test\t\t\n\tpublic void TestToFail()\t\t\t\t\n\t{\t\t\n\t System.out.println(\"This method to test fail\");\t\t\t\t\t\n\t // Assert.assertTrue(false);\t\t\t\n\t}", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkTest() {\n\t\tboolean flag = oTest.checkTest();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public boolean needTryAgain() {\n boolean z = this.mRetryConnectCallAppAbilityCount < 6;\n this.mRetryConnectCallAppAbilityCount++;\n return z;\n }", "private void fail() {\n mFails++;\n if(mFails > MAX_NUMBER_OF_FAILS) {\n gameOver();\n }\n }", "boolean shouldRetry(Reply reply) {\n int numErrors = reply.getNumErrors();\n if (numErrors == 0) {\n return false;\n }\n for (int i = 0; i < numErrors; ++i) {\n if (!retryPolicy.canRetry(reply.getError(i).getCode())) {\n return false;\n }\n }\n synchronized (monitor) {\n return !destroyed;\n }\n }", "public void onTestSkipped() {}", "@Test\n public void accuseFailTest() throws Exception {\n assertTrue(\"failure - accused status was not set to true\", target.isAccused());\n\n }", "@Test\n public void testFail(){\n fail(\"This is meant to fail\");\n }", "public void onTryFails(int currentRetryCount, Exception e) {}", "boolean doRetry() {\n synchronized (mHandler) {\n boolean doRetry = currentRetry < MAX_RETRIES;\n boolean futureSync = mHandler.hasMessages(0);\n\n if (doRetry && !futureSync) {\n currentRetry++;\n mHandler.postDelayed(getNewRunnable(), currentRetry * 15_000);\n }\n\n return mHandler.hasMessages(0);\n }\n }", "public boolean failedTick() {\n switch (remainingTicks) {\n case 0:\n return false;\n case -1:\n tickable.tick();\n default:\n remainingTicks--;\n }\n return true;\n }", "public boolean hasFailed(){\n\t\treturn failures;\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult tr) {\n\t\tsuper.onTestFailure(tr);\n\t}", "public void onTestFailedWithTimeout(ITestResult result) {\n\t\t\n\t}", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"********** \tTest Failed : \"+result.getName());\n\t\t\n\t}", "@Test\n public void questionIfNotAlreadyAccusedTest() throws Exception {\n\n }", "public void testSoThatTestsDoNotFail() {\n\n }", "boolean allowRetry(int retry, long startTimeOfExecution);", "private static void testFail() throws Throwable {\n Scheduler userInt = SchedulerTHelper.getSchedulerInterface();\n\n for (int i = 0; i < jobs_fail; i++) {\n String job_path = new File(jobs_path.toURI()).getAbsolutePath() + \"/flow_fail_\" + (i + 1) +\n \".xml\";\n\n Exception exc = null;\n JobId job = null;\n try {\n job = userInt.submit(JobFactory.getFactory().createJob(job_path));\n } catch (Exception e) {\n exc = e;\n }\n Assert\n .assertTrue(\"Job \" + job_path + \" was supposed to be rejected but was created\",\n job == null);\n Assert.assertTrue(exc != null);\n }\n SchedulerTHelper.log(jobs_fail + \" invalid jobs successfully rejected\");\n }", "public boolean test() throws Exception {\n throw new Exception(\"Test funcationality not yet implemented: unclear API\");\n }", "public boolean isFailure() {\n return _type == Type.FAILURE;\n }", "private boolean mustTryConnection(int iteration) {\n\t\t\n\t\t//the goal is to not to retry so often when several attempts have been made\n\t\t//the first 3 attemps, will not retry (give time for the system to startup)\n\t\tif (iteration < ITERATIONS_WITHOUT_RETRIES) {\n\t\t\t//here it will enter with iteration 0..2\n\t\t\treturn false;\n\t\t}\n\t\tif (iteration < ITERATIONS_WITH_NORMAL_RATE) {\n\t\t\t//Here it will enter with iteration 3..40\n //Retry every 2 attempts.\n\t\t\t//in iteration 6, 8, 10, 12, 14\n\t\t\treturn iteration % STEPS_AT_NORMAL_RATE == 0;\n\t\t}\n\t\t//between 15 and 40 attempts, only retry every 10 steps\n\t\tif (iteration < ITERATIONS_WITH_MEDIUM_RATE) {\n\t\t\t//here it will enter with iteration 10, 20, 30\n\t\t\treturn iteration % STEPS_AT_MEDIUM_RATE == 0;\n\t\t}\n\t\t\n\t\t//after 40 attempts, retry every 100 * MIN_INTERVAL\n\t\treturn iteration % STEPS_AT_SLOW_RATE == 0;\n\t}", "protected boolean isFailureOrRecovery(AbstractBuild<?, ?> build) {\n if (build.getResult() == Result.FAILURE || build.getResult() == Result.UNSTABLE) {\n return true;\n } else if (build.getResult() == Result.SUCCESS) {\n AbstractBuild<?, ?> previousBuild = build.getPreviousBuild();\n if (previousBuild != null && previousBuild.getResult() != Result.SUCCESS) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "@Override\n\tpublic void onTestFailure(ITestResult arg0) {\n\t\tSystem.out.println(\"on failure\");\n\t\t\n\t}", "@Override\n\tpublic void setFailureMode(boolean arg0) {\n\n\t}", "@Override\n\tpublic void onTestFailure(ITestResult result) {\n\t\t\n\t\tSystem.out.println(\"Failed Test \" + result.getName());\n\t}", "void doRetry();", "public void onTestFailure(ITestResult result) {\n\t\tSystem.out.println(\"*********Test onTestFailure :\"+result.getName());\r\n\t}", "public void testRetry() throws Exception {\n\n reportFilesProvider.createTestCrashFile();\n\n boolean didCatchException = false;\n\n try {\n // expected to timeout because the send can't complete, so set a very small timeout\n // and interval\n final long timeout = 500L;\n final long interval = 10L;\n\n uploadAndWait(timeout, interval);\n } catch (TimeoutException ex) {\n didCatchException = true;\n }\n assertTrue(didCatchException);\n // Should still be running:\n assertTrue(reportUploader.isUploading());\n assertFalse(reportManager.findReports().isEmpty());\n\n verifyZeroInteractions(mockCall);\n }", "public void testHttpFailureRetries() {\n delayTestFinish(RUNASYNC_TIMEOUT);\n runAsync1(0);\n }", "protected boolean ignoreFailure() {\n return ignoreFailure;\n }", "boolean isTroubled( ExpressionExperiment expressionExperiment );", "private boolean shouldRetryGetMaster(int tries, Exception e) {\n if (tries == numRetries - 1) {\n // This was our last chance - don't bother sleeping\n LOG.info(\"getMaster attempt \" + tries + \" of \" + numRetries +\n \" failed; no more retrying.\", e);\n return false;\n }\n LOG.info(\"getMaster attempt \" + tries + \" of \" + numRetries +\n \" failed; retrying after sleep of \" +\n ConnectionUtils.getPauseTime(this.pause, tries), e);\n return true;\n }", "boolean processFailure(Throwable t);", "public boolean isIfTaskFails() {\n return getFlow().isIfTaskFails();\n }", "@Override\n\tpublic boolean test() {\n\t\treturn false;\n\t}", "public boolean hasFailed() {\n return creationFailure;\n }", "@Test(groups={\"it\"})\r\n\tpublic void testTestNGFailedFilePresent() throws Exception {\r\n\t\t\r\n\t\texecuteSubTest(1, new String[] {\"com.seleniumtests.it.stubclasses.StubTestClassForDriverTest\"}, ParallelMode.METHODS, new String[] {\"testDriverWithFailure\"});\r\n\t\t\r\n\t\t// check files are there\r\n\t\tAssert.assertTrue(Paths.get(SeleniumTestsContextManager.getGlobalContext().getOutputDirectory(), \"testng-failed.xml\").toFile().isFile());\r\n\t\t\r\n\t}", "private void assertTrue(String name, boolean result) {\n if(! result) {\n System.out.println();\n System.out.println(\"***** Test failed ***** \"\n + name + \": \" +totalTests);\n totalErrors = totalErrors + 1;\n }/*else{\n System.out.println(\"----- Test passed ----- \"\n + name + \": \" +totalTests);\n }*/\n totalTests = totalTests + 1;\n }", "@Override\r\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult Result) {\n\t\t\r\n\t}", "public boolean proceedOnErrors() {\n return false;\n }", "public void onTestFailure(ITestResult result) {\r\n\t\ttry {\r\n\t\t\t//used to write result details in html\r\n\t\t\tgenerateTestExecution(result);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.getMessage();\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void writeTryLockFailedTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n int threadNum = 2;\n final CountDownLatch countDownLatch = new CountDownLatch(threadNum);\n for (int i = 0; i < threadNum; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n testUse.minusCountAndSleepInWriteTryLock(2000);\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n boolean result = false;\n if (testUse.count == 1000 || testUse.count == 999) {\n result = true;\n }\n Assert.assertTrue(result);\n }", "@BeforeTest\r\n\tpublic void checkTestSkip(){\r\n\t\t\t\t\r\n\t\t\t\tif(!TestUtil.isTestCaseRunnable(suite_cart_xls,this.getClass().getSimpleName())){\r\n\t\t\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\r\n\t\t\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\r\n\t\t\t\t}\r\n\trunmodes=TestUtil.getDataSetRunmodes(suite_cart_xls, this.getClass().getSimpleName());\t\r\n\t\t\t}", "@Override\n\tpublic void onTestFailure(ITestResult result) {\n\t\ttry {\n\t\t\tapitest = new ExcelAPI(obj.filepath);\n\t\t\tobj = (TestNGDataExlProvider) result.getInstance();\n\t\t\tXSSFCell cell = apitest.setCellData(obj.sheetName, \"Results\", obj.k,\"Fail\");\n\t\t\tapitest.setupFont(cell, HSSFColor.RED.index);\n\t\t\tapitest.createHyperlink(cell, \"F:\\\\Selenium\\\\webdriver\\\\LearnSeleniumAdvance\");\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 onTestFailure(ITestResult result) {\n \t\n \tSystem.out.println(\"The test case is failed :\"+result.getName());\n }", "private Predicate<Response> shouldErrorFailBuild(boolean skipFailures){\n return x -> skipFailures || x.isSuccessful();\n }", "@BeforeTest\n\t\t\tpublic void checkTestSkip(){\n\t\t\t\t\n\t\t\t\tif(!TestUtil.isTestCaseRunnable(suiteCxls,this.getClass().getSimpleName())){\n\t\t\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\n\t\t\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\n\t\t\t\t}\n\t\t\t\t\t\t}", "public void fail( String reason );", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "@Override\n\tpublic void onTestFailedButWithinSuccessPercentage(ITestResult result) {\n\t\t\n\t}", "void onTestSkipped(ITestResult result);", "@BeforeTest\n\tpublic void checkTestSkip()\n\t{\n\t\tAPP_LOGS.debug(\" Executing Test Case -> \"+this.getClass().getSimpleName());\n\t\t\n\t\tif(!TestUtil.isTestCaseRunnable(stakeholderDashboardSuiteXls,this.getClass().getSimpleName()))\n\t\t{\n\t\t\tAPP_LOGS.debug(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//logs\n\t\t\tthrow new SkipException(\"Skipping Test Case\"+this.getClass().getSimpleName()+\" as runmode set to NO\");//reports\n\t\t}\n\t\trunmodes=TestUtil.getDataSetRunmodes(stakeholderDashboardSuiteXls, this.getClass().getSimpleName());\n\t}" ]
[ "0.7688026", "0.7496475", "0.7229396", "0.7027582", "0.6874562", "0.6844606", "0.6835655", "0.6805579", "0.6762331", "0.67294645", "0.67185134", "0.66825265", "0.6650515", "0.65778595", "0.6542566", "0.65183556", "0.6409048", "0.63900006", "0.6388493", "0.6386784", "0.6353909", "0.6344207", "0.6341459", "0.63010895", "0.6275439", "0.62478876", "0.62405366", "0.62102014", "0.6192702", "0.6192702", "0.6192592", "0.6188508", "0.6177891", "0.61647815", "0.6163093", "0.6162703", "0.6139481", "0.6125406", "0.6119497", "0.6119327", "0.6105718", "0.60989034", "0.6097202", "0.6080192", "0.6076351", "0.6069528", "0.60689634", "0.6061684", "0.60514754", "0.60494107", "0.6046516", "0.6043639", "0.6025722", "0.59972733", "0.59972733", "0.59923506", "0.5963578", "0.5962141", "0.5961221", "0.595813", "0.5955777", "0.5914074", "0.59084886", "0.58989155", "0.58925027", "0.5888077", "0.5872694", "0.5871519", "0.58698356", "0.58688194", "0.5868411", "0.5868397", "0.5861169", "0.5853278", "0.5840872", "0.58276886", "0.5827405", "0.58261627", "0.5819519", "0.5814896", "0.5798355", "0.57907534", "0.5782823", "0.57808596", "0.57764167", "0.57725847", "0.5767743", "0.57672733", "0.57636154", "0.57600546", "0.57392627", "0.5736678", "0.5736678", "0.5736678", "0.5736678", "0.5736678", "0.5736678", "0.5736678", "0.57332075", "0.5722251" ]
0.70580363
3
Primary function used to teleport the player using doors. Performs numerous null checks, and also generates the destination door/pocket if it has not done so already. Also ensures correct orientation relative to the door.
public static void traverseDimDoor(World world, DimLink link, Entity entity) { if (world == null) { throw new IllegalArgumentException("world cannot be null."); } if (link == null) { throw new IllegalArgumentException("link cannot be null."); } if (entity == null) { throw new IllegalArgumentException("entity cannot be null."); } if (world.isRemote) { return; } if (cooldown == 0 || entity instanceof EntityPlayer) { cooldown = 2 + random.nextInt(2); } else { return; } if (!initializeDestination(link, DDProperties.instance())) { return; } entity = teleportEntity(entity, link.destination()); entity.worldObj.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mob.endermen.portal", 1.0F, 1.0F); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean teleport(Entity destination) {\n/* 571 */ return teleport(destination.getLocation());\n/* */ }", "public boolean movePlayer(Player p, Direction d) {\n\n\t\tLocation playerLoc = p.getLocation();\n\t\tTile playerTil = p.getTile();\n\t\tPosition playerPos = playerTil.getPos();\n\n\t\tTile newTile = null;\n\n\t\tswitch (d) {\n\n\t\tcase NORTH:\n\t\t\tnewTile = playerLoc.getTileInDirection(playerPos, Direction.NORTH);\n\t\t\tp.setFacing(Direction.NORTH);\n\t\t\tbreak;\n\t\tcase EAST:\n\t\t\tnewTile = playerLoc.getTileInDirection(playerPos, Direction.EAST);\n\t\t\tp.setFacing(Direction.EAST);\n\t\t\tbreak;\n\t\tcase WEST:\n\t\t\tnewTile = playerLoc.getTileInDirection(playerPos, Direction.WEST);\n\t\t\tp.setFacing(Direction.WEST);\n\t\t\tbreak;\n\t\tcase SOUTH:\n\t\t\tnewTile = playerLoc.getTileInDirection(playerPos, Direction.SOUTH);\n\t\t\tp.setFacing(Direction.SOUTH);\n\t\t\tbreak;\n\t\t}\n\n\t\tif (newTile != null) {\n\t\t\tif (newTile.getGameObject() == null) {\n\t\t\t\tif (newTile instanceof WaterTile) {\n\t\t\t\t\tif (!p.getHasFloatingDevice()) {\n\t\t\t\t\t\tserverController.broadcastPlayerMessage(\n\t\t\t\t\t\t\t\t\"It's deep blue and cold as ice, perhaps you require something to float on\", p);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (newTile instanceof DoorOutTile) {\n\t\t\t\t\tDoorOutTile dot = (DoorOutTile) newTile;\n\n\t\t\t\t\tif (board.getLocationById(dot.getOutLocationID()).getTileAtPosition(dot.getDoorPos())\n\t\t\t\t\t\t\t.getGameObject() != null) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tplayerTil.setGameObject(null);\n\n\t\t\t\t\tp.setLocation(dot.getOutLocationID());\n\t\t\t\t\tp.setTile(board.getLocationById(dot.getOutLocationID()).getTileAtPosition(dot.getDoorPos()));\n\n\t\t\t\t\tboard.getLocationById(dot.getOutLocationID()).getTileAtPosition(dot.getDoorPos()).setGameObject(p);\n\t\t\t\t\tp.setFacing(Direction.SOUTH);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\tplayerTil.setGameObject(null);\n\t\t\t\tnewTile.setGameObject(p);\n\t\t\t\tp.setTile(newTile);\n\t\t\t\tp.setLocation(board.getLocationById(newTile.getLocationID()));\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\ttriggerInteraction(p, newTile);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public void teleportToAstronaut() {\n\t\tAstronaut a;\n\t\tSpaceship sp;\n\t\tif(roamingAstronauts > 0) {\n\t\t\tsp = getTheSpaceship();\n\t\t\ta = getRandomAstronaut();\n\t\t\tsp.setLocation(a.getLocation());\n\t\t\tSystem.out.println(\"You've teleported to an astronaut. \\n Hope you didn't hit them.\");\n\t\t}\n\t\telse \n\t\t\tSystem.out.println(\"Error: Ther were no astronauts to jump to.\");\n\t}", "boolean teleport(Player p1, Player p2, boolean change);", "public void callOnTeleport() {\n\t\tif (summonedFamiliar != null && c.getInstance().summoned != null) {\n\t\t\tc.getInstance().summoned.killerId = 0;\n\t\t\tc.getInstance().summoned.underAttackBy = 0;\n\t\t\tc.getInstance().summoned.npcTeleport(0, 0, 0);\n\t\t\tc.getInstance().summoned.updateRequired = true;\n\t\t\tc.getInstance().summoned = Server.npcHandler.summonNPC(c, summonedFamiliar.npcId, c.getX(),\n\t\t\t\t\tc.getY() + (summonedFamiliar.large ? 2 : 1), c.heightLevel, 0, c.getInstance().summoned.HP, 1, 1,\n\t\t\t\t\t1);\n\t\t\tcallFamiliar();\n\t\t} else {\n\t\t\tc.getPA().sendSummOrbDetails(false, \"\");\n\t\t}\n\t}", "public void chasePlayer() {\n refreshObstructionMatrix();\n Coordinate currPosition = new Coordinate(getX(), getY());\n Player player = this.dungeon.getPlayer();\n Coordinate playerPosition = new Coordinate(player.getX(), player.getY());\n\n if (currPosition.equals(playerPosition)) {\n // Debug.printC(\"Enemy has reached the player!\", Debug.RED);\n player.useItem(this);\n } else {\n this.pathToDest = pathFinder.getPathToDest(currPosition, playerPosition);\n if (!this.pathToDest.empty()) {\n Coordinate nextPosition = this.pathToDest.pop();\n // this.setCoordinate(nextPosition);\n if (getX() + 1 == nextPosition.x) {\n moveRight();\n } else if (getX() - 1 == nextPosition.x) {\n moveLeft();\n } else if (getY() + 1 == nextPosition.y) {\n moveDown();\n } else if (getY() - 1 == nextPosition.y) {\n moveUp();\n }\n }\n }\n }", "@Override\n\tpublic Door MakeDoor(Room r1, Room r2) {\n\t\treturn new Door(r1, r2); \n\t}", "private void moveForwards() {\n\t\tposition = MoveAlgorithmExecutor.getAlgorithmFromCondition(orientation).execute(position);\n\t\t\n\t\t// Extracted the condition to check if tractor is in Ditch\n\t\tif(isTractorInDitch()){\n\t\t\tthrow new TractorInDitchException();\n\t\t}\n\t}", "public static boolean safeTeleport(Player toBeTeleported, Location toTeleport, boolean isFlying, boolean registerBackLocation, boolean... ignoreCooldown) throws CommandException {\n //Get SlapPlayer\n// SlapPlayer sp = PlayerControl.getPlayer(toBeTeleported);\n//\n// if ((ignoreCooldown.length > 0 && !ignoreCooldown[0]) || ignoreCooldown.length == 0) {\n// if (!sp.getTeleporter().canTeleport()) { //Check if able to teleport if cooldown\n// if (!Util.testPermission(toBeTeleported, \"tp.cooldownoverride\")) {\n// throw new CommandException(\"You'll need to wait a bit before teleporting agian!\");\n// }\n// }\n// }\n\n\n Location teleportTo = null;\n boolean tpUnder = false;\n\n Location fromLocation = toBeTeleported.getLocation();\n\n if (isFlying && !toBeTeleported.isFlying()) { //Target is flying while the player is not flying -> Find first block under target\n tpUnder = true;\n boolean creative = (toBeTeleported.getGameMode() == GameMode.CREATIVE); //Check if in creative\n for (Location loc = toTeleport; loc.getBlockY() > 0; loc.add(0, -1, 0)) { //Loop thru all blocks under target's location\n Material m = loc.getBlock().getType();\n if (m == Material.AIR) continue; //Looking for first solid\n if (m == Material.LAVA && !creative) { //If teleporting into lava && not in creative\n throw new CommandException(\"You would be teleported into Lava!\");\n }\n teleportTo = loc.add(0, 1, 0); //Set loc + 1 block above\n break;\n }\n } else { //Not flying\n teleportTo = toTeleport;\n }\n\n if (teleportTo == null) { //Check if location found\n throw new CommandException(\"Cannot teleport! Player above void!\");\n }\n\n toBeTeleported.teleport(teleportTo); //Teleport\n toBeTeleported.setVelocity(new Vector(0, 0, 0)); //Reset velocity\n\n// if (registerBackLocation) { //If registering back location\n// sp.getTeleporter().setBackLocation(fromLocation); //Set back location\n// }\n\n //Register teleport\n// sp.getTeleporter().teleported();\n\n return tpUnder;\n }", "public void teleport(boolean penalty) { \n\t\tPublisher teleport_h = new Publisher(\"/ariac_human/go_home\", \"std_msgs/Bool\", bridge);\n\t\tif(penalty)\t\n\t\t\tteleport_h.publish(new Bool(true));\t\n\t\telse\n\t\t\tteleport_h.publish(new Bool(false));\t\n\n\t\t// Reset \"smart\" orientation variables\n\t\tlastHumanState_MsgT = System.currentTimeMillis();\n\t\tlastUnsafeD_MsgT = System.currentTimeMillis();\n\t\tpreviousDistance = 50.0;\n\t\tisAproximating = false;\n\t}", "public void makeMove() {\n ArrayList<Field> myFields = new ArrayList<>();\n for (Field[] fieldsRow : fields) {\n for (Field field : fieldsRow) {\n if(field != null && this.equals(field.getPlayer())) {\n myFields.add(field);\n }\n }\n }\n bestMove[0] = myFields.get(0);\n bestMove[1] = myFields.get(0);\n\n Random rand = new Random();\n for(Field destination : destinationFields) {\n if(canMove()) break;\n destinationField = destination;\n for (Field origin : myFields) {\n for(int i = 0; i < origin.getNeighbours().length; ++i) {\n Field neighbour = origin.getNeighbours()[i];\n if(neighbour != null) {\n if(neighbour.getPlayer() == null) {\n if(valueOfMove(origin, neighbour) > valueOfMove(bestMove[0], bestMove[1])) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n } else if(valueOfMove(origin, neighbour) == valueOfMove(bestMove[0], bestMove[1])) {\n if(rand.nextBoolean()) {\n bestMove[0] = origin;\n bestMove[1] = neighbour;\n }\n }\n } else {\n Field nextField = neighbour.getNeighbours()[i];\n if(nextField != null) {\n correctJumpPaths(origin,null, origin);\n }\n }\n }\n }\n }\n }\n }", "public void makeMove(Location loc)\n {\n \tLocation curLoc = getLocation();\n \tint curDirection = getDirection();\n // get 2 left locations\n\t\tLocation leftNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.LEFT);\n Location leftNextNeighborLoc = leftNeighborLoc.getAdjacentLocation(curDirection + Location.LEFT);\n // get 2 right locations\n Location rightNeighborLoc = curLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n Location rightNextNeighborLoc = rightNeighborLoc.getAdjacentLocation(curDirection + Location.RIGHT);\n // initial a null\n Actor leftNeighborActor = null;\n Actor leftNextNeighborActor = null;\n Actor rightNeighborActor = null;\n Actor rightNextNeighborActor = null;\n\n boolean isLeftValid = false;\n boolean isRightValid = false;\n\n Grid<Actor> grid = getGrid();\n // if left valid\n if (grid.isValid(leftNeighborLoc) && grid.isValid(leftNextNeighborLoc))\n {\n \tleftNeighborActor = grid.get(leftNeighborLoc);\n \tleftNextNeighborActor = grid.get(leftNextNeighborLoc);\n \t\n \tif (leftNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisLeftValid = true;\n }\n }\n // if right valid\n if (grid.isValid(rightNeighborLoc) && grid.isValid(rightNextNeighborLoc))\n {\n \trightNeighborActor = grid.get(rightNeighborLoc);\n \trightNextNeighborActor = grid.get(rightNextNeighborLoc);\n\n \tif (rightNeighborActor == null && leftNextNeighborActor == null) {\n \t\tisRightValid = true;\n }\n }\n // if both valid\n if (isLeftValid && isRightValid)\n {\n\t // move ramdonly\n if (Math.random() < 0.5)\n\t {\n\t \tmoveTo(leftNextNeighborLoc);\n\t \n\t }\n\t else{\n\t \tmoveTo(rightNextNeighborLoc);\n\t }\n }\n // right valid only\n else if (isRightValid && !isLeftValid)\n {\n \tmoveTo(rightNextNeighborLoc);\n }\n // left valid only\n else if (!isRightValid && isLeftValid)\n {\n \tmoveTo(leftNextNeighborLoc);\n }\n else\n {\n \tsuper.makeMove(loc);\n }\n \n }", "private static void updateNeighbourTileDoors(Creature creature, int tilex, int tiley) {\n/* 2989 */ if (Tiles.isSolidCave(Tiles.decodeType(Server.caveMesh.getTile(tilex, tiley - 1)))) {\n/* */ \n/* 2991 */ VolaTile newTile = Zones.getOrCreateTile(tilex, tiley - 1, true);\n/* 2992 */ newTile.getSurfaceTile().doorCreatureMoved(creature, 0, 0);\n/* */ }\n/* */ else {\n/* */ \n/* 2996 */ VolaTile newTile = Zones.getOrCreateTile(tilex, tiley - 1, false);\n/* 2997 */ newTile.getCaveTile().doorCreatureMoved(creature, 0, 0);\n/* */ } \n/* */ \n/* */ \n/* 3001 */ if (Tiles.isSolidCave(Tiles.decodeType(Server.caveMesh.getTile(tilex + 1, tiley)))) {\n/* */ \n/* 3003 */ VolaTile newTile = Zones.getOrCreateTile(tilex + 1, tiley, true);\n/* 3004 */ newTile.getSurfaceTile().doorCreatureMoved(creature, 0, 0);\n/* */ }\n/* */ else {\n/* */ \n/* 3008 */ VolaTile newTile = Zones.getOrCreateTile(tilex + 1, tiley, false);\n/* 3009 */ newTile.getCaveTile().doorCreatureMoved(creature, 0, 0);\n/* */ } \n/* */ \n/* */ \n/* 3013 */ if (Tiles.isSolidCave(Tiles.decodeType(Server.caveMesh.getTile(tilex, tiley + 1)))) {\n/* */ \n/* 3015 */ VolaTile newTile = Zones.getOrCreateTile(tilex, tiley + 1, true);\n/* 3016 */ newTile.getSurfaceTile().doorCreatureMoved(creature, 0, 0);\n/* */ }\n/* */ else {\n/* */ \n/* 3020 */ VolaTile newTile = Zones.getOrCreateTile(tilex, tiley + 1, false);\n/* 3021 */ newTile.getCaveTile().doorCreatureMoved(creature, 0, 0);\n/* */ } \n/* */ \n/* */ \n/* 3025 */ if (Tiles.isSolidCave(Tiles.decodeType(Server.caveMesh.getTile(tilex - 1, tiley)))) {\n/* */ \n/* 3027 */ VolaTile newTile = Zones.getOrCreateTile(tilex - 1, tiley, true);\n/* 3028 */ newTile.getSurfaceTile().doorCreatureMoved(creature, 0, 0);\n/* */ }\n/* */ else {\n/* */ \n/* 3032 */ VolaTile newTile = Zones.getOrCreateTile(tilex - 1, tiley, false);\n/* 3033 */ newTile.getCaveTile().doorCreatureMoved(creature, 0, 0);\n/* */ } \n/* */ }", "@Override\r\n\tpublic boolean canTeleport() {\n\t\treturn false;\r\n\t}", "public void teleportToAlien() {\n\t\tAlien a;\n\t\tSpaceship sp;\n\t\tif(roamingAliens > 0){\n\t\t\tsp = getTheSpaceship();\n\t\t\ta = getRandomAlien();\n\t\t\tsp.setLocation(a.getLocation());\n\t\t\tSystem.out.println(\"You've teleported to an alien\");\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"Error: There were no aliens to jump to.\");\n\t}", "public static void makeEnemyMove() { //all players after index 1 are enemies\n if (gameMode == EARTH_INVADERS) {//find leftmost and rightmost vehicle columns to see if we need to move down\n int leftMost = board[0].length;\n int rightMost = 0;\n int lowest = 0;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {//find left-most, right-most and lowest most vehicles (non aircraft/train) to determine how formation should move\n Player curr = players[i];\n if (curr == null)\n continue;\n String name = curr.getName();\n if (name.equals(\"NONE\") || curr.isFlying() || name.startsWith(\"TRAIN\") || (curr instanceof Monster))\n continue;\n if (curr.getCol() < leftMost)\n leftMost = curr.getCol();\n if (curr.getCol() > rightMost)\n rightMost = curr.getCol();\n if (curr.getRow() > lowest)\n lowest = curr.getRow();\n curr.setHeadDirection(DOWN);\n }\n for (int i = FIRST_VEHICLE; i < players.length; i++) {//***move aircraft and trains\n Player curr = players[i];\n if (curr == null)\n continue;\n String name = curr.getName();\n if (name.equals(\"NONE\") || curr.isFlying() || name.startsWith(\"TRAIN\") || (curr instanceof Monster)) {\n if (curr.isMoving())\n continue;\n ArrayList<Integer> dirs = new ArrayList(); //array of preferred directions - everything but the reverse of their body position\n int bodyDir = curr.getBodyDirection();\n curr.clearDirections();\n int r = curr.getRow();\n int c = curr.getCol();\n if (bodyDir == UP) {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n }\n } else if (bodyDir == RIGHT) {\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n }\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n } else if (bodyDir == DOWN) {\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c + 1))\n dirs.add(RIGHT);\n }\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n } else //if(curr.getBodyDirection()==LEFT)\n {\n if (isValidMove(curr, r - 1, c))\n dirs.add(UP);\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r + 1, c))\n dirs.add(DOWN);\n }\n if (isValidMove(curr, r, c - 1))\n dirs.add(LEFT);\n }\n int rand = 0;\n if (dirs.size() > 0)\n rand = dirs.get((int) (Math.random() * dirs.size()));\n if (curr.isFlying()) { //if aircraft is flying in the visible board, don't change direction\n if (r == 1 && (c == 0 || c == board[0].length - 1)) //we are in the first row but behind a border\n { //we only want aircraft to appear in row 1 in EARTH INVADERS (like the UFO in space invaders)\n if (bodyDir == LEFT || bodyDir == RIGHT) {\n rand = UP;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (c == 0)\n rand = RIGHT;\n else if (c == board[0].length - 1)\n rand = LEFT;\n else\n //if(dirs.contains(bodyDir))\n rand = bodyDir;\n } else if (r == 0 || c == 0 || r == board.length - 1 || c == board[0].length - 1) {\n rand = bodyDir;\n if (r == 0 && c == 0) {\n rand = RIGHT;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (r == 0 && c == board[0].length - 1) {\n rand = LEFT;\n if (Math.random() < .5)\n rand = DOWN;\n } else if (r == board.length - 1 && c == 0) {\n rand = RIGHT;\n if (Math.random() < .5)\n rand = UP;\n } else if (r == board.length - 1 && c == board[0].length - 1) {\n rand = LEFT;\n if (Math.random() < .5)\n rand = UP;\n }\n } else if (/*dirs.contains(bodyDir) && */(r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1))\n rand = bodyDir; //make it so aircraft prefer to keep going the same direciton\n\n } else if (name.startsWith(\"TRAIN\")) {//make it so trains prefer to follow the right wall\n for (int j = 0; j < dirs.size(); j++)\n if (dirs.get(j) != bodyDir) {\n rand = dirs.get(j);\n break;\n }\n }\n curr.setDirection(rand);\n curr.setBodyDirection(rand);\n }\n }//***end aircraft/train movement\n if (leftMost == 1) //move vehicles down and start them moving right\n {\n if (EI_moving == LEFT) {\n EI_moving = DOWN;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (lowest < board.length - 3 && !curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setRow(curr.getRow() + 1);\n }\n } else if (EI_moving == DOWN) {\n EI_moving = RIGHT;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\")) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n }\n }\n } else if (EI_moving == RIGHT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(RIGHT);\n }\n }//***end leftmost is first col\n else if (rightMost == board[0].length - 2) //move vehicles down and start them moving left\n {\n if (EI_moving == RIGHT) {\n EI_moving = DOWN;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (lowest < board.length - 3 && !curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setRow(curr.getRow() + 1);\n }\n } else if (EI_moving == DOWN) {\n EI_moving = LEFT;\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\")) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n }\n }\n } else if (EI_moving == LEFT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(LEFT);\n }\n }//***end rightmost is last col\n else if (EI_moving == LEFT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(LEFT);\n }\n else if (EI_moving == RIGHT)\n for (int i = FIRST_VEHICLE; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n if (!curr.isFlying() && !curr.getName().startsWith(\"TRAIN\"))\n curr.setDirection(RIGHT);\n }\n return;\n }//***end EARTH INVADERS enemy movements\n for (int i = 2; i < players.length; i++) {\n Player curr = players[i];\n if (curr == null || curr.getName().equals(\"NONE\"))\n continue;\n String name = curr.getName();\n int r = curr.getRow();\n int c = curr.getCol();\n if (r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1 && (curr instanceof Vehicle))\n ((Vehicle) (curr)).setOnField(true);\n\n if (curr.isFlying() && webs[panel].size() > 0) {\n int x = curr.findX(cellSize);\n int y = curr.findY(cellSize);\n for (int p = 0; p < webs[panel].size(); p++) {\n int[] ray = webs[panel].get(p);\n if (Utilities.isPointOnRay(x, y, ray[0], ray[1], ray[2], ray[3])) {\n explosions.add(new Explosion(\"BIG\", x, y, explosionImages, animation_delay));\n Ordinance.radiusDamage(-1, x, y, 25, panel, .5);\n Spawner.resetEnemy(i);\n webs[panel].remove(p);\n p--;\n Structure str1 = structures[ray[4]][ray[5]][panel];\n Structure str2 = structures[ray[6]][ray[7]][panel];\n if (str1 != null)\n str1.setWebValue(0);\n if (str2 != null)\n str2.setWebValue(0);\n Utilities.updateKillStats(curr);\n break;\n }\n }\n }\n //reset any ground vehicle that ended up in the water\n //reset any train not on tracks - we need this because a player might change panels as a vehicle spawns\n if (name.startsWith(\"TRAIN\")) {\n Structure str = structures[r][c][panel];\n if (str != null && str.getName().equals(\"hole\") && str.getHealth() != 0) {\n explosions.add(new Explosion(\"BIG\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Utilities.updateKillStats(curr);\n Spawner.resetEnemy(i);\n continue;\n } else if (board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"BIG\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n } else if (!board[r][c][panel].startsWith(\"T\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else //ground vehicles\n if (!curr.isFlying() && !curr.getName().startsWith(\"BOAT\") && (curr instanceof Vehicle)) {\n\n if (((Vehicle) (curr)).getStunTime() > numFrames) //ground unit might be stunned by WoeMantis shriek\n continue;\n if (board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else //reset any water vehicle that ended up on land\n if (name.startsWith(\"BOAT\")) {\n if (!board[r][c][panel].startsWith(\"~\")) {\n explosions.add(new Explosion(\"SMALL\", curr.getX() - (cellSize / 2), curr.getY() - (cellSize / 2), puffImages, animation_delay));\n Spawner.resetEnemy(i);\n continue;\n }\n } else if (curr.getHealth() <= 0) {\n Spawner.resetEnemy(i);\n continue;\n }\n\n //if a ground unit has been on the playable field and leaves it, respawn them\n if (!curr.isFlying() && !name.startsWith(\"TRAIN\") && (curr instanceof Vehicle)) {\n if ((r == 0 || c == 0 || r == board.length - 1 || c == board[0].length - 1) && ((Vehicle) (curr)).getOnField()) {\n ((Vehicle) (curr)).setOnField(false);\n Spawner.resetEnemy(i);\n continue;\n }\n }\n if (name.endsWith(\"nukebomber\")) {//for the nukebomber, set the detonation coordinates so nuke fires when the plane exits the field\n int dr = curr.getDetRow();\n int dc = curr.getDetCol();\n int bd = curr.getBodyDirection();\n int dd = curr.getDetDir();\n if (bd == dd && (((bd == LEFT || bd == RIGHT) && c == dc) || (bd == UP || bd == DOWN) && r == dr)) {\n Ordinance.nuke();\n curr.setDetRow(-1);\n curr.setDetCol(-1);\n }\n }\n\n if (curr.isMoving())\n continue;\n int bodyDir = curr.getBodyDirection();\n curr.clearDirections();\n int[] target = isMonsterInSight(curr);\n int mDir = target[0]; //direction of the monster, -1 if none\n int monsterIndex = target[1]; //index of the monster in the players array, -1 if none\n ArrayList<Integer> dirs = new ArrayList(); //array of preferred directions - everything but the reverse of their body position\n if (bodyDir == UP) {\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n }\n } else if (bodyDir == RIGHT) {\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n }\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n } else if (bodyDir == DOWN) {\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r, c + 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == RIGHT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(RIGHT);\n }\n }\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n } else //if(curr.getBodyDirection()==LEFT)\n {\n\n if (isValidMove(curr, r - 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == UP) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(UP);\n }\n if (!name.startsWith(\"TRAIN\")) //trains need to follow the track circuit - only straight and right turns\n {\n if (isValidMove(curr, r + 1, c)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == DOWN) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(DOWN);\n }\n }\n if (isValidMove(curr, r, c - 1)) {\n if (Utilities.nonFlyingCivilian(name) && mDir == LEFT) {\n }//civilians don't want to move towards the monster if it is in direct sight\n else\n dirs.add(LEFT);\n }\n }\n\n if (dirs.size() > 0) {\n if (curr instanceof Monster) {//***MONSTER AI*******************\n double headTurnProb = 0.25;\n double stompProb = 0.5;\n int vDir = isVehicleInSight(curr);\n if (vDir >= 0) {\n boolean airShot = false;\n int vD = vDir;\n if (vD >= 10) {\n airShot = true;\n vD -= 10;\n }\n if (curr.head360() || !Utilities.oppositeDirections(vD, curr.getHeadDirection())) {\n curr.setHeadDirection(vD);\n if ((curr.getName().startsWith(\"Gob\") || curr.getName().startsWith(\"Boo\")) && numFrames >= curr.getLastShotTime() + curr.getReloadTime()) {\n Bullet temp = null;\n if (curr.getName().startsWith(\"Boo\")) {\n temp = new Bullet(curr.getName() + vD, curr.getX(), curr.getY(), 50, beamImages, SPEED, \"BEAM\", SPEED * 10, airShot, i, -1, -1);\n } else if (curr.getName().startsWith(\"Gob\")) {\n temp = new Bullet(\"flame\" + vD, curr.getX(), curr.getY(), 15, monsterFireImages, SPEED, \"FIRE\", SPEED * 4, airShot, i, -1, -1);\n }\n if (temp != null) {\n temp.setDirection(vD);\n bullets.add(temp);\n curr.setLastShotTime(numFrames);\n continue;\n }\n }\n }\n } else if (Math.random() < headTurnProb) {\n String hd = \"right\";\n if (Math.random() < .5)\n hd = \"left\";\n Utilities.turnHead(curr, hd);\n }\n Structure str = structures[r][c][panel];\n if (str != null && str.getHealth() > 0 && str.isDestroyable() && !str.getName().startsWith(\"FUEL\") && Math.random() < stompProb)\n playerMove(KeyEvent.VK_SPACE, i);\n else {\n int dir = dirs.get((int) (Math.random() * dirs.size()));\n if (dir == UP) {\n if (curr.getBodyDirection() != UP) {\n curr.setBodyDirection(UP);\n curr.setHeadDirection(UP);\n } else {\n if (!curr.isSwimmer() && board[r - 1][c][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (r - 1 >= 1) {\n str = structures[r - 1][c][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_UP, i);\n }\n } else if (dir == DOWN) {\n if (curr.getBodyDirection() != DOWN) {\n curr.setBodyDirection(DOWN);\n curr.setHeadDirection(DOWN);\n } else {\n if (!curr.isSwimmer() && board[r + 1][c][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (r + 1 <= structures.length - 1) {\n str = structures[r + 1][c][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_DOWN, i);\n }\n } else if (dir == LEFT) {\n if (curr.getBodyDirection() != LEFT) {\n curr.setBodyDirection(LEFT);\n curr.setHeadDirection(LEFT);\n } else {\n if (!curr.isSwimmer() && board[r][c - 1][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (c - 1 >= 1) {\n str = structures[r][c - 1][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_LEFT, i);\n }\n } else if (dir == RIGHT) {\n if (curr.getBodyDirection() != RIGHT) {\n curr.setBodyDirection(RIGHT);\n curr.setHeadDirection(RIGHT);\n } else {\n if (!curr.isSwimmer() && board[r][c + 1][panel].equals(\"~~~\") && !board[r][c][panel].equals(\"~~~\")) {\n continue;\n }\n if (c + 1 <= board[0].length - 1) {\n str = structures[r][c + 1][panel]; //don't walk into a fire\n if (str != null && str.onFire())\n continue;\n }\n playerMove(KeyEvent.VK_RIGHT, i);\n }\n }\n }\n continue;\n }//end monster AI movement\n else //shoot at a target\n if (name.endsWith(\"troops\") || name.endsWith(\"jeep\") || name.endsWith(\"police\") || name.startsWith(\"TANK\") || name.endsWith(\"coastguard\") || name.endsWith(\"destroyer\") || name.endsWith(\"fighter\") || name.equals(\"AIR bomber\")) {\n boolean airShot = false;\n if (gameMode == EARTH_INVADERS) //we don't want vehicles to shoot each other\n {\n airShot = true;\n curr.setHeadDirection(DOWN);\n }\n if (monsterIndex >= 0 && monsterIndex < players.length && players[monsterIndex].isFlying())\n airShot = true;\n if (curr.getName().endsWith(\"fighter\"))\n curr.setDirection(bodyDir); //keep moving while shooting\n if (mDir != -1 && curr.getRow() > 0 && curr.getCol() > 0 && curr.getRow() < board.length - 1 && curr.getCol() < board[0].length - 1) { //don't shoot from off the visible board\n if ((mDir == bodyDir || ((curr.getName().startsWith(\"TANK\") || curr.getName().endsWith(\"jeep\") || name.equals(\"AIR bomber\")) && (mDir == curr.getHeadDirection() || name.equals(\"AIR bomber\")))) && numFrames >= curr.getLastShotTime() + curr.getReloadTime()) { //AIR bomber needs to be able to drop bombs if they see the monster in front of them or behind them, so we need to check the name in two conditions\n Bullet temp;\n if (name.endsWith(\"jeep\") || name.endsWith(\"coastguard\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 65, (int) (Math.random() * 10) + 30);\n temp = new Bullet(\"jeep\" + mDir, curr.getX(), curr.getY(), 5, machBulletImages, SPEED, \"BULLET\", SPEED * 6, airShot, i, -1, -1);\n } else if (name.endsWith(\"troops\") || name.endsWith(\"police\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 70, (int) (Math.random() * 10) + 20);\n temp = new Bullet(\"troops\" + mDir, curr.getX(), curr.getY(), 3, bulletImages, SPEED, \"BULLET\", SPEED * 6, airShot, i, -1, -1);\n } else if (name.endsWith(\"destroyer\") || name.endsWith(\"artillery\")) {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 45, (int) (Math.random() * 10) + 85);\n temp = new Bullet(\"destroyer\" + mDir, curr.getX(), curr.getY(), 15, shellImages, SPEED, \"SHELL\", SPEED * 3, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n } else if (name.endsWith(\"fighter\")) {\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n temp = new Bullet(\"fighter\" + mDir, curr.getX(), curr.getY(), 30, rocketImages, SPEED, \"SHELL\", SPEED * 8, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n } else if (name.endsWith(\"missile\")) {\n temp = new Bullet(\"missile\" + mDir, curr.getX(), curr.getY(), 50, rocketImages, SPEED, \"SHELL\", SPEED * 3, true, i, players[monsterIndex].findX(cellSize), players[monsterIndex].findY(cellSize));\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n } else if (name.endsWith(\"flame\")) {\n temp = new Bullet(\"flame\" + mDir, curr.getX(), curr.getY(), 15, monsterFireImages, SPEED, \"FIRE\", SPEED * 4, airShot, i, -1, -1);\n channels[0].programChange(instr[TAIKO].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 10) + 5, (int) (Math.random() * 10) + 40);\n } else if (name.equals(\"AIR bomber\")) {\n temp = null;\n if (!DISABLE_BOMBERS) {\n int mR = players[PLAYER1].getRow(); //main player row & col\n int mC = players[PLAYER1].getCol();\n int mR2 = -99; //possible 2nd monster row & col\n int mC2 = -99;\n if (p1partner) {\n mR2 = players[PLAYER2].getRow();\n mC2 = players[PLAYER2].getCol();\n }\n if (players[PLAYER1].getHealth() > 0 && (Math.abs(r - mR) <= 2 || Math.abs(c - mC) <= 2 || Math.abs(r - mR2) <= 2 || Math.abs(c - mC2) <= 2)) {//our bomber is in the same row & col as a monster + or - 1\n if (bodyDir == UP && r < board.length - 1) {\n Ordinance.bigExplosion(curr.getX(), curr.getY() + (cellSize * 2), panel);\n Ordinance.radiusDamage(-1, curr.getX(), curr.getY() + (cellSize * 2), 50, panel, .25);\n } else if (bodyDir == DOWN && r > 1) {\n Ordinance.bigExplosion(curr.getX(), curr.getY() - (cellSize * 2), panel);\n Ordinance.radiusDamage(-1, curr.getX(), curr.getY() - (cellSize * 2), 50, panel, .25);\n } else if (bodyDir == RIGHT && c < board[0].length - 1) {\n Ordinance.bigExplosion(curr.getX() - (cellSize * 2), curr.getY(), panel);\n Ordinance.radiusDamage(-1, curr.getX() - (cellSize * 2), curr.getY(), 50, panel, .25);\n } else if (bodyDir == LEFT && c > 1) {\n Ordinance.bigExplosion(curr.getX() + (cellSize * 2), curr.getY(), panel);\n Ordinance.radiusDamage(-1, curr.getX() + (cellSize * 2), curr.getY(), 50, panel, .25);\n }\n }\n }\n } else {\n channels[0].programChange(instr[GUNSHOT].getPatch().getProgram());\n channels[0].noteOn((int) (Math.random() * 6) + 45, (int) (Math.random() * 10) + 85);\n temp = new Bullet(\"\" + mDir, curr.getX(), curr.getY(), 15, shellImages, SPEED, \"SHELL\", SPEED * 5, airShot, i, -1, -1);\n }\n if (temp != null)\n temp.setDirection(mDir);\n\n if (name.endsWith(\"troops\") || name.endsWith(\"police\") && Math.random() < .5) //make the police move towards the monster half the time\n {\n if (mDir == UP && isValidMove(curr, curr.getRow() - 1, curr.getCol()))\n curr.setDirection(UP);\n else if (mDir == DOWN && isValidMove(curr, curr.getRow() + 1, curr.getCol()))\n curr.setDirection(DOWN);\n else if (mDir == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() - 1))\n curr.setDirection(LEFT);\n else if (mDir == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() + 1))\n curr.setDirection(RIGHT);\n else\n curr.setDirection(-1);\n }\n if (temp != null && players[PLAYER1].getHealth() > 0) {\n if (gameMode == EARTH_INVADERS && !curr.isFlying()) {\n } else {\n if (numFrames >= ceaseFireTime + ceaseFireDuration || gameMode == EARTH_INVADERS) {\n bullets.add(temp);\n curr.setLastShotTime(numFrames);\n continue;\n }\n }\n }\n } else //change to face the monster to line up a shot\n {\n if (name.endsWith(\"troops\") || name.endsWith(\"police\") || name.endsWith(\"destroyer\") || name.endsWith(\"coastguard\") || name.endsWith(\"artillery\")) {\n curr.setDirection(-1); //stop to shoot\n curr.setBodyDirection(mDir);\n } else if (curr.getName().startsWith(\"TANK\") || curr.getName().endsWith(\"jeep\"))\n curr.setHeadDirection(mDir);\n continue;\n }\n }\n }\n int rand = dirs.get((int) (Math.random() * dirs.size()));\n if (curr.isFlying() && (r > 0 && c > 0 && r < board.length - 1 && c < board[0].length - 1)) {\n rand = bodyDir; //make it so aircraft prefer to keep going the same direciton\n } else if (name.startsWith(\"TRAIN\")) {//make it so trains prefer to follow the right wall\n for (int j = 0; j < dirs.size(); j++)\n if (dirs.get(j) != bodyDir) {\n rand = dirs.get(j);\n break;\n }\n }\n curr.setDirection(rand);\n curr.setBodyDirection(rand);\n\n continue;\n }\n //if no preferred direction, include the option to turn around\n //civilians should prefer to turn around rather than approach the monster\n if (name.endsWith(\"civilian\") || name.endsWith(\"bus\")) {\n if (bodyDir == mDir) //if we are facing the same direction as the monster, turn around\n {\n if (bodyDir == UP && isValidMove(curr, curr.getRow() + 1, curr.getCol())) {\n curr.setDirection(DOWN);\n curr.setBodyDirection(DOWN);\n continue;\n } else if (bodyDir == DOWN && isValidMove(curr, curr.getRow() - 1, curr.getCol())) {\n curr.setDirection(UP);\n curr.setBodyDirection(UP);\n continue;\n } else if (bodyDir == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() + 1)) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n continue;\n } else if (bodyDir == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() - 1)) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n continue;\n }\n }\n }\n int rand = (int) (Math.random() * 4);\n if (rand == UP && isValidMove(curr, curr.getRow() - 1, curr.getCol())) {\n curr.setDirection(UP);\n curr.setBodyDirection(UP);\n continue;\n }\n if (rand == DOWN && isValidMove(curr, curr.getRow() + 1, curr.getCol())) {\n curr.setDirection(DOWN);\n curr.setBodyDirection(DOWN);\n continue;\n }\n if (rand == LEFT && isValidMove(curr, curr.getRow(), curr.getCol() - 1)) {\n curr.setDirection(LEFT);\n curr.setBodyDirection(LEFT);\n continue;\n }\n if (rand == RIGHT && isValidMove(curr, curr.getRow(), curr.getCol() + 1)) {\n curr.setDirection(RIGHT);\n curr.setBodyDirection(RIGHT);\n continue;\n }\n\n }\n }", "public Door() {\n // needs to set defaults\n d20 = new D20();\n d10 = new D10();\n d6 = new D6();\n trapState = false;\n openState = false;\n archwayState = false;\n\n if (d10.roll() == 1) {\n // Is an archways\n archwayState = true;\n trapState = false;\n openState = true;\n } else {\n archwayState = false;\n // Is a door\n if (d20.roll() == 1) {\n\n trapState = true;\n } else {\n trapState = false;\n }\n\n if (d6.roll() == 1) {\n openState = false;\n } else {\n openState = true;\n }\n }\n myTrap = null;\n mySpaceList = new ArrayList<Space>();\n\n doorDescription = getDescription();\n }", "public void randomTeleport() {\n Random random = new Random(seed);\n seed = random.nextInt(10000);\n int randomY = RandomUtils.uniform(random, 0, worldHeight);\n int randomX = RandomUtils.uniform(random, 0, worldWidth);\n int randomDirection = RandomUtils.uniform(random, 0, 4);\n move(randomX, randomY);\n turn(randomDirection);\n }", "@EventHandler(priority = EventPriority.LOWEST)\n\tpublic void onPlayerTeleport(PlayerTeleportEvent event)\n\t{\n\t Player player = event.getPlayer();\n\t\tPlayerData playerData = this.dataStore.getPlayerData(player.getUniqueId());\n\t\t\n\t\t//FEATURE: prevent players from using ender pearls to gain access to secured claims\n\t\tTeleportCause cause = event.getCause();\n\t\tif(cause == TeleportCause.CHORUS_FRUIT || (cause == TeleportCause.ENDER_PEARL && instance.config_claims_enderPearlsRequireAccessTrust))\n\t\t{\n\t\t\tClaim toClaim = this.dataStore.getClaimAt(event.getTo(), false, playerData.lastClaim);\n\t\t\tif(toClaim != null)\n\t\t\t{\n\t\t\t\tplayerData.lastClaim = toClaim;\n\t\t\t\tString noAccessReason = toClaim.allowAccess(player);\n\t\t\t\tif(noAccessReason != null)\n\t\t\t\t{\n\t\t\t\t\tinstance.sendMessage(player, TextMode.Err, noAccessReason);\n\t\t\t\t\tevent.setCancelled(true);\n\t\t\t\t\tif(cause == TeleportCause.ENDER_PEARL)\n\t\t\t\t\t player.getInventory().addItem(new ItemStack(Material.ENDER_PEARL));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void teleportPlayer(GamePlayer player, List<Location> spawnpoint) {\r\n\t\tRandom rand = new Random();\r\n\t\tLocation spawn = spawnpoint.get(rand.nextInt(spawnpoint.size()));\r\n\t\t\r\n\t\tplayer.getPlayer().setSaturation(100000);\r\n\t\tplayer.getPlayer().setHealth(20);\r\n\t\tplayer.getPlayer().teleport(spawn);\r\n\t\tgiveStuff(player);\r\n\t}", "@Test\n\t\t\tpublic void doorwayAdjacentSpots() {\n\t\t\t\t//Tests a left doorway for the spot to its left\n\t\t\t\tSet<BoardCell> testList = board.getAdjList(0, 18);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(0, 17)));\n\t\t\t\t//Tests a right door for the spot on its right\n\t\t\t\ttestList = board.getAdjList(17, 4);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(17, 5)));\n\t\t\t\t//Tests a down door for the space below\n\t\t\t\ttestList = board.getAdjList(5, 15);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(6, 15)));\n\t\t\t\t//Tests an up door with the space above\n\t\t\t\ttestList = board.getAdjList(14, 9);\n\t\t\t\tassertTrue(testList.contains(board.getCellAt(13, 9)));\n\t\t\t\n\t\t\t}", "public boolean teleport ( Entity destination , PlayerTeleportEvent.TeleportCause cause ) {\n\t\treturn invokeSafe ( \"teleport\" , destination , cause );\n\t}", "private static void goThroughPassage(Player player) {\n int x = player.getAbsX();\n player.getMovement().teleport(x == 2970 ? x + 4 : 2970, 4384, player.getHeight());\n }", "static private void npcPath() {\n\n if (Time.secondsPassed % 45 == 44) {\n Random picker = new Random();\n while (true) {\n if (josephSchnitzel.getCurrentRoom().equals(mountain)) {\n String[] newRoomString = {\"south\"};\n int index = picker.nextInt(newRoomString.length);\n Room next = josephSchnitzel.getCurrentRoom().getExit(newRoomString[index]);\n josephSchnitzel.setCurrentRoom(next);\n break;\n }\n\n if (josephSchnitzel.getCurrentRoom().equals(beach)) {\n String[] newRoomString = {\"north\"};\n int indexOfNewRoomString = picker.nextInt(newRoomString.length);\n Room nextRoom = josephSchnitzel.getCurrentRoom().getExit(newRoomString[indexOfNewRoomString]);\n josephSchnitzel.setCurrentRoom(nextRoom);\n break;\n }\n\n if (josephSchnitzel.getCurrentRoom().equals(jungle)) {\n String[] newRoomString = {\"north\", \"south\"};\n int indexOfNewRoomString = picker.nextInt(newRoomString.length);\n Room nextRoom = josephSchnitzel.getCurrentRoom().getExit(newRoomString[indexOfNewRoomString]);\n josephSchnitzel.setCurrentRoom(nextRoom);\n break;\n }\n }\n }\n }", "public boolean doorTicker()\n\t{\n\t\tif(!isDoor)\n\t\t\treturn false;\n\t\tif(stateOfDoor!=this.DOOR_STATE_OPENING)\n\t\t\treturn false;\n\t\t\n\t\t//Now, find angle to (x2,y2) (which is the moving end of the wall)\n\t\t//to (x1,y2) relative to (originalX,originalY) which is a copy of x2,y2\n\t\t//set x2,y2 so that the angle is now a little larger, if that angle is now\n\t\t//greater than PI/2, set the stateOfDoor as OPEN\n\t\t\n\t\tdouble angleTo2 = this.angleToSide2(x1,y1);\n\t\t\n\t\tdouble newAngle;\n\t\t\n\t\tif(swingingWay1)\n\t\t{\n\t\t\tnewAngle= angleTo2 + ANGLE_CHANGE;\n\t\t\tticks++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewAngle= angleTo2 - ANGLE_CHANGE;\n\t\t\tticks--;\n\t\t}\n\t\t\n\t\t//distance from pivot\n\t\tdouble dx = this.length()*Math.cos(newAngle);\n\t\tdouble dy = this.length()*Math.sin(newAngle);\n\t\t\n\t\tx2 = x1+dx;\n\t\ty2 = y1+dy;\n\n\t\t//BECAUSE X2 and Y2 have changed, certain values need to be recalculated so that it paints ok\n\t\tmx = (x1+x2)/2;\n\t\tmy = (y1+y2)/2;\n\t\tif(x1!=x2)\n\t\t{\n\t\t\tm = (this.y1-this.y2)/(this.x1-this.x2);\n\t\t\tb = y1-m*this.x1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tm = 0;\n\t\t\tb = 0;\n\t\t}\n\t\t\n\t\t\n\t\t//now check if the door is all the way open\n\t\tdouble angleToOriginal = this.angleToOriginal(x1,y1);\n\t\t\n\t\t//if((newAngle-angleToOriginal>Math.PI/2)||(newAngle-angleToOriginal<-Math.PI/2))\n\t\t//if(ArtWork.isBetween(angleToOriginal-3*Math.PI/4, ArtWork.normalizeAngle(angleToOriginal+3*Math.PI/4), newAngle))\n\t\tif((ticks*ANGLE_CHANGE>Math.PI/2)||(ticks*ANGLE_CHANGE<-Math.PI/2))\n\t\t\tstateOfDoor=this.DOOR_STATE_OPEN;//stop!\n\t\t\n\t\treturn true;\n\t}", "static void Door2challenge() {\n System.out.println(\"Ready! 3...2...1...GO!\");\n System.out.println(\"Where do you want to go? Left, Right, or Straight\");\n direction = next.nextLine();\n //this is where the player will decide where to go\n //the rest of the maze will branch off from this decision. These choices will have the same outcome.\n \n if(direction.contains(\"left\")) {\n door2challenge_leftpath();\n //player enters the left branch maze\n \n }else if(direction.contains(\"right\")){\n door2challenge_rightpath();\n //player enters the right branch of the maze\n \n }else if(direction.contains(\"straight\")){\n door2challenge_straightpath();\n //player enters the straight branch of the maze\n }else{\n System.out.println(\"I don't understand...type it correctly!!!\");\n Door2challenge();\n }\n \n }", "private void goDirection(Command command) {\n String direction = command.getFirstParameter();\n Room nextRoom = currentRoom.nextRoom(direction);\n\n // try to leave current room\n if (nextRoom == null) {\n System.out.println(\"There is no door!\");\n } else {\n currentRoom = nextRoom;\n }\n }", "private static void addDoorsUD(Room roomAdjacent, Room roomCurrent) {\n\t\tA_Passage pass = new PassageVertical(roomAdjacent, roomCurrent);\n\t\t_maze.addPassage(pass);\n\t\troomAdjacent.addDoor(pass.getDoorFirst());\n\t\troomCurrent.addDoor(pass.getDoorSecond());\n\t\t_interactive.addArray(new I_UserInteract[] { roomAdjacent, roomCurrent,\n\t\t\t\tpass, pass.getDoorFirst(), pass.getDoorSecond() });\n\t}", "public Location teleport(LivingEntity entity, boolean safe, boolean centerEntity, boolean allowWater, TeleportCause tpCause) {\r\n\t\t// get the safe tp location\r\n\t\tLocation tpLocation = destination.clone();\r\n\t\t\r\n\t\tif(centerEntity)\r\n\t\t\ttpLocation = new Location(\r\n\t\t\t\t\ttpLocation.getWorld(), \r\n\t\t\t\t\ttpLocation.getBlockX() + 0.5, \r\n\t\t\t\t\ttpLocation.getBlockY(), \r\n\t\t\t\t\ttpLocation.getBlockZ() + 0.5, \r\n\t\t\t\t\ttpLocation.getYaw(), \r\n\t\t\t\t\ttpLocation.getPitch());\r\n\t\t\r\n\t\t// if we want the tp to be safe, get the safe location\r\n\t\tif(safe)\r\n\t\t\ttpLocation = getSafePoint(tpLocation, allowWater, (int)entity.getEyeHeight());\r\n\t\t\r\n\t\t// if null, no safe location found, return null\r\n\t\tif(tpLocation == null)\r\n\t\t\treturn null;\r\n\t\tHashMap<Entity, List<Entity>> ridingEntities = new HashMap<Entity, List<Entity>>();\r\n\t\t\r\n\t\t// loop all the passengers\r\n\t\tLinkedList<Entity> passengers = new LinkedList<Entity>();\r\n\t\tpassengers.add(entity);\r\n\t\t\r\n\t\t// add all the entities into the hashmap\r\n\t\tEntity passenger_ = null;\r\n\t\twhile(!passengers.isEmpty()) {\r\n\t\t\tpassenger_ = passengers.pop();\r\n\t\t\tpassengers.addAll(passenger_.getPassengers());\r\n\t\t\t\r\n\t\t\tridingEntities.put(passenger_, passenger_.getPassengers());\r\n\t\t\t// unseat the riding entites\r\n\t\t\tentity.eject();\r\n\t\t}\r\n\t\t\r\n\t\t// entities to remove from the riding thing\r\n\t\tList<Entity> toRemove = new ArrayList<Entity>();\r\n\t\t\r\n\t\t// teleport all players to the new location\r\n\t\tfor(Entity entity_ : ridingEntities.keySet()) {\r\n\t\t\tif(!entity_.teleport(tpLocation, tpCause))\r\n\t\t\t\ttoRemove.add(entity_);\r\n\t\t}\r\n\t\t\r\n\t\t// remove any mounts that may have failed to teleport\r\n\t\tfor(Entity ent : toRemove)\r\n\t\t\tridingEntities.remove(ent);\r\n\t\t\r\n\t\t// mount the entities\r\n\t\tfor(Entry<Entity, List<Entity>> entry : ridingEntities.entrySet()) {\r\n\t\t\t// seat all the passengers except those which failed to teleport\r\n\t\t\tfor(Entity ent : entry.getValue()) {\r\n\t\t\t\tif(toRemove.contains(ent))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\tentry.getKey().addPassenger(ent);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn tpLocation;\r\n\t}", "void scheduleNextDestination(Passenger passenger, Floor currentFloor);", "public void sendTeleport(final Player player) {\r\n player.lock();\r\n World.submit(new Pulse(1) {\r\n\r\n int delay = 0;\r\n\r\n @Override\r\n public boolean pulse() {\r\n if (delay == 0) {\r\n player.getActionSender().sendMessage(\"You've been spotted by an elemental and teleported out of its garden.\");\r\n player.graphics(new Graphics(110, 100));\r\n player.getInterfaceState().openComponent(8677);\r\n PacketRepository.send(MinimapState.class, new MinimapStateContext(player, 2));\r\n face(player);\r\n } else if (delay == 6) {\r\n player.getProperties().setTeleportLocation(Location.create(getRespawnLocation()));\r\n PacketRepository.send(MinimapState.class, new MinimapStateContext(player, 0));\r\n player.getInterfaceState().close();\r\n face(null);\r\n player.unlock();\r\n return true;\r\n }\r\n delay++;\r\n return false;\r\n }\r\n });\r\n }", "@Test\n\tpublic void FourDoorDirections() {\n\t\tBoardCell room = board.getCellAt(2, 2);\n\t\tassertTrue(room.isDoorway());\n\t\tassertEquals(DoorDirection.DOWN, room.getDoorDirection());\n\t\t//tests that the door at [13][3] points up\n\t\troom = board.getCellAt(13, 3);\n\t\tassertTrue(room.isDoorway());\n\t\tassertEquals(DoorDirection.UP, room.getDoorDirection());\n\t\t//tests that the door at [7][4] points right\n\t\troom = board.getCellAt(7, 4);\n\t\tassertTrue(room.isDoorway());\n\t\tassertEquals(DoorDirection.RIGHT, room.getDoorDirection());\n\t\t//tests that the door at [13][17] points left\n\t\troom = board.getCellAt(13, 17);\n\t\tassertTrue(room.isDoorway());\n\t\tassertEquals(DoorDirection.LEFT, room.getDoorDirection());\n\t\t// Test that room pieces that aren't doors know it\n\t\troom = board.getCellAt(0, 0);\n\t\tassertFalse(room.isDoorway());\t\n\t\t// Test that walkways are not doors\n\t\tBoardCell cell = board.getCellAt(0, 4);\n\t\tassertFalse(cell.isDoorway());\t\t\n\t}", "public boolean teleport ( Entity destination ) {\n\t\treturn invokeSafe ( \"teleport\" , destination );\n\t}", "public void movePlayer(String nomeArq, int px, int py) {\r\n if(Main.player1.Vez()) {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)){\r\n \tMain.player1.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player1.MudaLado(false,true);\r\n } \r\n pos = Main.player1.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0.1;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false) {\r\n \tMain.player1.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player1.Size()[0],Main.player1.Size()[1])==false)\r\n {\r\n \tMain.player1.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n Main.Fase.repinta(); \r\n }\r\n else {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)) {\r\n \tMain.player2.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player2.MudaLado(false,true);\r\n } \r\n pos = Main.player2.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false) {\r\n \tMain.player2.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false)\r\n {\r\n \tMain.player2.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n }\r\n }", "public static void Transfer(JailPrisoner prisoner, Player player)\r\n \t{\r\n \t\tif (prisoner.getTransferDestination() == \"find nearest\") prisoner.setTransferDestination(JailZoneManager.findNearestJail(player.getLocation(), prisoner.getJail().getName()).getName());\r\n \t\t\r\n \t\tif (prisoner.getCell() != null)\r\n \t\t{\r\n \t\t\tInventory inventory = player.getInventory();\r\n \t\t\tJailCell cell = prisoner.getCell();\r\n \t\t\tcell.setPlayerName(\"\");\r\n \t\t\tfor (Sign sign : cell.getSigns())\r\n \t\t\t{\r\n \t\t\t\tsign.setLine(0, \"\");\r\n \t\t\t\tsign.setLine(1, \"\");\r\n \t\t\t\tsign.setLine(2, \"\");\r\n \t\t\t\tsign.setLine(3, \"\");\r\n \t\t\t\tsign.update();\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif (cell.getChest() != null) \r\n \t\t\t{\r\n \t\t\t\tfor (ItemStack i: cell.getChest().getInventory().getContents())\r\n \t\t\t\t{\r\n \t\t\t\t\tif (i == null || i.getType() == Material.AIR) continue;\r\n \t\t\t\t\tinventory.addItem(i);\r\n \t\t\t\t}\r\n \t\t\t\tcell.getChest().getInventory().clear();\r\n \t\t\t}\r\n \t\t\tif (cell.getSecondChest() != null) \r\n \t\t\t{\r\n \t\t\t\tfor (ItemStack i: cell.getSecondChest().getInventory().getContents())\r\n \t\t\t\t{\r\n \t\t\t\t\tif (i == null || i.getType() == Material.AIR) continue;\r\n \t\t\t\t\tinventory.addItem(i);\r\n \t\t\t\t}\r\n \t\t\t\tcell.getSecondChest().getInventory().clear();\r\n \t\t\t}\r\n \t\t\tprisoner.setCell(null);\r\n \t\t}\r\n \t\t\t\t\t\t\r\n \t\tprisoner.SetBeingReleased(true);\r\n \t\t\r\n \t\tString targetJail = prisoner.getTransferDestination();\r\n \t\tif (targetJail.contains(\":\"))\r\n \t\t{\r\n \t\t\tprisoner.setRequestedCell(targetJail.split(\":\")[1]);\r\n \t\t\ttargetJail = targetJail.split(\":\")[0];\t\t\t\r\n \t\t}\r\n \t\t\r\n \t\tJailZone jail = Jail.zones.get(targetJail);\r\n \t\tprisoner.setJail(jail);\r\n \t\tprisoner.setTransferDestination(\"\");\r\n \t\tprisoner.setOfflinePending(false);\r\n \t\tUtil.Message(jail.getSettings().getString(Setting.MessageTransfer), player);\r\n \t\tJail.prisoners.put(prisoner.getName(),prisoner);\r\n \r\n \t\tJailCell cell = jail.getRequestedCell(prisoner);\r\n \t\tif (cell == null || (cell.getPlayerName() != null && !cell.getPlayerName().equals(\"\") && !cell.getPlayerName().equals(prisoner.getName()))) \r\n \t\t{\r\n \t\t\tcell = null;\r\n \t\t\tcell = jail.getEmptyCell();\r\n \t\t}\r\n \t\tif (cell != null)\r\n \t\t{\r\n \t\t\tcell.setPlayerName(player.getName());\r\n \t\t\tprisoner.setCell(cell);\r\n \t\t\tplayer.teleport(prisoner.getTeleportLocation());\r\n \t\t\tprisoner.updateSign();\r\n \t\t\tif (jail.getSettings().getBoolean(Setting.StoreInventory) && cell.getChest() != null)\r\n \t\t\t{\r\n \t\t\t\tChest chest = cell.getChest();\r\n \t\t\t\tchest.getInventory().clear();\r\n \t\t\t\tfor (int i = 0;i<40;i++)\r\n \t\t\t\t{\r\n \t\t\t\t\tif (chest.getInventory().getSize() <= Util.getNumberOfOccupiedItemSlots(chest.getInventory().getContents())) break;\r\n \t\t\t\t\tif (player.getInventory().getItem(i) == null || player.getInventory().getItem(i).getType() == Material.AIR) continue;\r\n \t\t\t\t\tchest.getInventory().addItem(player.getInventory().getItem(i));\r\n \t\t\t\t\tplayer.getInventory().clear(i);\r\n \t\t\t\t}\r\n \t\t\t\t\t\t\t\t\r\n \t\t\t\tif (cell.getSecondChest() != null)\r\n \t\t\t\t{\r\n \t\t\t\t\tchest = cell.getSecondChest();\r\n \t\t\t\t\tchest.getInventory().clear();\r\n \t\t\t\t\tfor (int i = 0;i<40;i++)\r\n \t\t\t\t\t{\r\n \t\t\t\t\t\tif (chest.getInventory().getSize() <= Util.getNumberOfOccupiedItemSlots(chest.getInventory().getContents())) break;\r\n \t\t\t\t\t\tif (player.getInventory().getItem(i) == null || player.getInventory().getItem(i).getType() == Material.AIR) continue;\r\n \t\t\t\t\t\tchest.getInventory().addItem(player.getInventory().getItem(i));\r\n \t\t\t\t\t\tplayer.getInventory().clear(i);\r\n \t\t\t\t\t}\r\n \r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t\tcell.update();\r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\tplayer.teleport(prisoner.getTeleportLocation());\r\n \t\t}\r\n \t\t\r\n \t\tif (jail.getSettings().getBoolean(Setting.StoreInventory)) \r\n \t\t{\r\n \t\t\tprisoner.storeInventory(player.getInventory());\r\n \t\t\tplayer.getInventory().clear();\r\n \t\t}\r\n \t\t\r\n \t\tprisoner.SetBeingReleased(false);\r\n \t\tInputOutput.UpdatePrisoner(prisoner);\r\n \t}", "@Override\n\tpublic void goForward() {\n\t\t// check side and move the according room and side\n\t\tif (side.equals(\"hRight\")) {\n\t\t\tthis.side = \"bFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(3);\n\n\t\t} else if (side.equals(\"hFront\")) {\n\t\t\tthis.side = \"mFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(2);\n\n\t\t} else if (side.equals(\"bLeft\")) {\n\t\t\tthis.side = \"rLeft\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(4);\n\n\t\t} else if (side.equals(\"rBack\")) {\n\t\t\tthis.side = \"bBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(3);\n\n\t\t} else if (side.equals(\"bBack\")) {\n\t\t\tthis.side = \"hLeft\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(1);\n\n\t\t} else if (side.equals(\"kBack\")) {\n\t\t\tthis.side = \"lFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(5);\n\n\t\t} else if (side.equals(\"lLeft\")) {\n\t\t\tthis.side = \"kRight\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(6);\n\n\t\t} else if (side.equals(\"lBack\")) {\n\t\t\tthis.side = \"mBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(2);\n\n\t\t} else if (side.equals(\"mFront\")) {\n\t\t\tthis.side = \"lFront\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(5);\n\n\t\t} else if (side.equals(\"mBack\")) {\n\t\t\tthis.side = \"hBack\";\n\t\t\tthis.room = properties.getRoomFromProperties().get(1);\n\n\t\t} else {\n\t\t\trandomRoom();\n\t\t\tSystem.out.println(\"Entered Wormhole!\");\n\t\t\tSystem.out.println(\"Location was chosen at random\");\n\t\t\tSystem.out.println(\"New location is: \" + room + \" room and \" + side.substring(1) + \" side\");\n\n\t\t}\n\t}", "public Place followDirection ( String checkDirection)\r\n\t{\t\r\n\t\t for( int i=0; i < directions.size(); i++)\r\n\t\t {\r\n\t\t\t if( directions.get(i).match( checkDirection))\r\n\t\t\t {\r\n\t\t\t\t // If direction matches with direction object's direction, now again check that if the door is unlocked or not. \r\n\t\t\t\t return directions.get(i).follow();\r\n\t\t\t\t \r\n\t\t\t }\r\n\t\t } \r\n\t\t System.out.println (\"There is no direction from this DOOR....OH No, You are stuck at this Current Place:\" + this.name());\r\n\t\t return this;\r\n\t}", "private void initializeDoorMotors()\n {\n frame = new Rectangle(shaftWidth*.4, location+7, 30, floorHeight*.6);\n leftDoor = new Rectangle(shaftWidth*.4, location+7, 0, floorHeight*.6);\n rightDoor = new Rectangle(shaftWidth*.6, location+7, 0, floorHeight*.6);\n frame.setFill(Color.BLACK);\n leftDoor.setFill(Color.valueOf(\"#C0C0C0\"));\n rightDoor.setFill(Color.valueOf(\"#C0C0C0\"));\n\n openingLeft = false;\n opened = 5;\n doorSpeed = 10;\n\n leftDoorTimeline = new Timeline(new KeyFrame(Duration.millis(doorSpeed), e -> {\n separationL = leftDoor.getWidth();\n\n if (openingLeft && separationL > opened-5) {\n leftDoor.setWidth(separationL - 0.5);\n } else if (!openingLeft && separationL < opened+10) {\n leftDoor.setWidth(separationL + 0.5);\n } else {\n leftDoorTimeline.pause();\n }\n }));\n leftDoorTimeline.setCycleCount(Animation.INDEFINITE);\n leftDoorTimeline.play();\n\n rightDoorTimeline = new Timeline(new KeyFrame(Duration.millis(doorSpeed), e -> {\n x = rightDoor.getLayoutX();\n separationR = rightDoor.getWidth();\n\n if(openingRight && separationR > opened-5) {\n rightDoor.setWidth(separationR - 0.5);\n rightDoor.setLayoutX(x + 0.5);\n }\n else if(!openingRight && separationR < opened+10) {\n rightDoor.setWidth(separationR + 0.5);\n rightDoor.setLayoutX(x - 0.5);\n } else {\n if (openingRight) { //just assuming the doors are closed/and opened at the\n status = DoorStatus.OPEN; // same time so only update door status in right animation\n } else {\n status = DoorStatus.CLOSED;\n }\n rightDoorTimeline.pause();\n }\n }));\n rightDoorTimeline.setCycleCount(Animation.INDEFINITE);\n rightDoorTimeline.play();\n }", "private void travelTo(Location destination) \n\t{\n\t\tSystem.out.println(destination.name());\n\t\tif (destination == Location.Home) {\n\t\t\t\n\t\t\tif (role == Role.Attacker) {\n\t\t\t\t\n\t\t\t\tswitch(startingCorner) { \n\t\t\t\t\t/*case 1: travelTo(Location.X4); travelTo(Location.AttackBase); break;\n\t\t\t\t\tcase 2: travelTo(Location.X3); travelTo(Location.AttackBase); break;\n\t\t\t\t\tcase 3: case 4: travelTo(Location.AttackBase);*/\n\t\t\t\tcase 1: travelTo(Location.AttackBase); break;\n\t\t\t\tcase 2: travelTo(Location.AttackBase); break;\n\t\t\t\tcase 3: //travelTo(Location.X2);\n\t\t\t\t\t\ttravelTo(Location.AttackBase); break;\n\t\t\t\tcase 4: //travelTo(Location.X1);\n\t\t\t\t\t\ttravelTo(Location.AttackBase); break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else if (role == Role.Defender) {\n\t\t\t\t\n\t\t\t\tswitch(startingCorner) {\n\t\t\t\t\tcase 1: //travelTo(Location.X4);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t\tcase 2: //travelTo(Location.X3);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t\tcase 3: travelTo(Location.DefWay3);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t\tcase 4: travelTo(Location.DefWay4);\n\t\t\t\t\t\t\ttravelTo(Location.DefenseBase); break;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\t\n\t\telse if (destination == Location.BallPlatform)\n\t\t\tnavigator.travelTo(ballPlatform[0], ballPlatform[1]);\n\t\t\t\n\t\telse if (destination == Location.ShootingRegion)\n\t\t\tnavigator.travelTo(CENTER, 7 * 30.0); // we have to account for the case when there is an obstacle in the destination\n\t\t\t// also need to find a way of determining the y coordinate\n\n\t\telse if (destination == Location.AttackBase)\n\t\t\tnavigator.travelTo(ATTACK_BASE[0], ATTACK_BASE[1]); \n\t\t\n\t\telse if (destination == Location.DefenseBase)\n\t\t\tnavigator.travelTo(DEFENSE_BASE[0], DEFENSE_BASE[1]);\n\t\t\n\t\telse if (destination == Location.X1) \n\t\t\tnavigator.travelTo(X[0][0] * 30.0, X[0][1] * 30.0);\n\n\t\telse if (destination == Location.X2)\n\t\t\tnavigator.travelTo(X[1][0] * 30.0, X[1][1] * 30.0);\n\t\t\n\t\telse if (destination == Location.X3) \n\t\t\tnavigator.travelTo(X[2][0] * 30.0, X[2][1] * 30.0);\n\n\t\telse if (destination == Location.X4)\n\t\t\tnavigator.travelTo(X[3][0] * 30.0, X[3][1] * 30.0);\n\t\t\n\t\telse if (destination == Location.DefWay3)\n\t\t\tnavigator.travelTo(240, 240);\n\t\t\n\t\telse if (destination == Location.DefWay4)\n\t\t\tnavigator.travelTo(60, 240);\n\n\t\t\n\t\t// return from method only after navigation is complete\n\t\twhile (navigator.isNavigating())\n\t\t{\n\t\t\tSystem.out.println(\"destX: \" + navigator.destDistance[0] + \"destY: \" + navigator.destDistance[1]);\n\t\t\ttry {\n\t\t\t\tThread.sleep(100);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public boolean teleport(Location location) {\n/* 508 */ return teleport(location, PlayerTeleportEvent.TeleportCause.PLUGIN);\n/* */ }", "public void sendTeleportPacket(int entityId, Vector destination, byte yaw, byte pitch) {\n Object packet = ReflectUtils.newInstance(\"PacketPlayOutEntityTeleport\");\n ReflectUtils.setField(packet, \"a\", entityId);\n\n // Set the teleport location to the position of the entity on the player's side of the portal\n ReflectUtils.setField(packet, \"b\", destination.getX());\n ReflectUtils.setField(packet, \"c\", destination.getY());\n ReflectUtils.setField(packet, \"d\", destination.getZ());\n ReflectUtils.setField(packet, \"e\", yaw);\n ReflectUtils.setField(packet, \"f\", pitch);\n\n sendPacket(packet);\n }", "protected boolean teleportRandomly() {\n double x = this.posX + (this.rand.nextDouble() - 0.5) * 64.0;\n double y = this.posY + (this.rand.nextInt(64) - 32);\n double z = this.posZ + (this.rand.nextDouble() - 0.5) * 64.0;\n return this.teleportTo(x, y, z);\n }", "protected void buildDoorway(World world, ICoords coords, Direction direction, Direction doubleSide) {\n\t\tint touching = 0;\n\t\tint x =0;\n\t\tint z = 0;\n\t\tint dx = 0;\n\t\tint dz = 0;\n\t\tint failSafe = 0;\n\n\t\t// setup the side that double side will remove\n\t\tswitch(doubleSide) {\n\t\tcase NORTH:\n\t\t\tdz--;\n\t\t\tbreak;\n\t\tcase EAST:\n\t\t\tdx++;\n\t\t\tbreak;\n\t\tcase SOUTH:\n\t\t\tdz++;\n\t\t\tbreak;\n\t\tcase WEST:\n\t\t\tdx--;\n\t\t\tbreak;\n\t\tdefault:\n\t\t}\n\n\t\tdo {\n\t\t\ttouching = 0;\n\n\t\t\t// carve \"regular\" doorway\n\t\t\tworld.setBlockState(coords.add(x, 1, z).toPos(), Blocks.AIR.getDefaultState(), 3);\n\t\t\tworld.setBlockState(coords.add(x, 2, z).toPos(), Blocks.AIR.getDefaultState(), 3);\n\t\t\t// carve double-side doorway\n\t\t\tworld.setBlockState(coords.add(dx, 1, dz).toPos(), Blocks.AIR.getDefaultState(), 3);\n\t\t\tworld.setBlockState(coords.add(dx, 2, dz).toPos(), Blocks.AIR.getDefaultState(), 3);\n\n\t\t\t// check in all four directions and add 1 to value\n\t\t\tBlockPos pos = coords.add(dx, 1, dz).toPos();\n\t\t\tif (world.getBlockState(pos.north()) == Blocks.AIR.getDefaultState()) touching++;\n\t\t\tif (world.getBlockState(pos.south()) == Blocks.AIR.getDefaultState()) touching++;\n\t\t\tif (world.getBlockState(pos.east()) == Blocks.AIR.getDefaultState()) touching++;\n\t\t\tif (world.getBlockState(pos.west()) == Blocks.AIR.getDefaultState()) touching++;\n\n\t\t\t// move to next block\n\t\t\tswitch(direction) {\n\t\t\tcase NORTH:\n\t\t\t\tz--;\n\t\t\t\tdz--;\n\t\t\t\tbreak;\n\t\t\tcase EAST:\n\t\t\t\tx++;\n\t\t\t\tdx++;\n\t\t\t\tbreak;\n\t\t\tcase SOUTH:\n\t\t\t\tz++;\n\t\t\t\tdz++;\n\t\t\t\tbreak;\n\t\t\tcase WEST:\n\t\t\t\tx--;\n\t\t\t\tdx--;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t}\n\t\t\tfailSafe++;\n\t\t} while (touching < 3 && failSafe < 5);\t\t\n\t}", "public void setPlayerPosition(Player player) {\n if (player.getPositionX() < 0 && (player.getPositionY() > screenHeight / 2 - doorSize && player.getPositionY() < screenHeight / 2 + doorSize)) {\n //left exit to right entry\n player.position.x = screenWidth - wallSize - player.getRadius();\n player.position.y = player.getPositionY();\n } else if ((player.getPositionX() > screenWidth / 2 - doorSize && player.getPositionX() < screenWidth / 2 + doorSize) && player.getPositionY() < 0) {\n //top exit to bottom entry\n player.position.x = player.getPositionX();\n player.position.y = screenHeight - wallSize - player.getRadius();\n } else if (player.getPositionX() > screenWidth && (player.getPositionY() > screenHeight / 2 - doorSize && player.getPositionY() < screenHeight / 2 + doorSize)) {\n //right exit to left entry\n player.position.x = wallSize + player.getRadius();\n player.position.y = player.getPositionY();\n } else {\n //bottom exit to top entry\n player.position.x = player.getPositionX();\n player.position.y = wallSize + player.getRadius();\n }\n }", "public void create2(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[1][1] = 1;\n\n\t\t//creating stairs to transport to room3\n\t\tfor(int i = 0; i <this.Stairs.length; i++){\n\t\t\tfor(int p = 0; p < this.Stairs.length; p++){\n\t\t\t\tthis.Stairs[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Stairs[18][18] = 1;\n\n\t\t//creating board to keep track of ari\n\t\tfor(int i = 0; i <this.Ari.length; i++){\n\t\t\tfor(int p = 0; p < this.Ari.length; p++){\n\t\t\t\tthis.Ari[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}\n\t\tthis.Ari[7][11] = 1;//putts ari there\n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 3; i< 4 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 6; i< 7 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 9; i< 10 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 19; p > 1; p--){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 1; p < 18; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes\n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{\n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "void placeTower();", "public boolean onDoor(){\n\t\tint yp = 0; int xp = 0;//coordinates to hold player position\n\t\tint yd = 1; int xd = 1;//coordinates to hold door position\n\t\tfor(int i = 0; i < this.position.length; i ++){//looks though arrays to gather position\n\t\t\tfor(int p = 0 ; p < this.position.length; p++){\n\t\t\t\tif(this.position[i][p] == 1 && this.Door[i][p] == 1){\n\t\t\t\t\typ = i; xp = p;\n\t\t\t\t\tyd = i; xd = p;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\tif(yp==yd && xp==xd){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;//if they are not in the same location, return false\n\t}", "public static void tpr(String world, Player player) {\n String msg = MessageManager.getMessageYml().getString(\"Tpr.Teleporting\");\n player.sendMessage(MessageManager.getPrefix() + ChatColor.translateAlternateColorCodes('&', msg));\n Location originalLocation = player.getLocation();\n Random random = new Random();\n Location teleportLocation;\n int maxDistance = Main.plugin.getConfig().getInt(\"TPR.Max\");\n World w = Bukkit.getServer().getWorld(world);\n int x = random.nextInt(maxDistance) + 1;\n int y = 150;\n int z = random.nextInt(maxDistance) + 1;\n boolean isOnLand = false;\n teleportLocation = new Location(w, x, y, z);\n while (!isOnLand) {\n teleportLocation = new Location(w, x, y, z);\n if (teleportLocation.getBlock().getType() != Material.AIR) {\n isOnLand = true;\n } else {\n y--;\n }\n }\n player.teleport(new Location(w, teleportLocation.getX(), teleportLocation.getY() + 1.0D, teleportLocation.getZ()));\n if (Main.plugin.getConfig().getString(\"NOTIFICATIONS.Tpr\").equalsIgnoreCase(\"True\")) {\n int dis = (int) teleportLocation.distance(originalLocation);\n String dist = String.valueOf(dis);\n String original = (MessageManager.getMessageYml().getString(\"Tpr.Distance\").replaceAll(\"%distance%\", dist));\n String distance = (ChatColor.translateAlternateColorCodes('&', original));\n player.sendMessage(MessageManager.getPrefix() + distance);\n }\n }", "public void movePlayer(String direction) {\n if(playerAlive(curPlayerRow, curPlayerCol)){\n if(direction.equals(\"u\")&&(curPlayerRow-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow-1), curPlayerCol);\n curPlayerRow -= 1;\n }else if(direction.equals(\"d\")&&(curPlayerRow+1)<=7){\n overwritePosition(curPlayerRow, curPlayerCol, (curPlayerRow+1), curPlayerCol);\n curPlayerRow += 1;\n }else if(direction.equals(\"l\")&&(curPlayerCol-1)>=0){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol-1));\n curPlayerCol -= 1;\n }else if(direction.equals(\"r\")&&(curPlayerCol+1)<=9){\n overwritePosition(curPlayerRow, curPlayerCol, curPlayerRow, (curPlayerCol+1));\n curPlayerCol += 1;\n }\n }\n if(playerFoundTreasure(curPlayerRow, curPlayerCol)){\n playerWins();\n }\n adjustPlayerLifeLevel(curPlayerRow, curPlayerCol);\n int[] array = calcNewTrollCoordinates(curPlayerRow, curPlayerCol, curTrollRow, curTrollCol);\n if(curPlayerRow == curTrollRow && curPlayerCol == curTrollCol){\n gameBoard[curTrollRow][curTrollCol] = new TrollPiece();\n }else{\n int newTrollRow = array[0];\n int newTrollCol = array[1];\n overwritePosition(curTrollRow, curTrollCol, newTrollRow, newTrollCol);\n curTrollRow = newTrollRow;\n curTrollCol = newTrollCol;\n }\n }", "protected boolean teleportTo(double x, double y, double z) {\n double xI = this.posX;\n double yI = this.posY;\n double zI = this.posZ;\n this.posX = x;\n this.posY = y;\n this.posZ = z;\n boolean canTeleport = false;\n int blockX = (int)Math.floor(this.posX);\n int blockY = (int)Math.floor(this.posY);\n int blockZ = (int)Math.floor(this.posZ);\n Block block;\n if (this.worldObj.blockExists(blockX, blockY, blockZ)) {\n boolean canTeleportToBlock = false;\n while (!canTeleportToBlock && blockY > 0) {\n block = this.worldObj.getBlock(blockX, blockY - 1, blockZ);\n if (block != null && block.getMaterial().blocksMovement()) {\n canTeleportToBlock = true;\n }\n else {\n --this.posY;\n --blockY;\n }\n }\n if (canTeleportToBlock) {\n this.setPosition(this.posX, this.posY, this.posZ);\n if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).size() == 0 && !this.worldObj.isAnyLiquid(this.boundingBox)) {\n canTeleport = true;\n }\n }\n }\n if (!canTeleport) {\n this.setPosition(xI, yI, zI);\n return false;\n }\n for (int i = 0; i < 128; i++) {\n double posRelative = i / 127.0;\n float vX = (this.rand.nextFloat() - 0.5F) * 0.2F;\n float vY = (this.rand.nextFloat() - 0.5F) * 0.2F;\n float vZ = (this.rand.nextFloat() - 0.5F) * 0.2F;\n double dX = xI + (this.posX - xI) * posRelative + (this.rand.nextDouble() - 0.5) * this.width * 2.0;\n double dY = yI + (this.posY - yI) * posRelative + this.rand.nextDouble() * this.height;\n double dZ = zI + (this.posZ - zI) * posRelative + (this.rand.nextDouble() - 0.5) * this.width * 2.0;\n this.worldObj.spawnParticle(\"portal\", dX, dY, dZ, vX, vY, vZ);\n }\n this.worldObj.playSoundEffect(xI, yI, zI, \"mob.endermen.portal\", 1.0F, 1.0F);\n this.worldObj.playSoundAtEntity(this, \"mob.endermen.portal\", 1.0F, 1.0F);\n return true;\n }", "private static void addDoorsLR(Room roomAdjacent, Room roomCurrent) {\n\t\tA_Passage pass = new PassageHorizontal(roomAdjacent, roomCurrent);\n\t\t_maze.addPassage(pass);\n\t\troomAdjacent.addDoor(pass.getDoorFirst());\n\t\troomCurrent.addDoor(pass.getDoorSecond());\n\t\t_interactive.addArray(new I_UserInteract[] { pass.getDoorSecond(),\n\t\t\t\tpass.getDoorFirst(), pass, roomAdjacent, roomCurrent });\n\t}", "public void create(){\n\t\t//creating board to keep track of player postion with 1 or 0. 0 if not there 1 if they are there\n\t\tfor(int i = 0; i <this.position.length; i++){\n\t\t\tfor(int p = 0; p < this.position.length; p++){\n\t\t\t\tthis.position[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of position making board\n\t\tthis.position[1][1] = 1;//putting player in this position\n\n\t\t//creating door in the rooms\n\t\tfor(int i = 0; i <this.Door.length; i++){\n\t\t\tfor(int p = 0; p < this.Door.length; p++){\n\t\t\t\tthis.Door[i][p] = 0;//filling with zero\n\t\t\t}\n\t\t}//end of Door making board\n\t\tthis.Door[9][13] = 1;//puts the door here \n\n\t\t//makes board that tells if item is there\n\t\tfor(int i = 0; i <this.Items.length; i++){\n\t\t\tfor(int p = 0; p < this.Items.length; p++){\n\t\t\t\tthis.Items[i][p] = null;//filling with null\n\t\t\t}\n\t\t}//end of filling board that has items\n\n\t\t//makes border of room\n\t\tfor(int i = 0; i < this.area.length; i++){\n\t\t\tfor(int p = 0; p<this.area.length; p++){\n\t\t\t\tif(i==0){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if (p==0 || p==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse if(i==19){\n\t\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tthis.area[i][p] = \" \";\n\t\t\t\t}\n\t\t\t}//end of innner for\n\t\t}//end of outter for\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 4; i< 5 ; i++){\n\t\t\tfor(int p = 4; p < 7; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 7; i< 8 ; i++){\n\t\t\tfor(int p = 2; p < 7; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 17; i< 18 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\t\n\t\t}\n\t\tfor(int i = 14; i< 15 ; i++){\n\t\t\tfor(int p = 13; p < 17; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\t\n\t\t}\t\n\t\tfor(int i = 11; i< 12 ; i++){\n\t\t\tfor(int p = 10; p < 17; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 15; i< 16 ; i++){\n\t\t\tfor(int p = 3; p < 6; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 16; i< 17 ; i++){\n\t\t\tfor(int p = 6; p < 13; p++){\n\t\t\t\tthis.area[p][i] = \"[ ]\";\n\t\t\t}\n\t\t}\n\t\tfor(int i = 12; i< 13 ; i++){\n\t\t\tfor(int p = 5; p < 10; p++){\n\t\t\t\tthis.area[i][p] = \"[ ]\";\n\t\t\t}\n\t\t\tSystem.out.println(\" \");\n\t\t}//end of for that creates walls\t\n\n\t\t//for loop that distributes items\n\t\tint y = 0;\n\t\tint x = 0;\n\t\tfor(int i = 0;i<10;i++){\n\t\t\tItem thing = ItemGenerator.generate();//making an item\n\t\t\tboolean good = false;\n\t\t\twhile(!good){//makes coordates until there is nothing in the way\n\t\t\t\ty = fate.nextInt(20);//getting coordiantaes \n\t\t\t\tx = fate.nextInt(20);\n\t\t\t\tif(this.Items[y][x]==null && this.area[y][x] != \"[ ]\"){\n\t\t\t\t\tgood = true;\n\t\t\t\t}//end of if\n\t\t\t\telse{ \n\t\t\t\t\tgood = false;\n\t\t\t\t}\n\t\t\t}//end of while\n\t\t\tItems[y][x] = thing;\n\t\t}//end of for that distributes items on board\n\n\t}", "public Door isDoor(Position position) {\n // check north\n if (board[position.x][position.y - 1] instanceof Door)\n return (Door) board[position.x][position.y - 1];\n // south\n if (board[position.x][position.y + 1] instanceof Door)\n return (Door) board[position.x][position.y + 1];\n // east\n if (board[position.x + 1][position.y] instanceof Door)\n return (Door) board[position.x + 1][position.y];\n // west\n if (board[position.x - 1][position.y] instanceof Door)\n return (Door) board[position.x - 1][position.y];\n return null;\n }", "@Override\r\n\tpublic void setUp() {\n\t\t\r\n\t\ttarget = pointEntity(caster,50);\r\n\t\tif (target == null) {\r\n\t\t\t\r\n\t\t\t\r\n\t\t\trefund = true;\r\n\t\t\tdead = true;\r\n\t\t\tif (refined)\r\n\t\t\t\tsteprange = 240;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_DEACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tplaySound(Sound.BLOCK_CONDUIT_ACTIVATE,caster.getLocation(),5,2F);\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tParUtils.parKreisDot(Particles.END_ROD, caster.getLocation(), 0, 1, 0.3F, randVector());\r\n\t\t\tdist = target.getLocation().distance(caster.getLocation());\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "boolean moveCharacter(Player player, Location.Direction direction) {\n Location currentLocation = player.getLocation();\r\n //check to see if move is possible\r\n Location destination = currentLocation.compass(direction);\r\n if (destination != null)\r\n {\r\n currentLocation.exit(player);\r\n destination.enter(player);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n } \r\n }", "public Door()\n {\n // initialize instance variables\n this.id = 0;\n this.room = new Room();\n this.isLocked = false;\n }", "public void slidePlayer(char next){\n\t\t\n\t\t\n\t\tif (next==SLIDE_LEFT){\n\t\t\t//Left\n\t\t\tfor(int j=-1; j>=0-_xIndex; j--){\n\t\t\t\tint nextX=_xIndex+j;\n\t\t\t\tint nextY=_yIndex;\n\t\t\t\tchar nextStop= this._room._roomGrid[nextX][nextY];\n\t\t\t\tif (nextStop == FREE || nextStop == SLIDE_UP || nextStop == SLIDE_DOWN || nextStop == SLIDE_RIGHT || nextStop == SEAMLESS){\n\t\t\t\t\t_gbs.getPlayer().addDest(nextX,nextY);\n\t\t\t\t\tSysOut.print(\"DEST ADDED\");\n\t\t\t\t\t_gbs.getPlayer().setAvoidMethod(\"freeze\");\n\t\t\t\t\t_gbs.getPlayer().setIgnoring(true);\n\t\t\t\t\tthis._approachTimer.start();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (next==SLIDE_DOWN){\n\t\t\t//Down\n\t\t\tfor(int j=1; j<=this._room._height-_yIndex-1; j++){\n\t\t\t\tint nextX=_xIndex;\n\t\t\t\tint nextY=_yIndex+j;\n\t\t\t\tchar nextStop= this._room._roomGrid[nextX][nextY];\n\t\t\t\tif (nextStop == FREE || nextStop == SLIDE_UP || nextStop == SLIDE_LEFT || nextStop == SLIDE_RIGHT || nextStop == SEAMLESS){\n\t\t\t\t\t_gbs.getPlayer().addDest(nextX,nextY);\n\t\t\t\t\tSysOut.print(\"DEST ADDED\");\n\t\t\t\t\t_gbs.getPlayer().setAvoidMethod(\"freeze\");\n\t\t\t\t\t_gbs.getPlayer().setIgnoring(true);\n\t\t\t\t\t_gbs.setSpinning(true);\n\t\t\t\t\tthis._approachTimer.start();\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\telse if (next==SLIDE_UP){\n\t\t\t//Up\n\t\t\tfor(int j=-1; j>=0-_yIndex; j--){\n\t\t\t\tint nextX=_xIndex;\n\t\t\t\tint nextY=_yIndex+j;\n\t\t\t\tchar nextStop= this._room._roomGrid[nextX][nextY];\n\t\t\t\tif (nextStop == FREE || nextStop == SLIDE_LEFT || nextStop == SLIDE_DOWN || nextStop == SLIDE_RIGHT || nextStop == SEAMLESS){\n\t\t\t\t\t_gbs.getPlayer().addDest(nextX,nextY);\n\t\t\t\t\tSysOut.print(\"DEST ADDED\");\n\t\t\t\t\t_gbs.getPlayer().setAvoidMethod(\"freeze\");\n\t\t\t\t\t_gbs.getPlayer().setIgnoring(true);\n\t\t\t\t\t_gbs.setSpinning(true);\n\t\t\t\t\tthis._approachTimer.start();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if (next==SLIDE_RIGHT){\n\t\t\t//Right\n\t\t\tfor(int j=1; j<=this._room._width-_xIndex-1; j++){\n\t\t\t\tint nextX=_xIndex+j;\n\t\t\t\tint nextY=_yIndex;\n\t\t\t\tchar nextStop= this._room._roomGrid[nextX][nextY];\n\t\t\t\tif (nextStop == FREE || nextStop == SLIDE_UP || nextStop == SLIDE_DOWN || nextStop == SLIDE_LEFT || nextStop == SEAMLESS){\n\t\t\t\t\t_gbs.getPlayer().addDest(nextX,nextY);\n\t\t\t\t\tSysOut.print(\"DEST ADDED\");\n\t\t\t\t\t_gbs.getPlayer().setAvoidMethod(\"freeze\");\n\t\t\t\t\t_gbs.getPlayer().setIgnoring(true);\n\t\t\t\t\t_gbs.setSpinning(true);\n\t\t\t\t\tthis._approachTimer.start();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private boolean movePlayer(String placeToMoveTo) {\n if (placeToMoveTo.equalsIgnoreCase(\"go\") || placeToMoveTo.equals(\"\")) {\n System.out.println(\"Go where?\");\n return false;\n }\n\n // Check to see if the player is trying to move through a valid Exit\n if (currentRoom.getExit1() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit1().getName())) {\n if (this.checkExit(currentRoom.getExit1())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit1().getDestination();\n return true;\n }\n } else if (currentRoom.getExit2() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit2().getName())) {\n if (this.checkExit(currentRoom.getExit2())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit2().getDestination();\n return true;\n }\n } else if (currentRoom.getExit3() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit3().getName())) {\n if (this.checkExit(currentRoom.getExit3())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit3().getDestination();\n return true;\n }\n } else if (currentRoom.getExit4() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getExit4().getName())) {\n if (this.checkExit(currentRoom.getExit4())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getExit4().getDestination();\n return true;\n }\n } else if (currentRoom.getSecretExit() != null && placeToMoveTo.equalsIgnoreCase(currentRoom.getSecretExit().getName())) {\n if (this.checkExit(currentRoom.getSecretExit())) {\n // Move the player and set the current room to the room that they have moved to\n currentRoom = currentRoom.getSecretExit().getDestination();\n return true;\n }\n } // They have not specified a valid exit\n else {\n System.out.println(\"It doesn't appear as though I can go there.\");\n return false;\n }\n\n return false;\n }", "private void teleport(Player player, ClanPlayerImpl clanPlayer, Location<World> teleportLocation) {\n player.setLocation(teleportLocation);\n clanPlayer.setLastClanHomeTeleport(new LastClanHomeTeleport());\n }", "protected void meander(){\n if(currentDestination == null){\n getNewMeanderPoint();\n }\n if(stuckCounter > 30){\n\n getNewMeanderPoint();\n }\n //Check if we have reached the current destination\n if((this.x == currentDestination.x) && (this.y == currentDestination.y)){\n getNewMeanderPoint();\n\n isWaiting = true;\n Random random = new Random();\n waitValue = random.nextInt(maxWait - minWait) + minWait;\n\n\n }\n\n\n //System.out.printf(\"X:%d Y:%d gX:%d Gy:%d\\n\", x, y, currentDestination.x, currentDestination.y);\n double dist;\n if(!isWaiting) {\n if (this.x != currentDestination.x) {\n dist = currentDestination.x - this.x;\n //Counteracts the effect of speed being greater than the distance, cauing jitter\n if (Math.abs(dist) < speed) {\n dx = dist;\n } else {\n int direction = (int) (dist / Math.abs(dist));\n switch (direction) {\n case 1:\n moveRight();\n break;\n case -1:\n moveLeft();\n break;\n }\n }\n } else {\n dx = 0;\n }\n if (this.y != currentDestination.y) {\n dist = currentDestination.y - this.y;\n //Counteracts the effect of speed being greater than the distance, cauing jitter\n if (Math.abs(dist) < speed) {\n dy = dist;\n } else {\n int direction = (int)(dist / Math.abs(dist));\n switch (direction) {\n case 1:\n moveDown();\n break;\n case -1:\n moveUp();\n break;\n }\n }\n } else {\n dy = 0;\n }\n }\n\n }", "public void perturbDirection(\r\n\t) {\r\n\t\tmDirection.x += 1e-5*Math.random();\t\t\t\r\n\t\tmDirection.y += 1e-5*Math.random();\r\n\t\tmDirection.z += 1e-5*Math.random();\r\n\t}", "public void doAction()\n {\n \n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n \n //Basic action:\n //Grab Gold if we can.\n if (w.hasGlitter(cX, cY))\n {\n w.doAction(World.A_GRAB);\n return;\n }\n \n //Basic action:\n //We are in a pit. Climb up.\n if (w.isInPit())\n {\n w.doAction(World.A_CLIMB);\n return;\n }\n //Test the environment\n /*if (w.hasBreeze(cX, cY))\n {\n System.out.println(\"I am in a Breeze\");\n }\n if (w.hasStench(cX, cY))\n {\n System.out.println(\"I am in a Stench\");\n }\n if (w.hasPit(cX, cY))\n {\n System.out.println(\"I am in a Pit\");\n }\n if (w.getDirection() == World.DIR_RIGHT)\n {\n System.out.println(\"I am facing Right\");\n }\n if (w.getDirection() == World.DIR_LEFT)\n {\n System.out.println(\"I am facing Left\");\n }\n if (w.getDirection() == World.DIR_UP)\n {\n System.out.println(\"I am facing Up\");\n }\n if (w.getDirection() == World.DIR_DOWN)\n {\n System.out.println(\"I am facing Down\");\n }\n */\n \n //decide next move\n if(w.hasStench(cX, cY)&&w.hasArrow())//Wumpus can be shot if located\n {\n if((w.hasStench(cX, cY+2))||(w.hasStench(cX-1, cY+1)&&w.isVisited(cX-1, cY))||(w.hasStench(cX+1, cY+1)&&w.isVisited(cX+1, cY)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX+2, cY))||(w.hasStench(cX+1, cY-1)&&w.isVisited(cX, cY-1))||(w.hasStench(cX+1, cY+1)&&w.isVisited(cX, cY+1)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX, cY-2))||(w.hasStench(cX-1, cY-1)&&w.isVisited(cX-1, cY))||(w.hasStench(cX+1, cY-1)&&w.isVisited(cX+1, cY)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n else if((w.hasStench(cX-2, cY))||(w.hasStench(cX-1, cY+1)&&w.isVisited(cX, cY+1))||(w.hasStench(cX-1, cY-1)&&w.isVisited(cX, cY-1)))//Condition for checking wumpus location\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n else if(cX==1&&cY==1) //First tile. Shoot North. If wumpus still alive, store its location as (2,1) to avoid it\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n if(w.hasStench(cX, cY))\n {\n wumpusLoc[0] = 2;\n wumpusLoc[1] = 1;\n }\n }\n else if(cX==1&&cY==4) //Condition for corner\n {\n if(w.isVisited(1, 3))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(2, 4))\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if(cX==4&&cY==1) //Condition for corner\n {\n if(w.isVisited(3, 1))\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(4, 2))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if(cX==4&&cY==4) //Condition for corner\n {\n if(w.isVisited(3, 4))\n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_SHOOT);\n }\n if(w.isVisited(4, 3))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_SHOOT);\n }\n \n }\n else if((cX==1)&&(w.isVisited(cX+1, cY-1))) //Condition for edge\n {\n \n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((cX==4)&&(w.isVisited(cX-1, cY-1))) //Condition for edge\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_SHOOT);\n }\n else if((cY==1)&&(w.isVisited(cX-1, cY+1))) //Condition for edge\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else if((cY==4)&&(w.isVisited(cX-1, cY-1))) //Condition for edge\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_SHOOT);\n }\n else //Can't locate wumpus, go back to safe location\n {\n turnTo((w.getDirection()+2)%4);\n w.doAction(World.A_MOVE);\n }\n }\n else // No stench. Explore \n {\n if(w.isValidPosition(cX, cY-1)&&!w.isVisited(cX, cY-1)&&isSafe(cX, cY-1)) \n {\n turnTo(World.DIR_DOWN);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX+1, cY)&&!w.isVisited(cX+1, cY)&&isSafe(cX+1, cY))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX-1, cY)&&!w.isVisited(cX-1, cY)&&isSafe(cX-1,cY))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_MOVE);\n }\n else\n {\n if(w.isValidPosition(cX, cY+1))\n {\n turnTo(World.DIR_UP);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX+1, cY))\n {\n turnTo(World.DIR_RIGHT);\n w.doAction(World.A_MOVE);\n }\n else if(w.isValidPosition(cX-1, cY))\n {\n turnTo(World.DIR_LEFT);\n w.doAction(World.A_MOVE);\n }\n }\n }\n \n }", "@Override\n\tpublic void onWalkRight(PlatformPlayer player) {\n\t\t\n\t}", "public static void sendTo(Player player, OwnedWarp warp) {\n if(warp == null)\n return;\n try {\n Points.teleportTo(player, warp.getTarget(), warp.getName());\n } catch (InvalidDestinationException ex) {\n player.sendMessage(ex.getMessage());\n Stdout.println(ex.getMessage(), Level.ERROR);\n }\n }", "protected void moveTowards()\r\n {\r\n if(planet != null)\r\n turnTowards(planet.getX(), planet.getY());\r\n\r\n //If the invader touches a planet, it will go into the planet\r\n TargetPlanet t = (TargetPlanet)getOneIntersectingObject (TargetPlanet.class);\r\n //if t exists and looking for nearest planet OR looking for unconquered planet and reached it or no set planet\r\n if (t != null && ((findNearestPlanet || (!findNearestPlanet && t.equals(planet))) || planet == null))\r\n {\r\n t.hitByFighter(isHuman); //planet's stats will change\r\n removeMe = true;\r\n }\r\n }", "public void movePlayer(PositionTracker tracker, int direction){\n\n\t //declare and initialize variables\n\t\tboolean moveIsValid = false;\n\t boolean doorIsUnlocked = false;\n\t \n\t switch(direction){//initiate switch statement, checking the value of direction\n\n\t //enter case 1\n\t case 1:\t//invoke the checkDoor method\n\t\t\t \tdoorIsUnlocked = this.checkDoor(tracker.getCurrentRoom().getDoor());\n\t\t\t \t\n\t\t\t \t//initiate if-else statement\n\t\t\t \tif(doorIsUnlocked == true) {\n\t\t\t \t\t\n\t\t\t \t\t//invoke the checkMove method\n\t\t\t\t \tmoveIsValid = this.checkMove(tracker, direction);\n\t\t\t \t\t\n\t\t\t \t\t//initiate if-else statement\n\t\t\t \t\tif(moveIsValid == true) {\n\t\t\t \t\t\t\n\t\t\t\t \t\tthis.makeMove(tracker, direction);//invoke the makeMove method\n\t\t\t\t \t\t\n\t\t\t\t \t\tthis.displayConfirmMove(direction);\n\t\t\t\t \t\t\n\t\t\t\t \t\ttracker.updateCurrentRoom();\n\t\t\t \t\t}\n\t\t\t\t \telse\n\t\t\t\t \t\tthis.displayNoRoomMsg();\n\t\t\t \t\t\n\t\t\t \t}else\n\t\t\t \t\tthis.displayLockedDoorMsg();\n\t\t\t \t\n\t \t\t\tbreak;//break from switch\n\n\t //enter case 2\n\t case 2:\t//invoke the checkMove method\n\t\t\t \tmoveIsValid = this.checkMove(tracker, direction);\n\t\t\t \t\n\t\t\t \tif(moveIsValid == true) {//initiate if-else statement\n\t\t\t \t\t\n\t\t\t \t\tthis.makeMove(tracker, direction);//invoke the makeMove method\n\t\t\t \t\t\n\t\t\t \t\tthis.displayConfirmMove(direction);\n\t\t\t \t\t\n\t\t\t \t\ttracker.updateCurrentRoom();\n\t\t\t \t\t\n\t\t\t \t}\n\t\t\t \telse\n\t\t\t \t\tthis.displayNoRoomMsg();\n\t\t\t \t\n\t \t\t\tbreak;//break from switch\n\n\t \t}//end switch \n\t }", "static void door2challenge_rightpath() {\n System.out.println(\"You met a creature...\");\n System.out.println(\"Get ready to RIP!!!\");\n player_fights();\n //after you beat the creature...\n System.out.println(\"You killed it!!! \" + username + \"You are on a roll!\");\n enter = next.nextLine();\n System.out.println(\"There is a straight path ahead take the path and continue to survive long enough to escape the creatures\");\n System.out.println(\"grasp...\");\n enter = next.nextLine();\n //when you take that straight path...\n System.out.println(\"It looks safe here... Shall we continue?\");\n answer = responses.nextLine();\n //Choice doesn't matter...you still have to continue\n System.out.println(\"No time to think \" + username + \" the creatures are behind you...run\");\n enter = next.nextLine();\n System.out.println(\"There are two diverging paths. Do you want to take the left or the right path?\");\n answer = next.nextLine();\n if(answer.contains(\"left\")) {\n System.out.println(\"You met a creature!\");\n System.out.println(username + \", prepare yourself...\");\n enter = next.nextLine();\n player_fights();\n //after you beat the monster you will go into another method which is a linked path...\n System.out.println(\"Congratulations you beat the monster\"); {\n door2_linkedpath(); //this is the linked path with the straight path branch.\n }\n }else if (answer.contains(\"right\")) {\n System.out.println(\"OH NO!!!\" + username + \" fell into the hole with razor sharp knives \");\n backtocheckpoint1_version2();\n \n }else{ //in case if the player mistypes the code, they will be punished by getting dragged back to an earlier checkpoint\n System.out.println(username +\" Please retype your response correctly. \");\n System.out.println(\"There is no horse playing at a time like this... \");\n System.out.println(\"The monsters dragged you back...Luckily you escaped\");\n enter = next.nextLine();\n System.out.println(\"Looks like you're back to the place where you just made your decision of taking the right path\");\n door2challenge_rightpath(); \n }\n \n \n }", "public boolean canTeleport(Entity t) {\r\n if (getDirection() == Direction.EAST && (t.getLocation().getX() - getLocation().getX()) < 4 && (t.getLocation().getX() - getLocation().getX()) > -1 && (t.getLocation().getY() - getLocation().getY()) == 0) {\r\n return true;\r\n }\r\n if (getDirection() == Direction.WEST && (getLocation().getX() - t.getLocation().getX()) < 4 && (getLocation().getX() - t.getLocation().getX()) > -1 && (t.getLocation().getY() - getLocation().getY()) == 0) {\r\n return true;\r\n }\r\n if (getDirection() == Direction.NORTH && (t.getLocation().getY() - getLocation().getY()) < 4 && (t.getLocation().getY() - getLocation().getY()) > -1 && (t.getLocation().getX() - getLocation().getX()) == 0) {\r\n return true;\r\n }\r\n if (getDirection() == Direction.SOUTH && (getLocation().getY() - t.getLocation().getY()) < 4 && (getLocation().getY() - t.getLocation().getY()) > -1 && (t.getLocation().getX() - getLocation().getX()) == 0) {\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean plizMovePlayerForward(Player player)\n {\n\n //check if die was rolled\n if (getValue_from_die() > 0)\n {\n int x_cord = player.getX_cordinate();\n int y_cord = player.getY_cordinate();\n int steps = player.getSteps_moved();\n\n //try to get player from color home\n if (attempt2GetPlayerFromHomeSucceds(player))\n {\n return true;\n }\n\n //if player has already reached home do nothing\n if (player.getSteps_moved() >= 58)\n {\n return false;\n }\n //if player is inside home stretch he has to play exact number to go home\n else if (player.getSteps_moved() >= 52)\n {\n if (59 - player.getSteps_moved() <= value_from_die)\n {\n return false;\n }\n }\n\n //if player isnt at home move him\n if (player.getSteps_moved() > 0)\n {\n for (int i = 1; i <= (value_from_die); i++)\n {\n player.movePlayerForward();\n if (roadBlocked(player))\n {\n road_blocked = true;\n }\n player.setHas_not_been_drawn(true);\n }\n\n //roll back changes\n if (road_blocked)\n {\n player.setX_cordinate(x_cord);\n player.setY_cordinate(y_cord);\n player.setSteps_moved(steps);\n ludo.setDrawRoadBlockedSign(true);\n //println(\"ROAD BLOCKED\");\n road_blocked = false;\n return false;\n }\n playPlayerHasMovedMusic();\n //see if player eats someone\n if (getPerson_to_play() == 1)\n {\n BlueEatsPlayer(player);\n }\n else if (getPerson_to_play() == 2)\n {\n RedEatsPlayer(player);\n }\n else if (getPerson_to_play() == 3)\n {\n GreenEatsPlayer(player);\n }\n else if (getPerson_to_play() == 4)\n {\n YellowEatsPlayer(player);\n }\n if (value_from_die == 6)\n {\n resetDieScore();\n ludo.setDrawScoreAllowed(false);\n return true;\n }\n //reset variables and change person to play\n resetDieScore();\n ludo.setDrawScoreAllowed(false);\n changePersonToPlay();\n return true;\n }\n //occurs rarely at the begining of the game\n else\n {\n //println(\"steps less than 0\");\n return false;\n }\n }\n else\n {\n //println(\"PLIZ ROLL DIE FIRST THEN MOVE BUTTON\");\n return false;\n }\n }", "@Test\n public void respawnRobotX0Y0OnMoveDirectionNORTH(){\n checkRespawnOnOutOfBounds(0, 0, CardinalDirection.NORTH);\n }", "private static boolean initializeDestination(DimLink link, DDProperties properties)\n \t{\n \t\tif (link.hasDestination())\n \t\t{\n \t\t\treturn true;\n \t\t}\n \n \t\t//Check the destination type and respond accordingly\n \t\t//FIXME: Add missing link types.\n \t\t//FIXME: Add code for restoring the destination-side door.\n \t\tswitch (link.linkType())\n \t\t{\n \t\t\tcase LinkTypes.DUNGEON:\n \t\t\t\treturn PocketBuilder.generateNewDungeonPocket(link, properties);\n \t\t\tcase LinkTypes.POCKET:\n \t\t\t\treturn PocketBuilder.generateNewPocket(link, properties);\n \t\t\tcase LinkTypes.NORMAL:\n \t\t\t\treturn true;\n \t\t\tdefault:\n \t\t\t\tthrow new IllegalArgumentException(\"link has an unrecognized link type.\");\n \t\t}\n \t}", "public boolean teleportTo(Projectile p, Level l) {\r\n\t\tRectangle landingZone = new Rectangle(p.x+(p.width/2)-(width/2),p.y+(p.height/2)-(height/2),width,height);\r\n\t\tRectangle[] walls = l.getWalls();\r\n\t\tRectangle[] enemies = l.getAliveEnemies();\r\n\t\tboolean enoughRoom = true;\r\n\t\tfor(int i=0; i<walls.length;i++){\r\n\t\t\tif(landingZone.intersects(walls[i])){\r\n\t\t\t\tenoughRoom = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i=0; i<enemies.length;i++){\r\n\t\t\tif(landingZone.intersects(enemies[i])){\r\n\t\t\t\tenoughRoom = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(landingZone.x < 0 || landingZone.x > 600-landingZone.width || landingZone.y < l.getHudLength() \r\n\t\t\t\t|| landingZone.y > 400 + l.getHudLength() - landingZone.height){\r\n\t\t\tenoughRoom = false;\r\n\t\t}\r\n\t\tif(enoughRoom){\r\n\t\t\tsetLocation(landingZone.x, landingZone.y);\r\n\t\t\tinTeleportCooldown = true;\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "@Test\n public void partyTour() throws FileNotFoundException, URISyntaxException,\n DisconnectedException {\n MatchController matchController = new MatchController() {\n @Override\n public void initMatch(PartyController partyController)\n throws FileNotFoundException, URISyntaxException {\n this.partyController = partyController;\n this.match = new Match();\n this.turnController = new TurnController(this) {\n @Override\n protected boolean isPlayerOffline(Player player) {\n return false;\n }\n\n @Override\n protected void notify(Player nextPlayer) {\n }\n\n };\n ZoneFactory zf = new TemplateZoneFactory(\n EftaiosGame.DEFAULT_MAP);\n this.zoneController = new ZoneController(zf);\n }\n\n @Override\n public void checkEndGame() {\n }\n\n };\n PlayerCard alien = new PlayerCard(PlayerRace.ALIEN, null);\n PlayerCard human = new PlayerCard(PlayerRace.HUMAN, null);\n Party party = new Party(\"test\", new EftaiosGame(), false);\n PartyController partyController = PartyController.createNewParty(party);\n party.addToParty(UUID.randomUUID(), \"player1\");\n party.addToParty(UUID.randomUUID(), \"player2\");\n party.addToParty(UUID.randomUUID(), \"player3\");\n party.addToParty(UUID.randomUUID(), \"player4\");\n party.addToParty(UUID.randomUUID(), \"player5\");\n party.addToParty(UUID.randomUUID(), \"player6\");\n party.addToParty(UUID.randomUUID(), \"player7\");\n List<Player> players = new ArrayList<Player>(party.getMembers()\n .keySet());\n Player player1 = players.get(0);\n Player player2 = players.get(1);\n Player player3 = players.get(2);\n Player player4 = players.get(3);\n Player player5 = players.get(4);\n Player player6 = players.get(5);\n Player player7 = players.get(6);\n player1.setIdentity(alien);\n player2.setIdentity(alien);\n player3.setIdentity(alien);\n player4.setIdentity(alien);\n player5.setIdentity(human);\n player6.setIdentity(human);\n player7.setIdentity(human);\n matchController.initMatch(partyController);\n\n // turno di partenza\n Player startPlayer = new Player(\"\", 9);\n for (Player nextPlayer : players) {\n if (nextPlayer.getIndex() == 7) {\n startPlayer = nextPlayer;\n }\n }\n Turn turn = new Turn(startPlayer, matchController.getMatch()\n .getTurnCount());\n matchController.getTurnController().setTurn(turn);\n assertTrue(matchController.getTurnController().getTurn()\n .getCurrentPlayer().equals(startPlayer));\n int num = matchController.getMatch().getTurnCount();\n\n // cerco il player successivo\n Player endPlayer = new Player(\"\", 9);\n for (Player nextPlayer : players) {\n if (nextPlayer.getIndex() == 1) {\n endPlayer = nextPlayer;\n }\n }\n\n // eseguo\n matchController.getTurnController().nextTurn();\n\n // verifico\n assertTrue(matchController.getTurnController().getTurn()\n .getCurrentPlayer().equals(endPlayer));\n assertTrue(matchController.getMatch().getTurnCount() == num + 1);\n }", "protected void patrol(){\n Point currentDest = patrolPoints.get(pointIndex);\n //Check if we have reached the current destination\n if(this.x == currentDest.x && this.y == currentDest.y){\n nextPatrolPoint();\n }\n if(stuckCounter > 30){\n nextPatrolPoint();\n }\n\n double dist;\n if(this.x != currentDest.x){\n dist = currentDest.x - this.x;\n //Counteracts the effect of speed being greater than the distance, cauing jitter\n if(Math.abs(dist) < speed){\n dx = dist;\n }\n else {\n int direction = (int)(dist/Math.abs(dist));\n switch (direction){\n case 1:\n moveRight();\n break;\n case -1:\n moveLeft();\n break;\n }\n }\n }\n else{\n dx = 0;\n }\n if(this.y != currentDest.y){\n dist = currentDest.y - this.y;\n //Counteracts the effect of speed being greater than the distance, cauing jitter\n if(Math.abs(dist) < speed){\n dy = dist;\n }\n else {\n int direction = (int)(dist/Math.abs(dist));\n switch (direction){\n case 1:\n moveDown();\n break;\n case -1:\n moveUp();\n break;\n }\n }\n }\n else{\n dy = 0;\n }\n }", "public void doComputerTurn() {\n Random rand = new Random();\n int randInt;\n\n if (!currentPlayer.isEmployed()) { // player not employed\n // moves (but suppresses popups) at random and update of player panel\n tryMove();\n\n if (!(currentPlayer.getLocation().getName() == \"trailer\")) {\n if (currentPlayer.getLocation().getName() == \"office\") { // in office\n // upgrade (but suppresses popups) at random and update of player panel\n tryUpgrade();\n \n } else { // in regular set\n // take role (but suppresses popups) at random and update of player panel\n tryTakeRole();\n }\n }\n endTurn();\n } else { // player is employed\n randInt = rand.nextInt(2); // get either 0 or 1\n if (randInt == 0) {\n // rehearse\n tryRehearse(); \n } else {\n // act\n tryAct();\n }\n\n endTurn();\n }\n }", "@Override\n public void interactWith(Door door) {\n if(door instanceof CastleDoor){ //CASTLE DOOR\n if(door.isOpen()){\n setIsPassingADoor(door);\n ((CastleDoor) door).close();\n } else {\n if(possess(ARPGItem.CASTLEKEY)){\n ((CastleDoor) door).open();\n }\n }\n } else { //SIMPLE DOOR\n setIsPassingADoor(door);\n }\n }", "private void createRooms()\n {\n Room outside, garden, kitchen, frontyard, garage, livingroom,\n upperhallway, downhallway, bedroom1, bedroom2, toilet,teleporter;\n\n // create the rooms\n outside = new Room(\"outside the house\",\"Outside\");\n garden = new Room(\"in the Garden\", \"Garden\");\n kitchen = new Room(\"in the Kitchen\",\"Kitchen\");\n frontyard = new Room(\"in the Frontyard of the house\", \"Frontyard\");\n garage = new Room(\"in the Garage\", \"Garage\");\n livingroom = new Room(\"in the Living room\", \"Living Room\");\n upperhallway = new Room(\"in the Upstairs Hallway\",\"Upstairs Hallway\");\n downhallway = new Room(\"in the Downstairs Hallway\", \"Downstairs Hallway\");\n bedroom1 = new Room(\"in one of the Bedrooms\", \"Bedroom\");\n bedroom2 = new Room(\"in the other Bedroom\", \"Bedroom\");\n toilet = new Room(\"in the Toilet upstairs\",\"Toilet\");\n teleporter = new Room(\"in the Warp Pipe\", \"Warp Pipe\");\n\n // initialise room exits\n outside.setExit(\"north\", garden);\n outside.setExit(\"east\", frontyard);\n\n garden.setExit(\"south\", outside);\n garden.setExit(\"east\", kitchen);\n\n kitchen.setExit(\"west\", garden);\n kitchen.setExit(\"north\", livingroom);\n kitchen.setExit(\"south\", downhallway);\n\n frontyard.setExit(\"west\", outside);\n frontyard.setExit(\"north\", downhallway);\n frontyard.setExit(\"east\", garage);\n\n garage.setExit(\"west\", frontyard);\n garage.setExit(\"north\", downhallway);\n\n livingroom.setExit(\"west\", kitchen);\n\n downhallway.setExit(\"north\",kitchen);\n downhallway.setExit(\"west\",frontyard);\n downhallway.setExit(\"south\",garage);\n downhallway.setExit(\"east\",upperhallway);\n\n upperhallway.setExit(\"north\", bedroom2);\n upperhallway.setExit(\"east\", bedroom1);\n upperhallway.setExit(\"south\", toilet);\n upperhallway.setExit(\"west\", downhallway);\n\n toilet.setExit(\"north\", upperhallway);\n\n bedroom1.setExit(\"west\",upperhallway);\n\n bedroom2.setExit(\"south\", upperhallway);\n\n rooms.add(outside);\n rooms.add(garden);\n rooms.add(kitchen);\n rooms.add(frontyard);\n rooms.add(garage);\n rooms.add(livingroom);\n rooms.add(upperhallway);\n rooms.add(downhallway);\n rooms.add(bedroom1);\n rooms.add(bedroom2);\n rooms.add(toilet);\n }", "public static void teleport(ServerPlayer player, ServerLevel world, BlockPos targetPos) {\n player.teleportTo(world, targetPos.getX() + 0.5, targetPos.getY() + 0.1, targetPos.getZ() + 0.5, player.yRotO, player.xRotO);\n }", "public void switchDoors() {\n if (stage != Stage.DOOR_CHOSEN) {\n throw new RuntimeException(\"Invalid Stage\");\n\n }\n chosen_door = switch_door;\n stage = stage.END;\n for (Door door : doors) {\n if (door.getState() == State.CLOSED) {\n door.open();\n }\n continue;\n }\n total_switched++;\n if (chosen_door.getContains() == Contains.CAR) {\n won_switched++;\n }\n }", "public abstract void makePlayer(Vector2 origin);", "private void teletransportar(Personaje p, Celda destino) {\n // TODO implement here\n }", "private void generateLegalMovesPlayer(char player) {\r\n\r\n\t\t// loop through the unitLIst and generate all the moves a player can make\r\n\t\tfor (Unit unit : this.unitList) {\r\n\t\t\tif (unit != null && unit.getColor() == player) {\r\n\t\t\t\tunit.getLegalMoves();\r\n\t\t\t\tinsertMovesIntoMoveList(unit, unit.getMoveList());\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void moveShipRight()\r\n\t\t{\r\n\t\t\t\tboolean moved = true;\r\n int currentPlayer = worldPanel.getCurrentPlayer();\r\n int currentUnit = worldPanel.getCurrentUnit();\r\n\r\n //if firstPlayer move unit right\r\n if(currentPlayer == 1)\r\n {\r\n int currentPos = worldPanel.player1.units[currentUnit - 1].getPosition();\r\n int temp1 = (currentPos + 1) % mapWidth;\r\n if(temp1 == 0)\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos - mapWidth + 1);\r\n }\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player1.units[currentUnit - 1].setPosition(currentPos + 1);\r\n }\r\n }//end if\r\n\r\n //if secondPlayer move unit right\r\n if(currentPlayer == 2)\r\n {\r\n int currentPos = worldPanel.player2.units[currentUnit - 1].getPosition();\r\n int temp1 = (currentPos + 1) % mapWidth;\r\n if(temp1 == 0)\r\n {\r\n int mapTemp = mapPieces[0][currentPos - mapWidth + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos - mapWidth + 1);\r\n }//end if\r\n else\r\n {\r\n int mapTemp = mapPieces[0][currentPos + 1];\r\n if(mapTemp != 0)//if unit tries to move onto land\r\n moved = false;\r\n else\r\n worldPanel.player2.units[currentUnit - 1].setPosition(currentPos + 1);\r\n }//end else\r\n }//end if\r\n\r\n //set up new player once unit has moved\r\n playerMoved(currentPlayer,currentUnit,moved);\r\n\r\n //set up new mapPosition if player moved\r\n if(moved == true)\r\n setMapPos();\r\n\t\t}", "public void move() {\n\n if (_currentFloor == Floor.FIRST) {\n _directionOfTravel = DirectionOfTravel.UP;\n }\n if (_currentFloor == Floor.SEVENTH) {\n _directionOfTravel = DirectionOfTravel.DOWN;\n }\n\n\n if (_directionOfTravel == DirectionOfTravel.UP) {\n _currentFloor = _currentFloor.nextFloorUp();\n } else if (_directionOfTravel == DirectionOfTravel.DOWN) {\n _currentFloor = _currentFloor.nextFloorDown();\n }\n\n if(_currentFloor.hasDestinationRequests()){\n stop();\n } \n\n }", "private static Point avoidNoFlyZones(Point droneCurr, Point droneNextDes, List<List<List<Point>>> noFlyZonesCoords, List<Point> dronePositions, String port) throws IOException, InterruptedException {\r\n\t\tvar intersectingLines = linesWhichIntersect(droneCurr, droneNextDes, noFlyZonesCoords);\r\n\t\tvar numCoords = intersectingLines.size();\r\n\t\t\r\n\t\tvar droneGrad = getGradient(droneCurr, droneNextDes);\r\n\t\tvar droneYint = getYint(droneCurr, droneNextDes);\r\n\t\tvar droneNext = droneNextDes; //in the case that there are no intersections with any lines\r\n\t\t\r\n\t\tPoint previous1 = null;\r\n\t\tPoint previous2 = null;\r\n\t\tvar lastIndex = dronePositions.size()-1;\r\n\t\tif(lastIndex>1) { //checks that drone has been in at least 3 positions\r\n\t\t\tprevious1 = dronePositions.get(lastIndex-1); //previous position of drone\r\n\t\t\tprevious2 = dronePositions.get(lastIndex-2); //position before previous position\r\n\t\t}\r\n\t\t\r\n\t\t//in the case that the drone intersects with one line\r\n\t\tif(numCoords == 2) {\r\n\t\t\tvar coord1 = intersectingLines.get(0);\r\n\t\t\tvar coord2 = intersectingLines.get(1); \r\n\t\t\tvar buildingInd = buildingIndex(coord1, port);\r\n\t\t\tif(buildingInd != 100) { //index initialised as 100 in buildingIndex function- if coordinate not found in list, 100 is returned\r\n\t\t\t\tvar buildingCentre = buildingCentres(port).get(buildingInd);\r\n\t\t\t\tvar buildingSideGrad = getGradient(coord1, coord2);\r\n\t\t\t\tdroneNext = chooseNextPos(droneCurr, droneNextDes, coord1, coord2, buildingSideGrad, buildingCentre, noFlyZonesCoords, previous1, previous2);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t//in the case that the drone intersects with two lines\r\n\t\telse if(numCoords == 4) {\r\n\t\t\tvar coord1 = intersectingLines.get(0);\r\n\t\t\tvar coord2 = intersectingLines.get(1);\r\n\t\t\tvar coord3 = intersectingLines.get(2);\r\n\t\t\tvar coord4 = intersectingLines.get(3);\r\n\t\t\t\r\n\t\t\tvar buildingSide1Grad = getGradient(coord1, coord2);\r\n\t\t\tvar buildingSide1Yint = getYint(coord1, coord2);\r\n\t\t\tvar intersection1 = getIntersection(droneYint, buildingSide1Yint, droneGrad, buildingSide1Grad);\r\n\t\t\tvar dist1 = euclidDist(intersection1, droneCurr);\r\n\t\t\t\r\n\t\t\tvar buildingSide2Grad = getGradient(coord3, coord4);\r\n\t\t\tvar buildingSide2Yint = getYint(coord3, coord4);\r\n\t\t\tvar intersection2 = getIntersection(droneYint, buildingSide2Yint, droneGrad, buildingSide2Grad);\r\n\t\t\tvar dist2 = euclidDist(intersection2, droneCurr);\r\n\t\t\t\r\n\t\t\tvar buildingInd1 = buildingIndex(coord1, port); //in case the two lines which the drone intersects with are from 2 different buildings\r\n\t\t\tvar buildingInd2 = buildingIndex(coord3, port);\r\n\t\t\tif(buildingInd1 !=100 && buildingInd2 !=100) { \r\n\t\t\t\tvar buildingCentre1 = buildingCentres(port).get(buildingInd1);\r\n\t\t\t\tvar buildingCentre2 = buildingCentres(port).get(buildingInd2);\r\n\t\t\t\t\r\n\t\t\t\tif(dist1<dist2) { //to determine which side the drone path intersects with first\r\n\t\t\t\t\tdroneNext = chooseNextPos(droneCurr, droneNextDes, coord1, coord2, buildingSide1Grad, buildingCentre1, noFlyZonesCoords, previous1, previous2);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdroneNext = chooseNextPos(droneCurr, droneNextDes, coord3, coord4, buildingSide2Grad, buildingCentre2, noFlyZonesCoords, previous1, previous2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t} \r\n\t\t//in the case that the drone intersects with three lines\r\n\t\telse if(numCoords == 6) {\r\n\t\t\tvar coord1 = intersectingLines.get(0);\r\n\t\t\tvar coord2 = intersectingLines.get(1);\r\n\t\t\tvar coord3 = intersectingLines.get(2);\r\n\t\t\tvar coord4 = intersectingLines.get(3);\r\n\t\t\tvar coord5 = intersectingLines.get(4);\r\n\t\t\tvar coord6 = intersectingLines.get(5);\r\n\t\t\t\r\n\t\t\tvar buildingSide1Grad = getGradient(coord1, coord2);\r\n\t\t\tvar buildingSide1Yint = getYint(coord1, coord2);\r\n\t\t\tvar intersection1 = getIntersection(droneYint, buildingSide1Yint, droneGrad, buildingSide1Grad);\r\n\t\t\tvar dist1 = euclidDist(intersection1, droneCurr);\r\n\t\t\t\r\n\t\t\tvar buildingSide2Grad = getGradient(coord3, coord4);\r\n\t\t\tvar buildingSide2Yint = getYint(coord3, coord4);\r\n\t\t\tvar intersection2 = getIntersection(droneYint, buildingSide2Yint, droneGrad, buildingSide2Grad);\r\n\t\t\tvar dist2 = euclidDist(intersection2, droneCurr);\r\n\t\t\t\r\n\t\t\tvar buildingSide3Grad = getGradient(coord5, coord6);\r\n\t\t\tvar buildingSide3Yint = getYint(coord5, coord6);\r\n\t\t\tvar intersection3 = getIntersection(droneYint, buildingSide3Yint, droneGrad, buildingSide3Grad);\r\n\t\t\tvar dist3 = euclidDist(intersection3, droneCurr);\r\n\t\t\t\r\n\t\t\tvar minDist = Math.min(Math.min(dist1, dist2),dist3);\r\n\t\t\t\r\n\t\t\tvar buildingInd1 = buildingIndex(coord1, port); //in case the three lines which the drone intersects with are from 3 different buildings\r\n\t\t\tvar buildingInd2 = buildingIndex(coord3, port);\r\n\t\t\tvar buildingInd3 = buildingIndex(coord5, port);\r\n\t\t\tif(buildingInd1 !=100 && buildingInd2 != 100 && buildingInd3 != 100) {\r\n\t\t\t\tvar buildingCentre1 = buildingCentres(port).get(buildingInd1);\r\n\t\t\t\tvar buildingCentre2 = buildingCentres(port).get(buildingInd2);\r\n\t\t\t\tvar buildingCentre3 = buildingCentres(port).get(buildingInd3);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tif(minDist==dist1) {\r\n\t\t\t\t\tdroneNext = chooseNextPos(droneCurr, droneNextDes, coord1, coord2, buildingSide1Grad, buildingCentre1, noFlyZonesCoords, previous1, previous2);\r\n\t\t\t\t}\r\n\t\t\t\telse if(minDist==dist2) {\r\n\t\t\t\t\tdroneNext = chooseNextPos(droneCurr, droneNextDes, coord3, coord4, buildingSide2Grad, buildingCentre2, noFlyZonesCoords, previous1, previous2);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdroneNext = chooseNextPos(droneCurr, droneNextDes, coord5, coord6, buildingSide3Grad, buildingCentre3, noFlyZonesCoords, previous1, previous2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn droneNext;\r\n\t}", "public void setDoor() {\n\t\tisaDoor = true;\n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate void planTower(Direction freeDirection) throws GameActionException {\r\n\t\tstairs.clear();\r\n\t\tstairs.add(fluxInfo.location);\r\n\t\tif (true) return;\r\n\t\t\r\n\t\tList<MapLocation> blocks = new ArrayList<MapLocation>(Arrays.asList(myRC.senseNearbyBlocks()));\r\n\t\tint howMany = 0;\r\n\t\tint towerSize = 0;\r\n\t\tfor (MapLocation blockLocation : blocks) {\r\n\t\t\thowMany += myRC.senseNumBlocksAtLocation(blockLocation);\r\n\t\t}\r\n\t\t\r\n\t\tstairs.add(fluxInfo.location);\r\n\t\ttowerSize++;\r\n\t\thowMany -= 2;\r\n\t\t\r\n\t\tDirection towerDirection = freeDirection.rotateRight().rotateRight();\r\n\t\twhile ((howMany > 0) && (towerDirection != freeDirection)){\r\n\t\t\tstairs.add(1, fluxInfo.location.add(towerDirection));\r\n\t\t\ttowerSize++;\r\n\t\t\thowMany -= towerSize * 2;\r\n\t\t\ttowerDirection = towerDirection.rotateRight();\r\n\t\t}\r\n\t\t\r\n\t\tCollections.reverse(stairs);\r\n\t}", "@Override\n public void doAction() {\n String move = agent.getBestMove(currentPosition);\n execute(move);\n\n //Location of the player\n int cX = w.getPlayerX();\n int cY = w.getPlayerY();\n\n if (w.hasWumpus(cX, cY)) {\n System.out.println(\"Wampus is here\");\n w.doAction(World.A_SHOOT);\n } else if (w.hasGlitter(cX, cY)) {\n System.out.println(\"Agent won\");\n w.doAction(World.A_GRAB);\n } else if (w.hasPit(cX, cY)) {\n System.out.println(\"Fell in the pit\");\n }\n\n// //Basic action:\n// //Grab Gold if we can.\n// if (w.hasGlitter(cX, cY)) {\n// w.doAction(World.A_GRAB);\n// return;\n// }\n//\n// //Basic action:\n// //We are in a pit. Climb up.\n// if (w.isInPit()) {\n// w.doAction(World.A_CLIMB);\n// return;\n// }\n//\n// //Test the environment\n// if (w.hasBreeze(cX, cY)) {\n// System.out.println(\"I am in a Breeze\");\n// }\n// if (w.hasStench(cX, cY)) {\n// System.out.println(\"I am in a Stench\");\n// }\n// if (w.hasPit(cX, cY)) {\n// System.out.println(\"I am in a Pit\");\n// }\n// if (w.getDirection() == World.DIR_RIGHT) {\n// System.out.println(\"I am facing Right\");\n// }\n// if (w.getDirection() == World.DIR_LEFT) {\n// System.out.println(\"I am facing Left\");\n// }\n// if (w.getDirection() == World.DIR_UP) {\n// System.out.println(\"I am facing Up\");\n// }\n// if (w.getDirection() == World.DIR_DOWN) {\n// System.out.println(\"I am facing Down\");\n// }\n//\n// //decide next move\n// rnd = decideRandomMove();\n// if (rnd == 0) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 1) {\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 2) {\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_TURN_LEFT);\n// w.doAction(World.A_MOVE);\n// }\n//\n// if (rnd == 3) {\n// w.doAction(World.A_TURN_RIGHT);\n// w.doAction(World.A_MOVE);\n// }\n }", "public static Move openingStrategy(PentagoBoardState boardState, int player) {\n\t Move firstMoveOne = new PentagoMove(1, 0, Quadrant.BL, Quadrant.BR, player);\r\n\t Move firstMoveTwo = new PentagoMove(1, 3, Quadrant.BL, Quadrant.BR, player);\r\n\t Move moveThree = new PentagoMove(0, 1, Quadrant.BL, Quadrant.TR, player);\r\n\t Move moveFour = new PentagoMove(0, 4, Quadrant.TL, Quadrant.BR, player);\r\n\t Move moveFive = new PentagoMove(3, 1, Quadrant.BL, Quadrant.TL, player);\r\n\t Move moveSix = new PentagoMove(3, 4, Quadrant.TL, Quadrant.TR, player);\r\n\t Move moveSeven = new PentagoMove(2, 2, Quadrant.TL, Quadrant.TR, player);\r\n\t Move moveEight = new PentagoMove(2, 5, Quadrant.TL, Quadrant.BR, player);\r\n\t Move moveNine = new PentagoMove(5, 2, Quadrant.BL, Quadrant.TL, player);\r\n\t Move moveTen = new PentagoMove(5, 5, Quadrant.TL, Quadrant.TR, player);\r\n\t \r\n\t //First turn as either Black or White\r\n\t if(boardState.getTurnNumber() == 0 || boardState.getTurnNumber() == 1) {\r\n\t if(boardState.isLegal((PentagoMove) firstMoveOne)) {\r\n\t \treturn firstMoveOne;\r\n\t }\r\n\t else if(boardState.isLegal((PentagoMove) firstMoveTwo)) {\r\n\t \treturn firstMoveTwo;\r\n\t }\r\n\t else {\r\n\t \t/* If something goes awry, play the first legal move (will place pieces in TL quadrant usually).\r\n\t \t * Same error condition for the following moves as well.\r\n\t \t **/\r\n\t \tArrayList<PentagoMove> legalMoves = boardState.getAllLegalMoves();\r\n\t \treturn legalMoves.get(0);\r\n\t }\r\n\t }\r\n\t else if(boardState.getTurnNumber() == 2 || boardState.getTurnNumber() == 3) {\r\n\t \t//White player turn 2 & 3 set up\r\n\t \tif(player == 0) {\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveThree) && boardState.getPieceAt(1, 0).toString().equals(\"w\")) {\r\n\t\t \treturn moveThree;\r\n\t\t }\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveFour) && boardState.getPieceAt(1, 3).toString().equals(\"w\")) {\r\n\t\t \t\treturn moveFour;\r\n\t\t \t}\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveFive) && boardState.getPieceAt(4, 0).toString().equals(\"w\")) {\r\n\t\t \treturn moveFive;\r\n\t\t }\r\n\t\t \tif(boardState.isLegal((PentagoMove) moveSix) && boardState.getPieceAt(4, 3).toString().equals(\"w\")) {\r\n\t\t \t\treturn moveSix;\r\n\t\t \t}\r\n\t\t \tif(boardState.getPieceAt(0, 1).toString().equals(\"b\") && boardState.getPieceAt(1, 0).toString().equals(\"w\")\t\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveSeven)) {\r\n\t\t \treturn moveSeven;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(0, 4).toString().equals(\"b\") && boardState.getPieceAt(1, 3).toString().equals(\"w\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveEight)) {\r\n\t\t \t\treturn moveEight;\r\n\t\t \t}\r\n\t\t \tif(boardState.getPieceAt(3, 1).toString().equals(\"b\") && boardState.getPieceAt(4, 0).toString().equals(\"w\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveNine)) {\r\n\t\t \treturn moveNine;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(3, 4).toString().equals(\"b\") && boardState.getPieceAt(4, 3).toString().equals(\"w\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveTen)) {\r\n\t\t \t\treturn moveTen;\r\n\t\t \t}\r\n\t\t else {\r\n\t\t \tArrayList<PentagoMove> legalMoves = boardState.getAllLegalMoves();\r\n\t\t \treturn legalMoves.get(0);\r\n\t\t }\r\n\t \t} \r\n\t \t//Black player turn 2 & 3 set up\r\n\t \telse {\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveThree) && boardState.getPieceAt(1, 0).toString().equals(\"b\")) {\r\n\t\t \treturn moveThree;\r\n\t\t }\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveFour) && boardState.getPieceAt(1, 3).toString().equals(\"b\")) {\r\n\t\t \treturn moveFour;\r\n\t\t }\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveFive) && boardState.getPieceAt(4, 0).toString().equals(\"b\")) {\r\n\t\t \treturn moveFive;\r\n\t\t }\r\n\t \t\tif(boardState.isLegal((PentagoMove) moveSix) && boardState.getPieceAt(4, 3).toString().equals(\"b\")) {\r\n\t\t \treturn moveSix;\r\n\t\t }\r\n\t \t\tif(boardState.getPieceAt(0, 1).toString().equals(\"w\") && boardState.getPieceAt(1, 0).toString().equals(\"b\")\r\n\t \t\t\t\t&& boardState.isLegal((PentagoMove) moveSeven)) {\r\n\t\t \treturn moveSeven;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(0, 4).toString().equals(\"w\") && boardState.getPieceAt(1, 3).toString().equals(\"b\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveEight)) {\r\n\t\t \t\treturn moveEight;\r\n\t\t \t}\r\n\t\t \tif(boardState.getPieceAt(3, 1).toString().equals(\"w\") && boardState.getPieceAt(4, 0).toString().equals(\"b\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveNine)) {\r\n\t\t \treturn moveNine;\r\n\t\t }\r\n\t\t \tif(boardState.getPieceAt(3, 4).toString().equals(\"w\") && boardState.getPieceAt(4, 3).toString().equals(\"b\")\r\n\t\t \t\t\t&& boardState.isLegal((PentagoMove) moveTen)) {\r\n\t\t \t\treturn moveTen;\r\n\t\t \t}\r\n\t\t else {\r\n\t\t \tArrayList<PentagoMove> legalMoves = boardState.getAllLegalMoves();\r\n\t\t \treturn legalMoves.get(0);\r\n\t\t }\r\n\t \t}\t \r\n\t }\r\n\t else {\r\n\t \t//If we are past Player's Turn 3, start using MiniMax with a-b pruning\r\n\t \tMiniMaxABPruning instc = new MiniMaxABPruning();\r\n\t \treturn instc.abPruningStrategy(boardState, boardState.getTurnPlayer());\r\n\t }\r\n\t}", "public abstract Vec2 doorPosition();", "public void teleportation(Vector2 posTp) {\n int distance = (int) Math.sqrt(Math.pow(posTp.x - position.x, 2) + Math.pow(posTp.y - position.y, 2));\n int coef = 50;\n if (wallet.getMoney() >= coef*distance) {\n position.set(posTp);\n position.x += WIDTH/2;\n resetMiner();\n wallet.withdraw(coef * distance);\n }\n }", "@Override\n\tpublic void onTurnRight(PlatformPlayer player) {\n\t\t\n\t}", "private void setDirection() {\r\n\t\tif (destinationFloor > initialFloor){\r\n\t\t\tdirection = 1;\r\n\t\t} else {\r\n\t\t\tdirection = -1;\r\n\t\t}\r\n\t}", "public void play() {\n Player playerOne = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.one\"), null));\n Player currentPlayer = playerOne;\n ShipsGameBoard playerOneGameBoard = new ShipsGameBoard(playerOne, playerOneFleet);\n ShipsGameBoard playerOneCheckBoard = new ShipsGameBoard(playerOne, playerOneFleetToCheck);\n playerOneCheckBoard.setup();\n\n TreeMap<Character, Integer> lettersAndDigits = lettersAndDigits(playerOneGameBoard.getLength());\n ShipCreator threeMastShipCreatorPlayerOne = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerOne,\n ShipGameBoardMark.THREE_MASTS,\n playerOneGameBoard,\n playerOneShipsGameLogic);\n\n playerOneGameBoard.print();\n shipsDeployment(playerOneGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerOne,\n playerOneShipsGameLogic,\n playerOneFleet,\n NUMBER_OF_SHIPS);\n\n// playerOneShipsGameLogic.clearConsole();\n\n Player playerTwo = preparePlayer(getUserName(scanner, validator, shipsGameText.getMessage(\"show.player.two\"), playerOne.getName()));\n ShipsGameBoard playerTwoGameBoard = new ShipsGameBoard(playerTwo, playerTwoFleet);\n ShipsGameBoard playerTwoCheckBoard = new ShipsGameBoard(playerTwo, playerTwoFleetToCheck);\n playerTwoCheckBoard.setup();\n\n ShipCreator threeMastShipCreatorPlayerTwo = new ShipCreator(THREE_MASTS_SHIP,\n null,\n playerTwo,\n ShipGameBoardMark.THREE_MASTS,\n playerTwoGameBoard,\n playerTwoShipsGameLogic);\n\n playerTwoGameBoard.print();\n shipsDeployment(playerTwoGameBoard,\n lettersAndDigits,\n threeMastShipCreatorPlayerTwo,\n playerTwoShipsGameLogic,\n playerTwoFleet,\n NUMBER_OF_SHIPS);\n\n\n boolean isAWinner = false;\n do {\n int userRow;\n int userCol;\n// playerOneGameBoard.clearConsole();\n showCurrentPlayerBoards(playerOne, currentPlayer, playerOneGameBoard, playerTwoGameBoard, playerOneCheckBoard,\n playerTwoCheckBoard, shipsGameText);\n System.out.println(shipsGameText.getMessage(\"show.witch.player.move\", currentPlayer.getName()));\n\n System.out.println(shipsGameText.getMessage(\"show.input.row\", Integer.toString(playerOneGameBoard.getLength())));\n userRow = getPlayerRowChoice(scanner, validator, playerOneGameBoard.getLength());\n\n System.out.println(shipsGameText.getMessage(\"show.input.col\",\n Character.toString(playerOneGameBoard.generateLastLetterOfColumn('A', playerOneGameBoard.getLength()))));\n userCol = convertLetterToDigit(lettersAndDigits, getPlayerColChoice(scanner, validator,\n lettersAndDigits));\n\n if (currentPlayer.equals(playerOne)) {\n if (playerTwoShipsGameLogic.checkForHit(userRow, userCol)) {\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerOneCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n playerTwoGameBoard.print();\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n playerOneShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n playerTwoShipsGameLogic.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.MISS);\n }\n\n// if (playerTwoShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n// playerTwoShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerTwo);\n// playerOneShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerTwoFleet, playerOne);\n// System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n// System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n// playerOneCheckBoard.print();\n// System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerTwo.getName()));\n// playerTwoGameBoard.print();\n// }\n\n\n if (playerTwoShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerOne.getName()));\n isAWinner = true;\n }\n\n } else {\n if (playerOneShipsGameLogic.checkForHit(userRow, userCol)) {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerTwo, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.HIT_BUT_NOT_SUNK);\n if (playerOneShipsGameLogic.checkShipForStatusChange(userRow, userCol)) {\n playerOneShipsGameLogic.changeShipStatusToSunk(userRow, userCol, playerOne);\n playerTwoShipsGameLogicToCheck.changeShipStatusToSinkOnCheckBoard(playerOneFleet, playerTwo);\n System.out.println(shipsGameText.getMessage(\"show.player.sunk.ship\"));\n System.out.println(shipsGameText.getMessage(\"show.player.checkboard\", currentPlayer.getName()));\n playerTwoCheckBoard.print();\n System.out.println(shipsGameText.getMessage(\"show.player.gameboard\", playerOne.getName()));\n playerOneGameBoard.print();\n }\n else {\n System.out.println(shipsGameText.getMessage(\"show.player.hit.ship\", playerOne.getName()));\n }\n } else {\n playerTwoShipsGameLogicToCheck.changeMastStatus(userRow, userCol, playerOne,\n ShipGameBoardMark.MISS);\n playerOneShipsGameLogic.changeMastStatus(userRow, userCol, playerOne, ShipGameBoardMark.MISS);\n System.out.println(shipsGameText.getMessage(\"show.player.miss\"));\n }\n if (playerOneShipsGameLogic.isPlayerLoose()) {\n System.out.println(shipsGameText.getMessage(\"show.player.win\", playerTwo.getName()));\n isAWinner = true;\n }\n }\n\n currentPlayer = swapPlayers(playerOne, currentPlayer, playerTwo);\n }\n while (!isAWinner);\n }", "@Override\n public void execute() {\n vars.setState(\"Teleporting...\");\n Methods.teleToFlameKing();\n }", "private void nextPosition()\n\t{\n\t\tdouble playerX = Game.player.getX();\n\t\tdouble playerY = Game.player.getY();\n\t\tdouble diffX = playerX - x;\n\t\tdouble diffY = playerY - y;\n\t\tif(Math.abs(diffX) < 64 && Math.abs(diffY) < 64)\n\t\t{\n\t\t\tclose = true;\n\t\t} \n\t\telse\n\t\t{\n\t\t\tclose = false;\n\t\t}\n\t\tif(close)\n\t\t{\n\t\t\tattackPlayer();\n\t\t} \n\t\telse if(alarm.done())\n\t\t{\n\t\t\tdirection = Math.abs(random.nextInt() % 360) + 1;\n\t\t\talarm.setTime(50);\n\t\t}\n\t\thspd = MathMethods.lengthDirX(speed, direction);\n\t\tvspd = MathMethods.lengthDirY(speed, direction);\n\t\tif(hspd > 0 && !flippedRight)\n\t\t{\n\t\t\tflippedRight = true;\n\t\t\tsetEnemy();\n\t\t} \n\t\telse if(hspd < 0 && flippedRight)\n\t\t{\n\t\t\tflippedRight = false;\n\t\t\tsetEnemy();\n\t\t}\n\t\tmove();\n\t\talarm.tick();\n\t\tshootTimer.tick();\n\t}", "public boolean teleport ( Location location , PlayerTeleportEvent.TeleportCause cause ) {\n\t\treturn invokeSafe ( \"teleport\" , location , cause );\n\t}", "public Door getDoor(String direction) {\n if (getDoors().containsKey(direction)) {\n return (getDoors().get(direction));\n } else {\n return (null);\n }\n\n }", "public interface Player {\n\n\n /**\n * Represents the attack result of random strategy.\n *\n * @return an attack result\n */\n AttackResult randomAttack();\n\n /**\n * Represents the attack result of user strategy.\n *\n * @return an attack result\n */\n AttackResult userAttack();\n\n /**\n * Represents the attack result of smart strategy.\n *\n * @return an attack result\n */\n AttackResult smartAttack();\n\n /**\n * Tells if one of the players has win the game.\n *\n * @return true if wins the game and false otherwise\n */\n boolean winGame();\n\n /**\n * Prints the fleet map.\n *\n * @param printer the printer to print the map\n */\n void printFleet(ConsolePrinter printer);\n\n /**\n * Prints the battle map.\n *\n * @param printer the printer to print the map\n */\n void printBattle(ConsolePrinter printer);\n\n /**\n * Creates a user player.\n *\n * @param randPlace true if place the ship randomly and false to place the ship by the player\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new user player\n */\n static Player createUserPlayer(boolean randPlace, FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, randPlace);\n }\n\n /**\n * Creates a robot player.\n *\n * @param fleetMap the fleet map of the player\n * @param battleMap the battle map of the player\n * @return a new robot player\n */\n static Player createRobotPlayer(FleetMap fleetMap, BattleMap battleMap) {\n return new AbstractPlayer(fleetMap, battleMap, true);\n }\n}", "private void wander(){\n\t\tmonster.moveRandom();\r\n\t\tsaveMove();\r\n\t}", "public Door(Direction direction){\n this.direction=direction;\n location=new PointF();\n setLocation(direction);\n rect = new RectF(location.x - size, location.y - size, location.x + size, location.y + size);\n }" ]
[ "0.57902974", "0.5684571", "0.5485919", "0.5449063", "0.54176414", "0.53478736", "0.53442734", "0.5342095", "0.53011775", "0.5222502", "0.51621157", "0.5160502", "0.51591396", "0.5142965", "0.5130192", "0.51213455", "0.506555", "0.5062984", "0.505838", "0.5047471", "0.5027972", "0.5015704", "0.5006957", "0.5002959", "0.4982245", "0.49681976", "0.49615115", "0.49506083", "0.4948762", "0.49266642", "0.49153888", "0.49077237", "0.49043357", "0.49031475", "0.48947424", "0.4882392", "0.4881321", "0.48787105", "0.4875443", "0.4866305", "0.4858064", "0.4856139", "0.48491666", "0.4848863", "0.48466524", "0.48433983", "0.48391947", "0.48357725", "0.4832408", "0.48317617", "0.48146212", "0.48063916", "0.47889888", "0.47788006", "0.47787246", "0.4775015", "0.47716826", "0.47691897", "0.47640303", "0.47607416", "0.47571418", "0.47563756", "0.4750243", "0.47390917", "0.47263733", "0.4718628", "0.47118685", "0.47113025", "0.47030297", "0.4699929", "0.46965927", "0.46917272", "0.46857086", "0.4682916", "0.46819785", "0.46728432", "0.4667112", "0.46640944", "0.46548626", "0.4649516", "0.46489474", "0.4641833", "0.46417874", "0.46406844", "0.4638764", "0.46345878", "0.4633186", "0.4632471", "0.46310323", "0.46084142", "0.46068758", "0.46029145", "0.45991835", "0.4589437", "0.4588646", "0.45792064", "0.4578872", "0.45715347", "0.45692265", "0.45638993", "0.4562279" ]
0.0
-1
FIXME: Change this later to support rooms that have been wiped and must be regenerated.
private static boolean initializeDestination(DimLink link, DDProperties properties) { if (link.hasDestination()) { return true; } //Check the destination type and respond accordingly //FIXME: Add missing link types. //FIXME: Add code for restoring the destination-side door. switch (link.linkType()) { case LinkTypes.DUNGEON: return PocketBuilder.generateNewDungeonPocket(link, properties); case LinkTypes.POCKET: return PocketBuilder.generateNewPocket(link, properties); case LinkTypes.NORMAL: return true; default: throw new IllegalArgumentException("link has an unrecognized link type."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void createRooms()//refactored\n {\n currentRoom = RoomCreator.buildCurrentRooms();//new\n }", "private static void performRoomManagement() {\n\t\t\r\n\t\t\r\n\r\n\t}", "Room getRoom();", "Room getRoom();", "public void populateRooms(){\n }", "public void createRooms()//Method was given\n { \n \n // create the rooms, format is name = new Room(\"description of the situation\"); ex. desc = 'in a small house' would print 'you are in a small house.'\n outside = new Room(\"outside\", \"outside of a small building with a door straight ahead. There is a welcome mat, a mailbox, and a man standing in front of the door.\", false);\n kitchen = new Room(\"kitchen\", \"in what appears to be a kitchen. There is a sink and some counters with an easter egg on top of the counter. There is a locked door straight ahead, and a man standing next to a potted plant. There is also a delicious looking chocolate bar sitting on the counter... how tempting\", true);\n poolRoom = new Room(\"pool room\", \"in a new room that appears much larger than the first room.You see a table with a flashlight, towel, and scissors on it. There is also a large swimming pool with what looks like a snorkel deep in the bottom of the pool. Straight ahead of you stands the same man as before.\", true);\n library = new Room(\"library\", \"facing east in a new, much smaller room than before. There are endless rows of bookshelves filling the room. All of the books have a black cover excpet for two: one red book and one blue book. The man stands in front of you, next to the first row of bookshelves\", true);\n exitRoom = new Room(\"exit\", \"outside of the building again. You have successfully escaped, congratulations! Celebrate with a non-poisonous chocolate bar\",true);\n \n // initialise room exits, goes (north, east, south, west)\n outside.setExits(kitchen, null, null, null);\n kitchen.setExits(poolRoom, null, outside, null);\n poolRoom.setExits(null, library, kitchen, null);\n library.setExits(null, null, exitRoom, poolRoom);\n exitRoom.setExits(null, null, null, null); \n \n currentRoom = outside; // start game outside\n }", "RoomInfo room(String name);", "private static void printRoom(Room currentRoom) {\n\t\t\n\t}", "public EventRoom getNewRoom(){\r\n newRoom.setRoomItems(eventRoomItems);\r\n return newRoom;\r\n }", "public Room(String roomName) {\n guests = new ArrayList<>();\n roomTier = null;\n this.roomName = roomName;\n this.roomId = RoomId.generate(roomName);\n }", "private void createRooms()\n {\n Room outside, theatre, pub, lab, office , hallway, backyard,chickenshop;\n \n // create the rooms\n outside = new Room(\"outside the main entrance of the university\");\n theatre = new Room(\"in a lecture theatre\");\n pub = new Room(\"in the campus pub\");\n lab = new Room(\"in a computing lab\");\n office = new Room(\"in the computing admin office\");\n hallway=new Room (\"in the hallway of the university\");\n backyard= new Room( \"in the backyard of the university\");\n chickenshop= new Room(\"in the chicken shop\");\n \n \n \n // initialise room exits\n outside.setExit(\"east\", theatre);\n outside.setExit(\"south\", lab);\n outside.setExit(\"west\", pub);\n\n theatre.setExit(\"west\", outside);\n theatre.setExit(\"north\", backyard);\n\n pub.setExit(\"east\", outside);\n\n lab.setExit(\"north\", outside);\n lab.setExit(\"east\", office);\n \n office.setExit(\"south\", hallway);\n office.setExit(\"west\", lab);\n \n chickenshop.setExit(\"west\", lab);\n\n currentRoom = outside; // start game outside\n \n }", "private void createRooms()\n {\n // create the rooms\n prison = new Room(\"Prison\", \"Prison. You awake in a cold, dark cell. Luckily, the wall next to you has been blown open. \\nUnaware of your current circumstances, you press on... \\n\");\n promenade = new Room(\"Promenade\",\"Promenade. After stumbling upon a ladder, you decided to climb up. \\n\" + \n \"You appear outside a sprawling promenade. There appears to be something shiny stuck in the ground... \\n\");\n sewers = new Room(\"Sewers\",\"Sewers. It smells... interesting. As you dive deeper, you hear something creak\");\n ramparts = new Room(\"Ramparts\", \"Ramparts. You feel queasy as you peer down below. \\nAs you make your way along, you're greated by a wounded soldier.\" +\n \"\\nIn clear agony, he slowly closes his eyes as he says, 'the king... ki.. kil... kill the king..' \\n\");\n depths = new Room(\"Depths\", \"Depths. You can hardly see as to where you're going...\" + \"\\n\");\n ossuary = new Room(\"Ossuary\", \"Ossuary. A chill runs down your spine as you examine the skulls... \\n\" +\n \"but wait... is.. is one of them... moving? \\n\" +\"\\n\" + \"\\n\" + \"There seems to be a chest in this room!\" + \"\\n\");\n bridge = new Room(\"Bridge\", \"Bridge. A LOUD SHREIK RINGS OUT BEHIND YOU!!! \\n\");\n crypt = new Room(\"Crypt\", \"Crypt. An eerire feeling begins to set in. Something about this place doesn't seem quite right...\" + \"\\n\");\n graveyard = new Room(\"Graveyard\", \"Graveyard. The soil looks rather soft. \\n\" +\n \"As you being to dive deeper, you begin to hear moans coming from behind you...\");\n forest = new Room(\"Forest\", \"Forest. It used to be gorgeous, and gleaming with life; that is, until the king came...\" + \"\\n\" +\n \"there's quite a tall tower in front of you... if only you had something to climb it.\" + \"\\n\");\n tower = new Room(\"Tower\", \"Tower. As you look over the land, you're astounded by the ruin and destruction the malice and king have left behind. \\n\");\n castle = new Room(\"Castle\", \"Castle. Used to be the most elegant and awe-inspiring building in the land. \\n\" +\n \"That is, before the king showed up... \\n\" +\n \"wait... is that... is that a chest? \\n\");\n throneRoomEntrance = new Room(\"Throne Entrance\", \"You have made it to the throne room entrance. Press on, if you dare.\");\n throne = new Room(\"Throne Room\", \"You have entered the throne room. As you enter, the door slams shut behind you! \\n\" +\n \"Before you stands, the king of all malice and destruction, Mr. Rusch\" + \"\\n\");\n deathRoom1 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom2 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom3 = new Room(\"Death Room\", \"THE DOOR SLAMS SHUT BEHIND YOU\");\n deathRoom4 = new Room(\"Death Room\", \"depths of the earth... well part of you at least.\" + \"\\n\" + \"You fell off the peaks of the castle to your untimely death\");\n \n // initialise room exits\n\n currentRoom = prison; // start game outside player.setRoom(currentRoom);\n player.setRoom(currentRoom);\n \n }", "private ArrayList<Room> createRooms() {\n //Adding starting position, always rooms(index0)\n\n rooms.add(new Room(\n \"Du sidder på dit kontor. Du kigger på uret og opdager, at du er sent på den. WTF! FISKEDAG! Bare der er fiskefilet tilbage, når du når kantinen. Du må hellere finde en vej ud herfra og hen til kantinen.\",\n false,\n null,\n null\n ));\n\n //Adding offices to <>officerooms, randomly placed later \n officeRooms.add(new Room(\n \"Du bliver kort blændet af en kontorlampe, som peger lige mod døråbningen. Du ser en gammel dame.\",\n false,\n monsterList.getMonster(4),\n itemList.getItem(13)\n ));\n\n officeRooms.add(new Room(\n \"Der er ingen i rummet, men rodet afslører, at det nok er Phillipas kontor.\",\n false,\n null,\n itemList.getItem(15)\n ));\n\n officeRooms.add(new Room(\n \"Du vader ind i et lokale, som er dunkelt oplyst af små, blinkende lamper og har en stank, der siger så meget spar fem, at det kun kan være IT-lokalet. Du når lige at høre ordene \\\"Rick & Morty\\\".\",\n false,\n monsterList.getMonster(6),\n itemList.getItem(7)\n ));\n\n officeRooms.add(new Room(\n \"Det var ikke kantinen det her, men hvorfor er der så krummer på gulvet?\",\n false,\n null,\n itemList.getItem(1)\n ));\n\n officeRooms.add(new Room(\n \"Tine sidder ved sit skrivebord. Du kan se, at hun er ved at skrive en lang indkøbsseddel. Hun skal nok have gæster i aften.\",\n false,\n monsterList.getMonster(0),\n itemList.getItem(18)\n ));\n\n officeRooms.add(new Room(\n \"Du træder ind i det tekøkken, hvor Thomas plejer at opholde sig. Du ved, hvad det betyder!\",\n false,\n null,\n itemList.getItem(0)\n ));\n\n officeRooms.add(new Room(\n \"Du går ind i det nok mest intetsigende rum, som du nogensinde har set. Det er så intetsigende, at der faktisk ikke er mere at sige om det.\",\n false,\n monsterList.getMonster(1),\n itemList.getItem(9)\n ));\n\n //Adding copyrooms to <>copyrooms, randomly placed later \n copyRooms.add(new Room(\n \"Døren knirker, som du åbner den. Et kopirum! Det burde du have set komme. Især fordi det var en glasdør.\",\n false,\n null,\n itemList.getItem(19)\n ));\n\n copyRooms.add(new Room(\n \"Kopimaskinen summer stadig. Den er åbenbart lige blevet færdig. Du går nysgerrigt over og kigger på alle de udskrevne papirer.\",\n false,\n null,\n itemList.getItem(12)\n ));\n\n //Adding restrooms to <>restrooms, randomly placed later \n restRooms.add(new Room(\n \"Ups! Dametoilettet. Der hænger en klam stank i luften. Det må være Ruth, som har været i gang.\",\n false,\n null,\n itemList.getItem(5)\n ));\n\n restRooms.add(new Room(\n \"Pedersen er på vej ud fra toilettet. Han vasker ikke fingre! Slut med at give ham hånden.\",\n false,\n monsterList.getMonster(7),\n itemList.getItem(11)\n ));\n\n restRooms.add(new Room(\n \"Du kommer ind på herretoilettet. Du skal simpelthen tisse så meget, at fiskefileterne må vente lidt. Du åbner toiletdøren.\",\n false,\n monsterList.getMonster(2),\n null\n ));\n\n restRooms.add(new Room(\n \"Lisette står og pudrer næse på dametoilettet. Hvorfor gik du herud?\",\n false,\n monsterList.getMonster(8),\n itemList.getItem(14)\n ));\n\n //Adding meetingrooms to<>meetingrooms, randomly placed later\n meetingRooms.add(new Room(\n \"Du træder ind i et lokale, hvor et vigtigt møde med en potentiel kunde er i gang. Du bliver nødt til at lade som om, at du er en sekretær.\",\n false,\n monsterList.getMonster(9),\n itemList.getItem(6)\n ));\n\n meetingRooms.add(new Room(\n \"Mødelokalet er tomt, men der står kopper og service fra sidste møde. Sikke et rod!\",\n false,\n null,\n itemList.getItem(3)\n ));\n\n meetingRooms.add(new Room(\n \"Projektgruppen sidder i mødelokalet. Vil du forsøge at forsinke dem i at nå fiskefileterne i kantinen?\",\n false,\n monsterList.getMonster(10),\n itemList.getItem(2)\n ));\n\n //Adding specialrooms to<>specialrooms, randomly placed later\n specialRooms.add(new Room(\n \"Du vader ind på chefens kontor. På hans skrivebord sidder sekretæren Phillipa.\",\n false,\n monsterList.getMonster(5),\n itemList.getItem(8)\n ));\n\n specialRooms.add(new Room(\n \"Det her ligner øjensynligt det kosteskab, Harry Potter boede i.\",\n false,\n monsterList.getMonster(3),\n itemList.getItem(4)\n ));\n\n specialRooms.add(new Room(\n \"OMG! Hvad er det syn?! KANTINEN!! Du klarede det! Du skynder dig op i køen lige foran ham den arrogante fra din afdeling. Da du når frem til fadet er der kun 4 fiskefileter tilbage. Du snupper alle 4!\",\n true,\n null,\n null\n ));\n\n //Adding rooms(Inde1-5)\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n addMeetingRoom(rooms, meetingRooms);\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n\n //Adding rooms(Inde6-10)\n addMeetingRoom(rooms, meetingRooms);\n addCopyRoom(rooms, copyRooms);\n addRestRoom(rooms, restRooms);\n addOfficeRoom();\n addCopyRoom(rooms, copyRooms);\n\n //Adding rooms(Inde11-15)\n addOfficeRoom();\n addSpecialRoom(rooms, specialRooms);\n addOfficeRoom();\n addRestRoom(rooms, restRooms);\n addOfficeRoom();\n\n //Adding rooms(Inde16-19)\n addOfficeRoom();\n addSpecialRoom(rooms, specialRooms);\n addSpecialRoom(rooms, specialRooms);\n addMeetingRoom(rooms, meetingRooms);\n\n return rooms;\n }", "private static void createRooms() {\n// Room airport, beach, jungle, mountain, cave, camp, raft, seaBottom;\n\n airport = new Room(\"airport\");\n beach = new Room(\"beach\");\n jungle = new Room(\"jungle\");\n mountain = new Room(\"mountain\");\n cave = new Room(\"cave\");\n camp = new Room(\"camp\");\n seaBottom = new Room(\"seabottom\");\n\n //Setting the the exits in different rooms\n beach.setExit(\"north\", jungle);\n beach.setExit(\"south\", seaBottom);\n beach.setExit(\"west\", camp);\n\n jungle.setExit(\"north\", mountain);\n jungle.setExit(\"east\", cave);\n jungle.setExit(\"south\", beach);\n\n mountain.setExit(\"south\", jungle);\n\n cave.setExit(\"west\", jungle);\n\n camp.setExit(\"east\", beach);\n\n seaBottom.setExit(\"north\", beach);\n\n // Starting room\n currentRoom = airport;\n }", "public void createRooms()\n {\n Room outside,bedroom, bathroom, hallway1, hallway2, spareroom, kitchen, fridge;\n\n // create the rooms\n bedroom = new Room(\"Bedroom\", \"your bedroom. A simple room with a little bit too much lego\");\n bathroom = new Room(\"Bathroom\", \"the bathroom where you take your business calls. Also plenty of toilet paper\");\n hallway1 = new Room(\"Hallway1\", \"the hallway outside your room, there is a dog here blocking your path. Youll need to USE something to distract him\");\n hallway2 = new Room(\"Hallway2\", \"the same hallway? This part leads to the spare room and kitchen\");\n spareroom = new Room(\"Spare room\", \"the spare room. This is for guests\");\n kitchen = new Room(\"Kitchen\", \"your kitchen. There is a bowl with cereal in it waiting for you,But its still missing some things\");\n fridge = new Room (\"Walk in Fridge\", \"a walkin fridge. Have you ever seen Ratatouille? Its like that\");\n outside = new Room(\"Outside\", \"the outside world, breathe it in\");\n \n \n Item toiletPaper, milk, spoon, poison;// creates the items and sets their room\n \n toiletPaper = new Item(\"Toilet-Paper\", hallway1);\n toiletPaper.setDescription(\"Just your standard bog roll. Dont let your dog get a hold of it\");\n bathroom.setItems(\"Toilet-Paper\",toiletPaper);\n \n milk = new Item(\"Milk\", kitchen);\n milk.setDescription(\"white and creamy, just like mama used to make\");\n fridge.setItems(\"Milk\", milk);\n \n spoon = new Item(\"Spoon\", kitchen);\n spoon.setDescription(\"Like a fork but for liquids\");\n spareroom.setItems(\"Spoon\", spoon);\n \n poison = new Item(\"Poison\", outside);\n poison.setDescription(\"This will probably drain all of your energy, dont USE it\");\n outside.setItems(\"Poison\", poison);\n \n // initialise room exits\n bedroom.setExit(\"east\", bathroom);\n bedroom.setExit(\"north\", hallway1);\n \n bathroom.setExit(\"west\", bedroom);\n \n hallway1.setExit(\"south\", bedroom);\n hallway1.setExit(\"north\", hallway2);\n \n hallway2.setExit(\"south\", hallway1);\n hallway2.setExit(\"west\", spareroom);\n hallway2.setExit(\"north\", kitchen);\n \n spareroom.setExit(\"east\", hallway2);\n \n kitchen.setExit(\"east\", outside);\n kitchen.setExit(\"west\", fridge);\n \n fridge.setExit(\"east\", kitchen);\n \n \n outside.setExit(\"west\", kitchen);\n \n\n this.currentRoom = bedroom; // start game in bedroom\n \n }", "@Override\n public Room makeRoom() {\n return new MagicRoom();\n }", "private Room createRooms(){\n Room inicio, pasilloCeldas, celdaVacia1,celdaVacia2, pasilloExterior,vestuarioGuardias, \n comedorReclusos,enfermeria,ventanaAbierta,salidaEnfermeria,patioReclusos,tunelPatio,salidaPatio;\n\n Item mochila,medicamentos,comida,itemInutil,itemPesado;\n mochila = new Item(\"Mochila\",1,50,true,true);\n medicamentos = new Item(\"Medicamentos\",5,10,true,false);\n comida = new Item(\"Comida\",2,5,true,false);\n itemInutil = new Item(\"Inutil\",10,0,false,false);\n itemPesado = new Item(\"Pesas\",50,0,false,false);\n\n // create the rooms\n inicio = new Room(\"Tu celda de la prision\");\n pasilloCeldas = new Room(\"Pasillo donde se encuentan las celdas\");\n celdaVacia1 = new Room(\"Celda vacia enfrente de la tuya\");\n celdaVacia2 = new Room(\"Celda de tu compaņero, esta vacia\");\n pasilloExterior = new Room(\"Pasillo exterior separado de las celdas\");\n vestuarioGuardias = new Room(\"Vestuario de los guardias de la prision\");\n comedorReclusos = new Room(\"Comedor de reclusos\");\n enfermeria = new Room(\"Enfermeria de la prision\");\n ventanaAbierta = new Room(\"Saliente de ventana de la enfermeria\");\n salidaEnfermeria = new Room(\"Salida de la prision por la enfermeria\");\n patioReclusos = new Room(\"Patio exterior de los reclusos\");\n tunelPatio = new Room(\"Tunel escondido para escapar de la prision\");\n salidaPatio = new Room(\"Salida de la prision a traves del tunel del patio\");\n\n // initialise room items\n\n comedorReclusos.addItem(\"Comida\",comida);\n enfermeria.addItem(\"Medicamentos\",medicamentos);\n pasilloCeldas.addItem(\"Inutil\",itemInutil);\n patioReclusos.addItem(\"Pesas\",itemPesado);\n vestuarioGuardias.addItem(\"Mochila\",mochila);\n\n // initialise room exits\n\n inicio.setExits(\"east\", pasilloCeldas);\n pasilloCeldas.setExits(\"north\",pasilloExterior);\n pasilloCeldas.setExits(\"east\",celdaVacia1);\n pasilloCeldas.setExits(\"south\",patioReclusos);\n pasilloCeldas.setExits(\"west\",inicio);\n pasilloCeldas.setExits(\"suroeste\",celdaVacia2);\n celdaVacia1.setExits(\"west\", pasilloCeldas);\n pasilloExterior.setExits(\"north\",comedorReclusos);\n pasilloExterior.setExits(\"west\",enfermeria);\n pasilloExterior.setExits(\"east\",vestuarioGuardias);\n comedorReclusos.setExits(\"south\", pasilloExterior);\n enfermeria.setExits(\"east\",pasilloExterior);\n enfermeria.setExits(\"south\", ventanaAbierta);\n ventanaAbierta.setExits(\"north\",enfermeria);\n ventanaAbierta.setExits(\"south\", salidaEnfermeria);\n patioReclusos.setExits(\"north\", pasilloCeldas);\n patioReclusos.setExits(\"east\", tunelPatio);\n tunelPatio.setExits(\"east\",salidaPatio);\n tunelPatio.setExits(\"west\", patioReclusos);\n // casilla de salida\n\n return inicio;\n }", "public String getRoom() {\r\n return room;\r\n }", "public void removeUnavailableRooms(){\n\t}", "public Room getRoom()\r\n {\r\n return room;\r\n }", "private void createRooms()\n {\n Room a1, a2, a3, b1, b2, b3, c1, c2, c3, bridge, outskirts;\n \n // create the rooms\n a1= new Room(\"see a strong river flowing south to the west. The trees seem to be letting up a little to the north.\");\n a2 = new Room(\" are still in a very dense forest. Maybe the trees are clearing up the the north?\");\n a3 = new Room(\"see a 30 foot cliff looming over the forest to the east. No way you could climb that. Every other direction is full of trees.\");\n b1 = new Room(\"see a strong river flowing to the west. Heavily wooded areas are in all other directions.\");\n b2 = new Room(\"see only trees around you.\");\n b3 = new Room(\"see a 30 foot cliff to the east. There might be one spot that is climbable. Trees surround you every other way.\");\n c1 = new Room(\" see the river cuts east here, but there seems to be a small wooden bridge to the south over it. The trees are less the direction that the river flows.\");\n c2 = new Room(\"are on a peaceful riverbank. If you weren't lost, this might be a nice spot for a picnic.\");\n c3 = new Room(\"see a 30 foot cliff to your east and a strong flowing river to the south. Your options are definitely limited.\");\n outskirts = new Room(\"make your way out of the trees and find yourself in an open field.\");\n cliff = new Room(\"managed to climb up the rocks to the top of the cliff. Going down, doesn't look as easy. You have to almost be out though now!\");\n bridge = new Room(\"cross the bridge and find a small trail heading south!\");\n win = new Room(\" manage to spot a road not too far off! Congratulations on finding your way out of the woods! Have a safe ride home! :)\" );\n fail = new Room(\" are entirely lost. It is pitch black out and there is no way that you are getting out of here tonight. I'm sorry, you LOSE.\");\n \n // initialise room exits\n a1.setExit(\"north\", outskirts);\n a1.setExit(\"east\", a2);\n a1.setExit(\"south\", b1);\n \n a2.setExit(\"east\", a3);\n a2.setExit(\"west\", a1);\n a2.setExit(\"south\", b2);\n a2.setExit(\"north\", outskirts);\n \n a3.setExit(\"north\", outskirts);\n a3.setExit(\"west\", a2);\n a3.setExit(\"south\", b3);\n \n b1.setExit(\"north\", a1);\n b1.setExit(\"east\", b2);\n b1.setExit(\"south\", c1);\n \n b2.setExit(\"east\", b3);\n b2.setExit(\"west\", b1);\n b2.setExit(\"south\", c2);\n b2.setExit(\"north\", a2);\n \n b3.setExit(\"north\", a3);\n b3.setExit(\"west\", b2);\n b3.setExit(\"south\", c3);\n b3.setExit(\"up\", cliff);\n \n c1.setExit(\"north\", b1);\n c1.setExit(\"east\", c2);\n c1.setExit(\"south\" , bridge);\n \n c2.setExit(\"east\", c3);\n c2.setExit(\"west\", c1);\n c2.setExit(\"north\", b2);\n \n c3.setExit(\"west\", c2);\n c3.setExit(\"north\", b3);\n \n outskirts.setExit(\"north\", win);\n outskirts.setExit(\"east\", a3);\n outskirts.setExit(\"west\", a1);\n outskirts.setExit(\"south\", a2);\n \n cliff.setExit(\"north\", outskirts);\n cliff.setExit(\"east\", win);\n \n bridge.setExit(\"north\", c1);\n bridge.setExit(\"south\", win);\n \n c3.addItem(new Item (\"shiny stone\", 0.1));\n a1.addItem(new Item (\"sturdy branch\", 2));\n a3.addItem(new Item(\"water bottle\" , 0.5));\n a3.addItem(new Item(\"ripped backpack\" , 1));\n currentRoom = b2; // start game outside\n }", "RoomInfo room(int id);", "public String getRoom() {\n\t\treturn room;\n\t}", "public Integer getNewRoom() {\n return newRoom;\n }", "private void createRooms()\n {\n Room outside, garden, kitchen, frontyard, garage, livingroom,\n upperhallway, downhallway, bedroom1, bedroom2, toilet,teleporter;\n\n // create the rooms\n outside = new Room(\"outside the house\",\"Outside\");\n garden = new Room(\"in the Garden\", \"Garden\");\n kitchen = new Room(\"in the Kitchen\",\"Kitchen\");\n frontyard = new Room(\"in the Frontyard of the house\", \"Frontyard\");\n garage = new Room(\"in the Garage\", \"Garage\");\n livingroom = new Room(\"in the Living room\", \"Living Room\");\n upperhallway = new Room(\"in the Upstairs Hallway\",\"Upstairs Hallway\");\n downhallway = new Room(\"in the Downstairs Hallway\", \"Downstairs Hallway\");\n bedroom1 = new Room(\"in one of the Bedrooms\", \"Bedroom\");\n bedroom2 = new Room(\"in the other Bedroom\", \"Bedroom\");\n toilet = new Room(\"in the Toilet upstairs\",\"Toilet\");\n teleporter = new Room(\"in the Warp Pipe\", \"Warp Pipe\");\n\n // initialise room exits\n outside.setExit(\"north\", garden);\n outside.setExit(\"east\", frontyard);\n\n garden.setExit(\"south\", outside);\n garden.setExit(\"east\", kitchen);\n\n kitchen.setExit(\"west\", garden);\n kitchen.setExit(\"north\", livingroom);\n kitchen.setExit(\"south\", downhallway);\n\n frontyard.setExit(\"west\", outside);\n frontyard.setExit(\"north\", downhallway);\n frontyard.setExit(\"east\", garage);\n\n garage.setExit(\"west\", frontyard);\n garage.setExit(\"north\", downhallway);\n\n livingroom.setExit(\"west\", kitchen);\n\n downhallway.setExit(\"north\",kitchen);\n downhallway.setExit(\"west\",frontyard);\n downhallway.setExit(\"south\",garage);\n downhallway.setExit(\"east\",upperhallway);\n\n upperhallway.setExit(\"north\", bedroom2);\n upperhallway.setExit(\"east\", bedroom1);\n upperhallway.setExit(\"south\", toilet);\n upperhallway.setExit(\"west\", downhallway);\n\n toilet.setExit(\"north\", upperhallway);\n\n bedroom1.setExit(\"west\",upperhallway);\n\n bedroom2.setExit(\"south\", upperhallway);\n\n rooms.add(outside);\n rooms.add(garden);\n rooms.add(kitchen);\n rooms.add(frontyard);\n rooms.add(garage);\n rooms.add(livingroom);\n rooms.add(upperhallway);\n rooms.add(downhallway);\n rooms.add(bedroom1);\n rooms.add(bedroom2);\n rooms.add(toilet);\n }", "@Override\n\tpublic void onRoomCreated(RoomData arg0) {\n\t\t\n\t}", "Room mo12151c();", "public void setRoom(String room) {\n\t\tthis.room = room;\n\t}", "@Override\n\tpublic int getNumberOfRooms() {\n\t\treturn 0;\n\t}", "public Room getRoom()\n {\n return currentRoom;\n }", "public static void createGameRooms()\r\n\t{\r\n\t\tfor(int i = 0; i < MAX_FIREWORKS_ROOMS; i++)\r\n\t\t{\r\n\t\t\taddRoom(\"fireworks_\" + i, new VMKGameRoom(\"fireworks_\" + i, \"Fireworks Game \" + i, \"\"));\r\n\t\t}\r\n\t\t\r\n\t\tfor(int i = 0; i < MAX_PIRATES_ROOMS; i++)\r\n\t\t{\r\n\t\t\taddRoom(\"pirates_\" + i, new VMKGameRoom(\"pirates_\" + i, \"Pirates Game \" + i, \"\"));\r\n\t\t}\r\n\t}", "public Room getRoom(){\n\t\treturn this.room;\n\t}", "@Override\n public int getRoomId() {\n return room.getRoomId();\n }", "public int getRoom(){\n\t\treturn room;\n\t}", "public void onRoomLoad() {\n\n }", "@Override\n\tprotected void on_room_entered(String room_door_name) {\n\n\t}", "protected void setRoom() {\n\t\tfor(int x = 0; x < xSize; x++) {\n\t\t\tfor (int y = 0; y < ySize; y++) {\n\t\t\t\tif (WALL_GRID[y][x] == 1) {\n\t\t\t\t\tlevelSetup[x][y] = new SimpleRoom();\n\t\t\t\t} else{\n\t\t\t\t\tlevelSetup[x][y] = new ForbiddenRoom();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// put special rooms\n\t\tlevelSetup[6][0] = new RoomWithLockedDoor();\n\t\tlevelSetup[2][6] = new FragileRoom();\n\n\t}", "java.lang.String getRoomName();", "public Room() {\n this.isTable = false;\n this.hasStage = false;\n this.hasTech = false;\n }", "public java.lang.CharSequence getRoom() {\n return room;\n }", "public Room createRoom(Room room);", "public Room getRoom() {\n return currentRoom;\n }", "@Override\n\tpublic void checkOutRoom() {\n\t\t\n\t}", "public Room() {\n\t\twall=\"\";\n\t\tfloor=\"\";\n\t\twindows=0;\n\t}", "public java.lang.CharSequence getRoom() {\n return room;\n }", "private void setPlayerRoom(){\n player.setRoom(currentRoom);\n }", "void makeMoreRooms() {\n\t\twhile(rooms.size() < size.maxRooms) {\n\t\t\t\tRoom made;\n\t\t\t\tint height = baseHeight;\n\t\t\t\tint x = random.nextInt(size.width);\n\t\t\t\tint z = random.nextInt(size.width);\n\t\t\t\tint xdim = random.nextInt(size.maxRoomSize - 5) + 6;\n\t\t\t\tint zdim = random.nextInt(size.maxRoomSize - 5) + 6;\n\t\t\t\tif(bigRooms.use(random)) {\n\t\t\t\t\txdim += random.nextInt((size.maxRoomSize / 2)) + (size.maxRoomSize / 2);\n\t\t\t\t\tzdim += random.nextInt((size.maxRoomSize / 2)) + (size.maxRoomSize / 2);\n\t\t\t\t}\n\t\t\t\tint ymod = (xdim <= zdim) ? (int) Math.sqrt(xdim) : (int) Math.sqrt(zdim);\n\t\t\t\tint roomHeight = random.nextInt((verticle.value / 2) + ymod + 1) + 2;\n\t\t\t\tmade = new PlaceSeed(x, height, z).growRoom(xdim, zdim, roomHeight, this, null, null);\n\t\t\t}\t\t\n\t\t//DoomlikeDungeons.profiler.endTask(\"Adding Extra Rooms (old)\");\n\t\t}", "@Override\n public Room getRoom(String roomId) {\n return getRoom(roomId, true);\n }", "private boolean checkRoomValid(String room) {\n\treturn true;\r\n}", "ItcRoom()\r\n\t {\t }", "@Override\n public Object getItem(int arg0) {\n Log.d(TAG, \"getItem: \"+fromName.get(arg0));\n return rooms.get(arg0);\n }", "private void updateRooms(DataSnapshot roomsSnap) {\n // assuming there will not be many rooms that show up on the user's page setting to\n // an empty HashTable each time there's a change will not disrupt performance much.\n rooms.clear();\n for (DataSnapshot roomSnap : roomsSnap.getChildren()) {\n // adds the roomID and room to\n String roomID = roomSnap.getKey();\n Room room = roomSnap.getValue(Room.class);\n rooms.put(roomID, room);\n }\n\n if (rooms.size() == 0) {\n String noActiveRoomsText = \"No active rooms in this area. Please check again later.\";\n Toast.makeText(this, noActiveRoomsText, Toast.LENGTH_SHORT).show();\n }\n\n // Populates the join room ListView with all the appropriate room informatoin\n RoomAdapter roomAdapter = new RoomAdapter(this, rooms);\n roomList.setAdapter(roomAdapter);\n }", "public Room getRandomRoom(){\n return (Room)rooms.get(random.nextInt(rooms.size()));\n }", "public boolean isRoom(){\n\t\treturn (cellType == CellType.ROOM);\n\t}", "public String getRoomName() {\n\treturn this.name;\n}", "public synchronized void setRoom(String room) {\n this.room = room;\n }", "public Room getCurrentRoom() {\r\t\treturn currentRoom;\r\t}", "public List<Room> getRooms() {\n return rooms;\n }", "public Room getDoorRoom()\n {\n return room;\n }", "public void nextRoom() {\n room++;\n createRoom();\n }", "public int getRoom()\n\t{\t\n\t\treturn iCurrentRoom;\n\t\t\n\t}", "public Room getRoom0(){\n return basement;\n }", "@Override\n\tpublic List<RoomInterface> getRooms() {\n\t\treturn rooms;\n\t}", "public void makeTestRoom() {\r\n\t\tthis.boardData = new BoardData();\r\n\t\tthis.boardData.loadLevelOne();\r\n\r\n\t\tif (boardData.getAllRooms().isEmpty()) {\r\n\t\t\tSystem.out.println(\"room list is empty\");\r\n\t\t} else if (boardData.getAllRooms().get(0).getRoomInventory().isEmpty()) {\r\n\t\t\tSystem.out.println(\"room's inventory is empty\");\r\n\t\t}\r\n\t}", "private List<Room> addRooms() {\n List<Room> rooms = new ArrayList<>();\n int numRooms = RandomUtils.uniform(random, MINROOMNUM, MAXROOMNUM);\n int playerRoomNum = RandomUtils.uniform(random, 0, numRooms);\n for (int i = 0; i < numRooms; i++) {\n rooms.add(addRandomRoom(random));\n if (i == playerRoomNum) {\n setPlayerInitialPosition(rooms, playerRoomNum);\n }\n }\n return rooms;\n }", "public void incrementNumberOfRooms() {\n\t\t\n\t\tnumberOfRooms++;\n\t}", "public void setRoom(Room room) {\n currentRoom = room;\n }", "public Room getRoom() {\n\t\treturn super.getRoom();\n\t}", "public Room getCurrentRoom()\n {\n return currentRoom;\n }", "public void generateRooms(){ //TODO it's public just for testing\n rooms = new ArrayList<>();\n for(Color color : roomsToBuild)\n rooms.add(new Room(color));\n }", "public Room room() {\r\n\t\treturn this.room;\r\n\t}", "public List<Room> findAllRooms();", "@Override\n\tpublic void onCreateRoomDone(RoomEvent arg0) {\n\t\t\n\t}", "public void createChatRoom(String name) throws RemoteException {\n\n\t\ttry {\n\t\t\tIChatServer chatStub;\n\t\t\t// make a new chatroom with supplied name\n\t\t\tIChatroom newRoom = new Chatroom(name);\n\t\t\tview.append(\"Make new ChatRoom: \" + newRoom.getName() + \"\\n\");\n\t\t\t// make a new chatserver stub for user in the newchatroom\n\t\t\tIChatServer newChatServer = new ChatServer(user, newRoom);\n\t\t\tview.append(\"Make new ChatServer: <User:\" + newChatServer.getUser().getName() + \", ChatServer: \"\n\t\t\t\t\t+ newChatServer.getChatroom().getName() + \">\\n\");\n\t\t\t//get a chatstub for new chatserver \n\t\t\tchatStub = (IChatServer) UnicastRemoteObject.exportObject(newChatServer, IChatServer.BOUND_PORT);\n\t\t\tregistry.rebind(IChatServer.BOUND_NAME + newRoom.hashCode(), chatStub);\n\t\t\tview.append(\"Make new ChatServer Stub for chatserver.\\n\");\n\t\t\t//add chatstub to newRoom\n\t\t\tnewRoom.addChatServer(chatStub);\n\t\t\tview.append(\"Add new ChatServer Stub to newRoom.\\n\");\n\t\t\t//add newchatroom to the user chatroom lists\n\t\t\tuser.addRoom(newRoom);\n\t\t\tview.append(\"Add new chatroom <\" + newRoom.getName() + \"> to user <\" + user.getName() + \">\\n\");\n\t\t\t//add all chatservers in that room to hashset\n\t\t\tHashSet<IChatServer> proxy = new HashSet<IChatServer>();\n\t\t\tfor (IChatServer item : newChatServer.getChatroom().getChatServers()) {\n\t\t\t\tIChatServer proxyChatServer = new ProxyIChatServer(item);\n\t\t\t\tproxy.add(proxyChatServer);\n\t\t\t}\n\t\t\tIMain2MiniAdpt miniMVCAdpt = view.makeMini(newChatServer, proxy);\n\t\t\tminiMVCAdpts.put(newRoom, miniMVCAdpt);\n\t\t\tcountRoom++;\n\t\t} catch (Exception e) {\n\t\t\tview.append(\"Error creating chatroom!\");\n\t\t}\n\n\t}", "public long getRoomId() {\n return roomId_;\n }", "public void changeOutofService(Room room);", "public int getRoomID() {\r\n\t\treturn this.room.getID();\r\n\t}", "public static void main(String[] args) {\n\n Room woods = new Room(\"Woods\");\n woods.setStory(\"You are a ferocious wolf, hungry, and tired after a long excursion \" +\n \"out in the deep dark woods. You have just heard some rumors that there are three little \" +\n \"pigs who have recently done some construction in the neighborhood…\");\n woods.setDescription(\"These woods are dark and scary.\");\n\n Room house1 = new Room (\"The Straw House\");\n house1.setStory(\"You’ve trekked out of the woods and followed the rocky dirt road until you\" +\n \" find a neighborhood full of questionably constructed straw houses. Your nose twitches \" +\n \"and you realize the one right in front of you contains some tasty bacon named Billy\");\n house1.setDescription(\"This is the site of the straw house.\");\n\n Room house2 = new Room(\"The Stick House\");\n house2.setStory(\"You decide to look for some more food and continue on to the next neighborhood,\" +\n \" filled with stick houses. You sniff the air and know immediately that the house to your left\" +\n \"houses Reginald -- a chunky pig\");\n house2.setDescription(\"Here is the site of a stick house.\");\n house2.setAccessible(false);// must set accessible again after the first pig is eaten\n\n Room house3 = new Room(\"The Brick House\");\n house3.setStory(\"You decide to look for some more food and continue on to the next neighborhood, filled with \" +\n \"brick houses. You sniff the air and have a good feeling about a house up ahead, which is made of bricks \" +\n \"and has a lovely skylight.\");\n house3.setDescription(\"Here is the site of the brick house.\");\n house3.setAccessible(false);// must set accessible again after the second pig is eaten\n\n Room house3Interior = new Room(\"Inside the brick house.\");\n house3Interior.setStory(\"Aha! Here is the delicious pig -- Spike! Your stomach is rumbling . . . \");\n house3Interior.setDescription(\"This is a nice house made for a pig. Above the fireplace is a framed photo eat \" +\n \"of the pig who lives here and his two brothers.\");\n house3Interior.setAccessible(false);// must set accessible again after the window is broken\n\n Room woods2 = new Room(\"More Woods\");\n woods2.setStory(\"You're feeling pretty good now, having gobbled up some pigs and successfully stopped your stomach from growling.\" +\n \"You walk out of the pig neighborhood and back towards the forest. \" +\n \"But you have a feeling that you're not out of the woods yet-- literally. There's a pig cop here, and if you don't get out of here fast, \" +\n \"you might find yourself in trouble again.\");\n woods2.setDescription(\"A dark and ominous forest.\");\n woods2.setAccessible(false); // must set accessible again after the third pig is eaten\n\n Room river = new Room (\"River shore\");\n river.setStory(\"You've run from the pig cop into another section of woods, but there's a wide rushing river in front of you. Surely you won't be able \" +\n \"to cross it without some sort of bridge . . .\");\n river.setDescription(\"A river cuts through the forest, rushing by quickly.\" );\n\n Room home = new Room(\"Home\");\n home.setStory(\"You're home! After a long and harrowing trip through the woods and a neighborhood full of pigs, you've managed to evade the cops\" +\n \"and arrive home. Your family cheers when they see you and you swear to never trek into the woods without some extra provisions\" +\n \"ever again.\" );\n home.setDescription(\"\");\n home.setAccessible(false); //must set accessible again after the river is crossed\n\n //END OF GAME\n //now possible to add another story...\n\n\n //Characters and their related actions\n\n Character owl = new Character(\"Owl\", \"A wise elderly owl who might have some helpful advice\", null);\n owl.setFirstDialogue(\"I'm an owl, hoot hoot.\");\n owl.setGeneralGreeting(\"Hello again. Hoot hoot!\");\n owl.populateDialogueByTopics(\"advice\", \"That straw house over there looks pretty flimsy. Even a slight breeze could knock it down!\" +\n \"Hoot hoot!\");\n owl.populateDialogueByTopics(\"owl things\", \"I eat mice. Hoot hoot!\");\n owl.populateDialogueByTopics(\"the forest\", \"It sure is dark and scary in here. Hoot hoot!\");\n\n Character pig1 = new Character(\"Billy\", \"A fat, delicious-looking pig\", null);\n pig1.setFirstDialogue(\"Hi, I'm Billy, the pig! You're not a wolf, are you?\");\n pig1.setGeneralGreeting(\"It's Billy the pig again!\");\n pig1.populateDialogueByTopics(\"new house\", \"I've just built a new house out of straw! I think it looks great.\");\n// pig1.setIsEatable(true);\n\n Character pig2 = new Character(\"Reginald\", \"A fat, delicious-looking pig\", null);\n pig2.setFirstDialogue(\"Hi, I'm Reginald, the pig! Have you heard from my brothers?\");\n pig2.setGeneralGreeting(\"It's Reginald again. I'm a little worried about my brothers.\");\n pig2.populateDialogueByTopics(\"new house\", \"I just built a house out of sticks. I bet it can withstand anything!\");\n// pig2.setIsEatable(true);\n\n Character pig3 = new Character(\"Spike\", \"A fat, delicious-looking pig\", null);\n pig3.setFirstDialogue(\"What's up? I'm Spike, the pig! Have you seen a wolf around here? I think one is prowling around . . .\");\n pig3.setGeneralGreeting(\"It's Reginald again. You should stay away, there's a wolf on the loose!\");\n pig3.populateDialogueByTopics(\"the wolf\", \"I think my brothers were eaten by a wolf! Thankfully I \" +\n \"have my strong brick house to protect me.\");\n pig3.setIsEatable(true);\n\n Character cop = new Character(\"Officer Pig\", \"A pig cop looking to find the wolf who ate his friends\", null);\n cop.setFirstDialogue(\"I'm Officer Pig. Hey! You look like the wolf who ate my friends!\");\n cop.setGeneralGreeting(\"I'm Officer Pig.\");\n cop.populateDialogueByTopics(\"wolf\", \"A wolf has been terrorizing the neighborhood. And you look quite a lot like a wolf . . .\");\n\n //Items that are spread throughout the game + what can happen to them\n\n Item house1Item = new Item(\"straw house\", \"a flimsy straw house\", null);\n house1Item.setPickUpAble(false);\n Item house2Item = new Item(\"stick house\", \"a slightly sturdier stick house\", null);\n house2Item.setPickUpAble(false);\n Item house3Item = new Item(\"brick house\", \"a strong, well-built brick house\", null);\n house3Item.setPickUpAble(false);\n\n Item leafBlower = new Item(\"leaf blower\", \"a gardening tool that generates a lot of wind\", null);\n Item brick = new Item(\"brick\", \"looks like a leftover brick from building a house\", null);\n Item window = new Item (\"window\", \"a nice skylight on the roof of the brick house\", null);\n window.setPickUpAble(false);\n Item rock = new Item(\"rock\", \"a flat gray rock\", null);\n Item vine = new Item(\"vine\", \"a long green vine suspended from a tree branch\", null);\n vine.setPickUpAble(false);\n\n //Where the items are placed in the game\n woods.addCharacter(owl);\n house1.addCharacter(pig1);\n house1.addItemToRoom(house1Item);\n house2.addCharacter(pig2);\n house2.addItemToRoom(leafBlower);\n house2.addItemToRoom(house2Item);\n house3.addItemToRoom(brick);\n house3.addItemToRoom(window);\n house3.addItemToRoom(house3Item);\n house3Interior.addCharacter(pig3);\n woods2.addCharacter(cop);\n river.addItemToRoom(rock);\n river.addItemToRoom(vine);\n\n //What directions the user can move throughout the game\n //Order of directions : N , S, E, W, in, out\n woods.setConnections(new Room[] {null, null, house1, null, null, null});\n house1.setConnections(new Room[] {null, house2, null, woods, null, null});\n house2.setConnections(new Room[] {house1, null, house3, null, null, null});\n house3.setConnections(new Room[] {null, null, null, house2, house3Interior, null});\n house3Interior.setConnections(new Room[] {null, null, null, null, null, house3});\n woods2.setConnections(new Room[] {house3, null, null, null, null, null});\n //river\n //home\n\n //Commands possible\n ArrayList<String> commands = new ArrayList<>(List.of(\"go\", \"show inventory\", \"pick up\", \"drop\", \"open\", \"eat\", \"talk\"));\n //Existing rooms in game\n ArrayList<Room> rooms = new ArrayList<>((List.of(woods, house1, house2, house3, house3Interior, woods2, river, home)));\n threeLittlePigs = new TextAdventure(\"Three Little Pigs\", commands, rooms, woods);\n\n //Item + item interactions possible\n threeLittlePigs.addInteraction(leafBlower, house1Item, () ->{\n house1.removeItemFromRoom(house1Item);\n house2.setAccessible(true);\n threeLittlePigs.addPoints(10);\n pig1.setIsEatable(true);\n// System.out.println(\"You have destroyed the Straw House.\");\n return \"You have destroyed the Straw House.\";\n\n });\n threeLittlePigs.addInteraction(leafBlower, house2Item, () ->{\n house2.removeItemFromRoom(house2Item);\n house3.setAccessible(true);\n threeLittlePigs.addPoints(10);\n pig2.setIsEatable(true);\n// System.out.println(\"You have destroyed the Stick House.\");\n return \"You have destroyed the Stick House\";\n });\n threeLittlePigs.addInteraction(brick, window, () ->{\n house3Interior.setAccessible(true);\n woods2.setAccessible(true);\n river.setAccessible(true);\n threeLittlePigs.getCurrentRoom().removeItemFromRoom(window);\n threeLittlePigs.getCurrentRoom().removeItemFromRoom(brick);\n house3Interior.addItemToRoom(brick);\n// System.out.println(\"You broke the window with the brick!\");\n return \"You broke the window with the brick!\";\n });\n threeLittlePigs.addInteraction(vine, rock, () -> {\n river.setAccessible(false);\n home.setAccessible(true);\n// System.out.println(\"You move the rock so that you can reach the vine and you swing across the river! The \" +\n// \"vine snaps just as you hit the other shore. You walk forwards from the shore and see a familiar neighborhood. \" +\n// \"Congratulations, you've made it home!\");\n threeLittlePigs.moveUserTo(home);\n return \"You move the rock so that you can reach the vine and you swing across the river! The \" +\n \"vine snaps just as you hit the other shore. You walk forwards from the shore and see a familiar neighborhood. \" +\n \"Congratulations, you've made it home!\";\n });\n\n //OUTLINE FOR LITTLE RED RIDING HOOD TEXT ADVENTURE\n\n Room woods3 = new Room(\"More Woods\");\n woods3.setStory(\"Congrats! You made it through a day of pig-eating and law-evading! After a good nights rest you are ready to\" +\n \" venture back out into the woods and try your luck at finding breakfast. You've recently heard that Grandma Riding-Hood\" +\n \"has fallen ill...Perhaps this is a good opportunity...\");\n woods3.setDescription(\"A dark and ominous forest.\");\n woods2.setAccessible(false); //is this needed?\n\n Room clearing = new Room(\"Clearing\");\n clearing.setStory(\"You heard whistling so you followed the noise which led you to a clearing in the woods where a wee girl in a\" +\n \"red-hooded poncho cape was bending over to pick flowers. To her left is a basket filled with muffins.\");\n clearing.setDescription(\"A sunny clearing in the woods\");\n clearing.setAccessible(false); //is this needed?\n\n Room grandmaHouse = new Room(\"Grandma's House\");\n grandmaHouse.setStory(\"You trot along the path for a while until you get to a wee cabin on a hill. \" +\n \"You smell a human inside!!\");\n grandmaHouse.setDescription(\"A cabin on a hill\");\n grandmaHouse.setAccessible(false); //Unlock once you have 'gotten directions' from lil Red\n\n Room insideGhouse = new Room(\"Inside Grandma's House\");\n insideGhouse.setStory(\"Poor Grandma lying asleep in the bed, she looks very ill, and you are very hungry...\");\n insideGhouse.setDescription(\"A rustic cabin with a huge, four poster bed and many quilts\");\n insideGhouse.setAccessible(false);\n\n Room inBed = new Room(\"Lying in Bed\");\n inBed.setStory(\"After eating Grandma and disguising yourself with her clothes, you decide to take a wee nap before lil Red arrives...\");\n inBed.setDescription(\"Lying amongst the quilts in Grandma's bed\");\n inBed.setAccessible(false); //ONLY UNLOCK ONCE GRANDMA IS EATEN\n\n Room woods4 = new Room(\"More Woods\");\n woods4.setStory(\"Congrats! You feel very full after eating so much today, perhaps its time to return home and get a good nights sleep\");\n woods4.setDescription(\"A dark and ominous forest.\");\n woods4.setAccessible(false); ////ONLY UNLOCK ONCE GRANDMA and lil Red are eaten\n\n //Now make it possible to go back to the original Room -- \"Home??\"\n\n }", "public List<Room> getCurrentRooms() {\n return currentRooms;\n }", "public MyRoom() {\r\n }", "public Room getStartRoom(){\n return startRoom;\n }", "public void setRoom(java.lang.CharSequence value) {\n this.room = value;\n }", "public abstract String getRoomName();", "public Room() {\r\n\t\troomObjects = new ArrayList<GameObject>();\r\n\t\troom_listener = new RoomListener();\r\n\t\tlisteners = new ListenerContainer(room_listener);\r\n\t}", "boolean getCurrentRoom() {\n return currentRoom;\n }", "@Override\n public boolean isAvailable() {\n return room.isAvailable();\n }", "public void setRoom(Room room) {\r\n\t\tthis.room = room;\r\n\t}", "private void clearRoomId() {\n \n roomId_ = 0L;\n }", "public export.serializers.avro.DeviceInfo.Builder clearRoom() {\n room = null;\n fieldSetFlags()[3] = false;\n return this;\n }", "@Override\n public int getCapacity() {\n return room.getCapacity();\n }", "public Room getCurrentRoom(){\n\treturn rooms[gx][gy];\n }", "public Room getMyRoom() {\n return this.myRoom;\n }", "void setRoom(int inRoom) {\n \t\tgraphics.setRoom(inRoom);\n \t}", "public static Room newRoom(int random){\n String nameRoom = \"\";\n int monsterAmount = 0;\n\t\tMonster monster;\n MonsterFactory monsterFac = new MonsterFactory();\n\t\tmonster= monsterFac.buildMonster((int)(Math.random() * 3) + 1);\n boolean createHealingPot = false;\n boolean createPitRoom = false;\n boolean createPillar = false;\n boolean createEntrance = false;\n boolean createExit = false;\n boolean createVisionPot = false;\n\n switch (random){\n case 1:\n \tnameRoom = \"The Entrance room\";\n \tmonsterAmount = 0;\n createEntrance = true;\n break;\n\n case 2:\n \tnameRoom = \"The Exit room\";\n \tmonsterAmount = 0;\n createExit = true;\n break;\n\n case 3:\n \tnameRoom = \"The room\";\n \tmonsterAmount = 1; //THIS ROOM WILL HAVE 1 MONSTER\n break;\n \n case 4:\n \tnameRoom = \"The Healing Potion room\";\n \tmonsterAmount=(int)(Math.random() * 1) + 0;\n createHealingPot = true;\n break;\n \n case 5:\n \tnameRoom = \"The Pit room\";\n \tmonsterAmount = 0;\n createPitRoom = true;\n break;\n\n case 6:\n \tnameRoom = \"The Pillar room\";\n \tmonsterAmount=(int)(Math.random() * 1) + 0;\n \tcreatePillar = true;\n break;\n \n case 7:\n \tnameRoom = \"The Vision Potion room\";\n \tmonsterAmount=0;\n createVisionPot=true;\n break;\n }\n \n if(monsterAmount <= 0 ) \n return new Room(nameRoom,createHealingPot, createPitRoom, createEntrance, createExit, createPillar, monsterAmount,createVisionPot);\n else\n return new Room(nameRoom,createHealingPot, createPitRoom, createEntrance, createExit, createPillar, monster, monsterAmount,createVisionPot);\n\n }", "public void unbookRoom(int room) {\n availableRooms.add(availableRooms.size(), room);\n unavailableRooms.remove(unavailableRooms.indexOf(room));\n unavailableRooms = unavailableRooms.stream().sorted().collect(Collectors.toList());\n availableRooms = availableRooms.stream().sorted().collect(Collectors.toList());\n System.out.println(\"Thank you for staying! See you next time.\");\n }", "public void createRoom(Rect room) {\n for(int x = room.x1 + 1; x < room.x2; x++) {\n for(int y = room.y1 + 1; y < room.y2; y++ ) {\n dungeon.map[x][y].blocked = false;\n dungeon.map[x][y].blockSight = false;\n }\n }\n }", "public Room(int id, int roomNumber, int persons, int days){\n this.id = id;\n this.roomNumber = roomNumber;\n this.persons = persons;\n this.days = days;\n available = false; //default value, assignment not necessary\n }", "@Override\n public void onNext(final RoomsResponse roomsResponse) {\n }", "private void setRooms() {\r\n\t\tAccountBean bean = new AccountBean();\r\n\t\tbean.setCf(Session.getSession().getCurrUser().getAccount().getCf());\r\n\t\tRoomController ctrl = RoomController.getInstance();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tthis.myRooms=FXCollections.observableArrayList(ctrl.getMyRooms(bean));\r\n\t\t}\r\n\t\tcatch (DatabaseException ex1) {\r\n\t\t\tJOptionPane.showMessageDialog(null,ex1.getMessage(),ERROR, JOptionPane.ERROR_MESSAGE);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public Room getRoom(String name) {\n\n if (room1.getGuest() != null && room1.getGuest().getName().equals(name)) { // If room 1 has a guest and that guest has the name of the guest being requested\n\n return room1;\n\n } else if(room2.getGuest() != null && room2.getGuest().getName().equals(name)) { // If room 2 has a guest and that guest has the name of the guest being requested\n\n return room2;\n\n }\n\n else return null; // If no guest with such name occupies room\n }", "public List<Room> unOccupiedRooms() {\n List<Room> rooms = new ArrayList<>();\n for (int i = 0; i < numOfRooms; i++) {\n if (!internalList.get(i).isOccupied()) {\n rooms.add(internalList.get(i));\n }\n }\n return rooms;\n }" ]
[ "0.7183627", "0.7122857", "0.6731659", "0.6731659", "0.6678635", "0.65381646", "0.6522477", "0.651477", "0.6506508", "0.64333975", "0.6421318", "0.64100784", "0.63661855", "0.6356475", "0.6339315", "0.6307888", "0.6275794", "0.6266754", "0.6264664", "0.6237757", "0.62314284", "0.62296075", "0.6226422", "0.62168884", "0.6214117", "0.61422414", "0.61315686", "0.6121577", "0.612107", "0.6118363", "0.6077619", "0.60747737", "0.6048571", "0.6020581", "0.60188544", "0.6009126", "0.6004867", "0.59768397", "0.5975239", "0.5974572", "0.59722584", "0.59668815", "0.59634346", "0.59541297", "0.5952917", "0.5945406", "0.5937361", "0.59367573", "0.59303564", "0.5917013", "0.59107506", "0.5901374", "0.588524", "0.58806515", "0.5876471", "0.587625", "0.5875696", "0.5870358", "0.5868183", "0.5867996", "0.5867461", "0.5867329", "0.58658844", "0.58500093", "0.58458", "0.5836377", "0.5835208", "0.5831746", "0.58282435", "0.5806451", "0.58039856", "0.580389", "0.580064", "0.5799025", "0.57979715", "0.5795936", "0.57955015", "0.5793671", "0.5789869", "0.57867473", "0.57810813", "0.5776003", "0.57759184", "0.5775692", "0.5774914", "0.5774225", "0.57613975", "0.5760559", "0.5748892", "0.57484025", "0.57404655", "0.5733516", "0.57270956", "0.5724123", "0.57232493", "0.5717158", "0.5713074", "0.5712427", "0.57054424", "0.5704007", "0.57030034" ]
0.0
-1
homework !!! must use your ArrayStack or LinkedListStack in problem 1 print with the following format. System.out.println() will not pass test.
public static void printListInReverse(ListNode list, PrintStream print) { print.println("hello world"); // place holder }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 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 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}", "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 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 display() {\n\n for (int i=top;i>=0;i--)\n {\n System.out.println(stack[i]);\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}", "private void printOutResult (){\n if (!numStack.empty()){\n System.out.println(numStack.peek());\n }\n else{\n System.out.println(\"Stack empty.\");\n }\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 }", "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 void main(String[] args) {\n// System.out.println(\"as.getSize() == \" + as.getSize());\n// as.pop();\n// System.out.println(\"as.pop() == \" + as);\n// System.out.println(\"as.peek() == \" + as.peek());\n// as.push(\"17\");\n// System.out.println(as);\n\n LinkedListStack<Integer> stack = new LinkedListStack<>();\n\n for(int i = 0 ; i < 5 ; i ++){\n stack.push(i);\n System.out.println(stack);\n }\n\n stack.pop();\n System.out.println(stack);\n\n }", "public String print(){\n if (index1 != 0 || index2 != 0 && !isFull()){\n System.out.println(\"Odd Stack: \");\n for (int i = 0; i < oddArray.length; i++) {\n if (oddArray[i] != 0) {\n if (i % 10 == 0)\n System.out.println();\n System.out.print(oddArray[i] + \" \");\n }\n }\n System.out.println(\"\\n\\nEven Stack: \");\n for (int j = 0; j < oddArray.length; j++)\n if (evenArray[j] != 0) {\n if (j % 10 == 0)\n System.out.println();\n System.out.print(evenArray[j] + \" \");\n }\n System.out.printf(\"\\n\\nNumber in Odd Stack: %1d \\nNumber in Even Stack: %1d\\n\", index1, index2);\n }\n return \"\";\n }", "public void print(){\n for(int i = 0; i < numElements; i++){\n System.out.print(myCustomStack[i] + \" \");\n }\n }", "@Test\n\tpublic void test1(){\n\t\tI_Stack<String> is = new I_Stack<String>();\n\t\tis.push(\"string1\");\n\t\tis.push(\"string2\");\n\t\tis.show(System.out);\n\t\t\n\t}", "@Test\n public void testPrintStack() {\n System.out.println(\"printStack\");\n Stack2 instance = new Stack2();\n instance.push(2);\n instance.push(4);\n instance.push(5);\n int temp = instance.pop();\n instance.printStack();\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 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 }", "public static void main( String[] args )\n {\n\tStack<String> cakes = new LLStack<String>();\n\n\t//\"bronze jungle fail smite challenger nunu consume blue\"\n\tSystem.out.println( \"is cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n\t//push tests\n\tcakes.push( \"blue\" );\t\n\tSystem.out.println( \"top value of cakes after pushing blue:\\n\" + cakes.peek() );\t\n\tcakes.push( \"consume\" );\t\n\tSystem.out.println( \"top value of cakes after pushing consume:\\n\" + cakes.peek() );\t\n\tcakes.push( \"nunu\" );\n\tSystem.out.println( \"top value of cakes after pushing nunu:\\n\" + cakes.peek() );\t\t\n\tcakes.push( \"challenger\" );\n\tSystem.out.println( \"top value of cakes after pushing challenger:\\n\" + cakes.peek() );\t\n\tcakes.push( \"smite\" );\t\n\tSystem.out.println( \"top value of cakes after pushing smite:\\n\" + cakes.peek() );\t\n\tcakes.push( \"fail\" );\t\n\tSystem.out.println( \"top value of cakes after pushing fail:\\n\" + cakes.peek() );\t\n\tcakes.push( \"jungle\" );\t\n\tSystem.out.println( \"top value of cakes after pushing jungle:\\n\" + cakes.peek() );\t\n\tcakes.push( \"bronze\" );\t\n\tSystem.out.println( \"top value of cakes after pushing bronze:\\n\" + cakes.peek() );\n\t\n\tSystem.out.println( \"\\nis cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n\t//pop tests\n\tfor( int i = 0; i < 8; i ++ ){\n\t\tSystem.out.println( \"top value of cakes: \" + cakes.peek() );\n\t\tSystem.out.println( \"value popped from cakes: \" + cakes.pop() );\n\t}\n\t\n\tSystem.out.println( \"\\nis cakes empty: \" + cakes.isEmpty() + \"\\n\" );\n\t\n }", "public static void main(String[] args) \r\n\t{\n\t \r\n Stack st=new Stack();\r\n st.push(6);\r\n st.push(5);\r\n st.push(3);\r\n st.push(2);\r\n st.push(1);\r\n \r\n System.out.println( st.peek());\r\n \r\n \r\n // System.out.println( st.isEmpty());\r\n\t}", "public static void main(String[] args) {\n ArrayDeque<Integer> stack = new ArrayDeque<>();\n stack.push(10);\n stack.push(20);\n stack.push(30);\n \n System.out.println(\"stack : \"+stack);\n System.out.println(\"Top : \"+stack.peek());\n \n while(stack.isEmpty() != true)\n {\n System.out.println(stack.poll()+\" \");\n }\n }", "public static void main(String[] args) {\n\t\tStack s = new Stack();\r\n\t\ts.push(10);\r\n\t\ts.push(20);\r\n\t\ts.push(30);\r\n\t\tSystem.out.println(s.pop());\r\n\t\ts.printStack();\r\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}", "public static void main(String[] args) {\n\t\tInteger[] iStore = new Integer[10];\n\t\tGenStack2<Integer> stk1 = new GenStack2<Integer>(iStore);\n\n\t\t// Create stack for array\n\t\tString[] name = { \"One\", \"Two\", \"Three\" };\n\t\tString[] strStore = new String[3];\n\t\tGenStack2<String> stk2 = new GenStack2<String>(strStore, name);\n\n\t\tString str;\n\t\tint n;\n\n\t\ttry {\n\t\t\tfor (int i = 0; i < iStore.length; i++) {\n\t\t\t\tstk1.push(i);\n\t\t\t}\n\t\t} catch (StackFullExeption exc) {\n\t\t\tSystem.out.println(exc);\n\t\t}\n\n\t\t// One stack from another\n\t\tString[] strStore2 = new String[3];\n\t\tGenStack2<String> stk3 = new GenStack2<String>(strStore2, stk2);\n\n\t\t// Display all stacks\n\t\ttry {\n\t\t\tSystem.out.print(\"stk1: \");\n\t\t\tfor (int i = 0; i < iStore.length; i++) {\n\t\t\t\tn = stk1.get();\n\t\t\t\tSystem.out.print(n + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\\n\");\n\n\t\t\tSystem.out.print(\"stk2: \");\n\t\t\tfor (int i = 0; i < strStore2.length; i++) {\n\t\t\t\tstr = stk2.get();\n\t\t\t\tSystem.out.print(str + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println(\"\\n\");\n\n\t\t\tSystem.out.print(\"stk3: \");\n\t\t\tfor (int i = 0; i < strStore2.length; i++) {\n\t\t\t\tstr = stk3.get();\n\t\t\t\tSystem.out.print(str + \" \");\n\t\t\t}\n\n\t\t} catch (StackEmptyExeption exc) {\n\t\t\tSystem.out.println(exc);\n\t\t}\n\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\n\t\tStack<String> testStack = new Stack<String>();\n\t\ttestStack.push(\"1\");\n\t\ttestStack.push(\"2\");\n\t\ttestStack.push(\"3\");\n\t\ttestStack.push(\"4\");\n\t\tSystem.out.println(testStack.peek());\n\t\tSystem.out.println(testStack.pop());\n\t\tSystem.out.println(testStack.pop());\n\t\tSystem.out.println(testStack);\n\t}", "public static void main(String[] args) {\r\n\r\n\t\tArrayStack arrst = new ArrayStack(5);\r\n\t\tIntStream.range(0, 5).forEach(arrst::push);\r\n\t\tSystem.out.println(\"Response of peek \" + arrst.peek());\r\n\t\tSystem.out.println(\"Response of pop\" + arrst.pop());\r\n\t\tSystem.out.println(\"push one random number in the middle\");\r\n\t\tarrst.push(10);\r\n\t\tSystem.out.println(\"printing stack after first pop\");\r\n\t\tarrst.display();\r\n\r\n\t\tIntStream.range(0, arrst.size()).forEach(i -> arrst.pop());\r\n\r\n\t\tSystem.out.println(\"isEmpty after poping all the elements ???\" + arrst.isEmpty());\r\n\r\n\t\tarrst.display();\r\n\r\n\t}", "public static void main(String[] args) {\n\r\n\r\n\r\n\t\tPerson p1 = new Person(\"1\", \"Nishant\");\r\n\t\tPerson p2 = new Person(\"2\", \"Nikhil\");\r\n\t\t\r\n\t\tPersonStack ps = new PersonStack();\r\n\t\t\r\n\t\tps.push(p1);\r\n\t\tps.push(p2);\r\n\t\t\r\n\t\tSystem.out.println(ps.pop().toString());\r\n\t\tSystem.out.println(ps.pop().toString());\r\n\t\t\r\n\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 void print_stacks(ArrayList<ArrayList<Stack<Integer>>> stacks) {\n\t\tfor (int k=0; k<size*size; k++) {\n\t\t\tSystem.out.println(\"----------------------------------------\\n\\tRow \"+k+\"'s Possible Values\\n----------------------------------------\");\n\t\t\tfor (int l=0; l<size*size; l++) {\n\t\t\t\tSystem.out.print(\"col \"+l+\" |\");\n\t\t\t\tif (!stacks.get(k).get(l).empty()) System.out.println(stacks.get(k).get(l));\n\t\t\t\telse System.out.println();\t\n\t\t\t}\n\t\t}\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 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) {\n\t\tStack stack = new Stack(3);\n\t\tSystem.out.println(\"Is stack empty ? - \" + isEmpty(stack));\n\t\tpush(stack, 10);\n\t\tpush(stack, 20);\n\t\tpush(stack, 30);\n\t\tpush(stack, 40);\n\t\tfor(int i = 0; i <= stack.top; i++){\n\t\t\tSystem.out.print(stack.list[i] + \" -\");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"No of element in stack - \"+(stack.top +1));\n\t\twhile(!isEmpty(stack)){\n\t\t\tSystem.out.println(\"Poping ...\"+ pop(stack));\n\t\t}\n\t}", "@Test\n public void testSingleStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n\n Assert.assertEquals(\"[1]\", ps.toString());\n }", "public static void main(String[] args) {\n\t\tTestStack s = new TestStack();\n\t\ts.push(1);\n\t\ts.push(\"2\");\n\t\ts.push(\"as\");\n\t\t\n\t\tint size =stack.size();\n\t\t\n\t\tfor(int i=0;i<size;i++)\n\t\t\tSystem.out.println(s.pop());\n\t\t\t\t\n\t}", "public static void main (String[] args) {\n // testing LinkedStack\n // ===================\n System.out.println(\"\\n** Test output for LinkedStack **\\n\");\n\n // instantiate new LinkedStack\n LinkedStack<String> stack = new LinkedStack<String>();\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(stack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // push an element onto stack, stack should have one element\n System.out.println(\"Pushing an element...\");\n stack.push(\"One\");\n System.out.println(\"After pushing a single element, the stack should have one element \\\"One\\\"\");\n System.out.println(stack);\n System.out.println();\n\n // pop the element, stack should be empty again\n System.out.println(\"Popping...\");\n stack.pop();\n System.out.println(\"After the pop operation, stack should be empty:\");\n System.out.println(stack);\n\n // push more elements\n System.out.println(\"Pushing an element...\");\n stack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Three\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Six\");\n System.out.println(\"Pushing an element...\");\n stack.push(\"Seven\");\n System.out.println(\"Stack with six elements:\");\n System.out.println(stack);\n System.out.println();\n\n // check size is 6 and isEmpty() returns false\n System.out.println(\"Checking that size = 6 and isEmpty is false...\");\n System.out.println(\"Size: \" + stack.size() + \" isEmpty: \" + stack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(stack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping...\");\n System.out.println(stack.pop());\n System.out.println(\"Stack after pop operation:\");\n System.out.println(stack);\n System.out.println();\n\n\n // ====================\n // testing DropOutStack\n // ====================\n System.out.println(\"\\n** Test output for DropOutStack **\\n\");\n // instantiate new DropOutStack with capacity of 5\n DropOutStack<String> dropStack = new DropOutStack<String>(5);\n\n // test peeking and popping empty stack, should throw exception\n System.out.println(\"Popping empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.pop());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n }\n System.out.println(\"Peeking at empty stack, which throws EmptyCollectionException:\");\n try {\n System.out.println(dropStack.peek());\n }\n catch (EmptyCollectionException e) {\n System.out.println(e.getClass() + \" \" + e.getMessage() + \"\\n\");\n\n }\n\n // check size is 0 and isEmpty() returns true\n System.out.println(\"Checking that size = 0 and isEmpty is true...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 elements to stack, stack not full\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"One\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Two\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Three\");\n System.out.println(\"After 3 push operations, the stack looks like this:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 3 and isEmpty() returns false\n System.out.println(\"Checking that size = 3 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // push 3 more elements to stack, should drop first element pushed to stack (\"One\")\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Four\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Five\");\n System.out.println(\"Pushing an element...\");\n dropStack.push(\"Six\");\n System.out.println(\"Stack after 3 more push operations, first element \\\"One\\\" is lost:\");\n System.out.println(dropStack);\n System.out.println();\n\n // check size is 5 and isEmpty() returns false\n System.out.println(\"Checking that size = 5 and isEmpty is false...\");\n System.out.println(\"Size: \" + dropStack.size() + \" isEmpty: \" + dropStack.isEmpty());\n System.out.println();\n\n // test peeking at top element from stack\n System.out.println(\"Peeking at top element..\");\n System.out.println(dropStack.peek());\n System.out.println();\n\n // test popping top element from stack\n System.out.println(\"Popping next element\");\n dropStack.pop();\n System.out.println(\"Stack after pop operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // push another element\n System.out.println(\"Pushing another element...\");\n dropStack.push(\"Seven\");\n System.out.println(\"After push operation:\");\n System.out.println(dropStack);\n System.out.println();\n\n // pop all elements from stack, stack should be empty\n System.out.println(\"Popping all elements from stack:\");\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n dropStack.pop();\n\n System.out.println(\"Stack is empty:\");\n System.out.println(dropStack);\n\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}", "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}", "@Test\n public void toStringTest() {\n assertEquals(\"1 2 3 4\", stack.toString());\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}", "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\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 void main(String[] args) throws IOException {\n\t\t\n\t\tBufferedReader buffer = new BufferedReader(new InputStreamReader(System.in)); \n\t\t int n = Integer.parseInt(buffer.readLine()); \n\t\t Stack<String> stack = new Stack<>(); \n\t\t \n\t\t \n\t\t for (int i=0; i<n; ++i) \n\t\t { //temp에 문자가 한글자씩 끊어서 저장이 된다.\n\t\t String[] temp = buffer.readLine().split(\"\"); \n\t\t for (int j=0; j<temp.length; ++j) \n\t\t { \n\t\t if (temp[j].equals(\"(\")) \n\t\t stack.push(temp[j]); \n\t\t if(temp[j].equals(\")\") && stack.isEmpty()) \n\t\t { \n\t\t stack.push(temp[j]); \n\t\t break; \n\t\t } \n\t\t if (temp[j].equals(\")\") && !stack.isEmpty()) \n\t\t stack.pop(); \n\t\t } \n\t\t if (stack.isEmpty()) \n\t\t System.out.println(\"YES\"); \n\t\t else \n\t\t System.out.println(\"NO\"); \n\t\t //stack에 존재하는 모든 자료를 삭제하는 메소드 -> stack.clear()\n\t\t stack.clear(); \n\t\t } \n\t\t }", "public static void main(String[] args) {\r\n\t\tStack <Integer> s=new Stack<>();//Stack s=new Stack();\r\n\t\ts.push(12);\r\n\t\ts.push(32);\r\n\t\ts.push(62);\r\n\t\ts.push(72);\r\n\t\tSystem.out.println(s.pop());\r\n\t\tSystem.out.println(s.pop());\r\n\t\tSystem.out.println(s.pop());\r\n\t\t\r\n\t\tStack <String> s2=new Stack<>();\r\n\t\ts2.push(\"h\");\r\n\t\ts2.push(\"o\");\r\n\t\ts2.push(\"l\");\r\n\t\ts2.push(\"a\");\r\n\t\tSystem.out.println(s2.pop());\r\n\t\tSystem.out.println(s2.pop());\r\n\t\tSystem.out.println(s2.pop());\r\n\r\n\t\t\r\n\t}", "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 static void main(String[] args) {\n\t\tintStack stack = new intStack();\n\t\t\n\t\t//pushing values into intStack\n\t\tfor(int i =0; i<5; i++){\n\t\t\tstack.push(i*3);\n\t\t}\n\t\t//reading back values\n\t\tstack.show();\n\t\tSystem.out.println();\n\t\t\n\t\t//popping values & showing stack after each iteration\n\t\tfor(int j =0; j<5; j++){\n\t\t\tstack.pop();\n\t\t\tstack.show();\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\t\n// working with MotorcycleStack\n\t\t\n\t\tMotorcycleStack motoStack = new MotorcycleStack();\n\t\tMotorcycles moto1 = new Motorcycles(\"Suzuki\", \"dr650\", 650);\n\t\tMotorcycles moto2 = new Motorcycles(\"Kawasaki\", \"klr650\", 650);\n\t\tMotorcycles moto3 = new Motorcycles(\"Suzuki\", \"drz400\", 400);\n\t\t\n\t\tmotoStack.push(moto1);\n\t\tmotoStack.display();\n\t\tmotoStack.push(moto2);\n\t\tmotoStack.display();\n\t\tmotoStack.push(moto3);\n\t\tmotoStack.display();\n\t\t\n\t\tif(!motoStack.isEmpty()){\n\t\t\tSystem.out.println(motoStack.pop());\n\t\t\tSystem.out.println(motoStack.pop());\n\t\t}\n\n\n\t}", "public void printCarStack() {\n if(!isCarStackEmpty()) {\n System.out.println(\"Car stack contains \" + (top + 1) + \" cars\");\n for (int index = top; index >= 0; index--) {\n System.out.println (\"element[\" + index + \"] = \" + carStack[index]);\n }\n System.out.println();\n }\n else {System.out.println(\"Car stack is empty\");\n }\n }", "public static void main(String[] args) {\n Solution solution = new Solution();\n TreeNode root = new TreeNode(1);\n root.left = new TreeNode(2);\n root.left.left = new TreeNode(6);\n root.left.left.right = new TreeNode(10);\n root.left.left.right.left = new TreeNode(-1);\n root.left.right = new TreeNode(9);\n\n root.right = new TreeNode(3);\n root.right.right = new TreeNode(5);\n root.right.left = new TreeNode(4);\n root.right.left.left = new TreeNode(7);\n root.right.left.right = new TreeNode(8);\n \n solution.stackList(root);\n for (int i = 0 ; i < solution.list.size(); i++) System.out.print(solution.list.get(i) + \" \");\n }", "public static void main(String[] args) {\n\t\tstack s = new stack();\n\t\ts.push(6);\n\t\ts.push(5);\n\t\ts.min();\n\t\ts.push(3);\n\t\ts.push(4);\n\t\ts.push(2);\n\t\ts.min();\n\t\ts.push(6);\n\t\t// s.print();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.min();\n\t\ts.min();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.pop();\n\t\ts.min();\n\t\t// s.print();\n\n\t}", "public static void main(String[] args) {\n\t\tSystem.out.println(\"A\".compareTo(\"B\"));\n//\t\tArrayStack<String> s1 = new ArrayStack<String>(5);\n//\t\ts1.push(\"A\");\n//\t\ts1.push(\"B\");\n//\t\ts1.push(\"C\");\n//\t\t\n//\t\tSystem.out.println(s1);\n//\t\t\n//\t\ts1.pop();\n//\t\tSystem.out.println(\"\\n\" + s1);\n//\t\t\n//\t\ts1.push(\"D\");\n//\t\ts1.push(\"E\");\n//\t\ts1.push(\"F\");\n//\t\t\n//\t\ts1.pop();\n//\t\tSystem.out.println(s1);\n\t\t\n\t}", "public void peek() {\r\n\t\t\tif(top==-1) {\r\n\t\t\t\tSystem.out.println(\"stack is empty!!\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(arr[top]);\r\n\t\t\t}\r\n\t\t\t\r\n\t\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}", "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}", "static void showPop(Stack<String> stack) {\n\t\tSystem.out.println(\"pop -> \" + stack.pop());\n\t\tSystem.out.println(\"Stack: \" + stack);\n\t}", "public static void main( String[] args )\n {\n Stack stack = new Stack( new DList() );\n stack.push( \"bat\" );\n stack.push( \"cat\" );\n stack.push( \"dog\" );\n\n System.out.println( \"Print the Stack.\" );\n System.out.println( stack );\n }", "public static void main(String[] args) {\n\t\tStack<String> stack = new Stack<>();\n\t\t//push é o metodo adiciona\n\t\tstack.push(\"ricardo\");\n\t\tstack.push(\"rodrigo\");\n\t\tstack.push(\"rogerio\");\n\t\tstack.push(\"ronaldo\");\n\t\t\n\t\tSystem.out.println(stack);\n\t\t\n\t\t//pop é o metodo delete\n\t\tstack.pop();\n\t\t\n\t\tSystem.out.println(stack);\n\t\t//peek é o metodo para retornar o ultimo elemento sem apagar\n\t\tSystem.out.println(stack.peek());\n\t\t\n\t\t//System.out.println(stack);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tunit11.Stack<String> stack = new unit11.Stack<String>();\n\t\t\n\t\tfor(String s : \"My dog has fleas\".split(\" \")){\n\t\t\tstack.push(s);\n\t\t}\n\t\twhile(!stack.empty()){\n\t\t\tSystem.out.println(stack.pop());\n\t\t}\n\t\tjava.util.Stack<String> stack2 = new java.util.Stack<String>();\n\t\tfor(String s : \"My dog has fleas\".split(\" \")){\n\t\t\tstack.push(s);\n\t\t}\n\t\twhile(! stack.empty()){\n\t\t\tSystem.out.println(stack.pop());\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 }", "public static void main(String[] args) {\n\t\tGenericStack<String> myStringStack = new GenericStack<>();// Declearing a GenericStack object\n\t\t\n\t\t// Places string literals into the GenericStack object \n\t\tmyStringStack.push(\"Apple\");\n\t\tmyStringStack.push(\"Pie\");\n\t\tmyStringStack.push(\"Is\");\n\t\tmyStringStack.push(\"Good\");\n\t\tmyStringStack.push(\"By\");\n\t\tmyStringStack.push(\"Itself\");\n\t\tmyStringStack.push(\"But\");\n\t\tmyStringStack.push(\"Better\");\n\t\tmyStringStack.push(\"With\");\n\t\tmyStringStack.push(\"Icecream\");\n\t\t\n\t\tmyStringStack.toString();// Display the object \n\t\t\n\t\t// Remove string literals from the object \n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\tmyStringStack.pop();\n\t\t\n\t\tmyStringStack.toString();// Display the object\n\t\t\n\t\tGenericStack<Integer> myIntStack = new GenericStack<>();// Declearing another GenericStack object\n\t\t\n\t\tfor(int i = 0; i <= 10; i++) {\n\t\t\tmyIntStack.push(i); // Filling the Integer \"stack\"\n\t\t}\n\t\t\n\t\tmyIntStack.toString(); // Display the object \n\t\t\n\t\t// Removing Integer objects from the GenericStack object myIntStack\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\tmyIntStack.pop();\n\t\n\t\t\n\t\tmyIntStack.toString();// Display the object\n\t}", "public static void main(String[] args) throws Exception {\n\r\n\t\tStack s = new Stack();\r\n\t\tStack n = new Stack();\r\n\t\ts.push(200);\r\n\t\ts.push(150);\r\n\t\ts.push(120);\r\n\t\ts.push(100);\r\n\t\ts.push(80);\r\n\r\n\t\ts.display();\r\n\t\t// displayrev(s);\r\n\t\tactrev(s, n, s.size());\r\n//\t\tSystem.out.println(s.size());\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t\ts.display();\r\n\r\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 }", "public static void main(String args[]) throws FileNotFoundException{\n PrintStream fileOut = new PrintStream(\"UnoStackTest.txt\");\r\n System.setOut(fileOut);\r\n \r\n // Constructor declaration test\r\n NumberCard redCard = new NumberCard(\"red\",3,\"none\");\r\n NumberCard blueCard = new NumberCard(\"blue\",5,\"none\");\r\n NumberCard greenCard = new NumberCard(\"green\",9,\"none\");\r\n NumberCard yellowCard = new NumberCard(\"yellow\",7,\"none\");\r\n \r\n // -6 used for sorting purposes in UnoStack\r\n NumberCard wildCard = new NumberCard(\"black\",-6,\"wild\");\r\n \r\n // UnoStack constructor declaration test\r\n UnoStack A = new UnoStack();\r\n UnoStack B = new UnoStack();\r\n UnoStack C = new UnoStack();\r\n \r\n // UnoStack A manual push\r\n System.out.println(\"--------------------\");\r\n A.Push(redCard);\r\n A.Push(blueCard);\r\n A.Push(greenCard);\r\n A.Push(yellowCard);\r\n A.Push(wildCard);\r\n \r\n // A prints deck and size\r\n A.printDeck(true, A);\r\n System.out.println(\"--------------------\");\r\n int aCount = A.sizeCount(A.rCount());\r\n \r\n System.out.println(aCount);\r\n System.out.println(\"--------------------\");\r\n // Shuffle test\r\n A.Shuffle();\r\n A.Shuffle();\r\n A.Shuffle();\r\n \r\n A.printDeck(true, A);\r\n System.out.println(\"--------------------\");\r\n \r\n // pop test\r\n A.pop();\r\n A.pop();\r\n A.pop();\r\n A.pop();\r\n A.pop();\r\n System.out.println(\"--------------------\");\r\n // size check\r\n A.sizeCount(A.rCount());\r\n System.out.println(\"--------------------\");\r\n \r\n \r\n \r\n // make deck function test for false and true action cards\r\n B.MakeDeck(B, true);\r\n System.out.println(\"--------------------\");\r\n int bCount = B.sizeCount(B.rCount());\r\n System.out.println(bCount);\r\n System.out.println(\"--------------------\");\r\n B.printDeck(true, B);\r\n System.out.println(\"--------------------\");\r\n C.MakeDeck(C, false);\r\n System.out.println(\"--------------------\");\r\n C.sizeCount(C.rCount());\r\n System.out.println(\"--------------------\");\r\n C.printDeck(false, C);\r\n System.out.println(\"--------------------\");\r\n \r\n \r\n }", "public static void main(String[] args) {\n\t\tStack<Integer>stack =new Stack<>();\n\t\tstack.push(23);\n\t\tstack.push(12);\n\t\tstack.push(78);\n\t\tstack.push(2);\n\t\tstack.push(14);\n sort(stack);\n while(!stack.isEmpty())\n {\n \tSystem.out.print(stack.pop()+\" \");\n }\n\t}", "public static void main(String[] args){\n\n Mystack ms = new Mystack();\n for ( int i = 0; i <= 11; i++){\n ms.push(i+1);\n }\n\n for( int j = 0 ; j < 1 ; j++){\n ms.pop();\n }\n \n ms.print(); \n\n for( int j = 0 ; j <= 1; j++){\n ms.push(j);\n }\n \n ms.print(); \n\n }", "public static void main(String[] args) {\n TeacherStack stack = new TeacherStack();\n stack.push(1); stack.push(2); stack.push(3); stack.push(4);stack.push(5);\n stack.push(6); stack.push(7);stack.push(8);stack.push(9);stack.push(10);\n stack.push(11);\n\n stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop(); stack.pop();\n stack.pop();\n\t}", "public static void main(String[] args) {\n\t\tQueueOfStack test = new QueueOfStack();\n\t\ttest.enqueue(2);\n\t\ttest.enqueue(3);\n\t\tSystem.out.println(test.dequeue());\n\t\ttest.enqueue(7);\n\t\ttest.enqueue(1);\n\t\ttest.enqueue(6);\n\t\ttest.enqueue(4);\n\t\tSystem.out.println(test.dequeue());\n\t\tSystem.out.println(test.dequeue());\n\t\tSystem.out.println(test.peek());\n\t}", "public void stackUsage() {\n\t\tStack<String> s = new Stack<String>();\n\t\ts.add(\"1\");\n\t\ts.add(\"2\");\n\t\ts.add(\"3\");\n\t\ts.add(\"10\");\n\t\ts.add(\"11\");\n\t\tSystem.out.println(s.peek());\n\t\t\n\t\tCollections.sort(s, new Comparator<String>() {\n\n\t\t\t@Override\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\tint a = Integer.valueOf(o1);\n\t\t\t\tint b = Integer.valueOf(o2);\n\t\t\t\tif (a > b) {\n\t\t\t\t\treturn 1;\n\t\t\t\t} else {\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t\tSystem.out.println(s.peek());\n\t}", "@Test\n public void testNonemptyStack() {\n ProgramStack ps = new ProgramStack();\n\n ps.push(1);\n ps.push(2);\n ps.push(3);\n\n Assert.assertEquals(\"[1, 2, 3]\", ps.toString());\n }", "static void stack_pop(Stack<Integer> stack)\r\n\t{\r\n\t\t\r\n\t\tSystem.out.print(\"Pop : \");\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tInteger dataElement=(Integer)stack.pop();\r\n\t\t\tSystem.out.print(\" \"+ dataElement);\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "@Test\n public void testStack() {\n DatastructureTest.STACK.push(3);\n DatastructureTest.STACK.push(7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 7);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == 3);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.peek()) == -1);\n Assert.assertTrue(((Integer) DatastructureTest.STACK.pop()) == -1);\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 }", "@Test\n public void testStackCodeExamples() {\n logger.info(\"Beginning testStackCodeExamples()...\");\n\n // Allocate an empty stack\n Stack<String> stack = new Stack<>();\n logger.info(\"Start with an empty stack: {}\", stack);\n\n // Push a rock onto it\n String rock = \"rock\";\n stack.pushElement(rock);\n assert stack.getTop().equals(rock);\n logger.info(\"Push a rock on it: {}\", stack);\n\n // Push paper onto it\n String paper = \"paper\";\n stack.pushElement(paper);\n assert stack.getTop().equals(paper);\n logger.info(\"Push paper on it: {}\", stack);\n\n // Push scissors onto it\n String scissors = \"scissors\";\n stack.pushElement(scissors);\n assert stack.getTop().equals(scissors);\n assert stack.getSize() == 3;\n logger.info(\"Push scissors on it: {}\", stack);\n\n // Pop off the scissors\n assert stack.popElement().equals(scissors);\n assert stack.getSize() == 2;\n logger.info(\"Pop scissors from it: {}\", stack);\n\n // Pop off the paper\n assert stack.popElement().equals(paper);\n assert stack.getSize() == 1;\n logger.info(\"Pop paper from it: {}\", stack);\n\n // Pop off the rock\n assert stack.popElement().equals(rock);\n assert stack.isEmpty();\n logger.info(\"Pop rock from it: {}\", stack);\n\n logger.info(\"Completed testStackCodeExamples().\\n\");\n }", "public void peek(){\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(topOfStack==-1){\n System.out.println(\"Stack is empty, can't peek\");\n return;\n }\n // if stack is not empty\n System.out.println(\"Top of the stack: \"+this.arr[this.topOfStack]);\n }", "public void StackTest() {\n\tSystem.out.println( \"\\nQuestion (8) Stack Test\" );\n\tSystem.out.println( \"-----------------------\");\n\tStack s = new Stack(3);\n\tSystem.out.println( \"push 0\");\n\ts.push(0);\n\tSystem.out.println( \"push 1\");\n\ts.push(1);\n\tSystem.out.println( \"push 2\");\n\ts.push(2);\n\tSystem.out.println( \"try to push 3\");\n\ts.push(3); // error here pushing beyond stack depth, will print error messgae\n\n\tSystem.out.println( \"pop \" + s.pop() );\n\tSystem.out.println( \"pop \" + s.pop() );\n\tSystem.out.println( \"pop \" + s.pop() ); \n\tSystem.out.println( \"try to pop \" ); // error here poping off empty stack\n\ts.pop();\n }", "public static void main(String[] args) {\n\t\tLinkedStack st = new LinkedStack();\n\t\tst.push(1);\n\t\tst.push(2);\n\t\tst.push(3);\n\t\tst.push(4);\n\t\tst.push(5);\n\t\tst.pop();\n\t\tst.pop();\n\t\tst.pop();\n\t\tst.pop();\n\t\tst.pop();\n\t\t\n\t\tst.pop();\n\t\tst.pop();\n\t\n\n}", "public static void main(String[] args) {\n\t\t\n\t Stack<String> s =new Stack<String>();\n\t System.out.println(s.size()+\" - \"+s.length());\n\t for (int i = 0; i < 100; i++) {\n\t\t\ts.push(\"111\");\n\t\t\tSystem.out.println(s.size()+\" - \"+s.length());\n\n\t\t\t\n\t\t}\n\t for (int i = 0; i < 100; i++) {\n\t\t\ts.pop();\n\t\t\tSystem.out.println(s.size()+\" - \"+s.length());\n\n\t\t\t\n\t\t}\n\t \n\t \n\t \t\n\t \n\t}", "public String getStack();", "static void stack_peek(Stack<Integer> stack)\r\n\t{\r\n\t\tInteger element=stack.peek();\r\n\t\tSystem.out.println(\"Element on stack top :\" + element);\r\n\t}", "public static void main(String[] args) {\r\n\t\tStack s = new Stack();\r\n\t\t// Stack specific method\r\n\t\ts.push(\"a\");\r\n\t\ts.push(\"b\");\r\n\t\ts.push(\"c\");\r\n\t\ts.push(\"d\");\r\n\t\ts.push(\"e\");\r\n\t\tSystem.out.println(\"the stack elements are \"+s);\r\n\t\t// search method will give the offset number of the element\r\n\t\tSystem.out.println(s.search(\"c\"));\r\n\t\t// if element is not present it will give -1\r\n\t\tSystem.out.println(s.search(\"f\"));\r\n\t\t//peek method:(Lifo patern) it will give you the first item without \r\n\t\t// removing it.\r\n\t\tSystem.out.println(\"lifo style \"+s.peek());\r\n\t\t// pop method: removing the last object lifo style\r\n\t\t System.out.println(s.pop()+\" the last object will be removed\");\r\n\t\t System.out.println(s +\" printing after pop method\");\r\n\t\t\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tDeque<Integer> stk = new ArrayDeque<>();\n\t\tstk.add(100);\n\t\tstk.add(200);\n\t\tstk.add(300);\n\t\tstk.add(400);\n\t\t\n\t\t\n//\t\tSystem.out.println(stk.isEmpty());\n\t\twhile(!stk.isEmpty())\n\t\t{\n\t\t\tSystem.out.println(stk.peek());\n\t\t\tstk.pop();\n\t\t\t\n\t\t}\n\n\t}", "public static void main(String[] args)\n\t{\n\n\t\tStack<String> myStack = new Stack<String>();\n\t\t//myStack.push(Color.RED); //Error!\n\t\tmyStack.push(\"Michael\");\n\t\tmyStack.push(\"Raymond\");\n\t\tmyStack.push(\"David\");\n\t\tmyStack.push(\"Jackson\");\n\t\tmyStack.push(\"Gabby\");\n\t\t\n\t\tSystem.out.println(\"\\nPrinting stack with loop:\");\n\t\tfor(int i = 0; i < myStack.size(); i++)\n\t\t\tSystem.out.println(i+ \". \" + myStack.get(i));\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(myStack); //get does not pop from stack.\n\t\t\n\t\tSystem.out.println(\"-*Popping 1 element from top of stack*-\\n\");\n\t\tmyStack.pop();\n\t\t\n\t\tSystem.out.println(\"\\nPrinting stack with loop:\");\n\t\tfor(int i = 0; i < myStack.size(); i++)\n\t\t\tSystem.out.println(i+ \". \" + myStack.get(i));\n\t\tSystem.out.println();\n\t\t\n\t\tSystem.out.println(\"Popping \" + myStack.pop() + \" from top of stack\");\n\t\tSystem.out.println(\"Popping \" + myStack.pop() + \" from top of stack\");\n\t\t\n\t\n\t\tSystem.out.println(\"\\nPrinting stack with loop:\");\n\t\tfor(int i = 0; i < myStack.size(); i++)\n\t\t\tSystem.out.println(i+ \". \" + myStack.get(i));\n\t\tSystem.out.println();\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}", "@Test\n public void pushOnStackTest_Correct(){\n assertEquals(stack.getTop().getData() , stack.getStack().returnFirst());\n }", "public static void main(String[] args) {\n\t\tString palabrejas[] = { \"columnas\", \"filas\", \"zalamero\", \"zascandil\" };\n\t\tStack<String> palabrasPila = new Stack<String>();\n\t\t// Aunque tiene varios métodos suelen usarse los de ingreso o extraccion\n\t\t// a la pila\n\t\t// para poner en la pila\n\t\t// push coloca un elemento en la cima de la pila\n\t\tpalabrasPila.push(palabrejas[0]);\n\t\tpalabrasPila.push(palabrejas[1]);\n\t\tSystem.out.println(palabrasPila);\n\t\t// como se obtienen los elementos seegun el criterio de una pila\n\t\t// dos formas\n\t\t// 1º obteniendo el elemento y borrandolo de la pila\n\t\t// con pop se retorna el elemento en la cima y se borra de la pila\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\tSystem.out.println(palabrasPila);\n\t\ttry {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.pop());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"pila vacia\");\n\t\t}\n\t\t// Como hemos dicho se puede trabajar con Stack como si fuese una colecction\n\t\tfor (int i = 0; i < palabrejas.length; i++) {\n\t\t\tpalabrasPila.push(palabrejas[i]);\n\t\t}\n\t\t// 2º metodo de acceso a Stack como pila\n\t\t// Se trata del metodo peek que es como el pop pero\n\t\t// no elimina el elemento de la cima\n\t\tfor (int i = 0; i < 5; i++) {\n\t\t\tSystem.out.println(\"cima \" + palabrasPila.peek());\n\t\t}\n\t\t// Si usas una Stack es porque lo necesitas. java te permite usarla como\n\t\t// una collection normal, pero en realidad solo se deberian usar las\n\t\t// cuatro funciones asociadas a a pila\n\t\t// pop,push,peek,isEmpty\n\t\tSystem.out.println(palabrasPila.size());\n\t}", "public static void main(String[] args) {\n\t\tStackImpl obj = new StackImpl();\n\t\tobj.Enqueue(2);\n\t\tobj.Enqueue(22);\n\t\tobj.Enqueue(23);\n\t\tobj.Enqueue(24);\n\t\tobj.Enqueue(25);\n\t\tobj.Enqueue(26);\n\t\tobj.Enqueue(37);\n\t\tobj.display();\n\t\tSystem.out.println();\n\t\tSystem.out.println(obj.Dequeue());\n\t\tobj.display();\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tStackUsingQueues st = new StackUsingQueues();\r\n\t\t\r\n\t\tst.push(1);\r\n\t\tst.push(2);\r\n\t\tst.push(3);\r\n\t\tst.push(4);\r\n\t\t\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\t\r\n\t\tst.push(5);\r\n\t\tst.push(6);\r\n\t\tst.push(7);\r\n\t\tst.push(8);\r\n\t\t\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\t\tSystem.out.println(st.pop());\r\n\r\n\t}", "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}", "public static void main(String[] args) {\n Scanner in = new Scanner(System.in);\n PrintStream out = System.out;\n StackofItem (in,out);\n }", "@Test\n\tpublic void testPushBack1() {\n\t\tcircularlist.pushBack(1);\n\t\tcircularlist.pushBack(2);\n\t\tcircularlist.pushBack(3);\n\t\t\n\t\tSystem.setOut(new PrintStream(Actualout));\n\t\t\n\t\tcircularlist.display();\n\t\t\n\t\tassertEquals(\"List : 1 2 3\\r\\n\", Actualout.toString());\n\t}", "static void stackPush(Stack<Integer> stack)\r\n\t{\r\n\t\tfor(int i=0;i<5;i++)\r\n\t\t{\r\n\t\t\tstack.push(i*5);\r\n\t\t}\r\n\t\tSystem.out.println(\"Printing the stack value which is push:\");\r\n\t\tSystem.out.println(\"Push :\"+stack +\"\\nsize of stack: \"+ stack.size());\r\n\t}", "public static void main(String[] args) {\n\t\tlist.add(new Node13(1));\n\t\tlist.add(new Node13(2));\n\t\tlist.add(new Node13(3));\n\t\tlist.add(new Node13(4));\n\t\tlist.add(new Node13(5));\n\t\tlist.add(new Node13(6));\n\t\tlist.add(new Node13(7));\n\t\tlist.add(new Node13(8));\n\t\taddEdge(1, 3);\n\t\taddEdge(2, 3);\n\t\taddEdge(2, 4);\n\t\taddEdge(3, 5);\n\t\taddEdge(4, 6);\n\t\taddEdge(5, 7);\n\t\taddEdge(5, 6);\n\t\taddEdge(6, 8);\n\t\tfor(Node13 n:list){\n\t\t\twhile(n!=null){\n\t\t\t\tSystem.out.print(n.c+\"-->\");\n\t\t\t\tn=n.next;\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\ttopolSort();\n\t\tSystem.out.println(\"After Topological sort : \"+stack.size());\n\t\tfor(Node13 p:stack){\n\t\t\tSystem.out.print(p.c+\" \");\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tStack<Integer> S = new Stack<>();\r\n\t\tfor(int i = 0; i<5; i++){\r\n\t\t\t//S.push(args);\r\n\t\t\tS.push(i);\r\n\t\t}\r\n\t\tSystem.out.println(\"Bottom-->\"+S+\"<--Top\");\r\n\t\t//S.pop();\r\n\t\twhile(!S.isEmpty()){\r\n\t\t\tSystem.out.println(\"After poping \"+S.pop());\r\n\t\t\tSystem.out.println(\"Now\tBottom-->\"+S+\"<--Top\");\r\n\t\t}\r\n\t\t\r\n\t\t//System.out.println(\"After poping \"+S.pop());\r\n\t\t//System.out.println(\"Now\tBottom-->\"+S+\"<--Top\");\r\n\t}", "public static void main(String[] args) {\n Stack testStack = new Stack();\n testStack.add(\"a\");\n testStack.add(\"b\");\n testStack.add(\"c\");\n System.out.println(testStack.values());\n System.out.println(testStack.take());\n System.out.println(testStack.values());\n System.out.println(testStack.take());\n System.out.println(testStack.values());\n \n\n }", "public void testToString() {\n assertEquals(this.empty.toString(), \"[]\");\n assertEquals(this.stack.toString(), \"[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\");\n }", "static void testCase() throws IOException{\r\n /*\r\n [\"MinStack\",\"push\",\"push\",\"push\",\"top\",\"pop\",\"getMin\",\"pop\",\"getMin\",\"pop\",\"push\",\"top\",\"getMin\",\"push\",\"top\",\"getMin\",\"pop\",\"getMin\"]\r\n[[],[2147483646],[2147483646],[2147483647],[],[],[],[],[],[],[2147483647],[],[],[-2147483648],[],[],[],[]]\r\n */\r\n\r\n try{\r\n long startTime, stopTime;\r\n startTime = System.currentTimeMillis();\r\n printSpace(logic(0));\r\n println(0);\r\n stopTime = System.currentTimeMillis();\r\n println((stopTime - startTime)+\" ms\");\r\n\r\n startTime = System.currentTimeMillis();\r\n printSpace(logic(4));\r\n println(4);\r\n stopTime = System.currentTimeMillis();\r\n println((stopTime - startTime)+\" ms\");\r\n }catch(IOException ex){\r\n ex.printStackTrace();\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tStackLink<Integer> st2 = new StackLink<Integer>();\n\t\tSystem.out.println(st2.length());\n\t\tst2.push(666);\n\t\tst2.push(123);\n\t\tSystem.out.println(st2.length());\n\t\tNode no = st2.pop();\n\t\tint a = (int)no.e;\n\t\tSystem.out.println(a);\n\t\tSystem.out.println(st2.length());\n\t\t\n\t}", "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 static void main(String[] args) {\n Stack<Integer> st = new Stack<Integer>();\n System.out.println(\"push\"+st.push(2));\n st.push((54));\n st.push(10);\n System.out.println(\"pop \"+st.pop());\n System.out.println(st.peek());\n System.out.println(st.isEmpty());\n \n System.out.println(\"----\");\n \n Queue<Integer> qu = new LinkedList<Integer>();\n System.out.println(qu.isEmpty());\n System.out.println(qu.add(5));\n System.out.println(qu.add(12));\n System.out.println(qu.size());\n qu.clear();\n System.out.println(qu.size());\n \n }", "public static void main(String[] args)throws IOException {\n\t\t \r\n\t\tReader.init(System.in);\r\n\t\tStack t= new Stack();\r\n\t\tint p= Reader.nextInt();\r\n\t\tt.size=p;\r\n\t\tint o = Reader.nextInt();\r\n\t\t//String[] Y=new String[o];\r\n\t\tfor(int y=0 ; y<o;y++){\r\n\t\t\t w=Reader.next();\r\n\t\t\t if(w.equals(\"push\")){\r\n\t\t\t\t\tt.push(Integer.parseInt(Reader.next()));\r\n\t\t\t\t\tSystem.out.println(t.top());\r\n\t\t\t\t}\r\n\t\t\t\telse if(w.equals(\"pop\")){\r\n\t\t\t\t\tint r=t.pop();\r\n\t\t\t\t\tSystem.out.println(r);\r\n\t\t\t\t}\r\n\t\t\t\telse if(w.equals(\"getmin\")){\r\n\t\t\t\t\tint v=t.getmin();\r\n\t\t\t\t\tSystem.out.println(v);\r\n\t\t\t\t}\r\n\t\t\t\telse if(w.equals(\"top\")){\r\n\t\t\t\t\tint l=t.top();\r\n\t\t\t\t\tSystem.out.println(l);\r\n\t\t\t\t}\r\n\t\t\t\telse if(w.equals(\"isempty\")){\r\n\t\t\t\t\tif(t.isempty()){\r\n\t\t\t\t\t\tSystem.out.println(1);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(0);}\r\n\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 \r\n\t\t}", "public void peekStack() {\n\n\t\tSystem.out.println(\"The Peek value is: \" + arrayValues[topOfStack]);\n\n\t}" ]
[ "0.7281107", "0.7253796", "0.72095114", "0.71250653", "0.71239763", "0.7062571", "0.70343804", "0.7018798", "0.70167124", "0.69771993", "0.6910599", "0.689175", "0.68803984", "0.6874785", "0.6861691", "0.68421793", "0.68153787", "0.6797689", "0.6767923", "0.67452383", "0.67281646", "0.67040306", "0.66933686", "0.6681738", "0.66761076", "0.6669662", "0.6664866", "0.6646663", "0.6628774", "0.6624208", "0.6622175", "0.6617844", "0.6615207", "0.6595545", "0.6594268", "0.65801436", "0.657909", "0.65703905", "0.654134", "0.65293026", "0.6527669", "0.6518817", "0.65143716", "0.6509014", "0.6503076", "0.6499004", "0.64964366", "0.6490171", "0.6478146", "0.6475876", "0.64733183", "0.6462079", "0.6462079", "0.6462079", "0.6456193", "0.6447467", "0.6439791", "0.6436035", "0.64329284", "0.64310503", "0.64192754", "0.6416399", "0.63868916", "0.6377451", "0.63740706", "0.6356164", "0.6351388", "0.6347819", "0.63402444", "0.6338381", "0.632701", "0.63213015", "0.6316955", "0.6306795", "0.6301695", "0.6296784", "0.6292821", "0.62923527", "0.6291399", "0.628637", "0.62850326", "0.62553746", "0.6247507", "0.6221128", "0.6215967", "0.62155193", "0.6201777", "0.61971396", "0.61957824", "0.6194202", "0.61763746", "0.6143261", "0.61357516", "0.61322814", "0.6125742", "0.6103346", "0.6100034", "0.6099919", "0.60966027", "0.60851306", "0.60748005" ]
0.0
-1
~ Constructors Creates a new directed weighted flow graph.
public DefaultDirectedWeightedFlowGraph(Class<? extends E> edgeClass) { this(new ClassBasedEdgeFactory<V, E>(edgeClass)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WeightedGraph() {\n super();\n }", "public DefaultDirectedWeightedFlowGraph(DefaultDirectedWeightedGraph<V, E> dWG) {\r\n this.graph = dWG;\r\n\r\n }", "public WeightedAdjacencyGraph() {\n this.vertices = new HashMap<>();\n }", "public DefaultDirectedWeightedFlowGraph(EdgeFactory<V, E> ef) {\r\n this.graph = new DefaultDirectedWeightedGraph(ef);\r\n\r\n }", "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph() {\r\n\t\treturn createGraph(goapUnit.getGoalState());\r\n\t}", "public DirectedEdge(int from, int to, double weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public weighted_graph copy();", "public WeightedEdge(){\n\t\t\n\t}", "public WeightedDiGraphAPI() {\r\n\t\tthis.mVisitStatus = new HashMap<Integer,Boolean>();\r\n\t\tthis.mVertexList = new TreeSet<Integer>();\r\n\t\tthis.mEdgeList = new PriorityQueue<DirectedEdge>();\r\n\t\tthis.adjList = new HashMap<Integer,List<DirectedEdge>>();\r\n\t\tthis.mMSTedgeList = new ArrayList<DirectedEdge>();\r\n\t}", "public Edge(Node source, Node sink, Object weight) {\n\t\tthis(source, sink);\n\t\tsetWeight(weight);\n\t}", "public static void exampleWeightedGraph() {\n\t\t\n\t\t// create unidrected topology\n\t\tTopology topology = new Topology();\n\t\t\n\t\t// Create edge with high weight and edge with low weight\n\t\tEdge edgeHighWeight = new Edge();\n\t\tedgeHighWeight.setWeight(1000);\n\t\t\n\t\tEdge edgeLowWeight = new Edge();\n\t\tedgeLowWeight.setWeight(1);\n\t\t\n\t\t// Assign edges to topology\n\t\ttopology.addEdge(\"1\", \"4\", edgeHighWeight);\n\t\ttopology.addEdge(\"2\", \"3\", edgeLowWeight);\n\t\ttopology.addEdge(\"1\", \"2\", edgeLowWeight);\n\t\ttopology.addEdge(\"4\", \"3\", edgeLowWeight);\n\t\t\n\t\t// convert to JGraphT\n\t\tWeightedGraph<String, DefaultWeightedEdge> graph = \n\t\t\t\tJGraphTConverter.getWeightedGraph(topology);\n\t\t\n\t\t// Find shortest paths\n\t\tString source = \"1\";\n\t\tString destination = \"3\";\n\t\tList<DefaultWeightedEdge> sp = \n\t\t\t\tDijkstraShortestPath.findPathBetween(graph, source, destination);\n\t\t\n\t\t// Print results\n\t\tSystem.out.println(\"Shortest path from \" + source + \" to \" + destination + \":\");\n\t\tfor (DefaultWeightedEdge e : sp) {\n\t\t\tSystem.out.println(graph.getEdgeSource(e) + \" -> \" + graph.getEdgeTarget(e));\n\t\t}\n\t}", "public weighted_graph getGraph();", "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph(List<GoapState> goalState) {\r\n\t\tIWeightedGraph<GraphNode, WeightedEdge> generatedGraph = this.generateGraphObject();\r\n\r\n\t\taddVertices(generatedGraph, goalState);\r\n\t\taddEdges(generatedGraph);\r\n\r\n\t\treturn generatedGraph;\r\n\t}", "public DFSGraph() {\n this(new HashMap<>(), HashMap::new, HashSet::new, HashSet::new);\n }", "public Graph() {\n }", "public WeightedAdjMatGraph(){\n this.edges = new int[DEFAULT_CAPACITY][DEFAULT_CAPACITY];\n this.n = 0;\n this.vertices = (T[])(new Object[DEFAULT_CAPACITY]);\n }", "public static Graph<Vertex,Edge> createGraphObject()\n\t{\n\t\tGraph<Vertex,Edge> g = new DirectedSparseMultigraph<Vertex, Edge>();\n\t\treturn g;\n\t}", "public Edge(Node from, Node to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public Edge(int source, int dest, int weight){\n\t\tthis.source = source;\n\t\tthis.dest = dest;\n\t\tthis.weight = weight;\n\t}", "public FlowNetwork(int V) {\n this.V = V-1;\n adj = (List<FlowEdge>[]) new List[V];\n for (int v=0; v < V; v++)\n adj[v] = new ArrayList<>();\n }", "public Edge(Object vertex1, Object vertex2, int w){\n v1 = vertex1;\n v2 = vertex2;\n weight = w;\n }", "public ListenableUndirectedWeightedGraph(WeightedGraph<V, E> base)\r\n/* */ {\r\n/* 81 */ super((UndirectedGraph)base);\r\n/* */ }", "public Edge(L source,L target,Integer weight) {\r\n \tsou=source;\r\n \ttar=target;\r\n \twei=weight;\r\n \tcheckRep();\r\n }", "public DSAGraph()\n\t{\n\t\tvertices = new DSALinkedList();\n\t\tedgeCount = 0;\n\t}", "public GraphEdge()\r\n {\r\n cost = 1.0;\r\n indexFrom = -1;\r\n indexTo = -1;\r\n }", "public static weighted_graph graphCreator(int node_size, int edge_size) {\n weighted_graph ga = new WGraph_DS();\n for (int i = 0; i < node_size; i++) {\n ga.addNode(i);\n }\n for (int i = 0; i < edge_size; i++) {\n double weight = Math.random();\n int vertex1 = (int) (Math.random() * node_size);\n int vertex2 = (int) (Math.random() * node_size);\n ga.connect(vertex1,vertex2,weight);\n }\n return ga;\n }", "public DirectedAcyclicGraphImpl() {\r\n super();\r\n topologicalsorting = new TopologicalSorting( this );\r\n }", "public Graph() {\r\n\t\tinit();\r\n\t}", "public Edge(int from, int to, Integer weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "@Override\n\tpublic directed_weighted_graph copy() {\n\t\tdirected_weighted_graph copy = new DWGraph_DS();\n\t\tCollection<node_data> vertex = dwg.getV();\n\t\tfor (node_data v : vertex) {\n\t\t\tNodeData ver = new NodeData(v.getKey(), v.getLocation(), v.getWeight());\n\t\t\tcopy.addNode(ver);// Add node\n\t\t\tcopy.getNode(v.getKey()).setInfo(v.getInfo());// Set info to node\n\t\t\tcopy.getNode(v.getKey()).setTag(v.getTag());// Set tag to node\n\t\t}\n\n\t\tfor (node_data n : vertex) {\n\t\t\tCollection<edge_data> edges = dwg.getE(n.getKey());\n\t\t\tif (edges != null) {\n\t\t\t\tfor (edge_data e : edges) {// Add all edges (0 or more) by connecting key,dest and weight\n\t\t\t\t\tcopy.connect(e.getSrc(), e.getDest(), e.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}", "public Edge(int from, int to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public WeightingModel(){}", "public Graph(boolean p_isDirectedGraph) {\n\t\tisDirectedGraph = p_isDirectedGraph;\n\t}", "public AtomGraph(IAtomContainer container, boolean weighted) {\n this();\n adjacencyMatrix = new AdjacencyAtomMatrix(container.getAtomCount());\n setAtomContainer(container, weighted);\n }", "public static EdgeWeightedDigraph createTestDigraph() {\n\n final int weight = 1; // Constant weight used.\n\n EdgeWeightedDigraph testGraph = new EdgeWeightedDigraph();\n testGraph.addEdge(new DirectedEdge(1, 2, weight));\n testGraph.addEdge(new DirectedEdge(2, 3, weight));\n testGraph.addEdge(new DirectedEdge(2, 4, weight));\n testGraph.addEdge(new DirectedEdge(3, 5, weight));\n testGraph.addEdge(new DirectedEdge(3, 8, weight));\n testGraph.addEdge(new DirectedEdge(4, 5, weight));\n testGraph.addEdge(new DirectedEdge(4, 8, weight));\n testGraph.addEdge(new DirectedEdge(6, 7, weight));\n testGraph.addEdge(new DirectedEdge(7, 4, weight));\n return testGraph;\n }", "public WeightedGraph(List<E> v, List<WeightedEdge> edges) {\n this();\n for (E e : v) {\n addVertex(e);\n }\n for (WeightedEdge e : edges) {\n addEdge(e);\n }\n }", "public interface WeightedGraph<V,E extends WeightedEdge<V>> extends Graph<V,E> {\n/**\n * Uses the\n * Floyd-Warshall all-pairs shortest path algorithm to compute and return a shortest\n * path matrix.\n**/\n\n\tpublic ShortestPathMatrix<V,E> allPairsShortestPaths();\n/**\n * Uses\n * the Bellman-Ford shortest path algorithm to compute and return a shortest path tree\n * for the given source vertex. This algorithm will yield the correct answer if there are\n * negative weight edges, provided that there is no negative weight cycle.\n**/\n\n\tpublic InTree<V,E> generalShortestPathFromSource(V source);\n/**\n * Uses Kruskal's minimum spanning tree to\n * return a set of edges that form a minimum spanning tree for this graph.\n * It throws a <code>DisconnectedGraphException</code> when the graph is not connected,\n * a <code>NegativeWeightEdgeException</code> when a negative weight edge\n * is encountered, and a <code>GraphException</code> when the graph is directed.\n**/\n\n\tpublic Set<E> kruskalMST() throws NegativeWeightEdgeException, DisconnectedGraphException;\n/**\n * Uses the\n * Edmonds-Karp implementation of the basic Ford-Fulkerson augmenting path\n * method to find a maximum flow (and a minimum cut) for the flow network\n * defined by the provided source and sink.\n**/\n\n\tpublic AbstractWeightedGraph<V,E>.FlowGraph maximumFlow(V source, V sink);\n/**\n * Uses Prim's minimum spanning tree to\n * return a set of edges that forms a minimum spanning tree for this graph.\n * It throws a <code>DisconnectedGraphException</code> when the graph is not connected,\n * a <code>NegativeWeightEdgeException</code> when a negative weight edge\n * is encountered, and an <code>IllegalArgumentException</code> when the graph is directed.\n**/\n\n\tpublic Set<E> primMST() throws NegativeWeightEdgeException, DisconnectedGraphException;\n/**\n * Uses\n * Dijkstra's shortest path algorithm to compute and return a shortest path tree\n * for the given source vertex. It throws a <code>NegativeWeightEdgeException</code> when the\n * graph has a negative weight edge reachable from the source.\n**/\n\n\tpublic InTree<V,E> weightedShortestPaths(V source)\n\t\tthrows NegativeWeightEdgeException, DisconnectedGraphException;\n}", "public EdgeImpl(Vertex sourceVertex, Vertex targetVertex, double edgeWeight, Graph graph) {\n this.sourceVertex = sourceVertex;\n this.targetVertex = targetVertex;\n this.edgeWeight = edgeWeight;\n this.graph = graph;\n }", "public Edge(int weight){\n\t\tthis.EDGE_ID = IDToGive;\n\t\tthis.edgeWeight = weight;\n\t\tIDToGive++;\n\t}", "public PlainGraph createGraph() {\n PlainGraph graph = new PlainGraph(getUniqueGraphName(), GraphRole.RULE);\n graphNodeMap.put(graph, new HashMap<>());\n return graph;\n }", "@Override\n\tpublic void init(directed_weighted_graph g) {\n\t\tthis.dwg = g;\n\t}", "public Edge(int start, int end, int weight) {\n this.startVertex = start;\n this.endVertex = end;\n this.weight = weight;\n }", "public void init(weighted_graph g);", "public Edge(Vertex from, Vertex to, int capacity){\r\n this.from = from;\r\n this.to = to;\r\n this.capacity = capacity;\r\n flow = 0;\r\n\r\n }", "Edge(Node from,Node to, int length){\n this.source=from;\n this.destination=to;\n this.weight=length;\n }", "public FlowNodeInstance() {\n\t}", "public interface weighted_graph_algorithms {\r\n /**\r\n * Init the graph on which this set of algorithms operates on.\r\n * @param g\r\n */\r\n public void init(weighted_graph g);\r\n\r\n /**\r\n * Return the underlying graph of which this class works.\r\n * @return\r\n */\r\n public weighted_graph getGraph();\r\n /**\r\n * Compute a deep copy of this weighted graph.\r\n * @return\r\n */\r\n public weighted_graph copy();\r\n /**\r\n * Returns true if and only if (iff) there is a valid path from EVREY node to each\r\n * other node. NOTE: assume ubdirectional graph.\r\n * @return\r\n */\r\n public boolean isConnected();\r\n /**\r\n * returns the length of the shortest path between src to dest\r\n * Note: if no such path --> returns -1\r\n * @param src - start node\r\n * @param dest - end (target) node\r\n * @return\r\n */\r\n public double shortestPathDist(int src, int dest);\r\n /**\r\n * returns the the shortest path between src to dest - as an ordered List of nodes:\r\n * src--> n1-->n2-->...dest\r\n * see: https://en.wikipedia.org/wiki/Shortest_path_problem\r\n * Note if no such path --> returns null;\r\n * @param src - start node\r\n * @param dest - end (target) node\r\n * @return\r\n */\r\n public List<node_info> shortestPath(int src, int dest);\r\n\r\n /**\r\n * Saves this weighted (undirected) graph to the given\r\n * file name\r\n * @param file - the file name (may include a relative path).\r\n * @return true - iff the file was successfully saved\r\n */\r\n public boolean save(String file);\r\n\r\n /**\r\n * This method load a graph to this graph algorithm.\r\n * if the file was successfully loaded - the underlying graph\r\n * of this class will be changed (to the loaded one), in case the\r\n * graph was not loaded the original graph should remain \"as is\".\r\n * @param file - file name\r\n * @return true - iff the graph was successfully loaded.\r\n */\r\n public boolean load(String file);\r\n}", "public Graph() {\r\n\t\tthis.matrix = new Matrix();\r\n\t\tthis.listVertex = new ArrayList<Vertex>();\r\n\t}", "public WeightedGraph(List<K> v)\n\t{\n\t // make ourselves a private copy of the vertex set\n\t verts = new HashSet<K>(v);\n\n\t // set up empty adkacency lists for each vertex\n\t adjLists = new HashMap<K, List<HashMap<K, Integer>>>();\n\t for (K src : verts)\n\t\t{\n\t\t adjLists.put(src, new ArrayList<HashMap<K, Integer>>());\n\t\t}\n\t}", "public DijkstraAlg(){\n \n }", "@Override\r\n public void init(weighted_graph g) {\r\n this.Graph = g;\r\n }", "public WGraph_DS()\n {\n modeCount=0;\n edges=0;\n HashMap<Integer,node_info>nodesHash=new HashMap<>();\n HashMap<Integer,Neighbors>edgesHash=new HashMap<>();\n }", "@SuppressWarnings(\"rawtypes\")\r\n\tpublic Graph() {\r\n \tthis.vertex = new HashMap<T, Vertex>();\r\n \tthis.edge = new HashMap<Integer, Edge>();\r\n }", "public WeightedGraph(Collection<K> v)\n {\n\t // make ourselves a private copy of the vertex set\n verts = new HashSet<K>(v);\n\n\t // set up empty adjacency lists for each vertex\n adjMaps = new HashMap<K, Map<K, Edge>>();\n for (K src : verts)\n {\n Map<K, Edge> adjMap = new HashMap<K, Edge>();\n adjMaps.put(src, adjMap);\n }\n }", "public Graph()\r\n\t{\r\n\t\tthis.adjacencyMap = new HashMap<String, HashMap<String,Integer>>();\r\n\t\tthis.dataMap = new HashMap<String,E>();\r\n\t}", "public Edge(int start, int end, int weight) {\n this.start = start;\n this.end = end;\n this.weight = weight;\n }", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "public Graph(){\n\t\tthis.sizeE = 0;\n\t\tthis.sizeV = 0;\n\t}", "public MultiGraph(boolean directed) {\r\n\t\tsuper(directed ? Type.DIRECTED : Type.UNDIRECTED);\r\n\t}", "public Graph() {\n\t\tdictionary=new HashMap<>();\n\t}", "@SuppressWarnings(\"unchecked\")\n\tprivate DirectedGraph getGraph() {\n\n\t\tNode node1, node2, node3, node4, node5;\n\t\tEdge edge1, edge2, edge3, edge4;\n\n\t\tNodeList nodes = new NodeList();\n\t\tEdgeList edges = new EdgeList();\n\n\t\t// create Node\n\t\tnode1 = new Node(\"Node1\");\n\t\tnodes.add(node1);\n\t\tnode2 = new Node(\"Node2\");\n\t\tnodes.add(node2);\n\t\tnode3 = new Node(\"Node3\");\n\t\tnodes.add(node3);\n\t\tnode4 = new Node(\"Node4\");\n\t\tnodes.add(node4);\n\t\tnode5 = new Node(\"Node5\");\n\t\tnodes.add(node5);\n\n\t\t// create Edge\n\t\tedge1 = new Edge(node1, node2);\n\t\tedges.add(edge1);\n\t\tedge2 = new Edge(node1, node3);\n\t\tedges.add(edge2);\n\t\tedge3 = new Edge(node2, node4);\n\t\tedges.add(edge3);\n\t\tedge4 = new Edge(node4, node5);\n\t\tedges.add(edge4);\n\n\t\tDirectedGraph graph = new DirectedGraph();\n\t\tgraph.nodes = nodes;\n\t\tgraph.edges = edges;\n\n\t\t// set Layout of the graph (Compute and Set the x,y of each Node)\n\t\tnew DirectedGraphLayout().visit(graph);\n\n\t\treturn graph;\n\t}", "public DirectedEdge(int v, int w, int distance, double cost) {\n if (v < 0)\n throw new IndexOutOfBoundsException(\"Must be postive integers!\");\n if (w < 0)\n throw new IndexOutOfBoundsException(\"Must be postive integers!\");\n if (Double.isNaN(cost))\n throw new IllegalArgumentException(\"Weight is NaN\");\n this.v = v;\n this.w = w;\n this.setCost(cost);\n this.setDistance(distance);\n }", "protected GraphNode() {\n }", "protected GraphNode() {\n }", "public Edge (Vertex from, Vertex to) {\r\n this.from = from;\r\n this.to = to;\r\n capacity = 0;\r\n flow = 0;\r\n }", "public static Graph createGraph(int V, int E, boolean weighted) throws IllegalArgumentException {\r\n\t\tRandom rand = new Random();\r\n\t\tif (E < V || E > (V*(V-1))) {\r\n\t\t\tthrow new IllegalArgumentException(\"To many/few edges!\");\r\n\t\t}\r\n\t\t\r\n\t\tGraph g = new Graph(V);\r\n\t\t\r\n\t\t/* Unweighted graph*/\r\n\t\tif (weighted == false) {\r\n\t\t\tfor (int i = 0; i < g.V; i++) {\r\n\t\t\t\tif(!g.addRandomEdge(i, rand.nextInt(V), 1)) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tif(g.addRandomEdge(rand.nextInt(V), rand.nextInt(V), 1)) {E--;}\r\n\t\t\t}\r\n\t\t/* Weighted graph*/\t\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < g.V; i++) {\r\n\t\t\t\tif(!g.addRandomEdge(i, rand.nextInt(V), rand.nextInt(20))) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tif (g.addRandomEdge(rand.nextInt(V), rand.nextInt(V), rand.nextInt(20))) {E--;}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn g;\r\n\t}", "public:\n Graph(int V); // Constructor\n void addEdge(int v, int w);", "Graph(){\n\t\tadjlist = new HashMap<String, Vertex>();\n\t\tvertices = 0;\n\t\tedges = 0;\n\t\tkeys = new ArrayList<String>();\n\t}", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "public static Graph buildGraph1() {\n Graph g = new Graph(\"Undirected graph For Kruskal Algorithm\");\n g.addEdge(\"A\", \"E\", 5);\n g.addEdge(\"A\", \"D\", 3);\n g.addEdge(\"A\", \"H\", 7);\n g.addEdge(\"A\", \"B\", 6);\n g.addEdge(\"D\", \"E\", 9);\n g.addEdge(\"D\", \"C\", 12);\n g.addEdge(\"C\", \"B\", 20);\n g.addEdge(\"B\", \"F\", 15);\n g.addEdge(\"F\", \"G\", 17);\n g.addEdge(\"G\", \"H\", 1);\n\n g.sortEdgesByIncreasingWeights();\n\n System.out.println(g);\n\n return g;\n }", "public AdjacencyListGraph(boolean isDirected) {\r\n\t\tthis.isDirected = isDirected;\r\n\t\tvertices = new HashMap<>();\r\n\t\tadjacencyLists = new HashMap<>();\r\n\t}", "public FlowRule() {\r\n }", "public Road(Town source, Town destination, int weight, String name) {\r\n\t\tthis.source = source;\r\n\t\tthis.destination = destination;\r\n\t\tthis.vertices = new HashSet<Town>();\r\n\t\tvertices.add(source);\r\n\t\tvertices.add(destination);\r\n\t\t\r\n\t\tthis.weight = weight;\r\n\t\tthis.name = name;\r\n\t\t\r\n\t}", "public Graph(int V, int E) {\n this(V);\n if (E < 0) throw new RuntimeException(\"Number of edges must be nonnegative\");\n for (int i = 0; i < E; i++) {\n int v = (int) (Math.random() * V);\n int w = (int) (Math.random() * V);\n double weight = Math.round(100 * Math.random()) / 100.0;\n Edge e = new Edge(v, w, weight,0);\n //addEdge(e);\n }\n }", "public Graph(int numberOfVertices){\r\n this.numberOfVertices = numberOfVertices;\r\n this.adjacencyList = new TreeMap<>();\r\n }", "public Builder() {\n this(Graphs.<N, E>createUndirected());\n }", "public Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "public AtomGraph(IAtomContainer container, IAtomContainer skipVertices, boolean weighted) {\n this();\n adjacencyMatrix = new AdjacencyAtomMatrix(container.getAtomCount());\n for (IAtom atom : skipVertices.atoms()) {\n this.skipVertices.add(atom);\n }\n setAtomContainer(container, weighted);\n }", "public Graphs() {\n graph = new HashMap<>();\n }", "public Graph()\n\t{\n\t\tthis.total_verts = null;\n\t\tthis.total_edges = null;\n\t\tnodes = new HashMap<String, Node>();\n\t}", "public Dijkstra(Graph graph)\n\t{\n\t\tthis.listNode = graph.getListNode();\n\t\tthis.listEdge = graph.getListEdge();\n\t}", "public Graph() {\n\t\ttowns = new HashSet<Town>();\n\t\troads = new HashSet<Road>();\n\t\tprevVertex = new HashMap<String, Town>();\n\t}", "public AtomGraph(IAtomContainer container, IAtomContainerSet skipVertices, boolean weighted) {\n this();\n adjacencyMatrix = new AdjacencyAtomMatrix(container.getAtomCount());\n for (IAtomContainer ac : skipVertices.atomContainers()) {\n for (IAtom atom : ac.atoms()) {\n this.skipVertices.add(atom);\n }\n }\n setAtomContainer(container, weighted);\n }", "@Override\n public directed_weighted_graph copy() {\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(G);\n oos.flush();\n oos.close();\n bos.close();\n byte[] byteData = bos.toByteArray();\n\n ByteArrayInputStream bis = new ByteArrayInputStream(byteData);\n return (directed_weighted_graph) (new ObjectInputStream(bis).readObject());\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "void addEdge(int source, int destination, int weight);", "private KeyedGraph<VWBetw, Edge> prepareGraph(final DataSet edges) {\n KeyedGraph<VWBetw, Edge> graph;\n \n // Get the graph orientation.\n int graphType = -1;\n if (globalOrientation != null) {\n graphType = globalOrientation.equalsIgnoreCase(DIRECTED)\n ? GraphSchema.DIRECT\n : globalOrientation.equalsIgnoreCase(REVERSED)\n ? GraphSchema.DIRECT_REVERSED\n : globalOrientation.equalsIgnoreCase(UNDIRECTED)\n ? GraphSchema.UNDIRECT\n : -1;\n } else if (graphType == -1) {\n LOGGER.warn(\"Assuming a directed graph.\");\n graphType = GraphSchema.DIRECT;\n }\n \n // Create the graph.\n if (weightsColumn != null) {\n graph = new WeightedGraphCreator<VWBetw, Edge>(\n edges,\n graphType,\n edgeOrientationColumnName,\n VWBetw.class,\n Edge.class,\n weightsColumn).prepareGraph();\n } else {\n throw new UnsupportedOperationException(\n \"ST_Distance has not yet been implemented for \"\n + \"unweighted graphs.\");\n }\n return graph;\n }", "@Override\n\tpublic void connect(int src, int dest, double w) {\n\t\tif(w<=0)\n\t\t{\n\t\t\tSystem.err.println(\"The weight must be positive! . connect failed\");\n\t\t\treturn;\n\t\t}\n\t\tEdgeData e = new EdgeData(src, dest, w);\n\t\tif (!Nodes.containsKey(src) || !Nodes.containsKey(dest)) {\n\t\t\tSystem.err.println(\"can't connect\");\n\t\t\treturn;\n\t\t}\n\t\tEdges.get(src).put(dest, e);\n\t\tnumOfEdges++;\n\t\tMC++;\n\t}", "Flow createFlow();", "public EdgeWeightedDigraph(int V) \n {\n if (V < 0) throw new RuntimeException(\"Number of vertices must be nonnegative\");\n this.V = V;\n this.E = 0;\n adj = (ArrayList<DirectedEdge>[]) new ArrayList[V];\n for (int v = 0; v < V; v++)\n adj[v] = new ArrayList<DirectedEdge>();\n }", "protected AbstractTreeAdjacencyGraph()\n\t{\n\t\tsuper();\n\t}", "Node(Vertex x,int w)\n\t{\n\t\tv=x;\n\t\tweight=w;\n\t}", "public PetriNet createSimplePetriNet(int tokenWeight) throws PetriNetComponentException {\n String arcWeight = Integer.toString(tokenWeight);\n return APetriNet.with(AToken.called(\"Default\").withColor(Color.BLACK)).and(\n APlace.withId(\"P1\").containing(1, \"Default\").token()).and(APlace.withId(\"P2\")).and(\n AnImmediateTransition.withId(\"T1\")).and(\n ANormalArc.withSource(\"P1\").andTarget(\"T1\").with(arcWeight, \"Default\").tokens()).andFinally(\n ANormalArc.withSource(\"T1\").andTarget(\"P2\").with(arcWeight, \"Default\").tokens());\n }", "@SuppressWarnings(\"unchecked\")\n\tEdgeWeightedGraph(int V)\n\t{\n\t\tthis.V=V;\n\t\tadj=(Bag<Edge>[]) new Bag[V];\n\t\tfor(int v=0;v<V;v++)\n\t\t\tadj[v]=new Bag<Edge> ();\n\t}", "public Graph<String, DefaultWeightedEdge> loadGraphFrom(String filepath) throws FileNotFoundException{\n\t\tif (!isGraphFile(filepath)){\n\t\t\tthrow new IllegalArgumentException(\"'\" + filepath + \"' is not a .graph file\");\n\t\t}\n\t\t\n\t\tFile file = new File(filepath);\n\t\tScanner graphdata;\n\t\t\n\t\t//wirft eine FileNotFoundException, wenn File nicht vorhanden\n\t\tgraphdata = new Scanner(file);\n\n\t\tWeightedGraph<String, DefaultWeightedEdge> graph = new DirectedWeightedMultigraph<String, DefaultWeightedEdge>(DefaultWeightedEdge.class);\n\t\tDefaultWeightedEdge aktEdge;\n\t\t\n\n\t\t//Graph einlesen:\n\t\twhile(graphdata.hasNext()){\n\t\t\tString aktSting = graphdata.next().trim();\n\t\t\t\t\t\t\t\t\n\t\t\tString[] aktAry = aktSting.split(\",\");\n\t\t\tString ecke1 = aktAry[0].trim();\n\t\t\tString ecke2 = aktAry[1].trim();\n\t\t\tDouble weight = Double.parseDouble(aktAry[2].trim());\n\t\t\tif(!graph.containsVertex(ecke1)){\n\t\t\t\tgraph.addVertex(ecke1);\n\t\t\t}\n\t\t\tif(!graph.containsVertex(ecke2)){\n\t\t\t\tgraph.addVertex(ecke2);\n\t\t\t}\n\t\t\t\n\t\t\tif (!graph.containsEdge(ecke1, ecke2)){\n\t\t\t\taktEdge = graph.addEdge(ecke1, ecke2);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, weight);\n\t\t\t\taktEdge = graph.addEdge(ecke2, ecke1);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, weight);\n\t\t\t}else{\n\t\t\t\taktEdge = graph.getEdge(ecke1, ecke2);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, graph.getEdgeWeight(aktEdge) + weight);\n\t\t\t\taktEdge = graph.getEdge(ecke2,ecke1);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, graph.getEdgeWeight(aktEdge) + weight);\n\t\t\t}\n\t\t}\n\t\treturn graph;\n\t}", "Graph(){\n\t\taddNode();\n\t\tcurrNode=myNodes.get(0);\n\t}", "public GraphWrapper() {\n\t\tthis.graph = new Graph<T,E>();\n\t}", "@Override\n public Graph newInstance(int vertexesCount) {\n return new SimpleGraph();\n }", "public UnmodifiableDirectedGraph(DirectedGraph<V, E> g)\n {\n super(g);\n }", "public Graph()\n\t{\n\t\tthis.map = new HashMap<Object, SinglyLinkedList>();\n\t}" ]
[ "0.7402975", "0.6924529", "0.68496126", "0.6738611", "0.67231345", "0.65552354", "0.65497345", "0.6524515", "0.646255", "0.64276314", "0.62582934", "0.6180722", "0.61288935", "0.61229056", "0.6118345", "0.60950845", "0.60909027", "0.609054", "0.6055488", "0.6036396", "0.6029305", "0.6017958", "0.6014623", "0.6012844", "0.6005306", "0.6004145", "0.60018986", "0.59775966", "0.59765136", "0.59501725", "0.59489375", "0.5942367", "0.5941538", "0.59382933", "0.59322375", "0.59210813", "0.5913973", "0.590611", "0.58998036", "0.58979243", "0.58777106", "0.58510464", "0.5838669", "0.58259076", "0.5812381", "0.5810107", "0.5776396", "0.5769193", "0.57563317", "0.5753304", "0.57531863", "0.57529", "0.57486033", "0.5736723", "0.57362133", "0.5732812", "0.5726816", "0.5721863", "0.5715552", "0.5713325", "0.57057977", "0.5704957", "0.5684021", "0.5684021", "0.5683341", "0.5669551", "0.56613505", "0.5657695", "0.56545717", "0.5649441", "0.5642038", "0.56245846", "0.5618996", "0.5612186", "0.55986315", "0.55951923", "0.5588078", "0.5581508", "0.5570505", "0.55539966", "0.5545013", "0.5533183", "0.55232775", "0.5519622", "0.5514795", "0.5513207", "0.55113727", "0.551043", "0.55022764", "0.550135", "0.54968506", "0.5493704", "0.5478443", "0.54761714", "0.5475674", "0.54740834", "0.5468678", "0.54653466", "0.5462105", "0.5461408" ]
0.6474125
8
Creates a new directed weighted flow graph with the specified edge factory.
public DefaultDirectedWeightedFlowGraph(EdgeFactory<V, E> ef) { this.graph = new DefaultDirectedWeightedGraph(ef); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static final Factory<Edge> getFactory() {\r\n\t\treturn new Factory<Edge> () {\r\n\t\t\tprivate int nextId = 0;\r\n\t\t\tpublic Edge create() {\r\n\t\t\t\treturn new Edge(nextId++);\r\n\t\t\t}\r\n\t\t};\r\n\t}", "Edge createEdge(Vertex src, Vertex tgt, boolean directed);", "public DefaultDirectedWeightedFlowGraph(Class<? extends E> edgeClass) {\r\n this(new ClassBasedEdgeFactory<V, E>(edgeClass));\r\n }", "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph() {\r\n\t\treturn createGraph(goapUnit.getGoalState());\r\n\t}", "public static EdgeWeightedDigraph createTestDigraph() {\n\n final int weight = 1; // Constant weight used.\n\n EdgeWeightedDigraph testGraph = new EdgeWeightedDigraph();\n testGraph.addEdge(new DirectedEdge(1, 2, weight));\n testGraph.addEdge(new DirectedEdge(2, 3, weight));\n testGraph.addEdge(new DirectedEdge(2, 4, weight));\n testGraph.addEdge(new DirectedEdge(3, 5, weight));\n testGraph.addEdge(new DirectedEdge(3, 8, weight));\n testGraph.addEdge(new DirectedEdge(4, 5, weight));\n testGraph.addEdge(new DirectedEdge(4, 8, weight));\n testGraph.addEdge(new DirectedEdge(6, 7, weight));\n testGraph.addEdge(new DirectedEdge(7, 4, weight));\n return testGraph;\n }", "public static weighted_graph graphCreator(int node_size, int edge_size) {\n weighted_graph ga = new WGraph_DS();\n for (int i = 0; i < node_size; i++) {\n ga.addNode(i);\n }\n for (int i = 0; i < edge_size; i++) {\n double weight = Math.random();\n int vertex1 = (int) (Math.random() * node_size);\n int vertex2 = (int) (Math.random() * node_size);\n ga.connect(vertex1,vertex2,weight);\n }\n return ga;\n }", "GraphFactory getGraphFactory();", "Flow createFlow();", "Flows createFlows();", "private Shape createEdge() {\n\t\tEdge edge = (Edge)shapeFactory.getShape(ShapeFactory.EDGE);\n\t\tEdgeLabel edgeLabel = (EdgeLabel) shapeFactory.getShape(ShapeFactory.EDGE_LABEL);\n\t\tedgeLabel.setEdge(edge);\n\t\tedge.setEdgeLabel(edgeLabel);\n\t\tshapes.add(edgeLabel);\n\t\tadd(edgeLabel);\n\t\treturn edge;\n\t}", "private IEdge<S> createEdge(final S symbol_, final Integer state_)\n\t{\n\t\treturn new Edge<>(symbol_, state_);\n\t}", "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph(List<GoapState> goalState) {\r\n\t\tIWeightedGraph<GraphNode, WeightedEdge> generatedGraph = this.generateGraphObject();\r\n\r\n\t\taddVertices(generatedGraph, goalState);\r\n\t\taddEdges(generatedGraph);\r\n\r\n\t\treturn generatedGraph;\r\n\t}", "void addEdge(int source, int destination, int weight);", "public PlainGraph createGraph() {\n PlainGraph graph = new PlainGraph(getUniqueGraphName(), GraphRole.RULE);\n graphNodeMap.put(graph, new HashMap<>());\n return graph;\n }", "public static GraphEdge createGraphEdgeForEdge() {\n GraphEdge graphEdge = new GraphEdge();\n\n for (int i = 0; i < 2; i++) {\n GraphNode childNode = new GraphNode();\n childNode.setPosition(AccuracyTestHelper.createPoint(20 * i, 10));\n childNode.setSize(AccuracyTestHelper.createDimension(40, 12));\n graphEdge.addContained(childNode);\n }\n graphEdge.addWaypoint(AccuracyTestHelper.createDiagramInterchangePoint(100, 100));\n graphEdge.addWaypoint(AccuracyTestHelper.createDiagramInterchangePoint(250, 200));\n\n // create a Relationship\n Relationship relationship = new IncludeImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(relationship);\n\n graphEdge.setSemanticModel(semanticModel);\n\n return graphEdge;\n }", "public Edge createEdge(String description, int sourceId, int destId, int weight) throws SQLException {\n\t\tVertex source = findVertById(sourceId);\n\t\tVertex destination = findVertById(destId);\n\t\tEdge newEdge = new Edge(description, weight, destination, source);\n\t\treturn rDb.createEdge(newEdge);\n\t}", "FlowType createFlowType();", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "private KeyedGraph<VWBetw, Edge> prepareGraph(final DataSet edges) {\n KeyedGraph<VWBetw, Edge> graph;\n \n // Get the graph orientation.\n int graphType = -1;\n if (globalOrientation != null) {\n graphType = globalOrientation.equalsIgnoreCase(DIRECTED)\n ? GraphSchema.DIRECT\n : globalOrientation.equalsIgnoreCase(REVERSED)\n ? GraphSchema.DIRECT_REVERSED\n : globalOrientation.equalsIgnoreCase(UNDIRECTED)\n ? GraphSchema.UNDIRECT\n : -1;\n } else if (graphType == -1) {\n LOGGER.warn(\"Assuming a directed graph.\");\n graphType = GraphSchema.DIRECT;\n }\n \n // Create the graph.\n if (weightsColumn != null) {\n graph = new WeightedGraphCreator<VWBetw, Edge>(\n edges,\n graphType,\n edgeOrientationColumnName,\n VWBetw.class,\n Edge.class,\n weightsColumn).prepareGraph();\n } else {\n throw new UnsupportedOperationException(\n \"ST_Distance has not yet been implemented for \"\n + \"unweighted graphs.\");\n }\n return graph;\n }", "MakeflowFactory getMakeflowFactory();", "public DAGTransformation(T outputGraph,\r\n\t\t\tModelVertexFactory<DAGVertex> vertexFactory) {\r\n\t\tthis.outputGraph = outputGraph;\r\n\t\tfactory = vertexFactory;\r\n\t}", "public static Graph createGraph(int V, int E, boolean weighted) throws IllegalArgumentException {\r\n\t\tRandom rand = new Random();\r\n\t\tif (E < V || E > (V*(V-1))) {\r\n\t\t\tthrow new IllegalArgumentException(\"To many/few edges!\");\r\n\t\t}\r\n\t\t\r\n\t\tGraph g = new Graph(V);\r\n\t\t\r\n\t\t/* Unweighted graph*/\r\n\t\tif (weighted == false) {\r\n\t\t\tfor (int i = 0; i < g.V; i++) {\r\n\t\t\t\tif(!g.addRandomEdge(i, rand.nextInt(V), 1)) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tif(g.addRandomEdge(rand.nextInt(V), rand.nextInt(V), 1)) {E--;}\r\n\t\t\t}\r\n\t\t/* Weighted graph*/\t\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < g.V; i++) {\r\n\t\t\t\tif(!g.addRandomEdge(i, rand.nextInt(V), rand.nextInt(20))) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tif (g.addRandomEdge(rand.nextInt(V), rand.nextInt(V), rand.nextInt(20))) {E--;}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn g;\r\n\t}", "@Override\n public Graph newInstance(int vertexesCount) {\n return new SimpleGraph();\n }", "public DefaultDirectedWeightedFlowGraph(DefaultDirectedWeightedGraph<V, E> dWG) {\r\n this.graph = dWG;\r\n\r\n }", "public static Graph<Vertex,Edge> createGraphObject()\n\t{\n\t\tGraph<Vertex,Edge> g = new DirectedSparseMultigraph<Vertex, Edge>();\n\t\treturn g;\n\t}", "private DGraph initFactory(DGraph g) {\n\t\tg= new DGraph();\n\t\tNodeData d0 = new NodeData(0);\n\t\tNodeData d1 = new NodeData(1);\n\t\tNodeData d2 = new NodeData(2);\n\t\tNodeData d3 = new NodeData(3);\n\t\tNodeData d4 = new NodeData(4);\n\t\tg.addNode(d0);\n\t\tg.addNode(d1);\n\t\tg.addNode(d2);\n\t\tg.addNode(d3);\n\t\tg.addNode(d4);\n\t\tg.connect(1, 2, 3);\n\t\tg.connect(2, 1, 4);\n\t\tg.connect(3, 4, 5);\n\t\tg.connect(4,3, 7);\n\t\tg.connect(3,2, 4);\n\t\tg.connect(3,1, 5);\n\t\tg.connect(1,3, 2);\n\t\treturn g;\n\t}", "private TestbedEdge newEdge(Agent src, Agent sink, JungAdapterGraph caller) {\n if (caller.getInnerGraph() instanceof cu.repsystestbed.graphs.FeedbackHistoryGraph) {\n try {\n return new SimFeedbackEdge(src, sink);\n } catch (Exception ex) {\n ChatterBox.debug(\"MyFeedbackEdge\", \"MyFeedbackEdge()\", ex.getMessage());\n return null;\n }\n } else if (caller.getInnerGraph() instanceof cu.repsystestbed.graphs.ReputationGraph) {\n return new SimReputationEdge(src, sink);\n } else if (caller.getInnerGraph() instanceof cu.repsystestbed.graphs.TrustGraph) {\n return new SimTrustEdge(src, sink);\n } else {\n ChatterBox.debug(this, \"newEdge()\", \"Unsupported caller\");\n return null;\n }\n }", "NetworkFactory getNetworkFactory();", "public static GradoopFlinkConfig createConfig(ExecutionEnvironment env,\n LogicalGraphLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraphLayoutFactory,\n GraphCollectionLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> graphCollectionLayoutFactory) {\n return new GradoopFlinkConfig(env, logicalGraphLayoutFactory, graphCollectionLayoutFactory);\n }", "public DirectedEdge(int from, int to, double weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public Edge(Node source, Node sink, Object weight) {\n\t\tthis(source, sink);\n\t\tsetWeight(weight);\n\t}", "private void createEdges() throws IOException {\r\n\t\tString line;\r\n\t\tString fromVertex=null;\r\n\t\tString toVertex=null;\r\n\t\twhile((line=next(1))!=null) {\r\n\t\t\tif(line.startsWith(\"[\"))\r\n\t\t\t\t{\r\n\t\t\t\tthis.buffer=line;\r\n\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\tint colon=line.indexOf(':');\r\n\t\t\tif(colon==-1) continue;\r\n\t\t\tif(line.startsWith(\"id:\"))\r\n\t\t\t\t{\r\n\t\t\t\ttoVertex= line.substring(colon+1).trim();\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\tif(line.startsWith(\"is_a:\"))\r\n\t\t\t\t{\r\n\t\t\t\tfromVertex = nocomment(line.substring(colon+1));\r\n\t\t\t\t//System.out.println(fromVertex+\" to be connected to: \"+toVertex);\r\n\t\t\t\tTerm fromNode = terms.get(fromVertex);\r\n\t\t\t\tTerm toNode = terms.get(toVertex);\r\n\t\t\t\tif (fromNode.namespace.equals(\"molecular_function\") && toNode.namespace.equals(\"molecular_function\")){\r\n\t\t\t\t\tdagMF.addEdge(fromNode, toNode);\r\n\t\t\t\t}\r\n\t\t\t\telse if (fromNode.namespace.equals(\"biological_process\") && toNode.namespace.equals(\"biological_process\")){\r\n\t\t\t\t\tdagBP.addEdge(fromNode, toNode);\r\n\t\t\t\t} \r\n\t\t\t\telse if (fromNode.namespace.equals(\"cellular_component\") && toNode.namespace.equals(\"cellular_component\")){\r\n\t\t\t\t\tdagCC.addEdge(fromNode, toNode);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tSystem.out.println(\"FAILED TO ADD TO DAG, not belonging to the same NAMESPACE\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}", "public Edge addEdge(EdgeType et, Node source, Node dest, double weight)\r\n {\r\n\tfinal String edgeTypeName = et.getName();\r\n Edge existingEdge = getEdge(edgeTypeName, source, dest);\r\n if (existingEdge == null)\r\n {\r\n existingEdge = ethMap.get(edgeTypeName).addEdge(source, dest, weight);\r\n edges = null;\r\n }\r\n else\r\n existingEdge.addWeight(weight);\n return existingEdge;\r\n }", "public void setEdgeFlow(double flow) throws Exception {\r\n\t\tif (this.capacity < flow || flow < 0)\r\n\t\t\tthrow new IndexOutOfBoundsException();\r\n\t\tthis.flow = flow;\r\n\t}", "protected Edge makeEdge(Node p_a, Node p_b) {\n\t\tif(!isDirectedGraph && p_a.hashCode() > p_b.hashCode()) {\n\t\t\treturn new Edge(p_b, p_a);\n\t\t} else {\n\t\t\treturn new Edge(p_a, p_b);\n\t\t}\n\t}", "public static void exampleWeightedGraph() {\n\t\t\n\t\t// create unidrected topology\n\t\tTopology topology = new Topology();\n\t\t\n\t\t// Create edge with high weight and edge with low weight\n\t\tEdge edgeHighWeight = new Edge();\n\t\tedgeHighWeight.setWeight(1000);\n\t\t\n\t\tEdge edgeLowWeight = new Edge();\n\t\tedgeLowWeight.setWeight(1);\n\t\t\n\t\t// Assign edges to topology\n\t\ttopology.addEdge(\"1\", \"4\", edgeHighWeight);\n\t\ttopology.addEdge(\"2\", \"3\", edgeLowWeight);\n\t\ttopology.addEdge(\"1\", \"2\", edgeLowWeight);\n\t\ttopology.addEdge(\"4\", \"3\", edgeLowWeight);\n\t\t\n\t\t// convert to JGraphT\n\t\tWeightedGraph<String, DefaultWeightedEdge> graph = \n\t\t\t\tJGraphTConverter.getWeightedGraph(topology);\n\t\t\n\t\t// Find shortest paths\n\t\tString source = \"1\";\n\t\tString destination = \"3\";\n\t\tList<DefaultWeightedEdge> sp = \n\t\t\t\tDijkstraShortestPath.findPathBetween(graph, source, destination);\n\t\t\n\t\t// Print results\n\t\tSystem.out.println(\"Shortest path from \" + source + \" to \" + destination + \":\");\n\t\tfor (DefaultWeightedEdge e : sp) {\n\t\t\tSystem.out.println(graph.getEdgeSource(e) + \" -> \" + graph.getEdgeTarget(e));\n\t\t}\n\t}", "public WeightedEdge(){\n\t\t\n\t}", "public Flow withEdges(Map<String, Edge> edges) {\n this.edges = edges;\n return this;\n }", "Edge(Node from,Node to, int length){\n this.source=from;\n this.destination=to;\n this.weight=length;\n }", "public static GraphNode createGraphNodeForUseCase() {\n GraphNode graphNode = new GraphNode();\n GraphNode graphNodeName = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(60, 20 + 20 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNodeName.addContained(childNode);\n }\n\n graphNode.addContained(graphNodeName);\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create a use case\n UseCase usecase = new UseCaseImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n usecase.addStereotype(stereotype);\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n usecase.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(usecase);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }", "public OutlineShape(final Vertex.Factory<? extends Vertex> factory) {\r\n this.vertexFactory = factory;\r\n this.outlines = new ArrayList<Outline>(3);\r\n this.outlines.add(new Outline());\r\n this.outlineState = VerticesState.UNDEFINED;\r\n this.bbox = new AABBox();\r\n this.triangles = new ArrayList<Triangle>();\r\n this.vertices = new ArrayList<Vertex>();\r\n this.addedVerticeCount = 0;\r\n this.dirtyBits = 0;\r\n this.sharpness = DEFAULT_SHARPNESS;\r\n }", "void addEdge(String origin, String destination, double weight){\n\t\tadjlist.get(origin).addEdge(adjlist.get(destination), weight);\n\t\tedges++;\n\t}", "@Override\n\tpublic directed_weighted_graph copy() {\n\t\tdirected_weighted_graph copy = new DWGraph_DS();\n\t\tCollection<node_data> vertex = dwg.getV();\n\t\tfor (node_data v : vertex) {\n\t\t\tNodeData ver = new NodeData(v.getKey(), v.getLocation(), v.getWeight());\n\t\t\tcopy.addNode(ver);// Add node\n\t\t\tcopy.getNode(v.getKey()).setInfo(v.getInfo());// Set info to node\n\t\t\tcopy.getNode(v.getKey()).setTag(v.getTag());// Set tag to node\n\t\t}\n\n\t\tfor (node_data n : vertex) {\n\t\t\tCollection<edge_data> edges = dwg.getE(n.getKey());\n\t\t\tif (edges != null) {\n\t\t\t\tfor (edge_data e : edges) {// Add all edges (0 or more) by connecting key,dest and weight\n\t\t\t\t\tcopy.connect(e.getSrc(), e.getDest(), e.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}", "protected GradoopFlinkConfig(\n ExecutionEnvironment executionEnvironment,\n LogicalGraphLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> logicalGraphLayoutFactory,\n GraphCollectionLayoutFactory<EPGMGraphHead, EPGMVertex, EPGMEdge> graphCollectionLayoutFactory) {\n super();\n\n Objects.requireNonNull(executionEnvironment);\n Objects.requireNonNull(logicalGraphLayoutFactory);\n Objects.requireNonNull(graphCollectionLayoutFactory);\n\n this.executionEnvironment = executionEnvironment;\n\n // init with default layout factories\n this.graphFactory = new LogicalGraphFactory(this);\n this.graphFactory.setLayoutFactory(logicalGraphLayoutFactory);\n\n this.graphCollectionFactory = new GraphCollectionFactory(this);\n this.graphCollectionFactory.setLayoutFactory(graphCollectionLayoutFactory);\n }", "EdgeLayout createEdgeLayout();", "DataFlow createDataFlow();", "private Edge addEdge(Node source, Node dest, double weight)\r\n\t{\r\n\t final Edge newEdge = new Edge(edgeType, source, dest, weight);\r\n\t if (!eSet.add(newEdge))\r\n\t\tthrow new RuntimeException(\"Edge already exists!\");\r\n\t source.addEdge(newEdge);\n\t return newEdge;\r\n\t}", "public weighted_graph copy();", "FlowDesignerFactory getFlowDesignerFactory();", "public static GraphNode createGraphNodeForUseCaseConnector() {\n GraphNode graphNode = new GraphNode();\n GraphNode graphNodeName = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(60, 20 + 20 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNodeName.addContained(childNode);\n }\n graphNode.addContained(graphNodeName);\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(-50, -50));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create a use case\n UseCase usecase = new UseCaseImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n usecase.setNamespace(namespace);\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(usecase);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }", "public static final Triple<List<DirectedGraphNode>,\n DirectedGraphWeightFunction,\n CoordinateMap> getRandomGraph(\n int size,\n float elf,\n Random r,\n HeuristicFunction f) {\n ArrayList<DirectedGraphNode> graph =\n new ArrayList<DirectedGraphNode>(size);\n DirectedGraphWeightFunction w = new DirectedGraphWeightFunction();\n CoordinateMap m = new CoordinateMap(2, size);\n\n for (int i = 0; i < size; ++i) {\n DirectedGraphNode u = new DirectedGraphNode(\"\" + i);\n graph.add(u);\n m.put(u, getRandomCoordinates(2, r, 1000));\n }\n\n for (int i = 0; i < size; ++i) {\n for (int j = 0; j < size; ++j) {\n if (r.nextFloat() < elf) {\n graph.get(i).addChild(graph.get(j));\n w.put(graph.get(i),\n graph.get(j),\n 1.5 * f.get(m.get(graph.get(i)),\n m.get(graph.get(j))));\n }\n }\n }\n\n for (int i = 0; i < size - 1; ++i) {\n graph.get(i).addChild(graph.get(i + 1));\n w.put(graph.get(i),\n graph.get(i + 1),\n 1.5 * f.get(m.get(graph.get(i)),\n m.get(graph.get(i + 1))));\n }\n\n graph.get(size - 1).addChild(graph.get(0));\n w.put(graph.get(size - 1),\n graph.get(0),\n 1.5 * f.get(m.get(graph.get(size - 1)),\n m.get(graph.get(0))));\n\n return new Triple<List<DirectedGraphNode>,\n DirectedGraphWeightFunction,\n CoordinateMap>(graph, w, m);\n\n }", "private static graph graph_creator(int v_size, int e_size, int seed) {\n graph g = new Graph_DS();\n initSeed(seed);\n for(int i=0;i<v_size;i++) {\n node_data n = new NodeData();\n g.addNode(n);\n }\n // Iterator<ex0.node_data> itr = V.iterator(); // Iterator is a more elegant and generic way, but KIS is more important\n int[] nodes = nodes(g);\n while(g.edgeSize() < e_size) {\n int a = nextRnd(0,v_size);\n int b = nextRnd(0,v_size);\n int i = nodes[a];\n int j = nodes[b];\n g.connect(i,j);\n }\n return g;\n }", "public static directed_weighted_graph loadgraph(String json) {\n\n\n GsonBuilder Gbuilde = new GsonBuilder();\n Gbuilde.registerTypeAdapter(DWGraph_DS.class, new graph_game_reader());\n Gson gson = Gbuilde.create();\n\n return gson.fromJson(json, DWGraph_DS.class);\n }", "public void buildFlow(FlowDO flow) {\n\t}", "public Edge(int source, int dest, int weight){\n\t\tthis.source = source;\n\t\tthis.dest = dest;\n\t\tthis.weight = weight;\n\t}", "public void createEdges() {\n \tfor(String key : ways.keySet()) {\n \t Way way = ways.get(key);\n \t if(way.canDrive()) {\n \t\tArrayList<String> refs = way.getRefs();\n \t\t\t\n \t\tif(refs.size() > 0) {\n \t\t GPSNode prev = (GPSNode) this.getNode(refs.get(0));\n \t\t drivableNodes.add(prev);\n \t\t \n \t\t GPSNode curr = null;\n \t\t for(int i = 1; i <refs.size(); i++) {\n \t\t\tcurr = (GPSNode) this.getNode(refs.get(i));\n \t\t\tif(curr == null || prev == null)\n \t\t\t continue;\n \t\t\telse {\n \t\t\t double distance = calcDistance(curr.getLatitude(), curr.getLongitude(),\n \t\t\t\t prev.getLatitude(), prev.getLongitude());\n\n \t\t\t GraphEdge edge = new GraphEdge(prev, curr, distance, way.id);\n \t\t\t prev.addEdge(edge);\n \t\t\t curr.addEdge(edge);\n \t\t\t \n \t\t\t drivableNodes.add(curr);\n \t\t\t prev = curr;\n \t\t\t}\n \t\t }\t\n \t\t}\n \t }\n \t}\n }", "public void addEdge(int start, int end, double weight);", "private static SimpleWeightedGraph<String, DefaultWeightedEdge> criaGrafo() {\r\n\t\tSimpleWeightedGraph<String,DefaultWeightedEdge> graph = new SimpleWeightedGraph<String, DefaultWeightedEdge>(DefaultWeightedEdge.class);\r\n\t\t\r\n\t\tgraph.addVertex(\"a\");\tgraph.addVertex(\"b\");\tgraph.addVertex(\"c\");\r\n\t\tgraph.addVertex(\"d\");\tgraph.addVertex(\"e\");\tgraph.addVertex(\"f\");\r\n\t\tgraph.addVertex(\"g\");\tgraph.addVertex(\"h\");\tgraph.addVertex(\"i\");\r\n\t\t\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"a\",\"b\"),2);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"b\",\"c\"),4);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"c\",\"d\"),2);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"d\",\"e\"),1);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"e\",\"f\"),6);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"f\",\"a\"),7);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"a\",\"g\"),3);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"g\",\"i\"),1);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"g\",\"h\"),3);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"g\",\"b\"),6);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"h\",\"c\"),2);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"h\",\"d\"),8);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"h\",\"i\"),4);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"i\",\"f\"),5);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"i\",\"e\"),2);\r\n\t\treturn graph;\r\n\t}", "public weighted_graph getGraph();", "public static AclfNetworkDSL createAclfNetwork(String id) {\r\n\t\treturn new AclfNetworkDSL(id);\r\n\t}", "public Edge(Node from, Node to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public Edge(int weight){\n\t\tthis.EDGE_ID = IDToGive;\n\t\tthis.edgeWeight = weight;\n\t\tIDToGive++;\n\t}", "public EdgeItemProvider(AdapterFactory adapterFactory) {\n\t\tsuper(adapterFactory);\n\t}", "public EdgeWeightedDigraph(int V, int[] Vf, int[] Vt, int E, int[] W) \n {\n this(V);\n online = new boolean[V];\n if (E < 0) throw new RuntimeException(\"Number of edges must be nonnegative\");\n for (int i = 0; i < E; i++) \n {\n int v = Vf[i];\n int w = Vt[i];\n double weight = W[i];\n //Add inverse of each edge we are adding\n DirectedEdge e = new DirectedEdge(v, w, weight, true);\n DirectedEdge eInv = new DirectedEdge(w,v,weight, true);\n addEdge(e);\n addEdge(eInv);\n \n }\n //Initialize array of vertex status\n for(int j = 0; j < V; j++)\n {\n \tonline[j] = true;\n }\n }", "PlanningFactory getFactory();", "public EdgeImpl(Vertex sourceVertex, Vertex targetVertex, double edgeWeight, Graph graph) {\n this.sourceVertex = sourceVertex;\n this.targetVertex = targetVertex;\n this.edgeWeight = edgeWeight;\n this.graph = graph;\n }", "public AbstractWeightedGraph<V,E>.FlowGraph maximumFlow(V source, V sink);", "public interface WeightedGraph<V,E extends WeightedEdge<V>> extends Graph<V,E> {\n/**\n * Uses the\n * Floyd-Warshall all-pairs shortest path algorithm to compute and return a shortest\n * path matrix.\n**/\n\n\tpublic ShortestPathMatrix<V,E> allPairsShortestPaths();\n/**\n * Uses\n * the Bellman-Ford shortest path algorithm to compute and return a shortest path tree\n * for the given source vertex. This algorithm will yield the correct answer if there are\n * negative weight edges, provided that there is no negative weight cycle.\n**/\n\n\tpublic InTree<V,E> generalShortestPathFromSource(V source);\n/**\n * Uses Kruskal's minimum spanning tree to\n * return a set of edges that form a minimum spanning tree for this graph.\n * It throws a <code>DisconnectedGraphException</code> when the graph is not connected,\n * a <code>NegativeWeightEdgeException</code> when a negative weight edge\n * is encountered, and a <code>GraphException</code> when the graph is directed.\n**/\n\n\tpublic Set<E> kruskalMST() throws NegativeWeightEdgeException, DisconnectedGraphException;\n/**\n * Uses the\n * Edmonds-Karp implementation of the basic Ford-Fulkerson augmenting path\n * method to find a maximum flow (and a minimum cut) for the flow network\n * defined by the provided source and sink.\n**/\n\n\tpublic AbstractWeightedGraph<V,E>.FlowGraph maximumFlow(V source, V sink);\n/**\n * Uses Prim's minimum spanning tree to\n * return a set of edges that forms a minimum spanning tree for this graph.\n * It throws a <code>DisconnectedGraphException</code> when the graph is not connected,\n * a <code>NegativeWeightEdgeException</code> when a negative weight edge\n * is encountered, and an <code>IllegalArgumentException</code> when the graph is directed.\n**/\n\n\tpublic Set<E> primMST() throws NegativeWeightEdgeException, DisconnectedGraphException;\n/**\n * Uses\n * Dijkstra's shortest path algorithm to compute and return a shortest path tree\n * for the given source vertex. It throws a <code>NegativeWeightEdgeException</code> when the\n * graph has a negative weight edge reachable from the source.\n**/\n\n\tpublic InTree<V,E> weightedShortestPaths(V source)\n\t\tthrows NegativeWeightEdgeException, DisconnectedGraphException;\n}", "public WeightedGraph(List<E> v, List<WeightedEdge> edges) {\n this();\n for (E e : v) {\n addVertex(e);\n }\n for (WeightedEdge e : edges) {\n addEdge(e);\n }\n }", "FuelingStation createFuelingStation();", "@SuppressWarnings(\"unchecked\")\n\tprivate DirectedGraph getGraph() {\n\n\t\tNode node1, node2, node3, node4, node5;\n\t\tEdge edge1, edge2, edge3, edge4;\n\n\t\tNodeList nodes = new NodeList();\n\t\tEdgeList edges = new EdgeList();\n\n\t\t// create Node\n\t\tnode1 = new Node(\"Node1\");\n\t\tnodes.add(node1);\n\t\tnode2 = new Node(\"Node2\");\n\t\tnodes.add(node2);\n\t\tnode3 = new Node(\"Node3\");\n\t\tnodes.add(node3);\n\t\tnode4 = new Node(\"Node4\");\n\t\tnodes.add(node4);\n\t\tnode5 = new Node(\"Node5\");\n\t\tnodes.add(node5);\n\n\t\t// create Edge\n\t\tedge1 = new Edge(node1, node2);\n\t\tedges.add(edge1);\n\t\tedge2 = new Edge(node1, node3);\n\t\tedges.add(edge2);\n\t\tedge3 = new Edge(node2, node4);\n\t\tedges.add(edge3);\n\t\tedge4 = new Edge(node4, node5);\n\t\tedges.add(edge4);\n\n\t\tDirectedGraph graph = new DirectedGraph();\n\t\tgraph.nodes = nodes;\n\t\tgraph.edges = edges;\n\n\t\t// set Layout of the graph (Compute and Set the x,y of each Node)\n\t\tnew DirectedGraphLayout().visit(graph);\n\n\t\treturn graph;\n\t}", "public int[][] create_edge(int from, int to, boolean weighted, int weight){\n try{\n if(weighted==true) // If weighted edge\n adj_matrix[from][to]=weight;\n else\n adj_matrix[from][to]=1;\n }\n catch(ArrayIndexOutOfBoundsException index){ // If invalid index\n System.out.println(\" Invalid Vertex!\");\n }\n return adj_matrix;\n }", "@Override\r\n\tpublic void link(E src, E dst, int weight) {\r\n\t\tinsertVertex(src); //Inserts src if not currently in the graph\r\n\t\tinsertVertex(dst); //Inserts dst if not currently in the graph\r\n\t\tEdge<E> newedge1 = new Edge<>(src, dst, weight);\r\n\r\n\t\tArrayList<Edge<E>> sEdges = adjacencyLists.get(src);\r\n\t\tsEdges.remove(newedge1); //if the edge already exists remove it\r\n\t\tsEdges.add(newedge1);\r\n\t\tif(!isDirected) { //Add the additional edge if this graph is undirected\r\n\t\t\tEdge<E> newedge2 = new Edge<>(dst, src, weight);\r\n\r\n\t\t\tArrayList<Edge<E>> dEdges = adjacencyLists.get(dst);\r\n\t\t\tdEdges.remove(newedge2); //if the edge already exists remove it\r\n\t\t\tdEdges.add(newedge2); \r\n\t\t}\r\n\t}", "public interface Simpleflowmodel4pcmFactory extends EFactory {\r\n\t/**\r\n\t * The singleton instance of the factory.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @generated\r\n\t */\r\n\tSimpleflowmodel4pcmFactory eINSTANCE = edu.kit.kastel.scbs.simpleflowmodel4pcm.impl.Simpleflowmodel4pcmFactoryImpl\r\n\t\t\t.init();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Flows</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Flows</em>'.\r\n\t * @generated\r\n\t */\r\n\tFlows createFlows();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Flow</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Flow</em>'.\r\n\t * @generated\r\n\t */\r\n\tFlow createFlow();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Signature Source</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Signature Source</em>'.\r\n\t * @generated\r\n\t */\r\n\tSignatureSource createSignatureSource();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Parameter Source</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Parameter Source</em>'.\r\n\t * @generated\r\n\t */\r\n\tParameterSource createParameterSource();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Signature Identification</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Signature Identification</em>'.\r\n\t * @generated\r\n\t */\r\n\tSignatureIdentification createSignatureIdentification();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Parameter Identification</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Parameter Identification</em>'.\r\n\t * @generated\r\n\t */\r\n\tParameterIdentification createParameterIdentification();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Generic Sink</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Generic Sink</em>'.\r\n\t * @generated\r\n\t */\r\n\tGenericSink createGenericSink();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Signature Sink</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Signature Sink</em>'.\r\n\t * @generated\r\n\t */\r\n\tSignatureSink createSignatureSink();\r\n\r\n\t/**\r\n\t * Returns a new object of class '<em>Parameter Sink</em>'.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return a new object of class '<em>Parameter Sink</em>'.\r\n\t * @generated\r\n\t */\r\n\tParameterSink createParameterSink();\r\n\r\n\t/**\r\n\t * Returns the package supported by this factory.\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @return the package supported by this factory.\r\n\t * @generated\r\n\t */\r\n\tSimpleflowmodel4pcmPackage getSimpleflowmodel4pcmPackage();\r\n\r\n}", "public Edge(int from, int to, Integer weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public void addAdjacent( AdjacentDockFactory<?> factory ){\n adjacent.put( getAdjacentID( factory ), factory );\n }", "protected Graph<Integer, Edge<Integer>> generateGraph() {\n Graph<Integer, Edge<Integer>> graph = newGraph();\n Integer[] integersArray = new Integer[25];\n\n /*\n * add all integers in [0,24]\n */\n for (int i = 0; i < 25; i++) {\n integersArray[i] = new Integer(i);\n graph.addVertex(integersArray[i]);\n }\n\n /*\n * create edges between all integers i, j for which (i + j) is even\n */\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n if ((i + j) % 2 != 0) {\n continue;\n }\n graph.addEdge(new UnweightedEdge(integersArray[i], integersArray[j]));\n }\n }\n\n return graph;\n }", "public static GradoopFlinkConfig createConfig(ExecutionEnvironment env) {\n return new GradoopFlinkConfig(env,\n new GVEGraphLayoutFactory(), new GVECollectionLayoutFactory());\n }", "private void createGraphs() {\n initialGraphCreation.accept(caller, listener);\n graphCustomization.accept(caller, listener);\n caller.generateAndAdd(params.getNumCallerEvents(), callerAddToGraphTest);\n listener.generateAndAdd(params.getNumListenerEvents(), listenerAddToGraphTest);\n generationDefinitions.accept(caller, listener);\n }", "@Test\n public void simpleGraph() {\n graph.edge(0, 1).setDistance(1).set(speedEnc, 10, 10);\n graph.edge(1, 2).setDistance(1).set(speedEnc, 10, 10);\n\n // source edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 5, 0));\n // target edge does not exist -> no path\n assertNotFound(calcPath(0, 2, 0, 5));\n // using NO_EDGE -> no path\n assertNotFound(calcPath(0, 2, NO_EDGE, 0));\n assertNotFound(calcPath(0, 2, 0, NO_EDGE));\n // using ANY_EDGE -> no restriction\n assertPath(calcPath(0, 2, ANY_EDGE, 1), 0.2, 2, 200, nodes(0, 1, 2));\n assertPath(calcPath(0, 2, 0, ANY_EDGE), 0.2, 2, 200, nodes(0, 1, 2));\n // edges exist -> they are used as restrictions\n assertPath(calcPath(0, 2, 0, 1), 0.2, 2, 200, nodes(0, 1, 2));\n }", "@Override\n public void addEdge(V source, V destination, double weight)\n {\n super.addEdge(source, destination, weight);\n super.addEdge(destination, source, weight);\n }", "public void addEdge(Graph graph, int source, int destination, double weight){\r\n\r\n Node node = new Node(destination, weight);\r\n LinkedList<Node> list = null;\r\n\r\n //Add an adjacent Node for source\r\n list = adjacencyList.get((double)source);\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)source, list);\r\n\r\n //Add adjacent node again since graph is undirected\r\n node = new Node(source, weight);\r\n\r\n list = null;\r\n\r\n list = adjacencyList.get((double)destination);\r\n\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)destination, list);\r\n }", "void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}", "public Graph createStationGraph(int[][] inputMatrix) {\n\t\t// set up a graph with nodes as stations and weighted cost edges to\n\t\t// other stations\n\t\tNode station = new Node(1);\n\t\tGraph graph = new Graph(station);\n\n\t\tfor (int i = 1; i < inputMatrix.length + 1; i++) {\n\t\t\tgraph.addNode(new Node(i));\n\t\t}\n\n\t\t// add the nodes and edges\n\t\tfor (int i = 0; i < inputMatrix.length; i++) {\n\t\t\t// get the station we're connecting\n\t\t\tstation = graph.getNodes().get(i);\n\t\t\tfor (int j = 0; j < inputMatrix.length; j++) {\n\t\t\t\tif ((inputMatrix[i][j] != INF) && (inputMatrix[i][j] != 0)) {\n\t\t\t\t\t// add the edges to that station\n\t\t\t\t\tstation.addEdge(new Edge(inputMatrix[i][j], graph.getNodes().get(j)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t graph.printGraph();\n\t\treturn graph;\n\t}", "@Override\n\tpublic FlowMessageFactory getFlowMessageFactory() {\n\t\treturn null;\n\t}", "public Edge(int w, int s, int e) {\n\t\tweight = w;\n\t\tstartVertex = s;\n\t\tendVertex = e;\n\t}", "public void addEdge(Node source, Node destination, int weight) {\n nodes.add(source);\n nodes.add(destination);\n checkEdgeExistance(source, destination, weight);\n\n if (!directed && source != destination) {\n checkEdgeExistance(destination, source, weight);\n }\n }", "public FlowDetails(final String sffNodeName, FlowKey flowKey, TableKey tableKey, Flow flow) {\n this.sffNodeName = sffNodeName;\n this.flowKey = flowKey;\n this.tableKey = tableKey;\n this.flow = flow;\n }", "public final Vertex.Factory<? extends Vertex> vertexFactory() { return vertexFactory; }", "private static void createGraph(In in) {\n int vert = in.readInt();\n int edge = in.readInt();\n //Using the graph.java class, create a new graph with the number of vertices + 1 (since the graph class starts with vertex 0)\n Graph graph = new Graph(vert + 1);\n //For loop that adds the edges of the graph to the graph object\n for (int i = 0; i < edge; i++) {\n graph.addEdge(in.readInt(), in.readInt());\n }\n //Uses the bipartite class to check if the graph is bipartite\n if (new Bipartite(graph).isBipartite()) {\n //If the graph is bipartite, prints 1\n StdOut.print(\"1 \");\n }\n else {\n //Prints -1 if the graph is not bipartite\n StdOut.print(\"-1 \");\n }\n }", "GraphLayout createGraphLayout();", "public Graph createGraph() {\n String fileName;\n// fileName =\"./428333.edges\";\n String line;\n Graph g = new Graph();\n// List<String> vertexNames = new ArrayList<>();\n// try\n// {\n// BufferedReader in=new BufferedReader(new FileReader(fileName));\n// line=in.readLine();\n// while (line!=null) {\n////\t\t\t\tSystem.out.println(line);\n// String src = line.split(\" \")[0];\n// String dst = line.split(\" \")[1];\n//// vertexNames.add(src);\n//// vertexNames.add(dst);\n//// System.out.println(src+\" \"+dst);\n// g.addEdge(src, dst, 1);\n// line=in.readLine();\n// }\n// in.close();\n// } catch (Exception e) {\n//\t\t\te.printStackTrace();\n// }\n\n fileName=\"./788813.edges\";\n// List<String> vertexNames = new ArrayList<>();\n try\n {\n BufferedReader in=new BufferedReader(new FileReader(fileName));\n line=in.readLine();\n while (line!=null) {\n//\t\t\t\tSystem.out.println(line);\n String src = line.split(\" \")[0];\n String dst = line.split(\" \")[1];\n g.addEdge(src, dst, 1);\n line=in.readLine();\n }\n in.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n// Graph g = new Graph(new String[]{\"v0\", \"v1\", \"v2\", \"v3\", \"v4\", \"v5\", \"v6\", \"v7\", \"v8\"});\n// // Add the required edges.\n// g.addEdge(\"v0\", \"v1\", 4); g.addEdge(\"v0\", \"v7\", 8);\n// g.addEdge(\"v1\", \"v2\", 8); g.addEdge(\"v1\", \"v7\", 11); g.addEdge(\"v2\", \"v1\", 8);\n// g.addEdge(\"v2\", \"v8\", 2); g.addEdge(\"v2\", \"v5\", 4); g.addEdge(\"v2\", \"v3\", 7);\n// g.addEdge(\"v3\", \"v2\", 7); g.addEdge(\"v3\", \"v5\", 14); g.addEdge(\"v3\", \"v4\", 9);\n// g.addEdge(\"v4\", \"v3\", 9); g.addEdge(\"v4\", \"v5\", 10);\n// g.addEdge(\"v5\", \"v4\", 10); g.addEdge(\"v5\", \"v3\", 9); g.addEdge(\"v5\", \"v2\", 4);\n// g.addEdge(\"v5\", \"v6\", 2);\n// g.addEdge(\"v6\", \"v7\", 1); g.addEdge(\"v6\", \"v8\", 6); g.addEdge(\"v6\", \"v5\", 2);\n// g.addEdge(\"v7\", \"v0\", 8); g.addEdge(\"v7\", \"v8\", 7); g.addEdge(\"v7\", \"v1\", 11);\n// g.addEdge(\"v7\", \"v6\", 1);\n// g.addEdge(\"v8\", \"v2\", 2); g.addEdge(\"v8\", \"v7\", 7); g.addEdge(\"v8\", \"v6\", 6);\n\n//\n return g;\n }", "public FlowNodeInstance(String nodeInstanceState, int firedFlowsNeeded, int loopCount) {\n\t\tthis.nodeInstanceState = nodeInstanceState;\n\t\tthis.incomingFiredFlowsNeeded = firedFlowsNeeded;\n\t\tthis.loopCount = loopCount;\n\t}", "public Graph<String, DefaultWeightedEdge> loadGraphFrom(String filepath) throws FileNotFoundException{\n\t\tif (!isGraphFile(filepath)){\n\t\t\tthrow new IllegalArgumentException(\"'\" + filepath + \"' is not a .graph file\");\n\t\t}\n\t\t\n\t\tFile file = new File(filepath);\n\t\tScanner graphdata;\n\t\t\n\t\t//wirft eine FileNotFoundException, wenn File nicht vorhanden\n\t\tgraphdata = new Scanner(file);\n\n\t\tWeightedGraph<String, DefaultWeightedEdge> graph = new DirectedWeightedMultigraph<String, DefaultWeightedEdge>(DefaultWeightedEdge.class);\n\t\tDefaultWeightedEdge aktEdge;\n\t\t\n\n\t\t//Graph einlesen:\n\t\twhile(graphdata.hasNext()){\n\t\t\tString aktSting = graphdata.next().trim();\n\t\t\t\t\t\t\t\t\n\t\t\tString[] aktAry = aktSting.split(\",\");\n\t\t\tString ecke1 = aktAry[0].trim();\n\t\t\tString ecke2 = aktAry[1].trim();\n\t\t\tDouble weight = Double.parseDouble(aktAry[2].trim());\n\t\t\tif(!graph.containsVertex(ecke1)){\n\t\t\t\tgraph.addVertex(ecke1);\n\t\t\t}\n\t\t\tif(!graph.containsVertex(ecke2)){\n\t\t\t\tgraph.addVertex(ecke2);\n\t\t\t}\n\t\t\t\n\t\t\tif (!graph.containsEdge(ecke1, ecke2)){\n\t\t\t\taktEdge = graph.addEdge(ecke1, ecke2);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, weight);\n\t\t\t\taktEdge = graph.addEdge(ecke2, ecke1);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, weight);\n\t\t\t}else{\n\t\t\t\taktEdge = graph.getEdge(ecke1, ecke2);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, graph.getEdgeWeight(aktEdge) + weight);\n\t\t\t\taktEdge = graph.getEdge(ecke2,ecke1);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, graph.getEdgeWeight(aktEdge) + weight);\n\t\t\t}\n\t\t}\n\t\treturn graph;\n\t}", "TripleGraph createTripleGraph();", "public double getEdgeFlow() {\n\t\treturn this.flow;\r\n\t}", "public Edge(int from, int to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "double getEdgeWeight();", "public Flow scheduleNewFlow(Flow flow)\n\t{\n\t\tTopology prunedTopology;\n\t\tTopology shortestPath;\n\t\t\n\t\tbwPruner = new BandwidthPruner(theResourceManager.getTopology());\n\t\tprunedTopology = bwPruner.pruneTopology(flow.getBandwidth(), flow.getStartTime(), flow.getEndTime());\n\t\t\n\t\tif(prunedTopology.isEmpty())\n\t\t\treturn null;\n\t\t\t\t\t\t\n\t\tspEngine = new ShortestPathEngine(prunedTopology);\n\t\tshortestPath = spEngine.calculateSP(flow);\n\t\t\n\t\t//shortestPath.dumpTopology();\n\t\t\t\t\n\t\tif(shortestPath.isEmpty())\n\t\t{\n\t\t\tlogger.warn(\"No Feasible Path for Flow {}\", flow.getID());\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t\t\t\n\t\tfor(FlowLink l : shortestPath.getLinks())\n\t\t{\n\t\t\ttheResourceManager.decreaseAvailableLinkBandwidth(l, flow.getBandwidth(), flow.getStartTime(), flow.getEndTime());\n\t\t}\n\t\t\t\t\n\t\t\n\t\ttheResourceManager.addFlowToRM(flow, shortestPath);\n\t\t\t\t\n\t\tflow.schedulingSuccess(true);\n\t\treturn flow;\n\t}", "public void testAddEdge() {\n System.out.println(\"addEdge\");\n\n Graph<Integer, Edge<Integer>> graph = newGraph();\n\n for (int i = 0; i < 25; i++) {\n graph.addVertex(new Integer(i));\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertTrue(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n\n for (int i = 0; i < 25; i++) {\n for (int j = 0; j < 25; j++) {\n Assert\n .assertFalse(graph.addEdge(new UnweightedEdge(new Integer(i), new Integer(j))));\n }\n }\n }" ]
[ "0.6440572", "0.5978513", "0.593119", "0.59212035", "0.5810886", "0.5728624", "0.56399006", "0.5637921", "0.55375075", "0.5526722", "0.540082", "0.5369645", "0.5333752", "0.53318256", "0.5329816", "0.5316353", "0.5248712", "0.5235385", "0.5190153", "0.51798314", "0.5145641", "0.5104744", "0.5103348", "0.5090135", "0.5078392", "0.50739866", "0.50662994", "0.5030824", "0.49999806", "0.49618256", "0.49452722", "0.4922029", "0.49167928", "0.49082875", "0.4905039", "0.49024463", "0.4870916", "0.48696136", "0.4853418", "0.4835011", "0.47855946", "0.47557548", "0.4754227", "0.47360614", "0.47221342", "0.4702412", "0.46992263", "0.46726412", "0.46600026", "0.46589613", "0.4655333", "0.4643392", "0.46341696", "0.46308404", "0.46268114", "0.4619264", "0.4611905", "0.4611097", "0.4606293", "0.46057582", "0.46035856", "0.45857647", "0.45756227", "0.45742688", "0.4572952", "0.4571392", "0.45670134", "0.4555729", "0.45519924", "0.45416924", "0.45395887", "0.4532158", "0.45295566", "0.45249787", "0.45177695", "0.4515319", "0.4506982", "0.4506581", "0.4502906", "0.45026797", "0.44955418", "0.44886217", "0.44871843", "0.448539", "0.44791654", "0.4475625", "0.44746196", "0.44660658", "0.44650465", "0.44624406", "0.44571579", "0.44455045", "0.44441953", "0.44347417", "0.44346026", "0.44309494", "0.44285277", "0.4427894", "0.4427259", "0.44133672" ]
0.71516603
0
Creates a new directed weighted flow graph by wrapping an DefaultDirectedWeightedGraph
public DefaultDirectedWeightedFlowGraph(DefaultDirectedWeightedGraph<V, E> dWG) { this.graph = dWG; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph() {\r\n\t\treturn createGraph(goapUnit.getGoalState());\r\n\t}", "public weighted_graph getGraph();", "public DefaultDirectedWeightedFlowGraph(EdgeFactory<V, E> ef) {\r\n this.graph = new DefaultDirectedWeightedGraph(ef);\r\n\r\n }", "public DefaultDirectedWeightedFlowGraph(Class<? extends E> edgeClass) {\r\n this(new ClassBasedEdgeFactory<V, E>(edgeClass));\r\n }", "public weighted_graph copy();", "public static void exampleWeightedGraph() {\n\t\t\n\t\t// create unidrected topology\n\t\tTopology topology = new Topology();\n\t\t\n\t\t// Create edge with high weight and edge with low weight\n\t\tEdge edgeHighWeight = new Edge();\n\t\tedgeHighWeight.setWeight(1000);\n\t\t\n\t\tEdge edgeLowWeight = new Edge();\n\t\tedgeLowWeight.setWeight(1);\n\t\t\n\t\t// Assign edges to topology\n\t\ttopology.addEdge(\"1\", \"4\", edgeHighWeight);\n\t\ttopology.addEdge(\"2\", \"3\", edgeLowWeight);\n\t\ttopology.addEdge(\"1\", \"2\", edgeLowWeight);\n\t\ttopology.addEdge(\"4\", \"3\", edgeLowWeight);\n\t\t\n\t\t// convert to JGraphT\n\t\tWeightedGraph<String, DefaultWeightedEdge> graph = \n\t\t\t\tJGraphTConverter.getWeightedGraph(topology);\n\t\t\n\t\t// Find shortest paths\n\t\tString source = \"1\";\n\t\tString destination = \"3\";\n\t\tList<DefaultWeightedEdge> sp = \n\t\t\t\tDijkstraShortestPath.findPathBetween(graph, source, destination);\n\t\t\n\t\t// Print results\n\t\tSystem.out.println(\"Shortest path from \" + source + \" to \" + destination + \":\");\n\t\tfor (DefaultWeightedEdge e : sp) {\n\t\t\tSystem.out.println(graph.getEdgeSource(e) + \" -> \" + graph.getEdgeTarget(e));\n\t\t}\n\t}", "public WeightedGraph() {\n super();\n }", "public static EdgeWeightedDigraph createTestDigraph() {\n\n final int weight = 1; // Constant weight used.\n\n EdgeWeightedDigraph testGraph = new EdgeWeightedDigraph();\n testGraph.addEdge(new DirectedEdge(1, 2, weight));\n testGraph.addEdge(new DirectedEdge(2, 3, weight));\n testGraph.addEdge(new DirectedEdge(2, 4, weight));\n testGraph.addEdge(new DirectedEdge(3, 5, weight));\n testGraph.addEdge(new DirectedEdge(3, 8, weight));\n testGraph.addEdge(new DirectedEdge(4, 5, weight));\n testGraph.addEdge(new DirectedEdge(4, 8, weight));\n testGraph.addEdge(new DirectedEdge(6, 7, weight));\n testGraph.addEdge(new DirectedEdge(7, 4, weight));\n return testGraph;\n }", "public interface WeightedGraph<V,E extends WeightedEdge<V>> extends Graph<V,E> {\n/**\n * Uses the\n * Floyd-Warshall all-pairs shortest path algorithm to compute and return a shortest\n * path matrix.\n**/\n\n\tpublic ShortestPathMatrix<V,E> allPairsShortestPaths();\n/**\n * Uses\n * the Bellman-Ford shortest path algorithm to compute and return a shortest path tree\n * for the given source vertex. This algorithm will yield the correct answer if there are\n * negative weight edges, provided that there is no negative weight cycle.\n**/\n\n\tpublic InTree<V,E> generalShortestPathFromSource(V source);\n/**\n * Uses Kruskal's minimum spanning tree to\n * return a set of edges that form a minimum spanning tree for this graph.\n * It throws a <code>DisconnectedGraphException</code> when the graph is not connected,\n * a <code>NegativeWeightEdgeException</code> when a negative weight edge\n * is encountered, and a <code>GraphException</code> when the graph is directed.\n**/\n\n\tpublic Set<E> kruskalMST() throws NegativeWeightEdgeException, DisconnectedGraphException;\n/**\n * Uses the\n * Edmonds-Karp implementation of the basic Ford-Fulkerson augmenting path\n * method to find a maximum flow (and a minimum cut) for the flow network\n * defined by the provided source and sink.\n**/\n\n\tpublic AbstractWeightedGraph<V,E>.FlowGraph maximumFlow(V source, V sink);\n/**\n * Uses Prim's minimum spanning tree to\n * return a set of edges that forms a minimum spanning tree for this graph.\n * It throws a <code>DisconnectedGraphException</code> when the graph is not connected,\n * a <code>NegativeWeightEdgeException</code> when a negative weight edge\n * is encountered, and an <code>IllegalArgumentException</code> when the graph is directed.\n**/\n\n\tpublic Set<E> primMST() throws NegativeWeightEdgeException, DisconnectedGraphException;\n/**\n * Uses\n * Dijkstra's shortest path algorithm to compute and return a shortest path tree\n * for the given source vertex. It throws a <code>NegativeWeightEdgeException</code> when the\n * graph has a negative weight edge reachable from the source.\n**/\n\n\tpublic InTree<V,E> weightedShortestPaths(V source)\n\t\tthrows NegativeWeightEdgeException, DisconnectedGraphException;\n}", "@Override\n\tpublic directed_weighted_graph copy() {\n\t\tdirected_weighted_graph copy = new DWGraph_DS();\n\t\tCollection<node_data> vertex = dwg.getV();\n\t\tfor (node_data v : vertex) {\n\t\t\tNodeData ver = new NodeData(v.getKey(), v.getLocation(), v.getWeight());\n\t\t\tcopy.addNode(ver);// Add node\n\t\t\tcopy.getNode(v.getKey()).setInfo(v.getInfo());// Set info to node\n\t\t\tcopy.getNode(v.getKey()).setTag(v.getTag());// Set tag to node\n\t\t}\n\n\t\tfor (node_data n : vertex) {\n\t\t\tCollection<edge_data> edges = dwg.getE(n.getKey());\n\t\t\tif (edges != null) {\n\t\t\t\tfor (edge_data e : edges) {// Add all edges (0 or more) by connecting key,dest and weight\n\t\t\t\t\tcopy.connect(e.getSrc(), e.getDest(), e.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}", "public WeightedAdjacencyGraph() {\n this.vertices = new HashMap<>();\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate DirectedGraph getGraph() {\n\n\t\tNode node1, node2, node3, node4, node5;\n\t\tEdge edge1, edge2, edge3, edge4;\n\n\t\tNodeList nodes = new NodeList();\n\t\tEdgeList edges = new EdgeList();\n\n\t\t// create Node\n\t\tnode1 = new Node(\"Node1\");\n\t\tnodes.add(node1);\n\t\tnode2 = new Node(\"Node2\");\n\t\tnodes.add(node2);\n\t\tnode3 = new Node(\"Node3\");\n\t\tnodes.add(node3);\n\t\tnode4 = new Node(\"Node4\");\n\t\tnodes.add(node4);\n\t\tnode5 = new Node(\"Node5\");\n\t\tnodes.add(node5);\n\n\t\t// create Edge\n\t\tedge1 = new Edge(node1, node2);\n\t\tedges.add(edge1);\n\t\tedge2 = new Edge(node1, node3);\n\t\tedges.add(edge2);\n\t\tedge3 = new Edge(node2, node4);\n\t\tedges.add(edge3);\n\t\tedge4 = new Edge(node4, node5);\n\t\tedges.add(edge4);\n\n\t\tDirectedGraph graph = new DirectedGraph();\n\t\tgraph.nodes = nodes;\n\t\tgraph.edges = edges;\n\n\t\t// set Layout of the graph (Compute and Set the x,y of each Node)\n\t\tnew DirectedGraphLayout().visit(graph);\n\n\t\treturn graph;\n\t}", "public static weighted_graph graphCreator(int node_size, int edge_size) {\n weighted_graph ga = new WGraph_DS();\n for (int i = 0; i < node_size; i++) {\n ga.addNode(i);\n }\n for (int i = 0; i < edge_size; i++) {\n double weight = Math.random();\n int vertex1 = (int) (Math.random() * node_size);\n int vertex2 = (int) (Math.random() * node_size);\n ga.connect(vertex1,vertex2,weight);\n }\n return ga;\n }", "@Override\n\tpublic directed_weighted_graph getGraph() {\n\t\treturn dwg;\n\t}", "public WeightedDiGraphAPI() {\r\n\t\tthis.mVisitStatus = new HashMap<Integer,Boolean>();\r\n\t\tthis.mVertexList = new TreeSet<Integer>();\r\n\t\tthis.mEdgeList = new PriorityQueue<DirectedEdge>();\r\n\t\tthis.adjList = new HashMap<Integer,List<DirectedEdge>>();\r\n\t\tthis.mMSTedgeList = new ArrayList<DirectedEdge>();\r\n\t}", "public DirectedEdge(int from, int to, double weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public interface weighted_graph_algorithms {\r\n /**\r\n * Init the graph on which this set of algorithms operates on.\r\n * @param g\r\n */\r\n public void init(weighted_graph g);\r\n\r\n /**\r\n * Return the underlying graph of which this class works.\r\n * @return\r\n */\r\n public weighted_graph getGraph();\r\n /**\r\n * Compute a deep copy of this weighted graph.\r\n * @return\r\n */\r\n public weighted_graph copy();\r\n /**\r\n * Returns true if and only if (iff) there is a valid path from EVREY node to each\r\n * other node. NOTE: assume ubdirectional graph.\r\n * @return\r\n */\r\n public boolean isConnected();\r\n /**\r\n * returns the length of the shortest path between src to dest\r\n * Note: if no such path --> returns -1\r\n * @param src - start node\r\n * @param dest - end (target) node\r\n * @return\r\n */\r\n public double shortestPathDist(int src, int dest);\r\n /**\r\n * returns the the shortest path between src to dest - as an ordered List of nodes:\r\n * src--> n1-->n2-->...dest\r\n * see: https://en.wikipedia.org/wiki/Shortest_path_problem\r\n * Note if no such path --> returns null;\r\n * @param src - start node\r\n * @param dest - end (target) node\r\n * @return\r\n */\r\n public List<node_info> shortestPath(int src, int dest);\r\n\r\n /**\r\n * Saves this weighted (undirected) graph to the given\r\n * file name\r\n * @param file - the file name (may include a relative path).\r\n * @return true - iff the file was successfully saved\r\n */\r\n public boolean save(String file);\r\n\r\n /**\r\n * This method load a graph to this graph algorithm.\r\n * if the file was successfully loaded - the underlying graph\r\n * of this class will be changed (to the loaded one), in case the\r\n * graph was not loaded the original graph should remain \"as is\".\r\n * @param file - file name\r\n * @return true - iff the graph was successfully loaded.\r\n */\r\n public boolean load(String file);\r\n}", "public static Graph<Vertex,Edge> createGraphObject()\n\t{\n\t\tGraph<Vertex,Edge> g = new DirectedSparseMultigraph<Vertex, Edge>();\n\t\treturn g;\n\t}", "public ListenableUndirectedWeightedGraph(WeightedGraph<V, E> base)\r\n/* */ {\r\n/* 81 */ super((UndirectedGraph)base);\r\n/* */ }", "public PlainGraph createGraph() {\n PlainGraph graph = new PlainGraph(getUniqueGraphName(), GraphRole.RULE);\n graphNodeMap.put(graph, new HashMap<>());\n return graph;\n }", "protected IWeightedGraph<GraphNode, WeightedEdge> createGraph(List<GoapState> goalState) {\r\n\t\tIWeightedGraph<GraphNode, WeightedEdge> generatedGraph = this.generateGraphObject();\r\n\r\n\t\taddVertices(generatedGraph, goalState);\r\n\t\taddEdges(generatedGraph);\r\n\r\n\t\treturn generatedGraph;\r\n\t}", "public void init(weighted_graph g);", "private static SimpleWeightedGraph<String, DefaultWeightedEdge> criaGrafo() {\r\n\t\tSimpleWeightedGraph<String,DefaultWeightedEdge> graph = new SimpleWeightedGraph<String, DefaultWeightedEdge>(DefaultWeightedEdge.class);\r\n\t\t\r\n\t\tgraph.addVertex(\"a\");\tgraph.addVertex(\"b\");\tgraph.addVertex(\"c\");\r\n\t\tgraph.addVertex(\"d\");\tgraph.addVertex(\"e\");\tgraph.addVertex(\"f\");\r\n\t\tgraph.addVertex(\"g\");\tgraph.addVertex(\"h\");\tgraph.addVertex(\"i\");\r\n\t\t\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"a\",\"b\"),2);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"b\",\"c\"),4);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"c\",\"d\"),2);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"d\",\"e\"),1);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"e\",\"f\"),6);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"f\",\"a\"),7);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"a\",\"g\"),3);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"g\",\"i\"),1);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"g\",\"h\"),3);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"g\",\"b\"),6);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"h\",\"c\"),2);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"h\",\"d\"),8);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"h\",\"i\"),4);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"i\",\"f\"),5);\r\n\t\tgraph.setEdgeWeight(graph.addEdge(\"i\",\"e\"),2);\r\n\t\treturn graph;\r\n\t}", "public interface DirectedGraph {\n\n /**\n * Set a graph label\n * @param label a graph label\n */\n void setGraphLabel(String label);\n\n /**\n * @return the graph label\n */\n String getGraphLabel();\n\n /**\n * Add a node in graph\n * @param node\n * @throws IllegalArgumentException if node is negative\n */\n void addNode(int node);\n\n /**\n * Associating metadata to node\n * @param node the node id\n * @param key the metadata key\n * @param value the metadata value\n */\n void addNodeMetadata(int node, String key, String value);\n\n /**\n * Get the value of the metadata associated with the given node\n * @param node the node to get metadata for\n * @param key the metadata key\n * @return the value or null if not found\n */\n String getNodeMetadataValue(int node, String key);\n\n /**\n * @return the node given the label or -1 if not found\n */\n int getNodeFromMetadata(String metadata);\n\n /**\n * Add an edge in graph from tail to head and return its index\n * @param tail predecessor node\n * @param head successor node\n * @return the edge id or -1 if already exists\n */\n int addEdge(int tail, int head);\n\n /**\n * Set an edge label\n * @param edge a edge id\n * @param label a node label\n */\n void setEdgeLabel(int edge, String label);\n\n /**\n * @return the edge label\n */\n String getEdgeLabel(int edge);\n\n /**\n * @return an array of graph nodes\n */\n int[] getNodes();\n\n /**\n * @return an array of graph edges\n */\n int[] getEdges();\n\n /**\n * @return the edge id from end points or -1 if not found\n */\n int getEdge(int tail, int head);\n\n /**\n * Get the incoming and outcoming edges for the given nodes\n * @param nodes the nodes\n * @return edge indices\n */\n int[] getEdgesIncidentTo(int... nodes);\n\n /**\n * Get the incoming edges to the given nodes\n * @param nodes the nodes\n * @return edge indices\n */\n int[] getInEdges(int... nodes);\n\n /**\n * Get the outcoming edges from the given nodes\n * @param nodes the nodes\n * @return edge indices\n */\n int[] getOutEdges(int... nodes);\n\n /**\n * @return the tail node of the given edge or -1 if not found\n */\n int getTailNode(int edge);\n\n /**\n * @return the head node of the given edge or -1 if not found\n */\n int getHeadNode(int edge);\n\n /**\n * @return true if node belongs to graph else false\n */\n boolean containsNode(int node);\n\n /**\n * @return true if edge belongs to graph else false\n */\n boolean containsEdge(int edge);\n\n /**\n * @return true if tail -> head edge belongs to graph else false\n */\n boolean containsEdge(int tail, int head);\n\n /**\n * @return ancestors of the given node\n */\n int[] getAncestors(int node);\n\n /**\n * @return descendants of the given node\n */\n int[] getDescendants(int node);\n\n /**\n * @return descendants of the given node\n */\n int[] getDescendants(int node, int maxDepth);\n\n /**\n * @return true if queryDescendant is a descendant of queryAncestor\n */\n boolean isAncestorOf(int queryAncestor, int queryDescendant);\n\n /**\n * @return the predecessors of the given node\n */\n int[] getPredecessors(int node);\n\n /**\n * @return the successors of the given node\n */\n int[] getSuccessors(int node);\n\n /**\n * @return the number of head ends adjacent to the given node\n */\n int getInDegree(int node);\n\n /**\n * @return the number of tail ends adjacent to the given node\n */\n int getOutDegree(int node);\n\n /**\n * @return the sources (indegree = 0) of the graph\n */\n int[] getSources();\n\n /**\n * @return the sinks (outdegree = 0) of the graph\n */\n int[] getSinks();\n\n /**\n * @return the subgraph of this graph composed of given nodes\n */\n DirectedGraph calcSubgraph(int... nodes);\n\n /**\n * @return the total number of graph nodes\n */\n default int countNodes() {\n\n return getNodes().length;\n }\n\n /**\n * @return the total number of graph edges\n */\n default int countEdges() {\n\n return getEdges().length;\n }\n\n /**\n * @return true if queryDescendant is a descendant of queryAncestor\n */\n default boolean isDescendantOf(int queryDescendant, int queryAncestor) {\n\n return isAncestorOf(queryAncestor, queryDescendant);\n }\n\n default boolean isSource(int node) {\n return getInDegree(node) == 0 && getOutDegree(node) > 0;\n }\n\n default boolean isSink(int node) {\n return getInDegree(node) > 0 && getOutDegree(node) == 0;\n }\n\n /**\n * The height of a rooted tree is the length of the longest downward path to a leaf from the root.\n *\n * @return the longest path from the root or -1 if it is not a tree\n */\n default int calcHeight() throws NotATreeException {\n\n int[] roots = getSources();\n\n if (roots.length == 0) {\n throw new NotATreeException();\n }\n\n class WrappedCalcLongestPath {\n private int calcLongestPath(int node, TIntList path) throws CycleDetectedException {\n\n if (!containsNode(node)) {\n throw new IllegalArgumentException(\"node \"+ node + \" was not found\");\n }\n\n if (isSink(node)) {\n return path.size()-1;\n }\n\n TIntList lengths = new TIntArrayList();\n for (int edge : getOutEdges(node)) {\n\n int nextNode = getHeadNode(edge);\n\n TIntList newPath = new TIntArrayList(path);\n newPath.add(nextNode);\n\n if (path.contains(nextNode)) {\n throw new CycleDetectedException(newPath);\n }\n\n lengths.add(calcLongestPath(nextNode, newPath));\n }\n\n return lengths.max();\n }\n }\n\n // it is ok if there are multiple roots (see example of enzyme-classification-cv where it misses the root that\n // connect children EC 1.-.-.-, EC 2.-.-.-, ..., EC 6.-.-.-)\n /*if (roots.length > 1) {\n throw new NotATreeMultipleRootsException(roots);\n }*/\n\n return new WrappedCalcLongestPath().calcLongestPath(roots[0], new TIntArrayList(new int[] {roots[0]}));\n }\n\n class NotATreeException extends Exception {\n\n public NotATreeException() {\n\n super(\"not a tree\");\n }\n }\n\n class NotATreeMultipleRootsException extends NotATreeException {\n\n private final int[] roots;\n\n public NotATreeMultipleRootsException(int[] roots) {\n\n super();\n this.roots = roots;\n }\n\n @Override\n public String getMessage() {\n\n return super.getMessage() + \", roots=\" + Arrays.toString(this.roots);\n }\n }\n\n class CycleDetectedException extends NotATreeException {\n\n private final TIntList path;\n\n public CycleDetectedException(TIntList path) {\n\n super();\n\n this.path = path;\n }\n\n @Override\n public String getMessage() {\n\n return super.getMessage() + \", path=\" + this.path;\n }\n }\n}", "@Test\r\n public void edgesTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n //create new shops \r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n\r\n //add them as nodes\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n //create edges \r\n test.createEdges();\r\n\r\n //make sure everyone is connected properly \r\n assertEquals(test.getEdgeWeight(one,two),20);\r\n assertEquals(test.getEdgeWeight(one,three),40);\r\n assertEquals(test.getEdgeWeight(one,four),60);\r\n assertEquals(test.getEdgeWeight(two,one),20);\r\n assertEquals(test.getEdgeWeight(two,three),20);\r\n assertEquals(test.getEdgeWeight(two,four),40);\r\n assertEquals(test.getEdgeWeight(three,one),40);\r\n assertEquals(test.getEdgeWeight(three,two),20);\r\n assertEquals(test.getEdgeWeight(three,four),20);\r\n assertEquals(test.getEdgeWeight(four,one),60);\r\n assertEquals(test.getEdgeWeight(four,two),40);\r\n assertEquals(test.getEdgeWeight(four,three),20);\r\n }", "@Override\n\tpublic void init(directed_weighted_graph g) {\n\t\tthis.dwg = g;\n\t}", "public Edge(Node source, Node sink, Object weight) {\n\t\tthis(source, sink);\n\t\tsetWeight(weight);\n\t}", "@Override\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS(this.ga);//create the copy graph via copy constructor\n return copy;\n }", "private KeyedGraph<VWBetw, Edge> prepareGraph(final DataSet edges) {\n KeyedGraph<VWBetw, Edge> graph;\n \n // Get the graph orientation.\n int graphType = -1;\n if (globalOrientation != null) {\n graphType = globalOrientation.equalsIgnoreCase(DIRECTED)\n ? GraphSchema.DIRECT\n : globalOrientation.equalsIgnoreCase(REVERSED)\n ? GraphSchema.DIRECT_REVERSED\n : globalOrientation.equalsIgnoreCase(UNDIRECTED)\n ? GraphSchema.UNDIRECT\n : -1;\n } else if (graphType == -1) {\n LOGGER.warn(\"Assuming a directed graph.\");\n graphType = GraphSchema.DIRECT;\n }\n \n // Create the graph.\n if (weightsColumn != null) {\n graph = new WeightedGraphCreator<VWBetw, Edge>(\n edges,\n graphType,\n edgeOrientationColumnName,\n VWBetw.class,\n Edge.class,\n weightsColumn).prepareGraph();\n } else {\n throw new UnsupportedOperationException(\n \"ST_Distance has not yet been implemented for \"\n + \"unweighted graphs.\");\n }\n return graph;\n }", "public static Graph createGraph(int V, int E, boolean weighted) throws IllegalArgumentException {\r\n\t\tRandom rand = new Random();\r\n\t\tif (E < V || E > (V*(V-1))) {\r\n\t\t\tthrow new IllegalArgumentException(\"To many/few edges!\");\r\n\t\t}\r\n\t\t\r\n\t\tGraph g = new Graph(V);\r\n\t\t\r\n\t\t/* Unweighted graph*/\r\n\t\tif (weighted == false) {\r\n\t\t\tfor (int i = 0; i < g.V; i++) {\r\n\t\t\t\tif(!g.addRandomEdge(i, rand.nextInt(V), 1)) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tif(g.addRandomEdge(rand.nextInt(V), rand.nextInt(V), 1)) {E--;}\r\n\t\t\t}\r\n\t\t/* Weighted graph*/\t\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < g.V; i++) {\r\n\t\t\t\tif(!g.addRandomEdge(i, rand.nextInt(V), rand.nextInt(20))) {i--;} \r\n\t\t\t\telse {E--;}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile (E > 0) {\r\n\t\t\t\tif (g.addRandomEdge(rand.nextInt(V), rand.nextInt(V), rand.nextInt(20))) {E--;}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn g;\r\n\t}", "void addEdge(int source, int destination, int weight);", "public DirectedAcyclicGraphImpl() {\r\n super();\r\n topologicalsorting = new TopologicalSorting( this );\r\n }", "@Override\n public directed_weighted_graph copy() {\n try {\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n ObjectOutputStream oos = new ObjectOutputStream(bos);\n oos.writeObject(G);\n oos.flush();\n oos.close();\n bos.close();\n byte[] byteData = bos.toByteArray();\n\n ByteArrayInputStream bis = new ByteArrayInputStream(byteData);\n return (directed_weighted_graph) (new ObjectInputStream(bis).readObject());\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "public WeightedGraph(List<E> v, List<WeightedEdge> edges) {\n this();\n for (E e : v) {\n addVertex(e);\n }\n for (WeightedEdge e : edges) {\n addEdge(e);\n }\n }", "public directed_weighted_graph deepCopy() {\n DWGraph_DS copyGraph = new DWGraph_DS(this); //create a new graph with the original graph data (only primitives)\n HashMap<Integer, node_data> copyNodesMap = new HashMap<>(); //create a new nodes HashMap for the new graph\n for (node_data node : nodes.values()) { //loop through all nodes in the original graph\n copyNodesMap.put(node.getKey(), new NodeData((NodeData) node)); //makes a duplicate of the original HashMap\n }\n copyGraph.nodes = copyNodesMap; //set the new graph nodes to the new HashMap we made.\n return copyGraph;\n }", "public WeightedAdjMatGraph(){\n this.edges = new int[DEFAULT_CAPACITY][DEFAULT_CAPACITY];\n this.n = 0;\n this.vertices = (T[])(new Object[DEFAULT_CAPACITY]);\n }", "public WeightedEdge(){\n\t\t\n\t}", "public static Graph buildGraph1() {\n Graph g = new Graph(\"Undirected graph For Kruskal Algorithm\");\n g.addEdge(\"A\", \"E\", 5);\n g.addEdge(\"A\", \"D\", 3);\n g.addEdge(\"A\", \"H\", 7);\n g.addEdge(\"A\", \"B\", 6);\n g.addEdge(\"D\", \"E\", 9);\n g.addEdge(\"D\", \"C\", 12);\n g.addEdge(\"C\", \"B\", 20);\n g.addEdge(\"B\", \"F\", 15);\n g.addEdge(\"F\", \"G\", 17);\n g.addEdge(\"G\", \"H\", 1);\n\n g.sortEdgesByIncreasingWeights();\n\n System.out.println(g);\n\n return g;\n }", "TripleGraph createTripleGraph();", "public GraphWrapper() {\n\t\tthis.graph = new Graph<T,E>();\n\t}", "public PetriNet createSimplePetriNet(int tokenWeight) throws PetriNetComponentException {\n String arcWeight = Integer.toString(tokenWeight);\n return APetriNet.with(AToken.called(\"Default\").withColor(Color.BLACK)).and(\n APlace.withId(\"P1\").containing(1, \"Default\").token()).and(APlace.withId(\"P2\")).and(\n AnImmediateTransition.withId(\"T1\")).and(\n ANormalArc.withSource(\"P1\").andTarget(\"T1\").with(arcWeight, \"Default\").tokens()).andFinally(\n ANormalArc.withSource(\"T1\").andTarget(\"P2\").with(arcWeight, \"Default\").tokens());\n }", "public Graph<String, DefaultWeightedEdge> loadGraphFrom(String filepath) throws FileNotFoundException{\n\t\tif (!isGraphFile(filepath)){\n\t\t\tthrow new IllegalArgumentException(\"'\" + filepath + \"' is not a .graph file\");\n\t\t}\n\t\t\n\t\tFile file = new File(filepath);\n\t\tScanner graphdata;\n\t\t\n\t\t//wirft eine FileNotFoundException, wenn File nicht vorhanden\n\t\tgraphdata = new Scanner(file);\n\n\t\tWeightedGraph<String, DefaultWeightedEdge> graph = new DirectedWeightedMultigraph<String, DefaultWeightedEdge>(DefaultWeightedEdge.class);\n\t\tDefaultWeightedEdge aktEdge;\n\t\t\n\n\t\t//Graph einlesen:\n\t\twhile(graphdata.hasNext()){\n\t\t\tString aktSting = graphdata.next().trim();\n\t\t\t\t\t\t\t\t\n\t\t\tString[] aktAry = aktSting.split(\",\");\n\t\t\tString ecke1 = aktAry[0].trim();\n\t\t\tString ecke2 = aktAry[1].trim();\n\t\t\tDouble weight = Double.parseDouble(aktAry[2].trim());\n\t\t\tif(!graph.containsVertex(ecke1)){\n\t\t\t\tgraph.addVertex(ecke1);\n\t\t\t}\n\t\t\tif(!graph.containsVertex(ecke2)){\n\t\t\t\tgraph.addVertex(ecke2);\n\t\t\t}\n\t\t\t\n\t\t\tif (!graph.containsEdge(ecke1, ecke2)){\n\t\t\t\taktEdge = graph.addEdge(ecke1, ecke2);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, weight);\n\t\t\t\taktEdge = graph.addEdge(ecke2, ecke1);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, weight);\n\t\t\t}else{\n\t\t\t\taktEdge = graph.getEdge(ecke1, ecke2);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, graph.getEdgeWeight(aktEdge) + weight);\n\t\t\t\taktEdge = graph.getEdge(ecke2,ecke1);\n\t\t\t\tgraph.setEdgeWeight(aktEdge, graph.getEdgeWeight(aktEdge) + weight);\n\t\t\t}\n\t\t}\n\t\treturn graph;\n\t}", "@Override\n public void addEdge(V source, V destination, double weight)\n {\n super.addEdge(source, destination, weight);\n super.addEdge(destination, source, weight);\n }", "@Override\r\n\tpublic void link(E src, E dst, int weight) {\r\n\t\tinsertVertex(src); //Inserts src if not currently in the graph\r\n\t\tinsertVertex(dst); //Inserts dst if not currently in the graph\r\n\t\tEdge<E> newedge1 = new Edge<>(src, dst, weight);\r\n\r\n\t\tArrayList<Edge<E>> sEdges = adjacencyLists.get(src);\r\n\t\tsEdges.remove(newedge1); //if the edge already exists remove it\r\n\t\tsEdges.add(newedge1);\r\n\t\tif(!isDirected) { //Add the additional edge if this graph is undirected\r\n\t\t\tEdge<E> newedge2 = new Edge<>(dst, src, weight);\r\n\r\n\t\t\tArrayList<Edge<E>> dEdges = adjacencyLists.get(dst);\r\n\t\t\tdEdges.remove(newedge2); //if the edge already exists remove it\r\n\t\t\tdEdges.add(newedge2); \r\n\t\t}\r\n\t}", "@RequestMapping(value = \"/max_weight_dag\", method = RequestMethod.GET)\r\n @ResponseBody\r\n public DirectedGraph getMaxWeightDAG() {\n UndirectedGraph graph = new UndirectedGraph(5);\r\n graph.addEdge(0, 1, 10.0);\r\n graph.addEdge(1, 2, 11.0);\r\n graph.addEdge(2, 3, 13.0);\r\n graph.addEdge(3, 4, 14.0);\r\n graph.addEdge(4, 0, 15.0);\r\n return graph;\r\n }", "public interface Graph<V> {\n /**\n * F??gt neuen Knoten zum Graph dazu.\n * @param v Knoten\n * @return true, falls Knoten noch nicht vorhanden war.\n */\n boolean addVertex(V v);\n\n /**\n * F??gt neue Kante (mit Gewicht 1) zum Graph dazu.\n * @param v Startknoten\n * @param w Zielknoten\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist oder Knoten identisch sind.\n * @return true, falls Kante noch nicht vorhanden war.\n */\n boolean addEdge(V v, V w);\n\n /**\n * F??gt neue Kante mit Gewicht weight zum Graph dazu.\n * @param v Startknoten\n * @param w Zielknoten\n * @param weight Gewicht\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist oder Knoten identisch sind.\n * @return true, falls Kante noch nicht vorhanden war.\n */\n boolean addEdge(V v, V w, double weight);\n\n /**\n * Pr??ft ob Knoten v im Graph vorhanden ist.\n * @param v Knoten\n * @return true, falls Knoten vorhanden ist.\n */\n boolean containsVertex(V v);\n\n /**\n * Pr??ft ob Kante im Graph vorhanden ist.\n * @param v Startknoten\n * @param w Endknoten\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist.\n * @return true, falls Kante vorhanden ist.\n */\n boolean containsEdge(V v, V w);\n \n /**\n * Liefert Gewicht der Kante zur??ck.\n * @param v Startknoten\n * @param w Endknoten\n * @throws IllegalArgumentException falls einer der Knoten\n * nicht im Graph vorhanden ist.\n * @return Gewicht, falls Kante existiert, sonst 0.\n */\n double getWeight(V v, V w);\n\n /**\n * Liefert Anzahl der Knoten im Graph zur??ck.\n * @return Knotenzahl.\n */\n int getNumberOfVertexes();\n\n /**\n * Liefert Anzahl der Kanten im Graph zur??ck.\n * @return Kantenzahl.\n */\n int getNumberOfEdges();\n\n /**\n * Liefert Liste aller Knoten im Graph zur??ck.\n * @return Knotenliste\n */\n List<V> getVertexList();\n \n /**\n * Liefert Liste aller Kanten im Graph zur??ck.\n * @return Kantenliste.\n */\n List<Edge<V>> getEdgeList();\n\n /**\n * Liefert eine Liste aller adjazenter Knoten zu v.\n * Genauer: g.getAdjacentVertexList(v) liefert eine Liste aller Knoten w,\n * wobei (v, w) eine Kante des Graphen g ist.\n * @param v Knoten\n * @throws IllegalArgumentException falls Knoten v\n * nicht im Graph vorhanden ist.\n * @return Knotenliste\n */\n List<V> getAdjacentVertexList(V v);\n\n /**\n * Liefert eine Liste aller inzidenten Kanten.\n * Genauer: g.getIncidentEdgeList(v) liefert\n * eine Liste aller Kanten im Graphen g mit v als Startknoten.\n * @param v Knoten\n * @throws IllegalArgumentException falls Knoten v\n * nicht im Graph vorhanden ist.\n * @return Kantenliste\n */\n List<Edge<V>> getIncidentEdgeList(V v);\n}", "private Graph<Node, DefaultEdge> initialiseSpaceGraph() {\n Graph<Node, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class);\n g = addNodes(g);\n g = addEdges(g);\n return g;\n }", "public EdgeImpl(Vertex sourceVertex, Vertex targetVertex, double edgeWeight, Graph graph) {\n this.sourceVertex = sourceVertex;\n this.targetVertex = targetVertex;\n this.edgeWeight = edgeWeight;\n this.graph = graph;\n }", "public UnmodifiableDirectedGraph(DirectedGraph<V, E> g)\n {\n super(g);\n }", "public WeightedGraph(Collection<K> v)\n {\n\t // make ourselves a private copy of the vertex set\n verts = new HashSet<K>(v);\n\n\t // set up empty adjacency lists for each vertex\n adjMaps = new HashMap<K, Map<K, Edge>>();\n for (K src : verts)\n {\n Map<K, Edge> adjMap = new HashMap<K, Edge>();\n adjMaps.put(src, adjMap);\n }\n }", "protected Graph<Sense<V>, DefaultWeightedEdge> buildSenseGraph() {\n final var builder = SimpleWeightedGraph.<Sense<V>, DefaultWeightedEdge>createBuilder(DefaultWeightedEdge.class);\n\n for (final var sourceEntry : inventory.entrySet()) {\n if (sourceEntry.getValue().isEmpty()) {\n builder.addVertex(new IndexedSense<>(sourceEntry.getKey(), 0));\n }\n\n final var source = sourceEntry.getKey();\n\n for (final var target : sourceEntry.getValue().keySet()) {\n final var sourceSense = requireNonNull(senses.get(source).get(inventory.get(source).get(target)));\n final var targetSense = requireNonNull(senses.get(target).get(inventory.get(target).get(source)));\n\n final var edge = requireNonNull(graph.getEdge(source, target));\n final var weight = graph.getEdgeWeight(edge);\n\n builder.addEdge(sourceSense, targetSense, weight);\n }\n }\n\n return builder.build();\n }", "public AtomGraph(IAtomContainer container, boolean weighted) {\n this();\n adjacencyMatrix = new AdjacencyAtomMatrix(container.getAtomCount());\n setAtomContainer(container, weighted);\n }", "@Override\n public Graph newInstance(int vertexesCount) {\n return new SimpleGraph();\n }", "@Override\r\n public weighted_graph copy() {\n weighted_graph copy = new WGraph_DS();\r\n for (node_info curr : this.Graph.getV()) { //The loop passes through all the ver' of the graph\r\n Nodes t = new Nodes(curr); //create new node\r\n copy.addNode(t.key); //copy the the old node to the new node\r\n }\r\n for (node_info curr0 : this.Graph.getV()) {\r\n for (node_info curr1 : this.Graph.getV(curr0.getKey())) { //this loops pass over the all nodes and copy the connection\r\n double i = this.Graph.getEdge(curr0.getKey(), curr1.getKey());\r\n if (i != -1) {\r\n copy.connect(curr0.getKey(), curr1.getKey(), i);\r\n }\r\n }\r\n }\r\n return copy;\r\n\r\n }", "GraphFactory getGraphFactory();", "protected void addDefaultEdges(IWeightedGraph<GraphNode, WeightedEdge> graph, Queue<GraphNode> nodesToWorkOn) {\r\n\r\n\t\t// graphNode.action != null -> start and ends\r\n\t\tfor (GraphNode graphNode : graph.getVertices()) {\r\n\t\t\tif (!this.startNode.equals(graphNode) && graphNode.action != null && (graphNode.preconditions.isEmpty()\r\n\t\t\t\t\t|| areAllPreconditionsMet(graphNode.preconditions, this.startNode.effects))) {\r\n\t\t\t\taddEgdeWithWeigth(graph, this.startNode, graphNode, new WeightedEdge(), 0);\r\n\t\t\t\tif (!nodesToWorkOn.contains(graphNode)) {\r\n\t\t\t\t\tnodesToWorkOn.add(graphNode);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Add the path to the node to the GraphPath list in the node\r\n\t\t\t\t// since this is the first step inside the graph.\r\n\t\t\t\tList<GraphNode> vertices = new ArrayList<GraphNode>();\r\n\t\t\t\tList<WeightedEdge> edges = new ArrayList<WeightedEdge>();\r\n\r\n\t\t\t\tvertices.add(this.startNode);\r\n\t\t\t\tvertices.add(graphNode);\r\n\r\n\t\t\t\tedges.add(graph.getEdge(this.startNode, graphNode));\r\n\r\n\t\t\t\tWeightedPath<GraphNode, WeightedEdge> graphPathToDefaultNode = PathFactory.generateWeightedPath(graph,\r\n\t\t\t\t\t\tthis.startNode, graphNode, vertices, edges);\r\n\r\n\t\t\t\tgraphNode.addGraphPath(null, graphPathToDefaultNode);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "GraphLayout createGraphLayout();", "public WeightedGraph(List<K> v)\n\t{\n\t // make ourselves a private copy of the vertex set\n\t verts = new HashSet<K>(v);\n\n\t // set up empty adkacency lists for each vertex\n\t adjLists = new HashMap<K, List<HashMap<K, Integer>>>();\n\t for (K src : verts)\n\t\t{\n\t\t adjLists.put(src, new ArrayList<HashMap<K, Integer>>());\n\t\t}\n\t}", "@Override\r\n public void init(weighted_graph g) {\r\n this.Graph = g;\r\n }", "@Override\r\n public weighted_graph getGraph() {\r\n return this.Graph;\r\n }", "public static Graph readWeightedGraph(String path) throws IOException {\r\n\t\t// construtor de Aresta identifica se eh com peso\r\n\t\treturn readGraph(path);\r\n\t}", "@Test\n void testDeepCopy(){\n weighted_graph g = new WGraph_DS();\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.addNode(1);\n g.addNode(2);\n g.addNode(3);\n g.addNode(4);\n g.connect(1,2,13);\n g.connect(1,3,14);\n g.connect(1,4,15);\n g.connect(2,3,23);\n weighted_graph g1 = ga.copy();\n g1.removeNode(3);\n assertNotNull(g.getNode(3));\n assertEquals(14,g.getEdge(1,3));\n assertNull(g1.getNode(3));\n assertEquals(-1,g1.getEdge(1,3));\n }", "public Graph(boolean p_isDirectedGraph) {\n\t\tisDirectedGraph = p_isDirectedGraph;\n\t}", "public static GraphNode createGraphNodeForUseCase() {\n GraphNode graphNode = new GraphNode();\n GraphNode graphNodeName = new GraphNode();\n\n for (int i = 0; i < 3; i++) {\n GraphNode childNode = new GraphNode();\n\n childNode.setPosition(AccuracyTestHelper.createPoint(60, 20 + 20 * i));\n childNode.setSize(AccuracyTestHelper.createDimension(100, 22));\n\n graphNodeName.addContained(childNode);\n }\n\n graphNode.addContained(graphNodeName);\n\n graphNode.setPosition(AccuracyTestHelper.createPoint(20, 20));\n graphNode.setSize(AccuracyTestHelper.createDimension(100, 100));\n\n // create a use case\n UseCase usecase = new UseCaseImpl();\n\n // set stereotype\n Stereotype stereotype = new StereotypeImpl();\n usecase.addStereotype(stereotype);\n\n // set namespace\n Namespace namespace = new MockAccuracyNamespaceImpl();\n usecase.setNamespace(namespace);\n\n // create a semantic model\n Uml1SemanticModelBridge semanticModel = new Uml1SemanticModelBridge();\n semanticModel.setElement(usecase);\n\n graphNode.setSemanticModel(semanticModel);\n\n return graphNode;\n }", "public Edge(int source, int dest, int weight){\n\t\tthis.source = source;\n\t\tthis.dest = dest;\n\t\tthis.weight = weight;\n\t}", "public AtomGraph(IAtomContainer container, IAtomContainer skipVertices, boolean weighted) {\n this();\n adjacencyMatrix = new AdjacencyAtomMatrix(container.getAtomCount());\n for (IAtom atom : skipVertices.atoms()) {\n this.skipVertices.add(atom);\n }\n setAtomContainer(container, weighted);\n }", "public void addEdge(Node source, Node destination, int weight) {\n nodes.add(source);\n nodes.add(destination);\n checkEdgeExistance(source, destination, weight);\n\n if (!directed && source != destination) {\n checkEdgeExistance(destination, source, weight);\n }\n }", "public DFSGraph() {\n this(new HashMap<>(), HashMap::new, HashSet::new, HashSet::new);\n }", "public void addEdge(Graph graph, int source, int destination, double weight){\r\n\r\n Node node = new Node(destination, weight);\r\n LinkedList<Node> list = null;\r\n\r\n //Add an adjacent Node for source\r\n list = adjacencyList.get((double)source);\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)source, list);\r\n\r\n //Add adjacent node again since graph is undirected\r\n node = new Node(source, weight);\r\n\r\n list = null;\r\n\r\n list = adjacencyList.get((double)destination);\r\n\r\n if (list == null){\r\n list = new LinkedList<Node>();\r\n }\r\n\r\n list.addFirst(node);\r\n adjacencyList.put((double)destination, list);\r\n }", "public AtomGraph(IAtomContainer container, IAtomContainerSet skipVertices, boolean weighted) {\n this();\n adjacencyMatrix = new AdjacencyAtomMatrix(container.getAtomCount());\n for (IAtomContainer ac : skipVertices.atomContainers()) {\n for (IAtom atom : ac.atoms()) {\n this.skipVertices.add(atom);\n }\n }\n setAtomContainer(container, weighted);\n }", "@Test\n void testShortestPathDist(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(Double.compare(45,ga.shortestPathDist(1,4)) == 0);\n assertEquals(0,ga.shortestPathDist(1,1));\n assertEquals(-1,ga.shortestPathDist(1,200));\n }", "public interface Graph {\n\n\t/**\n\t * Method to add the edge from start to end to the graph.\n\t * Adding self-loops is not allowed.\n\t * @param start start vertex\n\t * @param end end vertex\n\t */\n\tpublic void addEdge(int start, int end);\n\n\t/**\n\t * Method to add the edge with the given weight to the graph from start to end.\n\t * Adding self-loops is not allowed.\n\t * @param start number of start vertex\n\t * @param end number of end vertex\n\t * @param weight weight of edge\n\t */\n\tpublic void addEdge(int start, int end, double weight);\n\n\t/**\n\t * Method to add a vertex to the graph.\n\t */\n\tpublic void addVertex();\n\t\n\t/**\n\t * Method to add multiple vertices to the graph.\n\t * @param n number of vertices to add\n\t */\n\tpublic void addVertices(int n);\n\n\t/**\n\t * Returns all neighbors of the given vertex v (all vertices i with {i,v} in E or (i,v) or (v,i) in E).\n\t * @param v vertex whose neighbors shall be returned\n\t * @return List of vertices adjacent to v\n\t */\n\tpublic List<Integer> getNeighbors(int v);\n\n\t/**\n\t * Returns a list containing all predecessors of v. In an undirected graph all neighbors are returned.\n\t * @param v vertex id\n\t * @return list containing all predecessors of v\n\t */\n\tpublic List<Integer> getPredecessors(int v);\n\n\t/**\n\t * Returns a list containing all successors v. In an undirected graph all neighbors are returned.\n\t * @param v vertex id\n\t * @return list containing all edges starting in v\n\t */\n\tpublic List<Integer> getSuccessors(int v);\n\n\t/**\n\t * Method to get the number of vertices.\n\t * @return number of vertices\n\t */\n\tpublic int getVertexCount();\n\n\t/**\n\t * Method to get the weight of the edge {start, end} / the arc (start, end).\n\t * @param start start vertex of edge / arc\n\t * @param end end vertex of edge / arc\n\t * @return Double.POSITIVE_INFINITY, if the edge does not exist, c_{start, end} otherwise\n\t */\n\tpublic double getEdgeWeight(int start, int end);\n\n\t/**\n\t * Method to test whether the graph contains the edge {start, end} / the arc (start, end).\n\t * @param start start vertex of the edge\n\t * @param end end vertex of the edge\n\t */\n\tpublic boolean hasEdge(int start, int end);\n\n\t/**\n\t * Method to remove an edge from the graph, defined by the vertices start and end.\n\t * @param start start vertex of the edge\n\t * @param end end vertex of the edge\n\t */\n\tpublic void removeEdge(int start, int end);\n\n\t/**\n\t * Method to remove the last vertex from the graph.\n\t */\n\tpublic void removeVertex();\n\n\t/**\n\t * Returns whether the graph is weighted.\n\t * A graph is weighted if an edge with weight different from 1.0 has been added to the graph.\n\t * @return true if the graph is weighted\n\t */\n\tpublic boolean isWeighted();\n\n\t/**\n\t * Returns whether the graph is directed.\n\t * @return true if the graph is directed\n\t */\n\tpublic boolean isDirected();\n\n}", "Edge createEdge(Vertex src, Vertex tgt, boolean directed);", "public static directed_weighted_graph loadgraph(String json) {\n\n\n GsonBuilder Gbuilde = new GsonBuilder();\n Gbuilde.registerTypeAdapter(DWGraph_DS.class, new graph_game_reader());\n Gson gson = Gbuilde.create();\n\n return gson.fromJson(json, DWGraph_DS.class);\n }", "public MultiGraph(boolean directed) {\r\n\t\tsuper(directed ? Type.DIRECTED : Type.UNDIRECTED);\r\n\t}", "public void addEdge(int start, int end, double weight);", "public DirectedEdge(int v, int w, int distance, double cost) {\n if (v < 0)\n throw new IndexOutOfBoundsException(\"Must be postive integers!\");\n if (w < 0)\n throw new IndexOutOfBoundsException(\"Must be postive integers!\");\n if (Double.isNaN(cost))\n throw new IllegalArgumentException(\"Weight is NaN\");\n this.v = v;\n this.w = w;\n this.setCost(cost);\n this.setDistance(distance);\n }", "public AdjacencyListGraph(boolean isDirected) {\r\n\t\tthis.isDirected = isDirected;\r\n\t\tvertices = new HashMap<>();\r\n\t\tadjacencyLists = new HashMap<>();\r\n\t}", "public Edge(Node from, Node to, int weight) {\n this.from = from;\n this.to = to;\n this.weight = weight;\n }", "public interface Dijkstra<V,E>\n{\n\t/**\n\t * Sets the graph to use in computation\n\t */\n\tpublic void setGraph(Graph<V,E> graph);\n\t\n\t/**\n\t * Sets the start vertex the algorithm will use in computation\n\t * @throws IllegalArgumentException if the start vertex does not exist in the graph\n\t * @throws IllegalStateException if no graph has been set\n\t */\n\tpublic void setStart(int startId) throws IllegalArgumentException, IllegalStateException;\n\t\n\t/**\n\t * Sets the weighing to be used in computing the cost of traversing an edge\n\t */\n\tpublic void setWeighing(Weighing<E> weighing);\n\t\n\t/**\n\t * Computes the shortest path to all vertices from the start vertex in the graph\n\t * using the weighing function\n\t * @throws IllegalStateException if the graph, start vertex, or weighing object have not been set\n\t */\n\tpublic void computeShortestPath() throws IllegalStateException;\n\t\n\t/**\n\t * Returns the path from the start vertex to the end vertex provided\n\t * @return a list representing the shortest path. The first element is the start vertex, and the last\n\t * is the end vertex.\n\t * @throws IllegalArgumentException if endId is not a vertex in the graph\n\t * @throws IllegalStateException if computeShortestPath has not been called since any of the set methods\n\t * were last called\n\t */\n\tpublic List<Integer> getPath(int endId) throws IllegalArgumentException, IllegalStateException;\n\t\n\t/**\n\t * Returns the cost of the shortest path from the start vertex to the end vertex where\n\t * cost is defined by the sum of the weights of all the edges that connects the path as\n\t * defined by the weighing object.\n\t * @throws IllegalArgumentException if endId is not a vertex in the graph\n\t * @throws IllegalStateException if computeShortestPath has not been called since any of the set methods\n\t * were last called\n\t */\n\tpublic double getCost(int endId) throws IllegalArgumentException, IllegalStateException;\n}", "@Override\n\tpublic void connect(int src, int dest, double w) {\n\t\tif(w<=0)\n\t\t{\n\t\t\tSystem.err.println(\"The weight must be positive! . connect failed\");\n\t\t\treturn;\n\t\t}\n\t\tEdgeData e = new EdgeData(src, dest, w);\n\t\tif (!Nodes.containsKey(src) || !Nodes.containsKey(dest)) {\n\t\t\tSystem.err.println(\"can't connect\");\n\t\t\treturn;\n\t\t}\n\t\tEdges.get(src).put(dest, e);\n\t\tnumOfEdges++;\n\t\tMC++;\n\t}", "void addNode(int weight) \n {\n Node newNode = new Node(this.numNodes, weight);\n this.nodeList.add(newNode);\n this.numNodes = this.numNodes + 1;\n \n }", "public abstract boolean addEdge(Node node1, Node node2, int weight);", "@Override\n\tpublic graph copy() {\n\t\tgraph copy = new DGraph();\n\t\tCollection<node_data> nColl = this.GA.getV();\n\t\tfor (node_data node : nColl) {\n\t\t\tnode_data temp = new Node((Node) node );\n\t\t\tcopy.addNode(node);\n\t\t}\n\t\tCollection<node_data> nColl2 = this.GA.getV();\n\t\tfor (node_data node1 : nColl2) {\n\t\t\tCollection<edge_data> eColl = this.GA.getE(node1.getKey());\n\t\t\tif (eColl!=null) {\n\t\t\t\tfor (edge_data edge : eColl) {\n\t\t\t\t\tcopy.connect(edge.getSrc(), edge.getDest(), edge.getWeight());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn copy;\n\t}", "public static Graph instantiateAdjacencyMapGraph() {\r\n\t\treturn new AdjacencyMapGraph();\r\n\t}", "@Override\r\n\tpublic void FloydWarshall() {\r\n\t\tgraphForWarshall = new AdjacencyMatrixGraph<>(getOrder(), isDirected);\r\n\t\tvertices.forEach((E t, Vertex<E> u) -> {\r\n\t\t\tgraphForWarshall.insertVertex(t);\r\n\t\t});\r\n\t\tadjacencyLists.forEach((E t, ArrayList<Edge<E>> u) -> {\r\n\t\t\tfor(Edge<E> ale : u) {\r\n\t\t\t\tgraphForWarshall.link(ale.getSrc(), ale.getDst(), ale.getWeight());\r\n\t\t\t}\r\n\t\t});\r\n\t\tgraphForWarshall.FloydWarshall();\r\n\t}", "public Builder() {\n this(Graphs.<N, E>createUndirected());\n }", "public Edge(Object vertex1, Object vertex2, int w){\n v1 = vertex1;\n v2 = vertex2;\n weight = w;\n }", "public static Graph dijkstra(Graph graph, Node source) {\n source.distance = 0;\n Set<Node> settledNodes = new HashSet<>();\n Set<Node> unsettledNodes = new HashSet<>();\n unsettledNodes.add(source);\n \n while (unsettledNodes.size() != 0) {\n Node currentNode = Graph.getLowestDistanceNode(unsettledNodes);\n unsettledNodes.remove(currentNode);\n for (Map.Entry<Node, Integer> adjacencyPair: \n currentNode.adjacentNodes.entrySet()) {\n Node adjacentNode = adjacencyPair.getKey();\n Integer edgeWeight = adjacencyPair.getValue();\n if (!settledNodes.contains(adjacentNode)) {\n Graph.calculateMinimumDistance(adjacentNode, edgeWeight, currentNode);\n unsettledNodes.add(adjacentNode);\n }\n }\n settledNodes.add(currentNode);\n }\n return graph;\n }", "public static void createGraph(MinimumTrialsSourceToDestWord graph, String[] dictionary)\n {\n // creates nodes: one for each string in the list\n for (int i = 0; i < dictionary.length; i++)\n {\n graph.addNode(dictionary[i]);\n }\n \n // add edges only between the nodes which have distance of 1 between them\n for (int i = 0; i < dictionary.length; i++)\n {\n for (int j = 0; j < dictionary.length; j++)\n {\n if (editDistance(dictionary[i], dictionary[j]) == 1)\n {\n graph.addEdge(dictionary[i], dictionary[j], 1);\n }\n }\n }\n }", "public DirectedEdge(Graph g, Vertex v1, Vertex v2, Vertex source){\n\t\tsuper(g, v1, v2);\n\t\tthis.source = source;\n\t}", "void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}", "public static interface DiGraphNode<N, E> extends GraphNode<N, E> {\n\n public List<? extends DiGraphEdge<N, E>> getOutEdges();\n\n public List<? extends DiGraphEdge<N, E>> getInEdges();\n\n /** Returns whether a priority has been set. */\n boolean hasPriority();\n\n /**\n * Returns a nonnegative integer priority which can be used to order nodes.\n *\n * <p>Throws if a priority has not been set.\n */\n int getPriority();\n\n /** Sets a node priority, must be non-negative. */\n void setPriority(int priority);\n }", "public WGraph_DS(WGraph_DS other) {\n\tnodes = new HashMap<>();\n\tfor(node_info n: other.getNodes().values()) {\n\t\t\n\t\tthis.getNodes().put(n.getKey(), n);\n\t}\n\tthis.edge_size = other.edge_size;\n\tthis.mc = other.mc;\n}", "public InTree<V,E> weightedShortestPaths(V source)\n\t\tthrows NegativeWeightEdgeException, DisconnectedGraphException;", "boolean addEdge(V v, V w, double weight);", "public Edge(L source,L target,Integer weight) {\r\n \tsou=source;\r\n \ttar=target;\r\n \twei=weight;\r\n \tcheckRep();\r\n }", "@Test\r\n public void graphTest(){\r\n DirectedGraph test= new DirectedGraph();\r\n\r\n //create shops and add to nodes list\r\n Shop one=new Shop(1,new Location(10,10));\r\n Shop two =new Shop(2,new Location(20,20));\r\n Shop three=new Shop(3,new Location(30,30));\r\n Shop four=new Shop(4,new Location(40,40));\r\n assertEquals(test.addNode(one),true);\r\n assertEquals(test.addNode(two),true);\r\n assertEquals(test.addNode(three),true);\r\n assertEquals(test.addNode(four),true);\r\n\r\n //try to add a duplicate\r\n assertEquals(test.addNode(new Shop(1,new Location(10,10))),false);\r\n\r\n //add edge\r\n assertEquals(test.addEdge(one,two,5),true);\r\n assertEquals(test.addEdge(one,three,2),true);\r\n assertEquals(test.addEdge(two,three,6),true);\r\n assertEquals(test.addEdge(four,two,8),true);\r\n\r\n //obtain a facility from the graph\r\n assertEquals(test.getFacility(one),one);\r\n\r\n //try to obtain a non-existent facility \r\n assertEquals(test.getFacility(new Shop(12,new Location(50,50))),null);\r\n\r\n //test closest neighbor \r\n assertEquals(test.returnClosestNeighbor(one),three);\r\n assertEquals(test.returnClosestNeighbor(two),one);\r\n }", "public PackingGraphLayout(NodeLinkGraphLayout layout) {\n this.layout = layout;\n }", "private static WeightedUndirectedGraph addNodesGraph(WeightedUndirectedGraph g, int k, String graph, NodesMapper<String> mapper) throws IOException {\n ReadFile rf = new ReadFile();\n String[] lines = rf.readLines(graph);\n\n // map the words into id for g stilo\n //NodesMapper<String> mapper = new NodesMapper<String>();\n // creathe the graph\n // keep in mind that the id of a word is mapper.getId(s1) - 1 (important the -1)\n int n = lines.length;\n for (int i = 0; i < n; i++) {\n // split the line in 3 parts: node1, node2, and weight\n String[] line = lines[i].split(\" \");\n if (Integer.parseInt(line[3]) == k) {\n String node1 = line[0];\n String node2 = line[1];\n Double w = Double.parseDouble(line[2]);\n // the graph is directed, add links in both ways\n g.add(mapper.getId(node1) - 1, mapper.getId(node2) - 1, w);\n //g.add(mapper.getId(node2) - 1, mapper.getId(node1) - 1, w);\n }\n\n }\n return g;\n }" ]
[ "0.6768132", "0.67489266", "0.6737185", "0.66773593", "0.6655718", "0.66376746", "0.65151924", "0.6410576", "0.63893664", "0.63656384", "0.6273781", "0.61641216", "0.61552495", "0.6146054", "0.6093688", "0.60884786", "0.6022783", "0.5972649", "0.59237504", "0.5922876", "0.59228295", "0.58532673", "0.58453643", "0.584406", "0.5828891", "0.5821537", "0.5810461", "0.57723564", "0.57664114", "0.5729607", "0.57245904", "0.5716195", "0.56946665", "0.5677907", "0.5674565", "0.5663923", "0.5656095", "0.5640971", "0.5591592", "0.55899525", "0.55646914", "0.55625", "0.5543713", "0.55403364", "0.5527986", "0.5523838", "0.5514762", "0.5485072", "0.5478225", "0.5471953", "0.54630244", "0.54595613", "0.5447456", "0.54458493", "0.5404893", "0.5394656", "0.53771293", "0.5364222", "0.5349949", "0.5336164", "0.5325709", "0.5320822", "0.53114974", "0.5309452", "0.53075933", "0.5268406", "0.52548605", "0.524644", "0.5244308", "0.52370155", "0.523252", "0.52308714", "0.52306277", "0.5228589", "0.5227639", "0.5221307", "0.52111095", "0.519891", "0.5193492", "0.5178139", "0.51679075", "0.51596487", "0.51467234", "0.51370263", "0.513613", "0.5135387", "0.5115506", "0.50977075", "0.5085033", "0.508007", "0.5076597", "0.507606", "0.506595", "0.50533485", "0.5044382", "0.5042952", "0.5038237", "0.50344336", "0.5033921", "0.50223094" ]
0.7548851
0
commit one asset on main branch.
@Test public void run() throws Exception { BranchName main = BranchName.of("main"); // create an old commit referencing both unique and non-unique assets. //The unique asset should be identified by the gc policy below since they are older than 1 day. store.setOverride(FIVE_DAYS_IN_PAST_MICROS); commit().put("k1", new DummyValue().add(-3).add(0).add(100)).withMetadata("cOld").toBranch(main); // work beyond slop but within gc allowed age. store.setOverride(TWO_HOURS_IN_PAST_MICROS); // create commits that have time-valid assets. Create more commits than ParentList.MAX_PARENT_LIST to confirm recursion. for (int i = 0; i < 55; i++) { commit().put("k1", new DummyValue().add(i).add(i + 100)).withMetadata("c2").toBranch(main); } // create a new branch, commit two assets, then delete the branch. BranchName toBeDeleted = BranchName.of("toBeDeleted"); versionStore.create(toBeDeleted, Optional.empty()); Hash h = commit().put("k1", new DummyValue().add(-1).add(-2)).withMetadata("c1").toBranch(toBeDeleted); versionStore.delete(toBeDeleted, Optional.of(h)); store.clearOverride(); { // Create a dangling value to ensure that the slop factor avoids deletion of the assets of this otherwise dangling value. save(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()), new DummyValue().add(-50).add(-51)); // create a dangling value that should be cleaned up. save(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - TimeUnit.DAYS.toMicros(2), new DummyValue().add(-60).add(-61)); } SparkSession spark = SparkSession .builder() .appName("test-nessie-gc-collection") .master("local[2]") .getOrCreate(); // now confirm that the unreferenced assets are marked for deletion. These are found based // on the no-longer referenced commit as well as the old commit. GcOptions options = ImmutableGcOptions.builder() .bloomFilterCapacity(10_000_000) .maxAgeMicros(ONE_DAY_OLD_MICROS) .timeSlopMicros(ONE_HOUR_OLD_MICROS) .build(); IdentifyUnreferencedAssets<DummyValue> app = new IdentifyUnreferencedAssets<DummyValue>(helper, new DynamoSupplier(), spark, options); Dataset<UnreferencedItem> items = app.identify(); Set<String> unreferencedItems = items.collectAsList().stream().map(UnreferencedItem::getName).collect(Collectors.toSet()); assertThat(unreferencedItems, containsInAnyOrder("-1", "-2", "-3", "-60", "-61")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "byte[] submit() throws CommitException;", "void commit() {\n }", "void commit() throws CommitException;", "public void commit() {\n doCommit();\n }", "public void commit() {\n }", "public void commit(Writer output) throws IOException {\n postData(new StringReader(\"<commit/>\"), output);\n }", "void commit();", "void commit();", "void commit(IDevTree tree, Map options) throws IOException;", "@Override\n\tpublic void commit() {\n\n\t}", "public void commit() {\n tryCommit(true);\n }", "public void commit() throws ResourceException;", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit() throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public void commit();", "public void commitTransaction(TransID tid) \n throws IOException, IllegalArgumentException{// Not yet complete\n\t try {\n\t\t ADisk_lock.lock();\n\t\t // Call commit\n\t\t atranslist.get(tid).commit();\n\t\t Transaction temp = atranslist.remove(tid);\n\t\t wblist.addCommitted(temp);\t \n\t }\n\t finally{\n\t\t ADisk_lock.unlock();\n\t }\n }", "void commit(boolean isMajor);", "private void doCommit(final int y, final int x)\n \t\tthrows FileNotFoundException, GitAPIException\n \t{\n \t\t// update files\n \t\tupdateImageFile();\n \t\tupdateDataFile();\n \n \t\t// add files to changeset\n \t\tfinal AddCommand add = git.add();\n \t\tadd.addFilepattern(ASCII_IMAGE_FILE);\n \t\tadd.addFilepattern(CALENDAR_DATA_FILE);\n \t\tadd.call();\n \n \t\t// commit the changes\n \t\tfinal CommitCommand commit = git.commit();\n \t\tcommit.setAuthor(new PersonIdent(author, contrib[y][x].date));\n \t\tfinal String message = \"(\" + y + \", \" + x + \") -> \" +\n \t\t\tcontrib[y][x].current + COMMIT_NOTICE;\n \t\tcommit.setMessage(message);\n \t\tcommit.call();\n \t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit() throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public void commit() {\n\t\tcommitted = true;\n\t}", "void commit(String workspace);", "public void commit() {\n\t\tif (commit) {\n\t\t\t// Récupérer le path du JSON\n\t\t\tSystem.out.println(ClassLoader.getSystemResource(jsonFile));\n\t\t\tURL url = ClassLoader.getSystemResource(jsonFile);\n\t\t\t// On ouvre un flux d'écriture vers le fichier JSON\n\t\t\ttry (OutputStream ops = new FileOutputStream(Paths.get(url.toURI()).toFile())) {\n\t\t\t\t// Ecriture du fichier JSON avec formatage\n\t\t\t\t// (WithDefaultPrettyPrinter)\n\t\t\t\tobjectMapper.writerWithDefaultPrettyPrinter().writeValue(ops, database);\n\t\t\t\tlogger.info(\"OK - fichier JSON mis à jour \" + jsonFile);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tlogger.info(\"KO - FILE_NOT_FOUND\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - FILE_NOT_FOUND\", e);\n\t\t\t} catch (IOException e) {\n\t\t\t\tlogger.info(\"KO - I/O ERROR\" + jsonFile);\n\t\t\t\tthrow new DataRepositoryException(\"KO - I/O ERROR\", e);\n\t\t\t} catch (URISyntaxException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "void commit() throws InterruptedException;", "public static void commit(String message) throws IOException {\n stagingArea = Utils.readObject(STAGING_FILE, HashMap.class);\n stagingRemoveArea = Utils.readObject(STAGING_REMOVE_FILE, HashMap.class);\n\n if (stagingArea.size() == 0 && stagingRemoveArea.size() == 0){\n exitWithError(\"No changes added to the commit.\");\n }\n\n //Gets current head commit Object + name\n String currName = commitPointers.readHeadCommit()[1];\n File cFile = Utils.join(Commit.COMMIT_FOLDER, currName + \".txt\");\n Commit curr = Utils.readObject(cFile, Commit.class);\n\n //creates a list of parent ids for the new commit object\n ArrayList<String> parentsIDs = new ArrayList<String>(1);\n parentsIDs.add(0, currName);\n\n //creates a new commit with the parent IDs, and the bobs contained in headCommit (curr)\n Commit newCommit = new Commit(message, parentsIDs, curr.fileBlobs);\n\n //Staging area work\n //TODO: move line upwards so you can check if staging area is empty before anything else\n newCommit.updateCommitBlobs(stagingArea, stagingRemoveArea);\n\n //makes a new commitID, and saves new commit with that ID\n String newCommitId = Utils.sha1(Utils.serialize(newCommit));\n newCommit.saveCommit(newCommitId);\n\n stagingArea.clear();\n stagingRemoveArea.clear();\n Utils.writeObject(STAGING_FILE, stagingArea);\n Utils.writeObject(STAGING_REMOVE_FILE, stagingRemoveArea);\n\n //TODO: figure out how to send in the correct branch to head\n commitPointers.updateBranches(commitPointers.readHeadCommit()[0], newCommitId);\n commitPointers.updateHead(commitPointers.readHeadCommit()[0], newCommitId);\n }", "public abstract void commit();", "void tagCommit(TRepo repo, TCommit commit, String tagName);", "public void commit(String message) throws IOException {\n\t\t// check whether stage folder is empty\n\t\tboolean check = commitChecker();\n\t\tif (check == false)\n\t\t\treturn;// check whether we can commit now\n\t\tVersion currentCommit = new Version(ID, message, myHead, true,\n\t\t\t\tcurrentBranch);// create a new Version instance\n\t\tFile current = new File(\".gitlet/\" + ID);\n\t\tcurrent.mkdir();// create a folder for this commit\n\t\tif (messageMap.keySet().contains(message)) {\n\t\t\tArrayList<Integer> lst = messageMap.get(message);\n\t\t\tlst.add(ID);\n\t\t} else {\n\t\t\tArrayList<Integer> lst = new ArrayList<Integer>();\n\t\t\tlst.add(ID);\n\t\t\tmessageMap.put(message, lst);// add to the message map\n\t\t}\n\t\tmyCommit.put(ID, currentCommit);// add to commit map\n\t\tfor (String s : stagedFiles) {// find the staged folder and files inside\n\t\t\tFile beCopy = new File(\".gitlet/\" + ID + \"/\" + filenameHelper(s));\n\t\t\tbeCopy.createNewFile();\n\t\t\tcopyFile(\".gitlet/stage/\" + filenameHelper(s),\n\t\t\t\t\tbeCopy.getCanonicalPath());\n\t\t\tcurrentCommit\n\t\t\t\t\t.myMapPut(s, \".gitlet/\" + ID + \"/\" + filenameHelper(s));\n\t\t\tFile fl = new File(\".gitlet/stage/\" + filenameHelper(s));\n\t\t\tfl.delete();// copy the staged file into the new commit folder and\n\t\t\t\t\t\t// delete the file in stage folder\n\t\t}\n\t\tfor (Map.Entry<String, String> f : tracked.entrySet()) {\n\t\t\tif (!stagedFiles.contains(f.getKey())) {\n\t\t\t\tcurrentCommit.myMapPut(f.getKey(), f.getValue());// copy tracked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// files\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// into the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// tracked\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Hashmap\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// of the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// new\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Version\n\t\t\t}\n\t\t}\n\t\tstagedFiles = new ArrayList<String>();\n\t\tuntrackedFiles = new ArrayList<String>();\n\t\ttracked = currentCommit.file();// reset tracked files, untracked files\n\t\t\t\t\t\t\t\t\t\t// and staged files\n\t\tmyHead = currentCommit;\n\t\tmyBranch.put(currentBranch, currentCommit);\n\t\tID++;\n\t\tconflictState = false;// other settings\n\t\tSerialization();\n\t}", "protected void post_commit_hook() { }", "@Override\n public void commit() {\n }", "@Test(expected = RuntimeException.class)\r\n \tpublic void testCommit() throws ESException {\n \t\tlocalProject.commit();\r\n \t\tfail(\"Should not be able to commit an unshared Project!\");\r\n \t}", "public void commit(String logMsg) throws IOException {\n if (Utils.plainFilenamesIn(INDEX).size() == 0\n && Utils.plainFilenamesIn(REMOVAL).size() == 0) {\n System.out.println(\"No changes added to the commit.\");\n System.exit(0);\n }\n File head = new File(Main.DOTFILE, \"head\");\n if (head.exists()) {\n String parentCommit = Utils.readObject(head, String.class);\n Commit newCommit = new Commit(logMsg, parentCommit);\n helperCommit(newCommit);\n }\n }", "@Override\n\tpublic int commit() {\n\t\treturn 0;\n\t}", "private void commit() {\n if (vote != Vote.COMMIT) {\n throw new IllegalStateException(\"Cannot commit transaction with vote: \" + vote);\n }\n\n for (ObjectVersion<V> objectVersion : objectVersions.values()) {\n objectVersion.commit();\n }\n }", "private long commit(byte[] e) throws IOException, ClassNotFoundException, CheatAttemptException {\n\t\t\n\t\tCmtCommitValue val = committer.generateCommitValue(e);\n\t\tlong id = random.nextLong();\n\t\tcommitter.commit(val, id);\n\t\treturn id;\n\t\t\n\t}", "private static void checkout(Gitlet currCommit, String[] args) {\n if (args.length < 2 && args.length > 3) {\n System.out\n .println(\"Please input one of the following combinations: \"\n + \"\\n File Name \\n Commit Id and File Name \\n Branch Name\");\n return;\n }\n if (!isSure()) {\n return;\n }\n if (args.length == 2) {\n if (currCommit.tree.getBranches().contains(args[1])) {\n if (currCommit.tree.getCurrentBranch().equals(args[1])) {\n System.out\n .println(\"No need to checkout the current branch.\");\n return;\n }\n Commit headCommit = currCommit.tree.getHeadCommit(args[1]);\n HashMap<String, String> locations = headCommit.getFileLoc();\n HashMap<String, String> currentFiles = currCommit.tree\n .getHeadCommit().getFileLoc();\n for (String x : currentFiles.keySet()) {\n if (locations.containsKey(x)) {\n FileManip temp = new FileManip(locations.get(x));\n temp.copyFile(x);\n }\n }\n currCommit.tree.setCurrentBranch(args[1]);\n currCommit.status.replaceMainBranch(args[1]);\n addSerializeFile(currCommit);\n return;\n }\n Commit headCommit = currCommit.tree.getHeadCommit();\n if (currCommit.tree.containsFile(args[1])) {\n FileManip dest = new FileManip(headCommit.getLocation(args[1]));\n dest.copyFile(args[1]);\n return;\n }\n String error = \"File does not exist in the most recent commit,\";\n error += \" or no such branch exists.\";\n System.out.println(error);\n return;\n } else {\n if (!currCommit.tree.hasId(args[1])) {\n System.out.println(\"No commit with that id exists.\");\n return;\n\n }\n Commit commit = currCommit.tree.getCommitFromId(args[1]);\n\n if (!commit.containsFile(args[2])) {\n System.out.println(\"No such file exists in this commit.\");\n\n } else {\n System.out.println(commit.getLocation(args[2]));\n FileManip dest = new FileManip(commit.getLocation(args[2]));\n dest.copyFile(args[2]);\n }\n }\n }", "void createBranchAtCommit(TCommit commit, String branchName, TRepo repo);", "void branch(String branchName) {\n File curr = new File(\".gitlet/current\");\n String path = null;\n File newBranch = new File(\".gitlet/heads/\" + branchName + \".ser\");\n for (File file: curr.listFiles()) {\n path = file.getName();\n }\n if (newBranch.exists()) {\n System.out.println(\"A branch with that name already exists.\");\n return;\n } else {\n Commit currCom = deserializeCommit(\".gitlet/current/\" + path);\n try {\n FileOutputStream fieOut = new FileOutputStream(newBranch);\n ObjectOutputStream obetOut = new ObjectOutputStream(fieOut);\n obetOut.writeObject(currCom);\n } catch (IOException e) {\n System.out.println(\"p\");\n }\n }\n }", "protected void checkoutCommit(GitletModel model, Commit commit) throws GitletException {\n GitFileSet destCommitFiles = commit.getAllFiles();\n GitFileSet currentCommitFiles = model.getCurrentBranch().getHeadCommit().getAllFiles();\n GitFileSet diffFileSet = destCommitFiles.diff(currentCommitFiles);\n\n // Fail if any untracked files in the workspace will be overwritten.\n Set<String> workingDirectoryFileNames = model.getWorkingDirectoryFileNames();\n for (GitFile destFile : diffFileSet) {\n String fileName = destFile.getName();\n if (currentCommitFiles.lookupFile(fileName) == null\n && workingDirectoryFileNames.contains(fileName)) {\n throw new GitletException(\"There is an untracked file in the way; \"\n + \"delete it or add it first.\");\n }\n }\n\n // Finally, update the workspace.\n model.getBlobManager().restoreFiles(diffFileSet);\n }", "protected void commitJob(final ManifestCommitter committer,\n final JobContext jContext) throws IOException {\n committer.commitJob(jContext);\n\n }", "void updateBranch(Commit newt) {\n String nextBranch = null;\n Commit theNext = null;\n File parent = new File(\".gitlet/current\");\n for (File file : parent.listFiles()) {\n nextBranch = file.getName();\n }\n try {\n File getHead = new File(\".gitlet/heads/\" + nextBranch);\n FileOutputStream fieOut = new FileOutputStream(getHead);\n ObjectOutputStream obetOut = new ObjectOutputStream(fieOut);\n obetOut.writeObject(newt);\n } catch (IOException e) {\n System.out.println(\"Didn't work.\");\n }\n try {\n File hideous = new File(\".gitlet/current/\" + nextBranch);\n FileOutputStream ieOut = new FileOutputStream(hideous);\n ObjectOutputStream betOut = new ObjectOutputStream(ieOut);\n betOut.writeObject(newt);\n } catch (IOException e) {\n System.out.println(\"Didn't work.\");\n }\n }", "public void testCommit() throws Exception {\n IProject project = createProject(\"testCommit\", new String[] { \"changed.txt\", \"deleted.txt\", \"folder1/\", \"folder1/a.txt\", \"folder1/b.txt\", \"folder1/subfolder1/c.txt\" });\n \n // Perform some operations on the copy and commit only the top level\n addResources(project, new String[] { \"added.txt\", \"folder2/\", \"folder2/added.txt\" }, false);\n setContentsAndEnsureModified(project.getFile(\"changed.txt\"));\n deleteResources(new IResource[] {project.getFile(\"deleted.txt\")});\n setContentsAndEnsureModified(project.getFile(\"folder1/a.txt\"));\n setContentsAndEnsureModified(project.getFile(\"folder1/subfolder1/c.txt\"));\n \n // Commit the project shallow\n commit(asResourceMapping(new IResource[] { project }, IResource.DEPTH_ONE), \"A commit message\");\n \n // Commit a subfolder shallow\n commit(asResourceMapping(new IResource[] { project.getFolder(\"folder1\") }, IResource.DEPTH_ONE), \"A commit message\");\n \n // Now commit the file specifically\n commit(asResourceMapping(new IResource[] { project.getFile(\"folder1/subfolder1/c.txt\") }, IResource.DEPTH_ZERO), \"A commit message\");\n \n // Now commit the rest\n commit(asResourceMapping(new IResource[] { project.getFolder(\"folder2\") }, IResource.DEPTH_INFINITE), \"A commit message\");\n \n // Check the project out under a different name\n IProject copy = checkoutCopy(project, \"-copy\");\n assertEquals(project, copy);\n }", "public static void checkoutBranch(String arg) throws IOException {\n File currFile = Utils.join(Commit.COMMIT_FOLDER, commitPointers.readHeadCommit()[1] + \".txt\");\n Commit currCommit = Utils.readObject(currFile, Commit.class);\n\n if(!commitPointers.readBranches().containsKey(arg)){\n exitWithError(\"No such branch exists.\");\n }\n if(commitPointers.readHeadCommit()[0].equals(arg)) {\n exitWithError(\"No need to checkout the current branch.\");\n }\n File cFile = Utils.join(Commit.COMMIT_FOLDER, commitPointers.branches.get(arg) + \".txt\");\n Commit checkoutCommit = Utils.readObject(cFile, Commit.class);\n\n for (String cwdfileName : CWD.list()) {\n if (!cwdfileName.equals(\".gitlet\")) {\n File cwFile = Utils.join(CWD, cwdfileName);\n if ((cwFile.exists() && !currCommit.fileBlobs.containsKey(cwdfileName) && checkoutCommit.fileBlobs.containsKey(cwdfileName))) {\n exitWithError(\"There is an untracked file in the way; delete it, or add and commit it first.\");\n }\n }\n }\n\n for (String cwdfileName : CWD.list()) {\n if (!cwdfileName.equals(\".gitlet\")) {\n if (!checkoutCommit.fileBlobs.containsKey(cwdfileName) && currCommit.fileBlobs.containsKey(cwdfileName)) {\n Utils.join(CWD, cwdfileName).delete();\n }\n }\n }\n\n commitPointers.updateHead(arg, commitPointers.branches.get(arg));\n\n for (HashMap.Entry<String, String> fileBlob : checkoutCommit.fileBlobs.entrySet()) {\n checkoutFile(fileBlob.getKey());\n }\n }", "public void commit(){\n \n }", "private static boolean performFirstCommitIfRequired(@Nonnull final Project project,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Nonnull VirtualFile root,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Nonnull GitRepository repository,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Nonnull ProgressIndicator indicator,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Nonnull String name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@Nonnull String url)\n\t{\n\t\tif(!repository.isFresh())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tLOG.info(\"Trying to commit\");\n\t\ttry\n\t\t{\n\t\t\tLOG.info(\"Adding files for commit\");\n\t\t\tindicator.setText(\"Adding files to git...\");\n\n\t\t\t// ask for files to add\n\t\t\tfinal List<VirtualFile> trackedFiles = ChangeListManager.getInstance(project).getAffectedFiles();\n\t\t\tfinal Collection<VirtualFile> untrackedFiles = repository.getUntrackedFilesHolder()\n\t\t\t\t\t.retrieveUntrackedFiles();\n\t\t\tfinal List<VirtualFile> allFiles = new ArrayList<VirtualFile>();\n\t\t\tallFiles.addAll(trackedFiles);\n\t\t\tallFiles.addAll(untrackedFiles);\n\n\t\t\tfinal Ref<GithubUntrackedFilesDialog> dialogRef = new Ref<GithubUntrackedFilesDialog>();\n\t\t\tApplicationManager.getApplication().invokeAndWait(new Runnable()\n\t\t\t{\n\t\t\t\t@Override\n\t\t\t\tpublic void run()\n\t\t\t\t{\n\t\t\t\t\tGithubUntrackedFilesDialog dialog = new GithubUntrackedFilesDialog(project, allFiles);\n\t\t\t\t\tif(!trackedFiles.isEmpty())\n\t\t\t\t\t{\n\t\t\t\t\t\tdialog.setSelectedFiles(trackedFiles);\n\t\t\t\t\t}\n\t\t\t\t\tDialogManager.show(dialog);\n\t\t\t\t\tdialogRef.set(dialog);\n\t\t\t\t}\n\t\t\t}, indicator.getModalityState());\n\t\t\tfinal GithubUntrackedFilesDialog dialog = dialogRef.get();\n\n\t\t\tfinal Collection<VirtualFile> files2commit = dialog.getSelectedFiles();\n\t\t\tif(!dialog.isOK() || files2commit.isEmpty())\n\t\t\t{\n\t\t\t\tGithubNotifications.showInfoURL(project, \"Successfully created empty repository on GitHub\", name, url);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tCollection<VirtualFile> files2add = ContainerUtil.intersection(untrackedFiles, files2commit);\n\t\t\tCollection<VirtualFile> files2rm = consulo.ide.impl.idea.util.containers.ContainerUtil.subtract(trackedFiles, files2commit);\n\t\t\tCollection<VirtualFile> modified = new HashSet<VirtualFile>(trackedFiles);\n\t\t\tmodified.addAll(files2commit);\n\n\t\t\tGitFileUtils.addFiles(project, root, files2add);\n\t\t\tGitFileUtils.deleteFilesFromCache(project, root, files2rm);\n\n\t\t\t// commit\n\t\t\tLOG.info(\"Performing commit\");\n\t\t\tindicator.setText(\"Performing commit...\");\n\t\t\tGitSimpleHandler handler = new GitSimpleHandler(project, root, GitCommand.COMMIT);\n\t\t\thandler.addParameters(\"-m\", dialog.getCommitMessage());\n\t\t\thandler.endOptions();\n\t\t\thandler.run();\n\n\t\t\tVcsFileUtil.markFilesDirty(project, modified);\n\t\t}\n\t\tcatch(VcsException e)\n\t\t{\n\t\t\tLOG.warn(e);\n\t\t\tGithubNotifications.showErrorURL(project, \"Can't finish GitHub sharing process\",\n\t\t\t\t\t\"Successfully created project \", \"'\" + name + \"'\", \" on GitHub, but initial commit failed:<br/>\" +\n\t\t\t\t\t\t\te.getMessage(), url);\n\t\t\treturn false;\n\t\t}\n\t\tLOG.info(\"Successfully created initial commit\");\n\t\treturn true;\n\t}", "private void checkout(){\n Scanner input = new Scanner(System.in);\n System.out.println(\"checkout commit : \");\n System.out.println(\"masukan nama commit : \"); // nama commit bukan kode hash\n String value = input.nextLine();\n \n // overwrite file commit ke file-untuk-git\n overWriteFile(\"file-untuk-git\", value + \".txt\", false);\n \n \n }", "R commit(C change);", "public void addAllCommitPush(String message) throws IOException, GitAPIException {\n gitProjectUuidStore.pull().setTransportConfigCallback(transportConfigCallback).call();\n gitProjectZoneController.pull().setTransportConfigCallback(transportConfigCallback).call();\n //TODO: Add Missing Repos\n\n System.out.println(\"git add all files \");\n gitProjectUuidStore.add().addFilepattern(\".\").call();\n //Only commit and push in RELEASE MODE\n if(Play.current().isProd()) {\n CommitCommand commit = gitProjectUuidStore.commit();\n commit.setMessage(message).call();\n gitProjectUuidStore.push().setTransportConfigCallback(transportConfigCallback).call();\n }\n }", "public void saveOrUpdate(asset asset) {\n assetRepository.save(asset);\n }", "public void commitEntity();", "public void processCheckout(File commitFile,\n String fileName) throws IOException {\n Commit associatedCommit = Utils.readObject(commitFile, Commit.class);\n HashMap<String, Blob> allfilesInIt = associatedCommit.getFile();\n Blob fileContent = allfilesInIt.get(fileName);\n File fileinCWD = new File(Main.CWD, fileName);\n if (!fileinCWD.exists()) {\n fileinCWD.createNewFile();\n }\n Utils.writeContents(fileinCWD, fileContent.getContent());\n }", "TArea checkout(TCommit commit, TRepo repo, AreaFactory<TContent, TArea> areaFactory, ContentFactory<TContent> contentFactory);", "protected void commit(ResourceMapping mapper, String message) throws CoreException {\n SyncInfoTree set = getOutgoing(mapper.getProjects());\n commit(new ResourceMapping[] { mapper }, message);\n assertCommit(mapper, set);\n }", "public static void main(String[] args) {\nSystem.out.println(\"nagarjuna is .................\");\r\n//second commit\r\nSystem.out.println(\"vinay is ..............................\");\r\n//third commit\r\nSystem.out.println(\"vinay is a ?\");\r\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\r\n\t{\r\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\r\n\t}", "void commit(String tpcid);", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException\n\t{\n\t\tcom.mendix.core.Core.commit(context, getMendixObject());\n\t}", "protected void branch(ResourceMapping mapping, CVSTag branch) throws CoreException, IOException {\n CVSTag version = new CVSTag(\"Root_\" + branch.getName(), CVSTag.VERSION);\n branch(new ResourceMapping[] { mapping }, version, branch, true /* update */);\n assertTagged(mapping, version);\n assertBranched(mapping, branch);\n }", "@Override\n\tpublic void commit() throws Throwable {\n\t\tthrow new Warning(\"please use commit(context)\");\n\t}", "public abstract void commit(Iterable<? extends GroundAtom> atoms);", "public Commit() {\n }", "public Commit() {\n }", "protected abstract JsonObject submitBuildArtifact(CloseableHttpClient httpclient,\n JsonObject jco, String submitUrl)\n throws IOException;", "public void addCommit(Commit commit) throws IOException {\n String fileName = commit.getShaCode();\n File actualFile = new File(Main.ALL_COMMITS, fileName);\n if (!actualFile.exists()) {\n actualFile.createNewFile();\n }\n Utils.writeObject(actualFile, commit);\n }", "void commit() throws SolrServerException, IOException;", "public void gitThis(){\n\t}", "public void commit() {\n\t\tcommitted = true;\n\t\tbackUp();\n\t\t//back up the current board info at the meanwhile\n\t}", "public void checkout() throws VcsException;", "void commit(Transaction transaction);", "void checkoutIntoArea(TCommit commit, TRepo repo, TArea areaToUpdate, ContentFactory<TContent> contentFactory);", "void commit() {\r\n tx.commit();\r\n tx = new Transaction();\r\n }", "void commit() throws SoarException\n {\n // if lazy, commit\n if(db != null && params.lazy_commit.get() == LazyCommitChoices.on)\n {\n // Commit and then start next lazy-commit transaction\n try\n {\n db.commitExecuteUpdate( /* soar_module::op_reinit */);\n db.beginExecuteUpdate( /* soar_module::op_reinit */);\n }\n catch(SQLException e)\n {\n throw new SoarException(\"Error while forcing commit: \" + e.getMessage(), e);\n }\n }\n \n }", "public void voteCommit() {\n boolean b = preVote();\n synchronized ( this ) {\n if ( b == true ) \n commitVotes++; \n else {\n rbVotes++;\n votedCommit = false;\n }\n }\n postVote();\n }", "public static void branch(String arg){\n commitPointers.branches = commitPointers.readBranches();\n if (commitPointers.branches.containsKey(arg)){\n exitWithError(\"A branch with that name already exists.\");\n }\n\n String headID = commitPointers.readHeadCommit()[1];\n commitPointers.branches.put(arg, headID);\n commitPointers.saveBranches();\n }", "public void checkoutbranch(String givenbranch) {\n if (branch.equals(givenbranch)) {\n Utils.message(\"No need to checkout the current branch. \");\n throw new GitletException();\n } else if (!branches.containsKey(givenbranch)) {\n Utils.message(\"No such branch exists.\");\n throw new GitletException();\n } else {\n Comm curr = head;\n if (hasuntracked(curr)) {\n Utils.message(\"There is an untracked file in the way;\"\n + \" delete it or add it first.\");\n throw new GitletException();\n } else {\n head = branches.get(givenbranch);\n branch = givenbranch;\n branches.put(branch, head);\n for (Blob b: head.getContents().values()) {\n File f = new File(b.getName());\n Utils.writeContents(f,\n head.getContents().get(b.getName()).getContent());\n stagingarea.clear();\n }\n deleteuntracked(head);\n }\n }\n }", "@Test(expected = RuntimeException.class)\r\n \tpublic void testCommit2() throws ESException {\n \t\tlocalProject.commit(ESLogMessage.FACTORY.createLogMessage(\"test\", \"super\"), null, new NullProgressMonitor());\r\n \t\tfail(\"Should not be able to commit an unshared Project!\");\r\n \t}", "public void checkout() {\n\t}", "void execute(@Nonnull Blob blob);", "protected void commitTask(final ManifestCommitter committer,\n final TaskAttemptContext tContext) throws IOException {\n committer.commitTask(tContext);\n }", "public void commit() throws ResourceException\n {\n if (inManagedTransaction)\n {\n try\n {\n inManagedTransaction = false;\n con.commit();\n }\n catch (SQLException e)\n {\n checkException(e);\n } // end of try-catch\n } // end of if ()\n else\n {\n throw new JBossResourceException(\"Trying to commit outside of a local tx\");\n } // end of else\n\n }", "void commit( boolean onSave );", "protected abstract void commitIndividualTrx();", "public void execute() throws IOException, ParseException, GitAPIException {\n \t\tfinal int[][] pix = readPixels();\n \t\treadContributions();\n \t\tcomputeTargetContrib(pix);\n \n \t\tif (debug) {\n \t\t\tdebug(asciiImage(true));\n \t\t\tprintContrib();\n \t\t}\n \n \t\tinitGitRepository();\n \n \t\tif (showGUI) showProgressWindow();\n \n \t\tint i = 0;\n \t\tfor (int x = 0; x < CAL_WIDTH; x++) {\n \t\t\tfor (int y = 0; y < CAL_HEIGHT; y++) {\n \t\t\t\tif (contrib[y][x] == null) continue;\n \t\t\t\twhile (contrib[y][x].current < contrib[y][x].target) {\n \t\t\t\t\tcontrib[y][x].current++;\n \t\t\t\t\tif (git != null) doCommit(y, x);\n \t\t\t\t\ti++;\n \t\t\t\t\tif (showGUI) updateProgress(i);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\tprogressFrame.dispose();\n \n \t\tif (debug) System.out.println(\"Complete!\");\n \t}", "public void commit (boolean force) throws IOException {\n // There is something to commit\n if (commitCounter > 0 || !force)\n this.commit();\n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(\"This is commited by GitData\");\n\n\t}", "public void helperCommit(Commit newCommit) throws IOException {\n newCommit.setFiles(INDEX, REMOVAL);\n newCommit.changeStatus(true);\n addCommit(newCommit);\n Utils.writeObject(curHeadBranch(), newCommit.getShaCode());\n Utils.writeObject(HEADFILE, newCommit.getShaCode());\n clearStages();\n }", "public void makeCommit(String message) throws RepositoryException, IOException,\n ClassNotFoundException, ConfigurationException {\n Configuration config = Configuration.load();\n List<String> lastBlobIds = config.head().lastCommit().getCommit().getBlobIds();\n List<String> blobIds = new ArrayList<>(config.getIndexBlobs());\n\n if (lastBlobIds.equals(blobIds)) {\n throw new ConfigurationException(\"There are no new files in the index\");\n }\n\n config.makeCommit(message, blobIds);\n config.save();\n }", "@Override\n public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException,\n RollbackException, SecurityException, SystemException {\n assertActiveTransaction();\n try {\n getTransaction().commit();\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n txns.set(null);\n }\n\n }", "protected void commitTaskAndJob(ManifestCommitter committer,\n JobContext jContext,\n TaskAttemptContext tContext) throws IOException {\n try (DurationInfo d = new DurationInfo(LOG,\n \"committing Job %s\", jContext.getJobID())) {\n describe(\"\\ncommitting task\");\n committer.commitTask(tContext);\n describe(\"\\ncommitting job\");\n committer.commitJob(jContext);\n describe(\"commit complete\\n\");\n }\n }" ]
[ "0.6331862", "0.6227228", "0.5984934", "0.5922197", "0.5856027", "0.5789615", "0.57420874", "0.57420874", "0.5719315", "0.5698256", "0.5678718", "0.567516", "0.5642349", "0.5642349", "0.5642349", "0.5642349", "0.5642349", "0.56294346", "0.5623186", "0.56217057", "0.5614363", "0.56062263", "0.56062263", "0.56062263", "0.56062263", "0.5606149", "0.55891687", "0.5585171", "0.5567474", "0.55601937", "0.55297846", "0.5525758", "0.55039304", "0.5494899", "0.5484813", "0.5483072", "0.54791427", "0.5471949", "0.5468403", "0.54647076", "0.54547936", "0.54499656", "0.5446171", "0.5424609", "0.53891194", "0.53743994", "0.53731567", "0.53634703", "0.53568745", "0.5341338", "0.5339124", "0.53361994", "0.53196144", "0.52859145", "0.52732533", "0.5272638", "0.52725506", "0.5272308", "0.52664465", "0.52540493", "0.52540493", "0.52540493", "0.52540493", "0.52540493", "0.5228856", "0.52222306", "0.52222306", "0.52222306", "0.52222306", "0.5218719", "0.52075565", "0.52044076", "0.51749784", "0.51749784", "0.5169302", "0.5140995", "0.5139113", "0.51260084", "0.512459", "0.5117606", "0.5098688", "0.5093493", "0.5090427", "0.5079975", "0.50783134", "0.5076847", "0.50633", "0.50540435", "0.5051461", "0.5008176", "0.50077116", "0.49987942", "0.49930042", "0.49910143", "0.49906892", "0.49800837", "0.4965916", "0.49643102", "0.49583402", "0.49522933", "0.4949512" ]
0.0
-1
Delayed removal of status and navigation bar Note that some of these constants are new as of API 16 (Jelly Bean) and API 19 (KitKat). It is safe to use them, as they are inlined at compiletime and do nothing on earlier devices. mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
@SuppressLint("InlinedApi") @Override public void run() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void hideSystemUI() {\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); // enter immersive mode\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |\n View.SYSTEM_UI_FLAG_FULLSCREEN |\n View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView. setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize *'hen the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "@Override\n public void onSystemUiVisibilityChange(int visibility) {\n if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\n // TODO: The system bars are visible. Make any desired\n// int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;\n//\n// int a=SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n// decorView.setSystemUiVisibility(a);\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n\n\n } else {\n // TODO: The system bars are NOT visible. Make any desired\n\n }\n }", "public void hideSystemUI() {\r\n if (PhotoViewActivity.this != null)\r\n PhotoViewActivity.this.runOnUiThread(new Runnable() {\r\n public void run() {\r\n toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())\r\n .setDuration(240).start();\r\n photoViewActivity.setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\r\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\r\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\r\n | View.SYSTEM_UI_FLAG_IMMERSIVE);\r\n fullScreenMode = true;\r\n }\r\n });\r\n }", "@Override\n public void onSystemUiVisibilityChange(int visibility) {\n if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\n // TODO: The system bars are visible. Make any desired\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n decorView.setSystemUiVisibility(uiOptions);\n }\n }, 2000);\n } else {\n // TODO: The system bars are NOT visible. Make any desired\n // adjustments to your UI, such as hiding the action bar or\n // other navigational controls.\n }\n }", "public void FullScreencall() {\n View decorView = getWindow().getDecorView();\n int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n decorView.setSystemUiVisibility(uiOptions);\n }", "private void hideSystemUI() {\n // Set the IMMERSIVE flag.\n // Set the content to appear under the system bars so that the content\n // doesn't resize when the system bars hide and show.\n photoView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\n | View.SYSTEM_UI_FLAG_IMMERSIVE);\n isShowingSystemUI = false;\n }", "@Override\r\n \t public void onSystemUiVisibilityChange(int visibility) {\n \t if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\r\n \t // TODO: The system bars are visible.\r\n \t \thideSystemUI();\r\n \t } else {\r\n \t // TODO: The system bars are NOT visible. \r\n \t }\r\n \t }", "@SuppressLint(\"InlinedApi\")\r\n @Override\r\n public void run() {\n mainContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\r\n | View.SYSTEM_UI_FLAG_FULLSCREEN\r\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\r\n }", "public void hideSystemUI(View view) {\n view.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void showSystemUI() {\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n );\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "public void toggleHideyBar() {\n // BEGIN_INCLUDE (get_current_ui_flags)\n // The UI options currently enabled are represented by a bitfield.\n // getSystemUiVisibility() gives us that bitfield.\n int uiOptions = getWindow().getDecorView().getSystemUiVisibility();\n int newUiOptions = uiOptions;\n // END_INCLUDE (get_current_ui_flags)\n // BEGIN_INCLUDE (toggle_ui_flags)\n boolean isImmersiveModeEnabled =\n ((uiOptions | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY) == uiOptions);\n if (isImmersiveModeEnabled) {\n Log.i(TAG, \"Turning immersive mode mode off. \");\n } else {\n Log.i(TAG, \"Turning immersive mode mode on.\");\n }\n\n // Immersive mode: Backward compatible to KitKat (API 19).\n // Note that this flag doesn't do anything by itself, it only augments the behavior\n // of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample\n // all three flags are being toggled together.\n // This sample uses the \"sticky\" form of immersive mode, which will let the user swipe\n // the bars back in again, but will automatically make them disappear a few seconds later.\n newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;\n newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;\n newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n getWindow().getDecorView().setSystemUiVisibility(newUiOptions);\n //END_INCLUDE (set_ui_flags)\n }", "private void showSystemUI() {\n getWindow().getDecorView().setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "public static void hideSystemUI(Window window) {\n\n // Set the IMMERSIVE flag.\n // Set the content to appear under the system bars so that the content\n // doesn't resize when the system bars hide and show.\n int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN; // hide status bar\n\n if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {\n visibility |= View.SYSTEM_UI_FLAG_IMMERSIVE;\n }\n\n window.getDecorView().setSystemUiVisibility(visibility);\n }", "private void showSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void showSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void showSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void hideStatusBar(){\n try {\n View decorView = getWindow().getDecorView();\n// Hide the status bar.\n int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;\n decorView.setSystemUiVisibility(uiOptions);\n }catch (NullPointerException e){}\n }", "private void setupSystemUI() {\r\n toolbar.animate().translationY(Measure.getStatusBarHeight(getResources())).setInterpolator(new DecelerateInterpolator())\r\n .setDuration(0).start();\r\n getWindow().getDecorView().setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\r\n }", "public void toggleHideyBar() {\n // BEGIN_INCLUDE (get_current_ui_flags)\n // The UI options currently enabled are represented by a bitfield.\n // getSystemUiVisibility() gives us that bitfield.\n int uiOptions = getWindow().getDecorView().getSystemUiVisibility();\n int newUiOptions = uiOptions;\n // END_INCLUDE (get_current_ui_flags)\n // BEGIN_INCLUDE (toggle_ui_flags\n\n // Immersive mode: Backward compatible to KitKat (API 19).\n // Note that this flag doesn't do anything by itself, it only augments the behavior\n // of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample\n // all three flags are being toggled together.\n // This sample uses the \"sticky\" form of immersive mode, which will let the user swipe\n // the bars back in again, but will automatically make them disappear a few seconds later.\n newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;//通过异或来使屏幕全屏缩放.\n newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;\n newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n getWindow().getDecorView().setSystemUiVisibility(newUiOptions);\n //END_INCLUDE (set_ui_flags)\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n myrlayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "public View setSystemUiVisilityMode() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(5894);\n getWindow().addFlags(1024);\n return decorView;\n }", "public static void hideSystemUI(Window window) {\n \n window.addFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE\n | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);\n \n //View.Invisible\n window.getDecorView().setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n }", "@TargetApi(Build.VERSION_CODES.LOLLIPOP)\n private void setupTransparentSystemBarsForLollipop() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getWindow();\n window.getAttributes().systemUiVisibility |=\n (View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS\n | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.TRANSPARENT);\n window.setNavigationBarColor(Color.TRANSPARENT);\n }\n }", "public void showSystemUI() {\r\n if (PhotoViewActivity.this != null)\r\n PhotoViewActivity.this.runOnUiThread(new Runnable() {\r\n public void run() {\r\n toolbar.animate().translationY(Measure.getStatusBarHeight(getResources())).setInterpolator(new DecelerateInterpolator())\r\n .setDuration(240).start();\r\n photoViewActivity.setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\r\n fullScreenMode = false;\r\n }\r\n });\r\n\r\n }", "private void ocultarBarras(){\n View decorView = getWindow().getDecorView();\n int uiOptions = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_FULLSCREEN;\n decorView.setSystemUiVisibility(uiOptions);\n }", "public void makeFullScreen() {\n currentApiVersion = android.os.Build.VERSION.SDK_INT;\n final int flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE |\n View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |\n View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |\n View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n if (currentApiVersion >= Build.VERSION_CODES.KITKAT) {\n getWindow().getDecorView().setSystemUiVisibility(flags);\n final View decorView = getWindow().getDecorView();\n decorView.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() {\n @Override\n public void onSystemUiVisibilityChange(int visibility) {\n if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\n decorView.setSystemUiVisibility(flags);\n }\n }\n });\n }\n }", "static void maximumWindow(View decorView) {\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n if (hasFocus) {\n decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n }\n }", "private void showSystemUI() {\n photoView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n isShowingSystemUI = true;\n }", "private void disableFullscreen() {\n mainContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\r\n isFullscreen = false;\r\n\r\n // Schedule a runnable to display UI elements after a delay\r\n fullscreenHandler.removeCallbacks(enableFullscreenRunnable);\r\n fullscreenHandler.postDelayed(disableFullscreenRunnable, UI_ANIMATION_DELAY);\r\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n View decorView = getWindow().getDecorView();\n if (hasFocus) {\n decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n View decorView = getWindow().getDecorView();\n if(hasFocus) {\n decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n if (hasFocus) {\n getWindow().getDecorView().setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n }\n }", "private static void invasionStatusBar(Activity activity) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = activity.getWindow();\n View decorView = window.getDecorView();\n decorView.setSystemUiVisibility(decorView.getSystemUiVisibility()\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.TRANSPARENT);\n }\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n int flags = View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;\n\n Activity activity = getActivity();\n if (activity != null\n && activity.getWindow() != null) {\n activity.getWindow().getDecorView().setSystemUiVisibility(flags);\n }\n ActionBar actionBar = getSupportActionBar();\n if (actionBar != null) {\n actionBar.hide();\n }\n\n }", "public static void showSystemUI(Window window) {\n\n int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;\n\n window.getDecorView().setSystemUiVisibility(visibility);\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n\n final View decorView = getWindow().getDecorView();\n\n if (hasFocus) {\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n }\n }", "public void setFullScreen() {\r\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\r\n Window window = getWindow();\r\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS\r\n | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\r\n window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);\r\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\r\n window.setStatusBarColor(Color.TRANSPARENT);\r\n window.setNavigationBarColor(Color.TRANSPARENT);\r\n }\r\n }", "private void restoreSettings() {\n getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);\n getWindow().getDecorView().setSystemUiVisibility(systemUiVisibilitySetting);\n\n }", "public void setupTransparentStatusBar(){\n\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setFlags(\n WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS,\n WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n window.setFlags(\n WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION,\n WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n window.setNavigationBarColor(getResources().getColor(R.color.colorPrimaryDark));\n window.setStatusBarColor(getResources().getColor(R.color.colorPrimaryDark));\n }\n\n }", "public void toggleSystemUI() {\r\n if (fullScreenMode)\r\n showSystemUI();\r\n else hideSystemUI();\r\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n gameBoard.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n\n calculateConstants();\n }", "private void hideActionBar() {\n View decorView = getWindow().getDecorView();\n // Hide the status bar.\n int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;\n decorView.setSystemUiVisibility(uiOptions);\n // Hide the action bar\n getSupportActionBar().hide();\n }", "private void showSystemUi()\n\t{\n\t\tif (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)\n\t\t\treturn;\n\n\t\tmUnityPlayer.setSystemUiVisibility(mUnityPlayer.getSystemUiVisibility() & ~getLowProfileFlag());\n\t}", "public void showSystemUI() {\r\n this.mTargetContainer.getDecorView().setSystemUiVisibility(0);\r\n }", "@SuppressLint(\"InlinedApi\")\n @Override\n public void run() {\n mapView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "@Override\n\t\t\tpublic void onSystemUiVisibilityChange(final int visibility)\n\t\t\t{\n\t\t\t\tshowSystemUi();\n\t\t\t}", "public void reevaluateStatusBarVisibility() {\n if (updateStatusBarVisibilityLocked(getDisplayPolicy().adjustSystemUiVisibilityLw(this.mLastStatusBarVisibility))) {\n this.mWmService.mWindowPlacerLocked.requestTraversal();\n }\n }", "private void addUiVisibilityChangeListener()\n\t{\n\t\tif (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)\n\t\t\treturn;\n\n\t\tmUnityPlayer.setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener()\n\t\t{\n\t\t\t@Override\n\t\t\tpublic void onSystemUiVisibilityChange(final int visibility)\n\t\t\t{\n\t\t\t\t// Whatever changes - force status/nav bar to be visible\n\t\t\t\tshowSystemUi();\n\t\t\t}\n\t\t});\n\t}", "private void m119425d() {\n this.mSystemBar.setBackgroundColor(0);\n setSystemBarDisplayHomeAsUp();\n setSystemBarElevation(0.0f);\n setSystemBarTitleColor(ContextCompat.getColor(getActivity(), 17170445));\n setSystemBarIconColor(ContextCompat.getColor(getContext(), R.color.white));\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n //Show and hide navigation bar (Immersive mode)\n View showAndHideBars = findViewById(R.id.mylayout);\n showAndHideBars.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "@Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n //Show and hide navigation bar (Immersive mode)\n View showAndHideBars = findViewById(R.id.mylayout);\n showAndHideBars.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private static void removeFakeStatusBarViewIfExist(Activity activity) {\n Window window = activity.getWindow();\n ViewGroup mDecorView = (ViewGroup) window.getDecorView();\n\n View fakeView = mDecorView.findViewWithTag(TAG_FAKE_STATUS_BAR_VIEW);\n if (fakeView != null) {\n mDecorView.removeView(fakeView);\n }\n }", "static void translucentStatusBar(Activity activity) {\n Window window = activity.getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);\n\n ViewGroup mContentView = (ViewGroup) activity.findViewById(Window.ID_ANDROID_CONTENT);\n View mContentChild = mContentView.getChildAt(0);\n\n removeFakeStatusBarViewIfExist(activity);\n removeMarginTopOfContentChild(mContentChild, getStatusBarHeight(activity));\n if (mContentChild != null) {\n ViewCompat.setFitsSystemWindows(mContentChild, false);\n }\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n if (hasFocus) {\n decorView.setSystemUiVisibility(hideSystemBars());\n }\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "public void underStatusBar(boolean z, boolean z2) {\n if (this.topSpace != null) {\n this.topSpace.setVisibility(z ? 8 : 0);\n }\n if (this.rlRoot != null) {\n this.rlRoot.setFitsSystemWindows(false);\n BarUtils.setStatusBarLightMode(this, !z2);\n useBlackTitle(!z2);\n RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.rlTitleBar.getLayoutParams();\n layoutParams.setMargins(0, BarUtils.getStatusBarHeight(), 0, 0);\n this.rlTitleBar.setLayoutParams(layoutParams);\n }\n }", "private void changeStatusBarColor() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.TRANSPARENT);\n }\n\n }", "public void hideToolbarAndSideMenu() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n // This locks the drawer so it cant be opened\n drawer.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);\n\n // Hides the toolbar\n ViewGroup.LayoutParams layoutParams = toolbar.getLayoutParams();\n layoutParams.height = 0;\n toolbar.setLayoutParams(layoutParams);\n }\n });\n\n }", "private void changeStatusBarColor() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getWindow();\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.TRANSPARENT);\n }\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n myrlayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "public void updateSystemUiVisibility(int visibility, int globalDiff) {\n forAllWindows((Consumer<WindowState>) new Consumer(visibility, globalDiff) {\n /* class com.android.server.wm.$$Lambda$DisplayContent$1C_u_mpQFfKL_O8K1VFzBgPg50 */\n private final /* synthetic */ int f$0;\n private final /* synthetic */ int f$1;\n\n {\n this.f$0 = r1;\n this.f$1 = r2;\n }\n\n @Override // java.util.function.Consumer\n public final void accept(Object obj) {\n DisplayContent.lambda$updateSystemUiVisibility$22(this.f$0, this.f$1, (WindowState) obj);\n }\n }, true);\n }", "private void screenOffBroadcast() {\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n mDoScreenOff = true;\n }\n // prize add v8.0 by zhaojian 20171102 end\n\n Intent intent = new Intent(\"prize.set.keyguard.state\");\n intent.putExtra(\"hide\",false);\n intent.putExtra(\"sleep\",true);\n getContext().sendBroadcast(intent);\n flags = false;\n // prize add v8.0 by zhaojian 20171102 start\n beforeIsLock = false;\n // prize add v8.0 by zhaojian 20171102 end\n\n handler.removeMessages(1);\n\n // prize add v8.0 by zhaojian 2017912 start\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N){\n mIsAutoEnterReceiveUi = false;\n }\n // prize add v8.0 by zhaojian 2017912 end\n Log.d(TAG,\"screen off\");\n }", "public void setFullscreen(boolean actionBarDisabled) {\n\n if (Build.VERSION.SDK_INT < 16) {\n\n activity.getWindow().setFlags(\n WindowManager.LayoutParams.FLAG_FULLSCREEN,\n WindowManager.LayoutParams.FLAG_FULLSCREEN);\n\n } else {\n\n View decorView = activity.getWindow().getDecorView();\n\n // Hide the status bar.\n decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);\n\n // Remember that you should never show the action bar if the\n // status bar is hidden, so hide that too if necessary.\n ActionBar actionBar = activity.getSupportActionBar();\n\n if (actionBar != null && actionBarDisabled) {\n actionBar.hide();\n }\n }\n }", "public static /* synthetic */ void m87201a(boolean z, View view) {\n int systemUiVisibility = view.getSystemUiVisibility();\n view.setSystemUiVisibility(z ? systemUiVisibility | 16 : systemUiVisibility & -17);\n }", "public void refreshPlaybackInfoVisibility() {\n LinearLayout fakeSplitActionBar = (LinearLayout) findViewById(R.id.fake_split_action_bar);\n final ActionBar actionBar = getSupportActionBar();\n if (fakeSplitActionBar != null) {\n if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {\n fakeSplitActionBar.setVisibility(LinearLayout.GONE);\n actionBar.setDisplayShowCustomEnabled(true);\n } else {\n fakeSplitActionBar.setVisibility(LinearLayout.VISIBLE);\n actionBar.setDisplayShowCustomEnabled(false);\n }\n }\n }", "public void hideToolbarButtons() {\n Log.i(tag, \"hideToolbarButtons\");\n this.actionBarDrawerToggle.setHomeAsUpIndicator((Drawable) null);\n this.settingsButton.setVisibility(4);\n }", "@Override // com.zhihu.android.app.p1311ui.fragment.BaseFragment\n public boolean isSystemUiFullscreen() {\n return true;\n }", "@Override // com.zhihu.android.app.p1311ui.fragment.BaseFragment\n public boolean isSystemUiFullscreen() {\n return true;\n }", "@Override // com.zhihu.android.app.p1311ui.fragment.BaseFragment, com.zhihu.android.app.p1311ui.fragment.webview.WebViewFragment2\n public boolean isSystemUiFullscreen() {\n return true;\n }", "public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_online);\n View decorView = getWindow().getDecorView();\n // Hide the status bar.\n int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n decorView.setSystemUiVisibility(uiOptions);\n // Remember that you should never show the action bar if the\n // status bar is hidden, so hide that too if necessary.\n ActionBar actionBar = getSupportActionBar();\n actionBar.hide();\n }", "private void hideMenuScreen()\n {\n logoutButton.setVisibility(textViewLabel.INVISIBLE);\n battleButton.setVisibility(View.INVISIBLE);\n char1.setVisibility(View.INVISIBLE);\n char2.setVisibility(View.INVISIBLE);\n char3.setVisibility(View.INVISIBLE);\n }", "public void animateKeyguardStatusBarOut() {\n ValueAnimator ofFloat = ValueAnimator.ofFloat(new float[]{this.mKeyguardStatusBar.getAlpha(), 0.0f});\n ofFloat.addUpdateListener(this.mStatusBarAnimateAlphaListener);\n ofFloat.setStartDelay(this.mKeyguardStateController.isKeyguardFadingAway() ? this.mKeyguardStateController.getKeyguardFadingAwayDelay() : 0);\n ofFloat.setDuration(this.mKeyguardStateController.isKeyguardFadingAway() ? this.mKeyguardStateController.getShortenedFadingAwayDuration() : 360);\n ofFloat.setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN);\n ofFloat.addListener(new AnimatorListenerAdapter() {\n public void onAnimationEnd(Animator animator) {\n NotificationPanelViewController.this.mAnimateKeyguardStatusBarInvisibleEndRunnable.run();\n }\n });\n ofFloat.start();\n }", "@TargetApi(Build.VERSION_CODES.KITKAT_WATCH)\n private void init() {\n setFitsSystemWindows(false);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {\n setOnApplyWindowInsetsListener((view, insets) -> {\n if (getHeaderCount() == 0) {\n return FullscreenNavigationView.this.onApplyWindowInsets(insets);\n }\n return getHeaderView(0).onApplyWindowInsets(insets);\n });\n }\n }", "public void onResume() {\n super.onResume();\n setSystemUiVisilityMode();\n }", "public void setFullScreen(){\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tgetWindow().setFlags(LayoutParams.FLAG_FULLSCREEN, LayoutParams.FLAG_FULLSCREEN);\n\t}", "@Override\n public boolean onPreDraw() {\n mNavigationBarView.setSystemUiVisibility(mSystemUiFlags);\n return true;\n }" ]
[ "0.8305635", "0.8224361", "0.8190639", "0.80639213", "0.80339384", "0.80339384", "0.80339384", "0.80339384", "0.80339384", "0.80339384", "0.7992419", "0.7990797", "0.78727895", "0.7830553", "0.78135484", "0.7761877", "0.75880176", "0.7560409", "0.75301653", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.7487276", "0.74634725", "0.745038", "0.74408525", "0.74061406", "0.74061406", "0.74061406", "0.73567736", "0.7321294", "0.72965735", "0.7242647", "0.72220355", "0.71751267", "0.7159255", "0.7149444", "0.703905", "0.69724846", "0.69558996", "0.6923264", "0.6911117", "0.6898457", "0.68250424", "0.68226045", "0.6811625", "0.67225754", "0.6691387", "0.66403604", "0.6589846", "0.65698636", "0.65331554", "0.6498515", "0.64535934", "0.64447844", "0.6439079", "0.63963044", "0.6364864", "0.6349256", "0.6305086", "0.62653935", "0.6259892", "0.62424666", "0.6192042", "0.6192042", "0.6133094", "0.6089799", "0.60836", "0.59865934", "0.59865934", "0.59865934", "0.59865934", "0.59865934", "0.59865934", "0.5834451", "0.58309543", "0.5810639", "0.5805854", "0.57827735", "0.5735993", "0.57335323", "0.5723126", "0.5714236", "0.56897616", "0.56878585", "0.5649752", "0.5649752", "0.5615663", "0.56052506", "0.56013685", "0.5595393", "0.5591431", "0.5584981", "0.55640584", "0.5560485" ]
0.0
-1
Delayed display of UI elements
@Override public void run() { ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressLint(\"InlinedApi\")\n private void show() {\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\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}", "private void delayedHide(int delayMillis) {\n\n }", "public void display() {\r\n\t\tsetVisible(true);\r\n\t}", "public void display()\r\n\t{\r\n\t\t//System.out.println(\"Call to display\");\r\n\t\tif (this.isRunning) {\r\n\t\t\tfor (int i=0;i<Actions.size();i++) {\r\n\t\t\t\t((Action)Actions.elementAt(i)).tick(currTime++);\r\n\t\t\t}\r\n\t\t}\r\n\t\trender(true);\r\n\t}", "public void onDisplay() {\n\n\t}", "public void display() {\n\t\tthis.setVisible(true);\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\tFineModulationDisplay(FineModulation);\n\t\tAutoGreaseDisplay(AutoGrease);\n\t\tQuickcouplerDisplay(Quickcoupler);\n\t\tRideControlDisplay(RideControl);\n\t\tBeaconLampDisplay(BeaconLamp);\n\t\tMirrorHeatDisplay(MirrorHeat);\n//\t\tFNKeyDisplay(ParentActivity.LockEntertainment);\n\t}", "public void display() {\n startPreview();\n }", "private void DisplaySleep(){\n\n try {\n TimeUnit.SECONDS.sleep(1);\n }\n catch(InterruptedException e){}\n }", "static public void display(){\n\n elapsedTime = TimerManager.getTime() - startTime;\n\n if (!isDone){\n\n //Animate\n if (TimerManager.getTime()-animTimer > animSpeed){\n animTimer = TimerManager.getTime();\n frame++;\n }\n if (frame > 27){\n frame = 27;\n }\n \n switch (state){\n case 1:\n //Fade in\n alpha = 300 - (int)(elapsedTime/3);\n if (alpha <= 0){\n alpha = 0;\n state = 2;\n startTime = TimerManager.getTime();\n }\n break;\n case 2:\n //Wait a bit\n if (elapsedTime > 2000){\n state = 3;\n startTime = TimerManager.getTime();\n }\n break;\n case 3:\n //Fade out\n alpha = (int)(elapsedTime/4);\n if (alpha >= 255){\n alpha = 255;\n state = 4;\n startTime = TimerManager.getTime();\n isDone = true;\n }\n break;\n }\n \n //Display our sprites\n\n Shapes.begin(Renderer.cameraUI);\n Shapes.setColor(255,255,255,255);\n Shapes.drawBox(0,0,(float)Display.getWidth(),(float)Display.getHeight());\n Shapes.end();\n\n Renderer.startUI();\n\n Renderer.setColor(Color.BLACK);\n Text.draw(0,0,\"State: \"+state);\n Renderer.setColor(Color.WHITE);\n\n Renderer.draw(splashTextures[frame % 28].getRegion(),(float) Display.getWidth()/2 - 128, (float)Display.getHeight()/2-128,256,256);\n\n Renderer.endUI();\n\n Shapes.begin(Renderer.cameraUI);\n Shapes.setColor(0,0,0,Math.min(255,alpha));\n Shapes.drawBox(0,0,(float)Display.getWidth(),(float)Display.getHeight());\n Shapes.end();\n\n }\n }", "@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}", "public void run() {\n\t\t\t\t\t\tif (__delayCounter == _delayCounter[0]) {\r\n\t\t\t\t\t\t\t_pageBook.showPage(__page);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}", "public void animateButtons ()\r\n\t{\r\n\t\tGraphics g = getGraphics ();\r\n\t\t\r\n\t\tif (display == true){\r\n\t\t\tdelay (1000);\r\n\t\t\tdisplayCode(g);\r\n\t\t}\r\n\t\telse if (display == false){\r\n\t\t\thandleAction(g);\r\n\t\t}\r\n\t}", "@Override\n public void display() {\n display.display();\n }", "@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\temotionLayout.setVisibility(View.VISIBLE);\n\t\t\t\t}", "public void slowDownProcess() {\n\n for (int i = 0; i < arrayList.size(); i++) {\n arrayList.get(i).gifImageView.setImageDrawable(null);\n }\n try {\n Thread.sleep(100);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n for (int i = 0; i < arrayList.size(); i++) {\n arrayList.get(i).display();\n }\n }", "public void showUnready();", "public void onDisplay() {\n }", "public void update() {\n\n\t\tdisplay();\n\t}", "public void run(){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(10L);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tupdateButtonBounds();\n\t\t\t\t}", "@Override\r\n\tpublic void display() {\n\t\tSystem.out.println(\"Displaying...\");\r\n\t}", "public void display() {\n\t\tSystem.out.println(\"do something...\");\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 updateUI(){}", "@Override\r\n public void updateUI() {\r\n }", "private void showLoading()\n {\n relLoadingPanel.setVisibility(View.VISIBLE);\n ViewHelper.setViewGroupEnabled(scrMainContainer, false);\n }", "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 }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n ActionBar actionBar = getSupportActionBar();\n if (actionBar != null) {\n actionBar.show();\n }\n }", "public void show() {\n\t\t// Useless if called in outside animation loop\n\t\tactive = true;\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t\tMascota.set_desinfectar();\r\n\t\t\t\tmostrar_vida.setText(Mascota.get_vida() + \" %\");\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\t\r\n\t\t\t\t\teti_actividad.setText(\"Grrr...grrrr...Hijos de puta!\");\r\n\t\t\t\t\teti_actividad.setVisible(true);\r\n\t\t\t\t\tThread.sleep(6000);\r\n\t\t\t\t\teti_actividad.setVisible(false);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}", "private void showDisplay() {\n this.display.displayScreen();\n }", "public void updateUI() {\n\t\tgetLoaderManager().restartLoader(0, null, this);\n\t}", "public void display() {\n\t\t\n\t}", "public void display() {\n\t\t\n\t}", "public void update(){\n\t\tthis.setVisible(true);\n\t}", "public void redisplay();", "public void showComplete() {\r\n showCompleted = !showCompleted;\r\n todoListGui();\r\n }", "public void run() {\n loadAlertAnimationDelay(aType);\n }", "@Override\n\tpublic void display() {\n\t\t\n\t}", "@Override\n\tpublic void display() {\n\t\t\n\t}", "@Override\n public void run() {\n pg2.setVisibility(View.VISIBLE);\n }", "public void startLoading() {\r\n\t\tgetDisplay().setRowCount(0, true);\r\n\t\tlabel1.setHTML(\"\");\r\n\t\tlabel2.setHTML(\"\");\r\n\t}", "void updateDisplay()\r\n {\r\n\tCustomerNode temp = q.front();\r\n\tint i = 0;\r\n\r\n\tdisplayArea.setText(\"\");\r\n\t\r\n\tif (q.isEmpty())\r\n\t{\r\n displayArea.setText(\"Nobody waiting...\\n\");\r\n\t}\r\n\telse\r\n\t{\r\n do\r\n {\r\n displayArea.append(\"\" + ++i + \": \" + temp.getName()\r\n + \" \" + temp.getPhone() + \"\\n\");\r\n //temp = q.getNext(temp);\r\n temp = temp.getNext();\r\n }\r\n while (temp != null);\r\n\t}\r\n }", "public void start() {\n\t\t setVisible(true);\n\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 display() {\n\t\tSystem.out.println(\"display..\");\n\t}", "public void updateUI()\n\t{\n\t\tif( isRunning() == false) \n\t\t{\n\t\t\tupdateButton(\"Run\");\n\t\t\tbutton.setClickable(true);\n\t\t\tupdateTextView(Feedback.getMessage(Feedback.TYPE.NEW_TEST, null));\n\t\t}else\n\t\t{\n\t\t\tbutton.setClickable(true);\n\t\t\tupdateButton( \"Stop\" );\n\t\t\tupdateTextView(\"Tests are running.\");\n\n\t\t}\n\t}", "public void display()\r\n\t{\r\n\t\t\r\n\t}", "@Override\n\tpublic void display() {\n\n\t}", "@Override\n\tpublic void display() {\n\n\t}", "@Override\n\tpublic void display() {\n\n\t}", "@SuppressLint(\"InlinedApi\")\n private void show() {\n myrlayout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "void showNextEventsLoadingWheel();", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\n\tprotected void UpdateUI() {\n\t\t\n\t}", "@Override\r\n\tpublic void display() {\n\r\n\t}", "public void display() {\n java.awt.EventQueue.invokeLater(new Runnable() {\n public void run() {\n new ProviderMenu().setVisible(true);\n\n }\n });\n }", "public void display(int uMove, int cMove, boolean hard)\r\n {\r\n animate.start(uMove, cMove, hard);\r\n }", "public void updateUI(){\n\t\t\n\t\ttimeTV.setText(\"\"+String.format(\"\" + gameClock%10));\n\t\ttimeTV2.setText(\"\"+ gameClock/10+\".\");\n\t\tif (currentGameEngine!=null) {\n\t\t\tmultLeft.setText(\"multiplier: \"+currentGameEngine.getMultiplier()+\"X\");\n\t\t\tscoreTV.setText(\"\"+currentGameEngine.getScore());\n\t\t} else {\n\t\t\tscoreTV.setText(\"0\");\n\t\t}\n\n\t\t//errorTV.setText(\"\"+mFrameNum);\n\t\t\n\t\t\n\t}", "void showNext(){\n Log.d(\"Nexting\");\n right.post(new Runnable() {\n @Override\n public void run() {\n ViewAnimator.popInZero(right, 0, 200);\n }\n });\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mContentView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "void showMainLoadingWheel();", "public void showTimer(){\n mTimerProgressBar.setVisibility(View.VISIBLE);\n mTimerText.setVisibility(View.VISIBLE);\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\twhile(running) {\r\n\t\t\t\trepaint();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t}catch (InterruptedException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private void displayTask() {\n this.task = new Task();\n Color color = this.task.getColor();\n this.taskPanel.displayColor(color);\n }", "private void updateUIAfterTick(){ \n //turn counter\n this.turnClock.setText(\"Turn: \" + this.village.getTurnCountAsString());\n \n //population\n this.populationAmount.setText(\"Population: \" + Integer.toString(this.village.getPopulation().getPopulationAmount()) );\n this.populationGrowthrate.setText(\"Growthrate: \" + Float.toString(this.village.getPopulation().getGrowthrate()));\n\n //buildings:\n this.constructedBuildingsArea.setText(this.getConstructedBuildingsAsList());\n \n //event\n this.eventText.setText(this.currentEvent.getEventText());\n this.eventOption1Btn.setText(this.currentEvent.getOption1Text());\n this.eventOption2Btn.setText(this.currentEvent.getOption2Text());\n this.eventOption3Btn.setText(this.currentEvent.getOption3Text());\n this.eventOption4Btn.setText(this.currentEvent.getOption4Text());\n \n }", "@Override\r\n\tpublic void show() {\n\t\tSystem.out.println(\"Showing...\");\r\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\t\tebar.setVisibility(View.VISIBLE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tesend.setVisibility(View.GONE);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetopic.setEnabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\tetext.setEnabled(false);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}", "private void showPaySuccessCardView() {\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n paySuccessCardView.setVisibility(View.VISIBLE);\r\n }\r\n });\r\n try {\r\n Thread.sleep(1200);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n runOnUiThread(new Runnable() {\r\n @Override\r\n public void run() {\r\n paySuccessCardView.setVisibility(View.GONE);\r\n }\r\n });\r\n\r\n }", "public void start() {\r\n view.addListener(this);\r\n view.makeVisible();\r\n view.display();\r\n }", "@Override\n public void run() {\n try{\n Thread.sleep(5000);\n // To get rid of the Exception lets run the label updating after process is get completing. So that is label is\n // getting updated on the UI Thread and we don't get any exception\n Platform.runLater(new Runnable() { // Opening new Runnable to update the label\n @Override\n public void run() { // This is running in the UI Thread so updating the label\n ourLabel.setText(\"We did something\");\n }\n });\n } catch (InterruptedException e) {\n // We don't care about this\n }\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void updateUi() {\n\n }", "@Override\n public void run() {\n mButton_Buy_Ticket.setVisibility(View.VISIBLE);\n ln_view_number.setVisibility(View.VISIBLE);\n }", "@Override\n public void run() {\n mButton_Buy_Ticket.setVisibility(View.VISIBLE);\n ln_view_number.setVisibility(View.VISIBLE);\n }", "@Override\n public void display() {\n\n }", "public void hideIn1() {\r\n\t\thideTimer.schedule(500);\r\n\t}", "public void run() {\n\t\t\t\t\t\t\t\t\timageList.removeView(Moreview);\r\n\t\t\t\t\t\t\t\t\tgenerateUI(tempArrayList);\r\n\t\t\t\t\t\t\t\t}", "@Override\n public void run() {\n headerText.startAnimation(AnimationUtils.loadAnimation(Home.this, R.anim.view_fallingfromsky));\n headerText.setVisibility(View.VISIBLE);\n\n spaconIcon.startAnimation(AnimationUtils.loadAnimation(Home.this, R.anim.view_fadein_long));\n spaconIcon.setVisibility(View.VISIBLE);\n\n if (fillableLoader.getVisibility() == View.GONE) {\n fillableLoader.setVisibility(View.VISIBLE);\n }\n fillableLoader.start();\n }", "protected void redisplay() {\n\t\tdisplay.setText(\"\" + calc.getDisplayValue());\n\t}", "public void showReady();", "public void setUploading()\n {\n jPanel4.setVisible(false);\n th.start();\n }", "public void display() {\n\t}", "public void done() {\n fadeOut();\n animate(true);\n EUtils.waitAndRun(2000, this::hide);\n }", "private void updateDisplay() {\n btnScheduleTime.setText(new StringBuilder().append(PHHelper.pad(mHour))\n .append(\":\").append(PHHelper.pad(mMinute)));\n }", "public void displayToScreen(){\n System.out.println(convertBoardToString());\n delay();\n }", "public void showLoading() {\n }", "public void run() {\n\t\tif (!Sequencer.isPaused()) update(Sequencer.getTempo());\n\t\tdisplay();\n\t}", "private static void laterShowNewAtlas() {\n javax.swing.SwingUtilities.invokeLater(new Runnable() {\n public void run() {\n displayNewAtlas();\n }\n });\n }", "@Override\r\n\t\tpublic void run() {\n\t\t\tMusicPlayerContainer.this.adjustInfoTextViewAlpha();\r\n\t\t}", "@Override\r\n\tpublic void show() {\n\t\t\r\n\t\t\r\n\t}", "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}", "void showLoading(boolean visible);" ]
[ "0.6941023", "0.6717221", "0.66713834", "0.6607852", "0.65695727", "0.6560161", "0.64995843", "0.6486983", "0.6460261", "0.6453134", "0.64354575", "0.6428714", "0.63923097", "0.6370556", "0.63703376", "0.63700414", "0.63254714", "0.6321182", "0.62877566", "0.62872857", "0.62799215", "0.62733984", "0.6272416", "0.6262971", "0.6262971", "0.62536764", "0.6249576", "0.6221857", "0.6214979", "0.62083197", "0.6180594", "0.61700994", "0.61580616", "0.6145497", "0.6138977", "0.6138977", "0.6132597", "0.611653", "0.6114813", "0.6113899", "0.6111747", "0.6111747", "0.60965985", "0.6092172", "0.6091038", "0.6083055", "0.6082333", "0.6057418", "0.6056218", "0.6050508", "0.60458595", "0.60458595", "0.60458595", "0.60457903", "0.6045566", "0.60400224", "0.60400224", "0.6035563", "0.6031806", "0.60261333", "0.6021672", "0.60195243", "0.6004326", "0.6004326", "0.6004326", "0.6004326", "0.6004326", "0.6004326", "0.6004161", "0.59862787", "0.5982746", "0.5980745", "0.59769976", "0.5966131", "0.5954186", "0.5954176", "0.5951598", "0.5950513", "0.5950403", "0.5950403", "0.5950403", "0.59404606", "0.59404606", "0.5935967", "0.5928956", "0.59255135", "0.59220004", "0.5920379", "0.59140897", "0.5902309", "0.58984464", "0.5898209", "0.5895784", "0.58850217", "0.5883538", "0.58806777", "0.58786076", "0.5876114", "0.5875236", "0.5871956", "0.5863861" ]
0.0
-1
Show the system bar
@SuppressLint("InlinedApi") private void show() { mVisible = true; // Schedule a runnable to display UI elements after a delay mHideHandler.removeCallbacks(mHidePart2Runnable); mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void showSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void showSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void showSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void showSystemUI() {\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n );\n }", "private void showSystemUI() {\n getWindow().getDecorView().setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n }", "private void setupSystemUI() {\r\n toolbar.animate().translationY(Measure.getStatusBarHeight(getResources())).setInterpolator(new DecelerateInterpolator())\r\n .setDuration(0).start();\r\n getWindow().getDecorView().setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\r\n }", "public void showSystemUI() {\r\n if (PhotoViewActivity.this != null)\r\n PhotoViewActivity.this.runOnUiThread(new Runnable() {\r\n public void run() {\r\n toolbar.animate().translationY(Measure.getStatusBarHeight(getResources())).setInterpolator(new DecelerateInterpolator())\r\n .setDuration(240).start();\r\n photoViewActivity.setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\r\n fullScreenMode = false;\r\n }\r\n });\r\n\r\n }", "public void showSystemUI() {\r\n this.mTargetContainer.getDecorView().setSystemUiVisibility(0);\r\n }", "protected void showSystemMenu() {\n windowMenu.doClick(0);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "public void toggleSystemUI() {\r\n if (fullScreenMode)\r\n showSystemUI();\r\n else hideSystemUI();\r\n }", "private void showBars() {\n if (!mIsActive || mShowBars) {\n return;\n }\n mShowBars = true;\n mOrientationManager.unlockOrientation();\n showToolBar(true);\n showStatusBar();\n // mActionBar.show();\n //mActivity.getGLRoot().setLightsOutMode(false);\n refreshHidingMessage();\n refreshBottomControlsWhenReady();\n }", "private void showSystemUI() {\n photoView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n isShowingSystemUI = true;\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView. setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize *'hen the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "private void showSystemUi()\n\t{\n\t\tif (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)\n\t\t\treturn;\n\n\t\tmUnityPlayer.setSystemUiVisibility(mUnityPlayer.getSystemUiVisibility() & ~getLowProfileFlag());\n\t}", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);\n }", "private void hideSystemUI() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |\n View.SYSTEM_UI_FLAG_FULLSCREEN |\n View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n }", "private void hideSystemUI() {\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); // enter immersive mode\n }", "private void hideSystemUI() {\n // Set the IMMERSIVE flag.\n // Set the content to appear under the system bars so that the content\n // doesn't resize when the system bars hide and show.\n photoView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\n | View.SYSTEM_UI_FLAG_IMMERSIVE);\n isShowingSystemUI = false;\n }", "private void updateSystemTrayToolTip()\n {\n if (OSUtil.IS_LINUX)\n this.systemTray.setToolTip(\"SFR WiFi Public : Connecté\");\n else\n this.systemTray.setToolTip(FrmMainController.APP_NAME + \" \" + FrmMainController.APP_VERSION + FrmMainController.LINE_SEPARATOR + \"SFR WiFi Public : Connecté\");\n }", "@Override\r\n \t public void onSystemUiVisibilityChange(int visibility) {\n \t if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\r\n \t // TODO: The system bars are visible.\r\n \t \thideSystemUI();\r\n \t } else {\r\n \t // TODO: The system bars are NOT visible. \r\n \t }\r\n \t }", "public static void showSystemUI(Window window) {\n\n int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN;\n\n window.getDecorView().setSystemUiVisibility(visibility);\n }", "public StatusBar() {\n\t\tsuper();\n\t}", "public StatusBar() {\n super();\n super.setPreferredSize(new Dimension(100, 16));\n setMessage(\"Ready\");\n }", "private void initStatusBar() {\n ModelerSession.getStatusBarService().addStatusBarItem(\n getIdentifier(), selectedToolStatusBarItem, JideBoxLayout.FIX\n );\n }", "private void ocultarBarras(){\n View decorView = getWindow().getDecorView();\n int uiOptions = View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_FULLSCREEN;\n decorView.setSystemUiVisibility(uiOptions);\n }", "protected void setupStatusBar() {\r\n\t\tStatusBar statusBar = new StatusBar() {\r\n\t\t\tprivate static final long serialVersionUID = -8334549384792867496L;\r\n\r\n\t\t\t@Override\r\n\t\t\tprotected String makeAngleDescription(String label, Angle angle) {\r\n\t\t\t\tString s;\r\n\t\t\t\tif (Angle.ANGLE_FORMAT_DMS.equals(getAngleFormat()))\r\n\t\t\t\t\ts = String.format(\"%s %s\", label, angle.toDMSString());\r\n\t\t\t\telse\r\n\t\t\t\t\ts = String.format(\"%s %,.6f\\u00B0\", label, angle.degrees);\r\n\t\t\t\treturn s;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * Overridden to capture the current altitude.\r\n\t\t\t */\r\n\t\t\t@Override\r\n\t\t\tprotected String makeEyeAltitudeDescription(double metersAltitude){\r\n\t\t\t\t//System.out.println(\"metersAltitude: \"+ metersAltitude);\r\n\t\t\t\tsetCurrentAltitude(metersAltitude);\r\n\t\t\t\treturn super.makeEyeAltitudeDescription(metersAltitude);\r\n\t\t\t}\r\n\t\t};\r\n\t\tadd(statusBar, BorderLayout.PAGE_END);\r\n\t\tstatusBar.setEventSource(getWWD());\r\n\t}", "public void hideSystemUI(View view) {\n view.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }", "@Override\n\t\t\tpublic void onSystemUiVisibilityChange(final int visibility)\n\t\t\t{\n\t\t\t\tshowSystemUi();\n\t\t\t}", "public TrayHandler() {\n this.statusImages[0] = Toolkit.getDefaultToolkit().getImage(\"src/apache2tray/images/active.png\");\n this.statusImages[1] = Toolkit.getDefaultToolkit().getImage(\"src/apache2tray/images/inactive.png\");\n \n this.statusText[0] = \"Apache is running\";\n this.statusText[1] = \"Apache is not running\";\n \n this.systemtray = SystemTray.getSystemTray();\n }", "private void hideStatusBar(){\n try {\n View decorView = getWindow().getDecorView();\n// Hide the status bar.\n int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;\n decorView.setSystemUiVisibility(uiOptions);\n }catch (NullPointerException e){}\n }", "private void addApplicationSystemTray()\n {\n // Check if the OS has a system tray\n if (SystemTray.isSupported())\n {\n SystemTray tray = SystemTray.getSystemTray();\n \n // Create the popup menu of the system tray\n GenericPopupMenu.PopupMenuType popupMenuType = (OSUtil.IS_MAC ? GenericPopupMenu.PopupMenuType.AWT : GenericPopupMenu.PopupMenuType.SWING);\n this.popupMenu = new GenericPopupMenu(popupMenuType, \"\");\n GenericMenuItem.MenuItemType menuItemType = (OSUtil.IS_MAC ? GenericMenuItem.MenuItemType.AWT : GenericMenuItem.MenuItemType.SWING);\n GenericMenuItemSeparator.MenuItemSeparatorType menuItemSeparatorType = (OSUtil.IS_MAC ? GenericMenuItemSeparator.MenuItemSeparatorType.AWT : GenericMenuItemSeparator.MenuItemSeparatorType.SWING);\n this.popupMenu_ShowApp = new GenericMenuItem(menuItemType, \"Afficher l'application\");\n this.popupMenu_Blanc1 = new GenericMenuItemSeparator(menuItemSeparatorType);\n this.popupMenu_PauseStart = new GenericMenuItem(menuItemType, \"Pause\");\n this.popupMenu_Blanc2 = new GenericMenuItemSeparator(menuItemSeparatorType);\n this.popupMenu_Profiles = new GenericMenuItem(menuItemType, \"Profils\");\n this.popupMenu_Blanc3 = new GenericMenuItemSeparator(menuItemSeparatorType);\n this.popupMenu_Logs = new GenericMenuItem(menuItemType, \"Consulter les logs\");\n this.popupMenu_Parameters = new GenericMenuItem(menuItemType, \"Paramètres\");\n this.popupMenu_Blanc4 = new GenericMenuItemSeparator(menuItemSeparatorType);\n this.popupMenu_Quit = new GenericMenuItem(menuItemType, \"Quitter\");\n \n // Display the top item in bold only on Windows\n if (OSUtil.IS_WINDOWS)\n this.popupMenu_ShowApp.setFont(new Font(menuProfiles.getFont().getName(), Font.BOLD, menuProfiles.getFont().getSize()));\n \n this.popupMenu_Quit.addActionListener( new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n System.exit(0);\n }\n });\n this.popupMenu_ShowApp.addActionListener( new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n setState(FrmMain.NORMAL);\n setVisible(true);\n }\n });\n this.popupMenu_PauseStart.addActionListener( new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n if (popupMenu_PauseStart.getLabel().equalsIgnoreCase(I18nUtil.getInstance().getI18nMsg(\"fr.davidbrun.wifiautoconnect.views.FrmMain.popupMenu_PauseStart.Start\")))\n {\n popupMenu_PauseStart.setLabel(I18nUtil.getInstance().getI18nMsg(\"fr.davidbrun.wifiautoconnect.views.FrmMain.popupMenu_PauseStart.Pause\"));\n }\n else if (popupMenu_PauseStart.getLabel().equalsIgnoreCase(I18nUtil.getInstance().getI18nMsg(\"fr.davidbrun.wifiautoconnect.views.FrmMain.popupMenu_PauseStart.Pause\")))\n {\n popupMenu_PauseStart.setLabel(I18nUtil.getInstance().getI18nMsg(\"fr.davidbrun.wifiautoconnect.views.FrmMain.popupMenu_PauseStart.Start\"));\n }\n }\n });\n this.popupMenu_Parameters.addActionListener( new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n new FrmParameters(FrmMain.this, true).setVisible(true);\n }\n });\n this.popupMenu.addMenuItem(this.popupMenu_ShowApp);\n this.popupMenu.addMenuItemSeparator(this.popupMenu_Blanc1);\n this.popupMenu.addMenuItem(this.popupMenu_PauseStart);\n this.popupMenu.addMenuItemSeparator(this.popupMenu_Blanc2);\n this.popupMenu.addMenuItem(this.popupMenu_Profiles);\n this.popupMenu.addMenuItemSeparator(this.popupMenu_Blanc3);\n this.popupMenu.addMenuItem(this.popupMenu_Logs);\n this.popupMenu.addMenuItem(this.popupMenu_Parameters);\n this.popupMenu.addMenuItemSeparator(this.popupMenu_Blanc4);\n this.popupMenu.addMenuItem(this.popupMenu_Quit);\n \n // Create the system tray\n GenericTrayIcon.TrayIconType trayIconType = (OSUtil.IS_MAC ? GenericTrayIcon.TrayIconType.DEFAULT : GenericTrayIcon.TrayIconType.CUSTOM);\n systemTray = new GenericTrayIcon(trayIconType,\n ResourcesUtil.SYSTEM_TRAY_IMAGE_ICON.getImage(),\n FrmMainController.APP_NAME,\n this.popupMenu.getCurrentPopupMenu());\n \n //To catch events on the popup menu\n systemTray.setImageAutoSize(true);\n systemTray.addActionListener(new ActionListener()\n {\n @Override\n public void actionPerformed(ActionEvent e)\n {\n // TODO: manage double-click\n }\n });\n \n try\n {\n if (OSUtil.IS_MAC)\n tray.add((TrayIcon)systemTray.getCurrentTrayIcon());\n else\n tray.add((JTrayIcon)systemTray.getCurrentTrayIcon());\n }\n catch (Exception e)\n { }\n }\n else // If there is no system tray, we don't do anything\n { }\n }", "public void menuDisplay() {\n\t\t\n\t\tjava.lang.System.out.println(\"\");\n\t\tjava.lang.System.out.println(\"~~~~~~~~~~~~Display System Menu~~~~~~~~~~~~\");\n\t\tjava.lang.System.out.println(\"**** Enter a Number from the Options Below ****\");\n\t\tjava.lang.System.out.println(\"Choice 1 – Print System Details\\n\" + \n\t\t\t\t\t\t \"Choice 2 - Display System Properties\\n\" +\n\t\t\t\t\t\t \"Choice 3 – Diagnose System\\n\" + \n\t\t\t\t\t\t \"Choice 4 – Set Details\\n\" + \n\t\t\t\t\t\t \"Choice 5 – Quit the program\");\n\t\t\n\t}", "@TargetApi(Build.VERSION_CODES.LOLLIPOP)\n private void setupTransparentSystemBarsForLollipop() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = getWindow();\n window.getAttributes().systemUiVisibility |=\n (View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);\n window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS\n | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION);\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.TRANSPARENT);\n window.setNavigationBarColor(Color.TRANSPARENT);\n }\n }", "@Override\n public void onSystemUiVisibilityChange(int visibility) {\n if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\n // TODO: The system bars are visible. Make any desired\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n decorView.setSystemUiVisibility(uiOptions);\n }\n }, 2000);\n } else {\n // TODO: The system bars are NOT visible. Make any desired\n // adjustments to your UI, such as hiding the action bar or\n // other navigational controls.\n }\n }", "public void hideSystemUI() {\r\n if (PhotoViewActivity.this != null)\r\n PhotoViewActivity.this.runOnUiThread(new Runnable() {\r\n public void run() {\r\n toolbar.animate().translationY(-toolbar.getHeight()).setInterpolator(new AccelerateInterpolator())\r\n .setDuration(240).start();\r\n photoViewActivity.setSystemUiVisibility(\r\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\r\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\r\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\r\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\r\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\r\n | View.SYSTEM_UI_FLAG_IMMERSIVE);\r\n fullScreenMode = true;\r\n }\r\n });\r\n }", "public void setTrayIcon()\n\t{\n\t\tImage image = new Image(display, PropertyManager.getInstance().getProperty(\"ICON_FOLDER\"));\n\t\tfinal Tray tray = display.getSystemTray();\n\n\t\tif (tray == null)\n\t\t{\n\t\t\tSystem.out.println(\"The system tray is not available\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfinal TrayItem item = new TrayItem(tray, SWT.NONE);\n\t\t\titem.setToolTipText(PropertyManager.getInstance().getProperty(\"SOFT_INFO\"));\n\n\t\t\tfinal Menu menu = new Menu(shell, SWT.POP_UP);\n\n\t\t\tMenuItem mi1 = new MenuItem(menu, SWT.PUSH);\n\t\t\tMenuItem mi2 = new MenuItem(menu, SWT.PUSH);\n\t\t\tMenuItem mi3 = new MenuItem(menu, SWT.PUSH);\n\t\t\tMenuItem mi4 = new MenuItem(menu, SWT.PUSH);\n\n\t\t\tmi1.setText(\"Show\");\n\t\t\tmi1.addListener(SWT.Selection, new Listener()\n\t\t\t{\n\t\t\t\tpublic void handleEvent(Event event)\n\t\t\t\t{\n\t\t\t\t\tshell.setVisible(true);\n\t\t\t\t\tSystem.out.println(\"selection \" + event.widget);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmi2.setText(\"Hide\");\n\t\t\tmi2.addListener(SWT.Selection, new Listener()\n\t\t\t{\n\t\t\t\tpublic void handleEvent(Event event)\n\t\t\t\t{\n\t\t\t\t\tshell.setVisible(false);\n\t\t\t\t\tSystem.out.println(\"selection \" + event.widget);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmi3.setText(\"Change Operator\");\n\t\t\tmi3.addListener(SWT.Selection, new Listener()\n\t\t\t{\n\t\t\t\tpublic void handleEvent(Event event)\n\t\t\t\t{\n\t\t\t\t\tlogin = \"\";\n\t\t\t\t\tpassword = \"\";\n\t\t\t\t\tInputDialog opDialog = new InputDialog(shell, SWT.DIALOG_TRIM);\n\t\t\t\t\tshell.setEnabled(!shell.getEnabled());\n\t\t\t\t\tshell.setCursor(new Cursor(display, SWT.CURSOR_WAIT));\n\t\t\t\t\tString credential = opDialog.createDialogArea();\n\t\t\t\t\tlogin = credential.substring(0, credential.indexOf(File.separator));\n\t\t\t\t\tpassword = credential.substring(credential.indexOf(File.separator));\n\t\t\t\t\tshell.setEnabled(true);\n\t\t\t\t\tshell.setCursor(new Cursor(display, SWT.CURSOR_ARROW));\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tmi4.setText(\"Close\");\n\t\t\tmi4.addListener(SWT.Selection, new Listener()\n\t\t\t{\n\t\t\t\tpublic void handleEvent(Event event)\n\t\t\t\t{\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\tSystem.out.println(\"selection \" + event.widget);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\titem.addListener(SWT.MenuDetect, new Listener()\n\t\t\t{\n\t\t\t\tpublic void handleEvent(Event event)\n\t\t\t\t{\n\t\t\t\t\tmenu.setVisible(true);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\titem.setImage(image);\n\t\t}\n\t}", "private static void initSystemTray() {\n if (SystemTray.isSupported()) {\n SystemTray tray = SystemTray.getSystemTray();\n PopupMenu menu = new PopupMenu();\n MenuItem exitItem = new MenuItem(Resources.strings().get(\"menu_exit\"));\n exitItem.addActionListener(a -> System.exit(0));\n menu.add(exitItem);\n\n trayIcon = new TrayIcon(Resources.images().get(\"litiengine-icon.png\"), Game.info().toString(), menu);\n trayIcon.setImageAutoSize(true);\n try {\n tray.add(trayIcon);\n } catch (AWTException e) {\n log.log(Level.SEVERE, e.getLocalizedMessage(), e);\n }\n }\n }", "private static void invasionStatusBar(Activity activity) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n Window window = activity.getWindow();\n View decorView = window.getDecorView();\n decorView.setSystemUiVisibility(decorView.getSystemUiVisibility()\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);\n window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);\n window.setStatusBarColor(Color.TRANSPARENT);\n }\n }", "@Override\n public void onSystemUiVisibilityChange(int visibility) {\n if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {\n // TODO: The system bars are visible. Make any desired\n// int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;\n//\n// int a=SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n// decorView.setSystemUiVisibility(a);\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar\n | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);\n\n\n } else {\n // TODO: The system bars are NOT visible. Make any desired\n\n }\n }", "void hideToolbars();", "public void showActionBar(){\n getSupportActionBar().show();\n yell(\"Showing action bar\");\n }", "protected DisplayRequest actionBarDisplay() {\n return DisplayRequest.NO_ACTION_BAR;\n }", "public void FullScreencall() {\n View decorView = getWindow().getDecorView();\n int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n decorView.setSystemUiVisibility(uiOptions);\n }", "public abstract BossBar show();", "private static void showMenu() {\n System.out.println(\"1. Dodaj zadanie\");\n System.out.println(\"2. Wykonaj zadanie.\");\n System.out.println(\"3. Zamknij program\");\n }", "public void showTitleScreen() {\n frame.showMenu();\n }", "public View setSystemUiVisilityMode() {\n View decorView = getWindow().getDecorView();\n decorView.setSystemUiVisibility(5894);\n getWindow().addFlags(1024);\n return decorView;\n }", "void show_info() {\n\t\tsetAlwaysOnTop(false);\n\n\t\tString msg = \"<html><ul><li>Shortcuts:<br/>\"\n\t\t\t\t+ \"(\\\") start macro<br/>\"\n\t\t\t\t+ \"(esc) exit<br/><br/>\"\n\t\t\t\t+ \"<li>Author: <b>Can Kurt</b></ul></html>\";\n\n\t\tJLabel label = new JLabel(msg);\n\t\tlabel.setFont(new Font(\"arial\", Font.PLAIN, 15));\n\n\t\tJOptionPane.showMessageDialog(null, label ,\"Info\", JOptionPane.INFORMATION_MESSAGE);\n\n\t\tsetAlwaysOnTop(true);\n\t}", "public ShowSystemStatusResponse showSystemStatus(ShowSystemStatusRequest request) throws GPUdbException {\n ShowSystemStatusResponse actualResponse_ = new ShowSystemStatusResponse();\n submitRequest(\"/show/system/status\", request, actualResponse_, false);\n return actualResponse_;\n }", "public static void hideSystemUI(Window window) {\n\n // Set the IMMERSIVE flag.\n // Set the content to appear under the system bars so that the content\n // doesn't resize when the system bars hide and show.\n int visibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar\n | View.SYSTEM_UI_FLAG_FULLSCREEN; // hide status bar\n\n if (VERSION.SDK_INT >= VERSION_CODES.KITKAT) {\n visibility |= View.SYSTEM_UI_FLAG_IMMERSIVE;\n }\n\n window.getDecorView().setSystemUiVisibility(visibility);\n }", "public void show(){\n initializeTouchpad();\n initializeButtons();\n initializeShieldBar();\n }", "public static void showPowerMenu() {\n final IWindowManager wm = WindowManagerGlobal.getWindowManagerService();\n try {\n wm.showGlobalActions();\n } catch (RemoteException e) {\n e.printStackTrace();\n }\n }", "public void showStatusBar(boolean bShow) {\n\t\tTSEditorUtils.showStatusBar(m_editor, bShow);\n\t}", "private void hideActionBar() {\n View decorView = getWindow().getDecorView();\n // Hide the status bar.\n int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;\n decorView.setSystemUiVisibility(uiOptions);\n // Hide the action bar\n getSupportActionBar().hide();\n }", "private void m81846c(boolean z) {\n if (C6969H.m41409d(\"G6891C715A8\").equals(this.f58080l) || C6969H.m41409d(\"G6B82D611\").equals(this.f58080l)) {\n this.f58069a.setSystemBarDisplayHomeAsUp();\n } else if (C6969H.m41409d(\"G6A8FDA09BA\").equals(this.f58080l)) {\n this.f58069a.setSystemBarDisplayHomeAsClose();\n } else if (z) {\n this.f58069a.setSystemBarDisplayHomeAsClose();\n }\n }", "private void m119425d() {\n this.mSystemBar.setBackgroundColor(0);\n setSystemBarDisplayHomeAsUp();\n setSystemBarElevation(0.0f);\n setSystemBarTitleColor(ContextCompat.getColor(getActivity(), 17170445));\n setSystemBarIconColor(ContextCompat.getColor(getContext(), R.color.white));\n }", "public static void f_menu() {\n System.out.println(\"----------------------------------------\");\n System.out.println(\"--------------DIGITALSOFT---------------\");\n System.out.println(\"-----version:1.0------28/04/2020.-------\");\n System.out.println(\"-----Angel Manuel Correa Rivera---------\");\n System.out.println(\"----------------------------------------\");\n }", "@Override\n public void onWindowFocusChanged(boolean hasFocus) {\n super.onWindowFocusChanged(hasFocus);\n if (hasFocus) {\n decorView.setSystemUiVisibility(hideSystemBars());\n }\n }", "private static void createAndShowGUI() {\n if (!SystemTray.isSupported()) {\n log.error(\"SystemTray is not supported\");\n return;\n }\n\n SystemTray tray = SystemTray.getSystemTray();\n\n Image icon = createImage(\"/images/b2b.gif\", \"tray icon\");\n trayIcon = new TrayIcon(icon);\n trayIcon.setImageAutoSize(true);\n trayIcon.setToolTip(\"back2back\");\n\n PopupMenu popupMenu = new PopupMenu();\n {\n openWebUIMenuItem = new MenuItem(\"Open back2back web interface\");\n openWebUIMenuItem.addActionListener(B2BTrayIcon::openWebUI);\n popupMenu.add(openWebUIMenuItem);\n }\n popupMenu.addSeparator();\n {\n startAutomaticallyMenuItem = new CheckboxMenuItem(\"Start automatically with system\");\n startAutomaticallyMenuItem.addItemListener(e -> {\n int newState = e.getStateChange();\n setAutoStart(newState == ItemEvent.SELECTED);\n });\n startAutomaticallyMenuItem.setEnabled(serviceController != null);\n popupMenu.add(startAutomaticallyMenuItem);\n }\n popupMenu.addSeparator();\n {\n startMenuItem = new MenuItem(\"Start back2back engine\");\n startMenuItem.setEnabled(false);\n startMenuItem.addActionListener(evt -> {\n try {\n startEngine();\n } catch (ControlException e) {\n log.error(\"Failed to start engine\", e);\n trayIcon.displayMessage(\"back2back\", \"Failed to start engine: \" + e.toString(), TrayIcon.MessageType.ERROR);\n }\n });\n popupMenu.add(startMenuItem);\n }\n {\n stopMenuItem = new MenuItem(\"Stop back2back engine\");\n stopMenuItem.setEnabled(false);\n stopMenuItem.addActionListener(evt -> {\n try {\n stopEngine();\n } catch (ControlException e) {\n trayIcon.displayMessage(\"back2back\", \"Failed to stop engine: \" + e.toString(), TrayIcon.MessageType.ERROR);\n }\n });\n popupMenu.add(stopMenuItem);\n }\n popupMenu.addSeparator();\n {\n MenuItem item = new MenuItem(\"About\");\n item.addActionListener(B2BTrayIcon::about);\n popupMenu.add(item);\n }\n {\n MenuItem item = new MenuItem(\"Check for update\");\n item.setEnabled(updateManager != null);\n item.addActionListener(B2BTrayIcon::checkForUpdate);\n popupMenu.add(item);\n }\n {\n MenuItem item = new MenuItem(\"Close tray icon\");\n item.addActionListener(e -> {\n tray.remove(trayIcon);\n System.exit(0);\n });\n popupMenu.add(item);\n }\n\n// popupMenu.addActionListener(e -> log.debug(\"POPUP ACTION\"));\n trayIcon.setPopupMenu(popupMenu);\n\n trayIcon.addActionListener(e -> log.debug(\"TRAY ACTION\"));\n\n try {\n tray.add(trayIcon);\n } catch (AWTException e) {\n log.error(\"TrayIcon could not be added.\", e);\n return;\n }\n\n //trayIcon.displayMessage(\"back2back\", \"Tray icon ready\", TrayIcon.MessageType.INFO);\n\n // start status update on background thread\n Thread thread = new Thread(B2BTrayIcon::pollStatus);\n thread.setDaemon(true);\n thread.start();\n\n log.info(\"Tray icon ready.\");\n }", "public static void f_menu(){\n System.out.println(\"╔══════════════════════╗\");\r\n System.out.println(\"║ SoftAverageHeight ║\");\r\n System.out.println(\"║Version 1.0 20200428 ║\");\r\n System.out.println(\"║Created by:Andres Diaz║\");\r\n System.out.println(\"╚══════════════════════╝\");\r\n\r\n }", "public void underStatusBar(boolean z, boolean z2) {\n if (this.topSpace != null) {\n this.topSpace.setVisibility(z ? 8 : 0);\n }\n if (this.rlRoot != null) {\n this.rlRoot.setFitsSystemWindows(false);\n BarUtils.setStatusBarLightMode(this, !z2);\n useBlackTitle(!z2);\n RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) this.rlTitleBar.getLayoutParams();\n layoutParams.setMargins(0, BarUtils.getStatusBarHeight(), 0, 0);\n this.rlTitleBar.setLayoutParams(layoutParams);\n }\n }", "public Boolean getShowVBar() { return _showVBar; }", "public static void showGUI() {\n Display display = Display.getDefault();\n Shell shell = new Shell(display);\n EntropyUIconfig inst = new EntropyUIconfig(shell, SWT.NULL);\n Point size = inst.getSize();\n shell.setLayout(new FillLayout());\n shell.layout();\n if (size.x == 0 && size.y == 0) {\n inst.pack();\n shell.pack();\n } else {\n Rectangle shellBounds = shell.computeTrim(0, 0, size.x, size.y);\n shell.setSize(shellBounds.width, shellBounds.height);\n }\n shell.open();\n while (!shell.isDisposed()) {\n if (!display.readAndDispatch())\n display.sleep();\n }\n }", "@Override\r\n\tpublic void ShowToolBar(Context _in_context) {\n\t\tTypeSDKLogger.e( \"ShowToolBar\");\r\n\t}", "@Override\n public int getNumGuiBars() {\n return 1;\n }", "public StatusBar() {\n\t\tthis(DEFAULT_STATUS_MESSAGE, true, 1, 1, true);\n\t}", "private void setActionBar() {\n headView.setText(\"消息中心\");\n headView.setGobackVisible();\n headView.setRightGone();\n // headView.setRightResource();\n }", "private void showSignOutBar() {\n Log.d(TAG, \"Showing sign out bar\");\n findViewById(R.id.sign_in_bar).setVisibility(View.GONE);\n findViewById(R.id.sign_out_bar).setVisibility(View.VISIBLE);\n }", "private void setupToolbars(){\n\t\ttopBar = new TopBar(0, 0, setup.getFrameWidth()+12, Constants.WINDOW_HEADER_HEIGHT, \n\t\t\t\tConstants.COLOR_HEADER_1, setup);\n\t\t\n\t\tbottomBar = new BottomBar(0, \n\t\t\t\tConstants.WINDOW_HEADER_HEIGHT+(Constants.WINDOW_MAP_MARGIN*2)+Constants.WINDOW_MAP_HEIGHT, \n\t\t\t\tsetup.getFrameWidth()+12, \n\t\t\t\tConstants.WINDOW_HEADER_HEIGHT, \n\t\t\t\tConstants.COLOR_HEADER_1, setup);\n\t\t\n\t\trightBar = new RightBar((Constants.WINDOW_MAP_MARGIN*2)+Constants.WINDOW_MAP_WIDTH, \n\t\t\t\tConstants.WINDOW_HEADER_HEIGHT, \n\t\t\t\tConstants.WINDOW_RIGHT_BAR_WIDTH, \n\t\t\t\tConstants.WINDOW_RIGHT_BAR_HEIGHT, \n\t\t\t\tConstants.COLOR_MAP_LAND, setup);\n\t}", "public StatusBar() {\r\n setLayout(new BorderLayout());\r\n setPreferredSize(new Dimension(100, 20));\r\n panel = new WebPanel();\r\n BoxLayout boxLayout = new BoxLayout(panel, BoxLayout.LINE_AXIS);\r\n panel.setLayout(boxLayout);\r\n panel.add(Box.createHorizontalGlue());\r\n add(panel, BorderLayout.CENTER);\r\n setVisible(false);\r\n }", "public stat() {\n initComponents();\n \n jLabel4.setVisible(false);\n jLabel5.setVisible(false);\n jLabel14.setText(System.getProperty(\"user.name\" ));\n jLabel15.setText(System.getProperty(\"os.name\"));\n \n }", "private void setDisplay() {\n\t\tDisplayOpt.add(\"-sd\");\n\t\tDisplayOpt.add(\"/sd\");\n\t\tDisplayOpt.add(\"showdetails\");\n\n\t}", "public static void updateStatusBar(){\n\t\tstatus.setText(\"Sensors: \"+Sensor.idToSensor.size()+(TurnController.getInstance().getCurrentTurn()!=null?\", Turn: \"+TurnController.getInstance().getCurrentTurn().turn:\"\"));\n\t}", "public JLabel getStatusbarLabel()\r\n {\r\n return lbStatusbar;\r\n }", "private void setStatusBar(String statusMsg)\r\n {\r\n\r\n debug(\"setStatusBar() - get a handle to the main application\");\r\n StockMarketApp mainApp = getMainApp();\r\n\r\n if (mainApp != null)\r\n {\r\n debug(\"setStatusBar() - Sending message to change applications\");\r\n mainApp.setStatus(statusMsg);\r\n }\r\n debug(\"setStatusBar() - Processing completed\");\r\n }", "@Override\r\n\tpublic void ShowToolBar(Context _in_context) {\n\t\tTypeSDKLogger.e(\"ShowToolBar\");\r\n\t}", "public void display() {\n System.out.println(\"显示浅蓝色文本框\");\n }", "private void displayOptions() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Main System Menu\");\n\t\tSystem.out.println(\"----------------\");\n\t\tSystem.out.println(\"A)dd polling place\");\n\t\tSystem.out.println(\"C)lose the polls\");\n\t\tSystem.out.println(\"R)esults\");\n\t\tSystem.out.println(\"P)er-polling-place results\");\n\t\tSystem.out.println(\"E)liminate lowest candidate\");\n\t\tSystem.out.println(\"?) display this menu of choices again\");\n\t\tSystem.out.println(\"Q)uit\");\n\t\tSystem.out.println();\n\t}", "private static void displayUserMenu() {\n\t\tSystem.out.println(\"\\t User Menu Help \\n\" \n\t\t\t\t+ \"====================================\\n\"\n\t\t\t\t+ \"ar <reponame> : To add a new repo \\n\"\n\t\t\t\t+ \"dr <reponame> : To delete a repo \\n\"\n\t\t\t\t+ \"or <reponame> : To open repo \\n\"\n\t\t\t\t+ \"lr : To list repo \\n\"\n\t\t\t\t+ \"lo : To logout \\n\"\n\t\t\t\t+ \"====================================\\n\");\n\t}", "private void displayMenu()\r\n {\r\n System.out.println();\r\n System.out.println(\"--------- Main Menu -------------\");\r\n System.out.println(\"(1) Search Cars\");\r\n System.out.println(\"(2) Add Car\");\r\n System.out.println(\"(3) Delete Car\");\r\n System.out.println(\"(4) Exit System\");\r\n System.out.println(\"(5) Edit Cars\");\r\n }", "public SwingStatusBar() {\n super();\n \n setBorder(BorderFactory.createEmptyBorder(0, SMALL_BORDER, SMALL_BORDER,\n SMALL_BORDER));\n \n messageLabel = new JLabel(DEFAULT_MESSAGE);\n iconLabel = new JLabel(DEFAULT_ICON);\n \n messageLabel.setBorder(BorderFactory.createEtchedBorder());\n iconLabel.setBorder(BorderFactory.createEtchedBorder());\n \n messageLabel.addMouseListener(this);\n iconLabel.addMouseListener(this);\n ErrorManager.getErrorManager().addErrorListener(this);\n clearError();\n \n setLayout(new SpringLayout());\n \n add(messageLabel);\n add(iconLabel);\n \n setPreferredSize(new Dimension(Short.MAX_VALUE, 25));\n setMaximumSize(new Dimension(Short.MAX_VALUE, 25));\n \n layoutBar();\n }", "private Component getStatusBar() {\n\t\tJPanel statusBar = new JPanel();\n\t\tstatusBar.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));\n\t\tstatusLabel = new JLabel(\"Status: \");\n\t\tstatusLabel.setFont(new Font(\"SansSerif\", Font.ITALIC, 11));\n\t\tstatusBar.setLayout(new FlowLayout(FlowLayout.LEFT));\n\t\tstatusBar.add(statusLabel);\n\t\tstatusBar.setBorder(BorderFactory.createEmptyBorder(2, 4, 2, 4));\n\t\treturn statusBar;\n\t}", "private static void displayGuest() {\n // Clear the screen\n clearScreen();\n\n // Display UI\n System.out.println(\"Welcome, Guest.\\n\\n\"\n + \"Choose an option:\\n\"\n + \"- (R)ooms - View rooms and rates\\n\"\n + \"- (S)tays - View availability for your stay\\n\"\n + \"- (B)ack - Goes back to main menu\\n\");\n }", "@Override\n\tprotected void show() {\n\t\tsuper.show();\n\t\tSystem.out.println(\"BBBBBBBBBBBBBBBBBBB\");\n\t}", "public void updateMenus() {\n\t\tSystem.out.println(\"BarGraphDisplayer.updateMenus\");\n\t\tCommandRegistrar.gRegistrar.checkAction(\"barGraph\");\n\t\tCommandRegistrar.gRegistrar.enableAction(\"viewOptions\");\n\t}", "private void printMenu() {\n\t\tSystem.out.printf(\"\\n********** MiRide System Menu **********\\n\\n\");\n\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Create Car\", \"CC\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Book Car\", \"BC\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Complete Booking\", \"CB\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Display ALL Cars\", \"DA\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Search Specific Car\", \"SS\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Search Available Cars\", \"SA\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Seed Data\", \"SD\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Load Cars\", \"LC\");\n\t\tSystem.out.printf(\"%-30s %s\\n\", \"Exit Program\", \"EX\");\n\t\tSystem.out.println(\"\\nEnter your selection: \");\n\t\tSystem.out.println(\"(Hit enter to cancel any operation)\");\n\t}", "private void showSignInBar() {\n Log.d(TAG, \"Showing sign in bar\");\n findViewById(R.id.sign_in_bar).setVisibility(View.VISIBLE);\n findViewById(R.id.sign_out_bar).setVisibility(View.GONE);\n }", "private void Settings(){\n setUndecorated(true); \r\n\t setSize(250,70);\r\n\t setLocationRelativeTo(null);\r\n setAlwaysOnTop(true);\r\n\t setVisible(true);\r\n \r\n addMouseListener(new HandleStatusDialog());\r\n addWindowListener(new HandleStatusDialog());\r\n }", "public ShowSystemStatusResponse showSystemStatus(Map<String, String> options) throws GPUdbException {\n ShowSystemStatusRequest actualRequest_ = new ShowSystemStatusRequest(options);\n ShowSystemStatusResponse actualResponse_ = new ShowSystemStatusResponse();\n submitRequest(\"/show/system/status\", actualRequest_, actualResponse_, false);\n return actualResponse_;\n }", "public void toggleHideyBar() {\n // BEGIN_INCLUDE (get_current_ui_flags)\n // The UI options currently enabled are represented by a bitfield.\n // getSystemUiVisibility() gives us that bitfield.\n int uiOptions = getWindow().getDecorView().getSystemUiVisibility();\n int newUiOptions = uiOptions;\n // END_INCLUDE (get_current_ui_flags)\n // BEGIN_INCLUDE (toggle_ui_flags\n\n // Immersive mode: Backward compatible to KitKat (API 19).\n // Note that this flag doesn't do anything by itself, it only augments the behavior\n // of HIDE_NAVIGATION and FLAG_FULLSCREEN. For the purposes of this sample\n // all three flags are being toggled together.\n // This sample uses the \"sticky\" form of immersive mode, which will let the user swipe\n // the bars back in again, but will automatically make them disappear a few seconds later.\n newUiOptions ^= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;//通过异或来使屏幕全屏缩放.\n newUiOptions ^= View.SYSTEM_UI_FLAG_FULLSCREEN;\n newUiOptions ^= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;\n getWindow().getDecorView().setSystemUiVisibility(newUiOptions);\n //END_INCLUDE (set_ui_flags)\n }", "private void displayMenuOptions()\n {\n // display user options menu\n System.out.println(\"\");\n System.out.println(\"----------------------------------------------------\");\n System.out.println(\"\");\n System.out.println(\"COMMAND OPTIONS:\");\n System.out.println(\"\");\n System.out.println(\" 'on' to force power controller to ON state\");\n System.out.println(\" 'off' to force power controller to OFF state\");\n System.out.println(\" 'status' to see current power controller state\");\n System.out.println(\" 'sunrise' to display sunrise time.\");\n System.out.println(\" 'sunset' to display sunset time.\");\n System.out.println(\" 'next' to display next scheduled event.\");\n System.out.println(\" 'time' to display current time.\");\n System.out.println(\" 'coord' to display longitude and latitude.\");\n System.out.println(\" 'help' to display this menu.\");\n System.out.println(\"\");\n System.out.println(\"PRESS 'CTRL-C' TO TERMINATE\");\n System.out.println(\"\");\n System.out.println(\"----------------------------------------------------\");\n System.out.println(\"\");\n }", "public Boolean getShowHBar() { return _showHBar; }", "private BrowserToolbar() {\n\t\tinitComponents();\n\t}", "public void createStatusBar(JPanel bar) {\n bar.setPreferredSize(new Dimension(getWidth(), 25));\n bar.setBackground(Color.LIGHT_GRAY);\n\n // add into container\n bar.add(paintModule.sizeLabel);\n bar.add(paintModule.coordinate);\n\n }", "private static void createAndShowGUI() {\n if (!SystemTray.isSupported()) {\r\n return;\r\n }\r\n final PopupMenu popup = new PopupMenu();\r\n final TrayIcon trayIcon =\r\n new TrayIcon(createImage(\"/config/mut3.png\", \"JFileImporter\"));\r\n final SystemTray tray = SystemTray.getSystemTray();\r\n Font itemFont = new Font(\"Ariel\",Font.BOLD,12);\r\n // Create a popup menu components\r\n MenuItem aboutItem = new MenuItem(\"About\");\r\n MenuItem maxItem = new MenuItem(\"Maximize\");\r\n MenuItem minItem = new MenuItem(\"Minimize\");\r\n MenuItem showSchedulerItem = new MenuItem(\"Show Scheduler\");\r\n MenuItem showImporterItem = new MenuItem(\"Show Importer\");\r\n MenuItem exitItem = new MenuItem(\"Exit\");\r\n\r\n aboutItem.setFont(itemFont);\r\n maxItem.setFont(itemFont);\r\n minItem.setFont(itemFont);\r\n showSchedulerItem.setFont(itemFont);\r\n showImporterItem.setFont(itemFont);\r\n exitItem.setFont(itemFont);\r\n //Add components to popup menu\r\n popup.add(aboutItem);\r\n popup.addSeparator();\r\n popup.add(maxItem);\r\n popup.add(minItem);\r\n popup.addSeparator();\r\n popup.add(showSchedulerItem);\r\n popup.add(showImporterItem); \r\n popup.addSeparator();\r\n popup.add(exitItem);\r\n \r\n trayIcon.setPopupMenu(popup);\r\n \r\n try {\r\n tray.add(trayIcon);\r\n } catch (AWTException e) {\r\n \tJOptionPane.showMessageDialog(null, \"Tray Icon could not be added \"+e, \"Error creating Tray Icon\", JOptionPane.ERROR_MESSAGE);\r\n return;\r\n }\r\n trayIcon.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \tJImporterMain.maximize();\r\n }\r\n });\r\n \r\n maxItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \tJImporterMain.maximize();\r\n }\r\n });\r\n minItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \ttrayIcon.displayMessage(\"JFileImporter\", \"Importer Still Running! Right Click for more options\", TrayIcon.MessageType.INFO);\r\n \tJImporterMain.minimize();\r\n \t\r\n }\r\n });\r\n \r\n aboutItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \ttrayIcon.displayMessage(\"About\", \"JFileImporter\\nVersion\\t1.00\\nDeveloped By:\\tAnil Sehgal\", TrayIcon.MessageType.INFO);\r\n }\r\n });\r\n \r\n showImporterItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \tJImporterMain.showImporter();\r\n }\r\n });\r\n showSchedulerItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \tString schedulerShown = LoadProfileUI.showScheduler();\r\n \tif(schedulerShown.equals(\"npe\")){\r\n \t\ttrayIcon.displayMessage(\"Scheduler\", \"Please initialize the Scheduler from Menu\", TrayIcon.MessageType.WARNING);\r\n \t}else if(schedulerShown.equals(\"ge\")){\r\n \t\ttrayIcon.displayMessage(\"Scheduler\", \"Error Launching Scheduler, Please contact technical support\", TrayIcon.MessageType.ERROR);\r\n \t}\r\n }\r\n });\r\n trayIcon.setImageAutoSize(true);\r\n trayIcon.setToolTip(\"JFileImporter\"); \r\n exitItem.addActionListener(new ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n \tint option = JOptionPane.showConfirmDialog(null, \"If You Quit the Application, the scheduled job will terminate!\", \"Exit Confirmation\", JOptionPane.OK_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE);\r\n \tif(option == JOptionPane.OK_OPTION){\r\n\t tray.remove(trayIcon);\r\n\t System.exit(0);\r\n \t}\r\n }\r\n });\r\n }" ]
[ "0.74906224", "0.74906224", "0.74906224", "0.7391044", "0.7357647", "0.7254911", "0.7037097", "0.7036765", "0.69323057", "0.68598646", "0.68598646", "0.68598646", "0.68598646", "0.68598646", "0.68598646", "0.6850693", "0.684366", "0.68308485", "0.6825867", "0.6821222", "0.668988", "0.66511405", "0.6548902", "0.6466421", "0.63903207", "0.6387317", "0.63870233", "0.6366197", "0.636548", "0.63500637", "0.63173324", "0.6312969", "0.625545", "0.6229355", "0.618512", "0.6183886", "0.6168789", "0.61656106", "0.61255413", "0.6121389", "0.61200655", "0.61071414", "0.6090206", "0.6086153", "0.6063237", "0.59982705", "0.5996745", "0.5983521", "0.5982289", "0.5975637", "0.597533", "0.5952293", "0.59405464", "0.59401053", "0.59365356", "0.59255785", "0.59168303", "0.5905901", "0.5902088", "0.5901687", "0.58900505", "0.587311", "0.58669233", "0.58161557", "0.579975", "0.5795549", "0.5787545", "0.5766585", "0.5751678", "0.57468545", "0.57373565", "0.5735328", "0.5732227", "0.5731214", "0.5726133", "0.57230556", "0.57149047", "0.57146674", "0.5709959", "0.57089365", "0.5705795", "0.5692123", "0.56740457", "0.56738544", "0.56712323", "0.5670257", "0.5659116", "0.56590706", "0.56547207", "0.5648388", "0.56482196", "0.5645166", "0.5644378", "0.5636619", "0.5636415", "0.56300145", "0.56148136", "0.56144077", "0.56136465", "0.56118476", "0.5601864" ]
0.0
-1
Schedules a call to hide() in delay milliseconds, canceling any previously scheduled calls.
private void delayedHide(int delayMillis) { mHideHandler.removeCallbacks(mHideRunnable); mHideHandler.postDelayed(mHideRunnable, delayMillis); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void delayedHide(int delayMillis) {\n\n }", "private void delayedHide(int delayMillis) {\n\t\tmHideHandler.removeCallbacks(mHideRunnable);\n\t\tmHideHandler.postDelayed(mHideRunnable, delayMillis);\n\t}", "private void delayedHide(int delayMillis) {\n\t\tmHideHandler.removeCallbacks(mHideRunnable);\n\t\tmHideHandler.postDelayed(mHideRunnable, delayMillis);\n\t}", "public void hideIn1() {\r\n\t\thideTimer.schedule(500);\r\n\t}", "@Override\n\tpublic void hide() {\n\t\tmDismissed = true;\n\t\tremoveShowCallback();\n\t\tlong diff = System.currentTimeMillis() - mStartTime;\n\t\tif (diff >= mShowTime || mStartTime == -1) {\n\t\t\t// The progress spinner has been shown long enough\n\t\t\t// OR was not shown yet. If it wasn't shown yet,\n\t\t\t// it will just never be shown.\n\t\t\tsuper.hide();\n\t\t} else {\n\t\t\t// The progress spinner is shown, but not long enough,\n\t\t\t// so put a delayed message in to hide it when its been\n\t\t\t// shown long enough.\n\t\t\tif (!mPostedHide) {\n\t\t\t\tpostDelayed(mDelayedHide, mShowTime - diff);\n\t\t\t\tmPostedHide = true;\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void hide() {\n mHandler.post(mHide);\n }", "private void hide() {\n\t}", "public void hide() {\n }", "void hideTask ()\n\t{\n\t}", "void hide();", "public void hideMessageDelay() {\n if(System.currentTimeMillis() - lastChanceToKick > 1000) {\n Log.d(\"Time\", \"\" + (System.currentTimeMillis() - lastChanceToKick));\n displayed_message = \"\";\n }\n }", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "@Override\n\tpublic void hide() {\n\t\t\n\t}", "protected void hideNotify() {\n try {\n myJump.systemPauseThreads();\n } catch (Exception oe) {\n myJump.errorMsg(oe);\n }\n }", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide() {\n\t}", "@Override\n\tpublic void hide()\n\t{\n\n\t}", "@Override\n\tpublic void hide()\n\t{\n\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\t\r\n\t}", "public void hide() {\n hidden = true;\n }", "@Override\r\n public void hide() {\n }", "public void hideUnpauseButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.HIDE_UNPAUSE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\n\t}", "@Override\n\tpublic void hide() {\n\t\tdispose();\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\r\n\t}", "@Override\r\n\tpublic void hide() {\n\t\tthis.dispose();\r\n\t\t\r\n\t}", "@Override\r\n public void hide() {\r\n\r\n }", "public void hide() throws DeviceException;", "public void hide() {\n\t\thidden = true;\n\t}", "@Override\n\tpublic void hide() {\n\t\tdispose();\n\n\t}", "public void hide() {\n visible=false;\n }", "default void hide() { }", "private void anullerAction()\r\n\t{\r\n\t\tthis.hide();\r\n\t}", "@Override\n public void hide() {\n\n }", "@Override\n public void hide() {\n\n }", "@Override\n public void hide() {\n\n }", "@SuppressLint(\"InlinedApi\")\n private void show() {\n mVisible = true;\n\n // Schedule a runnable to display UI elements after a delay\n mHideHandler.removeCallbacks(mHidePart2Runnable);\n mHideHandler.postDelayed(mShowPart2Runnable, UI_ANIMATION_DELAY);\n }", "protected void hideNotify () {\n if (timer != null) {\n timer.cancel ();\n timer = null;\n }\n\n cityMap.removeMapListener (this);\n }", "public void hideIt(){\n this.setVisible(false);\n }", "public void destroy(float delay){\n\t\tdestroyTime = Math.min(destroyTime, Main.time + delay);\n\t}", "@Override\n\tpublic void hide() {\n\t\thits.remove();\n\t\ttimeLeft.remove();\n\t\tdarken.remove();\n\t\tcontainer.remove();\n\t\ttimer = null;\n\t\ttrainingBag = null;\n\t}", "@Override\r\n public void hide() {\r\n dispose();\r\n }", "public void hide() {\n\t\t// Useless if called in outside animation loop\n\t\tactive = false;\n\t}", "public void hide() {\r\n\t\tif (item != null) { \r\n\t ShowCaseStandalone.slog(Level.FINEST, \"Hiding showcase: \" + getSHA1());\r\n\t item.remove();\r\n\t \r\n\t int\t\tx\t= getSpawnLocation().getBlockX();\r\n\t int \ty \t= 0;\r\n\t int \tz\t= getSpawnLocation().getBlockZ();\r\n\t World\tw\t= getSpawnLocation().getWorld();\r\n\t \r\n\t item.teleport(new Location(w, x, y, z));\r\n\t\t\titem \t= null;\r\n\t\t}\r\n\t\tisVisible\t= false;\r\n\t}", "@Override\n public void hide() {\n \n }", "public void setDelay(int delay) {\n\t\t if (delay != this.delay) logger.info(\"New delay is: \"+getElapsedTimeHoursMinutesSecondsString(delay)); \n\t\t if (delay < this.delay) {\n\t\t\t scheduledFuture.cancel(true);\n\t\t\t reset(delay); \n\t\t }\n\t\t this.delay = delay;\n\t }", "public void setClickHideDelay ( Integer clickHideDelay ) {\r\n\t\tgetStateHelper().put(PropertyKeys.clickHideDelay, clickHideDelay);\r\n\t\thandleAttribute(\"clickHideDelay\", clickHideDelay);\r\n\t}", "public void setDelayedTimeout(int seconds);", "@Override\n\tpublic void onHide() {\n\n\t}" ]
[ "0.8275258", "0.768496", "0.768496", "0.748471", "0.6545245", "0.6433806", "0.6335333", "0.631813", "0.6296235", "0.6294597", "0.6078069", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.60214007", "0.5993936", "0.59786785", "0.59786785", "0.59786785", "0.59786785", "0.59690976", "0.59690976", "0.5961317", "0.5961317", "0.5961317", "0.5961317", "0.5961317", "0.5961317", "0.5961317", "0.5961317", "0.5954226", "0.5944259", "0.58930933", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5892179", "0.5880489", "0.5872997", "0.5872997", "0.5872997", "0.5872997", "0.58640903", "0.58507204", "0.5835184", "0.5834547", "0.5823486", "0.58007604", "0.576205", "0.57386696", "0.571379", "0.571379", "0.571379", "0.5699999", "0.5674759", "0.5664734", "0.56597126", "0.5617469", "0.5613158", "0.5590668", "0.55838126", "0.55832136", "0.55436945", "0.5536957", "0.55292153", "0.5485645" ]
0.7677579
12
Integer pageSize = aStatic.getPageSize();
@Override public PageInfo<VehicleProduct> findByPage(BaseQuery data) { Integer pageSize = 5; Integer pageNum=1; if (data.getPageNum()!=null) { pageNum=data.getPageNum(); } PageHelper.startPage(pageNum, pageSize); List<VehicleProduct> vehicleList = vehicleProductMapper.findByQuery(data); PageInfo<VehicleProduct> pageInfo = new PageInfo(vehicleList); return pageInfo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "long getPageSize();", "long getPageSize();", "long getPageSize();", "int getPageSize();", "int getPageSize();", "int getPageSize();", "int getPageSize();", "int getPagesize();", "default Integer getPageSize() {\n return 10;\n }", "public Integer getCurrentPageSize();", "public int getPageCount() { return _pages.size(); }", "int getPagesAmount();", "public static int getPageSize() {\n\t\treturn Unsafe.get().pageSize();\n\t}", "public Integer getPageCount();", "public int getRowsPerPage();", "public Integer getPerPage();", "public int getPagesize() {\n return pagesize_;\n }", "Integer getPage();", "int getNumPages();", "public int getPageSize() {\n return pageSize;\n }", "public int getPageSize() {\n return pageSize;\n }", "public int getPageSize() {\n return pageSize;\n }", "public int getPagesize() {\n return pagesize_;\n }", "boolean hasPagesize();", "long getAmountPage();", "public Dimension getPageSize()\n {\n return pageSize;\n }", "public int getPageSize()\n {\n return bouquet.getSheaf().getPageSize();\n }", "@java.lang.Override\n public long getPageSize() {\n return pageSize_;\n }", "@java.lang.Override\n public long getPageSize() {\n return pageSize_;\n }", "@java.lang.Override\n public long getPageSize() {\n return pageSize_;\n }", "int getPage();", "public int numPages() {\n // some code goes here\n return (int)Math.ceil(f.length()/BufferPool.PAGE_SIZE);\n \n }", "Integer getMaxPageResults();", "int getPageNumber();", "public int getPages(){\n return pages;\n }", "@Override\r\n\tpublic int getPaging() {\n\t\treturn 0;\r\n\t}", "public static int getPageSize() {\n\t\treturn PageSize;\n\t}", "@Override\n public int getNumOfPageRows() {\n return 10;\n }", "@Override\n public int numberOfPages() {\n // TODO Auto-generated method stub\n throw new UnsupportedOperationException(\"Unsupported operation\");\n }", "@java.lang.Override\n public long getPageSize() {\n return pageSize_;\n }", "@java.lang.Override\n public long getPageSize() {\n return pageSize_;\n }", "@java.lang.Override\n public long getPageSize() {\n return pageSize_;\n }", "public int getPages()\n {\n return pages;\n }", "public int getPages() {\n return pages;\n }", "@Override\n\t\tpublic int getPageSize() {\n\t\t\treturn 0;\n\t\t}", "public Integer getPageSize(WebElement eventListTable);", "public Iterator<Integer> getPageCountIterator();", "@Test\n public void pageSizeTest() {\n // TODO: test pageSize\n }", "public String getPageSize() {\r\n return pageSize;\r\n }", "public int getPageSize() {\n\t\treturn pageSize;\n\t}", "public int getPageSize() {\n\t\treturn pageSize;\n\t}", "public int getPageCount()\n {\n return _pages.size();\n }", "public int numPages() {\n // some code goes here\n return (int) Math.ceil(m_f.length() / BufferPool.PAGE_SIZE);\n }", "Optional<Integer> getPageCount();", "Long pageCount(Long pageSize, Long...params);", "public int getpageCount(int pageSize) {\n\t\treturn 0;\n\t}", "public int getPages() {\n return pages;\n }", "public int getPages() {\n return pages;\n }", "public int getTotalPages()\r\n {\r\n return pageNames.size()-1;\r\n }", "public java.lang.Integer getPageSize() {\n return pageSize;\n }", "public int getNumPages()\n {\n return numPages;\n }", "public int getTotalPages(int pagesize) {\n\t\tint totalpages = 0;\r\n\t\tSqlSession session = MybatisSqlSessionFactory.getSqlSession();\r\n\t\tInteger totalrecords = session.selectOne(\"rgettotalrecords\");\r\n\t\ttotalpages = (totalrecords%pagesize==0?0:1)+totalrecords/pagesize;\r\n\t\tMybatisSqlSessionFactory.closeSqlSession();\r\n\t\treturn totalpages;\r\n\t}", "public int numPages() {\n // some code goes here\n //System.out.println(\"File length :\" + f.length());\n\n return (int) Math.ceil(f.length() * 1.0 / BufferPool.PAGE_SIZE * 1.0);\n }", "io.dstore.values.IntegerValue getPageNo();", "io.dstore.values.IntegerValue getPageNo();", "public Vector<WbRecord> getAllPages() {\n\t\tVector<WbRecord> content = getNPages(130000000);\n\t\tSystem.out.println(\"Number of pages expected:\t\" + this.numPagesRequested);\n\t\tSystem.out.println(\"Actual number of pages wbRecordReader crawl:\t\" + this.totalNumPagesRetrieved);\n\t\treturn content;\n\t}", "public int getNumberOfPages(HttpServletRequest request,\n SubmissionInfo subInfo) throws ServletException\n {\n // always just one page of initial questions\n return 1;\n }", "public int numPages() {\n \t//numOfPages = (int)(this.fileName.length()/BufferPool.PAGE_SIZE);\n return numOfPages;\n }", "public int getTotalPages() {\r\n return totalPages;\r\n }", "public Integer getIncompletePageSize() {\n return incompletePageSize;\n }", "public abstract int getPageFreeSpace(int bucket);", "private int getFastForwardPages() {\r\n\t\tint pageSize = getPageSize();\r\n\t\treturn pageSize > 0 ? fastForwardRows / pageSize : 0;\r\n\t}", "Pages getPages();", "public boolean hasPagesize() {\n return ((bitField0_ & 0x00000400) == 0x00000400);\n }", "@Override\n public int getCount() {\n int TOTAL_PAGES = totalPages;\n return TOTAL_PAGES;\n }", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "boolean hasPagination();", "public int getPagesPerBatch()\n {\n return m_pagesPerBatch;\n }", "public Integer getPageItemCount() {\n return pageItemCount;\n }", "public int get_size();", "public int get_size();", "@ZAttr(id=597)\n public int getGalSyncLdapPageSize() {\n return getIntAttr(Provisioning.A_zimbraGalSyncLdapPageSize, 1000);\n }", "public int getDefaultPageSize()\n\t{\n\t\treturn defaultPageSize;\n\t}", "public PageList<Hoppy> getPageList(Hoppy hoppy, int pageSize, int pageNum) throws DataAccessException;", "@ApiModelProperty(value = \"Size of the found page\")\n public Integer getPageSize() {\n return pageSize;\n }", "public int pageCount()\n {\n return (int)Math.ceil((double)getTaskVector().size() /\n (double)getRecordsPerPage());\n }", "public int getPageEnd() {\n int val = (_pageIndex + 1) * _pageSize;\n return (val > _totalRecords) ? _totalRecords : val;\n }", "public int getPageStart() {\n return _totalRecords == 0 ? 0 : ((_pageIndex) * _pageSize) + 1;\n }", "public int numPages() {\n return numPages;\n }", "public int getGatheredPages() {\r\n return gatheredPages;\r\n }", "List<T> findPage(int pageNumber);", "public int getTotalPage() {\n return getSize() == 0 ? 1 : (int) Math.ceil((double) total / (double) getSize());\n }", "@ZAttr(id=583)\n public int getGalLdapPageSize() {\n return getIntAttr(Provisioning.A_zimbraGalLdapPageSize, 1000);\n }", "@Override\n public int getCount() {\n return PAGE_COUNT;\n }", "short getPageStart();", "public int getPageEntityIndex() {\n return this.pagenum * this.pagesize;\n }", "public interface PageContext<E> {\n public static final int DEFAULT_PAGE_SIZE = 20;\n\n public long getPageCount();\n\n public Page<E> getPage(int index);\n\n public int getPageSize();\n\n public long getTotal();\n}" ]
[ "0.8328864", "0.8328864", "0.8328864", "0.8269167", "0.8269167", "0.8269167", "0.8269167", "0.7988132", "0.7752553", "0.7710519", "0.7438293", "0.7345521", "0.7212982", "0.7200666", "0.7109418", "0.7104432", "0.7094103", "0.70296645", "0.70191693", "0.69975245", "0.69975245", "0.69975245", "0.6965429", "0.69582283", "0.69460773", "0.6885859", "0.68486696", "0.6750294", "0.6750294", "0.6750294", "0.674094", "0.6739281", "0.6724766", "0.6701413", "0.667396", "0.66669756", "0.6655623", "0.6629517", "0.65941983", "0.6594098", "0.6594098", "0.6594098", "0.65861803", "0.65378827", "0.6533696", "0.6532398", "0.6501795", "0.65009934", "0.64656645", "0.64484614", "0.64484614", "0.64299685", "0.64195216", "0.63724416", "0.63629985", "0.6337967", "0.6337683", "0.6337683", "0.63155913", "0.6300186", "0.6299213", "0.6258518", "0.62346417", "0.62221485", "0.62221485", "0.6208262", "0.61909235", "0.6164681", "0.613842", "0.61337775", "0.6125607", "0.60953873", "0.60481393", "0.603462", "0.60308427", "0.6018075", "0.6018075", "0.6018075", "0.6018075", "0.6018075", "0.6018075", "0.60098356", "0.5981427", "0.59789133", "0.59789133", "0.5954896", "0.5952683", "0.5947725", "0.5947358", "0.5942414", "0.5934489", "0.5927521", "0.59251803", "0.5921938", "0.59162396", "0.5911532", "0.5909954", "0.58954567", "0.58931404", "0.58905745", "0.5890454" ]
0.0
-1
/ Precedence of logical operators ! is evaluated first && is evaluated second || is valuated third int value1 = 10; int value2 = 20; int value3= 30; // True// True // retured value is True boolean result1 = value2>value1 && value2value1 && value2value1 && value2>value3; System. out .println( "value2>value1 && value2>value3 result3 is " +result3); // False// False// False boolean result4 = value2value3; System. out .println( "value2value3 result4 is " +result4); //2. Logical OR operator System. out .println( "Logical OR Operator Examples" ); // True// True// Retured value is True result1 = value2>value1 || value2value1 || value2value1 || value2>value3; System. out .println( "value2>value1 || value2>value3 result3 is " +result3); //False// False// Retured value is False result4 = value2value3; System. out .println( "value2value3 result4 is " +result4);
public static void main(String[] args) { int day = 2; String dayType; String dayString; switch (day) { case 1: dayString = "Monday"; break; case 2: dayString = "Tuesday"; break; case 3: dayString = "Wednesday"; break; case 4: dayString = "Thursday"; break; case 5: dayString = "Friday"; break; case 6: dayString = "Saturday"; break; case 7: dayString = "Sunday"; break; default: dayString = "Invalid day"; } switch (day) { //multiple cases without break statements case 1: case 2: case 3: case 4: case 5: dayType = "Weekday"; break; case 6: case 7: dayType = "Weekend"; break; default: dayType= "Invalid daytype"; } System.out.println(dayString+" is a "+ dayType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tint num = 20;\n\t\t\n\t\tnum = 25; \n\t\t\n\t\t//\" == \" sign or comparison boolean kullanilir \n\t\t\n\t\tboolean isTrue = 5 + 2 == 7;\n\t\t\n\t\tboolean isFalse = 5 + 2 == 8;\n\t\t\n\t\tSystem.out.println(isTrue == isFalse); // this says True equals False. it doesnt so it gives False result \n\t\t\n\n\t\t\n\t\t//!= Not Equal Sing\n\t\t\n\t\t\n\t\tboolean isTrue1 = 5+2 != 8;\n\t\t\n\t\tboolean noteq = 5+2 != 23;\n\t\t\n\t\tSystem.out.println(isTrue1);\n\t\tSystem.out.println(noteq);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// \">\" , \">=\" , \"<\" , \"<=\" ==> All returns boolean\n\t\t\n\t\t// && and operator .... If you have at least one false result \n\t\t// || Or operation ... If you have just one true the result will be true \n\t\t\n\t\tSystem.out.println(5>8); //False\n\t\t\n\t\tSystem.out.println(8>11-5); // True \n\t\t\n\t\t\n\t\tboolean b1 = 5>2;\t // true \n\t\tboolean b2 = 5==2+3;\t// true \n\t\tboolean b3 = 5==2;\t // false\n\t\tboolean b4 = 5<2; \t\t//false\n\t\t\n\t\t\n\t\t\n\t\t// to get true && all variables must ben true \n\t\t\n\t\tSystem.out.println(b1 && b2); // both true so result rue \n\t\t\n\t\tSystem.out.println(b1 && b3); //false \n\t\t\n\t\tSystem.out.println(b3 && b4); // false \n\t\t\n\t\t\n\t\t// || Or \n\t\tSystem.out.println(b2 || b1); // true bec at least one of the variables is true \n\t\t\n\t\tSystem.out.println(b3 || b4); // false bec all everything is false \n\t\t\n\t\tSystem.out.println(b1 || b2 || b3 || b4); // True bec at least one variable is true \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\nboolean a, b, c;\na =true;\nb = false;\nc =a && b;\n\nSystem.out.println(\"c = a&&B:\" + c);\nc = a||b;\nSystem.out.println(\"c = a||b:\" + c);\nc = a==b;\nSystem.out.println(\"c = a==b:\" + c);\nc = a!=b;\nSystem.out.println(\"c = a!=b:\" + c);\n\n\n\n\t}", "public static void main(String[] args) { , or , not\n // truth table -> t=1 f=0\n // a =t b= f c = a and b => a.b =0=>f\n\n // except 0 every no. is treated as true\n // int a=1 int b=2 a and b => a.b\n // and -> a=1 , b=2, a and b => a.b\n\n\n // and\n boolean a= false;\n boolean b= false;\n\n boolean c= a && b; // a.b\n System.out.println(c);\n\n //or\n boolean f= true;\n boolean d= true;\n\n boolean e= f || d; // a+b\n System.out.println(e);\n\n // not\n boolean g =true;\n boolean h= !g;\n System.out.println(h);\n\n }", "public static void main(String ... aa)\n {\n \n boolean a1 = 3 == 4; // false ;because 3 is different than 4\n boolean a2 = 4 != 5 ; // true ; because 4 is different than 5\n boolean a3 = 4 < 3.2 ; // false ;because 4 is greater than 3.2\n \n\n /* Logical operators have as results boolean values , however the operands\n are boolean values as well */\n \n boolean a4 = !(4<3.2); // true ; (4<3.2) is false and !false is true\n boolean a5 = true & (3==4); // false; (3==4) is false and true & false is false\n boolean a6 = false | true ; // true \n boolean a7 = false ^ false ; // false\n \n /**************EXTRA CONCEPTS************/\n \n /* & is the and operator , | is the or operator , ^ is the xor operator\n ! is the negation operator , so these operators fulfill the rules of\n logic */\n \n /* Short-circuit logical operators are || and && , they act as the normal\n | and & ,however , if the first operand is enough to know the final result,\n the second operand will not be evaluated */\n \n boolean a8 = false && (3<4); // this is false , however (3<4) was not evaluated\n \n /* a compile error will appar if we try to use relational and logical operators with\n different types of operators */\n \n // boolean a9 = 3 < true; this will not compile \n \n }", "public static void main(String[] args) {\n\t\t\n\t\tint x=300;\n\t\tint y=500;\n\t\tint z=500;\n\t\t\n\t\t//((x<y) && (x<z)) // logical expression in Java\n\t\t\n\t\t// (true && true) // the output is going to be true\n\t\t\n\t\t//((x==y) && (x>z))\n\t\t \n\t\t//( false && False) // the final output is going to be False\n\t\t//((x>y) && (x<z))\n\t\t \n\t\t//( false && true) // the final output is going to be False\t \n\t\t\n\t\t\n\t\tif((x==y)&&(x>z)) // compound condition\n{\n\tSystem.out.println(\"execute the block of code\");\n}\n\t\t\n\t\t\n\t\t\n\t\tboolean results= ((x<y)&&(x<z)); // true\n\t\tSystem.out.println(results);\n\t\t\n\t\t\n\t\t//OR operator ||\n\t\t\n\t\t// In case of OR operator, \n\t\t//if anyone of the relational expression is true, the final output is going to be true\n\t\t\n\t\t\n\t\t// x=400;\n\t\t// y=500;\n\t\t// z=400;\n\t\t \n\t\t\t//((x<y) || (x==z))\n\t\t\n\t\t// ( true || true) ----> true\n\t\t\n\t\t// false || true ----> TRUE\n\t\t\n\t\t// false || false----> false\n\t\t\n\t\t// True || False --->true\n\t\t\n\t\tint age= 30;\n\t\t\n\t\t if((age==30)||(age>18))\n\t\t {\n\t\t\t System.out.println(\"give the licence to customer\");\n\t\t }\n\t\t\n\t\t\n\t\t \n\t\t \n\t\t\n\t\t// Not operator ! - if the original value of the expression is true, and if we use ! operator on it, \n\t\t//the output will be changed to False\n\t\t\n\tint x1=100;\n\tint y1=50;\n\t\n\tif(!(x1==y1)) // x1 not equal to y1 ---true\n\t\t\n\t\t\n\t\t// !(x==y)\n\t\t\n\t{\n\t\tSystem.out.println(\"the output is true\");\n\t}\n\t\t// x>y --> 100>50 --->true\n\t\t \n\t\t//!(x>y) ---!(100>50) ---> False\n\t\t// 100 is not greater than 50 ---> false\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String[] args) {\n\n int x =55; //fales || false || true --->>true\n System.out.println( x==50 || x==51 || x==55 );\n\n //check\n //x is more than 50 and\n // x is not 52 or\n // x equal to 57\n // == is checking for equality != is checking for inequality\n //true && true\n // true || false ---->>>>true\n System.out.println( x > 50 && x != 52 || x==57);\n\n System.out.println(false || true && false);\n\n\n\n\n\n\n }", "private Expr or() { // This uses the same recursive matching structure as other binary operators.\n Expr expr = and(); // OR takes precedence over AND.\n while(match(OR)) {\n Token operator = previous();\n Expr right = and();\n expr = new Expr.Logical(expr, operator, right);\n }\n return expr;\n }", "public static void main(String[] args) {\n\t\n\tSystem.out.println(10>9);\n\tboolean resultA = 10> 9; \n\t\n\tSystem.out.println(resultA);\n\tSystem.out.println(10>=9); // greater or equal\n\t\n\tboolean resultB= 10>=9; \n\tSystem.out.println(resultB);\n\t\n\tboolean resultC = 10<=9; \n\tSystem.out.println(resultC);\n\t\n\tboolean resultD= 1100 <1200;\n\tSystem.out.println(resultD);\n\t\n\tboolean resultE = 1000 < 1000; \n\tSystem.out.println(resultE);\n\t\t\t\n\tboolean resultF = 1000 <= 1000; \n\tSystem.out.println(resultF);\n\t\n\t\n\t\n\t\n\tboolean A = ! false ; \n\tSystem.out.println(A);\n\t\n\tboolean B = ! true; \n\tSystem.out.println(B);\n\t\n\tboolean C = ! false !=false; \n\tSystem.out.println(C);\n\t\n\t\n\t\n\t// practice ! (not) : \n\t\n\tboolean g = false; \n\tSystem.out.println(g);\n\t\n\tSystem.out.println(! g);\n\t\n\tSystem.out.println(!true == false);\n\t\n\t\n\t\n\tboolean h = \"Batch 12\" == \"Batch13\"; \n\tSystem.out.println(h);\n\n\tSystem.out.println( \" batch12\" != \"Batch12\");\n\tSystem.out.println(\"Kuzzat\" == \"bad guy\");\n\t\n\t\n\tint Num = 198; \n\tSystem.out.println(Num %= 2);\n\t\n\tbyte byteNum = 30; \n\t// int INum = INum + byteNum ; // we must give value to local variables . \n\t\n\t\n\tString str; \n\t// System.out.println(str);\n\t\n\t\n\t\n}", "public void testX1andX2orNotX1() {\n \tCircuit circuit = new Circuit();\n \t\n \tBoolean b1 = Boolean.TRUE;\n \tBoolean b2 = Boolean.FALSE;\n \tAnd and = (And) circuit.getFactory().getGate(Gate.AND);\n\t\tNot not = (Not) circuit.getFactory().getGate(Gate.NOT);\n\t\tOr or = (Or) circuit.getFactory().getGate(Gate.OR);\n\t\tand.setLeftInput(b1);\n\t\tand.setRightInput(b2);\n\t\tand.eval();\n\t\tnot.setInput(b1);\n\t\tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n\t\tassertEquals(Boolean.FALSE, or.eval());\n\t\tassertEquals(Boolean.FALSE, circuit.eval());\n//\t\t==========================================\n\t\tb1 = Boolean.FALSE;\n \tb2 = Boolean.TRUE;\n// \tand.eval();\n// \tnot.eval();\n \tassertEquals(Boolean.FALSE, circuit.eval());\n// \t============================================\n \tDouble d1 = 0.0;\n \tDouble d2 = 1.0;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n\t\tnot.setInput(d1);\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(1.0), or.eval());\n// \t============================================\n \td1 = 0.5;\n \td2 = 0.5;\n \tand.setLeftInput(d1);\n\t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n\t\tor.setLeftInput(and.getOutput());\n\t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n// \t============================================\n \ttry {\n \td1 = 0.5;\n \td2 = 2.0;\n \tand.setLeftInput(d1);\n \t\tand.setRightInput(d2);\n \tand.eval();\n \tnot.setInput(d1);\n \tnot.eval();\n \t\tor.setLeftInput(and.getOutput());\n \t\tor.setRightInput(not.getOutput());\n \tassertEquals( new Double(0.625), or.eval());\n \t} catch (IllegalArgumentException e) {\n \t\tSystem.err.println(\"IllegalArgumentException: \" + e.getMessage());\n \t}\n\n }", "private Object eval(OrExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = false;\n for (AndExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result || (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (result) {\n return true;\n }\n }\n return false;\n }", "public static void main(String [] args){\n double a= 5+(4*5)/5;\n double b= (6*4%2)+15;\n System.out.println(\"a = \"+a);\n System.out.println(\"b = \"+b); \n \n //Ejemplo de operadores relacionales.\n boolean resultado1= a > b;\n boolean resultado2= a !=b; \n System.out.println(\"R1= \"+resultado1);\n System.out.println(\"R2= \"+resultado2); \n }", "public static void main(String[] args)\n {\n int i = 1 + 1;\n \n //Concat String\n String s = \"My\" + \" \" + \"String\";\n \n int r = 4;\n int ff = 4;\n System.out.println(\"String\" + r + ff);\n System.out.println(\"String\" + ( r + ff ));\n //If the left or the rigth operator is a String, + will be a String concatenation\n //If both operands are numeric, + will be an addition operator\n \n /*************************************/\n /** Operator = */\n /*************************************/\n //Assign a primitive value to a variable\n int ii = 4;\n \n //Assign a value to an object reference variable\n Object o = new Object();\n \n /*************************************/\n /** Compound assignment operators */\n /*************************************/\n //+=,-=,*=,/=\n// int x *= 2+5;//forbidden, compound assignment operators\n int x = 1;\n \n x *= 2+5;\n //equals to\n x = x * (2+5);\n\n /*************************************/\n /** Relational operators */\n /*************************************/\n //>,>=,<,<=,==,!=\n boolean b = false;\n if(b = false){System.out.println(\"false\");}\n //The result of any assignment is the value of the variable after assignment !\n \n /** == with enum values **/\n //It's the same than equals()\n \n /*************************************/\n /** Arithmetic operators */\n /*************************************/ \n //+,-,/,*,%\n \n /*************************************/\n /** Inc and Decrement operators */\n /*************************************/\n int azerty = 4;\n //pre incr and decrementation\n System.out.println(++azerty);//incr first, print after\n System.out.println(--azerty);//desc first, print after\n \n //post incr and decrementation\n azerty = 4;\n System.out.println(azerty++);//print first, inc after\n System.out.println(azerty--);//print first, desc after\n \n /*************************************/\n /** Logical operator */\n /*************************************/\n //|| OR\n if(theTruth() || theTruth()){\n //Do something\n }\n //if the first operator is true, the second will not be evaluated\n \n //| OR\n if(theTruth() | theTruth()){\n //Do something\n }\n //The two operators are evalued\n \n //XOR ^\n System.out.println(true ^ true);//false\n System.out.println(true ^ false);//true\n System.out.println(false ^ true);//true\n System.out.println(false ^ false);//false\n //The two operators are evalued\n \n //logical operator !\n if(false && false || true){\n System.out.println(\"?\");\n }\n if( (false && false) || true){\n System.out.println(\"??\");\n }\n if(false && false | true){\n System.out.println(\"???\");\n }\n if( (false && false) | true){\n System.out.println(\"????\");\n }\n //| operator is evaluated first!!!\n }", "public static void main(String[] args) {\n\r\n int i = +10;\r\n int i2 = -10;\r\n int i3 = ++i;\r\n int i4 = i++;\r\n int i5 = --i;\r\n int i6 = i--;\r\n\r\n // *** Binary Arithmetic Operators\r\n\r\n//\t\t+\r\n//\t\t-\r\n//\t\t/\r\n//\t\t%\r\n//\t\t*\r\n\r\n int i7 = 10 + 1;\r\n int i8 = i7 - 1;\r\n int i9 = i8 / 2;\r\n int i10 = i9 % 2;\r\n int i11 = 5 % 10;\r\n int i12 = i10 * 3;\r\n\r\n System.out.println(i7);\r\n System.out.println(i8);\r\n System.out.println(i9);\r\n System.out.println(\"Hello \" + \"World\" + \"!\"); // used for concatination\r\n\r\n // ============ Assignment Operators\r\n\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\r\n int i13 = 10;\r\n i13 += 2;\r\n System.out.println(i13);\r\n\r\n // ============ Relational Operators\r\n\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\r\n System.out.println(\"===== Relational Operators =====\");\r\n\r\n int y = 10;\r\n int j = 20;\r\n\r\n System.out.println(y == j);\r\n System.out.println(y != j);\r\n System.out.println(y > j);\r\n System.out.println(y < j);\r\n System.out.println(y >= j);\r\n System.out.println(y <= j);\r\n\r\n // ============ Logical Operators\r\n\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\r\n System.out.println(false && (5 / 5 == 0) );\r\n System.out.println(true || (5 / 7 == 0) );\r\n System.out.println(\"!true = \" + !true);\r\n System.out.println(true ^ false);\r\n\r\n\r\n // ============ Bitwise Operators\r\n\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\r\n System.out.println(\"4 & 5 = \" + (4 & 5)); // 4\r\n /*\r\n * \t\t\t\t1 0 0\r\n * \t\t\t\t& & &\r\n * \t\t\t\t1 0 1\r\n * \t\t\t\t-----\r\n * \t\t\t\t1 0 0 = 4\r\n */\r\n\r\n System.out.println(\"4 | 5 = \" + (4 | 5)); // 5\r\n /*\r\n * \t\t\t\t1 0 0\r\n * \t\t\t\t| | |\r\n * \t\t\t\t1 0 1\r\n * \t\t\t\t-----\r\n * \t\t\t\t1 0 1 = 5\r\n */\r\n\r\n System.out.println(\"4 ^ 5 = \" + (4 ^ 5)); // 1\r\n /*\r\n * \t\t\t\t1 0 0\r\n * \t\t\t\t^ ^ ^\r\n * \t\t\t\t1 0 1\r\n * \t\t\t\t-----\r\n * \t\t\t\t0 0 1 = 1\r\n */\r\n\r\n // ============ Ternary Operator\r\n\r\n//\t\t(condition) ? true expression : false expression\r\n\r\n System.out.println(5 > 1 ? \"2 is greater than one\" : \"2 is not less than one\");\r\n System.out.println(2 < 1 ? \"2 is greater than one\" : \"2 is not less than one\");\r\n\r\n // ============ Operator Precedence\r\n//\r\n//\t\tPrecedence highest to lowest among brackets.\r\n//\t\t()\r\n//\t\t[]\r\n//\t\t·\r\n//\r\n// Precedence highest to lowest among postfix and prefix.\r\n//\t\t++\r\n//\t\t--\r\n//\r\n// Precedence highest to lowest among urinary operators.\r\n//\t\t+\r\n//\t\t—\r\n//\t\t!\r\n//\t\t~\r\n//\t\t( type )\r\n//\r\n// Precedence highest to lowest among binary operators.\r\n//\t\t*\r\n//\t\t/\r\n//\t\t%\r\n//\t\t+\r\n//\t\t–\r\n//\r\n// Precedence highest to lowest among shift operator.\r\n//\t\t<<\r\n//\t\t>>\r\n//\t\t>>>\r\n//\r\n// Precedence highest to lowest among rational operators.\r\n//\t\t<\r\n//\t\t<=\r\n//\t\t>\r\n//\t\t>=\r\n//\t\tinstanceof\r\n//\r\n// Precedence highest to lowest among equality operator.\r\n//\t\t==\r\n//\t\t!=\r\n//\r\n// Precedence highest to lowest among bitwise operator.\r\n//\r\n//\t\t&\r\n//\r\n//\r\n//\t\t^\r\n//\r\n//\r\n//\t\t|\r\n//\r\n//\r\n//\t\t&&\r\n//\r\n//\r\n//\t\t||\r\n//\r\n//\r\n//\t\t? :\r\n//\r\n// Precedence highest to low among Assignment operators\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\r\n // Using Parantheses\r\n\r\n /*\r\n Parentheses raise the precedence of the operations that are inside them. This is\r\n often necessary to obtain the result you desire. For example, consider the\r\n following expression:\r\n\r\n a >> b + 3\r\n\r\n This expression first adds 3 to b and then shifts a right by that result. That is,\r\n this expression can be rewritten using redundant parentheses like this:\r\n a >> (b + 3)\r\n\r\n However, if you want to first shift a right by b positions and then add 3 to that result,\r\n you will need to parenthesize the expression like this:\r\n\r\n (a >> b) + 3\r\n */\r\n\r\n int a = 5;\r\n int b = 5;\r\n System.out.println(\"------------------------------\");\r\n System.out.println(a >> (b + 3)); // 0\r\n\r\n // After altering parantheses\r\n\r\n System.out.println((a >> b) + 3); //3\r\n\r\n\r\n // Test equality btw String and other objects using == and equals()\r\n\r\n String s = new String(\"hello\");\r\n String h = \"hello\";\r\n System.out.println(\"*******************\");\r\n\r\n System.out.println(s==h); //false\r\n System.out.println(s.equals(h)); //true\r\n\r\n int n = 78;\r\n int v = 79;\r\n\r\n System.out.println(n==v); //false\r\n\r\n int[] ar = {1,2,3};\r\n int[] yu = {1,2,3};\r\n\r\n System.out.println(Arrays.equals(ar, yu)); //true\r\n System.out.println(ar == yu); //false\r\n\r\n }", "private Term parseLogicalOr(final boolean required) throws ParseException {\n Term t1 = parseLogicalAnd(required);\n while (t1 != null) {\n /*int tt =*/ _tokenizer.next();\n if (isSpecial(\"||\") || isKeyword(\"or\")) {\n Term t2 = parseLogicalAnd(true);\n if ((t1.isB() && t2.isB()) || !isTypeChecking()) {\n t1 = new Term.OrB(t1, t2);\n } else {\n reportTypeErrorB2(\"'||' or 'or'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public Object visitLogicalOrExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n Object b = dispatch(n.getGeneric(1));\n \n if (a instanceof Long && b instanceof Long) {\n return (Long) a | (Long) b;\n }\n else {\n return parens(a) + \" || \" + parens(b);\n }\n }\n else {\n BDD a, b, bdd;\n \n a = ensureBDD(dispatch(n.getGeneric(0)));\n b = ensureBDD(dispatch(n.getGeneric(1)));\n \n bdd = a.orWith(b);\n \n return bdd;\n }\n }", "public static void main(String[] args) {\n System.out.println(\"Assignment operator example:\");\n\n\n int result = 1;\n result = 2 + result;\n System.out.println(\"New result = \" + result);\n System.out.println(\"-----------------------\\n\");\n //============================================\n\n /*Reminder operator or Modulo operator\n * displays the reminder*/\n System.out.println(\"Assignment Reminder operator or Modulo operator example:\");\n int someNumber = 10;\n int remainderResult;\n remainderResult = someNumber % 4;\n System.out.println(\"Remainder is: \" + remainderResult);\n System.out.println(\"-----------------------\\n\");\n //============================================\n\n /*Shortcut to add 1 or subtract 1\n * very useful in loops\n * We can use ++ and --*/\n //use of ++, see exmaple below; we are adding 1 using ++\n System.out.println(\"++ operator example:\");\n\n int someNumber1 = 5;\n System.out.println(\"Adding 1 to \" + someNumber1);\n someNumber1++;\n System.out.println(\"New value is \" + someNumber1);\n System.out.println(\"-----------------------\\n\");\n //============================================\n\n // use of --, see exmaple below; we are subtracting 1 using --\n System.out.println(\"-- operator example:\");\n\n int someNumber2 = 5;\n System.out.println(\"Subtracting 1 from \" + someNumber2);\n someNumber2--;\n System.out.println(\"New value is \" + someNumber2);\n System.out.println(\"-----------------------\\n\");\n //============================================\n\n // use of conditional operator, see exmaple below\n // we are using a == comparision operator to compare the logic in if-else statement\n // note: == is for comparision; = is for assignment\n System.out.println(\"Logical operator example (== is comparision operator)\");\n Boolean isTrue = true;\n if(isTrue == true){\n System.out.println(\"True\");\n }\n System.out.println(\"-----------------------\\n\");\n //============================================\n\n // we are using a && comparision operator to compare the logic in if-else statement\n // note:\n System.out.println(\"Logical operator example (&& operator)\");\n int someNumber3 = 5;\n if((someNumber3 < 6) && (someNumber3 > 4)){\n System.out.println(\"Comparision works!\");\n }\n System.out.println(\"-----------------------\\n\");\n //============================================\n\n // we are using a || OR operator to compare the logic in if-else statement\n // note:\n System.out.println(\"Logical operator example (||operator)\");\n int someNumber4 = 5;\n if((someNumber4< 6)|| (someNumber4 > 10)){\n System.out.println(\"Comparision works!\");\n }\n System.out.println(\"-----------------------\\n\");\n //============================================\n }", "public static Object logicOr(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) || ((Boolean) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in logicOr\");\n\t}", "public static void main(String[] args) {\nint a=10;\nint b=13; // For right shift of b:b >> 1\n//int c = a | b; //For OR gate\n//int c= a & b;// For AND gate\nint c=b<<1;//For left shift of b is multiply of b\na >>= 2; //Assignment Operator\nSystem.out.println(c);\nSystem.out.println(a);\nSystem.out.println(a>b);//comparision operator\n\n\t}", "protected boolean checkOperators()\n {\n Object loLeft ;\n Object loRight ;\n Object loOperator ;\n Object loConditionType ;\n boolean lboolOK = true ;\n\n for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ )\n {\n loLeft = getData( \"AND_COND_LHS_\" + liCtr ).getObject() ;\n loConditionType = getData( \"AND_COND_TYP_\" + liCtr ).getObject() ;\n loOperator = getData( \"AND_COND_OPR_\" + liCtr ).getObject() ;\n loRight = getData( \"AND_COND_RHS_\" + liCtr ).getObject() ;\n if ( ( loLeft != null ) && ( loOperator == null ) )\n {\n lboolOK = false ;\n raiseException( \"An operator is required for Condition \" + liCtr ) ;\n } /* end if ( ( loLeft != null ) && ( loOperator == null ) ) */\n\n if (loConditionType == null)\n {\n if(loLeft != null)\n {\n lboolOK = false ;\n raiseException( \"%c:Q0150,v: Condition Type for Condition \" +\n liCtr + \",v: Left Hand Side is %\" ) ;\n }\n if(loRight != null)\n {\n lboolOK = false ;\n raiseException( \"%c:Q0150,v: Condition Type for Condition \" +\n liCtr + \",v: Right Hand Side is %\" ) ;\n }\n } /* end if (loConditionType == null) */\n } /* end for ( int liCtr = 1 ; liCtr <= 5 ; liCtr++ ) */\n return lboolOK ;\n }", "@Test\n public void testPredicateOr() {\n Predicate<Integer> isEven = (x) -> (x % 2) == 0;\n Predicate<Integer> isDivSeven = (x) -> (x % 7) == 0;\n\n Predicate<Integer> evenOrDivSeven = isEven.or(isDivSeven);\n\n assertTrue(evenOrDivSeven.apply(14));\n assertTrue(evenOrDivSeven.apply(21));\n assertTrue(evenOrDivSeven.apply(8));\n assertFalse(evenOrDivSeven.apply(5));\n }", "@Test\n public void trueAndFalseCombined() {\n assertFalse(getPredicateInstance(false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(false, null, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n assertFalse(getPredicateInstance(true, true, false, null).evaluate(getTestValue()),\n \"false predicate evaluated to true\");\n }", "public final EObject ruleLogicalOrExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_LogicalAndExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2579:28: ( (this_LogicalAndExpression_0= ruleLogicalAndExpression ( () otherlv_2= '||' ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2580:1: (this_LogicalAndExpression_0= ruleLogicalAndExpression ( () otherlv_2= '||' ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2580:1: (this_LogicalAndExpression_0= ruleLogicalAndExpression ( () otherlv_2= '||' ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2581:5: this_LogicalAndExpression_0= ruleLogicalAndExpression ( () otherlv_2= '||' ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getLogicalOrExpressionAccess().getLogicalAndExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleLogicalAndExpression_in_ruleLogicalOrExpression5902);\r\n this_LogicalAndExpression_0=ruleLogicalAndExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_LogicalAndExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2589:1: ( () otherlv_2= '||' ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) ) )*\r\n loop41:\r\n do {\r\n int alt41=2;\r\n int LA41_0 = input.LA(1);\r\n\r\n if ( (LA41_0==47) ) {\r\n alt41=1;\r\n }\r\n\r\n\r\n switch (alt41) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2589:2: () otherlv_2= '||' ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2589:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2590:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getLogicalOrExpressionAccess().getLogicalOrExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,47,FOLLOW_47_in_ruleLogicalOrExpression5923); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getLogicalOrExpressionAccess().getVerticalLineVerticalLineKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2599:1: ( (lv_rightOperand_3_0= ruleLogicalAndExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2600:1: (lv_rightOperand_3_0= ruleLogicalAndExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2600:1: (lv_rightOperand_3_0= ruleLogicalAndExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2601:3: lv_rightOperand_3_0= ruleLogicalAndExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getLogicalOrExpressionAccess().getRightOperandLogicalAndExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleLogicalAndExpression_in_ruleLogicalOrExpression5944);\r\n \t lv_rightOperand_3_0=ruleLogicalAndExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getLogicalOrExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"LogicalAndExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop41;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public Object visitLogicalAndExpression(GNode n) {\n if (dostring) {\n Object a = dispatch(n.getGeneric(0));\n Object b = dispatch(n.getGeneric(1));\n \n if (a instanceof Long && b instanceof Long) {\n return (Long) a & (Long) b;\n }\n else {\n return parens(a) + \" && \" + parens(b);\n }\n }\n else {\n BDD a, b, bdd;\n \n a = ensureBDD(dispatch(n.getGeneric(0)));\n b = ensureBDD(dispatch(n.getGeneric(1)));\n \n bdd = a.andWith(b);\n \n return bdd;\n }\n }", "public Object visitBitwiseOrExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a | (Long) b;\n }\n else {\n result = parens(a) + \" | \" + parens(b);\n }\n \n return result;\n }", "public static void main(String[] args) {\n\t\tint num1;\r\n\t\tint num2;\r\n\t\tint num3;\r\n\t\tScanner s= new Scanner (System.in);\r\n\r\n\t\tSystem.out.println(\"enter 1st num: \");\r\n\t\tnum1 = s.nextInt();\r\n\t\tSystem.out.println(\"enter 2nd num: \");\r\n\t\tnum2 = s.nextInt();\r\n\t\tSystem.out.println(\"enter 3rd num: \");\r\n\t\tnum3 = s.nextInt();\r\n\t\ts.close();\r\n\t\t\r\n\t\tSystem.out.println(\"&& comparison =\" +((num1>num2)&&(num1<num2)&&(num2<num3)));\r\n\t\tSystem.out.println(\"|| comparison =\" +((num1>num2)||(num1<num2)||(num2<num3)));\r\n\t\tSystem.out.println(\"! comparison =\" + !(num1>num2));\r\n\t}", "public final EObject ruleConditionalOrExpression() throws RecognitionException {\n EObject current = null;\n\n Token lv_op_2_0=null;\n EObject this_ConditionalAndExpression_0 = null;\n\n EObject lv_right_3_0 = null;\n\n\n enterRule(); \n \n try {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:230:28: ( (this_ConditionalAndExpression_0= ruleConditionalAndExpression ( ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) ) ( (lv_right_3_0= ruleConditionalAndExpression ) ) )* ) )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:231:1: (this_ConditionalAndExpression_0= ruleConditionalAndExpression ( ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) ) ( (lv_right_3_0= ruleConditionalAndExpression ) ) )* )\n {\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:231:1: (this_ConditionalAndExpression_0= ruleConditionalAndExpression ( ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) ) ( (lv_right_3_0= ruleConditionalAndExpression ) ) )* )\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:232:5: this_ConditionalAndExpression_0= ruleConditionalAndExpression ( ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) ) ( (lv_right_3_0= ruleConditionalAndExpression ) ) )*\n {\n if ( state.backtracking==0 ) {\n \n newCompositeNode(grammarAccess.getConditionalOrExpressionAccess().getConditionalAndExpressionParserRuleCall_0()); \n \n }\n pushFollow(FOLLOW_ruleConditionalAndExpression_in_ruleConditionalOrExpression499);\n this_ConditionalAndExpression_0=ruleConditionalAndExpression();\n\n state._fsp--;\n if (state.failed) return current;\n if ( state.backtracking==0 ) {\n \n current = this_ConditionalAndExpression_0; \n afterParserOrEnumRuleCall();\n \n }\n // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:240:1: ( ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) ) ( (lv_right_3_0= ruleConditionalAndExpression ) ) )*\n loop3:\n do {\n int alt3=2;\n int LA3_0 = input.LA(1);\n\n if ( (LA3_0==28) ) {\n int LA3_2 = input.LA(2);\n\n if ( (synpred2_InternalJavaJRExpression()) ) {\n alt3=1;\n }\n\n\n }\n\n\n switch (alt3) {\n \tcase 1 :\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:240:2: ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) ) ( (lv_right_3_0= ruleConditionalAndExpression ) )\n \t {\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:240:2: ( ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) ) )\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:240:3: ( ( () ( ( '||' ) ) ) )=> ( () ( (lv_op_2_0= '||' ) ) )\n \t {\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:247:6: ( () ( (lv_op_2_0= '||' ) ) )\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:247:7: () ( (lv_op_2_0= '||' ) )\n \t {\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:247:7: ()\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:248:5: \n \t {\n \t if ( state.backtracking==0 ) {\n\n \t current = forceCreateModelElementAndSet(\n \t grammarAccess.getConditionalOrExpressionAccess().getBinaryExpressionLeftAction_1_0_0_0(),\n \t current);\n \t \n \t }\n\n \t }\n\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:253:2: ( (lv_op_2_0= '||' ) )\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:254:1: (lv_op_2_0= '||' )\n \t {\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:254:1: (lv_op_2_0= '||' )\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:255:3: lv_op_2_0= '||'\n \t {\n \t lv_op_2_0=(Token)match(input,28,FOLLOW_28_in_ruleConditionalOrExpression550); if (state.failed) return current;\n \t if ( state.backtracking==0 ) {\n\n \t newLeafNode(lv_op_2_0, grammarAccess.getConditionalOrExpressionAccess().getOpVerticalLineVerticalLineKeyword_1_0_0_1_0());\n \t \n \t }\n \t if ( state.backtracking==0 ) {\n\n \t \t if (current==null) {\n \t \t current = createModelElement(grammarAccess.getConditionalOrExpressionRule());\n \t \t }\n \t \t\tsetWithLastConsumed(current, \"op\", lv_op_2_0, \"||\");\n \t \t \n \t }\n\n \t }\n\n\n \t }\n\n\n \t }\n\n\n \t }\n\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:268:4: ( (lv_right_3_0= ruleConditionalAndExpression ) )\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:269:1: (lv_right_3_0= ruleConditionalAndExpression )\n \t {\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:269:1: (lv_right_3_0= ruleConditionalAndExpression )\n \t // ../com.jaspersoft.studio.editor.jrexpressions/src-gen/com/jaspersoft/studio/editor/jrexpressions/parser/antlr/internal/InternalJavaJRExpression.g:270:3: lv_right_3_0= ruleConditionalAndExpression\n \t {\n \t if ( state.backtracking==0 ) {\n \t \n \t \t newCompositeNode(grammarAccess.getConditionalOrExpressionAccess().getRightConditionalAndExpressionParserRuleCall_1_1_0()); \n \t \t \n \t }\n \t pushFollow(FOLLOW_ruleConditionalAndExpression_in_ruleConditionalOrExpression586);\n \t lv_right_3_0=ruleConditionalAndExpression();\n\n \t state._fsp--;\n \t if (state.failed) return current;\n \t if ( state.backtracking==0 ) {\n\n \t \t if (current==null) {\n \t \t current = createModelElementForParent(grammarAccess.getConditionalOrExpressionRule());\n \t \t }\n \t \t\tset(\n \t \t\t\tcurrent, \n \t \t\t\t\"right\",\n \t \t\tlv_right_3_0, \n \t \t\t\"ConditionalAndExpression\");\n \t \t afterParserOrEnumRuleCall();\n \t \t \n \t }\n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop3;\n }\n } while (true);\n\n\n }\n\n\n }\n\n if ( state.backtracking==0 ) {\n leaveRule(); \n }\n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public String getAndOr();", "public final CQLParser.logicalExpression_return logicalExpression() throws RecognitionException {\n CQLParser.logicalExpression_return retval = new CQLParser.logicalExpression_return();\n retval.start = input.LT(1);\n\n Object root_0 = null;\n\n CQLParser.orExpression_return orExpression83 = null;\n\n\n\n try {\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:359:2: ( orExpression )\n // /home/chinaski/programming/agile_workspace/ExplorerCat/src/main/antlr3/net/explorercat/cql/parser/CQL.g:359:4: orExpression\n {\n root_0 = (Object)adaptor.nil();\n\n pushFollow(FOLLOW_orExpression_in_logicalExpression1664);\n orExpression83=orExpression();\n\n state._fsp--;\n\n adaptor.addChild(root_0, orExpression83.getTree());\n\n }\n\n retval.stop = input.LT(-1);\n\n retval.tree = (Object)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n\n }\n \t\n \tcatch(RecognitionException re)\n \t{\t\n \t\treportError(re);\n \t\tthrow re;\n \t}\n finally {\n }\n return retval;\n }", "public final EObject ruleLogicalOrExpression() throws RecognitionException {\n EObject current = null;\n\n EObject this_LogicalAndExpression_0 = null;\n\n EObject lv_operands_3_0 = null;\n\n\n EObject temp=null; setCurrentLookahead(); resetLookahead(); \n \n try {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3300:6: ( (this_LogicalAndExpression_0= ruleLogicalAndExpression ( () ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+ )? ) )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3301:1: (this_LogicalAndExpression_0= ruleLogicalAndExpression ( () ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+ )? )\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3301:1: (this_LogicalAndExpression_0= ruleLogicalAndExpression ( () ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+ )? )\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3302:5: this_LogicalAndExpression_0= ruleLogicalAndExpression ( () ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+ )?\n {\n \n currentNode=createCompositeNode(grammarAccess.getLogicalOrExpressionAccess().getLogicalAndExpressionParserRuleCall_0(), currentNode); \n \n pushFollow(FOLLOW_ruleLogicalAndExpression_in_ruleLogicalOrExpression5694);\n this_LogicalAndExpression_0=ruleLogicalAndExpression();\n _fsp--;\n\n \n current = this_LogicalAndExpression_0; \n currentNode = currentNode.getParent();\n \n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3310:1: ( () ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+ )?\n int alt50=2;\n int LA50_0 = input.LA(1);\n\n if ( (LA50_0==49) ) {\n alt50=1;\n }\n switch (alt50) {\n case 1 :\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3310:2: () ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+\n {\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3310:2: ()\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3311:5: \n {\n \n temp=factory.create(grammarAccess.getLogicalOrExpressionAccess().getLogicalOrExpressionOperandsAction_1_0().getType().getClassifier());\n try {\n \tfactory.add(temp, \"operands\", current, null /*ParserRule*/, currentNode);\n } catch(ValueConverterException vce) {\n \thandleValueConverterException(vce);\n }\n current = temp; \n temp = null;\n CompositeNode newNode = createCompositeNode(grammarAccess.getLogicalOrExpressionAccess().getLogicalOrExpressionOperandsAction_1_0(), currentNode.getParent());\n newNode.getChildren().add(currentNode);\n moveLookaheadInfo(currentNode, newNode);\n currentNode = newNode; \n associateNodeWithAstElement(currentNode, current); \n \n\n }\n\n // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3326:2: ( '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) ) )+\n int cnt49=0;\n loop49:\n do {\n int alt49=2;\n int LA49_0 = input.LA(1);\n\n if ( (LA49_0==49) ) {\n alt49=1;\n }\n\n\n switch (alt49) {\n \tcase 1 :\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3326:4: '||' ( (lv_operands_3_0= ruleLogicalAndExpression ) )\n \t {\n \t match(input,49,FOLLOW_49_in_ruleLogicalOrExpression5714); \n\n \t createLeafNode(grammarAccess.getLogicalOrExpressionAccess().getVerticalLineVerticalLineKeyword_1_1_0(), null); \n \t \n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3330:1: ( (lv_operands_3_0= ruleLogicalAndExpression ) )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3331:1: (lv_operands_3_0= ruleLogicalAndExpression )\n \t {\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3331:1: (lv_operands_3_0= ruleLogicalAndExpression )\n \t // ../org.eclipselabs.mscript.language/src-gen/org/eclipselabs/mscript/language/parser/antlr/internal/InternalMscript.g:3332:3: lv_operands_3_0= ruleLogicalAndExpression\n \t {\n \t \n \t \t currentNode=createCompositeNode(grammarAccess.getLogicalOrExpressionAccess().getOperandsLogicalAndExpressionParserRuleCall_1_1_1_0(), currentNode); \n \t \t \n \t pushFollow(FOLLOW_ruleLogicalAndExpression_in_ruleLogicalOrExpression5735);\n \t lv_operands_3_0=ruleLogicalAndExpression();\n \t _fsp--;\n\n\n \t \t if (current==null) {\n \t \t current = factory.create(grammarAccess.getLogicalOrExpressionRule().getType().getClassifier());\n \t \t associateNodeWithAstElement(currentNode.getParent(), current);\n \t \t }\n \t \t try {\n \t \t \t\tadd(\n \t \t \t\t\tcurrent, \n \t \t \t\t\t\"operands\",\n \t \t \t\tlv_operands_3_0, \n \t \t \t\t\"LogicalAndExpression\", \n \t \t \t\tcurrentNode);\n \t \t } catch (ValueConverterException vce) {\n \t \t\t\t\thandleValueConverterException(vce);\n \t \t }\n \t \t currentNode = currentNode.getParent();\n \t \t \n\n \t }\n\n\n \t }\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt49 >= 1 ) break loop49;\n EarlyExitException eee =\n new EarlyExitException(49, input);\n throw eee;\n }\n cnt49++;\n } while (true);\n\n\n }\n break;\n\n }\n\n\n }\n\n\n }\n\n resetLookahead(); \n \tlastConsumedNode = currentNode;\n \n }\n \n catch (RecognitionException re) { \n recover(input,re); \n appendSkippedTokens();\n } \n finally {\n }\n return current;\n }", "public FluentExp<Boolean> or (SQLExpression<Boolean> expr)\n {\n return Ops.or(this, expr);\n }", "@Test\n public void testOr() {\n if (true || addValue()) {\n assertThat(flag, equalTo(0));\n }\n\n // first not satisfied, invoke second\n if (false || addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public static void main(String args[]) {\n boolean hasSATscore = true;\n boolean hasHighSchoolTranscript = true;\n boolean isInternational=false;\n boolean hasTOFELscore=false;\n\n /*\n * logical_step2: Check if the applicant is eligible to apply to the university\n * logical_step_details: the applicant must have a SAT score, a high school transcript and must have TOEFL score\n * if is an international student.\n * question_1: What does the following block of code do?\n * answer 1: Check if the applicant is eligible to apply to the university\n * question_2: What is the data type of the variable isElig?\n * answer 2: isElig is a Boolean data type\n * question_3: What is the value of: !isInternational. (value assigned above)\n * answer_3: the value of !isInternational is true\n * question_4: What is the output the following block of code?\n * answer_4: the code displays the following statement \"You eligibility requirement has been evaluated to :true\"\n */\n\n /*\n * stm_comment: isElig contains result of logical operation between the variables. logical and (&&), logical or(||) and not operator is used \n * question_1: Please explain how the value of isElig evaluated.\n * answer_1: isElig contains result of logical operation between the variables\n * question_2: Please state the operators used in the code block below.\n * answer_2: logical and (&&), logical or(||) and not operator is used .\n *\n */\n\n boolean isElig = hasSATscore && hasHighSchoolTranscript && (!isInternational || (isInternational && hasTOFELscore));\n System.out.println(\" Your eligibility requirement has been evaluated to :\" +isElig );\n\n\n }", "@RepeatedTest(20)\n void logicalOperatorsTest() {\n assertEquals(bi.or(bot), new Binary(\"1\"));\n assertEquals(bi.or(bof), bi);\n assertEquals(bi.and(bot), bi);\n assertEquals(bi.and(bof), new Binary(\"0\"));\n assertEquals(bot.or(bi), new Binary(\"1\"));\n assertEquals(bof.or(bi), bi);\n assertEquals(bot.and(bi), bi);\n assertEquals(bof.and(bi), new Binary(\"0\"));\n assertEquals(bot.and(bot), bot);\n assertEquals(bot.and(bof),bof);\n assertEquals(bof.and(bot),bof);\n assertEquals(bof.and(bof),bof);\n assertEquals(bot.or(bot), bot);\n assertEquals(bot.or(bof),bot);\n assertEquals(bof.or(bot),bot);\n assertEquals(bof.or(bof),bof);\n Binary b1 = new Binary(\"10001\");\n Binary b2 = new Binary(\"1001011\");\n assertEquals(b1.or(b2), new Binary(\"1111011\"));\n assertEquals(b1.and(b2), new Binary(\"1000001\"));\n assertEquals(b1.or(b2), b2.or(b1));\n assertEquals(b1.and(b2),b2.and(b1));\n assertEquals(bi.or(bi), bi);\n assertEquals(bi.and(bi),bi);\n Binary notbi = bi.neg();\n assertEquals(bi.or(notbi), new Binary(\"1\"));\n assertEquals(bi.and(notbi), new Binary(\"0\"));\n\n //nulls\n //Bool or ITypes \\ {Logicals}\n assertEquals(bot.or(st),Null);\n assertEquals(bof.or(st),Null);\n assertEquals(bot.or(f), Null);\n assertEquals(bof.or(i), Null);\n //Float or ITypes\n assertEquals(f.or(st), Null);\n assertEquals(f.or(bot), Null);\n assertEquals(f.or(bof), Null);\n assertEquals(f.or(i), Null);\n assertEquals(f.or(g), Null);\n assertEquals(f.or(bi), Null);\n //Int or ITypes\n assertEquals(i.or(st), Null);\n assertEquals(i.or(bot),Null);\n assertEquals(i.or(bof), Null);\n assertEquals(i.or(j), Null);\n assertEquals(i.or(f), Null);\n assertEquals(i.or(bi), Null);\n //Binary or ITypes \\ {Logicals}\n assertEquals(bi.or(st), Null);\n assertEquals(bi.or(f), Null);\n assertEquals(bi.or(i), Null);\n //NullType or ITypes\n assertEquals(Null.or(st), Null);\n assertEquals(Null.or(bof), Null);\n assertEquals(Null.or(f), Null);\n assertEquals(Null.or(i), Null);\n assertEquals(Null.or(bi), Null);\n assertEquals(Null.or(Null), Null);\n assertEquals(st.or(Null), Null);\n assertEquals(bot.or(Null), Null);\n assertEquals(f.or(Null), Null);\n assertEquals(i.or(Null), Null);\n assertEquals(bi.or(Null), Null);\n\n //Bool and ITypes \\ {Logicals}\n assertEquals(bot.and(st),Null);\n assertEquals(bof.and(st),Null);\n assertEquals(bot.and(f), Null);\n assertEquals(bof.and(i), Null);\n //Float and ITypes\n assertEquals(f.and(st), Null);\n assertEquals(f.and(bot), Null);\n assertEquals(f.and(bof), Null);\n assertEquals(f.and(i), Null);\n assertEquals(f.and(g), Null);\n assertEquals(f.and(bi), Null);\n //Int and ITypes\n assertEquals(i.and(st), Null);\n assertEquals(i.and(bot),Null);\n assertEquals(i.and(bof), Null);\n assertEquals(i.and(j), Null);\n assertEquals(i.and(f), Null);\n assertEquals(i.and(bi), Null);\n //Binary and ITypes \\ {Logicals}\n assertEquals(bi.and(st), Null);\n assertEquals(bi.and(f), Null);\n assertEquals(bi.and(i), Null);\n //NullType and ITypes\n assertEquals(Null.and(st), Null);\n assertEquals(Null.and(bof), Null);\n assertEquals(Null.and(f), Null);\n assertEquals(Null.and(i), Null);\n assertEquals(Null.and(bi), Null);\n assertEquals(Null.and(Null), Null);\n assertEquals(st.and(Null), Null);\n assertEquals(bot.and(Null), Null);\n assertEquals(f.and(Null), Null);\n assertEquals(i.and(Null), Null);\n assertEquals(bi.and(Null), Null);\n\n }", "public boolean containsOrOperator() {\r\n\t\tfor (int n = 0; n < elements.size(); ++n) {\r\n\t\t\tObject ob = elements.get(n);\r\n\t\t\tif (ob instanceof Operator.OrOperator) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "private static boolean checkOrOperations(String expression, Lexemes lexemes, SymbolTable table) {\n\t\tif (expression.contains(\"or\")) {\n\t\t\tString[] arr = expression.split(\"or\");\n\t\t\tint finalIndex = arr.length - 1;\n\n\t\t\tfor (int i = 0; i <= finalIndex; i++) {\n\t\t\t\tString s = arr[i];\n\t\t\t\tif (table.contains(s)) {\n\t\t\t\t\tint id = table.getIdOfVariable(s);\n\t\t\t\t\tlexemes.insertLexeme(\"ID\", ((Integer) id).toString());\n\t\t\t\t} else {\n\n\t\t\t\t\tif (s.equals(\"true\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_BOOL\", \"true\");\n\t\t\t\t\t} else if (s.equals(\"false\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(\"CONST_BOOL\", \"false\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!checkEqualsToOperations(s.trim(), lexemes, table)) return false;\n\t\t\t\t\t}\n\n\t\t\t\t\t// check if the current word is a variable\n\t\t\t\t\tif (i < finalIndex) {\n\t\t\t\t\t\tlexemes.insertLexeme(\"LOGOP\", \"or\");\n\t\t\t\t\t} else if (expression.endsWith(\"or\")) {\n\t\t\t\t\t\tlexemes.insertLexeme(\"LOGOP\", \"or\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (!checkEqualsToOperations(expression.trim(), lexemes, table)) return false;\n\t\t}\n\n\t\treturn true;\n\t}", "public LogicalOperator() {\n this.logical = Logical.And;\n }", "private Term parseLogicalAnd(final boolean required) throws ParseException {\n Term t1 = parseComparison(required);\n while (t1 != null) {\n /*int tt =*/ _tokenizer.next();\n if (isSpecial(\"&&\") || isKeyword(\"and\")) {\n Term t2 = parseComparison(true);\n if ((t1.isB() && t2.isB()) || !isTypeChecking()) {\n t1 = new Term.AndB(t1, t2);\n } else {\n reportTypeErrorB2(\"'&&' or 'and'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public static Object logicAnd(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) && ((Boolean) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in logicAnd\");\n\t}", "String getOr_op();", "Boolean conditionResult();", "private static boolean checkPrecedence(String operator1, String operator2){\n\n\t\tif((operator1.equals(\"*\") || operator1.equals(\"/\")) && (operator2.equals(\"*\") || operator2.equals(\"/\"))){\n\t\t\treturn true;\n\t\t}\n\t\telse if((operator1.equals(\"*\") || operator1.equals(\"/\")) && (operator2.equals(\"+\") || operator2.equals(\"-\"))){\n\t\t\treturn true;\n\t\t}\n\t\telse if((operator1.equals(\"+\") || operator1.equals(\"-\")) && (operator2.equals(\"+\") || operator2.equals(\"-\"))){\n\t\t\treturn true;\n\t\t}\n\t\telse if((operator1.equals(\"+\") || operator1.equals(\"-\")) && (operator2.equals(\"*\") || operator2.equals(\"/\"))){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "Expression orExpression() throws SyntaxException {\r\n\t\tToken first = t;\r\n\t\tExpression e0 = andExpression();\r\n\t\twhile(isKind(OP_OR)) {\r\n\t\t\tToken op = consume();\r\n\t\t\tExpression e1 = andExpression();\r\n\t\t\te0 = new ExpressionBinary(first, e0, op, e1);\r\n\t\t}\r\n\t\treturn e0;\r\n\t}", "@Override\n public Node typeCheck() {\n if (!(FOOLlib.isSubtype(left.typeCheck(), new BoolTypeNode()) &&\n FOOLlib.isSubtype(right.typeCheck(), new BoolTypeNode()))) {\n if(operator.equals(\"and\") || operator.equals(\"&&\")) {\n System.out.println(\"Non boolean in AND\");\n }\n else {\n System.out.println(\"Non boolean in OR\");\n }\n System.exit(0);\n }\n //se i tipi sono corretti restituisco bool\n return new BoolTypeNode();\n }", "public static BinaryExpression exclusiveOr(Expression expression0, Expression expression1) { throw Extensions.todo(); }", "Expr bool() throws IOException {\n\t\tExpr e = join();\n\t\twhile (look.tag == Tag.OR) {\n\t\t\tToken tok = look;\n\t\t\tmove();\n\t\t\te = new Or(tok, e,join());\n\t\t}\n\t\treturn e;\n\t}", "public final EObject ruleLogicalAndExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_LogicalNotExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2637:28: ( (this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2638:1: (this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2638:1: (this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2639:5: this_LogicalNotExpression_0= ruleLogicalNotExpression ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getLogicalAndExpressionAccess().getLogicalNotExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleLogicalNotExpression_in_ruleLogicalAndExpression6039);\r\n this_LogicalNotExpression_0=ruleLogicalNotExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_LogicalNotExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2647:1: ( () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) ) )*\r\n loop42:\r\n do {\r\n int alt42=2;\r\n int LA42_0 = input.LA(1);\r\n\r\n if ( (LA42_0==48) ) {\r\n alt42=1;\r\n }\r\n\r\n\r\n switch (alt42) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2647:2: () otherlv_2= '&&' ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2647:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2648:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getLogicalAndExpressionAccess().getLogicalAndExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,48,FOLLOW_48_in_ruleLogicalAndExpression6060); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getLogicalAndExpressionAccess().getAmpersandAmpersandKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2657:1: ( (lv_rightOperand_3_0= ruleLogicalNotExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2658:1: (lv_rightOperand_3_0= ruleLogicalNotExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2658:1: (lv_rightOperand_3_0= ruleLogicalNotExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2659:3: lv_rightOperand_3_0= ruleLogicalNotExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getLogicalAndExpressionAccess().getRightOperandLogicalNotExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleLogicalNotExpression_in_ruleLogicalAndExpression6081);\r\n \t lv_rightOperand_3_0=ruleLogicalNotExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getLogicalAndExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"LogicalNotExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop42;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public static void main(String[] args) {\n\t\tint x =5;\n\t\tint y =7;\n\t\tif(x==5 | ++y ==8){\n\t\t\tSystem.out.println(\"inside the if block and executed the logical &\");\n\t\t\tSystem.out.println(y);\n\t\t}\n\t\t\n\t\tif(x==5 || y ==8){\n\t\t\tSystem.out.println(\"inside the if block\");\n\t\t\tSystem.out.println(y);\n\t\t\tSystem.out.println(x);\n\t\t}\n\t\t\n\t\t\n\t}", "boolean hasOperator();", "public static void main(String[] args) {\n\t\t\n\t\tboolean directTrue = true;\n\t\tboolean directFalse = false;\n\n\t\t\n\t\tSystem.out.println(\"true = \"+directTrue+\" false = \"+directFalse);\n\t\t\n\t\t\n\t\t// Values changed dynamically\n\t\t// As per condition\n\t\t\n\t\tboolean dynamicallyTrue = ( 2 < 5);\n\t\tboolean dynamicallyFalse = ( 2 > 5);\n\n\t\tSystem.out.println(\"( 2 < 5 ) = \"+dynamicallyTrue+\" ( 2 > 5 ) = \"+dynamicallyFalse);\n\t\t\n\t}", "public final void conditionalOrExpression() throws RecognitionException {\n int conditionalOrExpression_StartIndex = input.index();\n try { dbg.enterRule(getGrammarFileName(), \"conditionalOrExpression\");\n if ( getRuleLevel()==0 ) {dbg.commence();}\n incRuleLevel();\n dbg.location(745, 1);\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 108) ) { return ; }\n // Java.g:746:5: ( conditionalAndExpression ( '||' conditionalAndExpression )* )\n dbg.enterAlt(1);\n\n // Java.g:746:9: conditionalAndExpression ( '||' conditionalAndExpression )*\n {\n dbg.location(746,9);\n pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression4364);\n conditionalAndExpression();\n\n state._fsp--;\n if (state.failed) return ;\n dbg.location(746,34);\n // Java.g:746:34: ( '||' conditionalAndExpression )*\n try { dbg.enterSubRule(129);\n\n loop129:\n do {\n int alt129=2;\n try { dbg.enterDecision(129);\n\n int LA129_0 = input.LA(1);\n\n if ( (LA129_0==98) ) {\n alt129=1;\n }\n\n\n } finally {dbg.exitDecision(129);}\n\n switch (alt129) {\n \tcase 1 :\n \t dbg.enterAlt(1);\n\n \t // Java.g:746:36: '||' conditionalAndExpression\n \t {\n \t dbg.location(746,36);\n \t match(input,98,FOLLOW_98_in_conditionalOrExpression4368); if (state.failed) return ;\n \t dbg.location(746,41);\n \t pushFollow(FOLLOW_conditionalAndExpression_in_conditionalOrExpression4370);\n \t conditionalAndExpression();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop129;\n }\n } while (true);\n } finally {dbg.exitSubRule(129);}\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n if ( state.backtracking>0 ) { memoize(input, 108, conditionalOrExpression_StartIndex); }\n }\n dbg.location(747, 5);\n\n }\n finally {\n dbg.exitRule(getGrammarFileName(), \"conditionalOrExpression\");\n decRuleLevel();\n if ( getRuleLevel()==0 ) {dbg.terminate();}\n }\n\n return ;\n }", "public static void main(String[] args) {\n\t\t\n\t\tSystem.out.println(1+2 > 4-2 && 12 < 23);\n\t\tSystem.out.println(1+2 > 4-2 || 12 < 23);\n\t\tSystem.out.println(1+2 > 4-2 && 12 > 23);\n\t\tSystem.out.println(1+2 > 4-2 || 12 > 23);\n\t\t\n\t\t\n\n\t}", "private double logicalAnd() {\n\t\tdouble q = p<=0.5?p:1-p;\n\t\treturn num * configMap.get('r') + (num-1) * configMap.get('l') + num * configMap.get('f') + configMap.get('t') + q * configMap.get('m') + p * configMap.get('a');\n\t}", "public void execute() {\n\t\tnot_a.in.set(a.get());\n\t\tnot_b.in.set(b.get());\n\n\t\t/* we now execute both of the NOT gates. Each one should\n\t\t * write a value to their output.\n\t\t */\n\t\tnot_a.execute();\n\t\tnot_b.execute();\n\n\n\t\t/* ----- IMPORTANT NOTE 2: -----\n\t\t *\n\t\t * We need to perform NOT twice in this component - since XOR\n\t\t * uses the NOT value of each of the inputs a,b. But we MUST\n\t\t * NOT use the same object twice! Instead, we use two\n\t\t * different NOT objects.\n\t\t *\n\t\t * In a program, this is of course a silly design. But\n\t\t * remember that we are trying to simulate hardware here - and\n\t\t * each component (such as a NOT gate) can only generate one\n\t\t * result per clock tick. So if we want to negate two different\n\t\t * signals for the same calculation, we need two differnt gates.\n\t\t */\n\n\n\t\t/* we now connect various wires to each AND gate. Each AND\n\t\t * checks for \"this value is true, the other is false\"; it does\n\t\t * this by doing the AND of one of the inputs, and the NOT of\n\t\t * the other.\n\t\t *\n\t\t * Note that it's perfectly OK to connect the same input to\n\t\t * two different devices - we just run wires to two different\n\t\t * physical places.\n\t\t */\n\t\tand1.a.set(a.get());\n\t\tand1.b.set(not_b.out.get());\n\n\t\tand2.a.set(not_a.out.get());\n\t\tand2.b.set(b.get());\n\n\t\t/* we execute the two AND gates *AFTER* their inputs are\n\t\t * in place.\n\t\t */\n\t\tand1.execute();\n\t\tand2.execute();\n\n\n\t\t/* the value of XOR is \"this and not that, or not this and that\" -\n\t\t * or, more formally,\n\t\t * (A ~B) + (~A B)\n\t\t * So our last step is to OR the result of the two AND gates\n\t\t * together. Its output is the output from our XOR gate.\n\t\t */\n\t\tor.a.set(and1.out.get());\n\t\tor.b.set(and2.out.get());\n\t\tor.execute();\n\t\tout.set(or.out.get());\n\t}", "public Object visitBitwiseAndExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a & (Long) b;\n }\n else {\n result = parens(a) + \" & \" + parens(b);\n }\n \n return result;\n }", "@Override\n\tpublic String visitBoolExpr(BoolExprContext ctx) {\n\t\tint childrenNo=ctx.children.size();\n\t\tif (childrenNo == 3 )\n\t\t{\n\t\t\tParseTree n=ctx.getChild(1);\t\t\t\n\t\t\tif (!(n instanceof TerminalNode)) return visit(n); //( boolExpr ) \n\t\t\telse if(n.equals(ctx.COMP())) {\n\t\t\t\tString firstOpType=visit(ctx.getChild(0)); //|arExpr COMP arExpr\n\t\t\t\tString secondOpType=visit(ctx.getChild(2)); \n\t\t\t\tif(!((firstOpType.equals(\"int\"))&&(secondOpType.equals(\"int\")))) throw new RuntimeException(\"you can only compare integer types\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}else if(n==ctx.EQ()){\t\t\t\t\t\t\t\t\t\t\t//|arExpr EQ arExpr\n\t\t\t\tString firstOpType=visit(ctx.getChild(0)); \n\t\t\t\tString secondOpType=visit(ctx.getChild(2)); \t\t\t\t\n\t\t\t\tif(!(((firstOpType.equals(\"int\"))&&(secondOpType.equals(\"int\")))||((firstOpType.equals(\"char\"))&&(secondOpType.equals(\"char\"))))) throw new RuntimeException(\"you can only use\"\n\t\t\t\t\t\t+ \"\\\"==\\\" operator on integer or character types\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}else if(n==ctx.AND()||n==ctx.OR()){ //|boolExpr (AND|OR)boolExpr\n\t\t\t\tString firstOpType=visit(ctx.getChild(0));\n\t\t\t\tString secondOpType=visit(ctx.getChild(2));\n\t\t\t\tif(!(firstOpType.equals(\"boolean\"))&&(secondOpType.equals(\"boolean\"))) throw new RuntimeException(\"you can only use boolean operators on boolean expressions\");\n\t\t\t\treturn \"boolean\";\n\t\t\t}\n\t\t} else if (childrenNo == 2 ) { //|NOT boolExpr\n\t\t\tString exprType=visit(ctx.getChild(1));\n\t\t\tif (!exprType.equals(\"boolean\")) throw new RuntimeException(\"NOT operator works only with boolean expresssions\");\n\t\t\t\treturn \"boolean\";\n\t\t}else {\t\t\t\t\t\t\t\t//|(ID|property|BOOLEANLIT|arrIdExpr|methodCall)\n\t\t\tParseTree n=ctx.getChild(0);\n\t\t\tif (n instanceof TerminalNode) {\t\t\t\t\n\t\t\t\tif (n==ctx.BOOLEANLIT()) return \"boolean\";\n\t\t\t\telse if(n==ctx.ID()){\n\t\t\t\t\tString key=visitTerminal((TerminalNode)n);\n\t\t\t\t\tRecord id= table.lookup(key);\n\t\t\t\t\tif (id==null) throw new RuntimeException(\"Identifier \"+key+\" is not declared\");\t\t\t\t\t\n\t\t\t\t\treturn id.getReturnType();\n\t\t\t\t\t\n\t\t\t\t}\t\t\t \n\t\t\t}else {\n\t\t\t\tString type=visit(ctx.getChild(0));\n\t\t\t\treturn type;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn null; //for debug\n\t}", "public boolean getOR() {\n return OR;\n }", "public static void main(String[] args) {\n\t\tSystem.out.println((0+15)/2);\r\n\t\tSystem.out.println(2.0e-6*10000000000.1);\r\n\t\tSystem.out.println(true&&false||true&&true);\r\n\t\t\r\n\t\t//1.1.2\r\n\t\tSystem.out.println((1+2.236)/2);\r\n\t\tSystem.out.println(1+2+3+4.0);\r\n\t\tSystem.out.println(4.1>=4);\r\n\t\tSystem.out.println(1+2+\"3\");\r\n\t\t\r\n\t\t//1.1.3\r\n//\t\tSystem.out.println(\"Please enter three nums\");\r\n\t\tScanner scanner=new Scanner(System.in);\r\n//\t\tint num=scanner.nextInt();\r\n//\t\tint num2=scanner.nextInt();\r\n//\t\tint num3=scanner.nextInt();\r\n//\t\r\n//\t\tif(num==num2&&num==num3) {\r\n//\t\t\tSystem.out.println(\"Eqaul:\");\r\n//\t\t}else {\r\n//\t\t\tSystem.out.println(\"Not equal:\");\r\n//\t\t}\r\n//\r\n//\t\t\t\r\n//\t\t//1.1.4\r\n//\t\t//a. then 语法错误\r\n//\t\t//b. ok\r\n//\t\t//c. ok\r\n//\t\t//d. ok\r\n//\r\n//\t\t\r\n//\t\t//1.1.5\r\n//\t\tint x=scanner.nextInt();\r\n//\t\tint y=scanner.nextInt();\r\n//\t\tif(x<1.0 && y<1.0 && x>0 && y>0) {\r\n//\t\t\tSystem.out.println(\"true\");\r\n//\t\t}\r\n//\t\telse {\r\n//\t\t\tSystem.out.println(\"false\");\r\n//\t\t}\r\n//\t\t\r\n\t\t\r\n\t\t//1.1.6\r\n//\t\tint f=0;\r\n//\t\tint g=1;\r\n//\t\tfor(int i=0;i<=15;i++) {\r\n//\t\t\tSystem.out.print(f+\"\\t\");\r\n//\t\t\tf=f+g;\r\n//\t\t\tg=f-g;\r\n//\t\t}\r\n\t\t\r\n\t\t//1.1.7\r\n//\t\tdouble t=9.0;\r\n//\t\twhile(Math.abs(t-9.0/t)> .001) {\r\n//\t\t\tt=(9.0/t+t)/2.0;\r\n//\t\t}\r\n//\t\tSystem.out.printf(\"%.5f\\n\", t);\r\n//\t\t\r\n//\t\t\r\n//\t\tint sum=0;\r\n//\t\tfor(int i=1;i<1000;i++)\r\n//\t\t\tfor(int j=0;j<i;j++)\r\n//\t\t\t\tsum++;\r\n//\t\tSystem.out.println(sum);\r\n//\t\r\n//\t\t\r\n//\t\tint sum2=0;\r\n//\t\tfor(int i=1;i<1000;i*=2)\r\n//\t\t\tfor(int j=0;j<1000;j++)\r\n//\t\t\t\tsum2++;\r\n//\t\tSystem.out.println(sum2);\r\n\t\r\n\t\t//1.1.8\r\n//\t\tSystem.out.println('b');\r\n//\t\tSystem.out.println('b'+'c');\r\n//\t\tSystem.out.println((char)('a'+4));\r\n\t\t\r\n\t\t//1.1.9\r\n//\t\tSystem.out.println(\"Please enter one num and return with a binary code\");\r\n//\t\tint N=scanner.nextInt();\r\n//\t\tString string=\"\";\r\n//\t\tfor(int n=N;n>0;n/=2) {\r\n//\t\t\tstring=(n%2)+string;\r\n//\t\t}\r\n//\t\tSystem.out.println(string);\r\n\t\t\r\n\t\t//1.1.10\r\n\t\t//int[] a=new int[10];\r\n\t\t\r\n\t\t//1.1.11\r\n//\t\tboolean[][] arrays= {{true,true,true},\r\n//\t\t\t\t{false,false,false},\r\n//\t\t\t\t{true,false,true},\r\n//\t\t};\r\n//\t\t\r\n//\t\tfor(int i=0;i<arrays.length;i++)\r\n//\t\t\tfor(int j=0;j<arrays.length;j++) {\r\n//\t\t\t\tif(arrays[i][j]) {\r\n//\t\t\t\t\tSystem.out.print(\"*\"+\"\\t\");\r\n//\t\t\t\t}\r\n//\t\t\t\telse {\r\n//\t\t\t\t\tSystem.out.print(\"^\"+\"\\t\");\r\n//\t\t\t\t}\r\n//\t\t\t}\r\n\t\t//1.1.12\r\n//\t\tint[] a=new int[10];\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\ta[i]=9-i;\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\ta[i]=a[a[i]];\r\n//\t\tfor(int i=0;i<10;i++)\r\n//\t\t\tSystem.out.println(i);\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t}", "@OperationMeta(opType = OperationType.INFIX)\n public static boolean or(boolean b1, boolean b2) {\n return b1 | b2;\n }", "@Test\n public void testAnd() {\n if (true && addValue()) {\n assertThat(flag, equalTo(1));\n }\n\n // first expression is not satisfied conditions, then second expression not invoke\n if (false && addValue()) {\n assertThat(flag, equalTo(1));\n }\n }", "public final Expr orExpr() throws RecognitionException {\r\n Expr result = null;\r\n\r\n int orExpr_StartIndex = input.index();\r\n\r\n Expr lhs =null;\r\n\r\n Expr rhs =null;\r\n\r\n\r\n try {\r\n if ( state.backtracking>0 && alreadyParsedRule(input, 18) ) { return result; }\r\n\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:162:5: (lhs= andExpr ( '||' rhs= andExpr )* )\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:162:9: lhs= andExpr ( '||' rhs= andExpr )*\r\n {\r\n pushFollow(FOLLOW_andExpr_in_orExpr834);\r\n lhs=andExpr();\r\n\r\n state._fsp--;\r\n if (state.failed) return result;\r\n\r\n if ( state.backtracking==0 ) { result = lhs; }\r\n\r\n // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:162:48: ( '||' rhs= andExpr )*\r\n loop13:\r\n do {\r\n int alt13=2;\r\n int LA13_0 = input.LA(1);\r\n\r\n if ( (LA13_0==35) ) {\r\n alt13=1;\r\n }\r\n\r\n\r\n switch (alt13) {\r\n \tcase 1 :\r\n \t // C:\\\\Users\\\\caytekin\\\\Documents\\\\GitHub\\\\sea-of-ql\\\\caytekin\\\\QLJava/src/org/uva/sea/ql/parser/antlr/QL.g:162:50: '||' rhs= andExpr\r\n \t {\r\n \t match(input,35,FOLLOW_35_in_orExpr840); if (state.failed) return result;\r\n\r\n \t pushFollow(FOLLOW_andExpr_in_orExpr844);\r\n \t rhs=andExpr();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return result;\r\n\r\n \t if ( state.backtracking==0 ) { result = new Or(result, rhs); }\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop13;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n if ( state.backtracking>0 ) { memoize(input, 18, orExpr_StartIndex); }\r\n\r\n }\r\n return result;\r\n }", "public boolean check_condition(User u) {\n\tboolean result = false;\n\t// if the recursion has not reached to the leaf level, then continue to\n\t// check the condition\n\tif (operatr_int < 10) // not a leaf node\n\t{\n\t boolean apply_result = cond.check_condition(u);\n\t boolean apply2_result = cond2.check_condition(u);\n\t switch (operatr_int) {\n\t case 1:\n\t\tresult = (apply_result && apply2_result);\n\t\tbreak;\n\t case 2:\n\t\tresult = (apply_result || apply2_result);\n\t\tbreak;\n\t }\n\t}\n\t// recursion has reached a leaf node -\n\telse {\n\t // attempt lookup of value for field name(s) from user\n\t Integer fieldVal1 = u.get_field_value(pre_field);\n\t // check whether a 2-field compare vs. field-constant compare\n\t // uses pre_field_second to signal since pre_cn can't hold null as\n\t // an int\n\t if (pre_field_second.equals(\"\"))\n\t\tresult = compare(fieldVal1, operatr_int, int_constant);\n\t else\n\t\tresult = compare(fieldVal1, operatr_int,\n\t\t\tu.get_field_value(pre_field_second));\n\t}\n\treturn result;\n }", "public static void main(String[] args) {\n System.out.println(7 > 5);\n System.out.println(7< -19);\n System.out.println(5>=5);\n System.out.println(7>= 8);\n System.out.println(4 <= 5);\n System.out.println(14>= 8);\n\n\n\n\n /*== is used to check for equality\n and IT IS VERY DIFFERENT FROM REGULAR =\n difference between == and = same as difference between equal and equality in daily english\n */\n System.out.println(5 == 5);\n\n /* != is used to check for inequality, ! in programming is translates into NOT!\n == and != are questions, checking equality or inequality.\n */\n System.out.println(6 != 10);\n }", "public static void main(String[] args) {\r\n\t\r\n\t\tint n1 = 10;\r\n\t\tboolean c1 = n1 > 5;\r\n\t\tboolean c2 = n1 < 5;\r\n\t\tboolean c3 = n1 >= 5;\r\n\t\tboolean c4 = n1 <= 5;\r\n\t\tboolean c5 = n1 == 5;\r\n\t\tboolean c6 = n1 != 5;\r\n\t\t\r\n\t\tSystem.out.println(c1);\r\n\t\tSystem.out.println(c2);\r\n\t\tSystem.out.println(c3);\r\n\t\tSystem.out.println(c4);\r\n\t\tSystem.out.println(c5);\r\n\t\tSystem.out.println(c6);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public boolean getOR() {\n return OR;\n }", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tint age = 14;\n\t\tString name = \"ABC\";\n\t\t\n\t\tboolean isUserEligible = false;\n\t\t\n\t\tisUserEligible = ( age >= 18 ) && ( name.equals(\"ABC\") );\n\t\t\n\t\tif( isUserEligible) {\n\t\t\tSystem.out.println(\"( with && ) User is eligible\");\n\t\t} else {\n\t\t\tSystem.out.println(\"( with && ) User is not eligible\");\n\t\t}\n\n\t\t\n\t\t// || ( OR )\n\t\n\t\t//\t\tLogical OR Operation \n\t\t\n\t\t// true || false = true\n\t\t// false || true = true\n\t\t// false || false = false\n\t\t// true || true = true\n\t\t\n\t\tif( isUserEligible) {\n\t\t\tSystem.out.println(\"( with || ) User is eligible\");\n\t\t} else {\n\t\t\tSystem.out.println(\"( with || ) User is not eligible\");\n\t\t}\n\t}", "private Term parseBitwiseOr(final boolean required) throws ParseException {\n Term t1 = parseBtwiseXOr(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '|') {\n Term t2 = parseBtwiseXOr(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.OrI(t1, t2);\n } else {\n reportTypeErrorI2(\"'|'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "public static Object or(Object val1, Object val2) {\n\t\tif (isBool(val1) && isBool(val2)) {\n\t\t\treturn ((Boolean) val1) | ((Boolean) val2);\n\t\t} else if (isInt(val1) && isInt(val2)) {\n\t\t\treturn ((BigInteger) val1).or((BigInteger) val2);\n\t\t}\n\t\tthrow new OrccRuntimeException(\"type mismatch in or\");\n\t}", "private Object eval(AndExpr expr) {\n if (expr.getExpr().size() == 1) {\n return eval(expr.getExpr().get(0));\n }\n\n boolean result = true;\n for (RelExpr e : expr.getExpr()) {\n Object res = eval(e);\n if (res instanceof Boolean) {\n result = result && (Boolean) res;\n } else {\n throw new RaydenScriptException(\"Expression error: Part expression result is not a boolean. Type: '\" + res.getClass() + \"'\");\n }\n\n if (!result) {\n return false;\n }\n }\n return true;\n }", "@Override\n public ILogical or(ILogical operador) {\n return operador.orBinary(this);\n }", "public static void main(String[] args) {\n\t\t\n\t\tint a = 5;\n\t\tint b = 6;\n//\t\tboolean c = a > b;\n//\t\tSystem.out.println(!c);\n\t\tSystem.out.println(!(boolean)(a > b));\n//\t\tint c = a & b;\n//\t\tint a = 10;\n//\t\tint b = 13;\n//\t\tint c = a | b;\n\t\t\n//\t\t1101 -> 0110 -> 0011 -> 0001 -> 0000 -> 0000; in right shift operation--everytime(>>1) divided by 2.\n//\t\t1101 -> 1010 -> 0100 -> 1000 -> 0000 -> 0000; in left shift operation--everytime(<<1) multiplied by 2.\n//\t\tint b = 13;\n//\t\tint c = b >> 2;\n//\t\tint d = b << 1;\n//\t\tSystem.out.println(c);\n//\t\tSystem.out.println(d);\n\n\t}", "public static void main(String[] args) {\n\n System.out.println(7>5);\n System.out.println(7<-10);\n\n //== is used to check for equality\n // and very different from single =\n System.out.println(5==5);\n\n // != is used to check for inequality\n // != means \"not equal to\"\n System.out.println(6!=5);\n\n\n\n\n }", "public final PythonParser.or_test_return or_test(expr_contextType ctype) throws RecognitionException {\n PythonParser.or_test_return retval = new PythonParser.or_test_return();\n retval.start = input.LT(1);\n\n PythonTree root_0 = null;\n\n Token or=null;\n List list_right=null;\n PythonParser.and_test_return left = null;\n\n PythonParser.and_test_return right = null;\n right = null;\n PythonTree or_tree=null;\n RewriteRuleTokenStream stream_OR=new RewriteRuleTokenStream(adaptor,\"token OR\");\n RewriteRuleSubtreeStream stream_and_test=new RewriteRuleSubtreeStream(adaptor,\"rule and_test\");\n try {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1046:5: (left= and_test[ctype] ( (or= OR right+= and_test[ctype] )+ | -> $left) )\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1046:7: left= and_test[ctype] ( (or= OR right+= and_test[ctype] )+ | -> $left)\n {\n pushFollow(FOLLOW_and_test_in_or_test4287);\n left=and_test(ctype);\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) stream_and_test.add(left.getTree());\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1047:9: ( (or= OR right+= and_test[ctype] )+ | -> $left)\n int alt81=2;\n int LA81_0 = input.LA(1);\n\n if ( (LA81_0==OR) ) {\n alt81=1;\n }\n else if ( (LA81_0==EOF||LA81_0==NEWLINE||LA81_0==NAME||LA81_0==AS||LA81_0==FOR||LA81_0==IF||LA81_0==ORELSE||(LA81_0>=RPAREN && LA81_0<=COMMA)||(LA81_0>=SEMI && LA81_0<=DOUBLESLASHEQUAL)||LA81_0==RBRACK||(LA81_0>=RCURLY && LA81_0<=BACKQUOTE)) ) {\n alt81=2;\n }\n else {\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 81, 0, input);\n\n throw nvae;\n }\n switch (alt81) {\n case 1 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1047:11: (or= OR right+= and_test[ctype] )+\n {\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1047:11: (or= OR right+= and_test[ctype] )+\n int cnt80=0;\n loop80:\n do {\n int alt80=2;\n int LA80_0 = input.LA(1);\n\n if ( (LA80_0==OR) ) {\n alt80=1;\n }\n\n\n switch (alt80) {\n \tcase 1 :\n \t // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1047:12: or= OR right+= and_test[ctype]\n \t {\n \t or=(Token)match(input,OR,FOLLOW_OR_in_or_test4303); if (state.failed) return retval; \n \t if ( state.backtracking==0 ) stream_OR.add(or);\n\n \t pushFollow(FOLLOW_and_test_in_or_test4307);\n \t right=and_test(ctype);\n\n \t state._fsp--;\n \t if (state.failed) return retval;\n \t if ( state.backtracking==0 ) stream_and_test.add(right.getTree());\n \t if (list_right==null) list_right=new ArrayList();\n \t list_right.add(right.getTree());\n\n\n \t }\n \t break;\n\n \tdefault :\n \t if ( cnt80 >= 1 ) break loop80;\n \t if (state.backtracking>0) {state.failed=true; return retval;}\n EarlyExitException eee =\n new EarlyExitException(80, input);\n throw eee;\n }\n cnt80++;\n } while (true);\n\n\n }\n break;\n case 2 :\n // /run/media/abhi/0cc7e6ad-008e-43cd-b47d-f3ed6f127f92/home/abhi/dacapo-9.12-bach-src (2)/benchmarks/bms/jython/build/grammar/Python.g:1050:8: \n {\n\n // AST REWRITE\n // elements: left\n // token labels: \n // rule labels: retval, left\n // token list labels: \n // rule list labels: \n // wildcard labels: \n if ( state.backtracking==0 ) {\n retval.tree = root_0;\n RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,\"rule retval\",retval!=null?retval.tree:null);\n RewriteRuleSubtreeStream stream_left=new RewriteRuleSubtreeStream(adaptor,\"rule left\",left!=null?left.tree:null);\n\n root_0 = (PythonTree)adaptor.nil();\n // 1050:8: -> $left\n {\n adaptor.addChild(root_0, stream_left.nextTree());\n\n }\n\n retval.tree = root_0;}\n }\n break;\n\n }\n\n\n }\n\n retval.stop = input.LT(-1);\n\n if ( state.backtracking==0 ) {\n\n retval.tree = (PythonTree)adaptor.rulePostProcessing(root_0);\n adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);\n }\n if ( state.backtracking==0 ) {\n\n if (or != null) {\n retval.tree = actions.makeBoolOp((left!=null?((PythonTree)left.tree):null), boolopType.Or, list_right);\n }\n\n }\n }\n\n catch (RecognitionException re) {\n errorHandler.reportError(this, re);\n errorHandler.recover(this, input,re);\n retval.tree = (PythonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re);\n }\n finally {\n }\n return retval;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint a=100;\n\t\tint b=200;\n\t\t// a==b ==> checking if a is equal to b\n\t\t// (a==b) ==> is called a relational expression\n\t\tboolean result = (a==b); // false\n\n\t\tSystem.out.println(result); //false\n\t\t\n\t\tSystem.out.println(\"is a and b equal? :\" + (a==b)); //false\n\t\t\n\t\t// not equal to ==> !=\n\t\t\n\t\tboolean result2= (a!=b);\n\t\t\nSystem.out.println(result2);\n\t\t\n\t\tSystem.out.println(\"is a and b equal? :\" + (a!=b));\n\t\t\n\t\t\n\t\t\n\t\t// >=\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private Term parseBtwiseXOr(final boolean required) throws ParseException {\n Term t1 = parseBitwiseAnd(required);\n while (t1 != null) {\n int tt = _tokenizer.next();\n if (tt == '^') {\n Term t2 = parseBitwiseAnd(true);\n if ((t1.isI() && t2.isI()) || !isTypeChecking()) {\n t1 = new Term.XOrI(t1, t2);\n } else {\n reportTypeErrorI2(\"'^'\");\n }\n } else {\n _tokenizer.pushBack();\n break;\n }\n }\n return t1;\n }", "private boolean hasPrecedence(char op1, char op2) {\n if (op1 == '(' || op1 == ')') {\n return false;\n }\n if ((op1 == '+' || op1 == '-') && (op2 == '*' || op2 == '/')) {\n return false;\n }\n return true;\n }", "public boolean isOperator(){\n return true;\n }", "public final AstValidator.cond_return cond() throws RecognitionException {\n AstValidator.cond_return retval = new AstValidator.cond_return();\n retval.start = input.LT(1);\n\n\n CommonTree root_0 = null;\n\n CommonTree _first_0 = null;\n CommonTree _last = null;\n\n CommonTree OR180=null;\n CommonTree AND183=null;\n CommonTree NOT186=null;\n CommonTree NULL188=null;\n CommonTree NOT190=null;\n CommonTree BOOL_COND196=null;\n AstValidator.cond_return cond181 =null;\n\n AstValidator.cond_return cond182 =null;\n\n AstValidator.cond_return cond184 =null;\n\n AstValidator.cond_return cond185 =null;\n\n AstValidator.cond_return cond187 =null;\n\n AstValidator.expr_return expr189 =null;\n\n AstValidator.rel_op_return rel_op191 =null;\n\n AstValidator.expr_return expr192 =null;\n\n AstValidator.expr_return expr193 =null;\n\n AstValidator.in_eval_return in_eval194 =null;\n\n AstValidator.func_eval_return func_eval195 =null;\n\n AstValidator.expr_return expr197 =null;\n\n\n CommonTree OR180_tree=null;\n CommonTree AND183_tree=null;\n CommonTree NOT186_tree=null;\n CommonTree NULL188_tree=null;\n CommonTree NOT190_tree=null;\n CommonTree BOOL_COND196_tree=null;\n\n try {\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:392:6: ( ^( OR cond cond ) | ^( AND cond cond ) | ^( NOT cond ) | ^( NULL expr ( NOT )? ) | ^( rel_op expr expr ) | in_eval | func_eval | ^( BOOL_COND expr ) )\n int alt52=8;\n switch ( input.LA(1) ) {\n case OR:\n {\n alt52=1;\n }\n break;\n case AND:\n {\n alt52=2;\n }\n break;\n case NOT:\n {\n alt52=3;\n }\n break;\n case NULL:\n {\n alt52=4;\n }\n break;\n case NUM_OP_EQ:\n case NUM_OP_GT:\n case NUM_OP_GTE:\n case NUM_OP_LT:\n case NUM_OP_LTE:\n case NUM_OP_NE:\n case STR_OP_EQ:\n case STR_OP_GT:\n case STR_OP_GTE:\n case STR_OP_LT:\n case STR_OP_LTE:\n case STR_OP_MATCHES:\n case STR_OP_NE:\n {\n alt52=5;\n }\n break;\n case IN:\n {\n alt52=6;\n }\n break;\n case FUNC_EVAL:\n case INVOKER_FUNC_EVAL:\n {\n alt52=7;\n }\n break;\n case BOOL_COND:\n {\n alt52=8;\n }\n break;\n default:\n if (state.backtracking>0) {state.failed=true; return retval;}\n NoViableAltException nvae =\n new NoViableAltException(\"\", 52, 0, input);\n\n throw nvae;\n\n }\n\n switch (alt52) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:392:8: ^( OR cond cond )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n OR180=(CommonTree)match(input,OR,FOLLOW_OR_in_cond1733); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n OR180_tree = (CommonTree)adaptor.dupNode(OR180);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(OR180_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_cond1735);\n cond181=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond181.getTree());\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_cond1737);\n cond182=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond182.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 2 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:393:8: ^( AND cond cond )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n AND183=(CommonTree)match(input,AND,FOLLOW_AND_in_cond1750); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n AND183_tree = (CommonTree)adaptor.dupNode(AND183);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(AND183_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_cond1752);\n cond184=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond184.getTree());\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_cond1754);\n cond185=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond185.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 3 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:394:8: ^( NOT cond )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n NOT186=(CommonTree)match(input,NOT,FOLLOW_NOT_in_cond1767); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n NOT186_tree = (CommonTree)adaptor.dupNode(NOT186);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(NOT186_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_cond_in_cond1769);\n cond187=cond();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, cond187.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 4 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:395:8: ^( NULL expr ( NOT )? )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n NULL188=(CommonTree)match(input,NULL,FOLLOW_NULL_in_cond1782); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n NULL188_tree = (CommonTree)adaptor.dupNode(NULL188);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(NULL188_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_expr_in_cond1784);\n expr189=expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, expr189.getTree());\n\n\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:395:21: ( NOT )?\n int alt51=2;\n int LA51_0 = input.LA(1);\n\n if ( (LA51_0==NOT) ) {\n alt51=1;\n }\n switch (alt51) {\n case 1 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:395:21: NOT\n {\n _last = (CommonTree)input.LT(1);\n NOT190=(CommonTree)match(input,NOT,FOLLOW_NOT_in_cond1786); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n NOT190_tree = (CommonTree)adaptor.dupNode(NOT190);\n\n\n adaptor.addChild(root_1, NOT190_tree);\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 5 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:396:8: ^( rel_op expr expr )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_rel_op_in_cond1800);\n rel_op191=rel_op();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) root_1 = (CommonTree)adaptor.becomeRoot(rel_op191.getTree(), root_1);\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_expr_in_cond1802);\n expr192=expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, expr192.getTree());\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_expr_in_cond1804);\n expr193=expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, expr193.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 6 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:397:8: in_eval\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_in_eval_in_cond1815);\n in_eval194=in_eval();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_0, in_eval194.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 7 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:398:8: func_eval\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_func_eval_in_cond1824);\n func_eval195=func_eval();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_0, func_eval195.getTree());\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n case 8 :\n // /home/hoang/DATA/WORKSPACE/trunk0408/src/org/apache/pig/parser/AstValidator.g:399:8: ^( BOOL_COND expr )\n {\n root_0 = (CommonTree)adaptor.nil();\n\n\n _last = (CommonTree)input.LT(1);\n {\n CommonTree _save_last_1 = _last;\n CommonTree _first_1 = null;\n CommonTree root_1 = (CommonTree)adaptor.nil();\n _last = (CommonTree)input.LT(1);\n BOOL_COND196=(CommonTree)match(input,BOOL_COND,FOLLOW_BOOL_COND_in_cond1835); if (state.failed) return retval;\n if ( state.backtracking==0 ) {\n BOOL_COND196_tree = (CommonTree)adaptor.dupNode(BOOL_COND196);\n\n\n root_1 = (CommonTree)adaptor.becomeRoot(BOOL_COND196_tree, root_1);\n }\n\n\n match(input, Token.DOWN, null); if (state.failed) return retval;\n _last = (CommonTree)input.LT(1);\n pushFollow(FOLLOW_expr_in_cond1837);\n expr197=expr();\n\n state._fsp--;\n if (state.failed) return retval;\n if ( state.backtracking==0 ) \n adaptor.addChild(root_1, expr197.getTree());\n\n\n match(input, Token.UP, null); if (state.failed) return retval;\n adaptor.addChild(root_0, root_1);\n _last = _save_last_1;\n }\n\n\n if ( state.backtracking==0 ) {\n }\n }\n break;\n\n }\n if ( state.backtracking==0 ) {\n\n retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);\n }\n\n }\n\n catch(RecognitionException re) {\n throw re;\n }\n\n finally {\n \t// do for sure before leaving\n }\n return retval;\n }", "public static boolean bitwiseOperator(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"bitwiseOperator\")) return false;\n if (!nextTokenIs(b, \"<bitwise operator>\", AND, OR, XOR)) return false;\n boolean r;\n Marker m = enter_section_(b, l, _NONE_, BITWISE_OPERATOR, \"<bitwise operator>\");\n r = consumeToken(b, AND);\n if (!r) r = consumeToken(b, XOR);\n if (!r) r = consumeToken(b, OR);\n exit_section_(b, l, m, r, false, null);\n return r;\n }", "public static void main(String[] args) {\n\r\n\t\tboolean a = (y > 1) && (5 != 4) || (x > -4);\r\n\t\tint b = +x++ + ++x - -x-- - --x;\r\n\t\tdouble c = -2;\r\n\t\tc = c * z;\r\n\t\tint d = x | 5;\r\n\t\tboolean e = ((x == y) || (x < z * y));\r\n\t\tint f = y << y;\r\n\t\tboolean g = !((x >> 666 < y) & (z++ == x));\r\n\r\n\t\tSystem.out.println(a);\r\n\t\tSystem.out.println(b);\r\n\t\tSystem.out.println(c);\r\n\t\tSystem.out.println(d);\r\n\t\tSystem.out.println(e);\r\n\t\tSystem.out.println(f);\r\n\t\tSystem.out.println(g);\r\n\t}", "public final EObject ruleBitwiseOrExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_BitwiseAndExpression_0 = null;\r\n\r\n EObject lv_rightOperand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2812:28: ( (this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )* ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2813:1: (this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )* )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2813:1: (this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )* )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2814:5: this_BitwiseAndExpression_0= ruleBitwiseAndExpression ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )*\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getBitwiseOrExpressionAccess().getBitwiseAndExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleBitwiseAndExpression_in_ruleBitwiseOrExpression6455);\r\n this_BitwiseAndExpression_0=ruleBitwiseAndExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_BitwiseAndExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2822:1: ( () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) ) )*\r\n loop45:\r\n do {\r\n int alt45=2;\r\n int LA45_0 = input.LA(1);\r\n\r\n if ( (LA45_0==51) ) {\r\n alt45=1;\r\n }\r\n\r\n\r\n switch (alt45) {\r\n \tcase 1 :\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2822:2: () otherlv_2= '|' ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2822:2: ()\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2823:5: \r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t current = forceCreateModelElementAndSet(\r\n \t grammarAccess.getBitwiseOrExpressionAccess().getBitwiseOrExpressionLeftOperandAction_1_0(),\r\n \t current);\r\n \t \r\n \t }\r\n\r\n \t }\r\n\r\n \t otherlv_2=(Token)match(input,51,FOLLOW_51_in_ruleBitwiseOrExpression6476); if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \tnewLeafNode(otherlv_2, grammarAccess.getBitwiseOrExpressionAccess().getVerticalLineKeyword_1_1());\r\n \t \r\n \t }\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2832:1: ( (lv_rightOperand_3_0= ruleBitwiseAndExpression ) )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2833:1: (lv_rightOperand_3_0= ruleBitwiseAndExpression )\r\n \t {\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2833:1: (lv_rightOperand_3_0= ruleBitwiseAndExpression )\r\n \t // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2834:3: lv_rightOperand_3_0= ruleBitwiseAndExpression\r\n \t {\r\n \t if ( state.backtracking==0 ) {\r\n \t \r\n \t \t newCompositeNode(grammarAccess.getBitwiseOrExpressionAccess().getRightOperandBitwiseAndExpressionParserRuleCall_1_2_0()); \r\n \t \t \r\n \t }\r\n \t pushFollow(FOLLOW_ruleBitwiseAndExpression_in_ruleBitwiseOrExpression6497);\r\n \t lv_rightOperand_3_0=ruleBitwiseAndExpression();\r\n\r\n \t state._fsp--;\r\n \t if (state.failed) return current;\r\n \t if ( state.backtracking==0 ) {\r\n\r\n \t \t if (current==null) {\r\n \t \t current = createModelElementForParent(grammarAccess.getBitwiseOrExpressionRule());\r\n \t \t }\r\n \t \t\tset(\r\n \t \t\t\tcurrent, \r\n \t \t\t\t\"rightOperand\",\r\n \t \t\tlv_rightOperand_3_0, \r\n \t \t\t\"BitwiseAndExpression\");\r\n \t \t afterParserOrEnumRuleCall();\r\n \t \t \r\n \t }\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop45;\r\n }\r\n } while (true);\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "private boolean conditionAndOr( String condition, String[] ligne )\r\n {\n if( !condition.contains(\"AND\") || !condition.contains(\"OR\") )\r\n return this.conditionSimple(condition, ligne);\r\n \r\n // on suppose que cette fonction ne peut être utilisée que si\r\n // la condition ne contient pas des ( ou )\r\n // dans le cas d'une succession de AND et OR\r\n // on donne la priorité pour le AND\r\n boolean resultat = false;\r\n boolean resAnd = true;\r\n boolean resOr = false;\r\n \r\n // pour supprimer tous les espaces\r\n condition = condition.replaceAll(\" \", \"\");\r\n String[] conditionsAnd = condition.split(\"AND\");\r\n for( String cdsAnd : conditionsAnd ) // cds abréviation de conditions\r\n {\r\n String[] conditionsOr = cdsAnd.split(\"OR\");\r\n for( String cdsOr : conditionsOr )\r\n {\r\n resOr |= this.conditionSimple(cdsOr, ligne);\r\n }\r\n resAnd &= resOr;\r\n }\r\n resultat = resAnd;\r\n return resultat;\r\n }", "@Test\n public void defaultOperatorsEvaluateFalseTest() throws Exception {\n\n assertThat(getNode(\"1 == 2\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 != 1\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 <> 1\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 < 0\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"2 > 4\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 >= 3\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"2 >= 4\", \"expr\").render(null), is((Object)false));\n assertThat(getNode(\"1 <= 0\", \"expr\").render(null), is((Object)false));\n }", "public static void main(String[] args) {\n\n\t\tboolean sonuc1 = 5 + 2 ==7;\n\t\t\n\t\tSystem.out.println(sonuc1);\n\t\t\n\t\tSystem.out.println(15*3==40);\n\t\t\n\t\tSystem.out.println(15-3==12);\n\t\t\n\t\t//sisteme bir değere atama yapmadan direk == i yazdırırsan sistem bunun boolean olduğunu anlar ve boolean şeklinde \n\t\t//bir değere atama yapmaksızın da sonuç elde ederiz.\n\t\t\n\t\tboolean esitMi= 24/2==12;\n\t\t\n\t\tSystem.out.println(esitMi);\n\t\t\n\t\tSystem.out.println(5+2>8 || 9<6 );\n\t\tSystem.out.println(5+2>8 || 9<6 );\n\t\tSystem.out.println(5+2>8 || 9<6 );\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Test\n public void defaultOperatorsEvaluteTrueTest() throws Exception {\n\n assertThat(getNode(\"1 == 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 != 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 <> 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 < 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"2 > 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 >= 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"2 >= 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 <= 2\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1 <= 1\", \"expr\").render(null), is((Object)true));\n\n // negative numbers\n assertThat(getNode(\"1 > -1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"-1 < 1\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"1.0 > -1.0\", \"expr\").render(null), is((Object)true));\n assertThat(getNode(\"-1.0 < 1.0\", \"expr\").render(null), is((Object)true));\n }", "public int getPrecedence() {\n switch (operator) {\n case AND:\n return 2;\n case OR:\n default:\n return 1;\n }\n }", "@Override\n\tpublic Object visit(ASTLogical node, Object data)\n\t{\n\t\treturn visitOperatorNode(node, data);\n\t}", "private String reduceOperation(String op1, String opd, String op2, StringBuffer expr) {\r\n if (opd == null) {\r\n if (op1 == null || op2 == null) {\r\n return null;\r\n } else if (\"AND\".equals(op1) && \"AND\".equals(op2)) {\r\n return \"AND\";\r\n } else {\r\n return \"OR\";\r\n }\r\n } else {\r\n if (op1 != null) {\r\n expr.append(op1).append(\" \");\r\n }\r\n expr.append(opd).append(\" \");\r\n return op2;\r\n }\r\n }", "static boolean binaryOperator(PsiBuilder b, int l) {\n if (!recursion_guard_(b, l, \"binaryOperator\")) return false;\n boolean r;\n r = multiplicativeOperator(b, l + 1);\n if (!r) r = additiveOperator(b, l + 1);\n if (!r) r = shiftOperator(b, l + 1);\n if (!r) r = relationalOperator(b, l + 1);\n if (!r) r = consumeToken(b, EQ_EQ);\n if (!r) r = bitwiseOperator(b, l + 1);\n return r;\n }", "public static void main(String[] args) {\n\t\t\n\t\t\t\tint i1=1, i2=2, i3=4; i2=i3%3;\n\t\t\t\tint i4=i1+(i2*i3)+i3;\n\t\t\t\tSystem.out.println(i4);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//The Question ask that true or false\n\t\t\t\t\n\t\t\t\t// The answer is false\n\t\t\t\t\n\t\t\t\t\n\t}", "public static void main(String[] args) {\n\n System.out.println(7>5);\n System.out.println(7<-19);\n System.out.println(5>= 5);\n System.out.println(7>=8);\n System.out.println(4<=5);\n System.out.println(17>=8);\n\n //== is used to check for equality\n //and every different from single =\n\n //is difference between == and = same as difference between equal and equality in daily English\n System.out.println(5==5);\n\n //!= is used to check for inequality, ! in programming translate no tnot\n System.out.println(6 !=10);\n System.out.println(6!= 6);\n\n //==and != are questions, checking for equality or inequality\n\n }", "boolean check(Env env) {\n boolean leftOK = leftOperand.check (env);\n boolean rightOK = rightOperand.check (env);\n return leftOK && rightOK;\n }", "public static void main(final String[] args) {\n\t\tfinal Predicate<Integer> p1 = i -> i > 10;\n\t\tSystem.out.println(p1.test(10)); // OP: false\n\n\t\t// i>10 && number is even then return true\n\t\tfinal Predicate<Integer> p2 = i -> i % 2 == 0;\n\t\tSystem.out.println(p1.and(p2).test(20)); // OP: true\n\n\t\t// i>10 || number is even then return true\n\t\tSystem.out.println(p1.or(p2).test(21)); // OP: true\n\n\t\t// i>10 && number is odd then return true\n\t\tSystem.out.println(p1.and(p2.negate()).test(21)); // OP: true\n\t}", "public final Expr orExpr() throws RecognitionException {\n Expr result = null;\n\n int orExpr_StartIndex = input.index();\n\n Expr lhs =null;\n\n Expr rhs =null;\n\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 14) ) { return result; }\n\n // /home/jahn/workspace1/QLAndroid/src/org/uva/sea/ql/parser/antlr/QL.g:165:5: (lhs= andExpr ( '||' rhs= andExpr )* )\n // /home/jahn/workspace1/QLAndroid/src/org/uva/sea/ql/parser/antlr/QL.g:165:9: lhs= andExpr ( '||' rhs= andExpr )*\n {\n pushFollow(FOLLOW_andExpr_in_orExpr707);\n lhs=andExpr();\n\n state._fsp--;\n if (state.failed) return result;\n\n if ( state.backtracking==0 ) { result = lhs; }\n\n // /home/jahn/workspace1/QLAndroid/src/org/uva/sea/ql/parser/antlr/QL.g:165:48: ( '||' rhs= andExpr )*\n loop11:\n do {\n int alt11=2;\n int LA11_0 = input.LA(1);\n\n if ( (LA11_0==34) ) {\n alt11=1;\n }\n\n\n switch (alt11) {\n \tcase 1 :\n \t // /home/jahn/workspace1/QLAndroid/src/org/uva/sea/ql/parser/antlr/QL.g:165:50: '||' rhs= andExpr\n \t {\n \t match(input,34,FOLLOW_34_in_orExpr713); if (state.failed) return result;\n\n \t pushFollow(FOLLOW_andExpr_in_orExpr717);\n \t rhs=andExpr();\n\n \t state._fsp--;\n \t if (state.failed) return result;\n\n \t if ( state.backtracking==0 ) { result = new Or(result, rhs); }\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop11;\n }\n } while (true);\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n\n finally {\n \t// do for sure before leaving\n if ( state.backtracking>0 ) { memoize(input, 14, orExpr_StartIndex); }\n\n }\n return result;\n }", "final public void PendingOperatorBool() throws ParseException {String o, op1, op2, r;\n// Si la pila no esta vacía\n if( !pOperators.empty()) {\n\n // Y el tope de la pila es > < <> o ==\n if ( pOperators.peek() == \">\" || pOperators.peek() == \"<\" ||\n pOperators.peek() == \"<>\" || pOperators.peek() == \"==\" ) {\n\n // Sacar los operandos y el operador de las pilas\n op2 = (String)pOperands.pop();\n op1 = (String)pOperands.pop();\n o = (String)pOperators.pop();\n r = \"t\" + currentTemporal;\n\n currentTemporal++;\n\n // Crear un cuadruplo y meterlos\n Cuadruplo quad = new Cuadruplo(o, op1, op2, r);\n quadCounter++;\n pOperands.push(r);\n cuadruplos.addElement(quad);\n }\n }\n }", "public void setOR(boolean value) {\n this.OR = value;\n }", "public static RuntimeValue or(RuntimeValue left, RuntimeValue right) throws RuntimeException {\n if (isDiscreteBoolSamples(left, right)) {\n return new RuntimeValue(\n RuntimeValue.Type.DISCRETE_BOOL_SAMPLE,\n Operators.or(left.getDiscreteBoolSample(), right.getDiscreteBoolSample())\n );\n }\n\n throw new RuntimeException(\"OR-ing incompatible types\");\n }", "public Object visitBitwiseXorExpression(GNode n) {\n Object a, b, result;\n \n nonboolean = true;\n \n dostring = true;\n \n a = dispatch(n.getGeneric(0));\n b = dispatch(n.getGeneric(1));\n \n dostring = false;\n \n if (a instanceof Long && b instanceof Long) {\n result = (Long) a ^ (Long) b;\n }\n else {\n result = parens(a) + \" ^ \" + parens(b);\n }\n \n return result;\n }", "public final EObject ruleLogicalNotExpression() throws RecognitionException {\r\n EObject current = null;\r\n\r\n Token otherlv_2=null;\r\n EObject this_BitwiseXorExpression_0 = null;\r\n\r\n EObject lv_operand_3_0 = null;\r\n\r\n\r\n enterRule(); \r\n \r\n try {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2695:28: ( (this_BitwiseXorExpression_0= ruleBitwiseXorExpression | ( () otherlv_2= '!' ( (lv_operand_3_0= ruleBitwiseXorExpression ) ) ) ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2696:1: (this_BitwiseXorExpression_0= ruleBitwiseXorExpression | ( () otherlv_2= '!' ( (lv_operand_3_0= ruleBitwiseXorExpression ) ) ) )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2696:1: (this_BitwiseXorExpression_0= ruleBitwiseXorExpression | ( () otherlv_2= '!' ( (lv_operand_3_0= ruleBitwiseXorExpression ) ) ) )\r\n int alt43=2;\r\n int LA43_0 = input.LA(1);\r\n\r\n if ( ((LA43_0>=RULE_ID && LA43_0<=RULE_HEX)||LA43_0==27||(LA43_0>=53 && LA43_0<=54)||(LA43_0>=72 && LA43_0<=73)||LA43_0==76) ) {\r\n alt43=1;\r\n }\r\n else if ( (LA43_0==49) ) {\r\n alt43=2;\r\n }\r\n else {\r\n if (state.backtracking>0) {state.failed=true; return current;}\r\n NoViableAltException nvae =\r\n new NoViableAltException(\"\", 43, 0, input);\r\n\r\n throw nvae;\r\n }\r\n switch (alt43) {\r\n case 1 :\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2697:5: this_BitwiseXorExpression_0= ruleBitwiseXorExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n newCompositeNode(grammarAccess.getLogicalNotExpressionAccess().getBitwiseXorExpressionParserRuleCall_0()); \r\n \r\n }\r\n pushFollow(FOLLOW_ruleBitwiseXorExpression_in_ruleLogicalNotExpression6176);\r\n this_BitwiseXorExpression_0=ruleBitwiseXorExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n \r\n current = this_BitwiseXorExpression_0; \r\n afterParserOrEnumRuleCall();\r\n \r\n }\r\n\r\n }\r\n break;\r\n case 2 :\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2706:6: ( () otherlv_2= '!' ( (lv_operand_3_0= ruleBitwiseXorExpression ) ) )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2706:6: ( () otherlv_2= '!' ( (lv_operand_3_0= ruleBitwiseXorExpression ) ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2706:7: () otherlv_2= '!' ( (lv_operand_3_0= ruleBitwiseXorExpression ) )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2706:7: ()\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2707:5: \r\n {\r\n if ( state.backtracking==0 ) {\r\n\r\n current = forceCreateModelElement(\r\n grammarAccess.getLogicalNotExpressionAccess().getLogicalNotExpressionAction_1_0(),\r\n current);\r\n \r\n }\r\n\r\n }\r\n\r\n otherlv_2=(Token)match(input,49,FOLLOW_49_in_ruleLogicalNotExpression6203); if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \tnewLeafNode(otherlv_2, grammarAccess.getLogicalNotExpressionAccess().getExclamationMarkKeyword_1_1());\r\n \r\n }\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2716:1: ( (lv_operand_3_0= ruleBitwiseXorExpression ) )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2717:1: (lv_operand_3_0= ruleBitwiseXorExpression )\r\n {\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2717:1: (lv_operand_3_0= ruleBitwiseXorExpression )\r\n // ../org.yakindu.sct.model.stext/src-gen/org/yakindu/sct/model/stext/parser/antlr/internal/InternalSText.g:2718:3: lv_operand_3_0= ruleBitwiseXorExpression\r\n {\r\n if ( state.backtracking==0 ) {\r\n \r\n \t newCompositeNode(grammarAccess.getLogicalNotExpressionAccess().getOperandBitwiseXorExpressionParserRuleCall_1_2_0()); \r\n \t \r\n }\r\n pushFollow(FOLLOW_ruleBitwiseXorExpression_in_ruleLogicalNotExpression6224);\r\n lv_operand_3_0=ruleBitwiseXorExpression();\r\n\r\n state._fsp--;\r\n if (state.failed) return current;\r\n if ( state.backtracking==0 ) {\r\n\r\n \t if (current==null) {\r\n \t current = createModelElementForParent(grammarAccess.getLogicalNotExpressionRule());\r\n \t }\r\n \t\tset(\r\n \t\t\tcurrent, \r\n \t\t\t\"operand\",\r\n \t\tlv_operand_3_0, \r\n \t\t\"BitwiseXorExpression\");\r\n \t afterParserOrEnumRuleCall();\r\n \t \r\n }\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n }\r\n break;\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n if ( state.backtracking==0 ) {\r\n leaveRule(); \r\n }\r\n }\r\n \r\n catch (RecognitionException re) { \r\n recover(input,re); \r\n appendSkippedTokens();\r\n } \r\n finally {\r\n }\r\n return current;\r\n }", "public final void inclusiveOrExpression() throws RecognitionException {\n int inclusiveOrExpression_StartIndex = input.index();\n try { dbg.enterRule(getGrammarFileName(), \"inclusiveOrExpression\");\n if ( getRuleLevel()==0 ) {dbg.commence();}\n incRuleLevel();\n dbg.location(753, 1);\n\n try {\n if ( state.backtracking>0 && alreadyParsedRule(input, 110) ) { return ; }\n // Java.g:754:5: ( exclusiveOrExpression ( '|' exclusiveOrExpression )* )\n dbg.enterAlt(1);\n\n // Java.g:754:9: exclusiveOrExpression ( '|' exclusiveOrExpression )*\n {\n dbg.location(754,9);\n pushFollow(FOLLOW_exclusiveOrExpression_in_inclusiveOrExpression4420);\n exclusiveOrExpression();\n\n state._fsp--;\n if (state.failed) return ;\n dbg.location(754,31);\n // Java.g:754:31: ( '|' exclusiveOrExpression )*\n try { dbg.enterSubRule(131);\n\n loop131:\n do {\n int alt131=2;\n try { dbg.enterDecision(131);\n\n int LA131_0 = input.LA(1);\n\n if ( (LA131_0==100) ) {\n alt131=1;\n }\n\n\n } finally {dbg.exitDecision(131);}\n\n switch (alt131) {\n \tcase 1 :\n \t dbg.enterAlt(1);\n\n \t // Java.g:754:33: '|' exclusiveOrExpression\n \t {\n \t dbg.location(754,33);\n \t match(input,100,FOLLOW_100_in_inclusiveOrExpression4424); if (state.failed) return ;\n \t dbg.location(754,37);\n \t pushFollow(FOLLOW_exclusiveOrExpression_in_inclusiveOrExpression4426);\n \t exclusiveOrExpression();\n\n \t state._fsp--;\n \t if (state.failed) return ;\n\n \t }\n \t break;\n\n \tdefault :\n \t break loop131;\n }\n } while (true);\n } finally {dbg.exitSubRule(131);}\n\n\n }\n\n }\n catch (RecognitionException re) {\n reportError(re);\n recover(input,re);\n }\n finally {\n if ( state.backtracking>0 ) { memoize(input, 110, inclusiveOrExpression_StartIndex); }\n }\n dbg.location(755, 5);\n\n }\n finally {\n dbg.exitRule(getGrammarFileName(), \"inclusiveOrExpression\");\n decRuleLevel();\n if ( getRuleLevel()==0 ) {dbg.terminate();}\n }\n\n return ;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint a=10;\n\t\tint b=20;\n\t\t\n\t\tint c=a&b; //Here sigle (&)And operator represents bitwise operator.\n\t\tint d=a|b; //Here Single (|)or operator represents bitwise operator.\n\t\t\n\t\tSystem.out.println(c);\n\t\tSystem.out.println(d);\n\n\t}", "public boolean evaluate(DataDeSerializerNoClass dds, long pos, Object[] params) {\r\n\t\tboolean first = (n1 != null ? n1.evaluate(dds, pos, params) : t1.evaluate(dds, pos, params));\r\n\t\t//do we have a second part?\r\n\t\tif (op == null) {\r\n\t\t\treturn first;\r\n\t\t}\r\n\t\tif ( !first && op == LOG_OP.AND) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif ( first && op == LOG_OP.OR) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn (n2 != null ? n2.evaluate(dds, pos, params) : t2.evaluate(dds, pos, params));\r\n\t}" ]
[ "0.7367896", "0.7355359", "0.7342465", "0.70999897", "0.6971661", "0.67124087", "0.656738", "0.6534837", "0.64990324", "0.6463141", "0.6412905", "0.63546747", "0.6354199", "0.6329013", "0.6278155", "0.62192607", "0.6198916", "0.61598545", "0.6081055", "0.6059548", "0.59825486", "0.5967172", "0.5930003", "0.5927187", "0.5871568", "0.58697325", "0.58689016", "0.5863864", "0.58345896", "0.5817335", "0.5806931", "0.5795117", "0.57729733", "0.573198", "0.57223094", "0.5719415", "0.5710221", "0.5704261", "0.56961364", "0.5695167", "0.56910825", "0.5659255", "0.5654977", "0.5653834", "0.5652236", "0.5646465", "0.5643475", "0.5632077", "0.5625309", "0.56026053", "0.55736184", "0.5573507", "0.5570056", "0.5566766", "0.5556011", "0.55514055", "0.55490327", "0.55377", "0.55355734", "0.55312765", "0.55235356", "0.5522852", "0.55195946", "0.55128145", "0.5503066", "0.54756105", "0.54691356", "0.54689664", "0.54583603", "0.5449942", "0.5440049", "0.54259986", "0.5420853", "0.54183656", "0.54099035", "0.54087687", "0.540576", "0.5393076", "0.539213", "0.53860015", "0.5383606", "0.53814477", "0.53738606", "0.53703094", "0.5369631", "0.5364279", "0.5356769", "0.53511316", "0.53509116", "0.5347635", "0.5322622", "0.5304382", "0.5301936", "0.529473", "0.5284138", "0.52838075", "0.5278718", "0.52676594", "0.526172", "0.5258452", "0.5258086" ]
0.0
-1
This method is used to test login in controller layer. Service layer response is mocked and controller layer of login is validated. This method is validated when valid details is provided from front end
@Test void validLoginTest() throws Exception { User userObj = new User(); userObj.setUsername("sivass"); userObj.setPassword("Siva123@"); UserInfo userInfo = new UserInfo(); userInfo.setRole("C"); userInfo.setUserId(10); String userJson = new ObjectMapper().writeValueAsString(userObj); when(userService.loginValidation(any(String.class), any(String.class))).thenReturn(userInfo); mockMvc.perform(post("/vegapp/v1/users/login").contentType(MediaType.APPLICATION_JSON).content(userJson)) .andExpect(status().isOk()).andExpect(jsonPath("$.role").value("C")) .andExpect(jsonPath("$.userId").value(10)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ResponseEntity<TokenLoginResponse> requestLoginResponse() {\n LoginRequest userLogin = new LoginRequest();\n userLogin.setUsername(\"user\");\n userLogin.setPassword(\"password\");\n ResponseEntity<TokenLoginResponse> loginResponse = new TestRestTemplate().postForEntity(\"http://localhost:\" + port + \"/login/api\", userLogin, TokenLoginResponse.class);\n assertEquals(HttpStatus.OK, loginResponse.getStatusCode());\n return loginResponse;\n }", "@ResponseStatus(HttpStatus.OK)\n @PostMapping(value = \"/login/renter\")\n public AppResponse<ResponseEntity<?>> logInUser(@Valid @RequestBody LoginRequest loginRequest) throws GeneralException {\n// Authentication authentication = authenticationManager.authenticate(\n// new UsernamePasswordAuthenticationToken(loginRequest.getRenterName(), loginRequest.getRenterPassword()));\n//\n// SecurityContextHolder.getContext().setAuthentication(authentication);\n// String jwt = jwtUtils.generateJwtToken(authentication);\n//\n// UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n// List<String> roles = userDetails.getAuthorities().stream()\n// .map(item -> item.getAuthority())\n// .collect(Collectors.toList());\n//\n// return ResponseEntity.ok(new JwtResponse(jwt,\n// userDetails.getId(),\n// userDetails.getUsername(),\n// userDetails.getEmail(),\n// roles));\n return new AppResponse<>(\"Success\",String.valueOf(HttpStatus.CREATED),\n \"Ok\",renterService.loginUser(loginRequest));\n\n }", "@Test\n public void testCreateSucess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n try {\n when(authServiceMock.getUser(anyString(), anyString())).thenReturn(user);\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.RequestBody requestBody = mock(Http.RequestBody.class);\n when(requestBody.asFormUrlEncoded()).thenReturn(new HashMap<String, String[]>(){{\n put(\"username\", new String[] {\"goodusername\" });\n put(\"password\", new String[] {\"goodpassword\" });\n } });\n Http.Request request = mock(Http.Request.class);\n when(request.body()).thenReturn(requestBody);\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).create();\n assertEquals(200, result.status());\n assertEquals(\"application/json\", result.contentType());\n assertTrue(contentAsString(result).\n equals(\"{\\\"id\\\":null,\" +\n \"\\\"username\\\":\\\"fake-user\\\",\" +\n \"\\\"token\\\":\\\"fake-token\\\",\" +\n \"\\\"tenant\\\":\\\"111\\\",\" +\n \"\\\"userid\\\":\\\"1\\\",\" +\n \"\\\"expireDate\\\":null}\"));\n\n try{\n verify(authServiceMock).getUser(anyString(), anyString());\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n }", "@PostMapping(\"/login\") //method handles POST requests with this path (login)\n public ResponseEntity<?> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));\n\n // update the SecurityContext\n SecurityContextHolder.getContext().setAuthentication(authentication);\n\n // generate JWT token\n String jwt = jwtUtils.generateJwtToken(authentication);\n\n // get UserDetails\n UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n List<String> roles = userDetails.getAuthorities().stream()\n .map(GrantedAuthority::getAuthority)\n .collect(Collectors.toList());\n\n // return response with JWT token and UserDetails\n return ResponseEntity.ok(new JwtResponse(jwt,\n userDetails.getId(),\n userDetails.getUsername(),\n userDetails.getEmail(),\n roles,\n userDetails.getCategory()\n ));\n }", "@PostMapping(\"login\")\r\n public ResponseEntity<?> login(@RequestBody UserDetails userDetails) {\r\n try {\r\n companyService = (CompanyService) loginManager.login(userDetails.getEmail(), userDetails.getPassword(), userDetails.getClientType());\r\n } catch (LoginException error) {\r\n System.out.println(error.getMessage());\r\n return ResponseEntity.badRequest().body(error.getMessage());\r\n }\r\n return ResponseEntity.ok(jwtUtil.generateToken(userDetails));\r\n }", "protected Response login() {\n return login(\"\");\n }", "@Test\n public void loginWrongUserNameFailTest() throws Exception {\n Map<String, String> loginREquest = buildLoginRequest(true);\n try {\n\n mockMvc.perform(\n post(LOGIN_PATH_REQ)\n .contentType(\"application/json\")\n .content(objToString(loginREquest))\n )\n .andDo(print())\n .andExpect(status().isInternalServerError())\n .andExpect(content().contentType(\"application/json\"));\n } catch (ServletException ex) {\n ex.printStackTrace();\n }\n }", "@PostMapping(\"/login\")\n public ResponseEntity<JwtDTO> login(@Valid @RequestBody LoginUser loginUsuario, BindingResult bindingResult){\n \tSystem.out.println(\"usuario login \"+ loginUsuario.getNombreUsuario()+\" contraseña \"+ loginUsuario.getPassword());\n if(bindingResult.hasErrors())\n return new ResponseEntity(new Mensaje(\"campos vacíos o email inválido\"), HttpStatus.BAD_REQUEST);\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(loginUsuario.getNombreUsuario(), loginUsuario.getPassword())\n );\n SecurityContextHolder.getContext().setAuthentication(authentication);\n String jwt = jwtProvider.generateToken(authentication);\n UserDetails userDetails = (UserDetails) authentication.getPrincipal();\n System.out.println(\"usuario que esta: \"+ userDetails.getUsername());\n System.out.println(\"privilegios: \"+ userDetails.getAuthorities());\n String idUser=iRepoUser.findByNombreUsuario(loginUsuario.getNombreUsuario()).get().getId_usuario()+\"\";\n System.out.println(\"id enviado es : \"+ idUser);\n JwtDTO jwtDTO = new JwtDTO(jwt, userDetails.getUsername(), userDetails.getAuthorities(),idUser);\n \n return new ResponseEntity<JwtDTO>(jwtDTO, HttpStatus.OK);\n }", "@Test\n public void testIndexSuccess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(200, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@Test\n\tvoid invalidLoginTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setUsername(\"sivass\");\n\t\tuserObj.setPassword(\"Sivas23@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.loginValidation(any(String.class), any(String.class)))\n\t\t\t\t.thenThrow(new InvalidLoginException(\"Invalid Login Credentials\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/login\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isUnauthorized())\n\t\t\t\t.andExpect(jsonPath(\"$.errorMessage\").value(\"Invalid Login Credentials\"));\n\t}", "@Test\n public void loginSuccessWithGoodCredentials() {\n Mockito.when(accountService.getAuthenticatedUser()).thenReturn(Mono.just(account));\n //Mockito.when(userDetailsService.findByUsername(eq(\"jukka\"))).thenReturn(Mono.just(account.toUserDetails()));\n \n client\n .post().uri(\"/login\")\n .header(\"Authorization\", \"Basic \" + utils.createAuthenticationToken(\"jukka\", \"jukka\"))\n .exchange()\n .expectStatus()\n .isOk()\n .expectHeader()\n .contentType(APPLICATION_JSON)\n .expectBody()\n .jsonPath(\"$.id\").isEqualTo(\"oidasajfdlihfaidh\")\n .jsonPath(\"$.name\").isEqualTo(\"Jukka Riekkonen\")\n .jsonPath(\"$.username\").isEqualTo(\"jukka\")\n .jsonPath(\"$.password\").doesNotExist();\n }", "RequestResult loginRequest() throws Exception;", "@RequestMapping(value = \"/{username}/{password}\", method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> login (@PathVariable(\"username\") String username,\n @PathVariable(\"password\") String password) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n Timestamp startTime = getTimeStamp();\n User user = userRepo.findByEmailAddress(username);\n\n if (user != null) { // yes user with this username exists\n\n if (user.getPassword().equals(password)) {\n if ( user.getApproved()) {\n respMap.put(\"message\", user.getType() + \" User \" + user.getFirstname() + \" with id \" + user.getUserid() + \" is logged in!\");\n respMap.put(\"userType\", user.getType());\n\n respMap.put(\"name\", user.getFirstname());\n respMap.put(\"httpStatus\", \"\" + HttpStatus.OK);\n respMap.put(\"startTime\", \"\" + startTime);\n respMap.put(\"userId\", \"\" + user.getUserid());\n respMap.put(\"success\", \"\" + 1);\n } else {\n respMap.put( \"message\" , \"Account has not been approved .. check with Administrator\");\n respMap.put( \"success\" , \"0\");\n message = \"Account has not been approved .. check with Administrator\";\n }\n\n } else { // password incorrect\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"0\");\n message = \"Username or password incorrect\";\n }\n } else { // username not found\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"\"+0);\n respMap.put(\"httpStatus\", \"\"+ HttpStatus.OK);\n\n }\n\n\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "@PostMapping(\"/signin\")\n public ResponseEntity<?> authenticateUser(@RequestBody LoginRequest loginRequest) {\n return userService.authenticateUser(loginRequest);\n }", "default String authenticate(ApplicationUser user, MockMvc mockMvc, ObjectMapper objectMapper) throws Exception {\n MvcResult mvcResult = mockMvc.perform(\n post(AUTH_BASE_URI)\n .contentType(MediaType.APPLICATION_JSON_VALUE)\n .content(\n objectMapper.writeValueAsString(new UserLoginDto(user.getEmail(), user.getPassword()))\n )\n ).andReturn();\n MockHttpServletResponse response = mvcResult.getResponse();\n return response.getContentAsString();\n }", "void loginDetails(LoginSuccess loginSuccess);", "@GetMapping(\"/api/v1/login\")\n public String login() {\n return \"Success\";\n }", "@Test\n\tpublic void getLoginUnauth() throws Exception {\n\t\tmockMvc.perform(MockMvcRequestBuilders.post(\"/login\")\n\t\t\t\t.with(SecurityMockMvcRequestPostProcessors.user(\"unauthorized\").password(\"NA\")))\n\t\t\t\t.andExpect(MockMvcResultMatchers.status().isFound())\n\t\t\t\t.andExpect(MockMvcResultMatchers.header().string(\"Location\", Matchers.containsString(\"/login?error\")));\n\t}", "@RequestMapping(\"/login\")\r\n\tpublic ModelAndView validate(HttpServletRequest request,HttpServletResponse response)\r\n\t{\r\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(ConfigClass.class);\r\n\t //\t Login log=context.getBean(Login.class);\r\n\t \tLoginService lser=context.getBean(LoginService.class);\r\n\t\tLoginService2 v=new LoginService2();\r\n\t\tModelAndView mv= new ModelAndView();\r\n\t\t/*log=lser.retrieveLogin(request.getParameter(\"username\"));\r\n\t\tString name=log.getName();\r\n\t\tString pass=log.getPassword();\r\n\t\t*/\r\n\t\tString name= request.getParameter(\"username\");\r\n\t\tString pass= request.getParameter(\"password\");\r\n\t\tif(v.validateLogin(name, pass))\r\n\t\t\tmv.setViewName(\"success\");\r\n\t\telse\r\n\t\t\tmv.setViewName(\"fail\");\r\n\t\treturn mv;\r\n\t}", "@PostMapping(\"/signin\")\n public ResponseEntity<JwtResponse> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n JwtResponse jwtResponse = this.authenticationService.authenticateUser(loginRequest);\n return ResponseEntity.ok(jwtResponse);\n }", "@CrossOrigin(origins=\"*\")\n\t@RequestMapping(value=\"/login\", method=RequestMethod.POST)\n\tpublic ResponseSender loginMethod(Authentication authResult)\n\t{\n\t\t\n\t\tClientDetailsImpl clientDetailsImpl=((ClientDetailsImpl)authResult.getPrincipal());\n\t\t\n\t\tClient clientReg=clientDetailsImpl.getClient();\n\t\t\n\t\tResponseSender responseSender=new ResponseSender();\t\n\t\t\n\t\tClient client=clientService.getClientById(clientReg.getClientId());\n\t\tString firstName=clientReg.getFirstName();\n\t\t\t\n\t\tSystem.out.println(\"Inside LoginController loginMethod() firstName is :-\"+firstName );\n\t\t\n\t\t//user found in the db, make token for it\n\t\t\n\t\t//Loginid is email in client table\n\t\tjwtClient.setClientId(clientReg.getClientId());\n\t\tjwtClient.setEmail(clientReg.getEmail());\n\t\t//ProfileType id role in client table\n\t\t\n\t\t\n\t\tString token=jwtGenerator.generate();\n\t\t\n\t\tSystem.out.println(\"Inside LoginController loginMethod() token is :- \"+token);\n\t\t//adding token in the response \n\t\t\n\t\tresponseSender.setMessage(\"You are login Successfully\");\n\t\tresponseSender.setFlag(true);\n\t\tresponseSender.setFirstName(firstName);\n\t\t\n\t\t//Setting token to the JwtAuthenticationToken to ensure that when user will come again in future\n\t\t//he/she must be logged in\n\t\t\n\t\tjwtAuthenticationToken.setToken(token);\n\t\t\n\t\t\n\t\treturn responseSender;\n\t}", "@Test\n void loginUser_validInput_userLoggedIn() throws Exception{\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"TestPassword\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.OFFLINE);\n\n given(loginService.checkLoginCredentials(Mockito.any())).willReturn(user);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"TestPassword\");\n userPostDTO.setUsername(\"testUsername\");\n\n MockHttpServletRequestBuilder putRequest = put(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n mockMvc.perform(putRequest).andExpect(status().isOk())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n\n }", "public static String loginHelper(String userName, String password, TestRestTemplate restTemplate) throws Exception {\n String loginContent = ApplicationUserUtility.getLoginRequestAsJson(userName, password);\n String loginURL = BASE_URL + USERS_API + LOGIN_URL;\n URI uri = new URI(loginURL);\n\n ResponseEntity<Object> result = restTemplate.exchange(uri, HttpMethod.POST, WebUtility.getEntity(loginContent), Object.class);\n Object loginSuccessResponse = result.getBody();\n LinkedHashMap response = (LinkedHashMap) loginSuccessResponse;\n Gson gson = new Gson();\n String json = gson.toJson(response,LinkedHashMap.class);\n ObjectMapper objectMapper = new ObjectMapper();\n JWTLoginSuccessResponse loginResponse = objectMapper.readValue(json, JWTLoginSuccessResponse.class);\n\n assertNotNull(loginResponse.getToken());\n assertTrue(loginResponse.getSuccess());\n return loginResponse.getToken().substring(7);\n }", "@PostMapping(\"/login\")\n @CrossOrigin\n public ResponseEntity<?> login(@RequestParam String contactNumber, @RequestParam String password) {\n String passwordByUser = String.valueOf(userService.findUserPassword(contactNumber));\n String sha256hex = Hashing.sha256()\n .hashString(password, Charsets.US_ASCII)\n .toString();\n if (userService.findUserPassword(contactNumber) == null)\n return new ResponseEntity<>(\"This contact number has not been registered!\", HttpStatus.OK);\n else if (!(passwordByUser.equalsIgnoreCase(sha256hex))) {\n return new ResponseEntity<>(\"Invalid Credentials\", HttpStatus.UNAUTHORIZED);\n } else {\n User user = userService.findUser(contactNumber);\n String accessToken = UUID.randomUUID().toString();\n userAuthTokenService.addAccessToken(user.getId(), accessToken);\n HttpHeaders headers = new HttpHeaders();\n headers.add(\"access-token\", accessToken);\n List<String> header = new ArrayList<>();\n header.add(\"access-token\");\n headers.setAccessControlExposeHeaders(header);\n return new ResponseEntity<>(user, headers, HttpStatus.OK);\n }\n }", "@CrossOrigin\n @RequestMapping(method = POST, path = \"/customer/login\", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<LoginResponse> login(@RequestHeader(\"authorization\") final String authorization) throws AuthenticationFailedException {\n //'ATH-003' The below try-catch block is used to see if the authrorization is in the correct format\n String username;\n String password;\n try {\n byte[] decode = Base64.getDecoder().decode(authorization.split(FoodOrderingUtil.BASIC_TOKEN)[1]);\n String decodedText = new String(decode);\n String[] decodedArray = decodedText.split(FoodOrderingUtil.COLON);\n username = decodedArray[0];\n password = decodedArray[1];\n } catch (Exception e) {\n throw new AuthenticationFailedException(\"ATH-003\", \"Incorrect format of decoded customer name and password\");\n }\n CustomerAuthEntity customerAuthEntity = customerService.authenticate(username, password);\n CustomerEntity customerEntity = customerAuthEntity.getCustomer();\n LoginResponse loginResponse = new LoginResponse().id(customerEntity.getUuid()).message(\"LOGGED IN SUCCESSFULLY\");\n loginResponse.contactNumber(customerEntity.getContactNumber());\n loginResponse.emailAddress(customerEntity.getEmail());\n loginResponse.firstName(customerEntity.getFirstName());\n loginResponse.lastName(customerEntity.getLastName());\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.add(\"access-token\", customerAuthEntity.getAccessToken());\n return new ResponseEntity<LoginResponse>(loginResponse, httpHeaders, HttpStatus.OK);\n }", "public void authenticate(LoginRequest loginRequest) {\n\n }", "@PostMapping(\"/customer/loginValidate\")\n\tpublic ResponseEntity<Optional<Customer>> loginValidate(@RequestBody LoginValidationDto loginvalidationdto) {\n\t\tOptional<Customer> optCustomer = customerRepository.findByUsernameAndPassword(loginvalidationdto.getUsername(),\n\t\t\t\tloginvalidationdto.getPassword());\n\t\tif (optCustomer.isPresent()) {\n\t\t\treturn ResponseEntity.ok(optCustomer);\n\t\t} else {\n\t\t\tOptional<Customer> optCustomerEmpty = Optional.of(new Customer());\n\t\t\treturn ResponseEntity.ok(optCustomerEmpty);\n\t\t}\n\n\t}", "boolean doLogin(UserDTO loginUser);", "Customer authenticateCustomer(LoginRequestDto loginRequestDto) throws UserNotFoundException;", "@PostMapping(value = \"/login\",consumes = MediaType.APPLICATION_JSON_VALUE,produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<UserRespo> login(HttpServletRequest request, @RequestBody AppUser user) {\n AppUser appUser = userService.loadUserByUsername(user.getUsername());\n\n Long id = appUser.getId();\n String role = appUser.getRoll().getName();\n String result = \"\";\n HttpStatus httpStatus = null;\n try {\n if(userService.checkLogin(user)) {\n result = jwtService.generateTokenLogin(user.getUsername());\n httpStatus = HttpStatus.OK;\n } else {\n result = \"Wrong userId and password\";\n httpStatus = HttpStatus.BAD_REQUEST;\n }\n } catch (Exception ex) {\n result = \"Server Error\";\n httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;\n }\n UserRespo userRespo = new UserRespo(result,id,user.getUsername(),user.getAvatar(),role);\n return new ResponseEntity<UserRespo>(userRespo, httpStatus);\n\n// // AppUser user1 = userService.loadUserByUsername(user.getUsername());\n// AppUser appUser = userService.loadUserByUsername(user.getUsername());\n// Long id = appUser.getId();\n// String result = \"\";\n// HttpStatus httpStatus = null;\n// try {\n// if (userService.checkLogin(user)) {\n// result = jwtService.generateTokenLogin(user.getUsername());\n// httpStatus = HttpStatus.OK;\n// } else {\n// result = \"Wrong userId and password\";\n// httpStatus = HttpStatus.BAD_REQUEST;\n// }\n// } catch (Exception ex) {\n// result = \"Server Error\";\n// httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;\n// }\n// UserRespo userRespo = new UserRespo(result,id,user.getUsername(),user.getAvatar());\n// return new ResponseEntity<UserRespo>(userRespo, httpStatus);\n }", "@CrossOrigin(origins = AppConstants.CORS)\n\t@RequestMapping(value = {UrlConstants.API_LOGIN_AUTHENTICATE+\"org\"}, method = RequestMethod.POST)\n\tpublic @ResponseBody ResponseDTO authenticate(@RequestBody LoginDTO loginDTO, BindingResult result) {\n\t\tResponseDTO responseDTO = null;\n\t\ttry { \n\t\t\tif(result.hasErrors()){\n\t\t\t\tresponseDTO = new ResponseDTO();\n\t\t\t\tresponseDTO.setErrorCode(300);\n\t\t\t\tresponseDTO = ResponseWriter.writeResponse(responseDTO);\n\t\t\t} else {\n\t\t\t\t//responseDTO = loginService.authenticate(loginDTO);\n\t\t\t\tlogger.info(\"here\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tresponseDTO = ResponseWriter.writeResponse(e.getCause(), e);\n\t\t\tlogger.error(\"error\",e);\n\t\t} \n\t\treturn responseDTO;\n\t}", "@Test\n public void TestifUserLoginWorks() throws Exception{\n //given\n User user1 = new User();\n user1.setStatus(UserStatus.IDLE);\n user1.setEmail(\"firstname@lastname\");\n user1.setUserId(1L);\n user1.setUsername(\"Thomas\");\n user1.setPassword(\"somePassword\");\n user1.setToken(\"someToken\");\n user1.setCurrentGameId(2L);\n\n User user2 = new User();\n user2.setStatus(UserStatus.IDLE);\n user2.setEmail(\"firstname@lastname\");\n user2.setUserId(1L);\n user2.setUsername(\"Thomas\");\n user2.setPassword(\"somePassword\");\n user2.setToken(\"someotherToken\");\n user2.setCurrentGameId(2L);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setUsername(\"Thomas\");\n userPostDTO.setPassword(\"somePassword\");\n userPostDTO.setEmail(\"firstname@lastname\");\n\n UserLoginDTO userLoginDTO = new UserLoginDTO();\n userLoginDTO.setUserId(1L);\n userLoginDTO.setUsername(\"Thomas\");\n userLoginDTO.setToken(\"someotherToken\");\n\n //mock the UserService - returns user\n given(dtoMapper.convertUserPostDTOtoEntity(Mockito.any())).willReturn(user1);\n given(userService.loginUser(Mockito.any())).willReturn(user2);\n given(dtoMapper.convertEntityToUserLoginDTO(Mockito.any())).willReturn(userLoginDTO);\n\n\n // when - Input is given\n MockHttpServletRequestBuilder patchRequest = patch(\"/users/login\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then - check the output\n mockMvc.perform(patchRequest).andExpect(status().isOk())\n .andExpect(jsonPath(\"$.userId\", is(user2.getUserId().intValue())))\n .andExpect(jsonPath(\"$.username\", is(userLoginDTO.getUsername())))\n .andExpect(jsonPath(\"$.token\", is(userLoginDTO.getToken())));\n }", "@ApiOperation(value = \"Authenticate as a user\",\n response = AuthenticatedUser.class, responseContainer = \"The authenticated user details\",\n notes = \"User must be registered\")\n\n @ApiResponses(value = {\n @ApiResponse(code=200, message = \"The corresponding authenticated user details\",\n response = AuthenticatedUser.class, responseHeaders = {\n }),\n @ApiResponse(code = 400, message = \"Bad request\"),\n @ApiResponse(code = 401, message = \"Unauthorized since you are not authorized user\"),\n @ApiResponse(code = 403, message = \"Forbidden since you are not authorized to perform such action\"),\n @ApiResponse(code = 500, message = \"Internal Server Error\")\n })\n @Validated\n /**\n * This is the login API function '/auth/login'\n * @param authenticationRequest The {@link AuthenticationRequest} contains the new user data\n * @return The {@link ResponseEntity}\n */\n @PostMapping(\"/login\")\n public ResponseEntity login(@ApiParam(value = \"Login credentials\", required = true) @RequestBody AuthenticationRequest credentials)\n {\n AuthenticatedUser authenticatedUser = this.authenticatedUserService.login(credentials);\n\n if (authenticatedUser != null)\n {\n return ResponseEntity.ok(authenticatedUser);\n }\n\n return new ResponseEntity<>(\"Invalid credentials\",HttpStatus.UNAUTHORIZED);\n }", "@Test\n public void testIndexNullUser() {\n User user = null;\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(401, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@PostMapping(\"/login\")\n public AuthResponse login(@RequestBody AuthRequest authRequest) {\n try {\n authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(authRequest.getUsername(), authRequest.getPassword()));\n } catch (BadCredentialsException badCredentialsException) {\n throw new RuntimeException(\"Invalid username or password\");\n }\n\n final UserDetails userDetails = customUserDetailsService.loadUserByUsername(authRequest.getUsername());\n final String token = jwtTokenUtil.generateToken(userDetails);\n\n return new AuthResponse(token);\n }", "public interface LoginService {\n\n /**\n * 登录\n *\n * @param data\n * @param req\n * @return\n */\n @ClearAuth\n @Route( code = RouteCode.Ou.LOGIN )\n MemberDTO login( MemberDTO data, RequestMsg req );\n\n /**\n * 注册\n *\n * @param member\n * @param terminal\n * @return\n */\n @ClearAuth\n @Validator\n @Route( code = RouteCode.Ou.REGISTER )\n MemberDTO register( @Valid( groups = Register.class ) MemberDTO member, RequestMsg req );\n\n /**\n * 免密登录\n * <p> 不验证密码直接登录 <p/>\n *\n * @param memberId\n * @param terminal\n * @param ip\n * @param loginInfo\n * @return\n */\n MemberDTO loginNoPwd( Integer memberId, String terminal, String ip, LoginInfoDTO loginInfo );\n\n /**\n * 注册时发送验证码\n *\n * @param mobile\n */\n @ClearAuth\n @Route( code = RouteCode.Ou.SEND_VCODE_4_REGISTER )\n void sendVcode4Register( String mobile );\n\n /**\n * 完善用户资料\n *\n * @param member\n * @param req\n */\n void accomplishMember( MemberDTO member, RequestMsg req );\n}", "AuthenticationResponseDTO authenticateUser(String email, String password);", "@PostMapping(value = \"/login\") \n\t public LoginResponseDto usersLogin(@RequestBody LoginDto loginDto) { \n\t\t LOGGER.info(\"login method\");\n\t\t return userService.usersLogin(loginDto);\n\t }", "@Test\n\tpublic void testVerifyUser() {\n\t\tLogin login = new Login(\"unique_username_78963321864\", \"unique_password_8946531846\");\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//verify the user\n\t\tString resource = \"verify_user\";\n\t\tString requestType = \"POST\";\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(login, MediaType.APPLICATION_JSON));\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t}", "@PostMapping(value = \"/api/login\", consumes = \"application/json\", produces = \"application/json\")\n public StatusJSON verifyLogin(@RequestBody UserJSON userJSON, HttpServletRequest request) {\n\n // check if user exists\n if (userService.userExists(userJSON.getUsername())) {\n\n // username exist, read salt, generate givenHash\n String salt = userService.getUserSalt(userJSON.getUsername());\n String givenHash = BCrypt.hashpw(userJSON.getPassword(), salt);\n\n // verify the user account\n if (userService.canLogin(userJSON.getUsername(), salt, givenHash)) {\n\n // TODO: Should store JWTs in the session rather than just the username.\n userService.setCurrentUser(request, userJSON.getUsername());\n\n return new StatusJSON(true);\n }\n }\n return new StatusJSON(false);\n }", "@PostMapping(\"/login\")\n public ResponseEntity<Map<String, String>> loginUser(@RequestBody User user){\n Map<String, String> result = userService.validateUser(user.getUsername(), user.getPassword());\n if(!result.get(\"status\").equals(\"200\"))\n return new ResponseEntity<>(result, HttpStatus.OK);\n \n User validated_user = userService.getUserByUsername(user.getUsername());\n return new ResponseEntity<>(generateJWTTToken(validated_user), HttpStatus.OK);\n }", "@Override\n public Response login(User user) {\n\n Response response = new Response();\n User foundUser = userDao.login(user);\n if(foundUser != null &&\n foundUser.getUserId() != null &&\n bCryptPasswordEncoder.matches(user.getPassword(), foundUser.getPassword())) {\n UserDetails userDetails = loadUserByUsername(foundUser.getEmail());\n response.setToken(jwtUtil.generateToken(userDetails));\n response.setUsername(foundUser.getUsername());\n\n return response;\n }\n return null;\n }", "@OnClick(R.id.signInButton)\n void signInButtonClick(){\n String userName = userNameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n\n UserModel userModel = new UserModel(userName, password);\n\n ApiInterface apiInterface = RetrofitApiClient.getClient().create(ApiInterface.class);\n Call<ResponseModel> call = apiInterface.loginToServer(userModel);\n call.enqueue(new Callback<ResponseModel>() {\n @Override\n public void onResponse(Call<ResponseModel> call, Response<ResponseModel> response) {\n Logger.d(\"Raw Response: \" + response.raw());\n\n if(response.code()==200){\n\n ResponseModel responseModel = response.body();\n Toast.makeText(getApplicationContext(), responseModel.getMessage(), Toast.LENGTH_LONG).show();\n\n if(responseModel.isSuccess()) { // user name and password is correct\n startActivity(new Intent(getApplicationContext(), MyIpActivity.class));\n finish(); // finish LoginActivity\n }\n\n } else\n Toast.makeText(getApplicationContext(), \"Error: \" + response.message(), Toast.LENGTH_LONG).show();\n\n }\n\n @Override\n public void onFailure(Call<ResponseModel> call, Throwable t) {\n Logger.d(\"Failed: \" + t.getMessage());\n Toast.makeText(getApplicationContext(), t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "@PostMapping(path=\"/login\")\n\tpublic User login(@RequestBody User n){\n\t\tString jwtToken = \"\";\n\t\tUser user = new User();\n\t\tif(n.getEmail() == null || n.getPassword() == null) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Please Fill in both user and password\");\n\t\t\treturn user;\n\t\t}\n\t\t\n\t\tString email = n.getEmail();\n\t\tString password = n.getPassword();\n\t\t\n\t\tif (userRepository.getUserByemail(email)==null) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Email is not associated with any accounts\");\n\t\t\treturn user;\n\t\t}\n\t\tuser = userRepository.getUserByemail(email);\n\t\t\n\t\tString pwd = user.getPassword();\n\t\t\n\t\tif(!password.equals(pwd)) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Email/passowrd combination does not match any records\");\n\t\t\treturn user;\n\t\t}\n\t\t\n\t\tjwtToken = Jwts.builder().setSubject(email).claim(\"roles\", \"user\").setIssuedAt(new Date())\n\t\t\t\t.signWith(SignatureAlgorithm.HS256, \"secretkey\").compact();\n\t\tuser.setToken(jwtToken);\n\t\tuserRepository.save(user);\n\t\t\n\t\treturn user;\n\t}", "@Test\n void createUser_validInput_userCreated() throws Exception {\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"Test User\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.ONLINE);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"Test User\");\n userPostDTO.setUsername(\"testUsername\");\n\n given(loginService.createUser(Mockito.any())).willReturn(user);\n\n // when/then -> do the request + validate the result\n MockHttpServletRequestBuilder postRequest = post(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then\n mockMvc.perform(postRequest)\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n }", "@Override\n\tpublic void validate(RequestEntity<? extends LoginRequest> request) throws ApiException {\n\t\t\n\t}", "@Test\n public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequest() throws Exception\n {\n Principal principal = Mockito.mock(Principal.class);\n Mockito.when(principal.getName()).thenReturn(\"login\");\n List<Order> expectedResult = Collections.singletonList(new Order());\n MockHttpSession session = new MockHttpSession();\n Mockito.when(userServiceMock.getUsersOrders(\"login\"))\n .thenReturn(expectedResult);\n mockMvc.perform(MockMvcRequestBuilders.get(\"/user\").session(session).principal(principal))\n .andExpect(MockMvcResultMatchers.view().name(\"user_cabinet\"));\n Assert.assertNotNull(session.getAttribute(\"usersOrders\"));\n }", "@Test\n\tpublic void testAuthenticateUserOK() {\n\t\tgiven(userRepository.findByLogin(anyString())).willReturn(new UserBuilder(USER_RETURNED).build());\n\n\t\t// make the service call\n\t\ttry {\n\t\t\tassertThat(authService.authenticateUser(USER)).isEqualTo(USER_RETURNED);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Error testing authenticateUser: \" + e.getMessage());\n\t\t}\t\n\t}", "@Test\n public void testDoLogin() {\n System.out.println(\"doLogin\");\n String username = \"AECobley\";\n String password = \"Cassandraisbae\";\n LoginModel instance = new LoginModel();\n String[] expResult = null;\n String[] result = instance.generalLogin(username, password);\n LoginModel loginModel = new LoginModel();\n \n assertNotNull(\"= Pass\",loginModel.generalLogin(username,password));\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"Login Failed\");\n }", "@Override\n public void doLogin(String userName, String password, final RequestResultListener requestResultListener) {\n\n initApiService();\n\n apiService.token(\"password\", userName, password).enqueue(new Callback<Response4Login>() {\n @Override\n public void onResponse(Call<Response4Login> call, Response<Response4Login> response) {\n if (response.isSuccessful()) {\n requestResultListener.onSuccess(response);\n } else {\n requestResultListener.onUnSuccess(response);\n }\n }\n\n @Override\n public void onFailure(Call<Response4Login> call, Throwable t) {\n requestResultListener.onFail();\n }\n });\n\n\n }", "@PostMapping(\"/user/login\")\n public ResponseVo<User> login(@Valid @RequestBody UserLoginForm userLoginForm,\n HttpSession session) {\n\n// if (bindingResult.hasErrors()) {\n// log.info(\"params inconsistent for login, {} {}\",\n// Objects.requireNonNull(bindingResult.getFieldError()).getField(),\n// bindingResult.getFieldError().getDefaultMessage());\n// return ResponseVo.error(ResponseEnum.PARAM_ERROR, bindingResult);\n// }\n\n ResponseVo<User> userResponseVo = userService.login(userLoginForm.getUsername(), userLoginForm.getPassword());\n\n session.setAttribute(MallConst.CURRENT_USER, userResponseVo.getData());\n log.info(\"/login sessionId={}\", session.getId());\n\n return userResponseVo;\n }", "@RequestMapping(\"/login\")\n\tprivate ResponseEntity<String> login (@RequestParam int id, @RequestParam String password) throws JsonProcessingException {\n\t\t\n\t\tUsers user = u_service.loginUser(id, password);\n\t HttpHeaders responseHeaders = new HttpHeaders();\n\t \n\t if (user == null || !user.getPassword().equals(password)) {\n\t return new ResponseEntity<String>(\"No such userId/password combo\", \n\t responseHeaders, HttpStatus.UNAUTHORIZED);\n\t } else {\n\t responseHeaders.add(\"Content-Type\", \"application/json\");\n\t String json = convertToJson(user);\n\t return new ResponseEntity<String>(json, responseHeaders, HttpStatus.OK); \n\t }\t\t\n\t\t\n\t}", "@RequestMapping(value=\"/login/{username}/{password}\")\n @ResponseBody\n public boolean login(@PathVariable String username, @PathVariable String password){\n return customUserDetailsService.login(username, password);\n\n }", "@Service\npublic interface LoginService {\n\n Map validateCode(HttpServletRequest request,String userEmail);\n}", "public ResponseEntity<?> authenticateUser(LoginRequest loginRequest){\n if (loginRequest.getIsTeacher() == 1){\n return teacherService.authenticateTeacher(loginRequest);\n }else {\n return studentService.authenticateStudent(loginRequest);\n }\n }", "public F.Promise<Result> handleSignIn() {\n final Form<LogIn> filledForm = logInForm.bindFromRequest();\n if (customerService().isLoggedIn()) {\n return asPromise(redirect(controllers.routes.HomeController.home()));\n } else if (filledForm.hasErrors()) {\n flash(\"error\", \"Login form contains missing or invalid data.\");\n return asPromise(badRequest(loginView.render(data().build(), filledForm)));\n } else {\n return handleSignInWithValidForm(filledForm);\n }\n }", "private static String doLogin(Request req, Response res) {\n HashMap<String, String> respMap;\n \n res.type(Path.Web.JSON_TYPE);\n \n \n\t String email = Jsoup.parse(req.queryParams(\"email\")).text();\n \n logger.info(\"email from the client = \" + email);\n \n if(email != null && !email.isEmpty()) { \n \n\t server = new SRP6JavascriptServerSessionSHA256(CryptoParams.N_base10, CryptoParams.g_base10);\n\t \t\t\n\t gen = new ChallengeGen(email);\n\t\t\n\t respMap = gen.getChallenge(server);\n \n if(respMap != null) {\n\t\t logger.info(\"JSON RESP SENT TO CLIENT = \" + respMap.toString());\n res.status(200);\n respMap.put(\"code\", \"200\");\n respMap.put(\"status\", \"success\");\n return gson.toJson(respMap);\n }\n }\n respMap = new HashMap<>();\n \n res.status(401);\n respMap.put(\"status\", \"Invalid User Credentials\");\n respMap.put(\"code\", \"401\");\n logger.error(\"getChallenge() return null map most likely due to null B value and Invalid User Credentials\");\n \treturn gson.toJson(respMap);\n}", "@PostMapping(\"/login\")\n public ResponseEntity<Object> login( @RequestParam(\"username\") String username, @RequestParam(\"password\") String password) { \n \tif(!username.isEmpty() && !password.isEmpty()) {\n \t\tString token = authenticationService.login(username, password);\n \t\tif(!token.isEmpty()) {\n \t\t\treturn new ResponseEntity<>(token,HttpStatus.OK);\n \t\t}else {\n \t\t\treturn new ResponseEntity<>(\"Credenziali errate!\",HttpStatus.UNAUTHORIZED); \t\t\t\n \t\t}\n \t}else {\n \t\treturn new ResponseEntity<>(\"Dati mancanti\",HttpStatus.BAD_REQUEST);\n \t}\n }", "@Test\n\tpublic void testLogin() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/login\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200, response.getStatusCodeValue());\n\t}", "private static Object doAuth(Request req, Response res) {\n \n HashMap<String, String> response = new HashMap<>();\n\t\t \n String email = Jsoup.parse(req.queryParams(\"email\")).text();\n\t\t String password = Jsoup.parse(req.queryParams(\"password\")).text();\n\t\t\n res.type(Path.Web.JSON_TYPE);\n \t\t\n\t\t\n\t\tif(email != null && !email.isEmpty() && password != null && !password.isEmpty() ) {\n \n authenticate = new Authenticate(password);\n\t\t\t//note that the server obj has been created during call to login()\n\t\t\tString M2 = authenticate.getM2(server);\n\t\t\t\n if(M2 != null || !M2.isEmpty()) {\n \n \n\t\t\tSession session = req.session(true);\n\t\t\tsession.maxInactiveInterval(Path.Web.SESSION_TIMEOUT);\n\t\t\tUser user = UserController.getUserByEmail(email);\n\t\t\tsession.attribute(Path.Web.ATTR_USER_NAME, user.getUsername());\n session.attribute(Path.Web.ATTR_USER_ID, user.getId().toString()); //saves the id as String\n\t\t\tsession.attribute(Path.Web.AUTH_STATUS, authenticate.authenticated);\n\t\t\tsession.attribute(Path.Web.ATTR_EMAIL, user.getEmail());\n logger.info(user.toString() + \" Has Logged In Successfully\");\n \n response.put(\"M2\", M2);\n response.put(\"code\", \"200\");\n response.put(\"status\", \"success\");\n response.put(\"target\", Path.Web.DASHBOARD);\n \n String respjson = gson.toJson(response);\n logger.info(\"Final response sent By doAuth to client = \" + respjson);\n res.status(200);\n return respjson;\n }\n\t\t\t\t\n\t\t} \n \n res.status(401);\n response.put(\"code\", \"401\");\n response.put(\"status\", \"Error! Invalid Login Credentials\");\n \n return gson.toJson(response);\n }", "@PostMapping(value = \"/login\", headers = {\"content-type=application/x-www-form-urlencoded\"})\n\tpublic ResponseEntity<UserDTO> login(WebRequest request){\n\t\t\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\t\n\t\tUser user = userService.findByUsername(username);\n\t\tif(user == null) {\n\t\t\t//ovo glumi token i ide u session local storage\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.NOT_FOUND);\n\t\t}else if(user.getPassword().equals(password)) {\n\t\t\treturn new ResponseEntity<UserDTO>(new UserDTO(user), HttpStatus.OK);\n\t\t}else {\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.UNAUTHORIZED);\n\t\t}\n\t\t\n\t\t\n\t}", "@Test\n\tpublic void loginWithValidCredentials(){\n\t\tapp.loginScreen().waitUntilLoaded();\n\t\tapp.loginScreen().logIn(Credentials.USER_VALID.username, Credentials.USER_VALID.password);\n\t\tassertTrue(app.userDashboardScreen().isActive());\n\t}", "@PostMapping(value = \"/getLoginProperties\", consumes = MediaType.APPLICATION_JSON_VALUE, \n\t\t\tproduces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic RestResponse<LoginProperties> getLoginProperties()\n\t{\n\t\tRestResponse<LoginProperties> restResponse = new RestResponse<>(SUCCESS);\n\t\ttry {\n\t\t\tLoginProperties userlogin = userCreationService.getLoginProperties();\n\t\t\trestResponse.setResult(userlogin);\n\t\t}catch(Exception e) {\n\t\t\tLOG.error(\"Exception : \", e);\n\t\t}\t\t\n\t\treturn restResponse;\n\t}", "@PostMapping(path = \"userLogind/\")\n public ResponseEntity<passConfirmation> getUserByEmail(@RequestBody userAccount account){\n String passwordByUser = accountRepo.getPasswordByUsername(account.getUsername());\n// System.out.println(\"****************************************\");\n// System.out.println(\"pass:\"+account.getPassword());\n// System.out.println(\"passfromdb:\"+ passwordByEmail);\n if (account.getPassword().toString().equals(passwordByUser)){\n passConfirmation confirmationOK = new passConfirmation(\"Confirmed\");\n return ResponseEntity.ok().body(confirmationOK);\n }else{\n passConfirmation confirmationDenied = new passConfirmation(\"Denied\");\n return ResponseEntity.ok().body(confirmationDenied);\n }\n }", "@Override\n public JsonResponse duringAuthentication(String... params) {\n try {\n final String username = params[0];\n final String password = params[1];\n return RequestHandler.authenticate(this.getApplicationContext(), username, password);\n } catch (IOException e) {\n return null;\n }\n }", "public interface CheckLoginService {\n //根据用户名和密码生成token\n Map<String, Object> checkLogin(LoginInfo loginInfo);\n //检验token信息是否正确,返回登录状态\n Map<String, Object> validToken(String token);\n //验证登录名和密码是否正确\n Boolean verifyAccountAndPassword(LoginInfo loginInfo);\n}", "RestaurantDto loginRestaurant(RestaurantDto restaurant);", "@PostMapping(value = \"login\")\n public ResponseEntity<AccountDto> login(@RequestBody final AuthenticationRequestDto authenticationRequestDto)\n throws LoginException {\n final AccountDto resultAccountDto = authenticationService.login(authenticationRequestDto);\n log.debug(\"Login - The API with body request [{}] has been consumed successfully\", authenticationRequestDto);\n return new ResponseEntity<>(resultAccountDto, HttpStatus.OK);\n }", "@PostMapping(\"/login\")\n public ResponseEntity<User> login(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the login parameters from the post request\n String login = request.getParameter(\"login\");\n String pass = request.getParameter(\"pass\");\n\n // send an HTTP 422 response if either parameter is missing or empty\n if (login == null || login.isEmpty() || pass == null || pass.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // get the user by userName and password\n User user = userRepo.findByUserNameAndPassword(login, pass);\n\n // if it could not find by using a username, try using an email instead\n if (user == null) {\n user = userRepo.findByEmailAndPassword(login, pass);\n\n // send an HTTP 401 response, if no user exists for provided login info\n if (user == null) {\n return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);\n }\n }\n\n // create a new session for the User\n session = request.getSession();\n session.setAttribute(\"user\", user.getUserName());\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user.getUserName()));\n\n // send an HTTP 200 response with the session user\n return ResponseEntity.ok(user.asSessionUser());\n }", "private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }", "@Test\n public void testPostCustomersLoginAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCustomersLoginAction(\"{email}\", \"{password}\", \"{anonymousCartId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/LoginResult\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "boolean userLogin(UserDTO user) throws UserException, Exception;", "boolean hasLoginResponse();", "public interface LoginResponse {\n\tpublic static final String IS_VALID = \"isValid\";\n\tpublic static final String ERROR_CODE = \"errorCode\";\n\tpublic static final String ERROR_MESSAGE = \"errorMessage\";\n\n\tpublic boolean isValid();\n\tpublic String authToken();\n\tpublic int errorCode();\n\tpublic String errorMessage();\n\tpublic User user();\n}", "@Override\n\tpublic DataResponse<LoginResponseVo> login(LoginRequestVo loginRequestVo) {\n\t\tDataResponse<LoginResponseVo> dataResponse = new DataResponse<LoginResponseVo>();\n\t\tif (StringUtils.isEmpty(loginRequestVo.getUsername()) || StringUtils.isEmpty(loginRequestVo.getPassword())) {\n\t\t\tdataResponse.setDataStatus(DataStatus.BUSINESS_ERROR);\n\t\t\tdataResponse.setNotes(\"用户名或密码不能为空!\");\n\t\t\treturn dataResponse;\n\t\t}\n\t\tSysUser user = new JPAQuery<SysUser>(em).from(qSysUser)\n\t\t\t\t.where(qSysUser.username.eq(loginRequestVo.getUsername())).fetchOne();\n\t\tif (null == user) {\n\t\t\tdataResponse.setDataStatus(DataStatus.BUSINESS_ERROR);\n\t\t\tdataResponse.setNotes(\"用户名或者密码错误!\");\n\t\t\tlog.warn(\"{}用户名不存在!\", loginRequestVo.getUsername());\n\t\t\treturn dataResponse;\n\t\t}\n\n\t\tif (!validatePassword(loginRequestVo.getPassword(), user.getPassword())) {\n\t\t\tdataResponse.setDataStatus(DataStatus.BUSINESS_ERROR);\n\t\t\tdataResponse.setNotes(\"用户名或者密码错误!\");\n\t\t\tlog.warn(\"{}用户名或者密码错误!\", loginRequestVo.getUsername());\n\t\t\treturn dataResponse;\n\t\t} else {\n\t\t\tLoginResponseVo vo = new LoginResponseVo();\n\t\t\tvo.setUserId(user.getId());\n\t\t\tvo.setUserName(user.getUsername());\n\t\t\tfinal String userIdentity = jwtTokenUtil.generateToken(user.getId());\n\t\t\tvo.setUserId(userIdentity);\n\t\t\tdataResponse.setResponse(vo);\n\t\t\treturn dataResponse;\n\t\t}\n\t}", "@Test\n public void testLogin() {\n System.out.println(\"doLogin\");\n String username = \"AECobley\";\n String password = \"Cassandra\";\n LoginModel instance = new LoginModel();\n String[] expResult = null;\n String[] result = instance.generalLogin(username, password);\n LoginModel loginModel = new LoginModel();\n assertNull(\"= fail\",loginModel.generalLogin(username,password));\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"Login Succeeded with wrong details\");\n }", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "@PostMapping(\"/loginUser\")\n\tpublic ResponseEntity<?> loginUser(@RequestBody User user, HttpSession hs) {\n\n\t\ttry {\n\t\t\tUser validUser = userService.loginUser(user.getEmailId(), user.getPassword());\n\t\t\ths.setAttribute(\"validUser\", validUser);\n\t\t\treturn new ResponseEntity<User>(validUser, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\t// e.printStackTrace();\n\t\t\tthrow new UserNotFoundException(\"user not found\");\n\t\t}\n\t\t// return new ResponseEntity<String>(\"login failed\",HttpStatus.UNAUTHORIZED);\n\n\t}", "@PostMapping(value = \"/userslogin\")\n\tpublic <T> ResponseEntity<?> loginProcess(@RequestBody User user) {\n\t\tLoginResponse loginResponse = new LoginResponse();\n\t\ttry {\n\t\t\t\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tloginResponse = userDelegate.login(user);\n\t\t\treturn responseUtil.successResponse(loginResponse);\t\t\n\t\t}\n\t\tcatch(ApplicationException e){\t\n\t\t\treturn responseUtil.errorResponse(e);\n\t\t}\n\t\t\n\t}", "public AuthenticationResponse validateToken(AuthValidationRequest authValidationRequest) throws TokenExpiredException {\n boolean isExpired = tokenHelper.isExpired(authValidationRequest.getToken());\n if(isExpired){\n throw new TokenExpiredException(\"Token expired. Please login again\");\n }\n\n AuthenticationResponse response = new AuthenticationResponse();\n response.setToken(authValidationRequest.getToken());\n\n String username = tokenHelper.getUsernameFromToken(authValidationRequest.getToken());\n User user = userRepo.findByUsername(username);\n\n response.setUser(user);\n\n return response;\n }", "@Test\r\n\tpublic void login() {\n\t\tUser loginExit = userMapper.login(\"wangxin\", \"123456\");\r\n\t\tif (loginExit == null) {\r\n\t\t\tSystem.out.println(\"用户不存在\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(loginExit);\r\n\t\t\tSystem.out.println(\"登录成功!\");\r\n\t\t}\r\n\t}", "@RequestMapping(\"login\")\n public boolean Authenticate(String userName, String password, HttpServletResponse res, @CookieValue(value = \"userInfo\", defaultValue = \"\") String userCookie){\n\n if(userCookie != null && !userCookie.equals(\"\")){\n String user = userCookie.split(\"~~~\")[0];\n String pass = userCookie.split(\"~~~\")[1];\n String valid = userCookie.split(\"~~~\")[2];\n\n if(Boolean.valueOf(valid) && userService.authenticate(user, pass).isAuthenticated()) return true;\n }\n\n LoginViewModel viewModel = userService.authenticate(userName, password);\n if(viewModel.isAuthenticated()){\n String[] userInfo = new String[4];\n userInfo[0] = userName;\n userInfo[1] = password;\n userInfo[2] = String.valueOf(viewModel.getUserId());\n\n String userString = Joiner.on(\"~~~\").skipNulls().join(userInfo);\n\n Cookie cookie = new Cookie(\"userInfo\", userString);\n\n res.addCookie(cookie);\n return true;\n }\n return false;\n }", "public void testLogin() throws Exception {\n super.login();\n }", "@Test\n public void test_create_user_and_login_success() {\n try {\n TokenVO firstTokenVO = authBO.createUser(\"createduser1\",\"createdpassword1\");\n Assert.assertNotNull(firstTokenVO);\n Assert.assertNotNull(firstTokenVO.getBearer_token());\n Assert.assertTrue(firstTokenVO.getCoachId() > 1);\n String firstToken = firstTokenVO.getBearer_token();\n\n TokenVO secondTokenVO = authBO.login(\"createduser1\", \"createdpassword1\");\n Assert.assertNotNull(secondTokenVO);\n Assert.assertNotNull(secondTokenVO.getBearer_token());\n Assert.assertTrue(secondTokenVO.getCoachId() > 1);\n Assert.assertTrue(secondTokenVO.getBearer_token() != firstTokenVO.getBearer_token());\n Assert.assertTrue(secondTokenVO.getCoachId() == firstTokenVO.getCoachId());\n } catch (AuthException e) {\n System.err.println(e.getMessage());\n Assert.assertTrue(e.getMessage().equalsIgnoreCase(\"\"));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail(e.getMessage());\n }\n }", "@RequestMapping(value = \"/authenticate\", method = RequestMethod.POST)\r\n public ResponseEntity<User> login(@RequestBody User user) {\r\n\t\tlogger.info(\"Authenticate user:\"+ user);\r\n\t\t\r\n\t\t// logger.debug(\"users=\"+userService.findAllUsers() );\r\n\t\t\r\n\t\tUser dbUser = userService.findByUserName( user.getUsername() );\r\n\r\n\t\tif (dbUser != null) {\r\n\t\t\tlogger.debug(\"Start authenticate User with username [{}].\", user.getUsername() );\r\n\t\t\t//logger.debug(\"dbUser.getPassword() = \" + dbUser.getPassword() );\r\n\t\t\t//logger.debug(\"user.getPassword() = \" + user.getPassword() );\r\n\t\t\tif ( dbUser.getPassword() != null ) {\r\n\t\t\t\t//String encryptedPasword = bCryptPasswordEncoder.encode( user.getPassword() );\r\n\t\t\t\t//logger.debug(\"encryptedPasword = \" + encryptedPasword );\r\n\t\t\t\tif ( bCryptPasswordEncoder.matches( user.getPassword(), dbUser.getPassword())) {\t\t\t\t\r\n\t\t\t\t//if ( dbUser.getPassword().equals( encryptedPasword ) ) { // this won't work, not same\r\n\t\t\t\t\tlogger.info(\"User with username {} authenticated.\", user.getUsername() );\r\n\t\t\t\t\treturn new ResponseEntity<User>(dbUser, HttpStatus.OK);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tlogger.warn(\"Unable to authenticate. Username [{}] or password incorrect.\", user.getUsername() );\r\n\t\t// json client side not handled status 401 with message pass\r\n\t\treturn new ResponseEntity(new CustomErrorType(\"Unable to authenticate. Username or password incorrect.\"),\r\n\t\t\t\tHttpStatus.UNAUTHORIZED);\r\n\t\t\r\n\t\t//return new ResponseEntity(new CustomErrorType(\"Unable to authenticate. Username or password incorrect.\"),\r\n\t\t//\t\tHttpStatus.OK);\r\n\t\t\r\n\t\t\r\n\t}", "@POST(\"login\")\n Call<User> login();", "@RequestMapping(value=\"/loginValidation\")\r\npublic String validation(@RequestParam(\"userid\") String userid,@RequestParam(\"password\") String password)\r\n{\r\n\t//getting all credentials from user table\r\n\tList<User> listUser=userService.getAllCreds();\r\n\tboolean flag = false;\r\n\t\r\n\t//checking whether the user is valid or not\r\n\tfor(User u: listUser) {\r\n\t\tif(u.getUserId().equals(userid) && u.getPassword().equals(password)) {\r\n\t\t\tflag=true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(flag)\r\n\t{\r\n\t\t//if creds are valid it will redirect to usertype page\r\n\t\treturn \"usertype\";\r\n\t }\r\n\telse\r\n\t{\r\n\t\t//if creds are invalid it will redirect to loginfailure page\r\n\t\treturn \"loginfailure\";\t \r\n }\r\n}", "@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/login\",method= RequestMethod.POST)\n @ResponseBody\n public LoginResVO loginHomeconnect(@ApiParam(value = \"account login\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n\t\t\t\t\t@RequestHeader HttpHeaders httpHeaders,\n\t\t\t\t\t@RequestBody(required = false) LoginReqVO body,HttpServletResponse response){\n\tString url = \"/api/translator/user/login\";\n\tLoginResVO result = new LoginResVO(RetObject.fail());\n\tMap<String,String> headerMap = new HashedMap();\n\theaderMap.put(\"PlatID\", platID);\n\theaderMap.put(\"AppID\", appID);\n\tString headers = getJSONString(headerMap);\n\tString bodyText = getJSONString(body);\n\tError headerError = validateHeaders(platID,appID);\n\tError bodyError = validateLoginBodyError(body);\n\tif ( bodyError == null && headerError == null){\n\t\tresponse.addHeader(\"AccessToken\",\"12345678\");\n\t\tresult = new LoginResVO();\n\t}\n\treturn result;\n}", "@ApiOperation(value = \"Login with userName and password\", response = UserDto.class)\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = UserApplicationConstants.SUCCESS),\n\t\t\t@ApiResponse(code = 404, message = UserApplicationConstants.USER_NOT_FOUND) })\n\t@PostMapping(value = \"/login\")\n\tpublic ResponseEntity<UserResponseWrapper<UserDto>> loginUser(@Valid @RequestBody LoginDto loginDto) {\n\t\treturn new ResponseEntity<UserResponseWrapper<UserDto>>(\n\t\t\t\tnew UserResponseWrapper<UserDto>(UserResponseStatus.SUCCESS, userService.login(loginDto)),\n\t\t\t\tHttpStatus.OK);\n\t}", "Login.Req getLoginReq();", "public AuthToken loginUser(){\n return null;\n }", "@Test\n public void testLoggedInUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"[email protected]\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"[email protected]\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "User loginUser(User userLoginRequest, HttpSession httpSession) throws Exception;", "private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }", "@ApiOperation(value = \"카카오로그인\", response = User.class)\n\t@PostMapping(\"/login\")\n\t public ResponseEntity<User> login(@RequestBody String accessToken) {\n\t \n\t int indexsame = 0;\n\t indexsame= accessToken.indexOf(\"=\");\n\t String token = accessToken.substring(indexsame+1, accessToken.length());\n\t HashMap<String,Object>userInfo =kakao.getUserInfo(token);\n\t User loginuser=new User();\n\t String id;\n\t String nickname;\n\t Object temp;\n\t if(userInfo!=null) {\n\t temp= userInfo.get(\"id\");\n\t temp=temp+\"\";\n\t id= temp+\"kakao.com\";\n\t if(userservice.getUserCount(id)>0) {\n\t User user= new User();\n\t user.setUserId(id);\n\t loginuser=userservice.login(user);\n\t }\n\t else if(userservice.getUserCount(id)==0) {\n\t Random r = new Random();\n\t int dice = r.nextInt(157211)+48271;\n\t String dicesen=Integer.toString(dice);\n\t String pw = dicesen;\n\t loginuser.setUserId(id);\n\t loginuser.setUserPw(pw);\n\t int totalcount=userservice.getTotalCount();\n\t loginuser.setUserName(totalcount+\"\");\n\t nickname= temp+\"\";\n\t loginuser.setUserNickname(nickname);\n\t userservice.insertUser(loginuser);\n\t }\n\t }\n\t return new ResponseEntity<User>(loginuser, HttpStatus.OK);\n\t}", "@Test\n\tpublic void customerLogin()\n\t{\n\t\tCustomerFacade cf = cust.login(\"Customer2\", \"4321\", ClientType.CUSTOMER);\n\t\tAssert.assertNotNull(cf);\n\t}", "private static void login(String role, String password) {\n String json = String.format(\"{username: \\\"%s\\\", password: \\\"%s\\\"}\", role, password);\n securityToken = given()\n .contentType(\"application/json\")\n .body(json)\n //.when().post(\"/api/login\")\n .when().post(\"/login\")\n .then()\n .extract().path(\"token\");\n }", "@Override\n public ActionForward execute(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n LoginForm formBean=(LoginForm)form;\n UserService ser = new UserService();\n \n String name = formBean.getUser();\n String pass = formBean.getPass();\n \n if ((name == null) || pass == null || name.equals(\"\") || pass.equals(\"\")) { \n if(ser.Validate(formBean)==false){\n formBean.setError();\n return mapping.findForward(FAILURE);\n }\n \n }\n\n return mapping.findForward(SUCCESS);\n \n }", "@GetMapping(\"/login\")\n public ResponseEntity<?> login(Principal principal){\n if(principal == null) {\n //This should be ok hhtp status because this will be user for logout path\n return ResponseEntity.ok(principal);\n }\n UsernamePasswordAuthenticationToken authenticationToken = (UsernamePasswordAuthenticationToken) principal;\n User user = userService.findByUsername(authenticationToken.getName());\n user.setToken(jwtTokenProvider.generateToken(authenticationToken));\n return new ResponseEntity<>(user,HttpStatus.OK);\n }", "@Test\n\tpublic void performRequestValidation() throws Exception {\n\n\t\tString responseBody = TestUtils.getValidResponse();\n\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tResponseEntity<ResponseWrapper> responseEntity = prepareReponseEntity(responseBody);\n\n\t\t\tthis.mockServer.verify();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.70019144", "0.6845226", "0.67921174", "0.67541", "0.674648", "0.65344775", "0.6527422", "0.65192187", "0.65053886", "0.6458095", "0.64455485", "0.6377919", "0.63426", "0.6334822", "0.6300359", "0.6286794", "0.62792313", "0.6275142", "0.62575454", "0.62550414", "0.6234106", "0.6229781", "0.6174814", "0.6154825", "0.61486065", "0.6146798", "0.6113874", "0.6112837", "0.6109564", "0.6101869", "0.6068528", "0.60533035", "0.6045381", "0.6043905", "0.6015954", "0.6015292", "0.59933734", "0.59863234", "0.5966248", "0.5953252", "0.59440815", "0.593336", "0.592667", "0.5913888", "0.5904805", "0.5898568", "0.58911836", "0.58719695", "0.586862", "0.58616334", "0.5860232", "0.5856005", "0.58474743", "0.5837575", "0.5833964", "0.581845", "0.5809819", "0.57965267", "0.5790715", "0.5774823", "0.5772294", "0.57711947", "0.5767614", "0.57581705", "0.5757159", "0.5740264", "0.57394826", "0.5738118", "0.5733734", "0.57295954", "0.5724056", "0.5718798", "0.57186496", "0.57151556", "0.5702393", "0.5699418", "0.5693914", "0.56917346", "0.56916183", "0.56794435", "0.5667393", "0.56592906", "0.5658387", "0.5654215", "0.56528664", "0.5648286", "0.5648143", "0.56327397", "0.5630795", "0.5626153", "0.56246424", "0.561734", "0.56159234", "0.5610961", "0.56077737", "0.55941206", "0.558693", "0.55846167", "0.5582671", "0.5576609" ]
0.736623
0
This method is used to test login in controller layer. Service layer response is mocked and controller layer of login is validated. This method is validated when invalid details is provided from front end
@Test void invalidLoginTest() throws Exception { User userObj = new User(); userObj.setUsername("sivass"); userObj.setPassword("Sivas23@"); String userJson = new ObjectMapper().writeValueAsString(userObj); when(userService.loginValidation(any(String.class), any(String.class))) .thenThrow(new InvalidLoginException("Invalid Login Credentials")); mockMvc.perform(post("/vegapp/v1/users/login").contentType(MediaType.APPLICATION_JSON).content(userJson)) .andExpect(status().isUnauthorized()) .andExpect(jsonPath("$.errorMessage").value("Invalid Login Credentials")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tvoid validLoginTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setUsername(\"sivass\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\n\t\tUserInfo userInfo = new UserInfo();\n\t\tuserInfo.setRole(\"C\");\n\t\tuserInfo.setUserId(10);\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.loginValidation(any(String.class), any(String.class))).thenReturn(userInfo);\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/login\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isOk()).andExpect(jsonPath(\"$.role\").value(\"C\"))\n\t\t\t\t.andExpect(jsonPath(\"$.userId\").value(10));\n\t}", "@Test\n public void loginWrongUserNameFailTest() throws Exception {\n Map<String, String> loginREquest = buildLoginRequest(true);\n try {\n\n mockMvc.perform(\n post(LOGIN_PATH_REQ)\n .contentType(\"application/json\")\n .content(objToString(loginREquest))\n )\n .andDo(print())\n .andExpect(status().isInternalServerError())\n .andExpect(content().contentType(\"application/json\"));\n } catch (ServletException ex) {\n ex.printStackTrace();\n }\n }", "private ResponseEntity<TokenLoginResponse> requestLoginResponse() {\n LoginRequest userLogin = new LoginRequest();\n userLogin.setUsername(\"user\");\n userLogin.setPassword(\"password\");\n ResponseEntity<TokenLoginResponse> loginResponse = new TestRestTemplate().postForEntity(\"http://localhost:\" + port + \"/login/api\", userLogin, TokenLoginResponse.class);\n assertEquals(HttpStatus.OK, loginResponse.getStatusCode());\n return loginResponse;\n }", "@ResponseStatus(HttpStatus.OK)\n @PostMapping(value = \"/login/renter\")\n public AppResponse<ResponseEntity<?>> logInUser(@Valid @RequestBody LoginRequest loginRequest) throws GeneralException {\n// Authentication authentication = authenticationManager.authenticate(\n// new UsernamePasswordAuthenticationToken(loginRequest.getRenterName(), loginRequest.getRenterPassword()));\n//\n// SecurityContextHolder.getContext().setAuthentication(authentication);\n// String jwt = jwtUtils.generateJwtToken(authentication);\n//\n// UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n// List<String> roles = userDetails.getAuthorities().stream()\n// .map(item -> item.getAuthority())\n// .collect(Collectors.toList());\n//\n// return ResponseEntity.ok(new JwtResponse(jwt,\n// userDetails.getId(),\n// userDetails.getUsername(),\n// userDetails.getEmail(),\n// roles));\n return new AppResponse<>(\"Success\",String.valueOf(HttpStatus.CREATED),\n \"Ok\",renterService.loginUser(loginRequest));\n\n }", "@Test\n public void testCreateSucess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n try {\n when(authServiceMock.getUser(anyString(), anyString())).thenReturn(user);\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.RequestBody requestBody = mock(Http.RequestBody.class);\n when(requestBody.asFormUrlEncoded()).thenReturn(new HashMap<String, String[]>(){{\n put(\"username\", new String[] {\"goodusername\" });\n put(\"password\", new String[] {\"goodpassword\" });\n } });\n Http.Request request = mock(Http.Request.class);\n when(request.body()).thenReturn(requestBody);\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).create();\n assertEquals(200, result.status());\n assertEquals(\"application/json\", result.contentType());\n assertTrue(contentAsString(result).\n equals(\"{\\\"id\\\":null,\" +\n \"\\\"username\\\":\\\"fake-user\\\",\" +\n \"\\\"token\\\":\\\"fake-token\\\",\" +\n \"\\\"tenant\\\":\\\"111\\\",\" +\n \"\\\"userid\\\":\\\"1\\\",\" +\n \"\\\"expireDate\\\":null}\"));\n\n try{\n verify(authServiceMock).getUser(anyString(), anyString());\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n }", "@PostMapping(\"login\")\r\n public ResponseEntity<?> login(@RequestBody UserDetails userDetails) {\r\n try {\r\n companyService = (CompanyService) loginManager.login(userDetails.getEmail(), userDetails.getPassword(), userDetails.getClientType());\r\n } catch (LoginException error) {\r\n System.out.println(error.getMessage());\r\n return ResponseEntity.badRequest().body(error.getMessage());\r\n }\r\n return ResponseEntity.ok(jwtUtil.generateToken(userDetails));\r\n }", "@Test\n\tpublic void getLoginUnauth() throws Exception {\n\t\tmockMvc.perform(MockMvcRequestBuilders.post(\"/login\")\n\t\t\t\t.with(SecurityMockMvcRequestPostProcessors.user(\"unauthorized\").password(\"NA\")))\n\t\t\t\t.andExpect(MockMvcResultMatchers.status().isFound())\n\t\t\t\t.andExpect(MockMvcResultMatchers.header().string(\"Location\", Matchers.containsString(\"/login?error\")));\n\t}", "@PostMapping(\"/login\") //method handles POST requests with this path (login)\n public ResponseEntity<?> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));\n\n // update the SecurityContext\n SecurityContextHolder.getContext().setAuthentication(authentication);\n\n // generate JWT token\n String jwt = jwtUtils.generateJwtToken(authentication);\n\n // get UserDetails\n UserDetailsImpl userDetails = (UserDetailsImpl) authentication.getPrincipal();\n List<String> roles = userDetails.getAuthorities().stream()\n .map(GrantedAuthority::getAuthority)\n .collect(Collectors.toList());\n\n // return response with JWT token and UserDetails\n return ResponseEntity.ok(new JwtResponse(jwt,\n userDetails.getId(),\n userDetails.getUsername(),\n userDetails.getEmail(),\n roles,\n userDetails.getCategory()\n ));\n }", "@PostMapping(\"/login\")\n public ResponseEntity<JwtDTO> login(@Valid @RequestBody LoginUser loginUsuario, BindingResult bindingResult){\n \tSystem.out.println(\"usuario login \"+ loginUsuario.getNombreUsuario()+\" contraseña \"+ loginUsuario.getPassword());\n if(bindingResult.hasErrors())\n return new ResponseEntity(new Mensaje(\"campos vacíos o email inválido\"), HttpStatus.BAD_REQUEST);\n Authentication authentication = authenticationManager.authenticate(\n new UsernamePasswordAuthenticationToken(loginUsuario.getNombreUsuario(), loginUsuario.getPassword())\n );\n SecurityContextHolder.getContext().setAuthentication(authentication);\n String jwt = jwtProvider.generateToken(authentication);\n UserDetails userDetails = (UserDetails) authentication.getPrincipal();\n System.out.println(\"usuario que esta: \"+ userDetails.getUsername());\n System.out.println(\"privilegios: \"+ userDetails.getAuthorities());\n String idUser=iRepoUser.findByNombreUsuario(loginUsuario.getNombreUsuario()).get().getId_usuario()+\"\";\n System.out.println(\"id enviado es : \"+ idUser);\n JwtDTO jwtDTO = new JwtDTO(jwt, userDetails.getUsername(), userDetails.getAuthorities(),idUser);\n \n return new ResponseEntity<JwtDTO>(jwtDTO, HttpStatus.OK);\n }", "protected Response login() {\n return login(\"\");\n }", "RequestResult loginRequest() throws Exception;", "@RequestMapping(value = \"/{username}/{password}\", method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> login (@PathVariable(\"username\") String username,\n @PathVariable(\"password\") String password) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n Timestamp startTime = getTimeStamp();\n User user = userRepo.findByEmailAddress(username);\n\n if (user != null) { // yes user with this username exists\n\n if (user.getPassword().equals(password)) {\n if ( user.getApproved()) {\n respMap.put(\"message\", user.getType() + \" User \" + user.getFirstname() + \" with id \" + user.getUserid() + \" is logged in!\");\n respMap.put(\"userType\", user.getType());\n\n respMap.put(\"name\", user.getFirstname());\n respMap.put(\"httpStatus\", \"\" + HttpStatus.OK);\n respMap.put(\"startTime\", \"\" + startTime);\n respMap.put(\"userId\", \"\" + user.getUserid());\n respMap.put(\"success\", \"\" + 1);\n } else {\n respMap.put( \"message\" , \"Account has not been approved .. check with Administrator\");\n respMap.put( \"success\" , \"0\");\n message = \"Account has not been approved .. check with Administrator\";\n }\n\n } else { // password incorrect\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"0\");\n message = \"Username or password incorrect\";\n }\n } else { // username not found\n respMap.put( \"message\" , \"Username : [\" + username + \"] or password : [\" + password + \"] incorrect\");\n respMap.put( \"success\" , \"\"+0);\n respMap.put(\"httpStatus\", \"\"+ HttpStatus.OK);\n\n }\n\n\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "@Test\n public void testIndexSuccess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(200, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@RequestMapping(\"/login\")\r\n\tpublic ModelAndView validate(HttpServletRequest request,HttpServletResponse response)\r\n\t{\r\n\t\tApplicationContext context = new AnnotationConfigApplicationContext(ConfigClass.class);\r\n\t //\t Login log=context.getBean(Login.class);\r\n\t \tLoginService lser=context.getBean(LoginService.class);\r\n\t\tLoginService2 v=new LoginService2();\r\n\t\tModelAndView mv= new ModelAndView();\r\n\t\t/*log=lser.retrieveLogin(request.getParameter(\"username\"));\r\n\t\tString name=log.getName();\r\n\t\tString pass=log.getPassword();\r\n\t\t*/\r\n\t\tString name= request.getParameter(\"username\");\r\n\t\tString pass= request.getParameter(\"password\");\r\n\t\tif(v.validateLogin(name, pass))\r\n\t\t\tmv.setViewName(\"success\");\r\n\t\telse\r\n\t\t\tmv.setViewName(\"fail\");\r\n\t\treturn mv;\r\n\t}", "@PostMapping(\"/customer/loginValidate\")\n\tpublic ResponseEntity<Optional<Customer>> loginValidate(@RequestBody LoginValidationDto loginvalidationdto) {\n\t\tOptional<Customer> optCustomer = customerRepository.findByUsernameAndPassword(loginvalidationdto.getUsername(),\n\t\t\t\tloginvalidationdto.getPassword());\n\t\tif (optCustomer.isPresent()) {\n\t\t\treturn ResponseEntity.ok(optCustomer);\n\t\t} else {\n\t\t\tOptional<Customer> optCustomerEmpty = Optional.of(new Customer());\n\t\t\treturn ResponseEntity.ok(optCustomerEmpty);\n\t\t}\n\n\t}", "@Test\n public void loginSuccessWithGoodCredentials() {\n Mockito.when(accountService.getAuthenticatedUser()).thenReturn(Mono.just(account));\n //Mockito.when(userDetailsService.findByUsername(eq(\"jukka\"))).thenReturn(Mono.just(account.toUserDetails()));\n \n client\n .post().uri(\"/login\")\n .header(\"Authorization\", \"Basic \" + utils.createAuthenticationToken(\"jukka\", \"jukka\"))\n .exchange()\n .expectStatus()\n .isOk()\n .expectHeader()\n .contentType(APPLICATION_JSON)\n .expectBody()\n .jsonPath(\"$.id\").isEqualTo(\"oidasajfdlihfaidh\")\n .jsonPath(\"$.name\").isEqualTo(\"Jukka Riekkonen\")\n .jsonPath(\"$.username\").isEqualTo(\"jukka\")\n .jsonPath(\"$.password\").doesNotExist();\n }", "@PostMapping(\"/signin\")\n public ResponseEntity<?> authenticateUser(@RequestBody LoginRequest loginRequest) {\n return userService.authenticateUser(loginRequest);\n }", "@PostMapping(\"/signin\")\n public ResponseEntity<JwtResponse> authenticateUser(@Valid @RequestBody LoginRequest loginRequest) {\n JwtResponse jwtResponse = this.authenticationService.authenticateUser(loginRequest);\n return ResponseEntity.ok(jwtResponse);\n }", "@PostMapping(\"/login\")\n @CrossOrigin\n public ResponseEntity<?> login(@RequestParam String contactNumber, @RequestParam String password) {\n String passwordByUser = String.valueOf(userService.findUserPassword(contactNumber));\n String sha256hex = Hashing.sha256()\n .hashString(password, Charsets.US_ASCII)\n .toString();\n if (userService.findUserPassword(contactNumber) == null)\n return new ResponseEntity<>(\"This contact number has not been registered!\", HttpStatus.OK);\n else if (!(passwordByUser.equalsIgnoreCase(sha256hex))) {\n return new ResponseEntity<>(\"Invalid Credentials\", HttpStatus.UNAUTHORIZED);\n } else {\n User user = userService.findUser(contactNumber);\n String accessToken = UUID.randomUUID().toString();\n userAuthTokenService.addAccessToken(user.getId(), accessToken);\n HttpHeaders headers = new HttpHeaders();\n headers.add(\"access-token\", accessToken);\n List<String> header = new ArrayList<>();\n header.add(\"access-token\");\n headers.setAccessControlExposeHeaders(header);\n return new ResponseEntity<>(user, headers, HttpStatus.OK);\n }\n }", "@GetMapping(\"/api/v1/login\")\n public String login() {\n return \"Success\";\n }", "default String authenticate(ApplicationUser user, MockMvc mockMvc, ObjectMapper objectMapper) throws Exception {\n MvcResult mvcResult = mockMvc.perform(\n post(AUTH_BASE_URI)\n .contentType(MediaType.APPLICATION_JSON_VALUE)\n .content(\n objectMapper.writeValueAsString(new UserLoginDto(user.getEmail(), user.getPassword()))\n )\n ).andReturn();\n MockHttpServletResponse response = mvcResult.getResponse();\n return response.getContentAsString();\n }", "@PostMapping(value = \"/login\",consumes = MediaType.APPLICATION_JSON_VALUE,produces = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<UserRespo> login(HttpServletRequest request, @RequestBody AppUser user) {\n AppUser appUser = userService.loadUserByUsername(user.getUsername());\n\n Long id = appUser.getId();\n String role = appUser.getRoll().getName();\n String result = \"\";\n HttpStatus httpStatus = null;\n try {\n if(userService.checkLogin(user)) {\n result = jwtService.generateTokenLogin(user.getUsername());\n httpStatus = HttpStatus.OK;\n } else {\n result = \"Wrong userId and password\";\n httpStatus = HttpStatus.BAD_REQUEST;\n }\n } catch (Exception ex) {\n result = \"Server Error\";\n httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;\n }\n UserRespo userRespo = new UserRespo(result,id,user.getUsername(),user.getAvatar(),role);\n return new ResponseEntity<UserRespo>(userRespo, httpStatus);\n\n// // AppUser user1 = userService.loadUserByUsername(user.getUsername());\n// AppUser appUser = userService.loadUserByUsername(user.getUsername());\n// Long id = appUser.getId();\n// String result = \"\";\n// HttpStatus httpStatus = null;\n// try {\n// if (userService.checkLogin(user)) {\n// result = jwtService.generateTokenLogin(user.getUsername());\n// httpStatus = HttpStatus.OK;\n// } else {\n// result = \"Wrong userId and password\";\n// httpStatus = HttpStatus.BAD_REQUEST;\n// }\n// } catch (Exception ex) {\n// result = \"Server Error\";\n// httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;\n// }\n// UserRespo userRespo = new UserRespo(result,id,user.getUsername(),user.getAvatar());\n// return new ResponseEntity<UserRespo>(userRespo, httpStatus);\n }", "@Test\n void loginUser_validInput_userLoggedIn() throws Exception{\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"TestPassword\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.OFFLINE);\n\n given(loginService.checkLoginCredentials(Mockito.any())).willReturn(user);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"TestPassword\");\n userPostDTO.setUsername(\"testUsername\");\n\n MockHttpServletRequestBuilder putRequest = put(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n mockMvc.perform(putRequest).andExpect(status().isOk())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n\n }", "@Test\n public void testIndexNullUser() {\n User user = null;\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n when(userServiceMock.isValid(anyString())).thenReturn(true);\n when(userServiceMock.findByToken(anyString())).thenReturn(user);\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.Request request = mock(Http.Request.class);\n when(request.getHeader(\"Token\")).thenReturn(\"fake-token\");\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).index();\n assertEquals(401, result.status());\n\n verify(userServiceMock).isValid(anyString());\n verify(userServiceMock, times(2)).findByToken(anyString());\n verify(request, times(2)).getHeader(anyString());\n }", "@Override\n\tpublic void validate(RequestEntity<? extends LoginRequest> request) throws ApiException {\n\t\t\n\t}", "@CrossOrigin(origins = AppConstants.CORS)\n\t@RequestMapping(value = {UrlConstants.API_LOGIN_AUTHENTICATE+\"org\"}, method = RequestMethod.POST)\n\tpublic @ResponseBody ResponseDTO authenticate(@RequestBody LoginDTO loginDTO, BindingResult result) {\n\t\tResponseDTO responseDTO = null;\n\t\ttry { \n\t\t\tif(result.hasErrors()){\n\t\t\t\tresponseDTO = new ResponseDTO();\n\t\t\t\tresponseDTO.setErrorCode(300);\n\t\t\t\tresponseDTO = ResponseWriter.writeResponse(responseDTO);\n\t\t\t} else {\n\t\t\t\t//responseDTO = loginService.authenticate(loginDTO);\n\t\t\t\tlogger.info(\"here\");\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tresponseDTO = ResponseWriter.writeResponse(e.getCause(), e);\n\t\t\tlogger.error(\"error\",e);\n\t\t} \n\t\treturn responseDTO;\n\t}", "@Test\n public void TestifUserLoginWorks() throws Exception{\n //given\n User user1 = new User();\n user1.setStatus(UserStatus.IDLE);\n user1.setEmail(\"firstname@lastname\");\n user1.setUserId(1L);\n user1.setUsername(\"Thomas\");\n user1.setPassword(\"somePassword\");\n user1.setToken(\"someToken\");\n user1.setCurrentGameId(2L);\n\n User user2 = new User();\n user2.setStatus(UserStatus.IDLE);\n user2.setEmail(\"firstname@lastname\");\n user2.setUserId(1L);\n user2.setUsername(\"Thomas\");\n user2.setPassword(\"somePassword\");\n user2.setToken(\"someotherToken\");\n user2.setCurrentGameId(2L);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setUsername(\"Thomas\");\n userPostDTO.setPassword(\"somePassword\");\n userPostDTO.setEmail(\"firstname@lastname\");\n\n UserLoginDTO userLoginDTO = new UserLoginDTO();\n userLoginDTO.setUserId(1L);\n userLoginDTO.setUsername(\"Thomas\");\n userLoginDTO.setToken(\"someotherToken\");\n\n //mock the UserService - returns user\n given(dtoMapper.convertUserPostDTOtoEntity(Mockito.any())).willReturn(user1);\n given(userService.loginUser(Mockito.any())).willReturn(user2);\n given(dtoMapper.convertEntityToUserLoginDTO(Mockito.any())).willReturn(userLoginDTO);\n\n\n // when - Input is given\n MockHttpServletRequestBuilder patchRequest = patch(\"/users/login\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then - check the output\n mockMvc.perform(patchRequest).andExpect(status().isOk())\n .andExpect(jsonPath(\"$.userId\", is(user2.getUserId().intValue())))\n .andExpect(jsonPath(\"$.username\", is(userLoginDTO.getUsername())))\n .andExpect(jsonPath(\"$.token\", is(userLoginDTO.getToken())));\n }", "Customer authenticateCustomer(LoginRequestDto loginRequestDto) throws UserNotFoundException;", "@CrossOrigin\n @RequestMapping(method = POST, path = \"/customer/login\", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<LoginResponse> login(@RequestHeader(\"authorization\") final String authorization) throws AuthenticationFailedException {\n //'ATH-003' The below try-catch block is used to see if the authrorization is in the correct format\n String username;\n String password;\n try {\n byte[] decode = Base64.getDecoder().decode(authorization.split(FoodOrderingUtil.BASIC_TOKEN)[1]);\n String decodedText = new String(decode);\n String[] decodedArray = decodedText.split(FoodOrderingUtil.COLON);\n username = decodedArray[0];\n password = decodedArray[1];\n } catch (Exception e) {\n throw new AuthenticationFailedException(\"ATH-003\", \"Incorrect format of decoded customer name and password\");\n }\n CustomerAuthEntity customerAuthEntity = customerService.authenticate(username, password);\n CustomerEntity customerEntity = customerAuthEntity.getCustomer();\n LoginResponse loginResponse = new LoginResponse().id(customerEntity.getUuid()).message(\"LOGGED IN SUCCESSFULLY\");\n loginResponse.contactNumber(customerEntity.getContactNumber());\n loginResponse.emailAddress(customerEntity.getEmail());\n loginResponse.firstName(customerEntity.getFirstName());\n loginResponse.lastName(customerEntity.getLastName());\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.add(\"access-token\", customerAuthEntity.getAccessToken());\n return new ResponseEntity<LoginResponse>(loginResponse, httpHeaders, HttpStatus.OK);\n }", "public static String loginHelper(String userName, String password, TestRestTemplate restTemplate) throws Exception {\n String loginContent = ApplicationUserUtility.getLoginRequestAsJson(userName, password);\n String loginURL = BASE_URL + USERS_API + LOGIN_URL;\n URI uri = new URI(loginURL);\n\n ResponseEntity<Object> result = restTemplate.exchange(uri, HttpMethod.POST, WebUtility.getEntity(loginContent), Object.class);\n Object loginSuccessResponse = result.getBody();\n LinkedHashMap response = (LinkedHashMap) loginSuccessResponse;\n Gson gson = new Gson();\n String json = gson.toJson(response,LinkedHashMap.class);\n ObjectMapper objectMapper = new ObjectMapper();\n JWTLoginSuccessResponse loginResponse = objectMapper.readValue(json, JWTLoginSuccessResponse.class);\n\n assertNotNull(loginResponse.getToken());\n assertTrue(loginResponse.getSuccess());\n return loginResponse.getToken().substring(7);\n }", "@ApiOperation(value = \"Authenticate as a user\",\n response = AuthenticatedUser.class, responseContainer = \"The authenticated user details\",\n notes = \"User must be registered\")\n\n @ApiResponses(value = {\n @ApiResponse(code=200, message = \"The corresponding authenticated user details\",\n response = AuthenticatedUser.class, responseHeaders = {\n }),\n @ApiResponse(code = 400, message = \"Bad request\"),\n @ApiResponse(code = 401, message = \"Unauthorized since you are not authorized user\"),\n @ApiResponse(code = 403, message = \"Forbidden since you are not authorized to perform such action\"),\n @ApiResponse(code = 500, message = \"Internal Server Error\")\n })\n @Validated\n /**\n * This is the login API function '/auth/login'\n * @param authenticationRequest The {@link AuthenticationRequest} contains the new user data\n * @return The {@link ResponseEntity}\n */\n @PostMapping(\"/login\")\n public ResponseEntity login(@ApiParam(value = \"Login credentials\", required = true) @RequestBody AuthenticationRequest credentials)\n {\n AuthenticatedUser authenticatedUser = this.authenticatedUserService.login(credentials);\n\n if (authenticatedUser != null)\n {\n return ResponseEntity.ok(authenticatedUser);\n }\n\n return new ResponseEntity<>(\"Invalid credentials\",HttpStatus.UNAUTHORIZED);\n }", "@CrossOrigin(origins=\"*\")\n\t@RequestMapping(value=\"/login\", method=RequestMethod.POST)\n\tpublic ResponseSender loginMethod(Authentication authResult)\n\t{\n\t\t\n\t\tClientDetailsImpl clientDetailsImpl=((ClientDetailsImpl)authResult.getPrincipal());\n\t\t\n\t\tClient clientReg=clientDetailsImpl.getClient();\n\t\t\n\t\tResponseSender responseSender=new ResponseSender();\t\n\t\t\n\t\tClient client=clientService.getClientById(clientReg.getClientId());\n\t\tString firstName=clientReg.getFirstName();\n\t\t\t\n\t\tSystem.out.println(\"Inside LoginController loginMethod() firstName is :-\"+firstName );\n\t\t\n\t\t//user found in the db, make token for it\n\t\t\n\t\t//Loginid is email in client table\n\t\tjwtClient.setClientId(clientReg.getClientId());\n\t\tjwtClient.setEmail(clientReg.getEmail());\n\t\t//ProfileType id role in client table\n\t\t\n\t\t\n\t\tString token=jwtGenerator.generate();\n\t\t\n\t\tSystem.out.println(\"Inside LoginController loginMethod() token is :- \"+token);\n\t\t//adding token in the response \n\t\t\n\t\tresponseSender.setMessage(\"You are login Successfully\");\n\t\tresponseSender.setFlag(true);\n\t\tresponseSender.setFirstName(firstName);\n\t\t\n\t\t//Setting token to the JwtAuthenticationToken to ensure that when user will come again in future\n\t\t//he/she must be logged in\n\t\t\n\t\tjwtAuthenticationToken.setToken(token);\n\t\t\n\t\t\n\t\treturn responseSender;\n\t}", "@PostMapping(path=\"/login\")\n\tpublic User login(@RequestBody User n){\n\t\tString jwtToken = \"\";\n\t\tUser user = new User();\n\t\tif(n.getEmail() == null || n.getPassword() == null) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Please Fill in both user and password\");\n\t\t\treturn user;\n\t\t}\n\t\t\n\t\tString email = n.getEmail();\n\t\tString password = n.getPassword();\n\t\t\n\t\tif (userRepository.getUserByemail(email)==null) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Email is not associated with any accounts\");\n\t\t\treturn user;\n\t\t}\n\t\tuser = userRepository.getUserByemail(email);\n\t\t\n\t\tString pwd = user.getPassword();\n\t\t\n\t\tif(!password.equals(pwd)) {\n\t\t\tuser.setError(true);\n\t\t\tuser.setError_msg(\"Email/passowrd combination does not match any records\");\n\t\t\treturn user;\n\t\t}\n\t\t\n\t\tjwtToken = Jwts.builder().setSubject(email).claim(\"roles\", \"user\").setIssuedAt(new Date())\n\t\t\t\t.signWith(SignatureAlgorithm.HS256, \"secretkey\").compact();\n\t\tuser.setToken(jwtToken);\n\t\tuserRepository.save(user);\n\t\t\n\t\treturn user;\n\t}", "public AuthenticationResponse validateToken(AuthValidationRequest authValidationRequest) throws TokenExpiredException {\n boolean isExpired = tokenHelper.isExpired(authValidationRequest.getToken());\n if(isExpired){\n throw new TokenExpiredException(\"Token expired. Please login again\");\n }\n\n AuthenticationResponse response = new AuthenticationResponse();\n response.setToken(authValidationRequest.getToken());\n\n String username = tokenHelper.getUsernameFromToken(authValidationRequest.getToken());\n User user = userRepo.findByUsername(username);\n\n response.setUser(user);\n\n return response;\n }", "public interface LoginService {\n\n /**\n * 登录\n *\n * @param data\n * @param req\n * @return\n */\n @ClearAuth\n @Route( code = RouteCode.Ou.LOGIN )\n MemberDTO login( MemberDTO data, RequestMsg req );\n\n /**\n * 注册\n *\n * @param member\n * @param terminal\n * @return\n */\n @ClearAuth\n @Validator\n @Route( code = RouteCode.Ou.REGISTER )\n MemberDTO register( @Valid( groups = Register.class ) MemberDTO member, RequestMsg req );\n\n /**\n * 免密登录\n * <p> 不验证密码直接登录 <p/>\n *\n * @param memberId\n * @param terminal\n * @param ip\n * @param loginInfo\n * @return\n */\n MemberDTO loginNoPwd( Integer memberId, String terminal, String ip, LoginInfoDTO loginInfo );\n\n /**\n * 注册时发送验证码\n *\n * @param mobile\n */\n @ClearAuth\n @Route( code = RouteCode.Ou.SEND_VCODE_4_REGISTER )\n void sendVcode4Register( String mobile );\n\n /**\n * 完善用户资料\n *\n * @param member\n * @param req\n */\n void accomplishMember( MemberDTO member, RequestMsg req );\n}", "AuthenticationResponseDTO authenticateUser(String email, String password);", "@PostMapping(\"/login\")\n public AuthResponse login(@RequestBody AuthRequest authRequest) {\n try {\n authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(authRequest.getUsername(), authRequest.getPassword()));\n } catch (BadCredentialsException badCredentialsException) {\n throw new RuntimeException(\"Invalid username or password\");\n }\n\n final UserDetails userDetails = customUserDetailsService.loadUserByUsername(authRequest.getUsername());\n final String token = jwtTokenUtil.generateToken(userDetails);\n\n return new AuthResponse(token);\n }", "void loginDetails(LoginSuccess loginSuccess);", "@PostMapping(\"/login\")\n public ResponseEntity<Map<String, String>> loginUser(@RequestBody User user){\n Map<String, String> result = userService.validateUser(user.getUsername(), user.getPassword());\n if(!result.get(\"status\").equals(\"200\"))\n return new ResponseEntity<>(result, HttpStatus.OK);\n \n User validated_user = userService.getUserByUsername(user.getUsername());\n return new ResponseEntity<>(generateJWTTToken(validated_user), HttpStatus.OK);\n }", "@PostMapping(value = \"/api/login\", consumes = \"application/json\", produces = \"application/json\")\n public StatusJSON verifyLogin(@RequestBody UserJSON userJSON, HttpServletRequest request) {\n\n // check if user exists\n if (userService.userExists(userJSON.getUsername())) {\n\n // username exist, read salt, generate givenHash\n String salt = userService.getUserSalt(userJSON.getUsername());\n String givenHash = BCrypt.hashpw(userJSON.getPassword(), salt);\n\n // verify the user account\n if (userService.canLogin(userJSON.getUsername(), salt, givenHash)) {\n\n // TODO: Should store JWTs in the session rather than just the username.\n userService.setCurrentUser(request, userJSON.getUsername());\n\n return new StatusJSON(true);\n }\n }\n return new StatusJSON(false);\n }", "@Test\n void createUser_validInput_userCreated() throws Exception {\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"Test User\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.ONLINE);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"Test User\");\n userPostDTO.setUsername(\"testUsername\");\n\n given(loginService.createUser(Mockito.any())).willReturn(user);\n\n // when/then -> do the request + validate the result\n MockHttpServletRequestBuilder postRequest = post(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then\n mockMvc.perform(postRequest)\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n }", "@PostMapping(value = \"/login\") \n\t public LoginResponseDto usersLogin(@RequestBody LoginDto loginDto) { \n\t\t LOGGER.info(\"login method\");\n\t\t return userService.usersLogin(loginDto);\n\t }", "boolean doLogin(UserDTO loginUser);", "@RequestMapping(\"/login\")\n\tprivate ResponseEntity<String> login (@RequestParam int id, @RequestParam String password) throws JsonProcessingException {\n\t\t\n\t\tUsers user = u_service.loginUser(id, password);\n\t HttpHeaders responseHeaders = new HttpHeaders();\n\t \n\t if (user == null || !user.getPassword().equals(password)) {\n\t return new ResponseEntity<String>(\"No such userId/password combo\", \n\t responseHeaders, HttpStatus.UNAUTHORIZED);\n\t } else {\n\t responseHeaders.add(\"Content-Type\", \"application/json\");\n\t String json = convertToJson(user);\n\t return new ResponseEntity<String>(json, responseHeaders, HttpStatus.OK); \n\t }\t\t\n\t\t\n\t}", "public void authenticate(LoginRequest loginRequest) {\n\n }", "@Override\n public Response login(User user) {\n\n Response response = new Response();\n User foundUser = userDao.login(user);\n if(foundUser != null &&\n foundUser.getUserId() != null &&\n bCryptPasswordEncoder.matches(user.getPassword(), foundUser.getPassword())) {\n UserDetails userDetails = loadUserByUsername(foundUser.getEmail());\n response.setToken(jwtUtil.generateToken(userDetails));\n response.setUsername(foundUser.getUsername());\n\n return response;\n }\n return null;\n }", "@Test\n public void testInvalidLogin() throws Exception {\n LoginActivity act = Mockito.mock(LoginActivity.class);\n when(act.getEmailText()).thenReturn(\"notAnEmail\");\n when(act.getPasswordText()).thenReturn(\"password\");\n LoginController log = new LoginController(act);\n log.login();\n\n verify(act).showFailedToLoginToast();\n // verify(act, atLeastOnce()).setEmailErrorText();\n // Above can't be tested until externalized strings\n verify(act, never()).showProgressDialog();\n verify(act, never()).finish();\n\n }", "@PostMapping(\"/user/login\")\n public ResponseVo<User> login(@Valid @RequestBody UserLoginForm userLoginForm,\n HttpSession session) {\n\n// if (bindingResult.hasErrors()) {\n// log.info(\"params inconsistent for login, {} {}\",\n// Objects.requireNonNull(bindingResult.getFieldError()).getField(),\n// bindingResult.getFieldError().getDefaultMessage());\n// return ResponseVo.error(ResponseEnum.PARAM_ERROR, bindingResult);\n// }\n\n ResponseVo<User> userResponseVo = userService.login(userLoginForm.getUsername(), userLoginForm.getPassword());\n\n session.setAttribute(MallConst.CURRENT_USER, userResponseVo.getData());\n log.info(\"/login sessionId={}\", session.getId());\n\n return userResponseVo;\n }", "@OnClick(R.id.signInButton)\n void signInButtonClick(){\n String userName = userNameEditText.getText().toString();\n String password = passwordEditText.getText().toString();\n\n UserModel userModel = new UserModel(userName, password);\n\n ApiInterface apiInterface = RetrofitApiClient.getClient().create(ApiInterface.class);\n Call<ResponseModel> call = apiInterface.loginToServer(userModel);\n call.enqueue(new Callback<ResponseModel>() {\n @Override\n public void onResponse(Call<ResponseModel> call, Response<ResponseModel> response) {\n Logger.d(\"Raw Response: \" + response.raw());\n\n if(response.code()==200){\n\n ResponseModel responseModel = response.body();\n Toast.makeText(getApplicationContext(), responseModel.getMessage(), Toast.LENGTH_LONG).show();\n\n if(responseModel.isSuccess()) { // user name and password is correct\n startActivity(new Intent(getApplicationContext(), MyIpActivity.class));\n finish(); // finish LoginActivity\n }\n\n } else\n Toast.makeText(getApplicationContext(), \"Error: \" + response.message(), Toast.LENGTH_LONG).show();\n\n }\n\n @Override\n public void onFailure(Call<ResponseModel> call, Throwable t) {\n Logger.d(\"Failed: \" + t.getMessage());\n Toast.makeText(getApplicationContext(), t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "@Test\n\tpublic void performRequestValidation() throws Exception {\n\n\t\tString responseBody = TestUtils.getValidResponse();\n\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tResponseEntity<ResponseWrapper> responseEntity = prepareReponseEntity(responseBody);\n\n\t\t\tthis.mockServer.verify();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Service\npublic interface LoginService {\n\n Map validateCode(HttpServletRequest request,String userEmail);\n}", "boolean userLogin(UserDTO user) throws UserException, Exception;", "@Test\n\tpublic void testVerifyUser() {\n\t\tLogin login = new Login(\"unique_username_78963321864\", \"unique_password_8946531846\");\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//verify the user\n\t\tString resource = \"verify_user\";\n\t\tString requestType = \"POST\";\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(login, MediaType.APPLICATION_JSON));\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t}", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "@PostMapping(\"/login\")\n public ResponseEntity<Object> login( @RequestParam(\"username\") String username, @RequestParam(\"password\") String password) { \n \tif(!username.isEmpty() && !password.isEmpty()) {\n \t\tString token = authenticationService.login(username, password);\n \t\tif(!token.isEmpty()) {\n \t\t\treturn new ResponseEntity<>(token,HttpStatus.OK);\n \t\t}else {\n \t\t\treturn new ResponseEntity<>(\"Credenziali errate!\",HttpStatus.UNAUTHORIZED); \t\t\t\n \t\t}\n \t}else {\n \t\treturn new ResponseEntity<>(\"Dati mancanti\",HttpStatus.BAD_REQUEST);\n \t}\n }", "public LoginFailureResponse loginFailureCall(HttpHeaders httpHeaders, HttpServletRequest req) {\n\t\t\n\t\tlogger.info(\"AuthenticationBO.loginFailureCall::::::::Start\");\n\t\tLoginFailureResponse loginFailureResponse = new LoginFailureResponse();\n\t\tString ldapNoUserInLDAP = null;\n\t\tString ldapCustomLockOutFlag = null;\n\t\tString ldapInvalidLoginCount = null;\n\t\tString uid = null;\n\t\tString uuid = null;\n\t\tint failureCount = 0;\n\t\tint customLockOutValue = 0;\n\t\t\n\t\tint oamMaxInvalidLoginCount = DEFAULT_OAM_MAX_INVALID_LOGIN_COUNT;\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t//If a configured value exists for max invalid login count, it will pickup from environment properties file else defaults to 5\n\t\t\tif(null != envMessageReader){\n\t\t\t\t if(StringUtils.isNotBlank(envMessageReader.getMessage(OAM_MAX_INVALID_LOGIN_COUNT_FROM_ENV_PROP))\n\t\t\t\t\t\t && getValueAsInteger(envMessageReader.getMessage(OAM_MAX_INVALID_LOGIN_COUNT_FROM_ENV_PROP)) > 0) {\n\t\t\t\t\t oamMaxInvalidLoginCount = getValueAsInteger(envMessageReader.getMessage(OAM_MAX_INVALID_LOGIN_COUNT_FROM_ENV_PROP));\n\t\t\t\t }\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Error in getting configured invalid login count, thus defaulted its value to [{}] Error:{}\" , oamMaxInvalidLoginCount, ex.getLocalizedMessage());\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t\n\t\t\tMultivaluedMap<String, String> requestHeadersMap = httpHeaders.getRequestHeaders();\n\t\t\t\n\t\t\tlogger.info(\"loginFailureCall(...) >>>>>>>>>>>>>>> Headers <<<<<<<<<<<<<<\");\n\t\t\tif(null != requestHeadersMap && requestHeadersMap.size() > 0) {\n\t\t\t\tfor(String headerName : requestHeadersMap.keySet()) {\n\t\t\t\t\tlogger.info(\"loginFailureCall(...) >> Header Name [{}] Header Value[{}]\", headerName, requestHeadersMap.getFirst(headerName));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.info(\"No headers received.\");\n\t\t\t}\n\t\t\tlogger.info(\"loginFailureCall(...) >>>>>>>>>>>>>>> Cookies <<<<<<<<<<<<<<\");\n\t\t\tMap<String, Cookie> cookies = httpHeaders.getCookies();\n\t\t\tif(null != cookies && cookies.size() > 0) {\n\t\t\t\tfor(String cookieName : cookies.keySet()) {\n\t\t\t\t\tlogger.info(\"loginFailureCall(...) >> Cookie Name [{}] Cookie Value[{}]\", cookieName, cookies.get(cookieName).getValue());\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Reading required Header (or Cookie) from SiteMinder for Login Failure \n\t\t\tuid = readValueFromHeaderOrCookie(httpHeaders, UID_HEADER);\n\t\t\tuuid = readValueFromHeaderOrCookie(httpHeaders, UNIQUEID_HEADER);\n\t\t\tldapNoUserInLDAP = readValueFromHeaderOrCookie(httpHeaders, NOUSERLDAP_HEADER);\n\t\t\tldapCustomLockOutFlag = readValueFromHeaderOrCookie(httpHeaders, SM_SSO_LOCKEDFLAG);\n\t\t\tcustomLockOutValue = getValueAsInteger(ldapCustomLockOutFlag);\n\t\t\tldapInvalidLoginCount = readValueFromHeaderOrCookie(httpHeaders, SM_SSO_FAILURECOUNT);\n\t\t\tfailureCount = getValueAsInteger(ldapInvalidLoginCount);\n\t\t\tlogger.info(\"loginFailureCall(...) \"\n\t\t\t\t\t+ \"uid[{}] \"\n\t\t\t\t\t+ \"uuid[{}]\"\n\t\t\t\t\t+ \"noUserInLDAP[{}] \"\n\t\t\t\t\t+ \"SSO_LOCKEDFLAG[{}] \"\n\t\t\t\t\t+ \"customLockOutValue[{}] \"\n\t\t\t\t\t+ \"SSO_FAILURECOUNT[{}] failureCount :[{}]\", uid, uuid, ldapNoUserInLDAP, ldapCustomLockOutFlag, customLockOutValue, ldapInvalidLoginCount, failureCount);\n\t\t\t\n\t\t\tlogger.debug(\"::::::::::::::::Calling the LDAP:::::::::::::::::::\");\t\t\t\n\t\t\t//Setting various error codes based on the SiteMinder Header (or Cookie) values to send back to the caller \n\t\t\tloginFailureResponse.setResultCode(RESULT_CODE_EXCEPTION_FAILURE);\n\t\t\tif(StringUtils.isEmpty(uid) ) {\n\t\t\t\tloginFailureResponse.setResultDescription(USER_NOT_FOUND_ERROR_CODE);\n\t\t\t\tloginFailureResponse.setErrorCode(MSG_USER_NOT_FOUND);\n\t\t\t\tlogger.info(\"User ID[{}] >> User Not Found in LDAP\", uid);\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tAttributes attrs = ldapHelper.getLdapUserinfo(uid);\n\t\t\t\t\n\t\t\t\tString customLockedOut = ldapHelper.getUserAttrValue(attrs, \"customLockOut\");\n\t\t\t\tlogger.info(\"::::::::::::::::checking lockedout status:::::::::::::::::::{}\"\n\t\t\t\t\t\t, customLockedOut);\n\t\t\t\t\n\t\t\t\tfailureCount = getValueAsInteger(ldapHelper.getUserAttrValue(attrs, \"invalidlogincount\"));\n\t\t\t\t\n\t\t\t\tif(org.apache.commons.lang3.StringUtils.isNotEmpty(customLockedOut) && Integer.parseInt(customLockedOut) > 0 ) {\n\t\t\t\t\tfailureCount++;\n\t\t\t\t\tlogger.info(\"User ID[{}] >> User Account is in Locked state. Error code sent back is:[MSG_LOCKED]\",uid);\n\t\t\t\t\tloginFailureResponse.setResultDescription(USER_LOCKEDOUT_STATUS_ERROR_CODE);\n\t\t\t\t\tloginFailureResponse.setErrorCode(MSG_LOCKED_ERROR_CODE);\n\t\t\t\t\tloginFailureResponse.setInvalidLoginCount(failureCount+\"\");\n\t\t\t\t\tsynchronizeLDAP(GME_RES_COMPANY_CODE, uid, LDAP_ORG_GME, (failureCount+\"\"), req);\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t// Update failureCount to 1 if its actual value recived from LDAP is greater or equal to 4. \n\t\t\t\t\t// This is required to for the scenario where user tried 6th time but SiteMinder sends \n\t\t\t\t\t// SSO_LOCKEDFLAG=0 with actual failure count\n\t\t\t\t\t// Note: SiteMinder unlocks user after 24 hours i.e. the header SSO_LOCKEDFLAG=0 (LDAP Attribute = CustomLockOutFlag') \n\t\t\t\t\t//---------------------------\n\t\t\t\t\t//failureCount = (failureCount >= (oamMaxInvalidLoginCount - 1) ? 1 : ++failureCount);\n\t\t\t\t\tfailureCount++;\n\t\t\t\t\tlogger.info(\"failureCount in else :{}\",failureCount);\n\t\t\t\t\tif ( failureCount > oamMaxInvalidLoginCount) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogger.info(\"Inside failureCount greater than oamMaxInvalidLoginCount\" );\n\t\t\t\t\t\tloginFailureResponse.setResultDescription(CREDENTIALS_MISMATCH_ERROR_CODE);\n\t\t\t\t\t\tloginFailureResponse.setErrorCode(MSG_BAD_LOGIN_ERROR_CODE);\n\t\t\t\t\t\tloginFailureResponse.setResultCode(String.valueOf(\"1\"));\n\t\t\t\t\t\tloginFailureResponse.setInvalidLoginCount(\"1\");\n\t\t\t\t\t\tsynchronizeLDAP(GME_RES_COMPANY_CODE, uid, LDAP_ORG_GME, (String.valueOf(1)), req);\n\t\t\t\t\t} else if(failureCount < (oamMaxInvalidLoginCount-1)) {\n\t\t\t\t\t\tlogger.info(\"User ID[{}] >> Invalid Credentials. Failure Count is [{}] Error code sent back is:[MSG_BAD_LOGIN]\",uid, failureCount);\n\t\t\t\t\t\tloginFailureResponse.setResultDescription(CREDENTIALS_MISMATCH_ERROR_CODE);\n\t\t\t\t\t\tloginFailureResponse.setErrorCode(MSG_BAD_LOGIN_ERROR_CODE);\n\t\t\t\t\t\tloginFailureResponse.setInvalidLoginCount(String.valueOf(failureCount));\n\t\t\t\t\t\tloginFailureResponse.setResultCode(String.valueOf(failureCount));\n\t\t\t\t\t\tsynchronizeLDAP(GME_RES_COMPANY_CODE, uid, LDAP_ORG_GME, (String.valueOf(failureCount)), req);\n\t\t\t\t\t} else if(failureCount == (oamMaxInvalidLoginCount-1)) {\n\t\t\t\t\t\tlogger.info(\"User ID[{}] >> Invalid Credentials. Account is about to Lock. Failure Count is [{}] Error code sent back is:[MSG_LOCK_PENDING]\", uid, failureCount);\n\t\t\t\t\t\tloginFailureResponse.setResultDescription(CREDENTIALS_MISMATCH_ERROR_CODE);\n\t\t\t\t\t\tloginFailureResponse.setErrorCode(MSG_LOCK_PENDING_ERROR_CODE);\n\t\t\t\t\t\tloginFailureResponse.setInvalidLoginCount(String.valueOf(failureCount));\n\t\t\t\t\t\tsynchronizeLDAP(GME_RES_COMPANY_CODE, uid, LDAP_ORG_GME, (String.valueOf(failureCount)), req);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"Exception occured in loginFailureCall(...). Error is :{}\" ,ex.getMessage());\n\t\t\tloginFailureResponse.setResultDescription(USER_LOCKEDOUT_UNKNOWN_ERROR_CODE);\n\t\t\tloginFailureResponse.setErrorCode(MSG_EXCEPTION_ERROR_CODE);\n\t\t}\n\t\t\n\t\tlogger.info(\"AuthenticationBO.loginFailureCall::::::::End\");\n\t\treturn loginFailureResponse;\n\t}", "@PostMapping(\"/login\")\n public ResponseEntity<User> login(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the login parameters from the post request\n String login = request.getParameter(\"login\");\n String pass = request.getParameter(\"pass\");\n\n // send an HTTP 422 response if either parameter is missing or empty\n if (login == null || login.isEmpty() || pass == null || pass.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // get the user by userName and password\n User user = userRepo.findByUserNameAndPassword(login, pass);\n\n // if it could not find by using a username, try using an email instead\n if (user == null) {\n user = userRepo.findByEmailAndPassword(login, pass);\n\n // send an HTTP 401 response, if no user exists for provided login info\n if (user == null) {\n return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(null);\n }\n }\n\n // create a new session for the User\n session = request.getSession();\n session.setAttribute(\"user\", user.getUserName());\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user.getUserName()));\n\n // send an HTTP 200 response with the session user\n return ResponseEntity.ok(user.asSessionUser());\n }", "@Test\n public void testDoLogin() {\n System.out.println(\"doLogin\");\n String username = \"AECobley\";\n String password = \"Cassandraisbae\";\n LoginModel instance = new LoginModel();\n String[] expResult = null;\n String[] result = instance.generalLogin(username, password);\n LoginModel loginModel = new LoginModel();\n \n assertNotNull(\"= Pass\",loginModel.generalLogin(username,password));\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"Login Failed\");\n }", "@Test\n\tpublic void testAuthenticateUserOK() {\n\t\tgiven(userRepository.findByLogin(anyString())).willReturn(new UserBuilder(USER_RETURNED).build());\n\n\t\t// make the service call\n\t\ttry {\n\t\t\tassertThat(authService.authenticateUser(USER)).isEqualTo(USER_RETURNED);\n\t\t} catch (Exception e) {\n\t\t\tfail(\"Error testing authenticateUser: \" + e.getMessage());\n\t\t}\t\n\t}", "public interface LoginResponse {\n\tpublic static final String IS_VALID = \"isValid\";\n\tpublic static final String ERROR_CODE = \"errorCode\";\n\tpublic static final String ERROR_MESSAGE = \"errorMessage\";\n\n\tpublic boolean isValid();\n\tpublic String authToken();\n\tpublic int errorCode();\n\tpublic String errorMessage();\n\tpublic User user();\n}", "@Override\n\tpublic void validateHeader(RequestEntity<? extends LoginRequest> request) throws ApiException {\n\t\t\n\t}", "@PostMapping(\"/loginUser\")\n\tpublic ResponseEntity<?> loginUser(@RequestBody User user, HttpSession hs) {\n\n\t\ttry {\n\t\t\tUser validUser = userService.loginUser(user.getEmailId(), user.getPassword());\n\t\t\ths.setAttribute(\"validUser\", validUser);\n\t\t\treturn new ResponseEntity<User>(validUser, HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\t// e.printStackTrace();\n\t\t\tthrow new UserNotFoundException(\"user not found\");\n\t\t}\n\t\t// return new ResponseEntity<String>(\"login failed\",HttpStatus.UNAUTHORIZED);\n\n\t}", "@PostMapping(value = \"login\")\n public ResponseEntity<AccountDto> login(@RequestBody final AuthenticationRequestDto authenticationRequestDto)\n throws LoginException {\n final AccountDto resultAccountDto = authenticationService.login(authenticationRequestDto);\n log.debug(\"Login - The API with body request [{}] has been consumed successfully\", authenticationRequestDto);\n return new ResponseEntity<>(resultAccountDto, HttpStatus.OK);\n }", "@ApiOperation(value = \"Login with userName and password\", response = UserDto.class)\n\t@ApiResponses(value = { @ApiResponse(code = 200, message = UserApplicationConstants.SUCCESS),\n\t\t\t@ApiResponse(code = 404, message = UserApplicationConstants.USER_NOT_FOUND) })\n\t@PostMapping(value = \"/login\")\n\tpublic ResponseEntity<UserResponseWrapper<UserDto>> loginUser(@Valid @RequestBody LoginDto loginDto) {\n\t\treturn new ResponseEntity<UserResponseWrapper<UserDto>>(\n\t\t\t\tnew UserResponseWrapper<UserDto>(UserResponseStatus.SUCCESS, userService.login(loginDto)),\n\t\t\t\tHttpStatus.OK);\n\t}", "@RequestMapping(value = \"/authenticate\", method = RequestMethod.POST)\r\n public ResponseEntity<User> login(@RequestBody User user) {\r\n\t\tlogger.info(\"Authenticate user:\"+ user);\r\n\t\t\r\n\t\t// logger.debug(\"users=\"+userService.findAllUsers() );\r\n\t\t\r\n\t\tUser dbUser = userService.findByUserName( user.getUsername() );\r\n\r\n\t\tif (dbUser != null) {\r\n\t\t\tlogger.debug(\"Start authenticate User with username [{}].\", user.getUsername() );\r\n\t\t\t//logger.debug(\"dbUser.getPassword() = \" + dbUser.getPassword() );\r\n\t\t\t//logger.debug(\"user.getPassword() = \" + user.getPassword() );\r\n\t\t\tif ( dbUser.getPassword() != null ) {\r\n\t\t\t\t//String encryptedPasword = bCryptPasswordEncoder.encode( user.getPassword() );\r\n\t\t\t\t//logger.debug(\"encryptedPasword = \" + encryptedPasword );\r\n\t\t\t\tif ( bCryptPasswordEncoder.matches( user.getPassword(), dbUser.getPassword())) {\t\t\t\t\r\n\t\t\t\t//if ( dbUser.getPassword().equals( encryptedPasword ) ) { // this won't work, not same\r\n\t\t\t\t\tlogger.info(\"User with username {} authenticated.\", user.getUsername() );\r\n\t\t\t\t\treturn new ResponseEntity<User>(dbUser, HttpStatus.OK);\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\tlogger.warn(\"Unable to authenticate. Username [{}] or password incorrect.\", user.getUsername() );\r\n\t\t// json client side not handled status 401 with message pass\r\n\t\treturn new ResponseEntity(new CustomErrorType(\"Unable to authenticate. Username or password incorrect.\"),\r\n\t\t\t\tHttpStatus.UNAUTHORIZED);\r\n\t\t\r\n\t\t//return new ResponseEntity(new CustomErrorType(\"Unable to authenticate. Username or password incorrect.\"),\r\n\t\t//\t\tHttpStatus.OK);\r\n\t\t\r\n\t\t\r\n\t}", "private static String doLogin(Request req, Response res) {\n HashMap<String, String> respMap;\n \n res.type(Path.Web.JSON_TYPE);\n \n \n\t String email = Jsoup.parse(req.queryParams(\"email\")).text();\n \n logger.info(\"email from the client = \" + email);\n \n if(email != null && !email.isEmpty()) { \n \n\t server = new SRP6JavascriptServerSessionSHA256(CryptoParams.N_base10, CryptoParams.g_base10);\n\t \t\t\n\t gen = new ChallengeGen(email);\n\t\t\n\t respMap = gen.getChallenge(server);\n \n if(respMap != null) {\n\t\t logger.info(\"JSON RESP SENT TO CLIENT = \" + respMap.toString());\n res.status(200);\n respMap.put(\"code\", \"200\");\n respMap.put(\"status\", \"success\");\n return gson.toJson(respMap);\n }\n }\n respMap = new HashMap<>();\n \n res.status(401);\n respMap.put(\"status\", \"Invalid User Credentials\");\n respMap.put(\"code\", \"401\");\n logger.error(\"getChallenge() return null map most likely due to null B value and Invalid User Credentials\");\n \treturn gson.toJson(respMap);\n}", "@Override\n\tpublic DataResponse<LoginResponseVo> login(LoginRequestVo loginRequestVo) {\n\t\tDataResponse<LoginResponseVo> dataResponse = new DataResponse<LoginResponseVo>();\n\t\tif (StringUtils.isEmpty(loginRequestVo.getUsername()) || StringUtils.isEmpty(loginRequestVo.getPassword())) {\n\t\t\tdataResponse.setDataStatus(DataStatus.BUSINESS_ERROR);\n\t\t\tdataResponse.setNotes(\"用户名或密码不能为空!\");\n\t\t\treturn dataResponse;\n\t\t}\n\t\tSysUser user = new JPAQuery<SysUser>(em).from(qSysUser)\n\t\t\t\t.where(qSysUser.username.eq(loginRequestVo.getUsername())).fetchOne();\n\t\tif (null == user) {\n\t\t\tdataResponse.setDataStatus(DataStatus.BUSINESS_ERROR);\n\t\t\tdataResponse.setNotes(\"用户名或者密码错误!\");\n\t\t\tlog.warn(\"{}用户名不存在!\", loginRequestVo.getUsername());\n\t\t\treturn dataResponse;\n\t\t}\n\n\t\tif (!validatePassword(loginRequestVo.getPassword(), user.getPassword())) {\n\t\t\tdataResponse.setDataStatus(DataStatus.BUSINESS_ERROR);\n\t\t\tdataResponse.setNotes(\"用户名或者密码错误!\");\n\t\t\tlog.warn(\"{}用户名或者密码错误!\", loginRequestVo.getUsername());\n\t\t\treturn dataResponse;\n\t\t} else {\n\t\t\tLoginResponseVo vo = new LoginResponseVo();\n\t\t\tvo.setUserId(user.getId());\n\t\t\tvo.setUserName(user.getUsername());\n\t\t\tfinal String userIdentity = jwtTokenUtil.generateToken(user.getId());\n\t\t\tvo.setUserId(userIdentity);\n\t\t\tdataResponse.setResponse(vo);\n\t\t\treturn dataResponse;\n\t\t}\n\t}", "@Override\n public ActionForward execute(ActionMapping mapping, ActionForm form,\n HttpServletRequest request, HttpServletResponse response)\n throws Exception {\n LoginForm formBean=(LoginForm)form;\n UserService ser = new UserService();\n \n String name = formBean.getUser();\n String pass = formBean.getPass();\n \n if ((name == null) || pass == null || name.equals(\"\") || pass.equals(\"\")) { \n if(ser.Validate(formBean)==false){\n formBean.setError();\n return mapping.findForward(FAILURE);\n }\n \n }\n\n return mapping.findForward(SUCCESS);\n \n }", "public F.Promise<Result> handleSignIn() {\n final Form<LogIn> filledForm = logInForm.bindFromRequest();\n if (customerService().isLoggedIn()) {\n return asPromise(redirect(controllers.routes.HomeController.home()));\n } else if (filledForm.hasErrors()) {\n flash(\"error\", \"Login form contains missing or invalid data.\");\n return asPromise(badRequest(loginView.render(data().build(), filledForm)));\n } else {\n return handleSignInWithValidForm(filledForm);\n }\n }", "@Test\n public void testLogin() {\n System.out.println(\"doLogin\");\n String username = \"AECobley\";\n String password = \"Cassandra\";\n LoginModel instance = new LoginModel();\n String[] expResult = null;\n String[] result = instance.generalLogin(username, password);\n LoginModel loginModel = new LoginModel();\n assertNull(\"= fail\",loginModel.generalLogin(username,password));\n // TODO review the generated test code and remove the default call to fail.\n //fail(\"Login Succeeded with wrong details\");\n }", "@RequestMapping(value=\"/loginValidation\")\r\npublic String validation(@RequestParam(\"userid\") String userid,@RequestParam(\"password\") String password)\r\n{\r\n\t//getting all credentials from user table\r\n\tList<User> listUser=userService.getAllCreds();\r\n\tboolean flag = false;\r\n\t\r\n\t//checking whether the user is valid or not\r\n\tfor(User u: listUser) {\r\n\t\tif(u.getUserId().equals(userid) && u.getPassword().equals(password)) {\r\n\t\t\tflag=true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(flag)\r\n\t{\r\n\t\t//if creds are valid it will redirect to usertype page\r\n\t\treturn \"usertype\";\r\n\t }\r\n\telse\r\n\t{\r\n\t\t//if creds are invalid it will redirect to loginfailure page\r\n\t\treturn \"loginfailure\";\t \r\n }\r\n}", "@Test\n public void testPostCustomersLoginAction() throws ClientException, IOException, ProcessingException {\n CloudResponse response = this.actions.postCustomersLoginAction(\"{email}\", \"{password}\", \"{anonymousCartId}\");\n List<Integer> expectedResults = Arrays.asList(200, 400);\n LOG.info(\"Got status {}\", response.getStatusLine());\n Assert.assertTrue(expectedResults.contains(response.getStatusLine().getStatusCode()));\n\n if(response.getStatusLine().getStatusCode() == 200) {\n this.actions.checkResponseJSONSchema(\"#/definitions/LoginResult\", response.getContent());\n }\n if(response.getStatusLine().getStatusCode() == 400) {\n this.actions.checkResponseJSONSchema(\"#/definitions/ErrorResponse\", response.getContent());\n }\n \n }", "@RequestMapping(value = \"/loginValidation\", method = RequestMethod.POST, produces = \"text/html;charset=UTF-8\" )\r\n\t@ResponseBody\r\n\tpublic String loginValidation(@Validated User user, BindingResult result, HttpSession session){\n\t\tString msg;\r\n\t\tif(result.hasErrors()){\r\n\t\t\tFieldError fe = result.getFieldErrors().get(0);\r\n\t\t\t//resultMap.put(\"result\", fe.getDefaultMessage());\r\n\t\t\tmsg = fe.getDefaultMessage();\r\n\t\t}else{\r\n\t\t\t//resultMap.put(\"result\", \"success\");\r\n\t\t\tmsg = \"success\";\r\n\t\t\tIDgenerator++;\r\n\t\t\tsession.setAttribute(\"SessionID\", IDgenerator);\r\n\t\t}\r\n\t\t//return resultMap;\r\n\t\treturn msg;\r\n\t}", "@PostMapping(value = \"/userslogin\")\n\tpublic <T> ResponseEntity<?> loginProcess(@RequestBody User user) {\n\t\tLoginResponse loginResponse = new LoginResponse();\n\t\ttry {\n\t\t\t\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tloginResponse = userDelegate.login(user);\n\t\t\treturn responseUtil.successResponse(loginResponse);\t\t\n\t\t}\n\t\tcatch(ApplicationException e){\t\n\t\t\treturn responseUtil.errorResponse(e);\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void testLogin() {\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\tHttpEntity<String> entity = new HttpEntity<String>(null, headers);\n\t\tResponseEntity<String> response = restTemplate.exchange(getRootUrl() + \"/login\",HttpMethod.GET, entity, String.class);\n\t\tassertEquals(200, response.getStatusCodeValue());\n\t}", "@RequestMapping(value=\"/login/{username}/{password}\")\n @ResponseBody\n public boolean login(@PathVariable String username, @PathVariable String password){\n return customUserDetailsService.login(username, password);\n\n }", "@PostMapping(path = \"userLogind/\")\n public ResponseEntity<passConfirmation> getUserByEmail(@RequestBody userAccount account){\n String passwordByUser = accountRepo.getPasswordByUsername(account.getUsername());\n// System.out.println(\"****************************************\");\n// System.out.println(\"pass:\"+account.getPassword());\n// System.out.println(\"passfromdb:\"+ passwordByEmail);\n if (account.getPassword().toString().equals(passwordByUser)){\n passConfirmation confirmationOK = new passConfirmation(\"Confirmed\");\n return ResponseEntity.ok().body(confirmationOK);\n }else{\n passConfirmation confirmationDenied = new passConfirmation(\"Denied\");\n return ResponseEntity.ok().body(confirmationDenied);\n }\n }", "@Test\n public void shouldReturnUserCabinetViewAndSessionWithExpectedAttributes_whenPassRequest() throws Exception\n {\n Principal principal = Mockito.mock(Principal.class);\n Mockito.when(principal.getName()).thenReturn(\"login\");\n List<Order> expectedResult = Collections.singletonList(new Order());\n MockHttpSession session = new MockHttpSession();\n Mockito.when(userServiceMock.getUsersOrders(\"login\"))\n .thenReturn(expectedResult);\n mockMvc.perform(MockMvcRequestBuilders.get(\"/user\").session(session).principal(principal))\n .andExpect(MockMvcResultMatchers.view().name(\"user_cabinet\"));\n Assert.assertNotNull(session.getAttribute(\"usersOrders\"));\n }", "@Test\n\tpublic void loginWithValidCredentials(){\n\t\tapp.loginScreen().waitUntilLoaded();\n\t\tapp.loginScreen().logIn(Credentials.USER_VALID.username, Credentials.USER_VALID.password);\n\t\tassertTrue(app.userDashboardScreen().isActive());\n\t}", "@PostMapping(value = \"/getLoginProperties\", consumes = MediaType.APPLICATION_JSON_VALUE, \n\t\t\tproduces = MediaType.APPLICATION_JSON_VALUE)\n\tpublic RestResponse<LoginProperties> getLoginProperties()\n\t{\n\t\tRestResponse<LoginProperties> restResponse = new RestResponse<>(SUCCESS);\n\t\ttry {\n\t\t\tLoginProperties userlogin = userCreationService.getLoginProperties();\n\t\t\trestResponse.setResult(userlogin);\n\t\t}catch(Exception e) {\n\t\t\tLOG.error(\"Exception : \", e);\n\t\t}\t\t\n\t\treturn restResponse;\n\t}", "@PostMapping(value = \"/login\", headers = {\"content-type=application/x-www-form-urlencoded\"})\n\tpublic ResponseEntity<UserDTO> login(WebRequest request){\n\t\t\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\t\n\t\tUser user = userService.findByUsername(username);\n\t\tif(user == null) {\n\t\t\t//ovo glumi token i ide u session local storage\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.NOT_FOUND);\n\t\t}else if(user.getPassword().equals(password)) {\n\t\t\treturn new ResponseEntity<UserDTO>(new UserDTO(user), HttpStatus.OK);\n\t\t}else {\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.UNAUTHORIZED);\n\t\t}\n\t\t\n\t\t\n\t}", "public void testLogin() throws Exception {\n super.login();\n }", "public ResponseEntity<?> authenticateUser(LoginRequest loginRequest){\n if (loginRequest.getIsTeacher() == 1){\n return teacherService.authenticateTeacher(loginRequest);\n }else {\n return studentService.authenticateStudent(loginRequest);\n }\n }", "@PostMapping(\"/login\")\n\t\tpublic String ValidateLoggedInUser(ModelMap model,@RequestParam String phno_mail,@RequestParam String password) {\n\t\t\tSystem.out.println(phno_mail + password);\n\t\t\t\tif(service.isValideUser(model,phno_mail, password)) {\n\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Valid\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\treturn \"home\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmodel.put(\"Message\",\"Invalid Phoneno or Password\");\n\t\t\t\treturn \"LoginOrRegister\";}\n\t\t\t\n\t\t\t\t\n\t\t}", "public CredentialValidationResult validate(UsernamePasswordCredential unpc){\r\n \r\n \r\n return null;\r\n}", "public AuthToken loginUser(){\n return null;\n }", "@Test\n public void testFailedLogin() throws Exception {\n when(failedLoginActivity.getEmailText()).thenReturn(EMAIL);\n when(failedLoginActivity.getPasswordText()).thenReturn(PASSWORD + \"b\");\n LoginController l = new LoginController(failedLoginActivity);\n l.login();\n verify(failedLoginActivity).showProgressDialog();\n Thread.sleep(3000); // Giving Auth three seconds to log-in before checking if it worked.\n verify(failedLoginActivity).stopProgressDialog();\n verify(failedLoginActivity).showFailedToLoginToast();\n Mockito.verify(failedLoginActivity, never()).finish(); // Activity shouldn't have been called to finish\n }", "@Override\n public void doLogin(String userName, String password, final RequestResultListener requestResultListener) {\n\n initApiService();\n\n apiService.token(\"password\", userName, password).enqueue(new Callback<Response4Login>() {\n @Override\n public void onResponse(Call<Response4Login> call, Response<Response4Login> response) {\n if (response.isSuccessful()) {\n requestResultListener.onSuccess(response);\n } else {\n requestResultListener.onUnSuccess(response);\n }\n }\n\n @Override\n public void onFailure(Call<Response4Login> call, Throwable t) {\n requestResultListener.onFail();\n }\n });\n\n\n }", "RestaurantDto loginRestaurant(RestaurantDto restaurant);", "@Test\n\tpublic void loginWithInvalidCredentials(){\n\t\tapp.loginScreen().waitUntilLoaded();\n\t\tapp.loginScreen().logIn(Credentials.USER_INVALID.username, Credentials.USER_INVALID.password);\n\t\tassertTrue(app.loginScreen().isActive());\n\t}", "@Override\n public String logIn(){\n String email = getUserEmail();\n String password = getUserPassword();\n \n if (email.isEmpty() || password.isEmpty()){\n setDisplayError(Color.RED, \"Empty Credentials!\");\n }\n else { \n String sql = \"SELECT * FROM registered_user Where email = ? and password = ?\";\n \n try {\n preparedStatement = conn.prepareStatement(sql);\n preparedStatement.setString(1, email);//1 states that the 1st parameter is email\n preparedStatement.setString(2, password);//2 stated that the 2nd parameter is password\n resultSet = preparedStatement.executeQuery();\n \n if (!resultSet.next()) //If the rows doesn't exist\n setDisplayError(Color.RED, \"Incorrect Email or Password\");\n else{\n status = \"Success\";\n setDisplayError(Color.GREEN, \"Successfull login... Redirecting...\");\n } \n } catch (SQLException ex) {\n System.out.println(\"In the LoginController 1st try part \" + ex.getMessage());\n } finally {\n //closing the prepared statement to prevent the SQL injection\n try {\n if (preparedStatement != null ) {\n preparedStatement.close();\n conn.close();\n } \n } catch (SQLException sQLException) {\n System.out.println(sQLException.getMessage());\n status = \"Exception\";\n } \n \n //closing the connection\n try {\n if (conn != null) {\n conn.close();\n }\n } catch (SQLException sQLException) {\n System.out.println(sQLException.getMessage());\n }\n }\n }\n \n return status; \n }", "private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }", "@ApiOperation(value = \"카카오로그인\", response = User.class)\n\t@PostMapping(\"/login\")\n\t public ResponseEntity<User> login(@RequestBody String accessToken) {\n\t \n\t int indexsame = 0;\n\t indexsame= accessToken.indexOf(\"=\");\n\t String token = accessToken.substring(indexsame+1, accessToken.length());\n\t HashMap<String,Object>userInfo =kakao.getUserInfo(token);\n\t User loginuser=new User();\n\t String id;\n\t String nickname;\n\t Object temp;\n\t if(userInfo!=null) {\n\t temp= userInfo.get(\"id\");\n\t temp=temp+\"\";\n\t id= temp+\"kakao.com\";\n\t if(userservice.getUserCount(id)>0) {\n\t User user= new User();\n\t user.setUserId(id);\n\t loginuser=userservice.login(user);\n\t }\n\t else if(userservice.getUserCount(id)==0) {\n\t Random r = new Random();\n\t int dice = r.nextInt(157211)+48271;\n\t String dicesen=Integer.toString(dice);\n\t String pw = dicesen;\n\t loginuser.setUserId(id);\n\t loginuser.setUserPw(pw);\n\t int totalcount=userservice.getTotalCount();\n\t loginuser.setUserName(totalcount+\"\");\n\t nickname= temp+\"\";\n\t loginuser.setUserNickname(nickname);\n\t userservice.insertUser(loginuser);\n\t }\n\t }\n\t return new ResponseEntity<User>(loginuser, HttpStatus.OK);\n\t}", "@RequestMapping(value = \"/authentication-failure\", method = RequestMethod.GET)\n public ResponseEntity<String> apiAuthenticationFailure() {\n return new ResponseEntity<>(\"{\\\"success\\\" : false, \\\"message\\\" : \\\"authentication-failure\\\"}\", getJsonHeaders(), HttpStatus.OK);\n }", "@Test\n\tpublic void testLoginAdminAccountWithInvalidCredentials() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.loginAdminAccount(USERNAME2, PASSWORD1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"Username or password incorrect. Please try again.\", error);\n\t}", "private static Object doAuth(Request req, Response res) {\n \n HashMap<String, String> response = new HashMap<>();\n\t\t \n String email = Jsoup.parse(req.queryParams(\"email\")).text();\n\t\t String password = Jsoup.parse(req.queryParams(\"password\")).text();\n\t\t\n res.type(Path.Web.JSON_TYPE);\n \t\t\n\t\t\n\t\tif(email != null && !email.isEmpty() && password != null && !password.isEmpty() ) {\n \n authenticate = new Authenticate(password);\n\t\t\t//note that the server obj has been created during call to login()\n\t\t\tString M2 = authenticate.getM2(server);\n\t\t\t\n if(M2 != null || !M2.isEmpty()) {\n \n \n\t\t\tSession session = req.session(true);\n\t\t\tsession.maxInactiveInterval(Path.Web.SESSION_TIMEOUT);\n\t\t\tUser user = UserController.getUserByEmail(email);\n\t\t\tsession.attribute(Path.Web.ATTR_USER_NAME, user.getUsername());\n session.attribute(Path.Web.ATTR_USER_ID, user.getId().toString()); //saves the id as String\n\t\t\tsession.attribute(Path.Web.AUTH_STATUS, authenticate.authenticated);\n\t\t\tsession.attribute(Path.Web.ATTR_EMAIL, user.getEmail());\n logger.info(user.toString() + \" Has Logged In Successfully\");\n \n response.put(\"M2\", M2);\n response.put(\"code\", \"200\");\n response.put(\"status\", \"success\");\n response.put(\"target\", Path.Web.DASHBOARD);\n \n String respjson = gson.toJson(response);\n logger.info(\"Final response sent By doAuth to client = \" + respjson);\n res.status(200);\n return respjson;\n }\n\t\t\t\t\n\t\t} \n \n res.status(401);\n response.put(\"code\", \"401\");\n response.put(\"status\", \"Error! Invalid Login Credentials\");\n \n return gson.toJson(response);\n }", "@RequestMapping(value = \"tpos/login/v2\", method = RequestMethod.POST)\r\n\tpublic @ResponseBody ControllerResponse2<Object> logintTposJsonData(HttpServletRequest request,\r\n\t\t\t@RequestBody final Acq_TposLogin_Model model) {\r\n\r\n\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Begin\");\r\n\t\tControllerResponse2<Object> controllerResponse = new ControllerResponse2<Object>();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tValidatorFactory vFactory = Validation.buildDefaultValidatorFactory();\r\n\t\t\tValidator modelValidator = vFactory.getValidator();\r\n\t\t\tSet<ConstraintViolation<Acq_TposLogin_Model>> modelErrors = modelValidator.validate(model);\r\n\t\t\t\r\n\t\t\tif (modelErrors.size() > 0) {\r\n\t\t\t\tString ValidationErrors = \"\";\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\tIterator<ConstraintViolation<Acq_TposLogin_Model>> errorIterator = modelErrors\r\n\t\t\t\t\t\t\t.iterator();\r\n\t\t\t\t\twhile (errorIterator.hasNext()) {\r\n\t\t\t\t\t\tConstraintViolation<Acq_TposLogin_Model> violation = errorIterator.next();\r\n\t\t\t\t\t\tString vErrors = violation.getPropertyPath() + \"-\" + violation.getMessage()+ \"-\"+ violation.getInvalidValue();\r\n\t\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"ValidationError\" + \"::\"\r\n\t\t\t\t\t\t\t\t+ vErrors);\r\n\t\t\t\t\t\tValidationErrors = ValidationErrors + vErrors + \"--\";\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (Exception e) {\r\n\r\n\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Exception in Validation Error Printing\");\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Parameter Validation Failed\");\r\n\r\n\t\t\t\tcontrollerResponse.setStatusCode(Acq_Status_Definations.InvalidParameters.getId());\r\n\t\t\t\tcontrollerResponse.setStatusMessage(Acq_Status_Definations.InvalidParameters.getDescription());\r\n\t\t\t\tcontrollerResponse.setBody(ValidationErrors);\r\n\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Forwarded To Handler\");\r\n\t\t\t\tServiceDto2<Object> daoResponse = loginHanler.loginTposV1(model);\r\n\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Return From Handler\");\r\n\r\n\t\t\t\tif (daoResponse.getStatusCode() == Acq_Status_Definations.Authenticated.getId()) {\r\n\t\t\t\t\t// User Authenticated For Login\r\n\r\n\t\t\t\t\tHttpSession session = request.getSession();\r\n\t\t\t\t\tsession.setAttribute(\"uname\", model.getLoginId());\r\n\t\t\t\t\tsession.setAttribute(\"userid\", daoResponse.getStatusMessage());\r\n\t\t\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Session Created\");\r\n\r\n\t\t\t\t\tcontrollerResponse.setStatusCode(daoResponse.getStatusCode());\r\n\t\t\t\t\tcontrollerResponse.setStatusMessage(daoResponse.getStatusMessage());\r\n\r\n\t\t\t\t\tif (daoResponse.getBody() != null) {\r\n\t\t\t\t\t\tcontrollerResponse.setBody(daoResponse.getBody());\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tcontrollerResponse.setBody(null);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// User Not Authenticated For Login\r\n\t\t\t\t\tcontrollerResponse.setStatusCode(daoResponse.getStatusCode());\r\n\t\t\t\t\tcontrollerResponse.setStatusMessage(daoResponse.getStatusMessage());\r\n\t\t\t\t\tcontrollerResponse.setBody(null);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tlogger.info(\"tpos/login/v1\" + \"::\" + \"Controller\" + \"::\" + \"Unexpected Error\");\r\n\t\t\te.printStackTrace();\r\n\t\t\tcontrollerResponse.setStatusCode(Acq_Status_Definations.UnexpectedServerError.getId());\r\n\t\t\tcontrollerResponse.setStatusMessage(Acq_Status_Definations.UnexpectedServerError.getDescription());\r\n\t\t\tcontrollerResponse.setBody(null);\r\n\t\t}\r\n\t\treturn controllerResponse;\r\n\t}", "@ApiOperation(value=\"Login\", notes=\"Login action\")\n @RequestMapping(value=\"/user/login\",method= RequestMethod.POST)\n @ResponseBody\n public LoginResVO loginHomeconnect(@ApiParam(value = \"account login\", required = true)@RequestHeader(value = \"PlatID\", required = true) String platID,@RequestHeader(value = \"AppID\", required = false) String appID,\n\t\t\t\t\t@RequestHeader HttpHeaders httpHeaders,\n\t\t\t\t\t@RequestBody(required = false) LoginReqVO body,HttpServletResponse response){\n\tString url = \"/api/translator/user/login\";\n\tLoginResVO result = new LoginResVO(RetObject.fail());\n\tMap<String,String> headerMap = new HashedMap();\n\theaderMap.put(\"PlatID\", platID);\n\theaderMap.put(\"AppID\", appID);\n\tString headers = getJSONString(headerMap);\n\tString bodyText = getJSONString(body);\n\tError headerError = validateHeaders(platID,appID);\n\tError bodyError = validateLoginBodyError(body);\n\tif ( bodyError == null && headerError == null){\n\t\tresponse.addHeader(\"AccessToken\",\"12345678\");\n\t\tresult = new LoginResVO();\n\t}\n\treturn result;\n}", "User loginUser(User userLoginRequest, HttpSession httpSession) throws Exception;", "@RestApi\npublic interface SecurityApi {\n\n /**\n * 校验图片验证码是否正确\n *\n * @param captchaCode\n * @param captchaCodeRedisKey\n * @return\n */\n @RequestMapping(\"/inner/securityApi/validateCaptchaCode/{captchaCode}/{captchaCodeRedisKey}\")\n Result<Boolean> validateCaptchaCode(@PathVariable String captchaCode, @PathVariable String captchaCodeRedisKey);\n\n /**\n * 获取图片验证码\n *\n * @param response\n * @return\n */\n @RequestMapping(\"/securityApi/getCaptcha\")\n Result<byte[]> getCaptcha(HttpServletRequest request, HttpServletResponse response);\n\n /**\n * 获取手机验证码\n *\n * @param paramDto\n * @param request\n * @return\n */\n @RequestMapping(\"/securityApi/getPhoneCode\")\n Result<String> getPhoneCode(@Valid DoctorSecurityGetPhoneCodeParamDto paramDto, Errors errors, HttpServletRequest request);\n\n /**\n * 校验手机验证码\n *\n * @param loginName\n * @param phoneValidateCode\n * @param type\n * @return\n */\n @RequestMapping(\"/securityApi/validatePhoneCode\")\n Result<Boolean> validatePhoneCode(String loginName, String phoneValidateCode, String type);\n\n /**\n * 授信\n *\n * @param paramDto\n * @param request\n * @return\n */\n @RequestMapping(\"/securityApi/creditDevice\")\n Result<String> creditDevice(@Valid DoctorSecurityCreditDeviceParamDto paramDto, Errors errors, HttpServletRequest request, HttpServletResponse response);\n\n /**\n * 检验是否第一次登录\n *\n * @param deviceInfoDto\n * @return\n */\n @RequestMapping(\"/inner/securityApi/checkFirstLoginForDoctor\")\n Result<Boolean> checkFirstLoginForDoctor(@RequestBody @Valid DoctorLoginDeviceInfoDto deviceInfoDto, Errors errors);\n\n /**\n * 检验deviceId是否已存在(此设备是否受信)\n *\n * @param deviceInfoDto\n * @return\n */\n @RequestMapping(\"/inner/securityApi/checkDeviceIdExistForDoctor\")\n Result<Boolean> checkDeviceIdExistForDoctor(@RequestBody @Valid DoctorLoginDeviceInfoDto deviceInfoDto, Errors errors);\n\n /**\n * 保存设备信息\n *\n * @param deviceInfoDto\n * @return\n */\n @RequestMapping(\"/inner/securityApi/saveDeviceInfoForDoctor\")\n Result<Boolean> saveDeviceInfoForDoctor(@RequestBody @Valid DoctorLoginDeviceInfoDto deviceInfoDto, Errors errors);\n}" ]
[ "0.7344891", "0.68325144", "0.683065", "0.66883904", "0.6648267", "0.6569454", "0.6557239", "0.65464646", "0.64839643", "0.6401694", "0.631298", "0.63120556", "0.6278616", "0.6222378", "0.62133324", "0.6153487", "0.6150837", "0.61396915", "0.6131614", "0.6124995", "0.6124337", "0.6120991", "0.61033016", "0.61028624", "0.60615635", "0.60372883", "0.5997338", "0.599725", "0.5996017", "0.59912413", "0.5987025", "0.5967092", "0.5956919", "0.59186536", "0.59119093", "0.5909383", "0.5883654", "0.5875194", "0.58742064", "0.58727956", "0.5854432", "0.5851426", "0.58445436", "0.58444756", "0.5844283", "0.5842684", "0.58415455", "0.5819868", "0.5818781", "0.5772722", "0.5769672", "0.57645833", "0.5752747", "0.5751607", "0.57492185", "0.5733151", "0.5718323", "0.57177544", "0.57146126", "0.5711135", "0.5703935", "0.5702951", "0.57009184", "0.5694789", "0.56891817", "0.56774306", "0.56768036", "0.56765807", "0.56648284", "0.5642061", "0.56409794", "0.5634501", "0.56315804", "0.5629456", "0.5618752", "0.5618188", "0.5611629", "0.56092703", "0.56059605", "0.56051826", "0.5603828", "0.55993885", "0.55990034", "0.55954266", "0.5588619", "0.5588581", "0.55869174", "0.5586538", "0.5576826", "0.55651826", "0.5565157", "0.5535509", "0.5530007", "0.5529643", "0.5522326", "0.55200934", "0.55143636", "0.5509217", "0.5508405", "0.55067974" ]
0.6975309
1
This method is used to test register in controller layer. Service layer response is mocked and controller layer of register is validated. This method is validated when valid details is provided from front end
@Test void validRegisterTest() throws Exception { User userObj = new User(); userObj.setName("Siva Murugan"); userObj.setEmail("[email protected]"); userObj.setGender("M"); userObj.setMobileNumber(9878909878L); userObj.setRole("C"); userObj.setUsername("sivanew"); userObj.setPassword("Siva123@"); String userJson = new ObjectMapper().writeValueAsString(userObj); when(userService.registerUser(any(User.class))).thenReturn(true); mockMvc.perform(post("/vegapp/v1/users/register").contentType(MediaType.APPLICATION_JSON).content(userJson)) .andExpect(status().isOk()).andExpect(content().string("true")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void testRegisterSuccessfully() {\n SignUpRequest request = new SignUpRequest(UNIQUE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).registered();\n }", "@Test\n void registerUser() throws Exception{\n\n final RegisterDto registerDto = new RegisterDto(\"[email protected]\", \"password\", \"John\", \"Doe\", \"2018\", \"Marnixplaats 18\", \"Antwerpen\", \"Antwerpen\", \"Belgium\");\n\n mockMvc.perform(post(\"/api/security/register\")\n .contentType(MediaType.APPLICATION_JSON_VALUE)\n .content(objectMapper.writeValueAsString(registerDto))).andExpect(status().isOk());\n\n final Users users = userService.findByUsername(\"[email protected]\");\n\n assertThat(users.getUsername()).isEqualTo(\"[email protected]\");\n assertThat(users.getFirstname()).isEqualTo(\"John\");\n assertThat(users.getLastname()).isEqualTo(\"Doe\");\n assertThat(users.getPostcode()).isEqualTo(\"2018\");\n assertThat(users.getAddress()).isEqualTo(\"Marnixplaats 18\");\n assertThat(users.getCity()).isEqualTo(\"Antwerpen\");\n assertThat(users.getProvince()).isEqualTo(\"Antwerpen\");\n assertThat(users.getCountry()).isEqualTo(\"Belgium\");\n\n }", "@Test\n\tpublic void registerUserTest4() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass1234\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(passwordsNoMatch));\n\t}", "@Test\n\tpublic void registerUserTest1() throws Exception {\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).characterEncoding(\"UTF-8\")).andDo(print()).andExpect(status().is(400));\n\n\t}", "@Test\n\tpublic void registerUserTest2() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(usernameTaken));\n\t}", "@PostMapping(value = \"/registerPharmacist\",consumes = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<?> registerPharmacist(@RequestBody PharmacistDTO pharmacistDTO){\n try {\n pharmacistService.registerPharmacist(pharmacistDTO);\n } catch (Exception e) {\n e.printStackTrace();\n return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);\n }\n\n return new ResponseEntity<>(HttpStatus.OK);\n }", "@Test\n\tpublic void registerUserTest3() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(emailTaken));\n\t}", "@Test\n\tpublic void registerUserTest7() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tUser user = new User();\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(user);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(201)).andExpect(content().json(objectMapper.writeValueAsString(user)));\n\t}", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@RequestBody RegistrationRequest registrationRequest){\n return userService.registerUser(registrationRequest);\n }", "@Test\n\tpublic void registerUserTest5() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.ofNullable(null));\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(500));\n\t}", "@Test\n public void processRegistration() throws Exception {\n String newUserName = \"goodusername\";\n long numberOfExpectedUsers = userRepository.count() + 1;\n mockMvc.perform(post(RegistrationController.BASE_URL)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .param(userNameField, newUserName)\n .param(passwordField, samplePasswordValue)\n .param(verifyPasswordField, samplePasswordValue))\n .andExpect(view().name(SearchController.REDIRECT + IndexController.URL_PATH_SEPARATOR))\n .andExpect(status().is3xxRedirection());\n long updatedNumberOfUsers = userRepository.count();\n assertEquals(numberOfExpectedUsers, updatedNumberOfUsers);\n }", "@Test\n void createUser_validInput_userCreated() throws Exception {\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"Test User\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.ONLINE);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"Test User\");\n userPostDTO.setUsername(\"testUsername\");\n\n given(loginService.createUser(Mockito.any())).willReturn(user);\n\n // when/then -> do the request + validate the result\n MockHttpServletRequestBuilder postRequest = post(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then\n mockMvc.perform(postRequest)\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n }", "@Test\n @WithMockUser\n public void add_post_authenticatedUserAndValidData_returnsCorrectViewAndStatusCode() throws Exception {\n mockMvc.perform(post(URL_CUSTOMERS_ADD)\n .param(PARAM_NAME, NAME)\n .param(PARAM_BIRTH_DATE, BIRTH_DATE))\n .andExpect(status().is3xxRedirection())\n .andExpect(redirectedUrl(URL_CUSTOMERS_ALL));\n }", "public interface IRegisterPresenter {\n public void requestRegister(RegisterBody registerBody);\n}", "public Boolean register(HttpServletRequest request) throws Exception;", "@POST\n @Consumes(MediaType.APPLICATION_JSON)\n Response create(@Valid @NotNull RegisterDTO registerDto, @PathParam(\"store_id\") Long storeId, @Context UriInfo uriInfo);", "@PostMapping(\"/register\")\n public AuthResponse register(@RequestBody AuthRequest authRequest) {\n User user = userService.register(authRequest.getUsername(), authRequest.getPassword(), authRequest.getRole());\n try {\n authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(authRequest.getUsername(), authRequest.getPassword()));\n } catch (BadCredentialsException badCredentialsException) {\n throw new RuntimeException(\"Invalid username or password\");\n }\n\n final UserDetails userDetails = customUserDetailsService.loadUserByUsername(authRequest.getUsername());\n final String token = jwtTokenUtil.generateToken(userDetails);\n\n return new AuthResponse(token);\n }", "public interface IRegister {\n void register(RegisterRequestEntity registerRequestEntity, IResponseSubcriber iResponseSubcriber);\n}", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "boolean registerUser(UserRegisterDTO userRegisterDTO);", "@Test\n public void registerInvalidCity() throws Exception {\n user.setCityId(-100);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "public interface RegisterService {\n @POST(\"register.php\")\n Call<RegisterResponse>getRegisterResponse(@Body RegisterForm registerForm);\n}", "@PostMapping(value = \"/register\") \n\t public RegisterResponseDto\t usersRegister(@RequestBody RegistrationDto registrationDto) {\n\t LOGGER.info(\"usersRegster method\");\n\t return\t userService.usersRegister(registrationDto); \n\t }", "public interface RegisterService {\n\n /**\n * 获取验证码\n * @param para\n * @return\n */\n RegisterResult getPictureCode(RegisterEnter para);\n /**\n * 注册用户\n * @param para\n * @return\n */\n RegisterResult registerUser(RegisterEnter para);\n\n\n /**\n * 个人用户注册设置密码\n * @param para\n * @return\n */\n @Role\n RegisterResult register_person(RegisterEnter para);\n\n /**\n * 插入注册推荐人公司信息\n * @param dept\n */\n void insertReferrerDept(String dept,String mobileNo);\n}", "public String register() throws NonUniqueBusinessKeyException,\n ValidationException, ObjectNotFoundException,\n MailOperationException, RegistrationException {\n if (logger.isDebugLoggingEnabled()) {\n\n }\n\n String mId = getMarketplaceId();\n String parameter = getRequest().getParameter(\n Constants.REQ_PARAM_SERVICE_KEY);\n String outcome = BaseBean.OUTCOME_SUCCESS;\n\n Long serviceKey = null;\n if (parameter != null && parameter.trim().length() > 0) {\n serviceKey = Long.valueOf(parameter);\n }\n // FIXME: Must be fixed in identity service.\n if (!isInternalMode()) {\n // A confirmation mail must be send, not a user created mail.\n // If no password is given it will be generated\n password = \"\";\n }\n try {\n organization = getAccountingService().registerCustomer(\n getOrganization(), user.getVOUserDetails(), password,\n serviceKey, mId, getSupplierId());\n } catch (NonUniqueBusinessKeyException ex) {\n if (isInternalMode()) {\n throw ex;\n }\n ex.setMessageKey(BaseBean.ERROR_USER_ALREADY_EXIST);\n ExceptionHandler.execute(ex, true);\n return BaseBean.OUTCOME_ERROR;\n }\n if (logger.isDebugLoggingEnabled()) {\n\n }\n return outcome;\n }", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@PostMapping(value = \"register\")\n public ResponseEntity<AccountDto> register(@RequestBody final AuthenticationRequestDto authenticationRequestDto)\n throws RegisterException {\n final AccountDto createdAccountDto = authenticationService.register(authenticationRequestDto);\n log.debug(\"Register - The API with body request [{}] has been consumed successfully\", authenticationRequestDto);\n return new ResponseEntity<>(createdAccountDto, HttpStatus.CREATED);\n }", "@Test\n\tpublic void registerUserTest6() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(null);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(notSuccessful));\n\t}", "@Test\n\tvoid RegistrationSuccessful() {\n\t\t\n\t// Specify Base URI\n\t\tRestAssured.basePath = \"https://restapi.demoqa.com/customer\";\n\t\t\n\t// Request object \n\tRequestSpecification httpRequest = RestAssured.given();\n\t\n\t// response Object\n\t// Request payload sending along with post\n\t\n\tJSONObject requestParams = new JSONObject();// JSONObject is a json-simple jar class\n\t\n\trequestParams.put(\"FirstName\", \"arif\");\n\trequestParams.put(\"LastName\",\"mod\");\n\trequestParams.put(\"UserName\", \"Arif212\");\n\trequestParams.put(\"Password\", \"mod415\");\n\trequestParams.put(\"Email\",\"[email protected]\");\n\t\n\thttpRequest.header(\"Content-Type\",\"application/json\");\n\t\t\n\thttpRequest.body(requestParams.toJSONString());// this method will convert above info into json format\n\t // and then attach above data to the request\n\t\t\n\t\t\n\t// ABOVE WE WERE PREPARING OUR REQUEST DETAILS AND CONVERTING TO JSON METHOD.\n\t// NOW BELOW WE WILL ACTUALLY SEND THE REQUEST.\n\t\n\t// Response object [ sending request with object]\n\tResponse response = httpRequest.request(Method.POST, \"/register\");// this is post method means create new\n\t\n\t// print response in console window\n\tString responseBody = response.getBody().asString();// will turn json response into String & store into responsebody\n\tSystem.out.println(\"Response body is: \"+ responseBody);\n\t\n\t// status code validation using assert from testng\n\tint statusCode = response.getStatusCode();\n\tSystem.out.println(\"Status code is:\"+ statusCode);\n\tAssert.assertEquals(statusCode, 201); // 201 is a sucessful post code \n\t\n\t// this method will get the value of SuccessCode from Json response and add it the variable \n\tString successCode = response.jsonPath().get(\"SuccessCode\");\n\tAssert.assertEquals(successCode, \"OPERATION_SUCCESS\"); // asserting to compare the successcodes\n\t\n\t\n\t\t\n\t}", "@Test\n public void test_create_user_success() throws Exception {\n UserDto user = new UserDto(null, \"Arya\", \"Stark\", \"[email protected]\");\n UserDto newUser = new UserDto(1L, \"Arya\", \"Stark\", \"[email protected]\");\n\n when(userService.existsByEmail(user)).thenReturn(false);\n when(userService.createUser(user)).thenReturn(newUser);\n\n mockMvc.perform(post(\"/users\").contentType(MediaType.APPLICATION_JSON).content(asJsonString(user)))\n .andExpect(status().isCreated());\n\n verify(userService, times(1)).existsByEmail(user);\n verify(userService, times(1)).createUser(user);\n verifyNoMoreInteractions(userService);\n }", "@PostMapping(\"/register\")\n public ResponseEntity<Map<String, String>> registerUser(@RequestBody User user){ \n userService.registerUser(user);\n return new ResponseEntity<>(generateJWTTToken(user), HttpStatus.OK);\n }", "@Test\n\tvoid repeatedMobileNumberTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new MobileNumberAlreadyExistException(\"E_MR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_MR01\"));\n\t}", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "@Test\n @InSequence(1)\n public void testRegister(){\n Customer customer = createCustomerInstance(\"Jane Doe\", \"[email protected]\", \"07744754955\");\n //Customer customer = storeCustomer(customer0);\n Taxi taxi0 = createTaxiInstance(\"JK66AKB\",6);\n Taxi taxi = storeTaxi(taxi0);\n //create a GuestBooking with a future date.\n GuestBooking guestBooking = createGuestBookingInstance(customer, taxi.getId(), futureDate1);\n Response response = guestBookingRestService.createBooking(guestBooking);\n\n assertEquals(\"Unexpected response status\", 201, response.getStatus());\n log.info(\" New booking via GuestBookingService.createBooking was persisted and returned status \" + response.getStatus());\n }", "@Produces(MediaType.APPLICATION_JSON)\n@Path(\"/stores/{store_id}/register\")\npublic interface RegisterResource {\n\n /**\n * GET endpoint for <code>Register</code> entity with given id.\n * \n * @param registerId <code>Register</code> entity id\n * @return <code>Response</code> object which holds response status \n * code and representation of <code>Register</code> entity\n */\n @GET\n @Path(\"/{register_id}\")\n Response getRegisterById(@PathParam(\"register_id\") Long registerId);\n\n /**\n * Creates endpoint for <code>Register</code> entity.\n * \n * @param registerDto <code>Register</code> data transfer object to which request\n * payload will be mapped to\n * @param storeId <code>Store</code> id to which <code>Register</code> entity\n * relates to\n * @param uriInfo an object that provides access to application and request URI\n * information\n * @return <code>Response</code> object which holds representation of saved\n * <code>Register</code> entity, response status code and URI of\n * newly created entity\n */\n @POST\n @Consumes(MediaType.APPLICATION_JSON)\n Response create(@Valid @NotNull RegisterDTO registerDto, @PathParam(\"store_id\") Long storeId, @Context UriInfo uriInfo);\n\n /**\n * Update endpoint for <code>Register</code> entity.\n * \n * @param registerDto <code>Register</code> data transfer object to which request\n * payload data will be mapped to\n * @param registerId id of <code>Register</code> entity to be updated\n * @return <code>Response</code> object containing representation of \n * updated <code>Store</code> entity and response status code\n */\n @PUT\n @Path(\"/{register_id}\")\n @Consumes(MediaType.APPLICATION_JSON)\n Response update(@Valid @NotNull RegisterDTO registerDto, @PathParam(\"store_id\") Long storeId, @PathParam(\"register_id\") Long registerId);\n\n /**\n * Delete endpoint for <code>Register</code> entity.\n * \n * @param registerId id of <code>Register</code> entity to be deleted\n * @return <code>Response</code> object containing response status code\n */\n @DELETE\n @Path(\"/{register_id}\")\n Response delete(@PathParam(\"register_id\") Long registerId);\n\n}", "Register.Req getRegisterReq();", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signupRequest) {\n System.out.println(\"Creating User \" + signupRequest);\n\n if (userAccountDetailsService.isUserExistByUsername(signupRequest.getUsername())) {\n System.out.println(\"A User with username: \" + signupRequest.getUsername() + \" already exist\");\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n\n UserAccount userAccount = new UserAccount();\n userAccount.setName(signupRequest.getName());\n userAccount.setUsername(signupRequest.getUsername());\n userAccount.setAge(signupRequest.getAge());\n userAccount.setPassword(passwordEncoder.encode(signupRequest.getPassword()));\n\n Set<String> roles = signupRequest.getRole();\n Set<Authorities> authorities = new HashSet<>();\n for(String role: roles) {\n Authorities authority = new Authorities();\n authority.setAuthority(role);\n authority.setUserAccount(userAccount);\n authorities.add(authority);\n }\n userAccount.setAuthorities(authorities);\n\n userAccountDetailsService.saveUser(userAccount);\n\n return new ResponseEntity<Void>(HttpStatus.CREATED);\n }", "@Override\r\n /**\r\n * Recieves the request from the client, calls the register service, and returns the result\r\n */\r\n public void handle(HttpExchange exchange) throws IOException {\n InputStreamReader reader = new InputStreamReader(exchange.getRequestBody());\r\n try {\r\n request = gson.fromJson(reader,RegisterRequest.class);\r\n if(validate(request)) {\r\n service = new RegisterService(request);\r\n result = service.register();\r\n }\r\n else {\r\n result = new ErrorResult(\"ERROR: Invalid Request body. Please check documentation for correct request body parameters\");\r\n }\r\n }\r\n catch(IllegalArgumentException e) {\r\n result = new ErrorResult(\"ERROR: Invalid request body. Please check documentation for correct request body parematers.\");\r\n }\r\n finally {\r\n PrintWriter out = new PrintWriter(exchange.getResponseBody());\r\n if(result.getMessage() == null) {\r\n //send as RegisterResult object\r\n LoginRegisterResult newResult = (LoginRegisterResult) result;\r\n json = gson.toJson(newResult);\r\n }\r\n else {\r\n json = gson.toJson(result);\r\n }\r\n exchange.sendResponseHeaders(HTTP_OK, 0);\r\n out.print(json);\r\n out.close();\r\n exchange.getResponseBody().flush();\r\n exchange.getResponseBody().close();\r\n }\r\n }", "@PostMapping(\"/register\")\n\tpublic String processRegistration(@ModelAttribute (name=\"vendor_details\") Vendor v,BindingResult res , RedirectAttributes flashMap)\n\t{\n\t\tSystem.out.println(\"inside registration method\");\n\t\tSystem.out.println(\"in process reg form : vendor details \" + v);\n\t\tSystem.out.println(\"in process reg form : payment details \" + v.getDetails());\n\t\tSystem.out.println(\"binding result \" + res );\n\t\tflashMap.addFlashAttribute(\"message\", vendorService.registerVendor(v));\n\t\t//after inserting the details : redirect client to vendor list\n\t\treturn \"redirect:/admin/list\";\n\t}", "boolean hasRegistrationResponse();", "@PostMapping(\"/register\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody User user, BindingResult result){\n \t\n \tResponseEntity<?> errorMap = mapValidationErrorService.mapValidationService(result);\n \n\t\tif(errorMap!=null) \n \treturn errorMap;\n\n User newUser = userService.save(user);\n return new ResponseEntity<User>(newUser, HttpStatus.CREATED);\n }", "public ManResponseBean registerUser(UserRegisterForm bean) throws Exception {\n String url = \"/services/RegisterUser\";\n /*\n * UserId SecurePassword SecurePin PinPayment PinAmount PinMenu PinPG\n * PinPGRate Name LeadId EmailNotify etc ReturnUrl TermsAgree Email\n * Language\n */\n NameValuePair[] params = {\n new NameValuePair(\"UserId\", bean.getUserId()),\n new NameValuePair(\"SecurePassword\", bean.getSecurePassword()),\n new NameValuePair(\"SecurePin\", bean.getSecurePin()),\n new NameValuePair(\"PinPayment\", bean.getPinPayment()),\n new NameValuePair(\"PinAmount\", bean.getPinAmount()),\n new NameValuePair(\"PinMenu\", bean.getPinMenu()),\n new NameValuePair(\"PinPG\", bean.getPinPG()),\n new NameValuePair(\"PinPGRate\", bean.getPinPGRate()),\n new NameValuePair(\"FirstName\", bean.getFirstName()),\n new NameValuePair(\"LastName\", bean.getLastName()),\n new NameValuePair(\"Name\", bean.getFirstName() + \" \"\n + bean.getLastName()),\n new NameValuePair(\"LeadId\", bean.getLeadId()),\n new NameValuePair(\"EmailNotify\", bean.getEmailNotify()),\n new NameValuePair(\"etc\", bean.getEtc()),\n new NameValuePair(\"ReturnUrl\", bean.getReturnUrl()),\n new NameValuePair(\"TermsAgree\", bean.getTermsAgree()),\n new NameValuePair(\"Question\", bean.getQuestion()),\n new NameValuePair(\"Answer\", bean.getAnswer()),\n new NameValuePair(\"Language\", bean.getLanguage()),\n new NameValuePair(\"Email\", bean.getEmail()) };\n ManResponseBean response = handlePOSTRequest(url, params, null);\n return response;\n }", "private boolean sendRequest(Map<?, ?> msbRegistionBodyMap) \n {\n LOGGER.info(\"Start registering to microservice bus\");\n String rawData = JsonUtil.toJson(msbRegistionBodyMap); \n MsbDetails oMsbDetails = MsbDetailsHolder.getMsbDetails();\n if(null == oMsbDetails) {\n LOGGER.info(\"MSB Details is NULL , Registration Failed !!!\");\n return false;\n } \n RestResponse oResponse = RestfulClient.sendPostRequest(oMsbDetails.getDefaultServer().getHost(),\n oMsbDetails.getDefaultServer().getPort(),\n MSB_REGISTION_URL, rawData);\n \n if(null == oResponse){\n LOGGER.info(\"Null Unregister Response for \" + MSB_REGISTION_URL);\n return false;\n } \n LOGGER.info(\"Response Code Received for MBS Registration:\" + oResponse.getStatusCode()); \n return isSuccess(oResponse.getStatusCode()) ? true : false;\n }", "@PostMapping(path = \"/register\",\n produces={MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE})\n @Timed\n public ResponseEntity registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) {\n\n HttpHeaders textPlainHeaders = new HttpHeaders();\n textPlainHeaders.setContentType(MediaType.TEXT_PLAIN);\n\n return userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase())\n .map(user -> new ResponseEntity<>(\"login already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> userRepository.findOneByEmail(managedUserVM.getEmail())\n .map(user -> new ResponseEntity<>(\"e-mail address already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> {\n User user = userService\n .createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),\n managedUserVM.getFirstName(), managedUserVM.getLastName(),\n managedUserVM.getEmail().toLowerCase(), managedUserVM.getImageUrl(), managedUserVM.getLangKey());\n\n mailService.sendActivationEmail(user);\n return new ResponseEntity<>(HttpStatus.CREATED);\n })\n );\n }", "@Test\n\tpublic void addUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tpost(\"/secure/user/addUser\").param(\"username\", \"username1\")\n\t\t\t\t\t\t.param(\"firstName\", \"firstName1\")\n\t\t\t\t\t\t.param(\"lastName\", \"lastName1\")\n\t\t\t\t\t\t.param(\"emailAddress\", \"[email protected]\")\n\t\t\t\t\t\t.param(\"password\", \"abcd1234\")\n\n\t\t\t\t\t\t.accept(MediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"message\").value(\"Success\"));\n\n\t}", "@PostMapping(value = \"/users\")\n\tpublic <T> ResponseEntity<?> registerProcess(@RequestBody User user) {\t\n\t\tLoginResponse registerResponse = new LoginResponse();\n\t\ttry {\n\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tregisterResponse = userDelegate.register(user);\n\t\t\treturn responseUtil.successResponse(registerResponse);\n\t\t\t\n\t\t} catch(ApplicationException e){\t\n\t\treturn responseUtil.errorResponse(e);\n\t}\n\t\t\n\t}", "@Test\n public void aTestRegister() {\n given()\n .param(\"username\", \"playlist\")\n .param(\"password\", \"playlist\")\n .post(\"/register\")\n .then()\n .statusCode(201);\n }", "@PostMapping(value = \"/registrar\")\n public ResponseEntity registrar(@RequestBody EmpleadoDTO empleado){\n return empleadoService.registrar(empleado);\n }", "@Test\n public void testCreateSucess() {\n User user = new User();\n user.setTenant(\"111\");\n user.setPassword(\"pass\");\n user.setToken(\"fake-token\");\n user.setUserid(\"1\");\n user.setUsername(\"fake-user\");\n\n IUserService userServiceMock = mock(IUserService.class);\n IAuthService authServiceMock = mock(IAuthService.class);\n try {\n when(authServiceMock.getUser(anyString(), anyString())).thenReturn(user);\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n\n Map<String, String> flashData = Collections.emptyMap();\n Map<String, Object> argData = Collections.emptyMap();\n play.api.mvc.RequestHeader header = mock(play.api.mvc.RequestHeader.class);\n Http.RequestBody requestBody = mock(Http.RequestBody.class);\n when(requestBody.asFormUrlEncoded()).thenReturn(new HashMap<String, String[]>(){{\n put(\"username\", new String[] {\"goodusername\" });\n put(\"password\", new String[] {\"goodpassword\" });\n } });\n Http.Request request = mock(Http.Request.class);\n when(request.body()).thenReturn(requestBody);\n Http.Context context = new Http.Context(2L, header, request, flashData, flashData, argData);\n Http.Context.current.set(context);\n\n Result result = new Login(userServiceMock, authServiceMock).create();\n assertEquals(200, result.status());\n assertEquals(\"application/json\", result.contentType());\n assertTrue(contentAsString(result).\n equals(\"{\\\"id\\\":null,\" +\n \"\\\"username\\\":\\\"fake-user\\\",\" +\n \"\\\"token\\\":\\\"fake-token\\\",\" +\n \"\\\"tenant\\\":\\\"111\\\",\" +\n \"\\\"userid\\\":\\\"1\\\",\" +\n \"\\\"expireDate\\\":null}\"));\n\n try{\n verify(authServiceMock).getUser(anyString(), anyString());\n }catch(UnauthorizedException | InternalServerException e){\n fail(e.getLocalizedMessage());\n }\n }", "@Test\n public void testRepeatRegistration(){\n UserRegisterKYC userRegister = new UserRegisterKYC(\"hello\", validId2, \"26/02/1995\",\"738583\");\n int requestResponse = userRegister.sendRegisterRequest();\n requestResponse = userRegister.sendRegisterRequest();\n assertEquals(500,requestResponse);\n }", "@Test\n @Order(1)\n void TC_REGISTRATION_1()\n {\n Mockito.when(mockedRequest.getParameter(\"username\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"password\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"email\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"nome\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"cognome\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"nazionalita\")).thenReturn(\"\");\n\n assertThrows(IllegalArgumentException.class, ()-> servlet.doPost(mockedRequest,mockedResponse));\n\n }", "@PostMapping(value = \"/registration\")\n public @ResponseBody\n ResponseEntity<Object> register(@RequestParam(\"firstName\") String firstName,\n @RequestParam(\"lastName\") String lastName,\n @RequestParam(\"username\") String username,\n @RequestParam(\"password\") String password) {\n\n Person person = personService.getPersonByCredentials(username);\n\n String securePassword = HashPasswordUtil.hashPassword(password);\n\n if (person == null) {\n\n person = new Person(username, securePassword, firstName, lastName, PersonType.USER);\n\n try {\n personService.add(person);\n } catch (IllegalArgumentException e) {\n logger.error(e.getMessage());\n }\n person = personService.getPersonByCredentials(username);\n\n ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();\n HttpSession session = attr.getRequest().getSession(true); // true == allow create\n session.setAttribute(\"user\", username);\n session.setAttribute(\"userId\", person.getId());\n\n return ResponseEntity.status(HttpStatus.OK).body(null);\n } else {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n }", "@PostMapping\n public @ResponseBody\n ResponseEntity<Object> register(@RequestParam(\"firstName\") final String firstName,\n @RequestParam(\"lastName\") final String lastName,\n @RequestParam(\"username\") final String username,\n @RequestParam(\"password\") final String password,\n @RequestParam(\"email\") final String email) {\n\n Person person = personService.getPersonByCredentials(username);\n\n final String securePassword = HashPasswordUtil.hashPassword(password);\n\n if (person == null) {\n\n person = new Person(username, securePassword, firstName, lastName, email, PersonType.USER);\n\n try {\n personService.add(person);\n } catch (IllegalArgumentException e) {\n logger.error(e.getMessage());\n }\n person = personService.getPersonByCredentials(username);\n\n ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();\n HttpSession session = attr.getRequest().getSession(true); // true == allow create\n session.setAttribute(\"user\", username);\n session.setAttribute(\"userId\", person.getIdPerson());\n\n return ResponseEntity.status(HttpStatus.OK).body(null);\n } else {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n }", "UserDTO registerUser(UserRegistrationDTO registrationDTO);", "public ResponseRegister() {\n }", "@Test\n\tpublic void addRegistrationDetails() {\n\t\tRegistrationDetails registrationDetailsForHappyPath = RegistrationHelper.getRegistrationDetailsForHappyPath();\n\t\ttry {\n\t\t\tem.getTransaction().begin();\n\t\t\tRegistrationDetails addRegistrationDetails = registrationDAO\n\t\t\t\t\t.addRegistrationDetails(registrationDetailsForHappyPath);\n\t\t\tem.getTransaction().commit();\n\t\t\tassertTrue(addRegistrationDetails.getId() != 0l);\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t}", "UserRegistrationResponse registrationPost(RegistrationForm registrationForm);", "@Test\n public void registerServerError() throws Exception {\n user.setUsername(\"thatssssaaaaaaaaaaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeryyyyyylo\" +\n \"oooooooooonggggusernameeeeeeeeeeeeeeeeee\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@PostMapping(\"/registerLocation\")\n public ResponseEntity<Response> registerLocation(@Valid @RequestBody LocationModel locationModel, \n Errors result) {\n\n Response response = new Response();\n if (result.hasErrors()) {\n Map<String, String> errors = result.getFieldErrors().stream()\n .collect(Collectors.toMap(FieldError::getField, FieldError::getDefaultMessage));\n\n response.setStatus(false);\n response.setErrorMessages(errors);\n return new ResponseEntity<Response>(response, HttpStatus.BAD_REQUEST);\n\n } else {\n\n try {\n\n locationRepository.save(locationModel);\n response.setStatus(true);\n response.setLocationModel(locationModel);\n\n } catch (Exception ex) {\n\n Map<String, String> errors = new HashMap<>();\n errors.put(\"Error message\", ex.toString());\n response.setStatus(false);\n response.setErrorMessages(errors);\n return new ResponseEntity<Response>(response, HttpStatus.BAD_REQUEST);\n }\n return new ResponseEntity<Response>(response, HttpStatus.CREATED);\n }\n }", "@PostMapping(\"/register\")\n public String register(@Valid UserForm userForm, BindingResult result){\n if(!userForm.confirmPassword()){\n result.rejectValue(\"confirmPassword\",\"confirmError\",\"两次密码不一致\");\n// boo = false;\n }\n if(result.hasErrors()){\n return \"register\"; // 如果使用@Valid注解,就表示已经将userForm和result放到了model中,直接可以在前端获取信息\n }\n// if(result.hasErrors()){\n// List<FieldError> fieldErrors = result.getFieldErrors();\n// for(FieldError error : fieldErrors){\n// System.out.println(error.getField() + \" : \" + error.getDefaultMessage() + \" : \" + error.getCode());\n// }\n// boo = false;\n// }\n// if(!boo){\n// return \"register\";\n// }\n User user = userForm.convertToUser();\n userRepository.save(user);\n return \"redirect:/login\";\n }", "@Test\n public void testTegisterPatient(){\n register.registerPatient(\"Donald\", \"Trump\",\"16019112345\", \"Doctor Proctor\");\n assertEquals(1, register.getRegisterSize());\n }", "private void handleRegister(Business business) {\n\n Call<String> call = rtfBase.register(business); //we get id\n call.enqueue(new Callback<String>() {\n @Override\n public void onResponse(Call<String> call, Response<String> response) {\n if(response.code() == 200)\n {\n // business.setId(response.body());\n // Toast.makeText(RegisterNewBusiness.this, \"registered successfully\",Toast.LENGTH_LONG).show();\n\n connectToApp(business);\n\n\n }\n if(response.code() == 400)\n {\n Toast.makeText(RegisterNewBusiness.this, \"you already registered\",Toast.LENGTH_LONG).show();\n\n }\n if(response.code() == 404)\n {\n Toast.makeText(RegisterNewBusiness.this, \"something wrong\",Toast.LENGTH_LONG).show();\n\n }\n }\n\n\n @Override\n public void onFailure(Call<String> call, Throwable t) {\n Toast.makeText(RegisterNewBusiness.this, t.getMessage(),Toast.LENGTH_LONG).show();\n }\n });\n }", "public Response getRegisterResponse(){\n\t\treturn this.registerResponse;\n\t}", "@PostMapping(\"/v1/register\")\n\t@Transactional\n\tpublic ResponseEntity<RegisteredUserResult> register(@RequestBody RegisterUserRequest registerUserRequest) {\n\n\t\tLOG.info(\"Register user!\");\n\n\t\tcheckHeader(registerUserRequest);\n\n\t\t// Create user in user service db\n\t\tUserEntity userEntity = new UserEntity();\n\t\tmapper.map(registerUserRequest, userEntity);\n\t\tuserEntity.setRoles(Arrays.asList(roleRepository.findByName(ROLE_USER)));\n\t\tuserEntity = userRepository.save(userEntity);\n\n\t\t// Create user in auth service db\n\t\tUserDto userDto = new UserDto();\n\t\tmapper.map(registerUserRequest, userDto);\n\t\tthis.authServiceClient.createUser(userDto);\n\n\t\tRegisteredUserResult result = new RegisteredUserResult(userEntity.getId());\n\t\tResponseEntity<RegisteredUserResult> response = new ResponseEntity<>(result, HttpStatus.OK);\n\n\t\treturn response;\n\t}", "@PostMapping(\"/register-manager\")\r\n\tpublic ResponseEntity<UserDto> registerManager(@RequestBody UserDto userDto){\n\t\tString firstName = userDto.getFirstName();\r\n\t\tif (firstName == null || firstName.length() < 3 || firstName.length() > 100) {\r\n\t\t\t// Throw Invalid Data exception\r\n\r\n\t\tString lastName = userDto.getLastName();\r\n\t\tif (lastName == null || lastName.length() < 3 || lastName.length() > 100) {\r\n\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t}\r\n\t\tString email = userDto.getEmail();\r\n\t\tif(email == null|| email.length()< 3 || email.length()>100 ){\r\n\t\t\t// Throw Invalid Data exception\r\n\t\t}\r\n\r\n\t\tString mobile = userDto.getMobile();\r\n\t\tif(mobile ==null ||mobile.length() <10 || mobile.length()>10){\r\n\t\t\t// Throw Invalid Data exception\r\n\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Test\n public void shouldEnrichAccountSaveAccountThenGetAccountUsingChargingId() throws Exception {\n //given\n final EnrichedAccountInfo expectedInfo = aEnrichedAccountInfo();\n final ContextData contextData = aContextData();\n String accountJson = converter.toJson(contextData);\n ERIFResponse erifResponse = ERIFResponse.builder()\n .ban(expectedInfo.getBan())\n .billingCycleDay(expectedInfo.getBillingCycleDay())\n .errId(expectedInfo.getErrorId())\n .childSpId(expectedInfo.getChildServiceProviderId())\n .isPrepay(expectedInfo.getCustomerType())\n .status(expectedInfo.getValidationStatus())\n .spId(expectedInfo.getServiceProviderId())\n .spType(expectedInfo.getServiceProviderType())\n .userGroups(expectedInfo.getUsergroups())\n .errDescription(expectedInfo.getErrorDescription())\n .build();\n\n ResponseEntity<ERIFResponse> responseEntity = new ResponseEntity<>(erifResponse, HttpStatus.OK);\n\n given(restTemplate.postForEntity(anyString(), any(HttpEntity.class), Matchers.<Class<ERIFResponse>>any()))\n .willReturn(responseEntity);\n\n MvcResult result = mockMvc.perform(post(\"/accounts/\")\n .contentType(contentType)\n .content(accountJson)\n .headers(aHttpHeaders(contextData.getClientId(), contextData.getLocale(), contextData.getChargingId())))\n .andExpect(MockMvcResultMatchers.status().isOk())\n .andReturn();\n final EnrichedAccountInfo info =\n (EnrichedAccountInfo) converter.fromJson(EnrichedAccountInfo.class, result.getResponse().getContentAsString());\n\n final Account expectedAccount = AccountDataBuilder.anAccount(contextData.getChargingId(), info, new Date());\n final ChargingId expectedChargingId = expectedAccount.getChargingId();\n repository.save(expectedAccount);\n\n final MvcResult response = mockMvc.perform(get(\"/accounts/\" + expectedChargingId.getType() + \"/\" + expectedChargingId.getValue() )\n .accept(MediaType.APPLICATION_JSON_UTF8))\n .andExpect(MockMvcResultMatchers.status().isOk())\n .andReturn();\n\n final Account account = (Account) converter.fromJson(Account.class, response.getResponse().getContentAsString());\n assertThat(account).isNotNull();\n assertThat(account).isEqualToIgnoringGivenFields(expectedAccount, \"lastValidate\", \"id\", \"profiles\", \"chargingId\");\n assertThat(account.getProfiles().get(0)).isEqualToComparingFieldByFieldRecursively(expectedAccount.getProfiles().get(0));\n assertThat(account.getChargingId()).isEqualToComparingFieldByField(account.getChargingId());\n }", "@Then(\"^user gives the details$\")\r\n\tpublic void user_gives_the_details() throws Throwable {\n\t register.registrationOfCustomer();\r\n\t}", "public void setRegisterResponse(Response registerResponse){\n\t\tthis.registerResponse=registerResponse;\n\t}", "@Test\n public void testAddTravel_InvalidCountryCodeExceptionEndpoint() throws Exception {\n dto.getEndpoint().setCountry(\"DTO\");\n \n mockMVC.perform(post(\"/user/1/travel\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@Test\n public void testRegisterDuplicateUsername() {\n SignUpRequest request = new SignUpRequest(DUPLICATE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).duplicateUsername();\n\n try {\n verify(connection, never()).register(request);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Test\n\tvoid repeatedUsernameTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new UsernameAlreadyExistException(\"E_UR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_UR01\"));\n\t}", "public Response<CustomerRegResponseDto> createCustomer(CustomerRegRequestDto requestDto) {\n\t\tResponse<CustomerRegResponseDto> responseDto = new Response<>();\n\t\tOptional<User> user = userRepo.findByUserId(requestDto.getUserId());\n\t\tif (!user.isPresent())\n\t\t\tthrow new UserNotFoundException(CustomerConstants.USER_NOT_FOUND);\n\n\t\tOptional<User> userEmail = userRepo.findByEmailId(requestDto.getCustomerEmailId());\n\t\tif (userEmail.isPresent())\n\t\t\tthrow new UserAlreadyExistException(CustomerConstants.USER_EMAIL_ID_ALREADY_EXISTS);\n\n\t\tUser userUserName = userRepo.findByUserNameContainsIgnoreCase(requestDto.getCustomerUserName().toLowerCase());\n\t\tif (userUserName != null)\n\t\t\tthrow new UserAlreadyExistException(CustomerConstants.USER_NAME_ALREADY_EXISTS);\n\n\t\tif (!requestDto.getPassword().equals(requestDto.getConfirmPassword())) {\n\t\t\tthrow new NoDataFoundException(CustomerConstants.PASSWORD_CONFIRMATION);\n\n\t\t}\n\n\t\tCustomer addNewCustomer = addCustomerDetails(requestDto);\n\t\tUser newUser = addNewUser(requestDto, addNewCustomer);\n\t\tCustomerRegResponseDto response = new CustomerRegResponseDto();\n\t\tresponse.setCustomerId(addNewCustomer.getCustomerId());\n\t\tresponse.setUserId(newUser.getUserId());\n\t\tresponseDto.setData(response);\n\t\tresponseDto.setMessage(CustomerConstants.CUSTOMER_CREATED_SUCCESSFULLY);\n\t\tresponseDto.setStatus(HttpServletResponse.SC_OK);\n\t\tresponseDto.setError(false);\n\t\tsendRegistrationEmailNotification(requestDto);\n\t\treturn responseDto;\n\t}", "@Test\n @Order(4)\n void TC_REGISTRATION_4()\n {\n Mockito.when(mockedRequest.getParameter(\"username\")).thenReturn(\"MarioRossi\");\n Mockito.when(mockedRequest.getParameter(\"password\")).thenReturn(\"pass\");\n Mockito.when(mockedRequest.getParameter(\"email\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"nome\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"cognome\")).thenReturn(\"\");\n Mockito.when(mockedRequest.getParameter(\"nazionalita\")).thenReturn(\"\");\n\n assertThrows(IllegalArgumentException.class, ()-> servlet.doPost(mockedRequest,mockedResponse));\n\n }", "@Test\n public void createUser() {\n Response response = regressionClient.createUser();\n dbAssist.responseValidation(response);\n }", "@Before\n public void setupRegisterViewModel(){\n MockitoAnnotations.initMocks(this);\n\n //we create an instance of the class to be tested by passing the mocked object\n registerViewModel = new RegisterViewModel(registerScreen, new UnitTestLogger());\n\n registerViewModel.getRegisterModel().setName(dummyName);\n registerViewModel.getRegisterModel().setEmail(dummyEmail);\n registerViewModel.getRegisterModel().setPhoneNo(dummyPhone);\n registerViewModel.getRegisterModel().setAddress(dummyAddress);\n }", "@PostMapping(\"/register\")\r\n public Guardian createGuardian(@Valid @RequestBody RegistrationInfo registrationInfo) throws UserExistException {\r\n User user = userService.save(new User(registrationInfo));\r\n if (user != null) {\r\n return guardianRepository.save(new Guardian(registrationInfo));\r\n } else {\r\n throw new UserExistException(\"User is empty. Something went wrong.\");\r\n }\r\n }", "@RequestMapping(value = \"/register/Mobile/{firstname}/{surname}/{password}/{phone}/{gender}/{yob}/{emailAddress:.+}\",\n method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> registerMobile (@PathVariable(\"firstname\") String firstname,\n @PathVariable(\"surname\") String surname,\n @PathVariable(\"password\") String password,\n @PathVariable(\"phone\") String phone,\n @PathVariable(\"gender\") String gender,\n @PathVariable(\"yob\") int yob,\n @PathVariable(\"emailAddress\") String emailAddress\n ) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n User user = userRepo.findByEmailAddress(emailAddress);\n\n if (user == null) {\n user = new User();\n\n if (checkPasswordFormat(password)) {\n user.setFirstname(firstname);\n user.setSurname(surname);\n user.setEmailAddress(emailAddress);\n user.setPassword(password);\n user.setType(\"Mobile\");\n user.setPhone(phone);\n user.setGender(gender);\n user.setYob(yob);\n // administrators and Mobile users are automatically enabled.\n user.setApproved( true );\n\n userRepo.save(user);\n\n // add empty user-point records for the new user against each retailer.\n\n List<Retailer> retailers = retailerRepo.findAll();\n for(Retailer retailer : retailers) {\n UserPoint newUserPoint = new UserPoint(user.getUserid(), retailer.getRetailerid(), 0);\n userPointRepo.save(newUserPoint);\n }\n\n respMap.put(\"message\",\"User created successfully\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n respMap.put(\"success\",\"1\");\n\n\n } else {\n respMap.put(\"message\",\"Password Incorrect: >= 6 and <= 20, at least one number, upper and lowercase character\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n } else {\n respMap.put(\"message\",\" - This email address is already in use, please chose another email address\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "public interface RegisterGuJingboService {\n /**\n * @param intentionDate 意向就诊时间\n * @param patientName 姓名\n * @param patientSex 性别\n * @param patientAge 性别\n * @param patientPhone 手机号\n * @param patientIntro 介绍人\n * @param firstFlag 初诊or复诊\n * @return\n */\n Map<String, Object> register4GuJingbo(String intentionDate, String patientName, String patientSex, String patientAge, String patientPhone, String patientIntro, String firstFlag);\n\n /**\n * 获取意向就诊日期(只获取1-9条)\n *\n * @return\n */\n Map<String, Object> getIntentionDateAndWeek();\n\n /**\n * 获取某日的挂号详情\n *\n * @param intentionDate\n * @return\n */\n Map<String, Object> getRegisterDetail(String intentionDate);\n\n /**\n * 大夫登录\n *\n * @param account\n * @param password\n * @return\n */\n Map<String, Object> registerSignIn(String account, String password);\n}", "public interface UserRegister {\n void successfulRegistrationRedirect(NewUser newUser);\n\n void showBackendErrorResponse(UserRegistrationError[] userRegistrationErrors);\n}", "@Test\n public void testSaveUser() throws Exception {\n mockMvc.perform(post(\"/save-user\")\n .param(\"id\", \"1\")\n .param(\"firstName\", \"assanai\")\n .param(\"lastName\", \"manurat\")\n .param(\"email\", \"[email protected]\")\n )\n .andExpect(status().isFound())\n .andExpect(model().hasNoErrors()) //checking the model to ensure don't have any error\n .andExpect(redirectedUrl(\"/users\")) //checking the url to ensure redirect to the new url\n ;\n\n }", "@Test\n void loginUser_validInput_userLoggedIn() throws Exception{\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"TestPassword\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.OFFLINE);\n\n given(loginService.checkLoginCredentials(Mockito.any())).willReturn(user);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"TestPassword\");\n userPostDTO.setUsername(\"testUsername\");\n\n MockHttpServletRequestBuilder putRequest = put(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n mockMvc.perform(putRequest).andExpect(status().isOk())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n\n }", "@PostMapping(value = \"/rest/appregistration\")\r\n \t@ResponseStatus(HttpStatus.CREATED)\r\n \t@ResponseBody\r\n \tpublic ResponseEntity createRegistration(@RequestBody RegistrationDto regObject) {\n \t\t\r\n \t\tRegistrationDto registrationDto = new RegistrationDto();\r\n\r\n\r\n \t\treturn new ResponseEntity(registrationDto, HttpStatus.OK);\r\n \t}", "@Test\n public void registerUsernameTooShort() throws Exception {\n user.setUsername(\"1234\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@RequestMapping(value = \"register_client\", method = RequestMethod.POST)\n public String submitRegisterClient(@ModelAttribute(\"formDto\") OauthClientDetailsDto formDto, BindingResult result) {\n clientDetailsDtoValidator.validate(formDto, result);\n if (result.hasErrors()) {\n return \"clientdetails/register_client\";\n }\n oauthService.registerClientDetails(formDto);\n return \"redirect:client_details\";\n }", "@Test\n public void registerPasswordEmpty() throws Exception {\n user.setPassword(null);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "public UserRegisterResponse() {\n }", "public interface RegistrationService {\n UserDto registrationNewUser(String login, String password, String email);\n\n}", "@PostMapping\n public User addUser(@Validated(value = Create.class) @RequestBody User user) {\n try {\n return userService.addUser(user);\n }catch (UserIdAlreadyExistsException exception){\n throw new UserIdAlreadyExistsException(\"User Id Already Exists\");\n }\n }", "@POST\n @Path(\"register\")\n @Produces(MediaType.APPLICATION_JSON)\n public JAXResult register(UserBE user){\n return null;\n }", "private void register() {\n RegisterModel registerModel = new RegisterModel(edtEmail.getText().toString(),\n edtPaswd.getText().toString(),\n edtDisplayName.getText().toString());\n\n Response.Listener<RegisterApiResponse> responseListener = new Response.Listener<RegisterApiResponse>() {\n @Override\n public void onResponse(RegisterApiResponse response) {\n if (response.isSuccess()) login();\n }\n };\n\n Response.ErrorListener errorListener = new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.cancel();\n if (error != null) {\n String errorMsg = \"An error occurred\";\n String err = (error.getMessage() == null) ? errorMsg : error.getMessage();\n Log.d(TAG, err);\n error.printStackTrace();\n\n if (err.matches(AppConstants.CONNECTION_ERROR) || err.matches(AppConstants.TIMEOUT_ERROR)) {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n } else if (err.matches(\".*Duplicate entry .* for key 'name_UNIQUE'.*\")) {\n edtDisplayName.setError(\"username taken\");\n edtDisplayName.requestFocus();\n } else if (err.matches(\".*The email has already been taken.*\")) {\n edtEmail.setError(\"email taken\");\n edtEmail.requestFocus();\n } else {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n }\n }\n }\n };\n\n\n progressDialog.setMessage(getString(R.string.progress_dialog_message_login));\n RegistrationRequests registerRequest =\n RegistrationRequests.register(this, registerModel, responseListener, errorListener);\n VolleyRequest.getInstance(this.getApplicationContext()).addToRequestQueue(registerRequest);\n progressDialog.show();\n }", "@Test\n\tpublic void getAccountDetailsTest() throws Exception {/*\n\t\tList<CreateAccount> listOfUsers= new ArrayList<>();\n\t\tlistOfUsers.add(new CreateAccount(1, \"Amrutha\", \"Kanthimath\", \"amruthaKanthimath\", \"1000005050\", \"9482929767\", \n\t\t\t\t\"abcd abcd\", \"Savings\", \"[email protected]\", 100000, \"BVYPA5458A\", \"123456789A\"));\n\t\tMockito.when(accountController.getListOfUsers()).thenReturn(listOfUsers);\n\t\tthis.mockMvc.perform(get(\"/getAcc\"))\n\t\t.andExpect(status().isOk())\n .andExpect(content().contentType(MediaType.APPLICATION_JSON))\n // .andExpect(\"$\", hasS)\n .andExpect(jsonPath(\"$.[0]\", is(1)))\n .andExpect(jsonPath(\"$.[0]\", is(\"Amrutha\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"Kanthimath\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"amruthaKanthimath\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"1000005050\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"9482929767\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"abcd abcd\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"Savings\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"[email protected]\")))\n .andExpect(jsonPath(\"$.[0]\", is(100000)))\n .andExpect(jsonPath(\"$.[0]\", is(\"BVYPA5458A\")))\n .andExpect(jsonPath(\"$.[0]\", is(\"123456789A\")));\n\t\t\n\t\tMockito.verify(accountController,times(1)).getListOfUsers();\n\t\tverifyNoMoreInteractions(accountController);\n \n\t*/}", "@Test\n public void testRegisterUser() throws AuthenticationException, IllegalAccessException {\n facade.registerUser(\"fiske\", \"JuiceIsLoose123/\");\n assertEquals(\"fiske\", facade.getVeryfiedUser(\"fiske\", \"JuiceIsLoose123/\").getUserName(), \"Expects user exist after register\");\n }", "@Test\n @InSequence(2)\n public void testInvalidRegister() {\n //find a existed customer\n List<Customer> customers = customerService.findAllCustomers();\n Customer customer = customers.get(0);\n //find a existed taxi\n List<Taxi> taxis = taxiService.findAllTaxis();\n Taxi taxi = taxis.get(0);\n GuestBooking guestBooking = createGuestBookingInstance(customer, taxi.getId(), futureDate1);\n\n try {\n guestBookingRestService.createBooking(guestBooking);\n fail(\"Expected a RestServiceException to be thrown\");\n } catch(RestServiceException e) {\n // the status should be same with the one in class BookingRestService\n assertEquals(\"Unexpected response status\",\n Response.Status.CONFLICT, e.getStatus());\n assertTrue(\"Unexpected error. Should be UniqueEmailException\",\n e.getCause() instanceof UniqueEmailException);\n assertEquals(\"Unexpected response body\", 1,\n e.getReasons().size());\n log.info(\"Invalid booking register attempt failed with return code \" + e.getStatus());\n }\n }", "@PreAuthorize(\"permitAll()\")\n @PostMapping(\"/users/\")\n public ResponseEntity<UserDTO> registerUser(@Valid @RequestBody User user) throws URISyntaxException {\n if (user.getId() != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_CUSTOM_ID,\n HeaderUtil.ERROR_MSG_CUSTOM_ID))\n .body(null);\n }\n\n // OPTION 1 - provided email is already in use by another user\n if (userService.getUserByEmail(user.getEmail()) != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_EMAIL_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_EMAIL_ALREADY_IN_USE))\n .body(null);\n }\n\n // OPTION 2 - provide username is already in use by another user\n if (userService.getUserByUsername(user.getUsername()) != null) {\n return ResponseEntity.\n badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_USERNAME_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_USERNAME_ALREADY_IN_USE))\n .body(null);\n }\n\n user.setVerified(false);\n User result = userService.save(user);\n\n mailSender.sendRegistrationMail(user.getFirstName(), user.getEmail(), null);\n\n return ResponseEntity.created(new URI(\"/api/users/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(Constants.EntityNames.USER, result.getId().toString()))\n .body(result.convertToDTO());\n }", "@PostMapping(\"/register-clerk\")\r\n\tpublic ResponseEntity<UserDto> registerClerk(@RequestBody UserDto userDto){\n\t\t\t\tString firstName = userDto.getFirstName();\r\n\t\t\t\tif (firstName == null || firstName.length() < 3 || firstName.length() > 100) {\r\n\t\t\t\t\t// Throw Invalid Data exception\r\n\r\n\t\t\t\tString lastName = userDto.getLastName();\r\n\t\t\t\tif (lastName == null || lastName.length() < 3 || lastName.length() > 100) {\r\n\t\t\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t\t\t}\r\n\t\t\t\tString email = userDto.getEmail();\r\n\t\t\t\tif(email == null|| email.length()< 3 || email.length()>100 ){\r\n\t\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t\t}\r\n\r\n\t\t\t\tString mobile = userDto.getMobile();\r\n\t\t\t\tif(mobile ==null ||mobile.length() <10 || mobile.length()>10){\r\n\t\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t}", "@Service\npublic interface RegisterService extends ICommService {\n boolean registerByEmail(String register_account,String register_password) throws ServiceException;\n boolean registerByPhone(String register_account,String register_password) throws ServiceException;\n}", "@Test\n public void postJson(){\n //prepare the request\n RestAssured.baseURI =\"http://restapi.demoqa.com/customer\";\n RequestSpecification request = RestAssured.given();\n\n // JSONObject is a class that represents a Simple JSON. it is from Json dependency\n // We can add Key - Value pairs using the put method\n JSONObject requestParams = new JSONObject();\n requestParams.put(\"FirstName\", \"Virender\");\n requestParams.put(\"LastName\", \"Singh\");\n\n requestParams.put(\"UserName\", \"simpleuser001\");\n requestParams.put(\"Password\", \"password1\");\n requestParams.put(\"Email\", \"[email protected]\");\n\n // Add a header stating the Request body is a JSON\n request.header(\"Content-Type\", \"application/json\");\n\n// Add the Json to the body of the request\n request.body(requestParams.toJSONString());\n\n// Post the request and check the response\n Response response = request.post(\"/register\");\n\n int statusCode = response.getStatusCode();\n // Assert.assertEquals(statusCode, \"201\");\n System.out.println(\"the status code is : \"+ statusCode);\n\n String successCode= response.jsonPath().get(\"SuccessCode\");\n System.out.println(successCode);\n\n }", "@Test\n public void validAdd() throws Exception {\n Logger.getGlobal().info(\"Start validAdd test\");\n RestaurantVO restaurant = new RestaurantVO();\n restaurant.setId(\"999\");\n restaurant.setName(\"Test Restaurant\");\n\n ResponseEntity<Restaurant> restaurants = restaurantController.add(restaurant);\n Assert.assertEquals(HttpStatus.CREATED, restaurants.getStatusCode());\n Logger.getGlobal().info(\"End validAdd test\");\n }", "@Test\n public void testRegisteredUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"[email protected]\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n // Duplicate request shouldn't change the result\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"[email protected]\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }" ]
[ "0.7300629", "0.7044915", "0.6649331", "0.6538899", "0.651867", "0.64329463", "0.63679826", "0.61925817", "0.6156291", "0.6139406", "0.6129829", "0.612259", "0.6121664", "0.6121383", "0.611975", "0.611935", "0.6106135", "0.60967755", "0.6090031", "0.60789627", "0.60699964", "0.6066798", "0.60124314", "0.6009939", "0.6009492", "0.6008096", "0.5993306", "0.5969623", "0.59651107", "0.5964933", "0.5949456", "0.5938288", "0.5930994", "0.59263706", "0.59209573", "0.5900856", "0.5889678", "0.5885937", "0.5868256", "0.586115", "0.58603805", "0.58087015", "0.58052146", "0.5801839", "0.5799695", "0.5793521", "0.5790091", "0.57829", "0.57702816", "0.5758315", "0.5750215", "0.5747452", "0.57396287", "0.5738159", "0.5735071", "0.5734489", "0.5730718", "0.5722198", "0.5708205", "0.5706775", "0.5703337", "0.5701824", "0.5701498", "0.5698062", "0.56960815", "0.5689997", "0.5682267", "0.56640124", "0.56563157", "0.56364805", "0.5629813", "0.56259537", "0.5625838", "0.56219155", "0.561904", "0.56174684", "0.5614029", "0.5612916", "0.5609625", "0.5608929", "0.5586471", "0.5583654", "0.5581909", "0.5579321", "0.5578464", "0.55756843", "0.55699605", "0.55670756", "0.5563176", "0.5537161", "0.5526213", "0.5525965", "0.55241215", "0.55188304", "0.55136704", "0.55133164", "0.55125135", "0.5508145", "0.55067164", "0.5500146" ]
0.7105627
1
This method is used to test register in controller layer. Service layer response is mocked and controller layer of register is validated. This method is validated when email already used by a user and service layer throws exception of EmailAlreadyExistException.
@Test void repeatedEmailTest() throws Exception { User userObj = new User(); userObj.setName("Siva Murugan"); userObj.setEmail("[email protected]"); userObj.setGender("M"); userObj.setMobileNumber(9878909878L); userObj.setRole("C"); userObj.setUsername("sivanew"); userObj.setPassword("Siva123@"); String userJson = new ObjectMapper().writeValueAsString(userObj); when(userService.registerUser(any(User.class))).thenThrow(new EmailAlreadyExistException("E_ER01")); mockMvc.perform(post("/vegapp/v1/users/register").contentType(MediaType.APPLICATION_JSON).content(userJson)) .andExpect(status().isConflict()).andExpect(jsonPath("$.errorMessage").value("E_ER01")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void registerUserTest3() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(emailTaken));\n\t}", "@Test\n\tpublic void registerUserTest4() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass1234\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(passwordsNoMatch));\n\t}", "@Test\n\tpublic void registerUserTest2() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(usernameTaken));\n\t}", "@Test\n public void testInvalidEmail() {\n email = \"[email protected]\";\n registerUser(username, password, password, email, email, forename, surname, null);\n assertNull(userService.getUser(username));\n }", "@SuppressWarnings(\"unchecked\")\n\t@Test\n\t@InSequence(3)\n\tpublic void testDuplicateEmail() throws Exception {\n\t\tCustomer customer = createCustomerInstance(\"Jane Doe\", \"[email protected]\", \"02125551234\");\n\t\tcustomerRestService.createCustomer(customer);\n\n\t\t// Register a different user with the same email\n\t\tCustomer anotherCustomer = createCustomerInstance(\"John Doe\", \"[email protected]\", \"02133551234\");\n\n\t\ttry {\n\t\t\tcustomerRestService.createCustomer(anotherCustomer);\n\t\t\tfail(\"Expected a RestServiceException to be thrown\");\n\t\t} catch (RestServiceException e) {\n\t\t\tassertEquals(\"Unexpected response status\", Response.Status.CONFLICT, e.getStatus());\n\t\t\tassertTrue(\"Unexecpted error. Should be Unique email violation\",\n\t\t\t\t\te.getCause() instanceof UniqueEmailException);\n\t\t\tassertEquals(\"Unexpected response body\", 1, e.getReasons().size());\n\t\t\tlog.info(\"Duplicate customer register attempt failed with return code \" + e.getStatus());\n\t\t}\n\n\t}", "public String register(RegisterRequest registerRequest) throws EmailAlreadyUsedException {\n if (this.userRepository.existsByEmail(registerRequest.getEmail())) {\n throw new EmailAlreadyUsedException(\"Error: Email is already in use!\");\n }\n // Create new user account\n User user = new User();\n user.setFirstName(registerRequest.getFirstName());\n user.setLastName(registerRequest.getLastName());\n user.setEmail(registerRequest.getEmail());\n user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));\n\n // Traitement des Roles\n Set<String> registerRequestRoles = registerRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n\n // find Roles\n if (registerRequestRoles == null) {\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n } else {\n registerRequestRoles.forEach(role -> {\n switch (role) {\n case \"super-admin\":\n Role superAdminRole = this.roleRepository.findByName(ERole.SUPER_ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(superAdminRole);\n\n break;\n case \"admin\":\n Role adminRole = this.roleRepository.findByName(ERole.ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(adminRole);\n break;\n case \"user\":\n Role userRole = this.roleRepository.findByName(ERole.USER)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(userRole);\n break;\n default:\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n }\n });\n }\n\n // Affect User Roles\n user.setRoles(roles);\n this.userRepository.save(user);\n return \"User registered successfully!\";\n }", "public String register(RegisterRequest registerRequest) throws EmailAlreadyUsedException,ResourceNotFoundException {\n if (this.userRepository.existsByEmail(registerRequest.getEmail())) {\n throw new EmailAlreadyUsedException(\"Error: Email is already in use!\");\n }\n // Create new user account\n User user = new User();\n user.setFirstName(registerRequest.getFirstName());\n user.setLastName(registerRequest.getLastName());\n user.setEmail(registerRequest.getEmail());\n user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));\n // Traitement des Roles\n Set<String> registerRequestRoles = registerRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n // find Roles\n if (registerRequestRoles == null) {\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n }else {\n registerRequestRoles.forEach(role -> {\n switch (role) {\n case \"super-admin\":\n Role superAdminRole = null;\n try {\n superAdminRole = this.roleRepository.findByName(ERole.SUPER_ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(superAdminRole);\n\n break;\n case \"admin\":\n Role adminRole = null;\n try {\n adminRole = this.roleRepository.findByName(ERole.ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(adminRole);\n break;\n case \"user\":\n Role userRole = null;\n try {\n userRole = this.roleRepository.findByName(ERole.USER)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(userRole);\n break;\n default:\n Role guestRole = null;\n try {\n guestRole = this.roleRepository.findByName(ERole.GUEST).orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(guestRole);\n }\n });\n }\n // Affect User Roles\n user.setRoles(roles);\n this.userRepository.save(user);\n return \"User registered successfully!\";\n }", "@Test\n\tvoid repeatedUsernameTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new UsernameAlreadyExistException(\"E_UR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_UR01\"));\n\t}", "@When(\"I try to register a new user with existing email\")\n\tpublic void i_try_to_register_a_new_user_with_existing_email() {\n\n\t\tString sql = \"select email from users\\n\" + \"where email is not null\\n\" + \" limit 1;\";\n\t\temail = (String) DBUtils.getCellValue(sql);\n\t\tassertNotNull(email);\n\n\t\tresponce = RestAssured.given().header(\"Authorization\", RestUtils.token).param(\"first-name\", \"Johnny\")\n\t\t\t\t.param(\"last-name\", \"Cage\").param(\"email\", email).param(\"password\", \"subzerobest\")\n\t\t\t\t.param(\"role\", \"student-team-member\").param(\"batch-number\", \"8\").param(\"team-name\", \"CodeHunters\")\n\t\t\t\t.param(\"campus-location\", \"VA\").when().post(RestAssured.baseURI + \"/api/students/student\");\n\n\t}", "@Test\n\tpublic void registerUserTest5() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.ofNullable(null));\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(500));\n\t}", "@Test\n\tvoid repeatedMobileNumberTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new MobileNumberAlreadyExistException(\"E_MR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_MR01\"));\n\t}", "@RequestMapping(value = \"/signup/validateEmail\", method = RequestMethod.POST)\n @ResponseBody\n public SPResponse validateEmail(@RequestParam String email) {\n SPResponse spResponse = new SPResponse();\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"The email to validate :\" + email);\n }\n // validate the email\n User user = userRepository.findByEmail(email); // signupForm.getEmail()\n if (user != null) {\n spResponse.addError(\"Duplicate_Email\",\n MessagesHelper.getMessage(\"exception.duplicateEmail.signup\"));\n } else {\n spResponse.isSuccess();\n }\n return spResponse;\n }", "@Test\n\tvoid validRegisterTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenReturn(true);\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isOk()).andExpect(content().string(\"true\"));\n\t}", "@Override\n\tpublic void checkDuplicateEmail(String email){\n\t\tif(userRepository.getUserByEmail(email) != null)\n\t\t\tthrow new BookException(HttpStatus.NOT_ACCEPTABLE,\"Email already exist\");\n\t}", "public String register() throws NonUniqueBusinessKeyException,\n ValidationException, ObjectNotFoundException,\n MailOperationException, RegistrationException {\n if (logger.isDebugLoggingEnabled()) {\n\n }\n\n String mId = getMarketplaceId();\n String parameter = getRequest().getParameter(\n Constants.REQ_PARAM_SERVICE_KEY);\n String outcome = BaseBean.OUTCOME_SUCCESS;\n\n Long serviceKey = null;\n if (parameter != null && parameter.trim().length() > 0) {\n serviceKey = Long.valueOf(parameter);\n }\n // FIXME: Must be fixed in identity service.\n if (!isInternalMode()) {\n // A confirmation mail must be send, not a user created mail.\n // If no password is given it will be generated\n password = \"\";\n }\n try {\n organization = getAccountingService().registerCustomer(\n getOrganization(), user.getVOUserDetails(), password,\n serviceKey, mId, getSupplierId());\n } catch (NonUniqueBusinessKeyException ex) {\n if (isInternalMode()) {\n throw ex;\n }\n ex.setMessageKey(BaseBean.ERROR_USER_ALREADY_EXIST);\n ExceptionHandler.execute(ex, true);\n return BaseBean.OUTCOME_ERROR;\n }\n if (logger.isDebugLoggingEnabled()) {\n\n }\n return outcome;\n }", "@Test\n\tpublic void registerUserTest7() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tUser user = new User();\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(user);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(201)).andExpect(content().json(objectMapper.writeValueAsString(user)));\n\t}", "@Test(expected = BusinessException.class)\n public void duplicateMail() {\n String email = \"[email protected]\";\n\n maillistService.addMailAddress(email);\n maillistService.addMailAddress(email);\n }", "@Test\n\tpublic void registerUserTest6() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(null);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(notSuccessful));\n\t}", "@Test\n @InSequence(2)\n public void testInvalidRegister() {\n //find a existed customer\n List<Customer> customers = customerService.findAllCustomers();\n Customer customer = customers.get(0);\n //find a existed taxi\n List<Taxi> taxis = taxiService.findAllTaxis();\n Taxi taxi = taxis.get(0);\n GuestBooking guestBooking = createGuestBookingInstance(customer, taxi.getId(), futureDate1);\n\n try {\n guestBookingRestService.createBooking(guestBooking);\n fail(\"Expected a RestServiceException to be thrown\");\n } catch(RestServiceException e) {\n // the status should be same with the one in class BookingRestService\n assertEquals(\"Unexpected response status\",\n Response.Status.CONFLICT, e.getStatus());\n assertTrue(\"Unexpected error. Should be UniqueEmailException\",\n e.getCause() instanceof UniqueEmailException);\n assertEquals(\"Unexpected response body\", 1,\n e.getReasons().size());\n log.info(\"Invalid booking register attempt failed with return code \" + e.getStatus());\n }\n }", "@Test\n public void testRegisterSuccessfully() {\n SignUpRequest request = new SignUpRequest(UNIQUE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).registered();\n }", "@Test\n void registerUser() throws Exception{\n\n final RegisterDto registerDto = new RegisterDto(\"[email protected]\", \"password\", \"John\", \"Doe\", \"2018\", \"Marnixplaats 18\", \"Antwerpen\", \"Antwerpen\", \"Belgium\");\n\n mockMvc.perform(post(\"/api/security/register\")\n .contentType(MediaType.APPLICATION_JSON_VALUE)\n .content(objectMapper.writeValueAsString(registerDto))).andExpect(status().isOk());\n\n final Users users = userService.findByUsername(\"[email protected]\");\n\n assertThat(users.getUsername()).isEqualTo(\"[email protected]\");\n assertThat(users.getFirstname()).isEqualTo(\"John\");\n assertThat(users.getLastname()).isEqualTo(\"Doe\");\n assertThat(users.getPostcode()).isEqualTo(\"2018\");\n assertThat(users.getAddress()).isEqualTo(\"Marnixplaats 18\");\n assertThat(users.getCity()).isEqualTo(\"Antwerpen\");\n assertThat(users.getProvince()).isEqualTo(\"Antwerpen\");\n assertThat(users.getCountry()).isEqualTo(\"Belgium\");\n\n }", "@Test\n public void testNonMatchingEmails() {\n registerUser(username, password, password, email, \"1\" + email, forename, surname, null);\n assertNull(userService.getUser(username));\n }", "@Test(expected = UserAlreadyExists.class)\n public void registryUserExists() throws Exception {\n\n User user_expected = new User();\n user_expected.setId(1L);\n user_expected.setName(\"nametest\");\n user_expected.setLast_name(\"lastnametest\");\n user_expected.setUsername(\"usernametest\");\n user_expected.setPassword(\"a7574a42198b7d7eee2c037703a0b95558f195457908d6975e681e2055fd5eb9\");\n\n given(userRepository.findByUsername(anyString())).willReturn(Optional.of(user_expected));\n\n User user_saved = userServiceImpl.registryUser(this.user);\n\n }", "User register(String firstName, String lastName, String username, String email) throws UserNotFoundException, EmailExistException, UsernameExistsException, MessagingException;", "@Test\n public void test_create_user_success() throws Exception {\n UserDto user = new UserDto(null, \"Arya\", \"Stark\", \"[email protected]\");\n UserDto newUser = new UserDto(1L, \"Arya\", \"Stark\", \"[email protected]\");\n\n when(userService.existsByEmail(user)).thenReturn(false);\n when(userService.createUser(user)).thenReturn(newUser);\n\n mockMvc.perform(post(\"/users\").contentType(MediaType.APPLICATION_JSON).content(asJsonString(user)))\n .andExpect(status().isCreated());\n\n verify(userService, times(1)).existsByEmail(user);\n verify(userService, times(1)).createUser(user);\n verifyNoMoreInteractions(userService);\n }", "@Test\n\tpublic void emailExistsAuth() {\n\t\tassertTrue(service.emailExists(\"[email protected]\"));\n\t}", "@PostMapping(path = \"/register\",\n produces={MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE})\n @Timed\n public ResponseEntity registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) {\n\n HttpHeaders textPlainHeaders = new HttpHeaders();\n textPlainHeaders.setContentType(MediaType.TEXT_PLAIN);\n\n return userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase())\n .map(user -> new ResponseEntity<>(\"login already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> userRepository.findOneByEmail(managedUserVM.getEmail())\n .map(user -> new ResponseEntity<>(\"e-mail address already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> {\n User user = userService\n .createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),\n managedUserVM.getFirstName(), managedUserVM.getLastName(),\n managedUserVM.getEmail().toLowerCase(), managedUserVM.getImageUrl(), managedUserVM.getLangKey());\n\n mailService.sendActivationEmail(user);\n return new ResponseEntity<>(HttpStatus.CREATED);\n })\n );\n }", "@Test\n\tpublic void registerUserTest1() throws Exception {\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).characterEncoding(\"UTF-8\")).andDo(print()).andExpect(status().is(400));\n\n\t}", "@PostMapping(value = \"/getValidExtUser\")\n\tpublic RestResponse<StgExtUserInfo> getValidExtUser(@RequestParam String email) {\t\n\t\tlogInfo(LOG, true, \"Ext user email : {} \", email);\t\t\n\t\tRestResponse<StgExtUserInfo> restResponse = new RestResponse<>(SUCCESS);\n\t\ttry {\n\t\t\tStgExtUserInfo extUser = userRegistrationService.getValidExtUser(email);\n\t\t\trestResponse.setResult(extUser);\n\t\t}catch(Exception e) {\n\t\t\tLOG.error(\"Exception : \", e);\n\t\t}\n\t\treturn restResponse;\t\t\n\t}", "@Test\n\tpublic void emailNotExistsAuth() {\n\t\tassertFalse(service.emailExists(\"[email protected]\"));\n\t}", "@Test(expected = AppException.class)\n public void testCreateEmailIncorrect() {\n User user = new User(\"login\", \"login(at)example.com\", \"Login Name\", \n \"12345678\");\n userService.create(user);\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<User> create(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the sign-up parameters from the post request\n String user = request.getParameter(\"user\");\n String first = request.getParameter(\"first\");\n String last = request.getParameter(\"last\");\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"pass\");\n\n String pattern = \"^[a-zA-Z0-9]*$\";\n\n // send an HTTP 422 response if any parameter is missing, empty, does not match the pattern (except email)\n if (user == null || user.isEmpty() || !user.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (first == null || first.isEmpty() || !first.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (last == null || last.isEmpty() || !last.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (email == null || email.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (pass == null || pass.isEmpty() || !pass.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // check to see if the userName or email are already taken\n List<User> uniqueAttributeCheck = userRepo.findByUserNameOrEmail(user, email);\n\n // send an HTTP 409 response if either already exists\n if (uniqueAttributeCheck.size() > 0) {\n return ResponseEntity.status(HttpStatus.CONFLICT).body(null);\n }\n\n User newUser;\n\n // create the new User and save it in the user repository\n try {\n newUser = userRepo.save(new User(user, first, last, email, pass));\n } catch (TransactionSystemException e) { // this exception will be thrown if the email does not validate\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // create a new session for the new User\n session = request.getSession();\n session.setAttribute(\"user\", user);\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user));\n\n // send an HTTP 201 response with the new session User\n return ResponseEntity.status(HttpStatus.CREATED).body(newUser.asSessionUser());\n }", "@PostMapping\n public User addUser(@Validated(value = Create.class) @RequestBody User user) {\n try {\n return userService.addUser(user);\n }catch (UserIdAlreadyExistsException exception){\n throw new UserIdAlreadyExistsException(\"User Id Already Exists\");\n }\n }", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }", "@Test\n\tpublic void createUsersServiceTestKo_emailNull() {\n\t\tUserDto user = null;\n\t\tDate now = Calendar.getInstance().getTime();\n\t\tString password;\n\t\tList<Profil> listProfils = profilService.findAll();\n\n\t\ttry {\n\t\t\t//insert users\n\t\t\t\tpassword = new String(\"Password\");\n\t\t\t\tuser = new UserDto();\n\t\t\t\tuser.setFirstname(\"firstname\");\n\t\t\t\tuser.setModificationDate(now);\n\t\t\t\tuser.setCreationDate(now);\n\t\t\t\tuser.setUserLastname(\"lastname\");\n\t\t\t\tuser.setProfil(listProfils.get(0));\n\t\t\t\tuser.setPassword(password);\n\t\t\t\tuserService.createUser(user);\n\t\t\t\tfail();\n\t\t} catch (ConstraintViolationException e) {\n\t\t\te.printStackTrace();\n\t\t\tSet<ConstraintViolation<?>> violations = e.getConstraintViolations();\n\t\t\tif (violations.size() > 1)\n\t\t\t\tfail();\n\t\t\tIterator<ConstraintViolation<?>> iter = violations.iterator();\n\t\t\tConstraintViolation<?> violationInError = iter.next();\n\t\t\t\tString msgTemplate = violationInError.getMessageTemplate();\n\t\t\t\tassertThat(\"{javax.validation.constraints.NotNull.message}\", equalTo(msgTemplate));\n\t\t} catch (HangTechnicalException e) {\n\t\t\tassertThat(\"Erro while saving user\", equalTo(e.getMessage()));\n\t\t\tassertTrue(e.getCause() instanceof ConstraintViolationException);\n\t\t\tConstraintViolationException exp = (ConstraintViolationException) e.getCause();\n\t\t\tSet<ConstraintViolation<?>> violations = exp.getConstraintViolations();\n\t\t\tif (violations.size() > 1)\n\t\t\t\tfail();\n\t\t\tIterator<ConstraintViolation<?>> iter = violations.iterator();\n\t\t\tConstraintViolation<?> violationInError = iter.next();\n\t\t\t\tString msgTemplate = violationInError.getMessageTemplate();\n\t\t\t\tassertThat(\"{javax.validation.constraints.NotNull.message}\", equalTo(msgTemplate));\n\t\t} \n\t}", "@PreAuthorize(\"permitAll()\")\n @PostMapping(\"/users/\")\n public ResponseEntity<UserDTO> registerUser(@Valid @RequestBody User user) throws URISyntaxException {\n if (user.getId() != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_CUSTOM_ID,\n HeaderUtil.ERROR_MSG_CUSTOM_ID))\n .body(null);\n }\n\n // OPTION 1 - provided email is already in use by another user\n if (userService.getUserByEmail(user.getEmail()) != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_EMAIL_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_EMAIL_ALREADY_IN_USE))\n .body(null);\n }\n\n // OPTION 2 - provide username is already in use by another user\n if (userService.getUserByUsername(user.getUsername()) != null) {\n return ResponseEntity.\n badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_USERNAME_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_USERNAME_ALREADY_IN_USE))\n .body(null);\n }\n\n user.setVerified(false);\n User result = userService.save(user);\n\n mailSender.sendRegistrationMail(user.getFirstName(), user.getEmail(), null);\n\n return ResponseEntity.created(new URI(\"/api/users/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(Constants.EntityNames.USER, result.getId().toString()))\n .body(result.convertToDTO());\n }", "@PostMapping\n public @ResponseBody\n ResponseEntity<Object> register(@RequestParam(\"firstName\") final String firstName,\n @RequestParam(\"lastName\") final String lastName,\n @RequestParam(\"username\") final String username,\n @RequestParam(\"password\") final String password,\n @RequestParam(\"email\") final String email) {\n\n Person person = personService.getPersonByCredentials(username);\n\n final String securePassword = HashPasswordUtil.hashPassword(password);\n\n if (person == null) {\n\n person = new Person(username, securePassword, firstName, lastName, email, PersonType.USER);\n\n try {\n personService.add(person);\n } catch (IllegalArgumentException e) {\n logger.error(e.getMessage());\n }\n person = personService.getPersonByCredentials(username);\n\n ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();\n HttpSession session = attr.getRequest().getSession(true); // true == allow create\n session.setAttribute(\"user\", username);\n session.setAttribute(\"userId\", person.getIdPerson());\n\n return ResponseEntity.status(HttpStatus.OK).body(null);\n } else {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n }", "@ApiOperation(value = \" Registration information \", tags = \"Register\")\n\n\t@PostMapping(\"/register\")\n\tpublic String addUser(@RequestParam String emailId,@RequestParam String name,@RequestParam String passwd) throws Exception\n\t{\n\t \n\t\tif(emailId!=null && !\"\".equals(emailId))\n\t\t{\n\t\t\tUser userObj=userservice.fetchByUserEmailId(emailId);\n\t\t\t\n\t\t\tif(userObj!=null) {\n\t\t return \"User with \"+emailId+\" is already exist\";\n\t\t }\n\t\t\t \n\t\t\t\n\t\t}\n\t\t User user =new User(name,emailId,passwd);\n\t\t\n\t\t // genrate 4 digit otp number\n\t\t int myotp=(int)(Math.random() * (8015)) + 2085;\n\t \t\tboolean status=emailservice.SendEmail(\"Otp is \"+myotp , emailId) ;\n\t if(!status)\n\t {\n\t \t return \"Not sending Mail\";\n\t } \n\t LocalTime time=LocalTime.now(); \n\t LocalDate date=LocalDate.now();\n\t user.setOtp(myotp);\n \t user.setActive(false);\n \t user.setLocalDate(date);\n \t user.setLocalTime(time);\n\t userservice.addUser(user);\n\t \n\t\treturn \"verification Start.....\";\n\t}", "@Test\n public void testConfirmationEmail() throws Exception {\n User user = new User(username, password);\n user = userService.save(user);\n String token = registerController.generateUserToken(user);\n assert !user.isEnabled();\n\n String response = restTemplate.getForObject(url + \"/token/\" + token, String.class);\n user = userService.getUser(username);\n assert user.isEnabled();\n }", "@Test\n public void createNewUserByExternalTokenAndCheckIt() throws Exception {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserToken(UUID.randomUUID().toString());\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n\n //Add login and expect new user successful registration\n userLogin.setUserLogin(\"[email protected]\");\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n assertThat(userResponse.getUserMail().equals(userLogin.getUserLogin()));\n assertThat(userResponse.getUserPoints()).size().isEqualTo(5);\n }", "@RequestMapping(value = \"/register/Retailer/{firstname}/{surname}/{password}/{userType}/{phone}/{gender}/{yob}/{emailAddress:.+}\",\n method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> registerRetailer (@PathVariable(\"firstname\") String firstname,\n @PathVariable(\"surname\") String surname,\n @PathVariable(\"password\") String password,\n @PathVariable(\"userType\") String userType,\n @PathVariable(\"phone\") String phone,\n// @PathVariable(\"retailerid\") int retailerid,\n @PathVariable(\"gender\") String gender,\n @PathVariable(\"yob\") int yob,\n @PathVariable(\"emailAddress\") String emailAddress\n ) throws ParseException {\n\n httpStatus = HttpStatus.OK;\n respMap = new HashMap<>();\n\n User user = userRepo.findByEmailAddress(emailAddress);\n\n if (user == null) {\n user = new User();\n if (checkPasswordFormat(password)) {\n user.setFirstname(firstname);\n user.setSurname(surname);\n user.setEmailAddress(emailAddress);\n user.setPassword(password);\n user.setPhone(phone);\n user.setGender(gender);\n user.setYob(yob);\n user.setType(userType);\n\n userRepo.save(user);\n\n respMap.put(\"message\",\"User created successfully\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n respMap.put(\"success\",\"1\");\n\n } else {\n respMap.put(\"message\",\"Password Incorrect: >= 6 and <= 20, at least one number, upper and lowercase character\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n } else {\n\n respMap.put(\"message\",\" - This email address is already in use, please chose another email address\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "@Test \n\tpublic void testRegisterValidUser() throws Exception {\n\t\tapp.getMailinatorHelper().getEmailsNumber();\n//\t\tbasePage.fillInRegistrationForm();\n\t\t\n\t\t//Step 1: Register valid user\n\t\t//\t\tStep 1-1: Fill and send form\n\t\t//\t\tStep 1-2: Get confirm email\n\t\t//\t\tStep 1-3: Confirm registration\n\t\t//\t\tStep 1-4: Check relogin\n\t\t//\t\tStep 1-1: Register valid user\n\t\t//\t\tStep 1-1: Register valid user\n\t\t//Step 2: Check that user successfully registered\n\t\t\n\t}", "@Test\n public void testCantRegisterInvalidEmail() {\n enterValuesAndClick(\"\", \"invalidemail\", \"123456\", \"123456\");\n checkErrors(nameRequiredError, emailInvalidError, pwdNoError, pwdRepeatNoError);\n }", "@Test\n @DisplayName(\"Should return 400 exception if 1+ emails in InviteRegisteredResource are not in email format for POST /bills/{billId}/accounts\")\n void shouldReturnExceptionIfListEmailsNotEmailFormatInInviteRegisteredResourceGivenPost() throws Exception {\n final var inviteRegisteredResource = InviteRegisteredResourceFixture.getDefault();\n final var user = UserFixture.getDefault();\n final var existentEmail = \"[email protected]\";\n final var invalidEmail = \"notemailformatcom\";\n inviteRegisteredResource.setAccounts(List.of(existentEmail, invalidEmail));\n final var existentBillId = 1000L;\n final var path = String.format(BILL_BILLID_ACCOUNTS_ENDPOINT, existentBillId);\n final var authorities = new ArrayList<GrantedAuthority>();\n authorities.add(new SimpleGrantedAuthority(\"RESPONSIBLE_\" + existentBillId));\n\n //When/Then\n final MvcResult result = performMvcPostRequestWithoutBearer(path, inviteRegisteredResource, 400, user.getUsername(), authorities);\n final ApiError error = verifyInvalidInputs(result, 1);\n assertThat(error.getErrors().get(0).getMessage()).isEqualTo(NOT_IN_EMAIL_FORMAT);\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signupRequest) {\n System.out.println(\"Creating User \" + signupRequest);\n\n if (userAccountDetailsService.isUserExistByUsername(signupRequest.getUsername())) {\n System.out.println(\"A User with username: \" + signupRequest.getUsername() + \" already exist\");\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n\n UserAccount userAccount = new UserAccount();\n userAccount.setName(signupRequest.getName());\n userAccount.setUsername(signupRequest.getUsername());\n userAccount.setAge(signupRequest.getAge());\n userAccount.setPassword(passwordEncoder.encode(signupRequest.getPassword()));\n\n Set<String> roles = signupRequest.getRole();\n Set<Authorities> authorities = new HashSet<>();\n for(String role: roles) {\n Authorities authority = new Authorities();\n authority.setAuthority(role);\n authority.setUserAccount(userAccount);\n authorities.add(authority);\n }\n userAccount.setAuthorities(authorities);\n\n userAccountDetailsService.saveUser(userAccount);\n\n return new ResponseEntity<Void>(HttpStatus.CREATED);\n }", "@Test\n public void testRegisteredUser() throws IOException {\n Map<String, Object> attr = new HashMap<>();\n String id = \"123\";\n attr.put(\"com.google.appengine.api.users.UserService.user_id_key\", id);\n helper.setEnvEmail(\"[email protected]\")\n .setEnvAttributes(attr)\n .setEnvAuthDomain(\"example.com\")\n .setEnvIsLoggedIn(true)\n .setUp();\n\n ArgumentCaptor<String> captor = ArgumentCaptor.forClass(String.class);\n\n HttpServletRequest request = mock(HttpServletRequest.class);\n HttpServletResponse response = mock(HttpServletResponse.class);\n\n StringWriter stringWriter = new StringWriter();\n PrintWriter writer = new PrintWriter(stringWriter);\n writer.flush();\n when(response.getWriter()).thenReturn(writer);\n\n assertNull(ofy().load().type(UserObject.class).id(id).now());\n\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n // Duplicate request shouldn't change the result\n new LoginRegistrationServlet().doGet(request, response);\n writer.flush();\n\n verify(response, atLeast(1)).sendRedirect(captor.capture());\n assertEquals(\"/home\", captor.getValue());\n\n UserObject result = ofy().load().type(UserObject.class).id(id).now();\n\n assertEquals(result.getId(), id);\n assertEquals(result.getUsername(), \"test\");\n assertEquals(result.getEmail(), \"[email protected]\");\n assertEquals(result.getProfilePicUrl(), \"\");\n }", "@Test\n public void createNewUserAndCheckIt() {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserLogin(\"068-068-68-68\");\n userLogin.setUserPassword(\"12345\");\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n\n //Successful registration\n userLogin.setUserPasswordNew(\"12345\");\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n\n assertThat(userResponse.getUserPhone().equals(usersService.normalizeAndCheckPhoneFormat(userLogin.getUserLogin())));\n assertThat(userResponse.getUserPoints()).size().isEqualTo(5);\n }", "@Test\n public void processRegistration() throws Exception {\n String newUserName = \"goodusername\";\n long numberOfExpectedUsers = userRepository.count() + 1;\n mockMvc.perform(post(RegistrationController.BASE_URL)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .param(userNameField, newUserName)\n .param(passwordField, samplePasswordValue)\n .param(verifyPasswordField, samplePasswordValue))\n .andExpect(view().name(SearchController.REDIRECT + IndexController.URL_PATH_SEPARATOR))\n .andExpect(status().is3xxRedirection());\n long updatedNumberOfUsers = userRepository.count();\n assertEquals(numberOfExpectedUsers, updatedNumberOfUsers);\n }", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@POST\n @Path(\"Signup\")\n public Response signup(JpaAccount account,\n @Context HttpServletRequest request) {\n Response r;\n if (this.checkEmailString(account.getEmail())) {\n if (account.getUsername().equals(\"\") || !this.checkExistingUsername(account.getUsername())) {\n User user;\n Subject subject = SecurityUtils.getSubject();\n\n if (subject.isAuthenticated() && accountFacade.find((Long) subject.getPrincipal()) instanceof GuestJpaAccount) {\n GuestJpaAccount from = (GuestJpaAccount) accountFacade.find((Long) subject.getPrincipal());\n subject.logout();\n userFacade.upgradeGuest(from, account);\n r = Response.status(Response.Status.CREATED).build();\n } else {\n // Check if e-mail is already taken and if yes return a localized error message:\n try {\n accountFacade.findByEmail(account.getEmail());\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail est déjà prise.\" : \"This email address is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n } catch (WegasNoResultException e) {\n // GOTCHA\n // E-Mail not yet registered -> proceed with account creation\n user = new User(account);\n userFacade.create(user);\n r = Response.status(Response.Status.CREATED).build();\n }\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Ce nom d'utilisateur est déjà pris.\" : \"This username is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail n'est pas valide.\" : \"This e-mail address is not valid.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n return r;\n }", "@Override\n public ResponseEntity<String> createUser(@ApiParam(value = \"\" ,required=true ) @Valid @RequestBody User user) {\n String problem = detectFormatProblemInUser(user);\n if(problem != null) {\n return new ResponseEntity<>(problem, HttpStatus.BAD_REQUEST);\n }\n // Used to prevent bruteforce listing of existing emails\n try {\n Thread.sleep(200);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n // Ensure the email is not already taken by another user\n if(userRepository.findById(user.getEmail()).isPresent()) {\n return new ResponseEntity<>(\"The email address is already taken\", HttpStatus.CONFLICT);\n }\n // We can store the new user in the database\n userRepository.save(userToUserEntity(user));\n return new ResponseEntity<>(\"User created successfully\", HttpStatus.CREATED);\n }", "@Then(\"^i should have an error message that An account using this email address has already been registered\\\\. Please enter a valid password or request a new one\\\\.$\")\n public void i_should_have_an_error_message_that_An_account_using_this_email_address_has_already_been_registered_Please_enter_a_valid_password_or_request_a_new_one() throws Throwable {\n AlreadyUserPage alreadyuserpage = PageFactory.initElements(driver, AlreadyUserPage.class);\n alreadyuserpage.verify_email_already_registered();\n\n }", "void ensureUserCreationAllowed(String email, String userName) throws BadRequestException, ConflictException, ServerException;", "@Test\n public void testRegisterDuplicateUsername() {\n SignUpRequest request = new SignUpRequest(DUPLICATE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).duplicateUsername();\n\n try {\n verify(connection, never()).register(request);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Override\n\tpublic User findDuplicateByEmail(String email) {\n\t\tUser dbUser = userRepository.findByEmail(email);\n\t\tif (dbUser != null) {\n\t\t\tthrow new RuntimeException(\"User Already Registered.\");\n\t\t}\n\t\treturn null;\n\t}", "private void registerEmailAddr() {\r\n\t\t\t\tWindow.setTitle(Common.APPNAME);\r\n\t\t\t\tmanualRegisterBtn.setEnabled(false);\r\n\t\t\t\tfinal String emailAddrProvided = emailAddrField.getText();\r\n\t\t\t\tserverResponseLabel.setText(\"\");\r\n\t\t\t\tregisterService.manualRegister(emailAddrProvided,\r\n\t\t\t\t\tnew AsyncCallback<String>() {\r\n\t\t\t\t\t\tpublic void onFailure(Throwable caught) {\r\n\t\t\t\t\t\t\t// Show the RPC error message to the user\r\n\t\t\t\t\t\t\tdialogBox.setText(\"Email Address Registration - Failure\");\r\n\t\t\t\t\t\t\tdialogBox.center();\r\n\t\t\t\t\t\t\tcloseButton.setFocus(true);\r\n\t\t\t\t\t\t\tdialogBox.show();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tpublic void onSuccess(String result) {\r\n\t\t\t\t\t\t\tif (\"Verified\".equalsIgnoreCase(result)) {\r\n\t\t\t\t\t\t\t\tString registerReturnUri = GWT.getHostPageBaseURL() + REGISTER_RETURN_URI;\r\n\t\t\t\t\t\t\t\tWindow.open(registerReturnUri, \"_self\", \"\"); \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\temailAddrField.setText(\"\");\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tWindow.alert(result);\r\n\t\t\t\t\t\t\t\t*/\r\n\t\t\t\t\t\t\t\tdialogBox.center();\r\n\t\t\t\t\t\t\t\tdialogBox.setAnimationEnabled(true);\r\n\t\t\t\t\t\t\t\tdialogBox.setWidth(\"320px\");\r\n\t\t\t\t\t\t\t\tdialogBox.setText(result);\r\n\t\t\t\t\t\t\t\tcloseButton.setFocus(true);\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tmanualRegisterBtn.setEnabled(true);\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}", "@Override\n //public void save(User user) throws PasswordConfirmationException, PasswordConfirmationEmptyException, DuplicateMailException, DuplicateHandleException {\n public void save(User user) throws UserValidationException {\n StringBuilder strExceptions = new StringBuilder();\n String passConfirmation = user.getPasswordConfirmation();\n\n if (user.getEmail() == null || user.getEmail().equals(\"\")) {\n strExceptions.append(\"[EmptyEmailException] Mail address not provided\");\n }\n\n if (user.getHandle() == null || user.getHandle().length() < 3) {\n if (strExceptions.length() > 0) {\n strExceptions.append(\"\\n\");\n }\n\n strExceptions.append(\"[HandleLengthException] User handle empty or not long enough\");\n }\n\n if (user.getPassword() == null || user.getPassword().length() < 8) {\n if (strExceptions.length() > 0) {\n strExceptions.append(\"\\n\");\n }\n\n strExceptions.append(\"[PasswordLengthException] User password empty or not long enough\");\n }\n\n if (!user.getPassword().equals(passConfirmation)) {\n //throw new PasswordConfirmationException(\"Passwords do not match\");\n if (strExceptions.length() > 0) {\n strExceptions.append(\"\\n\");\n }\n\n strExceptions.append(\"[PasswordConfirmationException] Passwords do not match\");\n }\n\n if (passConfirmation == null || passConfirmation.equals(\"\")) {\n //throw new PasswordConfirmationEmptyException(\"Password confirmation turned up empty\");\n if (strExceptions.length() > 0) {\n strExceptions.append(\"\\n\");\n }\n\n strExceptions.append(\"[PasswordConfirmationEmptyException] Password confirmation turned up empty\");\n }\n\n List<User> results = userRepository.findByMailOrHandle(user.getEmail(), user.getHandle());\n\n // If size == 0 -> this is skipped\n for (int x = 0; x < results.size(); x++) {\n User u = results.get(x);\n\n if (u.getEmail().equals(user.getEmail())) {\n //throw new DuplicateMailException(\"Email is already taken\");\n if (strExceptions.length() > 0) {\n strExceptions.append(\"\\n\");\n }\n\n strExceptions.append(\"[DuplicateMailException] Email is already taken\");\n }\n else if (u.getHandle().equals(user.getHandle())) {\n //throw new DuplicateHandleException(\"Handle is already taken\");\n if (strExceptions.length() > 0) {\n strExceptions.append(\"\\n\");\n }\n\n strExceptions.append(\"[DuplicateHandleException] Handle is already taken\");\n }\n }\n\n String encodedPassword = passwordEncoder.encode(user.getPassword());\n user.setPassword(encodedPassword);\n\n if (strExceptions.length() > 0) {\n throw new UserValidationException(strExceptions.toString());\n }\n\n userRepository.save(user);\n }", "@Test\r\n\tpublic void TC_08_verify_Existing_Email_Address() {\r\n\r\n\t\thomePgObj = new Page_Home(driver);\r\n\t\tregPgObj = homePgObj.click_RegistrationLink();\r\n\t\t\r\n\t\t// Step 1: Verify the registration page is displayed\r\n\t\t\r\n\t\tflag = regPgObj.registrationPgDisplay();\r\n\t\tAssert.assertTrue(flag, \"Registration page is displayed\");\r\n\t\t\r\n\t\t// Step 2: Enter valid/mandatory registration details with valid email address already taken\r\n\t\t\r\n\t\tregPgObj.enterRegistrationDetails(\"firstName\", firstName);\r\n\t\tregPgObj.enterRegistrationDetails(\"lastName\", lastName);\r\n\t\tregPgObj.enterRegistrationDetails(\"email\", email);\r\n\t\tregPgObj.enterRegistrationDetails(\"password\", password);\r\n\t\tregPgObj.enterRegistrationDetails(\"confirmPassword\", confirmPassword);\r\n\t\t\r\n\t\t// Step 3: Click on Sign in button\r\n\t\t\r\n\t\tregPgObj.clickSignInButton();\r\n\t\t\r\n\t\t// Step 4: Verify user should NOT be able to proceed further with registration as proper validation message regarding already registered\r\n\t\t//email address is displayed\r\n\t\terrMsg = Page_Registration.getMandatoryFieldErrMsg();\r\n\t\tAssert.assertEquals(errMsg, \"Username already taken.\");\r\n\r\n\t}", "public Boolean register(HttpServletRequest request) throws Exception;", "@PostMapping(value = \"/email\")\n public ResponseEntity<Email> enviarEmail( @RequestBody Email email){\n try {\n emailService.sendEmail(email);\n return new ResponseEntity<>(email, HttpStatus.OK);\n } catch( MailException e){\n return new ResponseEntity<>(null, HttpStatus.INTERNAL_SERVER_ERROR);\n }\n\n\n }", "@Test\n public void testRepeatRegistration(){\n UserRegisterKYC userRegister = new UserRegisterKYC(\"hello\", validId2, \"26/02/1995\",\"738583\");\n int requestResponse = userRegister.sendRegisterRequest();\n requestResponse = userRegister.sendRegisterRequest();\n assertEquals(500,requestResponse);\n }", "boolean registerUser(UserRegisterDTO userRegisterDTO);", "@Test\n @Transactional\n public void updateUserExistingEmail() throws Exception {\n userRepository.saveAndFlush(user);\n User anotherUser = new User();\n anotherUser.setLogin(\"jhipster\");\n anotherUser.setPassword(RandomStringUtils.random(60));\n anotherUser.setActivated(true);\n anotherUser.setEmail(\"jhipster@localhost\");\n anotherUser.setFirstName(\"java\");\n anotherUser.setLastName(\"hipster\");\n anotherUser.setImageUrl(\"\");\n anotherUser.setLangKey(\"en\");\n userRepository.saveAndFlush(anotherUser);\n // Update the user\n User updatedUser = userRepository.findById(user.getId()).get();\n ManagedUserVM managedUserVM = new ManagedUserVM();\n managedUserVM.setId(updatedUser.getId());\n managedUserVM.setLogin(updatedUser.getLogin());\n managedUserVM.setPassword(updatedUser.getPassword());\n managedUserVM.setFirstName(updatedUser.getFirstName());\n managedUserVM.setLastName(updatedUser.getLastName());\n managedUserVM.setEmail(\"jhipster@localhost\");// this email should already be used by anotherUser\n\n managedUserVM.setActivated(updatedUser.getActivated());\n managedUserVM.setImageUrl(updatedUser.getImageUrl());\n managedUserVM.setLangKey(updatedUser.getLangKey());\n managedUserVM.setCreatedBy(updatedUser.getCreatedBy());\n managedUserVM.setCreatedDate(updatedUser.getCreatedDate());\n managedUserVM.setLastModifiedBy(updatedUser.getLastModifiedBy());\n managedUserVM.setLastModifiedDate(updatedUser.getLastModifiedDate());\n managedUserVM.setAuthorities(Collections.singleton(USER));\n restUserMockMvc.perform(content(TestUtil.convertObjectToJsonBytes(managedUserVM))).andExpect(status().isBadRequest());\n }", "@Test\n public void test_IsEmailValid(){\n UserRegistration obj = new UserRegistration();\n boolean result = obj.checkEmailValidation(\"[email protected]\");\n assertThat(result, is(true));\n }", "@RequestMapping(value = \"/register/Mobile/{firstname}/{surname}/{password}/{phone}/{gender}/{yob}/{emailAddress:.+}\",\n method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> registerMobile (@PathVariable(\"firstname\") String firstname,\n @PathVariable(\"surname\") String surname,\n @PathVariable(\"password\") String password,\n @PathVariable(\"phone\") String phone,\n @PathVariable(\"gender\") String gender,\n @PathVariable(\"yob\") int yob,\n @PathVariable(\"emailAddress\") String emailAddress\n ) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n User user = userRepo.findByEmailAddress(emailAddress);\n\n if (user == null) {\n user = new User();\n\n if (checkPasswordFormat(password)) {\n user.setFirstname(firstname);\n user.setSurname(surname);\n user.setEmailAddress(emailAddress);\n user.setPassword(password);\n user.setType(\"Mobile\");\n user.setPhone(phone);\n user.setGender(gender);\n user.setYob(yob);\n // administrators and Mobile users are automatically enabled.\n user.setApproved( true );\n\n userRepo.save(user);\n\n // add empty user-point records for the new user against each retailer.\n\n List<Retailer> retailers = retailerRepo.findAll();\n for(Retailer retailer : retailers) {\n UserPoint newUserPoint = new UserPoint(user.getUserid(), retailer.getRetailerid(), 0);\n userPointRepo.save(newUserPoint);\n }\n\n respMap.put(\"message\",\"User created successfully\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n respMap.put(\"success\",\"1\");\n\n\n } else {\n respMap.put(\"message\",\"Password Incorrect: >= 6 and <= 20, at least one number, upper and lowercase character\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n } else {\n respMap.put(\"message\",\" - This email address is already in use, please chose another email address\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "public synchronized User registerUser(String email) {\r\n // registering happens rarely, so we'll just iterate through the userMap.\r\n for (User user : this.email2user.values()) {\r\n if (user.getEmail().equals(email)) {\r\n return user;\r\n }\r\n }\r\n // if we got here, we need to create a new User.\r\n User user = new User();\r\n user.setEmail(email);\r\n user.setProperties(new Properties());\r\n // Password is either their Email in the case of a test user, or the randomly generated string.\r\n String password = \r\n email.endsWith(server.getServerProperties().get(TEST_DOMAIN_KEY)) ? \r\n email : PasswordGenerator.make();\r\n user.setPassword(password);\r\n this.putUser(user);\r\n return user;\r\n }", "@Test\n public void registerServerError() throws Exception {\n user.setUsername(\"thatssssaaaaaaaaaaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeryyyyyylo\" +\n \"oooooooooonggggusernameeeeeeeeeeeeeeeeee\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "public void signUpWithEmail(final String email, final String firstName,\n final String lastName, final String password, String gender,\n final Date dateOfBirth, final Double heightInMeters,\n final Double weightInKg,\n final ServiceClientCompletion<ResponseResult> completion)\n {\n // Validate email format.\n if (!isEmailFormat(email) && completion != null)\n {\n final ResponseResult result =\n new ResponseResult(\n false,\n \"Please enter a valid email.\",\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS);\n completion\n .onCompletion(\n ServiceResultStatus.FAILED,\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS,\n result);\n return;\n }\n\n // create request headers\n final HashMap<String, String> headers = new HashMap<String, String>(2);\n headers.put(\"Authorization\", AUTHORIZATION_HEADER);\n headers.put(\"Content-Type\", \"application/json\");\n\n // body\n final Map<String, Object> body = new HashMap<String, Object>(9);\n body.put(FIRST_NAME, firstName);\n body.put(LAST_NAME, lastName);\n body.put(EMAIL, email);\n body.put(PASSWORD, password);\n body.put(REMEMBER_ME, \"true\");\n if (!StringHelper.isNullOrEmpty(gender))\n {\n // MALE and FEMALE are only valid options, and case sensitive.\n gender = gender.toUpperCase(Locale.US);\n body.put(GENDER, gender);\n }\n if (dateOfBirth != null)\n {\n // Convert to ISO 8601 string.\n final DateFormat df = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.US);\n body.put(DATE_OF_BIRTH, df.format(dateOfBirth) + \"T12:00:00Z\");\n }\n if (heightInMeters != null)\n {\n body.put(HEIGHT, heightInMeters);\n }\n if (weightInKg != null)\n {\n body.put(WEIGHT, weightInKg);\n }\n\n final Gson gson = new GsonBuilder().create();\n final String bodyJson = gson.toJson(body);\n\n this.beginRequest(REGISTER_ENDPOINT, ServiceMethod.PUT, headers, null,\n bodyJson, ServiceResponseFormat.GSON,\n new ServiceResponseTransform<JsonElement, ResponseResult>()\n {\n @Override\n public ResponseResult transformResponseData(\n final JsonElement json)\n throws ServiceResponseTransformException\n {\n final ResponseResult result =\n checkResultFromAuthService(json);\n if (!StringHelper.isNullOrEmpty(result.errorMessage)\n && result.errorMessage.toLowerCase(Locale.US).contains(\n \"attempt to insert duplicate record\"))\n {\n result.success = false;\n result.errorMessage =\n \"That email is already registered.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS;\n }\n else if (result.success)\n {\n final boolean success =\n setSharecareToken(json, false, false);\n if (!success)\n {\n result.success = false;\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_DATA;\n }\n }\n else\n {\n result.success = false;\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_DATA;\n if (!StringHelper.isNullOrEmpty(result.errorMessage)\n && result.errorMessage.toLowerCase(Locale.US)\n .contains(\"invalid email address\"))\n {\n result.errorMessage = \"Please enter a valid email.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS;\n }\n else if (!StringHelper\n .isNullOrEmpty(result.errorMessage)\n && result.errorMessage.toLowerCase(Locale.US)\n .contains(\"account already exists\"))\n {\n result.errorMessage =\n \"That email is already registered. Please try again with another email.\";\n result.responseCode =\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS;\n }\n }\n\n if (result.responseCode != ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_SUCCESS\n && result.responseCode != ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS)\n {\n result.success = false;\n result.errorMessage = \"ERROR\";\n }\n\n LogError(\"signUpWithEmail\", result);\n return result;\n }\n }, new ServiceClientCompletion<ResponseResult>()\n {\n\n @Override\n public void onCompletion(\n final ServiceResultStatus serviceResultStatus,\n final int responseCode, ResponseResult resultValue)\n {\n if (completion != null)\n {\n if (resultValue == null)\n {\n resultValue =\n new ResponseResult(\n false,\n \"ERROR\",\n ServiceClientConstants.SERVICE_RESPONSE_STATUS_CODE_BAD_PARAMETERS);\n }\n\n completion.onCompletion(resultValue.success\n ? ServiceResultStatus.SUCCESS\n : ServiceResultStatus.FAILED,\n resultValue.responseCode, resultValue);\n }\n }\n });\n }", "@PostMapping(\"/register\")\n\tpublic ResponseEntity<User> addUser(@Valid @RequestBody UserRequestDTO userRequest, UriComponentsBuilder ucBuilder) {\n\n\t\tUser existUser = this.userService.findByEmail(userRequest.getEmail());\n\t\tif (existUser != null) {\n\t\t\tthrow new ResourceConflictException(0L/*userRequest.getEmail()*/, \"Email already exists\");\n\t\t}\n\t\tUser user = this.userService.createPatient(userRequest);\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.setLocation(ucBuilder.path(\"/api/user/{userId}\").buildAndExpand(user.getId()).toUri());\n\t\tthis.emailNotificationService.sendNotificationAsync(user.getEmail(), \"Account Validation\", \"Visit this link and validate your account: http://localhost:8083/api/auth/validate/\" + user.getId() + \"/\");\n\t\treturn new ResponseEntity<>(user, HttpStatus.CREATED);\n\t}", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@RequestBody RegistrationRequest registrationRequest){\n return userService.registerUser(registrationRequest);\n }", "@PostMapping(\"/sign-up\") //method handles POST requests with this path (signup)\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signUpRequest) {\n if (userRepository.existsByUsername(signUpRequest.getUsername())) {\n // if so, throw 400 status and error message\n return ResponseEntity\n .badRequest()\n .body(new MessageResponse(\"Error: Username is already taken!\"));\n }\n\n // checks is email is already in use\n if (userRepository.existsByEmail(signUpRequest.getEmail())) {\n // if so, throw 400 status and error message\n return ResponseEntity\n .badRequest()\n .body(new MessageResponse(\"Error: Email is already in use!\"));\n }\n\n // create new user's account\n User user = new User(signUpRequest.getUsername(),\n signUpRequest.getEmail(),\n encoder.encode(signUpRequest.getPassword())); // save password encoded\n\n // create objects based on user category\n String category = signUpRequest.getCategory(); // get category from signUpRequest\n // for now there is just one category. When there are more categories, \"category.equals(\"\") should be taken out of the first if-statement.\n // when there are are a number of categories, change if-statements to switch statement.\n if (category.equals(\"artist\") || category.equals(\"\")) {\n // set user category\n Category userCategory = categoryRepository.findByName(ECategory.CATEGORY_ARTIST)\n .orElseThrow(() -> new RuntimeException(\"Error: Category is not found\"));\n user.setCategory(userCategory);\n }\n\n boolean typeUser = false;\n Set<String> strRoles = signUpRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n\n\n // if no role is defined, set ROLE_USER\n if (strRoles == null) {\n Role userRole = roleRepository.findByName(ERole.ROLE_USER)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(userRole);\n typeUser = true;\n\n // else, set roles as provided by SignupRequest\n } else {\n for (String role : strRoles) {\n switch (role) {\n case \"admin\":\n Role adminRole = roleRepository.findByName(ERole.ROLE_ADMIN)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(adminRole);\n\n break;\n case \"business\":\n Role businessRole = roleRepository.findByName(ERole.ROLE_BUSINESS)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(businessRole);\n\n break;\n\n case \"media\":\n Role mediaRole = roleRepository.findByName(ERole.ROLE_MEDIA)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(mediaRole);\n\n break;\n default:\n Role userRole = roleRepository.findByName(ERole.ROLE_USER)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(userRole);\n typeUser = true;\n\n }\n }\n }\n\n // set roles\n user.setRoles(roles);\n\n // save user\n userRepository.save(user);\n\n // if user has type USER, create roadmap\n if (typeUser) {\n roadmapServiceImpl.createInitialRoadmap(user); // at first, all the code for creating the roadmap was placed here. Decided to use e roadmapServiceImpl class to do this to keep the controller as clean as possible\n }\n\n // save userInformation\n UserInformation userInformation = new UserInformation(user.getId());\n userInformationService.save(userInformation);\n\n // return status 200 and success message\n return ResponseEntity.ok(new MessageResponse(\"User registered successfully!\"));\n }", "@RequestMapping(value = \"/register/Admin/{firstname}/{surname}/{password}/{userType}/{phone}/{gender}/{yob}/{emailAddress:.+}\",\n method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> registerAdmin (@PathVariable(\"firstname\") String firstname,\n @PathVariable(\"surname\") String surname,\n @PathVariable(\"password\") String password,\n @PathVariable(\"userType\") String userType,\n @PathVariable(\"phone\") String phone,\n @PathVariable(\"gender\") String gender,\n @PathVariable(\"yob\") int yob,\n @PathVariable(\"emailAddress\") String emailAddress\n ) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n User user = userRepo.findByEmailAddress(emailAddress);\n\n if (user == null) {\n user = new User();\n\n if (checkPasswordFormat(password)) {\n user.setFirstname(firstname);\n user.setSurname(surname);\n user.setEmailAddress(emailAddress);\n user.setPassword(password);\n user.setType(userType);\n user.setPhone(phone);\n user.setGender(gender);\n user.setYob(yob);\n // administrators are automatically enabled.\n user.setApproved( true );\n\n respMap.put(\"message\",\"User created successfully\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n respMap.put(\"success\",\"1\");\n userRepo.save(user);\n\n // retrieve user, and pick up userid.\n // with this id go to retailer with retailerid and change userid to this userid.\n // update retailer.\n\n } else {\n respMap.put(\"message\",\"Password Incorrect: >= 6 and <= 20, at least one number, upper and lowercase character\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n } else {\n respMap.put(\"message\",\" - This email address is already in use, please chose another email address\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "@PostMapping(path = \"register_user\")\n public String registerUser(User newUser){\n for(User user:users) {\n if (user.getEmailId().equals(newUser.getEmailId())) {\n return \"user_exists\";\n }\n }\n users.add(newUser);\n return \"register_success\";\n }", "@Override\n public ResponseEntity<ResponseMessage> addRole(String roleName, String email) {\n logger.info(STARTING_METHOD_EXECUTION);\n ResponseMessage responseMessage = new ResponseMessage();\n RoleModel roleModel=roleRepo.findByRole(roleName);\n if (roleModel == null) {\n RoleModel obj = new RoleModel();\n obj.setRole(roleName);\n obj.setCreatedOn(System.currentTimeMillis());\n obj.setCreatedBy(userRepo.getUserIdByUserEmail(email));\n roleRepo.save(obj);\n logger.debug(\"Role saved : {}\",roleName);\n responseMessage.setMessage(ROLE_ADDED);\n responseMessage.setStatusCode(HttpStatus.CREATED.value());\n logger.info(EXITING_METHOD_EXECUTION);\n return new ResponseEntity<>(responseMessage, HttpStatus.CREATED);\n }\n responseMessage.setMessage(ROLE_ALREADY_EXIST);\n responseMessage.setStatusCode(HttpStatus.CONFLICT.value());\n logger.debug(\"Role {} already exits\",roleName);\n logger.info(EXITING_METHOD_EXECUTION);\n return new ResponseEntity<>(responseMessage, HttpStatus.CONFLICT);\n }", "@Test\n public void test_isNotValidEmail(){\n UserRegistration obj = new UserRegistration();\n boolean result = obj.checkEmailValidation(\"robert.com\");\n assertThat(result, is(false));\n }", "@PostMapping(\"/signup\")\n\tpublic Signup signUpEmployee(@RequestBody Signup signup) {\n\t\tString email = signup.getEmailId();\n\t\tSignup user = userRepo.findByemailId(email);\n\t\tif(! user.isEmpty()) {\n\t\t\tthrow new UserAlreadyExistException(\"User Already Exist\");\n\t\t}\n\t\t\n\t\treturn userRepo.save(signup);\n\t}", "@PostMapping(\"/v1/register\")\n\t@Transactional\n\tpublic ResponseEntity<RegisteredUserResult> register(@RequestBody RegisterUserRequest registerUserRequest) {\n\n\t\tLOG.info(\"Register user!\");\n\n\t\tcheckHeader(registerUserRequest);\n\n\t\t// Create user in user service db\n\t\tUserEntity userEntity = new UserEntity();\n\t\tmapper.map(registerUserRequest, userEntity);\n\t\tuserEntity.setRoles(Arrays.asList(roleRepository.findByName(ROLE_USER)));\n\t\tuserEntity = userRepository.save(userEntity);\n\n\t\t// Create user in auth service db\n\t\tUserDto userDto = new UserDto();\n\t\tmapper.map(registerUserRequest, userDto);\n\t\tthis.authServiceClient.createUser(userDto);\n\n\t\tRegisteredUserResult result = new RegisteredUserResult(userEntity.getId());\n\t\tResponseEntity<RegisteredUserResult> response = new ResponseEntity<>(result, HttpStatus.OK);\n\n\t\treturn response;\n\t}", "private void register() {\n RegisterModel registerModel = new RegisterModel(edtEmail.getText().toString(),\n edtPaswd.getText().toString(),\n edtDisplayName.getText().toString());\n\n Response.Listener<RegisterApiResponse> responseListener = new Response.Listener<RegisterApiResponse>() {\n @Override\n public void onResponse(RegisterApiResponse response) {\n if (response.isSuccess()) login();\n }\n };\n\n Response.ErrorListener errorListener = new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.cancel();\n if (error != null) {\n String errorMsg = \"An error occurred\";\n String err = (error.getMessage() == null) ? errorMsg : error.getMessage();\n Log.d(TAG, err);\n error.printStackTrace();\n\n if (err.matches(AppConstants.CONNECTION_ERROR) || err.matches(AppConstants.TIMEOUT_ERROR)) {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n } else if (err.matches(\".*Duplicate entry .* for key 'name_UNIQUE'.*\")) {\n edtDisplayName.setError(\"username taken\");\n edtDisplayName.requestFocus();\n } else if (err.matches(\".*The email has already been taken.*\")) {\n edtEmail.setError(\"email taken\");\n edtEmail.requestFocus();\n } else {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n }\n }\n }\n };\n\n\n progressDialog.setMessage(getString(R.string.progress_dialog_message_login));\n RegistrationRequests registerRequest =\n RegistrationRequests.register(this, registerModel, responseListener, errorListener);\n VolleyRequest.getInstance(this.getApplicationContext()).addToRequestQueue(registerRequest);\n progressDialog.show();\n }", "@PostMapping(\"/register\")\n\tpublic String register(Retailer bean,ModelMap map) {\n\t\tint check = service.register(bean);\n\t\tif(check>0) {\n\t\t\tmap.addAttribute(\"msg\", \"you are Registered and Id is\"+check);\n\t\t}else {\n\t\t\tmap.addAttribute(\"msg\", \"Email is repeated\");\n\t\t}\n\t\treturn \"login\";\n\t}", "public RegisterResult register(RegisterRequest r) throws DBException, IOException\n {\n try\n {\n idGenerator = UUID.randomUUID();\n String personID = idGenerator.toString();\n User newUser = new User(\n r.getUserName(),\n r.getPassword(),\n r.getEmail(),\n r.getFirstName(),\n r.getLastName(),\n r.getGender(),\n personID\n );\n userDao.postUser(newUser);\n commit(true);\n login = new LoginService();\n\n LoginRequest loginRequest = new LoginRequest(r.getUserName(), r.getPassword());\n LoginResult loginResult = login.loginService(loginRequest);\n login.commit(true);\n\n fill = new FillService();\n FillRequest fillRequest = new FillRequest(r.getUserName(), 4);\n FillResult fillResult = fill.fill(fillRequest);\n fill.commit(true);\n\n\n result.setAuthToken(loginResult.getAuthToken());\n result.setUserName(loginResult.getUserName());\n result.setPersonID(loginResult.getPersonID());\n result.setSuccess(loginResult.isSuccess());\n\n\n if( !loginResult.isSuccess() || !fillResult.isSuccess() )\n {\n throw new DBException(\"Login failed\");\n }\n\n }\n catch(DBException ex)\n {\n result.setSuccess(false);\n result.setMessage(\"Error: \" + ex.getMessage());\n commit(false);\n }\n return result;\n }", "private void registerByEmail() {\n\n String username = editUsername.getText().toString();\n String email = editEmail.getText().toString();\n String password = editPassword.getText().toString();\n\n AVUser person = new AVUser();\n person.setUsername(username);\n person.setEmail(email);\n person.setPassword(password);\n person.put(Person.NICK_NAME,username);\n\n person.signUpInBackground(new SignUpCallback() {\n @Override\n public void done(AVException e) {\n if (e == null) {\n ShowMessageUtil.tosatFast(\"register successful!\", EmailRegisterActivity.this);\n openValidateDialog();\n } else {\n ShowMessageUtil.tosatSlow(\"fail to register:\" + e.getMessage(), EmailRegisterActivity.this);\n }\n }\n });\n }", "@Then(\"^Validar registro de usuario$\")\n\tpublic void validar_registro_de_usuario() throws Exception {\n\t throw new PendingException();\n\t}", "private void registerForEmail(final String email, final String name, final String facebookId, final String token, final String imageUrl, final boolean isFb){\n// String url = Router.User.getWIthEmailComplete(email);\n// JSONObject params = new JSONObject();\n// try {\n// params.put(\"name\",name);\n// params.put(\"isFb\",isFb);\n// params.put(\"token\",token);\n// params.put(\"email\",email);\n// params.put(\"profilepic\",imageUrl);\n// params.put(\"facebookId\",facebookId);\n// } catch (JSONException e) {e.printStackTrace();}\n// JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, url, params, new Response.Listener<JSONObject>() {\n//\n// @Override\n// public void onResponse(JSONObject jsonObject) {\n// try {\n// JSONObject result = jsonObject.getJSONObject(\"result\");\n// String userId = result.getString(\"userId\");\n// userMain.userId = userId;\n// userMain.token = token;\n// userMain.email = email;\n// userMain.authProvider = (isFb)?\"facebook\":\"google\";\n// updateLoginTokens();\n// userMain.saveUserDataLocally();\n//\n// loginWithUserId(userId);\n// } catch (JSONException e) {\n// e.printStackTrace();\n// }\n// }\n// }, new Response.ErrorListener() {\n// @Override\n// public void onErrorResponse(VolleyError volleyError) {\n// Log.e(\"ERROR\",\"error in registerForEmail\");\n// }\n// });\n// MainApplication.getInstance().getRequestQueue().add(jsonObjectRequest);\n }", "boolean userRegistration(UserDTO user) throws UserException,ConnectException;", "@Test\n public void testSetEmailInvalid() {\n System.out.println(\"setEmail Test (Injection value)\");\n String username = \"<script>alert(\\\"This is an attack!\\\");</script>\";\n user.setEmail(username);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertFalse(violations.isEmpty());\n }", "@Test\n public void testSetEmail() {\n System.out.println(\"setEmail Test (Passing value)\");\n String email = \"[email protected]\";\n user.setEmail(email);\n // Check for and print any violations of validation annotations\n Set<ConstraintViolation<User>> violations = validator.validate(user);\n String message =\n violations.iterator().hasNext() ? violations.iterator().next().getMessage() : \"\";\n if (!violations.isEmpty()) {\n System.out.println(\"Violation caught: \" + message);\n }\n // Test method\n assertTrue(violations.isEmpty());\n }", "@Test\n @DisplayName(\"Should return 400 exception if accounts list is null in InviteRegisteredResource for POST /bills/{billId}/accounts\")\n void shouldReturnExceptionIfListEmailsNullInInviteRegisteredResourceGivenPost() throws Exception {\n final var inviteRegisteredResource = InviteRegisteredResourceFixture.getDefault();\n final var user = UserFixture.getDefault();\n inviteRegisteredResource.setAccounts(null);\n final var existentBillId = 1000L;\n final var path = String.format(BILL_BILLID_ACCOUNTS_ENDPOINT, existentBillId);\n final var authorities = new ArrayList<GrantedAuthority>();\n authorities.add(new SimpleGrantedAuthority(\"RESPONSIBLE_\" + existentBillId));\n\n //When/Then\n final MvcResult result = performMvcPostRequestWithoutBearer(path, inviteRegisteredResource, 400, user.getUsername(), authorities);\n final ApiError error = verifyInvalidInputs(result, 1);\n assertThat(error.getErrors().get(0).getMessage()).isEqualTo(MUST_NOT_BE_EMPTY);\n }", "@Test\n public void testRegisterUser() throws AuthenticationException, IllegalAccessException {\n facade.registerUser(\"fiske\", \"JuiceIsLoose123/\");\n assertEquals(\"fiske\", facade.getVeryfiedUser(\"fiske\", \"JuiceIsLoose123/\").getUserName(), \"Expects user exist after register\");\n }", "@AfterThrowing(\"execution(* com.revature.services.UserService.register(..))\")\n\tpublic void failedUserRegister(JoinPoint jp) {\n\t\tlog.error(\"Register failed, username already exists\");\n\t}", "@PostMapping(value = \"/users\")\n\tpublic <T> ResponseEntity<?> registerProcess(@RequestBody User user) {\t\n\t\tLoginResponse registerResponse = new LoginResponse();\n\t\ttry {\n\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tregisterResponse = userDelegate.register(user);\n\t\t\treturn responseUtil.successResponse(registerResponse);\n\t\t\t\n\t\t} catch(ApplicationException e){\t\n\t\treturn responseUtil.errorResponse(e);\n\t}\n\t\t\n\t}", "@Transactional\n\tpublic int doRegister(String email, String password) throws NoSuchFieldException, SecurityException {\n\t\tUser user = userDao.findUser(email);\n\n\t\tif (user != null) {\n\t\t\t//邮箱已被注册\n\t\t\treturn -1;\n\t\t}\n\t\telse {\n\t\t\t//注册新用户\n\t\t\tuser = new User(1L, email, password, \"\", \"M\", 0, \"\");\n\t\t\tSystem.out.println(user);\n\t\t\tuserDao.save(user);\n\t\t\treturn 0;\n\t\t}\n\t}", "@Test(groups ={Slingshot,Regression})\n\tpublic void ValidateAdduserEmailidField() {\n\t\tReport.createTestLogHeader(\"MuMv\", \"Verify the Email address Field validations and its appropriate error message\"); \t \t \t \n\t\tUserProfile userProfile = new TestDataHelper().getUserProfile(\"MuMVTestDataspl\");\n\t\tnew LoginAction()\n\t\t.BgbnavigateToLogin()\n\t\t.BgbloginDetails(userProfile);\n\t\tnew MultiUserMultiViewAction()\n\t\t.ClickManageUserLink()\n\t\t.ClickAddNewUserLink()\n\t\t.AddUserRadioButton()\n\t\t.StandardUserCreation()\n\t\t.validateEmailidField(userProfile);\t\t\t\t \t \t\t\t\t\t\t\n\t}", "@POST\n\t @Consumes(MediaType.MULTIPART_FORM_DATA)\n\t @Produces(MediaType.APPLICATION_JSON)\n\t @Path(\"/Register\")\n\t public Response Register(@FormDataParam(\"Email\") String Email,\n\t\t\t @FormDataParam(\"FirstName\") String FirstName,\n\t\t\t @FormDataParam(\"LastName\") String LastName,\n\t\t\t @FormDataParam(\"Password\") String Password,\n\t\t\t @FormDataParam(\"Phone\") String Phone,\n\t\t\t @FormDataParam(\"Street\") String Street,\n\t\t\t @FormDataParam(\"City\") String City,\n\t\t\t @FormDataParam(\"State\") String State,\n\t\t\t @FormDataParam(\"PostalCode\") String PostalCode){\n\t\t int statusCode=400;\n\t\t int rs=-1;\n\t\t int emailFound=0;\n\t\t String result;\n\t\t DBConnection databaseInstance= new DBConnection();\n\t\t HashMap<String,String> memberData = new HashMap<String,String>();\n\t\t JSONObject jsonObject= new JSONObject();\t\n\t\t \n\t\t if(Email.equals(\"\")||FirstName.equals(\"\")||LastName.equals(\"\")||Password.equals(\"\")||Phone.equals(\"\")||Street.equals(\"\")||City.equals(\"\")||State.equals(\"\")||PostalCode.equals(\"\")) \n\t\t\t return listBook.makeCORS(Response.status(statusCode), \"\");\n\t\t memberData.put(\"Email\", Email);\n\t\t emailFound=retrieveMember(memberData).length(); \n\t\t \n\t\t memberData.put(\"FirstName\", FirstName);\t\t \n\t\t memberData.put(\"LastName\", LastName);\t\t \n\t\t memberData.put(\"Password\",Password);\t\t \n\t\t memberData.put(\"Phone\", Phone);\t\t \n\t\t memberData.put(\"Street\", Street);\t\t\t \n\t\t memberData.put(\"City\", City);\n\t\t memberData.put(\"PostalCode\", PostalCode);\n\t\t \n\t\t if(emailFound==0){\n\t\t rs= databaseInstance.tableInsertion(memberData, \"members\"); \n\t\t }\t\t \n\t\t try {\n\t\t\t \tif(rs==-1){\n\t\t\t\t\tstatusCode=401;\n\t\t\t\t\tjsonObject.put(\"msg\", \"Email is already in use\");\n\t\t\t\t}\n\t\t\t\tif(rs>0){\n\t\t\t\t\tstatusCode=200;\n\t\t\t\t\tjsonObject.put(\"msg\", \"Register succesful \" + rs);\n\t\t\t\t}\n\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t result =\"\"+ jsonObject;\n\t\t \n\t\t\n\t\treturn listBook.makeCORS(Response.status(statusCode), result);\t\t\t \t\t \n\t }", "@Test\n @DisplayName(\"Should return 400 exception if 1+ emails in InviteRegisteredResource is blank for POST /bills/{billId}/accounts\")\n void shouldReturnExceptionIfListEmailsBlankInInviteRegisteredResourceGivenPost() throws Exception {\n final var inviteRegisteredResource = InviteRegisteredResourceFixture.getDefault();\n final var existentEmail = \"[email protected]\";\n final var invalidEmail = \" \";\n inviteRegisteredResource.setAccounts(List.of(existentEmail, invalidEmail));\n final var existentBillId = 1000L;\n final var path = String.format(BILL_BILLID_ACCOUNTS_ENDPOINT, existentBillId);\n final var authorities = new ArrayList<GrantedAuthority>();\n authorities.add(new SimpleGrantedAuthority(\"RESPONSIBLE_\" + existentBillId));\n\n //When/Then\n final MvcResult result = performMvcPostRequestWithoutBearer(path, inviteRegisteredResource, 400, existentEmail, authorities);\n final ApiError error = verifyInvalidInputs(result, 2);\n\n final var errorList = error.getErrors().stream()\n .map(ApiSubError::getMessage)\n .filter(msg -> msg.equals(MUST_NOT_BE_BLANK)\n || msg.equals(NOT_IN_EMAIL_FORMAT))\n .collect(java.util.stream.Collectors.toList());\n\n assertThat(errorList.size()).isEqualTo(error.getErrors().size());\n }", "@RequestMapping(value=\"/available/email\", method=RequestMethod.POST)\n\tpublic @ResponseBody Object checkEmailAvailable(@RequestParam String email) {\n\t\ttry {\n\t\t\treturn userService.checkEmailAvailable(email);\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Thats an error. \" + e.toString());\n\t\t\treturn Collections.singletonMap(\"status\", \"error\");\n\t\t}\n\t}", "public Response<CustomerRegResponseDto> createCustomer(CustomerRegRequestDto requestDto) {\n\t\tResponse<CustomerRegResponseDto> responseDto = new Response<>();\n\t\tOptional<User> user = userRepo.findByUserId(requestDto.getUserId());\n\t\tif (!user.isPresent())\n\t\t\tthrow new UserNotFoundException(CustomerConstants.USER_NOT_FOUND);\n\n\t\tOptional<User> userEmail = userRepo.findByEmailId(requestDto.getCustomerEmailId());\n\t\tif (userEmail.isPresent())\n\t\t\tthrow new UserAlreadyExistException(CustomerConstants.USER_EMAIL_ID_ALREADY_EXISTS);\n\n\t\tUser userUserName = userRepo.findByUserNameContainsIgnoreCase(requestDto.getCustomerUserName().toLowerCase());\n\t\tif (userUserName != null)\n\t\t\tthrow new UserAlreadyExistException(CustomerConstants.USER_NAME_ALREADY_EXISTS);\n\n\t\tif (!requestDto.getPassword().equals(requestDto.getConfirmPassword())) {\n\t\t\tthrow new NoDataFoundException(CustomerConstants.PASSWORD_CONFIRMATION);\n\n\t\t}\n\n\t\tCustomer addNewCustomer = addCustomerDetails(requestDto);\n\t\tUser newUser = addNewUser(requestDto, addNewCustomer);\n\t\tCustomerRegResponseDto response = new CustomerRegResponseDto();\n\t\tresponse.setCustomerId(addNewCustomer.getCustomerId());\n\t\tresponse.setUserId(newUser.getUserId());\n\t\tresponseDto.setData(response);\n\t\tresponseDto.setMessage(CustomerConstants.CUSTOMER_CREATED_SUCCESSFULLY);\n\t\tresponseDto.setStatus(HttpServletResponse.SC_OK);\n\t\tresponseDto.setError(false);\n\t\tsendRegistrationEmailNotification(requestDto);\n\t\treturn responseDto;\n\t}", "public User register(User user) throws DuplicateUserException{\n\n //check if there's duplicate user by email\n if (user.getEmail().equalsIgnoreCase(userMapper.getEmail(user.getEmail()))){\n throw new DuplicateUserException(\"You are already registered, please proceed with your API key\");\n }else{\n //generate API key\n try {\n user.setApiKey(generateApiKey(128));\n } catch (NoSuchAlgorithmException e) {\n System.out.println(e.toString());\n }\n\n //setting user status to active\n user.setActive(true);\n\n //insert new user to DB\n userMapper.insertUser(user);\n\n //returns the latest user inserted\n return userMapper.getLatestUser();\n }\n\n }", "public ManResponseBean registerUser(UserRegisterForm bean) throws Exception {\n String url = \"/services/RegisterUser\";\n /*\n * UserId SecurePassword SecurePin PinPayment PinAmount PinMenu PinPG\n * PinPGRate Name LeadId EmailNotify etc ReturnUrl TermsAgree Email\n * Language\n */\n NameValuePair[] params = {\n new NameValuePair(\"UserId\", bean.getUserId()),\n new NameValuePair(\"SecurePassword\", bean.getSecurePassword()),\n new NameValuePair(\"SecurePin\", bean.getSecurePin()),\n new NameValuePair(\"PinPayment\", bean.getPinPayment()),\n new NameValuePair(\"PinAmount\", bean.getPinAmount()),\n new NameValuePair(\"PinMenu\", bean.getPinMenu()),\n new NameValuePair(\"PinPG\", bean.getPinPG()),\n new NameValuePair(\"PinPGRate\", bean.getPinPGRate()),\n new NameValuePair(\"FirstName\", bean.getFirstName()),\n new NameValuePair(\"LastName\", bean.getLastName()),\n new NameValuePair(\"Name\", bean.getFirstName() + \" \"\n + bean.getLastName()),\n new NameValuePair(\"LeadId\", bean.getLeadId()),\n new NameValuePair(\"EmailNotify\", bean.getEmailNotify()),\n new NameValuePair(\"etc\", bean.getEtc()),\n new NameValuePair(\"ReturnUrl\", bean.getReturnUrl()),\n new NameValuePair(\"TermsAgree\", bean.getTermsAgree()),\n new NameValuePair(\"Question\", bean.getQuestion()),\n new NameValuePair(\"Answer\", bean.getAnswer()),\n new NameValuePair(\"Language\", bean.getLanguage()),\n new NameValuePair(\"Email\", bean.getEmail()) };\n ManResponseBean response = handlePOSTRequest(url, params, null);\n return response;\n }" ]
[ "0.7492028", "0.7196356", "0.70833975", "0.6995061", "0.6990183", "0.69342226", "0.6835059", "0.6829169", "0.6811866", "0.67913586", "0.6769434", "0.67460215", "0.67095554", "0.66097385", "0.66054374", "0.6568128", "0.6541034", "0.6537801", "0.6535025", "0.6518319", "0.6474706", "0.64670235", "0.64383113", "0.6426935", "0.6416094", "0.639549", "0.6350553", "0.63479656", "0.6341774", "0.63372165", "0.633098", "0.6324942", "0.63206613", "0.628187", "0.62654084", "0.6169595", "0.6150348", "0.61384684", "0.6134636", "0.61209667", "0.6105225", "0.6094033", "0.6063485", "0.6055728", "0.60372585", "0.6033372", "0.6027924", "0.602582", "0.60251266", "0.6015617", "0.60133487", "0.601171", "0.59917706", "0.5988481", "0.59804136", "0.5955659", "0.5947124", "0.5919766", "0.5899276", "0.5894909", "0.5887924", "0.58825845", "0.5865265", "0.58635163", "0.5859994", "0.5856887", "0.58527446", "0.5852464", "0.5846329", "0.5840953", "0.5835887", "0.5833716", "0.58333623", "0.5827368", "0.5827321", "0.5808745", "0.57892424", "0.5783703", "0.5782573", "0.5778429", "0.57712233", "0.57707924", "0.57676077", "0.57667726", "0.5765071", "0.5751568", "0.57510936", "0.5749984", "0.5741958", "0.5730589", "0.57154036", "0.5709134", "0.57061064", "0.570557", "0.57051283", "0.5700616", "0.56977534", "0.569542", "0.56890666", "0.5682689" ]
0.7950278
0
This method is used to test register in controller layer. Service layer response is mocked and controller layer of register is validated. This method is validated when username already used by a user and service layer throws exception of UsernameAlreadyExistException.
@Test void repeatedUsernameTest() throws Exception { User userObj = new User(); userObj.setName("Siva Murugan"); userObj.setEmail("[email protected]"); userObj.setGender("M"); userObj.setMobileNumber(9878909878L); userObj.setRole("C"); userObj.setUsername("sivanew"); userObj.setPassword("Siva123@"); String userJson = new ObjectMapper().writeValueAsString(userObj); when(userService.registerUser(any(User.class))).thenThrow(new UsernameAlreadyExistException("E_UR01")); mockMvc.perform(post("/vegapp/v1/users/register").contentType(MediaType.APPLICATION_JSON).content(userJson)) .andExpect(status().isConflict()).andExpect(jsonPath("$.errorMessage").value("E_UR01")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void registerUserTest2() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(usernameTaken));\n\t}", "@Test\n\tpublic void registerUserTest4() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass1234\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(passwordsNoMatch));\n\t}", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test(expected = UserAlreadyExists.class)\n public void registryUserExists() throws Exception {\n\n User user_expected = new User();\n user_expected.setId(1L);\n user_expected.setName(\"nametest\");\n user_expected.setLast_name(\"lastnametest\");\n user_expected.setUsername(\"usernametest\");\n user_expected.setPassword(\"a7574a42198b7d7eee2c037703a0b95558f195457908d6975e681e2055fd5eb9\");\n\n given(userRepository.findByUsername(anyString())).willReturn(Optional.of(user_expected));\n\n User user_saved = userServiceImpl.registryUser(this.user);\n\n }", "@Test\n\tpublic void registerUserTest3() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(emailTaken));\n\t}", "@Test\n public void testRegisterDuplicateUsername() {\n SignUpRequest request = new SignUpRequest(DUPLICATE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).duplicateUsername();\n\n try {\n verify(connection, never()).register(request);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Test\n\tvoid validRegisterTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenReturn(true);\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isOk()).andExpect(content().string(\"true\"));\n\t}", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@Test\n public void testUserCanBeRegistered() {\n assert username.length() > 3 && username.length() < 16;\n registerUser(username, password);\n assertNotNull(userService.getUser(username));\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signupRequest) {\n System.out.println(\"Creating User \" + signupRequest);\n\n if (userAccountDetailsService.isUserExistByUsername(signupRequest.getUsername())) {\n System.out.println(\"A User with username: \" + signupRequest.getUsername() + \" already exist\");\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n\n UserAccount userAccount = new UserAccount();\n userAccount.setName(signupRequest.getName());\n userAccount.setUsername(signupRequest.getUsername());\n userAccount.setAge(signupRequest.getAge());\n userAccount.setPassword(passwordEncoder.encode(signupRequest.getPassword()));\n\n Set<String> roles = signupRequest.getRole();\n Set<Authorities> authorities = new HashSet<>();\n for(String role: roles) {\n Authorities authority = new Authorities();\n authority.setAuthority(role);\n authority.setUserAccount(userAccount);\n authorities.add(authority);\n }\n userAccount.setAuthorities(authorities);\n\n userAccountDetailsService.saveUser(userAccount);\n\n return new ResponseEntity<Void>(HttpStatus.CREATED);\n }", "@Test\n\tvoid repeatedEmailTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new EmailAlreadyExistException(\"E_ER01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_ER01\"));\n\t}", "@Test\n public void testRegisterUser() throws AuthenticationException, IllegalAccessException {\n facade.registerUser(\"fiske\", \"JuiceIsLoose123/\");\n assertEquals(\"fiske\", facade.getVeryfiedUser(\"fiske\", \"JuiceIsLoose123/\").getUserName(), \"Expects user exist after register\");\n }", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}", "@Test\n public void testCreateUserWithExistingUsername() {\n final String username = \"[email protected]\";\n final CreateUserRequest request1 = new CreateUserRequest(username, \"Michael\", \"Pickelbauer\");\n final CreateUserRequest request2 = new CreateUserRequest(username, \"Hugo\", \"Mayer\");\n\n // Now let's create the two user accounts\n final CreateUserResponse response1 = administration.createUser(token, request1);\n final CreateUserResponse response2 = administration.createUser(token, request2);\n\n // The first request should work like a charm\n assertThat(response1, is(not(nullValue())));\n assertThat(response1.isOk(), is(true));\n\n // The second request should fail, as we already have a user with this\n // username in the system\n assertThat(response2, is(not(nullValue())));\n assertThat(response2.isOk(), is(false));\n assertThat(response2.getError(), is(IWSErrors.USER_ACCOUNT_EXISTS));\n assertThat(response2.getMessage(), is(\"An account for the user with username \" + username + \" already exists.\"));\n }", "@Test\n public void processRegistration() throws Exception {\n String newUserName = \"goodusername\";\n long numberOfExpectedUsers = userRepository.count() + 1;\n mockMvc.perform(post(RegistrationController.BASE_URL)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .param(userNameField, newUserName)\n .param(passwordField, samplePasswordValue)\n .param(verifyPasswordField, samplePasswordValue))\n .andExpect(view().name(SearchController.REDIRECT + IndexController.URL_PATH_SEPARATOR))\n .andExpect(status().is3xxRedirection());\n long updatedNumberOfUsers = userRepository.count();\n assertEquals(numberOfExpectedUsers, updatedNumberOfUsers);\n }", "@Test\n\tpublic void registerUserTest5() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.ofNullable(null));\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(500));\n\t}", "@Test\n public void testInvalidUsernameGreaterThan15Characters() {\n username = UUID.randomUUID().toString();\n assert username.length() >= 16;\n registerUser(username, password);\n assertNull(userService.getUser(username));\n }", "@Test\n public void testRegisterSuccessfully() {\n SignUpRequest request = new SignUpRequest(UNIQUE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).registered();\n }", "@PostMapping\n public User addUser(@Validated(value = Create.class) @RequestBody User user) {\n try {\n return userService.addUser(user);\n }catch (UserIdAlreadyExistsException exception){\n throw new UserIdAlreadyExistsException(\"User Id Already Exists\");\n }\n }", "@Test\n\tpublic void registerUserTest1() throws Exception {\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).characterEncoding(\"UTF-8\")).andDo(print()).andExpect(status().is(400));\n\n\t}", "@Test\n public final void testCreateUserInJSONUserAlreadyExists() {\n \n try {\n \tUserAPI fixture = new UserAPI();\n String input = \"{\\\"userName\\\":\\\"Txuso\\\", \\\"password\\\": \\\"213\\\"}\";\n \tfixture.createUserInJSON(input);\n } catch (WebApplicationException e) {\n \tassertNotNull(Response.Status.NOT_ACCEPTABLE.getStatusCode());\n }\n }", "@Test\n void registerUser() throws Exception{\n\n final RegisterDto registerDto = new RegisterDto(\"[email protected]\", \"password\", \"John\", \"Doe\", \"2018\", \"Marnixplaats 18\", \"Antwerpen\", \"Antwerpen\", \"Belgium\");\n\n mockMvc.perform(post(\"/api/security/register\")\n .contentType(MediaType.APPLICATION_JSON_VALUE)\n .content(objectMapper.writeValueAsString(registerDto))).andExpect(status().isOk());\n\n final Users users = userService.findByUsername(\"[email protected]\");\n\n assertThat(users.getUsername()).isEqualTo(\"[email protected]\");\n assertThat(users.getFirstname()).isEqualTo(\"John\");\n assertThat(users.getLastname()).isEqualTo(\"Doe\");\n assertThat(users.getPostcode()).isEqualTo(\"2018\");\n assertThat(users.getAddress()).isEqualTo(\"Marnixplaats 18\");\n assertThat(users.getCity()).isEqualTo(\"Antwerpen\");\n assertThat(users.getProvince()).isEqualTo(\"Antwerpen\");\n assertThat(users.getCountry()).isEqualTo(\"Belgium\");\n\n }", "public ResponseEntity<User> createUser(User user) {\n List<User> users=getAllUsers();\n boolean usernameIsUsed=false;\n\n\n for(User myUser : users){\n\n\n String username= myUser.getUsername();\n\n if(username.equals(user.getUsername())){\n usernameIsUsed=true;\n return ResponseEntity.badRequest().build();\n }\n\n\n }\n if(!usernameIsUsed){\n myUserDetailsService.addUser(user);\n return ResponseEntity.ok(user);\n }\n\n return null;\n }", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<User> create(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the sign-up parameters from the post request\n String user = request.getParameter(\"user\");\n String first = request.getParameter(\"first\");\n String last = request.getParameter(\"last\");\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"pass\");\n\n String pattern = \"^[a-zA-Z0-9]*$\";\n\n // send an HTTP 422 response if any parameter is missing, empty, does not match the pattern (except email)\n if (user == null || user.isEmpty() || !user.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (first == null || first.isEmpty() || !first.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (last == null || last.isEmpty() || !last.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (email == null || email.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (pass == null || pass.isEmpty() || !pass.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // check to see if the userName or email are already taken\n List<User> uniqueAttributeCheck = userRepo.findByUserNameOrEmail(user, email);\n\n // send an HTTP 409 response if either already exists\n if (uniqueAttributeCheck.size() > 0) {\n return ResponseEntity.status(HttpStatus.CONFLICT).body(null);\n }\n\n User newUser;\n\n // create the new User and save it in the user repository\n try {\n newUser = userRepo.save(new User(user, first, last, email, pass));\n } catch (TransactionSystemException e) { // this exception will be thrown if the email does not validate\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // create a new session for the new User\n session = request.getSession();\n session.setAttribute(\"user\", user);\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user));\n\n // send an HTTP 201 response with the new session User\n return ResponseEntity.status(HttpStatus.CREATED).body(newUser.asSessionUser());\n }", "@Test\n\tpublic void registerUserTest7() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tUser user = new User();\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(user);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(201)).andExpect(content().json(objectMapper.writeValueAsString(user)));\n\t}", "@Test\n\tvoid shouldFindUserWithCorrectUsername() throws Exception {\n\t\tUser user = this.userService.findUserByUsername(\"antonio98\");\n\t\tAssertions.assertThat(user.getUsername()).isEqualTo(\"antonio98\");\n\t}", "@Test\n public void registerUsernameTooShort() throws Exception {\n user.setUsername(\"1234\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\n\tvoid repeatedMobileNumberTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new MobileNumberAlreadyExistException(\"E_MR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_MR01\"));\n\t}", "@Test\n public void registerServerError() throws Exception {\n user.setUsername(\"thatssssaaaaaaaaaaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeryyyyyylo\" +\n \"oooooooooonggggusernameeeeeeeeeeeeeeeeee\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@Test\n\tvoid shouldFindUserWithIncorrectUsername() throws Exception {\n\t\tUser user = this.userService.findUserByUsername(\"antonio98\");\n\t\tAssertions.assertThat(user.getUsername()).isNotEqualTo(\"fernando98\");\n\t}", "User register(String firstName, String lastName, String username, String email) throws UserNotFoundException, EmailExistException, UsernameExistsException, MessagingException;", "@Test\n public void createNewUserAndCheckIt() {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserLogin(\"068-068-68-68\");\n userLogin.setUserPassword(\"12345\");\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n\n //Successful registration\n userLogin.setUserPasswordNew(\"12345\");\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n\n assertThat(userResponse.getUserPhone().equals(usersService.normalizeAndCheckPhoneFormat(userLogin.getUserLogin())));\n assertThat(userResponse.getUserPoints()).size().isEqualTo(5);\n }", "@Test\n public void registerUsernameEmpty() throws Exception {\n user.setUsername(null);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.BAD_REQUEST.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "@PreAuthorize(\"permitAll()\")\n @PostMapping(\"/users/\")\n public ResponseEntity<UserDTO> registerUser(@Valid @RequestBody User user) throws URISyntaxException {\n if (user.getId() != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_CUSTOM_ID,\n HeaderUtil.ERROR_MSG_CUSTOM_ID))\n .body(null);\n }\n\n // OPTION 1 - provided email is already in use by another user\n if (userService.getUserByEmail(user.getEmail()) != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_EMAIL_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_EMAIL_ALREADY_IN_USE))\n .body(null);\n }\n\n // OPTION 2 - provide username is already in use by another user\n if (userService.getUserByUsername(user.getUsername()) != null) {\n return ResponseEntity.\n badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_USERNAME_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_USERNAME_ALREADY_IN_USE))\n .body(null);\n }\n\n user.setVerified(false);\n User result = userService.save(user);\n\n mailSender.sendRegistrationMail(user.getFirstName(), user.getEmail(), null);\n\n return ResponseEntity.created(new URI(\"/api/users/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(Constants.EntityNames.USER, result.getId().toString()))\n .body(result.convertToDTO());\n }", "@Test\n\tpublic void registerUserTest6() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(null);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(notSuccessful));\n\t}", "public String register(RegisterRequest registerRequest) throws EmailAlreadyUsedException {\n if (this.userRepository.existsByEmail(registerRequest.getEmail())) {\n throw new EmailAlreadyUsedException(\"Error: Email is already in use!\");\n }\n // Create new user account\n User user = new User();\n user.setFirstName(registerRequest.getFirstName());\n user.setLastName(registerRequest.getLastName());\n user.setEmail(registerRequest.getEmail());\n user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));\n\n // Traitement des Roles\n Set<String> registerRequestRoles = registerRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n\n // find Roles\n if (registerRequestRoles == null) {\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n } else {\n registerRequestRoles.forEach(role -> {\n switch (role) {\n case \"super-admin\":\n Role superAdminRole = this.roleRepository.findByName(ERole.SUPER_ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(superAdminRole);\n\n break;\n case \"admin\":\n Role adminRole = this.roleRepository.findByName(ERole.ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(adminRole);\n break;\n case \"user\":\n Role userRole = this.roleRepository.findByName(ERole.USER)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(userRole);\n break;\n default:\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n }\n });\n }\n\n // Affect User Roles\n user.setRoles(roles);\n this.userRepository.save(user);\n return \"User registered successfully!\";\n }", "@PostMapping(value = \"/registration\")\n public @ResponseBody\n ResponseEntity<Object> register(@RequestParam(\"firstName\") String firstName,\n @RequestParam(\"lastName\") String lastName,\n @RequestParam(\"username\") String username,\n @RequestParam(\"password\") String password) {\n\n Person person = personService.getPersonByCredentials(username);\n\n String securePassword = HashPasswordUtil.hashPassword(password);\n\n if (person == null) {\n\n person = new Person(username, securePassword, firstName, lastName, PersonType.USER);\n\n try {\n personService.add(person);\n } catch (IllegalArgumentException e) {\n logger.error(e.getMessage());\n }\n person = personService.getPersonByCredentials(username);\n\n ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();\n HttpSession session = attr.getRequest().getSession(true); // true == allow create\n session.setAttribute(\"user\", username);\n session.setAttribute(\"userId\", person.getId());\n\n return ResponseEntity.status(HttpStatus.OK).body(null);\n } else {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n }", "@PostMapping\n public @ResponseBody\n ResponseEntity<Object> register(@RequestParam(\"firstName\") final String firstName,\n @RequestParam(\"lastName\") final String lastName,\n @RequestParam(\"username\") final String username,\n @RequestParam(\"password\") final String password,\n @RequestParam(\"email\") final String email) {\n\n Person person = personService.getPersonByCredentials(username);\n\n final String securePassword = HashPasswordUtil.hashPassword(password);\n\n if (person == null) {\n\n person = new Person(username, securePassword, firstName, lastName, email, PersonType.USER);\n\n try {\n personService.add(person);\n } catch (IllegalArgumentException e) {\n logger.error(e.getMessage());\n }\n person = personService.getPersonByCredentials(username);\n\n ServletRequestAttributes attr = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();\n HttpSession session = attr.getRequest().getSession(true); // true == allow create\n session.setAttribute(\"user\", username);\n session.setAttribute(\"userId\", person.getIdPerson());\n\n return ResponseEntity.status(HttpStatus.OK).body(null);\n } else {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n }", "@PostMapping(path = \"/register\",\n produces={MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE})\n @Timed\n public ResponseEntity registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) {\n\n HttpHeaders textPlainHeaders = new HttpHeaders();\n textPlainHeaders.setContentType(MediaType.TEXT_PLAIN);\n\n return userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase())\n .map(user -> new ResponseEntity<>(\"login already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> userRepository.findOneByEmail(managedUserVM.getEmail())\n .map(user -> new ResponseEntity<>(\"e-mail address already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> {\n User user = userService\n .createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),\n managedUserVM.getFirstName(), managedUserVM.getLastName(),\n managedUserVM.getEmail().toLowerCase(), managedUserVM.getImageUrl(), managedUserVM.getLangKey());\n\n mailService.sendActivationEmail(user);\n return new ResponseEntity<>(HttpStatus.CREATED);\n })\n );\n }", "public String register(RegisterRequest registerRequest) throws EmailAlreadyUsedException,ResourceNotFoundException {\n if (this.userRepository.existsByEmail(registerRequest.getEmail())) {\n throw new EmailAlreadyUsedException(\"Error: Email is already in use!\");\n }\n // Create new user account\n User user = new User();\n user.setFirstName(registerRequest.getFirstName());\n user.setLastName(registerRequest.getLastName());\n user.setEmail(registerRequest.getEmail());\n user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));\n // Traitement des Roles\n Set<String> registerRequestRoles = registerRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n // find Roles\n if (registerRequestRoles == null) {\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n }else {\n registerRequestRoles.forEach(role -> {\n switch (role) {\n case \"super-admin\":\n Role superAdminRole = null;\n try {\n superAdminRole = this.roleRepository.findByName(ERole.SUPER_ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(superAdminRole);\n\n break;\n case \"admin\":\n Role adminRole = null;\n try {\n adminRole = this.roleRepository.findByName(ERole.ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(adminRole);\n break;\n case \"user\":\n Role userRole = null;\n try {\n userRole = this.roleRepository.findByName(ERole.USER)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(userRole);\n break;\n default:\n Role guestRole = null;\n try {\n guestRole = this.roleRepository.findByName(ERole.GUEST).orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(guestRole);\n }\n });\n }\n // Affect User Roles\n user.setRoles(roles);\n this.userRepository.save(user);\n return \"User registered successfully!\";\n }", "public String register() throws NonUniqueBusinessKeyException,\n ValidationException, ObjectNotFoundException,\n MailOperationException, RegistrationException {\n if (logger.isDebugLoggingEnabled()) {\n\n }\n\n String mId = getMarketplaceId();\n String parameter = getRequest().getParameter(\n Constants.REQ_PARAM_SERVICE_KEY);\n String outcome = BaseBean.OUTCOME_SUCCESS;\n\n Long serviceKey = null;\n if (parameter != null && parameter.trim().length() > 0) {\n serviceKey = Long.valueOf(parameter);\n }\n // FIXME: Must be fixed in identity service.\n if (!isInternalMode()) {\n // A confirmation mail must be send, not a user created mail.\n // If no password is given it will be generated\n password = \"\";\n }\n try {\n organization = getAccountingService().registerCustomer(\n getOrganization(), user.getVOUserDetails(), password,\n serviceKey, mId, getSupplierId());\n } catch (NonUniqueBusinessKeyException ex) {\n if (isInternalMode()) {\n throw ex;\n }\n ex.setMessageKey(BaseBean.ERROR_USER_ALREADY_EXIST);\n ExceptionHandler.execute(ex, true);\n return BaseBean.OUTCOME_ERROR;\n }\n if (logger.isDebugLoggingEnabled()) {\n\n }\n return outcome;\n }", "@Test\n public void test_getByUsername_2() throws Exception {\n User user1 = createUser(1, true);\n\n User res = instance.getByUsername(user1.getUsername());\n\n assertNull(\"'getByUsername' should be correct.\", res);\n }", "@Test\n\tpublic void testCreateAdminAccountWithTakenUsername() {\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(USERNAME1, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"This username is not available.\", error);\n\t}", "@Test\n public void test_create_user_success() throws Exception {\n UserDto user = new UserDto(null, \"Arya\", \"Stark\", \"[email protected]\");\n UserDto newUser = new UserDto(1L, \"Arya\", \"Stark\", \"[email protected]\");\n\n when(userService.existsByEmail(user)).thenReturn(false);\n when(userService.createUser(user)).thenReturn(newUser);\n\n mockMvc.perform(post(\"/users\").contentType(MediaType.APPLICATION_JSON).content(asJsonString(user)))\n .andExpect(status().isCreated());\n\n verify(userService, times(1)).existsByEmail(user);\n verify(userService, times(1)).createUser(user);\n verifyNoMoreInteractions(userService);\n }", "@RequestMapping(value=\"/signup/{username}/{password}\")\n @ResponseBody\n public boolean signup(@PathVariable String username, @PathVariable String password){\n\n User user = new User(username, password);\n try{\n customUserDetailsService.save(user);\n return true;\n }catch (Exception e) {\n System.out.println(e);\n //ef return false tha er username fratekid...\n return false;\n }\n }", "@PostMapping(\"/register\")\n public AuthResponse register(@RequestBody AuthRequest authRequest) {\n User user = userService.register(authRequest.getUsername(), authRequest.getPassword(), authRequest.getRole());\n try {\n authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(authRequest.getUsername(), authRequest.getPassword()));\n } catch (BadCredentialsException badCredentialsException) {\n throw new RuntimeException(\"Invalid username or password\");\n }\n\n final UserDetails userDetails = customUserDetailsService.loadUserByUsername(authRequest.getUsername());\n final String token = jwtTokenUtil.generateToken(userDetails);\n\n return new AuthResponse(token);\n }", "@RequestMapping(value=\"{username}\", method=RequestMethod.POST)\n @ResponseStatus(HttpStatus.CREATED)\n String register(@RequestBody User user) throws ServerException, UserException {\n try {\n LOGGER.info(\"/users/{username} POST hit with user {}\", user);\n return userFacade.register(user);\n } catch (RuntimeException e) {\n LOGGER.error(\"Error in /users/{username} POST {}\", e);\n throw new ServerException(e);\n }\n }", "@PostMapping(\"/v1/register\")\n\t@Transactional\n\tpublic ResponseEntity<RegisteredUserResult> register(@RequestBody RegisterUserRequest registerUserRequest) {\n\n\t\tLOG.info(\"Register user!\");\n\n\t\tcheckHeader(registerUserRequest);\n\n\t\t// Create user in user service db\n\t\tUserEntity userEntity = new UserEntity();\n\t\tmapper.map(registerUserRequest, userEntity);\n\t\tuserEntity.setRoles(Arrays.asList(roleRepository.findByName(ROLE_USER)));\n\t\tuserEntity = userRepository.save(userEntity);\n\n\t\t// Create user in auth service db\n\t\tUserDto userDto = new UserDto();\n\t\tmapper.map(registerUserRequest, userDto);\n\t\tthis.authServiceClient.createUser(userDto);\n\n\t\tRegisteredUserResult result = new RegisteredUserResult(userEntity.getId());\n\t\tResponseEntity<RegisteredUserResult> response = new ResponseEntity<>(result, HttpStatus.OK);\n\n\t\treturn response;\n\t}", "@PostMapping(value = \"/users\")\n\tpublic <T> ResponseEntity<?> registerProcess(@RequestBody User user) {\t\n\t\tLoginResponse registerResponse = new LoginResponse();\n\t\ttry {\n\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tregisterResponse = userDelegate.register(user);\n\t\t\treturn responseUtil.successResponse(registerResponse);\n\t\t\t\n\t\t} catch(ApplicationException e){\t\n\t\treturn responseUtil.errorResponse(e);\n\t}\n\t\t\n\t}", "@Test\n\tpublic void addUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tpost(\"/secure/user/addUser\").param(\"username\", \"username1\")\n\t\t\t\t\t\t.param(\"firstName\", \"firstName1\")\n\t\t\t\t\t\t.param(\"lastName\", \"lastName1\")\n\t\t\t\t\t\t.param(\"emailAddress\", \"[email protected]\")\n\t\t\t\t\t\t.param(\"password\", \"abcd1234\")\n\n\t\t\t\t\t\t.accept(MediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"message\").value(\"Success\"));\n\n\t}", "@Test\n public void loginWrongUserNameFailTest() throws Exception {\n Map<String, String> loginREquest = buildLoginRequest(true);\n try {\n\n mockMvc.perform(\n post(LOGIN_PATH_REQ)\n .contentType(\"application/json\")\n .content(objToString(loginREquest))\n )\n .andDo(print())\n .andExpect(status().isInternalServerError())\n .andExpect(content().contentType(\"application/json\"));\n } catch (ServletException ex) {\n ex.printStackTrace();\n }\n }", "@Test\n public void testInvalidUsernameLessThan4Characters() {\n username = username.substring(0, 3);\n assert username.length() <= 3;\n registerUser(username, password);\n assertNull(userService.getUser(username));\n }", "@Test\n\tpublic void testAddUser() throws IOException, InvalidUserException{\n\t\tassertFalse(Model.addUserName(username));\n\t}", "@Override\n public ResponseEntity<String> createUser(@ApiParam(value = \"\" ,required=true ) @Valid @RequestBody User user) {\n String problem = detectFormatProblemInUser(user);\n if(problem != null) {\n return new ResponseEntity<>(problem, HttpStatus.BAD_REQUEST);\n }\n // Used to prevent bruteforce listing of existing emails\n try {\n Thread.sleep(200);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n // Ensure the email is not already taken by another user\n if(userRepository.findById(user.getEmail()).isPresent()) {\n return new ResponseEntity<>(\"The email address is already taken\", HttpStatus.CONFLICT);\n }\n // We can store the new user in the database\n userRepository.save(userToUserEntity(user));\n return new ResponseEntity<>(\"User created successfully\", HttpStatus.CREATED);\n }", "@RequestMapping(value = \"register_new_customer\", method = { RequestMethod.POST })\n\tpublic void registerNewUser(@RequestParam(\"username\") String username, @RequestParam(\"password\") String password,\n\t\t\t\t\t\t\t\t@RequestParam(\"firstName\") String firstName, @RequestParam(\"lastName\") String lastName,\n\t\t\t\t\t\t\t\tHttpServletResponse response) {\n\t\tSystem.out.println(username + \" \" + password + \" \" + lastName + \" \" + firstName);\n\n\t\ttry {\n\t\t\t// In case the user already exist, show error to the user\n\t\t\tif (isExistUser(username)) {\n\t\t\t\tHttpStatus status = HttpStatus.CONFLICT;\n\t\t\t\tresponse.setStatus(status.value());\n\t\t\t} else {\n\t\t\t\t// Create Mongo client\n\t\t\t\tMongoClient mongoClient = new MongoClient(\"localhost\", 27017);\n\t\t\t\tMongoDatabase db = mongoClient.getDatabase(\"projectDB\");\n\n\t\t\t\t// Create Users collection\n\t\t\t\tMongoCollection<Document> collection = db.getCollection(\"USERS\");\n\n\t\t\t\t// Create user document and add to users collection\n\t\t\t\tDocument document = new Document(\"username\", username).append(\"password\", password)\n\t\t\t\t\t\t.append(\"firstName\", firstName).append(\"lastName\", lastName)\n\t\t\t\t\t\t.append(\"RegistrationDate\", new Date());\n\t\t\t\tcollection.insertOne(document);\n\t\t\t\tSystem.out.println(\"Document inserted successfully\");\n\n\t\t\t\t//Close DB connection and send OK message to the user\n\t\t\t\tmongoClient.close();\n\t\t\t\tHttpStatus status = HttpStatus.OK;\n\t\t\t\tresponse.setStatus(status.value());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e);\n\t\t\tHttpStatus status = HttpStatus.CONFLICT;\n\t\t\tresponse.setStatus(status.value());\n\t\t}\n\n\t}", "@Test\n public void testPasswordHasNumbersAndLetters() {\n registerUser(username, \"123456789\");\n assertNull(userService.getUser(username));\n }", "@PostMapping(value = \"\")\n public User create(@RequestBody User user, HttpServletResponse response) {\n if(StringUtils.isEmpty(user.getUsername())) {\n throw new IllegalArgumentException(\"Invalid username\");\n }\n\n User userCreated = userService.create(user);\n response.setStatus(HttpStatus.CREATED.value());\n return userCreated;\n }", "public UsernameOkResponse( IFieldsContainer container) throws Exception{\n\t\tthis(container.getFieldValue(UsernameMessageFieldValue.class).getUsername());\n\t}", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@RequestBody RegistrationRequest registrationRequest){\n return userService.registerUser(registrationRequest);\n }", "@Test\n public void createDuplicateAccount() {\n final String username1 = \"[email protected]\";\n final String username2 = \"[email protected]\";\n final String username3 = \"[email protected]\";\n final String firstname = \"william\";\n final String lastname = \"shakespeare\";\n final String address = \"@iaeste.org\";\n\n final CreateUserRequest request1 = new CreateUserRequest(username1, firstname, lastname);\n final CreateUserResponse response1 = administration.createUser(token, request1);\n assertThat(response1, is(not(nullValue())));\n assertThat(response1.isOk(), is(true));\n assertThat(response1.getUser(), is(not(nullValue())));\n assertThat(response1.getUser().getAlias(), is(firstname + '.' + lastname + address));\n\n final CreateUserRequest request2 = new CreateUserRequest(username2, firstname, lastname);\n final CreateUserResponse response2 = administration.createUser(token, request2);\n assertThat(response2, is(not(nullValue())));\n assertThat(response2.isOk(), is(true));\n assertThat(response2.getUser(), is(not(nullValue())));\n assertThat(response2.getUser().getAlias(), is(firstname + '.' + lastname + 2 + address));\n\n final CreateUserRequest request3 = new CreateUserRequest(username3, firstname, lastname);\n final CreateUserResponse response3 = administration.createUser(token, request3);\n assertThat(response3, is(not(nullValue())));\n assertThat(response3.isOk(), is(true));\n assertThat(response3.getUser(), is(not(nullValue())));\n assertThat(response3.getUser().getAlias(), is(firstname + '.' + lastname + 3 + address));\n }", "@Test\n public void createNewUserByExternalTokenAndCheckIt() throws Exception {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserToken(UUID.randomUUID().toString());\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n\n //Add login and expect new user successful registration\n userLogin.setUserLogin(\"[email protected]\");\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n assertThat(userResponse.getUserMail().equals(userLogin.getUserLogin()));\n assertThat(userResponse.getUserPoints()).size().isEqualTo(5);\n }", "public static RegisterResult register(RegisterRequest r) {\n\n User new_user = new User(UUID.randomUUID().toString(), r.userName, r.password, r.email,\n r.firstName, r.lastName, r.gender);\n\n RegisterResult result = new RegisterResult();\n\n User test_user = UserDao.getUser(r.userName);\n if (test_user != null && !test_user.userName.equals(\"\"))\n {\n result.message = \"Error: Username already taken by another user\";\n result.success = false;\n return result;\n }\n\n result.authToken = UUID.randomUUID().toString();\n AuthTokenDao.updateToken(r.userName, result.authToken);\n\n Person p = new Person(new_user.personID, r.userName, r.firstName, r.lastName, r.gender);\n PersonDao.addPerson(p);\n\n result.userName = r.userName;\n result.personID = new_user.personID;\n UserDao.addUser(new_user);\n\n // Generate 4 generations of ancestry\n GenerateData.generateGenerations(r.userName, 4);\n\n result.success = true;\n\n return result;\n }", "public Register_Result register(String username, String password) throws ClientException {\n\t\tRegister_Result result = new Register_Result();\n\t\tif(username.equals(\"puppy\")) {\n\t\t\tresult.setValid(true);\n\t\t\tresult.setName(\"puppy\");\n\t\t\tresult.setId(44);\n\t\t} else {\n\t\t\tresult.setValid(false);\n\t\t}\n\t\treturn result;\n\t}", "boolean registerUser(UserRegisterDTO userRegisterDTO);", "@RequestMapping(value = \"register\", method = RequestMethod.POST)\n public String register(@ModelAttribute @Valid RegisterForm registerForm, Errors errors, HttpServletRequest request, Model model) {\n\n if (errors.hasErrors()) {\n model.addAttribute(\"title\", \"Register to RandNums\");\n model.addAttribute(\"sessionActive\", isSessionActive(request.getSession()));\n return \"login/register\";\n }\n\n User existingUser = userDao.findByUsername(registerForm.getUsername());\n\n if (existingUser != null) {\n errors.rejectValue(\"username\", \"username.alreadyexists\", \"A user with that username already exists\");\n model.addAttribute(\"title\", \"Register\");\n model.addAttribute(\"sessionActive\", isSessionActive(request.getSession()));\n return \"login/register\";\n }\n\n User newUser = new User(registerForm.getUsername(), registerForm.getEmail(), registerForm.getPassword());\n\n userDao.save(newUser);\n setUserInSession(request.getSession(), newUser);\n\n return \"redirect:/home\";\n }", "@PostMapping(\"/register\")\n public ResponseEntity<Map<String, String>> registerUser(@RequestBody User user){ \n userService.registerUser(user);\n return new ResponseEntity<>(generateJWTTToken(user), HttpStatus.OK);\n }", "boolean userRegistration(UserDTO user) throws UserException,ConnectException;", "@Test\n public void test_getByUsername_3() throws Exception {\n User user1 = createUser(1, false);\n\n User res = instance.getByUsername(user1.getUsername());\n\n assertEquals(\"'getByUsername' should be correct.\", user1.getUsername(), res.getUsername());\n assertEquals(\"'getByUsername' should be correct.\", user1.getDefaultTab(), res.getDefaultTab());\n assertEquals(\"'getByUsername' should be correct.\", user1.getNetworkId(), res.getNetworkId());\n assertEquals(\"'getByUsername' should be correct.\", user1.getRole().getId(), res.getRole().getId());\n assertEquals(\"'getByUsername' should be correct.\", user1.getFirstName(), res.getFirstName());\n assertEquals(\"'getByUsername' should be correct.\", user1.getLastName(), res.getLastName());\n assertEquals(\"'getByUsername' should be correct.\", user1.getEmail(), res.getEmail());\n assertEquals(\"'getByUsername' should be correct.\", user1.getTelephone(), res.getTelephone());\n assertEquals(\"'getByUsername' should be correct.\", user1.getStatus().getId(), res.getStatus().getId());\n }", "@Test\n public void testRegister_emptyUsername() {\n SignUpRequest request = new SignUpRequest(\"\", PASSWORD);\n\n dao.register(request);\n\n verify(controller).emptyFields();\n\n try {\n verify(connection, never()).register(request);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@PostMapping(\"/sign-up\") //method handles POST requests with this path (signup)\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signUpRequest) {\n if (userRepository.existsByUsername(signUpRequest.getUsername())) {\n // if so, throw 400 status and error message\n return ResponseEntity\n .badRequest()\n .body(new MessageResponse(\"Error: Username is already taken!\"));\n }\n\n // checks is email is already in use\n if (userRepository.existsByEmail(signUpRequest.getEmail())) {\n // if so, throw 400 status and error message\n return ResponseEntity\n .badRequest()\n .body(new MessageResponse(\"Error: Email is already in use!\"));\n }\n\n // create new user's account\n User user = new User(signUpRequest.getUsername(),\n signUpRequest.getEmail(),\n encoder.encode(signUpRequest.getPassword())); // save password encoded\n\n // create objects based on user category\n String category = signUpRequest.getCategory(); // get category from signUpRequest\n // for now there is just one category. When there are more categories, \"category.equals(\"\") should be taken out of the first if-statement.\n // when there are are a number of categories, change if-statements to switch statement.\n if (category.equals(\"artist\") || category.equals(\"\")) {\n // set user category\n Category userCategory = categoryRepository.findByName(ECategory.CATEGORY_ARTIST)\n .orElseThrow(() -> new RuntimeException(\"Error: Category is not found\"));\n user.setCategory(userCategory);\n }\n\n boolean typeUser = false;\n Set<String> strRoles = signUpRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n\n\n // if no role is defined, set ROLE_USER\n if (strRoles == null) {\n Role userRole = roleRepository.findByName(ERole.ROLE_USER)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(userRole);\n typeUser = true;\n\n // else, set roles as provided by SignupRequest\n } else {\n for (String role : strRoles) {\n switch (role) {\n case \"admin\":\n Role adminRole = roleRepository.findByName(ERole.ROLE_ADMIN)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(adminRole);\n\n break;\n case \"business\":\n Role businessRole = roleRepository.findByName(ERole.ROLE_BUSINESS)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(businessRole);\n\n break;\n\n case \"media\":\n Role mediaRole = roleRepository.findByName(ERole.ROLE_MEDIA)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(mediaRole);\n\n break;\n default:\n Role userRole = roleRepository.findByName(ERole.ROLE_USER)\n .orElseThrow(() -> new RuntimeException(\"Error: Role is not found.\"));\n roles.add(userRole);\n typeUser = true;\n\n }\n }\n }\n\n // set roles\n user.setRoles(roles);\n\n // save user\n userRepository.save(user);\n\n // if user has type USER, create roadmap\n if (typeUser) {\n roadmapServiceImpl.createInitialRoadmap(user); // at first, all the code for creating the roadmap was placed here. Decided to use e roadmapServiceImpl class to do this to keep the controller as clean as possible\n }\n\n // save userInformation\n UserInformation userInformation = new UserInformation(user.getId());\n userInformationService.save(userInformation);\n\n // return status 200 and success message\n return ResponseEntity.ok(new MessageResponse(\"User registered successfully!\"));\n }", "void addUser(Username username) throws UserAlreadyExistsException;", "@PostMapping(\"/register\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody User user, BindingResult result){\n \t\n \tResponseEntity<?> errorMap = mapValidationErrorService.mapValidationService(result);\n \n\t\tif(errorMap!=null) \n \treturn errorMap;\n\n User newUser = userService.save(user);\n return new ResponseEntity<User>(newUser, HttpStatus.CREATED);\n }", "@Override\n public String register(String name, String password) throws BakeryServiceException {\n if (name == null || password == null || name.length() < 3 || password.length() < 3)\n throw new BakeryServiceException(400);\n\n // check that the user does not already exist\n User existingUser = this.userDAO.getUserByName(name);\n if (existingUser != null)\n throw new BakeryServiceException(409);\n\n String passwordHash = BCrypt.hashpw(password, BCrypt.gensalt());\n String token = UUID.randomUUID().toString();\n this.userDAO.createUser(name, passwordHash, token);\n return token;\n }", "public void checkUsernameAvailability(final Context context, final UsernameValidityListener listener) {\n if (getLoginRestClient() != null) {\n // Trigger a fake registration (without password) to know whether the user name is available or not.\n RegistrationParams params = new RegistrationParams();\n params.username = mUsername;\n\n // Note: We do not pass sessionId here, this is not necessary.\n\n register(context, params, new InternalRegistrationListener() {\n @Override\n public void onRegistrationSuccess() {\n // The registration could not succeed without password.\n // Keep calling listener (the error case) as a fallback,\n listener.onUsernameAvailabilityChecked(false);\n }\n\n @Override\n public void onRegistrationFailed(String message) {\n listener.onUsernameAvailabilityChecked(!TextUtils.equals(MatrixError.USER_IN_USE, message));\n }\n\n @Override\n public void onResourceLimitExceeded(MatrixError e) {\n // Should not happen, consider user is available, registration will fail later on\n listener.onUsernameAvailabilityChecked(true);\n }\n });\n }\n }", "@POST\n @Path(\"/users/register\")\n public Response register(\n @Context HttpServletRequest request \n ,@Context HttpServletResponse response\n ,@Context ServletContext servletContext\n ,String raw\n ){\n try{\n log.debug(\"/register called\");\n// String raw=IOUtils.toString(request.getInputStream());\n mjson.Json x=mjson.Json.read(raw);\n \n Database2 db=Database2.get();\n for (mjson.Json user:x.asJsonList()){\n String username=user.at(\"username\").asString();\n \n if (db.getUsers().containsKey(username))\n db.getUsers().remove(username); // remove so we can overwrite the user details\n \n Map<String, String> userInfo=new HashMap<String, String>();\n for(Entry<String, Object> e:user.asMap().entrySet())\n userInfo.put(e.getKey(), (String)e.getValue());\n \n userInfo.put(\"level\", LevelsUtil.get().getBaseLevel().getRight());\n userInfo.put(\"levelChanged\", new SimpleDateFormat(\"yyyy-MM-dd\").format(new Date()));// nextLevel.getRight());\n \n db.getUsers().put(username, userInfo);\n log.debug(\"New User Registered (via API): \"+Json.newObjectMapper(true).writeValueAsString(userInfo));\n db.getScoreCards().put(username, new HashMap<String, Integer>());\n \n db.addEvent(\"New User Registered (via API)\", username, \"\");\n }\n \n db.save();\n return Response.status(200).entity(\"{\\\"status\\\":\\\"DONE\\\"}\").build();\n }catch(IOException e){\n e.printStackTrace();\n return Response.status(500).entity(\"{\\\"status\\\":\\\"ERROR\\\",\\\"message\\\":\\\"\"+e.getMessage()+\"\\\"}\").build(); \n }\n \n }", "@Test\n public void canHaveSameFirstName() throws IOException {\n String firstName = \"sheila\";\n validRegistration();\n\n //SECOND REGISTRATION\n RegisterRequest registerRequest2 = new RegisterRequest(\"differentUser\", \"pass\", \"[email protected]\",\n firstName, \"smith\", \"m\");\n URL url2 = new URL( \"http://localhost:8080/user/register\");\n HttpURLConnection connection2 = (HttpURLConnection) url2.openConnection();\n connection2.setRequestMethod(\"POST\");\n connection2.setDoOutput(true);\n connection2.connect();\n\n Gson gson2 = new Gson();\n StringUtil.writeStringToStream(gson2.toJson(registerRequest2), connection2.getOutputStream());\n connection2.getOutputStream().close();\n\n int responseCode2 = connection2.getResponseCode();\n assertEquals(responseCode2, HttpURLConnection.HTTP_OK); //if you could not have two users with the same first name, then it would have thrown a 400\n }", "public boolean validateUsernameExist(String username) {\n return userRepository.findUsername(username);\n }", "@Test\n\tpublic void getUsernameSuccessTest() throws Exception {\n\t\tassertNotNull(new SecretCredentialsManagerImpl(null, \"true\", null, null) {\n\n\t\t\t@Override\n\t\t\tprotected SecretCache getSecretCache() {\n\t\t\t\treturn new SecretCache(Mockito.mock(AWSSecretsManager.class)) {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic String getSecretString(final String secretId) {\n\t\t\t\t\t\treturn \"{ \\\"username\\\" : \\\"username\\\" }\";\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t}.getUsername());\n\t}", "@Test\n public final void testCreateUserInJSONNullUsername() {\n\t try {\n\t String input = \"{\\\"userName\\\":\\\"\\\", \\\"password\\\": \\\"123\\\"}\";\n\t \tUserAPI fixture = new UserAPI();\n\t \tfixture.createUserInJSON(input);\n\t } catch (WebApplicationException e) {\n\t \tassertNotNull(Response.Status.NOT_ACCEPTABLE.getStatusCode());\n\t }\n }", "public Boolean register(HttpServletRequest request) throws Exception;", "void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }", "@Test\n public void testUnique_connectionException() throws SQLException {\n SignUpRequest request = new SignUpRequest(UNIQUE, \"Pw\");\n\n doThrow(SQLException.class).when(connection).isUnique(request.getUsername());\n\n dao.register(request);\n\n verify(controller).connectionFailed();\n }", "@POST\n @Path(\"Signup\")\n public Response signup(JpaAccount account,\n @Context HttpServletRequest request) {\n Response r;\n if (this.checkEmailString(account.getEmail())) {\n if (account.getUsername().equals(\"\") || !this.checkExistingUsername(account.getUsername())) {\n User user;\n Subject subject = SecurityUtils.getSubject();\n\n if (subject.isAuthenticated() && accountFacade.find((Long) subject.getPrincipal()) instanceof GuestJpaAccount) {\n GuestJpaAccount from = (GuestJpaAccount) accountFacade.find((Long) subject.getPrincipal());\n subject.logout();\n userFacade.upgradeGuest(from, account);\n r = Response.status(Response.Status.CREATED).build();\n } else {\n // Check if e-mail is already taken and if yes return a localized error message:\n try {\n accountFacade.findByEmail(account.getEmail());\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail est déjà prise.\" : \"This email address is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n } catch (WegasNoResultException e) {\n // GOTCHA\n // E-Mail not yet registered -> proceed with account creation\n user = new User(account);\n userFacade.create(user);\n r = Response.status(Response.Status.CREATED).build();\n }\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Ce nom d'utilisateur est déjà pris.\" : \"This username is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail n'est pas valide.\" : \"This e-mail address is not valid.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n return r;\n }", "@PostMapping(value = \"/register\", consumes = \"application/json\")\n\tpublic ResponseEntity<UserDTO> register(@RequestBody UserDTO userDTO){\n\t\tUser user = new User();\n\t\tif(userService.findByUsername(userDTO.getUsername()) != null) {\n\t\t\treturn new ResponseEntity<UserDTO>(HttpStatus.CONFLICT);\n\t\t}\n\t\tuser.setName(userDTO.getName());\n\t\tuser.setUsername(userDTO.getUsername());\n\t\tuser.setPassword(userDTO.getPassword());\n\t\tuser.setPhoto(userDTO.getPhoto());\n\t\t\n\t\tSet<Role> rolesToAdd = new HashSet<>();\n\t\tfor (RoleDTO roleDTO : userDTO.getRoles()) {\n\t\t\tRole role = roleService.findOne(roleDTO.getRoleName());\n\t\t\trolesToAdd.add(role);\n\t\t}\n\t\tuser.setRoles(rolesToAdd);\n\t\t\n\t\tuser = userService.save(user);\n\t\treturn new ResponseEntity<UserDTO>(new UserDTO(user), HttpStatus.CREATED);\n\t\t\n\t}", "@Test\n public void test_getByUsername_1() throws Exception {\n clearDB();\n\n User res = instance.getByUsername(\"not_exist\");\n\n assertNull(\"'getByUsername' should be correct.\", res);\n }", "@RequestMapping(value = { \"/new\" }, method = RequestMethod.POST)\r\n public String saveUser(@Valid User user, BindingResult result,\r\n ModelMap model) {\r\n if (result.hasErrors()) {\r\n return \"registration\";\r\n }\r\n\r\n // Preferred way to achieve uniqueness of field [loginID] should be implementing custom @Unique annotation\r\n // and applying it on field [loginID] of Model class [User].Below mentioned peace of code [if block] is\r\n // to demonstrate that you can fill custom errors outside the validation\r\n // framework as well while still using internationalised messages.\r\n\r\n if(!service.isLoginIDUnique(user.getId(), user.getLoginID())){\r\n FieldError loginIDError =new FieldError(\"user\",\"loginID\",messageSource.getMessage(\"non.unique.loginID\", new String[]{user.getLoginID()}, Locale.getDefault()));\r\n result.addError(loginIDError);\r\n return \"registration\";\r\n }\r\n\r\n service.saveUser(user);\r\n model.addAttribute(\"success\", \"user \" + user.getLoginID() + \" registered successfully\");\r\n return \"success\";\r\n }", "@PostMapping(value = \"/\", consumes = MediaType.APPLICATION_JSON_VALUE)\n\tpublic ResponseEntity<UsersDTO> createUser(@Valid @RequestBody final UsersDTO user) {\n\t\tlogger.info(\"Creating User : {}\", user);\n\t\tif(userJpaRepository.findByName(user.getName()) != null) {\n\t\t\tlogger.error(\"Unable to create. A User with name {} already exist\",\n\t\t\t\t\tuser.getName());\n\t\t\treturn new ResponseEntity<UsersDTO>(new CustomErrorType(\n\t\t\t\t\t\"Unable to create new User. A user with name \" + \n\t\t\t\t\tuser.getName() + \" already exist.\"),HttpStatus.CONFLICT);\n\t\t}\n\t\tuserJpaRepository.save(user);\n\t\treturn new ResponseEntity<UsersDTO>(user, HttpStatus.CREATED);\n\t}", "@Test\n public void testNonMatchingPasswords() {\n registerUser(username, password, password + password, email, email, forename, surname, null);\n assertNull(userService.getUser(username));\n }", "@Override\n @RequestMapping(\"/register\")\n public ConfirmationMessage register(@RequestParam(value = \"username\", defaultValue = \"\") String username,\n @RequestParam(value = \"password1\", defaultValue = \"\") String password1,\n @RequestParam(value = \"password2\", defaultValue = \"\") String password2,\n @RequestParam(value = \"email\", defaultValue = \"\") String email,\n @RequestParam(value = \"city\", defaultValue = \"\") String city) {\n return userLogic.register(username, password1, password2, email, city);\n }", "@PostMapping(\"/register\")\r\n public Guardian createGuardian(@Valid @RequestBody RegistrationInfo registrationInfo) throws UserExistException {\r\n User user = userService.save(new User(registrationInfo));\r\n if (user != null) {\r\n return guardianRepository.save(new Guardian(registrationInfo));\r\n } else {\r\n throw new UserExistException(\"User is empty. Something went wrong.\");\r\n }\r\n }", "@Test\n void createUser_validInput_userCreated() throws Exception {\n // given\n User user = new User();\n user.setId(1L);\n user.setPassword(\"Test User\");\n user.setUsername(\"testUsername\");\n user.setToken(\"1\");\n user.setStatus(UserStatus.ONLINE);\n\n UserPostDTO userPostDTO = new UserPostDTO();\n userPostDTO.setPassword(\"Test User\");\n userPostDTO.setUsername(\"testUsername\");\n\n given(loginService.createUser(Mockito.any())).willReturn(user);\n\n // when/then -> do the request + validate the result\n MockHttpServletRequestBuilder postRequest = post(\"/users\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(asJsonString(userPostDTO));\n\n // then\n mockMvc.perform(postRequest)\n .andExpect(status().isCreated())\n .andExpect(jsonPath(\"$.token\", is(user.getToken())));\n }", "@PostMapping(value = \"register\")\n public ResponseEntity<AccountDto> register(@RequestBody final AuthenticationRequestDto authenticationRequestDto)\n throws RegisterException {\n final AccountDto createdAccountDto = authenticationService.register(authenticationRequestDto);\n log.debug(\"Register - The API with body request [{}] has been consumed successfully\", authenticationRequestDto);\n return new ResponseEntity<>(createdAccountDto, HttpStatus.CREATED);\n }", "@PostMapping(\"/process_register\")\n public String processRegistration(User user,Model model)\n throws SignatureException, NoSuchAlgorithmException, InvalidKeyException{\n\n //checking if user exists\n if(userService.existByLogin(user.getLogin())) {\n model.addAttribute(\"error\", true);\n return \"registerForm\";\n }\n\n model.addAttribute(\"user\", user);\n //saving user\n /* userRepository.save(user);*/\n userService.saveUser(user, Sha512.generateSalt().toString());\n return \"registerSuccessful\";\n }", "boolean registrarUsuario(Usuario usuario) throws Exception;", "@Test\n\tpublic void testUpdateUser_wrongUsername() {\n\t\tLogin login = new Login(\"unique_username_14365432\", \"password\");\n\t\tResponse response = createUser(login);\n\t\t//printResponse(response);\n\t\tassertEquals(Status.OK.getStatusCode(), response.getStatus());\n\t\t\n\t\t//update the user\n\t\tLogin update = new Login(\"unique_username_645324\", \"a_different_password\");\n\t\tupdate.encryptPassword(passwordEncryptionKey);\n\t\t//change the password (to test a wrong password)\n\t\tlogin.setUsername(\"a_not_existing_username_64234e985243\");\n\t\tString resource = \"update_user\";\n\t\tString requestType = \"POST\";\n\t\t\n\t\tList<Login> updateLogins = Arrays.asList(login, update);\n\t\t\n\t\tresponse = sendRequest(resource, requestType, Entity.entity(updateLogins, MediaType.APPLICATION_JSON));\n\t\t//printResponse(response);\n\t\tassertEquals(Status.NOT_FOUND.getStatusCode(), response.getStatus());\n\t}", "private void register() {\n RegisterModel registerModel = new RegisterModel(edtEmail.getText().toString(),\n edtPaswd.getText().toString(),\n edtDisplayName.getText().toString());\n\n Response.Listener<RegisterApiResponse> responseListener = new Response.Listener<RegisterApiResponse>() {\n @Override\n public void onResponse(RegisterApiResponse response) {\n if (response.isSuccess()) login();\n }\n };\n\n Response.ErrorListener errorListener = new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.cancel();\n if (error != null) {\n String errorMsg = \"An error occurred\";\n String err = (error.getMessage() == null) ? errorMsg : error.getMessage();\n Log.d(TAG, err);\n error.printStackTrace();\n\n if (err.matches(AppConstants.CONNECTION_ERROR) || err.matches(AppConstants.TIMEOUT_ERROR)) {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n } else if (err.matches(\".*Duplicate entry .* for key 'name_UNIQUE'.*\")) {\n edtDisplayName.setError(\"username taken\");\n edtDisplayName.requestFocus();\n } else if (err.matches(\".*The email has already been taken.*\")) {\n edtEmail.setError(\"email taken\");\n edtEmail.requestFocus();\n } else {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n }\n }\n }\n };\n\n\n progressDialog.setMessage(getString(R.string.progress_dialog_message_login));\n RegistrationRequests registerRequest =\n RegistrationRequests.register(this, registerModel, responseListener, errorListener);\n VolleyRequest.getInstance(this.getApplicationContext()).addToRequestQueue(registerRequest);\n progressDialog.show();\n }", "@Override\n public Response registerUser(String nciUserId, HpcUserRequestDTO userRegistrationRequest) {\n try {\n securityBusService.registerUser(nciUserId, userRegistrationRequest);\n\n } catch (HpcException e) {\n return errorResponse(e);\n }\n\n return createdResponse(null);\n }", "@AfterThrowing(\"execution(* com.revature.services.UserService.register(..))\")\n\tpublic void failedUserRegister(JoinPoint jp) {\n\t\tlog.error(\"Register failed, username already exists\");\n\t}", "@Test\n public void checkForNonExistingUserCredential() {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserLogin(\"+380680000000\");\n userLogin.setUserPassword(\"12345\");\n\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignIn\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n }" ]
[ "0.7740674", "0.71596783", "0.7080061", "0.69996387", "0.6973125", "0.6873729", "0.6822487", "0.67789924", "0.67735463", "0.66672695", "0.6665892", "0.66613704", "0.66588205", "0.66471", "0.6638485", "0.66237897", "0.659", "0.6589151", "0.65647894", "0.6561626", "0.6550198", "0.6549343", "0.654915", "0.65135574", "0.65128964", "0.64754546", "0.6470847", "0.6470617", "0.6451066", "0.6431146", "0.63927275", "0.6388386", "0.6384395", "0.63727397", "0.6359057", "0.6356261", "0.63452965", "0.6324125", "0.6309994", "0.6296434", "0.6281383", "0.62791127", "0.62710345", "0.6270244", "0.6266188", "0.6257534", "0.6253917", "0.6247003", "0.6242312", "0.623989", "0.62275755", "0.6217561", "0.6210729", "0.6168001", "0.6166131", "0.61361957", "0.61289304", "0.6126611", "0.6111676", "0.6102607", "0.60868704", "0.6085763", "0.60827845", "0.60741323", "0.6063299", "0.6059808", "0.6054556", "0.6036014", "0.60355103", "0.60333633", "0.602933", "0.6023617", "0.6012848", "0.60117793", "0.5988205", "0.5975366", "0.5951439", "0.5945075", "0.59305716", "0.59196657", "0.5905784", "0.5891389", "0.5889827", "0.58884233", "0.58878714", "0.58704835", "0.58623147", "0.58586514", "0.585611", "0.58543164", "0.58509725", "0.5850564", "0.58421016", "0.5835426", "0.5827478", "0.5826194", "0.5820971", "0.5813859", "0.5812795", "0.5812422" ]
0.80079675
0
This method is used to test register in controller layer. Service layer response is mocked and controller layer of register is validated. This method is validated when mobile number already used by a user and service layer throws exception of MobileNumberAlreadyExistException.
@Test void repeatedMobileNumberTest() throws Exception { User userObj = new User(); userObj.setName("Siva Murugan"); userObj.setEmail("[email protected]"); userObj.setGender("M"); userObj.setMobileNumber(9878909878L); userObj.setRole("C"); userObj.setUsername("sivanew"); userObj.setPassword("Siva123@"); String userJson = new ObjectMapper().writeValueAsString(userObj); when(userService.registerUser(any(User.class))).thenThrow(new MobileNumberAlreadyExistException("E_MR01")); mockMvc.perform(post("/vegapp/v1/users/register").contentType(MediaType.APPLICATION_JSON).content(userJson)) .andExpect(status().isConflict()).andExpect(jsonPath("$.errorMessage").value("E_MR01")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tvoid validRegisterTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenReturn(true);\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isOk()).andExpect(content().string(\"true\"));\n\t}", "@Test\n\tvoid repeatedEmailTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new EmailAlreadyExistException(\"E_ER01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_ER01\"));\n\t}", "@RequestMapping(value = \"/register/Mobile/{firstname}/{surname}/{password}/{phone}/{gender}/{yob}/{emailAddress:.+}\",\n method= RequestMethod.GET)\n @ResponseBody\n public ResponseEntity<HashMap<String,String>> registerMobile (@PathVariable(\"firstname\") String firstname,\n @PathVariable(\"surname\") String surname,\n @PathVariable(\"password\") String password,\n @PathVariable(\"phone\") String phone,\n @PathVariable(\"gender\") String gender,\n @PathVariable(\"yob\") int yob,\n @PathVariable(\"emailAddress\") String emailAddress\n ) throws ParseException {\n\n respMap = new HashMap<>();\n httpStatus = HttpStatus.OK;\n User user = userRepo.findByEmailAddress(emailAddress);\n\n if (user == null) {\n user = new User();\n\n if (checkPasswordFormat(password)) {\n user.setFirstname(firstname);\n user.setSurname(surname);\n user.setEmailAddress(emailAddress);\n user.setPassword(password);\n user.setType(\"Mobile\");\n user.setPhone(phone);\n user.setGender(gender);\n user.setYob(yob);\n // administrators and Mobile users are automatically enabled.\n user.setApproved( true );\n\n userRepo.save(user);\n\n // add empty user-point records for the new user against each retailer.\n\n List<Retailer> retailers = retailerRepo.findAll();\n for(Retailer retailer : retailers) {\n UserPoint newUserPoint = new UserPoint(user.getUserid(), retailer.getRetailerid(), 0);\n userPointRepo.save(newUserPoint);\n }\n\n respMap.put(\"message\",\"User created successfully\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n respMap.put(\"success\",\"1\");\n\n\n } else {\n respMap.put(\"message\",\"Password Incorrect: >= 6 and <= 20, at least one number, upper and lowercase character\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n } else {\n respMap.put(\"message\",\" - This email address is already in use, please chose another email address\");\n respMap.put(\"success\",\"0\");\n respMap.put(\"httpStatus\",\"\"+httpStatus);\n }\n\n return new ResponseEntity<>(respMap, httpStatus);\n }", "public String register() throws NonUniqueBusinessKeyException,\n ValidationException, ObjectNotFoundException,\n MailOperationException, RegistrationException {\n if (logger.isDebugLoggingEnabled()) {\n\n }\n\n String mId = getMarketplaceId();\n String parameter = getRequest().getParameter(\n Constants.REQ_PARAM_SERVICE_KEY);\n String outcome = BaseBean.OUTCOME_SUCCESS;\n\n Long serviceKey = null;\n if (parameter != null && parameter.trim().length() > 0) {\n serviceKey = Long.valueOf(parameter);\n }\n // FIXME: Must be fixed in identity service.\n if (!isInternalMode()) {\n // A confirmation mail must be send, not a user created mail.\n // If no password is given it will be generated\n password = \"\";\n }\n try {\n organization = getAccountingService().registerCustomer(\n getOrganization(), user.getVOUserDetails(), password,\n serviceKey, mId, getSupplierId());\n } catch (NonUniqueBusinessKeyException ex) {\n if (isInternalMode()) {\n throw ex;\n }\n ex.setMessageKey(BaseBean.ERROR_USER_ALREADY_EXIST);\n ExceptionHandler.execute(ex, true);\n return BaseBean.OUTCOME_ERROR;\n }\n if (logger.isDebugLoggingEnabled()) {\n\n }\n return outcome;\n }", "@RequestMapping(value = \"/register\")\n @ResponseBody\n public CommonReturnType register(@Param(\"telphone\") String telphone,\n @Param(\"otpCode\") String otpCode,\n @Param(\"password\") String password) throws BusinessException, NoSuchAlgorithmException {\n\n String inCacheOtpCode = redisUtils.get(telphone);\n if (StringUtils.equals(otpCode,inCacheOtpCode)){\n throw new BusinessException(EmBusinessError.COMMON_ERROR,\"otpCode error\");\n }\n UserModel userModel = new UserModel();\n userModel.setTelphone(telphone);\n userModel.setEncrptPassword(this.EncodeByMd5(password));\n\n userService.register(userModel);\n return CommonReturnType.create(null);\n\n }", "private void checkUserRegister() {\n console.log(\"aschschjcvshj\", mStringCountryCode + mStringMobileNO);\n console.log(\"asxasxasxasx_token\",\"Register here!!!!!\");\n mUtility.hideKeyboard(RegisterActivity.this);\n mUtility.ShowProgress(\"Please Wait..\");\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"mobile_number\", mStringMobileNO);\n Call<VoLoginData> mLogin = mApiService.checkUserAlreadyRegistered(params);\n mLogin.enqueue(new Callback<VoLoginData>() {\n @Override\n public void onResponse(Call<VoLoginData> call, Response<VoLoginData> response) {\n mUtility.HideProgress();\n VoLoginData mLoginData = response.body();\n // If not register then send detail with otp.\n if (mLoginData != null && mLoginData.getResponse().equalsIgnoreCase(\"false\")) {\n Intent mIntent = new Intent(RegisterActivity.this, VerifyRegisterAccount.class);\n mIntent.putExtra(\"intent_username\", mStringUsername);\n mIntent.putExtra(\"intent_account_name\", mStringAccountName);\n mIntent.putExtra(\"intent_email\", mStringEmail);\n mIntent.putExtra(\"intent_mobileno\", mStringMobileNO);\n mIntent.putExtra(\"intent_password\", mStringPassword);\n mIntent.putExtra(\"intent_fcm_token\", mStringDevicesUIDFCMToken);\n mIntent.putExtra(\"intent_country_code\", mStringCountryCode);\n mIntent.putExtra(\"intent_is_from_signup\", true);\n startActivity(mIntent);\n } else if (mLoginData != null && mLoginData.getResponse().equalsIgnoreCase(\"true\")) {\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_sign_up_already_register, mStringMobileNO), getResources().getString(R.string.str_ok));\n } else {\n if (mLoginData != null && mLoginData.getMessage() != null && !mLoginData.getMessage().equalsIgnoreCase(\"\"))\n showMessageRedAlert(mRelativeLayoutMain, mLoginData.getMessage(), getResources().getString(R.string.str_ok));\n }\n }\n\n @Override\n public void onFailure(Call<VoLoginData> call, Throwable t) {\n mUtility.HideProgress();\n console.log(\"asxasxasx\",new Gson().toJson(call.request().body()));\n t.printStackTrace();\n showMessageRedAlert(mRelativeLayoutMain, getResources().getString(R.string.str_server_error_try_again), getResources().getString(R.string.str_ok));\n }\n });\n }", "@Test\n public void testRegisterSuccessfully() {\n SignUpRequest request = new SignUpRequest(UNIQUE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).registered();\n }", "@Test\n\tvoid repeatedUsernameTest() throws Exception {\n\t\tUser userObj = new User();\n\t\tuserObj.setName(\"Siva Murugan\");\n\t\tuserObj.setEmail(\"[email protected]\");\n\t\tuserObj.setGender(\"M\");\n\t\tuserObj.setMobileNumber(9878909878L);\n\t\tuserObj.setRole(\"C\");\n\t\tuserObj.setUsername(\"sivanew\");\n\t\tuserObj.setPassword(\"Siva123@\");\n\t\tString userJson = new ObjectMapper().writeValueAsString(userObj);\n\t\twhen(userService.registerUser(any(User.class))).thenThrow(new UsernameAlreadyExistException(\"E_UR01\"));\n\t\tmockMvc.perform(post(\"/vegapp/v1/users/register\").contentType(MediaType.APPLICATION_JSON).content(userJson))\n\t\t\t\t.andExpect(status().isConflict()).andExpect(jsonPath(\"$.errorMessage\").value(\"E_UR01\"));\n\t}", "@Test\r\n public void testSendWelcomeSignupMessageSMS_ExistingUser() {\n String mobile = \"9908599937\";//\"9887589396\";\r\n boolean smsSendEnabled= false;\r\n //Commuter commuter = commuterService.getCommuterById(commuter_id);\r\n Commuter commuter = commuterService.getCommuterByMobile(mobile);\r\n boolean userRegistrationExist = true;\r\n boolean status = commuterService.sendWelcomeSignupMessageSMS(commuter, -1, userRegistrationExist, smsSendEnabled);\r\n if (status) {\r\n System.out.println(\"status:\" + status);\r\n }\r\n }", "@PostMapping(\"/register-manager\")\r\n\tpublic ResponseEntity<UserDto> registerManager(@RequestBody UserDto userDto){\n\t\tString firstName = userDto.getFirstName();\r\n\t\tif (firstName == null || firstName.length() < 3 || firstName.length() > 100) {\r\n\t\t\t// Throw Invalid Data exception\r\n\r\n\t\tString lastName = userDto.getLastName();\r\n\t\tif (lastName == null || lastName.length() < 3 || lastName.length() > 100) {\r\n\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t}\r\n\t\tString email = userDto.getEmail();\r\n\t\tif(email == null|| email.length()< 3 || email.length()>100 ){\r\n\t\t\t// Throw Invalid Data exception\r\n\t\t}\r\n\r\n\t\tString mobile = userDto.getMobile();\r\n\t\tif(mobile ==null ||mobile.length() <10 || mobile.length()>10){\r\n\t\t\t// Throw Invalid Data exception\r\n\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "@Override\n public UserAuthenticationResponse registerMobileNumberOTPVerification(VerifyMobileNumberOTPRequest verifyMobileNumberOTPRequest) {\n User user = userService.getUserByMobileNo(verifyMobileNumberOTPRequest.getMobileNo());\n\n checkOTP(user.getId(), verifyMobileNumberOTPRequest.getMobileNo(), verifyMobileNumberOTPRequest.getOtpNumber(), verifyMobileNumberOTPRequest.getSecureKeyword());\n\n String securePassword = passwordUtil.generateRandomSecurePassword();\n\n UserAuthentication userAuthentication = registerUserAuthentication(\"ROLE_USER\", user.getId(), verifyMobileNumberOTPRequest.getMobileNo(), securePassword);\n\n createUserDetails(user);\n return allowAuthentication(userAuthentication.getUsername());\n }", "@PostMapping\n public User addUser(@Validated(value = Create.class) @RequestBody User user) {\n try {\n return userService.addUser(user);\n }catch (UserIdAlreadyExistsException exception){\n throw new UserIdAlreadyExistsException(\"User Id Already Exists\");\n }\n }", "@Test\n\tpublic void registerUserTest4() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass1234\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(passwordsNoMatch));\n\t}", "@PostMapping(value = \"/users\")\n\tpublic <T> ResponseEntity<?> registerProcess(@RequestBody User user) {\t\n\t\tLoginResponse registerResponse = new LoginResponse();\n\t\ttry {\n\n\t\t\tuser.setUserId(userDelegate.fetchUserId(user.getEmail()));\n\t\t\tregisterResponse = userDelegate.register(user);\n\t\t\treturn responseUtil.successResponse(registerResponse);\n\t\t\t\n\t\t} catch(ApplicationException e){\t\n\t\treturn responseUtil.errorResponse(e);\n\t}\n\t\t\n\t}", "@Override\n public void verifyHasPhone() {\n }", "@PostMapping(path = \"/register\",\n produces={MediaType.APPLICATION_JSON_VALUE, MediaType.TEXT_PLAIN_VALUE})\n @Timed\n public ResponseEntity registerAccount(@Valid @RequestBody ManagedUserVM managedUserVM) {\n\n HttpHeaders textPlainHeaders = new HttpHeaders();\n textPlainHeaders.setContentType(MediaType.TEXT_PLAIN);\n\n return userRepository.findOneByLogin(managedUserVM.getLogin().toLowerCase())\n .map(user -> new ResponseEntity<>(\"login already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> userRepository.findOneByEmail(managedUserVM.getEmail())\n .map(user -> new ResponseEntity<>(\"e-mail address already in use\", textPlainHeaders, HttpStatus.BAD_REQUEST))\n .orElseGet(() -> {\n User user = userService\n .createUser(managedUserVM.getLogin(), managedUserVM.getPassword(),\n managedUserVM.getFirstName(), managedUserVM.getLastName(),\n managedUserVM.getEmail().toLowerCase(), managedUserVM.getImageUrl(), managedUserVM.getLangKey());\n\n mailService.sendActivationEmail(user);\n return new ResponseEntity<>(HttpStatus.CREATED);\n })\n );\n }", "@Test\n\tpublic void registerUserTest3() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(emailTaken));\n\t}", "@Test\n public void testRepeatRegistration(){\n UserRegisterKYC userRegister = new UserRegisterKYC(\"hello\", validId2, \"26/02/1995\",\"738583\");\n int requestResponse = userRegister.sendRegisterRequest();\n requestResponse = userRegister.sendRegisterRequest();\n assertEquals(500,requestResponse);\n }", "@Test\n\tpublic void registerUserTest2() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(usernameTaken));\n\t}", "@Test\n void registerUser() throws Exception{\n\n final RegisterDto registerDto = new RegisterDto(\"[email protected]\", \"password\", \"John\", \"Doe\", \"2018\", \"Marnixplaats 18\", \"Antwerpen\", \"Antwerpen\", \"Belgium\");\n\n mockMvc.perform(post(\"/api/security/register\")\n .contentType(MediaType.APPLICATION_JSON_VALUE)\n .content(objectMapper.writeValueAsString(registerDto))).andExpect(status().isOk());\n\n final Users users = userService.findByUsername(\"[email protected]\");\n\n assertThat(users.getUsername()).isEqualTo(\"[email protected]\");\n assertThat(users.getFirstname()).isEqualTo(\"John\");\n assertThat(users.getLastname()).isEqualTo(\"Doe\");\n assertThat(users.getPostcode()).isEqualTo(\"2018\");\n assertThat(users.getAddress()).isEqualTo(\"Marnixplaats 18\");\n assertThat(users.getCity()).isEqualTo(\"Antwerpen\");\n assertThat(users.getProvince()).isEqualTo(\"Antwerpen\");\n assertThat(users.getCountry()).isEqualTo(\"Belgium\");\n\n }", "@PostMapping(value = \"/registerPharmacist\",consumes = MediaType.APPLICATION_JSON_VALUE)\n public ResponseEntity<?> registerPharmacist(@RequestBody PharmacistDTO pharmacistDTO){\n try {\n pharmacistService.registerPharmacist(pharmacistDTO);\n } catch (Exception e) {\n e.printStackTrace();\n return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);\n }\n\n return new ResponseEntity<>(HttpStatus.OK);\n }", "private void checkMobileAvailable(HttpServletRequest request, @NotNull long mobile) {\r\n\t\tString action = getCleanParam(request, config.getParam().getSmsActionName());\r\n\t\t// bind phone , needn't Check account exist\r\n\t\tif (BIND == (Action.safeOf(action))) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// Getting account information\r\n\t\tIamAccountInfo acc = configurer.getIamAccount(new SmsParameter(String.valueOf(mobile)));\r\n\r\n\t\t// Check mobile(user) available\r\n\t\tif (!(acc != null && !StringUtils.isEmpty(acc.getPrincipal()))) {\r\n\t\t\tlog.warn(\"Illegal users, because mobile phone number: {} corresponding users do not exist\", mobile);\r\n\t\t\tthrow new UnknownAccountException(bundle.getMessage(\"GeneralAuthorizingRealm.notAccount\", String.valueOf(mobile)));\r\n\t\t}\r\n\r\n\t}", "private void handleRegister(Business business) {\n\n Call<String> call = rtfBase.register(business); //we get id\n call.enqueue(new Callback<String>() {\n @Override\n public void onResponse(Call<String> call, Response<String> response) {\n if(response.code() == 200)\n {\n // business.setId(response.body());\n // Toast.makeText(RegisterNewBusiness.this, \"registered successfully\",Toast.LENGTH_LONG).show();\n\n connectToApp(business);\n\n\n }\n if(response.code() == 400)\n {\n Toast.makeText(RegisterNewBusiness.this, \"you already registered\",Toast.LENGTH_LONG).show();\n\n }\n if(response.code() == 404)\n {\n Toast.makeText(RegisterNewBusiness.this, \"something wrong\",Toast.LENGTH_LONG).show();\n\n }\n }\n\n\n @Override\n public void onFailure(Call<String> call, Throwable t) {\n Toast.makeText(RegisterNewBusiness.this, t.getMessage(),Toast.LENGTH_LONG).show();\n }\n });\n }", "public ManResponseBean registerUser(UserRegisterForm bean) throws Exception {\n String url = \"/services/RegisterUser\";\n /*\n * UserId SecurePassword SecurePin PinPayment PinAmount PinMenu PinPG\n * PinPGRate Name LeadId EmailNotify etc ReturnUrl TermsAgree Email\n * Language\n */\n NameValuePair[] params = {\n new NameValuePair(\"UserId\", bean.getUserId()),\n new NameValuePair(\"SecurePassword\", bean.getSecurePassword()),\n new NameValuePair(\"SecurePin\", bean.getSecurePin()),\n new NameValuePair(\"PinPayment\", bean.getPinPayment()),\n new NameValuePair(\"PinAmount\", bean.getPinAmount()),\n new NameValuePair(\"PinMenu\", bean.getPinMenu()),\n new NameValuePair(\"PinPG\", bean.getPinPG()),\n new NameValuePair(\"PinPGRate\", bean.getPinPGRate()),\n new NameValuePair(\"FirstName\", bean.getFirstName()),\n new NameValuePair(\"LastName\", bean.getLastName()),\n new NameValuePair(\"Name\", bean.getFirstName() + \" \"\n + bean.getLastName()),\n new NameValuePair(\"LeadId\", bean.getLeadId()),\n new NameValuePair(\"EmailNotify\", bean.getEmailNotify()),\n new NameValuePair(\"etc\", bean.getEtc()),\n new NameValuePair(\"ReturnUrl\", bean.getReturnUrl()),\n new NameValuePair(\"TermsAgree\", bean.getTermsAgree()),\n new NameValuePair(\"Question\", bean.getQuestion()),\n new NameValuePair(\"Answer\", bean.getAnswer()),\n new NameValuePair(\"Language\", bean.getLanguage()),\n new NameValuePair(\"Email\", bean.getEmail()) };\n ManResponseBean response = handlePOSTRequest(url, params, null);\n return response;\n }", "@PostMapping(\"/register\")\n\tpublic String register(Retailer bean,ModelMap map) {\n\t\tint check = service.register(bean);\n\t\tif(check>0) {\n\t\t\tmap.addAttribute(\"msg\", \"you are Registered and Id is\"+check);\n\t\t}else {\n\t\t\tmap.addAttribute(\"msg\", \"Email is repeated\");\n\t\t}\n\t\treturn \"login\";\n\t}", "boolean registerUser(UserRegisterDTO userRegisterDTO);", "@Test\n public void test_create_user_success() throws Exception {\n UserDto user = new UserDto(null, \"Arya\", \"Stark\", \"[email protected]\");\n UserDto newUser = new UserDto(1L, \"Arya\", \"Stark\", \"[email protected]\");\n\n when(userService.existsByEmail(user)).thenReturn(false);\n when(userService.createUser(user)).thenReturn(newUser);\n\n mockMvc.perform(post(\"/users\").contentType(MediaType.APPLICATION_JSON).content(asJsonString(user)))\n .andExpect(status().isCreated());\n\n verify(userService, times(1)).existsByEmail(user);\n verify(userService, times(1)).createUser(user);\n verifyNoMoreInteractions(userService);\n }", "@Test\n\tpublic void registerUserTest5() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.ofNullable(null));\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(500));\n\t}", "@Test\n\tpublic void registerUserTest1() throws Exception {\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).characterEncoding(\"UTF-8\")).andDo(print()).andExpect(status().is(400));\n\n\t}", "@Test\n public void testRegisterDuplicateUsername() {\n SignUpRequest request = new SignUpRequest(DUPLICATE, \"Secret\");\n\n dao.register(request);\n\n verify(controller).duplicateUsername();\n\n try {\n verify(connection, never()).register(request);\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }\n }", "@Test\n public void createNewUserAndCheckIt() {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserLogin(\"068-068-68-68\");\n userLogin.setUserPassword(\"12345\");\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n\n //Successful registration\n userLogin.setUserPasswordNew(\"12345\");\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n\n assertThat(userResponse.getUserPhone().equals(usersService.normalizeAndCheckPhoneFormat(userLogin.getUserLogin())));\n assertThat(userResponse.getUserPoints()).size().isEqualTo(5);\n }", "void validateMobileNumber(String stringToBeValidated,String name);", "@Test\n\t\tvoid givenEmail_CheckForValidationForMobile_RetrunTrue() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"98 9808229348\");\n\t\t\tAssertions.assertTrue(result);\n\t\t}", "@Test\n public void processRegistration() throws Exception {\n String newUserName = \"goodusername\";\n long numberOfExpectedUsers = userRepository.count() + 1;\n mockMvc.perform(post(RegistrationController.BASE_URL)\n .contentType(MediaType.APPLICATION_FORM_URLENCODED)\n .param(userNameField, newUserName)\n .param(passwordField, samplePasswordValue)\n .param(verifyPasswordField, samplePasswordValue))\n .andExpect(view().name(SearchController.REDIRECT + IndexController.URL_PATH_SEPARATOR))\n .andExpect(status().is3xxRedirection());\n long updatedNumberOfUsers = userRepository.count();\n assertEquals(numberOfExpectedUsers, updatedNumberOfUsers);\n }", "private void register() {\n RegisterModel registerModel = new RegisterModel(edtEmail.getText().toString(),\n edtPaswd.getText().toString(),\n edtDisplayName.getText().toString());\n\n Response.Listener<RegisterApiResponse> responseListener = new Response.Listener<RegisterApiResponse>() {\n @Override\n public void onResponse(RegisterApiResponse response) {\n if (response.isSuccess()) login();\n }\n };\n\n Response.ErrorListener errorListener = new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n progressDialog.cancel();\n if (error != null) {\n String errorMsg = \"An error occurred\";\n String err = (error.getMessage() == null) ? errorMsg : error.getMessage();\n Log.d(TAG, err);\n error.printStackTrace();\n\n if (err.matches(AppConstants.CONNECTION_ERROR) || err.matches(AppConstants.TIMEOUT_ERROR)) {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n } else if (err.matches(\".*Duplicate entry .* for key 'name_UNIQUE'.*\")) {\n edtDisplayName.setError(\"username taken\");\n edtDisplayName.requestFocus();\n } else if (err.matches(\".*The email has already been taken.*\")) {\n edtEmail.setError(\"email taken\");\n edtEmail.requestFocus();\n } else {\n AlertDialog.Builder alertDialog = new AlertDialog.Builder(RegisterActivity.this);\n alertDialog.setTitle(getString(R.string.error_title_signup));\n alertDialog.setMessage(getString(R.string.error_message_network)).setCancelable(false)\n .setPositiveButton(getString(R.string.dialog_ok), new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.cancel();\n }\n });\n alertDialog.show();\n }\n }\n }\n };\n\n\n progressDialog.setMessage(getString(R.string.progress_dialog_message_login));\n RegistrationRequests registerRequest =\n RegistrationRequests.register(this, registerModel, responseListener, errorListener);\n VolleyRequest.getInstance(this.getApplicationContext()).addToRequestQueue(registerRequest);\n progressDialog.show();\n }", "private void doRegister(){\n Map<String, String> mParams = new HashMap<>();\n mParams.put(\"account\", etPhone.getText().toString());\n mParams.put(\"password\", etPwd.getText().toString());\n mParams.put(\"code\", etValid.getText().toString());\n\n x.http().post(HttpUtils.getRequestParams(\"/teacher/v1/register\", mParams),\n\n new Callback.CommonCallback<String>() {\n @Override\n public void onSuccess(String result) {\n\n CustomProgress.hideDialog();\n LogUtil.d(\"\"+result);\n Response response = CommonUtil.checkResponse(result);\n if (response.isStatus()) {\n SharedPreferences shareAutoLogin = MyApplication.getInstance().getShareAutoLogin();\n SharedPreferences.Editor editor = shareAutoLogin.edit();\n editor.putBoolean(MyApplication.getInstance().AUTOLOGIN, true);\n editor.commit();\n MyApplication.getInstance().setShareApp(etPhone.getText().toString(), etPwd.getText().toString());\n User user = User.getUserFromJsonObj(response.getData().optJSONObject(\"data\"));\n User.setCurrentUser(user);\n MobclickAgent.onProfileSignIn(user.getNickName());\n\n // 登录环信\n if (!StringUtils.isEmpty(user.hxId) && !StringUtils.isEmpty(user.hxPwd))\n AppUtils.loginEmmobAndSaveInfo(user);\n\n // 极光推送设置别名\n JPushInterface.setAlias(RegisterActivity.this, user.getId() + \"\", new TagAliasCallback() {\n @Override\n public void gotResult(int i, String s, Set<String> set) {\n if (i == 0) {\n LogUtil.i(\"极光推送别名设置成功,别名:\" + s);\n }\n }\n });\n\n socketLogin(user.getToken());\n\n Intent intent = new Intent(RegisterActivity.this, CodeActivity.class);\n startActivity(intent);\n finish();\n } else {\n Toast.makeText(x.app(), response.getData().optString(\"message\"), Toast.LENGTH_SHORT).show();\n\n }\n }\n\n @Override\n public void onError(Throwable ex, boolean isOnCallback) {\n\n CustomProgress.hideDialog();\n\n if (ex instanceof HttpException) { // 网络错误\n HttpException httpEx = (HttpException) ex;\n int responseCode = httpEx.getCode();\n String responseMsg = httpEx.getMessage();\n String errorResult = httpEx.getResult();\n LogUtil.d(responseCode + \":\" + responseMsg);\n Toast.makeText(x.app(), x.app().getResources().getString(R.string.net_error), Toast.LENGTH_SHORT).show();\n } else { // 其他错误\n // ...\n }\n //Toast.makeText(x.app(), ex.getMessage(), Toast.LENGTH_LONG).show();\n }\n\n @Override\n public void onCancelled(CancelledException cex) {\n Toast.makeText(x.app(), \"cancelled\", Toast.LENGTH_LONG).show();\n }\n\n @Override\n public void onFinished() {\n\n }\n });\n\n }", "@Test\n\tpublic void registerUserTest7() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tUser user = new User();\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(user);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(201)).andExpect(content().json(objectMapper.writeValueAsString(user)));\n\t}", "public void validateRegistration(RegistrationModel register) {\n\t\tif (registerDao.checkAccountNoIfExist(register.getAccount_no(), register.getJai())) {\n\t\t\t// Checks if account if not Existing and not Verified \n\t\t\tif (!registerDao.checkCustomerLinkIfExist(register.getAccount_no())) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\t// Account already registered.\n\t\t\t\tVerificationModel verify = new VerificationModel();\n\t\t\t\tverify.setAccount_no(register.getAccount_no());\n\t\t\t\t\n\t\t\t\tTimestamp todayTimeStamp = new Timestamp(System.currentTimeMillis());\n\t\t\t\tTimestamp regTimeStamp = verifyDao.retireveReg_date(verify); \n\t\t\t\tlong diffHours = (regTimeStamp.getTime()-todayTimeStamp.getTime()) / (60 * 60 * 1000);\n\t\t\t\t\n\t\t\t\tif (diffHours>24) {\n\t\t\t\t\tgenerateCustomerRecord(register);\n\t\t\t\t} else {\n\t\t\t\t\t// Account already registered. Please verify your registration\n\t\t\t\t\tsetRegistrationError(\"R02\"); \n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Customer not allowed to access online service of OBS!\n\t\t\tsetRegistrationError(\"R01\"); \n\t\t}\n\t}", "@Test\n public void registerInvalidCity() throws Exception {\n user.setCityId(-100);\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "public Boolean register(HttpServletRequest request) throws Exception;", "@Test\n public void testRegisterExistingPatient(){\n register.registerPatient(\"Mikke\",\"Mus\",\"24120012345\", \"Doctor Proctor\");\n assertThrows(IllegalArgumentException.class,\n () -> { register.registerPatient(\"Donald\", \"Duck\", \"24120012345\", \"Doctor Proctor\") ;});\n assertEquals(1, register.getRegisterSize());\n }", "@PostMapping(\"/register-clerk\")\r\n\tpublic ResponseEntity<UserDto> registerClerk(@RequestBody UserDto userDto){\n\t\t\t\tString firstName = userDto.getFirstName();\r\n\t\t\t\tif (firstName == null || firstName.length() < 3 || firstName.length() > 100) {\r\n\t\t\t\t\t// Throw Invalid Data exception\r\n\r\n\t\t\t\tString lastName = userDto.getLastName();\r\n\t\t\t\tif (lastName == null || lastName.length() < 3 || lastName.length() > 100) {\r\n\t\t\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t\t\t}\r\n\t\t\t\tString email = userDto.getEmail();\r\n\t\t\t\tif(email == null|| email.length()< 3 || email.length()>100 ){\r\n\t\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t\t}\r\n\r\n\t\t\t\tString mobile = userDto.getMobile();\r\n\t\t\t\tif(mobile ==null ||mobile.length() <10 || mobile.length()>10){\r\n\t\t\t\t\t// Throw Invalid Data exception\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t}", "@Test\n public void createNewUserByExternalTokenAndCheckIt() throws Exception {\n UserLogin userLogin = new UserLogin();\n userLogin.setUserToken(UUID.randomUUID().toString());\n boolean isThrow = false;\n try {\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n } catch (ApplicationException e) {\n isThrow = true;\n }\n assertThat(isThrow);\n\n //Add login and expect new user successful registration\n userLogin.setUserLogin(\"[email protected]\");\n UserResponse userResponse = loginsService.checkLoginSignInSignUp(userLogin, \"SignUp\");\n assertThat(userResponse.getUserMail().equals(userLogin.getUserLogin()));\n assertThat(userResponse.getUserPoints()).size().isEqualTo(5);\n }", "@RequestMapping(value = \"/user/validate\")\n @Service\n public @ResponseBody ValidateResult validatePhoneNumberAPI(@RequestParam(value = \"phoneNumber\", required = true) String phoneNumber) {\n \tValidateResult result = new ValidateResult();\n \t\n \tresult.setResult(phoneNumber.substring(0, Math.min(phoneNumber.length(), 10)));\n \t\n \treturn result;\n }", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@Test\n @InSequence(2)\n public void testInvalidRegister() {\n //find a existed customer\n List<Customer> customers = customerService.findAllCustomers();\n Customer customer = customers.get(0);\n //find a existed taxi\n List<Taxi> taxis = taxiService.findAllTaxis();\n Taxi taxi = taxis.get(0);\n GuestBooking guestBooking = createGuestBookingInstance(customer, taxi.getId(), futureDate1);\n\n try {\n guestBookingRestService.createBooking(guestBooking);\n fail(\"Expected a RestServiceException to be thrown\");\n } catch(RestServiceException e) {\n // the status should be same with the one in class BookingRestService\n assertEquals(\"Unexpected response status\",\n Response.Status.CONFLICT, e.getStatus());\n assertTrue(\"Unexpected error. Should be UniqueEmailException\",\n e.getCause() instanceof UniqueEmailException);\n assertEquals(\"Unexpected response body\", 1,\n e.getReasons().size());\n log.info(\"Invalid booking register attempt failed with return code \" + e.getStatus());\n }\n }", "@PostMapping(\"/register\")\n public ResponseEntity<Map<String, String>> registerUser(@RequestBody User user){ \n userService.registerUser(user);\n return new ResponseEntity<>(generateJWTTToken(user), HttpStatus.OK);\n }", "boolean userRegistration(UserDTO user) throws UserException,ConnectException;", "public interface IRegisterPre\n{\n /**\n * 验证验证码\n *\n * @param mobile 电话\n * @param code 验证码\n * @param type 类型,主要用于不同地方发送验证码,例如登录,注册等\n */\n void validSecurityCode(String mobile, String code, String type, String tokenId);\n\n void register(String mobile, String password, String tokenId);\n}", "@PostMapping(\"/register\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody User user, BindingResult result){\n \t\n \tResponseEntity<?> errorMap = mapValidationErrorService.mapValidationService(result);\n \n\t\tif(errorMap!=null) \n \treturn errorMap;\n\n User newUser = userService.save(user);\n return new ResponseEntity<User>(newUser, HttpStatus.CREATED);\n }", "private void callRegisterHttp(String phone, int region, final Bundle bundle){\n ObserverOnNextListener<GetVerificationCodeModel> observer = new ObserverOnNextListener<GetVerificationCodeModel>() {\n @Override\n public void onNext(GetVerificationCodeModel model) {\n if(model.getStatus().equals(Constant.CONNECT_SUCCESS)){\n setPrevTitle(mTitle);\n replaceFragment(new VerifyPhoneFragment(), bundle);\n }\n else if(model.getStatus().equals(Constant.CONNECT_FAILED)){\n showBottomSnackBar(getString(R.string.network_connect_errors));\n Log.e(TAG, \"Fail: \" + model.getResult().getErrors().get(0));\n }\n }\n };\n HttpMethod.getInstance().registerByPhone(new ProgressObserver<GetVerificationCodeModel>(getContext(), observer), phone, region);\n }", "@Test\n\t\tvoid WithoutSpace_CheckForValidationForMobile_RetrunFalse() {\n\t\t\tboolean result = ValidateUserDetails.validateMobile(\"919874563214\");\n\t\t\tAssertions.assertFalse(result);\n\t\t}", "@PostMapping(path = \"/register\")\n public @ResponseBody\n String registerUser( @RequestBody TaiKhoan user) {\n // Admin admin = mAdminDao.findByToken(token);\n //if (admin != null) {\n TaiKhoan taiKhoan = mTaiKhoanDao.save(new TaiKhoan(user.getTentk(), user.getMatkhau(), user.getGmail(), user.getSdt(),user.getCmt(),user.getTypeuser(),user.getAnh()));\n if (taiKhoan != null) return AC_REGISTER_SUCESS;\n else return AC_REGISTER_NO_SUCESS;\n //} else return AC_REGISTER_NO_SUCESS;\n }", "@Test\n final void testCreateDeviceAlreadyExists() {\n when(deviceDao.findDevice(DeviceFixture.SERIAL_NUMBER)).thenReturn(Optional.of(deviceDTO));\n\n assertThrows(\n ExceptionType.DeviceAlreadyExistsException.class,\n () -> deviceController.createDevice(createDeviceRequest));\n }", "@PostMapping(\"/register\")\n public String register(@Valid UserForm userForm, BindingResult result){\n if(!userForm.confirmPassword()){\n result.rejectValue(\"confirmPassword\",\"confirmError\",\"两次密码不一致\");\n// boo = false;\n }\n if(result.hasErrors()){\n return \"register\"; // 如果使用@Valid注解,就表示已经将userForm和result放到了model中,直接可以在前端获取信息\n }\n// if(result.hasErrors()){\n// List<FieldError> fieldErrors = result.getFieldErrors();\n// for(FieldError error : fieldErrors){\n// System.out.println(error.getField() + \" : \" + error.getDefaultMessage() + \" : \" + error.getCode());\n// }\n// boo = false;\n// }\n// if(!boo){\n// return \"register\";\n// }\n User user = userForm.convertToUser();\n userRepository.save(user);\n return \"redirect:/login\";\n }", "void createCustomerAccount(String mobileNumber) throws Exception;", "private boolean sendRequest(Map<?, ?> msbRegistionBodyMap) \n {\n LOGGER.info(\"Start registering to microservice bus\");\n String rawData = JsonUtil.toJson(msbRegistionBodyMap); \n MsbDetails oMsbDetails = MsbDetailsHolder.getMsbDetails();\n if(null == oMsbDetails) {\n LOGGER.info(\"MSB Details is NULL , Registration Failed !!!\");\n return false;\n } \n RestResponse oResponse = RestfulClient.sendPostRequest(oMsbDetails.getDefaultServer().getHost(),\n oMsbDetails.getDefaultServer().getPort(),\n MSB_REGISTION_URL, rawData);\n \n if(null == oResponse){\n LOGGER.info(\"Null Unregister Response for \" + MSB_REGISTION_URL);\n return false;\n } \n LOGGER.info(\"Response Code Received for MBS Registration:\" + oResponse.getStatusCode()); \n return isSuccess(oResponse.getStatusCode()) ? true : false;\n }", "@Test\n public void registerUsernameTaken() throws Exception {\n user.setUsername(\"sabina\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.CONFLICT.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "public Response<CustomerRegResponseDto> createCustomer(CustomerRegRequestDto requestDto) {\n\t\tResponse<CustomerRegResponseDto> responseDto = new Response<>();\n\t\tOptional<User> user = userRepo.findByUserId(requestDto.getUserId());\n\t\tif (!user.isPresent())\n\t\t\tthrow new UserNotFoundException(CustomerConstants.USER_NOT_FOUND);\n\n\t\tOptional<User> userEmail = userRepo.findByEmailId(requestDto.getCustomerEmailId());\n\t\tif (userEmail.isPresent())\n\t\t\tthrow new UserAlreadyExistException(CustomerConstants.USER_EMAIL_ID_ALREADY_EXISTS);\n\n\t\tUser userUserName = userRepo.findByUserNameContainsIgnoreCase(requestDto.getCustomerUserName().toLowerCase());\n\t\tif (userUserName != null)\n\t\t\tthrow new UserAlreadyExistException(CustomerConstants.USER_NAME_ALREADY_EXISTS);\n\n\t\tif (!requestDto.getPassword().equals(requestDto.getConfirmPassword())) {\n\t\t\tthrow new NoDataFoundException(CustomerConstants.PASSWORD_CONFIRMATION);\n\n\t\t}\n\n\t\tCustomer addNewCustomer = addCustomerDetails(requestDto);\n\t\tUser newUser = addNewUser(requestDto, addNewCustomer);\n\t\tCustomerRegResponseDto response = new CustomerRegResponseDto();\n\t\tresponse.setCustomerId(addNewCustomer.getCustomerId());\n\t\tresponse.setUserId(newUser.getUserId());\n\t\tresponseDto.setData(response);\n\t\tresponseDto.setMessage(CustomerConstants.CUSTOMER_CREATED_SUCCESSFULLY);\n\t\tresponseDto.setStatus(HttpServletResponse.SC_OK);\n\t\tresponseDto.setError(false);\n\t\tsendRegistrationEmailNotification(requestDto);\n\t\treturn responseDto;\n\t}", "@Service\npublic interface RegisterService extends ICommService {\n boolean registerByEmail(String register_account,String register_password) throws ServiceException;\n boolean registerByPhone(String register_account,String register_password) throws ServiceException;\n}", "@Test\n public void registerServerError() throws Exception {\n user.setUsername(\"thatssssaaaaaaaaaaveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeryyyyyylo\" +\n \"oooooooooonggggusernameeeeeeeeeeeeeeeeee\");\n // when:\n MockHttpServletResponse response\n = this.mockMvc.perform(post(\"/user\")\n .contentType(MediaType.APPLICATION_JSON)\n .content(jacksonTester.write(user).getJson()))\n .andReturn().getResponse();\n\n // then:\n assertThat(response.getStatus()).as(\"Checking HTTP status\")\n .isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR.value());\n\n // checking links:\n JSONObject responseJson = new JSONObject(response.getContentAsString());\n Assert.assertTrue(\"Checking _links is there\", responseJson.has(\"_links\"));\n JSONObject linksJson = responseJson.getJSONObject(\"_links\");\n Assert.assertTrue(\"Checking home is there\", linksJson.has(\"home\"));\n }", "public interface RegisterService {\n\n /**\n * 获取验证码\n * @param para\n * @return\n */\n RegisterResult getPictureCode(RegisterEnter para);\n /**\n * 注册用户\n * @param para\n * @return\n */\n RegisterResult registerUser(RegisterEnter para);\n\n\n /**\n * 个人用户注册设置密码\n * @param para\n * @return\n */\n @Role\n RegisterResult register_person(RegisterEnter para);\n\n /**\n * 插入注册推荐人公司信息\n * @param dept\n */\n void insertReferrerDept(String dept,String mobileNo);\n}", "@Override\n public RegisterBO register(UserRequest userRequest) {\n User user = new User().with(u -> u.email = userRequest.getEmail())\n .with(u -> u.username = userRequest.getEmail())\n .with(u -> u.preferredLanguages.add(new Locale(\"es\", \"CL\")))//TODO: revisar mas adelante\n .with(u -> u.password = userRequest.getPassword())\n .with(u -> u.fullName = userRequest.getFullName());\n if (userRequest.getPhone() != null)\n user.with(u -> u.mobilePhone = userRequest.getPhone().trim());\n\n // Se inicia el registro de usuario y objecto request\n UserRegistration registration = new UserRegistration();\n registration.applicationId = UUID.fromString(aplicationId);\n registration.verified = false;\n\n RegistrationRequest request = new RegistrationRequest(user, registration);\n\n // Uso el objeto ClientResponse para capturar respuesta\n ClientResponse<RegistrationResponse, Errors> response = getFusionAuthClient.register(null, request);\n\n // Traducto respuesta segun exito o error\n return registerTranslate.translate(response);\n }", "@PostMapping(\"/process_register\")\n public String processRegistration(User user,Model model)\n throws SignatureException, NoSuchAlgorithmException, InvalidKeyException{\n\n //checking if user exists\n if(userService.existByLogin(user.getLogin())) {\n model.addAttribute(\"error\", true);\n return \"registerForm\";\n }\n\n model.addAttribute(\"user\", user);\n //saving user\n /* userRepository.save(user);*/\n userService.saveUser(user, Sha512.generateSalt().toString());\n return \"registerSuccessful\";\n }", "@PostMapping(\"/send\")\n public ResponseEntity sendValidate(String username){\n TipCommon tipCommon = authFeign.findUserPhone(username, \"WEB_MANAGER\");\n\n log.info(\"tipCommon:{}\",tipCommon);\n if(tipCommon.getCode() != 200){\n tipCommon.setCode(500);\n tipCommon.setMsg(\"用户该客户端无法登录\");\n return ResponseEntity.badRequest().body(tipCommon);\n }\n\n// if(null == userInfo){\n// log.debug(\"用户名:{} 不存在\", username);\n// tipCommon.setCode(500);\n// tipCommon.setMsg(\"用户名不存在\");\n// return ResponseEntity.badRequest().body(tipCommon);\n// }\n//\n// if(!StringUtils.equals(userInfo.getStatus(),\"1\")){\n// log.debug(\"用户名:{} 状态:{} 不可用\",userInfo.getLoginName(),userInfo.getStatus());\n// tipCommon.setCode(500);\n// tipCommon.setMsg(\"用户状态不可用\");\n// return ResponseEntity.badRequest().body(tipCommon);\n// }\n Random random = new Random();\n\n String code = \"\";\n for (int i = 0; i < 4; i++) {\n code += random.nextInt(10);\n }\n\n LoginMessageVo loginMessageVo = new LoginMessageVo();\n loginMessageVo.setBusinessId(30L);\n loginMessageVo.setCode(code);\n loginMessageVo.setPhone(Long.valueOf(tipCommon.getMsg()));\n HttpHeaders httpHeaders = new HttpHeaders();\n httpHeaders.setContentType(MediaType.APPLICATION_JSON);\n\n HttpEntity<LoginMessageVo> httpEntity = new HttpEntity<>(loginMessageVo, httpHeaders);\n if(!smsValidateService.checkMobileSendTime(tipCommon.getMsg())){\n tipCommon.setCode(500);\n tipCommon.setMsg(\"短信发送过于频繁,每分钟只能发送一次\");\n return ResponseEntity.badRequest().body(tipCommon);\n }\n ResponseEntity<Map> exchange = null;\n try {\n exchange = restTemplate.exchange(\"http://sms.zhidianfan.com/message/sendLoginMessage\", HttpMethod.POST, httpEntity, Map.class);\n } catch (RestClientException e) {\n log.error(\"短信发送异常\");\n tipCommon.setCode(500);\n tipCommon.setMsg(\"网络繁忙,稍后重试\");\n return ResponseEntity.badRequest().body(tipCommon);\n }\n Map body = exchange.getBody();\n log.info(\"短信发送结果:{}\", body);\n boolean data = (boolean)body.get(\"data\");\n if (data) {\n SmsValidate smsValidate = new SmsValidate();\n smsValidate.setCode(code);\n smsValidate.setIsUse(0);\n smsValidate.setBusinessId(30);\n smsValidate.setPhone(tipCommon.getMsg());\n validateService.insert(smsValidate);\n }\n\n return ResponseEntity.ok(SuccessTip.SUCCESS_TIP);\n }", "private void registerUser(String number) {\n HashMap<String, String> parameters = new HashMap<>(); // for our app, we are using the verified phone number as parameters\n parameters.put(\"phone\", number);\n\n String apiKey = \"https://crtsapp.herokuapp.com/api/crts/auth/register/\"; // change this whenever you upload the project to some other backend service.\n JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(\n Request.Method.POST,\n apiKey,\n new JSONObject(parameters),\n response -> {\n try {\n if(response.getBoolean(\"success\")){\n // On successful registration, we will login the user subsequently.\n // Logging in the user will also help to get the information of the user\n // that can be stored in the local storage(Using SharedPreference) to fasten the App.\n loginUser(number);\n }else{\n Toast.makeText(MainActivity.this, \"Please click on Verify again\", Toast.LENGTH_SHORT).show();\n }\n } catch (JSONException jsonException) {\n jsonException.printStackTrace();\n }\n },\n error -> {\n\n NetworkResponse response = error.networkResponse;\n if(error instanceof ServerError && response!=null){\n try {\n String res = new String(response.data, HttpHeaderParser.parseCharset(response.headers, \"utf-8\"));\n JSONObject obj = new JSONObject(res);\n Toast.makeText(MainActivity.this, obj.getString(\"msg\"), Toast.LENGTH_SHORT).show();\n\n }catch (JSONException | UnsupportedEncodingException jsonException){\n jsonException.printStackTrace();\n }\n }\n }\n ){\n @Override\n public Map<String, String> getHeaders() {\n HashMap<String, String> headers = new HashMap<>();\n headers.put(\"Content-Type\", \"application/json\");\n return headers;\n }\n };\n\n // Adding a retry policy to ensure user can try again to login in case there is an issue with the backend.\n int socketTime = 5000; // 5sec time is given to register\n RetryPolicy retryPolicy = new DefaultRetryPolicy(socketTime,\n DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);\n jsonObjectRequest.setRetryPolicy(retryPolicy);\n\n RequestQueue requestQueue = Volley.newRequestQueue(this);\n requestQueue.add(jsonObjectRequest);\n\n }", "@Test(expected = UserAlreadyExists.class)\n public void registryUserExists() throws Exception {\n\n User user_expected = new User();\n user_expected.setId(1L);\n user_expected.setName(\"nametest\");\n user_expected.setLast_name(\"lastnametest\");\n user_expected.setUsername(\"usernametest\");\n user_expected.setPassword(\"a7574a42198b7d7eee2c037703a0b95558f195457908d6975e681e2055fd5eb9\");\n\n given(userRepository.findByUsername(anyString())).willReturn(Optional.of(user_expected));\n\n User user_saved = userServiceImpl.registryUser(this.user);\n\n }", "public boolean registerToServer() throws Exception{\n \t\n\t\t// On crée un objet container pour contenir nos donnée\n\t\t// On y ajoute un AdminStream de type Registration avec comme params le login et le mot de pass\n \tRegistrationRequest regRequest = new RegistrationRequest(login, pass);\n\t\ttry {\n\t\t\t// On tente d'envoyer les données\n\t\t\toos_active.writeObject(regRequest);\n\t\t\t// On tente de recevoir les données\n\t\t\tRegistrationResponse regResponse = (RegistrationResponse)ois_active.readObject();\n\n\t\t\t// On switch sur le type de retour que nous renvoie le serveur\n\t\t\t// !!!Le type enum \"Value\" est sujet à modification et va grandir en fonction de l'avance du projet!!!\n\t\t\tswitch(regResponse.getResponseType()){\n\t\t\tcase REG_ALREADY_EXISTS:\n\t\t\t\topResult = \"Error : User already exist!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_LOGIN_BAD_FORMAT:\n\t\t\t\topResult = \"Error : login bad format!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_PASS_BAD_FORMAT:\n\t\t\t\topResult = \"Error : password bad format!\";\n\t\t\t\treturn false;\n\t\t\tcase REG_SUCCESS:\n\t\t\t\topResult = \"Account registration succeed!\";\n\t\t\t\treturn true;\n\t\t\tcase REG_UNKNOW_ERROR:\n\t\t\t\topResult = \"Error : Unknown error!\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new ClientChatException (ClientChatException.IO_ERREUR, \"ERROR: Communication Error\");\n\t\t}\n\t\treturn false;\n }", "@PostMapping(value = \"/register\") \n\t public RegisterResponseDto\t usersRegister(@RequestBody RegistrationDto registrationDto) {\n\t LOGGER.info(\"usersRegster method\");\n\t return\t userService.usersRegister(registrationDto); \n\t }", "@POST\n\t @Consumes(MediaType.MULTIPART_FORM_DATA)\n\t @Produces(MediaType.APPLICATION_JSON)\n\t @Path(\"/Register\")\n\t public Response Register(@FormDataParam(\"Email\") String Email,\n\t\t\t @FormDataParam(\"FirstName\") String FirstName,\n\t\t\t @FormDataParam(\"LastName\") String LastName,\n\t\t\t @FormDataParam(\"Password\") String Password,\n\t\t\t @FormDataParam(\"Phone\") String Phone,\n\t\t\t @FormDataParam(\"Street\") String Street,\n\t\t\t @FormDataParam(\"City\") String City,\n\t\t\t @FormDataParam(\"State\") String State,\n\t\t\t @FormDataParam(\"PostalCode\") String PostalCode){\n\t\t int statusCode=400;\n\t\t int rs=-1;\n\t\t int emailFound=0;\n\t\t String result;\n\t\t DBConnection databaseInstance= new DBConnection();\n\t\t HashMap<String,String> memberData = new HashMap<String,String>();\n\t\t JSONObject jsonObject= new JSONObject();\t\n\t\t \n\t\t if(Email.equals(\"\")||FirstName.equals(\"\")||LastName.equals(\"\")||Password.equals(\"\")||Phone.equals(\"\")||Street.equals(\"\")||City.equals(\"\")||State.equals(\"\")||PostalCode.equals(\"\")) \n\t\t\t return listBook.makeCORS(Response.status(statusCode), \"\");\n\t\t memberData.put(\"Email\", Email);\n\t\t emailFound=retrieveMember(memberData).length(); \n\t\t \n\t\t memberData.put(\"FirstName\", FirstName);\t\t \n\t\t memberData.put(\"LastName\", LastName);\t\t \n\t\t memberData.put(\"Password\",Password);\t\t \n\t\t memberData.put(\"Phone\", Phone);\t\t \n\t\t memberData.put(\"Street\", Street);\t\t\t \n\t\t memberData.put(\"City\", City);\n\t\t memberData.put(\"PostalCode\", PostalCode);\n\t\t \n\t\t if(emailFound==0){\n\t\t rs= databaseInstance.tableInsertion(memberData, \"members\"); \n\t\t }\t\t \n\t\t try {\n\t\t\t \tif(rs==-1){\n\t\t\t\t\tstatusCode=401;\n\t\t\t\t\tjsonObject.put(\"msg\", \"Email is already in use\");\n\t\t\t\t}\n\t\t\t\tif(rs>0){\n\t\t\t\t\tstatusCode=200;\n\t\t\t\t\tjsonObject.put(\"msg\", \"Register succesful \" + rs);\n\t\t\t\t}\n\n\t\t\t} catch (JSONException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t result =\"\"+ jsonObject;\n\t\t \n\t\t\n\t\treturn listBook.makeCORS(Response.status(statusCode), result);\t\t\t \t\t \n\t }", "@Test\n public void testAddTravel_InvalidCountryCodeExceptionEndpoint() throws Exception {\n dto.getEndpoint().setCountry(\"DTO\");\n \n mockMVC.perform(post(\"/user/1/travel\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(dto))\n .header(\"Authorization\", \"1\"))\n .andExpect(status().isInternalServerError());\n \n verify(databaseMock, times(1)).getUser(anyInt());\n verifyNoMoreInteractions(databaseMock);\n }", "@PostMapping(\"/registerLocation\")\n public ResponseEntity<Response> registerLocation(@Valid @RequestBody LocationModel locationModel, \n Errors result) {\n\n Response response = new Response();\n if (result.hasErrors()) {\n Map<String, String> errors = result.getFieldErrors().stream()\n .collect(Collectors.toMap(FieldError::getField, FieldError::getDefaultMessage));\n\n response.setStatus(false);\n response.setErrorMessages(errors);\n return new ResponseEntity<Response>(response, HttpStatus.BAD_REQUEST);\n\n } else {\n\n try {\n\n locationRepository.save(locationModel);\n response.setStatus(true);\n response.setLocationModel(locationModel);\n\n } catch (Exception ex) {\n\n Map<String, String> errors = new HashMap<>();\n errors.put(\"Error message\", ex.toString());\n response.setStatus(false);\n response.setErrorMessages(errors);\n return new ResponseEntity<Response>(response, HttpStatus.BAD_REQUEST);\n }\n return new ResponseEntity<Response>(response, HttpStatus.CREATED);\n }\n }", "public RegisterResult register(RegisterRequest r) throws DBException, IOException\n {\n try\n {\n idGenerator = UUID.randomUUID();\n String personID = idGenerator.toString();\n User newUser = new User(\n r.getUserName(),\n r.getPassword(),\n r.getEmail(),\n r.getFirstName(),\n r.getLastName(),\n r.getGender(),\n personID\n );\n userDao.postUser(newUser);\n commit(true);\n login = new LoginService();\n\n LoginRequest loginRequest = new LoginRequest(r.getUserName(), r.getPassword());\n LoginResult loginResult = login.loginService(loginRequest);\n login.commit(true);\n\n fill = new FillService();\n FillRequest fillRequest = new FillRequest(r.getUserName(), 4);\n FillResult fillResult = fill.fill(fillRequest);\n fill.commit(true);\n\n\n result.setAuthToken(loginResult.getAuthToken());\n result.setUserName(loginResult.getUserName());\n result.setPersonID(loginResult.getPersonID());\n result.setSuccess(loginResult.isSuccess());\n\n\n if( !loginResult.isSuccess() || !fillResult.isSuccess() )\n {\n throw new DBException(\"Login failed\");\n }\n\n }\n catch(DBException ex)\n {\n result.setSuccess(false);\n result.setMessage(\"Error: \" + ex.getMessage());\n commit(false);\n }\n return result;\n }", "@Override\n public JSONDoRegistrationResult DoRegistration(JSONDoRegistrationData data) throws Exception{\n JSONDoRegistrationResult v_res = new JSONDoRegistrationResult();\n if (!m_CustomerProvider.checkIdentificator(data.getAccount().getEmail())) {\n v_res.addStatus(JSONDoRegistrationResult.USEDEMAIL);\n }\n if (!m_CustomerProvider.checkIdentificator(data.getAccount().getLogin())) {\n v_res.addStatus(JSONDoRegistrationResult.USEDLOGIN);\n }\n if (!m_CustomerProvider.checkIdentificator(data.getAccount().getTelephone())) {\n v_res.addStatus(JSONDoRegistrationResult.USEDPHONE);\n }\n // TODO add check for correct email/phone/login/password\n if (!v_res.getStatus().isEmpty()) {\n return v_res;\n }\n \n Customer v_customer = new Customer();\n v_customer.setEmail(data.getAccount().getEmail());\n v_customer.setLogin(data.getAccount().getLogin());\n v_customer.setName(data.getAccount().getName());\n v_customer.setTelephone(data.getAccount().getTelephone());\n String v_hashedPWD = Hasher.generateStorngPasswordHash(data.getAccount().getPassword());\n v_customer.setPassword(v_hashedPWD);\n \n m_CustomerProvider.placeCustomer(v_customer);\n \n v_res.addStatus(JSONDoRegistrationResult.OK);\n \n return v_res;\n }", "public int register() \n { \n File file = new File(MSB_REGISTION_FILE);\n if(!file.exists()) \n {\n LOGGER.info(\"Stop registering as can't find msb registion file:\" + file.getAbsolutePath()); \n return CommonConstant.MsbRegisterCode.MSDB_REGISTER_FILE_NOT_EXISTS;\n }\n\n Map<?, ?> msbRegistionBodyMap = getMsbRegistrationData();\n if(null == msbRegistionBodyMap)\n {\n LOGGER.info(\"Reading data from msb registion file failed:\" + file.getAbsolutePath()); \n return CommonConstant.MsbRegisterCode.MSDB_REGISTER_FILE_NOT_EXISTS;\n }\n\n LOGGER.info(\"Registering body: \" + JsonUtil.toJson(msbRegistionBodyMap));\n\n bRegistrationStatus = sendRequest(msbRegistionBodyMap);\n \n return bRegistrationStatus \n ? CommonConstant.MsbRegisterCode.MSDB_REGISTER_SUCESS \n : CommonConstant.MsbRegisterCode.MSDB_REGISTER_FAILED;\n }", "@Test\n\tpublic void registerUserTest6() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(null);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(notSuccessful));\n\t}", "@WebMethod public Pertsona register(String izena, String abizena1, String abizena2, String erabiltzaileIzena, String pasahitza, String telefonoa, String emaila, LocalDate jaiotzeData, String mota) throws UserAlreadyExist;", "@Test\n public void testIncorrectName(){\n UserRegisterKYC nameWithNumber = new UserRegisterKYC(\"hello123\",validId3,\"26/02/1995\",\"738583\");\n int requestResponse = nameWithNumber.sendRegisterRequest();\n assertEquals(400, requestResponse);\n\n UserRegisterKYC nameWithSymbol = new UserRegisterKYC(\"hello!\", validId3, \"26/02/1995\",\"587631\");\n requestResponse = nameWithSymbol.sendRegisterRequest();\n assertEquals(400, requestResponse);\n }", "@ApiOperation(value = \" Registration information \", tags = \"Register\")\n\n\t@PostMapping(\"/register\")\n\tpublic String addUser(@RequestParam String emailId,@RequestParam String name,@RequestParam String passwd) throws Exception\n\t{\n\t \n\t\tif(emailId!=null && !\"\".equals(emailId))\n\t\t{\n\t\t\tUser userObj=userservice.fetchByUserEmailId(emailId);\n\t\t\t\n\t\t\tif(userObj!=null) {\n\t\t return \"User with \"+emailId+\" is already exist\";\n\t\t }\n\t\t\t \n\t\t\t\n\t\t}\n\t\t User user =new User(name,emailId,passwd);\n\t\t\n\t\t // genrate 4 digit otp number\n\t\t int myotp=(int)(Math.random() * (8015)) + 2085;\n\t \t\tboolean status=emailservice.SendEmail(\"Otp is \"+myotp , emailId) ;\n\t if(!status)\n\t {\n\t \t return \"Not sending Mail\";\n\t } \n\t LocalTime time=LocalTime.now(); \n\t LocalDate date=LocalDate.now();\n\t user.setOtp(myotp);\n \t user.setActive(false);\n \t user.setLocalDate(date);\n \t user.setLocalTime(time);\n\t userservice.addUser(user);\n\t \n\t\treturn \"verification Start.....\";\n\t}", "public String register(RegisterRequest registerRequest) throws EmailAlreadyUsedException,ResourceNotFoundException {\n if (this.userRepository.existsByEmail(registerRequest.getEmail())) {\n throw new EmailAlreadyUsedException(\"Error: Email is already in use!\");\n }\n // Create new user account\n User user = new User();\n user.setFirstName(registerRequest.getFirstName());\n user.setLastName(registerRequest.getLastName());\n user.setEmail(registerRequest.getEmail());\n user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));\n // Traitement des Roles\n Set<String> registerRequestRoles = registerRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n // find Roles\n if (registerRequestRoles == null) {\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n }else {\n registerRequestRoles.forEach(role -> {\n switch (role) {\n case \"super-admin\":\n Role superAdminRole = null;\n try {\n superAdminRole = this.roleRepository.findByName(ERole.SUPER_ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(superAdminRole);\n\n break;\n case \"admin\":\n Role adminRole = null;\n try {\n adminRole = this.roleRepository.findByName(ERole.ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(adminRole);\n break;\n case \"user\":\n Role userRole = null;\n try {\n userRole = this.roleRepository.findByName(ERole.USER)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(userRole);\n break;\n default:\n Role guestRole = null;\n try {\n guestRole = this.roleRepository.findByName(ERole.GUEST).orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n } catch (ResourceNotFoundException e) {\n e.printStackTrace();\n }\n roles.add(guestRole);\n }\n });\n }\n // Affect User Roles\n user.setRoles(roles);\n this.userRepository.save(user);\n return \"User registered successfully!\";\n }", "@Test\n @WithMockUser\n public void add_post_authenticatedUserAndValidData_returnsCorrectViewAndStatusCode() throws Exception {\n mockMvc.perform(post(URL_CUSTOMERS_ADD)\n .param(PARAM_NAME, NAME)\n .param(PARAM_BIRTH_DATE, BIRTH_DATE))\n .andExpect(status().is3xxRedirection())\n .andExpect(redirectedUrl(URL_CUSTOMERS_ALL));\n }", "@SuppressWarnings(\"unchecked\")\n\t@Test\n\t@InSequence(3)\n\tpublic void testDuplicateEmail() throws Exception {\n\t\tCustomer customer = createCustomerInstance(\"Jane Doe\", \"[email protected]\", \"02125551234\");\n\t\tcustomerRestService.createCustomer(customer);\n\n\t\t// Register a different user with the same email\n\t\tCustomer anotherCustomer = createCustomerInstance(\"John Doe\", \"[email protected]\", \"02133551234\");\n\n\t\ttry {\n\t\t\tcustomerRestService.createCustomer(anotherCustomer);\n\t\t\tfail(\"Expected a RestServiceException to be thrown\");\n\t\t} catch (RestServiceException e) {\n\t\t\tassertEquals(\"Unexpected response status\", Response.Status.CONFLICT, e.getStatus());\n\t\t\tassertTrue(\"Unexecpted error. Should be Unique email violation\",\n\t\t\t\t\te.getCause() instanceof UniqueEmailException);\n\t\t\tassertEquals(\"Unexpected response body\", 1, e.getReasons().size());\n\t\t\tlog.info(\"Duplicate customer register attempt failed with return code \" + e.getStatus());\n\t\t}\n\n\t}", "@Test\n public void testTegisterPatient(){\n register.registerPatient(\"Donald\", \"Trump\",\"16019112345\", \"Doctor Proctor\");\n assertEquals(1, register.getRegisterSize());\n }", "@Override\n public void onFailure(int code, String msg) {\n Toast.makeText(RegisterActivity.this,\"注册失败:\" + msg,Toast.LENGTH_SHORT).show();\n return;\n }", "@PostMapping(\"/register\")\n\tpublic ResponseEntity<User> addUser(@Valid @RequestBody UserRequestDTO userRequest, UriComponentsBuilder ucBuilder) {\n\n\t\tUser existUser = this.userService.findByEmail(userRequest.getEmail());\n\t\tif (existUser != null) {\n\t\t\tthrow new ResourceConflictException(0L/*userRequest.getEmail()*/, \"Email already exists\");\n\t\t}\n\t\tUser user = this.userService.createPatient(userRequest);\n\t\tHttpHeaders headers = new HttpHeaders();\n\t\theaders.setLocation(ucBuilder.path(\"/api/user/{userId}\").buildAndExpand(user.getId()).toUri());\n\t\tthis.emailNotificationService.sendNotificationAsync(user.getEmail(), \"Account Validation\", \"Visit this link and validate your account: http://localhost:8083/api/auth/validate/\" + user.getId() + \"/\");\n\t\treturn new ResponseEntity<>(user, HttpStatus.CREATED);\n\t}", "public static boolean mobileNo(String mobileNo) throws UserRegistrationException {\n\t\tboolean resultMobileNo = validateMobileNo.validator(mobileNo);\n\t\tif(true) {\n\t\t\treturn Pattern.matches(patternMobileNo, mobileNo);\n\t\t}else\n\t\t\tthrow new UserRegistrationException(\"Enter correct Mobile number\");\n\t}", "public interface RegisterService {\n @POST(\"register.php\")\n Call<RegisterResponse>getRegisterResponse(@Body RegisterForm registerForm);\n}", "public BUserToRegisterDto register(BUserToRegisterDto bUserToRegisterDto) {\n\t\tBUserToRegisterDto res = new BUserToRegisterDto();\n\t\tList<String> errores = validateBUserToRegisterDto(bUserToRegisterDto);\n\t\tif(errores.isEmpty()){\n\t\t\tBUser bUser = convertDtoToEntity(bUserToRegisterDto);\n\t\t\tbUserRepository.save(bUser);\n\t\t}else{\n\t\t\tres.setErrores(errores);\n\t\t}\n\t\treturn res;\n\t}", "@Override\r\n\tpublic boolean register(MemberDto mem) {\n\t\treturn register(mem.getEmail(),mem.getName(),mem.getPw());\r\n\t}", "public static RegisterResult register(RegisterRequest r) {\n\n User new_user = new User(UUID.randomUUID().toString(), r.userName, r.password, r.email,\n r.firstName, r.lastName, r.gender);\n\n RegisterResult result = new RegisterResult();\n\n User test_user = UserDao.getUser(r.userName);\n if (test_user != null && !test_user.userName.equals(\"\"))\n {\n result.message = \"Error: Username already taken by another user\";\n result.success = false;\n return result;\n }\n\n result.authToken = UUID.randomUUID().toString();\n AuthTokenDao.updateToken(r.userName, result.authToken);\n\n Person p = new Person(new_user.personID, r.userName, r.firstName, r.lastName, r.gender);\n PersonDao.addPerson(p);\n\n result.userName = r.userName;\n result.personID = new_user.personID;\n UserDao.addUser(new_user);\n\n // Generate 4 generations of ancestry\n GenerateData.generateGenerations(r.userName, 4);\n\n result.success = true;\n\n return result;\n }", "public String register(RegisterRequest registerRequest) throws EmailAlreadyUsedException {\n if (this.userRepository.existsByEmail(registerRequest.getEmail())) {\n throw new EmailAlreadyUsedException(\"Error: Email is already in use!\");\n }\n // Create new user account\n User user = new User();\n user.setFirstName(registerRequest.getFirstName());\n user.setLastName(registerRequest.getLastName());\n user.setEmail(registerRequest.getEmail());\n user.setPassword(passwordEncoder.encode(registerRequest.getPassword()));\n\n // Traitement des Roles\n Set<String> registerRequestRoles = registerRequest.getRoles();\n Set<Role> roles = new HashSet<>();\n\n // find Roles\n if (registerRequestRoles == null) {\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n } else {\n registerRequestRoles.forEach(role -> {\n switch (role) {\n case \"super-admin\":\n Role superAdminRole = this.roleRepository.findByName(ERole.SUPER_ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(superAdminRole);\n\n break;\n case \"admin\":\n Role adminRole = this.roleRepository.findByName(ERole.ADMIN)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(adminRole);\n break;\n case \"user\":\n Role userRole = this.roleRepository.findByName(ERole.USER)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(userRole);\n break;\n default:\n Role guestRole = this.roleRepository.findByName(ERole.GUEST)\n .orElseThrow(() -> new ResourceNotFoundException(\"Error: Role is not found.\"));\n roles.add(guestRole);\n }\n });\n }\n\n // Affect User Roles\n user.setRoles(roles);\n this.userRepository.save(user);\n return \"User registered successfully!\";\n }", "@RequestMapping(value = { \"/new\" }, method = RequestMethod.POST)\r\n public String saveUser(@Valid User user, BindingResult result,\r\n ModelMap model) {\r\n if (result.hasErrors()) {\r\n return \"registration\";\r\n }\r\n\r\n // Preferred way to achieve uniqueness of field [loginID] should be implementing custom @Unique annotation\r\n // and applying it on field [loginID] of Model class [User].Below mentioned peace of code [if block] is\r\n // to demonstrate that you can fill custom errors outside the validation\r\n // framework as well while still using internationalised messages.\r\n\r\n if(!service.isLoginIDUnique(user.getId(), user.getLoginID())){\r\n FieldError loginIDError =new FieldError(\"user\",\"loginID\",messageSource.getMessage(\"non.unique.loginID\", new String[]{user.getLoginID()}, Locale.getDefault()));\r\n result.addError(loginIDError);\r\n return \"registration\";\r\n }\r\n\r\n service.saveUser(user);\r\n model.addAttribute(\"success\", \"user \" + user.getLoginID() + \" registered successfully\");\r\n return \"success\";\r\n }", "@PostMapping(path=\"/register\") // Map ONLY GET Requests\n\tpublic @ResponseBody User addNewUser (@RequestBody User n) throws CloneNotSupportedException {\n\t\tArrayList<User> s = (ArrayList<User>) userRepository.findAllByemail(n.getEmail());\n\t\tUser result =(User) n.clone();\n\t\tif(s.size() > 1) {\n\t\t\tresult.setError(true);\n\t\t\tresult.setError_msg(\"You are already registered!\");\n\t\t\treturn result;\n\t\t} else {\n\t\t\tuserRepository.save(n);\n\t\t}\n\t\treturn result;\n\t}", "@PostMapping(\"/signup\")\n public ResponseEntity<User> create(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the sign-up parameters from the post request\n String user = request.getParameter(\"user\");\n String first = request.getParameter(\"first\");\n String last = request.getParameter(\"last\");\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"pass\");\n\n String pattern = \"^[a-zA-Z0-9]*$\";\n\n // send an HTTP 422 response if any parameter is missing, empty, does not match the pattern (except email)\n if (user == null || user.isEmpty() || !user.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (first == null || first.isEmpty() || !first.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (last == null || last.isEmpty() || !last.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (email == null || email.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (pass == null || pass.isEmpty() || !pass.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // check to see if the userName or email are already taken\n List<User> uniqueAttributeCheck = userRepo.findByUserNameOrEmail(user, email);\n\n // send an HTTP 409 response if either already exists\n if (uniqueAttributeCheck.size() > 0) {\n return ResponseEntity.status(HttpStatus.CONFLICT).body(null);\n }\n\n User newUser;\n\n // create the new User and save it in the user repository\n try {\n newUser = userRepo.save(new User(user, first, last, email, pass));\n } catch (TransactionSystemException e) { // this exception will be thrown if the email does not validate\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // create a new session for the new User\n session = request.getSession();\n session.setAttribute(\"user\", user);\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user));\n\n // send an HTTP 201 response with the new session User\n return ResponseEntity.status(HttpStatus.CREATED).body(newUser.asSessionUser());\n }", "@RequestMapping(value = \"/api/v1/meter/register\", method = RequestMethod.POST, consumes = \"application/json\", produces = \"application/json\")\n\tpublic RestResponse registerMeter(@RequestBody DeviceRegistrationRequest data) {\n\t\tRestResponse response = new RestResponse();\n\n\t\tUUID deviceKey = null;\n\n\t\ttry {\n\t\t\tAuthenticatedUser user = this.authenticate(data.getCredentials(), EnumRole.ROLE_ADMIN);\n\n\t\t\tswitch (data.getType()) {\n\t\t\t\tcase METER:\n\t\t\t\t\tif (data instanceof WaterMeterDeviceRegistrationRequest) {\n\t\t\t\t\t\tWaterMeterDeviceRegistrationRequest meterData = (WaterMeterDeviceRegistrationRequest) data;\n\n\t\t\t\t\t\tAuthenticatedUser owner = userRepository.getUserByUtilityAndKey(user.getUtilityId(),\n\t\t\t\t\t\t\t\t\t\tmeterData.getUserKey());\n\n\t\t\t\t\t\tif (owner == null) {\n\t\t\t\t\t\t\tthrow createApplicationException(DeviceErrorCode.DEVICE_OWNER_NOT_FOUND).set(\"meter\",\n\t\t\t\t\t\t\t\t\t\t\tmeterData.getSerial()).set(\"key\",\n\t\t\t\t\t\t\t\t\t\t\t(meterData.getUserKey() == null ? \"\" : meterData.getUserKey().toString()));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tDevice device = deviceRepository.getWaterMeterDeviceBySerial(meterData.getSerial());\n\n\t\t\t\t\t\tif (device != null) {\n\t\t\t\t\t\t\tthrow createApplicationException(DeviceErrorCode.ALREADY_EXISTS).set(\"id\",\n\t\t\t\t\t\t\t\t\t\t\tmeterData.getSerial());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdeviceKey = deviceRepository.createMeterDevice(owner.getUsername(), meterData.getSerial(),\n\t\t\t\t\t\t\t\t\t\tmeterData.getProperties(), meterData.getLocation());\n\n\t\t\t\t\t\tDeviceRegistrationResponse deviceResponse = new DeviceRegistrationResponse();\n\t\t\t\t\t\tdeviceResponse.setDeviceKey(deviceKey.toString());\n\n\t\t\t\t\t\treturn deviceResponse;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tthrow createApplicationException(DeviceErrorCode.NOT_SUPPORTED).set(\"type\",\n\t\t\t\t\t\t\t\t\tdata.getType().toString());\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(ex.getMessage(), ex);\n\n\t\t\tresponse.add(this.getError(ex));\n\t\t}\n\n\t\treturn response;\n\t}", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@RequestBody RegistrationRequest registrationRequest){\n return userService.registerUser(registrationRequest);\n }", "@PreAuthorize(\"permitAll()\")\n @PostMapping(\"/users/\")\n public ResponseEntity<UserDTO> registerUser(@Valid @RequestBody User user) throws URISyntaxException {\n if (user.getId() != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_CUSTOM_ID,\n HeaderUtil.ERROR_MSG_CUSTOM_ID))\n .body(null);\n }\n\n // OPTION 1 - provided email is already in use by another user\n if (userService.getUserByEmail(user.getEmail()) != null) {\n return ResponseEntity\n .badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_EMAIL_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_EMAIL_ALREADY_IN_USE))\n .body(null);\n }\n\n // OPTION 2 - provide username is already in use by another user\n if (userService.getUserByUsername(user.getUsername()) != null) {\n return ResponseEntity.\n badRequest()\n .headers(HeaderUtil.failure(\n Constants.EntityNames.USER,\n HeaderUtil.ERROR_CODE_USERNAME_ALREADY_IN_USE,\n HeaderUtil.ERROR_MSG_USERNAME_ALREADY_IN_USE))\n .body(null);\n }\n\n user.setVerified(false);\n User result = userService.save(user);\n\n mailSender.sendRegistrationMail(user.getFirstName(), user.getEmail(), null);\n\n return ResponseEntity.created(new URI(\"/api/users/\" + result.getId()))\n .headers(HeaderUtil.createEntityCreationAlert(Constants.EntityNames.USER, result.getId().toString()))\n .body(result.convertToDTO());\n }", "@RequestMapping(value = \"register\", method = RequestMethod.POST)\n public String register(@ModelAttribute @Valid RegisterForm registerForm, Errors errors, HttpServletRequest request, Model model) {\n\n if (errors.hasErrors()) {\n model.addAttribute(\"title\", \"Register to RandNums\");\n model.addAttribute(\"sessionActive\", isSessionActive(request.getSession()));\n return \"login/register\";\n }\n\n User existingUser = userDao.findByUsername(registerForm.getUsername());\n\n if (existingUser != null) {\n errors.rejectValue(\"username\", \"username.alreadyexists\", \"A user with that username already exists\");\n model.addAttribute(\"title\", \"Register\");\n model.addAttribute(\"sessionActive\", isSessionActive(request.getSession()));\n return \"login/register\";\n }\n\n User newUser = new User(registerForm.getUsername(), registerForm.getEmail(), registerForm.getPassword());\n\n userDao.save(newUser);\n setUserInSession(request.getSession(), newUser);\n\n return \"redirect:/home\";\n }", "public boolean register(final RegisterDTO registerDTO)\n\t\t\tthrows ApplicationCustomException, HibernateException, SQLException;", "@OnClick(R.id.register_button)\n public void register () {\n InputMethodManager imm = (InputMethodManager) context\n .getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromInputMethod(usernameField.getWindowToken(), 0);\n imm.hideSoftInputFromInputMethod(passwordField.getWindowToken(), 0);\n imm.hideSoftInputFromInputMethod(confirmField.getWindowToken(), 0);\n imm.hideSoftInputFromInputMethod(emailField.getWindowToken(), 0);\n\n\n\n\n String username = usernameField.getText().toString();\n String password = passwordField.getText().toString();\n String confirm = confirmField.getText().toString();\n String email = emailField.getText().toString();\n String avatarBase64 = \"string\";\n\n if (username.isEmpty() || password.isEmpty() || confirm.isEmpty() || email.isEmpty()) {\n\n Toast.makeText(context, R.string.field_empty, Toast.LENGTH_LONG).show();\n } else if(!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {\n\n Toast.makeText(context, R.string.provide_vaild_email, Toast.LENGTH_SHORT).show();\n\n } else if (!password.equals(confirm)) {\n\n Toast.makeText(context, R.string.passwords_dont_match, Toast.LENGTH_SHORT).show();\n } else {\n\n registerButton.setEnabled(false);\n spinner.setVisibility(VISIBLE);\n }\n Account account = new Account(email, username, avatarBase64, password);\n RestClient restClient = new RestClient();\n restClient.getApiService().register(account).enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n\n if (response.isSuccessful()) {\n Toast.makeText(context, R.string.registration_successful, Toast.LENGTH_LONG).show();\n //This will run if everything comes back good and sets the users token and expiration\n// User regUser = response.body();\n// UserStore.getInstance().setToken(regUser.getToken());\n// UserStore.getInstance().setTokenExpiration(regUser.getExpiration());\n\n //This will set up the flow of the application to show the next view upon successful registration\n Flow flow = PeoplemonApplication.getMainFlow();\n flow.goBack();\n } else {\n\n //This will return if the user has entered info but they have registered before\n resetView();\n Toast.makeText(context, R.string.registration_failed + \": \" + response.code(), Toast.LENGTH_LONG).show();\n }\n }\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n\n //This will show up if the data didn't come back from the server correctly or there is a timeout.\n resetView();\n Toast.makeText(context, R.string.registration_failed, Toast.LENGTH_LONG).show();\n }\n });\n }" ]
[ "0.6455696", "0.6339709", "0.6313856", "0.62987196", "0.62599", "0.62195635", "0.6217549", "0.62005156", "0.6193361", "0.6189587", "0.6104295", "0.60920024", "0.60729885", "0.6043953", "0.604293", "0.5981338", "0.59555334", "0.59451914", "0.59381694", "0.5919558", "0.58859307", "0.58850604", "0.5856057", "0.5844496", "0.5809454", "0.58014524", "0.57892126", "0.57782817", "0.577265", "0.57606405", "0.57526207", "0.57319087", "0.57312983", "0.5712608", "0.5697063", "0.5659215", "0.56366044", "0.5635369", "0.5616857", "0.56127006", "0.56093025", "0.5600631", "0.5599064", "0.5567436", "0.5545714", "0.5543485", "0.55328155", "0.5530723", "0.55302286", "0.5513841", "0.55102193", "0.5506262", "0.55049956", "0.54954445", "0.5493545", "0.54813594", "0.5477435", "0.54740614", "0.5472384", "0.54717636", "0.5468756", "0.5453634", "0.54428", "0.5440874", "0.5440813", "0.5428784", "0.5424359", "0.5422786", "0.5420323", "0.54190946", "0.5418843", "0.53933555", "0.53912556", "0.53845555", "0.5381239", "0.5379194", "0.5379108", "0.53665483", "0.536427", "0.5363981", "0.53611284", "0.53565", "0.5352976", "0.534904", "0.5345953", "0.5339089", "0.53320295", "0.53240436", "0.5322453", "0.53216165", "0.53212625", "0.53081006", "0.5307498", "0.5306504", "0.53020346", "0.5300315", "0.52982616", "0.52901244", "0.52814275", "0.52812886" ]
0.8101971
0
Instantiates a new column menu actions.
public CrossReferenceMenuActions(MenuManagerController menuManagerController) { final ATabularController<?> tabularController = (ATabularController<?>) menuManagerController.getMenuContainer(); if (null != tabularController) { Action action; for (final CrossReference crossReference : ((ATabularCore<?>) tabularController.getGenCode()).getCrossReferences()) { action = new Action(crossReference.getDescription(), SWT.CHECK) { public void runWithEvent(Event event) { E4AdichatzApplication.openPart(tabularController.getContext(), getCrossRefParamMap(tabularController, crossReference)); } }; menuManagerController.getControl().add(action); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void populateCellMenu(Cell cell, List<String> actions);", "public void createMenu() {\n\t\tmenuBar.add(createGameMenuColumn());\n\t\tmenuBar.add(createTestsMenuColumn());\n\t\tmenuBar.add(createCheatsMenuColumn());\n\n\t\tparentMainView.setJMenuBar(menuBar);\n\t}", "protected void createContextMenu() {\n\t\t// TODO : XML Editor 에서 Query Editor 관련 Action 삭제~~\n\t\tMenuManager contextMenu = new MenuManager(\"#PopUp\"); //$NON-NLS-1$\n\t\tcontextMenu.add(new Separator(\"additions\")); //$NON-NLS-1$\n\t\tcontextMenu.setRemoveAllWhenShown(true);\n\t\tcontextMenu.addMenuListener(new NodeActionMenuListener());\n\t\tMenu menu = contextMenu.createContextMenu(getControl());\n\t\tgetControl().setMenu(menu);\n\t\t// makeActions();\n\t\t// hookSingleClickAction();\n\n\t}", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new MaxissueactionColumns();\n\t}", "@objid (\"491bee9e-12dd-11e2-8549-001ec947c8cc\")\n private static void createMenuEntriesForAction(IModule module, MMenu moduleMenu, MPart view) {\n Map<String, MMenu> slotMap = new HashMap<>();\n \n // ask module for its IModuleAction that should be inserted into the\n // contextual menu and for each of them\n for (IModuleAction action : module.getActions(ActionLocation.contextualpopup)) {\n // Create the MHandler and MHandledItem for this action.\n \n // MCommand\n MCommand command = ModuleCommandsRegistry.getCommand(module, action);\n \n // MHandler\n final MHandler handler = createAndActivateHandler(command, module, action, view);\n \n // MHandledItem\n MHandledMenuItem item = createAndInsertItem(moduleMenu, action, slotMap);\n // Bind to command\n item.setCommand(command);\n \n Expression visWhen = new IsVisibleExpression(handler.getObject(), item);\n MCoreExpression isVisibleWhenExpression = MUiFactory.INSTANCE.createCoreExpression();\n isVisibleWhenExpression.setCoreExpressionId(\"programmatic.value\");\n isVisibleWhenExpression.setCoreExpression(visWhen);\n \n item.setVisibleWhen(isVisibleWhenExpression);\n }\n }", "void cellMenuAction(Cell cell, String action);", "private void createContextMenu() {\r\n\r\n\t\tfinal MenuManager menuMgr = new MenuManager();\r\n\r\n\t\tmenuMgr.setRemoveAllWhenShown(true);\r\n\r\n\t\tmenuMgr.addMenuListener(new IMenuListener() {\r\n\t\t\tpublic void menuAboutToShow(final IMenuManager menuMgr2) {\r\n\t\t\t\tfillContextMenu(menuMgr2);\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tfinal Table table = _photoViewer.getTable();\r\n\r\n//\t\tif (isRecreate) {\r\n//\r\n//\t\t\t/*\r\n//\t\t\t * when a tooltip is reparented, the context menu must be recreated otherwise an\r\n//\t\t\t * exception is thown that the menu shell has the wrong parent\r\n//\t\t\t */\r\n//\r\n//\t\t\tmenuMgr.dispose();\r\n//\t\t}\r\n\r\n\t\tfinal Menu tableContextMenu = menuMgr.createContextMenu(table);\r\n\r\n\t\ttable.setMenu(tableContextMenu);\r\n\r\n\t\t_columnManager.createHeaderContextMenu(table, tableContextMenu);\r\n\t}", "@Override\n protected void initialiseUiColumns() {\n }", "private void placeActions() {\n IActionBars actionBars = getViewSite().getActionBars();\n\n // first in the menu\n IMenuManager menuManager = actionBars.getMenuManager();\n menuManager.add(mCreateFilterAction);\n menuManager.add(mEditFilterAction);\n menuManager.add(mDeleteFilterAction);\n menuManager.add(new Separator());\n menuManager.add(mClearAction);\n menuManager.add(new Separator());\n menuManager.add(mExportAction);\n\n // and then in the toolbar\n IToolBarManager toolBarManager = actionBars.getToolBarManager();\n for (CommonAction a : mLogLevelActions) {\n toolBarManager.add(a);\n }\n toolBarManager.add(new Separator());\n toolBarManager.add(mCreateFilterAction);\n toolBarManager.add(mEditFilterAction);\n toolBarManager.add(mDeleteFilterAction);\n toolBarManager.add(new Separator());\n toolBarManager.add(mClearAction);\n }", "public ContextMenu createContextMenu() {\n\t\tContextMenu ctm = new ContextMenu();\n\n\t\tMenuItem rename = new MenuItem(\"Rename\");\n\t\tMenuItem remove = new MenuItem(\"Remove\");\n\n\t\trename.setOnAction((ActionEvent) -> {\n\t\t\tthis.fireEvent(new VertexEvent(VertexEvent.RENAME, this));\n\t\t});\n\t\tremove.setOnAction((ActionEvent) -> {\n\t\t\tthis.fireEvent(new VertexEvent(VertexEvent.REMOVE, this));\n\n\t\t});\n\t\t// Add MenuItem to ContextMenu\n\t\tctm.getItems().addAll(rename, remove);\n\t\treturn ctm;\n\t}", "private void initializeMenuForListView() {\n\t\tMenuItem sItem = new MenuItem(labels.get(Labels.PROP_INFO_ADD_S_MENU));\n\t\tsItem.setOnAction(event ->\n\t\t\taddSAction()\n\t\t);\n\t\t\n\t\tMenuItem scItem = new MenuItem(labels.get(Labels.PROP_INFO_ADD_SC_MENU));\n\t\tscItem.setOnAction(event ->\n\t\t\t\taddScAction()\n\t\t);\n\t\t\n\t\tContextMenu menu = new ContextMenu(sItem, scItem);\n\t\tfirstListView.setContextMenu(menu);\n\t\tsecondListView.setContextMenu(menu);\n\t}", "private void createContextMenu() {\n\t\tMenuManager menuMgr = new MenuManager();\n\t\tmenuMgr.setRemoveAllWhenShown(true);\n\t\tmenuMgr.addMenuListener(new IMenuListener() {\n\t\t\tpublic void menuAboutToShow(IMenuManager mgr) {\n\t\t\t\tfillContextMenuMethodsTableViewer(mgr);\n\t\t\t}\n\n\t\t});\n\t\t// Create menu for methodsTableViewer\n\t\tMenu menu = menuMgr.createContextMenu(tableViewerLeft.getControl());\n\t\ttableViewerLeft.getControl().setMenu(menu);\n\n\t\t// Register menu for extension.\n\t\tgetSite().registerContextMenu(menuMgr, tableViewerLeft);\n\n\t\t// Create menu manager for methodsTableViewer for callsTableViewer\n\t\tMenuManager menuMgr1 = new MenuManager();\n\t\tmenuMgr1.setRemoveAllWhenShown(true);\n\t\tmenuMgr1.addMenuListener(new IMenuListener() {\n\t\t\tpublic void menuAboutToShow(IMenuManager mgr) {\n\t\t\t\tfillContextMenuCallsTableViewer(mgr);\n\t\t\t}\n\n\t\t});\n\t\t// Create menu for callsTableViewer\n\t\tMenu menu1 = menuMgr1.createContextMenu(tableViewerRight.getControl());\n\t\ttableViewerRight.getControl().setMenu(menu1);\n\n\t\t// Register menu for extension.\n\t\tgetSite().registerContextMenu(menuMgr1, tableViewerRight);\n\t}", "public void setUpEditMenu() {\n add(editMenu);\n\n //editMenu.add(cutItem);\n //editMenu.add(copyItem);\n //editMenu.add(pasteItem);\n //editMenu.addSeparator();\n clearAllItems.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n world.deleteAllEntities();\n }\n });\n editMenu.add(clearAllItems);\n editMenu.addSeparator();\n JMenuItem loadVectors = new JMenuItem(\"Load stimulus vectors...\");\n loadVectors.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n SFileChooser chooser = new SFileChooser(\".\", \"Load vectors\");\n File theFile = chooser.showOpenDialog();\n if (theFile != null) {\n double[][] vecs = Utils.getDoubleMatrix(theFile);\n world.loadStimulusVectors(vecs);\n }\n }\n });\n editMenu.add(loadVectors);\n\n }", "private void createRowForNewColumnButton(Composite section2)\n {\n buttonNewColumn = toolkit.createButton(section, \"New Column...\", SWT.PUSH); //$NON-NLS-1$\n buttonGridData(buttonNewColumn, SWT.TOP);\n buttonNewColumn.addSelectionListener(new SelectionListener()\n {\n public void widgetDefaultSelected(SelectionEvent e)\n {\n }\n\n public void widgetSelected(SelectionEvent e)\n {\n NewColumnPopup dialog = new NewColumnPopup(getShell());\n if (dialog.open() == Dialog.OK)\n {\n // if the first field is not set\n if (valueToRecognizeReq == null)\n {\n valueToRecognizeReq = new Column(dialog.getColumnInput(), dialog.getRegexInput());\n reqIdComponent.setValueText(valueToRecognizeReq.getText());\n }\n else\n {\n tree.add(new Column(dialog.getColumnInput(), dialog.getRegexInput()));\n listFormat.refresh();\n }\n controller.removeDocumentType();\n updateWizard();\n }\n }\n });\n\n }", "@Override\r\n\tpublic void initialize(URL arg0, ResourceBundle arg1) {\n\t\tTableColumn workflowName = new TableColumn(\"Name\");\r\n\t\t\r\n\t\tworkflowName.setCellValueFactory(\r\n new PropertyValueFactory<WorkflowEntry, String>(\"name\"));\r\n\t\t\r\n\t\tTableColumn info = new TableColumn(\"Info\");\r\n\t\t\r\n\t info.setCellValueFactory(\r\n new PropertyValueFactory<WorkflowEntry, String>(\"info\"));\r\n\t \r\n\t // Adding a button to tableView\r\n\t \r\n\t TableColumn actionCol = new TableColumn( \"Action\" );\r\n actionCol.setCellValueFactory( new PropertyValueFactory<>( \"DUMMY\" ) );\r\n \r\n\t\ttableView.getColumns().addAll(workflowName,info,actionCol);\r\n\r\n\t}", "private void createMenus() {\r\n\t\t// File menu\r\n\t\tmenuFile = new JMenu(Constants.C_FILE_MENU_TITLE);\r\n\t\tmenuBar.add(menuFile);\r\n\t\t\r\n\t\tmenuItemExit = new JMenuItem(Constants.C_FILE_ITEM_EXIT_TITLE);\r\n\t\tmenuItemExit.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\r\n\t\t\t\tactionOnClicExit();\t\t// Action triggered when the Exit item is clicked.\r\n\t\t\t}\r\n\t\t});\r\n\t\tmenuFile.add(menuItemExit);\r\n\t\t\r\n\t\t// Help menu\r\n\t\tmenuHelp = new JMenu(Constants.C_HELP_MENU_TITLE);\r\n\t\tmenuBar.add(menuHelp);\r\n\t\t\r\n\t\tmenuItemHelp = new JMenuItem(Constants.C_HELP_ITEM_HELP_TITLE);\r\n\t\tmenuItemHelp.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tactionOnClicHelp();\r\n\t\t\t}\r\n\t\t});\r\n\t\tmenuHelp.add(menuItemHelp);\r\n\t\t\r\n\t\tmenuItemAbout = new JMenuItem(Constants.C_HELP_ITEM_ABOUT_TITLE);\r\n\t\tmenuItemAbout.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tactionOnClicAbout();\r\n\t\t\t}\r\n\t\t});\r\n\t\tmenuHelp.add(menuItemAbout);\r\n\t\t\r\n\t\tmenuItemReferences = new JMenuItem(Constants.C_HELP_ITEM_REFERENCES_TITLE);\r\n\t\tmenuItemReferences.addActionListener(new ActionListener() {\r\n\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\tactionOnClicReferences();\r\n\t\t\t}\r\n\t\t});\r\n\t\tmenuHelp.add(menuItemReferences);\r\n\t}", "public void initializeTable(){\r\n\t \r\n\t // Adding a button to tableView\r\n\t /*\r\n\t TableColumn actionCol = new TableColumn( \"Action\" );\r\n actionCol.setCellValueFactory( new PropertyValueFactory<>( \"DUMMY\" ) );\r\n\r\n Callback<TableColumn<WorkflowEntry, String>, TableCell<WorkflowEntry, String>> cellFactory = //\r\n new Callback<TableColumn<WorkflowEntry, String>, TableCell<WorkflowEntry, String>>()\r\n {\r\n public TableCell<WorkflowEntry, String> call( final TableColumn<WorkflowEntry, String> param )\r\n {\r\n final TableCell<WorkflowEntry, String> cell = new TableCell<WorkflowEntry, String>()\r\n {\r\n\r\n final Button btn = new Button( \"Approve\" );\r\n\r\n @Override\r\n public void updateItem( String item, boolean empty )\r\n {\r\n super.updateItem( item, empty );\r\n if ( empty )\r\n {\r\n setGraphic( null );\r\n setText( null );\r\n }\r\n else\r\n {\r\n btn.setOnAction( ( ActionEvent event ) ->\r\n {\r\n WorkflowEntry person = getTableView().getItems().get( getIndex() );\r\n System.out.println( person.getName() );\r\n } );\r\n setGraphic( btn );\r\n setText( null );\r\n }\r\n }\r\n };\r\n return cell;\r\n }\r\n };\r\n\r\n actionCol.setCellFactory( cellFactory );*/\r\n\t\t\r\n\t\ttableView.setItems(data);\r\n\t}", "protected ViewerPopupMenu createPopupMenu()\n {\n ViewerPopupMenu menu = super.createPopupMenu();\n\n viewAction = new ViewerAction(this, \"View\", \"view\",\n \"View Dofs\",\n \"View the dofs of an Actor in table form.\",\n null, null, \"Ctrl-V\", null, \"false\");\n\n menu.addSeparator();\n menu.add(viewAction);\n\n return menu;\n }", "protected JMenuBar createDropDownMenu()\r\n {\r\n\r\n // Setup menu Items String values that are shared\r\n setSharedMenuItemStrings();\r\n // Make a new Action Trigger, as it is generic and used in many places.\r\n ActionTrigger actionTrigger = new ActionTrigger();\r\n // Add\tall the Horizontal elements\r\n JMenuBar result = new JMenuBar();\r\n\r\n // to the button group - Set the Fraction Decimal Visible as being\r\n // selected below.\r\n com.hgutil.data.Fraction.setShowAsFraction(false);\r\n\r\n // Create two individual check button menu items, and add\r\n ButtonGroup fractionGroup = new ButtonGroup();\r\n HGMenuItem fractionCheck =\r\n new HGMenuItem(\r\n HGMenuListItem.JCHECKBOXMNUITEM,\r\n getString(\"WatchListTableModule.edit_menu.fractions_on_text\"),\r\n fractionCmd,\r\n null,\r\n KeyEvent.VK_F,\r\n InputEvent.CTRL_MASK,\r\n fractionGroup,\r\n false);\r\n HGMenuItem decimalCheck =\r\n new HGMenuItem(\r\n HGMenuListItem.JCHECKBOXMNUITEM,\r\n getString(\"WatchListTableModule.edit_menu.decimals_on_text\"),\r\n decimalCmd,\r\n null,\r\n KeyEvent.VK_D,\r\n InputEvent.CTRL_MASK,\r\n fractionGroup,\r\n true);\r\n JMenu viewColumnNumbers =\r\n HGMenuItem.makeMenu(\r\n getString(\"WatchListTableModule.edit_menu.view_columns_fields_as\"),\r\n 'C',\r\n new Object[] { fractionCheck, decimalCheck },\r\n actionTrigger);\r\n\r\n // Lets build a Menu List of Columns that we can either \r\n // view or not view\r\n // Build Check Boxes, for all Items, except the Symbol Column\r\n HGMenuItem[] columnsChecks = new HGMenuItem[StockData.columns.length];\r\n for (int k = 1; k < StockData.columns.length; k++)\r\n {\r\n columnsChecks[k] =\r\n new HGMenuItem(\r\n HGMenuListItem.JCHECKBOXMNUITEM,\r\n StockData.columns[k].getTitle(),\r\n null,\r\n null,\r\n 0,\r\n 0,\r\n null,\r\n true,\r\n new ColumnKeeper(StockData.columns[k]));\r\n }\r\n\r\n // Add in the Viewing menu\r\n JMenu viewColumns =\r\n HGMenuItem.makeMenu(getString(\"WatchListTableModule.edit_menu.view_columns_text\"), 'V', columnsChecks, null);\r\n\r\n JMenu insertRows =\r\n HGMenuItem.makeMenu(\r\n getString(\"WatchListTableModule.edit_menu.view_insert_row_text\"),\r\n 'I',\r\n new Object[] { insertBeforeCmd, insertAfterCmd },\r\n actionTrigger);\r\n\r\n JMenu editMenu = null;\r\n editMenu =\r\n HGMenuItem.makeMenu(\r\n getString(\"WatchListTableModule.edit_menu.title\"),\r\n 'E',\r\n new Object[] {\r\n viewColumns,\r\n viewColumnNumbers,\r\n null,\r\n insertRows,\r\n deleteRowCmd,\r\n null,\r\n addNewWatchListCmd,\r\n deleteWatchListCmd,\r\n renameListCmd,\r\n null,\r\n printListCmd,\r\n null,\r\n tableProps },\r\n actionTrigger);\r\n\r\n // Add the Edit Menu to the result set the Alignment and return the MenuBar\r\n result.add(editMenu);\r\n result.setAlignmentX(JMenuBar.LEFT_ALIGNMENT);\r\n return result;\r\n }", "@Override\n\t public boolean onCreateActionMode(ActionMode mode, Menu menu) {\n\t // Inflate a menu resource providing context menu items\n\t MenuInflater inflater = mode.getMenuInflater();\n\t inflater.inflate(R.menu.context_tables, menu);\n\t return true;\n\t }", "protected void addMenuActionsPropertyDescriptor(Object object) {\n\t\titemPropertyDescriptors.add\n\t\t\t(createItemPropertyDescriptor\n\t\t\t\t(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),\n\t\t\t\t getResourceLocator(),\n\t\t\t\t getString(\"_UI_Widget_menuActions_feature\"),\n\t\t\t\t getString(\"_UI_PropertyDescriptor_description\", \"_UI_Widget_menuActions_feature\", \"_UI_Widget_type\"),\n\t\t\t\t WavePackage.Literals.WIDGET__MENU_ACTIONS,\n\t\t\t\t true,\n\t\t\t\t false,\n\t\t\t\t true,\n\t\t\t\t null,\n\t\t\t\t null,\n\t\t\t\t null));\n\t}", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new WaybillforauditColumns();\n\t}", "private void initActions() \n {\n // Quits the application\n this.quitAction = new AbstractAction (\"Quit\") \n {\n public static final long serialVersionUID = 2L;\n\n @Override\n public void actionPerformed (ActionEvent arg0) \n { \n System.exit(0);\n }\n };\n\n // Creates a new model\n this.newGameAction = new AbstractAction (\"New Game\") \n {\n public static final long serialVersionUID = 3L;\n\n @Override\n public void actionPerformed(ActionEvent arg0) \n {\n AsteroidsFrame.this.newGame ();\n }\n };\n }", "public JMTMenuBar createMenu() {\r\n \t\tJMTMenuBar menu = new JMTMenuBar(JMTImageLoader.getImageLoader());\r\n \t\t// File menu\r\n \t\tMenuAction action = new MenuAction(\"File\", new AbstractJmodelAction[] { newModel, openModel, saveModel, saveModelAs, closeModel, null, exit });\r\n \t\tmenu.addMenu(action);\r\n \r\n \t\t// Edit menu\r\n \t\taction = new MenuAction(\"Edit\", new AbstractJmodelAction[] {\r\n \t\t// editUndo, editRedo, null\r\n \t\t\t\tactionCut, actionCopy, actionPaste, actionDelete, null, takeScreenShot });\r\n \t\tmenu.addMenu(action);\r\n \r\n \t\t// Define menu\r\n \t\taction = new MenuAction(\"Define\",\r\n \t\t\t\tnew AbstractJmodelAction[] { editUserClasses, editMeasures, editSimParams, editPAParams, null, editDefaults });\r\n \t\tmenu.addMenu(action);\r\n \r\n \t\t// Solve menu\r\n \t\taction = new MenuAction(\"Solve\", new AbstractJmodelAction[] { simulate, pauseSimulation, stopSimulation, null, switchToExactSolver, null,\r\n \t\t\t\tshowResults });\r\n \t\tmenu.addMenu(action);\r\n \r\n \t\t// Help menu\r\n \t\taction = new MenuAction(\"Help\", new AbstractJmodelAction[] { openHelp, null, about });\r\n \t\tmenu.addMenu(action);\r\n \r\n \t\treturn menu;\r\n \t}", "private void createMenus() {\n\t\tJMenuBar menuBar = new JMenuBar();\n\n\t\tfileMenu = new JMenu(flp.getString(\"file\"));\n\t\tmenuBar.add(fileMenu);\n\n\t\tfileMenu.add(new JMenuItem(new ActionNewDocument(flp, this)));\n\t\tfileMenu.add(new JMenuItem(new ActionOpen(flp, this)));\n\t\tfileMenu.add(new JMenuItem(new ActionSave(flp, this)));\n\t\tfileMenu.add(new JMenuItem(new ActionSaveAs(flp, this)));\n\t\tfileMenu.addSeparator();\n\t\tfileMenu.add(new JMenuItem(new ActionExit(flp, this)));\n\t\tfileMenu.add(new JMenuItem(new ActionStatistics(flp, this)));\n\n\t\teditMenu = new JMenu(flp.getString(\"edit\"));\n\n\t\teditMenu.add(new JMenuItem(new ActionCut(flp, this)));\n\t\teditMenu.add(new JMenuItem(new ActionCopy(flp, this)));\n\t\teditMenu.add(new JMenuItem(new ActionPaste(flp, this)));\n\n\t\ttoolsMenu = new JMenu(flp.getString(\"tools\"));\n\n\t\titemInvert = new JMenuItem(new ActionInvertCase(flp, this));\n\t\titemInvert.setEnabled(false);\n\t\ttoolsMenu.add(itemInvert);\n\n\t\titemLower = new JMenuItem(new ActionLowerCase(flp, this));\n\t\titemLower.setEnabled(false);\n\t\ttoolsMenu.add(itemLower);\n\n\t\titemUpper = new JMenuItem(new ActionUpperCase(flp, this));\n\t\titemUpper.setEnabled(false);\n\t\ttoolsMenu.add(itemUpper);\n\n\t\tsortMenu = new JMenu(flp.getString(\"sort\"));\n\t\tsortMenu.add(new JMenuItem(new ActionSortAscending(flp, this)));\n\t\tsortMenu.add(new JMenuItem(new ActionSortDescending(flp, this)));\n\n\t\tmenuBar.add(editMenu);\n\t\tmenuBar.add(createLanguageMenu());\n\t\tmenuBar.add(toolsMenu);\n\t\tmenuBar.add(sortMenu);\n\n\t\tthis.setJMenuBar(menuBar);\n\t}", "private PSContentTypeActionMenuHelper(){}", "private void createContextMenu(Menu contextMenu) {\t\n \t\tMenuActions menuActions;\n \t\ttry {\n \t\t\tmenuActions = ParseUtils.parseMenuData(this, this.contextMenuXmlFileName);\n \t\t\tthis.listContextualActions = menuActions.getList();\n \t\t\t\n \t\t\tIterator<MenuActionDataItem> itContextualActions = this.listContextualActions.iterator();\n \t\t\t\n \t\t\tint i = 0;\n \t\t\twhile(itContextualActions.hasNext()){\n \t\t\t\tfinal MenuActionDataItem action = itContextualActions.next();\n \t\t\t\t\n \t\t\t\tif( this.isEntryPoint == false || (\n \t\t\t\t\t\t(this.isEntryPoint == true & ( !action.getSystemAction().equals(\"home\") && \n \t\t\t\t\t\t!action.getSystemAction().equals(\"back\") ) ) ) ){\n \t\t\t\t\n \t\t\t\tString resource = \"drawable/\" + action.getImageName().split(\"\\\\.\")[0];\n \t\t\t\tint idImage = getResources().getIdentifier(resource, null, getPackageName());\n \t\t\t\t\n \t\t\t\tcontextMenu.add(Menu.NONE, i, Menu.NONE, action.getTitle()).setIcon(idImage);\n \t\t\t\ti++;\n \t\t\t\t}\n \t\t\t}\n \t\t} catch (InvalidFileException e) {\n \t\t\tLog.e(\"createContextMenu\", e.getMessage());\n \t\t}\t\n \t}", "public ChessMenuBar() {\n String[] menuCategories = {\"File\", \"Options\", \"Help\"};\n String[] menuItemLists =\n {\"New game/restart,Exit\", \"Toggle graveyard,Toggle game log\",\n \"About\"};\n for (int i = 0; i < menuCategories.length; i++) {\n JMenu currMenu = new JMenu(menuCategories[i]);\n String[] currMenuItemList = menuItemLists[i].split(\",\");\n for (int j = 0; j < currMenuItemList.length; j++) {\n JMenuItem currItem = new JMenuItem(currMenuItemList[j]);\n currItem.addActionListener(new MenuListener());\n currMenu.add(currItem);\n }\n this.add(currMenu);\n }\n }", "private void createContextMenu(){\r\n\t\tmenu = new JMenuBar();\r\n\t\tint ctrl;\r\n\t\tif(MAC)\r\n\t\t\tctrl = ActionEvent.META_MASK;\r\n\t\telse\r\n\t\t\tctrl = ActionEvent.CTRL_MASK;\r\n\r\n\t\tJMenu fileMenu = new JMenu(\"File\");\r\n\t\tnewMenu = new JMenuItem(\"New\");\r\n\t\tnewMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ctrl));\r\n\t\tnewMenu.addActionListener(this);\r\n\t\topenMenu = new JMenuItem(\"Open\");\r\n\t\topenMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ctrl));\r\n\t\topenMenu.addActionListener(this);\r\n\t\trecentMenu = new JMenu(\"Open Recent\");\r\n\t\tpopulateRecentMenu();\r\n\t\tsaveMenu = new JMenuItem(\"Save\");\r\n\t\tsaveMenu.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ctrl));\r\n\t\tsaveMenu.addActionListener(this);\r\n\t\tsaveAsMenu = new JMenuItem(\"Save As...\");\r\n\t\tsaveAsMenu.addActionListener(this);\r\n\t\tfileMenu.add(newMenu);\r\n\t\tfileMenu.add(openMenu);\r\n\t\tfileMenu.add(recentMenu);\r\n\t\tfileMenu.add(saveMenu);\r\n\t\tfileMenu.add(saveAsMenu);\r\n\r\n\t\tmenu.add(fileMenu);\r\n\r\n\t\tJMenu editMenu = new JMenu(\"Edit\");\r\n\t\tpreferencesMenu = new JMenuItem(\"Preferences\");\r\n\t\tpreferencesMenu.addActionListener(this);\r\n\t\teditMenu.add(preferencesMenu);\r\n\r\n\t\tmenu.add(editMenu);\r\n\r\n\t\tif(!MAC){\r\n\t\t\tJMenu helpMenu = new JMenu(\"Help\");\r\n\t\t\tJMenuItem aboutMenuI = new JMenuItem(\"About\");\r\n\r\n\t\t\taboutMenuI.addActionListener(new ActionListener(){\r\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\r\n\t\t\t\t\tshowAboutMenu();\r\n\t\t\t\t}\t\t\r\n\t\t\t});\r\n\t\t\thelpMenu.add(aboutMenuI);\r\n\t\t\tmenu.add(helpMenu);\r\n\t\t}\r\n\t}", "private void initializeMenu() {\n menu = new Menu(parent.getShell());\n MenuItem item1 = new MenuItem(menu, SWT.NONE);\n item1.setText(Resources.getMessage(\"LatticeView.9\")); //$NON-NLS-1$\n item1.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(final SelectionEvent arg0) {\n model.getClipboard().addToClipboard(selectedNode);\n controller.update(new ModelEvent(ViewSolutionSpace.this, ModelPart.CLIPBOARD, selectedNode));\n model.setSelectedNode(selectedNode);\n controller.update(new ModelEvent(ViewSolutionSpace.this, ModelPart.SELECTED_NODE, selectedNode));\n actionRedraw();\n }\n });\n \n MenuItem item2 = new MenuItem(menu, SWT.NONE);\n item2.setText(Resources.getMessage(\"LatticeView.10\")); //$NON-NLS-1$\n item2.addSelectionListener(new SelectionAdapter() {\n @Override\n public void widgetSelected(final SelectionEvent arg0) {\n controller.actionApplySelectedTransformation();\n model.setSelectedNode(selectedNode);\n controller.update(new ModelEvent(ViewSolutionSpace.this, ModelPart.SELECTED_NODE, selectedNode));\n actionRedraw();\n }\n });\n }", "private void initContextMenu() throws Exception {\n\t\t\n\t\tMenuManager menuManager = new MenuManager();\n\t\tMenu menu = menuManager.createContextMenu(wrapedViewer.getTree());\n\t\twrapedViewer.getTree().setMenu(menu);\n\t\t\n\t\t//--RDF and RDFS columns\n\t\tResultViewerColumnInfo labelColumnInfo = new ResultViewerColumnInfo(\"rdfs:label\", RDFS.LABEL);\n\t\tSetColumnVisibleAction showLabelAction = new SetColumnVisibleAction(labelColumnInfo, this);\n\t\tcontextMenuActions.put(labelColumnInfo.getColumnType(), showLabelAction);\n\t\tmenuManager.add(showLabelAction);\n\t\t//ResultViewerColumnInfo typeColumnInfo = new ResultViewerColumnInfo(\"rdf:type\", RDF.TYPE);\n\t\t//SetColumnVisibleAction showTypeAction = new SetColumnVisibleAction(typeColumnInfo, this);\n\t\t//contextMenuActions.put(typeColumnInfo.getColumnType(), showTypeAction);\n\t\t//menuManager.add(showTypeAction);\n\t\t\n\t\t//--Peer column\n\t\tResultViewerColumnInfo peerColumnInfo = new ResultViewerColumnInfo(\"oyster:peer\", Constants.POMVURI+Constants.ontologyOMVLocation);\n\t\tSetColumnVisibleAction showPeerAction = new SetColumnVisibleAction(peerColumnInfo, this);\n\t\tcontextMenuActions.put(peerColumnInfo.getColumnType(), showPeerAction);\n\t\tmenuManager.add(showPeerAction);\n\t\tmenuManager.add(new Separator());\n\t\t\n\t\t\n\t\tOntology resourceTypeOntology = mOyster2.getTypeOntology();\n\t\tOWLClass ontologyClass = KAON2Manager.factory().owlClass(Constants.OMV+Constants.DefaultTypeOntologyRoot);\n\t\ttry{\n\t\t\t/*KAON2 BUG, DOES NOT SUPPORT OWL DL\n\t * SHOULD BE DELETED WHEN IT DOES\n\t */\n\t\t\t\n\t\t\tResultViewerColumnInfo nameColumnInfo = new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Constants.name), Constants.OMVURI+Constants.name);\n\t\t\tSetColumnVisibleAction showNameAction = new SetColumnVisibleAction(nameColumnInfo, this);\n\t\t\tcontextMenuActions.put(nameColumnInfo.getColumnType(), showNameAction);\n\t\t\tmenuManager.add(showNameAction);\n\t\t\tResultViewerColumnInfo acronymColumnInfo = new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Constants.acronym), Constants.OMVURI+Constants.acronym);\n\t\t\tSetColumnVisibleAction showAcronymAction = new SetColumnVisibleAction(acronymColumnInfo, this);\n\t\t\tcontextMenuActions.put(acronymColumnInfo.getColumnType(), showAcronymAction);\n\t\t\tmenuManager.add(showAcronymAction);\n\t\t\tResultViewerColumnInfo descriptionColumnInfo = new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Constants.description), Constants.OMVURI+Constants.description);\n\t\t\tSetColumnVisibleAction showDescriptionAction = new SetColumnVisibleAction(descriptionColumnInfo, this);\n\t\t\tcontextMenuActions.put(descriptionColumnInfo.getColumnType(), showDescriptionAction);\n\t\t\tmenuManager.add(showDescriptionAction);\n\t\t\tResultViewerColumnInfo documentationColumnInfo = new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Constants.documentation), Constants.OMVURI+Constants.documentation);\n\t\t\tSetColumnVisibleAction showDocumentationAction = new SetColumnVisibleAction(documentationColumnInfo, this);\n\t\t\tcontextMenuActions.put(documentationColumnInfo.getColumnType(), showDocumentationAction);\n\t\t\tmenuManager.add(showDocumentationAction);\n\t\t\tResultViewerColumnInfo uriColumnInfo = new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Constants.URI), Constants.OMVURI+Constants.URI);\n\t\t\tSetColumnVisibleAction showURIAction = new SetColumnVisibleAction(uriColumnInfo, this);\n\t\t\tcontextMenuActions.put(uriColumnInfo.getColumnType(), showURIAction);\n\t\t\tmenuManager.add(showURIAction);\n\t\t\t\n\t\t\t/* UNTIL HERE */\n\t\t\t\n\t\t\tSet<DataProperty> dataProperties=ontologyClass.getDataPropertiesFrom(resourceTypeOntology);\n\t\t\tfor (DataProperty dataProperty : dataProperties){\n\t\t\t\tSetColumnVisibleAction action = new SetColumnVisibleAction(new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Namespaces.guessLocalName(dataProperty.getURI())), dataProperty.getURI()), this);\n\t\t\t\tcontextMenuActions.put(dataProperty.getURI(), action);\n\t\t\t\tmenuManager.add(action);\n\t\t\t}\n\t Set<ObjectProperty> objectProperties=ontologyClass.getObjectPropertiesFrom(resourceTypeOntology);\n\t for (ObjectProperty objectProperty : objectProperties){\n\t \tSetColumnVisibleAction action = new SetColumnVisibleAction(new ResultViewerColumnInfo(MainWindow.whichName(Constants.omvCondition+Namespaces.guessLocalName(objectProperty.getURI())), objectProperty.getURI()), this);\n\t\t\t\tcontextMenuActions.put(objectProperty.getURI(), action);\n\t\t\t\tmenuManager.add(action);\n\t }\n\t \n\t\t}\n\t catch (KAON2Exception e) {\n\t \tSystem.err.println(e + \" in contextinit()\");\n\t }\n\t\t\n\t}", "private Menu createPopupMenu() {\n\t\tMenu popUpMenu = new Menu(parent.getShell(), SWT.POP_UP);\n\n\t\t/**\n\t\t * Adds a listener to handle enabling and disabling\n\t\t * some items in the Edit submenu.\n\t\t */\n\t\tpopUpMenu.addMenuListener(new MenuAdapter() {\n\t\t\t@Override\n public void menuShown(MenuEvent e) {\n\t\t\t\tMenu menu = (Menu) e.widget;\n\t\t\t\tMenuItem[] items = menu.getItems();\n\t\t\t\tint rowIndex = table.getSelectionIndex();\n\t\t\t\tint columnIndex = cursor.getColumn();\n\t\t\t\tint tableSize = table.getBufferSize();\n\t\t\t\tHexTablePointer p1 = new HexTablePointer(rowIndex, columnIndex - 1);\n\n\t\t\t\tboolean isOffsetColumn = columnIndex == 0;\n\t\t\t\tboolean isCharacterColumn = columnIndex == HexEditorConstants.TABLE_NUM_COLUMNS - 1;\n\t\t\t\tboolean endOfBuffer = p1.getOffset() >= tableSize;\n\t\t\t\tboolean readonly = hexEditor.isReadOnly();\n\n\t\t\t\tboolean enableInsert = !isOffsetColumn && !isCharacterColumn && !endOfBuffer && !readonly;\n\t\t\t\tboolean enableDelete = !isOffsetColumn && !isCharacterColumn && !endOfBuffer && !readonly;\n\t\t\t\tboolean enableAppend = !readonly;\n\n\t\t\t\titems[0].setEnabled(enableInsert); // insert\n\t\t\t\titems[1].setEnabled(enableAppend); // append\n\t\t\t\t//--- separator ---\n\t\t\t\titems[3].setEnabled(canUndo());\n\t\t\t\titems[4].setEnabled(canRedo());\n\t\t\t\t//--- separator ---\n\t\t\t\titems[8].setEnabled(canPaste()); // paste\n\t\t\t\titems[9].setEnabled(enableDelete); // delete\n\t\t\t\t// --- separator ---\n\t\t\t\titems[11].setEnabled(true); // goto\n\t\t\t\t// --- separator ---\n\t\t\t\titems[13].setEnabled(true); // about\n\t\t\t} // menuShown()\n\t\t});\n\n\n\t\t//\n\t\t// \"Insert\" menu item\n\t\t//\n\t\tMenuItem item = new MenuItem(popUpMenu, SWT.PUSH/*SWT.CASCADE*/);\n\t\titem.setText(Messages.HexEditorControl_37);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\tpopupMenuInsertData(table.getSelectionIndex(), cursor.getColumn());\n\t\t\t}\n\t\t});\n\n\t\t//\n\t\t// \"Append\" menu item\n\t\t//\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH/*SWT.CASCADE*/);\n\t\titem.setText(Messages.HexEditorControl_38);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\tpopupMenuAppendData();\n\t\t\t}\n\t\t});\n\n\t\t//\n\t\t// Separator\n\t\t//\n\t\tnew MenuItem(popUpMenu, SWT.SEPARATOR);\n\n\t\t//\n\t\t// \"Undo\" and \"Redo\" menu item\n\t\t//\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH/*SWT.CASCADE*/);\n\t\titem.setText(Messages.HexEditorControl_39);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\thexEditor.undo();\n\t\t\t}\n\t\t});\n\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH/*SWT.CASCADE*/);\n\t\titem.setText(Messages.HexEditorControl_40);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\thexEditor.redo();\n\t\t\t}\n\t\t});\n\t\t//\n\t\t// Separator\n\t\t//\n\t\tnew MenuItem(popUpMenu, SWT.SEPARATOR);\n\n\t\tListener copyPasteListener = new Listener() {\n\t\t\t@Override\n public void handleEvent(Event event) {\n\t\t\t\thexEditor.getEditorSite().getActionBars().getGlobalActionHandler(\n\t\t\t\t (String) event.widget.getData()).run();\n\t\t\t}\n\t\t};\n\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH);\n\t\titem.setText(Messages.HexEditorControl_41);\n\t\titem.setData(ActionFactory.CUT.getId());\n\t\titem.addListener(SWT.Selection, copyPasteListener);\n\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH);\n\t\titem.setText(Messages.HexEditorControl_42);\n\t\titem.setData(ActionFactory.COPY.getId());\n\t\titem.addListener(SWT.Selection, copyPasteListener);\n\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH);\n\t\titem.setText(Messages.HexEditorControl_43);\n\t\titem.setData(ActionFactory.PASTE.getId());\n\t\titem.addListener(SWT.Selection, copyPasteListener);\n\n\t\t//\n\t\t// \"Delete\" menu item\n\t\t//\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH/*SWT.CASCADE*/);\n\t\titem.setText(Messages.HexEditorControl_44);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\tpopupMenuDeleteData(table.getSelectionIndex(), cursor.getColumn());\n\t\t\t}\n\t\t});\n\n\t\t//\n\t\t// Separator\n\t\t//\n\t\tnew MenuItem(popUpMenu, SWT.SEPARATOR);\n\n\t\t//\n\t\t// \"Goto...\" menu item\n\t\t//\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH/*SWT.CASCADE*/);\n\t\titem.setText(Messages.HexEditorControl_45);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\tpopupMenuGoto();\n\t\t\t}\n\t\t});\n\n\t\t//\n\t\t// Separator\n\t\t//\n\t\tnew MenuItem(popUpMenu, SWT.SEPARATOR);\n\n\t\t//\n\t\t// \"About\" menu item\n\t\t//\n\t\titem = new MenuItem(popUpMenu, SWT.PUSH/*SWT.NULL*/);\n\t\titem.setText(Messages.HexEditorControl_46);\n\t\titem.addSelectionListener(new SelectionAdapter() {\n\t\t\t@Override\n public void widgetSelected(SelectionEvent e) {\n\t\t\t\tpopupMenuAbout();\n\t\t\t}\n\t\t});\n\n\t\treturn popUpMenu;\n\t}", "protected abstract PopupMenuHelper createActionMenuHelper();", "private void initMenu() {\n \n JMenuBar menuBar = new JMenuBar();\n \n JMenu commands = new JMenu(\"Commands\");\n \n JMenuItem add = new JMenuItem(\"Add\");\n add.addActionListener((ActionEvent e) -> {\n changeState(\"Add\");\n });\n commands.add(add);\n \n JMenuItem search = new JMenuItem(\"Search\");\n search.addActionListener((ActionEvent e) -> {\n changeState(\"Search\");\n });\n commands.add(search);\n \n JMenuItem quit = new JMenuItem(\"Quit\");\n quit.addActionListener((ActionEvent e) -> {\n System.out.println(\"QUITING\");\n System.exit(0);\n });\n commands.add(quit);\n \n menuBar.add(commands);\n \n setJMenuBar(menuBar);\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n\n getActivity().getMenuInflater().inflate(R.menu.actions , menu);\n\n }", "private void buildGrid()\n {\n actions.setText(\"Select\");\n\n actions.setMenu(new MenuBuilder()\n .build(visit, icons.contact16())\n .build(delete, icons.delete16())\n .build(message, icons.mail16())\n .get());\n\n contactsColumnModel = new ColumnModel<ContactInfo>(new ColumnsBuilder<ContactInfo>()\n .build(\"\", props.name(), 50, true, new IconCell(icons.contact16()))\n .build(\"Name\", props.name(), 150, false)\n .build(\"Lastname1\", props.lastname1(), 150, false)\n .build(\"Lastname2\", props.lastname2(), 150, true)\n .build(\"Actions\", props.name(), 50, false, actions)\n .get());\n }", "public JMenuItem createMenuItem(Action a) {\n JMenuItem item = new JMenuItem(a);\n decorateMenuComponent(item);\n return item;\n }", "public ActionMenuItem() {\n this(\"\");\n }", "private void initializeMenuForPairsListView() {\n\t\tMenuItem deleteItem = new MenuItem(labels.get(Labels.PROP_INFO_REMOVE_MENU));\n\t\tdeleteItem.setOnAction(event ->\n\t\t\t\tremoveSelectedAction()\n\t\t);\n\t\tpairsListView.setContextMenu(new ContextMenu(deleteItem));\n\t}", "void onColumnClick(int column);", "private void createActionsPanel() {\n DefaultActionGroup group = new DefaultActionGroup();\n group.add(new CloseAction());\n ActionManager actionManager = ActionManager.getInstance();\n JComponent actionsToolbar = actionManager\n .createActionToolbar(ActionPlaces.CODE_INSPECTION, group, false)\n .getComponent();\n JPanel actionsPanel = new JPanel(new BorderLayout());\n actionsPanel.add(actionsToolbar, BorderLayout.WEST);\n add(actionsPanel, BorderLayout.WEST);\n }", "public Menu createViewMenu();", "public void addColumn(TableColumn aColumn) {\n\t\tObject id = aColumn.getIdentifier();\n\t\tJCheckBoxMenuItem item = new JCheckBoxMenuItem(\n\t\t\t\t(String) aColumn.getHeaderValue(), true);\n\t\titem.addActionListener(actionListener);\n\t\tidMap.put(item, id);\n\t\titemMap.put(id, item);\n\t\tpopup.add(item);\n\t\tsuper.addColumn(aColumn);\n\t}", "private void buildViewMenu(){\n //Create a Run Payroll menu item\n viewItem = new JMenuItem(\"View CS History\");\n viewItem.setMnemonic(KeyEvent.VK_H);\n viewItem.addActionListener(new ViewListener());\n \n //Create a JMenu object for the run menu\n viewMenu = new JMenu(\"View\");\n viewMenu.setMnemonic(KeyEvent.VK_V);\n \n //Add the item to the menu\n viewMenu.add(viewItem);\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n //menu.setHeaderTitle(\"Select The Action\");\n menu.add(0, v.getId(), 0, \"Edit word\");\n menu.add(1, v.getId(), 0, \"Delete word\");\n\n super.onCreateContextMenu(menu, v, menuInfo);\n }", "private static JMenuBar createMenu() {\r\n JMenuBar mb = new JMenuBar();\r\n JMenu menu = new JMenu(\"File\");\r\n JMenuItem item = new JMenuItem(\"Save\");\r\n item.addActionListener((ActionEvent evt) -> {\r\n saveActionPerformed();\r\n });\r\n menu.add(item);\r\n mb.add(menu);\r\n\r\n menu = new JMenu(\"Help\");\r\n item = new JMenuItem(\"Show how-to\");\r\n item.addActionListener((ActionEvent evt) -> {\r\n showHelp();\r\n });\r\n menu.add(item);\r\n\r\n mb.add(menu);\r\n\r\n return mb;\r\n }", "private void initColumns() {\n columnNames = new LinkedList<String>();\n columnNames.add(\"table.ededb.datatable.action\");\n columnNames.add(\"table.ededb.datatable.filename\");\n columnNames.add(\"table.ededb.datatable.mime\");\n columnNames.add(\"table.ededb.datatable.size\");\n columnNames.add(\"table.ededb.datatable.localcopy\");\n }", "protected void initializeFileMenu() {\n\t\tfinal JMenu fileMenu = new JMenu(\"File\");\n\t\tthis.add(fileMenu);\n\t\t// Status\n\t\tfinal JMenuItem sysStatusItem = new JMenuItem();\n\t\tsysStatusItem.setAction(this.commands.findById(CmdStatus.DEFAULT_ID));\n\t\tsysStatusItem.setAccelerator(KeyStroke.getKeyStroke('S',\n\t\t\t\tInputEvent.CTRL_DOWN_MASK));\n\t\tfileMenu.add(sysStatusItem);\n\t\t// Log\n\t\tfinal JMenuItem sysLogItem = new JMenuItem();\n\t\tsysLogItem.setAction(this.commands.findById(CmdLog.DEFAULT_ID));\n\t\tsysLogItem.setAccelerator(KeyStroke.getKeyStroke('L',\n\t\t\t\tInputEvent.CTRL_DOWN_MASK));\n\t\tfileMenu.add(sysLogItem);\n\t\t// Separator\n\t\tfileMenu.add(new JSeparator());\n\t\t// Exit\n\t\tfinal JMenuItem exitItem = new JMenuItem(\"Exit\");\n\t\texitItem.setAction(this.commands.findById(CmdExit.DEFAULT_ID));\n\t\texitItem.setAccelerator(KeyStroke.getKeyStroke('Q',\n\t\t\t\tInputEvent.CTRL_DOWN_MASK));\n\t\tfileMenu.add(exitItem);\n\t}", "protected JPopupMenu createPopupMenu()\r\n {\r\n\r\n // Setup menu Items String values that are shared\r\n setSharedMenuItemStrings();\r\n // Add\tall the Horizontal elements\r\n JPopupMenu result = null;\r\n\r\n JMenu insertRows =\r\n HGMenuItem.makeMenu(\r\n getString(\"WatchListTableModule.edit_menu.view_insert_row_text\"),\r\n 'I',\r\n new Object[] { insertBeforeCmd, insertAfterCmd },\r\n actionTrigger);\r\n\r\n result =\r\n HGMenuItem.makePopupMenu(\r\n new Object[] {\r\n viewOptionChainCmd,\r\n null,\r\n viewHistoricChartCmd,\r\n null,\r\n insertRows,\r\n deleteRowCmd,\r\n null,\r\n addNewWatchListCmd,\r\n deleteWatchListCmd,\r\n renameListCmd,\r\n null,\r\n printListCmd },\r\n actionTrigger);\r\n\r\n // Set the Alignment and return the MenuBar\r\n result.setAlignmentX(JMenuBar.LEFT_ALIGNMENT);\r\n return result;\r\n }", "private void constructMenus()\n\t{\n\t\tthis.fileMenu = new JMenu(\"File\");\n\t\tthis.editMenu = new JMenu(\"Edit\");\n\t\tthis.caseMenu = new JMenu(\"Case\");\n\t\tthis.imageMenu = new JMenu(\"Image\");\n\t\tthis.fileMenu.add(this.saveImageMenuItem);\n\t\tthis.fileMenu.addSeparator();\n\t\tthis.fileMenu.add(this.quitMenuItem);\n\t\tthis.editMenu.add(this.undoMenuItem);\n\t\tthis.editMenu.add(this.redoMenuItem);\n\t\tthis.caseMenu.add(this.removeImageMenuItem);\n\t\tthis.imageMenu.add(this.antiAliasMenuItem);\n\t\tthis.imageMenu.addSeparator();\n\t\tthis.imageMenu.add(this.brightenMenuItem);\n\t\tthis.imageMenu.add(this.darkenMenuItem);\n\t\tthis.imageMenu.addSeparator();\n\t\tthis.imageMenu.add(this.grayscaleMenuItem);\n\t\tthis.imageMenu.addSeparator();\n\t\tthis.imageMenu.add(this.resizeMenuItem);\n\t\tthis.imageMenu.addSeparator();\n\t\tthis.imageMenu.add(this.cropMenuItem);\n\t\tthis.imageMenu.addSeparator();\n\t\tthis.imageMenu.add(this.rotate90MenuItem);\n\t\tthis.imageMenu.add(this.rotate180MenuItem);\n\t\tthis.imageMenu.add(this.rotate270MenuItem);\n\t}", "public void addMenuItems()\n\t{\n\t\tstartButton = new JButton(\"Start\");\n\t\tstartButton.setLayout(null);\n\t\tstartButton.setBounds(350, 225, 100, 50);\n\t\t\n\t\toptionsButton = new JButton(\"Options\");\n\t\toptionsButton.setLayout(null);\n\t\toptionsButton.setBounds(350, 275, 100, 50);\n\t\t\n\t\texitButton = new JButton(\"Exit\");\n\t\texitButton.setLayout(null);\n\t\texitButton.setBounds(350, 375, 100, 50);\n\t\texitButton.setActionCommand(\"exit\");\n\t\texitButton.addActionListener((ActionListener) this);\n\t\t\n\t\tmainMenuPanel.add(startButton);\n\t\tmainMenuPanel.add(optionsButton);\n\t\tmainMenuPanel.add(startButton);\n\t}", "public void init() {\n\t\tMenu menu = new Menu();\n\t\tmenu.register();\n\n\t\t// Application.getInstance().getGUILog().showMessage(\"Show a popup the proper\n\t\t// way !\");\n\n\t\t// final ActionsConfiguratorsManager manager =\n\t\t// ActionsConfiguratorsManager.getInstance();\n\n\t\t// final MDAction action = new ExampleAction();\n\t\t// Adding action to main menu\n\t\t// manager.addMainMenuConfigurator(new MainMenuConfigurator(action));\n\t\t// Adding action to main toolbar\n\t\t// manager.addMainToolbarConfigurator(new MainToolbarConfigurator(action));\n\n\t\t// pluginDir = getDescriptor().getPluginDirectory().getPath();\n\n\t\t// Creating submenu in the MagicDraw main menu\n\t\t// ActionsConfiguratorsManager manager =\n\t\t// ActionsConfiguratorsManager.getInstance();\n\t\t// manager.addMainMenuConfigurator(new\n\t\t// MainMenuConfigurator(getSubmenuActions()));\n\n\t\t/**\n\t\t * @Todo: load project options (@see myplugin.generator.options.ProjectOptions)\n\t\t * from ProjectOptions.xml and take ejb generator options\n\t\t */\n\n\t\t// for test purpose only:\n\t\t// GeneratorOptions ejbOptions = new GeneratorOptions(\"c:/temp\", \"ejbclass\",\n\t\t// \"templates\", \"{0}.java\", true, \"ejb\");\n\t\t// ProjectOptions.getProjectOptions().getGeneratorOptions().put(\"EJBGenerator\",\n\t\t// ejbOptions);\n\n\t\t// ejbOptions.setTemplateDir(pluginDir + File.separator +\n\t\t// ejbOptions.getTemplateDir()); //apsolutna putanja\n\t}", "private void constructMenuItems()\n\t{\n\t\tthis.saveImageMenuItem = ComponentGenerator.generateMenuItem(\"Save Image\", this, KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));\n\t\tthis.quitMenuItem = ComponentGenerator.generateMenuItem(\"Quit\", this, KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));\n\t\tthis.undoMenuItem = ComponentGenerator.generateMenuItem(\"Undo\", this, KeyStroke.getKeyStroke(KeyEvent.VK_Z, ActionEvent.CTRL_MASK));\n\t\tthis.redoMenuItem = ComponentGenerator.generateMenuItem(\"Redo\", this, KeyStroke.getKeyStroke(KeyEvent.VK_Y, ActionEvent.CTRL_MASK));\n\t\tthis.removeImageMenuItem = ComponentGenerator.generateMenuItem(\"Remove Image from Case\", this);\n\t\tthis.antiAliasMenuItem = ComponentGenerator.generateMenuItem(\"Apply Anti Aliasing\", this);\n\t\tthis.brightenMenuItem = ComponentGenerator.generateMenuItem(\"Brighten by 10%\", this);\n\t\tthis.darkenMenuItem = ComponentGenerator.generateMenuItem(\"Darken by 10%\", this);\n\t\tthis.grayscaleMenuItem = ComponentGenerator.generateMenuItem(\"Convert to Grayscale\", this);\n\t\tthis.resizeMenuItem = ComponentGenerator.generateMenuItem(\"Resize Image\", this);\n\t\tthis.cropMenuItem = ComponentGenerator.generateMenuItem(\"Crop Image\", this);\n\t\tthis.rotate90MenuItem = ComponentGenerator.generateMenuItem(\"Rotate Image 90\\u00b0 Right\", this);\n\t\tthis.rotate180MenuItem = ComponentGenerator.generateMenuItem(\"Rotate Image 180\\u00b0 Right\", this);\n\t\tthis.rotate270MenuItem = ComponentGenerator.generateMenuItem(\"Rotate Image 270\\u00b0 Right\", this);\n\t}", "Column createColumn();", "protected void init_actions()\r\n {\r\n action_obj = new CUP$LuaGrammarCup$actions(this);\r\n }", "@Override\n public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {\n super.onCreateContextMenu(menu, v, menuInfo);\n menu.setHeaderTitle(\"Select the Action\");\n getMenuInflater().inflate(R.menu.my_context_menu, menu); // add costume menu\n }", "protected void addMenuItems(JPopupMenu menu, ActionListener listener) {\r\n JMenuItem menuItem;\r\n menuItem = new JMenuItem(\"Store cluster\", GUIFactory.getIcon(\"new16.gif\"));\r\n menuItem.setActionCommand(STORE_CLUSTER_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menu.addSeparator();\r\n \r\n menuItem = new JMenuItem(\"Launch new session\", GUIFactory.getIcon(\"launch_new_mav.gif\"));\r\n menuItem.setActionCommand(LAUNCH_NEW_SESSION_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem); \r\n \r\n menu.addSeparator();\r\n \r\n menuItem = new JMenuItem(\"Delete public cluster\", GUIFactory.getIcon(\"delete16.gif\"));\r\n menuItem.setActionCommand(SET_DEF_COLOR_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menu.addSeparator();\r\n \r\n menuItem = new JMenuItem(\"Save cluster...\", GUIFactory.getIcon(\"save16.gif\"));\r\n menuItem.setActionCommand(SAVE_CLUSTER_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menuItem = new JMenuItem(\"Save all clusters...\", GUIFactory.getIcon(\"save16.gif\"));\r\n menuItem.setActionCommand(SAVE_ALL_CLUSTERS_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menu.addSeparator();\r\n \r\n setOverallMaxMenuItem = new JMenuItem(\"Set Y to overall max...\", GUIFactory.getIcon(\"Y_range_expand.gif\"));\r\n setOverallMaxMenuItem.setActionCommand(SET_Y_TO_EXPERIMENT_MAX_CMD);\r\n setOverallMaxMenuItem.addActionListener(listener);\r\n setOverallMaxMenuItem.setEnabled(false);\r\n menu.add(setOverallMaxMenuItem);\r\n \r\n setClusterMaxMenuItem = new JMenuItem(\"Set Y to cluster max...\", GUIFactory.getIcon(\"Y_range_expand.gif\"));\r\n setClusterMaxMenuItem.setActionCommand(SET_Y_TO_CLUSTER_MAX_CMD);\r\n setClusterMaxMenuItem.addActionListener(listener);\r\n menu.add(setClusterMaxMenuItem);\r\n\r\n menuItem = new JMenuItem(\"Toggle reference line...\");\r\n menuItem.setActionCommand(TOGGLE_REF_LINE_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menu.addSeparator();\r\n \r\n menuItem = new JMenuItem(\"Broadcast Matrix to Gaggle\", GUIFactory.getIcon(\"gaggle_icon_16.gif\"));\r\n menuItem.setActionCommand(BROADCAST_MATRIX_GAGGLE_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menuItem = new JMenuItem(\"Broadcast Gene List to Gaggle\", GUIFactory.getIcon(\"gaggle_icon_16.gif\"));\r\n menuItem.setActionCommand(BROADCAST_NAMELIST_GAGGLE_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n menuItem = new JMenuItem(\"Broadcast Matrix to Genome Browser\", GUIFactory.getIcon(\"gaggle_icon_16.gif\"));\r\n menuItem.setActionCommand(BROADCAST_MATRIX_GENOME_BROWSER_CMD);\r\n menuItem.addActionListener(listener);\r\n menu.add(menuItem);\r\n \r\n }", "public SwitchColTable() {\r\r\r\r\n }", "protected void init_actions()\n {\n action_obj = new CUP$Asintactico$actions(this);\n }", "private MenuManager createEditMenu() {\n\t\tMenuManager menu = new MenuManager(\"&Edition\", Messages.getString(\"IU.Strings.40\")); //$NON-NLS-1$ //$NON-NLS-2$\n\t\tmenu.add(new GroupMarker(Messages.getString(\"IU.Strings.41\"))); //$NON-NLS-1$\n\n\t\tmenu.add(getAction(ActionFactory.UNDO.getId()));\n\t\tmenu.add(getAction(ActionFactory.REDO.getId()));;\n\n\t\tmenu.add(new GroupMarker(IWorkbenchActionConstants.UNDO_EXT));\n\t\tmenu.add(new Separator());\n\t\tmenu.add(getAction(ActionFactory.CUT.getId()));\n\t\tmenu.add(getAction(ActionFactory.COPY.getId()));\n\t\tmenu.add(getAction(ActionFactory.PASTE.getId()));\n\t\tmenu.add(new GroupMarker(IWorkbenchActionConstants.CUT_EXT));\n\t\tmenu.add(new Separator());\n\t\tmenu.add(getAction(ActionFactory.DELETE.getId()));\n\t\tmenu.add(getAction(ActionFactory.SELECT_ALL.getId()));\n\t\tmenu.add(getAction(ActionFactory.FIND.getId()));\n\t\tmenu.add(new Separator());\n\t\tmenu.add(getAction(ActionFactory.PREFERENCES.getId()));\n\t\treturn menu;\n\t}", "public void buildContextMenu(IMenuManager menu) {\n\t\t// Add standard action groups to the menu\n\t\tGEFActionConstants.addStandardActionGroups(menu);\n\n\t\t// Add actions to the menu\n\t\tmenu.appendToGroup(GEFActionConstants.GROUP_UNDO, // target group id\n\t\t\t\tgetAction(ActionFactory.UNDO.getId())); // action to add\n\t\tmenu.appendToGroup(GEFActionConstants.GROUP_UNDO,\n\t\t\t\tgetAction(ActionFactory.REDO.getId()));\n\t\tmenu.appendToGroup(GEFActionConstants.GROUP_EDIT,\n\t\t\t\tgetAction(ActionFactory.DELETE.getId()));\n\t}", "private void fillDetailContextMenu(IMenuManager menu) {\n menu.add(getAction(DETAIL_COPY_ACTION));\n menu.add(getAction(DETAIL_SELECT_ALL_ACTION));\n menu.add(new Separator());\n menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));\n }", "public abstract void newColumn();", "private void createMenusNow()\n {\n JMenu debugMenu = myToolbox.getUIRegistry().getMenuBarRegistry().getMenu(MenuBarRegistry.MAIN_MENU_BAR,\n MenuBarRegistry.DEBUG_MENU);\n debugMenu.add(SwingUtilities.newMenuItem(\"DataTypeInfo - Print Summary\", e -> printSummary()));\n debugMenu.add(SwingUtilities.newMenuItem(\"DataTypeInfo - Tag Data Type\", e -> tagDataType()));\n }", "private void buildFileMenu(){\n //Create a Save menu item\n saveItem = new JMenuItem(\"Save\");\n saveItem.setMnemonic(KeyEvent.VK_S);\n saveItem.addActionListener(new SaveListener());\n \n //Create a Load menu item\n loadItem = new JMenuItem(\"Load\");\n loadItem.setMnemonic(KeyEvent.VK_L);\n loadItem.addActionListener(new LoadListener());\n\n //Create an Exit menu item\n exitItem = new JMenuItem(\"Exit\");\n exitItem.setMnemonic(KeyEvent.VK_X);\n exitItem.addActionListener(new ExitListener());\n \n //Create a JMenu object for the file menu\n fileMenu = new JMenu(\"File\");\n fileMenu.setMnemonic(KeyEvent.VK_F);\n \n //Add the items to the menu\n fileMenu.add(saveItem);\n fileMenu.add(loadItem);\n fileMenu.add(exitItem);\n }", "private void makeMenu() {\r\n int i = 0;\r\n int j = 0;\r\n final JMenuBar bar = new JMenuBar();\r\n final Action[] menuActions = {new NewItemAction(MENU_ITEM_STRINGS[i++]),\r\n new ExitAction(MENU_ITEM_STRINGS[i++], myFrame),\r\n new AboutAction(MENU_ITEM_STRINGS[i++], myFrame)};\r\n i = 0;\r\n\r\n final JMenu fileMenu = new JMenu(MENU_STRINGS[j++]);\r\n fileMenu.setMnemonic(KeyEvent.VK_F);\r\n fileMenu.add(menuActions[i++]);\r\n fileMenu.addSeparator();\r\n fileMenu.add(menuActions[i++]);\r\n\r\n final JMenu optionsMenu = new JMenu(MENU_STRINGS[j++]);\r\n optionsMenu.setMnemonic(KeyEvent.VK_O);\r\n\r\n final JMenu helpMenu = new JMenu(MENU_STRINGS[j++]);\r\n helpMenu.setMnemonic(KeyEvent.VK_H);\r\n helpMenu.add(menuActions[i++]);\r\n\r\n bar.add(fileMenu);\r\n bar.add(optionsMenu);\r\n bar.add(helpMenu);\r\n\r\n myFrame.setJMenuBar(bar);\r\n }", "protected void createColumns(TableViewer viewer) throws CaoException {\n\n\t\tIConfig[] headers = list.getApplication().getConfig().getConfig(CapCore.LIST_LIST_HEADERS).getConfigBundle(\"header\");\n\t\t\n\t\tfor ( IConfig data : headers) {\n\t\t\t\n\t\t\tMyColumnData columnData = new MyColumnData();\n\t\t\t\n\t\t\tcolumnData.config = data;\n\t\t\tcolumnData.imageProvider = CapCore.getInstance().getImageProvider(data.getString(\"imageprovider\",null));\n\t\t\tTableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);\n\t\t\tcolumn.getColumn().setText(data.getString(\"title\",\"?\"));\n\t\t\tcolumn.getColumn().setWidth((int)data.getLong(\"width\",400));\n\t\t\tcolumn.getColumn().setResizable(true);\n\t\t\tcolumn.getColumn().setMoveable(true);\t\t\n\t\t\tcolumn.getColumn().setData(columnData);\n\t\t}\n\t\t\n\t\tTable table = viewer.getTable();\n\t\ttable.setHeaderVisible(true);\n\t\ttable.setLinesVisible(true);\n\t}", "public GenericMotifBrowserPanelContextMenu(final GenericMotifBrowserPanel panel, boolean allowCreateCollection) {\n this.gui=panel.getGUI(); \n this.panel=panel;\n this.engine=gui.getEngine();\n \n DisplayMenuItemListener menuItemListener=new DisplayMenuItemListener();\n JMenuItem showItem=new JMenuItem(SHOW);\n JMenuItem showOnlySelectedItem=new JMenuItem(SHOW_ONLY_SELECTED); \n JMenuItem showAllItem=new JMenuItem(SHOW_ALL); \n JMenuItem hideItem=new JMenuItem(HIDE);\n JMenuItem hideAllItem=new JMenuItem(HIDE_ALL);\n JMenuItem selectShownMotifsItem=new JMenuItem(SELECT_SHOWN_MOTIFS);\n JMenuItem selectOnlyShownMotifsItem=new JMenuItem(SELECT_ONLY_SHOWN_MOTIFS);\n JMenuItem createCollectionItem=new JMenuItem(CREATE_MOTIF_COLLECTION); \n\n dbmenu=new ExternalDBLinkMenu(null, gui);\n selectMotifsFromMenu=new JMenu(SELECT_MOTIFS_FROM);\n selectOnlyMotifsFromMenu=new JMenu(SELECT_ONLY_MOTIFS_FROM);\n selectFromCollectionListener=new SelectFromCollectionListener();\n clearAndselectFromCollectionListener=new ClearAndSelectFromCollectionListener();\n \n\n showItem.addActionListener(menuItemListener);\n showOnlySelectedItem.addActionListener(menuItemListener);\n showAllItem.addActionListener(menuItemListener);\n hideItem.addActionListener(menuItemListener);\n hideAllItem.addActionListener(menuItemListener); \n selectShownMotifsItem.addActionListener(menuItemListener);\n selectOnlyShownMotifsItem.addActionListener(menuItemListener);\n if (allowCreateCollection) createCollectionItem.addActionListener(menuItemListener); \n ColorMenuListener colormenulistener=new ColorMenuListener() {\n public void newColorSelected(Color color) {\n if (color==null) return;\n gui.getVisualizationSettings().setFeatureColor(selectedMotifNames, color, true);\n panel.repaint();\n }\n };\n ColorMenu colorMenu=new ColorMenu(COLOR_SUBMENU_HEADER,colormenulistener,panel);\n\n displayMotif=new JMenuItem(DISPLAY_MOTIF); \n displayMotif.addActionListener(menuItemListener);\n this.add(displayMotif); \n limitedToOne.add(displayMotif);\n \n this.add(showItem);\n this.add(showOnlySelectedItem); \n this.add(showAllItem); \n this.add(hideItem); \n this.add(hideAllItem); \n this.add(colorMenu);\n this.add(new JSeparator()); \n this.add(selectShownMotifsItem);\n this.add(selectOnlyShownMotifsItem);\n this.add(selectMotifsFromMenu);\n this.add(selectOnlyMotifsFromMenu);\n this.add(new JSeparator()); \n if (allowCreateCollection) {\n this.add(createCollectionItem);\n }\n compareMotifToOthers=new JMenuItem(\"Compare\"); \n compareMotifToOthers.addActionListener(menuItemListener);\n this.add(compareMotifToOthers); \n limitedToOne.add(compareMotifToOthers); \n \n saveMotifLogo=new JMenuItem(SAVE_MOTIF_LOGO);\n saveMotifLogo.addActionListener(menuItemListener); \n this.add(saveMotifLogo); \n limitedToOne.add(saveMotifLogo);\n \n this.add(dbmenu);\n limitedToOne.add(dbmenu);\n }", "private void initializeKeyBoardActions() {\n\t\tpairsListView.setOnKeyPressed(event -> {\n\t\t\tif (KeyCode.DELETE == event.getCode()) {\n\t\t\t\tremoveSelectedAction();\n\t\t\t}\n\t\t});\n\t\tfirstListView.setOnKeyPressed(this::handleListViewKeys);\n\t\tsecondListView.setOnKeyPressed(this::handleListViewKeys);\n\t}", "private void createMenus() {\r\n\t\tJMenuBar menuBar = new JMenuBar();\r\n\t\t\r\n\t\tJMenu fileMenu = new LJMenu(\"file\", flp);\r\n\t\tmenuBar.add(fileMenu);\r\n\t\t\r\n\t\tfileMenu.add(new JMenuItem(createBlankDocument));\r\n\t\tfileMenu.add(new JMenuItem(openDocumentAction));\r\n\t\tfileMenu.add(new JMenuItem(saveDocumentAction));\r\n\t\tfileMenu.add(new JMenuItem(saveDocumentAsAction));\r\n\t\tfileMenu.add(new JMenuItem(closeCurrentTabAction));\r\n\t\tfileMenu.addSeparator();\r\n\t\tfileMenu.add(new JMenuItem(getStatsAction));\r\n\t\tfileMenu.addSeparator();\r\n\t\tfileMenu.add(new JMenuItem(exitAction));\r\n\t\t\r\n\t\tJMenu editMenu = new LJMenu(\"edit\", flp);\r\n\t\tmenuBar.add(editMenu);\r\n\t\t\r\n\t\teditMenu.add(new JMenuItem(copyAction));\r\n\t\teditMenu.add(new JMenuItem(pasteAction));\r\n\t\teditMenu.add(new JMenuItem(cutAction));\r\n\t\t\r\n\t\tJMenu langMenu = new LJMenu(\"lang\", flp);\r\n\t\tJMenuItem hr = new LJMenuItem(\"cro\", flp);\r\n\t\thr.addActionListener((l) -> { \r\n\t\t\tLocalizationProvider.getInstance().setLanguage(\"hr\");\r\n\t\t\tcurrentLang = \"hr\";\r\n\t\t});\r\n\t\t\r\n\t\tlangMenu.add(hr);\r\n\t\tJMenuItem en = new LJMenuItem(\"eng\", flp);\r\n\t\ten.addActionListener((l) -> { \r\n\t\t\t LocalizationProvider.getInstance().setLanguage(\"en\");\r\n\t\t\t currentLang = \"en\";\r\n\t\t});\r\n\t\tlangMenu.add(en);\r\n\t\tJMenuItem de = new LJMenuItem(\"de\", flp);\r\n\t\tde.addActionListener((l) -> { \r\n\t\t\t LocalizationProvider.getInstance().setLanguage(\"de\");\r\n\t\t\t currentLang = \"de\";\r\n\t\t});\r\n\t\tlangMenu.add(de);\r\n\t\tmenuBar.add(langMenu);\r\n\t\t\r\n\t\tJMenu toolsMenu = new LJMenu(\"tools\", flp);\r\n\t\tJMenuItem toUp = new JMenuItem(toUpperCaseAction);\r\n\t\ttoolsMenu.add(toUp);\r\n\t\ttoggable.add(toUp);\r\n\t\ttoUp.setEnabled(false);\r\n\t\tJMenuItem toLow = new JMenuItem(toLowerCaseAction);\r\n\t\ttoolsMenu.add(toLow);\r\n\t\ttoggable.add(toLow);\r\n\t\ttoLow.setEnabled(false);\r\n\t\tJMenuItem inv = new JMenuItem(invertSelected);\r\n\t\ttoolsMenu.add(inv);\r\n\t\ttoggable.add(inv);\r\n\t\tinv.setEnabled(false);\r\n\t\tmenuBar.add(toolsMenu);\r\n\t\t\r\n\t\tJMenu sort = new LJMenu(\"sort\", flp);\r\n\t\tJMenuItem sortAsc = new JMenuItem(sortAscAction);\r\n\t\tsort.add(sortAsc);\r\n\t\ttoggable.add(sortAsc);\r\n\t\tJMenuItem sortDesc = new JMenuItem(sortDescAction);\r\n\t\tsort.add(sortDesc);\r\n\t\ttoggable.add(sortDesc);\r\n\t\tJMenuItem uniq = new JMenuItem(uniqueLinesAction);\r\n\t\ttoolsMenu.add(uniq);\r\n\t\ttoggable.add(uniq);\r\n\t\t\r\n\t\ttoolsMenu.add(sort);\r\n\t\tsetJMenuBar(menuBar);\r\n\r\n\t}", "private void setupMenus() {\n\t\tJMenuBar menuBar = new JMenuBar();\n\n\t\t// Build the first menu.\n\t\tJMenu menu = new JMenu(Messages.getString(\"Gui.File\")); //$NON-NLS-1$\n\t\tmenu.setMnemonic(KeyEvent.VK_A);\n\t\tmenuBar.add(menu);\n\n\t\t// a group of JMenuItems\n\t\tJMenuItem menuItem = new JMenuItem(openAction);\n\t\tmenu.add(menuItem);\n\n\t\t// menuItem = new JMenuItem(openHttpAction);\n\t\t// menu.add(menuItem);\n\n\t\t/*\n\t\t * menuItem = new JMenuItem(crudAction); menu.add(menuItem);\n\t\t */\n\n\t\tmenuItem = new JMenuItem(showLoggingFrameAction);\n\t\tmenu.add(menuItem);\n\n\t\tmenuItem = new JMenuItem(quitAction);\n\t\tmenu.add(menuItem);\n\n\t\tmenuBar.add(menu);\n\n\t\tJMenu optionMenu = new JMenu(Messages.getString(\"Gui.Options\")); //$NON-NLS-1$\n\t\tmenuItem = new JCheckBoxMenuItem(baselineModeAction);\n\t\toptionMenu.add(menuItem);\n\t\tmenuItem = new JMenuItem(toggleButtonsAction);\n\t\toptionMenu.add(menuItem);\n\n\t\tmenuBar.add(optionMenu);\n\t\tJMenu buttonMenu = new JMenu(Messages.getString(\"Gui.Buttons\")); //$NON-NLS-1$\n\t\tmenuItem = new JMenuItem(wrongAnswerAction);\n\t\tbuttonMenu.add(menuItem);\n\t\tmenuItem = new JMenuItem(attendingAction);\n\t\tbuttonMenu.add(menuItem);\n\n\t\tmenuItem = new JMenuItem(independentAction);\n\t\tbuttonMenu.add(menuItem);\n\t\tmenuItem = new JMenuItem(verbalAction);\n\t\tbuttonMenu.add(menuItem);\n\t\tmenuItem = new JMenuItem(modelingAction);\n\t\tbuttonMenu.add(menuItem);\n\t\tmenuItem = new JMenuItem(noAnswerAction);\n\t\tbuttonMenu.add(menuItem);\n\n\t\tmenuBar.add(buttonMenu);\n\t\tframe.setJMenuBar(menuBar);\n\n\t\tframe.pack();\n\n\t\tframe.setVisible(true);\n\t}", "private void buildMenu() {\n JMenuBar mbar = new JMenuBar();\n setJMenuBar(mbar);\n\n JMenu fileMenu = new JMenu(\"File\");\n fileMenu.addMenuListener(this);\n\n JMenuItem openItem = new JMenuItem(\"Open\");\n openItem.setEnabled(false);\n JMenuItem newItem = new JMenuItem(\"New\");\n newItem.setEnabled(false);\n saveItem = new JMenuItem(\"Save\");\n saveItem.setEnabled(false);\n saveAsItem = new JMenuItem(\"Save As\");\n saveAsItem.setEnabled(false);\n reloadCalItem = new JMenuItem(RELOAD_CAL);\n exitItem = new JMenuItem(EXIT);\n\n mbar.add(makeMenu(fileMenu, new Object[]{newItem, openItem, null,\n reloadCalItem, null,\n saveItem, saveAsItem, null, exitItem}, this));\n\n JMenu viewMenu = new JMenu(\"View\");\n mbar.add(viewMenu);\n JMenuItem columnItem = new JMenuItem(COLUMNS);\n columnItem.addActionListener(this);\n JMenuItem logItem = new JMenuItem(LOG);\n logItem.addActionListener(this);\n JMenu satMenu = new JMenu(\"Satellite Image\");\n JMenuItem irItem = new JMenuItem(INFRA_RED);\n irItem.addActionListener(this);\n JMenuItem wvItem = new JMenuItem(WATER_VAPOUR);\n wvItem.addActionListener(this);\n satMenu.add(irItem);\n satMenu.add(wvItem);\n viewMenu.add(columnItem);\n viewMenu.add(logItem);\n viewMenu.add(satMenu);\n\n observability = new JCheckBoxMenuItem(\"Observability\", true);\n observability.setToolTipText(\"Check that the source is observable.\");\n remaining = new JCheckBoxMenuItem(\"Remaining\", true);\n remaining.setToolTipText(\n \"Check that the MSB has repeats remaining to be observed.\");\n allocation = new JCheckBoxMenuItem(\"Allocation\", true);\n allocation.setToolTipText(\n \"Check that the project still has sufficient time allocated.\");\n\n String ZOA = System.getProperty(\"ZOA\", \"true\");\n boolean tickZOA = true;\n if (\"false\".equalsIgnoreCase(ZOA)) {\n tickZOA = false;\n }\n\n zoneOfAvoidance = new JCheckBoxMenuItem(\"Zone of Avoidance\", tickZOA);\n localQuerytool.setZoneOfAvoidanceConstraint(!tickZOA);\n\n disableAll = new JCheckBoxMenuItem(\"Disable All\", false);\n JMenuItem cutItem = new JMenuItem(\"Cut\",\n new ImageIcon(ClassLoader.getSystemResource(\"cut.gif\")));\n cutItem.setEnabled(false);\n JMenuItem copyItem = new JMenuItem(\"Copy\",\n new ImageIcon(ClassLoader.getSystemResource(\"copy.gif\")));\n copyItem.setEnabled(false);\n JMenuItem pasteItem = new JMenuItem(\"Paste\",\n new ImageIcon(ClassLoader.getSystemResource(\"paste.gif\")));\n pasteItem.setEnabled(false);\n\n mbar.add(makeMenu(\"Edit\",\n new Object[]{\n cutItem,\n copyItem,\n pasteItem,\n null,\n makeMenu(\"Constraints\", new Object[]{observability,\n remaining, allocation, zoneOfAvoidance, null,\n disableAll}, this)}, this));\n\n mbar.add(SampClient.getInstance().buildMenu(this, sorter, table));\n\n JMenu helpMenu = new JMenu(\"Help\");\n helpMenu.setMnemonic('H');\n\n mbar.add(makeMenu(helpMenu, new Object[]{new JMenuItem(INDEX, 'I'),\n new JMenuItem(ABOUT, 'A')}, this));\n\n menuBuilt = true;\n }", "protected void init_actions()\n {\n action_obj = new CUP$ParserForms$actions(this);\n }", "public Menu createToolsMenu();", "private void initializeKeyBoardActions(){\n\r\n\r\n registerKeyboardAction(new java.awt.event.ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n cutMenuItem_actionPerformed(e);}},\r\n \"Cut\",\r\n KeyStroke.getKeyStroke('X', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false),\r\n JComponent.WHEN_FOCUSED);\r\n registerKeyboardAction(new java.awt.event.ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n copyMenuItem_actionPerformed(e);}},\r\n \"Copy\",\r\n KeyStroke.getKeyStroke('C', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false),\r\n JComponent.WHEN_FOCUSED);\r\n registerKeyboardAction(new java.awt.event.ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n pasteMenuItem_actionPerformed(e);}},\r\n \"Paste\",\r\n KeyStroke.getKeyStroke('V', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false),\r\n JComponent.WHEN_FOCUSED);\r\n\r\n\r\n registerKeyboardAction(new java.awt.event.ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n selectAllMenuItem_actionPerformed(e);}},\r\n \"Select All\",\r\n KeyStroke.getKeyStroke('A', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), false),\r\n JComponent.WHEN_FOCUSED);\r\n\r\n registerKeyboardAction(new java.awt.event.ActionListener() {\r\n public void actionPerformed(ActionEvent e) {\r\n deleteMenuItem_actionPerformed(e);}},\r\n \"Delete\",\r\n KeyStroke.getKeyStroke(KeyEvent.VK_DELETE,0),\r\n JComponent.WHEN_FOCUSED);\r\n\r\n\r\n}", "private void createMenuForGCodeModifier(IMenuManager contextMenu, IModifier<?> modifier) {\r\n\t\tcontextMenu.add(new EnableDisableAction(rs274Service, modifier.getId()));\r\n\t\tcontextMenu.add(new ModifierMoveUpAction(rs274Service, modifier.getId()));\r\n\t\tcontextMenu.add(new ModifierMoveDownAction(rs274Service, modifier.getId()));\r\n\t\tcontextMenu.add(new Separator());\r\n\t\tcontextMenu.add(new DeleteModifierAction(rs274Service, modifier.getId()));\r\n\t}", "public void initializeMenuItems() {\n\t\tuserMenuButton = new MenuButton();\n\t\tmenu1 = new MenuItem(bundle.getString(\"mVmenu1\")); //\n\t\tmenu2 = new MenuItem(bundle.getString(\"mVmenu2\")); //\n\t}", "protected void init_actions()\n {\n action_obj = new CUP$include$actions(this);\n }", "private JMenu getMActions() {\n\t\tif (mActions == null) {\n\t\t\tmActions = new JMenu();\n\t\t\tmActions.setText(\"Servisler\");\n mActions.add(getMiBilesikKutukSorgula());\n\t\t\tmActions.add(getMiKimlikNumarasindanKisiBilgisiSorgula());\n\t\t\tmActions.add(getMiKisiListesiSorgula());\n \n\t\t}\n\t\treturn mActions;\n\t}", "private void initMenuBar() {\r\n\t\t// file menu\r\n\t\tJMenu fileMenu = new JMenu(\"File\");\r\n\t\tfileMenu.setMnemonic(KeyEvent.VK_F);\r\n\t\tadd(fileMenu);\r\n\r\n\t\tJMenuItem fileNewMenuItem = new JMenuItem(new NewAction(parent, main));\r\n\t\tfileNewMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileNewMenuItem);\r\n\t\tJMenuItem fileOpenMenuItem = new JMenuItem(new OpenAction(parent, main));\r\n\t\tfileOpenMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileOpenMenuItem);\r\n\r\n\t\tJMenuItem fileSaveMenuItem = new JMenuItem(new SaveAction(main));\r\n\t\tfileSaveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileSaveMenuItem);\r\n\t\tJMenuItem fileSaveAsMenuItem = new JMenuItem(new SaveAsAction(main));\r\n\t\tfileSaveAsMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(fileSaveAsMenuItem);\r\n\r\n\t\tfileMenu.addSeparator();\r\n\t\tfileMenu.add(recentMenu);\r\n\t\tfileMenu.addSeparator();\r\n\r\n\t\tJMenuItem exitMenuItem = new JMenuItem(new ExitAction(main));\r\n\t\texitMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\tfileMenu.add(exitMenuItem);\r\n\r\n\t\t// tools menu\r\n\t\tJMenu toolsMenu = new JMenu(\"Application\");\r\n\t\ttoolsMenu.setMnemonic(KeyEvent.VK_A);\r\n\t\tadd(toolsMenu);\r\n\r\n\t\tJMenuItem defineCategoryMenuItem = new JMenuItem(\r\n\t\t\t\tnew DefineCategoryAction());\r\n\t\tdefineCategoryMenuItem.setAccelerator(KeyStroke.getKeyStroke(\r\n\t\t\t\tKeyEvent.VK_C, Event.CTRL_MASK));\r\n\t\ttoolsMenu.add(defineCategoryMenuItem);\r\n\t\tJMenuItem defineBehaviorNetworkMenuItem = new JMenuItem(\r\n\t\t\t\tnew DefineBehaviorNetworkAction());\r\n\t\tdefineBehaviorNetworkMenuItem.setAccelerator(KeyStroke.getKeyStroke(\r\n\t\t\t\tKeyEvent.VK_B, Event.CTRL_MASK));\r\n\t\ttoolsMenu.add(defineBehaviorNetworkMenuItem);\r\n\t\tJMenuItem startSimulationMenuItem = new JMenuItem(\r\n\t\t\t\tnew StartSimulationAction(main));\r\n\t\tstartSimulationMenuItem.setAccelerator(KeyStroke.getKeyStroke(\r\n\t\t\t\tKeyEvent.VK_E, Event.CTRL_MASK));\r\n\t\ttoolsMenu.add(startSimulationMenuItem);\r\n\r\n\t\t// help menu\r\n\t\tJMenu helpMenu = new JMenu(\"Help\");\r\n\t\thelpMenu.setMnemonic(KeyEvent.VK_H);\r\n\t\tadd(helpMenu);\r\n\r\n\t\tJMenuItem helpMenuItem = new JMenuItem(new HelpAction(parent));\r\n\t\thelpMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H,\r\n\t\t\t\tEvent.CTRL_MASK));\r\n\t\thelpMenu.add(helpMenuItem);\r\n\r\n\t\t// JCheckBoxMenuItem clock = new JCheckBoxMenuItem(new\r\n\t\t// ScheduleSaveAction(parent));\r\n\t\t// helpMenu.add(clock);\r\n\t\thelpMenu.addSeparator();\r\n\t\tJMenuItem showMemItem = new JMenuItem(new ShowMemAction(parent));\r\n\t\thelpMenu.add(showMemItem);\r\n\r\n\t\tJMenuItem aboutMenuItem = new JMenuItem(new AboutAction(parent));\r\n\t\thelpMenu.add(aboutMenuItem);\r\n\t}", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new CustomerselfhawbColumns();\n\t}", "public boolean getMenuColumnsFlag()\t\t{ return menuColumns; }", "@Override\n\tpublic IColumns createColumns() {\n\t\treturn new CorewaybillforchangeewbColumns();\n\t}", "private void createMenu() {\n\t\tJMenuBar mb = new JMenuBar();\n\t\tsetJMenuBar(mb);\n\t\tmb.setVisible(true);\n\t\t\n\t\tJMenu menu = new JMenu(\"File\");\n\t\tmb.add(menu);\n\t\t//mb.getComponent();\n\t\tmenu.add(new JMenuItem(\"Exit\"));\n\t\t\n\t\t\n\t}", "@Override\n public void initialize(URL url, ResourceBundle rb) {\n // Initialise context menu for tables\n contextMenu = new ContextMenu();\n\n MenuItem delete = new MenuItem(\"Delete\");\n MenuItem view = new MenuItem(\"View/edit\");\n MenuItem emailMenu = new MenuItem(\"Send email\");\n\n contextMenu.getItems().addAll(view, delete, emailMenu);\n delete.setOnAction(new handleDelete());\n view.setOnAction(new handleView());\n emailMenu.setOnAction(v -> handleSendEmailSingle());\n\n // Set up car table\n searchResultsTable.setContextMenu(contextMenu);\n // Set search options and select first\n searchSelection.getItems().addAll(FXCollections.observableArrayList(menuItems));\n searchSelection.getSelectionModel().select(0);\n searchSelection.getSelectionModel().selectedIndexProperty().addListener(\n (ov, oldv, newv) -> {\n setSearchItems(newv);\n }\n );\n filterSelection.getItems().addAll(FXCollections.observableArrayList(filterItems));\n filterSelection.getSelectionModel().select(0);\n filterSelection.getSelectionModel().selectedIndexProperty().addListener(\n (ov, oldv, newv) -> {\n setFilterItems(newv);\n }\n );\n\n nameColumn.setCellValueFactory(t -> t.getValue().getNameProperty());\n surnameColumn.setCellValueFactory(t -> t.getValue().getSurnameProperty());\n partnerNameColumn.setCellValueFactory(t -> t.getValue().getPartnerProperty());\n carRegColumn.setCellValueFactory(t -> t.getValue().getCarRegProperty());\n childrenColumn.setCellValueFactory(t -> t.getValue().getChildrenProperty());\n memberNoColumn.setCellValueFactory(cellData -> {\n\n StringProperty value = cellData.getValue().getMemberNoProperty();\n if (cellData.getValue().getRefuse() != null && cellData.getValue().getRefuse().getDate() != null) {\n value.setValue(\"refuse entry\");\n }\n if (value.getValue() == null) {\n value.setValue(\"n/a\");\n }\n return value;\n });\n\n // Comparator to ensure \"Sort by member joined date\" sorts by date, not String\n Comparator comparator = new Comparator<String>() {\n\n public int compare(String a, String b) {\n Date startDate;\n Date endDate;\n try {\n startDate = df.parse(a);\n endDate = df.parse(b);\n return startDate.compareTo(endDate);\n } catch (Exception e) {\n return (a.compareTo(b));\n }\n }\n };\n memberNoColumn.setComparator(comparator);\n\n societyColumn.setCellValueFactory(t -> t.getValue().getSocietyProperty());\n idValidColumn.setCellValueFactory(cellData -> {\n return Utility.checkValidID(cellData.getValue().getImageCollection());\n });\n\n // Make sure everything scales when we resize window\n //mainAnchorPane.prefHeightProperty().bind(scene.heightProperty());\n //mainAnchorPane.prefWidthProperty().bind(scene.widthProperty());\n mainVBox.prefWidthProperty().bind(mainAnchorPane.widthProperty());\n mainVBox.prefHeightProperty().bind(mainAnchorPane.heightProperty());\n\n subAnchorPane.prefWidthProperty().bind(mainAnchorPane.widthProperty());\n subAnchorPane.prefHeightProperty().bind(mainAnchorPane.heightProperty());\n tableAnchorPane.prefWidthProperty().bind(subAnchorPane.widthProperty());\n tableAnchorPane.prefHeightProperty().bind(subAnchorPane.heightProperty());\n\n filteredRowItemList = FXCollections.observableArrayList();\n searchResultsTable.setItems(filteredRowItemList);\n customerCountStatus.setText(Integer.toString(filteredRowItemList.size()));\n\n customersDisplayedHBox.setStyle(\"-fx-background-color: white\");\n queryHBox.setStyle(\"-fx-background-color: white \");\n setupMenu();\n\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "protected void init_actions()\n {\n action_obj = new CUP$parser$actions(this);\n }", "@Test\n public void testAdditonalActionGrouping() {\n JXTable table = new JXTable(10, 4);\n AbstractActionExt custom = new AbstractActionExt(\"Custom\") {\n \n @Override\n public void actionPerformed(ActionEvent e) {\n // TODO Auto-generated method stub\n \n }\n };\n custom.putValue(GroupKeyActionGrouper.GROUP_KEY, 0);\n table.getActionMap().put(ColumnControlButton.COLUMN_CONTROL_MARKER + \"myCommand\", custom);\n ColumnControlButton button = new ColumnControlButton(table);\n button.setActionGrouper(new GroupKeyActionGrouper());\n DefaultColumnControlPopup popup = (DefaultColumnControlPopup) button.getColumnControlPopup();\n assertEquals(\"additional actions visible, component count expected \", \n table.getColumnCount() \n + 1 /* separator */ + 3 /*default actions with column. prefix*/\n + 1 /* separator custom group */ + 1 /* custom action */, \n popup.getPopupMenu().getComponentCount());\n }" ]
[ "0.6624892", "0.6459648", "0.6446051", "0.6413572", "0.6257723", "0.6153111", "0.6145157", "0.60968465", "0.6045609", "0.590718", "0.5901597", "0.58836025", "0.58365226", "0.5818718", "0.5783664", "0.5776446", "0.57729495", "0.57424116", "0.5741513", "0.57365775", "0.5725067", "0.57229793", "0.5697275", "0.5697217", "0.56828654", "0.56690896", "0.56649226", "0.566226", "0.56608677", "0.5645596", "0.56411034", "0.5634023", "0.562485", "0.5610254", "0.560807", "0.559645", "0.5576321", "0.5564881", "0.5554073", "0.55438745", "0.55422986", "0.55154216", "0.55153733", "0.551476", "0.5506952", "0.5493895", "0.5481601", "0.5480018", "0.5473083", "0.54721755", "0.54648745", "0.5455179", "0.54535466", "0.54444766", "0.5443085", "0.5440009", "0.5433812", "0.5432076", "0.54285526", "0.54274786", "0.5427402", "0.5426018", "0.54239476", "0.5423714", "0.54139715", "0.5413871", "0.54120165", "0.5398358", "0.53923404", "0.53849304", "0.5371144", "0.5366093", "0.53555095", "0.53425294", "0.5333672", "0.53334886", "0.5330547", "0.5328006", "0.53250134", "0.5320276", "0.53187966", "0.53152055", "0.53140134", "0.531368", "0.53130305", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5305824", "0.5303025" ]
0.0
-1
Generated managedobject class for type TaslyOrderLineQuantityData first defined at extension omstaslyextorder. .
public interface TaslyOrderLineQuantityData extends OrderLineQuantityData, PropertyAware { /**<i>Generated managed object type code constant.</i>*/ String _TYPECODE = "TaslyOrderLineQuantityData"; /** <i>Generated constant</i> - Attribute key of <code>TaslyOrderLineQuantityData.express_code</code> attribute defined at extension <code>oms-tasly-ext-order</code>. */ AttributeType<TaslyOrderLineQuantityData, String> EXPRESS_CODE = new AttributeType<>("express_code"); /** <i>Generated constant</i> - Attribute key of <code>TaslyOrderLineQuantityData.express_order_id</code> attribute defined at extension <code>oms-tasly-ext-order</code>. */ AttributeType<TaslyOrderLineQuantityData, String> EXPRESS_ORDER_ID = new AttributeType<>("express_order_id"); /** <i>Generated constant</i> - Attribute key of <code>TaslyOrderLineQuantityData.refundstatus</code> attribute defined at extension <code>oms-tasly-ext-order</code>. */ AttributeType<TaslyOrderLineQuantityData, String> REFUNDSTATUS = new AttributeType<>("refundstatus"); /** <i>Generated constant</i> - Index of <code>TaslyOrderLineQuantityData</code> type defined at extension <code>oms-tasly-ext-order</code>. */ UniqueIndexSingle<TaslyOrderLineQuantityData, Long> UX_ORDERLINEQUANTITIES_OLQID = new UniqueIndexSingle<>("UX_orderLineQuantities_olqId", TaslyOrderLineQuantityData.class); /** * <i>Generated method</i> - Getter of the <code>TaslyOrderLineQuantityData.express_order_id</code> attribute defined at extension <code>oms-tasly-ext-order</code>. * <p/> * 快递运单号. * * @return the express_order_id */ @javax.validation.constraints.Size(max=64) java.lang.String getExpress_order_id(); /** * <i>Generated method</i> - Getter of the <code>TaslyOrderLineQuantityData.express_code</code> attribute defined at extension <code>oms-tasly-ext-order</code>. * <p/> * 快递公司代码. * * @return the express_code */ @javax.validation.constraints.Size(max=10) java.lang.String getExpress_code(); /** * <i>Generated method</i> - Getter of the <code>TaslyOrderLineQuantityData.refundstatus</code> attribute defined at extension <code>oms-tasly-ext-order</code>. * <p/> * 退款、退货状态. * * @return the refundstatus */ @javax.validation.constraints.Size(max=128) java.lang.String getRefundstatus(); /** * <i>Generated method</i> - Setter of <code>TaslyOrderLineQuantityData.express_order_id</code> attribute defined at extension <code>oms-tasly-ext-order</code>. * <p/> * 快递运单号. * * @param value the express_order_id */ void setExpress_order_id(final java.lang.String value); /** * <i>Generated method</i> - Setter of <code>TaslyOrderLineQuantityData.express_code</code> attribute defined at extension <code>oms-tasly-ext-order</code>. * <p/> * 快递公司代码. * * @param value the express_code */ void setExpress_code(final java.lang.String value); /** * <i>Generated method</i> - Setter of <code>TaslyOrderLineQuantityData.refundstatus</code> attribute defined at extension <code>oms-tasly-ext-order</code>. * <p/> * 退款、退货状态. * * @param value the refundstatus */ void setRefundstatus(final java.lang.String value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public OrderLine() {\n products = new ArrayList<>();\n price = new BigDecimal(0);\n }", "public OrderLine() {\n }", "public void setOrderLine (MOrderLine oLine, int M_Locator_ID, BigDecimal Qty)\n\t{\n\t\tMOrgPOS orgpos = MOrgPOS.getOrgPos(getCtx(), oLine.getParent().getAD_Org_ID(), get_Trx());\n\t\tif(M_Locator_ID > 0 && (oLine.getParent().getC_DocTypeTarget_ID() == orgpos.getDocType_Ticket_ID()))\n\t\t\tM_Locator_ID = oLine.get_ValueAsInt(\"M_Locator_ID\")>0?oLine.get_ValueAsInt(\"M_Locator_ID\"):orgpos.getM_LocatorStock_ID();\n\t\tsetC_OrderLine_ID(oLine.getC_OrderLine_ID());\n\t\tsetLine(oLine.getLine());\n\t\tsetC_UOM_ID(oLine.getC_UOM_ID());\n\t\tMProduct product = oLine.getProduct();\n\t\tif (product == null)\n\t\t{\n\t\t\tsetM_Product_ID(0);\n\t\t\tsetM_AttributeSetInstance_ID(0);\n\t\t\tsuper.setM_Locator_ID(0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetM_Product_ID(oLine.getM_Product_ID());\n\t\t\tsetM_AttributeSetInstance_ID(oLine.getM_AttributeSetInstance_ID());\n\t\t\t//\n\t\t\tif (product.isItem())\n\t\t\t{\n\t\t\t\tif (M_Locator_ID == 0)\n\t\t\t\t\tsetM_Locator_ID(Qty);\t//\trequires warehouse, product, asi\n\t\t\t\telse\n\t\t\t\t\tsetM_Locator_ID(M_Locator_ID);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsuper.setM_Locator_ID(0);\n\t\t}\n\t\tsetC_Charge_ID(oLine.getC_Charge_ID());\n\t\tsetDescription(oLine.getDescription());\n\t\tsetIsDescription(oLine.isDescription());\n\t\t//\n\t\tsetAD_Org_ID(oLine.getAD_Org_ID());\n\t\tsetC_Project_ID(oLine.getC_Project_ID());\n\t\tsetC_ProjectPhase_ID(oLine.getC_ProjectPhase_ID());\n\t\tsetC_ProjectTask_ID(oLine.getC_ProjectTask_ID());\n\t\tsetC_Activity_ID(oLine.getC_Activity_ID());\n\t\tsetC_Campaign_ID(oLine.getC_Campaign_ID());\n\t\tsetAD_OrgTrx_ID(oLine.getAD_OrgTrx_ID());\n\t\tsetUser1_ID(oLine.getUser1_ID());\n\t\tsetUser2_ID(oLine.getUser2_ID());\n\t}", "public LineItem(Product product, int quantity) {\n this.product = product;\n this.quantity = quantity;\n }", "org.datacontract.schemas._2004._07.cdiscount_service_marketplace_api_external_contract_data_order.ExternalOrderLine addNewExternalOrderLine();", "public LineData_mxJPO() {\n super();\n // TODO Auto-generated constructor stub\n }", "@JsonProperty(\"OrderLine\")\r\n\tpublic void setOrderLine(OrderLine orderLine) {\r\n\t\tthis.orderLine = orderLine;\r\n\t}", "public void generateLineItems(){\n for(int i=0; i<purch.getProdIdx().length; i++){\r\n \r\n prod= new Product(db.getProductDbItem(purch.getProductItem(i)));\r\n \r\n LineItem[] tempL=new LineItem[lineItem.length+1];\r\n System.arraycopy(lineItem,0,tempL,0,lineItem.length);\r\n lineItem=tempL;\r\n lineItem[lineItem.length-1]= new LineItem(prod.getProdId(),purch.getQtyAmtItm(i), \r\n prod.getProdUnitPrice(), prod.getProdDesc(), prod.getProdDiscCode()); \r\n totalPurch += (purch.getQtyAmtItm(i) * prod.getProdUnitPrice());\r\n totalDisc += lineItem[lineItem.length-1].getDiscAmt();\r\n \r\n }\r\n }", "@Test\n\tpublic void saveOrderLine() {\n\t\t// TODO: JUnit - Populate test inputs for operation: saveOrderLine \n\t\tOrderLine orderline_1 = new ecom.domain.OrderLine();\n\t\tservice.saveOrderLine(orderline_1);\n\t}", "public int getQuantity() { \n return myOrderQuantity;\n }", "public void setC_OrderLine_ID (int C_OrderLine_ID);", "Productline_decl getProductline_decl();", "public LineStroker() {\n }", "@SuppressWarnings(\"all\")\npublic interface I_C_Decoris_PreOrderLine \n{\n\n /** TableName=C_Decoris_PreOrderLine */\n public static final String Table_Name = \"C_Decoris_PreOrderLine\";\n\n /** AD_Table_ID=1000199 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name C_Decoris_PreOrder_ID */\n public static final String COLUMNNAME_C_Decoris_PreOrder_ID = \"C_Decoris_PreOrder_ID\";\n\n\t/** Set C_Decoris_PreOrder\t */\n\tpublic void setC_Decoris_PreOrder_ID (int C_Decoris_PreOrder_ID);\n\n\t/** Get C_Decoris_PreOrder\t */\n\tpublic int getC_Decoris_PreOrder_ID();\n\n\tpublic I_C_Decoris_PreOrder getC_Decoris_PreOrder() throws RuntimeException;\n\n /** Column name C_Decoris_PreOrderLine_ID */\n public static final String COLUMNNAME_C_Decoris_PreOrderLine_ID = \"C_Decoris_PreOrderLine_ID\";\n\n\t/** Set C_Decoris_PreOrderLine\t */\n\tpublic void setC_Decoris_PreOrderLine_ID (int C_Decoris_PreOrderLine_ID);\n\n\t/** Get C_Decoris_PreOrderLine\t */\n\tpublic int getC_Decoris_PreOrderLine_ID();\n\n /** Column name C_Decoris_PreOrderLine_UU */\n public static final String COLUMNNAME_C_Decoris_PreOrderLine_UU = \"C_Decoris_PreOrderLine_UU\";\n\n\t/** Set C_Decoris_PreOrderLine_UU\t */\n\tpublic void setC_Decoris_PreOrderLine_UU (String C_Decoris_PreOrderLine_UU);\n\n\t/** Get C_Decoris_PreOrderLine_UU\t */\n\tpublic String getC_Decoris_PreOrderLine_UU();\n\n /** Column name C_Decoris_PreSalesLine_ID */\n public static final String COLUMNNAME_C_Decoris_PreSalesLine_ID = \"C_Decoris_PreSalesLine_ID\";\n\n\t/** Set Decoris Presales Line\t */\n\tpublic void setC_Decoris_PreSalesLine_ID (int C_Decoris_PreSalesLine_ID);\n\n\t/** Get Decoris Presales Line\t */\n\tpublic int getC_Decoris_PreSalesLine_ID();\n\n\tpublic I_C_Decoris_PreSalesLine getC_Decoris_PreSalesLine() throws RuntimeException;\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name LineNetAmt */\n public static final String COLUMNNAME_LineNetAmt = \"LineNetAmt\";\n\n\t/** Set Line Amount.\n\t * Line Extended Amount (Quantity * Actual Price) without Freight and Charges\n\t */\n\tpublic void setLineNetAmt (BigDecimal LineNetAmt);\n\n\t/** Get Line Amount.\n\t * Line Extended Amount (Quantity * Actual Price) without Freight and Charges\n\t */\n\tpublic BigDecimal getLineNetAmt();\n\n /** Column name LineNo */\n public static final String COLUMNNAME_LineNo = \"LineNo\";\n\n\t/** Set Line No.\n\t * Unique line for this document\n\t */\n\tpublic void setLineNo (int LineNo);\n\n\t/** Get Line No.\n\t * Unique line for this document\n\t */\n\tpublic int getLineNo();\n\n /** Column name M_AttributeSetInstance_ID */\n public static final String COLUMNNAME_M_AttributeSetInstance_ID = \"M_AttributeSetInstance_ID\";\n\n\t/** Set Attribute Set Instance.\n\t * Product Attribute Set Instance\n\t */\n\tpublic void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID);\n\n\t/** Get Attribute Set Instance.\n\t * Product Attribute Set Instance\n\t */\n\tpublic int getM_AttributeSetInstance_ID();\n\n\tpublic I_M_AttributeSetInstance getM_AttributeSetInstance() throws RuntimeException;\n\n /** Column name M_Fifapps_Objcodes_ID */\n public static final String COLUMNNAME_M_Fifapps_Objcodes_ID = \"M_Fifapps_Objcodes_ID\";\n\n\t/** Set M_Fifapps_Objcodes\t */\n\tpublic void setM_Fifapps_Objcodes_ID (int M_Fifapps_Objcodes_ID);\n\n\t/** Get M_Fifapps_Objcodes\t */\n\tpublic int getM_Fifapps_Objcodes_ID();\n\n\tpublic I_M_Fifapps_Objcodes getM_Fifapps_Objcodes() throws RuntimeException;\n\n /** Column name M_Fifapps_Supplier_ID */\n public static final String COLUMNNAME_M_Fifapps_Supplier_ID = \"M_Fifapps_Supplier_ID\";\n\n\t/** Set M_Fifapps_Supplier\t */\n\tpublic void setM_Fifapps_Supplier_ID (int M_Fifapps_Supplier_ID);\n\n\t/** Get M_Fifapps_Supplier\t */\n\tpublic int getM_Fifapps_Supplier_ID();\n\n\tpublic I_M_Fifapps_Supplier getM_Fifapps_Supplier() throws RuntimeException;\n\n /** Column name M_Product_ID */\n public static final String COLUMNNAME_M_Product_ID = \"M_Product_ID\";\n\n\t/** Set Product.\n\t * Product, Service, Item\n\t */\n\tpublic void setM_Product_ID (int M_Product_ID);\n\n\t/** Get Product.\n\t * Product, Service, Item\n\t */\n\tpublic int getM_Product_ID();\n\n\tpublic org.compiere.model.I_M_Product getM_Product() throws RuntimeException;\n\n /** Column name PriceEntered */\n public static final String COLUMNNAME_PriceEntered = \"PriceEntered\";\n\n\t/** Set Price.\n\t * Price Entered - the price based on the selected/base UoM\n\t */\n\tpublic void setPriceEntered (BigDecimal PriceEntered);\n\n\t/** Get Price.\n\t * Price Entered - the price based on the selected/base UoM\n\t */\n\tpublic BigDecimal getPriceEntered();\n\n /** Column name QtyEntered */\n public static final String COLUMNNAME_QtyEntered = \"QtyEntered\";\n\n\t/** Set Quantity.\n\t * The Quantity Entered is based on the selected UoM\n\t */\n\tpublic void setQtyEntered (BigDecimal QtyEntered);\n\n\t/** Get Quantity.\n\t * The Quantity Entered is based on the selected UoM\n\t */\n\tpublic BigDecimal getQtyEntered();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "public String getOrderLineNum() {\n return orderLineNum;\n }", "private OrderLine insertOrderLine(Order order,\n SalesOrderLineInformation salesOrderLineInformation, Organization org, Warehouse warehouse,\n long lineNo) throws Exception {\n OrderLine orderLine = null;\n JsonToDataConverter fromJsonToData = new JsonToDataConverter();\n try {\n orderLine = (OrderLine) fromJsonToData.toBaseOBObject(salesOrderLineInformation\n .getOrderLineJSON());\n orderLine.setCreatedBy(order.getCreatedBy());\n orderLine.setCreationDate(new Date());\n orderLine.setUpdatedBy(order.getCreatedBy());\n orderLine.setUpdated(new Date());\n orderLine.setOrganization(org);\n if (warehouse.getIbdoWarehousetype().equals(\"FACST_External\")) {\n orderLine.setOrganization(order.getOrganization());\n }\n orderLine.setSalesOrder(order);\n orderLine.setPartnerAddress(null);\n orderLine.setWarehouse(warehouse);\n orderLine.setNewOBObject(true);\n orderLine.setProduct(salesOrderLineInformation.getProduct());\n orderLine.setCreateReservation(SOConstants.StockReservationAutomatic);\n orderLine.setOrderedQuantity(salesOrderLineInformation.getQuantity());\n orderLine.setWarehouseRule(salesOrderLineInformation.getWarehouseRule());\n orderLine.setLineNo(lineNo);\n orderLine.setIbdoPoid(salesOrderLineInformation.getOrderLineJSON().getString(\"id\"));\n } catch (JSONException e) {\n LOG.error(e.getMessage(), e);\n } catch (Exception e) {\n LOG.error(e.getMessage(), e);\n throw new Exception(e.toString());\n }\n OBDal.getInstance().save(orderLine);\n return orderLine;\n }", "public void setProductLine(entity.APDProductLine value);", "public String getProductLine() {\n return productLine;\n }", "@Test\n\tpublic void saveOrderLineProduct() {\n\t\t// TODO: JUnit - Populate test inputs for operation: saveOrderLineProduct \n\t\tInteger id_1 = 0;\n\t\tProduct related_product = new ecom.domain.Product();\n\t\tOrderLine response = null;\n\t\tresponse = service.saveOrderLineProduct(id_1, related_product);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveOrderLineProduct\n\t}", "@Override\n public List<PurchaseOrderLine> getOrderlines() {\n return orderLines;\n }", "@Test\n\tpublic void saveOrderLineSalesOrder() {\n\t\t// TODO: JUnit - Populate test inputs for operation: saveOrderLineSalesOrder \n\t\tInteger id_2 = 0;\n\t\tSalesOrder related_salesorder = new ecom.domain.SalesOrder();\n\t\tOrderLine response = null;\n\t\tresponse = service.saveOrderLineSalesOrder(id_2, related_salesorder);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: saveOrderLineSalesOrder\n\t}", "public int getC_OrderLine_ID();", "Quantity createQuantity();", "@JsonProperty(\"OrderLine\")\r\n\tpublic OrderLine getOrderLine() {\r\n\t\treturn orderLine;\r\n\t}", "public TExpressOrderRecord() {\n super(TExpressOrder.T_EXPRESS_ORDER);\n }", "private int getQtyLinesFromDB()\n {\n \tint id = getC_Order_ID();\n \tif (id <= 0)\n \t\treturn 0;\n \tint qtyLines = DB.getSQLValue(get_TrxName(),\n \t \"SELECT COUNT(1) FROM C_OrderLine WHERE C_Order_ID = \" + id);\n \treturn qtyLines;\n }", "public OMAbstractLine() {\n super();\n }", "org.datacontract.schemas._2004._07.cdiscount_service_marketplace_api_external_contract_data_order.ExternalOrderLine insertNewExternalOrderLine(int i);", "Quantity getQuantity();", "public CartLines() {\n }", "public Long getQuantity() {\r\n return quantity;\r\n }", "org.datacontract.schemas._2004._07.cdiscount_service_marketplace_api_external_contract_data_order.ExternalOrderLine getExternalOrderLineArray(int i);", "@Override\n public PurchaseOrderLine getOrderLine(int index) {\n return orderLines.get(index);\n }", "public LineData()\n\t{\n\t}", "@Override\n\tpublic int getLineType() {\n\t\treturn 0;\n\t}", "public double getQuantity() {\n return quantity;\n }", "public Long getQuantity() {\n return quantity;\n }", "@Test\n\tpublic void deleteOrderLine() {\n\t\t// TODO: JUnit - Populate test inputs for operation: deleteOrderLine \n\t\tOrderLine orderline = new ecom.domain.OrderLine();\n\t\tservice.deleteOrderLine(orderline);\n\t}", "@Override\n\tpublic int add(Forge_Order_Detail t) {\n\t\treturn 0;\n\t}", "@gw.internal.gosu.parser.ExtendedProperty\n public entity.APDProductLine getProductLine();", "public int getQuantity() {\r\n return quantity;\r\n }", "protected Double getQuantity() {\n return quantity;\n }", "long getQuantity();", "long getQuantity();", "public static void main(String args[]) \r\n\t{\n\t\tSystem.out.println(\"Welcome to the Line Item Calculator\"); \r\n\t\tSystem.out.println(); \r\n\t\tScanner sc = new Scanner(System.in); \r\n\t\t\r\n\t\t\r\n\t\tString select_item;\r\n\t\tString choice = \"y\"; \r\n\t\tInvoice item = new Invoice ();\r\n\t\tdouble invoice_Total = 0;\r\n\t\t\r\n\t\tNumberFormat currency = NumberFormat.getCurrencyInstance();\r\n\t\t\r\n\t\twhile (choice.equalsIgnoreCase(\"y\")){ \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// get the input from the user \r\n\t\t\tString productCode = Validator.getString(sc,\"Enter product code: \"); \r\n\t\t\tint quantity = Validator.getInt(sc,\"Enter quantity: \"); \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//get the Product object \r\n\t\t\tProduct product = ProductDB.getProductInfo(productCode); \r\n\t\t\t\r\n\t\t\t\r\n\t\t\tBonus:\r\n\t\t\tfor(int i=0; i < item.get_list().size(); i++){\r\n\t\t\t\tselect_item = item.get_list().get(i) ;\r\n\t\t\t\t\r\n\t\t\t\t//&& i != item.get_list().size()\r\n\t\t\t\tif(select_item.substring(0,2).contains(productCode) && i != item.get_list().size()){\r\n\t\t\t\t\tquantity += Integer.parseInt(select_item.substring(42,43)); //index of the quantity in the list\r\n\t\t\t\t\t//invoice_Total -= Integer.parseInt(select_item\r\n\t\t\t\t\titem.delete_line_item(i);\r\n\t\t\t\t\tbreak Bonus;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\t// create the LineItem object and set its fields \r\n\t\t\tLineItem lineItem = new LineItem(); \r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tlineItem.setProduct(product); \r\n\t\t\tlineItem.setQuantity(quantity);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//invoice_Total += lineItem.getTotal();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\titem.store_line_item(lineItem.getProduct(), lineItem.getQuantity(), lineItem.getTotal());\r\n\t\t\t\r\n\t\t\r\n\t\t\tSystem.out.println(\"Another line item? (y/n): \"); \r\n\t\t\tchoice = sc.nextLine();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Code Description Price Qty Total \");\r\n\t\tSystem.out.println(\"---- ------------ --------- ----- ------- \");\r\n\t\t\r\n\t\t\r\n\t\tfor (String list:item.get_list()){\r\n\t\t\t\r\n\t\t\r\n\t\t\tinvoice_Total += Double.parseDouble(list.substring(56,61)); //index of the total in the list\r\n\t\t\tSystem.out.println(list);\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\tSystem.out.println(\" Invoice total: \" + currency.format(invoice_Total));\r\n\t\t\r\n\t}", "public Order(long price, long quantity, long seqNo) {\n this.price = price;\n this.quantity = quantity;\n this.seqNo = seqNo;\n }", "public int getQuantity()\r\n {\r\n return _quantity;\r\n }", "public OrderItem_() {\n }", "@Override\n\tpublic FDCartLineI getOrderLineById(int parseInt) {\n\t\treturn null;\n\t}", "public CustMnjOntSoObinSizline_LineEOImpl() {\n }", "int sizeOfExternalOrderLineArray();", "public String getQuantity() {\n return quantity;\n }", "public void setLineCarriageprice(Long lineCarriageprice) {\n this.lineCarriageprice = lineCarriageprice;\n }", "public int getQuantity() {\r\n return quantity;\r\n }", "public Double getProductQty() {\n return productQty;\n }", "@Test\n\tpublic void deleteOrderLineSalesOrder() {\n\t\t// TODO: JUnit - Populate test inputs for operation: deleteOrderLineSalesOrder \n\t\tInteger orderline_id = 0;\n\t\tInteger related_salesorder_id = 0;\n\t\tOrderLine response = null;\n\t\tresponse = service.deleteOrderLineSalesOrder(orderline_id, related_salesorder_id);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: deleteOrderLineSalesOrder\n\t}", "public Receipt(Purchase p) {\r\n this.purch=p;\r\n totalPurch=0;\r\n totalDisc=0;\r\n \r\n db= new FakeDataBase();\r\n c= new Customer(db.getCustomerDbItem(purch.getCustIdx()));\r\n //System.out.println(c.toString());\r\n lineItem = new LineItem[0];\r\n generateLineItems();\r\n }", "public void setInvoiceLine (MInvoiceLine iLine, int M_Locator_ID, BigDecimal Qty)\n\t{\n\t\tsetC_OrderLine_ID(iLine.getC_OrderLine_ID());\n\t\tsetLine(iLine.getLine());\n\t\tsetC_UOM_ID(iLine.getC_UOM_ID());\n\t\tint M_Product_ID = iLine.getM_Product_ID();\n\t\tif (M_Product_ID == 0)\n\t\t{\n\t\t\tset_ValueNoCheck(\"M_Product_ID\", null);\n\t\t\tset_ValueNoCheck(\"M_Locator_ID\", null);\n\t\t\tset_ValueNoCheck(\"M_AttributeSetInstance_ID\", null);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tsetM_Product_ID(M_Product_ID);\n\t\t\tsetM_AttributeSetInstance_ID(iLine.getM_AttributeSetInstance_ID());\t\t\t\n\t\t\tif (M_Locator_ID == 0)\n\t\t\t\tsetM_Locator_ID(Qty);\t//\trequires warehouse, product, asi\n\t\t\telse\n\t\t\t\tsetM_Locator_ID(M_Locator_ID);\n\t\t}\n\t\tsetC_Charge_ID(iLine.getC_Charge_ID());\n\t\tsetDescription(iLine.getDescription());\n\t\tsetIsDescription(iLine.isDescription());\n\t\t//\n\t\tsetC_Project_ID(iLine.getC_Project_ID());\n\t\tsetC_ProjectPhase_ID(iLine.getC_ProjectPhase_ID());\n\t\tsetC_ProjectTask_ID(iLine.getC_ProjectTask_ID());\n\t\tsetC_Activity_ID(iLine.getC_Activity_ID());\n\t\tsetC_Campaign_ID(iLine.getC_Campaign_ID());\n\t\tsetAD_OrgTrx_ID(iLine.getAD_OrgTrx_ID());\n\t\tsetUser1_ID(iLine.getUser1_ID());\n\t\tsetUser2_ID(iLine.getUser2_ID());\n\t}", "public CustomerOrderLineTableModel(List<CustomerOrderLine> theCustomerOrderLines) {\n\t\tcustomerOrderLines = theCustomerOrderLines;\n\t}", "public long getQuantity() {\n return quantity_;\n }", "public long getQuantity() {\n return quantity_;\n }", "public java.math.BigDecimal getQty() throws java.rmi.RemoteException;", "@Override\n\tpublic java.lang.String getNeedQuantity() {\n\t\treturn _lineaGastoCategoria.getNeedQuantity();\n\t}", "@SuppressWarnings(\"all\")\npublic interface I_i_ordertrx_temp \n{\n\n /** TableName=i_ordertrx_temp */\n public static final String Table_Name = \"i_ordertrx_temp\";\n\n /** AD_Table_ID=1000126 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name count_order */\n public static final String COLUMNNAME_count_order = \"count_order\";\n\n\t/** Set count_order\t */\n\tpublic void setcount_order (int count_order);\n\n\t/** Get count_order\t */\n\tpublic int getcount_order();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name i_ordertrx_temp_ID */\n public static final String COLUMNNAME_i_ordertrx_temp_ID = \"i_ordertrx_temp_ID\";\n\n\t/** Set Semeru Order Temporary\t */\n\tpublic void seti_ordertrx_temp_ID (int i_ordertrx_temp_ID);\n\n\t/** Get Semeru Order Temporary\t */\n\tpublic int geti_ordertrx_temp_ID();\n\n /** Column name insert_order */\n public static final String COLUMNNAME_insert_order = \"insert_order\";\n\n\t/** Set insert_order\t */\n\tpublic void setinsert_order (boolean insert_order);\n\n\t/** Get insert_order\t */\n\tpublic boolean isinsert_order();\n\n /** Column name order_detail */\n public static final String COLUMNNAME_order_detail = \"order_detail\";\n\n\t/** Set order_detail\t */\n\tpublic void setorder_detail (String order_detail);\n\n\t/** Get order_detail\t */\n\tpublic String getorder_detail();\n\n /** Column name orders */\n public static final String COLUMNNAME_orders = \"orders\";\n\n\t/** Set orders\t */\n\tpublic void setorders (String orders);\n\n\t/** Get orders\t */\n\tpublic String getorders();\n\n /** Column name pos */\n public static final String COLUMNNAME_pos = \"pos\";\n\n\t/** Set pos\t */\n\tpublic void setpos (String pos);\n\n\t/** Get pos\t */\n\tpublic String getpos();\n\n /** Column name Result */\n public static final String COLUMNNAME_Result = \"Result\";\n\n\t/** Set Result.\n\t * Result of the action taken\n\t */\n\tpublic void setResult (String Result);\n\n\t/** Get Result.\n\t * Result of the action taken\n\t */\n\tpublic String getResult();\n\n /** Column name transaction_id */\n public static final String COLUMNNAME_transaction_id = \"transaction_id\";\n\n\t/** Set transaction_id\t */\n\tpublic void settransaction_id (int transaction_id);\n\n\t/** Get transaction_id\t */\n\tpublic int gettransaction_id();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "public static void C_OrderLine(MOrderLine ol) {\n\t\tif (MUMOrderLine.isConsumesForecast(ol))\n\t\t\treturn;\n\n\t\tMPPMRP mrp = getQuery(ol, null, null).firstOnly();\n\t\tif (mrp == null) {\n\t\t\tmrp = new MPPMRP(ol.getCtx(), 0, ol.get_TrxName());\n\t\t\tmrp.setC_OrderLine_ID(ol.getC_OrderLine_ID());\n\t\t}\n\t\tmrp.setAD_Org_ID(ol.getAD_Org_ID());\n\t\tmrp.setC_Order(MUMOrderLine.getParent(ol));\n\t\tmrp.setDescription(ol.getDescription());\n\t\tmrp.setName(\"MRP\");\n\t\tmrp.setDatePromised(ol.getDatePromised());\n\t\tmrp.setDateStartSchedule(ol.getDatePromised());\n\t\tmrp.setDateFinishSchedule(ol.getDatePromised());\n\t\tmrp.setDateOrdered(ol.getDateOrdered());\n\t\tmrp.setM_Warehouse_ID(ol.getM_Warehouse_ID());\n\t\tmrp.setM_Product_ID(ol.getM_Product_ID());\n\t\tmrp.setQty(ol.getQtyOrdered().subtract(ol.getQtyDelivered()));\n\t\tmrp.save();\n\n\t\tMOrder o = MUMOrderLine.getParent(ol);\n\t\tMDocType dt = MDocType.get(o.getCtx(), o.getC_DocTypeTarget_ID());\n\t\tString DocSubTypeSO = dt.getDocSubTypeSO();\n\t\tMProduct product = new MProduct(ol.getCtx(), ol.getM_Product_ID(), ol.get_TrxName());\n\t\tif (MDocType.DOCSUBTYPESO_StandardOrder.equals(DocSubTypeSO) && product.isBOM() && !product.isPurchased()\n\t\t\t\t&& IsProductMakeToOrder(ol.getCtx(), ol.getM_Product_ID(), ol.get_TrxName())) {\n\t\t\tMPPMRP.createMOMakeTo(ol, ol.getQtyOrdered());\n\t\t}\n\n\t\treturn;\n\t}", "public int getQuantity()\n {\n return quantity;\n }", "public int getLineType() {\n return lineType;\n }", "public void setOrderLineNum(String orderLineNum) {\n this.orderLineNum = orderLineNum == null ? null : orderLineNum.trim();\n }", "@Test\n\tpublic void deleteOrderLineProduct() {\n\t\t// TODO: JUnit - Populate test inputs for operation: deleteOrderLineProduct \n\t\tInteger orderline_id_1 = 0;\n\t\tInteger related_product_id = 0;\n\t\tOrderLine response = null;\n\t\tresponse = service.deleteOrderLineProduct(orderline_id_1, related_product_id);\n\t\t// TODO: JUnit - Add assertions to test outputs of operation: deleteOrderLineProduct\n\t}", "public int getQuantity() {\r\n return quantity;\r\n }", "public void setConvertedProductQty (BigDecimal ConvertedProductQty)\n{\nset_Value (\"ConvertedProductQty\", ConvertedProductQty);\n}", "public interface LaborLedgerExpenseTransferAccountingLine extends AccountingLine, ExternalizableBusinessObject {\n\n /**\n * Gets the emplid\n * \n * @return Returns the emplid.\n */\n public String getEmplid();\n\n /**\n * Gets the laborObject\n * \n * @return Returns the laborObject.\n */\n public LaborLedgerObject getLaborLedgerObject();\n\n /**\n * Gets the payrollEndDateFiscalPeriodCode\n * \n * @return Returns the payrollEndDateFiscalPeriodCode.\n */\n public String getPayrollEndDateFiscalPeriodCode();\n\n /**\n * Gets the payrollEndDateFiscalYear\n * \n * @return Returns the payrollEndDateFiscalYear.\n */\n public Integer getPayrollEndDateFiscalYear();\n\n /**\n * Gets the payrollTotalHours\n * \n * @return Returns the payrollTotalHours.\n */\n public BigDecimal getPayrollTotalHours();\n\n /**\n * Gets the positionNumber\n * \n * @return Returns the positionNumber.\n */\n public String getPositionNumber();\n\n /**\n * Sets the emplid\n * \n * @param emplid The emplid to set.\n */\n public void setEmplid(String emplid);\n\n /**\n * Sets the laborLedgerObject\n * \n * @param laborLedgerObject The laborLedgerObject to set.\n */\n public void setLaborLedgerObject(LaborLedgerObject laborLedgerObject);\n\n /**\n * Sets the payrollEndDateFiscalPeriodCode\n * \n * @param payrollEndDateFiscalPeriodCode The payrollEndDateFiscalPeriodCode to set.\n */\n public void setPayrollEndDateFiscalPeriodCode(String payrollEndDateFiscalPeriodCode);\n\n /**\n * Sets the payrollEndDateFiscalYear\n * \n * @param payrollEndDateFiscalYear The payrollEndDateFiscalYear to set.\n */\n public void setPayrollEndDateFiscalYear(Integer payrollEndDateFiscalYear);\n\n /**\n * Sets the payrollTotalHours\n * \n * @param payrollTotalHours The payrollTotalHours to set.\n */\n public void setPayrollTotalHours(BigDecimal payrollTotalHours);\n\n /**\n * Sets the positionNumber\n * \n * @param positionNumber The positionNumber to set.\n */\n public void setPositionNumber(String positionNumber);\n}", "public int getC_OrderLine_ID() {\n\t\tInteger ii = (Integer) get_Value(\"C_OrderLine_ID\");\n\t\tif (ii == null)\n\t\t\treturn 0;\n\t\treturn ii.intValue();\n\t}", "public Long getLineCarriageprice() {\n return lineCarriageprice;\n }", "public CQ getPsl12_ProductServiceQuantity() { \r\n\t\tCQ retVal = this.getTypedField(12, 0);\r\n\t\treturn retVal;\r\n }", "public long getQuantity() {\n return quantity_;\n }", "public long getQuantity() {\n return quantity_;\n }", "@Override\n public String toString(){\n return \"\\n\"+String.valueOf(orderId) + \" $\"+String.valueOf(amount)+ \" Name:\"+String.valueOf(vendor);\n }", "public int getQuantity() {\n return quantity;\n }", "public int getQuantity() {\n return quantity;\n }", "public int getQuantity() {\n return quantity;\n }", "public int getQuantity() {\n return quantity;\n }", "public int getQuantity() {\n return quantity;\n }", "public int getQuantity() {\n return quantity;\n }", "public int getQty() {\n return qty;\n }", "public POSLineItemWrapper(POSLineItemDetail detail) {\n this.id = detail.getLineItem().getItem().getId();\n this.desc = detail.getLineItem().getItemDescription();\n this.qty++;\n this.price = detail.getLineItem().getItemRetailPrice();\n this.isReturn = detail.getLineItem() instanceof com.chelseasystems.cr.pos.ReturnLineItem;\n this.vat = detail.getVatAmount();\n this.itemOriginalVat = detail.getLineItem().getNetAmount().multiply(detail.getLineItem().\n getItem().getVatRate().doubleValue()).round();\n Reduction[] reds = detail.getReductionsArray();\n for (int idx = 0; idx < reds.length; idx++) {\n String reason = reds[idx].getReason();\n // if(reason.equalsIgnoreCase(\"PRIVILEGE Discount\"))\n // {\n // privAmt = reds[idx].getAmount();\n // PrivilegeDiscount disc = getPrivilegeDiscount();\n // try\n // {\n // privPct = disc.getPercent(detail.getLineItem(), compositePOSTransaction.getStore().getId());\n // continue;\n // }\n // catch(Exception e)\n // {\n // }\n // }\n // else if(reason.equalsIgnoreCase(\"DRIVERS Discount\"))\n // {\n // coachAmt = reds[idx].getAmount();\n // DriversDiscount disc = getDriversDiscount();\n // try\n // {\n // coachPct = disc.getPercent(detail.getLineItem(), compositePOSTransaction.getStore().getId());\n // continue;\n // }\n // catch(Exception e)\n // {\n // }\n // }\n // else if(reason.equalsIgnoreCase(\"CONCESSIONAIRE Discount\"))\n // {\n // concessAmt = reds[idx].getAmount();\n // ConcessionaireDiscount disc = getConcessionaireDiscount();\n // try\n // {\n // concessPct = disc.getPercent(detail.getLineItem(), compositePOSTransaction.getStore().getId());\n // continue;\n // }\n // catch(Exception e)\n // {\n // }\n // }\n // else if(reason.equalsIgnoreCase(\"SETTLEMENT\"))\n // {\n // settleAmt = reds[idx].getAmount();\n // SettlementDiscount disc = getSettlementDiscount();\n // try\n // {\n // settlePct = disc.getPercent();\n // continue;\n // }\n // catch(Exception e)\n // {\n // }\n // }\n // else\n if (reason.equalsIgnoreCase(\"Manual Markdown\")) {\n manualAmt = reds[idx].getAmount();\n } else {\n promoAmt = reds[idx].getAmount();\n }\n }\n }", "public void setLINE_NO(BigDecimal LINE_NO) {\r\n this.LINE_NO = LINE_NO;\r\n }", "public void setLINE_NO(BigDecimal LINE_NO) {\r\n this.LINE_NO = LINE_NO;\r\n }", "public void setLINE_NO(BigDecimal LINE_NO) {\r\n this.LINE_NO = LINE_NO;\r\n }", "public void setLINE_NO(BigDecimal LINE_NO) {\r\n this.LINE_NO = LINE_NO;\r\n }", "public TExpressOrderRecord(Integer id, Integer userId, String expressNumber, String expressCompanyName, ExpressCompanyType expressCompany, String phone, String address, String studentName, LocalDateTime accessDay, String accessNumber, OrderType orderType, String orderTypeName, String remark, LocalDateTime createTime, Integer createUser, String createUserName, LocalDateTime updateTime, Integer updateUser, String updateUserName, LocalDateTime deleteTime, Integer deleteUser, String deleteUserName, Byte enabled, LocalDateTime dataVersion) {\n super(TExpressOrder.T_EXPRESS_ORDER);\n\n set(0, id);\n set(1, userId);\n set(2, expressNumber);\n set(3, expressCompanyName);\n set(4, expressCompany);\n set(5, phone);\n set(6, address);\n set(7, studentName);\n set(8, accessDay);\n set(9, accessNumber);\n set(10, orderType);\n set(11, orderTypeName);\n set(12, remark);\n set(13, createTime);\n set(14, createUser);\n set(15, createUserName);\n set(16, updateTime);\n set(17, updateUser);\n set(18, updateUserName);\n set(19, deleteTime);\n set(20, deleteUser);\n set(21, deleteUserName);\n set(22, enabled);\n set(23, dataVersion);\n }", "public float getQuantity() {\n return quantity;\n }", "public int getQuantity();", "@Override\n protected boolean beforeSave(boolean newRecord) {\n if (!newRecord){\n if ((is_ValueChanged(X_Z_RemDifInvLinAfecta.COLUMNNAME_PriceEntered)) || (is_ValueChanged(X_Z_RemDifInvLinAfecta.COLUMNNAME_QtyEntered))){\n this.setLineTotalAmt(this.getQtyEntered().multiply(this.getPriceEntered()).setScale(2, RoundingMode.HALF_UP));\n\n MInvoiceLine invoiceLine = (MInvoiceLine) this.getC_InvoiceLine();\n if ((invoiceLine != null) && (invoiceLine.get_ID() > 0)){\n invoiceLine.setQtyInvoiced(this.getQtyEntered());\n invoiceLine.setQtyEntered(this.getQtyEntered());\n invoiceLine.setPriceActual(this.getPriceEntered());\n invoiceLine.setPriceEntered(this.getPriceEntered());\n\n MProduct prod = (MProduct) invoiceLine.getM_Product();\n\n // Impuesto del producto (primero impuesto especial de compra, y si no tiene, entonces el impuesto normal\n if (prod.get_ValueAsInt(\"C_TaxCategory_ID_2\") > 0) {\n MTaxCategory taxCat = new MTaxCategory(getCtx(), prod.get_ValueAsInt(\"C_TaxCategory_ID_2\"), null);\n MTax tax = taxCat.getDefaultTax();\n if (tax != null) {\n if (tax.get_ID() > 0) {\n invoiceLine.setC_Tax_ID(tax.get_ID());\n }\n }\n } else {\n if (prod.getC_TaxCategory_ID() > 0) {\n MTaxCategory taxCat = (MTaxCategory) prod.getC_TaxCategory();\n MTax tax = taxCat.getDefaultTax();\n if (tax != null) {\n if (tax.get_ID() > 0) {\n invoiceLine.setC_Tax_ID(tax.get_ID());\n }\n }\n }\n }\n\n invoiceLine.setLineNetAmt();\n invoiceLine.setTaxAmt();\n invoiceLine.saveEx();\n }\n\n }\n }\n\n return true;\n }", "public void setShrinkQty (BigDecimal ShrinkQty)\n{\nset_Value (\"ShrinkQty\", ShrinkQty);\n}", "public void addToOrder() {\n OrderLine orderLine = new OrderLine(order.lineNumber++, sandwhich, sandwhich.price());\n order.add(orderLine);\n ObservableList<Extra> selected = extraSelected.getItems();\n orderPrice.clear();\n String price = new DecimalFormat(\"#.##\").format(sandwhich.price());\n orderPrice.appendText(\"$\"+price);\n extraOptions.getItems().addAll(selected);\n extraSelected.getItems().removeAll(selected);\n pickSandwhich();\n\n\n\n }", "public int getQuantity() {\n return this.quantity;\n }", "@Override\r\n\tprotected String[] getSpecificLines() {\r\n\t\tString[] lines = new String[4];\r\n\t\tlines[0] = \"\";\r\n\t\tif (items.toString().lastIndexOf('_') < 0) {\r\n\t\t\tlines[1] = items.toString();\r\n\t\t\tlines[2] = \"\";\r\n\t\t} else {\r\n\t\t\tlines[1] = items.toString().substring(0, items.toString().lastIndexOf('_'));\r\n\t\t\tlines[2] = items.toString().substring(items.toString().lastIndexOf('_') + 1);\r\n\t\t}\r\n\t\tlines[3] = String.valueOf(cost);\r\n\t\treturn lines;\r\n\t}", "public void setConvertedSplitQty (BigDecimal ConvertedSplitQty)\n{\nset_Value (\"ConvertedSplitQty\", ConvertedSplitQty);\n}", "public interface ManualQuote extends MutableBusinessModel\n{\n public static final String PROPERTY_PRODUCT_KEYS = \"PROPERTY_PRODUCT_KEYS\";\n public static final String PROPERTY_SIDE = \"PROPERTY_SIDE\";\n public static final String PROPERTY_PRICE = \"PROPERTY_PRICE\";\n public static final String PROPERTY_SIZE = \"PROPERTY_SIZE\";\n public static final String PROPERTY_OVERRIDE = \"PROPERTY_OVERRIDE\";\n\n // helper methods to struct attributes\n public String getSessionName();\n public ProductKeys getProductKeys();\n public char getSide();\n public Price getPrice();\n public int getSize();\n public boolean isOverrideIndicator();\n public ManualQuoteDetail getManualQuoteDetail();\n public KeyValueStruct[] getExtensions();\n public SessionProduct getSessionProduct();\n public SessionReportingClass getSessionReportingClass();\n public SessionProductClass getSessionProductClass();\n\n public void setSessionProduct(SessionProduct sessionProduct);\n public void setSessionReportingClass(SessionReportingClass sessionReportingClass);\n public void setSessionProductClass(SessionProductClass sessionProductClass);\n public void setSide(char side);\n public void setPrice(Price price);\n public void setSize(int size);\n public void setOverrideIndicator(boolean override);\n public void setManualQuoteDetail(ManualQuoteDetail manualQuoteDetail);\n public void setExtensions(KeyValueStruct[] keyValues);\n\n public ManualQuoteStruct getStruct();\n}" ]
[ "0.6524634", "0.6363414", "0.6314658", "0.6292632", "0.62543297", "0.6213122", "0.6094878", "0.6071226", "0.6040542", "0.6040368", "0.6030125", "0.599224", "0.5983194", "0.596801", "0.5957175", "0.5956054", "0.59466374", "0.5895114", "0.5886395", "0.5828172", "0.5823036", "0.58175486", "0.5811949", "0.5788222", "0.5750184", "0.573831", "0.56946665", "0.5651284", "0.5649759", "0.5648175", "0.5647081", "0.56367844", "0.56264967", "0.56260145", "0.5610726", "0.5609047", "0.56030196", "0.5601419", "0.5599407", "0.5595854", "0.55914026", "0.55829984", "0.55812466", "0.55812466", "0.55746406", "0.5562471", "0.555626", "0.55512124", "0.5541015", "0.5535827", "0.55317456", "0.5531326", "0.54923624", "0.54804206", "0.5480145", "0.5472945", "0.54698557", "0.5461353", "0.5455765", "0.54549676", "0.54549676", "0.54444903", "0.54440314", "0.5443248", "0.54409033", "0.5435071", "0.5432303", "0.54315567", "0.5431275", "0.54297405", "0.5425316", "0.5422238", "0.5416448", "0.5411812", "0.54032314", "0.53936493", "0.53936493", "0.53840363", "0.53835946", "0.53835946", "0.53835946", "0.53835946", "0.53835946", "0.53835946", "0.53742886", "0.5365618", "0.5363956", "0.5363956", "0.5363956", "0.5363956", "0.5357426", "0.5355567", "0.53537893", "0.5351641", "0.53477335", "0.5341307", "0.53361946", "0.5332682", "0.5330276", "0.53231215" ]
0.72613376
0
access it using localhost:4567/api/signup
private void doSignup(RoutingContext ctx){ // Get Data from view JsonObject req = ctx.getBodyAsJson(); String username = req.getString("username"); String password = req.getString("password"); GoogleAuthenticator authenticator = new GoogleAuthenticator(); //Get Generate Key System.out.println(" Calling Google Authenticator to generate AuthKey"); GoogleAuthenticatorKey authKey = authenticator.createCredentials(); String key = authKey.getKey(); System.out.println(" Google Authenticator generated AuthKey"); //Store Data from Repository User user = new User(username,password,key); //send response to the user JsonObject res = new JsonObject().put("key",key); ctx.response().setStatusCode(200).end(res.encode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}", "void signUp(SignUpRequest signupRequest);", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@RequestBody RegistrationRequest registrationRequest){\n return userService.registerUser(registrationRequest);\n }", "@Test\n\tpublic void registerUserTest1() throws Exception {\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).characterEncoding(\"UTF-8\")).andDo(print()).andExpect(status().is(400));\n\n\t}", "public void postSignUpData(String userName, String email , String password) {\n\n HttpPost httppost = new HttpPost(\"http://192.168.1.224:3000/signup\");\n\n try {\n // Add your data\n\n JSONObject json = new JSONObject();\n json.put(\"username\" , userName);\n json.put(\"email\" , email);\n json.put(\"password\" , password);\n\n StringEntity se = new StringEntity( json.toString());\n se.setContentType(new BasicHeader(HTTP.CONTENT_TYPE, \"application/json\"));\n httppost.setEntity(se);\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n\n s = EntityUtils.toString(response.getEntity());\n\n s = s.toString();\n\n\n int a=response.getStatusLine().getStatusCode();\n\n\n\n } catch (ClientProtocolException e) {\n // TODO Auto-generated catch block\n } catch (IOException e) {\n // TODO Auto-generated catch block\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@GET(Config.REGISTER) Call<User> registerUser(@QueryMap Map<String, String> body);", "private void userSignup(String email, String password) {\n String url = \"https://7e69edce-af20-4c49-9ad9-5697df4e8a20.mock.pstmn.io\";\n StringRequest request = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {\n @Override\n public void onResponse(String response) {\n// Log.i(\"LOG\", \"onResponse: \" + response);\n onSignupClicked.onClicked(response);\n dismiss();\n }\n }, new Response.ErrorListener() {\n @Override\n public void onErrorResponse(VolleyError error) {\n// Toast.makeText(getContext(), error.toString(), Toast.LENGTH_SHORT).show();\n Log.i(\"LOG\", \"onErrorResponse: \" + error.toString());\n }\n }) {\n @Override\n protected Map<String, String> getParams() throws AuthFailureError {\n Map<String, String> params = new HashMap<String, String>();\n\n params.put(\"username\", email);\n params.put(\"password\", password);\n return params;\n }\n };\n\n request.setRetryPolicy(new DefaultRetryPolicy(15000, DefaultRetryPolicy.DEFAULT_MAX_RETRIES,\n DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));\n\n RequestQueue requestQueue = Volley.newRequestQueue(getContext());\n requestQueue.add(request);\n }", "public void Register() {\n Url url = new Url();\n User user = new User(fname.getText().toString(), lname.getText().toString(), username.getText().toString(), password.getText().toString());\n Call<Void> registerUser = url.createInstanceofRetrofit().addNewUser(user);\n registerUser.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n Toast.makeText(getActivity(), \"User Registered successfully\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n Toast.makeText(getActivity(), \"Error\" + t, Toast.LENGTH_SHORT).show();\n }\n });\n }", "@RequestMapping(value=\"/signup/{username}/{password}\")\n @ResponseBody\n public boolean signup(@PathVariable String username, @PathVariable String password){\n\n User user = new User(username, password);\n try{\n customUserDetailsService.save(user);\n return true;\n }catch (Exception e) {\n System.out.println(e);\n //ef return false tha er username fratekid...\n return false;\n }\n }", "@PostMapping(path = \"/signup\", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)\n @ResponseBody\n public UserResult signUp(@RequestBody UserSignUpInput userSignUpInput) {\n return userService.signUp(userSignUpInput);\n }", "@Test\n public void aTestRegister() {\n given()\n .param(\"username\", \"playlist\")\n .param(\"password\", \"playlist\")\n .post(\"/register\")\n .then()\n .statusCode(201);\n }", "public void signUp(UserSignUpRequest userSignUpRequest) {\n apiInterface.signUp(\n userSignUpRequest\n )\n .subscribeOn(Schedulers.io())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(\n new Observer<Response<ResponseBody>>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onNext(Response<ResponseBody> responseBodyResponse) {\n if (responseBodyResponse.code() == 201) {\n try {\n //noinspection ConstantConditions\n saveUserData(\n new Gson().fromJson(\n responseBodyResponse.body().string(),\n UserData.class\n )\n );\n } catch (IOException e) {\n e.printStackTrace();\n }\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.SUCCESS, \"\"\n )\n )\n );\n } else {\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.FAIL,\n getErrorMessage(responseBodyResponse.errorBody())\n )\n )\n );\n }\n }\n\n @Override\n public void onError(Throwable e) {\n mutableLiveDataSignUpResult.postValue(\n new Event<>(\n new Result(\n Enums.Result.FAIL,\n getErrorMessage(e)\n )\n )\n );\n }\n\n @Override\n public void onComplete() {\n\n }\n }\n );\n }", "@POST\n @Path(\"register\")\n @Produces(MediaType.APPLICATION_JSON)\n public JAXResult register(UserBE user){\n return null;\n }", "UserRegistrationResponse registrationPost(RegistrationForm registrationForm);", "@Override\n public ApiResponse createUser(SignupDto signupDto){\n var userRole = this.roleDAO.findByName(RoleEnum.USER);\n Set<Role> userRoles = new HashSet<Role>(Collections.singletonList(userRole.get()));\n\n Person newPerson = new Person();\n newPerson.setEmail(signupDto.getUsername());\n newPerson.setFirstName(signupDto.getFirstName());\n newPerson.setLastName(signupDto.getLastName());\n newPerson.setRoles(userRoles);\n\n // Encriptamos la contraseña que nos mando el usuario\n var encryptedPassword = this.passwordEncoder.encode(signupDto.getPassword());\n newPerson.setPassword(encryptedPassword);\n\n this.personDAO.save(newPerson);\n\n return new ApiResponse(true, \"Usuario creado\");\n\n }", "@GetMapping(\"/login\")\r\n public Person login(@RequestBody SignUp signUp) {\r\n Person person = loginService.signup(signUp);\r\n }", "public void signUp() {\n presenter.signup(username.getText().toString(), password.getText().toString());\n }", "Task<Void> signUp(String email, String password);", "@PostMapping(\"/signup\")\n @CrossOrigin\n public ResponseEntity<?> signup(@RequestParam String firstName, String lastName, @RequestParam String email, @RequestParam String contactNumber, @RequestParam String password) {\n if (userService.findUser(contactNumber) != null) {\n return new ResponseEntity<>(\"Try any other contact number, this contact number has already been registered!\", HttpStatus.BAD_REQUEST);\n } else if (!isEmailValid(email)) {\n return new ResponseEntity<>(\"Invalid email-id format!\", HttpStatus.BAD_REQUEST);\n } else if (!isContactNumberValid(contactNumber)) {\n return new ResponseEntity<>(\"Invalid contact number!\", HttpStatus.BAD_REQUEST);\n } else if (!isPasswordStrong(password)) {\n return new ResponseEntity<>(\"Weak password!\", HttpStatus.BAD_REQUEST);\n } else {\n String sha256hex = Hashing.sha256()\n .hashString(password, Charsets.US_ASCII)\n .toString();\n userService.newUser(firstName, lastName, email, contactNumber, sha256hex);\n return new ResponseEntity<>(\"User with contact number \" + contactNumber + \" successfully registered!\", HttpStatus.CREATED);\n }\n }", "@POST\n\t@Path(\"/signUp\")\n\t@Consumes(MediaType.APPLICATION_JSON)\n\tpublic String createUser(User user) {\n\t\tUserService.createUser(user);\n\t\treturn \"User \" + user.getUsername() + \" is created successfully\";\n\t}", "@RequestMapping(\"/signup\")\n public void signUp(String firstName, String lastName, String address,\n String emailAddress, String userName,\n String password, int age, int telephoneNumber){\n User.UserBuilder userBuilder = new User.UserBuilder(firstName, lastName, address, age,\n userName, password,emailAddress);\n if(telephoneNumber > 0) userBuilder.telephoneNumber(telephoneNumber);\n User user = userBuilder.build();\n userService.addUser(user);\n }", "@POST\n @Path(\"/users/register\")\n public Response register(\n @Context HttpServletRequest request \n ,@Context HttpServletResponse response\n ,@Context ServletContext servletContext\n ,String raw\n ){\n try{\n log.debug(\"/register called\");\n// String raw=IOUtils.toString(request.getInputStream());\n mjson.Json x=mjson.Json.read(raw);\n \n Database2 db=Database2.get();\n for (mjson.Json user:x.asJsonList()){\n String username=user.at(\"username\").asString();\n \n if (db.getUsers().containsKey(username))\n db.getUsers().remove(username); // remove so we can overwrite the user details\n \n Map<String, String> userInfo=new HashMap<String, String>();\n for(Entry<String, Object> e:user.asMap().entrySet())\n userInfo.put(e.getKey(), (String)e.getValue());\n \n userInfo.put(\"level\", LevelsUtil.get().getBaseLevel().getRight());\n userInfo.put(\"levelChanged\", new SimpleDateFormat(\"yyyy-MM-dd\").format(new Date()));// nextLevel.getRight());\n \n db.getUsers().put(username, userInfo);\n log.debug(\"New User Registered (via API): \"+Json.newObjectMapper(true).writeValueAsString(userInfo));\n db.getScoreCards().put(username, new HashMap<String, Integer>());\n \n db.addEvent(\"New User Registered (via API)\", username, \"\");\n }\n \n db.save();\n return Response.status(200).entity(\"{\\\"status\\\":\\\"DONE\\\"}\").build();\n }catch(IOException e){\n e.printStackTrace();\n return Response.status(500).entity(\"{\\\"status\\\":\\\"ERROR\\\",\\\"message\\\":\\\"\"+e.getMessage()+\"\\\"}\").build(); \n }\n \n }", "@POST\n @Path(\"/user/account\")\n @Consumes(MediaType.APPLICATION_FORM_URLENCODED)\n public void createUserAccount(@FormParam(\"name\") String name, @FormParam(\"email\") String email, @FormParam(\"password\") String password, @FormParam(\"con_password\") String confirmPassword, @FormParam(\"address\") String address){\n \n System.out.println(name);\n System.out.println(email);\n System.out.println(password);\n System.out.println(confirmPassword);\n System.out.println(address);\n \n }", "public F.Promise<Result> handleSignUp() {\n final Form<SignUp> filledForm = signUpForm.bindFromRequest();\n if(customerService().isLoggedIn()) {\n return asPromise(redirectToReturnUrl());\n } else if (filledForm.hasErrors()) {\n return asPromise(badRequest(signupView.render(data().build(), filledForm)));\n } else {\n return handleSignUpWithValidForm(filledForm);\n }\n }", "private void userSignUp(final int id, String agentNm, String fName, String sta, String localG, String tow, String phoneNm, String fmMr, String cbRg, String memSiz, String cggNam, String cFarmZz, String fcRg, String inFarm, String riceVarr, String qttyHarr, String afRg,\n String fertTldd, String noRzz, String qtyApll, String alRg, String szLoaa, String srcRicc, String qtyPdyRicc, String majByrss, String comSolcc, String qttyByy, String howMcc, String prcBb, String incDs,\n String reasnn, String hwSpyy, String stRg, String ysSptrr, String fm1, String t11, String cstCs11, String fm2, String t22, String cstCs22, String fm3, String t33, String cstCs33, String infPrcc, String salesDmm,\n String avgQtFcc, String whnCp, String whyCp, String whnEx, String whyExx, String mjCh, String adCh, String timSe, String othSe, String adInn) {\n Call<ResponseBody> call = RetrofitClient2\n .getInstance()\n .getNaSurvey()\n .submitResponse(agentNm, fName, sta, localG, tow, phoneNm, fmMr, cbRg, memSiz, cggNam, cFarmZz, fcRg, inFarm, riceVarr, qttyHarr, afRg, fertTldd, noRzz, qtyApll, alRg, szLoaa, srcRicc, qtyPdyRicc, majByrss, comSolcc, qttyByy, howMcc, prcBb, incDs, reasnn, hwSpyy, stRg, ysSptrr, fm1, t11, cstCs11,\n fm2, t22, cstCs22, fm3, t33, cstCs33, infPrcc, salesDmm, avgQtFcc, whnCp, whyCp, whnEx, whyExx, mjCh, adCh, timSe, othSe, adInn);\n\n call.enqueue(new Callback<ResponseBody>() {\n @Override\n public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {\n\n try {\n JSONObject obj = new JSONObject(String.valueOf(response));\n if (!obj.getBoolean(\"error\")) {\n //updating the status in sqlite\n db.updateNameStatus(id, SurveyActivity.SYNC_STATUS_OK);\n\n //sending the broadcast to refresh the list\n context.sendBroadcast(new Intent(SurveyActivity.DATA_SAVED_BROADCAST));\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }\n\n @Override\n public void onFailure(Call<ResponseBody> call, Throwable t) {\n Map<String, String> params = new HashMap<>();\n params.put(\"agentNm\", agentNm);\n params.put(\"fname\", fName);\n params.put(\"state\", sta);\n params.put(\"lga\", localG);\n params.put(\"town\", tow);\n params.put(\"phoneNm\", phoneNm);\n params.put(\"farmer\", fmMr);\n params.put(\"cogp\", cbRg);\n params.put(\"memsz\", memSiz);\n params.put(\"cgnam\", cggNam);\n params.put(\"cofmsz\", cFarmZz);\n params.put(\"frmcol\", fcRg);\n params.put(\"invfz\", inFarm);\n params.put(\"ricev\", riceVarr);\n params.put(\"qtyhv\", qttyHarr);\n params.put(\"apfert\", afRg);\n params.put(\"ysyld\", fertTldd);\n params.put(\"norz\", noRzz);\n params.put(\"qtyap\", qtyApll);\n params.put(\"aploa\", alRg);\n params.put(\"szloa\", szLoaa);\n params.put(\"srcric\", srcRicc);\n params.put(\"qtypdrc\", qtyPdyRicc);\n params.put(\"majby\", majByrss);\n params.put(\"comso\", comSolcc);\n params.put(\"qtby\", qttyByy);\n params.put(\"hwmch\", howMcc);\n params.put(\"pricbf\", prcBb);\n params.put(\"indcr\", incDs);\n params.put(\"rsn\", reasnn);\n params.put(\"hwspl\", hwSpyy);\n params.put(\"chsp\", stRg);\n params.put(\"yssptr\", ysSptrr);\n params.put(\"frm1\", fm1);\n params.put(\"to1\", t11);\n params.put(\"costc1\", cstCs11);\n params.put(\"frm2\", fm2);\n params.put(\"to2\", t22);\n params.put(\"costcs2\", cstCs22);\n params.put(\"frm3\", fm3);\n params.put(\"to3\", t33);\n params.put(\"costcs3\", cstCs33);\n params.put(\"infpr\", infPrcc);\n params.put(\"salsdm\", salesDmm);\n params.put(\"avqtf\", avgQtFcc);\n params.put(\"wncp\", whnCp);\n params.put(\"wycp\", whyCp);\n params.put(\"wnex\", whnEx);\n params.put(\"wyex\", whyExx);\n params.put(\"majch\", mjCh);\n params.put(\"addch\", adCh);\n params.put(\"timsl\",timSe);\n params.put(\"othsl\",othSe);\n params.put(\"adin\",adInn);\n\n return;\n }\n });\n\n }", "@Test\n\tpublic void registerUserTest4() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass1234\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(passwordsNoMatch));\n\t}", "@Test\n\tpublic void createUserwithPOSTTest() {\n\t\tRestAssured.baseURI = \"https://gorest.co.in\";\n\t\tRequestSpecification request = RestAssured.given().log().all();\n\t request.header(\"Authorization\", \"Bearer 4242b4a465097df28229861ee3a53a1ab3e674935bb89e135543e470750c4e3b\");\n\t request.contentType(\"application/json\");\n\t File file = new File(\"/Users/testersinem/Documents/workspace/API/src/test/java/com/api/test/createuser.json\");\n\t request.body(file);\n\t Response response = request.post(\"/public-api/users\");\n\t System.out.println(response.prettyPrint());\n\t}", "@RequestMapping(\"/signup\")\n public String signupPage() {\n return \"createProfile\";\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<User> create(HttpServletRequest request, HttpServletResponse response) {\n // check that another session doesn't already exist for this request, and if there is, send a 403 response\n HttpSession session = request.getSession(false);\n if (session != null) {\n return ResponseEntity.status(HttpStatus.FORBIDDEN).body(null);\n }\n\n // get the sign-up parameters from the post request\n String user = request.getParameter(\"user\");\n String first = request.getParameter(\"first\");\n String last = request.getParameter(\"last\");\n String email = request.getParameter(\"email\");\n String pass = request.getParameter(\"pass\");\n\n String pattern = \"^[a-zA-Z0-9]*$\";\n\n // send an HTTP 422 response if any parameter is missing, empty, does not match the pattern (except email)\n if (user == null || user.isEmpty() || !user.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (first == null || first.isEmpty() || !first.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (last == null || last.isEmpty() || !last.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (email == null || email.isEmpty()) {\n return ResponseEntity.unprocessableEntity().body(null);\n } else if (pass == null || pass.isEmpty() || !pass.matches(pattern)) {\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // check to see if the userName or email are already taken\n List<User> uniqueAttributeCheck = userRepo.findByUserNameOrEmail(user, email);\n\n // send an HTTP 409 response if either already exists\n if (uniqueAttributeCheck.size() > 0) {\n return ResponseEntity.status(HttpStatus.CONFLICT).body(null);\n }\n\n User newUser;\n\n // create the new User and save it in the user repository\n try {\n newUser = userRepo.save(new User(user, first, last, email, pass));\n } catch (TransactionSystemException e) { // this exception will be thrown if the email does not validate\n return ResponseEntity.unprocessableEntity().body(null);\n }\n\n // create a new session for the new User\n session = request.getSession();\n session.setAttribute(\"user\", user);\n\n // add the user cookie to the response\n response.addCookie(CookieManager.getUserCookie(user));\n\n // send an HTTP 201 response with the new session User\n return ResponseEntity.status(HttpStatus.CREATED).body(newUser.asSessionUser());\n }", "@PostMapping(\"/register\")\n public ResponseEntity<Map<String, String>> registerUser(@RequestBody User user){ \n userService.registerUser(user);\n return new ResponseEntity<>(generateJWTTToken(user), HttpStatus.OK);\n }", "@PostMapping(\"/register\")\n public String register(String uid, String[] key){\n return \"\";\n }", "boolean signUp(User user);", "@PostMapping(\"/signup\")\n\tpublic Signup signUpEmployee(@RequestBody Signup signup) {\n\t\tString email = signup.getEmailId();\n\t\tSignup user = userRepo.findByemailId(email);\n\t\tif(! user.isEmpty()) {\n\t\t\tthrow new UserAlreadyExistException(\"User Already Exist\");\n\t\t}\n\t\t\n\t\treturn userRepo.save(signup);\n\t}", "@Test\n\tpublic void registerUserTest2() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(usernameTaken));\n\t}", "@Test\n\tpublic void registerUserTest3() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(true);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(400)).andExpect(status().reason(emailTaken));\n\t}", "UserCreateResponse createUser(UserCreateRequest request);", "@Test\n\tpublic void addUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tpost(\"/secure/user/addUser\").param(\"username\", \"username1\")\n\t\t\t\t\t\t.param(\"firstName\", \"firstName1\")\n\t\t\t\t\t\t.param(\"lastName\", \"lastName1\")\n\t\t\t\t\t\t.param(\"emailAddress\", \"[email protected]\")\n\t\t\t\t\t\t.param(\"password\", \"abcd1234\")\n\n\t\t\t\t\t\t.accept(MediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"message\").value(\"Success\"));\n\n\t}", "@POST\n @Path(\"Signup\")\n public Response signup(JpaAccount account,\n @Context HttpServletRequest request) {\n Response r;\n if (this.checkEmailString(account.getEmail())) {\n if (account.getUsername().equals(\"\") || !this.checkExistingUsername(account.getUsername())) {\n User user;\n Subject subject = SecurityUtils.getSubject();\n\n if (subject.isAuthenticated() && accountFacade.find((Long) subject.getPrincipal()) instanceof GuestJpaAccount) {\n GuestJpaAccount from = (GuestJpaAccount) accountFacade.find((Long) subject.getPrincipal());\n subject.logout();\n userFacade.upgradeGuest(from, account);\n r = Response.status(Response.Status.CREATED).build();\n } else {\n // Check if e-mail is already taken and if yes return a localized error message:\n try {\n accountFacade.findByEmail(account.getEmail());\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail est déjà prise.\" : \"This email address is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n } catch (WegasNoResultException e) {\n // GOTCHA\n // E-Mail not yet registered -> proceed with account creation\n user = new User(account);\n userFacade.create(user);\n r = Response.status(Response.Status.CREATED).build();\n }\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Ce nom d'utilisateur est déjà pris.\" : \"This username is already taken.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n } else {\n String msg = detectBrowserLocale(request).equals(\"fr\") ? \"Cette adresse e-mail n'est pas valide.\" : \"This e-mail address is not valid.\";\n r = Response.status(Response.Status.BAD_REQUEST).entity(WegasErrorMessage.error(msg)).build();\n }\n return r;\n }", "@Headers({\n \"Content-Type:application/json\"\n })\n @POST(\"users\")\n Call<UserResource> registerUser(\n @retrofit2.http.Body UserResource userResource\n );", "@RequestMapping(value=\"/signup\",method=RequestMethod.GET)\r\n\tpublic ModelAndView signupSuccess()\r\n\t{\r\n\t\tModelAndView mv=new ModelAndView(\"DefaultPage\");\r\n\t\tmv.addObject(\"title\",\"signup\");\r\n\t\tmv.addObject(\"userClicksSignup\", true);\r\n\t\tUser nuser=new User();\r\n\t\t//setting few fields\r\n\t\tnuser.setEnabled(true);\r\n\t\tnuser.setRole(\"USER\");\r\n\t\tmv.addObject(\"user\", nuser);\r\n\t\treturn mv;\r\n\t}", "@Test\n public void testUserNotifiedOnRegistrationSubmission() throws Exception {\n ResponseEntity<String> response = registerUser(username, password);\n assertNotNull(userService.getUser(username));\n assertEquals(successUrl, response.getHeaders().get(\"Location\").get(0));\n }", "@PostMapping(\"/signup\")\n\tpublic ResponseEntity<?> addUser(@RequestBody RegistrationRequest userRequest, UriComponentsBuilder ucBuilder) {\n\t\ttry {\n\t\t\tUser existUser = this.userService.findByEmail(userRequest.getEmail());\n\n\t\t\tif (existUser != null)\n\t\t\t\tthrow new ResourceConflictException(userRequest.getId(), \"Username already exists\");\n\n\t\t\treturn new ResponseEntity<>(this.userService.save(userRequest), HttpStatus.CREATED);\n\t\t} catch (Exception e) {\n\t\t\treturn new ResponseEntity<>(e.getMessage() + \" ovde je propalo\", HttpStatus.BAD_REQUEST);\n\t\t}\n\t}", "@RequestMapping(value=\"/signup\", method=RequestMethod.POST, produces={MediaType.APPLICATION_JSON_VALUE})\n public @ResponseBody void signUp(HttpServletRequest http, HttpServletResponse response) throws Exception {\n \tString id = http.getHeader(ID_HEADER_PARAM);\n \tString name = http.getHeader(NAME_HEADER_PARAM);\n \tString password = http.getHeader(PASSWORD_HEADER_PARAM);\n \t//TODO: The password must be decoded with the application's private key \n \t\n \tif (id == null || id.isEmpty()) \n throw new Exception(\"Missing header: \" + ID_HEADER_PARAM);\n if (name == null || name.isEmpty()) \n throw new Exception(\"Missing header: \" + NAME_HEADER_PARAM);\n if (password == null || password.isEmpty()) \n throw new Exception(\"Missing header: \" + PASSWORD_HEADER_PARAM);\n\n Claims claims = Jwts.claims().setSubject(name); \n String token = Jwts.builder()\n .setClaims(claims)\n .setIssuer(id)\n .signWith(SignatureAlgorithm.HS256, Base64.encodeBase64String(password.getBytes()))\n .compact();\n \n Employee employee = new Employee(id, name, Base64.encodeBase64String(password.getBytes()));\n \n \tSignUpEmployeeCommand cmd = new SignUpEmployeeCommand(employee);\n \tcmd.addListener(new CommandListener());\n \tcmd.issue();\n \n response.addHeader(\"name\", name);\n response.addHeader(\"id\", employee.getEmployeeId());\n response.addHeader(\"authorization\", token);\n }", "@RequestMapping(value = \"/signup\", method = RequestMethod.GET)\n\tpublic String signUpPage(Model model)\n\t{\n\t\t/* Initialize user registration form */\n\t\tmodel.addAttribute(\"userForm\", new UserDto());\n\t\treturn \"user/signup\";\n\t}", "boolean hasSignupRequest();", "public void signup(){\n\t\tboolean result = SignUpForm.display(\"Chocolate Chiptunes - Sign Up\", \"Sign-Up Form\");\n\t\tSystem.out.println(result);\n\t}", "public boolean SignUp(String username,String password,String realname) throws IOException, JSONException {\n OkHttpClient client = new OkHttpClient();\n RequestBody body = new FormBody.Builder()\n .add(\"user_id\",\"\")\n .add(\"user_code\", username)\n .add(\"user_pwd\", password)\n .add(\"user_name\", realname)\n .add(\"user_birthday\",\"\").build();\n String PcPath = \"http://www.mypc.com:8080\";\n String url=PcPath+\"/permission/user/useradd\";\n Request request = new Request.Builder().url(url).post(body).addHeader(\"Cookie\",this.jid).build();\n final Call call = client.newCall(request);\n Response response = call.execute();\n String responseData = response.body().string();\n JSONObject jsonObject = new JSONObject(responseData);\n int id = jsonObject.getInt(\"status\");\n if (id == 200) {\n return true;\n }\n return false;\n }", "@PostMapping(\"/signup\")\n public ResponseEntity<?> registerUser(@Valid @RequestBody SignupRequest signupRequest) {\n System.out.println(\"Creating User \" + signupRequest);\n\n if (userAccountDetailsService.isUserExistByUsername(signupRequest.getUsername())) {\n System.out.println(\"A User with username: \" + signupRequest.getUsername() + \" already exist\");\n return new ResponseEntity<Void>(HttpStatus.CONFLICT);\n }\n\n UserAccount userAccount = new UserAccount();\n userAccount.setName(signupRequest.getName());\n userAccount.setUsername(signupRequest.getUsername());\n userAccount.setAge(signupRequest.getAge());\n userAccount.setPassword(passwordEncoder.encode(signupRequest.getPassword()));\n\n Set<String> roles = signupRequest.getRole();\n Set<Authorities> authorities = new HashSet<>();\n for(String role: roles) {\n Authorities authority = new Authorities();\n authority.setAuthority(role);\n authority.setUserAccount(userAccount);\n authorities.add(authority);\n }\n userAccount.setAuthorities(authorities);\n\n userAccountDetailsService.saveUser(userAccount);\n\n return new ResponseEntity<Void>(HttpStatus.CREATED);\n }", "public void signUp(View v) {\n attemptRegistration();\n }", "@ApiOperation(value = \" Registration information \", tags = \"Register\")\n\n\t@PostMapping(\"/register\")\n\tpublic String addUser(@RequestParam String emailId,@RequestParam String name,@RequestParam String passwd) throws Exception\n\t{\n\t \n\t\tif(emailId!=null && !\"\".equals(emailId))\n\t\t{\n\t\t\tUser userObj=userservice.fetchByUserEmailId(emailId);\n\t\t\t\n\t\t\tif(userObj!=null) {\n\t\t return \"User with \"+emailId+\" is already exist\";\n\t\t }\n\t\t\t \n\t\t\t\n\t\t}\n\t\t User user =new User(name,emailId,passwd);\n\t\t\n\t\t // genrate 4 digit otp number\n\t\t int myotp=(int)(Math.random() * (8015)) + 2085;\n\t \t\tboolean status=emailservice.SendEmail(\"Otp is \"+myotp , emailId) ;\n\t if(!status)\n\t {\n\t \t return \"Not sending Mail\";\n\t } \n\t LocalTime time=LocalTime.now(); \n\t LocalDate date=LocalDate.now();\n\t user.setOtp(myotp);\n \t user.setActive(false);\n \t user.setLocalDate(date);\n \t user.setLocalTime(time);\n\t userservice.addUser(user);\n\t \n\t\treturn \"verification Start.....\";\n\t}", "@POST(\"/users\")\n Call<User> createUser(\n @Body User user\n );", "@GetMapping(\"/user\")\n public String user(){\n\n return \"User .. \";\n }", "@OnClick(R.id.register_button)\n public void register () {\n InputMethodManager imm = (InputMethodManager) context\n .getSystemService(Context.INPUT_METHOD_SERVICE);\n imm.hideSoftInputFromInputMethod(usernameField.getWindowToken(), 0);\n imm.hideSoftInputFromInputMethod(passwordField.getWindowToken(), 0);\n imm.hideSoftInputFromInputMethod(confirmField.getWindowToken(), 0);\n imm.hideSoftInputFromInputMethod(emailField.getWindowToken(), 0);\n\n\n\n\n String username = usernameField.getText().toString();\n String password = passwordField.getText().toString();\n String confirm = confirmField.getText().toString();\n String email = emailField.getText().toString();\n String avatarBase64 = \"string\";\n\n if (username.isEmpty() || password.isEmpty() || confirm.isEmpty() || email.isEmpty()) {\n\n Toast.makeText(context, R.string.field_empty, Toast.LENGTH_LONG).show();\n } else if(!Patterns.EMAIL_ADDRESS.matcher(email).matches()) {\n\n Toast.makeText(context, R.string.provide_vaild_email, Toast.LENGTH_SHORT).show();\n\n } else if (!password.equals(confirm)) {\n\n Toast.makeText(context, R.string.passwords_dont_match, Toast.LENGTH_SHORT).show();\n } else {\n\n registerButton.setEnabled(false);\n spinner.setVisibility(VISIBLE);\n }\n Account account = new Account(email, username, avatarBase64, password);\n RestClient restClient = new RestClient();\n restClient.getApiService().register(account).enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n\n if (response.isSuccessful()) {\n Toast.makeText(context, R.string.registration_successful, Toast.LENGTH_LONG).show();\n //This will run if everything comes back good and sets the users token and expiration\n// User regUser = response.body();\n// UserStore.getInstance().setToken(regUser.getToken());\n// UserStore.getInstance().setTokenExpiration(regUser.getExpiration());\n\n //This will set up the flow of the application to show the next view upon successful registration\n Flow flow = PeoplemonApplication.getMainFlow();\n flow.goBack();\n } else {\n\n //This will return if the user has entered info but they have registered before\n resetView();\n Toast.makeText(context, R.string.registration_failed + \": \" + response.code(), Toast.LENGTH_LONG).show();\n }\n }\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n\n //This will show up if the data didn't come back from the server correctly or there is a timeout.\n resetView();\n Toast.makeText(context, R.string.registration_failed, Toast.LENGTH_LONG).show();\n }\n });\n }", "@PostMapping(\"/process_register\")\n public String processRegistration(User user,Model model)\n throws SignatureException, NoSuchAlgorithmException, InvalidKeyException{\n\n //checking if user exists\n if(userService.existByLogin(user.getLogin())) {\n model.addAttribute(\"error\", true);\n return \"registerForm\";\n }\n\n model.addAttribute(\"user\", user);\n //saving user\n /* userRepository.save(user);*/\n userService.saveUser(user, Sha512.generateSalt().toString());\n return \"registerSuccessful\";\n }", "@Headers({\n \"Content-Type:application/json\"\n })\n @POST(\"administrators\")\n Call<Void> createUser(\n @retrofit2.http.Body UserBody userBody\n );", "@FormUrlEncoded\n @POST(\"api/Daftar/tambah\")\n Call<UserModel> daftarUser(@Field(\"nama\") String nama,\n @Field(\"identitas\") String identitas,\n @Field(\"email\") String email,\n @Field(\"password\") String password,\n @Field(\"token_firebase\") String token_firebase);", "public Result showSignUp() {\n return ok(signupView.render(data().build(), signUpForm));\n }", "private void register(String username,String password){\n\n }", "@PostMapping(\"/register\")\n public String saveUser(@ModelAttribute User user){\n return \"redirect:login\";\n }", "User registration(User user);", "public UserAuthToken createUser(CreateUserRequest request);", "@Test\n\tpublic void registerUserTest5() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.ofNullable(null));\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(500));\n\t}", "private void signUp() {\n final String email = ((EditText) findViewById(R.id.etSignUpEmail))\n .getText().toString();\n final String password = ((EditText) findViewById(R.id.etSignUpPassword))\n .getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:success\");\n sendVerificationEmail(mAuth.getCurrentUser());\n updateUI();\n } else {\n Log.d(\"SIGN_UP_USER\", \"createUserWithEmail:failure\");\n Toast.makeText(LoginActivity.this,\n \"Failed to create a new user.\",\n Toast.LENGTH_LONG).show();\n }\n }\n });\n }", "private void setupEndpoints() {\n\t\tpost(API_CONTEXT + \"/users\", \"application/json\", (request, response) -> {\n\t\t\t//response.status(201);\n\t\t\treturn userService.createNewUser(request.body());\n\t\t}, new JsonTransformer());\n\t\t\n\t\tpost(API_CONTEXT + \"/login\", \"application/json\", (request, response) -> {\n\t\t\t//response.status(201);\n\t\t\treturn userService.find(request.body());\n\t\t}, new JsonTransformer());\n\t\t\n\t\tput(API_CONTEXT + \"/users\", \"application/json\", (request, response)\n\t\t\t\t-> userService.update(request.body()), new JsonTransformer());\n\t\t\n\t\tdelete(API_CONTEXT + \"/users/:email\", \"application/json\", (request, response)\n\t\t\t\t-> userService.deleteUser(request.params(\":email\")), new JsonTransformer());\n\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response) throws ServletException, IOException {\r\n \r\n String path = request.getPathInfo();\r\n if (path.equals(\"/signup\")) {\r\n \r\n String name = request.getParameter(\"name\");\r\n String email = request.getParameter(\"email\");\r\n String login = request.getParameter(\"login\");\r\n String password= request.getParameter(\"password\");\r\n \r\n User user = new User(login, password, name, email, false, false);\r\n \r\n BCryptPassword bcrypt = new BCryptPassword(user.getPassword());\r\n loginService.putUser(user.getLogin(), bcrypt, User.ROLES);\r\n \r\n MongoDB.store(user);\r\n response.sendRedirect(\"/login\");\r\n }\r\n }", "public interface UserApi {\n\n\n @GET(\"/user/\")\n User getUser(@Query(\"username\") String username);\n\n @POST(\"/user/\")\n User login(@Query(\"username\") String username, @Query(\"password\") String password);\n\n}", "@Override\n @RequestMapping(method= RequestMethod.POST, value=\"/staff/signup\")\n protected @ResponseBody ResponseEntity signUp(@RequestBody Staff user) {\n return super.signUp(user);\n }", "String registerUser(User user);", "public void signup() {\n Log.d(TAG, \"Signup\");\n\n if (!validate()) {\n onSignupFailed();\n return;\n }\n\n createProgressDialog(R.string.creating_account);\n\n final String name = _nameText.getText().toString();\n final String email = _emailText.getText().toString();\n final String password = _passwordText.getText().toString();\n\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n // If sign in fails, display a message to the user. If sign in succeeds\n // the auth state listener will be notified and logic to handle the\n // signed in user can be handled in the listener.\n if (!task.isSuccessful()) {\n createToast(R.string.authentication_failed, Toast.LENGTH_SHORT);\n } else {\n progressDialog.dismiss();\n final FirebaseUser user = mAuth.getCurrentUser();\n mDatabase.child(\"users\").child(user.getUid()).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.getValue() == null) {\n createUserInFirebase(name, email, user.getUid());\n }\n }\n @Override\n public void onCancelled(DatabaseError databaseError) {\n\n }\n });\n sendToTrivia();\n }\n\n }\n });\n\n\n new android.os.Handler().postDelayed(\n new Runnable() {\n public void run() {\n // On complete call either onSignupSuccess or onSignupFailed\n // depending on success\n progressDialog.dismiss();\n }\n }, 3000);\n }", "public SignUpController(SignupForm signup){\r\n this.signup = signup;\r\n }", "public interface RegisterService {\n @POST(\"register.php\")\n Call<RegisterResponse>getRegisterResponse(@Body RegisterForm registerForm);\n}", "public static void signup() throws Exception{\n\t\trender();\n\t}", "private void configureSignup() {\n\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(this.getResources().getString(R.string.web_client_id))\n .requestEmail().build();\n\n // Build a GoogleApiClient with access to GoogleSignIn.API and the options above.\n mGoogleApiClient = new GoogleApiClient.Builder(this)\n .enableAutoManage(this /* FragmentActivity */, this /* OnConnectionFailedListener */)\n .addApi(Auth.GOOGLE_SIGN_IN_API, gso)\n .build();\n\n\n mGoogleApiClient.connect();\n }", "@Test\n public void whenFetchingExistingUserReturn200() throws Exception {\n UserRegistrationRequestDTO request = getSampleRegistrationRequest();\n long userId = api.registerUser(request).execute().body();\n\n // when fetching user details\n Response<UserDTO> response = api.getUserDetails(userId).execute();\n\n // then http status code should be ok\n assertThat(response.code(), is(200));\n\n // and user should have a matching name\n assertThat(response.body().fullName, is(request.fullName));\n }", "@PostMapping(\"/users\")\n public User createUser(@RequestBody User user){\n return service.addAUser(user);\n\n }", "@RequestMapping(value = \"/restaurantSignup\", method = RequestMethod.POST)\n\t\tpublic ModelAndView signUp(Model model) {\n\t\t\t\n\t\t\t\t\treturn new ModelAndView(\"Signup\", \"command\", new Restaurants());\n\t\t}", "@RequestMapping(value = \"/signup\", method = RequestMethod.POST)\n\tpublic String signup(HttpServletRequest request, Model model) {\n\t\tString username = request.getParameter(\"username\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString verify = request.getParameter(\"verify\"); //uses verification from template \"signup.html\"\n\t\t\n\t\t//if passwords don't match, returns an error message\n\t\tif(!password.equals(verify)){\n\t\t\tmodel.addAttribute(\"verify_error\", \"The passwords do not match.\");\n\t\t\tmodel.addAttribute(\"username\", username);\n\t\t\treturn \"signup\";\n\t\t}\n\t\t\n\t\telse {\n\t\t\t\n\t\t//if user name does not follow parameters, returns an error message\n\t\tif(!User.isValidUsername(username)){ \n\t\t\t model.addAttribute(\"username_error\", \"Invalid username.\");\n\t\t\t model.addAttribute(\"username\", username);\n\t\t\t return \"signup\";\n\t\t }\n\t\t\n\t\t //if password doesn't fall within the prescribed parameters, returns an error message \n\t\t else if(!User.isValidPassword(password)){ \n\t\t\t model.addAttribute(\"password_error\",\"Invalid password.\");\n\t\t\t model.addAttribute(\"username\", username);\n\t\t\t return \"signup\";\n\t\t } else { //if everything works as it should, it creates a new user\n\t\t\n\t\tUser newUser = new User(username, password);\n\t\tuserDao.save(newUser);\n\t\tHttpSession thisSession = request.getSession();\n\t\tthis.setUserInSession(thisSession, newUser);\n\t\treturn \"redirect:librarian/newentry\";\n\t\t}\n\t}\n\t}", "@GetMapping(\"/addUser\")\n public String home() {\n User user = new User();\n user.setUserName(\"Gitika\");\n user.setPassword(passwordEncoder.encode(\"saurabh321\"));\n user.setActive(true);\n user.setRoles(\"Role_Admin\");\n userRepository.save(user);\n return \"User created successfully\";\n }", "@Test\n\tpublic void registerUserTest7() throws Exception {\n\t\tSignUpRequest signUpRequest = new SignUpRequest(\"Marko\", \"Troskot\", \"MTro\", \"[email protected]\", \"pass123\", \"pass123\");\n\n\t\tMockito.when(userService.existsByUsername(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tMockito.when(userService.existsByEmail(ArgumentMatchers.anyString())).thenReturn(false);\n\t\tRole role = new Role();\n\t\trole.setType(RoleType.USER);\n\t\tMockito.when(roleService.findByType(ArgumentMatchers.any(RoleType.class))).thenReturn(Optional.of(role));\n\t\tUser user = new User();\n\t\tMockito.when(userService.save(ArgumentMatchers.any(User.class), ArgumentMatchers.anyBoolean())).thenReturn(user);\n\n\t\tmockMvc.perform(post(\"/api/auth/signup\").contentType(MediaType.APPLICATION_JSON).content(objectMapper.writeValueAsString(signUpRequest)).characterEncoding(\"UTF-8\"))\n\t\t\t\t.andDo(print()).andExpect(status().is(201)).andExpect(content().json(objectMapper.writeValueAsString(user)));\n\t}", "@PostMapping(\"/addAcc\")\n public userAccount setUserAccount(@RequestBody userAccount account) {\n// System.out.println(\"Email:\"+account.getEmail());\n// System.out.println(\"username:\"+account.getUsername());\n// System.out.println(\"pass:\"+account.getPassword());\n return this.accountRepo.save(account);\n// return null;\n }", "@RequestMapping(value = \"/signup/member\", method = RequestMethod.POST)\n @ResponseBody\n public SPResponse signupMember(@Valid UserProfileForm userProfileForm,\n @Valid AddressForm addressForm, @Valid PasswordForm password,\n @RequestParam(required = false) String token, BindingResult bindingResult,\n HttpSession session, HttpServletResponse httpServletResponse) {\n \n SPResponse resp = new SPResponse();\n \n if (bindingResult.hasErrors()) {\n addBindingErrors(bindingResult, resp);\n return resp;\n }\n \n SPResponse response = ControllerHelper.doProcess(signupHelper::signupMember, userProfileForm,\n addressForm, password.getPassword(), session, token);\n return response;\n \n }", "@Override\r\n\tpublic void postRequest(Request request, Response response) {\r\n\t\tcreateUser(request, response);\r\n\t}", "@GetMapping(\"/registration\")\n\t public String registration(Model model) {\n\t model.addAttribute(\"userForm\", new User());\n\t return \"registration\";\n\t }", "public int signUp(RestaurantDetails details);", "private void RegisterGoogleSignup() {\n\n\t\ttry {\n\t\t\tLocalData data = new LocalData(SplashActivity.this);\n\n\t\t\tArrayList<String> asName = new ArrayList<String>();\n\t\t\tArrayList<String> asValue = new ArrayList<String>();\n\n\t\t\tasName.add(\"email\");\n\t\t\tasName.add(\"firstname\");\n\t\t\tasName.add(\"gender\");\n\t\t\tasName.add(\"id\");\n\t\t\tasName.add(\"lastname\");\n\t\t\tasName.add(\"name\");\n\t\t\t// asName.add(\"link\");\n\n\t\t\tasName.add(\"device_type\");\n\t\t\tasName.add(\"device_id\");\n\t\t\tasName.add(\"gcm_id\");\n\t\t\tasName.add(\"timezone\");\n\n\t\t\tasValue.add(data.GetS(LocalData.EMAIL));\n\t\t\tasValue.add(data.GetS(LocalData.FIRST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.GENDER));\n\t\t\tasValue.add(data.GetS(LocalData.ID));\n\t\t\tasValue.add(data.GetS(LocalData.LAST_NAME));\n\t\t\tasValue.add(data.GetS(LocalData.NAME));\n\t\t\t// asValue.add(data.GetS(LocalData.LINK));\n\n\t\t\tasValue.add(\"A\");\n\n\t\t\tString android_id = Secure\n\t\t\t\t\t.getString(SplashActivity.this.getContentResolver(),\n\t\t\t\t\t\t\tSecure.ANDROID_ID);\n\n\t\t\tasValue.add(android_id);\n\n\t\t\tLocalData data1 = new LocalData(SplashActivity.this);\n\t\t\tasValue.add(data1.GetS(\"gcmId\"));\n\t\t\tasValue.add(Main.GetTimeZone());\n\t\t\tString sURL = StringURLs.getQuery(StringURLs.GOOGLE_LOGIN, asName,\n\t\t\t\t\tasValue);\n\n\t\t\tConnectServer connectServer = new ConnectServer();\n\t\t\tconnectServer.setMode(ConnectServer.MODE_POST);\n\t\t\tconnectServer.setContext(SplashActivity.this);\n\t\t\tconnectServer.setListener(new ConnectServerListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onServerResponse(String sJSON, JSONObject jsonObject) {\n\t\t\t\t\t// TODO Auto-generated method stub\n\n\t\t\t\t\tLog.d(\"JSON DATA\", sJSON);\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tif (sJSON.length() != 0) {\n\t\t\t\t\t\t\tJSONObject object = new JSONObject(sJSON);\n\t\t\t\t\t\t\tJSONObject response = object\n\t\t\t\t\t\t\t\t\t.getJSONObject(JSONStrings.JSON_RESPONSE);\n\t\t\t\t\t\t\tString sResult = response\n\t\t\t\t\t\t\t\t\t.getString(JSONStrings.JSON_SUCCESS);\n\n\t\t\t\t\t\t\tif (sResult.equalsIgnoreCase(\"1\") == true) {\n\n\t\t\t\t\t\t\t\tString user_id = response.getString(\"userid\");\n\n\t\t\t\t\t\t\t\tLocalData data = new LocalData(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this);\n\t\t\t\t\t\t\t\tdata.Update(\"userid\", user_id);\n\t\t\t\t\t\t\t\tdata.Update(\"name\", response.getString(\"name\"));\n\n\t\t\t\t\t\t\t\tGetNotificationCount();\n\n\t\t\t\t\t\t\t} else if (sResult.equalsIgnoreCase(\"0\") == true) {\n\n\t\t\t\t\t\t\t\tString msgcode = jsonObject.getJSONObject(\n\t\t\t\t\t\t\t\t\t\t\"response\").getString(\"msgcode\");\n\n\t\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, msgcode),\n\t\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (Exception exp) {\n\n\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\tSplashActivity.this,\n\t\t\t\t\t\t\t\tMain.getStringResourceByName(\n\t\t\t\t\t\t\t\t\t\tSplashActivity.this, \"c100\"),\n\t\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tconnectServer.execute(sURL);\n\n\t\t} catch (Exception exp) {\n\n\t\t\tToast.makeText(SplashActivity.this,\n\t\t\t\t\tMain.getStringResourceByName(SplashActivity.this, \"c100\"),\n\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t}\n\t}", "@RequestMapping(value = \"/signup/business/assisted/account\", method = RequestMethod.POST)\n @ResponseBody\n public SPResponse signupAssistedAccount(@Valid SignupAssistedAccountForm assistedForm) {\n SPResponse resp = new SPResponse();\n try {\n boolean success = signupHelper.signupAssisted(signupForm, assistedForm);\n if (!success) {\n resp.addError(\"SP_ASSISTED_SIGNUP_ERROR\", \"Could not signup account !!!\");\n } else {\n resp.isSuccess();\n }\n } catch (SPException e) {\n LOG.warn(\"Could not sign up account !!!\", e);\n resp.addError(e);\n }\n return resp;\n }", "@Test\n public void createUser() {\n Response response = regressionClient.createUser();\n dbAssist.responseValidation(response);\n }", "public interface RegisterAPI {\n\n @FormUrlEncoded\n @POST(\"android/restfull/insert.php\")\n Call<Value> daftar(@Field(\"kode\") String kode,\n @Field(\"nama\") String nama,\n @Field(\"harga\") String harga);\n\n @GET(\"android/restfull/view.php\")\n Call<Value> view();\n\n @FormUrlEncoded\n @POST(\"android/restfull/update.php\")\n Call<Value> ubah(@Field(\"kode\") String kode,\n @Field(\"nama\") String nama,\n @Field(\"harga\") String harga);\n\n\n @FormUrlEncoded\n @POST(\"android/restfull/delete.php\")\n Call<Value> hapus(@Field(\"kode\") String kode);\n\n @FormUrlEncoded\n @POST(\"android/restfull/search.php\")\n Call<Value> search(@Field(\"search\") String search);\n}", "private void registerCSRFUser() {\n\n RestAssured.given()\n .when()\n .relaxedHTTPSValidation()\n .formParam(\"username\", \"csrf-\" + this.getUser())\n .formParam(\"password\", \"password\")\n .formParam(\"matchingPassword\", \"password\")\n .formParam(\"agree\", \"agree\")\n .post(url(\"register.mvc\"));\n\n }", "@PostMapping(\"/registration\")\n\t public String registration(@ModelAttribute(\"userForm\") User userForm, BindingResult bindingResult,Model model) {if (bindingResult.hasErrors()) {\n\t return \"registration\";\n\t }\n\t userService.save(userForm);\n\t localUsername=userForm.getUsername();\n\t boolean flag=userService.autoLogin(userForm.getUsername(), userForm.getPasswordConfirm());\n\t model.addAttribute(\"expense\", expenseService.getMonthAndYearAndAmount());\n\t model.addAttribute(\"username\",userForm.getUsername());\n\t return \"redirect:/dashboard\";\n\t }", "@GetMapping(\"/registration\")\n public String registration(Model model) {\n \t\n model.addAttribute(\"userForm\", new User());\n\n return \"registration\";\n }", "public void updateUser(View view) {\n fullName = (EditText) findViewById(R.id.edit_user_fullName);\n email = (EditText) findViewById(R.id.edit_user_email);\n password = (EditText) findViewById(R.id.edit_user_password);\n\n try {\n Request request = new Request.Builder()\n .url(\"https://events-api-81942.herokuapp.com/eventsavvy-api/main/signup/\"+fullName.getText()+\"/\"+email.getText()+\"/\"+username+\"/\"+password.getText()+\"/\")\n .build();\n\n client.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n e.printStackTrace();\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n try (ResponseBody responseBody = response.body()) {\n if (!response.isSuccessful())\n throw new IOException(\"Unexpected code \" + response);\n\n Headers responseHeaders = response.headers();\n for (int i = 0, size = responseHeaders.size(); i < size; i++) {\n System.out.println(responseHeaders.name(i) + \": \" + responseHeaders.value(i));\n }\n\n System.out.println(responseBody.string());\n Intent intent = new Intent(getApplicationContext(), SettingsActivity.class);\n startActivity(intent);\n }\n }\n });\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n\n }", "@GetMapping\n public String onRegistration() {\n return \"registration\";\n }", "public interface INetService {\n String baseUrl = \"https://app.netease.im/api/\";\n\n /**\n * 注册\n * @param username\n * @param nickname\n * @param pwd\n * @return\n */\n @POST(\"createDemoUser\")\n Flowable<BaseModel<String>> createUser(@Query(\"username\") String username,\n @Query(\"nickname\") String nickname,\n @Query(\"password\") String pwd);\n\n\n}", "@RequestMapping(value = \"/signup/individual/account\", method = RequestMethod.POST)\n @ResponseBody\n public SPResponse signupIndividualAccount(@Valid SignupAccountForm accountForm,\n HttpServletRequest request) {\n SPResponse resp = new SPResponse();\n try {\n boolean success = signupHelper\n .signupIndividual(signupForm, addressForm, accountForm, request);\n if (!success) {\n resp.addError(\"SP_INDIVIDUAL_SIGNUP_ERROR\", \"Could not signup account !!!\");\n } else {\n resp.isSuccess();\n }\n } catch (SPException e) {\n LOG.warn(\"Could not sign up account !!!\", e);\n resp.addError(e);\n } catch (Exception e) {\n LOG.warn(\"Could not sign up account !!!\", e);\n resp.addError(new SPException(e));\n }\n return resp;\n }", "@POST(\"/api/users\")\n public void addUser(@Body User User,Callback<User> callback);", "@PostMapping(\"register\")\n\tpublic UserInfo registerUser(@RequestBody Profile profile) {\n\t\treturn userService.registerUser(profile);\n\t}", "@Override\n\tpublic int signup(MemberVO member) {\n\t\treturn mapper.signup(member);\n\t}", "@RequestMapping(\"/signup\")\r\n\tpublic ModelAndView signups(HttpServletRequest request,HttpServletResponse response) {\r\n\tModelAndView mv= new ModelAndView();\r\n\t\t\r\n\t\tmv.setViewName(\"signup\");\r\n\r\n\t\treturn mv;\r\n\t}", "@Test\n\tpublic void validateAddedUser() throws Exception {\n\t\tmockMvc.perform(\n\t\t\t\tget(\"/secure/user/{username}\", \"username1\").accept(\n\t\t\t\t\t\tMediaType.APPLICATION_JSON)).andDo(print())\n\t\t\t\t.andExpect(status().isOk())\n\t\t\t\t.andExpect(content().contentType(\"application/json\"))\n\t\t\t\t.andExpect(jsonPath(\"username\").value(\"username1\"));\n\n\t}" ]
[ "0.686044", "0.6850581", "0.6780019", "0.6739688", "0.6532104", "0.6527675", "0.6523384", "0.64493364", "0.6420643", "0.6398363", "0.636201", "0.6356909", "0.6340942", "0.63184255", "0.63052076", "0.62917304", "0.6279441", "0.6228014", "0.6203716", "0.61845404", "0.6158573", "0.6139647", "0.61241376", "0.6123135", "0.6114012", "0.61083364", "0.6105615", "0.60991204", "0.6083779", "0.6076761", "0.6072362", "0.60653746", "0.60569274", "0.6053277", "0.60485023", "0.6040205", "0.6039455", "0.6034143", "0.60258603", "0.6022965", "0.6021697", "0.599049", "0.59901506", "0.59689593", "0.59551924", "0.59508693", "0.5946069", "0.5942143", "0.5939587", "0.5928949", "0.59225273", "0.5911329", "0.5906846", "0.58949006", "0.5878869", "0.5871536", "0.5869664", "0.5868834", "0.58611506", "0.58571184", "0.5844694", "0.5830359", "0.582706", "0.5824721", "0.5822566", "0.5820171", "0.5814545", "0.5812503", "0.5797264", "0.5794663", "0.57946146", "0.57932884", "0.5784757", "0.57816267", "0.57770956", "0.5766455", "0.57657194", "0.576495", "0.57617116", "0.5761049", "0.5758473", "0.5755487", "0.57484764", "0.5744567", "0.57375014", "0.5733985", "0.5730287", "0.5725407", "0.5722296", "0.5721228", "0.57209384", "0.57078004", "0.5703642", "0.5703306", "0.5699431", "0.5692458", "0.5691102", "0.56810135", "0.56801945", "0.5676591" ]
0.6992043
0
TODO Autogenerated method stub
public static void main(String[] args) throws Exception { ItemMap items = new ItemMap(); OrderSet orders = new OrderSet(); CustomerList customers = new CustomerList(); SharedObject so = new SharedObject(); Manager.populateItemMap(items, "items.csv"); Manager.populateOrderSet(orders, customers, "existingCustomerOrders.csv"); CafeModel cafe = new CafeModel(orders, items, customers); ArrayList<ArrayList<String>> allOrders = Manager.indexOrders(orders, customers, items); System.out.println("Foo123 price: " + items.getPrice("DRINK206")); CafeGUIView gui = new CafeGUIView(orders, customers, items, so); CafeGUIController controller = new CafeGUIController(gui, so); QueueManager q = new QueueManager(so, orders, cafe, customers, items, controller); Thread producerThread = new Thread(q); producerThread.start(); Server serverOne = new Server(so, gui, 1); Thread consumerThreadOne = new Thread(serverOne); consumerThreadOne.start(); Server serverTwo = new Server(so, gui, 2); Thread consumerThreadTwo = new Thread(serverTwo); consumerThreadTwo.start(); NewOrderMgr newOrderManager = new NewOrderMgr(so, orders, customers, gui, items); Thread newOrderThread = new Thread(newOrderManager); newOrderThread.start(); Log.getInstance(); Log.Log(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.66708666", "0.65675074", "0.65229905", "0.6481001", "0.64770633", "0.64584893", "0.6413091", "0.63764185", "0.6275735", "0.62541914", "0.6236919", "0.6223816", "0.62017626", "0.61944294", "0.61944294", "0.61920846", "0.61867654", "0.6173323", "0.61328775", "0.61276996", "0.6080555", "0.6076938", "0.6041293", "0.6024541", "0.6019185", "0.5998426", "0.5967487", "0.5967487", "0.5964935", "0.59489644", "0.59404725", "0.5922823", "0.5908894", "0.5903041", "0.5893847", "0.5885641", "0.5883141", "0.586924", "0.5856793", "0.58503157", "0.58464456", "0.5823378", "0.5809384", "0.58089525", "0.58065355", "0.58065355", "0.5800514", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57912874", "0.57896614", "0.5789486", "0.5786597", "0.5783299", "0.5783299", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5773351", "0.5760369", "0.5758614", "0.5758614", "0.574912", "0.574912", "0.574912", "0.57482654", "0.5732775", "0.5732775", "0.5732775", "0.57207066", "0.57149917", "0.5714821", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57132614", "0.57115865", "0.57045746", "0.5699", "0.5696016", "0.5687285", "0.5677473", "0.5673346", "0.56716853", "0.56688815", "0.5661065", "0.5657898", "0.5654782", "0.5654782", "0.5654782", "0.5654563", "0.56536144", "0.5652585", "0.5649566" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Stream<String> strings = streamSection(nextStream(), 1, 3); System.out.println("**********************"); strings.forEach(System.out::println); Stream<String> strings2 = streamSection(nextStream(), 0, 5); System.out.println("**********************"); strings2.forEach(System.out::println); Stream<String> strings3 = streamSection(nextStream(), 2, 4); System.out.println("**********************"); strings3.forEach(System.out::println); }
{ "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
recuperation des id deja traites (enregistrer sous forme de nom de fichiers vides)
@Override public void process(Exchange exchange) throws Exception { File envoyeDirectory = new File("envoye"); String[] fileNames = envoyeDirectory.list(); LOG.debug("Liste de messages envoyés : {}", fileNames); if (fileNames == null) { fileNames = new String[1]; LOG.debug("initialisation du cache de fichiers traités à vide, premier lancement"); } exchange.getIn().setHeader("fileNames", fileNames); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setId_trimestre(int id_trimestre) {this.id_trimestre = id_trimestre;}", "public int getIden() {\n return iden;\n }", "public int getId() {\n // some code goes here\n \treturn m_f.getAbsoluteFile().hashCode();\n }", "public long getDossierId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "public int getIdReceta() {\r\n return idReceta;\r\n }", "public int getId() {\n // some code goes here\n return f.getAbsoluteFile().hashCode();\n //throw new UnsupportedOperationException(\"implement this\");\n }", "public int getIdRichiesta() {\n return idRichiesta;\n }", "public int getId_docente() {\n return id_docente;\n }", "public int getId()\r\n/* 53: */ {\r\n/* 54: 79 */ return this.idDetalleComponenteCosto;\r\n/* 55: */ }", "public long getIdSejour(){\n\t\treturn idSejour;\n\t}", "public void setIdLocacion(Integer idLocacion);", "public int getIdfilial(){\r\n return idfilial;\r\n }", "@Override\n\tpublic int getId() {\n\t\treturn _keHoachKiemDemNuoc.getId();\n\t}", "public Edificio( String id )\n {\n identificador = id;\n salones = new ArrayList<Salon>( );\n }", "public void setId(int idNuevo)\n { \n this.id = idNuevo;\n }", "public void setIdRichiesta(int idRichiesta) {\n this.idRichiesta = idRichiesta;\n }", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "public int getId() {\n // some code goes here\n int id = f.getAbsoluteFile().hashCode();\n //System.out.println(id);\n return id;\n }", "public int getIdDetalle_Ventaf() {\n return idDetalle_Ventaf;\n }", "@Override\n\tpublic int getId(){\n\t\treturn id;\n\t}", "java.lang.String getID();", "public java.lang.String getIdFiche(){\r\n return this.idFiche;\r\n }", "public void setIdDetalle_Ventaf(int idDetalle_Ventaf) {\n this.idDetalle_Ventaf = idDetalle_Ventaf;\n }", "public void getIdForDel(int rID, int fID, int vID){\n recipeID = rID;\n foodID = fID;\n vitaminID = vID;\n }", "public Integer getIdLocacion();", "public int getId()\r\n/* 75: */ {\r\n/* 76:110 */ return this.idAutorizacionDocumentoPuntoDeVentaAutoimpresorSRI;\r\n/* 77: */ }", "@Override\n public long getPartidoId() {\n return _partido.getPartidoId();\n }", "@Override\r\n public int getId() {\n return id;\r\n }", "public void initialiserListeRdvReference(int idEleve){\r\n\r\n\t\tKlisteRdvBDD.loadFromDb(BDD.db,\"select * from assurer_lecon where idELEVE = \"+idEleve+\" order by idAgenda asc\");\r\n\t\t\r\n\t\tKlisteRdvAgenda.loadFromDb(BDD.db,\"select * from agenda where id in (select idAgenda from assurer_lecon where ideleve =\"+idEleve+\") \" +\r\n\t\t\t\t\"order by id asc\");\r\n\t}", "public Long getIdVieSociale() {\r\n\t\treturn idVieSociale.get();\r\n\t}", "public void setIdfilial(int idfilial){\r\n this.idfilial = idfilial;\r\n }", "public void asignarID(Object id) {\n\n propiedad temporal;\n for (int i = 0; i < this.listadoElementos.size(); i++) {\n temporal = listadoElementos.get(i);\n if (temporal instanceof propiedadId) {\n propiedadId v = (propiedadId) temporal;\n if (!id.toString().equalsIgnoreCase(\"\")) {\n v.idElemento = id.toString();\n this.listadoElementos.set(i, v);\n break;\n\n }\n }\n }\n \n propiedadId n =new propiedadId(id);\n this.listadoElementos.add(n);\n }", "private static void idVorhanden() {\n\t\tLinkedHashSet<String> genre = new LinkedHashSet<String>();\t\t\t// benötigt, um duplikate von genres zu entfernen\n\t\tLinkedHashSet<String> darsteller = new LinkedHashSet<String>();\t\t// benötigt, um duplikate von darstellern zu entfernen\n\t\tString kinofilm = \"\";\t\t\t\t\t\t\t\t\t\t\t\t// benötigt für die Ausgabe des Filmtitels und Jahr\n\t\t\n\t\tsetSql(\"SELECT g.GENRE, m.TITLE, m.YEAR, mc.CHARACTER, p.NAME from Movie m JOIN MOVgen MG ON MG.MOVIEID = M.MOVIEID right JOIN GENRE G ON MG.GENREID = G.GENREID\\n\"\n\t\t\t\t\t+ \"\t\t\t\tright JOIN MOVIECHARACTER MC ON M.MOVIEID = MC.MOVIEID JOIN PERSON P ON MC.PERSONID = P.PERSONID\\n\"\n\t\t\t\t\t+ \"\t\t\t\tWHERE M.MOVIEID = \" + movieID);\t// SQL Abfrage, um Genre, Title, Year, Character und Name eines Films zu bekommen\n\t\t\n\t\tsqlAbfrage();\t\t\t\t\t\t\t\t\t// SQL Abfrage ausführen und Ergebnis im ResultSet speichern\n\t\t\n\t\ttry {\n\t\t\n\t\t\tif(!rs.next()) {\t\t\t\t\t\t\t// prüfe, ob das ResultSet leer ist\n\t\t\t\tSystem.out.println();\n\t\t\t\tSystem.out.println(\"MovieID ungültig. Bitte eine der folgenden MovieID's angeben: \"); // Meldung ausgeben, dass ID ungültig ist\n\t\t\t\tidProblem();\t\t\t\t\t\t\t// wenn movieID nicht vorhanden, führe idProblem() aus, um mögliche Filme anzuzeigen\n\t\t\t} else {\n\t\t\t\trs.isBeforeFirst();\t\t\t\t\t\t// Durch die if-Abfrage springt der Cursor des ResultSets einen weiter und muss zurück auf die erste Stelle\n\t\t\t\twhile (rs.next()) {\t\t\t\t\t\t// Zeilenweises durchgehen des ResultSets \"rs\"\n\t\t\t\t\t/*\n\t\t\t\t\t * Aufbau des ResultSets \"rs\":\n\t\t\t\t\t * eine oder mehrere Zeilen mit folgenden Spalten:\n\t\t\t\t\t * GENRE | TITLE | YEAR | CHARACTER | NAME\n\t\t\t\t\t * (1) (2) (3) (4) (5)\n\t\t\t\t\t */\n\t\t\t\t\tgenre.add(rs.getString(1));\t\t\t\t\t\t\t\t\t\t\t// speichern und entfernen der Duplikate der Genres in \"genre\"\n\t\t\t\t\tkinofilm = (rs.getString(2) + \" (\" + rs.getString(3) + \")\");\t\t// Speichern des Filmtitels und des Jahrs in \"kinolfilm\"\n\t\t\t\t\tdarsteller.add(rs.getString(4) + \": \" + rs.getString(5));\t\t\t// speichern und entfernen der Duplikate der Darsteller in \"darsteller\"\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t * Zur besseres Ausgabe, werden die LinkedHashSets in ArrayLists übertragen\n\t\t\t\t * Grund: Es ist nicht möglich auf einzelne, bestimmte Elemente des HashSets zuzugreifen.\n\t\t\t\t * Bedeutet: HashSet.get(2) existiert nicht, ArrayList.get(2) existiert.\n\t\t\t\t */\n\t\t\t\tArrayList<String> genreArrayList = new ArrayList<String>();\n\t\t\t\t\tfor (String s : genre) {\n\t\t\t\t\t\tgenreArrayList.add(s);\n\t\t\t\t\t}\n\n\t\t\t\tArrayList<String> darstellerArrayList = new ArrayList<String>();\n\t\t\t\t\tfor (String s : darsteller) {\n\t\t\t\t\t\tdarstellerArrayList.add(s);\n\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Ausgabe der Kinofilm Daten nach vorgegebenen Format:\n\t\t\t\t\t\t\t * \n\t\t\t\t\t\t\t * Kinofilm: Filmtitel (Year)\n\t\t\t\t\t\t\t * Genre: ... | ... | ..\n\t\t\t\t\t\t\t * Darsteller:\n\t\t\t\t\t\t\t * Character: Name\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\t\t\t// erzeugt Leerzeile\n\t\t\t\t\t\t\tSystem.out.println(\"Kinofilme: \" + kinofilm);\t\t// Ausgabe: Kinofilm: Filmtitel (Year)\n\t\t\t\t\t\t\tSystem.out.print(\"Genre: \" + genreArrayList.get(0)); // Ausgabe des ersten Genres, vermeidung des Zaunpfahlproblems\n\n\t\t\t\t\t\t\tfor (int i = 1; i < genreArrayList.size(); i++) {\t\t// Ausgabe weiterer Genres, solange es weitere Einträge in\t\n\t\t\t\t\t\t\t\tSystem.out.print(\" | \" + genreArrayList.get(i)); \t// der ArrayList \"genreArrayList\" gibt\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tSystem.out.println();\t\t\t\t\t\t\t\t// erzeugt Leerzeile\n\t\t\t\t\t\t\tSystem.out.println(\"Darsteller:\");\t\t\t\t\t// Ausgabe: Darsteller:\n\t\t\t\t\t\t\tfor (int i = 0; i < darstellerArrayList.size(); i++) {\t// Ausgabe der Darsteller, solange es\n\t\t\t\t\t\t\t\tSystem.out.println(\" \" + darstellerArrayList.get(i));\t// Darsteller in der \"darstellerArrayList\" gibt\n\t\t\t\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tSystem.out.println(e); // Ausgabe Fehlermeldung\n\t\t}\n\t}", "public int getId()\r\n/* 208: */ {\r\n/* 209:381 */ return this.idCargaEmpleado;\r\n/* 210: */ }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "public int getId_anneeScolaire() {return id_anneeScolaire;}", "public int getId(){\r\n\t\treturn id;\r\n\t}", "public int getId(){\r\n\t\treturn id;\r\n\t}", "public long getIdCargaTienda();", "@Override\n\tpublic int getId() {\n\t\treturn id;\n\t}" ]
[ "0.62557757", "0.62026167", "0.61991775", "0.617723", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61413735", "0.61097234", "0.6095258", "0.6089454", "0.6085338", "0.6079833", "0.60562277", "0.60513765", "0.6043011", "0.6021711", "0.60170937", "0.5995104", "0.5991708", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5984158", "0.5977273", "0.59629977", "0.5961069", "0.594387", "0.5897212", "0.58898604", "0.58898556", "0.5870958", "0.5863024", "0.58528167", "0.58397746", "0.58372766", "0.5828253", "0.5820652", "0.58201927", "0.579459", "0.5788205", "0.57856375", "0.5771205", "0.57706505", "0.57706505", "0.5764919", "0.57619894" ]
0.0
-1
Created by chentuanhui on 2016/9/23.
public interface BookService { //order:bydefault //http://api2.qingting.fm/v6/media/categories/527/channels/order/bydefault/0/attr/855/curpage/1/pagesize/30 @GET("v6/media/categories/527/channels/order/{order}/0/attr/{id}/curpage/{curpage}/pagesize/{pagesize}") Observable<BookResult> getBookList(@Header("Cache-Control") String cacheControl, @Path("order") String order, @Path("id") int id, @Path("curpage") int curpage, @Path("pagesize") int pagesize); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void nadar() {\n\t\t\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 public void settings() {\n // TODO Auto-generated method stub\n \n }", "private void poetries() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n public void func_104112_b() {\n \n }", "private void init() {\n\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n void init() {\n }", "private void kk12() {\n\n\t}", "@Override\n public void init() {\n }", "public void mo38117a() {\n }", "public void mo4359a() {\n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "private void strin() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\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\tpublic void einkaufen() {\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public final void mo51373a() {\n }", "@Override\n public void initialize() { \n }", "Petunia() {\r\n\t\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "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 afterInit() {\n\t\t\n\t}", "@Override\n\tpublic void afterInit() {\n\t\t\n\t}", "private void init() {\n\n\n\n }", "public void mo6081a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\n public void init() {}", "@Override\n protected void init() {\n }", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "private void m50366E() {\n }", "@Override\r\n\tpublic void init() {}" ]
[ "0.6158929", "0.60614836", "0.59614855", "0.58734775", "0.58602744", "0.5852098", "0.5852098", "0.58503354", "0.58432955", "0.5773304", "0.5771686", "0.57495964", "0.57476884", "0.5746606", "0.5731063", "0.5719766", "0.5701703", "0.5698854", "0.5698854", "0.56708443", "0.56550074", "0.5653375", "0.5648079", "0.5646568", "0.56359273", "0.5615918", "0.55893445", "0.55857426", "0.558433", "0.558433", "0.558433", "0.558433", "0.558433", "0.55659074", "0.5558174", "0.5551674", "0.5537165", "0.553119", "0.5525704", "0.5525271", "0.55251586", "0.55229163", "0.5521098", "0.5521098", "0.551554", "0.551554", "0.551554", "0.54975814", "0.54975814", "0.5494801", "0.5491522", "0.5489186", "0.5489186", "0.5489186", "0.5489186", "0.5489186", "0.5489186", "0.54878837", "0.54820794", "0.5478727", "0.547738", "0.5474", "0.5474", "0.5474", "0.5470556", "0.5467911", "0.5457979", "0.54455763", "0.5440754", "0.54389954", "0.543431", "0.54304546", "0.5430303", "0.5430303", "0.5430303", "0.5421994", "0.5421994", "0.5421994", "0.5421994", "0.5421994", "0.5421994", "0.5421994", "0.54121643", "0.54121643", "0.5411184", "0.54016143", "0.5393996", "0.53810596", "0.5378166", "0.5373938", "0.5373787", "0.5371779", "0.5368178", "0.5355484", "0.53478134", "0.53470105", "0.53431964", "0.5332968", "0.5327241", "0.53170556", "0.5311325" ]
0.0
-1
Where the logic of the action is executed.
@Override public String execute() throws Exception { Program program = programService.getProgram(id); DataElementGroup dataElementGroup = program.getDataElementGroup(); IndicatorGroup indicatorGroup = program.getIndicatorGroup(); if( deSelectedList.size() >0 || indSelectedList.size()>0) { program.setName( StringUtils.trimToNull( name ) ); program.setCode( StringUtils.trimToNull( code ) ); program.setShortName( StringUtils.trimToNull( shortName ) ); program.setDescription( StringUtils.trimToNull( description ) ); program.getDataElements().clear(); program.getIndicators().clear(); dataElementGroup.getMembers().clear(); indicatorGroup.getMembers().clear(); for ( String id : deSelectedList ) { DataElement dataElement = dataElementService.getDataElement( id ); dataElementGroup.getMembers().add( dataElement ); program.getDataElements().add( dataElement ); } for ( String id : indSelectedList ) { Indicator indicator = indicatorService.getIndicator( id ); indicatorGroup.getMembers().add( indicator ); program.getIndicators().add( indicator ); } //updating DataElementGroup and IndicatorGroup dataElementGroup.setName( StringUtils.trimToNull( name ) ); dataElementGroup.setCode( StringUtils.trimToNull( code ) ); dataElementGroup.setShortName( StringUtils.trimToNull( shortName )); indicatorGroup.setName( StringUtils.trimToNull( name ) ); indicatorGroup.setCode( StringUtils.trimToNull( code ) ); programService.updateProgram( program ); dataElementService.updateDataElementGroup( dataElementGroup ); indicatorService.updateIndicatorGroup( indicatorGroup ); } return SUCCESS; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void execute(ActionContext ctx) {\n\t\t\r\n\t}", "public void action() {\n action.action();\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\n public void action() {\n }", "@Override\r\n\tpublic void action() {\n\t\t\r\n\t}", "@Override\n\tpublic void action() {\n\t\tSystem.out.println(\"action now!\");\n\t}", "@Override\n\tpublic void action() {\n\n\t}", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n }", "@Override\n\tprotected void compute() {\n\t\tSystem.out.println(\"This is an action\");\n\t}", "public void logic(){\r\n\r\n\t}", "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}", "protected abstract void actionExecuted(SUT system, State state, Action action);", "public void executeAction()\n\t{\t\t\n\t\tthis.getUser().setHealth(this.getUser().getHealth()+HEALTH);\n\t}", "@Override\n\tpublic void execute() {\n\t\tempfaengerA.doAction1();\n\t\tempfaengerA.doAction2();\n\t\tempfaengerA.doAction3();\n\n\t}", "public void doAction(){}", "private void act() {\n\t\tmyAction.embodiment();\n\t}", "private void entryAction() {\n\t}", "protected void execute()\n\t{\n\t}", "public void executeAction( String actionInfo );", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "abstract public void performAction();", "public void action() {\n }", "@Override\n protected void doAct() {\n }", "protected void execute() {\n\n\t}", "protected void execute() {\r\n }", "public abstract boolean execute(ActionContext actionContext)\n throws Exception;", "@Override\n\tpublic void doExecute(Runnable action) {\n\t\t\n\t}", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public abstract void action();", "public void doInitialAction(){}", "public void act() \n {\n // Add your action code here.\n klawisze();\n stawiaj();\n pobierzJablka();\n }", "protected void execute() {\n\t}", "protected void execute() {\n\t\t\n\t}", "Action execute(Context context);", "@Override\n public void action() {\n System.out.println(\"do some thing...\");\n }", "public void performAction(HandlerData actionInfo) throws ActionException;", "public abstract void onAction();", "private void executeAction(ElevatorAction first) {\n\n\t}", "private String performTheAction(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tString servletPath = request.getServletPath();\r\n\t\tString action = getActionName(servletPath);\r\n\t\t// Let the logged in user run his chosen action\r\n\t\treturn Action.perform(action, request);\r\n\t}", "public void execute() {\n setExecuted(true);\n }", "void actionProcessed(Action action, ActionResult res, int round);", "public void run() {\n long startTime = 0;\n if (action.getClass().getName().contains(\"TooAction\")) {\n startTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sending a ToO alert...\");\n }\n\n action.doTriggerAction(change, handback);\n\n // Record the end time and warn if it took too long.\n if (startTime != 0) {\n long curTime = System.currentTimeMillis();\n LOG.log(Level.WARNING, \"Sent ToO alert\");\n\n long elapsed = curTime - startTime;\n if (elapsed > 5000) {\n LOG.log(Level.WARNING, \"Long delay sending ToO alert: \" + elapsed);\n }\n }\n\n }", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "public void actionSuccessful() {\n System.out.println(\"Action performed successfully!\");\n }", "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}", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "@Override\n\tprotected void logic() {\n\n\t}", "protected void execute()\n {\n }", "protected void execute() {}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\r\n\t\r\n\t}", "public void execute() {\n\n\t}", "public void performAction();", "public void processAction(CIDAction action);", "@Override\n\tpublic void actionHandler(Actions action, int arg1, int arg2) {\n\t\tlogic.actionHandler(action, arg1, arg2);\n\t}", "@Override\n public void action() {\n System.out.println(\"Matchmaker Behaviour\");\n addBehaviour(new RequestToMatchMakerBehaviour());\n\n }", "public void act() \r\n {\r\n // Add your action code here.\r\n tembak();\r\n gerakKiri();\r\n gerakKanan();\r\n \r\n \r\n \r\n }", "protected void doPreEntryActions(RequestControlContext context) throws FlowExecutionException {\r\n\r\n\t}", "public void action() {\n\t\t\n\t\tjugar.setOnAction(f->{\n\n\t\t\tMain.pantallaPersonaje();\n\t\t});\n\t\n\t\tpuntajes.setOnAction(f->{\n\t\t\tMain.pantallaPuntajes();\n\t\t});\n\t\n\t\n\t}", "@Override\n public void run() {\n chosenActionUnit.run(getGame(), inputCommands);\n }", "public void execute() {\n\t\t\n\t}", "@Override\r\n\tpublic void visit(SimpleAction action)\r\n\t{\n\t\t\r\n\t}", "public void act() {\n\t}", "interface Action {\n /**\n * Executes the action. Called upon state entry or exit by an automaton.\n */\n void execute();\n }", "@Override\r\n\tpublic void processAction(ActionRequest actionRequest,\r\n\t\t\tActionResponse actionResponse) throws IOException, PortletException {\r\n\t\t// TODO Auto-generated method stub\r\n\t\tsuper.processAction(actionRequest, actionResponse);\r\n\t}", "public void act() \r\n {\r\n \r\n // Add your action code here\r\n MovimientoNave();\r\n DisparaBala();\r\n Colisiones();\r\n //muestraPunto();\r\n //archivoTxt();\r\n }", "public void act()\n {\n if(onSales == true)\n {\n calculateSale();\n }\n }", "protected void execute() {\n \toi.updateToggleLift();\n if(oi.toggleOnLift){\n \t// The commands here will occur if the TorqueLift toggle switch\n \t// is activated. All code here will only run after the button\n \t// has been toggled.\n \tif (limitswitch.getReadyState()) { \n \ttorquelift.swap();\n \ttorquelift.moveAllMotors(oi.getLiftSpeed());\n \t} else {\n \t\t// activates when the limit switch is pressed\n \t\ttorquelift.moveAllMotors(oi.getLiftYUpSpeed());\n \t}\n } else {\n \t// The commands here will occur normally, when the TorqueLift is\n \t// not activated.\n \treturn;\n }\n }", "protected void execute() {\n\n\n \n }", "public void act() \n {\n // Add your action code here.\n tempoUp();\n }", "protected void execute() {\n \t// literally still do nothing\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n handleAction();\n }", "void executeAction(String action, Map params,\n IPSAgentHandlerResponse response);", "public void actionOffered();", "@Override\r\n\tpublic Message doAction() {\n\t\treturn null;\r\n\t}" ]
[ "0.73040634", "0.7238826", "0.7101533", "0.7101533", "0.7101533", "0.70639193", "0.68539524", "0.6853354", "0.6810679", "0.6810679", "0.6808125", "0.6772251", "0.67718446", "0.67718446", "0.67718446", "0.67718446", "0.67718446", "0.67718446", "0.67718446", "0.67718446", "0.6698782", "0.66905344", "0.66863316", "0.66772914", "0.66707134", "0.661194", "0.6585098", "0.6526421", "0.6521039", "0.6512262", "0.6511607", "0.6487614", "0.6482259", "0.64765424", "0.6469902", "0.64687955", "0.6461396", "0.6458633", "0.6458633", "0.6458633", "0.6458633", "0.645838", "0.64495814", "0.64485246", "0.6438059", "0.6419671", "0.6393442", "0.6379322", "0.63683784", "0.63638216", "0.63556576", "0.63490695", "0.6342267", "0.6335689", "0.63341355", "0.63341355", "0.63247806", "0.6303299", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62803715", "0.62718594", "0.62598467", "0.62502676", "0.6248287", "0.6248287", "0.6248287", "0.624791", "0.6244689", "0.6214744", "0.6209348", "0.61935395", "0.617554", "0.6162198", "0.6161139", "0.61571926", "0.6152542", "0.613449", "0.6134213", "0.6124453", "0.6123568", "0.6116334", "0.6112098", "0.61084336", "0.6106594", "0.6086706", "0.60773724", "0.6077091", "0.60656977", "0.60634214", "0.6055587", "0.6043387" ]
0.0
-1
TODO Autogenerated method stub
public static void main(String[] args) { Milk m=new Milk(); m.mineral(); m.bisleri(); }
{ "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
TreeSet ts = new TreeSet(new MyComp());
public static void main(String[] args) { TreeSet<String> ts = new TreeSet<>(new MyComp().reversed()); ts.add("C"); ts.add("B"); ts.add("A"); ts.add("G"); ts.add("Z"); ts.add("Q"); for (String element : ts){ System.out.print(element); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public SyncedTreeSet() {\n _treeSet = new TreeSet<T>();\n }", "public static void main(String[] args) {\r\n\t\tHashSet h1=new HashSet();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\th1.add(3);\r\n\t\th1.add(7); //Homogeous \r\n\t\th1.add(9);//hetrogeous\r\n\t\th1.add(10);\r\n\t\t\r\n\t\tTreeSet t1=new TreeSet(h1);\r\n\t\tt1.add(100);\r\n\t\tSystem.out.println(t1);\r\n\t}", "public static void main(String[] args) {\n\r\n TreeSet<point> ts1 = new TreeSet<>();\r\n ts1.add(new point(1,1));\r\n ts1.add(new point(5, 5));\r\n ts1.add(new point(5, 2));\r\n\r\n System.out.println(ts1);\r\n }", "public SortedSet() {\n\n }", "public static <T extends Comparable> Set<T> CreateSortedSet() {\n return new TreeSet<>();\n }", "public static void main(String[] args) {\n SortedSet<CompareObject> objects = new TreeSet<>(new ComparatorTest());\n\n objects.add(new CompareObject(1));\n objects.add(new CompareObject(3));\n objects.add(new CompareObject(5));\n objects.add(new CompareObject(-13));\n objects.add(new CompareObject(12));\n objects.add(new CompareObject(1100));\n objects.add(new CompareObject(1));\n\n for (CompareObject x : objects){\n System.out.println(x);\n }\n\n }", "public static void main(String[] args) \n\t{\n\t\tSortedSet<String> ts = new TreeSet<String>(); \n\n\t\t// Adding elements into the TreeSet \n\t\t// using add() \n\t\tts.add(\"Sravan\"); \n\t\tts.add(\"Ojaswi\"); \n\t\tts.add(\"Bobby\"); \n\t\tts.add(\"Rohith\"); \n\t\tts.add(\"Gnanesh\"); \n\t\tts.add(\"Devi2\"); \n\n\t\t// Adding the duplicate \n\t\t// element \n\t\tts.add(\"Sravan\"); \n\n\t\t// Displaying the TreeSet \n\t\tSystem.out.println(ts); \n\n\t\t// Removing items from TreeSet \n\t\t// using remove() \n\t\tts.remove(\"Ojaswi\"); \n\n\t\t// Iterating over Tree set items \n\t\tSystem.out.println(\"Iterating over set:\"); \n\t\tIterator<String> i = ts.iterator(); \n\t\twhile (i.hasNext()) \n\t\t\tSystem.out.println(i.next()); \n\t}", "<T extends Comparable> SortedSet<T> sorted(Set<T> in) {\n return new TreeSet<>(in);\n }", "public static void main(String[] args) {\n\n// SortedSet<Integer> set=new TreeSet<>();\n// set.add(45);\n// set.add(3);\n// set.add(12);\n// System.out.println(set);\n\n SortedSet<User> set=new TreeSet<>();\n set.add(new User(34,\"r\"));\n set.add(new User(4,\"j\"));\n set.add(new User(14,\"x\"));\n System.out.println(set);\n }", "public static void main(String[] args) {\n\r\n\t\tTreeSet<String> ts= new TreeSet<String>();\r\n\t}", "public MyMultiset() {\n\t\tthis.set = new HashSet<Node>();\n\t}", "public static void main(String[] args) {\n\n\n TreeSet<String> t = new TreeSet();\n\n t.add(\"A\");\n t.add(\"B\");\n t.add(\"C\");\n\n TreeSet<String> u = t;\n\n for (String x : t) {\n System.out.println(x);\n u.add(\"\" + new Date());\n }\n\n }", "public SortedSet(ISet<E> other) {\n\n }", "public MyTreeSet()\r\n {\r\n root = null;\r\n }", "public static <T extends Comparable> Set<T> AsSortedSet(@NonNull T... ts) {\n return Create_UnModifiableSet_By_InputElements(ContainerUtil.<T>CreateSortedSet(), ts);\n }", "public static void main(String[] args) {\n\t\t// TODO Auto-generated method stub\n\t\tTreeSet<String> ts = new TreeSet<String>();\n\t\tts.add(\"D\");\n\t\tts.add(\"B\");\n\t\tts.add(\"E\");\n\t\tts.add(\"A\");\n\t\tts.add(\"C\");\n\t\tts.add(\"B\");\t\t//duplicates are not stored\n\t\tts.add(null);\n\t\tSystem.out.println(\"Elements of TreeSet:\\n\" + ts);\n\t\t\n\t\tSortedSet<String> ts2 = new TreeSet<String>();\t//SortedSet is an interface\n\t\tts2 = ts.subSet(\"B\", \"D\");\n\t\tSystem.out.println(ts2);\n\t\t\n\t\tts2 = ts.subSet(\"B\", false, \"E\", true);\n\t\tSystem.out.println(ts2);\n\t}", "public static void main(String[] args) {\n Set<Integer> S1 = new TreeSet<>();\r\n // add objects\r\n S1.add(65); S1.add(36); S1.add(24); S1.add(36);\r\n \r\n // show the content and assert they are sorted and no duplications\r\n System.out.println(\"set = \" + S1); \r\n //remove elements\r\n S1.remove(36); S1.remove(24);\r\n System.out.println(S1); //assert set = 65\r\n S1.add(15); S1.add(24); S1.add(80); // add 15, 24, 80\r\n System.out.println(\"set = \" +S1); //assert set = 15, 24, 65, 80\r\n \r\n System.out.println(\"Does S1 contain 10?\"\r\n + S1.contains(10)); // assert false\r\n System.out.println(\"S1 has \" + S1.size() +\" objects\"); // assert 4\r\n\r\n // create another Set object implemented using HashSet\r\n Set<Integer> S2 = new HashSet<>();\r\n // add all objects in S1 to S2\r\n S2.addAll(S1);\r\n System.out.println(\"hashset = \" +S2); //assert they may not be ordered\r\n\r\n // create another Set object implemented using LinkedHashSet\r\n Set<Integer> S3 = new LinkedHashSet<>();\r\n S3.add(150); // add 150\r\n S3.addAll(S1);// add all objects in S1 to S2\r\n System.out.println(\"LinkedHashSet = \" +S3);//assert s3=[150,15,24,65,80]\r\n \r\n S3.removeAll(S3); // remove all items\r\n System.out.println(\"LinkedHashSet = \" +S3);//assert s3=[]\r\n }", "public static void main(String[] args) {\n\n Set<Student> set = Sets.newTreeSet();\n Student s3 = new Student(3);\n Student s4 = new Student(4);\n Student s5 = new Student(5);\n Student s1 = new Student(1);\n Student s2 = new Student(2);\n List<Student> list = Lists.newArrayList();\n list.add(s4);\n list.add(s3);\n list.add(s5);\n list.add(s1);\n list.add(s2);\n\n list.sort(new Comparator<Student>() {\n @Override\n public int compare(Student o1, Student o2) {\n return o1.getAge() - o2.getAge() < 0 ? 1 : -1;\n }\n });\n System.out.println(list);\n\n// s1.toString();\n// set.add(s3);\n// set.add(s4);\n// set.add(s5);\n// set.add(s1);\n// set.add(s2);\n// System.out.println(set);\n// for (Student s : set) {\n// System.out.println(s);\n// }\n\n\n }", "public static void main(String[] args) {\n\t\t\r\n\t\t TreeSet<String> treeset = new TreeSet<String>();\r\n\t\t treeset.add(\"Good\");\r\n\t\t treeset.add(\"For\");\r\n\t\t treeset.add(\"Health\");\r\n\t\t //Add Duplicate Element\r\n\t\t treeset.add(\"Good\");\r\n\t\t System.out.println(\"TreeSet : \");\r\n\t\t for (String temp : treeset) {\r\n\t\t System.out.println(temp);\r\n\t\t }\r\n\t\t }", "public static void main(String[] args) {\n TreeSet<Employee> treeEmp = new TreeSet<>();\n \n for(int i =0; i<100 ; i++){\n treeEmp.add(new Employee(\"Pera\"+i, (int)(Math.random()*100+1)));\n } \n \n \n Iterator<Employee> iteratorEmp = treeEmp.iterator();\n while (iteratorEmp.hasNext()) { \n Employee ite = iteratorEmp.next();\n System.out.println(\"Empployee name: \"+ite.name+\" id: \"+ite.id);\n }\n \n System.out.println(treeEmp.first());\n System.out.println(treeEmp.last());\n \n Employee e = new Employee(\"Perica499\");\n e.id = \"50\";\n treeEmp.add(e);\n Iterator<Employee> headSetIterator = treeEmp.headSet(e).iterator();\n while (headSetIterator.hasNext()) { \n System.out.println(\"object Id \"+headSetIterator.next().id);\n }\n \n System.out.println(\"*****************************\");\n \n TreeSet<Employee> emps = new TreeSet<>(new CustomComparator());\n \n \n }", "public PointSET() {\n //s = new TreeSet<Point2D>(Point2D.X_ORDER);\n }", "public static SortedSet synchronizedSortedSet(SortedSet set) {\n/* 263 */ return SynchronizedSortedSet.decorate(set);\n/* */ }", "public static void main(String args[]) {\n\tSystem.out.println(\"--------------------------------------------------------------------\");\r\n\tSystem.out.println(\"Program 2.2: Sorting TreeSet when it has user-defined Objects/values\");\r\n\tTreeSet TS3 = new TreeSet();\r\n\tassign3And4_SubClass_Employee e31 = new assign3And4_SubClass_Employee(9, \"Mamta\", 200);\r\n\tassign3And4_SubClass_Employee e41 = new assign3And4_SubClass_Employee(4, \"Mamta\", 200);\r\n\tassign3And4_SubClass_Employee e51 = new assign3And4_SubClass_Employee(2, \"Mamta\", 200);\r\n\tassign3And4_SubClass_Employee e61 = new assign3And4_SubClass_Employee(2, \"Mamta\", 200);\r\n\tTS3.add(e31);\r\n\tTS3.add(e41);\r\n\tTS3.add(e51);\r\n\tTS3.add(e61);\r\n\tSystem.out.println(\"Sorted TreeSet TS3 is : \"+TS3); // sort then in Asc order + it doesnt allow duplicate values.\r\n\t}", "public static void main(String[] args){\n\t\tTreeSet hs=new TreeSet();\n\t\t\n\t\ths.add(\"d\");\n\t\ths.add(\"c\");\n\t\ths.add(\"b\");\n\t\ths.add(\"a\");\n\t\ths.add(\"c\");\n\t\ths.add(\"i\");\n\t\ths.add(\"l\");\n\t\ths.add(new Integer(2));\n\t\ths.add(new Float(2));\n\t\t\n\t\t\t\t\n\t\tSystem.out.println(\"Hashset is \"+hs);\n\t\tSystem.out.println(\"Size of Hashset is \"+ hs.size());\n\t\t\n\t\tSystem.out.println(\"Does hashset contains this 'u' element \" + hs.contains(\"u\"));\t\t\n\t\tSystem.out.println(\"is hashset empty \" + hs.isEmpty());\n\t\tSystem.out.println(\"remove the element \"+hs.remove(\"i\"));\n\t\t\n\t\t\n\t hs.clear();\n\t System.out.println(\"get class \" +hs.getClass());\n\t\t\n\t System.out.println(\"is hashset empty \" +hs.isEmpty());\n\t \n\t \n\t\t\n\t}", "@SuppressWarnings(\"unchecked\")\n \tpublic static <T> Set<T> createConcurrentHashSet() {\n \t\treturn (Set<T>) Collections.synchronizedSet(CollectionFactory.createHashSet());\n \t}", "public static void main(String[] args) {\n\t\tTreeSet<String> myset=new TreeSet<String>();\r\n\t\t myset.add(\"ardra\");\r\n\t\t myset.add(\"anakha\");\r\n\t\t myset.add(\"anusha\");\r\n\t\t myset.add(\"ananya\");\r\n\t\t \r\n\t\t \r\n\t\t TreeSet<String> myset1=new TreeSet<String>();\r\n\t\t myset1=(TreeSet<String>) myset.clone();\r\n\t\t System.out.println(myset1);\r\n\t\t \r\n\r\n\t}", "public static <T> Set<T> AsSortedSet(@NonNull Comparator<T> comparator, @NonNull T... ts) {\n return Create_UnModifiableSet_By_InputElements(CreateSortedSet(comparator), ts);\n }", "public GenericSetTreeNode(Comparator<? super N> comparator, V value) {\n\t\tsuper(null, value);\n\t\t\n\t\tif (comparator == null) {\n\t\t\tcomparator = new Comparator<N>() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic int compare(N o1, N o2) {\n\t\t\t\t\treturn o1.toString().compareTo(o2.toString());\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t\t\n\t\tthis.comparator = comparator;\n\t\t\n\t\tinternalSetChildrenCollection(TreeMultiset.create(comparator));\n\t}", "public static void main(String[] args) {\n SortedSet<String> fruits = new TreeSet<>(Comparator.reverseOrder());\n\n /*\n The above TreeSet with the custom Comparator is the concise form of the following:\n SortedSet<String> fruits = new TreeSet<>(new Comparator<String>() {\n @Override\n public int compare(String s1, String s2) {\n return s2.compareTo(s1);\n }\n });\n */\n\n // Adding new elements to a TreeSet\n fruits.add(\"Banana\");\n fruits.add(\"Apple\");\n fruits.add(\"Pineapple\");\n fruits.add(\"Orange\");\n\n System.out.println(\"Fruits Set : \" + fruits);\n\n System.out.println(fruits.tailSet(\"Banana\"));\n System.out.println(fruits.subSet(\"Orange\", \"Banana\"));\n // creating a TreeSet\n TreeSet<Integer> treeadd = new TreeSet<>();\n\n // adding in the tree set\n treeadd.add(12);\n treeadd.add(11);\n treeadd.add(16);\n treeadd.add(15);\n\n // getting ceiling value for 13\n System.out.println(\"Ceiling value for 13: \" + treeadd.ceiling(13));//15\n System.out.println(\"Flooring value for 13: \" + treeadd.floor(13));//12\n }", "Boolean superset(MultiSet<X> s);", "public static void main(String[] args) {\r\n\t\tSortedSet<String> ss = new TreeSet<String>();\r\n\t\tss.add(\"geeta\");\r\n\t\tss.add(\"seeta\");\r\n\t\tss.add(\"meeta\");\r\n\t\tss.add(\"neeta\");\r\n\t\tss.add(\"reeta\");\r\n\t\tSystem.out.println(\"SortedSet elements : \"+ ss);\r\n\t\tSystem.out.print(\"Iterating SortedSet elements : \");\r\n\t\tIterator it = ss.iterator();\r\n\t\twhile (it.hasNext()) \r\n\t\t{\r\n System.out.print(it.next() + \" \");\r\n }\r\n System.out.println();\r\n System.out.println(\"Lowest element :\"+ ss.first());\r\n System.out.println(\"Highest element :\"+ ss.last());\r\n System.out.println(\"Lesser than elements : \" +ss.headSet(\"seeta\"));\r\n System.out.println(\"Higher than or equals elements : \"+ ss.tailSet(\"meeta\"));\r\n System.out.println(\"Range elements : \"+ss.subSet(\"neeta\", \"reeta\"));\r\n \r\n\t}", "public static void main(String[] args) {\n SortedSet<Long> longTreeSet = new TreeSet<>();\n longTreeSet.add(3L);\n longTreeSet.add(3L);\n longTreeSet.add(39L);\n longTreeSet.add(30L);\n longTreeSet.add(30L);\n\n System.out.println(\"longTreeSet = \" + longTreeSet);\n System.out.println(\"longTreeSet.size() = \" + longTreeSet.size());\n System.out.println(\"longTreeSet.first() = \" + longTreeSet.first());\n System.out.println(\"longTreeSet.last() = \" + longTreeSet.last());\n\n longTreeSet.addAll(Arrays.asList(15L, 18L, 15L, 18L));\n System.out.println(\"longTreeSet = \" + longTreeSet);\n\n //longTreeSet.add(null);\n // System.out.println(\"longTreeSet = \" + longTreeSet);\n\n\n System.out.println(\"longTreeSet.subSet(15L, 21L) = \" + longTreeSet.subSet(15L, 30L));\n System.out.println(\"longTreeSet.headSet(18L) = \" + longTreeSet.headSet(18L));\n System.out.println(\"longTreeSet.tailSet(18L) = \" + longTreeSet.tailSet(18L));\n\n SortedSet<Long> tailView = longTreeSet.tailSet(18L);\n System.out.println(\"tailView.remove(30L) = \" + tailView.remove(30L));\n System.out.println(\"longTreeSet = \" + longTreeSet);\n\n\n\n }", "public static void main(String[] args) {\n\t\tTreeSet<Integer> numset = new TreeSet<Integer>();//stored in order\n\t\tnumset.add(10);\n\t\tnumset.add(40); //string buffer is not implementing comparable class so it cannot be used in tree set\n\t\tnumset.add(30);\n\t\tnumset.add(20);\n\t\tnumset.add(10);\n\t\tSystem.out.println(numset);\n\t\tSystem.out.println(numset.headSet(40));//gives values lesser than it\n\t\tSystem.out.println(numset.tailSet(10));//gives equal or greater than it\n\t\tSystem.out.println(numset.subSet(10, 30));//gives starting values from starting and value before last element\n\t\tSortedSet<Integer> set2= new TreeSet<Integer>(); //store in sorted set\n\t\t\n\t\tset2=numset.subSet(10, 30);\n\t\tSystem.out.println(\"subset is \"+set2);\n\t\tSystem.out.println(numset.comparator());//returns null if values are already in order\n\t\tSystem.out.println(numset.higher(10));//gives value higher than this\n\t\tSystem.out.println(numset.lower(30));//gives value lower than this\n\t\tSystem.out.println(numset.descendingSet());\n\t\t\n\t\tIterator<Integer> iterator=numset.iterator();\n\t\twhile(iterator.hasNext()) {\n\t\t\tSystem.out.println(iterator.next());\n\t\t}\n\t\tIterator<Integer> iterator2=numset.descendingIterator();\n\t\twhile(iterator2.hasNext()) {\n\t\t\tSystem.out.println(iterator2.next());\n\t\t}\n\t}", "public static <T> Set<T> CreateSortedSet(Comparator<T> comparator) {\n return new TreeSet<>(comparator);\n }", "public static void main(String[] args) {\n\t\tShirt r = new Shirt(\"Red\", 10);\r\n\t\tShirt b = new Shirt(\"Blue\", 465);\r\n\t\tShirt g = new Shirt(\"Green\", 3213456);\r\n\t\t// Creates some custom comparator object.\r\n\t\tSizeComp s = new SizeComp();\r\n\t\tColorComp c = new ColorComp();\r\n\t\t// Creates some tree sets using custom comparator. \r\n\t\tTreeSet<Shirt> mySizeSet = new TreeSet<>(s);\r\n\t\tmySizeSet.add(r);\r\n\t\tmySizeSet.add(g);\r\n\t\tmySizeSet.add(b);\r\n\t\tout.println(\"Sort by Size\");\r\n\t\tout.println(mySizeSet);\r\n\t\t\r\n\t\tTreeSet<Shirt> myCompSet = new TreeSet<>(c);\r\n\t\tmyCompSet.add(r);\r\n\t\tmyCompSet.add(g);\r\n\t\tmyCompSet.add(b);\r\n\t\tout.println(\"Sort by Color\");\r\n\t\tout.println(myCompSet);\r\n\t}", "public OrderedSet (String setName) {\n initialize();\n name = setName;\n }", "public static void main(String[] args) {\n\t\tTreeSet<String> ts = new TreeSet<String>();\n\t\t\n\t\tts.add(\"\");\n\t\t//System.out.println(ts);\n\n\t\tts.add(\"Red\");\n\t\tts.add(\"Green\");\n\t\tts.add(\"Blue\");\n\t\tts.add(\"White\");\n\t\tts.add(\"Orange\");\n\t\tts.add(\"\");\n\n\t\tSystem.out.println(ts);\n\t\tSystem.out.println(ts.size());\n\n\t\t// List<String> li = new ArrayList<String>(ts);\n\n\t\tTreeSet<String> ts1 = new TreeSet<String>();\n\n\t\tts1.add(\"Red\");\n\t\tts1.add(\"Green\");\n\t\tts1.add(\"Blue\");\n\t\tts1.add(\"WWhite\");\n\t\tts1.add(\"OOrange\");\n\n\t\tfor (String tss : ts) {\n\t\t\tSystem.out.println(ts1.contains(tss) ? \"YES\" : \"NO\");\n\t\t}\n\n\t\tTreeSet<Integer> ts2 = new TreeSet<Integer>();\n\n\t\tts2.add(1);\n\t\tts2.add(2);\n\t\tts2.add(3);\n\t\tts2.add(5);\n\t\tts2.add(9);\n\n\t\tIterator<Integer> itr = ts2.headSet(3).iterator();\n\n\t\twhile (itr.hasNext()) {\n\t\t\tSystem.out.println(itr.next());\n\t\t}\n\n\t\tSystem.out.println(\"======\");\n\n\t\tIterator<Integer> itr2 = ts2.tailSet(3).iterator();\n\n\t\twhile (itr2.hasNext()) {\n\t\t\tSystem.out.println(itr2.next());\n\t\t}\n\n\t\tSystem.out.println(\"======\");\n\n\t\tSystem.out.println(ts2.ceiling(11));\n\t\tSystem.out.println(ts2.floor(3));\n\n\t\tSystem.out.println(\"======\");\n\n\t\tSystem.out.println(ts2.lower(3));\n\t\tSystem.out.println(ts2.higher(3));\n\t\t\n\t\tSystem.out.println(\"======\");\n\t\t\n\t\tTreeSet t = new TreeSet();\n\t\t\n\t\tt.add(new StringBuffer(\"AA\"));\n\t\tt.add(new StringBuffer(\"BB\"));\n\t\tSystem.out.println(t);\n\t\t\n\n\t\t// ts1.addAll(ts);\n\t\t// System.out.println(ts1);\n\n\t\t/*\n\t\t * System.out.println(\"Treeset to ArrayList: \" + li); Collections.reverse(li);\n\t\t * System.out.println(\"After Reversing: \" + li);\n\t\t */\n\n\t\t/*\n\t\t * Iterator<String> itr = ts.iterator();\n\t\t * \n\t\t * while (itr.hasNext()) { System.out.println(itr.next()); }\n\t\t */\n\t}", "public static void main(String[] args) {\n\t\t \n\t\tTreeSet<String> obj = new TreeSet<String>();\n\t\t\n\t\t\n\t\tobj.add(\"ABC\");\n\t\tobj.add(\"String\");\n\t\tobj.add(\"Test\");\n\t\tobj.add(\"Pen\");\n\t\tobj.add(\"Ink\");\n\t\tobj.add(\"Jack\");\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\tTreeSet<Integer> obj1 = new TreeSet<Integer>();\n\t\t\n\t\tobj1.add(88);\n\t\tobj1.add(45);\n\t\tobj1.add(7);\n\t\tobj1.add(3);\n\t\tobj1.add(222);\n\t\t\n\t\tSystem.out.println(obj1);\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n\t\t TreeSet<Integer> treeSet = new TreeSet<Integer>();\n\t\t \n\t\t treeSet.add(21);\n\t\t treeSet.add(10);\n\t\t treeSet.add(25);\n\t\t // treeSet.add(null);\n\t\t treeSet.add(25);\n\t\t //treeSet.add(null);\n\t\t long start = System.currentTimeMillis();\n\t\t Iterator<Integer> iterator = treeSet.iterator();\n\t\t while(iterator.hasNext())\n\t\t {\n\t\t\t System.out.println(iterator.next());\n\t\t }\n\t\t long end = System.currentTimeMillis();\n\t\t System.out.println(end - start);\n\t}", "public PointSET() {\n pointSet = new TreeSet<>();\n }", "public SortedSet<Date> getSelection()\n/* */ {\n/* 179 */ return new TreeSet(this.selectedDates);\n/* */ }", "public interface StartTreeNodeComparator\n{\n public boolean compare (StartTreeNode node);\n}", "private static TreeSet<Integer> b(bqf parambqf) {\n }", "private EmptySortedSet() {\n }", "Set createSet();", "public static SortedSet transformedSortedSet(SortedSet set, Transformer transformer) {\n/* 322 */ return TransformedSortedSet.decorate(set, transformer);\n/* */ }", "public static void main(String[] args) {\n Set<BankAccount> set=new TreeSet(new BankAccountTest());\n\tset.add(new BankAccount(128,\"mallika\",2000.0));\n\tset.add(new BankAccount(124,\"sallika1\",21000.0));\n\tset.add(new BankAccount(125,\"nallika2\",20000));\t\n\tfor(BankAccount bank:set){\n\t\tSystem.out.println(bank);\n\t}\n \n\t}", "public static void main(String[] args) \n {\n\t Scanner sc = new Scanner(System.in);\n TreeSet<String> tree = new TreeSet<String>();\n \n// Prompt user for a line of text containing characters:\n System.out.println(\"Enter line: \");\n String str = sc.nextLine();\n \n// Put words into tree:\n for (String s : str.split(\" \"))\n tree.add(s);\n \n// Print tree set use:\n System.out.println(tree);\n }", "public static void main(String[] args) {\n\t\t\n\t\tTreeSet<String> set = new TreeSet<String>();\n\t\tset.add(\"A\");\n\t\tset.add(\"B\");\n\t\tset.add(\"C\");\n\t\tset.add(\"D\");\n\t\tset.add(\"E\");\n\t\tset.add(\"F\");\n\t\t\n\t\tSystem.out.println(set);\n\n\t}", "public static SortedSet typedSortedSet(SortedSet set, Class type) {\n/* 306 */ return TypedSortedSet.decorate(set, type);\n/* */ }", "public static SortedSet predicatedSortedSet(SortedSet set, Predicate predicate) {\n/* 293 */ return PredicatedSortedSet.decorate(set, predicate);\n/* */ }", "public static Set orderedSet(Set set) {\n/* 236 */ return (Set)ListOrderedSet.decorate(set);\n/* */ }", "private SimplexComparator() {}", "public static void main(String[] args) {\n\t\tclass Person {\n\t\t\tprivate String nome;\n\n\t\t\tpublic Person(String nome) {\n\t\t\t\tthis.nome = nome;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic String toString() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn nome;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic boolean equals(Object obj) {\n\t\t\t\tSystem.out.println(\"Equals\");\n\t\t\t\tPerson person = (Person) obj;\n\t\t\t\treturn this.nome.equals(person.nome) ? true : false;\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int hashCode() {\n\t\t\t\tSystem.out.println(\"Hashcode!\");\n\t\t\t\treturn nome.charAt(0);\n\t\t\t}\n\t\t}\n\t\tSet<String> setComHashSet = new HashSet<>();\n\t\tsetComHashSet.add(\"Nicholas\");\n\t\tsetComHashSet.add(\"Cabral\");\n\t\tsetComHashSet.add(\"Barbosa\");\n\t\tSystem.out.println(\"I dont care about order! I care about performance to add() \" + setComHashSet);\n\t\tSet<String> setTreeSet = new TreeSet<>(Set.copyOf(setComHashSet));\n\t\tSystem.out.println(\"I care about order, however I dont care about performance to add() \" + setTreeSet);\n\t\tSystem.out.println();\n\t\tSet<Person> setPerson = new HashSet<>();\n\t\tPerson person = new Person(\"Nicholas\");\n\t\tPerson person2 = new Person(\"Nicholas2\");\n\t\tsetPerson.add(person);\n\t\tsetPerson.add(person2);\n\t\tSystem.out.println(setPerson);\n\t\tString[] arr = { \"Nihcolas\" };\n\t\tList<String> lista = Arrays.asList(arr);\n\n\t\tA a = new A();\n\t\tSetCollection b = (SetCollection) a;\n\t\tSystem.out.println(a == b);\n\t}", "@Test\r\n public void anotherConstructorWorks() throws Exception {\r\n TreeSet<Integer> check = new TreeSet<>(Comparator.reverseOrder());\r\n assertTrue(check.add(1));\r\n assertTrue(check.add(2));\r\n assertFalse(check.add(2));\r\n assertArrayEquals(new Integer[]{2, 1}, check.toArray());\r\n assertTrue(check.add(4));\r\n assertTrue(check.remove(2));\r\n assertFalse(check.remove(43));\r\n assertArrayEquals(new Integer[]{4, 1}, check.toArray());\r\n }", "public static SortedSet unmodifiableSortedSet(SortedSet set) {\n/* 276 */ return UnmodifiableSortedSet.decorate(set);\n/* */ }", "@Test\r\n public void addToStringSet() throws Exception {\r\n TreeSet<String> s = new TreeSet<>();\r\n assertTrue(s.add(\"kek\"));\r\n assertTrue(s.contains(\"kek\"));\r\n }", "public static void main(String[] args) {\n Set<Inner> set = new HashSet<>();\n System.out.println(set.add(new Inner(\"A\")));\n System.out.println(set.add(new Inner(\"A\")));\n System.out.println(set.add(new Inner(\"A\")));\n\n System.out.println(set);\n }", "@Test\r\n public void addAllFromSetWithStrings() throws Exception {\r\n TreeSet<String> s = new TreeSet<>();\r\n s.addAll(sStr);\r\n assertTrue(s.contains(\"kek\"));\r\n assertTrue(s.contains(\"lel\"));\r\n assertTrue(s.contains(\"lol\"));\r\n }", "@Test\r\n public void addAllWorks() throws Exception {\r\n TreeSet<Integer> s = new TreeSet<>();\r\n ArrayList<Integer> array = new ArrayList<>();\r\n array.add(1);\r\n array.add(2);\r\n array.add(3);\r\n s.addAll(array);\r\n assertTrue(s.contains(1));\r\n assertTrue(s.contains(2));\r\n assertTrue(s.contains(3));\r\n }", "public interface TransformsToUnsortedSetTrait extends RichIterableTestCase\n{\n @Override\n default <T> UnsortedSetIterable<T> getExpectedTransformed(T... elements)\n {\n return Sets.immutable.with(elements);\n }\n\n @Override\n default <T> MutableSet<T> newMutableForTransform(T... elements)\n {\n return Sets.mutable.with(elements);\n }\n\n @Override\n default MutableBooleanSet newBooleanForTransform(boolean... elements)\n {\n return new BooleanHashSet(elements);\n }\n\n @Override\n default MutableByteSet newByteForTransform(byte... elements)\n {\n return new ByteHashSet(elements);\n }\n\n @Override\n default MutableCharSet newCharForTransform(char... elements)\n {\n return new CharHashSet(elements);\n }\n\n @Override\n default MutableDoubleSet newDoubleForTransform(double... elements)\n {\n return new DoubleHashSet(elements);\n }\n\n @Override\n default MutableFloatSet newFloatForTransform(float... elements)\n {\n return new FloatHashSet(elements);\n }\n\n @Override\n default MutableIntSet newIntForTransform(int... elements)\n {\n return new IntHashSet(elements);\n }\n\n @Override\n default MutableLongSet newLongForTransform(long... elements)\n {\n return new LongHashSet(elements);\n }\n\n @Override\n default MutableShortSet newShortForTransform(short... elements)\n {\n return new ShortHashSet(elements);\n }\n}", "public static java.util.SortedSet synchronizedSortedSet(java.util.SortedSet arg0)\n { return null; }", "public MyHashSet() {\n s = new ArrayList<>();\n }", "GeneralizationSet createGeneralizationSet();", "@SuppressWarnings(\"rawtypes\")\n\t\tpublic static void main(String[] args) {\n\t Set<String> s=new TreeSet<String>();\n\n\t s.add(\"b\");\n\t s.add(\"a\");\n\t s.add(\"d\");\n\t s.add(\"c\");\n\t s.add(\"c\");\n\t s.add(\"d\");\n\t s.add(\"e\");\n\t \n\t Iterator it=s.iterator();\n\n\t while(it.hasNext())\n\t {\n\t String value=(String)it.next();\n\n\t System.out.println(\"Value :\"+value);\n\t }\n\t }", "public MyHashSet() {\n \n }", "public static void main(String[] args) {\n HashSet<String> hashSet = new HashSet<>();\n hashSet.add(\"Orange\");\n hashSet.add(\"Red\");\n hashSet.add(\"Pink\");\n hashSet.add(\"Red\");\n hashSet.add(\"White\");\n System.out.println(hashSet);\n TreeSet<String> treeSet = new TreeSet<>(hashSet);\n for (String color : treeSet) {\n System.out.println(color);\n }\n\n }", "public static void main(String[] args) {\n\n TreeSet<String> set = new TreeSet<String>();\n try {\n set.add(\"hello\");\n set.add(\"world\");\n set.add(\"welcome\");\n set.add(\"all\");\n set.add(\"all\");\n set.add(\"welcome\");\n\n for (String num : set) {\n System.out.println( num);\n\n }\n// set.add(null);\n } catch (NullPointerException e) {\n System.out.println(e);\n System.out.println(\"Set doesn't allow null value and duplicate value\");\n }\n\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 }", "Set<X> toSet();", "public interface OrderedSet<T> {\r\n\r\n\tpublic void put(T key);\r\n\t\r\n\tpublic int rank(T key);\r\n\t\r\n\tpublic boolean contains(T key);\r\n\t\r\n\tpublic T select(int rank);\r\n\t\r\n\tpublic T[] keys();\r\n\t\r\n\tpublic T[] keys(int lo,int hi);\r\n\r\n\tpublic T[] keys(T lo, T hi);\r\n\t\r\n\t//(key-1)find the predecessor\r\n\tpublic T floor(T key);\r\n\t\r\n\t//(key+1)find the successor\r\n\tpublic T ceiling(T key);\r\n}", "public static void main( String[] args )\n {\n OrderedSet set = new OrderedSet( true );\n set.add( new Integer( 6 ) );\n set.add( new Integer( 1 ) );\n set.add( new Integer( 4 ) );\n set.add( new Integer( 1 ) );\n System.out.println( set );\n System.out.println();\n\n System.out.println( \"Enumerate the OrderedSet\" );\n Enumeration e = set.elements();\n while ( e.hasMoreElements() )\n System.out.println( e.nextElement() );\n System.out.println();\n\n System.out.println( \"Iterate through the OrderedSet\" );\n for ( OrderedSetIterator i = set.begin(); !i.atEnd(); i.advance() )\n System.out.println( i.get() );\n System.out.println();\n\n System.out.println( \"Show that duplicates can be added.\" );\n set.add( new Integer( 8 ) );\n System.out.println( \"set = \" + set );\n\n set.add( new Integer( 4 ) );\n System.out.println( \"set = \" + set );\n }", "public static void main(String[] args) {\n ArrayList<Integer> nums = new ArrayList<>();\n nums.addAll( Arrays.asList(100, 2000, 50, 50, 100, 200, 300, 50));\n nums=new ArrayList<>(new TreeSet<>(nums));\n System.out.println(nums);\n\n String str1 = \"babababC\";\n str1 = new TreeSet<>( Arrays.asList(str1.split(\"\")) ).toString();\n System.out.println(str1);\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * - 2. Write a program that can REMOVE THE DUPLICATES from an ArrayList. DO NOT change the ORDER\n * -> LinkedHashSet -> Remove Duplicates and Keeps the Insertion Order\n */\n ArrayList<Integer> list = new ArrayList<>(Arrays.asList(6,6,6,6,5,5,5,4,4,4,4));\n list=new ArrayList<>(new LinkedHashSet<>(list));\n System.out.println(list);\n\n\n /**\n * - 1. Write a program that can remove the duplicated characters from String and store them into variable\n */\n String str = \"ABABABCDEF\";\n String[] arr = str.split(\"\");\n str = new LinkedHashSet<>(Arrays.asList(arr)).toString().replace(\", \", \"\");\n System.out.println(str);\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * -> Does not accept duplicates, and sort the objects\n * -> HashSet accepts null\n * -> HashSet is faster than TreeSet\n */\n HashSet<Integer> numbers = new HashSet<>(Arrays.asList(10,9,10, 9, 8, 7, 8, 7, 6, 5, 6, 1));\n System.out.println(numbers ); // -> [1, 5, 6, 7, 8, 9, 10]\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * - ITERATOR: -> is the only way to remove duplicates from collection\n * - removeIf -> removes numbers because it is uses the iterator interface internally. Iterator implicitly\n *\n * - hasNext() method only can go forward cant go backward. it stars from next index\n * - when we use it our loop hasNext() iterates from the next index\n * - iterator(); - hasNext(); - next(); - remove();\n */\n ArrayList<Integer> list2 = new ArrayList<>(Arrays.asList(1,1,2,2,3,3,4,4,5,5));\n list2.removeIf( p -> p < 4 );\n System.out.println(list2);\n\n\n ArrayList<Integer> list3 = new ArrayList<>(Arrays.asList(1,1,2,2,3,3,4,4,5,5));\n Iterator<Integer> it =list3.iterator(); // - this method will return iterator\n while( it.hasNext() ){ // - iterator explicitly. While loop only accept boolean\n if( it.next() < 4 ){\n it.remove();\n }\n }\n System.out.println(list3);\n\n\n ArrayList<Integer> list4 = new ArrayList<>(Arrays.asList(1,1,2,3,3,4,4,5,5));\n // - hasNext(); will iterate all the indexes. We do not need extra iterator in the loop\n for(Iterator<Integer> I = list4.iterator(); I.hasNext(); ){\n if( I.next() < 4) {\n I.remove();\n }\n }\n System.out.println(list4);\n\n\n\n LinkedHashSet<String> names = new LinkedHashSet<>();\n names.addAll(Arrays.asList( \"Mehmet\",\"Mohammed\",\"Yucel\",\"Sha\",\"Ozgur\", \"Ahmet\",\"Osmanj\",\"Ozgur\",\"Ozgur\",\"Irina\"));\n System.out.println(names);\n Iterator<String> it3 = names.iterator();\n while( it3.hasNext() ){\n String s = it3.next();\n if(s.contains(\"m\") || s.contains(\"M\")){ // - s.toLowerCase.contains(\"m\")\n it3.remove();\n }\n }\n System.out.println(names);\n\n /*\n ===============================================================\n for(Iterator<String> it3 = names.iterator(); it3.hasNext() ; ){\n String s = it3.next();\n if(s.toLowerCase().contains(\"m\")){\n it3.remove();\n }\n }\n ================================================================\n names.removeIf( s -> s.contains(\"m\") || s.contains(\"M\") );\n ================================================================\n names.removeAll( Arrays.asList( \"Mehmet\", \"Ozgur\", \"Mohammed\" ));\n ================================================================\n names.retainAll( Arrays.asList( \"Yucel\", \"Sha\", \"Ahmet\" ) );\n ================================================================\n boolean result = list.containsAll( Arrays.asList(5, 6, 9, 8, 11 ));\n */\n\n\n\n\n\n\n\n System.out.println(\"=========================================================================================\");\n\n\n\n\n\n }", "public BoundedTreeSet(Comparator<? super E> comparator, int size) {\n\t\tsuper(comparator);\n\t\tthis.size = size;\n\t}", "public static void main(String[] args) {\n\t\tTreeSet<Integer> ts = new TreeSet<Integer>();\n\t\tts.add(10);\n\t\tts.add(11);\n\t\tts.add(18);\n\t\tts.add(13);\n\t\tts.add(14);\n\t\tts.add(14);\n\t\t\n\t\tfor(Integer i:ts) {\n\t\t\tSystem.out.println(i);\n\t\t}\n\t}", "@Test\r\n public void descendingSet() throws Exception {\r\n TreeSet<Integer> kek = new TreeSet<>();\r\n kek.addAll(sInt);\r\n TreeSet<Integer> check = (TreeSet<Integer>) kek.descendingSet();\r\n check.add(43);\r\n assertTrue(check.contains(43));\r\n assertTrue(kek.contains(43));\r\n assertTrue(kek.remove(43));\r\n assertFalse(check.contains(43));\r\n assertFalse(kek.contains(43));\r\n }", "MultiSet<X> add(X x);", "public static void main(String[] args) {\n HashSetTest hashSetTest = new HashSetTest();\n hashSetTest.operations();\n //TreeSet\n TreesetTest treesetTest = new TreesetTest();\n treesetTest.operations();\n }", "public MyHashSet() {\n nodes = new Node[Max_Size];\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tSet list = new HashSet();\n\t\tlist.add(\"1\");\n\t\tlist.add(\"2\");\n\t\tlist.add(\"3\");\n\t\tlist.add(\"1\");\n\t\tlist.forEach(System.out::print); // 123\n\t\t\n\t\tSystem.out.println(\"---------------------------\");\n\t\t\n//\t\tStream<String> stream = Arrays.stream(new String[] {\"a\",\"b\",\"c\"});\n//\t\tString output = stream.filter(s->{ \n//\t\t\tif(s.compareTo(\"abc\") > 0)\n//\t\t\t\treturn true;\n//\t\t})\n//\t\t.peek(System.out::print)\n//\t\t.collect(Collectorsjoining()); //Compilation Fail Here\n//\t\tSystem.out.println(output);\n\t\t\n\t\t\n\t\tVector obj = new Vector(4,2);\n\t\tobj.addElement(new Integer(3));\n\t\tobj.addElement(new Integer(2));\n\t\tobj.addElement(new Integer(5));\n\t\tSystem.out.println(obj.capacity());\n\t\t\n\t\tSystem.out.println(\"---------------------------\");\n\t\t\n//\t\tSet _set = new HashSet();\n\t\tSet _set = new TreeSet();\n\t\t_set.add(new Integer(2));\n\t\t_set.add(new Integer(1));\n\t\tSystem.out.println(_set); // [1,2] TreeSet will Guaranteed Sorting\n\t\t\n\t\tSystem.out.println(\"---------------------------\");\n\t\t\n\t\tSet<Integer> ss = new HashSet<Integer>();\n\t\tInteger i1 = 45;\n\t\tInteger i2 = 46;\n\t\tss.add(i1);\n\t\tss.add(i1);\n\t\tss.add(i2);\n\t\tSystem.out.print(ss.size() + \" \");\n\t\tss.remove(i1);\n\t\tSystem.out.print(ss.size() + \" \");\n\t\ti2=47;\n\t\tss.remove(i2);\n\t\tSystem.out.print(ss.size() + \" \");\n\t\t\n\t\tSystem.out.println(\"---------------------------\");\n\t}", "public PortableSortedSet(Remote.Supplier<SortedSet<E>> supplier)\n {\n m_supplier = supplier;\n }", "Set<Node<K, V>> entrySet();", "public PTreeCredalSet(PotentialInterval intervalSet){\n super(intervalSet.getVariables());\n ProbabilityTree pTree;\n pTree=intervalsToPTreeCredalSet(intervalSet);\n setTree(pTree);\n }", "public PointSET() {\n mPoints = new TreeSet<Point2D>();\n }", "public DoComparator()\n {\n this(true, false, false);\n }", "public static void main(String[] args) {\r\n\t\t\tTreeSet t1=new TreeSet();\r\n\t\t\t\r\n\t\t\tt1.add(8);\r\n\t\t\tt1.add(88);\r\n\t\t\tt1.add(9);\r\n\t\t\tt1.add(8);\r\n\t\t\tt1.add(4);\r\n\t\t\t\r\n\t\t\tSystem.out.println(t1);\r\n\t\t\tSystem.out.println(\"---------------\");\r\n\r\n\r\n\t\t\t\r\n\t\t\tLinkedList l1=new LinkedList(t1);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tListIterator i=l1.listIterator();\r\n\t\t\t\r\n\t\t\twhile (i.hasPrevious())\r\n\t\t\t\tSystem.out.println(i.previous());\r\n\t\t\t}", "public interface MinTracker<T> {\n /** Compares an element x of a set to the current list of minimal elements\n * and modifies the set of minimal elements accordingly.\n * \n * @param x */\n void digest(T x);\n\n /** Retrieves the current set of minimal elements.\n * \n * @return Collection<T> of minimal elements */\n Collection<T> getMinElements();\n}", "public static void main(String[] args) {\n Set<String> list = new TreeSet<>();\n list.add(\"Song\");\n list.add(\"Album\");\n list.add(\"Artist\");\n list.add(\"Year\");\n list.add(\"Genre\");\n list.add(\"Song\");\n list.add(\"Song\");\n\n System.out.println();\n for(String x : list){\n System.out.println(x);\n }\n\n //NO REPITTED VALUES AND ASCENDED ORDER WHIT COMPARABLE, HASHCODE AND EQUALS\n Set<Persona> list2 = new TreeSet<>();\n list2.add(new Persona(1, \"Rayman\"));\n list2.add(new Persona(2, \"Castlevania\"));\n list2.add(new Persona(3, \"Silent Hill\"));\n list2.add(new Persona(4, \"Silent Hill\"));\n list2.add(new Persona(1, \"Rayman\"));\n\n System.out.println();\n for(Persona x : list2){\n System.out.println(x.getId() + \" - \" + x.getName());\n }\n }", "@Override\n public Set<K> keySet() {\n Set<K> keyset = new TreeSet<>();\n Inorder(root, keyset);\n return keyset;\n }", "@Test\r\n public void addAllFromSet() throws Exception {\r\n TreeSet<Integer> s = new TreeSet<>();\r\n s.addAll(sInt);\r\n assertTrue(s.contains(1));\r\n assertTrue(s.contains(2));\r\n assertTrue(s.contains(3));\r\n assertTrue(s.contains(4));\r\n assertTrue(s.contains(5));\r\n }", "@SuppressWarnings(\"unchecked\")\n public SortedOrderedBag() {\n this.comp = (Comparator<E>) DEFAULT_COMPARATOR;\n }", "public static void main(String args[]) {\n\t\tTreeSet<Car> treeset = new TreeSet<>();\r\n\r\n\t\ttreeset.add(new Car(\"Diablo\", 600000, 1998, \"Chrevolet\"));\r\n\t\ttreeset.add(new Car(\"Focus\", 300000, 1990, \"Fords\"));\r\n\t\ttreeset.add(new Car(\"Indica\", 200000, 1890, \"Tata\"));\r\n\r\n\t\t//Lambda expression for printing value\r\n\t\ttreeset.stream().forEach((name) -> System.out.println(name));\r\n\r\n\t}", "public static void main(String [] arguments){\n TreeSet<String> colors = new TreeSet<String>();\n\n // add to the Tree Set object\n colors.add(\"blue\");\n colors.add(\"yellow\");\n colors.add(\"green\");\n colors.add(\"red\");\n\n System.out.println(colors.size());\n\n //\n System.out.println(colors.first());\n System.out.println(colors.last());\n\n colors.remove(\"yellow\");\n\n System.out.println(\"After yellow was removed: \");\n\n for(String color : colors) {\n System.out.println(color);\n }\n\n System.out.println(\"Traveresing the Tree Set with a while loop:\");\n\n Iterator <String> iterator = colors.iterator();\n while(iterator.hasNext()) {\n System.out.println(iterator.next());\n }\n}", "public static void main(String[] args) {\n\t\tTreeSet<Integer> set = new TreeSet<Integer>();\n\t\tset.add(218);\n\t\tset.add(56);\n\t\tset.add(18);\n\t\tset.add(91);\n\t\tset.add(100);\n\t\tset.add(40);\n\t\tset.add(60);\n\t\tset.add(12);\n\n\t\tSystem.out.println(\"Elements of the treeset are: \" + set);\n\t\tSystem.out.println(\"Lowest value Stored in Java TreeSet is : \" + set.first());\n\t\tSystem.out.println(\"Highest value Stored in Java TreeSet is : \" + set.last());\n\n\t}", "public ListSet() {\n lists = new TernarySearchTree<>();\n }", "public HeapSet (Collection<T> collection) {\r\n\t\tsuper (collection);\r\n\t\tHeapSet.heapify (this);\r\n\t}", "private EmptySet() {}", "public static java.util.Set synchronizedSet(java.util.Set arg0)\n { return null; }", "public static <T> Set<T> AsSet(@NonNull T... ts) {\n return Create_UnModifiableSet_By_InputElements(new HashSet<T>(), ts);\n }", "private static <K, V> Set<Map.Entry<K, V>> getSortedEntrySet(Map<K, V> dict) {\n if (!(dict instanceof SortedMap<?, ?>)) {\n Map<K, V> tmp = new TreeMap<>(EvalUtils.SKYLARK_COMPARATOR);\n tmp.putAll(dict);\n dict = tmp;\n }\n\n return dict.entrySet();\n }" ]
[ "0.6879813", "0.67951417", "0.6719849", "0.6677616", "0.6601301", "0.6505895", "0.63417935", "0.63317716", "0.6330672", "0.6285445", "0.62366176", "0.61995775", "0.6197409", "0.61794776", "0.6083557", "0.60832787", "0.604703", "0.5993531", "0.59775907", "0.5958983", "0.59467685", "0.59446394", "0.594382", "0.5918728", "0.58635074", "0.5861024", "0.5859434", "0.58415514", "0.5804338", "0.5783685", "0.5780885", "0.5775031", "0.57725185", "0.57725084", "0.57711715", "0.5738235", "0.57322437", "0.56981546", "0.56760687", "0.5673609", "0.565382", "0.56489944", "0.5646492", "0.56379825", "0.561384", "0.56125647", "0.55980194", "0.5597733", "0.5556841", "0.55559456", "0.5551178", "0.5542328", "0.5530548", "0.55206895", "0.5509541", "0.55053294", "0.55026233", "0.5496593", "0.5489711", "0.5484049", "0.54743284", "0.5473838", "0.54516524", "0.54397404", "0.5439374", "0.5437309", "0.5435299", "0.54135406", "0.5399872", "0.5395638", "0.53951526", "0.5372856", "0.5367176", "0.53627515", "0.5346236", "0.53411955", "0.5290305", "0.5289268", "0.52837384", "0.52790684", "0.527482", "0.52743965", "0.52691025", "0.5265364", "0.52590626", "0.5248525", "0.5247425", "0.52457505", "0.5244848", "0.52342254", "0.52335346", "0.5219907", "0.5209211", "0.5208172", "0.5196898", "0.51907325", "0.51804763", "0.51798093", "0.5163759", "0.5163" ]
0.6650724
4
Lay doi tuong JSON bang duong dan ten ten moi node luu trong doi tuong danh sach
public static JsonElement getElementByPath(JsonObject root, List<String> list, JsonElement[] parent){ JsonElement ret = root; int i = 0; String s; try{ do{ if(i == list.size()){ return ret; } s = list.get(i++); if(parent != null){ parent[0] = ret; } ret = ((JsonObject)ret).get(s); if(ret == null || ret.isJsonNull()){ return null; } else if(ret.isJsonPrimitive()){ if(i < (list.size() - 1)){ return null; } else{ s = list.get(i); String str = ret.getAsString(); if(s.equals(str)){ return ret; } else{ return null; } } } else if (ret.isJsonArray()){ // tao lap duong dan con List<String> l = new ArrayList<>(); int j; for(j = i; j < list.size(); j++){ l.add(list.get(j)); } // tim kiem bat ky doi tuong con nao thao man JsonArray arr = (JsonArray)ret; boolean bFound = false; for(j = 0; j < arr.size(); j++){ ret = arr.get(j); ret = getElementByPath((JsonObject)ret, l, parent); if(ret != null){ bFound = true; break; } } if(!bFound){ ret = null; } return ret; } } while(true); } catch(Exception ex){ return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void leerCabezeraJson(JSONObject node){\n if( !REQUEST_STR.contentEquals(node.getString(NODE_TYPE_STR) ) ){\n throw new RuntimeException(Mensajes.ERR_FIRMA_JSON);\n }\n try{\n setScope(node.getString(REQUEST_SCOPE_STR));\n setIdentity(node.getString(REQUEST_IDENTITY_STR)); \n internalJSONToMetadata(node.getJSONObject(REQUEST_META_STR) );\n setCmd(node.getString(REQUEST_ID_STR));\n }\n catch(Exception e){\n throw new RuntimeException(Mensajes.ERR_FALTA_DATO+\" : \"+ e.getMessage());\n }\n if( this.mScope == null || this.mScope.equals(\"\") ||\n this.mIdentity == null || this.mIdentity.equals(\"\") ||\n this.mCurrentCommand == null || this.mCurrentCommand.equals(\"\")){\n \n throw new RuntimeException(Mensajes.ERR_DATO_VACIO);\n }\n \n }", "@Test\n\tpublic void languageTranslationJSONTest() {\n\t\tNDLLanguageTranslate detail = new NDLLanguageTranslate(\"author\");\n\t\tdetail.addValue(new NDLLanguageDetail(\"eng\", \"debasis jana\"), new NDLLanguageDetail(\"hin\", \"डेबसिस जन\"));\n\t\tdetail.addValue(new NDLLanguageDetail(\"eng\", \"tilak mu\"), new NDLLanguageDetail(\"hin\", \"\"),\n\t\t\t\tnew NDLLanguageDetail(\"ur\", \"तिलक मु\"));\n\t\tdetail.addValue(new NDLLanguageDetail(\"eng\", \"\"), new NDLLanguageDetail(\"hin\", \"\"));\n\t\tString json = NDLDataUtils.serializeLanguageTranslation(detail);\n\t\tNDLLanguageTranslate obtained = NDLDataUtils.desrializeLanguageTranslation(json);\n\t\tList<List<NDLLanguageDetail>> values = obtained.getValues();\n\t\tfor(List<NDLLanguageDetail> value : values) {\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "public void testJson() {\n\t\t\n\t\tSmallTalkEpisode episode = new SmallTalkEpisode();\n\t\tSmallTalkGespraech gespraech = new SmallTalkGespraech(0);\n\t\t\n\t\tSmallTalkJsonHelper testInstanz1 = new SmallTalkJsonHelper(\"We\", 2.34 , 0);\n\t\tSmallTalkJsonHelper testInstanz2 = new SmallTalkJsonHelper(\"Bez\", 5.24 , 0);\n\t\tSmallTalkJsonHelper testInstanz3 = new SmallTalkJsonHelper(\"Begr\", 22.34 , 1);\n\t\t\n\t\tJSONObject jsonObject = new JSONObject(testInstanz1);\n\t\tString myJson1 = jsonObject.toString();\n\t\tgespraech.addGespraech(myJson1);\n\t\t\n\t\tjsonObject = new JSONObject(testInstanz2);\n\t\tString myJson2 = jsonObject.toString();\n\t\tgespraech.addGespraech(myJson2);\n\t\t\n\t\tjsonObject = new JSONObject(testInstanz3);\n\t\tString myJson3 = jsonObject.toString();\n\t\tgespraech.addGespraech(myJson3);\n\t\t\n\t\tepisode.addGespraech(gespraech.createInnerJson());\n\t\t\n\t\tSmallTalkGespraech gespraech1 = new SmallTalkGespraech(1);\n\t\t\n\t\tSmallTalkJsonHelper testInstanz4 = new SmallTalkJsonHelper(\"We\", 2.34 , 0);\n\t\tSmallTalkJsonHelper testInstanz5 = new SmallTalkJsonHelper(\"Bez\", 5.24 , 0);\n\t\tSmallTalkJsonHelper testInstanz6 = new SmallTalkJsonHelper(\"Begr\", 22.34 , 1);\n\t\t\n\t\tjsonObject = new JSONObject(testInstanz1);\n\t\tString myJson4 = jsonObject.toString();\n\t\tgespraech1.addGespraech(myJson1);\n\t\t\n\t\tjsonObject = new JSONObject(testInstanz2);\n\t\tString myJson5 = jsonObject.toString();\n\t\tgespraech1.addGespraech(myJson2);\n\t\t\n\t\tjsonObject = new JSONObject(testInstanz3);\n\t\tString myJson6 = jsonObject.toString();\n\t\tgespraech1.addGespraech(myJson3);\n\t\t\n\t\tepisode.addGespraech(gespraech1.createInnerJson());\n\t\t\n\t\tSystem.out.println(episode.createInnerJson());\n\t\t\n\t\tFileSaver fileSaver = new FileSaver();\n\t\tfileSaver.stringAsJson(episode.createInnerJson(), \"FinalJson.json\");\n\t}", "private void loadDia() throws JSONException {\n\n\n String json = \"{\\n\" +\n \" \\\"mes\\\": 10,\\n\" +\n \" \\\"ano\\\": 2017,\\n\" +\n \" \\\"dias\\\":[\\n\" +\n \" {\\n\" +\n \" \\\"dia\\\":1,\\n\" +\n \" \\\"titulos\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"asd\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$4050,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdsaf\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$50,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"fdasfa\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$452,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 1,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"2a\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$450,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 2,\\n\" +\n \" \\\"sinal\\\": 2,\\n\" +\n \" \\\"grupo\\\": 2,\\n\" +\n \" \\\"nome\\\": \\\"1b\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$40,00\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"dia\\\":13,\\n\" +\n \" \\\"titulos\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 3,\\n\" +\n \" \\\"sinal\\\": 3,\\n\" +\n \" \\\"grupo\\\": 3,\\n\" +\n \" \\\"nome\\\": \\\"13a\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$450,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 4,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"13b\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$40,00\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"dia\\\":16,\\n\" +\n \" \\\"titulos\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 5,\\n\" +\n \" \\\"sinal\\\": 5,\\n\" +\n \" \\\"grupo\\\": 2,\\n\" +\n \" \\\"nome\\\": \\\"16a\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$52,00\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"dia\\\":18,\\n\" +\n \" \\\"titulos\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 6,\\n\" +\n \" \\\"sinal\\\": 4,\\n\" +\n \" \\\"grupo\\\": 3,\\n\" +\n \" \\\"nome\\\": \\\"18a\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$52,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 7,\\n\" +\n \" \\\"sinal\\\": 5,\\n\" +\n \" \\\"grupo\\\": 1,\\n\" +\n \" \\\"nome\\\": \\\"18a\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$2,00\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"id\\\": 8,\\n\" +\n \" \\\"sinal\\\": 1,\\n\" +\n \" \\\"grupo\\\": 2,\\n\" +\n \" \\\"nome\\\": \\\"18a\\\",\\n\" +\n \" \\\"valor\\\": \\\"R$2000,00\\\"\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \" }\\n\" +\n \" ]\\n\" +\n \"}\";\n\n\n //Toast.makeText(getApplicationContext(), \"certo\",Toast.LENGTH_LONG).show();\n }", "private JSON() {\n\t}", "public void constructJSONGraph(String name){\n \t IndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t .relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tHashMap<Node,Integer> nodenumbers = new HashMap<Node,Integer>();\n \t\tHashMap<Integer,Node> numbernodes = new HashMap<Integer,Node>();\n \t\tint count = 0;\n \t\tfor(Node friendnode: CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\tif (friendnode.hasRelationship(Direction.INCOMING)){\n \t\t\t\tnodenumbers.put(friendnode, count);\n \t\t\t\tnumbernodes.put(count,friendnode);\n \t\t\t\tcount += 1;\n \t\t\t}\n \t\t}\n \t\tPrintWriter outFile;\n \t\ttry {\n \t\t\toutFile = new PrintWriter(new FileWriter(\"graph_data.js\"));\n \t\t\toutFile.write(\"{\\\"nodes\\\":[\");\n \t\t\tfor(int i=0; i<count;i++){\n \t\t\t\tNode tnode = numbernodes.get(i);\n \t\t\t\toutFile.write(\"{\\\"name\\\":\\\"\"+tnode.getProperty(\"name\")+\"\");\n \t\t\t\toutFile.write(\"\\\",\\\"group\\\":\"+nodenumbers.get(tnode)+\"\");\n \t\t\t\toutFile.write(\"},\");\n \t\t\t}\n \t\t\toutFile.write(\"],\\\"links\\\":[\");\n \t\t\tfor(Node tnode: nodenumbers.keySet()){\n \t\t\t\tfor(Relationship trel : tnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\toutFile.write(\"{\\\"source\\\":\"+nodenumbers.get(trel.getStartNode())+\"\");\n \t\t\t\t\toutFile.write(\",\\\"target\\\":\"+nodenumbers.get(trel.getEndNode())+\"\");\n \t\t\t\t\toutFile.write(\",\\\"value\\\":\"+1+\"\");\n \t\t\t\t\toutFile.write(\"},\");\n \t\t\t\t}\n \t\t\t}\n \t\t\toutFile.write(\"]\");\n \t\t\toutFile.write(\"}\\n\");\n \t\t\toutFile.close();\n \t\t} catch (IOException e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t}", "private Node loadNode(JsonObject jsonNode) {\n Node returnedNode = null;\r\n\r\n returnedNode = loadStation(jsonNode);\r\n// case JSON_IS_LINE:\r\n// returnedNode = loadLine(jsonNode);\r\n// break;\r\n\r\n\r\n return returnedNode;\r\n }", "public static void main(String[] argv) throws ParseException \t\r\n {\r\n JSONParser jsParser = new JSONParser();\r\n\r\n \r\n \r\n Object ob;\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(FILENAME))) \r\n\t\t{\r\n\t\t\tob = jsParser.parse(br);\r\n\t System.out.println(ob);\r\n\r\n\t JSONObject json = (JSONObject) jsParser.parse(ob.toString());\r\n\t \r\n\r\n\t System.out.println(\"name=\" + json.get(\"jeuadmin-result\")); // name=MyNode\r\n\t \r\n JSONArray msgList =(JSONArray) json.get(\"values\");\r\n Iterator<String>iterator = msgList.iterator();\r\n \r\n/*\r\n Iterator<String>iterator = msgList.iterator();\r\n while(iterator.hasNext()) \r\n {\r\n System.out.println(iterator.next());\r\n }\r\n\r\n*/\r\n\t \r\n\t System.out.println(\"name=\" + \"\"); // name=MyNode\r\n\r\n//\t System.out.println(\"width=\" + json.get(\"width\")); // width=200\r\n\t\r\n\t\t} \r\n\t\tcatch (IOException e) \r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t} \r\n\t\t\r\n/*\r\n Object ob;\r\n\t\ttry \r\n\t\t{\r\n\t\t\tob = jsParser.parse(txt);\r\n\t System.out.println(ob); // {\"name\":\"MyNode\", \"width\":200, \"height\":100}\r\n\t JSONObject json = (JSONObject) jsParser.parse(txt);\r\n\t System.out.println(\"name=\" + json.get(\"name\")); // name=MyNode\r\n\t System.out.println(\"width=\" + json.get(\"width\")); // width=200\r\n\t\t} \r\n\t\tcatch (ParseException e) \r\n\t\t{\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n*/\r\n\t\t\r\n }", "@Test\n public void testNodeDefault() throws Exception, JSONException {\n WebResource r = resource();\n ClientResponse response = r.path(\"ws\").path(\"v1\").path(\"node\").get(ClientResponse.class);\n Assert.assertEquals((((MediaType.APPLICATION_JSON) + \"; \") + (JettyUtils.UTF_8)), response.getType().toString());\n JSONObject json = response.getEntity(JSONObject.class);\n verifyNodeInfo(json);\n }", "@Test(timeout = 4000)\n public void test22() throws Throwable {\n Integer integer0 = new Integer((-821));\n JSONObject jSONObject0 = new JSONObject(integer0);\n String string0 = \"53N/{T[\";\n JSONObject jSONObject1 = jSONObject0.put(\"53N/{T[\", (-1913.632));\n jSONObject1.toString((-821));\n jSONObject0.optString(\"53N/{T[\", \"53N/{T[\");\n jSONObject0.opt(\",2fHJL;.]tm*PJ9\");\n jSONObject0.optLong((String) null);\n jSONObject0.toString((-821));\n Byte byte0 = new Byte((byte)1);\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n JSONObject jSONObject2 = jSONObject1.put(\"|f}%!.^JO \", (Collection) linkedList0);\n JSONObject jSONObject3 = jSONObject2.accumulate(\"o%,g eOJ=9n\\\"\", \"java.lang.Double@0000000003\");\n try { \n jSONObject3.getJSONObject(\"{\\n\\\"java.lang.String@0000000002\\\": java.lang.Double@0000000003,\\n\\\"java.lang.String@0000000004\\\": \\\"java.lang.Class@0000000005\\\"\\n}\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"{\\\\n\\\\\\\"java.lang.String@0000000002\\\\\\\": java.lang.Double@0000000003,\\\\n\\\\\\\"java.lang.String@0000000004\\\\\\\": \\\\\\\"java.lang.Class@0000000005\\\\\\\"\\\\n}\\\"] not found.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "String getJson();", "String getJson();", "String getJson();", "public String treeJSON() {\n\t\ttry{\r\n\t\tList trees = this.getTransedTrees();\r\n\t\tString result = this.treeJSON(trees);\r\n\t\treturn result;\r\n\t\t}catch(Exception e){\r\n\t\t\tlog.info(\">>>>faceye error in method:treeJSON() is\"+e.toString());\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\t\r\n\t}", "protected void verificarEstructuraJson(JSONObject node){\n Set<String> keys = node.keySet();\n \n for( String key : keys ){\n if( key.contentEquals(NODE_TYPE_STR) || key.contentEquals(REQUEST_SCOPE_STR) || key.contentEquals(REQUEST_IDENTITY_STR) ||\n key.contentEquals(REQUEST_META_STR) || key.contentEquals(REQUEST_ID_STR) || key.contentEquals(REQUEST_DATA_STR)){ \n }\n else{\n throw new RuntimeException(Mensajes.ERR_SIN_FORMATO_JSON);\n }\n }\n }", "String getJSON();", "public abstract T zzb(JSONObject jSONObject);", "private Tamagotchi tamagotchiToJson(JSONObject jsonObject) {\n String name = jsonObject.getString(\"name\");\n Tamagotchi tr = new Tamagotchi(name);\n return tr;\n }", "@Test\n public void testNodeInfoDefault() throws Exception, JSONException {\n WebResource r = resource();\n ClientResponse response = r.path(\"ws\").path(\"v1\").path(\"node\").path(\"info\").get(ClientResponse.class);\n Assert.assertEquals((((MediaType.APPLICATION_JSON) + \"; \") + (JettyUtils.UTF_8)), response.getType().toString());\n JSONObject json = response.getEntity(JSONObject.class);\n verifyNodeInfo(json);\n }", "String toJSON();", "TorrentJsonParser getJsonParser();", "public String getJson();", "void process(JsonNode document);", "private void createLearnJSON(){\n json = new JSONObject();\n\n try {\n json.put(\"userID\", global.getUserID());\n StringBuilder p1 = new StringBuilder();\n for (String s: global.getWords()){\n p1.append(p1.toString().equals(\"\") ? s : (\" \" + s));\n }\n json.put(\"p1\", p1.toString());\n json.put(\"p2\", url);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Path(\"/node\")\n @GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response nodeRead() {\n HashMap<String, String> schema = new HashMap<>();\n schema.put(\"key_url\",\"string\");\n schema.put(\"num_inlinks\", \"int\");\n schema.put(\"num_outlinks\",\"int\");\n schema.put(\"inlink_score\",\"float\"); \n schema.put(\"outlink_score\",\"float\"); \n schema.put(\"metadata\",\"string\");\n return Response.ok(schema).type(MediaType.APPLICATION_JSON).build();\n }", "void mo28373a(JSONObject jSONObject);", "@Override\n\tpublic void updateNode(JsonObject jsonData) {\n\t\t\n\t}", "private void createJSON(){\n json = new JSONObject();\n JSONArray userID = new JSONArray();\n JSONArray palabras = new JSONArray();\n JSONArray respuesta = new JSONArray();\n\n @SuppressLint(\"SimpleDateFormat\") DateFormat formatForId = new SimpleDateFormat(\"yyMMddHHmmssSSS\");\n String id = formatForId.format(new Date()) + \"_\" + android_id;\n userID.put(id);\n global.setUserID(id);\n\n for (int i = 0; i < global.getWords().size() && i < 7; i++){\n palabras.put(global.getWords().get(i));\n }\n\n respuesta.put(url);\n\n try {\n json.put(\"userID\", userID);\n json.put(\"palabras\", palabras);\n json.put(\"respuesta\", respuesta);\n } catch (JSONException e) {\n e.printStackTrace();\n }\n }", "@Test(timeout = 4000)\n public void test18() throws Throwable {\n Byte byte0 = new Byte((byte)39);\n Byte.toUnsignedLong((byte)44);\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"] is not a JSONArray.\";\n stringArray0[1] = \"*bpp)j7=\";\n stringArray0[2] = \"B7?dng\";\n JSONObject jSONObject0 = new JSONObject(byte0, stringArray0);\n JSONObject jSONObject1 = jSONObject0.put(\"] is not a JSONArray.\", (double) (byte)39);\n jSONObject0.toString((int) (byte)39);\n jSONObject0.optString(\"a2H;Fk;R703/.\", \"] is not a JSONArray.\");\n jSONObject0.opt(\"{\\\"java.lang.String@0000000002\\\": java.lang.Double@0000000003}\");\n jSONObject0.optLong(\"ik\");\n jSONObject0.toString((int) (byte)39);\n int int0 = new Byte((byte)97);\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n jSONObject0.put(\"*bpp)j7=\", (Collection) linkedList0);\n jSONObject1.accumulate(\"] is not a JSONArray.\", linkedList0);\n try { \n jSONObject0.getJSONObject(\"{\\\"java.lang.String@0000000002\\\": java.lang.Double@0000000003}\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"{\\\\\\\"java.lang.String@0000000002\\\\\\\": java.lang.Double@0000000003}\\\"] not found.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "public void lite() {\n\t\t\r\n\t\tthis.setJson(\"[]\");\r\n\t\t\r\n\t\t\r\n\t}", "public void jsonPresentation () {\n System.out.println ( \"****** Json Data Module ******\" );\n ArrayList<Book> bookArrayList = new ArrayList<Book>();\n String jsonData = \"\";\n ObjectMapper mapper = new ObjectMapper();\n bookArrayList = new Request().postRequestBook();\n try {\n jsonData = mapper.writeValueAsString(bookArrayList);\n } catch (JsonProcessingException e) {\n System.out.println(\"Error: \"+ e);\n }\n System.out.println(jsonData);\n ClientEntry.showMenu ( );\n }", "public void fiddle(String jso) {\n\n Lexicon dict = gson.fromJson(jso,Lexicon.class);\n\n Log.i(TAG,\"POJO Success: language = \" + dict.getLanguage() );\n for (String s : dict.dictionary.keySet()) {\n Log.i(TAG,\"key = \" + s + \" value = \" + dict.dictionary.get(s));\n }\n\n String jsonString = gson.toJson(jso);\n Log.i(TAG,\"jsonString = \" + jsonString);\n\n DictionaryAdapter adapter = new DictionaryAdapter(dict.getDictionary());\n ListView lv = (ListView) findViewById(R.id.dictview);\n lv.setAdapter(adapter);\n }", "@Test(timeout = 4000)\n public void test041() throws Throwable {\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n String string0 = JSONObject.valueToString(linkedList0);\n assertEquals(\"[]\", string0);\n }", "public List<List<HashMap<String,String>>> parse(JSONObject jObject){\n // Khoi tao cac mang\n List<List<HashMap<String, String>>> routes = new ArrayList<List<HashMap<String,String>>>() ;\n JSONArray jRoutes = null;\n JSONArray jLegs = null;\n JSONArray jSteps = null;\n try {\n // Truy cap vao phan tu chua danh sach tuyen duong\n jRoutes = jObject.getJSONArray(\"routes\");\n for(int i = 0; i < jRoutes.length(); i++){\n jLegs = ((JSONObject)jRoutes.get(i)).getJSONArray(\"legs\");\n List path = new ArrayList<HashMap<String, String>>();\n // Phan tich cac buoc\n for(int j = 0; j < jLegs.length(); j++){\n jSteps = ( (JSONObject)jLegs.get(j)).getJSONArray(\"steps\");\n // Phan tich cac diem\n for(int k = 0; k < jSteps.length(); k++){\n // Danh sach cac duong thang\n String polyline = \"\";\n polyline = (String)((JSONObject)((JSONObject)jSteps.get(k)).get(\"polyline\")).get(\"points\");\n // Giai ma cac duong thang duoc ve tren ban do\n List list = decodePoly(polyline);\n // Gan danh sach cac diem\n for(int l=0;l <list.size();l++){\n HashMap<String, String> hm = new HashMap<String, String>();\n hm.put(\"lat\", Double.toString(((LatLng)list.get(l)).latitude) );\n hm.put(\"lng\", Double.toString(((LatLng)list.get(l)).longitude) );\n path.add(hm);\n }\n }\n routes.add(path);\n }\n }\n } catch (JSONException e) {\n e.printStackTrace();\n }catch (Exception e){\n }\n return routes;\n }", "protected String getJSON() {\n/*Generated! Do not modify!*/ return gson.toJson(replyDTO);\n/*Generated! Do not modify!*/ }", "public JSONObject transformer() {\n JSONObject jsonObject = new JSONObject();\n JSONArray listening = new JSONArray();\n JSONArray listening_correction = new JSONArray();\n JSONArray reading = new JSONArray();\n JSONArray reading_correction = new JSONArray();\n JSONArray historique = new JSONArray();\n\n for (int i = 0; i < this.listening.size(); i++) {\n listening.put(this.listening.get(i).whoIs());\n listening_correction.put(this.listening_correction.get(i).whoIs());\n }\n\n for (int j = 0; j < this.reading.size(); j++) {\n reading.put(this.reading.get(j).whoIs());\n reading_correction.put(this.reading_correction.get(j).whoIs());\n }\n\n for(int k=0; k < this.historique.size(); k++){\n historique.put( transforme(this.historique.get(k)) );\n }\n\n try {\n jsonObject.put(\"nom\", this.nom);\n jsonObject.put(\"listening\", listening);\n jsonObject.put(\"reading\", reading);\n jsonObject.put(\"listening_correction\", listening_correction);\n jsonObject.put(\"reading_correction\", reading_correction);\n jsonObject.put(\"historique\",historique);\n jsonObject.put(\"etat\", this.etat);\n jsonObject.put(\"mode\", this.mode);\n jsonObject.put(\"est_termine\", this.est_termine);\n jsonObject.put(\"chronometre\", this.chronometre);\n Log.i(\"jsonObject\",jsonObject.toString());\n } catch (JSONException e) {\n e.printStackTrace();\n }\n return jsonObject;\n }", "JsonNode updateData(String data);", "@GET\n @Produces(\"application/json\")\n public String getJson() {\n\n JSONObject rezultat = new JSONObject();\n\n List<Korisnici> korisnici = korisniciFacade.findAll();\n\n \n\n try {\n for (Korisnici k : korisnici) {\n if (k.getIdkorisnik() == Long.parseLong(id)) {\n\n SoapListaAdresa soapOdgovor = listaDodanihAdresaBesplatno(k.getKorisnickoime(), k.getLozinka());\n\n List<Adresa> adrese = soapOdgovor.getAdrese();\n \n JSONArray jsonPolje = new JSONArray();\n int brojac = 0;\n for (Adresa a : adrese) {\n JSONObject jsonAdresa = new JSONObject();\n jsonAdresa.put(\"idadresa\", a.getIdadresa());\n jsonAdresa.put(\"adresa\", a.getAdresa());\n jsonAdresa.put(\"lat\", a.getGeoloc().getLatitude());\n jsonAdresa.put(\"long\", a.getGeoloc().getLongitude());\n jsonPolje.put(brojac,jsonAdresa);\n brojac++;\n }\n rezultat.put(\"adrese\", jsonPolje);\n } \n }\n return rezultat.toString();\n } catch (JSONException ex) {\n Logger.getLogger(MeteoRESTResource.class.getName()).log(Level.SEVERE, null, ex);\n }\n return null;\n }", "@Test\r\n public void testInjestjson() {\r\n System.out.println(\"injest\");\r\n String doc = \"/imageword/words.json\";\r\n String json = \"{\\\"imageWords\\\":[{\\\"url\\\":\\\"crowd.svg\\\",\\\"textSrc\\\":null,\\\"metaInfo\\\":null,\\\"corelation\\\":null,\\\"id\\\":1,\\\"imageName\\\":\\\"Crowd\\\",\\\"dataSource\\\":\\\"<svg xmlns=\\\\\\\"http://www.w3.org/2000/svg\\\\\\\" xmlns:xlink=\\\\\\\"http://www.w3.org/1999/xlink\\\\\\\" version=\\\\\\\"1.0\\\\\\\" x=\\\\\\\"0px\\\\\\\" y=\\\\\\\"0px\\\\\\\" width=\\\\\\\"100px\\\\\\\" height=\\\\\\\"100px\\\\\\\" viewBox=\\\\\\\"0 0 100 100\\\\\\\" enable-background=\\\\\\\"new 0 0 100 100\\\\\\\" xml:space=\\\\\\\"preserve\\\\\\\">\\\\n <path d=\\\\\\\"M19.453,27.837c3.151,0,5.698-2.551,5.698-5.697c0-3.15-2.546-5.702-5.698-5.702 c-3.15,0-5.696,2.551-5.696,5.702C13.757,25.286,16.303,27.837,19.453,27.837z\\\\\\\"/>\\\\n <circle cx=\\\\\\\"81.189\\\\\\\" cy=\\\\\\\"22.138\\\\\\\" r=\\\\\\\"5.699\\\\\\\"/>\\\\n <path d=\\\\\\\"M50.35,27.837c3.147,0,5.697-2.551,5.697-5.697c0-3.15-2.55-5.702-5.697-5.702 c-3.151,0-5.702,2.551-5.702,5.702C44.648,25.286,47.199,27.837,50.35,27.837z\\\\\\\"/>\\\\n <circle cx=\\\\\\\"81.189\\\\\\\" cy=\\\\\\\"22.138\\\\\\\" r=\\\\\\\"5.699\\\\\\\"/>\\\\n <path d=\\\\\\\"M89.036,35.577l9.913-11.868c1.292-1.549,1.085-3.858-0.467-5.151c-1.551-1.293-3.85-1.086-5.146,0.462 c0,0-7.637,9.068-7.658,9.057c-1.274,1.124-2.936,1.811-4.763,1.811c-1.71,0-3.278-0.597-4.507-1.59 c-0.019,0.007-0.01,0.004-0.006,0l-7.873-9.277c-0.771-0.923-1.904-1.366-3.019-1.301c-1.116-0.064-2.242,0.378-3.018,1.301 c0,0-7.637,9.068-7.654,9.057c-1.273,1.124-2.939,1.811-4.763,1.811c-1.709,0-3.278-0.597-4.507-1.59h-0.004l-7.875-9.277 c-0.78-0.93-1.92-1.372-3.044-1.301c-1.128-0.071-2.274,0.371-3.045,1.301c0,0-7.64,9.068-7.658,9.057 c-1.273,1.124-2.939,1.811-4.768,1.811c-1.71,0-3.274-0.597-4.507-1.59l-7.878-9.277c-1.292-1.549-3.596-1.756-5.146-0.462 c-1.552,1.292-1.755,3.602-0.463,5.151L11.61,36.194v12.185c0,0.337,0.026,0.661,0.071,0.987l-1.595,30.765 c-0.146,2.055,1.405,3.838,3.458,3.979c2.054,0.141,3.834-1.401,3.975-3.459l1.269-24.463c0.224,0.017,0.44,0.035,0.665,0.035 c0.273,0,0.542-0.014,0.807-0.044l1.679,24.472c0.137,2.058,1.921,3.6,3.978,3.459c2.05-0.142,3.605-1.925,3.46-3.979 l-2.124-30.939c0.026-0.267,0.044-0.541,0.044-0.813V35.577l7.35-8.799l7.861,9.417v2.594L39,62.291h2.903l-0.925,17.84 c-0.141,2.055,1.405,3.838,3.458,3.979c2.058,0.141,3.842-1.401,3.983-3.459l0.952-18.36h2.199l1.255,18.36 c0.15,2.058,1.93,3.6,3.983,3.459c2.054-0.142,3.604-1.925,3.463-3.979l-1.225-17.84h2.864L58.193,37.37v-1.793l7.318-8.764 l7.838,9.382v12.185c0,0.337,0.021,0.661,0.067,0.987l-1.596,30.765c-0.141,2.055,1.405,3.838,3.458,3.979 c2.054,0.141,3.838-1.401,3.983-3.459l1.267-24.463c0.215,0.017,0.436,0.035,0.66,0.035c0.271,0,0.542-0.014,0.807-0.044 l1.674,24.472c0.145,2.058,1.929,3.6,3.983,3.459c2.05-0.142,3.601-1.925,3.459-3.979l-2.125-30.939 c0.032-0.267,0.049-0.541,0.049-0.813V35.577z\\\\\\\"/>\\\\n <circle cx=\\\\\\\"81.189\\\\\\\" cy=\\\\\\\"22.138\\\\\\\" r=\\\\\\\"5.699\\\\\\\"/>\\\\n </svg>\\\",\\\"tag\\\":\\\"crowd\\\"},{\\\"url\\\":\\\"happy.svg\\\",\\\"textSrc\\\":null,\\\"metaInfo\\\":null,\\\"corelation\\\":null,\\\"id\\\":13,\\\"imageName\\\":\\\"Happy\\\",\\\"dataSource\\\":\\\"<svg xmlns=\\\\\\\"http://www.w3.org/2000/svg\\\\\\\" xmlns:xlink=\\\\\\\"http://www.w3.org/1999/xlink\\\\\\\" version=\\\\\\\"1.1\\\\\\\" x=\\\\\\\"0px\\\\\\\" y=\\\\\\\"0px\\\\\\\" width=\\\\\\\"100px\\\\\\\" height=\\\\\\\"100px\\\\\\\" viewBox=\\\\\\\"0 0 100 100\\\\\\\" enable-background=\\\\\\\"new 0 0 100 100\\\\\\\" xml:space=\\\\\\\"preserve\\\\\\\">\\\\n <path d=\\\\\\\"M49.998,4C24.596,4,4,24.597,4,50c0,25.405,20.596,46,45.998,46C75.404,96,96,75.405,96,50C96,24.597,75.404,4,49.998,4z M49.998,86C30.119,86,14,69.882,14,50c0-19.883,16.119-36,35.998-36C69.883,14,86,30.117,86,50C86,69.882,69.883,86,49.998,86z\\\\\\\"></path>\\\\n <circle cx=\\\\\\\"36.5\\\\\\\" cy=\\\\\\\"38.86\\\\\\\" r=\\\\\\\"6.667\\\\\\\"></circle>\\\\n <circle cx=\\\\\\\"63.5\\\\\\\" cy=\\\\\\\"38.86\\\\\\\" r=\\\\\\\"6.667\\\\\\\"></circle>\\\\n <path d=\\\\\\\"M70.84,57.883c-2.119-1.297-4.89-0.629-6.187,1.49c-2.71,4.431-8.462,7.293-14.653,7.293s-11.943-2.862-14.653-7.293 c-1.297-2.119-4.067-2.787-6.187-1.49c-2.12,1.297-2.787,4.067-1.49,6.188C32.046,71.223,40.602,75.666,50,75.666 s17.955-4.443,22.331-11.596C73.628,61.95,72.961,59.18,70.84,57.883z\\\\\\\"></path>\\\\n </svg>\\\",\\\"tag\\\":\\\"happy\\\"},{\\\"url\\\":\\\"man.svg\\\",\\\"textSrc\\\":null,\\\"metaInfo\\\":null,\\\"corelation\\\":null,\\\"id\\\":5,\\\"imageName\\\":\\\"Man\\\",\\\"dataSource\\\":\\\"<svg version=\\\\\\\"1.0\\\\\\\" id=\\\\\\\"Layer_1\\\\\\\" xmlns=\\\\\\\"http://www.w3.org/2000/svg\\\\\\\" xmlns:xlink=\\\\\\\"http://www.w3.org/1999/xlink\\\\\\\" x=\\\\\\\"0px\\\\\\\" y=\\\\\\\"0px\\\\\\\" width=\\\\\\\"100px\\\\\\\" height=\\\\\\\"100px\\\\\\\" viewBox=\\\\\\\"0 0 37.207 100\\\\\\\" enable-background=\\\\\\\"new 0 0 37.207 100\\\\\\\" xml:space=\\\\\\\"preserve\\\\\\\">\\\\n<circle cx=\\\\\\\"18.118\\\\\\\" cy=\\\\\\\"8.159\\\\\\\" r=\\\\\\\"8.159\\\\\\\"></circle>\\\\n<path d=\\\\\\\"M8.472,95.426c0,2.524,2.05,4.574,4.574,4.574c2.529,0,4.576-2.05,4.576-4.574l0.004-38.374h2.037L19.65,95.426\\\\n\\\\tc0,2.524,2.048,4.574,4.574,4.574s4.573-2.05,4.573-4.574l0.02-66.158h2.006v24.38c0,4.905,6.398,4.905,6.384,0v-24.9\\\\n\\\\tc0-5.418-3.184-10.728-9.523-10.728L9.396,18.012C3.619,18.012,0,22.722,0,28.599v25.05c0,4.869,6.433,4.869,6.433,0v-24.38h2.048\\\\n\\\\tL8.472,95.426z\\\\\\\"></path>\\\\n</svg>\\\",\\\"tag\\\":\\\"man, person\\\"}]}\";\r\n IwRepoDAOMarkLogicImplStud instance = new IwRepoDAOMarkLogicImplStud();\r\n boolean expResult = true;\r\n boolean result = instance.injestJson(doc, json);\r\n assertEquals(expResult, result);\r\n }", "private void ophalen(Conversation conversation) {\r\n\t\tJsonObject lJsonObjectIn = (JsonObject) conversation.getRequestBodyAsJSON();\r\n\t\tString klasnaam = ((klasnaam = lJsonObjectIn.getString(\"klas\")) != null) ? klasnaam : \"V1B\"; //als er geen klas is aangeklikt gebruik V1B\r\n\t\tKlas lKlas = informatieSysteem.getKlas(klasnaam);\t\r\n ArrayList<Student> lStudentenVanKlas = lKlas.getStudenten();\r\n\t\tJsonArrayBuilder lJsonArrayBuilder = Json.createArrayBuilder();\r\n\t\tfor (Student lMedeStudent : lStudentenVanKlas) {\r\n\t\t\t\tJsonObjectBuilder lJsonObjectBuilderVoorStudent = Json.createObjectBuilder();\r\n\t\t\t\tString lLastName = lMedeStudent.getVolledigeAchternaam();\r\n\t\t\t\tlJsonObjectBuilderVoorStudent\r\n\t\t\t\t\t.add(\"id\", lMedeStudent.getStudentNummer())\t\r\n\t\t\t\t\t.add(\"firstName\", lMedeStudent.getVoornaam())\t\r\n\t\t\t\t\t.add(\"lastName\", lLastName)\t\t\t\t \r\n\t\t\t\t .add(\"presence\", lMedeStudent.getAanwezigheid())\t\r\n\t\t\t\t\t.add(\"absent\", false);\r\n\t\t\t lJsonArrayBuilder.add(lJsonObjectBuilderVoorStudent);\t\t\r\n\t\t}\r\n String lJsonOutStr = lJsonArrayBuilder.build().toString();\r\n\t\tconversation.sendJSONMessage(lJsonOutStr);\t\r\n\t}", "void mo16412a(String str, JSONObject jSONObject);", "JsonObject raw();", "private void parseJson(JSONObject json) {\n try {\n nameRes = new String[json.getJSONArray(\"data\").length()];\n idRes = new String[json.getJSONArray(\"data\").length()];\n photoRes = new String[json.getJSONArray(\"data\").length()];\n bi_id = new BigInteger[json.getJSONArray(\"data\").length()];\n\n for(int i = 0; i < json.getJSONArray(\"data\").length();i++){\n JSONObject record = json.getJSONArray(\"data\").getJSONObject(i);\n nameRes[i] = record.getString(\"name\");\n photoRes[i] = record.getJSONObject(\"picture\").getJSONObject(\"data\").getString(\"url\");\n idRes[i] = record.getString(\"id\");\n String temp_id = record.getString(\"id\");\n BigInteger final_id = new BigInteger(temp_id);\n bi_id[i] = final_id;\n //System.out.println(photoRes[i]);\n //System.out.println(\"main____\"+nameRes[0]);\n }\n\n// listems = new ArrayList<Map<String, Object>>();\n// for (int i = 0; i < nameRes.length; i++) {\n// listem = new HashMap<String, Object>();\n// listem.put(\"photo\", photoRes[i]);\n// listem.put(\"name\", nameRes[i]);\n// listem.put(\"id\", idRes[i]);\n// listem.put(\"bi_id\", bi_id[i]);\n// listems.add(listem);\n// }\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n/*\n List<Map<String, Object>> listems = new ArrayList<Map<String, Object>>();\n for (int i = 0; i < nameRes.length; i++) {\n Map<String, Object> listem = new HashMap<String, Object>();\n listem.put(\"photo\", photoRes[i]);\n listem.put(\"name\", nameRes[i]);\n\n listems.add(listem);\n }*/\n }", "@Test(timeout = 4000)\n public void test086() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n JSONArray jSONArray0 = new JSONArray();\n String string0 = \"su\";\n JSONObject jSONObject1 = jSONObject0.append(\"su\", jSONArray0);\n StringWriter stringWriter0 = new StringWriter();\n jSONObject1.write(stringWriter0);\n jSONObject1.optDouble(\"8k\\\"]Uu:+Wz~|:~8#4\");\n jSONObject1.isNull(\"su\");\n try { \n jSONObject1.getDouble(\"su\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"su\\\"] is not a number.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "@SuppressWarnings(\"unchecked\")\n\tprivate void ucitajRestorane(String contextPath) {\n\t\tFileWriter fileWriter = null;\n\t\tBufferedReader in = null;\n\t\tFile file = null;\n\t\ttry {\n\t\t\tfile = new File(contextPath + \"/data/restorani.txt\");\n\t\t\tin = new BufferedReader(new FileReader(file));\n\n\t\t\tObjectMapper objectMapper = new ObjectMapper();\n\t\t\tobjectMapper.setVisibilityChecker(\n\t\t\t\t\tVisibilityChecker.Std.defaultInstance().withFieldVisibility(JsonAutoDetect.Visibility.ANY));\n\t\t\tTypeFactory factory = TypeFactory.defaultInstance();\n\t\t\tMapType type = factory.constructMapType(HashMap.class, String.class, Restoran.class);\n\t\t\tobjectMapper.getFactory().configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true);\n\t\t\trestorani = ((HashMap<Integer, Restoran>) objectMapper.readValue(file, type));\n\t\t} catch (FileNotFoundException fnfe) {\n\t\t\ttry {\n\t\t\t\tfile.createNewFile();\n\t\t\t\tfileWriter = new FileWriter(file);\n\t\t\t\tObjectMapper objectMapper = new ObjectMapper();\n\t\t\t\tobjectMapper.configure(SerializationFeature.INDENT_OUTPUT, true);\n\t\t\t\tobjectMapper.getFactory().configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true);\n\t\t\t\tString stringRestaurants = objectMapper.writeValueAsString(restorani);\n\t\t\t\tfileWriter.write(stringRestaurants);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tif (fileWriter != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.close();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t} finally {\n\t\t\tif (in != null) {\n\t\t\t\ttry {\n\t\t\t\t\tin.close();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void guardarEnJSON () {\n Gson gson = new GsonBuilder().setPrettyPrinting().create();\n String s = gson.toJson(this);\n try {\n FileWriter fw = new FileWriter(\"files/graph.json\");\n fw.write(s);\n fw.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "@Test(timeout = 4000)\n public void test058() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n JSONArray jSONArray0 = new JSONArray();\n String string0 = \"su\";\n JSONObject jSONObject1 = jSONObject0.append(\"su\", jSONArray0);\n try { \n jSONObject1.getJSONObject(\"su\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"su\\\"] is not a JSONObject.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "public String readJson() {\n\t\t\tif (lastReadChar == ']') {\n\t\t\t\tSystem.out.println(\"Nunca deberia llegar a aca si usa hasNext()\");\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Si fue una coma, busco el siguiente '{'\n\t\t\twhile (read()!= '{');\n\t\t\t\n\t\t\tStringBuilder jsonText = new StringBuilder();\n\t\t\tjsonText.append((char) '{');\n\t\t\tlastReadChar = read();\n\t\t\t\n\t\t\twhile (lastReadChar != '}') { \n\t\t\t\tjsonText.append((char) lastReadChar);\n\t\t\t\tlastReadChar = read();\n\t\t\t} jsonText.append('}');\n\t\t\t\n\t\t\t// To satisfy Invariant: find the next ']' or ','\n\t\t\twhile (lastReadChar != ']' && lastReadChar != ',') lastReadChar = read(); \n\t\t\t\n\t\t\t//System.out.println(\"Analizando : \" + jsonText.toString());\n\t\t\treturn jsonText.toString();\n\t\t}", "private String notificacionesSRToJson(List<DaNotificacion> notificacions){\n String jsonResponse=\"\";\n Map<Integer, Object> mapResponse = new HashMap<Integer, Object>();\n Integer indice=0;\n for(DaNotificacion notificacion : notificacions){\n Map<String, String> map = new HashMap<String, String>();\n map.put(\"idNotificacion\",notificacion.getIdNotificacion());\n if (notificacion.getFechaInicioSintomas()!=null)\n map.put(\"fechaInicioSintomas\",DateUtil.DateToString(notificacion.getFechaInicioSintomas(), \"dd/MM/yyyy\"));\n else\n map.put(\"fechaInicioSintomas\",\" \");\n map.put(\"codtipoNoti\",notificacion.getCodTipoNotificacion().getCodigo());\n map.put(\"tipoNoti\",notificacion.getCodTipoNotificacion().getValor());\n map.put(\"fechaRegistro\",DateUtil.DateToString(notificacion.getFechaRegistro(), \"dd/MM/yyyy\"));\n map.put(\"SILAIS\",notificacion.getCodSilaisAtencion()!=null?notificacion.getCodSilaisAtencion().getNombre():\"\");\n map.put(\"unidad\",notificacion.getCodUnidadAtencion()!=null?notificacion.getCodUnidadAtencion().getNombre():\"\");\n //Si hay persona\n if (notificacion.getPersona()!=null){\n /// se obtiene el nombre de la persona asociada a la ficha\n String nombreCompleto = \"\";\n nombreCompleto = notificacion.getPersona().getPrimerNombre();\n if (notificacion.getPersona().getSegundoNombre()!=null)\n nombreCompleto = nombreCompleto +\" \"+ notificacion.getPersona().getSegundoNombre();\n nombreCompleto = nombreCompleto+\" \"+notificacion.getPersona().getPrimerApellido();\n if (notificacion.getPersona().getSegundoApellido()!=null)\n nombreCompleto = nombreCompleto +\" \"+ notificacion.getPersona().getSegundoApellido();\n map.put(\"persona\",nombreCompleto);\n //Se calcula la edad\n int edad = DateUtil.calcularEdadAnios(notificacion.getPersona().getFechaNacimiento());\n map.put(\"edad\",String.valueOf(edad));\n //se obtiene el sexo\n map.put(\"sexo\",notificacion.getPersona().getSexo().getValor());\n if(edad > 12 && notificacion.getPersona().isSexoFemenino()){\n map.put(\"embarazada\", envioMxService.estaEmbarazada(notificacion.getIdNotificacion()));\n }else\n map.put(\"embarazada\",\"--\");\n if (notificacion.getMunicipioResidencia()!=null){\n map.put(\"municipio\",notificacion.getMunicipioResidencia().getNombre());\n }else{\n map.put(\"municipio\",\"--\");\n }\n }else{\n map.put(\"persona\",\" \");\n map.put(\"edad\",\" \");\n map.put(\"sexo\",\" \");\n map.put(\"embarazada\",\"--\");\n map.put(\"municipio\",\"\");\n }\n\n mapResponse.put(indice, map);\n indice ++;\n }\n jsonResponse = new Gson().toJson(mapResponse);\n UnicodeEscaper escaper = UnicodeEscaper.above(127);\n return escaper.translate(jsonResponse);\n }", "void mo26099a(String str, JSONObject jSONObject);", "@Test\r\n\tpublic void test01_post() {\n\t\tJSONObject obj=new JSONObject();\r\n\t\tobj.put(\"Gazi1\", \"7979893089\");\r\n\t\tobj.put(\"Reshma\", \"6291172991\");\r\n\t\t\r\n\t\t\r\n\t\t//System.out.println(obj.toJSONString());\r\n\t\tgiven().header(\"Content-Type\",\"Application/JSON\")\r\n\t\t.contentType(ContentType.JSON).accept(ContentType.JSON)\r\n\t\t.body(obj.toJSONString()).when().post(\"https://reqres.in/api/users\").then()\r\n\t\t.statusCode(201);\r\n\t\t\r\n\t}", "public void jsonParseMeth(JSONArray am3) {\n for (int i = 0; i <= am3.size() - 1; i++) {\n JSONObject obj1 = (JSONObject) am3.get(i);\n System.out.println(((JSONObject) am3.get(i)).toJSONString());\n System.out.println((String) obj1.get(\"ibx\"));\n System.out.println((String) obj1.get(\"switchName\"));\n System.out.println((String) obj1.get(\"cspName\"));\n System.out.println(obj1.get(\"vlanCount\"));\n System.out.println(obj1.get(\"usedBandwidth\"));\n System.out.println((String) obj1.get(\"portName\"));\n System.out.println((String) obj1.get(\"portPriority\"));\n System.out.println(obj1.get(\"percentageAvailableBandwidth\"));\n System.out.println(obj1.get(\"totalBandwidth\"));\n System.out.println(obj1.get(\"availableBandwidth\"));\n JSONArray physical = (JSONArray) obj1.get(\"physicalPortNames\");\n for (Object phy : physical) {\n System.out.println(phy.toString());\n }\n }\n\n }", "void mo59932a(String str, JSONObject jSONObject);", "public List<JsonObject> notasDeVentas(){\n String nv[][]= pedidoMaterialRepository.buscarNotaVenta();\n List<JsonObject> js = new ArrayList<JsonObject>();\n \n for (int i=0;i<nv.length;i++){\n \n JsonObject jo = new JsonObject();\n jo.put(\"notaDeVenta\", nv[i][0]);\n jo.put(\"descripcion\", nv[i][1]);\n jo.put(\"cliente\", nv[i][2]);\n js.add(jo);\n }\n \n return js;\n }", "@Test(timeout = 4000)\n public void test053() throws Throwable {\n String string0 = JSONObject.quote(\"f+\\n\");\n assertEquals(\"\\\"f+\\\\n\\\"\", string0);\n \n JSONObject jSONObject0 = new JSONObject();\n JSONArray jSONArray0 = jSONObject0.names();\n assertNull(jSONArray0);\n \n String string1 = JSONObject.valueToString(jSONObject0, 1566, 1566);\n assertEquals(\"{}\", string1);\n }", "@Test(timeout = 4000)\n public void test11() throws Throwable {\n Byte byte0 = new Byte((byte)39);\n Byte.toUnsignedLong((byte)44);\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"] is not a JSONArray.\";\n stringArray0[1] = \"*bpp)j7=\";\n stringArray0[2] = \"B7?dng\";\n JSONObject jSONObject0 = new JSONObject(byte0, stringArray0);\n jSONObject0.put(\"] is not a JSONArray.\", (double) (byte)39);\n jSONObject0.toString((int) (byte)39);\n jSONObject0.optString(\"a2H;Fk;R703/.\", \"] is not a JSONArray.\");\n jSONObject0.opt(\"{\\\"java.lang.String@0000000002\\\": java.lang.Double@0000000003}\");\n jSONObject0.optLong(\"ik\");\n jSONObject0.toString((int) (byte)39);\n byte byte1 = (byte)97;\n Byte.compare((byte)97, (byte) (-119));\n jSONObject0.isNull(\"(_&\");\n JSONObject.numberToString(byte0);\n JSONObject.quote(\"\");\n JSONObject.doubleToString((byte) (-119));\n Short short0 = new Short((byte)39);\n jSONObject0.putOpt(\"\\\"$c.1O[-X9i\", short0);\n JSONTokener jSONTokener0 = new JSONTokener(\"'m P|=\");\n JSONArray jSONArray0 = null;\n try {\n jSONArray0 = new JSONArray(jSONTokener0);\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // A JSONArray text must start with '[' at character 1 of 'm P|=\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }", "public void testGetJSON() {\n\t}", "void testFormatter(String s){\n\t\tInputStream istream = new java.io.ByteArrayInputStream(s.getBytes());\n\t\tMessageContext mc = new MessageContext();\n\t\tJSONOMBuilder ob = new JSONOMBuilder();\n\t\tOMSourcedElement omse;\n\t\ttry {\n\t\t\tomse = (OMSourcedElement) ob.processDocument(istream, \"application/json\", mc);\n\t\t} catch (AxisFault e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n // go for the formatte\n\t\tJSONMessageFormatter of = new JSONMessageFormatter();\n\t\tmc.setDoingREST(true);\n\t\tOMDataSource datasource = omse.getDataSource();\n\t\tString str = of.getStringToWrite(datasource);\n\t\tSystem.out.println(str);\n\t}", "@Test(timeout = 4000)\n public void test012() throws Throwable {\n JSONObject.quote(\"=\\\" p^/$6Yz29)9\");\n JSONObject jSONObject0 = new JSONObject();\n jSONObject0.append(\"\\\"=\\\" p^/$6Yz29)9\\\"\", \"=\\\" p^/$6Yz29)9\");\n jSONObject0.toString(3125, 3125);\n assertEquals(1, jSONObject0.length());\n }", "@Test(timeout = 4000)\n public void test057() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n JSONObject jSONObject1 = jSONObject0.optJSONObject(\"v.W.y`~H9LS\");\n assertNull(jSONObject1);\n }", "String encodeNS(String doc) {\n\t\tJSONParser parser = new JSONParser();\n\t\tTransformer transformer = new Transformer();\n\t\ttry {\n\t\t\tparser.parse(doc, transformer);\n\t\t\tObject value = transformer.getResult();\n\t\t\treturn value.toString();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn \"\";\n\t\t}\n\t}", "public void mo15090a(JSONObject jSONObject) {\n }", "@Test(timeout = 4000)\n public void test080() throws Throwable {\n Long long0 = new Long((-1L));\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"i3@.UhF(TlbH|]?SS\";\n stringArray0[1] = \"\\\"l{g8@|<`A~s*ul$h\";\n stringArray0[2] = \"QmU{LG(E2hKNIE>tV_N\";\n JSONObject jSONObject0 = new JSONObject(long0, stringArray0);\n StringWriter stringWriter0 = new StringWriter(2247);\n jSONObject0.put(\"getdecode\", false);\n jSONObject0.put(\"i3@.UhF(TlbH|]?SS\", false);\n JSONObject.valueToString(\"i3@.UhF(TlbH|]?SS\", 190, 190);\n stringWriter0.append((CharSequence) \"\\\"java.lang.String@0000000002\\\"\");\n StringWriter stringWriter1 = stringWriter0.append('D');\n Writer writer0 = jSONObject0.write(stringWriter1);\n jSONObject0.write(writer0);\n JSONObject.valueToString(writer0, (-1), 2247);\n JSONArray jSONArray0 = null;\n try {\n jSONArray0 = new JSONArray((String) null);\n fail(\"Expecting exception: NullPointerException\");\n \n } catch(NullPointerException e) {\n //\n // no message in exception (getMessage() returned null)\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }", "@Test(timeout = 4000)\n public void test001() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n String string0 = jSONObject0.optString(\",:]/\\\"[{;=#\");\n assertEquals(\"\", string0);\n }", "@Override\r\n public String getUsoMaggiore() {\n int maxpacchetti=0;\r\n int npacchetti=0;\r\n String a;\r\n Map<String, String> mappatemp=new HashMap<>();\r\n Iterator<Map<String, String>> iterator;\r\n iterator = getUltimaEntry().iterator();\r\n System.out.println(getUltimaEntry().size());\r\n\t\twhile (iterator.hasNext()) {\r\n \r\n\t\t\tMap<String, String> m = iterator.next();\r\n //si fa la ricerca della più utilizzata all'inerno della mappa\r\n \r\n npacchetti=Integer.parseInt(m.get(\"RX-OK\"))+Integer.parseInt(m.get(\"TX-OK\"));\r\n System.out.println(maxpacchetti);\r\n if (maxpacchetti<npacchetti){\r\n maxpacchetti=npacchetti;\r\n mappatemp.put(\"Iface\",m.get(\"Iface\"));\r\n mappatemp.put(\"Pacchetti_TX+RX_OK\",String.valueOf(npacchetti));\r\n \r\n }\r\n }\r\n \r\n try {\r\n String json = new ObjectMapper().writeValueAsString(mappatemp);\r\n System.out.println(json);\r\n \r\n \r\n if (json!=null) return json ;\r\n } catch (JsonProcessingException ex) {\r\n Logger.getLogger(NetstatSingleton.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n \r\n return \"NOT WORKING\";\r\n \r\n }", "public JSONNode() {\n map = new HashMap<>();\n }", "void mo350a(C0636l c0636l, JsonValue jsonValue);", "@Test(timeout = 4000)\n public void test046() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n LinkedList<JSONObject> linkedList0 = new LinkedList<JSONObject>();\n JSONArray jSONArray0 = new JSONArray((Collection) linkedList0);\n JSONArray jSONArray1 = jSONObject0.toJSONArray(jSONArray0);\n assertNull(jSONArray1);\n }", "public abstract String toJson();", "public void ReadJson() {\n System.out.println(\"Read Json Method in the Mother Class\");\n }", "@Test\n public void testWithoutNewWarnings() {\n String request = \"{\\\"canRunOnFailed\\\":false,\\\"defaultEncoding\\\":\\\"\\\",\\\"failedTotalAll\\\":\\\"\\\",\\\"failedTotalHigh\\\":\\\"\\\",\\\"failedTotalLow\\\":\\\"\\\",\\\"failedTotalNormal\\\":\\\"\\\",\\\"healthy\\\":\\\"0\\\",\\\"pattern\\\":\\\"\\\",\\\"shouldDetectModules\\\":false,\\\"thresholdLimit\\\":\\\"low\\\",\\\"unHealthy\\\":\\\"50\\\",\\\"unstableTotalAll\\\":\\\"\\\",\\\"unstableTotalHigh\\\":\\\"\\\",\\\"unstableTotalLow\\\":\\\"\\\",\\\"unstableTotalNormal\\\":\\\"\\\"}\";\n\n JSONObject input = JSONObject.fromObject(request);\n JSONObject output = PluginDescriptor.convertHierarchicalFormData(input);\n\n assertEquals(\"Wrong JSON \", input, output);\n }", "@Override\r\n\tpublic void translateToJSON(ParsedJSONContainer jsonContainer) {\t\tjsonContainer.put(\"id\",getId());\r\n\t\tjsonContainer.put(\"labels\",getLabels());\r\n\t\tjsonContainer.put(\"version\",getVersion());\r\n\t}", "@Test(timeout = 4000)\n public void test16() throws Throwable {\n HashMap<Float, Object> hashMap0 = new HashMap<Float, Object>();\n Float float0 = new Float(0.0F);\n Float.max(0.0F, 0.0F);\n hashMap0.put(float0, float0);\n JSONObject jSONObject0 = new JSONObject((Map) hashMap0);\n hashMap0.remove((Object) jSONObject0);\n Long long0 = new Long((-1L));\n JSONObject.valueToString(long0);\n hashMap0.getOrDefault(jSONObject0, jSONObject0);\n JSONObject.valueToString(hashMap0, 8, 13);\n JSONObject.doubleToString(0.0);\n jSONObject0.keys();\n jSONObject0.toString(13);\n try { \n jSONObject0.getJSONArray(\";&7Li\\\"+g4z OK%1i76o\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\";&7Li\\\\\\\"+g4z OK%1i76o\\\"] not found.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "public Integer loadJSONFile()\n {\n JSONParser parser = new JSONParser();\n try{\n\n Object obj = parser.parse(new FileReader(\"/Users/rnuka/Desktop/sample.json\"));\n JSONObject jsonObj = (JSONObject)obj;\n\n Long age = (Long)jsonObj.get(\"age\");\n System.out.println(\"age:\"+age);\n\n String name = (String)jsonObj.get(\"name\");\n System.out.println(\"name:\" + name);\n\n JSONArray address = (JSONArray)jsonObj.get(\"address\");\n\n for(Object str : address){\n System.out.println(str);\n }\n\n\n\n }catch(Exception e){\n e.printStackTrace();\n }\n return 1;\n }", "@Test(timeout = 4000)\n public void test056() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n JSONArray jSONArray0 = new JSONArray();\n String string0 = \"su\";\n JSONObject jSONObject1 = jSONObject0.append(\"su\", jSONArray0);\n jSONObject1.getJSONArray(\"su\");\n jSONObject1.isNull(\"su\");\n try { \n jSONObject1.getDouble(\"su\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"su\\\"] is not a number.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "public String leerArchivoJSON() {\n String contenido = \"\";\n FileReader entradaBytes;\n try {\n entradaBytes = new FileReader(new File(ruta));\n BufferedReader lector = new BufferedReader(entradaBytes);\n String linea;\n try {\n while ((linea = lector.readLine()) != null) {\n contenido += linea;\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (entradaBytes != null) {\n entradaBytes.close();\n }\n if (lector != null) {\n lector.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n } catch (FileNotFoundException ex) {\n Logger.getLogger(GenerarIsla.class.getName()).log(Level.SEVERE, null, ex);\n }\n return contenido;\n }", "@Test\n public void testFromJson() {\n String rawTxJson = \"{\\n\" +\n \" \\\"tx_id\\\": \\\"88367f8df0e3bbb0027b1133b3de36ab779e26af00fc256bde7228c9727d20ef\\\",\\n\" +\n \" \\\"version\\\": 1,\\n\" +\n \" \\\"size\\\": 236,\\n\" +\n \" \\\"time_range\\\": 1521625823,\\n\" +\n \" \\\"inputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"type\\\": \\\"spend\\\",\\n\" +\n \" \\\"asset_id\\\": \\\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\\",\\n\" +\n \" \\\"asset_definition\\\": {},\\n\" +\n \" \\\"amount\\\": 100000000000,\\n\" +\n \" \\\"control_program\\\": \\\"0014f54622eeb837e39d359f7530b6fbbd7256c9e73d\\\",\\n\" +\n \" \\\"address\\\": \\\"sm1q74rz9m4cxl3e6dvlw5ctd7aawftvneeaqsuq3v\\\",\\n\" +\n \" \\\"spent_output_id\\\": \\\"34d739d5020d7e92477222b652e8fbe08467f5eb03700ce2ef57752930b05ff1\\\",\\n\" +\n \" \\\"input_id\\\": \\\"4ae0a25ea92e8c2749099576a234e7dfacb643597545873549c5000ba83fdd9a\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"outputs\\\": [\\n\" +\n \" {\\n\" +\n \" \\\"type\\\": \\\"control\\\",\\n\" +\n \" \\\"id\\\": \\\"8a511581e2fb6986abc3be3bbd842434f642db7c56a1fc5c4c7adf93c750e9a4\\\",\\n\" +\n \" \\\"position\\\": 0,\\n\" +\n \" \\\"asset_id\\\": \\\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\\",\\n\" +\n \" \\\"asset_definition\\\": {},\\n\" +\n \" \\\"amount\\\": 99959999500,\\n\" +\n \" \\\"control_program\\\": \\\"00144453a011caf735428d0291d82b186e976e286fc1\\\",\\n\" +\n \" \\\"address\\\": \\\"sm1qg3f6qyw27u659rgzj8vzkxrwjahzsm7pyjen5j\\\"\\n\" +\n \" },\\n\" +\n \" {\\n\" +\n \" \\\"type\\\": \\\"control\\\",\\n\" +\n \" \\\"id\\\": \\\"03b6ac529c2d1c7d422a7c063d74893e8ca2003b2b3368c27d0ede2d2f6ea3ba\\\",\\n\" +\n \" \\\"position\\\": 1,\\n\" +\n \" \\\"asset_id\\\": \\\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\\\",\\n\" +\n \" \\\"asset_definition\\\": {},\\n\" +\n \" \\\"amount\\\": 500,\\n\" +\n \" \\\"control_program\\\": \\\"0014613908c28df499e3aa04e033100efaa24ca8fd01\\\",\\n\" +\n \" \\\"address\\\": \\\"sm1qvyus3s5d7jv782syuqe3qrh65fx23lgpzf33em\\\"\\n\" +\n \" }\\n\" +\n \" ],\\n\" +\n \" \\\"fee\\\": 40000000\\n\" +\n \" }\";\n RawTransaction decodedTx = RawTransaction.fromJson(rawTxJson);\n System.out.println(decodedTx.toJson());\n }", "@Test\n\tpublic void testTipoDeFicheroPatron(){\n\t\tassertTrue(json.get(\"tipo\").equals(\"patron\"));\n\t}", "public static void main(String[] args) throws IOException {.put(\"a\", \"a\");\n// jsonObject.put(\"b\", \"b\");\n// List<JSONObject> l = new LinkedList<>();\n// JSONObject j = new JSONObject();\n// j.put(\"t\", \"t\");\n// l.add(j);\n// jsonObject\n\n List<Integer> l = KMPSearch.search(\"asd\",\"c\");\n System.out.println(l);\n\n// System.out.println(jsonObject.toJSONString());\n }", "@Test\n public void fourOThreeTest() throws IOException {\n\n Client client = new Client();\n ClientResponse response = client.resource(\n \"http://localhost:8080/cms/item_1\").get(ClientResponse.class);\n\n assert response.getStatus() == 403 : \"Response is not a 403\";\n\n JsonNode message = getMessage(response).get(\"message\");;\n assert message.asText().equals(\"Object not found\") : \"Message is not correct.\";\n }", "@Test(timeout = 4000)\n public void test06() throws Throwable {\n Byte byte0 = new Byte((byte)39);\n Byte.toUnsignedLong((byte)44);\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"] is not a JSONArray.\";\n stringArray0[1] = \"*bpp)j7=\";\n stringArray0[2] = \"B7?dng\";\n JSONObject jSONObject0 = new JSONObject(byte0, stringArray0);\n jSONObject0.put(\"] is not a JSONArray.\", (double) (byte)39);\n jSONObject0.toString((int) (byte)39);\n jSONObject0.optString(\"a2H;Fk;R703/.\", \"] is not a JSONArray.\");\n jSONObject0.opt(\"{\\\"java.lang.String@0000000002\\\": java.lang.Double@0000000003}\");\n jSONObject0.optLong(\"ik\");\n jSONObject0.toString((int) (byte)39);\n Byte.compare((byte)97, (byte) (-119));\n jSONObject0.isNull(\"(_&\");\n assertEquals(1, jSONObject0.length());\n \n JSONObject.numberToString(byte0);\n JSONObject.quote(\"\");\n JSONObject.doubleToString((byte) (-119));\n JSONObject.quote(\"wheel.json.JSONObject$1\");\n String string0 = JSONObject.doubleToString(216);\n assertEquals(\"216\", string0);\n }", "@Override\n\tprotected void preProcessInputData(JsonNode input) {\n\t\t\n\t}", "@Test\n\tpublic void testBeetlTest() throws JsonProcessingException {\n Account account = accountDao.queryAccountByName(\"李四\");\n\n ObjectMapper mapper = new ObjectMapper();\n String str = mapper.writeValueAsString(account);\n System.out.println(\"queryAccountByName:\" + str);\n }", "@Test(timeout = 4000)\n public void test050() throws Throwable {\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n String string0 = JSONObject.valueToString(linkedList0, 125, 125);\n assertEquals(\"[]\", string0);\n \n Object object0 = JSONObject.NULL;\n String string1 = JSONObject.valueToString(object0, 125, 2548);\n assertEquals(\"null\", string1);\n }", "private JsonNode toJson() {\n ObjectMapper mapper = new ObjectMapper();\n ObjectNode root = mapper.createObjectNode();\n root.put(\"packages\", jsonPackages(mapper));\n root.put(\"cycleSegments\", jsonCycleSegments(mapper, catalog.getCycleSegments()));\n root.put(\"summary\", jsonSummary(mapper));\n return root;\n }", "public ArrayList<Product> parseJSONAction(String textJson){\n \n JSONParser j = new JSONParser();\n \n try {\n \n Map<String, Object> productsListJson = j.parseJSON(new CharArrayReader(textJson.toCharArray()));\n ArrayList<Map<String,Object>> productsList = (ArrayList<Map<String,Object>>) productsListJson.get(\"root\");\n //System.out.println(\"pdd \" + productsList.toString());\n Map<String, Object> cart = productsList.get(0);\n //System.out.println(\"cc \" + cart);\n //System.out.println(\"ggg\" + cart.get(\"cart\"));\n ArrayList<Map<String,Object>> lis = (ArrayList<Map<String,Object>>) cart.get(\"cart\");\n //System.out.println(\"lista \" + lis.toString());\n for(Map<String, Object> en : lis){\n Product p = new Product();\n p.setDetails(en.get(\"numProducts\").toString());\n p.setRef_product((int) Double.parseDouble(en.get(\"refProduct\").toString()));\n p.setPrice((int) Float.parseFloat(en.get(\"totalPrice\").toString()));\n products.add(p);\n }\n \n Map<String, Object> data = productsList.get(1);\n ArrayList<Map<String,Object>> llis = (ArrayList<Map<String,Object>>) data.get(\"data\");\n System.out.println(\"dddd\" + llis.toString());\n int i=0;\n for(Map<String, Object> en : llis){\n Product pro = products.get(i);\n pro.setName(en.get(\"name\").toString());\n pro.setPhoto(\"http://127.0.0.1/ftbb_web/ftbb_web/public/images/prod/\"+en.get(\"photo\").toString());\n i++;\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n \n return products; \n }", "public abstract JsonElement serialize();", "@Test(timeout = 4000)\n public void test016() throws Throwable {\n String string0 = JSONObject.quote(\"=\\\" p^/$6Yz29)9\");\n assertEquals(\"\\\"=\\\\\\\" p^/$6Yz29)9\\\"\", string0);\n \n Short short0 = new Short((short)11);\n String[] stringArray0 = new String[3];\n stringArray0[0] = \"=\\\" p^/$6Yz29)9\";\n stringArray0[1] = \"\\\"=\\\" p^/$6Yz29)9\\\"\";\n stringArray0[2] = \"\\\"=\\\" p^/$6Yz29)9\\\"\";\n JSONObject jSONObject0 = new JSONObject(short0, stringArray0);\n String string1 = jSONObject0.toString(4791, 104);\n assertEquals(\"{}\", string1);\n }", "public void gsonData() {\n Gson gson = new Gson();\n gson.toJson(list);\n System.out.println(\"gson string is :----->\" + list);\n }", "@Test(timeout = 4000)\n public void test062() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n JSONArray jSONArray0 = new JSONArray();\n String string0 = \"su\";\n JSONObject jSONObject1 = jSONObject0.append(\"su\", jSONArray0);\n jSONObject1.isNull(\"su\");\n try { \n jSONObject1.getLong(\"su\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"su\\\"] is not a number.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "private void updateItem(JsonNode json) {\n }", "@Test\n public void verifyJsonBackWardCompatible() throws IOException, URISyntaxException, ParseException {\n\n ObjectMapper mapper = new ObjectMapper();\n\n String origJsonDataFile = UserTest.class.getSimpleName() + \"_noDesc.json\";\n String jsonData = ApiTestUtil.readJSONFile(origJsonDataFile);\n\n User u = mapper.readValue(jsonData, User.class);\n assertEquals( Integer.valueOf(56239), u.getId());\n\n String targetJson = mapper.writeValueAsString(u);\n JSONObject json = ApiTestUtil.convertJSONStr2Obj(targetJson);\n JSONObject expectedJson = ApiTestUtil.convertJSONStr2Obj(jsonData);\n\n ApiTestUtil.verifyJson((Map<String, Object>)json, (Map<String, Object>)expectedJson);\n\n }", "@Test(timeout = 4000)\n public void test094() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n LinkedList<Integer> linkedList0 = new LinkedList<Integer>();\n JSONArray jSONArray0 = new JSONArray();\n JSONObject jSONObject1 = jSONObject0.append(\"su\", jSONArray0);\n jSONObject1.isNull(\"su\");\n jSONObject1.put(\"su\", 4135.211029659);\n jSONObject1.getDouble(\"su\");\n try { \n jSONObject1.getBoolean(\"su\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // JSONObject[\\\"su\\\"] is not a Boolean.\n //\n verifyException(\"wheel.json.JSONObject\", e);\n }\n }", "@Test(timeout = 4000)\n public void test15() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n StringWriter stringWriter0 = new StringWriter(12);\n Double.sum(0.0, (-2252.167794836282));\n Double.isFinite((-710.25));\n JSONObject.getNames((Object) stringWriter0);\n String string0 = \"\";\n String string1 = \"RT8u3l.~].,i\";\n JSONObject jSONObject1 = null;\n try {\n jSONObject1 = new JSONObject(\"RT8u3l.~].,i\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // A JSONObject text must begin with '{' at character 1 of RT8u3l.~].,i\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }", "public List<EstadoCita> obtenerDatosJSON(String rta){\n Log.e(\"Agenda JSON\",rta);\n // La lista de generos a retornar\n List<EstadoCita> lista = new ArrayList<EstadoCita>();\n try{\n /**\n * accedemos al json como array, ya que estamos 100% seguros de que lo que devuelve es un array\n * y no un objeto.\n */\n JSONArray json = new JSONArray(rta);\n for (int i=0; i<json.length(); i++){\n JSONObject row = json.getJSONObject(i);\n EstadoCita g = new EstadoCita();\n g.setId(row.getInt(\"id\"));\n g.setEstado(row.getString(\"estado\"));\n // g.setMedico((Medico) row.get(\"medico\"));\n // g.setHora((Hora) row.get(\"hora\"));\n lista.add(g);\n\n\n }\n } catch (JSONException e){\n e.printStackTrace();\n }\n return lista;\n }", "@Test(timeout = 4000)\n public void test099() throws Throwable {\n JSONObject jSONObject0 = new JSONObject();\n JSONObject jSONObject1 = new JSONObject(jSONObject0);\n JSONObject jSONObject2 = jSONObject1.putOpt(\"\", jSONObject0);\n Byte.compare((byte)42, (byte)42);\n JSONObject.quote(\"\");\n Byte.toUnsignedInt((byte)42);\n JSONObject.valueToString(jSONObject2, (-1394), (-1394));\n JSONObject jSONObject3 = new JSONObject(\"{\\n\\\"java.lang.String@0000000003\\\": {},\\n\\\"java.lang.String@0000000004\\\": \\\"java.lang.Class@0000000005\\\"\\n}\");\n String string0 = \"&<uWyN63)KiOjjs&n3\";\n JSONObject jSONObject4 = null;\n try {\n jSONObject4 = new JSONObject(\"&<uWyN63)KiOjjs&n3\");\n fail(\"Expecting exception: RuntimeException\");\n \n } catch(RuntimeException e) {\n //\n // A JSONObject text must begin with '{' at character 1 of &<uWyN63)KiOjjs&n3\n //\n verifyException(\"wheel.json.JSONTokener\", e);\n }\n }", "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 abstract String toJsonString();", "public void mo9092a(JSONObject jSONObject) throws JSONException {\n }", "@Override\r\n\tprotected GuardarSustentoResponse responseText(String json) {\n\t\tGuardarSustentoResponse guardarSustentoResponse = JSONHelper.desSerializar(json, GuardarSustentoResponse.class);\r\n\t\treturn guardarSustentoResponse;\r\n\t}", "public static void main(String[] args) {\n\t\tString json = \"{\\\"name\\\":nico,age:21,skill:[java,c,c#,python,php,javascript],deposit:0.0,info:{address:china,job:IT}}\";\n\t\t\n\t\t//Json Object Array\n\t\tString jsonArray = \"[\" + json + \",\" + json + \"]\";\n\n\t\t//Noson parse\n\t\tNoson noson = Noson.parseNoson(json);\n\t\tList<Object> nosonArray = Noson.parseArray(jsonArray);\n\n\t\t//Noson to Json\n\t\tSystem.out.println(\"==========>> Noson to Json:\");\n\t\tSystem.out.println(json = noson.toString());\n\t\tSystem.out.println(jsonArray = nosonArray.toString());\n\t\tSystem.out.println();\n\n\t\t//Get parameter from noson\n\t\tSystem.out.println(\"==========>> Get parameter from noson:\");\n\t\tSystem.out.println(\"name\\t\" + noson.get(\"name\"));\n\t\tSystem.out.println(\"age\\t\" + noson.get(\"age\"));\n\t\tSystem.out.println(\"skill\\t\" + noson.get(\"skill\"));\n\t\tSystem.out.println(\"deposit\\t\" + noson.get(\"deposit\"));\n\t\tSystem.out.println(\"info\\t\" + noson.get(\"info\"));\n\t\tSystem.out.println();\n\n\t\t//Convert to Map\n\t\tMap<String, Object> testMap = Noson.convert(json, Map.class);\n\t\tSystem.out.println(\"==========>> Convert to Map:\");\n\t\tSystem.out.println(testMap);\n\t\tSystem.out.println();\n\n\t\t//Convert to List\n\t\tList<Object> testList = Noson.convert(jsonArray, List.class);\n\t\tSystem.out.println(\"==========>> Convert to List:\");\n\t\tSystem.out.println(testList);\n\t\tSystem.out.println();\n\n\t\t//Convert to Set\n\t\tSet<Object> testSet = Noson.convert(jsonArray, Set.class);\n\t\tSystem.out.println(\"==========>> Convert to Set:\");\n\t\tSystem.out.println(testSet);\n\t\tSystem.out.println();\n\n\t\t//Convert to Java Object\n\t\tSystem.out.println(\"==========>> Convert to Java Object:\");\n\t\tNico nico = Noson.convert(json, Nico.class);\n\t\tSystem.out.println(nico);\n\t\tSystem.out.println();\n\t\t\n\t\t//Convert to Complex Types\n\t\tSystem.out.println(\"==========>> Convert to Complex Types:\");\n\t\tList<Nico> nicos = Noson.convert(jsonArray, new NoType<List<Nico>>(){});\n\t\tSystem.out.println(nicos);\n\t\tSystem.out.println();\n\t\t\n\t\t//Reversal Object to Json\n\t\tSystem.out.println(\"==========>> Reversal Object to Json:\");\n\t\tSystem.out.println(Noson.reversal(testMap));\n\t\tSystem.out.println(Noson.reversal(testList));\n\t\tSystem.out.println(Noson.reversal(testSet));\n\t\tSystem.out.println(Noson.reversal(nico));\n\t\tSystem.out.println(Noson.reversal(nicos));\n\t\tSystem.out.println();\n\n\t}" ]
[ "0.60391253", "0.599151", "0.5955325", "0.5909354", "0.5875587", "0.5824895", "0.5757651", "0.57321656", "0.5705164", "0.5700233", "0.5684058", "0.5684058", "0.5684058", "0.5653676", "0.56401175", "0.561648", "0.5577033", "0.5567359", "0.5562254", "0.5545487", "0.55416083", "0.5527448", "0.5490729", "0.5472677", "0.5467778", "0.54618776", "0.54394484", "0.5435851", "0.5433655", "0.5429762", "0.54114485", "0.5410638", "0.54098254", "0.5402831", "0.5399365", "0.5375098", "0.5372503", "0.537204", "0.5366607", "0.5357126", "0.5327373", "0.532084", "0.5301014", "0.52946365", "0.52906746", "0.5286774", "0.5280476", "0.52804655", "0.52790546", "0.52788717", "0.5278629", "0.5275836", "0.52605855", "0.52562016", "0.5256049", "0.52445394", "0.52397287", "0.52343035", "0.52323633", "0.52273995", "0.52206224", "0.5216197", "0.5216131", "0.52119935", "0.52092457", "0.5209238", "0.52060604", "0.52055174", "0.5188003", "0.5179827", "0.51787657", "0.51754874", "0.5174999", "0.5167286", "0.51622516", "0.51617175", "0.51528746", "0.5146563", "0.51444286", "0.514103", "0.51364166", "0.5136089", "0.5135124", "0.51318794", "0.51283854", "0.51252484", "0.5115992", "0.51126945", "0.51084226", "0.5105687", "0.51048297", "0.5103169", "0.5102458", "0.5100875", "0.5098593", "0.5097777", "0.5095641", "0.50928444", "0.5091591", "0.50912154", "0.5089995" ]
0.0
-1
TODO Autogenerated method stub
@Override public ImageIcon getFrameIcon() { 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}", "@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
The constructor for the EventTimeline that takes in a location and dimension.
public EventTimeline(Location location, Dimensions dimension) { super(location, dimension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public EventTimeline(int x, int y, int width, int height) {\n this(new Location(x, y), new Dimensions(width, height));\n }", "public EventTimeline() {\n this(0, 0, 91, 9);\n }", "public Event(String title, String location,\n LocalDateTime datetime, int duration, int eventCapacity){\n this.title = title;\n this.location = location;\n this.datetime = datetime;\n this.usernames = new ArrayList<>();\n this.duration = duration;\n this.eventCapacity = eventCapacity;\n uuid = UUID.randomUUID();\n this.type = \"event\";\n }", "protected Event(String title, String location,\n LocalDateTime datetime, int duration, int eventCapacity, String type){\n this.title = title;\n this.location = location;\n this.datetime = datetime;\n this.usernames = new ArrayList<>();\n this.duration = duration;\n this.eventCapacity = eventCapacity;\n uuid = UUID.randomUUID();\n this.type = type;\n }", "Event (Timeline timeline, String name, int[] startDate, int[] endDate, boolean visible, String notes) {\n super(name);\n this.timeline = timeline;\n this.startDate = startDate;\n this.endDate = endDate;\n this.visible = visible;\n this.notes = notes;\n }", "public EventCommand(String description, LocalDateTime eventDateTime) {\n this.description = description;\n this.eventDateTime = eventDateTime;\n }", "public TimedEvent() {\n this(DEFAULT_LABEL + nextTaskID, DEFAULT_DATE, DEFAULT_TIME); // assigning default values\n }", "Timeline (String name) {\n super(name);\n visible = false;\n events = new LinkedList<>();\n }", "TimelineEntity(){}", "public DoorEvent(int x, int y) {\r\n super(x, y, 18, true);\r\n }", "public Entity(double x, double y, double width, double height) {\n\t\tsuper(x, y, width, height);\n\t}", "public Event(String title, String location, String description, String date, String courseRelation, int scheduledTime) {\n\t\t\n\t\tthis.title = title;\n\t\tthis.location = location;\n\t\tthis.description = description;\n\t\tthis.date = date;\n\t\tthis.courseRelation = courseRelation;\n\t\tthis.scheduledTime = scheduledTime;\n\t}", "public TimeWindow(int startTime, int endTime, int duration){\n this.startTime = startTime;\n this.endTime = endTime;\n this.duration = duration;\n }", "public Unit(int x, int y, int width, int height) {\n super(x, y, width, height);\n LOGGER.log(Level.INFO, this.toString() + \" created at (\" + x + \",\" + y + \")\", this.getClass());\n }", "public PathPoint(float x, float y, int t, int numEvents) {\n this.x = x;\n this.y = y;\n this.t = t;\n this.nEvents = numEvents;\n }", "public Location(int x, int y)\n {\n this.x = x;\n this.y = y;\n }", "public Location()\n\t{\n\t\tline = -1;\n\t\tcolumn = -1;\n\t}", "public Meeting(String meetingId, String bookClubId, String location, String date, String startTime, String endTime, String bookTitle, String bookAuthor, String bookThumb, double latitude, double longitude) {\n this.meetingId = meetingId;\n this.bookClubId = bookClubId;\n this.location = location;\n this.date = date;\n this.startTime = startTime;\n this.endTime = endTime;\n this.bookTitle = bookTitle;\n this.bookAuthor = bookAuthor;\n this.bookThumb = bookThumb;\n this.latitude = latitude;\n this.longitude = longitude;\n }", "public FrameAnimator(String location)\n\t{\n\t\tthis(location, \"basic\");\n\t}", "Event(int start, int end, String eventName, String description) {\r\n this.start = start;\r\n this.end = end;\r\n this.eventName = eventName;\r\n this.description = description;\r\n }", "public Clock(int x, int y) // constructor\n\t{\n\t\tpointsTo = 12;\n\t\tisActive = false;\n\t\tloc = new Location(x, y);\n\t}", "public JXGraph(Rectangle2D view) {\r\n this(new Point2D.Double(view.getCenterX(), view.getCenterY()),\r\n view, 0.2, 4, 0.2, 4);\r\n }", "public Bounds(double x, double y, double width, double height) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public QueueEntry(String playerName, Location loc) {\n this(playerName, null, loc, EntryType.LOCATION);\n }", "Event(int start, int end, String eventName) {\r\n this.start = start;\r\n this.end = end;\r\n this.eventName = eventName;\r\n this.description = \"\";\r\n }", "public CanvasDims(int x, int y, int width, int height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }", "Axis (Timeline timeline) {\n\n// assigns a Timeline to the Axis\n this.timeline = timeline;\n\n// creates a common y value for all Elements of the Axis\n// also used by all Markers on this Axis\n y = (axes.size() + 1) * 120;\n\n// places and styles the Axis\n this.setText(timeline.name.toUpperCase());\n this.setLayoutY(y - 12);\n this.setStyle(stylesheet.toString());\n this.getStyleClass().add(\"marker\");\n\n// places and styles the persistentLabel\n persistentLabel = new Label(timeline.name.toUpperCase());\n persistentLabel.setLayoutY(y - 13);\n persistentLabel.setStyle(stylesheet.toString());\n persistentLabel.getStyleClass().add(\"marker\");\n persistentLabel.setStyle(\"-fx-text-fill: #cccccc\");\n persistentLabel.setLayoutX(20);\n persistentLabel.setVisible(false);\n\n// sets start as the startDate of the first Event\n start = timeline.events.peekFirst().startDate[2];\n\n// sets right click on the Label and persistentLabel to expand Timeline\n this.setOnMouseClicked(mouseEvent -> {\n if (mouseEvent.getButton() == MouseButton.SECONDARY)\n expandElement(timeline);\n });\n persistentLabel.setOnMouseClicked(mouseEvent -> {\n if (mouseEvent.getButton() == MouseButton.SECONDARY)\n expandElement(timeline);\n });\n }", "public Rectangle(int x, int y, int width, int height, Color color) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.color = color;\n }", "public DuctBreakEvent(Player player, BlockLocation location) {\n super();\n this.player = player;\n this.location = location;\n }", "public Wall(Point loc,int _length) {\n\t\tlocation=loc;\n\t\tlength=_length;\n\t\timage = new Rectangle(loc.getX(),loc.getY(),10,_length);\n\t\timage.setFill(Color.WHITE);\n\t}", "public StsPoint2D()\n\t{\n\t}", "public Eventd() {\n }", "public Point2d() {\r\n\t // Call two-argument constructor and specify the origin.\r\n\t\t this(0, 0);\r\n\t\t System.out.println(\"Point2d default initiializing\");\r\n\t }", "public HighlightRunnable(Location loc, Direction dir, Vector dimensions) {\n this.loc = loc;\n this.dir = dir;\n\n //Calculates goalLocation relative to direction.\n goalLoc = new Location(loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());\n goalLoc.add(dir.getRelVecX().multiply(dimensions.getBlockX()));\n goalLoc.add(dir.getRelVecY().multiply(dimensions.getBlockY()));\n goalLoc.add(dir.getRelVecZ().multiply(dimensions.getBlockZ()));\n }", "public ServerScheduledEventMetadataImpl(JsonNode data) {\n this.location = data.path(\"location\").textValue();\n }", "public Training(String name, long timestamp, TrainingPlace location) {\n this.name = name;\n this.timestamp = timestamp;\n this.location = location;\n }", "public Spatial(Location tr)\r\n {\r\n this(new Location.Location2D(0, 0), tr);\r\n }", "public f(Dimension dimension) {\n super(1);\n this.a = dimension;\n }", "public Location(int row, int column)\r\n\t{\r\n\t\tthis.row=row;\r\n\t\tthis.column=column;\r\n\t}", "public FrameAnimator(String location, int interval)\n\t{\n\t\tthis(location, \"basic\", interval);\n\t}", "public Rectangle() {\n this(50, 40);\n }", "public Data(int _dimension) {\r\n this.setDimension(_dimension);\r\n }", "public Asteroid(double xLoc, double yLoc) {\n\t\tsuper(resource.Constants.SPR_ASTEROID);\n\t\tsetX(xLoc);\n\t\tsetY(yLoc);\n\t\tthis.xLoc = xLoc;\n\t\tthis.yLoc = yLoc;\n\t}", "public Location(int x, int y)\r\n {\r\n\r\n //this basically makes a new location...it's a constructor\r\n //\"this\" refers to the instance of this class...meaning the instance\r\n //variables. This is saying that the instance variable \"x\" will be\r\n //updated to the value of x that is passed into as a parameter of\r\n //this function. This pretty much makes this a constructor method.\r\n this.x = x;\r\n this.y = y;\r\n\r\n }", "public GeoInlineTable(Construction c, GPoint2D location) {\r\n\t\tsuper(c);\r\n\t\tsetLocation(location);\r\n\t\tsetSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);\r\n\t}", "public Event(double dt, Particle a, Particle b) { // create event\n\n if (Double.isNaN(dt))\n throw new IllegalEventException(\"illegal time: NaN\");\n\n if (dt < 0.0)\n throw new IllegalEventException(\"negative time\");\n\n this.eTime = dt + sTime;\n this.a = a;\n this.b = b;\n this.countA = (a != null) ? a.getCount() : 0;\n this.countB = (b != null) ? b.getCount() : 0;\n }", "public Location(int row, int col) {\n\n this.row = row;\n this.col = col;\n\n }", "public ACLEvent(JSONObject j) {\r\n this(j.getString(\"id\"), j.getString(\"name\"), new Date(kCentralGMTOffestMillis+(long)j.getDouble(\"start\")), new Date(kCentralGMTOffestMillis+(long)j.getDouble(\"finish\")), j.getString(\"stage\"));\r\n }", "public TimeLine(Spatial target) {\r\n this.target = target;\r\n }", "public Location(int x, int y)\n\t{\n\t\tmX = x;\n\t\tmY = y;\n\t}", "protected abstract void initTimeline();", "public Rectangle(String name, double x, double y, Color color, double width, double height,\n boolean visible) {\n super(name, x, y, color, width, height, visible);\n }", "public LinesDimension1() {\n \n }", "public Rectangle(double x, double y, double width, double height) {\n super(x, y, width, height);\n }", "public Wall(float x, float y, float width, float height, World world)\n {\n super(x,y,width, height);\n this.world = world;\n }", "MyRectangle2D(double x, double y, double width, double height) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.height = height;\r\n\t\tthis.width = width;\r\n\t}", "public Event(String description, String a) throws DateTimeParseException {\n super(description);\n this.at = Task.generateTime(a);\n }", "public Rect(int xPos,int yPos,int rectWidth,int rectHeight,Color rectColor) {\n \tsuper(rectColor);\n \tx = xPos;\n \ty = yPos;\n \twidth = rectWidth;\n \theight = rectHeight;\n }", "public Rectangle(int x, int y, int width, int height, Color colour) {\n\t\tsuper(x,y,width,height,colour);\n\t}", "public Population (Coordinate location){\n this.location = location;\n }", "public Obstacle(Location location) {\n super(location);\n }", "public Cluster(BasicEvent ev) {\n this();\n location.x = ev.x;\n location.y = ev.y;\n birthLocation.x = ev.x;\n birthLocation.y = ev.y;\n lastTimestamp = ev.timestamp;\n firstTimestamp = lastTimestamp;\n numEvents = 1;\n setRadius(defaultClusterRadius);\n }", "public PointEventNode(String id) {\n\t\tsuper(id);\n\t}", "public Event(int eventType, double eventTime){\n this.eventType = eventType;\n this.eventTime = eventTime;\n }", "public EventQueue(){}", "MyRectangle (int x, int y, int width, int height, int screenWidth, int screenHeight, int colorIdx)\n {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.screenWidth = screenWidth;\n this.screenHeight = screenHeight;\n this.color = COLORS[colorIdx];\n }", "public Entity(Point position, int gridSize) {\n this.position = new Point(position);\n this.gridSize = gridSize;\n direction = UP;\n\n // without this dummy node, rotation does not work properly\n getChildren().add(new Rectangle(gridSize, gridSize, Color.TRANSPARENT));\n\n update();\n }", "public ListViewAdapter(Event[] dataset, Context context) {\n this.dataset = dataset;\n this.context = context;\n }", "public Duration() {\n this(0, 0, 0, 0, 0, 0.0);\n }", "public Layer(Vector2i position, Vector2i size) {\n\t\tthis.viewport = new Viewport(position, size, this::render);\n\t}", "public MyWorld()\n {\n super(600, 400, 1);\n }", "public OtherActivity (String title, Time startTime, Time endTime, String comment, String location) {\n super(title, startTime, endTime, comment);\n this.location = location;\n }", "private Animation(int length, int x, int y, int spriteWidth, int frameDist) {\n this.length = length;\n this.rightX = x;\n this.leftX = x;\n this.y = y;\n this.spriteWidth = spriteWidth;\n this.spriteHeight = spriteWidth;\n this.frameDist = frameDist;\n }", "public FrameAnimator(String location, String startingSet)\n\t{\n\t\tthis(location, startingSet, 50);\n\t}", "public ScheduleEvent()\n\t{\n\n\t}", "public MCalendarEventView()\r\n {\r\n }", "public World(int width, int height)\n {\n this(width, height, AIR_EL);\n }", "public EventPlanner(int N, double d) {\n this.N = N;\n this.d = d;\n }", "public Point(int dim) {\n this.attributes = new float[dim];\n this.nbAttributes = dim;\n }", "public Event(Long timestamp) {\r\n \tthis.timestamp = timestamp;\r\n }", "public Diff(TemporalPredicate firstPredicate, TemporalPredicate secondPredicate, TimeDimension dimension) {\n this.firstPredicate = Objects.requireNonNull(firstPredicate, \"No first predicate given.\");\n this.secondPredicate = Objects.requireNonNull(secondPredicate, \"No second predicate given.\");\n this.dimension = Objects.requireNonNull(dimension, \"No time dimension given.\");\n }", "public PersonEvent(Person person) {\n super(person);\n this.person = person;\n }", "public JXGraph(Point2D origin, Rectangle2D view) {\r\n this(origin, view, 0.2, 4, 0.2, 4);\r\n }", "public TimedEvent(String label, Date date, Time time) {\n super(label, date); // using the constructor of its superclass\n this.setTime(time); // assigns the time argument value to the attribute\n }", "public Event(int id, String eventName){\n this.id = id;\n this.event = eventName;\n this.location = null;\n this.date = 0;\n this.startTime = \"00:00 AM\";\n this.endTime = \"00:00 AM\";\n this.notes = \"No notes\";\n this.allDay = false;\n this.bigId = -1;\n this.alarm = -1;\n\n }", "public Training(String name, TrainingPlace location) {\n this.name = name;\n this.timestamp = System.currentTimeMillis() / 1000;\n this.location = location;\n }", "public Location() {\r\n \r\n }", "public NodeEvent() {\n\t\tthis(new Note(), DEFAULT_LIKELIHOOD);\n\t}", "public EventMessage(Event event)\r\n {\r\n //super(\"EventMessage\");\r\n super(TYPE_IDENT, event);\r\n }", "public RegularUnit(Location location, int length, int width, int height){\n // initialise instance variables\n super(location, length, width, height, TYPE);\n }", "public Plot() {\r\n }", "public Location() {\n\t\t\n\t\txCoord=0;\n\t\tyCoord=0;\n\t\t\n\t}", "public TemperatureUnit(double width, double height, double length, StorageLocation myLoc, int tempLvl)\n {\n super(width, height, length, myLoc);\n setTempLvl(tempLvl);\n }", "public Transition(Point position, MapScreen screen, Point spawn) {\n\t\tsuper(position);\n\t\tnewScreen = screen;\n\t\tthis.spawn = spawn;\n\t}", "public Event (String name, String dateTime) {\n\t\tsuper(name);\n\t\tthis.dateTime = dateTime;\n\t}", "public Event() {\n\n }", "public ControlSpacer(Dimension dimension)\n {\n myWidth = (int)dimension.getWidth();\n myHeight = (int)dimension.getHeight();\n }", "public Event() {\r\n\r\n\t}", "public Event(){\n\n }", "public Presentation(String type, int x, int y, int width, int height) {\n this.type = type;\n this.position = new Position(x, y);\n this.size = new Size(width, height);\n }" ]
[ "0.7683685", "0.67677087", "0.6350119", "0.6007887", "0.55904305", "0.54256374", "0.53600407", "0.5339171", "0.5336453", "0.5187967", "0.5180346", "0.5168462", "0.5136544", "0.51055306", "0.5083074", "0.5081945", "0.50796247", "0.506751", "0.50545025", "0.50373214", "0.502499", "0.5022086", "0.50138456", "0.49836197", "0.49817508", "0.49736217", "0.49723372", "0.4966373", "0.49633977", "0.49574056", "0.494369", "0.49415627", "0.49317843", "0.49270952", "0.49114862", "0.49096543", "0.49038833", "0.48939586", "0.4885188", "0.48752835", "0.48752624", "0.48730254", "0.48695752", "0.48675165", "0.48601535", "0.48540202", "0.4841184", "0.48358053", "0.48330885", "0.48199677", "0.48194522", "0.4817788", "0.48145887", "0.48123974", "0.48083684", "0.48066196", "0.4803467", "0.4799823", "0.4790628", "0.47822937", "0.47662342", "0.4761924", "0.47543386", "0.47453782", "0.47440183", "0.474001", "0.47276145", "0.47252506", "0.4723245", "0.4719886", "0.47153413", "0.47151414", "0.47128296", "0.47059152", "0.46952608", "0.46948037", "0.4693537", "0.46907258", "0.46893767", "0.46864584", "0.46833822", "0.4681809", "0.4681334", "0.46748635", "0.46734378", "0.4672623", "0.46720922", "0.46617827", "0.46606484", "0.46507844", "0.46454304", "0.46409136", "0.46385852", "0.4626896", "0.4626543", "0.46206284", "0.4620063", "0.46143478", "0.4611901", "0.46088633" ]
0.8735746
0
The constructor for the EventStream that takes in a x / y and width / height.
public EventTimeline(int x, int y, int width, int height) { this(new Location(x, y), new Dimensions(width, height)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Stone(int x, int y, int width, int height) {\n\t\tsuper(x, y, width, height);\n\t\t\n\t}", "public Shape(int x, int y, int deltaX, int deltaY, int width, int height) {\n\t\t_x = x;\n\t\t_y = y;\n\t\t_deltaX = deltaX;\n\t\t_deltaY = deltaY;\n\t\t_width = width;\n\t\t_height = height;\n\t}", "public CanvasDims(int x, int y, int width, int height) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n }", "public Rectangle(double x, double y, double width, double height) {\n super(x, y, width, height);\n }", "public Unit(int x, int y, int width, int height) {\n super(x, y, width, height);\n LOGGER.log(Level.INFO, this.toString() + \" created at (\" + x + \",\" + y + \")\", this.getClass());\n }", "public Entity(double x, double y, double width, double height) {\n\t\tsuper(x, y, width, height);\n\t}", "MyRectangle2D(double x, double y, double width, double height) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.height = height;\r\n\t\tthis.width = width;\r\n\t}", "public Rectangle(float w, float h, float x, float y, float r, float g, float b, String n, int s, int e) {\n super(x, y, r, g, b, n, s, e);\n this.width = w;\n this.height = h;\n }", "public Figure(int x, int y) {\n this.x = x;\n this.y = y;\n }", "public RectangleShape(int xCoord, int yCoord, int widthOfRect, int heightOfRect)\n {\n System.out.println(\"setting x to: \"+ xCoord+\" & setting y to: \"+ yCoord);\n x = xCoord;\n y = yCoord;\n width = widthOfRect;\n height = heightOfRect;\n }", "TwoDShape5(double x) {\n width = height = x;\n }", "public Bounds(double x, double y, double width, double height) {\n\t\tsuper();\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Rectangle(int x, int y, int w, int h) {\n this.x = x;\n this.y = y;\n this.size = new Dimension(w, h);\n }", "public Size(double width, double height)\r\n {\r\n this.width = width;\r\n this.height = height;\r\n }", "Polymorph(int x, int y, int height, int width){\n \t this.x = x;\n \t this.y = y;\n \t this.height = height;\n \t this.width = width;\n }", "public Coordinates(int x, int y)\r\n {\r\n xCoord = x;\r\n yCoord = y;\r\n }", "public Rectangle(double width, double height) {\r\n this.width = width;\r\n this.height = height;\r\n }", "public Coordinate(int x,int y)\n {\n this.x = x;\n this.y = y;\n }", "public Road(int x, int y, int width, int height)\n {\n screenWidth = width;\n screenHeight = height;\n xTopLeft = x;\n yTopLeft = y;\n }", "public EventTimeline() {\n this(0, 0, 91, 9);\n }", "public DoorEvent(int x, int y) {\r\n super(x, y, 18, true);\r\n }", "private SquareCoordinate(int x, int y)\n {\n \tthis.x = x;\n \tthis.y = y;\n }", "public Coordinates(int x, int y){\n this.x = x;\n this.y = y;\n }", "public SimpleFrame(float x, float y, float w, float h) {\n super();\n\n setPosition(x, y);\n setSize(w, h);\n }", "public Position( int xCoordinate, int yCoordinate ) {\n xPosition = xCoordinate;\n yPosition = yCoordinate;\n }", "public HorizontalCoords() {\n }", "public Position2D(double x, double y) {\n this.x = x;\n this.y = y;\n }", "public Object2D(double xs,double ys,Dimension sizes)\r\n\t{\r\n\t\tx = xs;\r\n\t\ty = ys;\r\n\t\twidth = (int)sizes.getHeight();\r\n\t\theight= (int)sizes.getWidth();\r\n\t}", "public void setup(int x, int y, int width, int height) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Rectangle() {\n x = 0;\n y = 0;\n width = 0;\n height = 0;\n }", "Point(int x_, int y_){\n x = x_;\n y = y_;\n }", "Oval(int width, int height, int x, int y){\n setWidth(width);\n setHeight(height);\n setX(x);\n setY(y);\n }", "public Coordinate(int x, int y, int data){\r\n this.x = x;\r\n this.y = y;\r\n this.data = data;\r\n }", "public HitBox(double x, double y, int width, int height){\n\t\trect = new Rectangle((int)x, (int)y, width, height);\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public RectangleObject(double width, double height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t}", "public Rectangle(int x, int y, int width, int height, Color color) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.color = color;\n }", "public Coordinates(int x, int y) {\n\t\t\n\t\txPosition = x;\t\t\t// Assigns the x integer\n\t\tyPosition = y;\t\t\t// Assigns the y integer\n\t}", "public Shape(int x, int y) {\n\t\tthis(x, y, DEFAULT_DELTA_X, DEFAULT_DELTA_Y, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\t}", "public Image( int x, int y, int w, int h )\r\n {\r\n super();\r\n setBounds( x, y, w, h );\r\n }", "public PathPoint(float x, float y, int t, int numEvents) {\n this.x = x;\n this.y = y;\n this.t = t;\n this.nEvents = numEvents;\n }", "public Rectangle() {\n this(50, 40);\n }", "Rectangle(double newWidth, double newHeight){\n height = newHeight;\n width = newWidth;\n }", "public BoundingBox(int x0, int y0, int width, int height) {\n\t\tthis(new Coord(x0, y0), width, height);\n\t}", "public EventTimeline(Location location, Dimensions dimension) {\n super(location, dimension);\n }", "public Point(int x, int y)\n\t{\n\t\t// Instantiate properties with parameter values \n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Position(int x, int y) {\n this.x = x;\n this.y = y;\n }", "public MyShape(Component c, int height, int width, int x, int y) {\n\t\tthis.r = new Rectangle(x, y, width,height);//height and width had to be changed to match the actual objects\n\t\tsetX(x);\n\t\tsetY(y);\n\t\tthis.width = width;\n\t\tthis.height = height;\t\n\n\t}", "public Shape(int width, int height) {\r\n\r\n\t\t// Shape width and height should not be greater than the sheet width and height\r\n\t\tif (width > Sheet.SHEET_WIDTH || height > Sheet.SHEET_HEIGHT) {\r\n\t\t\tthrow new IllegalArgumentException(\"Shape width or height is not valid\");\r\n\t\t}\r\n\r\n\t\tthis.sWidth = width;\r\n\t\tthis.sHeight = height;\r\n\t}", "public Player(int width, int height)\n {\n this.width = width;\n this.height = height;\n createImage();\n }", "public Screen(int width, int height) {\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\tpixels = new int[width * height];\r\n\t}", "public CustomRectangle(int x1, int y1, int x2, int y2) {\n this.x1 = Integer.toString(x1);\n this.y1 = Integer.toString(y1);\n this.x2 = Integer.toString(x2);\n this.y2 = Integer.toString(y2);\n }", "public Shape() { this(X_DEFAULT, Y_DEFAULT); }", "public Pixel(int xPos, int yPos){\n\t\t\n\t\tthis.x = new Integer(xPos);\n\t\tthis.y = new Integer(yPos);\n\t\tthis.z = null;\n\t\tthis.intensity = null;\n\t\tthis.type = \"2Dposition\";\n\t}", "public Entity(int x, int y){\n \t\tlocation = new Point(x,y);\n \t\twidth = 0;\n\t\theight = 0;\n\t\timage = null;\n\t\t\n\t\tvisible = false;\n \t}", "Rectangle()\n {\n this(1.0,1.0);\n }", "public ComplexSprite(double x, double y, double width, double height) {\r\n\t\tthis.factory = SpriteFactory.getInstance();\r\n\t\tthis.dx = factory.getDX();\r\n\t\tthis.dy = factory.getDY();\r\n\t\tthis.sprites = new ArrayList<>();\r\n\t}", "public Shape(int x, int y, int wid, int ht, Color col, int xSpd, int ySpd)\r\n {\r\n\t\txPos = x;\r\n\t\tyPos = y;\r\n\t\twidth=wid;\r\n\t\theight= ht;\r\n\t\tcolor=col;\r\n\t\txSpeed=xSpd;\r\n\t\tySpeed=ySpd;\r\n\t\t//finish this constructor\r\n }", "public Position(int x, int y) {\n this.x = x;\n this.y = y;\n }", "public Rectangle(int x, int y, int width, int height, Color colour) {\n\t\tsuper(x,y,width,height,colour);\n\t}", "public Point(float x, float y)\n {\n this.x = x;\n this.y = y;\n }", "public Position(double x, double y) {\n\t\txCoord = x;\n\t\tyCoord = y;\n\t}", "public PositionComponent(float x, float y) {\n\t\tthis(x, y, 0);\n\t}", "public Worker(int x, int y, int size) {\n super(x, y, size);\n// this.x = x;\n// this.y = y;\n// this.size = size;\n }", "public CustomRectangle(String x1, String y1, String x2, String y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n }", "public Pixel(int x, int y) {\n super(x, y);\n }", "public Point(int x, int y){\n this.x = x;\n this.y = y;\n }", "public AStar2D(int width, int height) {\n super( new Grid2D(width, height) );\n }", "public Square(int x, int y){\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}", "Rectangle(){\n height = 1;\n width = 1;\n }", "public Point(int x, int y) {\r\n this.x = x;\r\n this.y = y;\r\n }", "public Picture(int width, int height)\n {\n // let the parent class handle this width and height\n super(width,height);\n }", "public Picture(int width, int height)\n {\n // let the parent class handle this width and height\n super(width,height);\n }", "public void streamFromXML(Element node, XMLStreamer streamer, Object instance) {\n super.streamFromXML(node, streamer, instance);\n startingPoint.x = Integer.parseInt(node.getAttribute(\"x\"));\n startingPoint.y = Integer.parseInt(node.getAttribute(\"y\"));\n }", "public RandomPointGenerator(int width, int height) {\n\t\tthis(0, 0, width, height);\n\t}", "public Rectangle(int length, int width) {\n }", "public Position(int x, int y) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t}", "public Rectangle(Point upperLeft, double width, double height) {\n this.upperLeft = upperLeft;\n this.width = width;\n this.height = height;\n }", "public Screen(int width, int height){\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\timage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);\n\t\tpixels = ((DataBufferInt)image.getRaster().getDataBuffer()).getData();\n\t}", "public Point(int x, int y)\r\n\t{\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t}", "public Point(int x, int y) {\n this.x = x;\n this.y = y;\n }", "Rectangle() {\r\n\t\tlength = 1.0;\r\n\t\twidth = 1.0;\r\n\t}", "public Point2D(double x, double y){\n this.x = x;\n this.y = y;\n }", "public WMFDeviceContext(RandomAccessStream stream, double width, double height)\n\t\t\tthrows IOException {\n\t\tinitLowLevelGraphics(stream, (int)Math.ceil(width), (int)Math.ceil(height));\n\t}", "public Rect(int xPos,int yPos,int rectWidth,int rectHeight,Color rectColor) {\n \tsuper(rectColor);\n \tx = xPos;\n \ty = yPos;\n \twidth = rectWidth;\n \theight = rectHeight;\n }", "public JXGraph(Rectangle2D view) {\r\n this(new Point2D.Double(view.getCenterX(), view.getCenterY()),\r\n view, 0.2, 4, 0.2, 4);\r\n }", "public Sprite(float centerX, float centerY, float z, int width, int height) {\n \t_center = new Coordinates(centerX, centerY, z);\n \t_dimensions = new Coordinates(width, height, 0f);\n }", "public BoundingBox(Coord origin, int width, int height) {\n\t\tsuper();\n\t\tthis.origin = origin;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}", "public Point2D(int x1,int y1) {\n\t\tx= x1;\n\t\ty=y1;\n\t}", "Coordinate(int Xposition, int Yposition) {\n\t\tthis.X = Xposition;\n\t\tthis.Y = Yposition;\n\n\t}", "public Context(int width, int height)\n {\n this.width = width;\n this.height = height;\n this.data = new int[width * height];\n this.image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);\n data = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();\n }", "public Coordinate(double xCoordinate, double yCoordinate) {\n this.xCoordinate = xCoordinate;\n this.yCoordinate = yCoordinate;\n }", "public StsPoint2D()\n\t{\n\t}", "public Ship(float x, float y) {\r\n\t\tthis.bounds = new Rectangle(x, y, width, height);\r\n\t}", "public Hotspot(float x, float y, float width, float height) {\r\n\t\tthis.x = x;\r\n\t\tthis.y = y;\r\n\t\tthis.width = width;\r\n\t\tthis.height = height;\r\n\t\t_id = -1;\r\n\t\t_dynamicObject = null;\r\n\t}", "public Size(int w, int h) {\n width = w;\n height = h;\n }", "public Track(double x1, double y1, double x2, double y2) {\r\n // Store the positions of the tracks end points\r\n this.x1 = x1;\r\n this.y1 = y1;\r\n this.x2 = x2;\r\n this.y2 = y2;\r\n }", "public Point(int x, int y) {\r\n\t\tthis.x = x;\tthis.y = y;\r\n\t}", "public ColourRect(float x, float y, float w, float h){\n super(x,y,w,h);\n }", "public Coordinate(int x, int y, int identity){\r\n\t\tsuper(x,y);\r\n\t\tthis.identity = identity;\r\n\t}", "public GameComponent(int topLeftXPosition, int topLeftYPosition, int width, int height)\n\t{\n\t\tthis.topLeftXPosition = topLeftXPosition;\n\t\tthis.topLeftYPosition = topLeftYPosition;\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t}" ]
[ "0.6016591", "0.5953955", "0.5939091", "0.5930463", "0.59299445", "0.59133214", "0.5883002", "0.5791808", "0.5781791", "0.57809174", "0.57708955", "0.57164586", "0.56636924", "0.5638272", "0.5603732", "0.55674165", "0.55572325", "0.5556725", "0.5548672", "0.5535601", "0.55269384", "0.5502112", "0.54979366", "0.54909503", "0.5478544", "0.54486984", "0.5439149", "0.5432209", "0.5417016", "0.5392344", "0.5377941", "0.5376953", "0.5376826", "0.53674066", "0.53345674", "0.53308237", "0.53268266", "0.53235906", "0.53117627", "0.53020585", "0.52965677", "0.5293109", "0.52900016", "0.5282882", "0.5275307", "0.52747977", "0.5269556", "0.52566075", "0.52539927", "0.524522", "0.52394253", "0.5234941", "0.5234191", "0.52336645", "0.5227842", "0.5225168", "0.5218373", "0.52053505", "0.5197867", "0.5192369", "0.51865643", "0.51829886", "0.517921", "0.51762897", "0.51699126", "0.5168017", "0.5161266", "0.5158788", "0.5123968", "0.51234245", "0.5119723", "0.5119723", "0.51193017", "0.51163095", "0.5110682", "0.510797", "0.510367", "0.5103048", "0.51020455", "0.51013005", "0.5101155", "0.5099592", "0.5097129", "0.5093775", "0.50929844", "0.50916755", "0.50884515", "0.50867903", "0.5086728", "0.5084306", "0.5081168", "0.50788087", "0.5070429", "0.50686914", "0.5067344", "0.50646573", "0.5060024", "0.50573754", "0.50565034", "0.5052666" ]
0.7441999
0
Private constructor used for deserialization. Set in the top left corner of the board with the default dimensions.
public EventTimeline() { this(0, 0, 91, 9); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Board() {\n\t\tswitch (Board.boardType) {\n\t\tcase Tiny:\n\t\t\tthis.dimensions = TinyBoard; break;\n\t\tcase Giant:\n\t\t\tthis.dimensions = GiantBoard; break;\n\t\tdefault:\n\t\t\tthis.dimensions = StandardBoard; break;\n\t\t}\n\t\tboard = new Square[dimensions.x][dimensions.y];\n\t\tinit();\n\t}", "public Board() {\r\n\t\tthis.size = 4;\r\n\t\tthis.gameBoard = createBoard(4);\r\n\t\tthis.openTiles = 16;\r\n\t\tthis.moves = 0;\r\n\t\tthis.xValues = new boolean[4][4];\r\n\t\tthis.yValues = new boolean[4][4];\r\n\t\tthis.complete = false;\r\n\t}", "public Board() {\n\t\tintializeBoard(_RowCountDefault, _ColumnCountDefault, _CountToWinDefault);\n\t}", "public Board() {\n this.board = new byte[][] { new byte[3], new byte[3], new byte[3] };\n }", "public Board()\r\n\t{\r\n\t\tsuper(8, 8);\r\n\t}", "public Board() {\n this.x = 0;\n this.o = 0;\n }", "public Board()\n\t{\n\t\tcols = DEFAULT_WIDTH;\n\t\trows = DEFAULT_HEIGHT;\n\t\t\n\t\tpieces = new int[rows][cols];\n\t\tif (pieces.length > 0)\n\t\t{\n\t\t\tfor (int i = 0; i < pieces.length; i++)\n\t\t\t\tfor (int j = 0; j < pieces[0].length; j++)\n\t\t\t\t\tpieces[i][j] = -1;\n\t\t}\n\t}", "public Board() {\n initialize(3, null);\n }", "public Board()\r\n {\r\n board = new Piece[8][8];\r\n xLength = yLength = 8;\r\n }", "public Board() {\n\t\tdimension = 9;\n\t\tpuzzle = new int[dimension][dimension];\n\t}", "public Board() {\n\t\tboardState = new Field[DIMENSION][DIMENSION];\n\t\tfor(int i = 0; i < DIMENSION; i++) {\n\t\t\tfor(int j = 0; j < DIMENSION; j++) {\n\t\t\t\tboardState[i][j] = new Field();\n\t\t\t}\n\t\t}\n\t}", "public GameBoard (int height, int width)\n {\n mHeight = height;\n mWidth = width;\n }", "public Board() {\n\t\tboard = new int[8][8];\n\t\tbombs = 64 / 3;\n\t\tdifficulty = GlobalModel.BESTSCORE_EASY;\n\t\tfillBoard();\n\t\tsetDefaultScores();\n\t}", "public Board()\r\n\t{\r\n\t\tfor(int x = 0; x < 9; x++)\r\n\t\t\tfor(int y = 0 ; y < 9; y++)\r\n\t\t\t{\r\n\t\t\t\tboard[x][y] = new Cell();\r\n\t\t\t\tboard[x][y].setBoxID( 3*(x/3) + (y)/3+1);\r\n\t\t\t}\r\n\t}", "public Board() {\n\t\tboard = new char[9][9];\n\t}", "public Board(int dimensions){\n this.dimensions = dimensions;\n createBoard(dimensions);\n this.status = Status.CREATED;\n this.hitsLeft = 15;\n }", "public Board() {\n playerNumber = 2;\n deadBlackCount = 0;\n deadWhiteCount = 0;\n deadRedCount = 0;\n deadBlueCount = 0;\n\n fields = new Field[DIMENSION][DIMENSION];\n // init fields\n for (int i = 0; i < DIMENSION; i++) {\n for (int j = 0; j < DIMENSION; j++) {\n fields[i][j] = new Field();\n fields[i][j].setX(i);\n fields[i][j].setY(j);\n }\n }\n }", "public Board() {\n for (int row = 0; row < 9; row++) {\n for (int col = 0; col < 9; col++) {\n this.grid[row][col] = 0;\n }\n }\n }", "public Board() {\n this.board = new Piece[16];\n }", "public Board(float width, float height) {\r\n tablero = new Array<BlockDrawable>();\r\n this.width = width;\r\n this.height = height;\r\n deletedRowsInfo.ordered = true;\r\n reset();\r\n }", "public Board()\r\n\t{\r\n\t\treset();\r\n\t}", "public Board()\r\n\t{\r\n\t\tthis.grid = new CellState[GRID_SIZE][GRID_SIZE];\r\n\t\tthis.whiteMarblesCount = MARBLES_COUNT;\r\n\t\tthis.blackMarblesCount = MARBLES_COUNT;\r\n\t\t\r\n\t\t/**\r\n\t\t * Initializes the board with empty value\r\n\t\t */\r\n\t\tfor (int indexcol = 0; indexcol < GRID_SIZE; indexcol++)\r\n\t\t{\r\n\t\t\tfor (int indexrow = 0; indexrow < GRID_SIZE; indexrow++)\r\n\t\t\t{\r\n\t\t\t\tthis.grid[indexrow][indexcol] = CellState.EMPTY;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Sets marbles on the board with default style\r\n\t\t */\r\n\t\tfor (int indexcol = 0; indexcol < 5; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[0][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[8][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tfor (int indexcol = 0; indexcol < 6; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[1][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[7][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tfor (int indexcol = 2; indexcol < 5; indexcol++)\r\n\t\t{\r\n\t\t\tthis.grid[2][indexcol] = CellState.WHITE_MARBLE;\r\n\t\t\tthis.grid[6][8 - indexcol] = CellState.BLACK_MARBLE;\r\n\t\t}\r\n\t\tthis.grid[3][8] = CellState.INVALID;\r\n\t\tthis.grid[2][7] = CellState.INVALID;\r\n\t\tthis.grid[1][6] = CellState.INVALID;\r\n\t\tthis.grid[0][5] = CellState.INVALID;\r\n\t\tthis.grid[5][0] = CellState.INVALID;\r\n\t\tthis.grid[6][1] = CellState.INVALID;\r\n\t\tthis.grid[7][2] = CellState.INVALID;\r\n\t\tthis.grid[8][3] = CellState.INVALID;\r\n\t}", "public Board() {\n\n for(int row = 0; row < size; row++) {\n for(int col = 0; col < size; col++) {\n\n grid[row][col] = \"-\";\n\n }\n }\n\n }", "public Board() {\n tiles = new int[3][3];\n int[] values = genValues(new int[]{1, 2, 3, 4, 5, 6, 7, 8, 0});\n\n int offset;\n for (int i = 0; i < 3; i++) {\n offset = 2 * i;\n tiles[i] = Arrays.copyOfRange(values, i + offset, i + offset + 3);\n }\n }", "public Board() {\n for (int y = 0; y < spaces.length; y++) {\n for (int x = 0; x < spaces[0].length; x++) {\n spaces[y][x] = new SubBoard();\n wonBoards[y][x] = ' ';\n }\n }\n }", "private Board()\r\n {\r\n this.grid = new Box[Config.GRID_SIZE][Config.GRID_SIZE];\r\n \r\n for(int i = 0; i < Config.NB_WALLS; i++)\r\n {\r\n this.initBoxes(Wall.ID);\r\n }\r\n \r\n for(int i = 0; i < Config.NB_CHAIR; i++)\r\n {\r\n this.initBoxes(Chair.ID);\r\n }\r\n \r\n for(int i = 0; i < Config.NB_PLAYER; i++)\r\n {\r\n this.initBoxes(Chair.ID);\r\n }\r\n }", "Board() {\n this(INITIAL_PIECES, BLACK);\n _countBlack = 12;\n _countWhite = 12;\n _moveHistory = new ArrayList<Move>();\n _movesMade = 0;\n }", "public PersonalBoard(){\n this(0);\n }", "public BitBoardImpl() {\n\tinitialPosition();\n }", "public Board(int boardHeight, int boardWidth) {\n this.boardWidth = boardHeight+1;\n this.boardHeight = boardWidth+1;\n this.board = new char[this.boardHeight][this.boardWidth];\n this.numShips = 0;\n boardInit();\n }", "private Board() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// A private board constructor to ensure only one is created\n\t\tsuper();\n\t}", "public Board(int dimensionX, int dimensionY) {\n\t\tthis.fieldMap = FieldMap.getEmptyFieldMap(dimensionX, dimensionY);\n\t\tFieldMap.serialize(fieldMap, \"test.map\");\n\t\tunitsOnBoard = new HashMap<Position, Unit>();\n\t}", "public Sudoku() {\n this.board = new int[size][size];\n }", "public GameBoard(){\r\n\t\tboard = new Box[boardSize];\r\n\t\tfor(int i = 0; i < boardSize; i++){\r\n\t\t\tboard[i] = Box.EMPTY;\r\n\t\t}\r\n\t}", "public Board() {\n\t\tmarkCount = 0;\n\t\ttheBoard = new char[3][];\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\ttheBoard[i] = new char[3];\n\t\t\tfor (int j = 0; j < 3; j++)\n\t\t\t\ttheBoard[i][j] = SPACE_CHAR;\n\t\t}\n\t}", "public Board() {\n\t\tfor(int i = 0; i < board.length; i++){\n\t\t\tfor(int j = 0; j < board[i].length; j++){\n\t\t\t\tboard[i][j] = 0;\n\t\t\t}\n\t\t}\n\t}", "public XOBoard() {\n\t\t// initialise the boards\n\t\tboard = new int[4][4];\n\t\trenders = new XOPiece[4][4];\n\t\tfor (int i = 0; i < 4; i++)\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tboard[i][j] = EMPTY;\n\t\t\t\trenders[i][j] = null;\n\t\t\t}\n\t\tcurrent_player = XPIECE;\n\n\t\t// initialise the rectangle and lines\n\t\tback = new Rectangle();\n\t\tback.setFill(Color.GREEN);\n\t\th1 = new Line();\n\t\th2 = new Line();\n\t\th3 = new Line();\n\t\tv1 = new Line();\n\t\tv2 = new Line();\n\t\tv3 = new Line();\n\t\th1.setStroke(Color.WHITE);\n\t\th2.setStroke(Color.WHITE);\n\t\th3.setStroke(Color.WHITE);\n\t\tv1.setStroke(Color.WHITE);\n\t\tv2.setStroke(Color.WHITE);\n\t\tv3.setStroke(Color.WHITE);\n\n\t\t// the horizontal lines only need the endx value modified the rest of //\n\t\t// the values can be zero\n\t\th1.setStartX(0);\n\t\th1.setStartY(0);\n\t\th1.setEndY(0);\n\t\th2.setStartX(0);\n\t\th2.setStartY(0);\n\t\th2.setEndY(0);\n\t\th3.setStartX(0);\n\t\th3.setStartY(0);\n\t\th3.setEndY(0);\n\n\t\t// the vertical lines only need the endy value modified the rest of the\n\t\t// values can be zero\n\t\tv1.setStartX(0);\n\t\tv1.setStartY(0);\n\t\tv1.setEndX(0);\n\t\tv2.setStartX(0);\n\t\tv2.setStartY(0);\n\t\tv2.setEndX(0);\n\t\tv3.setStartX(0);\n\t\tv3.setStartY(0);\n\t\tv3.setEndX(0);\n\n\t\t// setup the translation of one cell height and two cell heights\n\t\tch_one = new Translate(0, 0);\n\t\tch_two = new Translate(0, 0);\n\t\tch_three = new Translate(0, 0);\n\t\th1.getTransforms().add(ch_one);\n\t\th2.getTransforms().add(ch_two);\n\t\th3.getTransforms().add(ch_three);\n\n\t\t// setup the translation of one cell width and two cell widths\n\t\tcw_one = new Translate(0, 0);\n\t\tcw_two = new Translate(0, 0);\n\t\tcw_three = new Translate(0, 0);\n\t\tv1.getTransforms().add(cw_one);\n\t\tv2.getTransforms().add(cw_two);\n\t\tv3.getTransforms().add(cw_three);\n\n\t\t// add the rectangles and lines to this group\n\t\tgetChildren().addAll(back, h1, h2, h3, v1, v2, v3);\n\n\t}", "public void setBoard() {\n margin = Math.round((sizeOfCell * 3) / 2);\n RelativeLayout.LayoutParams marginParam = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);\n marginParam.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);\n marginParam.addRule(RelativeLayout.CENTER_HORIZONTAL);\n marginParam.setMargins(0, 0, 0, (margin));\n gridContainer.setLayoutParams(marginParam);\n\n LinearLayout.LayoutParams lpRow = new LinearLayout.LayoutParams(sizeOfCell * maxN, sizeOfCell);\n LinearLayout.LayoutParams lpCell = new LinearLayout.LayoutParams(sizeOfCell, sizeOfCell);\n LinearLayout linRow;\n\n for (int row = 0; row < maxN; row++) {\n linRow = new LinearLayout(context);\n for (int col = 0; col < maxN; col++) {\n ivCell[row][col] = new ImageView(context);\n linRow.addView(ivCell[row][col], lpCell);\n }\n linBoardGame.addView(linRow, lpRow);\n }\n }", "public UIBoard()\r\n\t{\r\n\t\t//Creates a 10x10 \"Board\" object\r\n\t\tsuper(10,10);\r\n\t\tgrid = new int[getLength()][getWidth()];\r\n\t\t\r\n\t\t//Sets all coordinates to the value 0, which corresponds to \"not hit yet\"\r\n\t\tfor(int i=0; i<grid.length; i++)\r\n\t\t\tfor(int j=0; j<grid[i].length; j++)\r\n\t\t\t\tgrid[i][j] = 0;\t\t\r\n\t}", "public Board(int xLen, int yLen)\r\n {\r\n if(xLen <= 0 || yLen <= 0)\r\n xLen = yLen = 8;\r\n board = new Piece[xLen][yLen];\r\n xLength = xLen;\r\n yLength = yLen;\r\n }", "public OthelloBoard (int height, int width){\n super(height, width);\n m_Pieces = new OthelloPiece[WIDTH][HEIGHT];\n m_PieceCount+=4;\n \n }", "public TTTBoard(int dimensions)\n\t{\n\t\tsuper(dimensions, dimensions);\n\t\tplayer = 0;\n\t}", "private void initializeBoard() {\n\t\t\n\t}", "public Board() {\n //Create all pieces\n board[0][0] = new Rook(\"black\", 0, 0);\n board[0][1] = new Knight(\"black\", 0, 1);\n board[0][2] = new Bishop(\"black\", 0, 2);\n board[0][3] = new Queen(\"black\", 0, 3);\n board[0][4] = new King(\"black\", 0, 4);\n board[0][5] = new Bishop(\"black\", 0, 5);\n board[0][6] = new Knight(\"black\", 0, 6);\n board[0][7] = new Rook(\"black\", 0, 7);\n\n board[7][0] = new Rook(\"white\", 7, 0);\n board[7][1] = new Knight(\"white\", 7, 1);\n board[7][2] = new Bishop(\"white\", 7, 2);\n board[7][3] = new Queen(\"white\", 7, 3);\n board[7][4] = new King(\"white\", 7, 4);\n board[7][5] = new Bishop(\"white\", 7, 5);\n board[7][6] = new Knight(\"white\", 7, 6);\n board[7][7] = new Rook(\"white\", 7, 7);\n\n for (int j = 0; j < 8; j++) {\n board[1][j] = new Pawn(\"black\", 1, j);\n board[6][j] = new Pawn(\"white\", 6, j);\n }\n\n //Printing everything\n for (Piece[] a : board) {\n for (Piece b : a) {\n System.out.printf(\"%-15s\", \"[\" + b + \"]\");\n }\n System.out.println(\"\");\n }\n }", "public Board(){\n for(int holeIndex = 0; holeIndex<holes.length; holeIndex++)\n holes[holeIndex] = new Hole(holeIndex);\n for(int kazanIndex = 0; kazanIndex<kazans.length; kazanIndex++)\n kazans[kazanIndex] = new Kazan(kazanIndex);\n nextToPlay = Side.WHITE;\n }", "Board() {\n this.ones = -1; // 1\n this.twos = -1; // 2\n this.threes = -1; // 3\n this.fours = -1; // 4\n this.fives = -1; // 5\n this.sixes = -1; // 6\n this.threeOfAKind = -1; // 7\n this.fourOfAKind = -1; // 8\n this.smallStraight = -1;// 9\n this.longStraight = -1; // 10\n this.fullHouse = -1; // 11\n this.yahtzee = -1; // 12\n }", "public Board() {\n\t\t\n\t\tchar letter = 'A';\n\t\tint letterValue;\n\t\tint tempNum;\n\t\tString position;\n\t\tString number;\n\t\t\n\t\t\n\t\tfor(int i = 0; i < 10; i++) {\n\t\t\tfor(int j = 0; j < 10; j++) {\n\t\t\t\ttempNum = j+1;\n\t\t\t\tnumber = Integer.toString(tempNum);\n\t\t\t\tposition = Character.toString(letter) + number;\n\t\t\t\t//position += Character.toString(number);\n\t\t\t\tradar[i][j] = position;\n\t\t\t}\n\t\t\tletterValue = (int) letter;\n\t\t\tletterValue++;\n\t\t\tletter = (char) letterValue;\n\t\t}\n\t\trefRadar = backup(radar);\n\t}", "public void initializeBoard() {\n\n\t\t/*\n\t\t * How the array coordinates align with the actual chess board\n\t\t * (row,col) \n\t\t * (7,0) ... ... ... \n\t\t * (7,7) ... ... ... \n\t\t * ... ... ... \n\t\t * (2,0) ...\n\t\t * (1,0) ... \n\t\t * (0,0) ... ... ... (0,7)\n\t\t */\n\n\t\tboolean hasMoved = false;\n\t\tboolean white = true;\n\t\tboolean black = false;\n\n\t\t// Set white piece row\n\t\tboard[0][0] = new Piece('r', white, hasMoved, 0, 0, PieceArray.A_rookId);\n\t\tboard[0][1] = new Piece('n', white, hasMoved, 0, 1, PieceArray.B_knightId);\n\t\tboard[0][2] = new Piece('b', white, hasMoved, 0, 2, PieceArray.C_bishopId);\n\t\tboard[0][3] = new Piece('q', white, hasMoved, 0, 3, PieceArray.D_queenId);\n\t\tboard[0][4] = new Piece('k', white, hasMoved, 0, 4, PieceArray.E_kingId);\n\t\tboard[0][5] = new Piece('b', white, hasMoved, 0, 5, PieceArray.F_bishopId);\n\t\tboard[0][6] = new Piece('n', white, hasMoved, 0, 6, PieceArray.G_knightId);\n\t\tboard[0][7] = new Piece('r', white, hasMoved, 0, 7, PieceArray.H_rookId);\n\n\t\t// Set white pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[1][i] = new Piece('p', white, hasMoved, 1, i, i + 8);\n\t\t}\n\n\t\t// Set empty rows\n\t\tfor (int row = 2; row < 6; row++)\n\t\t\tfor (int col = 0; col < 8; col++)\n\t\t\t\tboard[row][col] = null;\n\n\t\t// Set black pawns\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tboard[6][i] = new Piece('p', black, hasMoved, 6, i, i+8);\n\t\t}\n\n\t\t// Set black piece row\n\t\tboard[7][0] = new Piece('r', black, hasMoved, 7, 0, PieceArray.A_rookId);\n\t\tboard[7][1] = new Piece('n', black, hasMoved, 7, 1, PieceArray.B_knightId);\n\t\tboard[7][2] = new Piece('b', black, hasMoved, 7, 2, PieceArray.C_bishopId);\n\t\tboard[7][3] = new Piece('q', black, hasMoved, 7, 3, PieceArray.D_queenId);\n\t\tboard[7][4] = new Piece('k', black, hasMoved, 7, 4, PieceArray.E_kingId);\n\t\tboard[7][5] = new Piece('b', black, hasMoved, 7, 5, PieceArray.F_bishopId);\n\t\tboard[7][6] = new Piece('n', black, hasMoved, 7, 6, PieceArray.G_knightId);\n\t\tboard[7][7] = new Piece('r', black, hasMoved, 7, 7, PieceArray.H_rookId);\n\t}", "public MyWorld()\n { \n // Create a new world with 600x400 cells with a cell size of 1x1 pixels.\n super(600, 600, 1); \n \n drawLines();\n \n for( int r = 0; r < board.length; r++ )\n {\n for( int c = 0; c < board[r].length; c++)\n {\n board[r][c] = \"\"; \n \n }\n }\n }", "public BoardImpl(int size)\r\n {\r\n if (size != 9 && size != 13 && size != 19)\r\n throw new WrongBoardSizeException(\"Board could not be created. GO board must be size 9, 13 or 19\");\r\n setSize(size);\r\n setBoard(new ArrayList<List<Field>>());\r\n setHistory(new ArrayList<Move>());\r\n createFields();\r\n }", "private void initialiseBoard() {\r\n\t\t//Set all squares to EMPTY\r\n\t\tfor(int x = 0; x < board.getWidth(); x++) {\r\n\t\t\tfor(int y = 0; y < board.getHeight(); y++) {\r\n\t\t\t\tboard.setSquare(new GridSquare(GridSquare.Type.EMPTY), x, y);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Assign player tiles\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_ONE_TILE), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new PlayerTile(GridSquare.Type.PLAYER_TWO_TILE), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y);\r\n\t\t\r\n\t\t//Assign Creation tiles\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_ONE_POSITION_X+3, Board.PLAYER_ONE_POSITION_Y+3);\r\n\t\tsetFixedTile(new CreationTile(GridSquare.Type.CREATION_TILE), Board.PLAYER_TWO_POSITION_X-3, Board.PLAYER_TWO_POSITION_Y-3);\r\n\t\t\r\n\t\t//Assign Out of Bounds tiles\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_ONE_POSITION_X-3, Board.PLAYER_ONE_POSITION_Y-3);\r\n\t\t\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\tsetFixedTile(new OutOfBoundsTile(GridSquare.Type.OUT_OF_BOUNDS), Board.PLAYER_TWO_POSITION_X+3, Board.PLAYER_TWO_POSITION_Y+3);\r\n\t\t\r\n\t\t\r\n\t}", "public Board(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tgrid = new boolean[width][height];\n\t\tcommitted = true;\n\t\t//Initialize the quick palying data attributes\n\t\twidths = new int[height];\n\t\theights = new int[width];\n\t\tmaxHeight = 0;\n\t\t//Initialize the undo data\n\t\tundoWidths = new int[height];\n\t\tundoHeights = new int[width];\n\t\tundoGrid = new boolean[width][height];\n\t\t\n\t\t// YOUR CODE HERE\n\t}", "public Board (int rSize, int cSize)\r\n\t{\r\n\t\tint i, x;\r\n\t\tRow_Size = rSize;\r\n\t\tColumn_Size = cSize;\r\n\t\tLayout = new int [Row_Size][Column_Size];\r\n\r\n\t\tfor(i=0;i<Row_Size;i++)\r\n\t\t{\r\n\t\t\tfor(x=0;x<Column_Size;x++)\r\n\t\t\t{\r\n\t\t\t\tLayout[i][x] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public Gameboard() {\n\n\t\tturn = 0;\n\n\t\tboard = new Cell[4][4][4];\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\t\tfor (int k = 0; k < board.length; k++) {\n\n\t\t\t\t\tboard[i][j][k] = Cell.E;\n\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Board(int size) {\n initialize(size, null);\n }", "public PersonalBoard(int width, int height){\n super(width, height);\n this.rand = new Random();\n }", "public void setBoard() {\n bestPieceToMove = null;\n bestPieceFound = false;\n bestMoveDirectionX = 0;\n bestMoveDirectionY = 0;\n bestMoveFound = false;\n killAvailable = false;\n lightCounter = 12;\n darkCounter = 12;\n for (int y = 0; y < boardSize; y++) {\n for (int x = 0; x < boardSize; x++) {\n board[y][x] = new Field(x, y);\n if (y < 3 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.DARK, PieceType.MEN));\n } else if (y > 4 && board[y][x].getPlaceable()) {\n board[y][x].setPiece(new Piece(PieceColor.LIGHT, PieceType.MEN));\n }\n }\n }\n }", "@Override\r\n public Dimension getPreferredSize()\r\n {\n return new Dimension(BOARD_WIDTH, BOARD_HEIGHT);\r\n }", "public Board() {\n\t\tthis.myBoard = new BlockFor2048[4][4];\n\t\tint randomInserted = 0;\n\t\tint colInd = 0;\n\t\tint rowInd = 0;\n\t\twhile (randomInserted != 2){\n\t\t\tcolInd = (int)(Math.random() * 4);\n\t\t\trowInd = (int)(Math.random() * 4);\n\t\t\tif (this.myBoard[colInd][rowInd] == null){\n\t\t\t\tthis.myBoard[colInd][rowInd] = new BlockFor2048(2);\n\t\t\t\trandomInserted++;\n\t\t\t}\n\t\t}\t\t\n\t\tthis.ScoreValue = 0;\n\t}", "public TicTacToeBoard() {board = new int[rows][columns];}", "public SudokuBoard()\n\t{\n\t\tcurrentTime = 0;\n\t\tseconds = 0;\n\t\tminutes = 0;\n\t\tnumberOfHints = 0;\n\t\ttimeDisplay = null;\n\t\tuser = null;\n\t\tdifficulty = \"\";\n\t}", "public void setUp()\r\n {\r\n board = new MineSweeperBoard(4, 4, 1);\r\n }", "public Board(int boardSize) {\n\n sounds = new GameSounds();\n gridSize = boardSize;\n newGame = 0;\n titleScreen = true;\n traversedTiles = new boolean[gridSize][gridSize];\n pellets = new boolean[gridSize][gridSize];\n ghosts.add(new Ghost(180, 180, ghostImage1));\n ghosts.add(new Ghost(200, 180, ghostImage2));\n ghosts.add(new Ghost(220, 180, ghostImage3));\n map = getMapFromFile(\"first.txt\");\n// ghosts.add(new Ghost(220,180,ghostImage4));\n reset();\n }", "public TetrisBoard() {\n super();\n\n myBoard = new Board();\n myHeight = myBoard.getHeight() * BLOCK_SIZE;\n myWidth = myBoard.getWidth() * BLOCK_SIZE;\n myGameMode = CLASSIC_MODE;\n myBoardString = myBoard.toString();\n myGameOver = false;\n myWelcome = true;\n myTimer = new Timer(INITIAL_TIMER_DELAY, new TimerListener());\n\n setupBoard();\n }", "public Board(char[][] board) {\n this.boardWidth = board.length;\n this.boardHeight = board[0].length;\n this.board = board;\n this.numShips = 0;\n boardInit();\n }", "public Board(int rows, int columns) throws Exception {\n\t\tif (rows >= 8 && columns >= 8) {\n\t\t\tthis.rows = rows;\n\t\t\tthis.columns = columns;\n\t\t\tboard = new int[rows][columns];\n\t\t\tthis.bombs = (rows * columns) / 3;\n\t\t\tfillBoard();\n\t\t} else {\n\t\t\tthrow new Exception(\"Minesweeper dimensions invalid:\\nWidth: from 8 to 100\\nHeight: from 8 to 100\\nBombs: 1 to 1/3 of squares\");\n\t\t}\n\t}", "public KnightsPosition() {\r\n row = 0;\r\n column = 0;\r\n }", "TetrisBoard() {\n\t\t// create new board \n\t\tblockMatrix = new boolean[NUM_ROWS][NUM_COLS];\n\t\t\n\t\t// fill in values for board\n\t\tinitBoard();\n\t\t\n\t\t// add new piece to fall\n\t\taddNewPiece();\n\t\t\n\t\t// start scores at 0\n\t\tnumLines = 0;\n\t\tnumTetrises = 0;\n\t}", "public Board() {\n\t\tthis.table = new int[Constants.SIZE][Constants.SIZE];\n\t\tthis.P1Movable = new boolean[Constants.SIZE][Constants.SIZE];\n\t\tthis.P2Movable = new boolean[Constants.SIZE][Constants.SIZE];\n\t\tP1turn = true;\n\t\tnumPieces = 0;\n\t\t\n\t\tfor(int i=0; i<table.length; i++) {\n\t\t\tfor(int j=0; j<table[i].length; j++) {\n\t\t\t\ttable[i][j] = Constants.EMPTY;\n\t\t\t\tP1Movable[i][j] = true;\n\t\t\t\tP2Movable[i][j] = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public AIPlayer(Board board) {\n cells = board.squares;\n }", "Board() {\r\n init();\r\n }", "public ThirteensBoard()\n {\n super(BOARD_SIZE, RANKS, SUITS, POINT_VALUES);\n }", "public Coordinate() { row = col = -1; }", "public Display() {\r\n\t\t//Fills the board with invalid positions\r\n\t\tboard = new int[17][17];\r\n\t\tfor (int i = 0; i < 17; i++)\r\n\t\t\tfor (int j = 0; j < 17; j++)\r\n\t\t\t\tboard[i][j] = -1;\r\n\r\n\t\t//Fills the center of the board with valid positions\r\n\t\tfor (int i = 4; i <= 12; i++)\r\n\t\t\tfor (int j = 4; j <= 12; j++)\r\n\t\t\t\tboard[i][j] = 0;\r\n\t\t\r\n\t\t//Fills the rest of the board with valid positions\r\n\t\tfillTriangle(-1, board, 0, 16, 12);\r\n\t\tfillTriangle(1, board, 0, 9, 13);\r\n\t\tfillTriangle(-1, board, 0, 7, 12);\r\n\t\tfillTriangle(1, board, 0, 0, 4);\r\n\t\tfillTriangle(-1, board, 0, 7, 3);\r\n\t\tfillTriangle(1, board, 0, 9, 4);\r\n\t\t\r\n\t\tthis.setPreferredSize(SIZE);\r\n\t}", "public CheckerBoard(int size) {\n super(new int[size * tilesPerSide][size * tilesPerSide][3]);\n for (int y = 0; y < this.getHeight(); ++y) {\n for (int x = 0; x < this.getWidth(); ++x) {\n for (int channel = 0; channel < 3; ++channel) {\n this.data[y][x][channel] = ((x / size + y / size) % 2 == 1) ? 0 : 255;\n }\n }\n }\n }", "public Board(int width, int height) {\n\t\tthis.width = width;\n\t\tthis.height = height;\n\t\tgrid = new boolean[width][height];\n\t\tcommitted = true;\n\t\twidths = new int[height];\n\t\theights = new int[width];\n\t\tmaxColumnHeight = 0;\n\n\t\tbackupGrid = new boolean[width][height];\n\t\tbackupHeights = new int[width];\n\t\tbackupWidths = new int [height];\n\t\tbackupMaxColumnHeight = 0;\n\t}", "Board createLayout();", "public Board(int size, Piece[][] initConfig) {\n initialize(size, initConfig);\n }", "public Board() {\n this.actionField = new ActionField();\n this.buyField = new BuyField();\n }", "@Override\r\n public Dimension getPreferredSize() {\r\n return new Dimension(boardWidth, boardHeight);\r\n }", "public Board(){\r\n \r\n //fill tile list with tile objects\r\n tiles.add(new Tile(new Coordinate(0,0)));\r\n tiles.add(new Tile(new Coordinate(0,1)));\r\n tiles.add(new Tile(new Coordinate(0,2)));\r\n tiles.add(new Tile(new Coordinate(1,0)));\r\n tiles.add(new Tile(new Coordinate(1,1)));\r\n tiles.add(new Tile(new Coordinate(1,2)));\r\n tiles.add(new Tile(new Coordinate(1,3)));\r\n tiles.add(new Tile(new Coordinate(2,0)));\r\n tiles.add(new Tile(new Coordinate(2,1)));\r\n tiles.add(new Tile(new Coordinate(2,2)));\r\n tiles.add(new Tile(new Coordinate(2,3)));\r\n tiles.add(new Tile(new Coordinate(2,4)));\r\n tiles.add(new Tile(new Coordinate(3,1)));\r\n tiles.add(new Tile(new Coordinate(3,2)));\r\n tiles.add(new Tile(new Coordinate(3,3)));\r\n tiles.add(new Tile(new Coordinate(3,4)));\r\n tiles.add(new Tile(new Coordinate(4,2)));\r\n tiles.add(new Tile(new Coordinate(4,3)));\r\n tiles.add(new Tile(new Coordinate(4,4)));\r\n \r\n //fills corner list with corner objects\r\n List<Coordinate> cornercoords = new ArrayList<>();\r\n for(Tile t : tiles){\r\n for(Coordinate c : t.getAdjacentCornerCoords()){\r\n if(cornercoords.contains(c)==false) cornercoords.add(c);\r\n }\r\n }\r\n for(Coordinate c : cornercoords){\r\n corners.add(new Corner(c));\r\n }\r\n \r\n //fills adjacent corner/tile fields\r\n for(Tile t: tiles){\r\n t.fillAdjacents(tiles,corners);\r\n }\r\n for(Corner c: corners){\r\n c.fillAdjacents(tiles,corners);\r\n }\r\n \r\n //generates an edge between each corner and fills the list of edges\r\n //results in lots of duplicates\r\n for(Corner c: corners){\r\n for(Corner adjacent: c.getAdjacentCorners()){\r\n edges.add(new Edge(c,adjacent));\r\n }\r\n }\r\n \r\n //hopefully removes duplicates from the edge list\r\n Iterator<Edge> iter = edges.iterator();\r\n boolean b = false;\r\n while (iter.hasNext()) {\r\n Edge e = iter.next();\r\n for(Edge edge : edges){\r\n if(e.sharesCorners(edge)==true && edge!=e){\r\n b = true;\r\n }\r\n }\r\n if(b==true) iter.remove();\r\n b = false;\r\n }\r\n \r\n //give each tile a token number and resource type \r\n ArrayList<Tile> randomtiles = randomize(tiles);\r\n int sheep = 3;\r\n int wood = 3;\r\n int rock = 2;\r\n int brick = 2;\r\n int wheat = 3;\r\n for(Tile t : randomtiles){\r\n if(sheep>0){\r\n t.setResource(Resource.SHEEP);\r\n sheep--;\r\n }\r\n if(wood>0){\r\n t.setResource(Resource.WOOD);\r\n wood--;\r\n }\r\n if(brick>0){\r\n t.setResource(Resource.CLAY);\r\n brick--;\r\n }\r\n if(wheat>0){\r\n t.setResource(Resource.WHEAT);\r\n wheat--;\r\n }\r\n if(rock>0){\r\n t.setResource(Resource.ROCK);\r\n rock--;\r\n }\r\n else t.setResource(Resource.DESERT); \r\n } \r\n randomtiles = randomize(randomtiles);\r\n int twos = 1;\r\n int twelves = 1;\r\n int threes = 2;\r\n int fours = 2;\r\n int fives = 2;\r\n int sixes = 2;\r\n int sevens = 2;\r\n int eights = 2;\r\n int nines = 2;\r\n int tens = 2;\r\n int elevens = 2; \r\n for(Tile t : randomtiles){\r\n if(t.getResource() != Resource.DESERT){\r\n if(twos != 0){\r\n t.setToken(2);\r\n twos--;\r\n }\r\n else if(threes !=0){\r\n t.setToken(3);\r\n threes--;\r\n }\r\n else if(fours !=0){\r\n t.setToken(4);\r\n fours--;\r\n } \r\n else if(fives !=0){\r\n t.setToken(5);\r\n fives--;\r\n } \r\n else if(sixes !=0){\r\n t.setToken(6);\r\n sixes--;\r\n } \r\n else if(sevens !=0){\r\n t.setToken(7);\r\n sevens--;\r\n } \r\n else if(eights !=0){\r\n t.setToken(8);\r\n eights--;\r\n } \r\n else if(nines !=0){\r\n t.setToken(9);\r\n nines--;\r\n } \r\n else if(tens !=0){\r\n t.setToken(10);\r\n tens--;\r\n } \r\n else if(elevens !=0){\r\n t.setToken(11);\r\n elevens--;\r\n } \r\n else if(twelves !=0){\r\n t.setToken(12);\r\n twelves--;\r\n } \r\n }\r\n }\r\n }", "public void initializeBoard() {\n\t\tfor (int i = 0; i < 9; i++) {\n\t\t\tthis.board[i] = \"-\";\n\n\t\t}\n\n\t}", "public ThreeStonesBoard(int size) {\r\n this.size = size;\r\n this.board = new Tile[size][size];\r\n }", "private void fillBoard() {\n\n boardMapper.put(1, new int[]{0, 0});\n boardMapper.put(2, new int[]{0, 1});\n boardMapper.put(3, new int[]{0, 2});\n boardMapper.put(4, new int[]{1, 0});\n boardMapper.put(5, new int[]{1, 1});\n boardMapper.put(6, new int[]{1, 2});\n boardMapper.put(7, new int[]{2, 0});\n boardMapper.put(8, new int[]{2, 1});\n boardMapper.put(9, new int[]{2, 2});\n\n }", "public ThreeStonesBoard(Tile[][] board) {\r\n this.board = board;\r\n }", "@Test\r\n public void testCustomBoardConstructor() throws IllegalAccessException, NoSuchFieldException\r\n {\r\n Board b = new Board(5,6);\r\n assertEquals(5, b.xLength);\r\n assertEquals(6, b.yLength);\r\n Class<?> bClass = Board.class;\r\n Field field = bClass.getDeclaredField(\"board\");\r\n field.setAccessible(true);\r\n Piece[][] internalBoard = (Piece[][]) field.get(b);\r\n assertEquals(5, internalBoard.length);\r\n assertEquals(6, internalBoard[0].length);\r\n }", "private void initialize() {\n this.board.addBoardChangeListener(this);\n\n this.layers = new ArrayList();\n this.bounds = new Rectangle();\n\n this.zoom = 1.0;\n this.zoomLevel = ZOOM_NORMALSIZE;\n this.affineTransform = new AffineTransform();\n\n this.loadTiles(board);\n this.setPreferredSize(new Dimension((board.getWidth() * 32),\n (board.getHeight() * 32)));\n\n bufferedImage = new BufferedImage((board.getWidth() * 32),\n (board.getHeight() * 32), BufferedImage.TYPE_INT_ARGB);\n\n this.antialiasGrid = true;\n this.gridColor = DEFAULT_GRID_COLOR;\n this.gridOpacity = 100;\n\n if (!this.layers.isEmpty()) {\n this.currentSelectedLayer = this.layers.get(0);\n }\n }", "public Board(int[][] tiles) {\n n = tiles.length;\n this.tiles = deepCopy(tiles);\n }", "private void setUpCorrect() {\n List<Tile> tiles = makeTiles();\n Board board = new Board(tiles, 4, 4);\n boardManager = new BoardManager(board);\n }", "private GameBoard() {}", "public Connect4Board() {\n super(rows, cols);\n }", "public Board(int[][] grid, Tetrimino piece) {\n //initComponents();\n this.grid = grid;\n this.piece = piece;\n setLayout(new GridLayout(grid.length-4, grid[0].length));\n init();\n }", "public void setBoardDimensions(int i, int j) {\n\tcols = i;\n\trows = j;\n\tboard.init(i, j);\n\tgb.init();\n\tvalidate();\n }", "public Board(Map<Integer, Space> spaces)\r\n\t{\r\n\t\t_spaces = spaces;\r\n\t}", "public Board(String gameType) {\n propertyFactory = new TileFactory(gameType);\n createBoard();\n }", "public GameBoard() {\n this.gameStarted = false;\n this.turn = 1; \n this.boardState = new char[3][3];\n this.winner = 0; \n this.isDraw = false; \n\n }", "public GameBoard() {\r\n boards = new ArrayList<GameBoard>();\r\n }", "public Queen(int initX, int initY, Color color, StandardBoard board) {\n\t\tsuper(initX, initY, color, board);\n\t\tthis.nameOfPiece = \"queen\";\n\t}", "Board() {\n clear();\n }", "Board() {\n clear();\n }", "private void initializeBoard() {\n\n squares = new Square[8][8];\n\n // Sets the initial turn to the White Player\n turn = white;\n\n final int maxSquares = 8;\n for(int i = 0; i < maxSquares; i ++) {\n for (int j = 0; j < maxSquares; j ++) {\n\n Square square = new Square(j, i);\n Piece piece;\n Player player;\n\n if (i < 2) {\n player = black;\n } else {\n player = white;\n }\n\n if (i == 0 || i == 7) {\n switch(j) {\n case 3:\n piece = new Queen(player, square);\n break;\n case 4:\n piece = new King(player, square);\n break;\n case 2:\n case 5:\n piece = new Bishop(player, square);\n break;\n case 1:\n case 6:\n piece = new Knight(player, square);\n break;\n default:\n piece = new Rook(player, square);\n }\n square.setPiece(piece);\n } else if (i == 1 || i == 6) {\n piece = new Pawn(player, square);\n square.setPiece(piece);\n }\n squares[j][i] = square;\n }\n }\n }" ]
[ "0.78086543", "0.74905634", "0.7490009", "0.74812275", "0.73758745", "0.7334863", "0.72188264", "0.718872", "0.71499294", "0.7125397", "0.7000072", "0.6958052", "0.69469726", "0.69466686", "0.68790203", "0.68420243", "0.6827247", "0.6821515", "0.67661345", "0.6716351", "0.6711568", "0.6703801", "0.67033017", "0.6683406", "0.6658674", "0.66583955", "0.6648948", "0.664099", "0.66331154", "0.6633023", "0.66299725", "0.66284937", "0.6606519", "0.6597539", "0.6589879", "0.65867245", "0.65699124", "0.6559049", "0.6553477", "0.65513545", "0.65481836", "0.65385705", "0.6527451", "0.65140164", "0.65011835", "0.6494535", "0.6490486", "0.64678574", "0.6463512", "0.64515454", "0.6445505", "0.6442735", "0.6439274", "0.6425863", "0.6410645", "0.6395751", "0.6379512", "0.63779056", "0.63669795", "0.6360917", "0.63524294", "0.63524216", "0.6350584", "0.63435936", "0.63398695", "0.63216335", "0.6319654", "0.6310449", "0.6308345", "0.63067675", "0.630414", "0.6285748", "0.6278039", "0.62776667", "0.6275662", "0.6266469", "0.62646663", "0.6262814", "0.6256203", "0.6251655", "0.6245739", "0.6244686", "0.6224581", "0.6224346", "0.62242424", "0.6215365", "0.61914957", "0.6164602", "0.6161871", "0.6152771", "0.61526155", "0.61400646", "0.6124761", "0.6124403", "0.61240935", "0.6118285", "0.6114449", "0.6113939", "0.6107447", "0.6107447", "0.61048347" ]
0.0
-1
The getter for the EventTimeline's query which will fuel the EventTimeline..
@JsonIgnore public String getQuery() { return _query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Timeline getTimeline() { return this.timeline; }", "public Timeline getTimeline() {\n return this.timeline;\n }", "public RMTimeline getTimeline() { return getTimeline(false); }", "public Timeline getTimeline(){\n return null;\n }", "public HashMap<String/* concept path */, List<TimelineEvent> /* events */> runTimelineQuery(Query query){\n\t\tList<String> requiredFieldsForTimeline = query.getRequiredFields();\n\t\tList<String> fieldsForTimeline = new ArrayList(query.getRequiredFields());\n\t\tfieldsForTimeline.addAll(query.getRequiredFields());\n\n\t\t// todo: copy the query?\n\t\t// wipe out required fields to not limit the patients by it\n\t\tquery.setRequiredFields(new ArrayList<>());\n\n\t\t// list patients involved\n\t\tSet<Integer> patientIds = abstractProcessor.getPatientSubsetForQuery(query);\n\n\t\t// get start time for the timeline\n\t\tlong startTime = Long.MAX_VALUE;\n\t\tfor(String field : requiredFieldsForTimeline) {\n\t\t\tPhenoCube cube = abstractProcessor.getCube(field);\n\t\t\tList<KeyAndValue> values = cube.getValuesForKeys(patientIds);\n\t\t\tfor(KeyAndValue value : values) {\n\t\t\t\tif(value.getTimestamp()!=null && value.getTimestamp() > 0 && value.getTimestamp() < startTime) {\n\t\t\t\t\tstartTime = value.getTimestamp();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfinal long _startTime = startTime;\n\t\tLinkedHashMap<String/* concept path */, List<TimelineEvent> /* events */> timelineEvents = \n\t\t\t\tnew LinkedHashMap<>();\n\t\t// fetch results for selected fields\n\t\tfor(String concept : fieldsForTimeline) {\n\t\t\tPhenoCube cube = abstractProcessor.getCube(concept);\n\t\t\tList<KeyAndValue> values = cube.getValuesForKeys(patientIds);\n\t\t\ttimelineEvents.put(concept, \n\t\t\t\t\tvalues.parallelStream()\n\t\t\t\t\t.map( value->{\n\t\t\t\t\t\treturn new TimelineEvent(value, _startTime);\n\t\t\t\t\t})\n\t\t\t\t\t.filter(event -> {\n\t\t\t\t\t\treturn event.getTimestamp() > -1;\n\t\t\t\t\t})\n\t\t\t\t\t.sorted(TimelineEvent.timestampComparator)\n\t\t\t\t\t.collect(Collectors.toList()));\n\t\t}\n\n\t\tList<Entry<String, List<TimelineEvent>>> entries = new ArrayList<>(timelineEvents.entrySet());\n\n\t\tCollections.sort(entries, (a, b)->{\n\t\t\tif(a.getValue().isEmpty()) return 1;\n\t\t\tif(b.getValue().isEmpty()) return -1;\n\t\t\treturn TimelineEvent.timestampComparator.compare(a.getValue().get(0), b.getValue().get(0));\n\t\t});\n\n\t\ttimelineEvents.clear();\n\t\tentries.stream().forEach(\n\t\t\t\t(entry)->{\n\t\t\t\t\ttimelineEvents.put(entry.getKey(), entry.getValue());\n\t\t\t\t});\n\n\t\treturn timelineEvents;\n\t}", "public PagedList<Post> getTimeline() {\n return this.getTimeline(null);\n }", "public Query getQuery()\n {\n return query;\n }", "public Query getQuery ()\n {\n\n\treturn this.q;\n\n }", "@Override\n public Cursor<Event> streamEvents() {\n ensureRatingCache();\n return cache.streamEvents();\n }", "public ContactQuery getQuerySource()\n {\n return (ContactQuery) source;\n }", "private void queryEvents() {\n ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n // include data referred by user key\n query.include(Event.KEY_HOST);\n // limit query to latest 20 items\n query.setLimit(30);\n // order posts by creation date (newest first)\n query.addDescendingOrder(\"createdAt\");\n // start an asynchronous call for events\n query.findInBackground(new FindCallback<Event>() {\n @Override\n public void done(List<Event> events, com.parse.ParseException e) {\n\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n\n // for debugging purposes let's print every event description to logcat\n for (Event event : events) {\n Log.i(TAG, \"Event: \" + event.getDescription() + \", username: \" + event.getHost().getUsername());\n }\n\n // save received events to list and notify adapter of new data\n allEvents.addAll(events);\n }\n\n });\n }", "@XmlElement(name = \"events\")\n public List<TimelineEvent> getEvents() {\n return events;\n }", "public String getTimeline(String screenName);", "public CanaryTimeline getTimeline() {\n return this.timeline;\n }", "public com.microsoft.schemas.sharepoint.soap.UpdateViewQuery getQuery() {\r\n return query;\r\n }", "SearchResult<TimelineMeta> search(SearchQuery searchQuery);", "IQuery getQuery();", "public Observable getEvents(){\n QBRequestGetBuilder requestBuilder = new QBRequestGetBuilder();\n requestBuilder.sortDesc(\"startDate\");\n return makeObservable(requestBuilder);\n }", "public LiveData<Event> getEvent() {\n return event;\n }", "public List<Event> getEvents() {\n List<Event> events = new ArrayList<>();\n\n Query query = new Query(\"Event\");\n PreparedQuery results = datastore.prepare(query);\n\n for (Entity entity : results.asIterable()) {\n try {\n String idString = entity.getKey().getName();\n UUID eventId = UUID.fromString(idString);\n String speaker = (String) entity.getProperty(\"speaker\");\n String organization = (String) entity.getProperty(\"organization\");\n String eventDate = (String) entity.getProperty(\"eventDate\");\n Location location = (Location) entity.getProperty(\"location\");\n List<String> amenities = getAmenities(eventId);\n String externalLink = (String) entity.getProperty(\"externalLink\");\n PublicType publicType = (PublicType) entity.getProperty(\"publicType\");\n long ownerId = (long) entity.getProperty(\"ownerId\");\n List<ThreadComment> thread = getThread(eventId);\n // long timeStamp = (long) entity.getProperty(\"timestamp\");\n\n Event event = new Event(eventId, speaker, organization, eventDate, location, amenities, externalLink,\n publicType, ownerId);\n event.copyThread(thread);\n events.add(event);\n // An exception can occur here for multiple reasons (Type casting error, any\n // property not existing, key error, etc...)\n } catch (Exception e) {\n System.err.println(\"Error reading event.\");\n System.err.println(entity.toString());\n e.printStackTrace();\n }\n }\n\n return events;\n }", "public EventEntry getEventEntry();", "public String getQuery() {\n return _query;\n }", "public String getQuery(){\n return this.query;\n }", "public java.lang.String getQuery()\n {\n return this.query;\n }", "public String getQuery() {\n return this.query;\n }", "public String query() {\n return this.innerProperties() == null ? null : this.innerProperties().query();\n }", "public Event getEvent(){\n\t\t\treturn event;\n\t\t}", "com.google.speech.logs.timeline.InputEvent.Event getEvent();", "public DatabaseQuery getQuery() {\n return query;\n }", "public Query advancedQuery() \n {\n return null;\n }", "public QueryModel getQueryModel()\n {\n return _queryModel;\n }", "@Override\r\n public List<Events> findAllEvents() {\r\n return em.createNamedQuery(\"Events.findAll\").getResultList();\r\n }", "public Event getEvent(int id) {\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor res = db.query(TABLE_NAME,\n new String[]{COL_1, COL_2, COL_3, COL_4, COLOR},\n ID + \" = '\" + id + \"'\",\n null, null, null, null);\n if (res.moveToNext()) {\n Calendar start = Calendar.getInstance();\n Calendar end = Calendar.getInstance();\n start.setTimeInMillis(res.getLong(0));\n end.setTimeInMillis(res.getLong(1));\n return new Event(start, end, res.getString(2), res.getString(3), id, res.getInt(4));\n } else {\n return null;\n }\n }", "public String getQuery() {\r\n return query;\r\n }", "public Event getEvent() {\n\n return null;\n }", "@Override\n public Iterator<SingleQuery> iterator() {\n return new QueryHistoryIterator();\n }", "@NonNull\n public EventModel getEvent() {\n return mEvent;\n }", "public java.lang.String getQuery() {\r\n return query;\r\n }", "public final String getQuery() {\n return this.query;\n }", "Optional<Timeline> findByName(String name);", "TimelineEntity(){}", "public String getQuery() {\n return query;\n }", "public String getQuery() {\n return query;\n }", "public String getQuery() {\n return query;\n }", "public String getQuery() {\n return query;\n }", "public ArrayList<TimeLineEvent> getTimeLineEvents() {\n\t\treturn info;\n\t}", "@Override\n\tpublic ArrayList<Map<String, String>> get() {\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyyMMdd\");\n\t\tDate current = new Date();\n\t\tString date = format.format(current);\t\t\t\t\n\t\t// 유효기간이 지난 데이터는 리턴하지 않는다.\n\t\tArrayList<Map<String, String>> list = new ArrayList<Map<String, String>>();\n\t\tString sql = \"SELECT * FROM \" + EventDBHelper.TABLE + \" WHERE \" + ENABLEDATE + \">=\" + date + \" ORDER BY \" + ENABLEDATE + \" ASC\";\n\t\tmCursor = mDB.rawQuery(sql, null);\n\n\t\tif (mCursor.moveToFirst()) {\n\t\t\twhile (!mCursor.isAfterLast()) {\n\t\t\t\tMap<String, String> map = new HashMap<String, String>();\n\t\t\t\tmap.put(ESTID, mCursor.getString(mCursor.getColumnIndex(ESTID)));\n\t\t\t\tmap.put(EVENTID, mCursor.getString(mCursor.getColumnIndex(EVENTID)));\n\t\t\t\tmap.put(ENABLEDATE,\tmCursor.getString(mCursor.getColumnIndex(ENABLEDATE)));\n\t\t\t\tmap.put(DESC, mCursor.getString(mCursor.getColumnIndex(DESC)));\n\t\t\t\tlist.add(map);\n\t\t\t\tmCursor.moveToNext();\n\t\t\t}\n\t\t}\n\n\t\treturn list;\n\t}", "public QueryDescriptor getQueryDescriptor()\n {\n return _currentDescriptor;\n }", "public Event getEvent() {\n\t\treturn event;\n\t}", "public String getQuery() {\r\n\t\treturn query;\r\n\t}", "AbstractList<Event> getEventByCreateDate(Date d){\r\n\t\treturn events;\r\n\t}", "public TimeSeriesViewModel getTimeSeries() {\n return getParent().getTimeSeries();\n }", "public ArrayList<Event> getEvents(){\n return this.events;\n }", "public long getQueryTimeSec() {\n return queryTimeSec_;\n }", "public QueryElements getQueryAccess() {\n\t\treturn pQuery;\n\t}", "public String query() {\n return this.query;\n }", "public long getQueryTimeSec() {\n return queryTimeSec_;\n }", "public LiveData<List<DatabaseObject<Event>>> getAttendingEvents() {\n return mCachedEventsLiveData;\n }", "@Override\n public <E extends Event> Cursor<E> streamEvents(Class<E> type) {\n ensureRatingCache();\n return cache.streamEvents(type);\n }", "public EventDates getEventDates() {\n return eventDates;\n }", "public Object getEvent() {\r\n return event;\r\n }", "SearchResult<TimelineMeta> search(SearchParameter searchParameter);", "public ArrayList<Event> getEvents(){return new ArrayList<Event>(events);}", "public List<Event> getParticipatedEvents() {\n return participatedEvents;\n }", "public java.lang.CharSequence getQuery() {\n return query;\n }", "public Date getEventTime() {\n return eventTime;\n }", "public Date getEventTime() {\n return eventTime;\n }", "public Integer getQuery() {\n return this.query;\n }", "public EventsDTO getEvents();", "public java.lang.CharSequence getQuery() {\n return query;\n }", "public DurationBean getEventDuration() {\n// return getEventDates().getDuration();\n DurationBean db = getEventDates().getDuration();\n if (debug()) {\n debug(\"Event duration=\" + db);\n }\n\n return db;\n }", "public QueryState getQueryState() {\n return queryState;\n }", "@VTID(34)\n com.exceljava.com4j.excel.TimelineState getTimelineState();", "public Iterator<Exact_Period_Count> get_QueryIterator()\r\n\t{\r\n\t\treturn m_queryList.iterator();\r\n\t}", "Event getEvent();", "ScheduledEvents getScheduledEvents();", "public int getQueryTimeNsec() {\n return queryTimeNsec_;\n }", "@JsonGetter(\"event\")\r\n public String getEvent ( ) { \r\n return this.event;\r\n }", "@Override\n public String toString() {\n return \"Query: QueryID=\" +this.getQueryID()+ \" ReqPosts=\" + this.getRequestedPosts();\n }", "public Queries queries() {\n return this.queries;\n }", "@Override\n\tpublic Collection<Instance> getByQuery(Query query) {\n\t\treturn null;\n\t}", "public List<Events> getAllSystemEventsListForAll();", "public int getQueryTimeNsec() {\n return queryTimeNsec_;\n }", "boolean hasQueryVisibility();", "public jkt.hrms.masters.business.PrjQueryEntry getQueryEntry () {\n\t\treturn queryEntry;\n\t}", "public ArrayList<CampusEvent> fetchEvents() {\n SQLiteDatabase dbObj = getReadableDatabase();\n ArrayList<CampusEvent> entryList = new ArrayList<CampusEvent>();\n\n Cursor cursor = dbObj.query(TABLE_EVENT_ENTRIES, mColumnList, null,\n null, null, null, null);\n\n while (cursor.moveToNext()) {\n CampusEvent event = cursorToEvent(cursor);\n entryList.add(event);\n }\n\n cursor.close();\n dbObj.close();\n\n return entryList;\n }", "public com.microsoft.schemas.sharepoint.dsp.DSQuery getDsQuery() {\r\n return dsQuery;\r\n }", "public List<Event> getEventsList() {\n List<Event> eventDetails = eventRepository.findAll();\n return eventDetails;\n }", "public EventList getEvents(String userName) {\n try {\n PreparedStatement s = sql.prepareStatement(\"SELECT userId, eventName, startMonth, startDay, startYear, startHour, startMinute\" +\n \", endMonth, endDay, endYear, endHour, endMinute FROM Events WHERE userId=?\");\n s.setInt(1, getIdOfUser(userName));\n s.execute();\n ResultSet results = s.getResultSet();\n\n EventList events = new EventList();\n if (!results.isBeforeFirst()) {\n return events;\n }\n\n while (!results.isLast()) {\n results.next();\n Event e = new Event(userName, results.getString(2),\n results.getInt(3), results.getInt(4), results.getInt(5),\n results.getInt(6), results.getInt(7), results.getInt(8),\n results.getInt(9), results.getInt(10), results.getInt(11),\n results.getInt(12));\n events.add(e);\n }\n results.close();\n s.close();\n events.sort();\n\n return events;\n } catch (SQLException e) {\n System.err.println(\"SQLE\");\n sqlException(e);\n return null;\n }\n }", "@Override\n public Criteria getCriteria() {\n\n //判断是否为精确到天的时间查询\n //情况一 点击分组查询查看该天的详情\n if (this.searchObject.getEndtime() == null && this.searchObject.getStarttime() != null){\n\n this.searchObject.setEndtime(DateTool.addDays(this.searchObject.getStarttime(),1));\n\n //情况二 在分组页面按时间搜索\n }else if (this.searchObject.getEndtime() != null && this.searchObject.getStarttime().equals(this.searchObject.getEndtime())){\n\n this.searchObject.setEndtime(DateTool.addDays(this.searchObject.getStarttime(),1));\n }\n\n Criteria criteria = Criteria.and(\n\n Criteria.add(ActivityPlayerApply.PROP_ID, Operator.EQ, this.searchObject.getId()),\n Criteria.add(ActivityPlayerApply.PROP_ACTIVITY_MESSAGE_ID, Operator.EQ, this.searchObject.getActivityMessageId()),\n Criteria.add(ActivityPlayerApply.PROP_USER_ID, Operator.EQ, this.searchObject.getUserId()),\n Criteria.add(ActivityPlayerApply.PROP_USER_NAME, Operator.EQ, this.searchObject.getUserName()),\n Criteria.add(ActivityPlayerApply.PROP_REGISTER_TIME, Operator.EQ, this.searchObject.getRegisterTime()),\n Criteria.add(ActivityPlayerApply.PROP_APPLY_TIME, Operator.EQ, this.searchObject.getApplyTime()),\n Criteria.add(ActivityPlayerApply.PROP_PLAYER_RECHARGE_ID, Operator.EQ, this.searchObject.getPlayerRechargeId()),\n Criteria.add(ActivityPlayerApply.PROP_STARTTIME, Operator.GE, this.searchObject.getStarttime()),\n Criteria.add(ActivityPlayerApply.PROP_STARTTIME, Operator.LE, this.searchObject.getEndtime()),\n Criteria.add(ActivityPlayerApply.PROP_PREFERENTIAL_VALUE, Operator.EQ, this.searchObject.getPreferentialValue()),\n Criteria.add(ActivityPlayerApply.PROP_ARTICLE, Operator.EQ, this.searchObject.getArticle()),\n Criteria.add(ActivityPlayerApply.PROP_IS_REALIZE, Operator.EQ, this.searchObject.getIsRealize()),\n Criteria.add(ActivityPlayerApply.PROP_RELATION_PLAYER_ID, Operator.EQ, this.searchObject.getRelationPlayerId()),\n Criteria.add(ActivityPlayerApply.PROP_ACTIVITY_CLASSIFY_KEY, Operator.EQ, this.searchObject.getActivityClassifyKey()),\n Criteria.add(ActivityPlayerApply.PROP_ACTIVITY_TYPE_CODE, Operator.EQ, this.searchObject.getActivityTypeCode())\n );\n criteria.addAnd(ActivityPlayerApply.PROP_IS_DELETED, Operator.EQ, false);\n return criteria;\n }", "public ArrayList<QueryInfo> getQueryList()\n\t{\n\t\treturn queryList;\n\t}", "public RMTimeline getTimeline(boolean create)\n{\n // Get timeline from attributes map\n RMTimeline timeline = (RMTimeline)get(\"Anim\");\n \n // If null and create is requested, create\n if(timeline==null && create)\n setTimeline(timeline = new RMTimeline(this));\n\n // Return timeline\n return timeline;\n}", "private ArrayList<Item> getEvents() {\n\t\tArrayList<Item> events = Magical.getStorage().getList(\n\t\t\t\tStorage.EVENTS_INDEX);\n\t\treturn events;\n\t}", "public Events getEventDetailsByEventId(int eventId);", "public List<JsonEvent> getEvents(final EventQuery query) throws Exception {\n\t\tInputStream result = null;\n\t\tList<JsonEvent> events = null;\n\n\t\ttry {\n\t\t\tresult = UrlUtil.getInputStream(getUrl(query, Format.GEOJSON));\n\t\t\tevents = parseJsonEventCollection(result);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tresult.close();\n\t\t\t} catch (NullPointerException npx) {\n\t\t\t\t// Don't throw null pointer exceptions because they mask the real\n\t\t\t\t// exception, eg, that an error occurred during I/O.\n\t\t\t}\n\t\t}\n\n\t\treturn events;\n\t}", "public ArrayList<FbEvent> getOngoingEvents() throws SQLException {\n\t\tArrayList<FbEvent> events = new ArrayList<FbEvent>();\n\t\tSQLiteDatabase db = tableHelper.getReadableDatabase();\n\t\ttry {\n\t\t\tCursor cursor = db.query(SQLTablesHelper.MY_EVENT_TABLE_NAME, columns,\n\t\t\t\t\tSQLTablesHelper.MY_EVENT_START_TIME + \" >= ?\",\n\t\t\t\t\tnew String[] {String.valueOf(TimeFrame.getUnixTime(TimeFrame.getTodayDate()))}, \n\t\t\t\t\tnull, null, null);\n\t\t\tcursor.moveToFirst();\n\t\t\twhile (!cursor.isAfterLast()) {\n\t\t\t\tFbEvent event = cursorToEvent(cursor);\n\t\t\t\tevents.add(event);\n\t\t\t\tcursor.moveToNext();\n\t\t\t}\n\t\t\tcursor.close();\n\t\t} finally {\n\t\t\tdb.close();\n\t\t}\n\t\treturn events;\n\t}", "private TimeSpanList activeTimeAnswer()\r\n {\r\n return TimeSpanList.singleton(TimeSpan.get(myQueryTime));\r\n }", "Collection<CalendarEvent> getActiveEvents(long when)\n{\n List<CalendarEvent> rslt = new ArrayList<CalendarEvent>();\n try {\n getAllEvents(when);\n rslt.addAll(cal_events);\n }\n catch (Exception e) {\n BasisLogger.logE(\"GOOGLECAL: problem getting events\",e);\n }\n return rslt;\n}", "private QueryService getQueryService() {\n return queryService;\n }", "List<InsureUnitTrend> queryInsureDate();" ]
[ "0.65798044", "0.64662075", "0.6427115", "0.6157067", "0.6074588", "0.59795976", "0.58332366", "0.57123554", "0.55521107", "0.5550583", "0.55473703", "0.5523594", "0.5479448", "0.5452918", "0.5449252", "0.543731", "0.5434324", "0.54273075", "0.54211336", "0.53780377", "0.53771967", "0.5352092", "0.53488106", "0.5328952", "0.53260314", "0.53068167", "0.526798", "0.5265441", "0.52653044", "0.5236838", "0.5226886", "0.5226399", "0.52180815", "0.52067184", "0.5203478", "0.51912236", "0.519027", "0.5182178", "0.5181239", "0.5181217", "0.51741815", "0.51695895", "0.516691", "0.516691", "0.516691", "0.51483274", "0.5148095", "0.51452166", "0.5134893", "0.5115435", "0.5114274", "0.5110823", "0.509994", "0.5093308", "0.5090899", "0.508912", "0.50730944", "0.50665605", "0.50566953", "0.50519025", "0.50508904", "0.50453764", "0.5040076", "0.50300956", "0.50199765", "0.50145566", "0.50145566", "0.5012702", "0.5012483", "0.49941412", "0.49914655", "0.4986772", "0.49805853", "0.49440268", "0.49406826", "0.4938757", "0.4932288", "0.49232715", "0.49230847", "0.49212965", "0.49133882", "0.49112856", "0.49057233", "0.48994103", "0.4881954", "0.48761773", "0.48696914", "0.48614836", "0.4853266", "0.48513702", "0.4850598", "0.48497754", "0.48373643", "0.48345873", "0.48313162", "0.48300594", "0.4828476", "0.48193693", "0.48130563", "0.48100877" ]
0.52112955
33
The setter for the EventTimeline's query which will fuel the EventStream..
public void setQuery(String query) { _query = checkNotNull(query, "query is null"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void setQueryFilter(CalendarFilter filter) {\n this.queryFilter = filter;\n }", "public void setQuery(DatabaseQuery query) {\n this.query = query;\n }", "public void setQuery (Query q)\n\t throws IllegalStateException,\n\t QueryParseException\n {\n\n\tif (!q.parsed ())\n\t{\n\n\t throw new IllegalStateException (\"Query has not yet been parsed.\");\n\n\t}\n\n\tthis.q = q;\n\n\tthis.checkFrom ();\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n }", "public void setQuery(String query) {\n this.query = query;\n }", "public void setQuery(String query) {\n this.query = query;\n }", "public void setQuery(com.microsoft.schemas.sharepoint.soap.UpdateViewQuery query) {\r\n this.query = query;\r\n }", "public void setTimeline(Timeline timeline) {\n/* 485 */ if (this.timeline != timeline) {\n/* 486 */ this.timeline = timeline;\n/* 487 */ fireChangeEvent();\n/* */ } \n/* */ }", "public void setQuery(String query) {\n this.query = query == null ? null : query.trim();\n }", "public void setQuery(String query) {\n this.query = query == null ? null : query.trim();\n }", "@Override\n public Cursor<Event> streamEvents() {\n ensureRatingCache();\n return cache.streamEvents();\n }", "protected abstract void onQueryStart();", "public void setQuery(String query) {\n this.query = Optional.ofNullable(query);\n }", "public void setQuery(java.lang.String query) {\r\n this.query = query;\r\n }", "public void setQueryString(String query) {\n if (query != null && _convertPositionalParametersToNamed && JPQLParser.LANG_JPQL.equals(_language)) {\n query = query.replaceAll(\"[\\\\?]\", \"\\\\:_\");\n }\n _query = query;\n }", "public void setQuery(Integer query) {\n this.query = query;\n }", "public void setQuery( String query ) \r\n throws SQLException, IllegalStateException \r\n {\r\n if ( !connectedToDatabase ) \r\n throw new IllegalStateException( \"Not Connected to Database\" );\r\n\r\n resultSet = statement.executeQuery( query );\r\n\r\n metaData = resultSet.getMetaData();\r\n\r\n resultSet.last(); \r\n numberOfRows = resultSet.getRow(); \r\n \r\n fireTableStructureChanged();\r\n }", "public synchronized void requestStream(Query q) {\n // if this user has already registered a query\n if (!streams.containsKey(q)) {\n Closeable stream = factory.getStream(q);\n streams.put(q, stream);\n counts.put(q, 0);\n }\n counts.put(q, counts.get(q) + 1);\n if (sheduledRemovals.containsKey(q)) {\n sheduledRemovals.remove(q);\n }\n }", "public void setInto(Query query) {\n if (_candidate != null)\n query.setCandidateType(_candidate, true);\n if (!StringUtil.isEmpty(_query))\n query.setQuery(_query);\n if (_res != null)\n query.setResultType(_res);\n if (_readOnly != null)\n query.setReadOnly(_readOnly);\n if (_resultSetMappingName != null)\n query.setResultMapping(null, _resultSetMappingName);\n }", "public void setQuery (String q)\n\t throws QueryParseException\n {\n\n\tthis.q = new Query ();\n\tthis.q.parse (q);\n\n\tthis.badQuery = false;\n\tthis.exp = null;\n\n\tthis.checkFrom ();\n\n }", "public com.example.DNSLog.Builder setQuery(java.lang.CharSequence value) {\n validate(fields()[8], value);\n this.query = value;\n fieldSetFlags()[8] = true;\n return this;\n }", "public InfluxDBParameter setQuery(String query) {\n this.query = query;\n return this;\n }", "@Override\n\tpublic void queryData() {\n\t\t\n\t}", "public void queryListener(QueryEvent queryEvent) {\n //#{bindings.ImplicitViewCriteriaQuery.processQuery}\n // Add event code here...\n \n FacesContext fctx = FacesContext.getCurrentInstance();\n ELContext elctx = fctx.getELContext();\n ExpressionFactory exprFactory = fctx.getApplication().getExpressionFactory();\n MethodExpression me = exprFactory.createMethodExpression(elctx, \"#{bindings.ImplicitViewCriteriaQuery.processQuery}\",\n Object.class, new Class[]{QueryEvent.class});\n me.invoke(elctx, new Object[] {queryEvent});\n \n BindingContext bctx = BindingContext.getCurrent();\n BindingContainer bindings = bctx.getCurrentBindingsEntry();\n DCIteratorBinding allEmployeesIter = (DCIteratorBinding) bindings.get(\"allEmployeesIterator\");\n \n boolean skipEditForm = allEmployeesIter.getEstimatedRowCount() > 0 ? false : true;\n \n ADFContext adfCtx = ADFContext.getCurrent();\n \n adfCtx.getPageFlowScope().put(\"skipEditEmployees\", skipEditForm);\n\n AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();\n adfFacesContext.addPartialTarget(trainComponent);\n }", "@Override\n public void setQueryReport(String startDate, String endDate) {\n throw new UnsupportedOperationException(\"Not supported yet.\");\n }", "public void setQueryContext(QueryContext context) {\n \t\tthis.queryContext = context;\n \t\tif (getStructuredViewer() == null)\n \t\t\treturn;\n \n \t\tObject input = getStructuredViewer().getInput();\n \t\tif (input instanceof QueriedElement) {\n \t\t\t((QueriedElement) input).setQueryContext(context);\n \t\t\tgetStructuredViewer().refresh();\n \t\t}\n \t}", "public void setQuery(String query) {\n this.stringQuery = query;\n }", "public void setRetrievalQuery(final String query)\n {\n immutableSetRetrievalQuery(query);\n }", "public void setQueryString(String sQuery) {\n reposDataSourceFactory.setQuery(sQuery);\n }", "@Override\r\n\tpublic void queryResult(queryResultRequest request, StreamObserver<queryResultResponse> responseObserver) {\n\t\tsuper.queryResult(request, responseObserver);\r\n\t}", "void setQueryRequest(com.exacttarget.wsdl.partnerapi.QueryRequest queryRequest);", "@Override\n public void queryIdArrived(final QueryId queryId) {\n }", "public void setQuery(java.lang.CharSequence value) {\n this.query = value;\n }", "private void queryEvents() {\n ParseQuery<Event> query = ParseQuery.getQuery(Event.class);\n // include data referred by user key\n query.include(Event.KEY_HOST);\n // limit query to latest 20 items\n query.setLimit(30);\n // order posts by creation date (newest first)\n query.addDescendingOrder(\"createdAt\");\n // start an asynchronous call for events\n query.findInBackground(new FindCallback<Event>() {\n @Override\n public void done(List<Event> events, com.parse.ParseException e) {\n\n // check for errors\n if (e != null) {\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n\n // for debugging purposes let's print every event description to logcat\n for (Event event : events) {\n Log.i(TAG, \"Event: \" + event.getDescription() + \", username: \" + event.getHost().getUsername());\n }\n\n // save received events to list and notify adapter of new data\n allEvents.addAll(events);\n }\n\n });\n }", "public final void setQuery(final String newQuery) {\n this.query = newQuery;\n }", "public void setQueryCondition(QueryCondition queryCondition)\n {\n\tthis.queryCondition = queryCondition;\n }", "public StreamingQueries(TwitterStream twitterStream){\r\n\t\tthis.twitterStream = twitterStream;\r\n\t\tincrementShutdownTimer();\r\n\t}", "public void setTimeline(Timeline timeline) {\n this.timeline = timeline;\n }", "public HashMap<String/* concept path */, List<TimelineEvent> /* events */> runTimelineQuery(Query query){\n\t\tList<String> requiredFieldsForTimeline = query.getRequiredFields();\n\t\tList<String> fieldsForTimeline = new ArrayList(query.getRequiredFields());\n\t\tfieldsForTimeline.addAll(query.getRequiredFields());\n\n\t\t// todo: copy the query?\n\t\t// wipe out required fields to not limit the patients by it\n\t\tquery.setRequiredFields(new ArrayList<>());\n\n\t\t// list patients involved\n\t\tSet<Integer> patientIds = abstractProcessor.getPatientSubsetForQuery(query);\n\n\t\t// get start time for the timeline\n\t\tlong startTime = Long.MAX_VALUE;\n\t\tfor(String field : requiredFieldsForTimeline) {\n\t\t\tPhenoCube cube = abstractProcessor.getCube(field);\n\t\t\tList<KeyAndValue> values = cube.getValuesForKeys(patientIds);\n\t\t\tfor(KeyAndValue value : values) {\n\t\t\t\tif(value.getTimestamp()!=null && value.getTimestamp() > 0 && value.getTimestamp() < startTime) {\n\t\t\t\t\tstartTime = value.getTimestamp();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfinal long _startTime = startTime;\n\t\tLinkedHashMap<String/* concept path */, List<TimelineEvent> /* events */> timelineEvents = \n\t\t\t\tnew LinkedHashMap<>();\n\t\t// fetch results for selected fields\n\t\tfor(String concept : fieldsForTimeline) {\n\t\t\tPhenoCube cube = abstractProcessor.getCube(concept);\n\t\t\tList<KeyAndValue> values = cube.getValuesForKeys(patientIds);\n\t\t\ttimelineEvents.put(concept, \n\t\t\t\t\tvalues.parallelStream()\n\t\t\t\t\t.map( value->{\n\t\t\t\t\t\treturn new TimelineEvent(value, _startTime);\n\t\t\t\t\t})\n\t\t\t\t\t.filter(event -> {\n\t\t\t\t\t\treturn event.getTimestamp() > -1;\n\t\t\t\t\t})\n\t\t\t\t\t.sorted(TimelineEvent.timestampComparator)\n\t\t\t\t\t.collect(Collectors.toList()));\n\t\t}\n\n\t\tList<Entry<String, List<TimelineEvent>>> entries = new ArrayList<>(timelineEvents.entrySet());\n\n\t\tCollections.sort(entries, (a, b)->{\n\t\t\tif(a.getValue().isEmpty()) return 1;\n\t\t\tif(b.getValue().isEmpty()) return -1;\n\t\t\treturn TimelineEvent.timestampComparator.compare(a.getValue().get(0), b.getValue().get(0));\n\t\t});\n\n\t\ttimelineEvents.clear();\n\t\tentries.stream().forEach(\n\t\t\t\t(entry)->{\n\t\t\t\t\ttimelineEvents.put(entry.getKey(), entry.getValue());\n\t\t\t\t});\n\n\t\treturn timelineEvents;\n\t}", "public Builder setQuery(java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n query_ = value;\n\n return this;\n }", "protected final void immutableSetRetrievalQuery(final String query)\n {\n m__strRetrievalQuery = query;\n }", "public void setEvents(List<TimelineEvent> events) {\n this.events = events;\n }", "@Override\n public <E extends Event> Cursor<E> streamEvents(Class<E> type) {\n ensureRatingCache();\n return cache.streamEvents(type);\n }", "public abstract Query<T> setQuery(String oql);", "public void setPagination(Query query) {\r\n\t\tif (getCount() != null && getCount() > 0) {\r\n\t\t\tquery.setMaxResults(getCount());\r\n\t\t}\r\n\t\tif (getPage() != null && getCount() != null) {\r\n\t\t\tquery.setFirstResult(getCount() * (getPage() - 1));\r\n\t\t}\r\n\t}", "@Override\n public Iterator<SingleQuery> iterator() {\n return new QueryHistoryIterator();\n }", "@Override\n protected void initializeEventList()\n {\n }", "public void setQueryString(String queryString) {\n if (queryString != null) {\n super.setQueryString('?' + queryString);\n } else {\n super.setQueryString(queryString);\n }\n }", "public void setDsQuery(com.microsoft.schemas.sharepoint.dsp.DSQuery dsQuery) {\r\n this.dsQuery = dsQuery;\r\n }", "public void customQuery(String query) {\n sendQuery(query);\n }", "public Timeline getTimeline() { return this.timeline; }", "Event (Timeline timeline, String name, int[] startDate, int[] endDate, boolean visible, String notes) {\n super(name);\n this.timeline = timeline;\n this.startDate = startDate;\n this.endDate = endDate;\n this.visible = visible;\n this.notes = notes;\n }", "public void setQueryParameter(String queryParameter){\n this.queryParameter = queryParameter;\n }", "@Override\n\tpublic void queryPoints() {\n\n\t}", "@Override\r\n public void onShowQueryResult() {\n }", "public void setQueryFlow(String queryFlow) {\r\n\t\tthis.queryFlow = queryFlow;\r\n\t}", "public void setQuerySpec(org.hl7.rim.QuerySpec querySpec) {\n _querySpec = querySpec;\n }", "public void setQueryEntry (jkt.hrms.masters.business.PrjQueryEntry queryEntry) {\n\t\tthis.queryEntry = queryEntry;\n\t}", "public void setQueryString(java.lang.String mQueryString) {\n bugQuery.setQueryString(mQueryString);\n }", "@Override\n public boolean onQueryTextChange(String query) {\n presenter.getMovies(query);\n return false;\n }", "public void setEventTime(Date eventTime) {\n this.eventTime = eventTime;\n }", "public void setEventTime(Date eventTime) {\n this.eventTime = eventTime;\n }", "public void setString(String SearchQuery) {\n this.SearchQuery = SearchQuery;\n notifyDataSetChanged();\n }", "public void setQueryString(String queryString) {\r\n\t\tLOG.info(DOLLAR + INSIDE_METHOD + DOLLAR);\r\n\t\tthis.queryString = queryString;\r\n\t\tLOG.info(DOLLAR + OUTSIDE_METHOD + DOLLAR);\r\n\t}", "void setOrderedQueryParameter(Query query, T value);", "@Override\n\tpublic void run() {\n\t\tthis.queryEngine.getEPAdministrator().getConfiguration().addEventType(IntEvent.class);\n \n String epl = \"select myValue from IntEvent\";\n EPStatement statement = this.queryEngine.getEPAdministrator().createEPL(epl);\n \n \n \n statement.addListener( (newData, oldData) -> {\n \tint threadNumber = (int) newData[0].get(\"threadNumber\");\n \tint loopNumber = (int) newData[0].get(\"loopNumber\");\n int myValue = (int) newData[0].get(\"myValue\");\n System.out.println(\"got a new value\");\n this.threadTimes[threadNumber][loopNumber] = Clock.getRealtimeClock().getTime();\n// System.out.println(String.format(\"New Random value: %d, Received time: %d\", myValue, System.currentTimeMillis()));\n });\n System.out.println(\"Query started\");\n\t\t\n\t}", "public FoursquarePathBuilder setQuery(String query) {\n String querys = query;\n addParameter(\"query\", querys);\n return this;\n }", "@Override\n public void run() {\n Node serverValue = serverSyncTree.getServerValue(query.getSpec());\n if (serverValue != null) {\n source.setResult(\n InternalHelpers.createDataSnapshot(\n query.getRef(), IndexedNode.from(serverValue)));\n return;\n }\n serverSyncTree.setQueryActive(query.getSpec());\n final DataSnapshot persisted = serverSyncTree.persistenceServerCache(query);\n if (persisted.exists()) {\n // Prefer the locally persisted value if the server is not responsive.\n scheduleDelayed(() -> source.trySetResult(persisted), GET_TIMEOUT_MS);\n }\n connection\n .get(query.getPath().asList(), query.getSpec().getParams().getWireProtocolParams())\n .addOnCompleteListener(\n ((DefaultRunLoop) ctx.getRunLoop()).getExecutorService(),\n (@NonNull Task<Object> task) -> {\n if (source.getTask().isComplete()) {\n return;\n }\n if (!task.isSuccessful()) {\n if (persisted.exists()) {\n source.setResult(persisted);\n } else {\n source.setException(Objects.requireNonNull(task.getException()));\n }\n } else {\n /*\n * We need to replicate the behavior that occurs when running `once()`. In other words,\n * we need to create a new eventRegistration, register it with a view and then\n * overwrite the data at that location, and then remove the view.\n */\n Node serverNode = NodeUtilities.NodeFromJSON(task.getResult());\n QuerySpec spec = query.getSpec();\n // EventRegistrations require a listener to be attached, so a dummy\n // ValueEventListener was created.\n keepSynced(spec, /*keep=*/ true, /*skipDedup=*/ true);\n List<? extends Event> events;\n if (spec.loadsAllData()) {\n events = serverSyncTree.applyServerOverwrite(spec.getPath(), serverNode);\n } else {\n events =\n serverSyncTree.applyTaggedQueryOverwrite(\n spec.getPath(),\n serverNode,\n getServerSyncTree().tagForQuery(spec));\n }\n repo.postEvents(\n events); // to ensure that other listeners end up getting their cached\n // events.\n source.setResult(\n InternalHelpers.createDataSnapshot(\n query.getRef(),\n IndexedNode.from(serverNode, query.getSpec().getIndex())));\n keepSynced(spec, /*keep=*/ false, /*skipDedup=*/ true);\n }\n });\n }", "public void Query() {\n }", "@Override\n\tpublic void setEvent(Event event) {\n\t\tthis.currentEvent = event;\n\t}", "@Override\n\tpublic void setEvent(java.lang.String event) {\n\t\t_dlSyncEvent.setEvent(event);\n\t}", "@Override\n\tpublic Query objectQuery(String query) throws Exception {\n\t\treturn null;\n\t}", "public void sendQuery(Message query, Object id, ResolverListener listener, long endTime) {\n this.listener = listener;\n this.id = id;\n this.query = query;\n this.endTime = endTime;\n startTimer();\n startConnect();\n }", "public void setParameters(Query query) {\r\n\t\tfor (String name : parameters.keySet()) {\r\n\t\t\tthis.setParameter(name, parameters.get(name), query);\r\n\t\t}\r\n\t}", "TimelineEntity(){}", "public void setEvent(String event) {\n this.event = event;\n }", "public void setNewSearch(String query){\n isNewSearch = true;\n this.query = query;\n }", "public void setQueryable(Boolean queryable) {\n this.queryable = queryable;\n }", "public Timeline getTimeline(){\n return null;\n }", "public com.microsoft.schemas.sharepoint.soap.UpdateViewQuery getQuery() {\r\n return query;\r\n }", "private void setEventThread() {\n setEventThread(Thread.currentThread());\n }", "public void setQueryBuilder(QueryBuilder queryBuilder) {\n\n if (queryBuilder == null) {\n throw new IllegalArgumentException(\"queryBuilder should not be null!\");\n }\n\n this.builder = queryBuilder;\n\n }", "abstract public void onQueryRequestArrived(ClientQueryRequest request);", "public void sendQuery(Message query, Object id, ResponseQueue responseQueue, long endTime) {\n this.responseQueue = responseQueue;\n this.id = id;\n this.query = query;\n this.endTime = endTime;\n startTimer();\n startConnect();\n }", "public void setEventCreated() {\n Date now = new Date();\n this.eventCreated = now;\n }", "Timeline (String name) {\n super(name);\n visible = false;\n events = new LinkedList<>();\n }", "public Builder setQueryMessage(com.google.protobuf.ByteString value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000200;\n queryMessage_ = value;\n onChanged();\n return this;\n }", "public void setQueryTimeout(int queryTimeout) {\n\t\tthis.queryTimeout = queryTimeout;\n\t}", "public void setEvent(String event) {\r\n\t\tthis.event = event;\r\n\t}", "public EventTimeline() {\n this(0, 0, 91, 9);\n }", "public void setTimeline(CanaryTimeline timeline) {\n this.timeline = timeline;\n }", "public void setQueryString(String queryString) {\n this.queryString = queryString;\n }", "public void setPtQuery(com.microsoft.schemas.sharepoint.dsp.PTQuery ptQuery) {\r\n this.ptQuery = ptQuery;\r\n }", "public void setQueryString(String queryString){\n this.queryString = queryString;\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n if (isConnected) {\n currentStream = twitterStreamFactory.getInstance();\n currentStream.addListener(MainActivity.this);\n currentStream.filter(query);\n\n searchView.clearFocus();\n\n Toast.makeText(\n this,\n R.string.toast_on_query_stream_starting,\n Toast.LENGTH_LONG)\n .show();\n }\n else {\n Toast.makeText(\n this,\n R.string.toast_on_query_device_not_connected,\n Toast.LENGTH_SHORT)\n .show();\n }\n\n return true;\n }", "public AbstractJoSQLFilter (Query q)\n\t throws IllegalStateException,\n\t QueryParseException\n {\n\n\tthis.setQuery (q);\n\n }", "public void customUpdate(String query) {\n sendUpdate(query);\n }", "public void configure(Query query, boolean isEditable, TableType tableType, QueryResultsListener listener){\n\t\tthis.isEditable = isEditable;\n\t\tthis.tableType = tableType;\n\t\tthis.startingQuery = query;\n\t\tthis.queryListener = listener;\n\t\trunQuery();\n\t}", "protected void setTimeline(RMTimeline aTimeline)\n{\n // Stop listening to old timeline property changes\n if(getTimeline()!=null) getTimeline().removePropertyChangeListener(this);\n \n // Set anim\n put(\"Anim\", aTimeline);\n \n // Set owner to this shape and start listening for property changes\n if(aTimeline!=null) {\n aTimeline.setOwner(this);\n aTimeline.addPropertyChangeListener(this);\n }\n}", "void setEventStartDate(Date startEventDate);", "void setDateRange(Date start, Date end);" ]
[ "0.61948955", "0.58675677", "0.58484477", "0.5722281", "0.57086605", "0.56686157", "0.564198", "0.55938137", "0.55938137", "0.5585006", "0.5515529", "0.5494287", "0.5491283", "0.54717684", "0.54377276", "0.54315126", "0.5412096", "0.5397708", "0.53930515", "0.5358391", "0.53381336", "0.5324375", "0.52759314", "0.5273845", "0.5271519", "0.5271506", "0.52603966", "0.52567995", "0.52470064", "0.52095413", "0.5173521", "0.51511055", "0.5143059", "0.514176", "0.51291007", "0.5113117", "0.5109395", "0.509544", "0.5095296", "0.5084378", "0.50486434", "0.5045189", "0.5044234", "0.501942", "0.4996847", "0.49881503", "0.49850625", "0.49833456", "0.49770874", "0.49652812", "0.49623346", "0.49564785", "0.49560258", "0.4955555", "0.4946461", "0.49268863", "0.49013728", "0.4891438", "0.4879963", "0.4871031", "0.4871031", "0.4851504", "0.4837", "0.48252192", "0.48224682", "0.4816267", "0.4796599", "0.47942907", "0.4783254", "0.4772396", "0.4771883", "0.47692603", "0.47666955", "0.47565576", "0.47522834", "0.47517043", "0.47438684", "0.47438434", "0.4738555", "0.47310343", "0.47307327", "0.4730169", "0.4726648", "0.47241125", "0.47217962", "0.47130674", "0.47070757", "0.47063488", "0.47045395", "0.46994063", "0.4695721", "0.4691506", "0.46753314", "0.46595415", "0.46569902", "0.46538374", "0.46536964", "0.46489766", "0.46453637", "0.4636347" ]
0.5706476
5
load the first page of results
void load(Request req);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract PaginatedResult<T> first() throws AblyException;", "@Override\n\tpublic void onLoadMore() {\n\t\tpage++;\n\t\texecutorService.submit(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception 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});\n\t}", "int getFirstItemOnPage();", "private void waitForFirstPageToBeLoaded() {\n IdlingResource idlingResource = new ElapsedTimeIdlingResource(LATENCY_IN_MS + 1000);\n IdlingRegistry.getInstance().register(idlingResource);\n\n //Check that first item has been loaded\n onView(withItemText(\"POPULAR MOVIE #1 (1999)\")).check(matches(isDisplayed()));\n\n //Clean up\n IdlingRegistry.getInstance().unregister(idlingResource);\n }", "private void loadContent()\n {\n // locking the function to prevent the adapter\n // from calling multiples async requests with\n // the same definitions which produces duplicate\n // data.\n locker.lock();\n\n // this function contruct a GraphRequest to the next paging-cursor from previous GraphResponse.\n GraphRequest nextGraphRequest = lastGraphResponse.getRequestForPagedResults(GraphResponse.PagingDirection.NEXT);\n\n // if we reached the end of our pages, the above method 'getRequestForPagedResults'\n // return 'null' object\n if(nextGraphRequest != null)\n {\n // for clarificating and formatting purposes\n // I declared the callback besides the members\n // variables.\n nextGraphRequest.setCallback(callback);\n nextGraphRequest.executeAsync();\n }\n }", "protected void loadNextPage(){\n\n if(!isShowingSearchedVotes) {\n setLoadingMoreItems(true);\n RikdagskollenApp.getInstance().getRiksdagenAPIManager().getVotes(new VoteCallback() {\n\n @Override\n public void onVotesFetched(List<Vote> votes) {\n setShowLoadingView(false);\n voteList.addAll(votes);\n getAdapter().notifyDataSetChanged();\n setLoadingMoreItems(false);\n }\n\n @Override\n public void onFail(VolleyError error) {\n setLoadingMoreItems(false);\n decrementPage();\n }\n }, getPageToLoad());\n\n incrementPage();\n }\n }", "@Override\n\tpublic void loadNextPage() {\n\t\tif(curr_content.isLastPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是最后一页:\", 3000);\n\t\t}else{\n\t\t\texchangeNext(m_bookFactory.getNextPageContent(next_content));\n\t\t}\n\t}", "void setFirstResult(int offset);", "@Override\n\tpublic void loadPrePage() {\n\t\t\n\t\tif(curr_content.isFirstPage){\n\t\t\tPigAndroidUtil.showToast(mContext, \"以是第一页:\", 3000);\n\t\t}else{\n\t\t\texchangePre(m_bookFactory.getPrePageContent(pre_content));\n\t\t}\n\t}", "public void setFirstResult(int begin) {\n\r\n\t}", "public void nextPage() {\n\t\tthis.skipEntries += NUM_PER_PAGE;\n\t\tloadEntries();\n\t}", "public int getFirstPage() {\n\t\treturn firstPage;\n\t}", "public Pageable first() {\n\t\t\t\treturn null;\r\n\t\t\t}", "private void fetchNextBlock() {\n try {\n \tSearchClient _client = new SearchClient(\"cubansea-instance\");\n \tWebSearchResults _results = _client.webSearch(createNextRequest());\n \t\tfor(WebSearchResult _result: _results.listResults()) {\n \t\t\tresults.add(new YahooSearchResult(_result, cacheStatus+1));\n \t\t\tcacheStatus++;\n \t\t}\n \t\tif(resultCount == -1) resultCount = _results.getTotalResultsAvailable().intValue();\n } catch (IOException e) {\n\t\t\tthrow new TechnicalError(e);\n\t\t} catch (SearchException e) {\n\t\t\tthrow new TechnicalError(e);\n\t\t}\n\t}", "@Override\n\t\tpublic void onLoadMore() {\n\t\t\tpageIndex++;\n\t\t\tloadInfo(pageIndex, 1);\n\t\t\tif (DzqcStu.isDebug) {\n\t\t\t\tLog.i(\"pageIndex------\", pageIndex+\"\");\n\t\t\t}\n\t\t}", "public void setFirstPage(int firstPage) {\n\t\tthis.firstPage = firstPage;\n\t}", "public void searchNextPage() {\n if (!isPerformingQuery\n && isViewingRecipes\n && !isQueryExhausted().getValue()) {\n recipeRepository.searchNextPage();\n }\n }", "private static int getFirstResultRelativeToPageNumber(int pageNumber, int pageSize) {\n\t\treturn (pageNumber - 1) * pageSize;\n\t}", "private void firstRunning() {\n for (int page = 1; page < 50; page++) {\n vacancies.addAll(parser.parseHtml(URL + page, null));\n }\n LOG.info(vacancies.size());\n try (VacancyDao vacancyDao = new VacancyDao(properties)) {\n vacancyDao.insertSet(vacancies);\n vacancyDao.insertLastUpdateDate(new Date().getTime());\n } catch (Exception e) {\n LOG.error(e.getMessage(), e);\n }\n }", "public boolean isFirstPage();", "public void run() {\n getPage(page + 1, false);\n }", "private void loadNextPageOfTopRatedMovies() {\n\t\ttry {\n\t\t\tMovieApiClient movieApiClient = MovieDbApi.getRetrofitClient().create(MovieApiClient.class);\n\t\t\tCall<TopRatedMovies> call = movieApiClient.getTopRatedMovies(getString(R.string.api_key), \"en_US\", currentPage);\n\t\t\tcall.enqueue(new Callback<TopRatedMovies>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onResponse(Call<TopRatedMovies> call, Response<TopRatedMovies> response) {\n\t\t\t\t\tif (response.isSuccessful()) {\n\t\t\t\t\t\tadapter.removeLoadingFooter();\n\t\t\t\t\t\tisLoading = false;\n\t\t\t\t\t\tprogress.setVisibility(View.GONE);\n\t\t\t\t\t\tTopRatedMovies topRatedMovies = response.body();\n\t\t\t\t\t\tList<TopRatedMovieResults> topRatedMovieResults = topRatedMovies.getResults();\n\t\t\t\t\t\tadapter.addAll(topRatedMovieResults);\n\n\t\t\t\t\t\tif (currentPage != TotalPages)\n\t\t\t\t\t\t\tadapter.addLoadingFooter();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tisLastPage = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Call<TopRatedMovies> call, Throwable t) {\n\t\t\t\t\tif (t instanceof SocketTimeoutException || t instanceof IOException) {\n\t\t\t\t\t\tprogress.setVisibility(View.GONE);\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), getString(R.string.no_netowrk), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tLog.e(\"ERROR\", getString(R.string.no_netowrk), t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprogress.setVisibility(View.GONE);\n\t\t\t\t\t\tLog.e(\"ERROR\", getString(R.string.error), t);\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tprogress.setVisibility(View.GONE);\n\t\t\tToast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();\n\t\t}\n\t}", "int getPage();", "private void firstNetworkCall() {\n startIndex = 0;\n getBlockListNetworkCall(getActivity(), startIndex, maxItems);\n }", "Integer getPage();", "@Override\n public boolean onLoadMore(int page, int totalItemsCount, int firstVisibleItem) {\n if (loading) {\n getListDataByPaging(String.valueOf(page), firstVisibleItem);\n }\n // or loadNextDataFromApi(totalItemsCount);\n return true; // ONLY if more data is actually being loaded; false otherwise.\n }", "public abstract Page<T> firstPage(final TwilioRestClient client);", "void loadAll(int pageNum, LoadView mLoadView);", "private void getFirsTopRatedMovies() {\n\t\ttry {\n\t\t\tMovieApiClient movieApiClient = MovieDbApi.getRetrofitClient().create(MovieApiClient.class);\n\t\t\tCall<TopRatedMovies> call = movieApiClient.getTopRatedMovies(getString(R.string.api_key), \"en_US\", currentPage);\n\t\t\tcall.enqueue(new Callback<TopRatedMovies>() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onResponse(Call<TopRatedMovies> call, Response<TopRatedMovies> response) {\n\t\t\t\t\tif (response.isSuccessful()) {\n\t\t\t\t\t\tTopRatedMovies topRatedMovies = response.body();\n\t\t\t\t\t\tList<TopRatedMovieResults> topRatedMovieResults = topRatedMovies.getResults();\n\t\t\t\t\t\tprogress.setVisibility(View.GONE);\n\t\t\t\t\t\tadapter.addAll(topRatedMovieResults);\n\n\t\t\t\t\t\tif (currentPage <= TotalPages)\n\t\t\t\t\t\t\tadapter.addLoadingFooter();\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tisLastPage = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tprogress.setVisibility(View.GONE);\n\t\t\t\t\t\tlayout_nothing_to_show.setVisibility(View.VISIBLE);\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onFailure(Call<TopRatedMovies> call, Throwable t) {\n\t\t\t\t\tif (t instanceof SocketTimeoutException || t instanceof IOException) {\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), getString(R.string.no_netowrk), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tLog.e(\"ERROR\", getString(R.string.no_netowrk), t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tLog.e(\"ERROR\", getString(R.string.error), t);\n\t\t\t\t\t\tToast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public Page<T> firstPage() {\n return firstPage(Twilio.getRestClient());\n }", "public void setFirstResult(java.lang.Integer firstResult)\r\n {\r\n this.firstResult = firstResult;\r\n }", "private void luceneFirstGetNextChunk(SortBy sort) throws ServiceException {\n do {\n // DON'T set an sql LIMIT if we're asking for lucene hits!!! If we did, then we wouldn't be\n // sure that we'd \"consumed\" all the Lucene-ID's, and therefore we could miss hits!\n\n // limit in clause based on Db capabilities - bug 15511\n luceneChunk = luceneOp.getNextResultsChunk(Math.min(Db.getINClauseBatchSize(), hitsPerChunk));\n\n DbSearchConstraints.Leaf sc = getTopLeafConstraint();\n sc.indexIds.clear();\n sc.indexIds.addAll(luceneChunk.getIndexIds());\n\n // exponentially expand the chunk size in case we have to go back to the DB\n hitsPerChunk *= 2;\n if (hitsPerChunk > MAX_HITS_PER_CHUNK) {\n hitsPerChunk = MAX_HITS_PER_CHUNK;\n }\n\n if (sc.indexIds.size() == 0) {\n // we know we got all the index-id's from lucene. since we don't have a\n // LIMIT clause, we can be assured that this query will get all the remaining results.\n endOfHits = true;\n } else {\n // must not ask for offset,limit here b/c of indexId constraints!,\n dbSearch(dbHits, sort, -1, -1);\n }\n } while (dbHits.size() == 0 && !endOfHits);\n }", "@Override\n\t\t\tprotected PaginationResponseData load() {\n\t\t\t\treturn null;\n\n\t\t\t}", "public int getPageStart() {\n return _totalRecords == 0 ? 0 : ((_pageIndex) * _pageSize) + 1;\n }", "@Override\n\tpublic void onLoadMore() {\n\t\tLog.d(\"load\", \"\");\n\t\tcurrentPage++;\n\t\tmodel.getPostsByType(userId, currentPage, method, postListiner);\n\t}", "@Override\n\tpublic void onLoadMore() {\n\t\tif (onRefresh_number) {\n\t\t\tpage = page + 1;\n\n\t\t\tonRefresh_number = false;\n\t\t\tgetData();\n\n\t\t\t// if (Tools.isConnect(getApplicationContext())) {\n\t\t\t// onRefresh_number = false;\n\t\t\t// getData();\n\t\t\t// } else {\n\t\t\t// onRefresh_number = true;\n\t\t\t// handler.sendEmptyMessage(2);\n\t\t\t// }\n\t\t} else {\n\t\t\thandler.sendEmptyMessage(3);\n\t\t}\n\t}", "public void getNextPage(String url) {\n String kw = \"flag\";\n client = new OkHttpClient();\n final Request request = new Request.Builder()\n .url(url)\n .build();\n Call call = client.newCall(request);\n call.enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n System.out.println(e);\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n String htmlStr = response.body().string();\n //Type listTpye = new TypeToken<LinkedList<QueryRes>>(){}.getType();\n //System.out.println(htmlStr.toString());\n\n try {\n json = new JSONObject(htmlStr);\n //parsePageJson(json);\n System.out.println(json);\n } catch (Exception e) {\n System.out.println(\"error again\");\n }\n //parseJson(json);\n Message msg = handler.obtainMessage();\n msg.what = 1;\n handler.sendMessage(msg);\n //parsePageJson(page_json);\n }\n });\n }", "@Override\n protected void onNextPageRequested(int page) {\n\n }", "@Override\n public void PageFistLoad() {\n }", "public PaginatedResult<T> start(ResultPage resultPage) {\n return start(resultPage, null);\n }", "private void loadMoreItems() {\n isLoading = true;\n\n currentPage += 1;\n\n Call findMyFeedVideosCall = vimeoService.findMyFeedVideos(currentPage, PAGE_SIZE);\n calls.add(findMyFeedVideosCall);\n findMyFeedVideosCall.enqueue(findMyFeedVideosNextFetchCallback);\n }", "@Override\n\tpublic List<Visit> load(int first, int pageSize, String sortField, SortOrder sortOrder, \n\t\t\tMap<String, Object> filters) {\n\n\t\t\n\t\treturn result;\n\t}", "private static void fetchNextPage(Context context) {\n\n /* Get pages info */\n int currentPage = PageUtils.getCurrentPage(context);\n int totalPages = PageUtils.getTotalPages(context);\n\n /* Get uri of data for current show mode */\n Uri uri;\n int showMode = MoviesPreferences.getMoviesShowMode(context);\n if (showMode == MoviesPreferences.SHOW_MODE_MOST_POPULAR) {\n uri = MoviesContract.MovieEntry.CONTENT_URI_MOST_POPULAR;\n } else {\n uri = MoviesContract.MovieEntry.CONTENT_URI_TOP_RATED;\n }\n\n /* If last update time expired, set current page to 0 and clean cache table */\n boolean isDataActual = DateUtils.isMoviesListLastUpdateActual(context);\n if (!isDataActual) {\n context.getContentResolver().delete(uri, null, null);\n currentPage = 0;\n PageUtils.setCurrentPage(context, currentPage);\n }\n\n /* If all pages already loaded, we don't need to do anything */\n if (currentPage == totalPages) {\n return;\n }\n\n URL moviesListUrl = NetworkUtils.getMoviesListUrl(context, currentPage + 1);\n ContentValues[] movieContentValues = null;\n int requestedTotalPages = 1;\n\n try {\n String response = NetworkUtils.getResponseFromHttpUrl(moviesListUrl);\n movieContentValues = TmdbJsonUtils.getMovieContentValuesFromJson(response);\n requestedTotalPages = TmdbJsonUtils.getTotalPagesFromJson(response);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n if (movieContentValues == null) {\n return;\n }\n\n int insertedRows = context.getContentResolver()\n .bulkInsert(uri, movieContentValues);\n\n if (insertedRows > 0) {\n currentPage++;\n PageUtils.setCurrentPage(context, currentPage);\n\n if (currentPage == 1) {\n PageUtils.setTotalPages(context, requestedTotalPages);\n long currentTime = System.currentTimeMillis();\n DateUtils.setMoviesListLastUpdateTime(context, currentTime);\n }\n }\n\n }", "public abstract void onLoadMore(int skipStart);", "@Override\n public void run() {\n loadingMore=true;\n //load data from url\n ArrayList<Recipe> recipe = Utils.fetchListOfRecipeData(stringUrl+current_page);\n ++current_page;\n recipesList.addAll(recipe);\n }", "short getPageStart();", "@Override\n\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\tpresenter.loadRecordsPage(page);\n\t\t}", "public void loadMore(int first) {\n if (!stopLoading)\n Place.loadMultiple(getActivity(), first, LIST_INITIAL_LOAD_MORE_ONSCROLL, filterParams, false, new Place.onMultipleDownloadedListener() {\n @Override\n public void onDownloaded(List<Place> places) {\n if (places.size() == 0)\n stopLoading = true;\n //((MapPlaceAdapter) mAdapter).addItems(places);\n addPlaces(places);\n mRecyclerView.swapAdapter(mAdapter, false);\n }\n });\n }", "@Override\n protected void loadNextDataFromApi(int page) {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n query.include(Post.KEY_USER);\n query.whereEqualTo(Post.KEY_USER, ParseUser.getCurrentUser());\n query.setLimit(POST_LIMIT);\n query.setSkip(POST_LIMIT*page);\n query.addDescendingOrder(Post.KEY_CREATED_AT);\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e) {\n if (e != null){\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n for (Post post: posts){\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username: \" + post.getUser().getUsername());\n }\n allPosts.addAll(posts);\n adapter.notifyDataSetChanged();\n }\n });\n\n\n }", "public abstract void onLoadMore(int page, int totalItemsCount);", "public abstract void onLoadMore(int page, int totalItemsCount);", "private void fetch(int i){\n // if Search completes succesfully\n if(searchOK(i)){// proceed to fetch\n int docs = Integer.parseInt(counts.get(i));\n int start = 0;\n // while end of results not reached\n // i.e. stops when the last document of the last batch (start + step) is grater than the total count of docs\n while(start < docs){\n //get next part of results\n fetchPart(i,start,step);\n start += step;\n }\n } else { // print a message for wrong search of specific query\n // Log printing\n if(debugMode) {\n System.out.println(\" \" + new Date().toString() + \" \" + db + \" Fetch > No succesful search for query : \" + this.queries.get(i));\n }\n }\n }", "@RequestMapping(\"/atmService\")\n\t\tpublic String firstPage(Map<String, Object> model) throws IOException{\n\t\t\treturn \"ATMApp_FirstPage\";\n\t}", "@Override\r\n public void loadInitial(@NonNull LoadInitialParams params, @NonNull final LoadInitialCallback callback) {\r\n APIClient.getAPIClient().getAPI().getUsersList().enqueue(new Callback<List<User>>() {\r\n @Override\r\n public void onResponse(Call<List<User>> call, Response<List<User>> response) {\r\n if(response.body() != null) {\r\n //There's Only one page with this result\r\n callback.onResult(response.body(), null, null);\r\n }\r\n }\r\n\r\n @Override\r\n public void onFailure(Call<List<User>> call, Throwable t) {\r\n\r\n }\r\n });\r\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onSinglePageLoad(@Nullable LocalResult localResult, int pageNumber) {\n if (localResult == null) return;\n\n //update page number\n this.pageNumber = pageNumber;\n //update nextUrl\n nextUrl = localResult.getNextUrl();\n //check if there's more data to fetch\n hasMoreData = isThereMoreData();\n\n //update the respective fragments with one new page of data\n if (fragments[LIST] != null) {\n ((SuggestionsListFragment) fragments[LIST]).onSinglePageLoad(localResult, selectedIdsMap, hasMoreData, pageNumber);\n }\n\n if (fragments[MAP] != null) {\n ((SuggestionsClusterMapFragment) fragments[MAP]).onSinglePageLoad(localResult, selectedIdsMap, hasMoreData, pageNumber);\n }\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextData(page);\n }", "protected int getInitialPage(HttpServletRequest request) {\n return 0;\n }", "@Override\r\n\tpublic String paging(String sql) {\n\t\treturn null;\r\n\t}", "@Override\n public void onLoadMore() {\n MyApplacation.getmHandler().postDelayed(new Runnable() {\n @Override\n public void run() {\n pageNo++;\n getDataForService();\n }\n }, 1000);\n\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextFeedPage(page);\n }", "SearchResult findNext(SearchResult result);", "public int getPageStart(){\r\n\t\treturn (this.page -1) * perPageNum;\r\n\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n Log.d(\"DEBUG\", \"network continue load before count:\" + tweets.size());\n loadNextDataFromApi(page, view);\n }", "@Override\r\n\tpublic List loadMasterDataSet(int pageSize, int startRow) {\n\t\treturn null;\r\n\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadMoreRecyclerViewData(hal[0]);\n hal[0]++;\n }", "public StrColumn getPageFirst() {\n return delegate.getColumn(\"page_first\", DelegatingStrColumn::new);\n }", "public void loadLastReadPage(){\n \t\t\tlastReadLoaded = false;//recalculate and jump to the last read page\n \t\t\tpageHasChanged = false;//navigating between pages causes the view to jump to top of page, this'll reset that\n \t\t\tloadPage(false, null);\n \t\t}", "public int getResultsPage()\r\n\t{\r\n\t\treturn this.resultsPage;\r\n\t}", "public void setResultsPage(int resultsPage)\r\n\t{\r\n\t\tthis.resultsPage = resultsPage;\r\n\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n if(next_url != null) {\n curent_page = page;\n loadMore(page);\n }\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n if(next_url != null) {\n curent_page = page;\n loadMore(page);\n }\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "void loadNext();", "int getPageNumber();", "@Override\n public Document getNextPage(Document doc) throws IOException {\n if (isStopped()) {\n throw new IOException(\"Ripping interrupted\");\n }\n // Find next page\n Elements hrefs = doc.select(\".ptt a\");\n if (hrefs.isEmpty()) {\n LOGGER.info(\"doc: \" + doc.html());\n throw new IOException(\"No navigation links found\");\n }\n // Ensure next page is different from the current page\n String nextURL = hrefs.last().attr(\"href\");\n if (nextURL.equals(this.lastURL)) {\n LOGGER.info(\"lastURL = nextURL : \" + nextURL);\n throw new IOException(\"Reached last page of results\");\n }\n // Sleep before loading next page\n sleep(PAGE_SLEEP_TIME);\n // Load next page\n Document nextPage = getPageWithRetries(new URL(nextURL));\n this.lastURL = nextURL;\n return nextPage;\n }", "public int getStartIndex() {\n int cacheRange = 100 / numResultsPerPage;\n int base = pageNumber % cacheRange;\n if (base == 0) {\n return 100 - numResultsPerPage;\n } else {\n return (base - 1) * numResultsPerPage;\n }\n }", "public void loadNextDataFromApi(int offset) {\n // Send an API request to retrieve appropriate paginated data\n // --> Send the request including an offset value (i.e `page`) as a query parameter.\n // --> Deserialize and construct new model objects from the API response\n // --> Append the new data objects to the existing set of items inside the array of items\n // --> Notify the adapter of the new items made with `notifyItemRangeInserted()`\n PostFetch postFetch = new PostFetch(getContext(), new AppUtils.MyInterface() {\n @Override\n public void myMethod(String response) {\n if(response.equals(\"0\")){\n Toast.makeText(getContext(), \"No internet connection\", Toast.LENGTH_SHORT).show();\n }\n else if(response.equals(\"1\")){\n Toast.makeText(getContext(), \"Unable to connect to server\", Toast.LENGTH_SHORT).show();\n }\n else {\n AppUtils.addPostsToAdapter(getContext(), response, mAdapter);\n }\n }\n });\n postFetch.execute(url, Integer.valueOf(offset*10).toString(), AppUtils.PAGE_SIZE);\n }", "public void getWantedPageFromPagination()throws Exception{\r\n SearchPageFactory pageFactory = new SearchPageFactory(driver);\r\n List<WebElement> pageOrderList = pageFactory.searchPagePaginationList;\r\n WebElement wantedPageOrder = pageOrderList.get(1);\r\n clickElement(wantedPageOrder, Constant.explicitTime);\r\n }", "public void loadNextDataFromApi(int offset, View view) {\n // Send an API request to retrieve appropriate paginated data\n // --> Send the request including an offset value (i.e `page`) as a query parameter.\n // --> Deserialize and construct new model objects from the API response\n // --> Append the new data objects to the existing set of items inside the array of items\n // --> Notify the adapter of the new items made with `notifyItemRangeInserted()`\n final int curSize = tweets.size();// adapter.getItemCount();\n\n // Create the Handler object (on the main thread by default)\n Handler handler = new Handler();\n // Define the code block to be executed\n Runnable runnableCode = () -> {\n // reset only with first load.\n //scrollListener.resetState();\n Log.d(\"DEBUG\", \"before new load tweets size:\" + curSize);\n if(hasLocal) {\n adapter.clear();\n hasLocal =false;\n populateTimeline(1L,Long.MAX_VALUE - 1);\n }else {\n populateTimeline(1L, tweets.get(curSize - 1).getId());\n }\n };\n // Run the above code block on the main thread after 500 miliseconds\n handler.postDelayed(runnableCode, 500);\n }", "public void startPage() {\n\t\tthis.dataComposer.startPage();\n\t}", "@Override\n\tpublic synchronized void onLoadMore() {\n\t\ttry {\n\t\t\t// 如果总页数大于当前页码数,加载更多\n\t\t\tif (pageSize > curPage) {\n\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\") + 1);\n\t\t\t\tcurPage++;\n\t\t\t\tURL = URL + curPage + \".xml\";\n\t\t\t\tnew AsyncLoadNews(lsnb, URL).execute();\n\t\t\t} else {\n\t\t\t\tlistView.setPullLoadEnable(false);\n\t\t\t\tonLoadStop();\n\t\t\t\tToast toast = Toast.makeText(getActivity(), \"数据已经加载完毕!\",\n\t\t\t\t\t\tToast.LENGTH_LONG);\n\t\t\t\t// toast.getView().setBackgroundResource(R.drawable.red_toast_bg);\n\t\t\t\ttoast.getView().setPadding(20, 10, 20, 10);\n\t\t\t\ttoast.show();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n public Ares2ClusterDO selectOneByQuery(Ares2ClusterQuery query) {\n query.setPageNo(1);\n query.setPageSize(1);\n List<Ares2ClusterDO> topList = selectByQuery(query);\n if (topList != null && topList.size() > 0) {\n return topList.get(0);\n }\n return null;\n }", "public void paginationLoading() {\n mTvShows.add(null);\n notifyItemInserted(mTvShows.size() - 1);\n }", "private void find(boolean forward) {\n \tif (this.currentFindResultPage != null) {\n \t\t/* searching again */\n \t\tint nextResultNum = forward ? this.currentFindResultNumber + 1 : this.currentFindResultNumber - 1;\n \t\tif (nextResultNum >= 0 && nextResultNum < this.pagesView.getFindResults().size()) {\n \t\t\t/* no need to really find - just focus on given result and exit */\n \t\t\tthis.currentFindResultNumber = nextResultNum;\n \t\t\tthis.pagesView.scrollToFindResult(nextResultNum);\n \t\t\tthis.pagesView.invalidate();\n \t\t\treturn;\n \t\t}\n \t}\n\n \t/* finder handles next/prev and initial search by itself */\n \tFinder finder = new Finder(this, forward);\n \tThread finderThread = new Thread(finder);\n \tfinderThread.start();\n }", "public ActionForward init(ActionMapping mapping, ActionForm form,\n\t\t\tHttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows Exception {\n\t\tthis.rows=100;\n\t\tsavedInRequest(request);\n\t\treturn firstPage(mapping, form, request, response);\n\t}", "@Override\r\n\tprotected void doFirst() {\n\t\t\r\n\t}", "public void customLoadMoreDataFromApi(int offset) {\n // This method probably sends out a network request and appends new data items to your adapter. \n // Use the offset value and add it as a parameter to your API request to retrieve paginated data.\n // Deserialize API response and then construct new objects to append to the adapter\n \tAsyncHttpClient client = new AsyncHttpClient();\n\t\t//https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=%s&start=%d&imgsz=medium\n\t\t//client.get(\"https://ajax.googleapis.com/ajax/services/search/images?\"+\"start=\"+0+\"&v=1.0&q=\"+Uri.encode(query),\n\t\tclient.get(getQueryString(offset*8) + Uri.encode(query),\n\t\t\t\tnew JsonHttpResponseHandler(){\n\t\t\t@Override\n\t\t\tpublic void onSuccess(JSONObject response){\n\t\t\t\tJSONArray imageJsonResults = null;\n\t\t\t\ttry{\n\t\t\t\t\timageJsonResults = response.getJSONObject(\"responseData\").getJSONArray(\"results\");\n\t\t\t\t\timageAdapter.addAll(ImageResult.fromJSONArray(imageJsonResults));\t\n\t\t\t\t}catch(JSONException 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\n \t\n }", "@Override\n\t\tpublic synchronized void onLoadMore() {\n\t\t\ttry {\n\t\t\t\t//如果总页数大于当前页码数,加载更多\n\t\t\t\tif(pageSize > curPage){\n\t\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\")+1);\n\t\t\t\t\tcurPage++;\n\t\t\t\t\tURL = URL+curPage+\".xml\";\n\t\t\t\t\tnew AsyncLoadNews(flag,lsnb,URL).execute();\n\t\t\t\t}else{\n\t\t\t\t\tlistView.setPullLoadEnable(false);\n\t\t\t\t\tonLoadStop();\n\t\t\t\t\tToast toast = Toast.makeText(getActivity(), \"数据已经加载完毕!\", Toast.LENGTH_LONG);\n//\t\t\t\t\ttoast.getView().setBackgroundResource(R.drawable.red_toast_bg);\n\t\t\t\t\ttoast.getView().setPadding(20, 10, 20, 10);\n\t\t\t\t\ttoast.show();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\n\t\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\t\tpopulateTimeline();\n\t\t\t}", "boolean getPageNoNull();", "private void loadData() {\n\n if (mIsLoading) {\n return;\n }\n\n String url = mSiteData.getUrl();\n\n if (!mIsRefreshMode) {\n //if (mMaxPage > 0 && mCurrentPage > mMaxPage) {\n // return;\n //}\n //Log.e(mTag, \"mMaxPage: \" + mMaxPage);\n\n if (mCurrentPage > 1) {\n switch (mSiteData.getId()) {\n case Config.BLOG_ID_AKB48_TEAM8:\n url = url + \"?p=\" + mCurrentPage;\n break;\n case Config.BLOG_ID_NGT48_MANAGER:\n url = url + \"lite/?p=\" + mCurrentPage;\n break;\n case Config.BLOG_ID_SKE48_SELECTED:\n case Config.BLOG_ID_NMB48_OFFICIAL:\n url = url + \"page-\" + mCurrentPage + \".html\";\n break;\n }\n //showToolbarProgressBar();\n }\n }\n\n String userAgent = Config.USER_AGENT_WEB;\n switch (mSiteData.getId()) {\n case Config.BLOG_ID_SKE48_SELECTED:\n case Config.BLOG_ID_NMB48_OFFICIAL:\n case Config.BLOG_ID_NGT48_MANAGER:\n case Config.BLOG_ID_NGT48_PHOTOLOG:\n userAgent = Config.USER_AGENT_MOBILE;\n break;\n }\n\n mIsLoading = true;\n\n if (!mIsFirst && !mIsRefreshMode) {\n mLoLoadingMore.setVisibility(View.VISIBLE);\n }\n\n //Log.e(mTag, url);\n requestData(url, userAgent);\n }", "public void previousPage() {\n\t\tthis.skipEntries -= NUM_PER_PAGE;\n\t\tif (this.skipEntries < 1) {\n\t\t\tskipEntries = 1;\n\t\t}\n\t\tloadEntries();\n\t}", "@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\tpublic String result(ModelMap model) {\n\t\tmodel.put(\"page\", 0);\n\n\t\treturn \"index\";\n\t}", "@Override\r\n\tpublic int getPaging() {\n\t\treturn 0;\r\n\t}", "void nextPage() throws IndexOutOfBoundsException;", "Page getPage(int index);", "@ImageOptions(flipRtl = true)\r\n\t\tImageResource simplePagerFirstPage();", "private static StringBuilder searchNextPage(String nextToken){\r\n\t\tHttpURLConnection conn = null;\r\n\t\tStringBuilder jsonResults = new StringBuilder();\r\n\t\ttry{\r\n\t\t\tStringBuilder request = new StringBuilder(PLACES_API_SOURCE);\r\n\t\t\trequest.append(typeSearch);\r\n\t\t\trequest.append(JSON_OUT);\r\n\t\t\trequest.append(\"?pagetoken=\");\r\n\t\t\trequest.append(nextToken);\r\n\t\t\trequest.append(\"&key=\");\r\n\t\t\trequest.append(KEY);\r\n\r\n\t\t\tURL url = new URL(request.toString());\r\n\t\t\tconn = (HttpURLConnection) url.openConnection();\r\n\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), \"UTF-8\"));\r\n\t\t\tString line = \"\";\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tjsonResults.append(line);\r\n\t\t\t}\r\n\t\t}catch(MalformedURLException e){\r\n\t\t\tSystem.out.println(\"URL ERROR [search] \");\r\n\t\t}catch(IOException e){\r\n\t\t\tSystem.out.println(\"CONNECTION ERROR [search] \"+ e);\r\n\t\t}finally{\r\n\t\t\tif(conn!=null)\r\n\t\t\t\tconn.disconnect();\r\n\t\t}\r\n\t\treturn jsonResults;\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception 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}" ]
[ "0.6906001", "0.67819065", "0.67812943", "0.65648437", "0.65571666", "0.6486111", "0.6442348", "0.63608086", "0.6318835", "0.6259402", "0.62323505", "0.62313", "0.6221363", "0.6163371", "0.61616164", "0.6124779", "0.6082857", "0.6064367", "0.606058", "0.60414654", "0.6036196", "0.60169387", "0.59311396", "0.5928225", "0.5922153", "0.59064424", "0.58843964", "0.5882184", "0.58463323", "0.58300227", "0.582667", "0.5818618", "0.580453", "0.57632416", "0.57602257", "0.5736896", "0.57317334", "0.57118744", "0.56831276", "0.5679231", "0.56747735", "0.5660708", "0.56564647", "0.56506777", "0.5650674", "0.5643525", "0.5628959", "0.56232965", "0.5616531", "0.5615713", "0.5615713", "0.56149817", "0.5613266", "0.55980915", "0.5591833", "0.5591833", "0.5591833", "0.5586821", "0.557441", "0.55671424", "0.55583096", "0.5557531", "0.5554994", "0.55452293", "0.5537706", "0.5535734", "0.5526412", "0.55096334", "0.5499867", "0.54810405", "0.5470064", "0.54678845", "0.54675704", "0.54675704", "0.54613894", "0.545784", "0.5451057", "0.54508644", "0.5450701", "0.5448206", "0.54463494", "0.54440176", "0.54367095", "0.5428807", "0.54222596", "0.5416776", "0.54093224", "0.54056925", "0.5400966", "0.53946793", "0.53718066", "0.5367233", "0.5365677", "0.53601265", "0.535964", "0.5352084", "0.5347485", "0.5343475", "0.5339063", "0.53368837", "0.5335681" ]
0.0
-1
a single callback can be attached, if needed
void setCallback(IResponseCallback<WalletDataDecl.ListResultTmpl<Response>> cb);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void callback() {\n }", "@Override\n\tpublic void onCallback() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void callbackCall() {\n\t\t\t}", "public void callback();", "@Override\n\tpublic void callback() {\n\t}", "@Override\n\t\t\t\t\t\t\t\t\tpublic void callback(int position) {\n\n\t\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void callback(Object o) {}", "void additionalCreationCallback() {\n }", "@Override\n public void onCallBack(int pos) {\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n\n Log.v(TAG, \"on attach\");\n callback = (Callback)activity;\n }", "public void activate(){\n callback.action();\n }", "public abstract void onAttach();", "EventCallbackHandler getCallbackHandler();", "public interface Callback {\n }", "void addUserCallback(UserCallback callback);", "void addAdvertCallback(AdvertCallback callback);", "public interface Callback {\n void onExpanded(boolean z);\n\n void onInteraction();\n\n void onPrioritySettings();\n }", "public void addToCallbacks(entity.LoadCallback element);", "public void onCompletion(Runnable callback)\n/* */ {\n/* 158 */ this.completionCallback = callback;\n/* */ }", "public void runOnAvailableCallback() {\n onAvailableCallback.run();\n }", "interface MyCallBack {\n\tpublic void onComplete(); \n}", "public interface RequestCallbackListener {\n public void notifyToCaller(boolean isExecuted,Object obj);\n}", "public Response callback() throws Exception;", "void addCallback(BiConsumer<Boolean, Boolean> callback);", "@Override\n\tpublic void createCB(CB cb) {\n\t\t\n\t}", "void addCallback(Executor executor, BiConsumer<Boolean, Boolean> callback);", "public void onActivation() { }", "public void setupCallback(MouseBehaviorCallback callback) {\r\n\t\tthis.callback = callback;\r\n\t}", "public CallbackHandler() {\r\n // TODO Auto-generated constructor stub\r\n }", "public abstract void callback(Instruction instruction);", "public interface Callback {\n\n void registerWith(Callbacks helper);\n\n}", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n if (callbackManager != null) callbackManager.setActivity(activity);\n }", "int callback(int num_msg, Pointer msg, Pointer resp, Pointer _ptr);", "public interface Callback {\n public void click();\n }", "public void add( final Callback callback ) {\n\t\tcallbacks.add( callback );\n\t}", "public interface RandomLivingAdderCallback {\n public void inserted();\n}", "public static void registerCallbackHandler(com.sybase.persistence.CallbackHandler handler)\n {\n DELEGATE.registerCallbackHandler(handler);\n }", "public synchronized void addCallback(MaestroNoteCallback callback) {\n callbacks.add(callback);\n }", "void onCallback(String gekozenWoord);", "protected void javaCallback() {\n\t}", "public LowLevelNetworkHandler setCallback(Callback callback);", "void addEventRegistrationCallback(EventRegistrationCallback eventRegistrationCallback);", "void addMessageInl(ID id, Callback callback) {\n if(mCallbackMap.containsKey(id)){\n timeOutID(id);\n }\n mCallbackMap.put(id, callback);\n mIDList.add(0, id);\n if(mIDList.size() == 1) mHandler.postDelayed(new Runnable() {\n @Override\n public void run() {\n lastOneTimeOut();\n }\n }, mTimeOut);\n }", "public interface Callback {\n\n void call();\n\n}", "public interface ICallBAck {\n void getCallback();\n }", "private void setListener() {\n\t}", "public interface Callback {\n void mo142a(MediaResource mediaResource);\n\n void mo143b(MediaResource mediaResource);\n }", "public void\t\tnotifyUCallbackListeners();", "void attach (ObservateurGenerateurAsync observateur);", "public interface UHFCallbackLiatener {\n void refreshSettingCallBack(ReaderSetting readerSetting);\n void onInventoryTagCallBack(RXInventoryTag tag);\n void onInventoryTagEndCallBack(RXInventoryTag.RXInventoryTagEnd tagEnd);\n void onOperationTagCallBack(RXOperationTag tag);\n}", "public abstract void onNext();", "public void executer(Callback callback){\n exec();\n if(callback != null){\n System.out.println(\" \" +\n \"[ Callback : callback() : 调用回调函数 ]\");\n callback.call();\n }\n }", "void addLifecycleCallback(LifecycleCallbackItem lifecycleCallbackItem);", "@Override\n public void registerCallback(@NonNull BleMessageStreamCallback callback) {\n mCallbacks.add(callback);\n }", "public void onBegin() {\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public interface Callback {\n void call();\n}", "protected void onBegin() {}", "public void mo55177a() {\n this.f1456a.onSuccess();\n }", "@Override\n\t\t\t\tpublic void onProgess(long total, long num) {\n\t\t\t\t\tif(callback!=null)\n\t\t\t\t\tcallback.onUplodinging(total, num);\n\t\t\t\t}", "void registerCallback(BundleTriggerCallback callback);", "static Handler getCallbackHandler() {\n return sCallbackHandler;\n }", "public interface ComCallBack {\n public void onCallBack(Object obj);\n}", "@Override\n protected void onCallbacksInitialize() {\n ViewGroup view = (ViewGroup) findViewById(getClickedID());\n if (view != null) {\n view.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if (callbackReference != null\n && objectReference != null\n && objectReference.get() != null\n && callbackReference.get() != null) {\n T object = objectReference.get();\n callbackReference.get().onItemClick(index, object);\n }\n }\n });\n }\n }", "private void setPlayerCallbacks() {\n universalPlayer.setPlayerStateListener(this);\n universalPlayer.setOnAutonomicTrackChangeCallback(new IOperationFinishCallback() {\n @Override\n public void operationFinished() {\n if (isAdded()) {\n playableMediaItem = UniversalPlayer.getInstance().getPlayingMediaItem();\n initPlayerUI();\n configurePlayer();\n initTrackNumbersSection();\n }\n }\n });\n\n IOperationFinishCallback playerFailedCallback = MediaUtils.getPlayerFailCallback(getActivity(), playableMediaItem);\n\n if (universalPlayer.isInErrorState) {\n playerFailedCallback.operationFinished();\n } else {\n universalPlayer.setOnPlayingFailedCallback(playerFailedCallback);\n }\n }", "public interface OnCallingListener {\n void onCallEnd();\n}", "public interface Callback {\n\n /**\n * A callback method the user should implement. This method will be called when the send to the server has\n * completed.\n * @param send The results of the call. This send is guaranteed to be completed so none of its methods will block.\n */\n public void onCompletion(RecordSend send);\n}", "@Override\r\n\t\tpublic void onAttach(Activity activity) {\n\t\t\tsuper.onAttach(activity);\r\n\t\t\tmCallback=(Fragment_Listener)activity;\r\n\t\t\t\r\n\t\t}", "public interface Callbacks {\n void onStateChanged();\n void onProximityNegative();\n }", "public interface OnRecordCallBack {\n\n int onSaveRecord(DataSource dataSource, int record);\n\n int onGetRecord(DataSource dataSource);\n\n int onResetRecord(DataSource dataSource);\n\n int onRemoveRecord(DataSource dataSource);\n\n void onClearRecord();\n\n}", "public void setListener(Callback callback) {\n final Callback oldCallback = mCallback;\n if (oldCallback != callback) {\n mCallback = callback;\n\n if (callback == null) {\n // Stop listening for changes now that there IS NOT a listener.\n mContext.getContentResolver().unregisterContentObserver(mContentObserver);\n } else if (oldCallback == null) {\n // Start listening for changes now that there IS a listener.\n final ContentResolver cr = mContext.getContentResolver();\n cr.registerContentObserver(Secure.getUriFor(Secure.TWILIGHT_STATE),\n false /* notifyForDescendants */, mContentObserver, mUserId);\n cr.registerContentObserver(Secure.getUriFor(Secure.THEME_AUTO_MODE),\n false /* notifyForDescendants */, mContentObserver, mUserId);\n cr.registerContentObserver(Secure.getUriFor(Secure.THEME_CUSTOM_START_TIME),\n false /* notifyForDescendants */, mContentObserver, mUserId);\n cr.registerContentObserver(Secure.getUriFor(Secure.THEME_CUSTOM_END_TIME),\n false /* notifyForDescendants */, mContentObserver, mUserId);\n }\n }\n }", "private void registerCallbacks() {\n nations.forEach(this::registerCallback);\n }", "public interface BlobChangingCallback {\n\n /**\n * Informs the listener that a blob has changed and is ready to update and replace a localized blob that has been marked as tied to the\n * life cycle of the worker process.\n *\n * <p>If `go.getLatch()` is never called before the method completes it is assumed that the listener is good with the blob changing.\n *\n * @param assignment the assignment this resource and callback are registered with.\n * @param port the port that this resource and callback are registered with.\n * @param blob the blob that is going to change.\n * @param go a way to indicate if the listener is ready for the resource to change.\n */\n void blobChanging(LocalAssignment assignment, int port, LocallyCachedBlob blob, GoodToGo go);\n}", "public interface CallBackInterface {\n}", "public void on() {\n\n\t}", "public void setOnReceiveCalled() {\n this.f49 = true;\n }", "private boolean isCallback(IMethodResult result)\n\t{\n\t\treturn (result != null && result.hasCallback());\n\t}", "public interface CallBackListener\n{\n public void drawbackTexto0(String response);\n}", "public void registerCallback(IInstrumentServiceCallback callback) {\n\t\t\tif (callback != null) {\n\t\t\t\tm_callbacks.register(callback);\n\t\t\t\tm_soundManager.progressListenerRegistered();\n\t\t\t}\n\t\t}", "public void setCallbacks(entity.LoadCallback[] value);", "@Override\r\n\tpublic void setListener() {\n\r\n\t}", "@Override\r\n\tpublic void setListener() {\n\r\n\t}", "public interface OnCanvasCallback {\n void onSingleTap();\n\n void onDownDispear();\n\n void setUndoEnable(boolean enable);\n void setRecoverEnable(boolean enable);\n}", "public interface Callback {\n public static final int TYPE_REGULAR = 0;\n public static final int TYPE_DRAFT = 1;\n public static final int TYPE_TRASH = 2;\n\n /**\n * Called when the specified mailbox does not exist.\n */\n public void onMailboxNotFound(boolean firstLoad);\n\n /**\n * Called when the user wants to open a message.\n * Note {@code mailboxId} is of the actual mailbox of the message, which is different from\n * {@link MessageListFragment#getMailboxId} if it's magic mailboxes.\n *\n * @param messageId the message ID of the message\n * @param messageMailboxId the mailbox ID of the message.\n * This will never take values like {@link Mailbox#QUERY_ALL_INBOXES}.\n * @param listMailboxId the mailbox ID of the listbox shown on this fragment.\n * This can be that of a magic mailbox, e.g. {@link Mailbox#QUERY_ALL_INBOXES}.\n * @param type {@link #TYPE_REGULAR}, {@link #TYPE_DRAFT} or {@link #TYPE_TRASH}.\n */\n public void onMessageOpen(long messageId, long messageMailboxId, long listMailboxId,\n int type);\n\n /**\n * Called when an operation is initiated that can potentially advance the current\n * message selection (e.g. a delete operation may advance the selection).\n * @param affectedMessages the messages the operation will apply to\n */\n public void onAdvancingOpAccepted(Set<Long> affectedMessages);\n\n /**\n * Called when a drag & drop is initiated.\n *\n * @return true if drag & drop is allowed\n */\n public boolean onDragStarted();\n\n /**\n * Called when a drag & drop is ended.\n */\n public void onDragEnded();\n }", "public final void addCallback(Callback callback) {\n if (callback == null) {\n throw new IllegalArgumentException(\"callback\");\n }\n \n if (!mCallbacks.contains(callback)) {\n mCallbacks.add(callback);\n }\n }", "@Override\n\tpublic void updateCB(CB cb) {\n\t\t\n\t}", "@Override\n public void onSuccess() {\n if (callback != null) {\n callback.run();\n }\n }", "@Override\n public void onSuccess() {\n if (callback != null) {\n callback.run();\n }\n }", "public void onContinue() {\n }", "boolean callback(Pointer hWnd, Pointer arg);", "public interface SimpleCallback<T> {\n void onStart();\n\n void onNext(T t);\n\n void onComplete();\n}", "public interface CardListener {\n void callback(CardInfo cardInfo);\n}", "@Override\r\n\tpublic void on() {\n\r\n\t}", "@Override\n public void onDeviceAdded(final MidiDeviceInfo device) {\n for(Map.Entry<DeviceCallback, Handler> item : mCallbacks.entrySet()) {\n final DeviceCallback callback = item.getKey();\n Handler handler = item.getValue();\n if(handler == null) {\n callback.onDeviceAdded(device);\n } else {\n handler.post(new Runnable() {\n @Override\n public void run() {\n callback.onDeviceAdded(device);\n }\n });\n }\n }\n }", "public interface ICallback {\n void sucessed(String s);\n void fialed(String s);\n}", "@Override\n\tprotected void setListener() {\n\n\t}", "@Override\n\tprotected void setListener() {\n\n\t}", "public ClickListener(){\n System.out.println(\"I've been attached\");\n }", "public boolean isCallback() {\n return callback;\n }", "public synchronized void add(T e){\n if(e==null){\n return;\n }\n callbackList.add(e);\n }", "public SendedCallback getSendedCallback() {\n return sendedCallback;\n }", "private void fireOnTweetsReceived(ArrayList<AbstractTweet> arlis) {\n if ( mOnNewTweet != null ){\n mOnNewTweet.onNewTweet(arlis);\n }\n else{\n throw new NullPointerException(\"fireOnTweetsReceived(): WARNING:: we don't have listener registered. Suspicious logic\"); \n }\n }" ]
[ "0.68971276", "0.6819867", "0.6737128", "0.6676657", "0.66201717", "0.64985555", "0.6394053", "0.6324237", "0.6184731", "0.6179281", "0.6050341", "0.60147065", "0.6002642", "0.5981946", "0.5976388", "0.5944225", "0.5932017", "0.592483", "0.59212667", "0.5889826", "0.58743083", "0.58365357", "0.5828931", "0.58139765", "0.58137363", "0.58028483", "0.57691544", "0.5764542", "0.57520497", "0.5733902", "0.5711389", "0.57057214", "0.5693666", "0.56864786", "0.5682276", "0.56518096", "0.5649158", "0.56487477", "0.563947", "0.563255", "0.5622334", "0.56056035", "0.5592907", "0.5588416", "0.55880356", "0.5585344", "0.5583023", "0.55750364", "0.55603707", "0.55558866", "0.555585", "0.5554104", "0.5552711", "0.555047", "0.5546053", "0.5545458", "0.55416584", "0.553072", "0.55306715", "0.55282384", "0.551967", "0.5503397", "0.550115", "0.5500898", "0.5494976", "0.5489191", "0.5478247", "0.5478101", "0.54756355", "0.54738307", "0.5470384", "0.5448812", "0.5446557", "0.5442792", "0.5438938", "0.54386514", "0.5434585", "0.54336876", "0.5431708", "0.5422152", "0.5422152", "0.54204595", "0.5419176", "0.5416014", "0.5402429", "0.54013604", "0.54013604", "0.5394633", "0.53908926", "0.5386417", "0.53833103", "0.53820145", "0.53764033", "0.5374903", "0.5357324", "0.5357324", "0.5355856", "0.53475875", "0.53475696", "0.53408253", "0.5334835" ]
0.0
-1
observe to read results
LiveData<WalletDataDecl.ListResultTmpl<Response>> results();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getDataFromDb() {\n viewModel.getCachedResults().observe(getViewLifecycleOwner(), searchResults -> {\n// Log.d(TAG, \"queryMusic: \" + new GsonBuilder().create().toJson(searchResults));\n\n //Checks if results is empty, will show the empty message if it do else, clears the list and adds the new one\n if (searchResults.isEmpty()) {\n resultsRv.setVisibility(View.GONE);\n progressBar.setVisibility(View.GONE);\n resultText.setVisibility(View.VISIBLE);\n } else {\n resultsRv.setVisibility(View.VISIBLE);\n progressBar.setVisibility(View.GONE);\n resultText.setVisibility(View.GONE);\n mSearchResultList.clear();\n mSearchResultList.addAll(searchResults);\n resultsListAdapter.setData(mSearchResultList);\n// Log.d(TAG, \"setData: mSearchResultList: \"+ new GsonBuilder().create().toJson(mSearchResultList));\n }\n });\n }", "public void receiveResultGetContents(\r\n\t\t\tcom.autometrics.analytics.v9.j2ee.webservices.v1_0.GetContentsResponse result) {\r\n\t}", "public void getTestResults(){\n TestResultDAO resultsManager = DAOFactory.getTestResultDAO();\n //populate with values from the database\n if(!resultsManager.readAllTestResults(testResults)){\n //close the window due to read failure\n JOptionPane.showMessageDialog(rootPanel, \"Failed to read test results from database. Please check your internet connection and try again.\");\n System.exit(-3);\n }\n }", "public void receiveResultservicedis(\n ) {\n }", "protected abstract void retrievedata();", "protected void notifyRead(){\n indexList.clear();\n int rows = bank.getRows();\n for(int i = 0; i < rows; i++){\n int value = bank.getInt(filterVar, i);\n if (filterList.contains(value)) indexList.add(i);\n }\n }", "public List<String> getResult()\n {\n while (!readComplete)\n {\n try\n {\n Thread.sleep(1000);\n }\n catch (InterruptedException ex)\n {\n // swallow and exit;\n }\n }\n return lines;\n }", "@Override\n public void onOnlineDiveDataProgress(\n Object result) {\n\n }", "public Result getResults()\r\n {\r\n return result;\r\n }", "public void onResultConsumed() {\n }", "@Override\n\t\t\t\t\t\t\tpublic void onOnlineDiveDataProgress(Object result) {\n\n\t\t\t\t\t\t\t}", "private void readItems() {\n }", "public void getResults()\n\t{\n\t\tThread mOutReader = new Thread()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getInputStream()));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile ((!isInterrupted() && line != null))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = line.trim();\n\t\t\t\t\t\tmResults.add(line);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedIOException e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t//we will process the error stream just in case\n\t\tThread mErrReader = new Thread()\n\t\t{\n\t\t\tpublic void run()\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tBufferedReader br = new BufferedReader(new InputStreamReader(mProcess.getErrorStream()));\n\t\t\t\t\tString line = br.readLine();\n\t\t\t\t\twhile ((!isInterrupted() && line != null))\n\t\t\t\t\t{\n\t\t\t\t\t\tline = line.trim();\n\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t\tline = br.readLine();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedIOException e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t\tcatch (Exception e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tmOutReader.start();\n\t\tmErrReader.start();\n\n\t\t//wait for process to end.\n\t\ttry\n\t\t{\n\t\t\tmProcess.waitFor();\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.err.println(\"process exception\");\n\t\t}\n\t\tmFinished = true;\n\t}", "void onFetchDataStarted();", "void onNext(CorfuStreamEntries results);", "@Override\n\tpublic void queryData() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception 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}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception 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}", "private void results() {\n\t\t// when the election is not closed,\n\t\ttry{\n\t\t\tMap<String,Integer> results = election.getResultsFromPolls();\n\t\t\t// when the election is closed,\n\n\t\t\tCollection<Integer> values = results.values();\n\t\t\tint totalVotes = 0;\n\n\t\t\tfor(Integer i:values){\n\t\t\t\ttotalVotes += i;\n\t\t\t}\n\t\t\tSystem.out.println(\"Current election results for all polling places.\");\n\t\t\tSystem.out.println(\"NAME PARTY VOTES %\");\n\t\t\tprintResultsHelper(results,totalVotes);\n\n\t\t}catch(UnsupportedOperationException uoe){\n\t\t\tSystem.out.println(\"The election is still open for votes.\");\n\t\t\tSystem.out.println(\"You must close the election before viewing results.\");\n\t\t}\n\t}", "private void retrieveResult() {\n if (result == null) {\n this.setResult(((DocumentBuilder)this.getHandler()).getResult());\n }\n }", "public void read() {\n synchronized (this) {\n while (events.size() == 0) {\n try {\n wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n System.out.printf(\"Read :%d,%s\\n\",\n events.size(), events.poll());\n notify();\n }\n }", "private String readResult() throws IOException {\n return reader.readLine();\n }", "private void getMasechtotListFromServer() {\n\n\n RequestManager.getMasechtotList().subscribe(new Observer<Result<MasechetList>>() {\n @Override\n public void onSubscribe(Disposable d) {\n\n }\n\n @Override\n public void onNext(Result<MasechetList> masechetListResult) {\n\n saveMasechtotList(masechetListResult.getData());\n mMasechtotList = masechetListResult.getData();\n\n }\n\n @Override\n public void onError(Throwable e) {\n\n }\n\n @Override\n public void onComplete() {\n\n }\n });\n\n\n }", "@Override\n public void run() {\n\n // get the result\n\n final List<UserModel> userModels = userListRepository.getUserList(refresh);\n\n getMainThreadExecutor().execute(new Runnable() {\n @Override\n public void run() {\n callback.onResult(userModels);\n }\n });\n\n }", "@Override\r\n\tpublic void queryResult(queryResultRequest request, StreamObserver<queryResultResponse> responseObserver) {\n\t\tsuper.queryResult(request, responseObserver);\r\n\t}", "@Override\n public void completed(Integer result, String attachment)\n {\n log.info(\"Successful read!\");\n }", "@Override\n\t\t\t\t\t\t public void run() {\n\t\t\t\t\t\t\t getResponse();\n\t\t\t\t\t\t }", "public interface IResultsAvailable {\n public void onResultsAvailable(QueryResult results);\n}", "public void receiveResultsIO_FI_OA_AFS_OA024(out.deal.afs.zc024.MT_FI_OA_AFS_OA024_REP result) {\n\t}", "public void read() {\n postBusy();\n mErrorLiveData.postValue(null);\n mManager.list(new McuMgrCallback<McuMgrImageStateResponse>() {\n @Override\n public void onResponse(@NonNull final McuMgrImageStateResponse response) {\n mHashes[0] = mHashes[1] = null;\n // Save the hash of the unconfirmed images. They are required for sending test\n // and confirm messages.\n if (response.images != null) {\n for (McuMgrImageStateResponse.ImageSlot slot : response.images) {\n if (!slot.confirmed) {\n mHashes[slot.image] = slot.hash;\n }\n }\n }\n postReady(response);\n }\n\n @Override\n public void onError(@NonNull final McuMgrException error) {\n mErrorLiveData.postValue(error);\n postReady(null);\n }\n });\n }", "@Override \n\t\tprotected void publishResults(CharSequence constraint, FilterResults results)\n\t\t{\n\t\t\t\n \n filteredData = (ArrayList<IndexEntry>) results.values;\n notifyDataSetChanged();\n \n if (callback != null){\n \tcallback.valuesFiltered();\n \tcallback = null;\n }\n \n\t\t}", "public void ownRead();", "protected abstract void onQueryResult(NewsResponse newsResponse);", "@Override\r\n public void read() {\n System.out.println('\\n' + \"DB repo: \");\r\n //Idk, probably search for a person and read data??\r\n\r\n }", "public void run() {\n readFromClient();\n }", "public void retrieveData(){\n\t\tloaderImage.loadingStart();\n\t\tJsonClient js = new JsonClient();\n\t\tjs.retrieveData(JSON_URL, this);\n\t}", "@Override\n synchronized public void run() {\n try {\n BufferedReader bufferedReader = new BufferedReader(\n new InputStreamReader(inputStream, Charset.defaultCharset())\n );\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n this.result.add(line);\n }\n } catch (IOException ex) {\n log.error(\"Failed to consume and display the input stream of type \" + streamType + \".\", ex);\n } finally {\n this.isStopped = true;\n notify();\n }\n }", "public void processResults(){\n double latitude = Double.parseDouble(latText.getText().trim());\n double longitude = Double.parseDouble(longText.getText().trim());\n int year = Integer.parseInt(yearText.getText().trim());\n\n int observatoryId = MainController.observatoryID;\n\n Runnable task = new Runnable() {\n @Override\n public void run() {\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n int id = ObservatoryData.getInstance().getDatabase().getLastGalamseyEntry() + 1;\n Galamsey newest = new Galamsey(id,observatoryId,longitude,latitude,year, Galamsey.vegColour.getColour(colourValue));\n ObservatoryData.getInstance().getGalamseyHashMap().add(id,newest);\n ObservatoryData.getInstance().getDatabase().insertIntoGalamseyDB(vegColour,colourValue, latitude,longitude,year,observatoryId);\n ObservatoryData.getInstance().buildObservatoryList();\n }\n });\n\n }\n };\n\n new Thread(task).start();\n }", "public List<Result> loadResults() {\n List<Result> results = null;\n try {\n DataBaseBroker dbb = new DataBaseBroker();\n dbb.loadDriver();\n dbb.establishConnection();\n results = dbb.loadResults();\n dbb.commit();\n dbb.closeConnection();\n } catch (Exception ex) {\n Logger.getLogger(GameDBLogic.class.getName()).log(Level.SEVERE, null, ex);\n }\n return results;\n }", "@Override\r\n\tpublic void resultsUpdated() {\r\n\t\tmLayout.hideText();\r\n\t\t\r\n\t\tif(mModel.getResults().size() == 1){\r\n\t\t\tmModel.selectPerson(mModel.getResults().get(0));\r\n\t\t\tmController.getProfilePicture(mModel.getResults().get(0).sciper);\r\n\t\t\tmDialog = new PersonDetailsDialog(this, mModel.getSelectedPerson());\r\n\t\t\tmDialog.show();\r\n\t\t}else\r\n\t\t\tstartActivity(new Intent(getApplicationContext(), DirectoryResultListView.class));\r\n\t\t\r\n\t}", "@Override\n protected void publishResults(CharSequence charSequence, FilterResults results) {\n\n liftList = (ArrayList<Lift>) results.values;\n notifyDataSetChanged();\n }", "@Override\r\n\tpublic boolean results()\r\n\t{\r\n\t\treturn this.results(this.getRobot());\r\n\t}", "@java.lang.Override\n public com.google.cloud.speech.v2.StreamingRecognitionResult getResults(int index) {\n return results_.get(index);\n }", "@Override\r\n public void read() {\r\n Connection conexao = mysql.getConnection();\r\n try {\r\n PreparedStatement stm = conexao.prepareStatement(readSQL);\r\n ResultSet rs = stm.executeQuery();\r\n\r\n while (rs.next()) {\r\n int idcodigo = rs.getInt(\"idcodigo\");\r\n String data = rs.getString(\"data\");\r\n int p_rodada = rs.getInt(\"p_rodada\");\r\n int s_rodada = rs.getInt(\"s_rodada\");\r\n int t_rodada = rs.getInt(\"t_rodada\");\r\n int total = rs.getInt(\"total\");\r\n System.out.println(\"\\nCódigo: \" + idcodigo + \"\\nData: \" + data + \"\\nPrimeira Rodada: \" + p_rodada+ \"\\nSegunda Rodada: \" + s_rodada + \"\\nTerceira Rodada: \" + t_rodada + \"\\nTotal: \" + total);\r\n }\r\n rs.close();\r\n conexao.close();\r\n\r\n } catch (final SQLException ex) {\r\n System.out.println(\"Falha de conexão com a base de dados!\");\r\n ex.printStackTrace();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n try {\r\n conexao.close();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n }", "@Override\r\n public void onShowQueryResult() {\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onLoadLiveTV(String result) {\n\n\t\t\t\t\t\t\t\t}", "@Override\n protected void publishResults(CharSequence constraint,\n FilterResults results) {\n\n list = (List<Person>) results.values;\n notifyDataSetChanged();\n }", "@Override\r\n\tpublic void reading() {\n\t\tSystem.out.println(\"reading\");\r\n\t}", "@Override\n public void dataReceived(PlayingInfoModel result) {\n }", "@Override\n public void run() {\n load_remote_data();\n }", "void onFetchDataCompleted();", "void confirmRead();", "private void getcompareResults(String concept, HttpServletResponse resp) {\n\t\ttry {\n\t\t\tList<JSONObject> js = SparqlEvaluator.getInstance().getRelation(\n\t\t\t\t\tconcept);\n\t\t\tIterator<JSONObject> itr = js.iterator();\n\t\t\tSystem.out.println(\"Size of list :: \" + js.size());\n\n\t\t\tresp.setContentType(\"text/html; charset=UTF-8\");\n\n\t\t\tString dset = \"dbpedia\";\n\n\t\t\tresp.getWriter().print(\"{\\\"bindings\\\": [\");\n\n\t\t\t// resp.getWriter().println(\"Response from Servlet\"+js.size());\n\t\t\tboolean first = true;\n\t\t\tint count = 1;\n\t\t\twhile (itr.hasNext()) {\n\t\t\t\tif (!first) {\n\t\t\t\t\tresp.getWriter().print(\",\");\n\t\t\t\t}\n\t\t\t\tfirst = false;\n\t\t\t\tresp.getWriter().print(itr.next().toString());\n\t\t\t\tSystem.out.println(count++);\n\t\t\t}\n\t\t\tSystem.out.println(\"After loop\");\n\t\t\tresp.getWriter().print(\"]}\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void saveResults(){\n //Tell adapter to save gathered data\n //Call appropriate function\n }", "private void getResults(GetResultRequestEvent e){\n\t\ttable.generateTable(tf.getItemIDList(),\n\t\t\t\te.getBuySystem(), e.getBuyType(),\n\t\t\t\te.getSellSystem(), e.getSellType(),\n\t\t\t\te.getMinimumMargin());\n\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmResult = mFaceManager.getmResult();\n\t\t\t\t\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\tmResult = mFaceManager.getmResult();\n\t\t\t\t\t}", "public abstract RefreshResults refresh();", "private void doRead() throws IOException {\n\t\t\tvar res = sc.read(bb);\n\n\t\t\tif ( res == -1 ) {\n\t\t\t\tlogger.info(\"Connection closed with the client.\");\n\t\t\t\tclosed = true;\n\t\t\t}\n\n\t\t\tupdateInterestOps();\n\t\t}", "public void readData() {\n ConnectivityManager connMgr = (ConnectivityManager)\n this.getSystemService(Context.CONNECTIVITY_SERVICE);\n\n // Get details on the currently active default data network\n NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();\n\n // If there is a network connection, fetch data\n if (networkInfo != null && networkInfo.isConnected()) {\n // Get a reference to the LoaderManager, in order to interact with loaders.\n LoaderManager loaderManager = getLoaderManager();\n\n // number the loaderManager with mPage as may be requesting up to three lots of JSON for each tab\n loaderManager.restartLoader(FETCH_STOCK_PICKING_LOADER_ID, null, loadStockDetailFromServerListener);\n } else {\n // Otherwise, display error\n // First, hide loading indicator so error message will be visible\n View loadingIndicator = findViewById(R.id.loading_spinner);\n loadingIndicator.setVisibility(View.GONE);\n\n // Update empty state with no connection error message\n TextView noConnectionView = (TextView) findViewById(R.id.empty_view);\n noConnectionView.setText(getString(R.string.error_no_internet_connection));\n noConnectionView.setVisibility(View.VISIBLE);\n }\n }", "public void publishResults(CharSequence constraint, FilterResults results) {\n if (results.count == 0) {\n CaSiAdapter.this.notifyDataSetInvalidated();\n return;\n }\n CaSiAdapter.this.list = (ArrayList) results.values;\n CaSiAdapter.this.notifyDataSetChanged();\n }", "void getDataFromServer();", "@Override\r\n\tpublic void readResult(IDCardItem arg0) {\n\t\tmHandler.obtainMessage(200, arg0).sendToTarget();\r\n\t}", "@Override\r\n\tpublic void QueryResultReceived(List<QueryResult> result) {\n\t\t\r\n\t\twhile (form == null);\r\n\t\tform.UpdateResult(result);\r\n\t}", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void run() {\n adapterOverView.notifyDataSetChanged();\n\n // hide progress bar\n progressBarInOverViewWait.setVisibility(View.GONE);\n\n // change var for false if end getting data - can't start new request if old one is not finish\n isGetingDataFromMSSQL = false;\n }", "@Override\n public void run() {\n refreshData();\n }", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "@When(\"^all the events are retrieved$\")\n public void all_the_events_are_retrieved() throws Throwable {\n consumers = 1;\n clearMetrics();\n System.gc();\n long before = System.nanoTime();\n recordCount = ryvr.getSource().stream().count();\n long after = System.nanoTime();\n double localLatencyµs = (after - before) / 1000.0;\n LOGGER.info(\"total latency: {}µs\", localLatencyµs);\n LOGGER.info(\"MTPS(local): {}\", recordCount / localLatencyµs);\n\n if (httpThroughputCounter != null) {\n double byteCount = httpThroughputCounter.getBytes();\n double latencySeconds = httpThroughputCounter.getTotalLatency();\n LOGGER.info(\"bytes: {}MB\", byteCount / 1024.0 / 1024.0);\n LOGGER.info(\"throughput (local): {}MB/s\",\n byteCount / 1024.0 / 1024.0 / localLatencyµs * 1000000);\n LOGGER.info(\"throughput: {}MB/s\", byteCount / 1024.0 / 1024.0 / latencySeconds);\n LOGGER.info(\"total latency(prom): {}µs\", latencySeconds * 1000000.0);\n LOGGER.info(\"MTPS(prom): {}\", recordCount / latencySeconds / 1000000);\n httpThroughputCounter.logLatencies();\n }\n\n }", "@Override\r\n protected void fetchData() {\n\r\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tresults.addAll(resultDataList);\n\t\t\t\tresultAdapter.notifyDataSetChanged();\n\t\t\t\tswingBottomInAnimationAdapter.notifyDataSetChanged();\n\t\t\t}", "public void readResponse()\n\t{\n\t\tDataObject rec = null;\n\t\tsynchronized(receive)\n\t\t{\n\t\t\trec = receive.get();\n\t\t}\n\t\tAssertArgument.assertNotNull(rec, \"Received packet\");\n\t\tpublishResponse(rec);\n\t}", "public void saveResults();", "protected void fetch() {\n HttpClient client = new HttpClient();\n client.getHostConfiguration().setHost(HOST, PORT, SCHEME);\n\n List<String> prefectures = getCodes(client, PATH_PREF, \"pref\");\n List<String> categories = getCodes(client, PATH_CTG, \"category_s\");\n\n // This is a workaround for the gnavi API.\n // Gnavi API only allows max 1000 records for output.\n // Therefore, we divide records into smaller pieces\n // by prefectures and categories.\n for (String prefecture: prefectures) {\n for (String category: categories) {\n logger.debug(\"Prefecture: {}\", prefecture);\n logger.debug(\"Category: {}\", category);\n getVenues(client, prefecture, category, 1);\n }\n }\n }", "public void completeData();", "public void run() {\n\t\t\t\tHttpURLConnection connection = null;\r\n\t\t\t\tStringBuilder response = new StringBuilder();\r\n\t\t\t\ttry{\r\n\t\t\t\t\tURL url = new URL(address);\r\n\t\t\t\t\tconnection = (HttpURLConnection) url.openConnection();\r\n\t\t\t\t\tconnection.setRequestMethod(\"GET\");\r\n\t\t\t\t\tconnection.setConnectTimeout(8000);\r\n\t\t\t\t\tconnection.setReadTimeout(8000);\r\n\t\t\t\t\tconnection.setDoInput(true);\r\n\t\t\t\t\t//connection.setDoOutput(true);\r\n\t\t\t\t\tint responseCode = connection.getResponseCode();\r\n\t\t\t\t\tLog.d(\"HttpUtil\", String.valueOf(responseCode));\r\n\t\t\t\t\tif(responseCode != 200){\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Fail\");\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tInputStream in = connection.getInputStream();\r\n\t\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(in));\r\n\t\t\t\t\t\tString line;\r\n\t\t\t\t\t\twhile((line = reader.readLine()) != null){\r\n\t\t\t\t\t\t\tresponse.append(line);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tLog.d(\"HttpUtil\", \"Get Success\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onFinish(response.toString());\r\n\t\t\t\t\t}\r\n\t\t\t\t}catch(Exception e){\r\n\t\t\t\t\tif(listener != null){\r\n\t\t\t\t\t\tlistener.onError(e);\r\n\t\t\t\t\t}\r\n\t\t\t\t}finally{\r\n\t\t\t\t\tif(connection != null){\r\n\t\t\t\t\t\tconnection.disconnect();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "private void retrieveFavoritePhotos() {\n showProgress(this.mProgressBar, this.mRlContent);\n this.mFavoritePhotosViewModel.retrievePhotos();\n }", "public void publishResults(CharSequence constraint, FilterResults results) {\n if (results.count == 0) {\n BaiHatAdapter.this.notifyDataSetInvalidated();\n return;\n }\n BaiHatAdapter.this.list = (ArrayList) results.values;\n BaiHatAdapter.this.notifyDataSetChanged();\n }", "@Override\r\n protected Boolean doInBackground(Void... params) {\n getData(pageIndex);\r\n return true;\r\n }", "@Override\n protected void publishResults(CharSequence constraint,\n FilterResults results) {\n if (results.count == 0) {\n\n roomList = (List<iFlyChatRoom>) results.values;\n notifyDataSetInvalidated();\n\n } else {\n roomList = (List<iFlyChatRoom>) results.values;\n notifyDataSetChanged();\n }\n\n }", "public void read() {\n\t\tthis.isRead = true;\n\t}", "@Override\n\t\t\tpublic void onLoadLiveTV(String result) {\n\n\t\t\t}", "public void receiveResultquery(\n com.exacttarget.wsdl.partnerapi.QueryResponseMsgDocument result\n ) {\n }", "public void onFetchCompleted () {}", "@Override\n protected void publishResults(CharSequence constraint, Filter.FilterResults results) {\n filtered = (List<Scenario>) results.values;\n notifyDataSetChanged();\n }", "private void ObserveAnyChange(){\n movieListViewModel.getMovies().observe(getViewLifecycleOwner(), new Observer<List<MovieModel>>() {\n @Override\n public void onChanged(List<MovieModel> movieModels) {\n\n if (movieModels != null){\n for (MovieModel movieModel: movieModels){\n // get data in Log\n Log.v(TAG, \" onChanged: \"+ movieModel.getTitle());\n movieRecyclerAdapter.setmMovieModels(movieModels);\n }\n }\n\n }\n });\n }", "@Override\r\n\tpublic void read() {\n\r\n\t}", "@Override\n public void run() {\n try{\n //3.2.1) URL url = new...\n URL url = new URL(\"http://api.androidhive.info/json/movies.json\");\n //3.2.2)URLConnection con = url.openConnection\n URLConnection con = url.openConnection();\n //3.2.3)InputStream in = con.getInputStream\n InputStream in = con.getInputStream();\n\n //3.2.4) String json IO.getString(in)\n String json = IO.getString(in);\n\n //3.2.5) parse the json\n List<Movie> movies = parseJson(json);\n\n //3.2.6) notify the listener\n listener.onMoviesArrived(movies, null);\n }catch (Exception e){\n e.printStackTrace();\n listener.onMoviesArrived(null, e);\n }\n\n }", "@Override\n public Observable<MainModelImp> getResults() {\n return model.build().getNearbyResult(lat, lon);\n }", "public void writeResults() {\n gfmBroker.storeResults(this.responses, fileOutputPath);\n }", "void getPeopleRx();", "@Override\n public void onDataCached(ResponseDTO r) {\n response = r;\n buildPages();\n if (riverListFragment != null) {\n riverListFragment.refreshListStop();\n }\n try {\n if (SharedUtil.getRiverLoadedFlag(ctx) == 1) {\n\n getData();\n } else {\n progressBar.setVisibility(View.GONE);\n if (riverListFragment != null) {\n riverListFragment.refreshListStop();\n }\n }\n } catch (Exception e) {\n\n }\n }", "private void loadResult() {\n lvResult.setVisibility(View.VISIBLE);\n lvResult.setAdapter(new AddressAdapter(MainActivity.this, geocodingResult.getResults()));\n }", "protected abstract List<List<SearchResults>> processStream();", "public IScapSyncSearchResult[] getResults();", "protected void modelRead(){\r\n\t\tthis.model.read(in, null);\r\n\t\tSystem.out.println(\"\\n -- model read finished --\\n\");\r\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tResult result = mFacePlus.getAllPersonListInfo();\n\t\t\t\tif(result.type == Result.TYPE.FAILED){\n\t\t\t\t\tDebug.debug(TAG, \"err msg = \" + result.data);\n\t\t\t\t\tLog.e(TAG,\"false\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tList<Person> personlist = (List<Person>) result.data;\n\t\t\t\tfor (int i = 0; i < personlist.size(); i++) {\n\t\t\t\t\tPerson person = personlist.get(i);\n\t\t\t\t\tLog.e(TAG,person.getName());\n\t\t\t\t\tLog.e(TAG,person.getId());\n\t\t\t\t}\n\t\t\t}", "public void showResults(String results){\n\t\t\tMessage msg = MainUIHandler.obtainMessage(UI_SHOW_RESULTS);\n\t\t\tmsg.obj=results;\n\t\t\tMainUIHandler.sendMessage(msg);\t\n\t\t}", "public void read(IServerCallback callback) {\n ServerCall sc = new ServerCall(ServiceName.matchMaking, ServiceOperation.READ, null, callback);\n _client.sendRequest(sc);\n }", "void loadResults(ArrayList<Comic> results, int totalItems);" ]
[ "0.66883194", "0.6140722", "0.61180925", "0.60553825", "0.60400796", "0.5947948", "0.58842087", "0.58746773", "0.5850556", "0.58263814", "0.5808916", "0.57531023", "0.5730609", "0.5729364", "0.5719769", "0.569306", "0.5689725", "0.5689725", "0.5677713", "0.566181", "0.56608224", "0.56211746", "0.55933225", "0.55916464", "0.5588192", "0.5561034", "0.5559015", "0.55542994", "0.5544032", "0.5539821", "0.551103", "0.54971623", "0.5471719", "0.54661113", "0.5464399", "0.54614186", "0.5446733", "0.54445624", "0.5443539", "0.5425649", "0.5422004", "0.54115695", "0.540195", "0.5398883", "0.53899205", "0.53869164", "0.53834337", "0.538093", "0.53788584", "0.5376299", "0.5370712", "0.5352265", "0.53418916", "0.53417236", "0.5333777", "0.53310704", "0.53310704", "0.532614", "0.53261137", "0.5323503", "0.53127664", "0.530882", "0.5308022", "0.5304858", "0.52967536", "0.5293479", "0.5289829", "0.52832276", "0.5282099", "0.5269969", "0.52696055", "0.52630514", "0.5261811", "0.5261084", "0.5259114", "0.52571213", "0.52480155", "0.5246326", "0.52456695", "0.52449715", "0.52449244", "0.5243538", "0.52408063", "0.5240671", "0.5240462", "0.5239197", "0.5237641", "0.5231498", "0.52312386", "0.5229826", "0.522949", "0.52280736", "0.522734", "0.5226848", "0.52247936", "0.52176195", "0.5213184", "0.5210816", "0.5210427", "0.52056557" ]
0.5369232
51
observe to read errors, including TX_INVALID which means data set was invalidated and now reset+load must be executed to update the data (preferable w/ req.page.aroundId set near the previously observed page)
LiveData<WalletData.Error> error();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private synchronized void evictPage() throws DbException {\n // some code goes here\n // not necessary for proj1\n //flush the page first, which is the end node\n // System.out.println(\"In evict head \" + head + \" end \"+end);\n // Node evictedNode = end;\n\n // Page retrievedPage = bufferedPages.get(evictedNode.pageId).page;\n\n // //find page that is not dirty\n // //System.out.println(end.pageId.hashCode() + \" ??\" );\n // while (evictedNode != null && retrievedPage.isDirty() != null) {\n // System.out.println(\"bufferpool loops\");\n // evictedNode = evictedNode.pre;\n // retrievedPage = evictedNode == null ? \n // null : bufferedPages.get(evictedNode.pageId).page;\n // }\n // System.out.println(\"evict one node in evict\");\n // if (evictedNode == null) {\n // throw new DbException(\"All pages are dirty.\");\n // }\n\n // try {\n // flushPage(evictedNode.pageId);\n // } catch (IOException e) {\n // e.printStackTrace();\n // System.exit(0);\n // } catch (Exception e) {\n // e.printStackTrace();\n // System.exit(0);\n // }\n // //remove the page\n // bufferedPages.remove(evictedNode.pageId);\n //removeNode(evictedNode);\n\n Page retrievedPage = null;\n\n for (PageId pid : bufferedPages.keySet()) {\n retrievedPage = bufferedPages.get(pid).page;\n if (retrievedPage.isDirty() == null) {\n break;\n }\n }\n\n try {\n flushPage(retrievedPage.getId());\n } catch (IOException e) {\n e.printStackTrace();\n System.exit(0);\n } catch (Exception e) {\n e.printStackTrace();\n System.exit(0);\n }\n //remove the page\n bufferedPages.remove(retrievedPage.getId());\n\n }", "private void tryStaleEntry (RequestHandler rh, Exception e) {\n\tif (rh.entry != null && rh.conditional && !mustRevalidate) {\n\t handleStaleEntry (rh);\n\t} else {\n\t doError (504, e);\n\t return;\n\t}\n }", "private synchronized void evictPage() throws DbException {\n // some code goes here\n // not necessary for lab1\n Page pg = bufferPool.evictPage();\n PageId pid = pg.getId();\n try {\n if (pg != null) {\n flushPage(pid);\n discardPage(pid);\n }\n } catch (IOException e) {\n throw new DbException(\"evictPage: unable to error when flush a page\");\n }\n }", "public void checkReadLock() {\n checkNotDeleted();\n super.checkReadLock();\n }", "@Test\n public void testAllDirtySucceeds()\n throws IOException, DbException, TransactionAbortedException {\n HeapFile f = SystemTestUtil.createRandomHeapFile(2, 512 * 10, null, null);\n Database.resetBufferPool(1);\n\n // BEGIN TRANSACTION\n Transaction t = new Transaction();\n t.start();\n\n // Insert a new row\n TransactionTestUtil.insertRow(f, t);\n\n // Scanning the table must fail because it can't evict the dirty page\n try {\n TransactionTestUtil.findMagicTuple(f, t);\n } catch (DbException e) {\n fail(\"Expected scan to run be able to evict buffer pages\");\n }\n t.commit();\n }", "private void failureRecovery() throws IOException {\n //no requirement to check if current page version is the newest\n// HashMap<Integer, Integer> map = getLastPageVersions();\n\n //just overwrite pages with versions from log files\n List<UserData> lastCommittedPageVersions = getLastCommittedPageVersions();\n\n for (UserData lastCommittedPageVersion : lastCommittedPageVersions) {\n persistData(lastCommittedPageVersion);\n }\n }", "@Override\n\tpublic void onSkipInRead(Throwable t) {\n\t\t\n\t}", "@Test\n public void numberOfIndexValuesStatIsUpdatedWhenEntryInvalidated() throws Exception {\n IndexStatistics stats = index.getStatistics();\n region.invalidate(\"3\");\n assertEquals(3, stats.getNumberOfValues());\n SelectResults results = region.query(\"status = 'active'\");\n assertEquals(2, results.size());\n }", "@Override\n\t\t\t\tpublic void onNetworkError(Request request, IOException e) {\n\t\n\t\t\t\t\tscrollView.onRefreshComplete();\n\t\t\t\t\t\n\t\t\t\t}", "private void onLoadingError() {\n AppSession.showDataLoadError(\"conexus\");\n finish();\n }", "@Before(stages = LifecycleStage.BindingAndValidation, on = {\"edit\", \"save\"})\r\n public void loadExcursionFromDatabase() {\r\n String ids = getContext().getRequest().getParameter(\"excursion.id\");\r\n if (ids == null) return;\r\n excursion = facade.getExcursion(Long.parseLong(ids));\r\n date = excursion.getExcursionDate().toString(DateTimeFormat.forPattern(pattern));\r\n trips = facade.getAllTrips();\r\n tripId = excursion.getTrip().getId();\r\n }", "@Test\n\t@Transactional\n\t@DirtiesContext\n\tpublic void testRestartOnSecondPage() throws Exception {\n\n\t\tgetAsItemStream(reader).open(executionContext);\n\t\t\n\t\tFoo foo1 = reader.read();\n\t\tassertEquals(1, foo1.getValue());\n\t\tFoo foo2 = reader.read();\n\t\tassertEquals(2, foo2.getValue());\n\t\tFoo foo3 = reader.read();\n\t\tassertEquals(3, foo3.getValue());\n\t\tFoo foo4 = reader.read();\n\t\tassertEquals(4, foo4.getValue());\n\n\t\tgetAsItemStream(reader).update(executionContext);\n\t\n\t\tgetAsItemStream(reader).close();\n\n\t\t// create new input source\n\t\treader = createItemReader();\n\n\t\tgetAsItemStream(reader).open(executionContext);\n\n\t\tFoo foo5 = reader.read();\n\t\tassertEquals(5, foo5.getValue());\n\n\t\tassertNull(reader.read());\n\t}", "public void onLoadingFailure() {\n AppSession.showDataLoadError(\"post\");\n onLoadingComplete();\n }", "public void onReadError(Exception ex) {\n logger.error(\"Encountered error on read\");\n }", "public void errorWhenCommitting();", "public void queryError()\r\n {\r\n myFailedQueryCountProvider.setValue(Integer.valueOf(myFailedQueryCounter.incrementAndGet()));\r\n }", "@Test\n public void invalidTableOffset() throws InterruptedException {\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(0, 100));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n\n // Table Offset must be greater than 1\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(1, 100));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n\n // Table Offset must be less than 246 (255-maxTableOffset())\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(250, 100));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n }", "public void fail() {\n _siteStatus = false;\n _lockTable.clear();\n _accessedTransactions.clear();\n _uncommitDataMap.clear();\n _lastFailTime = _tm.getCurrentTime();\n }", "protected final void assertResponseRead () {\n\t\t\tif(!didRead) throw new ProviderException (\"Response has not been read yet! -- whose bad?\");\n\t\t}", "@Override\n public void errorOnUpdate(String buxError) {\n }", "private void reallocateUnConsumedEsnRecords() {\n\t\tesnInfoRepository\n\t\t\t\t.findAllByIsConsumed(false).stream().filter(item -> (Days\n\t\t\t\t\t\t.daysBetween(new DateTime(item.getDateClaimed()), new DateTime()).isGreaterThan(Days.days(2))))\n\t\t\t\t.forEach(item -> {\n\t\t\t\t\titem.setUserClaimed(null);\n\t\t\t\t\titem.setDateClaimed(null);\n\t\t\t\t});\n\t}", "public void checkReadLock() {\r\n return;\r\n }", "abstract void onIndexDisrupted(String caseId);", "public void inquiryError() {\n\t\t\n\t}", "private synchronized void flushPage(PageId pid) throws IOException {\n // some code goes here\n // not necessary for lab1\n if (bufferPool.pageIdxMap.containsKey(pid)) {\n Page pg = bufferPool.pageIdxMap.get(pid);\n if (pg.isDirty() != null) {\n Database.getCatalog().getDatabaseFile(pg.getId().getTableId()).writePage(pg);\n }\n }\n\n }", "private void fireOnModelErrorEvent(Exception e) {\n \t\tif(!facade.getApplicationStateManager()\r\n \t\t\t\t.getApplicationState().equals(ApplicationState.LOADING)) {\r\n \t\t\treturn;\r\n \t\t}\r\n \t\t\r\n \t\tIterator<ModelDataListener> it = this.modelDataListeners.iterator();\r\n \t\t\r\n \t\twhile(it.hasNext()) {\r\n \t\t\tit.next().onModelError(e);\r\n \t\t}\r\n \t}", "public void recover() {\n _siteStatus = true;\n for (Integer varIndex : _dataMap.keySet()) {\n List<Data> dataList;\n if (varIndex % 2 == 0) {\n dataList = _dataMap.get(varIndex);\n Data d = dataList.get(dataList.size() - 1);\n // set the last commit variable to unavailable to read\n d.setAccess(false);\n // set the unavailable time for the variable which is the time it fails\n // When a particular version of variable is unavailable, it will never\n // become available, but we may have new version of variable\n d.setUnavailableTime(_lastFailTime);\n }\n }\n }", "@Override\n\tpublic void doReload() throws BusinessException, Exception {\n\t\t\n\t}", "private void ensureChangesAllowed() {\n if (lifecycle.started() == false) {\n throw new IllegalStateException(\"Can't make changes to indices service, node is closed\");\n }\n }", "@Override\n protected boolean continueOnWriteError() {\n return true;\n }", "void onFetchDataError(Throwable e);", "@Test\n public void invalidTableEgress() throws InterruptedException {\n for (int i = 100; i < 110; ++i) {\n this.sfcOfRendererDataListener.onDataTreeChanged(createSfcOfRendererConfig(100, i));\n Thread.sleep(SLEEP); // otherwise the failure is not detected\n verifySettersNotCalled();\n }\n }", "@Override\n public void onErrorResponse(ERTRestApi\n .ERTRestApiError error) {\n ContentValues contentValues = new\n ContentValues();\n contentValues.put(ReportEntry\n .COLUMN_IS_DELETED, \"false\");\n getContext().getContentResolver().update(\n ReportEntry\n .buildReportUriNoNetworkSync\n (reportId),\n contentValues,\n null,\n null\n );\n\n Log.e(LOG_TAG, error.getMessage());\n }", "public void checkError() throws IOException{\n if (transactionFailure == null) {\n FacesContext.getCurrentInstance().getExternalContext().\n redirect(\"converter.xhtml\");\n }\n }", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for proj1\n }", "@Override\n public void abortTx() {\n \tfor (VBox vbox : overwrittenAncestorWriteSet) {\n \t // revert the in-place entry that had overwritten\n \t vbox.inplace = vbox.inplace.next;\n \t}\n \n this.orec.version = OwnershipRecord.ABORTED;\n for (OwnershipRecord mergedLinear : linearNestedOrecs) {\n mergedLinear.version = OwnershipRecord.ABORTED;\n }\n \tfor (ParallelNestedTransaction mergedTx : mergedTxs) {\n \t mergedTx.orec.version = OwnershipRecord.ABORTED;\n \t}\n \t\n\t// give the read set arrays, which were used exclusively by this nested or its children, back to the thread pool\n\tCons<VBox[]> parentArrays = this.getRWParent().bodiesRead;\n\tCons<VBox[]> myArrays = this.bodiesRead;\n\twhile (myArrays != parentArrays) {\n\t returnToPool(myArrays.first());\n\t myArrays = myArrays.rest();\n\t}\n\t\n \tbodiesRead = null;\n \tboxesWritten = null;\n \tboxesWrittenInPlace = null;\n \tperTxValues = null;\n \toverwrittenAncestorWriteSet = null;\n \tmergedTxs = null;\n \tlinearNestedOrecs = null;\n \tcurrent.set(this.getParent());\n }", "@Override\r\n\tpublic void validateUpdate() throws Exception {\n\r\n\t}", "void tryWriteLockInOMRequest() throws IOException;", "protected void handleMultipleRowsFound()\r\n/* 44: */ throws DataAccessException\r\n/* 45: */ {\r\n/* 46:103 */ throw new IncorrectResultSizeDataAccessException(\r\n/* 47:104 */ \"LobStreamingResultSetExtractor found multiple rows in database\", 1);\r\n/* 48: */ }", "@Test(expected = DataAcessException.class)\n\t public void testUpdateExcep() throws DataAcessException{\n\t\tUsers user = BaseData.getUsers();\n\t\twhen(entityManager.merge(user)).thenThrow(new RuntimeException());\n\t\tuserDao.update(user);\n\t }", "@Override\n\t\t\tpublic void onFail() {\n\t\t\t\tcallBack.onCheckUpdate(-1, null); // 检查出错\n\t\t\t}", "public void pendingRecordFailed() {\n pendingRecordFailed(0);\n }", "@Test(expected = DataAcessException.class)\n\t public void testUpdateAllExcep() throws DataAcessException{\n\t\tUsers user = BaseData.getUsers();\n\t\twhen(entityManager.merge(user)).thenThrow(new RuntimeException());\n\t\t List<Users> users = new ArrayList<Users>();\n\t\t users.add( BaseData.getUsers());\n\t\t\tusers.add(BaseData.getDBUsers());\n\t\tuserDao.update(users);\n\t }", "@Override\n public void onError(DatabaseError e) {\n }", "@Override\n public void onRead() {\n /*\n * It should be an error that the remote send something before we\n * pre-write.\n */\n throw new IllegalStateException();\n }", "public void canelDataUpdate() {\n dataModel.cancelDataLoading();\n }", "void loadWeather() {\n\n // existing station's weather records are never updated.\n // why not?????\n\n// if (!\"\".equals(stationId) && !stationIgnore) {\n if (!stationExists && !weather.isNullRecord()) {\n\n if (!weatherIsLoaded) {\n\n // is there a weather record?\n// int count = weather.getRecCnt(\n// MrnWeather.STATION_ID + \"=\" + stationId);\n\n// if (count == 0) {\n\n // insert weather record\n weather.setStationId(stationId);\n if (dbg3) System.out.println(\"<br>loadWeather: put weather = \" + weather);\n try {\n weather.put();\n } catch(Exception e) {\n System.err.println(\"loadWeather: put weather = \" + weather);\n System.err.println(\"loadWeather: put sql = \" + weather.getInsStr());\n e.printStackTrace();\n } // try-catch\n\n weatherCount++;\n\n// } else {\n//\n// // update weather record\n// MrnWeather whereWeather = new MrnWeather(stationId);\n// whereWeather.upd(weather);\n//\n// } // if (weatherRecordCount == 0)\n//\n weatherIsLoaded = true;\n } // if (!weather.isNullRecord())\n\n } // if (!stationExists && !weather.isNullRecord())\n// } // if (!\"\".equals(stationId) && !stationIgnore)\n\n weather = new MrnWeather();\n\n }", "@Test\n\t@Transactional\n\t@DirtiesContext\n\tpublic void testInvalidRestore() throws Exception {\n\n\t\tgetAsItemStream(reader).open(executionContext);\n\t\t\n\t\tFoo foo1 = reader.read();\n\t\tassertEquals(1, foo1.getValue());\n\n\t\tFoo foo2 = reader.read();\n\t\tassertEquals(2, foo2.getValue());\n\n\t\tgetAsItemStream(reader).update(executionContext);\n\t\n\t\tgetAsItemStream(reader).close();\n\n\t\t// create new input source\n\t\treader = createItemReader();\n\t\tgetAsItemStream(reader).open(new ExecutionContext());\n\n\t\tFoo foo = reader.read();\n\t\tassertEquals(1, foo.getValue());\n\n\t\ttry {\n\t\t\tgetAsItemStream(reader).open(executionContext);\n\t\t\tfail();\n\t\t}\n\t\tcatch (Exception ex) {\n\t\t\t// expected\n\t\t}\n\t}", "public void invalidateData() {\n Log.d(TAG, \"mama MessagesListRepository invalidateData \");\n //messagesRepository.setInitialKey(null);\n messagesRepository.invalidateData();\n }", "protected boolean continueOnWriteError() {\n/* 348 */ return true;\n/* */ }", "@Override\n\tpublic void netErrorReLoad() {\n\t\t\n\t}", "@Override\n\tpublic void netErrorReLoad() {\n\t\t\n\t}", "@Override\r\n public void onCancelled(DatabaseError error) {\n Log.w(\"\", \"Failed to read value.\", error.toException());\r\n //showProgress(false);\r\n }", "public void fireBeforeRead(State state, int data_addr) {\n rcount++;\n }", "@Test\n @Transactional\n public void checkStateIsRequired() throws Exception {\n assertThat(transferEventRepository.findAll()).hasSize(0);\n // set the field null\n transferEvent.setState(null);\n\n // Create the TransferEvent, which fails.\n restTransferEventMockMvc.perform(post(\"/api/transferEvents\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(transferEvent)))\n .andExpect(status().isBadRequest());\n\n // Validate the database is still empty\n List<TransferEvent> transferEvents = transferEventRepository.findAll();\n assertThat(transferEvents).hasSize(0);\n }", "private void persistUserDataIfNeeded() throws IOException {\n int amountdatasets = 0;\n for (Transaction t : buffer) {\n amountdatasets += t.getDatasets().size();\n }\n //more than 5 datasets in write buffer --> write committed transactions\n if (amountdatasets >= 5) {\n Set<Transaction> todelete = new HashSet<>();\n\n //only one thread at a time should enter this block\n synchronized (this) {\n// System.out.println(\"thread \" + Thread.currentThread().getId() + \" entered persistUserDataIfNeeded sync block\");\n for (Transaction t : buffer) {\n if (t.isCommitted()) {\n for (UserData data : t.getDatasets()) {\n persistData(data);\n }\n todelete.add(t);\n }\n }\n\n //here the deletion happens. Comment out if Abnahme is n�rgeling... :)\n for (Transaction t : todelete) {\n System.out.println(\"removing transaction \" + t.getId() + \" from buffer\");\n buffer.remove(t);\n }\n// System.out.println(\"thread \" + Thread.currentThread().getId() + \" left persistUserDataIfNeeded sync block\");\n }\n }\n }", "@Test(expectedExceptions = DataAccessException.class)\r\n public void testUpdateWrongDistance() {\r\n ActivityRecord record = setActivityRecord();\r\n recordDao.create(record);\r\n assertNotNull(recordDao.findActivityRecord(record.getId()));\r\n\r\n record.setDistance(-5);\r\n recordDao.update(record);\r\n }", "private void assertNoStaleDataExistInNearCache(IMap<Integer, Integer> map) {\n Map<Integer, Integer> fromNearCache = getAllEntries(map);\n\n // 2. clear Near Cache\n ((NearCachedMapProxyImpl) map).getNearCache().clear();\n\n // 3. get all values when Near Cache is empty, these requests\n // will go directly to underlying IMap because Near Cache is empty\n Map<Integer, Integer> fromIMap = getAllEntries(map);\n\n for (int i = 0; i < ENTRY_COUNT; i++) {\n assertEquals(fromIMap.get(i), fromNearCache.get(i));\n }\n }", "private void onTouched() {\n Record record = recordStore.getRecord(dataKey);\n if (record != null) {\n recordStore.accessRecord(record, Clock.currentTimeMillis());\n }\n }", "public void checkWriteLock() {\n checkNotDeleted();\n super.checkWriteLock();\n }", "@Override\n\t\t\tpublic void onError(int arg0, String arg1) {\n\t\t\t\tLogUtils.i(TAG,\"find failed.\"+arg1);\n\t\t\t\tpageNum--;\n\t\t\t\tsetState(LOADING_FAILED);\n\t\t\t\tmPullRefreshListView.onRefreshComplete();\n\t\t\t}", "private void checkInvalidInformation(EditPlanDirectToManaged editPlanPage) throws Exception {\n //\n Reporter.log(\"Verifying Error Messages on Edit Plan Page\", true);\n editPlanPage.invalidEditPlanUpdate();\n softAssert.assertTrue(editPlanPage.verifyEditPlanErrorMessage());\n\n //Re-Enter correct details\n editPlanPage.updateAnnualHouseHoldincome(Constants.DEFAULT_ANNUAL_HOUSEHOLD_INCOME);\n editPlanPage.updateRetirementAge(Constants.DEFAULT_RETIREMENT_AGE + \"\");\n }", "protected void maybeToReadonlyTransaction() {\n\t\tTransaction.current().toReadonly();\n\t}", "private void loadRules() throws DataNormalizationException {\n\t\tloadRules(TableVersion.COMMITTED);\n\t}", "public void recordChange(int page_number) throws PageNotLoadedException{\n\t\tint index = getPageIndexInArrayList(page_number); \n\t\tif (index == -1)\n\t\t\tthrow new PageNotLoadedException();\n//\t\tBoolean newVal = pages_loaded_is_changed.get(index); \n//\t\tnewVal= new Boolean(true);\n\t\tpages_loaded_is_changed.set(index,new Boolean(true));\n\t}", "@Override\n\t\t\tprotected PaginationResponseData load() {\n\t\t\t\treturn null;\n\n\t\t\t}", "@Override\n\t\t\t\tpublic void onException(Exception e) {\n\t\t\t\t\tLog.d(\"SD_TRACE\", \"load api exception\" + e.toString());\n\t\t\t\t\tmLoadSuccess = false;\n\t\t\t\t}", "private void ensureRowCached(int rowIndex) {\n if(!isRowCached(rowIndex)) {\n //HAVE TO FETCH DATA FROM THE REMOTE STORE\n \n //SET THE toIndex AND fromIndex VARIABLES\n \n //TEST IF THE USER IS DESCENDING THE TABLE\n if (rowIndex >= lastRequiredFetchRowIndex) {\n fromIndex = rowIndex;\n toIndex = rowIndex+chunkSize;\n\t\n\t\t\t\ttry {\n if(toIndex > tableDescription.getRowCount()) {\n toIndex = tableDescription.getRowCount();\n }\n\t\t\t\t}\n\t\t\t\tcatch(Exception ex) {\n\t\t\t\t\tex.printStackTrace();\t\n\t\t\t\t}\n }\n \n //USER IS ASCENDING THE TABLE\n else {\n fromIndex = rowIndex-chunkSize;\n if(fromIndex < 0) {\n fromIndex = 0;\n }\n toIndex = rowIndex+1;\n }\n \n Object[][] rows = null;\n //RETRIEVE THE DATA\n try {\n rows = tableDataSource.retrieveRows(fromIndex, toIndex);\n }\n catch(Exception ex) {\n ex.printStackTrace();\n throw new RuntimeException(\"Problem occurred retrieving table data \\n\");\n }\n \n //ADD THE DATA TO THE CACHE\n for(int i = 0; i < rows.length; i++) {\n //SET THE VALUE IN THE DATA ARRAY\n data[writePositionIndex] = rows[i];\n \n //CREATE AN INDEX TO THE NEW CACHED DATA\n tableIndex = fromIndex+i;\n rowIndexLookup[writePositionIndex] = tableIndex;\n \n //CLOCK UP writePositionIndex AND REZERO IF NECESSARY\n if(writePositionIndex == (maximumCacheSize-1)) {\n writePositionIndex = 0;\n }\n else {\n writePositionIndex++;\n }\n lastRequiredFetchRowIndex = rowIndex;\n }\n }\n }", "@Override\n\t\tpublic void loadError() {\n\t\t}", "@Override\n\t\t\tpublic void onError(Request request, Throwable exception) {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onNetworkError() {\n\n\t\t\t}", "public void onWriteError(Exception ex, Object item) {\n logger.error(\"Encountered error on write\");\n }", "@Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n Log.w(TAG, \"Failed to read value.\" + databaseError.toString());\n }", "@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Oof2\", \"Failed to read value.\", error.toException());\n }", "@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Oof2\", \"Failed to read value.\", error.toException());\n }", "@Test\n @Ignore(\"This is only applicable to Neo4j 2.0.0-M03 and below where transactions \" +\n \"were not mandatory for reading\")\n public void defaultReadingIsReadCommitted() throws Exception {\n assertNameAndAgeViaLookup(john.getId(), \"John\", 34, \"John\");\n\n // Do the update in a separate Thread and ensure its actually updated\n doUpdateInSeparateThread(new PersonUpdater(\"John\", 44));\n\n // Now, back in our thread, ensure we read the commited value\n assertNameAndAgeViaLookup(john.getId(), \"John\", 44, \"John\");\n }", "@Test\n public void testVisitThrowingException() {\n ResetBasicData.reset();\n\n Query<Customer> query = DB.find(Customer.class).setAutoTune(false)\n .fetchQuery(\"contacts\").where().gt(\"id\", 0).order(\"id\")\n .setMaxRows(2).query();\n\n final AtomicInteger counter = new AtomicInteger(0);\n\n assertThrows(IllegalStateException.class, () -> {\n query.findEachWhile(customer -> {\n counter.incrementAndGet();\n if (counter.intValue() > 0) {\n throw new IllegalStateException(\"cause a failure\");\n }\n return true;\n });\n });\n }", "@Override\n public void onCancelled(@NonNull DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }", "public synchronized void flushPages(TransactionId tid) throws IOException {\n // some code goes here\n // not necessary for lab1|lab2\n }", "private void ensureRead() throws IOException, BadDescriptorException {\n if (reading) return;\n flushWrite();\n buffer.clear();\n buffer.flip();\n reading = true;\n }", "public void validate() throws org.apache.thrift.TException {\n if (record != null) {\n record.validate();\n }\n }", "public void validate() throws org.apache.thrift.TException {\n if (record != null) {\n record.validate();\n }\n }", "public void failOnMappingUpdate(Exception cause) {\n assert assertInvariants(ItemProcessingState.WAIT_FOR_MAPPING_UPDATE);\n currentItemState = ItemProcessingState.EXECUTED;\n final DocWriteRequest docWriteRequest = getCurrentItem().request();\n executionResult = new BulkItemResponse(\n getCurrentItem().id(),\n docWriteRequest.opType(),\n // Make sure to use getCurrentItem().index() here, if you use docWriteRequest.index() it will use the\n // concrete index instead of an alias if used!\n new BulkItemResponse.Failure(getCurrentItem().index(), docWriteRequest.id(), cause)\n );\n markAsCompleted(executionResult);\n }", "private void failCheckpointReadLock() throws CheckpointReadLockTimeoutException, IgniteException {\n String msg = \"Checkpoint read lock acquisition has been timed out.\";\n\n IgniteException e = new IgniteException(msg);\n\n if (cctx.kernalContext().failure().process(new FailureContext(SYSTEM_CRITICAL_OPERATION_TIMEOUT, e)))\n throw e;\n\n throw new CheckpointReadLockTimeoutException(msg);\n }", "private void cleanUpConsumedEsnRecords() {\n\t\tesnInfoRepository.findAllByIsConsumed(true).removeIf(item -> (Days\n\t\t\t\t.daysBetween(new DateTime(item.getDateImported()), new DateTime()).isGreaterThan(Days.days(30))));\n\t}", "private void doneUpdate(long transaction) throws RequestIsOutException {\n\t\t\tassert this.lastSentTransaction == null || transaction > this.lastSentTransaction;\n\t\t\t\n\t\t\tthis.sendLock.readLock().unlock();\n\t\t}", "@Override\n public void onCancelled(DatabaseError error) {\n // Failed to read value\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }", "@Override\r\n\tpublic void onError(Object pojo, Method method, Throwable throwable) {\r\n\t\tif (threadLocalEntityManager != null)\r\n\t\t\tthreadLocalEntityManager.rollbackTransaction();\r\n\r\n\t\tlogger.error(\"JPA: TransactionalHandler onError: \", throwable);\r\n\t}", "void checkPermanentStorageData() {\n if (!isAlive()) {\n Log.e(LOG_TAG, \"checkPermanentStorageData : the session is not anymore active\");\n return;\n }\n\n // When the data are extracted from a persistent storage,\n // some fields are not retrieved :\n // They are used to retrieve some data\n // so add the missing links.\n Collection<RoomSummary> summaries = mStore.getSummaries();\n for (RoomSummary summary : summaries) {\n if (null != summary.getLatestRoomState()) {\n summary.getLatestRoomState().setDataHandler(this);\n }\n }\n }", "@Override\n public void onCancelled(DatabaseError error) {\n Log.w(TAG, \"Failed to read value.\", error.toException());\n }", "@Override\n\t\t\t\tpublic void onNetworkError(Request request, IOException e) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void onError(Call call, Exception e, int id) {\n refresh.finishRefresh();\n refresh.finishRefreshLoadMore();\n// processData(string);\n }", "public void checkpoint(boolean hasUncommittedData) throws SQLException;", "@Override\r\n protected final void checkNotPrepared ()\r\n {\r\n if (isPrepared ())\r\n throw new IllegalStateException (\"This object was already prepared and can therefore not be modified: \" +\r\n toString ());\r\n }", "public void undoChanges() {\r\n if (getPageDataStoresStatus() == DataStoreBuffer.STATUS_NOT_MODIFIED)\r\n return;\r\n else\r\n _ds.undoChanges(_ds.getRow());\r\n }", "public static void RomLoadErr(){\n\t\tloadError = true;\t\t\n\t}", "@Override\n protected void onRecordLoaded() {\n mRecordsToLoad -= 1;\n if (DBG) log(\"onRecordLoaded \" + mRecordsToLoad + \" requested: \" + mRecordsRequested);\n\n if (getRecordsLoaded()) {\n onAllRecordsLoaded();\n } else if (getLockedRecordsLoaded() || getNetworkLockedRecordsLoaded()) {\n onLockedAllRecordsLoaded();\n } else if (mRecordsToLoad < 0) {\n loge(\"recordsToLoad <0, programmer error suspected\");\n mRecordsToLoad = 0;\n }\n }", "@Override\n\t\t\tpublic void onNetworkError(Request request, IOException e) {\n\n\t\t\t}", "@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Payments\", \"Failed to read value.\", error.toException());\n }", "@Override\n public void onCancelled(DatabaseError error) {\n Log.w(\"Jinx\", \"Failed to read value.\", error.toException());\n }", "protected boolean afterMerge() throws DBSIOException{return true;}" ]
[ "0.55234975", "0.54882437", "0.53816015", "0.5276027", "0.5225344", "0.51247627", "0.5116413", "0.50001884", "0.49915522", "0.49656743", "0.49419427", "0.493622", "0.49214652", "0.48935637", "0.48932973", "0.4890469", "0.48842958", "0.4867193", "0.48486018", "0.48378116", "0.48319653", "0.4830383", "0.48224413", "0.4821976", "0.48156282", "0.48083577", "0.48056066", "0.47888884", "0.47778624", "0.47756436", "0.47389543", "0.47250843", "0.47247458", "0.46954024", "0.4689592", "0.4683053", "0.4679169", "0.46785232", "0.46768418", "0.46714965", "0.46657413", "0.46654406", "0.46622923", "0.4657808", "0.46569514", "0.46557793", "0.46489528", "0.46407217", "0.46340308", "0.46276852", "0.46168348", "0.46168348", "0.46029955", "0.4596306", "0.45938894", "0.4592271", "0.45875382", "0.45855018", "0.45769894", "0.4575858", "0.45724085", "0.45675725", "0.4561223", "0.4549169", "0.454684", "0.4512154", "0.45008218", "0.44879207", "0.44838303", "0.4483375", "0.44825882", "0.44796163", "0.44753173", "0.4473267", "0.4473267", "0.44729546", "0.44722468", "0.44693637", "0.44624943", "0.44595036", "0.4455592", "0.4455592", "0.4447423", "0.44435778", "0.44389355", "0.44375062", "0.44369903", "0.44314882", "0.44313657", "0.44264612", "0.44251037", "0.4421603", "0.4417621", "0.44174334", "0.441591", "0.44153553", "0.44139886", "0.44128352", "0.44124016", "0.44095773", "0.44028375" ]
0.0
-1
reset list to allow for new 'load' call
void reset();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadLists() {\n }", "private void loadLists() {\n loadSavedCourses();\n loadSavedSchedules();\n }", "public void reset() {\n this.list.clear();\n }", "public void reset() {\n //mLoader.reset();\n start();\n }", "@Override \n\t protected void onReset() {\n\t super.onReset();\n\n\t // Ensure the loader is stopped\n\t onStopLoading();\n\t \n\t mChildList = null;\n\t }", "@Override \n\t protected void onReset() {\n\t super.onReset();\n\n\t // Ensure the loader is stopped\n\t onStopLoading();\n\t \n\t mChildList = null;\n\t }", "private void restList() {\n for (Processus tmp : listOfProcess) {\n tmp.resetProcess();\n }\n }", "private void refreshList() {\n if (loadStepsTask != null) {\n loadStepsTask.cancel(false);\n }\n loadStepsTask = new LoadStepsTask(this, dbManager);\n loadStepsTask.execute();\n }", "@Override\n public void onLoaderReset(Loader<List<Link>> loader) {\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<Movie>> loader) {\n }", "public void loadAllLists(){\n }", "public void Reset()\n {\n this.list1.clear();\n }", "public void reload(){\n populateList();\n }", "public void reset() {\n cancelTaskLoadOIFits();\n\n userCollection = new OiDataCollection();\n oiFitsCollection = new OIFitsCollection();\n oiFitsCollectionFile = null;\n selectedDataPointer = null;\n\n fireOIFitsCollectionChanged();\n }", "private void reset() {\n\t\tfiles = new HashMap<>();\n\t\tparams = new HashMap<>();\n\t}", "@Generated(hash = 15234777)\n public synchronized void resetImageList() {\n imageList = null;\n }", "public static void restoreList() {\n\n if (copyList.isEmpty())\n return;\n\n\n getList().clear();\n\n for (Map<String, ?> item : copyList) {\n getList().add(item);\n }\n\n copyList.clear();\n //Log.d(\"test\", \"After restore: Champlist size \" + getSize() + \" copylist size \" + copyList.size());\n\n }", "private void loadData() {\n this.financeDataList = new ArrayList<>();\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<Book>> loader) {\n adapter.clear();\n Log.i(LOG_TAG,\"onLoaderReset\");\n }", "@Override\n\tpublic void refreshData(){\n\t\tpageNum = 1;\n\t\tlist.clear();\n\t\tloadData();\n\t}", "public static void reset() {\n\t\tCAUGHT.clear();\n\t\tLOAD_CACHE.clear();\n\t}", "public void clear(){\n\n \tlist = new ArrayList();\n\n }", "private void initList() {\n long now = System.nanoTime();\n loadConfig();\n SlogEx.d(TAG, \"load config use:\" + (System.nanoTime() - now));\n }", "protected synchronized void clearURLLoader() {\r\n currentLoader = null;\r\n }", "public void unload(){ \n load.unloadFirst(); \n }", "public void loadList () {\r\n ArrayList<String> list = fileManager.loadWordList();\r\n if (list != null) {\r\n for (String s : list) {\r\n addWord(s);\r\n }\r\n }\r\n }", "public void reset() {\n initEntries();\n }", "@Override\n public void onLoaderReset(Loader<List<Pokemon>> loader) {\n mAdapter.clear();\n }", "public void reiniciarLista(){\n lista_inicializada = false;\n }", "public synchronized void resetArticlePhotoList() {\n articlePhotoList = null;\n }", "@Override\r\n\tpublic void reload() {\n\t\tallcode.clear();\r\n\t\tinit();\r\n\t}", "@Override\n public void clear() {\n isLoaded = false;\n }", "public void reload()\r\n\t{\r\n\t\tmEntities.clear();\r\n\t\tmParticles.clear();\r\n\t\tStats.instance().setBananaLevel();\r\n\t\tloadBlocks();\r\n\t}", "@Override\n public void onLoaderReset(Loader<List<Book>> loader) {\n mAdapter.clear();\n }", "private void clearLists() {\n\t\tobjects = new ArrayList<Entity>();\n\t\tenemies.clear();\n\t\titemList.clear();\n\t}", "private void initList() {\n\n }", "public void unloaded(){\n\t\tloaded=false;\n\t}", "public synchronized void resetCollections() {\n collections = null;\n }", "public void loadList(String name){\n }", "@Override\n\tpublic void onLoaderReset(Loader<Cursor> loader) {\n\t\tsetListAdapter(null);\n\t}", "public void onLoaderReset(Loader<List<Book>> loader) {\n mAdapter.clear();\n }", "public static void reset()\n\t\t{\n\t\t\tfeatureSet = new THashMap();\n\t\t\tfeatureIds = new TObjectIntHashMap();\n\t\t\tnextID = 1;\t\t\t\n\t\t}", "@Override\n public void onLoaderReset(Loader<List<StockPicking>> loader) {\n mAdapter.clear();\n }", "@Override\n public void onLoaderReset(Loader<ArrayList<Reviews>> loader) {\n\n }", "public static void load() {\n load(false);\n }", "@Override\r\n\t\tpublic void onLoaderReset(android.content.Loader<List<User>> arg0) {\n\t\t\t\r\n\t\t}", "public void clear() {\n\t\tlists.clear();\n\t}", "public synchronized void resetOrdenDBList() {\n ordenDBList = null;\n }", "private void clearLists() {\r\n if (memoryLists == null) return;\r\n\r\n for (int i = 0; i < this.memoryLists.length; i++) {\r\n this.lastChanged[i] = -1;\r\n\r\n // clear list\r\n memoryLists[i].setModel(new DefaultListModel());\r\n }\r\n\r\n this.memoryBlocks = null;\r\n this.memoryLists = null;\r\n }", "@Override\n public void onLoaderReset(Loader<List<EarthQuake>> loader) {\n mAdapter.clear();\n }", "public void reset() {\n next = 0;\n renderList.clear();\n viewList.clear();\n }", "public void reset() {\n aCollection = this.asciiMathLibraryBlock.getOwnedElement().stream().filter(e -> e instanceof NamedElement).collect(Collectors.toList());\n cCollection = this.customFuncBlock.getOwnedElement().stream().filter(e -> e instanceof NamedElement).collect(Collectors.toList());\n }", "public void clearInitialize(){\n index=0;\n for(int i =0; i < list.length;i++){\n list[i]=0;\n }\n hasFilled = false;\n\n }", "public void reset() {\r\n\t\t//begin\r\n\t\tproducerList.clear();\r\n\t\tretailerList.clear();\r\n\t\tBroker.resetLists();\r\n\t\t//end\r\n\t}", "@Override\n\tpublic void onLoaderReset(Loader<List<NewsEntry>> arg0)\n\t{\n\t\t\n\t}", "public synchronized static void resetCache() {\n prefixes = null;\n jsonldContext = null;\n }", "public void initialize()\r\n {\n \t\tSystem.out.println(\"*** Initializing asserted list ...\");\r\n \t\treload();\r\n \t\tSystem.out.println(\"*** ... List loaded\");\r\n }", "@Override\r\n\tpublic void load() {\n\t\ts.load();\r\n\r\n\t}", "@Override\n public void onLoaderReset(@NonNull Loader<List<newslist>> loader) {\n mAdapter.clear();\n }", "public void reset() {\n \titems.clear();\n \tsetProcessCount(0);\n }", "@Override\r\n public void onLoaderReset(Loader<List<NewsList>> loader) {\n adapter.clear();\r\n }", "@Override\n public void clear() {\n loadedClasses.clear();\n }", "@Override\n public void onLoaderReset(Loader<Cursor> loader) {\n mSubredditsAdapter.swapCursor(null);\n }", "private void reset() {\n\t\tdata.clear();\n\t}", "@Override\n public void onLoaderReset(Loader<ArrayList<NewsItem>> loader) {\n newsAdapter.clear();\n }", "public void clear() {\n this.layers.clear();\n list.clear();\n }", "public void initial_list_original(){\n \tFile file = new File(original_directory_conf);\n \tif(file.exists()){\n \t\tArrayList<String> original_directory_list = new ArrayList<String>();\n original_directory_list = read_from_file.readFromFile(original_directory_conf);\n for(int i = 0; i < original_directory_list.size(); i++){\n \tdefault_list_model1.addElement(original_directory_list.get(i));\n }\n list_original.setModel(default_list_model1);\n scroll_pane.repaint();\n \t}else{\n \t\treturn;\n \t}\n \t\n }", "public static void reset() {\n Set<Map.Entry<Class<?>, DatabaseDefinition>> entrySet = globalDatabaseHolder.databaseClassLookupMap.entrySet();\n for (Map.Entry<Class<?>, DatabaseDefinition> value : entrySet) {\n value.getValue().reset(getContext());\n }\n globalDatabaseHolder.reset();\n loadedModules.clear();\n }", "void clear() {\n\t\t// Initialize new empty list, clearing out old data\n\t\tmNewsList = new ArrayList<>();\n\t}", "void loadAll() {\n\t\tsynchronized (this) {\n\t\t\tif (isFullyLoaded) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (Entry<Integer, Supplier<ChunkMeta<?>>> generator : ChunkMetaFactory.getInstance()\n\t\t\t\t\t.getEmptyChunkFunctions()) {\n\t\t\t\tChunkMeta<?> chunk = generator.getValue().get();\n\t\t\t\tchunk.setChunkCoord(this);\n\t\t\t\tchunk.setPluginID(generator.getKey());\n\t\t\t\ttry {\n\t\t\t\t\tchunk.populate();\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// need to catch everything here, otherwise we block the main thread forever\n\t\t\t\t\t// once it tries to read this\n\t\t\t\t\tCivModCorePlugin.getInstance().getLogger().log(Level.SEVERE, \n\t\t\t\t\t\t\t\"Failed to load chunk data\", e);\n\t\t\t\t}\n\t\t\t\taddChunkMeta(chunk);\n\t\t\t}\n\t\t\tisFullyLoaded = true;\n\t\t\tthis.notifyAll();\n\t\t}\n\t}", "public void reInit() {\n balls.clear();\n for (Ball b: ballsInit) {\n balls.add(new Ball(b));\n }\n }", "public void reset()\r\n {\n if_list.removeAllElements();\r\n ls_db.reset();\r\n spf_root = null;\r\n vertex_list.removeAllElements();\r\n router_lsa_self = null;\r\n floodLastTime = Double.NaN;\r\n delayFlood = false;\r\n spf_calculation = 0;\r\n lsa_refresh_timer = null;\r\n }", "private void freshTheData() {\n mData.clear();\n mData.addAll(mDataOrg);\n }", "void reset() {\n blocks.clear();\n }", "public void load() {\n\t}", "public List<String> load();", "public void resetxlsxDataList() {\n this.xlsxDataList.clear();\n }", "private void reload() {\n if (running == false) {\n agentsOnSpawn = new String[][]{{\"random\", \"random\", \"random\"}, {\"random\", \"random\", \"random\"}, {\"random\", \"random\", \"random\"}};\n PlayerPanel.reset();\n playersAgentsMap.clear();\n agentList.clear();\n playerCount = 0;\n playerList.removeAll();\n iPlayerList.entrySet().forEach((pair) -> {\n IPlayer player = pair.getValue();\n try {\n player.setPoints(0);\n player.resetStrategy();\n addNewAgent(player, player.getStrategy());\n } catch (RemoteException ex) {\n Logger.getLogger(ServerFrame.class.getName()).log(Level.SEVERE, null, ex);\n }\n });\n\n }\n\n }", "public static void resetActiveDataFiles() {\n\t\tmDataFiles = new ArrayList<String>();\n\t\tmNumDataFiles = 0;\n\t\tsetNumDataFiles(mNumDataFiles);\n\t}", "@Override\n public void refreshList() {\n }", "public void resetAll() {\n reset(getAll());\n }", "protected void clear() {\n\n\t\tthis.myRRList.clear();\n\t}", "public void reload() {\n reload(true);\n reload(false);\n }", "public void clear() {\n\t\tstringList = null;\n\t}", "@Override\n public void reset() throws IOException {\n lemmaListIndex = 0;\n lemmaList = Collections.emptyList();\n tagsList.clear();\n super.reset();\n }", "public void reset() {\n\t\tfor (int i = 0; i < stats.size(); i++) {\n\t\t\tstats.get(i).reset();\n\t\t}\n\t}", "public void reset() {\n _valueLoaded = false;\n _value = null;\n }", "protected void reset()\n {\n this.shapeDataCache.removeAllEntries();\n this.sector = null;\n }", "@Override\r\n public void onLoaderReset(Loader<List<News>> loader) {\n mAdapter.clear();\r\n }", "public static void loadAllAdditionalCachedObjectList() {\n\n\t\t// TODO Completar cuando sea necesario.\n\n\t}", "private void initializeLists() {\n this.sensorsPm10 = new ArrayList<>();\n this.sensorsTempHumid = new ArrayList<>();\n }", "@Override\n public void clear() {\n initialize();\n }", "void reinitialize() {\n super.reinitialize();\n head = tail = null;\n }", "public void reload(){\n\t\tplugin_configuration.load();\n\t\tflarf_configuration.load();\n\t\tmessages_configuration.load();\n\t\tstadiumlisting.load();\n\t}", "@Override\r\n\tpublic void onLoaderReset(Loader<Cursor> mLoader) {\n\t\t\r\n\t}", "@Override public void onLoaderReset(Loader<Cursor> loader) {\n\t\t}", "@Override\n\tpublic void onLoaderReset(Loader<Cursor> loader) {\n\n\t}", "@Override\n public void resetFilteredLists() {\n\n }", "private void loadList() {\n new MyAsyncTask(this, username, mainUsername, authHead, pageType,\n userList, view).execute(\"\");\n this.swipeContainer.setRefreshing(false);\n }", "@Override\n\tpublic List<Item> loadItems(int start, int count) {\n\t\treturn null;\n\t}", "protected void reload() {\n runnables.values().stream()\n .filter(Objects::nonNull) //idk how it can be null, but better be prepared\n .map(BungeeF3Runnable::getTask)\n .filter(Objects::nonNull) //fix for NullPointer\n .forEach(ScheduledTask::cancel);\n\n runnables.clear();\n players.clear();\n hookedServers.clear();\n\n checkServers();\n\n try {\n parser = new BungeeConfigParser(this);\n } catch (IOException ex) {\n logger.error(\"Failed to load config file!\", ex);\n return;\n }\n if (!parser.isOnlyAPI()) {\n startRunnables();\n }\n\n if (isHooked(\"LP\")) {\n lpHook = new LuckPermsHook(parser.getF3GroupList());\n }\n }" ]
[ "0.73393893", "0.68796676", "0.67387843", "0.6704811", "0.66749257", "0.66749257", "0.6665834", "0.6632815", "0.65794927", "0.6532871", "0.65315986", "0.65259904", "0.6522073", "0.6518342", "0.6513067", "0.65067464", "0.65042406", "0.6497166", "0.6450048", "0.6449635", "0.64419293", "0.64356923", "0.6426235", "0.6343452", "0.6336912", "0.63158697", "0.63101286", "0.6294663", "0.628873", "0.6283076", "0.6281882", "0.62793285", "0.6278053", "0.6277858", "0.62658364", "0.6256093", "0.62513644", "0.6244855", "0.6241258", "0.62104416", "0.6209884", "0.620023", "0.61983424", "0.61915123", "0.6184312", "0.6179266", "0.617866", "0.61751103", "0.61651087", "0.6164335", "0.6164328", "0.6162414", "0.6157505", "0.61495286", "0.61467487", "0.6141738", "0.61268866", "0.61186314", "0.6118503", "0.61184496", "0.6116562", "0.6115897", "0.611183", "0.6107897", "0.6099063", "0.6093837", "0.6089557", "0.60875016", "0.60804236", "0.60789883", "0.60632974", "0.6052286", "0.6047602", "0.60438263", "0.6043331", "0.60417986", "0.6038335", "0.6037284", "0.60191673", "0.6014118", "0.6006952", "0.6003731", "0.60017985", "0.5995901", "0.59937555", "0.5990085", "0.5981021", "0.5979958", "0.5978335", "0.59753203", "0.5973999", "0.5973326", "0.59732246", "0.596662", "0.5958067", "0.5956523", "0.5952478", "0.59509367", "0.5944778", "0.5941908", "0.5937985" ]
0.0
-1
call to release reader resources
void destroy();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void closeResources() {\n try {\n if (inputStream != null) {\n inputStream.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n try {\n if (inputStreamReader != null) {\n inputStreamReader.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n try {\n if (reader != null) {\n reader.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n try {\n if (writer != null) {\n writer.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n try {\n if (outputStream != null) {\n outputStream.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n try {\n if (outputStreamWriter != null) {\n outputStreamWriter.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n try {\n if (writer != null) {\n writer.close();\n }\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n\n }", "public void releaseResources();", "public void release() throws IOException;", "protected final void close()\n {\n try {\n _reader.close();\n _reader = null;\n } catch ( IOException except ) { }\n }", "@Override\n public void close() {\n \ttry {\n \t\tif(reader != null) {\n \t\t\treader.close();\n \t\t}\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "public void release()\r\n throws IOException\r\n {\r\n // nothing needs to be done\r\n }", "public static void cleanResources() {\n\t\tscanner.close();\n\t\treturn;\n\t}", "@Override\n\tpublic void releaseResouces() {\n\t\tsuper.releaseResouces();\n\t}", "public void releaseReadLock() {\r\n return;\r\n }", "private void cleanup(InputStream in) {\n try {\n if (reader != null)\n reader.close();\n if (in != null)\n in.close();\n reader = null;\n }\n catch (Exception ex) {\n // ignore!\n }\n }", "public void close() throws IOException {\r\n reader.close();\r\n reader = null;\r\n }", "@Override\n\tpublic void releaseAllResources() {\n\t}", "@Override\n public void releaseResources() {\n if (cluster != null) {\n cluster.close();\n }\n if (cpds != null) {\n cpds.close();\n }\n }", "public static void close( Reader reader )\n {\n if ( reader != null )\n {\n try\n {\n reader.close();\n }\n catch ( IOException e )\n {\n log.error( \"Error closing reader: \" + reader, e );\n }\n }\n }", "void releaseReadLock();", "@Override\n public void release() {\n }", "public void release()\n \t{\n \t\tif( iterator == null )\n \t\t{\n \t\t\tindex = new SpatialIndex();\n \t\t\tedgeAllocator = 0;\n \t\t\tmergeOps = null;\n \t\t\t\n \t\t\tSystem.gc();\n \t\t}\n \t}", "public void release() {\n }", "public void destroyAllResource() {\r\n\t\ttry {\r\n\t\t\tif(outrs != null){\r\n\t\t\t\toutrs.close();\r\n\t\t\t\toutrs=null;\r\n\t\t\t}\r\n\t\t\tif(outstmt != null ){\r\n\t\t\t\toutstmt.close();\r\n\t\t\t\toutstmt=null;\r\n\t\t\t} \r\n\t\t\tif (dbConnection != null){\r\n\t\t\t\tdbConnection.close();\r\n\t\t\t\tdbConnection=null;\r\n\t\t\t} \r\n\t\t}catch (SQLException ex) {\r\n\t\t}\r\n\t}", "private void close() {\n try {\n if (reader != null) {\n this.reader.close();\n }\n if (writer != null) {\n this.writer.close();\n }\n }\n catch (IOException e) {\n log.error(e);\n log.debug(Constants.STREAM_IS_CLOSED);\n }\n }", "@SuppressWarnings(\"unused\")\n\t\t\tprivate void dispose() {\n\t\t\t\t\n\t\t\t}", "public void release() {\r\n return;\r\n }", "@Override\n public void release() {\n output = null;\n super.release();\n }", "public static void release() {\n\t}", "public void release() throws JenaProviderException {\t\t\n\t}", "@Override\n public void release() {\n \n }", "private void releaseResources() {\n\t\tstopForeground(true);\n\t\taudioManager.unregisterRemoteControlClient(remoteControlClient);\n\t\taudioManager.unregisterMediaButtonEventReceiver(remoteReceiver);\n\t\t\n\t\tif (mediaPlayer != null){\n\t\t\tmediaPlayer.reset();\n\t\t\tmediaPlayer.release();\n\t\t\tmediaPlayer = null;\n\t\t}\n\t\t\n\t\tif (wifiLock.isHeld()) {\n\t\t\twifiLock.release();\n\t\t}\n\t}", "@Override\n public void release() {\n }", "public void release() {\n\t\t\n\t}", "public void finalize() {\r\n byteBuffer2 = null;\r\n byteBuffer4 = null;\r\n byteBuffer8 = null;\r\n progressBar = null;\r\n tagBuffer = null;\r\n\r\n if (raFile != null) {\r\n\r\n try {\r\n raFile.close();\r\n } catch (final IOException ioe) {\r\n // Do nothing\r\n }\r\n }\r\n\r\n raFile = null;\r\n }", "@Override\n public void cleanup() {\n if (this.inputStream != null) {\n try {\n this.inputStream.close();\n }\n catch (IOException var1_1) {}\n }\n this.defaultFetcher.cleanup();\n }", "@Override\n public void release() {\n super.release();\n init();\n }", "@Override\r\n\tpublic void release()\r\n\t{\n\t}", "protected void releaseReferences() {\r\n\r\n\t}", "protected void tearDown() throws Exception {\n _reader.close();\n }", "public void release() {\n }", "protected abstract void disposeResources();", "public void release();", "public void release();", "public void release() {\n if (this.compositeDisposable != null) {\n this.compositeDisposable.clear();\n }\n }", "public void release() {\n\t\tsuper.release();\r\n\t\tinnerContent = null;\r\n\t\tlabelHead = null;\r\n\t\tscroll = null;\r\n\t}", "protected void release()\n {\n }", "private void releaseResources(LogbookEntry data) {\n\n if (this.database != null && this.database.isOpen()){\n this.database.close();\n }\n if (this.databaseSchemaHelper != null) {\n this.databaseSchemaHelper.close();\n }\n }", "@Override\n\tpublic void release() {\n\t}", "public void finalize() {\n acquire.release();\n }", "public void finalize() {\n acquire.release();\n }", "@Override\n protected void doClose() {\n FileUtil.closeSilent(this.in);\n this.recordFactory = null;\n this.geometryFactory = null;\n this.in = null;\n this.recordDefinition = null;\n this.resource = null;\n }", "@Override\r\n\tpublic void release() {\n\r\n\t}", "@Override\n\tpublic void release() {\n\t\t\n\t}", "@Override\n\tpublic void release() {\n\n\t}", "@Override\n\tpublic void release() {\n\n\t}", "public void close() throws IOException {\n reader.close();\n }", "public void close() {\n\t\tif (taxonomyAccessor != null && taxonomyWriter != null) {\n\t\t\ttaxonomyAccessor.release(taxonomyWriter);\n\t\t}\n\t}", "void _release();", "protected void cleanup() {\n try {\n if (_in != null) {\n _in.close();\n _in = null;\n }\n if (_out != null) {\n _out.close();\n _out = null;\n }\n if (_socket != null) {\n _socket.close();\n _socket = null;\n }\n } catch (java.io.IOException e) {\n }\n }", "public void release()\r\n\t{\r\n\t\tsuper.release();\r\n\t\t_href = null;\r\n\t\t_box = null;\r\n\t\t_bracket = null;\r\n\t\t_bracketFont = null;\r\n\r\n\t}", "public void disposeResources()\n {\n for (Disposable disposable : this.disposableObjects) {\n disposable.dispose();\n }\n }", "public void release() {\n\n mTextureRender = null;\n mSurfaceTexture = null;\n }", "public void release() {\r\n pageEL = null;\r\n params = null;\r\n super.release();\r\n }", "@Override\n protected final void deallocate() {\n ByteBuf wrapped = unwrap();\n recyclerHandle.recycle(this);\n wrapped.release();\n }", "void dispose() {}", "public void release()\n {\n \n release_0(nativeObj);\n \n return;\n }", "@Override\n public void close()\n {\n synchronized (this) {\n if (closed) {\n return;\n }\n closed = true;\n }\n\n readers.forEach(ExchangeStorageReader::close);\n }", "private void dispose() {\n\n\t}", "public void release() { \r\n\t remoteControlClient = null;\r\n\t }", "public void dispose() {\r\n\t\tclose();\r\n\t}", "public\n void close() throws ResourceException;", "@Override\n public void dispose(){\n if(handle <= 0) return;\n free(handle);\n handle = 0;\n }", "public final void release() { \n native_release();\n }", "public void deallocate() {\n\tsetLoaded(false);\n\n if (!externalAudioPlayer) {\n if (audioPlayer != null) {\n audioPlayer.close();\n audioPlayer = null;\n }\n }\n \n\tif (!externalOutputQueue) {\n\t outputQueue.close();\n\t}\n }", "protected synchronized void cleanup() {\n frameStorage.clear();\n if (frameIterator != null) {\n try {\n frameIterator.close();\n } catch (IOException ex) {\n logger.error(Thread.currentThread().getName() + \" IOException while closing the mediaReader\", ex);\n }\n }\n status = Status.STOPPED;\n frameIterator = null;\n }", "public void release()\n\t{\n\t\t// System.out.println(usedBy.getName() + \": Releasing \" + toString());\n\t\tthis.usedBy = null;\n\t}", "public void dispose() {\n processDispose(false);\n }", "void release();", "void release();", "public void closeReader() throws IOException{\n if(isOpen){\n csvReader.close();\n }\n\n }", "public void removeResources() {\n\t\tresources.clear();\n\t}", "@Override\n public void cleanup() throws Exception {\n outputStream.close();\n }", "public void release() throws SQLException\r\n\t{\r\n\t\tst.close();\r\n\t}", "@Override\n public void destroy() {\n if (fileWriter != null) {\n try {\n fileWriter.close();\n } catch (IOException e) {\n }\n }\n }", "public void dispose() {\n\t\t\r\n\t}", "public void dispose() {\n\t\t\r\n\t}", "public void dispose() {\n\t\t\r\n\t}", "void drain() {\n if (stdOutReader != null) {\n stdOutReader.drain();\n }\n if (stdErrReader != null) {\n stdErrReader.drain();\n }\n }", "public void cleanup() {\n this.close();\n this.delete(this.backingFileBasename + RECORDING_OUTPUT_STREAM_SUFFIX);\n this.delete(this.backingFileBasename + RECORDING_INPUT_STREAM_SUFFIX);\n }", "public void dispose() ;", "public void dispose() {\n\t\t\t\r\n\t\t}", "public void close() {\n\t\tgetter().close();\r\n\t}", "@Override\n\t\tpublic void dispose() {\n\t\t \n\t\t}", "public void dispose()\n\t{\n\t\tthis.accessor.dispose();\n\t\tthis.env.close();\n\t}", "protected void onReleaseResources(D data) {\n // For a simple List<> there is nothing to do. For something\n // like a Cursor, we would close it here.\n }", "@Override\n public boolean release(ResourceConsumer consumer) {\n return false;\n }", "final void release() {\n mem.release();\n }", "public void close () {\n\t\tif (this.container!=null)\n\t\t\ttry {\n\t\t\t\tcontainer.close();\n\t\t\t\tcontainer = null;\n\t\t\t\tmetaData.seek(0);\n\t\t\t\tmetaData.writeInt(blockSize);\n\t\t\t\tmetaData.writeInt(size);\n\t\t\t\tmetaData.close();\n\t\t\t\treservedBitMap.close();\n\t\t\t\tupdatedBitMap.close();\n\t\t\t\tfreeList.close();\n\t\t\t}\n\t\t\tcatch (IOException ie) {\n\t\t\t\tthrow new WrappingRuntimeException(ie);\n\t\t\t}\n\t}", "@Override\n public void dispose() {\n file = null;\n }", "public void free() {\n if (relRootCM.isOpen())\n relRootCM.close();\n if (relReachableCM.isOpen())\n relReachableCM.close();\n if (relCICM.isOpen())\n relCICM.close();\n if (relCMCM.isOpen())\n relCMCM.close();\n }", "public void release() {\r\n super.release();\r\n this.page = null;\r\n }", "@Override public void close() throws IOException {\r\n\t\tif (closed) return;\r\n\t\tfor (Reader reader: readerQueue) {\r\n\t\t\treader.close();\r\n\t\t}\r\n\t\tclosed = true;\r\n\t}", "public void releaseOCR(){\n \tif(baseApi != null){ baseApi.end(); baseApi = null; } \n\t\tmState = State.UNINITIALIZED;\n }", "private void cleanup() {\n if (mPosterBytes != null) {\n try {\n mPosterBytes.close();\n } catch (IOException ignored) {\n // Ignored.\n } finally {\n mPosterBytes = null;\n }\n }\n }", "private void release() {\n noxItemCatalog.release();\n noxItemCatalog.deleteObserver(catalogObserver);\n }" ]
[ "0.7470349", "0.74378604", "0.7259103", "0.72487825", "0.7147514", "0.7054441", "0.7006282", "0.6898385", "0.6836268", "0.67971617", "0.6796081", "0.6757825", "0.67243546", "0.67110044", "0.67076945", "0.66747475", "0.6648764", "0.6646533", "0.6641031", "0.6632692", "0.6612809", "0.66117704", "0.6609991", "0.65839183", "0.65593445", "0.6533941", "0.65330356", "0.6530907", "0.6521675", "0.65201676", "0.651884", "0.6516373", "0.65123886", "0.65121055", "0.6509517", "0.64952165", "0.64903504", "0.64814216", "0.64814216", "0.64801234", "0.6471864", "0.6461674", "0.6449239", "0.6428242", "0.6427562", "0.6427562", "0.6421758", "0.6415107", "0.6398234", "0.6381993", "0.6381993", "0.63654286", "0.635294", "0.6345941", "0.63411623", "0.6304791", "0.6304413", "0.62992346", "0.6297173", "0.62960553", "0.6277274", "0.62616843", "0.6246899", "0.6231988", "0.6229", "0.6221835", "0.6217627", "0.6186986", "0.61857057", "0.61849385", "0.61810285", "0.61720973", "0.61698866", "0.6169276", "0.6169276", "0.6160714", "0.6156952", "0.6155823", "0.6155028", "0.6152812", "0.6149509", "0.6149509", "0.6149509", "0.6145038", "0.61416614", "0.6132059", "0.6131709", "0.6129372", "0.6128323", "0.612419", "0.6110966", "0.60981345", "0.60972583", "0.6094588", "0.6091", "0.60824233", "0.60806644", "0.6075478", "0.60713404", "0.60699946", "0.6068644" ]
0.0
-1
to integrate w/ AndroidPaging library, create a Pager, after that the ListData object itself should not be used, as Pager will submit it's own requests and a callback.
IPager createPager(PagedList.Config config);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LiveData<PagedList<Response>> pagedList();", "private void pagination(){\n recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {\n @Override\n public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {\n super.onScrollStateChanged(recyclerView, newState);\n }\n\n @Override\n public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {\n super.onScrolled(recyclerView, dx, dy);\n\n if (dy>0){\n LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();\n int lastItem = layoutManager.findLastCompletelyVisibleItemPosition(); //finds last visible item\n int currentTotalCount = layoutManager.getItemCount(); //find total number of displayed items\n\n if (mLoadingItems){\n if (currentTotalCount > previousTotal){\n mLoadingItems = false;\n previousTotal = currentTotalCount;\n }\n }\n if (!mLoadingItems && (currentTotalCount <= (lastItem +view_threshold))) {\n mLoadingItems = true;\n //Increment number of items on the list\n firstItemVisible = firstItemVisible+10;\n lastItemVisible = lastItemVisible+10;\n //Update adapter\n jsonParse();\n }\n }\n }\n });\n }", "private void pagination()\n {\n if (value==0)\n {\n aBoolean=true;\n setAdapter(postModels);\n value=1;\n count=count+10;\n }\n else if (value==1)\n {\n if (count<page_count)\n {\n aBoolean=true;\n count=count+10;\n temp_list.addAll(postModels);\n adapter.notifyDataSetChanged();\n }\n }\n }", "private void setAdapterAndListener() {\r\n CustomPagerAdapter = new CustomPagerAdapter(getSupportFragmentManager(), PhotoViewActivity.this, dataModelArrayList);\r\n pager.setAdapter(CustomPagerAdapter);\r\n pager.setOffscreenPageLimit(3);\r\n pager.setCurrentItem(position);\r\n\r\n pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\r\n @Override\r\n public void onPageScrolled(final int pos, float positionOffset, int positionOffsetPixels) {\r\n /*\r\n * Setting the title on toolbar\r\n * */\r\n position = pos;\r\n String name = dataModelArrayList.get(position).getFile().getName();\r\n String actualName = FileUtils.getSecureFileName(name);\r\n if (actualName != null && !actualName.equalsIgnoreCase(\"\")) {\r\n updateTileBar(actualName);\r\n } else {\r\n updateTileBar(name);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n @Override\r\n public void onPageSelected(int num) {\r\n int pos = 0;\r\n //Update the toolbar menu item on page change\r\n invalidateOptionsMenu();\r\n\r\n }\r\n\r\n @Override\r\n public void onPageScrollStateChanged(int state) {\r\n\r\n }\r\n });\r\n }", "public abstract RecyclerViewPaginationAdapter<TItem, ?> getNewInstanceOfListAdapter(List<TItem> initialItems);", "private void setup() {\n adapter = new HomeAdapter(this);\n\n linearLayoutManager = new LinearLayoutManager\n (this, LinearLayoutManager.VERTICAL, false);\n rv.setLayoutManager(linearLayoutManager);\n rv.setItemAnimator(new DefaultItemAnimator());\n\n rv.setAdapter(adapter);\n showWait();\n if (NetworkUtils.isNetworkConnected(this)) {\n\n presenter.loadPage(currentPage);\n } else {\n onFailure(NetworkError.NETWORK_ERROR_MESSAGE);\n }\n rv.addOnScrollListener(new PaginationScrollListener(linearLayoutManager) {\n @Override\n protected void loadMoreItems() {\n AppLogger.d(TAG,\"currentPage:\"+currentPage);\n isLoading = true;\n currentPage += 1;\n presenter.loadPage(currentPage);\n\n\n }\n\n @Override\n public int getTotalPageCount() {\n AppLogger.d(TAG,\"TOTAL_PAGES:\"+TOTAL_PAGES);\n return TOTAL_PAGES;\n }\n\n @Override\n public boolean isLastPage() {\n return isLastPage;\n }\n\n @Override\n public boolean isLoading() {\n return isLoading;\n }\n });\n\n\n }", "public void customLoadMoreDataFromApi(int offset) {\n// Log.d(TAG, \"page = \" + offset);\n populateTimeline();\n // This method probably sends out a network request and appends new data items to your adapter.\n // Use the offset value and add it as a parameter to your API request to retrieve paginated data.\n // Deserialize API response and then construct new objects to append to the adapter\n }", "@Override\n protected void loadNextDataFromApi(int page) {\n ParseQuery<Post> query = ParseQuery.getQuery(Post.class);\n query.include(Post.KEY_USER);\n query.whereEqualTo(Post.KEY_USER, ParseUser.getCurrentUser());\n query.setLimit(POST_LIMIT);\n query.setSkip(POST_LIMIT*page);\n query.addDescendingOrder(Post.KEY_CREATED_AT);\n query.findInBackground(new FindCallback<Post>() {\n @Override\n public void done(List<Post> posts, ParseException e) {\n if (e != null){\n Log.e(TAG, \"Issue with getting posts\", e);\n return;\n }\n for (Post post: posts){\n Log.i(TAG, \"Post: \" + post.getDescription() + \", username: \" + post.getUser().getUsername());\n }\n allPosts.addAll(posts);\n adapter.notifyDataSetChanged();\n }\n });\n\n\n }", "private void paginate() {\n List<ItemModel> old = adapter.getItems();\n List<ItemModel> New = new ArrayList<>(addList());\n CardStackCallback callback = new CardStackCallback(old, New);\n DiffUtil.DiffResult result = DiffUtil.calculateDiff(callback);\n adapter.setItems(New);\n result.dispatchUpdatesTo(adapter);\n }", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tLog.i(\"\", \"Enter hereeeeeeeeeeeeeeeeeeeee(onPageSelected!!!\");\n\t\t\t\t\n\t\t\t\t//adapter.instantiateItem(pager, arg0);\n\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t}", "public QueryPager(JSONObject paging) {\n setPaging(paging);\n }", "@Override\n public void run() {\n\n if (pageTokenAvailable) {\n smoothProgressBar.setVisibility(View.VISIBLE);\n\n current_start += 10;\n\n // searchbean_post_data.getStart_limit()+=10;\n\n searchbean_post_data.setStart_limit(current_start);\n\n\n findDataFromServer();\n\n\n //or you can add all at once but do not forget to call mAdapter.notifyDataSetChanged();\n }\n\n\n }", "private void initializePaging() {\r\n\t\t\r\n\t\tList<Fragment> fragments = new Vector<Fragment>();\r\n\t\tfragments.add(Fragment.instantiate(this, ContactBookFragment.class.getName()));\r\n\t\tfragments.add(Fragment.instantiate(this, MainDashBoardFragment.class.getName()));\r\n\t\tfragments.add(Fragment.instantiate(this, GroupDashBoardFragment.class.getName()));\r\n\t\tthis.mPagerAdapter = new PagerAdapter(super.getSupportFragmentManager(), fragments);\r\n\t\t//\r\n\t\tViewPager pager = (ViewPager)super.findViewById(R.id.viewpager);\r\n\t\tpager.setAdapter(this.mPagerAdapter);\r\n\t\tpager.setCurrentItem(1);\t// Set the default page to Main Dash Board\r\n\t}", "public Paging() {\n }", "@Override\n public void onLoadMore() {\n if (searchbeanArrayList_new.size() != 0) {\n\n\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n // remove progress item\n\n\n //add items one by one\n\n if (pageTokenAvailable) {\n smoothProgressBar.setVisibility(View.VISIBLE);\n\n current_start += 10;\n\n // searchbean_post_data.getStart_limit()+=10;\n\n searchbean_post_data.setStart_limit(current_start);\n\n\n findDataFromServer();\n\n\n //or you can add all at once but do not forget to call mAdapter.notifyDataSetChanged();\n }\n\n\n }\n }, 2000);\n\n }\n\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "public void customLoadMoreDataFromApi() {\n // This method probably sends out a network request and appends new data items to your adapter. \n // Use the offset value and add it as a parameter to your API request to retrieve paginated data.\n // Deserialize API response and then construct new objects to append to the adapter\n \tmakeGoogleApiCall();\n \t\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextData(page);\n }", "private void initViewPager() {\n }", "private void initialisePaging() {\n\nList<Fragment> fragments = new Vector<Fragment>();\nfragments.add(Fragment.instantiate(this, Fragment0.class.getName()));\nfragments.add(Fragment.instantiate(this, Fragment1.class.getName()));\nfragments.add(Fragment.instantiate(this, Fragment2.class.getName()));\nthis.mPagerAdapter = new MyPagerAdapter(super.getSupportFragmentManager(), fragments);\n\nViewPager pager = (ViewPager) super.findViewById(R.id.awesomepager);\npager.setAdapter(this.mPagerAdapter);\n}", "@Override\n\t public void onLoadMore(int page, int totalItemsCount) {\n\t customLoadMoreDataFromApi(page); \n // or customLoadMoreDataFromApi(totalItemsCount); \n\t }", "@Override\n\t public void onLoadMore(int page, int totalItemsCount) {\n\t customLoadMoreDataFromApi(); \n // or customLoadMoreDataFromApi(totalItemsCount); \n\t }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n customLoadMoreDataFromApi(page);\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n customLoadMoreDataFromApi(page);\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextPosts(page);\n hideProgressBar();\n }", "@Override\n\t\tpublic void initList() {\n\t\t\tadapter = new MsgItemAdapter(context);\n\t\t\tArrayList<MsgBean> datas = getData();\n\t\t\tadapter.setData(datas);\n\t\t\tmListView.setAdapter(adapter);\n\t\t\tmListView.setViewMode(true, true);\n\t\t\tif(!DataValidate.checkDataValid(datas)){\n\t\t\t\tpageView.setDefaultPage().setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t}", "private PagedListHolder<NewsArticle> populatePagedListHolder(final HttpServletRequest request) {\n @SuppressWarnings(\"unchecked\")\n PagedListHolder<NewsArticle> pagedListHolder =\n (PagedListHolder<NewsArticle>) request.getSession().getAttribute(ARTICLE_LIST);\n\n // If first time on page populate the pagedListHolder with the news articles\n if (pagedListHolder == null) {\n List<NewsArticle> articleList = newsService.listNewsArticles();\n LOGGER.log(Level.INFO, \"articleList - articleList.size(): {0}\", articleList.size());\n pagedListHolder = new PagedListHolder<NewsArticle>(articleList);\n } else {\n String page = request.getParameter(\"page\");\n if (\"next\".equals(page)) {\n pagedListHolder.nextPage();\n } else if (\"previous\".equals(page)) {\n pagedListHolder.previousPage();\n }\n }\n\n return pagedListHolder;\n }", "@Override\n\tpublic Loader<List<PostEntity>> onCreateLoader(int arg0, Bundle arg1) {\n\t\treturn new ThrowableLoader<List<PostEntity>>(getActivity(), items) {\n\n\t\t\t@Override\n\t\t\tpublic List<PostEntity> loadData() throws Exception {\n\t\t\t\tint pagenum = getListView().getCurrentPage() + 1;\n\t\t\t\treturn service.getPostList(boardId, pagenum, true);\n\t\t\t}\n\t\t};\n\t}", "@Override\n public PagerAdapter getAdapter() {\n return wrappedPagerAdapter;\n }", "private void createPaginationPageFactory() {\n pdfViewer.setPageFactory(pageNumber -> {\n if (currentFile.get() == null) {\n return null ;\n } else {\n if (pageNumber >= currentFile.get().getNumPages() || pageNumber < 0) {\n return null ;\n } else {\n updateImage(currentFile.get(), pageNumber);\n return scroller;\n }\n }\n });\n }", "private void setUpViewPager() {\n\n mDbProducts = realm.where(DbProduct.class).findAll();\n try {\n mViewPager.setAdapter(new FeedPagerAdapter(getChildFragmentManager()));\n } catch (Exception e) {\n// getFragmentManager().popBackStack();\n Log.e(LOG_TAG, e.toString());\n }\n\n int index = 0;\n\n try {\n long openingProductId = getActivity().getIntent().getLongExtra(MainActivity.EXTRA_PRODUCT_ID, 0);\n if (openingProductId != 0) {\n\n index = mDbProducts.indexOf(mDbProducts.where().equalTo(DbProduct.PRODUCT_ID, openingProductId).findFirst());\n }\n } catch (Exception e) {\n index = 0;\n }\n\n ViewPager.OnPageChangeListener onPageChangeListener = new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n\n }\n\n @Override\n public void onPageSelected(int position) {\n try {\n setHeaderText(mDbProducts.get(position).getProductName());\n } catch (Exception e) {\n //\n }\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n\n }\n };\n mViewPager.addOnPageChangeListener(onPageChangeListener);\n\n try {\n // indicator.setupWithViewPager(mViewPager);\n // indicator.addOnPageChangeListener(onPageChangeListener);\n\n } catch (Exception e)\n {\n\n }\n\n Log.d(LOG_TAG, \"Product Size: \" + mDbProducts.size() + \" Index: \" + index);\n\n mViewPager.setCurrentItem(index, true);\n setHeaderText(mDbProducts.get(index).getProductName());\n\n ivLeft.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n int currentPosition = mViewPager.getCurrentItem();\n try {\n mViewPager.setCurrentItem(currentPosition - 1, true);\n } catch (Exception e) {\n //do nothing\n }\n }\n });\n\n ivRight.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n int currentPosition = mViewPager.getCurrentItem();\n try {\n mViewPager.setCurrentItem(currentPosition + 1, true);\n } catch (Exception e) {\n //do nothing\n }\n }\n });\n }", "public interface PaginationAdapterCallback {\n\n void retryPageLoad();\n}", "@Override\n public void onLoadMore() {\n MyApplacation.getmHandler().postDelayed(new Runnable() {\n @Override\n public void run() {\n pageNo++;\n getDataForService();\n }\n }, 1000);\n\n }", "@Override\n\t\tpublic void onScroll(AbsListView view, int firstVisibleItem,\n\t\t\t\tint visibleItemCount, int totalItemCount) {\n\t\t\tif ((firstVisibleItem + visibleItemCount == totalItemCount)\n\t\t\t\t\t&& totalItemCount != 0 && !loadingDataFlag\n\t\t\t\t\t&& totalItemCount > 1&&!dataFinish) {\n\t\t\t\tloadingDataFlag = true;\n\t\t\t\tfootView.setVisibility(View.VISIBLE);\n\n\t\t\t\tpageNum = pageNum + 1;\n\n\t\t\t\tthreadHandler\n\t\t\t\t\t\t.sendEmptyMessage(GlobalConstants.MSG_AVCOMMENT_THREAD_INIT_DATA);\n\t\t\t}\n\n\t\t}", "public interface PaginationAdapterCallback {\n void retryPageLoad();\n}", "@Override\n\tpublic void initData() {\n\n\t\tsuper.initData();\n\t\tinitLsitData();\n\n\t\tviewpager.setAdapter(new MyPagerAdapter());\n\t\tindicator.setViewPager(viewpager);\n\n\t}", "void onPagesAdded(List<Integer> pageList);", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n if(next_url != null) {\n curent_page = page;\n loadMore(page);\n }\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n if(next_url != null) {\n curent_page = page;\n loadMore(page);\n }\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n pageNumberBeingQueried = page;\n\n /*\n * Loader call - case 2 of 3\n * We call loader methods in case our recycler view is running out of items for display\n * */\n manageLoaders();\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextFeedPage(page);\n }", "@Override\n public int getCount() {\n return PAGE_COUNT;\n }", "public NonSwipeableViewPager(Context context) {\n super(context);\n setMyScroller();\n }", "public abstract void onLoadMore(int page, int totalItemsCount);", "public abstract void onLoadMore(int page, int totalItemsCount);", "@Override\n protected void onResume() {\n getList(currentPage.toString(), tag);\n super.onResume();\n }", "private void initListView() {\n viewPager.setAdapter(adapter);\n }", "public List<Object> retrievePagingList(PageBean pageBean) ;", "protected abstract void onRequestPage(boolean isRequestNext,int fromIndex,int toIndex,float x,float y);", "@Override\n\t\tpublic synchronized void onLoadMore() {\n\t\t\ttry {\n\t\t\t\t//如果总页数大于当前页码数,加载更多\n\t\t\t\tif(pageSize > curPage){\n\t\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\")+1);\n\t\t\t\t\tcurPage++;\n\t\t\t\t\tURL = URL+curPage+\".xml\";\n\t\t\t\t\tnew AsyncLoadNews(flag,lsnb,URL).execute();\n\t\t\t\t}else{\n\t\t\t\t\tlistView.setPullLoadEnable(false);\n\t\t\t\t\tonLoadStop();\n\t\t\t\t\tToast toast = Toast.makeText(getActivity(), \"数据已经加载完毕!\", Toast.LENGTH_LONG);\n//\t\t\t\t\ttoast.getView().setBackgroundResource(R.drawable.red_toast_bg);\n\t\t\t\t\ttoast.getView().setPadding(20, 10, 20, 10);\n\t\t\t\t\ttoast.show();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "@Override\n public int getCount() {\n return PAGE_COUNT;\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_offer, container, false);\n\n mOfferViewPager = view.findViewById(R.id.offerViewPager);\n mImageView = view.findViewById(R.id.offerMainImage);\n mRTL = view.findViewById(R.id.offerRTL);\n mDb = FirebaseFirestore.getInstance();\n mList = new ArrayList<>();\n\n getData();\n\n Log.d(TAG, \"onCompleteMlist: \"+getmList().size());\n adapter = new OfferPagerAdapter(getFragmentManager(), 0, mList);\n Log.d(TAG, \"onCreateView: \"+mList.size());\n\n mOfferViewPager.setAdapter(adapter);\n mRTL.hasFixedSize();\n OfferRTLAdapter RTLadapter = new OfferRTLAdapter(mOfferViewPager);\n Log.d(TAG, \"onCreateView: position\"+ RTLadapter.getCurrentIndicatorPosition());\n Log.d(TAG, \"onCreateView: \"+mOfferViewPager.getCurrentItem());\n mRTL.setUpWithAdapter(RTLadapter);\n\n Log.d(TAG, \"onCreateView: \"+pos);\n mRTL.setIndicatorColor(Color.RED);\n Picasso.get().load(R.drawable.offer_main_pic).into(mImageView);\n return view;\n }", "public PageList(){\n count = 0;\n capacity = 4;\n itemArray = new int[capacity];\n }", "@Override\n\tpublic void initListData(final int page) {\n\t\tif (list == null) {\n\t\t\tlist = new ArrayList<FaultBean>();\n\t\t}\n\t\t\n\t\t// page值为1时,表明巡检状态可能发生了变化,所以数据需要进行初始化。当适配器mAapter非空时,表明有数据,所以需要通知列表刷新\n\t\tif (page == 1) {\n\t\t\tlist.clear();\n\t\t\tif (mAdapter != null) { // 一定要做通知刷新处理,否则可能会报错\n\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t}\n\t\t}\n\n\t\tmHandler.post(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tUserHttp.accidentHandlingHistoryQuery(page, num, \"defectTime\",\n\t\t\t\t\t\t\"desc\", MyApp.userInfo.getStaffId(), new HttpDataCallBack() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void HttpSuccess(String _result) {\n\t\t\t\t\t\t\t\tgetAccidentRepairListData(_result);\n\t\t\t\t\t\t\t\tmHandler.obtainMessage(MESSAGE_SUCCESS)\n\t\t\t\t\t\t\t\t\t\t.sendToTarget();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\t\t\t\t\t\t\t\tmHandler.obtainMessage(MESSAGE_FAILED)\n\t\t\t\t\t\t\t\t\t\t.sendToTarget();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "private void setupViewPager(ViewPager viewPager, List<Blog> blogs) {\n }", "@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic DataWrapper<List<PaperPojo>> getPapers(HttpServletRequest request,Long projectId, String token, Integer pageIndex, Integer pageSize, Paper paper) {\n\t\tDataWrapper<List<PaperPojo>> dataWrappers = new DataWrapper<List<PaperPojo>>();\r\n \tList<PaperPojo> papers=new ArrayList<PaperPojo>();\r\n \t\r\n \tDataWrapper<List<Paper>> dataWrapper = new DataWrapper<List<Paper>>();\r\n\t\t User userInMemory = SessionManager.getSession(token);\r\n\t if (userInMemory != null) {\r\n\t \tString projectIdList=null;\r\n\t \tif(projectIdList==null){\r\n\t \t\tprojectIdList=\"79\";\r\n\t \t}\t\r\n\t \t\tdataWrapper= paperDao.getPaperLists(projectIdList,pageSize, pageIndex,paper);\r\n\t \t\tfor(int i=0;i<dataWrapper.getData().size();i++){\r\n\t \t\t\tPaperPojo papernew=new PaperPojo();\r\n \t\t\t\tpapernew.setProjectId(projectId);\r\n\t \t\t\tpapernew.setId(dataWrapper.getData().get(i).getId());\r\n\t \t\t\tpapernew.setBuildingNum(dataWrapper.getData().get(i).getBuildingNum());\r\n\t \t\t\tpapernew.setProfessionType(dataWrapper.getData().get(i).getProfessionType());\r\n\t \t\t\tpapernew.setFloorNum(dataWrapper.getData().get(i).getFloorNum());\r\n\t \t\t\tpapernew.setOriginName(dataWrapper.getData().get(i).getOriginName());\r\n\t \t\t\tFiles file=fileDao.getById(dataWrapper.getData().get(i).getFileId());\r\n\t \t\t\tif(file!=null){\r\n\t \t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyyMMddHHmmssSSS\" );\r\n\t \t\t\t \tDate d=new Date();\r\n\t \t\t\t \tString str=sdf.format(d);\r\n\t \t\t\t \tString rootPath = request.getSession().getServletContext().getRealPath(\"/\");\r\n\t \t\t\t \tString filePath=\"\";\r\n\t \t\t\t \tif(projectId!=null){\r\n\t \t\t\t \t\tfilePath=\"/codeFiles/\"+projectId;\r\n\t \t\t\t \t}else{\r\n\t \t\t\t \t\tfilePath=\"/codeFiles\";\r\n\t \t\t\t \t}\r\n\t \t\t\t \tString imgpath=rootPath+filePath;\r\n\t \t\t\t \ttry{\r\n\t \t\t\t\tMultiFormatWriter multiFormatWriter = new MultiFormatWriter();\r\n\t \t\t\t @SuppressWarnings(\"rawtypes\")\r\n\t \t\t\t\t\tMap hints = new HashMap(); \r\n\t \t\t\t //内容所使用编码 \r\n\t \t\t\t hints.put(EncodeHintType.CHARACTER_SET, \"utf8\"); \r\n\t \t\t\t BitMatrix bitMatrix = multiFormatWriter.encode(\"http://jasobim.com.cn/\"+file.getUrl(),BarcodeFormat.QR_CODE, 200, 200, hints); \r\n\t \t\t\t //生成二维码 \r\n\t \t\t\t File outputFile = new File(imgpath,str+\".png\"); \r\n\t \t\t\t \r\n\t \t\t\t MatrixToImageWriter.writeToFile(bitMatrix, \"png\", outputFile); \r\n\t \t\t\t\t} catch (Exception e) {\r\n\t \t\t\t\t\te.printStackTrace();\r\n\t \t\t\t\t}\r\n\t \t\t\t \tString url=\"\";\r\n\t \t\t\t \tif(projectId!=null){\r\n\t \t\t\t \t\turl=\"codeFiles/\"+projectId+\"/\"+str+\".png\";\r\n\t \t\t\t \t}else{\r\n\t \t\t\t \t\turl=\"codeFiles/\"+str+\".png\";\r\n\t \t\t\t \t}\r\n\t \t\t\t\tpapernew.setUrl(url);\r\n\t \t\t\t}\r\n\t \t\t\tif(papernew.getId()!=null){\r\n\t \t\t\t\tpapers.add(papernew);\r\n\t \t\t\t}\r\n\t \t\t}\r\n\t \t\tdataWrappers.setData(papers);\r\n\t \t\tif(dataWrapper.getCurrentPage()==-1){\r\n\t \t\t\tdataWrappers.setCurrentPage(1);\r\n\t \t\t}else{\r\n\t \t\t\tdataWrappers.setCurrentPage(dataWrapper.getCurrentPage());\r\n\t \t\t}\r\n\t \t\t\tdataWrappers.setCallStatus(dataWrapper.getCallStatus());\r\n\t \t\t\tdataWrappers.setNumberPerPage(dataWrapper.getNumberPerPage());\r\n\t \t\t\tdataWrappers.setTotalNumber(dataWrapper.getTotalNumber());\r\n\t \t\t\tdataWrappers.setTotalPage(dataWrapper.getTotalPage());\r\n\t \t\r\n\t\t\t} else {\r\n\t\t\t\tdataWrappers.setErrorCode(ErrorCodeEnum.User_Not_Logined);\r\n\t\t\t}\r\n return dataWrappers;\r\n\t}", "private void initData() {\n\t\tpages = new ArrayList<WallpaperPage>();\n\n\t}", "@Override\n\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\tpresenter.loadRecordsPage(page);\n\t\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n Log.d(\"DEBUG\", \"network continue load before count:\" + tweets.size());\n loadNextDataFromApi(page, view);\n }", "protected CoolPagedListAdapter(Context context) {\n super(diffCallback);\n this.context = context;\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadMoreRecyclerViewData(hal[0]);\n hal[0]++;\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n System.out.println(\"load more\" + totalItemsCount);\n loadMore(totalItemsCount);\n }", "private void initViewPager() {\n\t RelativeLayout.LayoutParams rl = new RelativeLayout.LayoutParams(\n\t ContextUtil.getWidth(SecurityMonitorActivity.this) / 2, PixelUtils.dp2px(2));\n\t rl.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);\n\t cursor.setLayoutParams(rl);\n\t\toffset = (ContextUtil.getWidth(SecurityMonitorActivity.this) / 2 - cursor.getWidth()/2);// 计算偏移量\n\t\tbmpW = cursor.getWidth();\n\t\tMatrix matrix = new Matrix();\n\t\tmatrix.postTranslate(offset, 0);\n\t\tcursor.setImageMatrix(matrix);// 设置动画初始位置\n\n\t\tmonitorPreviewFragment = new MonitorPreviewFragment();\n\t\tvideoPlaybackFragment = new VideoPlaybackFragment();\n\n\t mFragments.add(monitorPreviewFragment);\n\t mFragments.add(videoPlaybackFragment);\n\t tv_title1.setTextColor(getResources().getColor(R.color.gray));\n\t pager.setOffscreenPageLimit(3);\n\t pager.setAdapter(new MyPagerAdapter(SecurityMonitorActivity.this.getSupportFragmentManager(), mFragments));\n\t pager.setCurrentItem(0);\n\t pager.setOnPageChangeListener(new MyOnPageChangeListener());\n\t}", "@Override\n protected void onCreate(@Nullable Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n\n SID = (UUID) getIntent().getSerializableExtra(EXTRA_ID);\n\n mQurans = QueryUtilsList.get(this).getAllPages();\n\n mBinding = ActivitySurhPagerBinding.inflate(getLayoutInflater());\n setContentView(mBinding.getRoot());\n\n\n // setContentView(R.layout.activity_surh_pager);\n\n mainToolbar = findViewById(R.id.qourn_toolbar) ;\n\n setSupportActionBar(mainToolbar);\n\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n\n\n\n // isActionBarHidden = false;\n mActionBarStatus.setActionBarStatus(false);\n\n\n int p = (int)getIntent().getSerializableExtra(EXTRA_SURH_START_PAGE) ;\n\n\n\n\n // QueryUtilsList queryUtilsList = QueryUtilsList.get(this);\n\n\n\n Spinner spinner = (Spinner) findViewById(R.id.spinner);\n\n\n mBinding.surhViewPager.setAdapter(new FragmentStateAdapter(this) {\n @NonNull\n @Override\n public Fragment createFragment(int position) {\n\n //quran = mQurans.get(position);\n\n // return QuranFragment.newInstance(quran.getId());\n return QuranFragment.arrayList.get(position);\n\n }\n\n @Override\n public int getItemCount() {\n //return mQurans.size();\n\n return QuranFragment.arrayList.size();\n }\n });\n\n mBinding.surhViewPager.registerOnPageChangeCallback(pageChangeCallback);\n mBinding.surhViewPager.setCurrentItem(p-1, false) ;\n\n\n\n\n// mViewPager = findViewById(R.id.surh_view_pager);\n/*\n\n mViewPager.setAdapter(new FragmentStateAdapter(this) {\n @NonNull\n @Override\n public Fragment createFragment(int position) {\n quran = mQurans.get(position);\n return QuranFragment.newInstance(quran.getId());\n }\n\n @Override\n public int getItemCount() {\n return mQurans.size();\n }\n\n\n });\n\n mPageChangeCallback = new ViewPager2.OnPageChangeCallback() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n super.onPageScrolled(position, positionOffset, positionOffsetPixels);\n\n }\n\n @Override\n public void onPageSelected(int position) {\n super.onPageSelected(position);\n Toast.makeText(SurhPagerActivity.this, \" position= \" +position , Toast.LENGTH_SHORT).show();\n\n\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n super.onPageScrollStateChanged(state);\n }\n };*/\n\n\n\n\n\n\n\n\n\n\n }", "List<Item<T>> addItemsForPage(final long page);", "@Override\n protected void onPostExecute(Void result) {\n startViewPagerThread();\n\n }", "private void initPicDownloadPage() {\n\n\t\tif (mScrollLayout.getChildCount() <= 0) {\n\t\t\tfor (File dir : getSearchFiles()) {\n\t\t\t\tif (dir == null || !dir.exists())\n\t\t\t\t\tcontinue;\n\t\t\t\tif (dir.list().length <= 0\n\t\t\t\t\t\t&& dir != StorageUtils.getFavorDir(this))\n\t\t\t\t\tcontinue;\n\t\t\t\tWallpaperPage wallpaperPage = new WallpaperPage(\n\t\t\t\t\t\tgetApplicationContext());\n\t\t\t\tpages.add(wallpaperPage);\n\t\t\t\twallpaperPage.setAdapter(new LocalWallpaperAdapter(this,dir.getAbsolutePath()));\n\t\t\t\tAsyncTaskLoadLocalPic loader = new AsyncTaskLoadLocalPic(\n\t\t\t\t\t\tnew PageLoadListener(wallpaperPage), this);\n\t\t\t\tloader.execute(dir);\n\t\t\t}\n\n\t\t\tpageCount = pages.size();\n\t\t\t// PAGE_MAX_INDEX = pages.size() - 1;\n\t\t\tpageAdapter.notifyDataSetChanged();\n\t\t}\n\t}", "@Override\n\tpublic void setPaging(PagingInterface paging) {\n\t\t\n\t}", "@Override\n\tpublic void setPaging(PagingInterface paging) {\n\t\t\n\t}", "void onPaginate(MessageCreateEvent event, Message paginateMessage, T currentItem, int arrow, Paginator<T> paginator);", "public PaginationScrollListener(LinearLayoutManager linearLayoutManager) {\n// this.layoutManager=linearLayoutManager;\n this.mlayoutmanager = linearLayoutManager;\n }", "@Override\n\tpublic synchronized void onLoadMore() {\n\t\ttry {\n\t\t\t// 如果总页数大于当前页码数,加载更多\n\t\t\tif (pageSize > curPage) {\n\t\t\t\tURL = URL.substring(0, URL.lastIndexOf(\"_\") + 1);\n\t\t\t\tcurPage++;\n\t\t\t\tURL = URL + curPage + \".xml\";\n\t\t\t\tnew AsyncLoadNews(lsnb, URL).execute();\n\t\t\t} else {\n\t\t\t\tlistView.setPullLoadEnable(false);\n\t\t\t\tonLoadStop();\n\t\t\t\tToast toast = Toast.makeText(getActivity(), \"数据已经加载完毕!\",\n\t\t\t\t\t\tToast.LENGTH_LONG);\n\t\t\t\t// toast.getView().setBackgroundResource(R.drawable.red_toast_bg);\n\t\t\t\ttoast.getView().setPadding(20, 10, 20, 10);\n\t\t\t\ttoast.show();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n protected void loadData() {\n setUpLoadingViewVisibility(true);\n callImageList = RetrofitGenerator.createService(ApiService.class)\n .getAllPubImage();\n callImageList.enqueue(callbackImageList);\n }", "private void populateTimeline(int page) {\n\n Log.d(\"DEBUG\", \"Page: \" + page);\n client.getHomeTimeline(new JsonHttpResponseHandler() {\n\n //Success\n @Override\n public void onSuccess(int statusCode, Header[] headers, JSONArray json) {\n super.onSuccess(statusCode, headers, json);\n //Deserialize Json, Create models and load model data into listview\n\n recycleAdapter.clear();\n ArrayList<Tweet> arrayList = Tweet.fromJsonArray(json);\n addAll(arrayList);\n swipeContainer.setRefreshing(false);\n\n //add tweets to db\n for (int i=0; i< arrayList.size(); i++)\n {\n dbHelper.addTweetToDB(arrayList.get(i));\n }\n }\n\n //Failure\n @Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n super.onFailure(statusCode, headers, throwable, errorResponse);\n\n Log.d(\"DEBUG\", errorResponse.toString());\n }\n }, page);\n }", "public void prepareCircularCarrusel() {\n ArrayList arrayList = new ArrayList();\n arrayList.add(((WebTextViewFragment) this.fragments.get(this.fragments.size() - 1)).getClone());\n arrayList.addAll(this.fragments);\n arrayList.add(((WebTextViewFragment) this.fragments.get(0)).getClone());\n this.fragments = arrayList;\n this.mPager.addOnPageChangeListener(new OnPageChangeListener() {\n public void onPageSelected(int i) {\n int currentItem = CircularCarruselPagerAdapter.this.getCurrentItem();\n if (CircularCarruselPagerAdapter.this.isListenerAvailable().booleanValue() && CircularCarruselPagerAdapter.this.isCurrentItemOnRange(currentItem).booleanValue()) {\n CircularCarruselPagerAdapter.this.mListener.onPageSelected(currentItem);\n }\n }\n\n public void onPageScrolled(int i, float f, int i2) {\n if (CircularCarruselPagerAdapter.this.isListenerAvailable().booleanValue()) {\n CircularCarruselPagerAdapter.this.mListener.onPageScrolled(i, f, i2);\n }\n }\n\n public void onPageScrollStateChanged(int i) {\n if (i == 0) {\n int count = CircularCarruselPagerAdapter.this.getCount();\n int currentItem = CircularCarruselPagerAdapter.this.mPager.getCurrentItem();\n if (currentItem == 0) {\n CircularCarruselPagerAdapter.this.mPager.setCurrentItem(count - 2, false);\n } else if (currentItem == count - 1) {\n CircularCarruselPagerAdapter.this.mPager.setCurrentItem(1, false);\n }\n }\n }\n });\n }", "PageInfo list(Date beginDate, Date endDate, List<Integer> resources, int pageNo, int pageSize);", "public MoreVersionsAdapter(List<ParseObject> data, Activity context) {\n mData = data;\n appcontext = context;\n }", "private void init() {\n\t\tinitData();\n\t\tmViewPager = (ViewPagerCompat) findViewById(R.id.id_viewpager);\n\t\tnaviBar = findViewById(R.id.navi_bar);\n\t\tNavigationBarUtils.initNavigationBar(this, naviBar, true, ScreenContents.class, false, ScreenViewPager.class,\n\t\t\t\tfalse, ScreenContents.class);\n\t\tmViewPager.setPageTransformer(true, new DepthPageTransformer());\n\t\t// mViewPager.setPageTransformer(true, new RotateDownPageTransformer());\n\t\tmViewPager.setAdapter(new PagerAdapter() {\n\t\t\t@Override\n\t\t\tpublic Object instantiateItem(ViewGroup container, int position) {\n\n\t\t\t\tcontainer.addView(mImageViews.get(position));\n\t\t\t\treturn mImageViews.get(position);\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic void destroyItem(ViewGroup container, int position, Object object) {\n\n\t\t\t\tcontainer.removeView(mImageViews.get(position));\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic boolean isViewFromObject(View view, Object object) {\n\t\t\t\treturn view == object;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int getCount() {\n\t\t\t\treturn mImgIds.length;\n\t\t\t}\n\t\t});\n\t}", "@Override\n\t\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\t\tpopulateTimeline();\n\t\t\t}", "private void setdata(){\n final Handler handler = new Handler();\n final Runnable Update = new Runnable() {\n public void run() {\n if (currentPage == img.length) {\n currentPage = 0;\n }\n viewPager.setCurrentItem(currentPage++, true);\n }\n };\n Timer swipeTimer = new Timer();\n swipeTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n handler.post(Update);\n }\n }, 2500, 2500);\n }", "@Override\n public void onLoadMoreRecycleViewDataListner(int page, int totalItemsCount, RecyclerView view)\n {\n\n mRecyclerViewScrollToEndObserver.setLoadingData(true);\n if(!mIsLastPageLoaded)\n {\n mRecyclerView.post(new Runnable()\n {\n @Override\n public void run()\n {\n mTopStoryItems.add(mTopStoryLoadingMoreItem);\n mTopStoriesAdapter.updateData(mTopStoryItems);\n mTopStoriesRecyclerViewModelCallbackHandler.notifyLoadMoreTopStories();\n }\n });\n }\n }", "@Override\n protected void onNextPageRequested(int page) {\n\n }", "private void setUpData() {\n\n ViewPager viewPager = findViewById(R.id.home_view_pager);\n RecyclerView servicesCatRecycler = findViewById(R.id.home_recycler_our_services);\n servicesCatRecycler.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL ,false));\n servicesCatRecycler.setNestedScrollingEnabled(true);\n\n RecyclerView userReviewRecycler = findViewById(R.id.home_recycler_user_reviews);\n userReviewRecycler.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL ,false));\n //userReviewRecycler.setNestedScrollingEnabled(true);\n\n BannerViewModel bannerViewModel = ViewModelProviders.of(this, bannerViewModelFactory).get(BannerViewModel.class);\n\n final HomeViewPagerAdapter homeViewPagerAdapter = new HomeViewPagerAdapter(HomeActivity.this);\n bannerViewModel.getBannerList().observe(this, new Observer<List<Banner>>() {\n @Override\n public void onChanged(@Nullable List<Banner> banners) {\n if(banners!=null) {\n homeViewPagerAdapter.setList(banners);\n //Log.v(\"HHHHHHH \", banners.get(0).getLocalPath());\n }else{\n showToastForInternetConnection();\n //Log.v(\"AAAAAAAA \",\"no data in observer\");\n }\n }\n });\n\n //viewPager.setAdapter(homeViewPagerAdapter);\n viewPager.setAdapter(homeViewPagerAdapter);\n TabLayout indicator = findViewById(R.id.indicatorHomeViewPager);\n indicator.setupWithViewPager(viewPager);\n// if(!sBase.checkInternet(this)){\n// progressDialog.dismiss();\n// Toast.makeText(this, \"No Internet\", Toast.LENGTH_SHORT).show();\n// }else {\n// progressDialog.setMessage(\"Loding...\");\n\n\n// RetrofitAPI retrofitAPI = RetrofitApiInstance.getRetrofit(this).create(RetrofitAPI.class);\n// Call<List<Banner>> call = retrofitAPI.getAllBanners();\n// call.enqueue(new Callback<List<Banner>>() {\n// @Override\n// public void onResponse(@NonNull Call<List<Banner>> call, @NonNull Response<List<Banner>> response) {\n// progressDialog.dismiss();\n// try {\n// List<Banner>bannerList= response.body();\n// //Banner banner = response.body();\n//// List<String> strings = null;\n//// String baseUrl = \"\";\n//// if (bannerList == null) {\n////\n////// strings = banner.getBanners();\n////// baseUrl = banner.getBaseUrl();\n//// }\n// HomeViewPagerAdapter homeViewPagerAdapter = new HomeViewPagerAdapter(HomeActivity.this, bannerList);\n// viewPager.setAdapter(homeViewPagerAdapter);\n// viewPager.setAdapter(homeViewPagerAdapter);\n// TabLayout indicator = findViewById(R.id.indicatorHomeViewPager);\n// indicator.setupWithViewPager(viewPager);\n// } catch (Exception e) {\n// Toast.makeText(HomeActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\n// e.printStackTrace();\n// }\n// }\n//\n// @Override\n// public void onFailure(@NonNull Call<List<Banner>> call, @NonNull Throwable t) {\n// progressDialog.dismiss();\n// Toast.makeText(HomeActivity.this, \"failed\"+call.toString(), Toast.LENGTH_SHORT).show();\n// HomeViewPagerAdapter homeViewPagerAdapter = new HomeViewPagerAdapter(HomeActivity.this,null);\n//// ViewPager viewPager = findViewById(R.id.home_view_pager);\n// viewPager.setAdapter(homeViewPagerAdapter);\n// TabLayout indicator = findViewById(R.id.indicatorHomeViewPager);\n// indicator.setupWithViewPager(viewPager);\n// }\n// });\n\n ServiceCategoryViewModel serviceCategoryViewModel=ViewModelProviders.of(this,serviceCategoryViewModelFactory).get(ServiceCategoryViewModel.class);\n final HomeRecyclerOurServiceCategory homeRecyclerOurServiceCategory = new HomeRecyclerOurServiceCategory(HomeActivity.this,new OnRecyclerItemClicked() {\n @Override\n public void onItemClicked(int pos) {\n Toast.makeText(HomeActivity.this, \"\" + pos, Toast.LENGTH_SHORT).show();\n }\n });\n servicesCatRecycler.setAdapter(homeRecyclerOurServiceCategory);\n\n serviceCategoryViewModel.getServiceCategories().observe(this, new Observer<List<ServiceCategory>>() {\n @Override\n public void onChanged(@Nullable List<ServiceCategory> serviceCategories) {\n if(serviceCategories!=null){\n homeRecyclerOurServiceCategory.setServiceCategoryList(serviceCategories);\n }else{\n showToastForInternetConnection();\n }\n }\n });\n// final Call<List<ServiceCategory>>service_cat_call=retrofitAPI.getAllServicesCategories();\n// service_cat_call.enqueue(new Callback<List<ServiceCategory>>() {\n// @Override\n// public void onResponse(@NonNull Call<List<ServiceCategory>> call, @NonNull Response<List<ServiceCategory>> response) {\n// try {\n// List<ServiceCategory> serviceCategoryList = response.body();\n// if (serviceCategoryList != null) {\n// HomeRecyclerOurServiceCategory homeRecyclerOurServiceCategory = new HomeRecyclerOurServiceCategory(HomeActivity.this, serviceCategoryList, new OnRecyclerItemClicked() {\n// @Override\n// public void onItemClicked(int pos) {\n// Toast.makeText(HomeActivity.this, \"\" + pos, Toast.LENGTH_SHORT).show();\n// }\n// });\n// servicesCatRecycler.setAdapter(homeRecyclerOurServiceCategory);\n// }\n// }catch (Exception e){\n// e.printStackTrace();\n// Toast.makeText(HomeActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\n// }\n// }\n//\n// @Override\n// public void onFailure(@NonNull Call<List<ServiceCategory>> call, @NonNull Throwable t) {\n// Toast.makeText(HomeActivity.this, \"Failure\", Toast.LENGTH_SHORT).show();\n// }\n// });\n\n UserReviewViewModel userReviewViewModel=ViewModelProviders.of(this,userReviewViewModelFactory).get(UserReviewViewModel.class);\n final HomeRecyclerUserReview homeRecyclerUserReview = new HomeRecyclerUserReview(HomeActivity.this, new OnRecyclerItemClicked() {\n @Override\n public void onItemClicked(int pos) {\n Toast.makeText(HomeActivity.this, \"\" + pos, Toast.LENGTH_SHORT).show();\n }\n });\n userReviewRecycler.setAdapter(homeRecyclerUserReview);\n userReviewViewModel.getAllUserReview().observe(this, new Observer<List<UserReview>>() {\n @Override\n public void onChanged(@Nullable List<UserReview> userReviews) {\n if(userReviews!=null){\n homeRecyclerUserReview.setUserReviewList(userReviews);\n }else{\n showToastForInternetConnection();\n }\n }\n });\n// final Call<List<UserReview>>userReviewCall=retrofitAPI.getAllUserReviews();\n// userReviewCall.enqueue(new Callback<List<UserReview>>() {\n// @Override\n// public void onResponse(@NonNull Call<List<UserReview>> call, @NonNull Response<List<UserReview>> response) {\n// try {\n// List<UserReview> userReviewList = response.body();\n// if (userReviewList != null) {\n// HomeRecyclerUserReview homeRecyclerUserReview = new HomeRecyclerUserReview(HomeActivity.this, userReviewList, new OnRecyclerItemClicked() {\n// @Override\n// public void onItemClicked(int pos) {\n// Toast.makeText(HomeActivity.this, \"\" + pos, Toast.LENGTH_SHORT).show();\n// }\n// });\n// userReviewRecycler.setAdapter(homeRecyclerUserReview);\n// }\n// }catch (Exception e){\n// e.printStackTrace();\n// Toast.makeText(HomeActivity.this, \"Error\", Toast.LENGTH_SHORT).show();\n// }\n// }\n//\n// @Override\n// public void onFailure(@NonNull Call<List<UserReview>> call, @NonNull Throwable t) {\n// Toast.makeText(HomeActivity.this, \"Failure\", Toast.LENGTH_SHORT).show();\n// }\n// });\n //}\n }", "@Override\n public boolean onLoadMore(int page, int totalItemsCount, int firstVisibleItem) {\n if (loading) {\n getListDataByPaging(String.valueOf(page), firstVisibleItem);\n }\n // or loadNextDataFromApi(totalItemsCount);\n return true; // ONLY if more data is actually being loaded; false otherwise.\n }", "public interface BasePresenter {\n /**\n *获取数据的方法\n * @param offest 改项目中会大量用到分页加载,代表的是起始位置\n * @param size 每一页的条目个数\n */\n void getData(int offest, int size);\n\n}", "private void initLisiData() {\n\t\tif (isKefu) {\n\t\t\tlist = dbinstance.queryOtherChatRecord(page * a + \"\", b + \"\");\n\t\t} else {\n\t\t\tlist = dbinstance.queryPrivateChatRecord(\n\t\t\t\t\tUserInfoBean.getUserInfo(ChatPersonActivity.this).getUid(),\n\t\t\t\t\ttargetId, page * a + \"\", b + \"\");\n\t\t}\n\n\t\tif (list.size() > 0) {\n\t\t\tfor (PrivateChatMessagesEntity entity : list) {\n\n\t\t\t\tmDataArrays.add(0, entity);\n\t\t\t}\n\t\t\t// Collections.reverse(mDataArrays);\n\t\t}\n\t\tmAdapter = new PrivateChatMessagesAdapter(this, mDataArrays);\n\t\tmListView.setAdapter(mAdapter);\n\t\tmListView.setSelection(mAdapter.getCount() - 1);\n\t}", "public interface AddressActivityPresenter extends Presenter<AddressActivityView> {\n\n void getAddressList(Context mContext, int pageNum);\n\n}", "@Override\n public void onLoad(final int currentPage) {\n mModel.add(null);\n adapter.notifyItemInserted(mModel.size() - 1);\n\n //Delay loading for 5 seconds\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //Generate a new set of data\n Collection<Model> temp = generate(currentPage, 10);\n\n //Remove progress model_item\n mModel.remove(mModel.size() - 1);\n adapter.notifyItemRemoved(mModel.size() - 1);\n\n //Update model and view\n mModel.addAll(temp);\n adapter.setLoaded();\n //Not effective but suitable for demonstration\n adapter.notifyDataSetChanged();\n }\n }, 5000);\n }", "@Override\r\n\tpublic int getPaging() {\n\t\treturn 0;\r\n\t}", "@Override\r\n\tpublic String list() {\n\t\tList<HeadLine> dataList=new ArrayList<HeadLine>();\r\n\t\tPagerItem pagerItem=new PagerItem();\r\n\t\tpagerItem.parsePageSize(pageSize);\r\n\t\tpagerItem.parsePageNum(pageNum);\r\n\t\t\r\n\t\tLong count=headLineService.count();\r\n\t\tpagerItem.changeRowCount(count);\r\n\t\t\r\n\t\tdataList=headLineService.pager(pagerItem.getPageNum(), pagerItem.getPageSize());\r\n\t\tpagerItem.changeUrl(SysFun.generalUrl(requestURI, queryString));\r\n\t\t\r\n\t\trequest.put(\"DataList\", dataList);\r\n\t\trequest.put(\"pagerItem\", pagerItem);\r\n\t\t\r\n\t\t\r\n\t\treturn \"list\";\r\n\t}", "public PersonneAdapter(Context context, List<Personne> aListP) {\n mContext = context;\n mListP = aListP;\n mInflater = LayoutInflater.from(mContext);\n\n\n }", "public PagerViewAdapter(Context context, int[] list,\n\t\t\tList<InterestsDTO> list1, List<WhatAreYouDataDTO> list2,\n\t\t\tList<WhatAreYouDataDTO> list3, AppManager singleton) {\n\t\tthis.context = (Activity_ProfileDetails) context;\n\t\tthis.integerList = list;\n\t\tthis.interestList = list1;\n\t\tthis.whatAreYouDataList1 = list2;\n\n\t\tthis.whatAreYouDataList2 = list3;\n\t\tthis.singleton = singleton;\n\t\tintentValue = this.context.getIntent().getExtras()\n\t\t\t\t.getInt(AppConstants.COME_FROM);\n\t\timageLoader = new ImageLoader(this.context);\n\t\tif (intentValue != AppConstants.COME_FROM_UPDATE_PROFILE) {\n\t\t\tuserDTO = new UserDTO();\n\t\t}\n\t\tgpsTracker = new GPSTracker(context);\n\t\ttypefaceHeader = FontStyle.getFont(context,\n\t\t\t\tAppConstants.HelveticaNeueLTStd_Lt);\n\t}", "private void setupViewPager(ViewPager viewPager) {\n\n try {\n mFragmentList.clear();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n adapter.notifyDataSetChanged();\n\n mFragmentList.add(Constants.mMainActivity.productListPendingFragment);\n mFragmentTitleList.add(\"Pending\");\n\n mFragmentList.add(Constants.mMainActivity.productListApprovedFragment);\n mFragmentTitleList.add(\"Approved\");\n\n mFragmentList.add(Constants.mMainActivity.productListRejectedFragment);\n mFragmentTitleList.add(\"Rejected\");\n\n viewPager.setAdapter(adapter);\n }", "private void initializeViewPager() {\n mProductsViewPagerAdapter = new ProductsViewPagerAdapter(this, mMobileImages);\n mBinding.vPPdpProductImages.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\n @Override\n public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {\n }\n\n @Override\n public void onPageSelected(int position) {\n EcomUtil.setViewPagerSelectedDot(mBinding.vPPdpProductImages.getContext(), mDots,\n mDotsCount, position);\n }\n\n @Override\n public void onPageScrollStateChanged(int state) {\n }\n });\n }", "private void setImageListView(){\n imageListView.setHasFixedSize(true);\n GridLayoutManager layoutManager = new GridLayoutManager(context, 2);\n imageListView.setLayoutManager(layoutManager);\n imageAdapter = new ImageAdapter(photoList,\n imageListView, context);\n imageListView.setAdapter(imageAdapter);\n // Setup load more listener\n imageAdapter.setOnLoadMoreListener(new OnLoadMoreListener() {\n @Override\n public void onLoadMoreBrief() {\n // Add a progress bar\n photoList.add(null);\n imageAdapter.notifyItemInserted(photoList.size() - 1);\n\n Map<String, String> options = setSearchOptions(query, Constants.NOT_NEW_SEARCH);\n Call<SearchResponse> call = service.searchPhoto(options);\n call.enqueue(new Callback<SearchResponse>() {\n @Override\n public void onResponse(Response<SearchResponse> response, Retrofit retrofit) {\n SearchResponse result = response.body();\n if (result.getStat().equals(\"ok\")) {\n // Remove progress bar and add more photos to list\n photoList.remove(photoList.size() - 1);\n imageAdapter.notifyItemRemoved(photoList.size());\n if (result.getPhotos().getPhoto().size() != 0) {\n int size = imageAdapter.getItemCount();\n photoList.addAll(result.getPhotos().getPhoto());\n imageAdapter.notifyItemRangeInserted(size, photoList.size() - 1);\n imageAdapter.setLoaded();\n pageCount++;\n }\n } else {\n // Remove progress bar and display message if something wrong\n photoList.remove(photoList.size() - 1);\n imageAdapter.notifyItemRemoved(photoList.size());\n Toast.makeText(context, result.getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Log error here since request failed\n Toast.makeText(context, t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }\n });\n // To make sure the progress bar in a single view, not in a grid\n layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {\n @Override\n public int getSpanSize(int position) {\n int viewType = imageAdapter.getItemViewType(position);\n if (viewType == imageAdapter.VIEW_ITEM) {\n return 1;\n } else if (viewType == imageAdapter.VIEW_PEOG) {\n return 2;\n }\n return -1;\n }\n });\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tcount=pagerlistener.setpage();\n//\t\t\t\t initNewDatas(count);//得到新数据\n\t\t\t\tfightermessageadapter.notifyDataSetChanged();//刷新ListView;\n\t\t\t\ttopNewsMoreLV.loadCompleted();\n\t\t\t}", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n G.i(\"YOOOHO\");\n\n G.i(\"passed threshold p: \" + page + \" activity: \" + totalItemsCount);\n if (!noMorePost){\n loadPosts(Constant.POST_REQUEST_COUNT,totalItemsCount,page, searchPhrase);\n }else\n noMorePost = false;\n\n }", "@Override\n protected Void doInBackground(Void... params) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n //change the flag to be true\n loadingMore=true;\n //load data from url\n ArrayList<Recipe> recipe = Utils.fetchListOfRecipeData(stringUrl+current_page);\n ++current_page;\n recipesList.addAll(recipe);\n }\n });\n\n\n return null;\n }" ]
[ "0.6622916", "0.6463742", "0.64228123", "0.63610834", "0.63082856", "0.6173725", "0.6166341", "0.61479974", "0.6124236", "0.6077748", "0.6065351", "0.60600626", "0.6056318", "0.6045697", "0.6037454", "0.6001522", "0.6001522", "0.6001522", "0.5999334", "0.597815", "0.5952435", "0.595135", "0.593274", "0.59110844", "0.58929783", "0.58929783", "0.5884443", "0.58439815", "0.58378613", "0.5820274", "0.5801637", "0.58005136", "0.5798831", "0.57943237", "0.5793184", "0.5788498", "0.57796425", "0.5777054", "0.5774556", "0.57741266", "0.57741266", "0.57711685", "0.57674843", "0.57607394", "0.5744161", "0.5739018", "0.5739018", "0.5727695", "0.57255715", "0.5721377", "0.57165563", "0.56994504", "0.5698365", "0.56967103", "0.5691399", "0.5686272", "0.56845313", "0.56735206", "0.56705827", "0.56667256", "0.5664531", "0.5650395", "0.5646084", "0.5634166", "0.56341404", "0.5628756", "0.56232446", "0.5601081", "0.5596823", "0.55931157", "0.55931157", "0.5579474", "0.5572455", "0.5568595", "0.55671245", "0.55644596", "0.5561813", "0.5556262", "0.55475885", "0.5543445", "0.5537998", "0.5535931", "0.55340564", "0.553228", "0.55268574", "0.55258936", "0.5524891", "0.55247563", "0.5522423", "0.55202675", "0.5520156", "0.55193865", "0.55179405", "0.551278", "0.551086", "0.55054677", "0.550321", "0.5503159", "0.5499857", "0.5498803" ]
0.7427808
0
observe new PagedLists and submit them to Adapter
LiveData<PagedList<Response>> pagedList();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void paginate() {\n List<ItemModel> old = adapter.getItems();\n List<ItemModel> New = new ArrayList<>(addList());\n CardStackCallback callback = new CardStackCallback(old, New);\n DiffUtil.DiffResult result = DiffUtil.calculateDiff(callback);\n adapter.setItems(New);\n result.dispatchUpdatesTo(adapter);\n }", "void onPagesAdded(List<Integer> pageList);", "private void pagination(){\n recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {\n @Override\n public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {\n super.onScrollStateChanged(recyclerView, newState);\n }\n\n @Override\n public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {\n super.onScrolled(recyclerView, dx, dy);\n\n if (dy>0){\n LinearLayoutManager layoutManager = (LinearLayoutManager) recyclerView.getLayoutManager();\n int lastItem = layoutManager.findLastCompletelyVisibleItemPosition(); //finds last visible item\n int currentTotalCount = layoutManager.getItemCount(); //find total number of displayed items\n\n if (mLoadingItems){\n if (currentTotalCount > previousTotal){\n mLoadingItems = false;\n previousTotal = currentTotalCount;\n }\n }\n if (!mLoadingItems && (currentTotalCount <= (lastItem +view_threshold))) {\n mLoadingItems = true;\n //Increment number of items on the list\n firstItemVisible = firstItemVisible+10;\n lastItemVisible = lastItemVisible+10;\n //Update adapter\n jsonParse();\n }\n }\n }\n });\n }", "public abstract RecyclerViewPaginationAdapter<TItem, ?> getNewInstanceOfListAdapter(List<TItem> initialItems);", "@Command\n\t@NotifyChange(\"*\")\n\tpublic void paginarLista(){\n\t\tint page=pagAnalistas.getActivePage();\n\t\tcambiarAnalistas(page, null, null);\n\t}", "private void pagination()\n {\n if (value==0)\n {\n aBoolean=true;\n setAdapter(postModels);\n value=1;\n count=count+10;\n }\n else if (value==1)\n {\n if (count<page_count)\n {\n aBoolean=true;\n count=count+10;\n temp_list.addAll(postModels);\n adapter.notifyDataSetChanged();\n }\n }\n }", "@Override\n public void onLoadMore() {\n if (searchbeanArrayList_new.size() != 0) {\n\n\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n // remove progress item\n\n\n //add items one by one\n\n if (pageTokenAvailable) {\n smoothProgressBar.setVisibility(View.VISIBLE);\n\n current_start += 10;\n\n // searchbean_post_data.getStart_limit()+=10;\n\n searchbean_post_data.setStart_limit(current_start);\n\n\n findDataFromServer();\n\n\n //or you can add all at once but do not forget to call mAdapter.notifyDataSetChanged();\n }\n\n\n }\n }, 2000);\n\n }\n\n }", "private void updateList() {\n Model.instace.getAllArticles(new ArticleFirebase.GetAllArticlesAndObserveCallback() {\n @Override\n public void onComplete(List<Article> list) {\n data.clear();\n data = list;\n adapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancel() {\n\n }\n });\n }", "List<Item<T>> addItemsForPage(final long page);", "@Override\n\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\tpresenter.loadRecordsPage(page);\n\t\t}", "public abstract void onLoadMore(int page, int totalItemsCount);", "public abstract void onLoadMore(int page, int totalItemsCount);", "public void paginationLoading() {\n mTvShows.add(null);\n notifyItemInserted(mTvShows.size() - 1);\n }", "public void paging(ModelAndView mav);", "@Override\n public void onPageChanged(int page, int pageCount) {\n }", "private void loadMoreItems() {\n isLoading = true;\n\n currentPage += 1;\n\n Call findMyFeedVideosCall = vimeoService.findMyFeedVideos(currentPage, PAGE_SIZE);\n calls.add(findMyFeedVideosCall);\n findMyFeedVideosCall.enqueue(findMyFeedVideosNextFetchCallback);\n }", "public interface BasePageAdapter<T> {\n void clearAll();\n\n void addAll(List<T> list);\n}", "@Override\n public void onLoadMoreItems() {\n if (mAdapter.hasMoreItems()) {\n requestData(mAdapter.getItems() == null ? 0 : mAdapter.getItems().size(), false);\n } else {\n mAdapter.onFinishLoading(false);\n }\n }", "public void updateAfterAddition(List<Integer> pageList) {\n int pageNum = Collections.min(pageList);\n mDocPagesModified = true;\n int pageCount;\n boolean shouldUnlockRead = false;\n try {\n mPdfViewCtrl.docLockRead();\n shouldUnlockRead = true;\n final PDFDoc doc = mPdfViewCtrl.getDoc();\n if (doc == null) {\n return;\n }\n pageCount = doc.getPageCount();\n } catch (Exception ex) {\n AnalyticsHandlerAdapter.getInstance().sendException(ex);\n return;\n } finally {\n if (shouldUnlockRead) {\n mPdfViewCtrl.docUnlockRead();\n }\n }\n\n try {\n mDataList.clear();\n for (int p = 1; p <= pageCount; p++) {\n Map<String, Object> itemMap = new HashMap<>();\n itemMap.put(ThumbnailsViewAdapter.PAGE_NUMBER_SRC, p);\n itemMap.put(ThumbnailsViewAdapter.THUMB_IMAGE, null);\n add(itemMap);\n }\n } catch (Exception ignored) {\n }\n\n Utils.safeNotifyDataSetChanged(this);\n safeScrollToPosition(pageNum - 1);\n }", "@Override\n\t\tpublic void initList() {\n\t\t\tadapter = new MsgItemAdapter(context);\n\t\t\tArrayList<MsgBean> datas = getData();\n\t\t\tadapter.setData(datas);\n\t\t\tmListView.setAdapter(adapter);\n\t\t\tmListView.setViewMode(true, true);\n\t\t\tif(!DataValidate.checkDataValid(datas)){\n\t\t\t\tpageView.setDefaultPage().setVisibility(View.VISIBLE);\n\t\t\t}\n\t\t}", "@Override\n\t\tpublic void onLoadMore() {\n\t\t\tdaoIndex++;\n\t\t\tgetData();\n\t\t\tadapter.notifyDataSetChanged();\n\t\t\tonLoad();\n\t\t}", "private void refreshListView() {\n\t\t\tisEnd=false;\n\t\t\tlistView.setMode(Mode.PULL_FROM_START);\n\t\t\tjsonArray=new JSONArray();\n\t\t\tcurrentPage=0;\n\t\t\tgetSharePage(++currentPage);\n\t\t\t\n\t\t}", "public void setSearchOperation(List<Post> newList)\n {\n notifyDataSetChanged();\n }", "@Override\n public void onLoad(final int currentPage) {\n mModel.add(null);\n adapter.notifyItemInserted(mModel.size() - 1);\n\n //Delay loading for 5 seconds\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n //Generate a new set of data\n Collection<Model> temp = generate(currentPage, 10);\n\n //Remove progress model_item\n mModel.remove(mModel.size() - 1);\n adapter.notifyItemRemoved(mModel.size() - 1);\n\n //Update model and view\n mModel.addAll(temp);\n adapter.setLoaded();\n //Not effective but suitable for demonstration\n adapter.notifyDataSetChanged();\n }\n }, 5000);\n }", "@Override\n\t\t\tpublic void onLoadMore(int page, int totalItemsCount) {\n\t\t\t\tpopulateTimeline();\n\t\t\t}", "@Override\n\t\t\tpublic void onRefresh() {\n\t\t\t\tcurPage = 1;\n\t\t\t\tmList.clear();\n\t\t\t\tJiaoYiJiLuExec.getInstance().getTiXianJiLuList(mHandler,\n\t\t\t\t\t\tManagerUtils.getInstance().yjtc.getId(), curPage,\n\t\t\t\t\t\tpageSize, NetworkAsyncCommonDefines.GET_TXJL_LIST_S,\n\t\t\t\t\t\tNetworkAsyncCommonDefines.GET_TXJL_LIST_F);\n\t\t\t}", "@Override\n protected void onResume() {\n getList(currentPage.toString(), tag);\n super.onResume();\n }", "public void refreshListAdapter() {\n adapter.setListContent(requests);\n //We in turn set the adapter to the RecyclerView\n recyclerView.setAdapter(adapter);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n notificationID = notifications.get(notifications.size()-1).getID();\n feachNotificationsFromApi(notificationID);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextPosts(page);\n hideProgressBar();\n }", "@Override\n\tpublic void onRefresh() {\n\t\tpage = 1;\n\t\tSystem.out.println(\"onRefresh1\");\n\t\tmyList.clear();\n\t\tSystem.out.println(\"onRefresh2\");\n\t\tgetData();\n\t}", "private void LoadItems() {\n\n Call<NewsResponce> callNews = null;\n\n if (SourceId != null && DateTo != null && DateAt != null) {\n callNews = newsApiInterface.GetEverything(NewsClient.API_KEY, DateAt, DateTo, currentPage, SourceId);\n\n } else if (SourceId != null && DateAt != null) {\n callNews = newsApiInterface.GetEverything(NewsClient.API_KEY, DateAt, currentPage, SourceId);\n\n } else if (SourceId != null && DateTo != null) {\n callNews = newsApiInterface.GetEverythingDateTo(NewsClient.API_KEY, DateTo, currentPage, SourceId);\n\n } else {\n DialogAlert(R.string.dialog_title_no_criterias, R.string.dialog_message_no_criterias);\n }\n\n if (callNews != null)\n callNews.enqueue(new Callback<NewsResponce>() {\n @Override\n public void onResponse(Call<NewsResponce> call, final Response<NewsResponce> response) {\n if (response.body() != null) {\n if (response.body().getTotalResults() > articleList.size()) {\n articleList.addAll(response.body().getArticles());\n newsAdapter.notifyDataSetChanged();\n ++currentPage;\n }\n } else\n articleList.clear();\n\n Log.d(TAG, articleList.size() + \"\");\n }\n\n @Override\n public void onFailure(Call<NewsResponce> call, Throwable t) {\n Log.e(TAG, t.getMessage());\n }\n });\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextFeedPage(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextData(page);\n }", "@Override\n public void run() {\n\n if (pageTokenAvailable) {\n smoothProgressBar.setVisibility(View.VISIBLE);\n\n current_start += 10;\n\n // searchbean_post_data.getStart_limit()+=10;\n\n searchbean_post_data.setStart_limit(current_start);\n\n\n findDataFromServer();\n\n\n //or you can add all at once but do not forget to call mAdapter.notifyDataSetChanged();\n }\n\n\n }", "@Override\n public void onLoadMoreRecycleViewDataListner(int page, int totalItemsCount, RecyclerView view)\n {\n\n mRecyclerViewScrollToEndObserver.setLoadingData(true);\n if(!mIsLastPageLoaded)\n {\n mRecyclerView.post(new Runnable()\n {\n @Override\n public void run()\n {\n mTopStoryItems.add(mTopStoryLoadingMoreItem);\n mTopStoriesAdapter.updateData(mTopStoryItems);\n mTopStoriesRecyclerViewModelCallbackHandler.notifyLoadMoreTopStories();\n }\n });\n }\n }", "@Override\n public void onNext(List<Activitys> activityses) {\n if (mActivityses==null) {\n mActivityses = new ArrayList<Activitys>();\n }\n mActivityses=activityses;\n setAdapter(mContext, activityses);\n\n }", "MyAdapter(List<FakeNews> myList) {\n list = myList;\n }", "public void updateUI() {\n appViewModel.usersList.observe(getViewLifecycleOwner(), new Observer<PagedList<UserModel>>() {\n @Override\n public void onChanged(PagedList<UserModel> userModels) {\n adapter.submitList(userModels);\n adapter.notifyDataSetChanged();\n }\n });\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tlistitem.clear();\n\t\t\t\tnew AsyncTask<Void, Void, Void>() {\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\tgetmessage_list(1);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void onPostExecute(Void result) {\n\t\t\t\t\t\tif (count >= 19) {\n\t\t\t\t\t\t\txListView.startLoadMore();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\txListView.stopLoadMore();\n\t\t\t\t\t\t}\n\t\t\t\t\t\txListView.setRefreshSuccess();\n\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\tLog.d(TAG, \"jieshu\");\n\t\t\t\t\t}\n\t\t\t\t}.execute(null, null, null);\n\t\t\t}", "public void loadAllLists(){\n }", "@Override\n\tpublic void initListData(final int page) {\n\t\tif (list == null) {\n\t\t\tlist = new ArrayList<FaultBean>();\n\t\t}\n\t\t\n\t\t// page值为1时,表明巡检状态可能发生了变化,所以数据需要进行初始化。当适配器mAapter非空时,表明有数据,所以需要通知列表刷新\n\t\tif (page == 1) {\n\t\t\tlist.clear();\n\t\t\tif (mAdapter != null) { // 一定要做通知刷新处理,否则可能会报错\n\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t}\n\t\t}\n\n\t\tmHandler.post(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tUserHttp.accidentHandlingHistoryQuery(page, num, \"defectTime\",\n\t\t\t\t\t\t\"desc\", MyApp.userInfo.getStaffId(), new HttpDataCallBack() {\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void HttpSuccess(String _result) {\n\t\t\t\t\t\t\t\tgetAccidentRepairListData(_result);\n\t\t\t\t\t\t\t\tmHandler.obtainMessage(MESSAGE_SUCCESS)\n\t\t\t\t\t\t\t\t\t\t.sendToTarget();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\t\t\t\t\t\t\t\tmHandler.obtainMessage(MESSAGE_FAILED)\n\t\t\t\t\t\t\t\t\t\t.sendToTarget();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "@Override\n public void loadItems(){\n Log.d(\"Presenter\",\"Loading Items\");\n mRepository.getItems(new DataSource.LoadItemsCallback() {\n @Override\n public void onItemsLoaded(List<Session> sessions) {\n Log.d(\"PRESENTER\",\"Loaded\");\n\n //mView.showItems(Items);\n }\n\n @Override\n public void onDataNotAvailable() {\n Log.d(\"PRESENTER\",\"Not Loaded\");\n }\n });\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadNextDataFromApi(page);\n }", "private void setList() {\n Log.i(LOG,\"+++ setList\");\n txtCount.setText(\"\" + projectTaskList.size());\n if (projectTaskList.isEmpty()) {\n return;\n }\n\n projectTaskAdapter = new ProjectTaskAdapter(projectTaskList, darkColor, getActivity(), new ProjectTaskAdapter.TaskListener() {\n @Override\n public void onTaskNameClicked(ProjectTaskDTO projTask, int position) {\n projectTask = projTask;\n mListener.onStatusUpdateRequested(projectTask,position);\n }\n\n\n });\n\n mRecyclerView.setAdapter(projectTaskAdapter);\n mRecyclerView.scrollToPosition(selectedIndex);\n\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n loadMoreRecyclerViewData(hal[0]);\n hal[0]++;\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n customLoadMoreDataFromApi(page);\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount) {\n customLoadMoreDataFromApi(page);\n // or customLoadMoreDataFromApi(totalItemsCount);\n }", "@Override\n\t\t\tpublic void onScrollStateChanged(RecyclerView recyclerView,\n\t\t\t\t\tint newState) {\n\t\t\t\tsuper.onScrollStateChanged(recyclerView, newState);\n\t\t\t\tif (newState == RecyclerView.SCROLL_STATE_IDLE\n\t\t\t\t\t\t&& lastVisibleItem + 1 == mTiXianJiLuAdapter\n\t\t\t\t\t\t\t\t.getItemCount()) {\n\t\t\t\t\tswiperefreshlayout.setRefreshing(true);\n\t\t\t\t\tcurPage++;\n\t\t\t\t\tJiaoYiJiLuExec.getInstance().getTiXianJiLuList(mHandler,\n\t\t\t\t\t\t\tManagerUtils.getInstance().yjtc.getId(),\n\t\t\t\t\t\t\tcurPage, pageSize,\n\t\t\t\t\t\t\tNetworkAsyncCommonDefines.GET_TXJL_LIST_S,\n\t\t\t\t\t\t\tNetworkAsyncCommonDefines.GET_TXJL_LIST_F);\n\t\t\t\t}\n\n\t\t\t}", "@Override\n\t public void onLoadMore(int page, int totalItemsCount) {\n\t customLoadMoreDataFromApi(); \n // or customLoadMoreDataFromApi(totalItemsCount); \n\t }", "@Override\n\t public void onLoadMore(int page, int totalItemsCount) {\n\t customLoadMoreDataFromApi(page); \n // or customLoadMoreDataFromApi(totalItemsCount); \n\t }", "@Override\n public void onPageSelected(int position) {\n viewPager.getAdapter().notifyDataSetChanged();\n Log.d(\"ADebugTag\", \"***************notifyDataSetChanged*************** \");\n\n }", "private void addDataForListView() {\n \t\n \tif(loadable)\n \t{\t\n \tloadable = false;\n \tdirection = BACKWARD;\n \tstrUrl = Url.composeHotPageUrl(type_id, class_id, last_id);\n \trequestData();\n \t}\n\t}", "@Override\n public void onSuccess(List<BlocksByHeightQuery.Datum> list) {\n List<com.arcblock.btcblockviewer.BlocksByHeightQuery.Datum> oldList = new ArrayList<>();\n oldList.addAll(mBlocks);\n\n // set mBlocks with new data\n mBlocks = list;\n DiffUtil.DiffResult result = DiffUtil.calculateDiff(new CoreKitDiffUtil<>(oldList, mBlocks), true);\n // need this line , otherwise the update will have no effect\n mListBlocksAdapter.setNewListData(mBlocks);\n result.dispatchUpdatesTo(mListBlocksAdapter);\n\n refreshNextAndPre();\n\n //2. view status change and loadMore component need\n if (mPagedQueryHelper.isHasMore()) {\n mListBlocksAdapter.setEnableLoadMore(true);\n mListBlocksAdapter.loadMoreComplete();\n } else {\n mListBlocksAdapter.loadMoreEnd();\n }\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n System.out.println(\"load more\" + totalItemsCount);\n loadMore(totalItemsCount);\n }", "@Override\n public void onMultiPageLoad(@Nullable ArrayList<LocalResult> localResultArrayList) {\n if (localResultArrayList == null) return;\n\n //update page number\n pageNumber = localResultArrayList.size()-1;\n //update nextUrl\n nextUrl = localResultArrayList.get(pageNumber).getNextUrl();\n //check if there's more data to fetch\n hasMoreData = isThereMoreData();\n\n //update the respective fragments with multiple pages of data\n if (fragments[LIST] != null) {\n ((SuggestionsListFragment) fragments[LIST]).onMultiPageLoad(localResultArrayList, selectedIdsMap, hasMoreData);\n }\n\n if (fragments[MAP] != null) {\n ((SuggestionsClusterMapFragment) fragments[MAP]).onMultiPageLoad(localResultArrayList, selectedIdsMap, hasMoreData);\n }\n }", "protected CoolPagedListAdapter(Context context) {\n super(diffCallback);\n this.context = context;\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n pageNumberBeingQueried = page;\n\n /*\n * Loader call - case 2 of 3\n * We call loader methods in case our recycler view is running out of items for display\n * */\n manageLoaders();\n }", "@Override\n public void onLoadMore(int page, int totalItemsCount, RecyclerView view) {\n Log.d(\"DEBUG\", \"network continue load before count:\" + tweets.size());\n loadNextDataFromApi(page, view);\n }", "public void customLoadMoreDataFromApi() {\n // This method probably sends out a network request and appends new data items to your adapter. \n // Use the offset value and add it as a parameter to your API request to retrieve paginated data.\n // Deserialize API response and then construct new objects to append to the adapter\n \tmakeGoogleApiCall();\n \t\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tcount=pagerlistener.setpage();\n//\t\t\t\t initNewDatas(count);//得到新数据\n\t\t\t\tfightermessageadapter.notifyDataSetChanged();//刷新ListView;\n\t\t\t\ttopNewsMoreLV.loadCompleted();\n\t\t\t}", "private void setup() {\n adapter = new HomeAdapter(this);\n\n linearLayoutManager = new LinearLayoutManager\n (this, LinearLayoutManager.VERTICAL, false);\n rv.setLayoutManager(linearLayoutManager);\n rv.setItemAnimator(new DefaultItemAnimator());\n\n rv.setAdapter(adapter);\n showWait();\n if (NetworkUtils.isNetworkConnected(this)) {\n\n presenter.loadPage(currentPage);\n } else {\n onFailure(NetworkError.NETWORK_ERROR_MESSAGE);\n }\n rv.addOnScrollListener(new PaginationScrollListener(linearLayoutManager) {\n @Override\n protected void loadMoreItems() {\n AppLogger.d(TAG,\"currentPage:\"+currentPage);\n isLoading = true;\n currentPage += 1;\n presenter.loadPage(currentPage);\n\n\n }\n\n @Override\n public int getTotalPageCount() {\n AppLogger.d(TAG,\"TOTAL_PAGES:\"+TOTAL_PAGES);\n return TOTAL_PAGES;\n }\n\n @Override\n public boolean isLastPage() {\n return isLastPage;\n }\n\n @Override\n public boolean isLoading() {\n return isLoading;\n }\n });\n\n\n }", "@Override\n public void onChanged(List<Record> records) {\n RecordAdapter recordAdapter = new RecordAdapter(RecordListFragment.this.getContext(), records);\n listView.setAdapter(recordAdapter);\n }", "@Override\n\t\t\tpublic void onStart() {\n\t\t\t\tif (listitem != null || listitem.size() > 0) {\n\t\t\t\t\tlistitem.clear();\n\t\t\t\t}\n\t\t\t\tnew AsyncTask<Void, Void, Void>() {\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\n\t\t\t\t\t\tgetdata(1);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void onPostExecute(Void result) {\n\t\t\t\t\t\tif (count >= 19) {\n\t\t\t\t\t\t\txlistview.startLoadMore();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\txlistview.stopLoadMore();\n\t\t\t\t\t\t}\n\t\t\t\t\t\txlistview.setRefreshSuccess();\n\t\t\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t\t\t\tLog.d(TAG, \"jieshu\");\n\t\t\t\t\t}\n\t\t\t\t}.execute(null, null, null);\n\t\t\t}", "private void setImageListView(){\n imageListView.setHasFixedSize(true);\n GridLayoutManager layoutManager = new GridLayoutManager(context, 2);\n imageListView.setLayoutManager(layoutManager);\n imageAdapter = new ImageAdapter(photoList,\n imageListView, context);\n imageListView.setAdapter(imageAdapter);\n // Setup load more listener\n imageAdapter.setOnLoadMoreListener(new OnLoadMoreListener() {\n @Override\n public void onLoadMoreBrief() {\n // Add a progress bar\n photoList.add(null);\n imageAdapter.notifyItemInserted(photoList.size() - 1);\n\n Map<String, String> options = setSearchOptions(query, Constants.NOT_NEW_SEARCH);\n Call<SearchResponse> call = service.searchPhoto(options);\n call.enqueue(new Callback<SearchResponse>() {\n @Override\n public void onResponse(Response<SearchResponse> response, Retrofit retrofit) {\n SearchResponse result = response.body();\n if (result.getStat().equals(\"ok\")) {\n // Remove progress bar and add more photos to list\n photoList.remove(photoList.size() - 1);\n imageAdapter.notifyItemRemoved(photoList.size());\n if (result.getPhotos().getPhoto().size() != 0) {\n int size = imageAdapter.getItemCount();\n photoList.addAll(result.getPhotos().getPhoto());\n imageAdapter.notifyItemRangeInserted(size, photoList.size() - 1);\n imageAdapter.setLoaded();\n pageCount++;\n }\n } else {\n // Remove progress bar and display message if something wrong\n photoList.remove(photoList.size() - 1);\n imageAdapter.notifyItemRemoved(photoList.size());\n Toast.makeText(context, result.getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Log error here since request failed\n Toast.makeText(context, t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }\n });\n // To make sure the progress bar in a single view, not in a grid\n layoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {\n @Override\n public int getSpanSize(int position) {\n int viewType = imageAdapter.getItemViewType(position);\n if (viewType == imageAdapter.VIEW_ITEM) {\n return 1;\n } else if (viewType == imageAdapter.VIEW_PEOG) {\n return 2;\n }\n return -1;\n }\n });\n }", "@Override\n public void onLoadMoreBrief() {\n photoList.add(null);\n imageAdapter.notifyItemInserted(photoList.size() - 1);\n\n Map<String, String> options = setSearchOptions(query, Constants.NOT_NEW_SEARCH);\n Call<SearchResponse> call = service.searchPhoto(options);\n call.enqueue(new Callback<SearchResponse>() {\n @Override\n public void onResponse(Response<SearchResponse> response, Retrofit retrofit) {\n SearchResponse result = response.body();\n if (result.getStat().equals(\"ok\")) {\n // Remove progress bar and add more photos to list\n photoList.remove(photoList.size() - 1);\n imageAdapter.notifyItemRemoved(photoList.size());\n if (result.getPhotos().getPhoto().size() != 0) {\n int size = imageAdapter.getItemCount();\n photoList.addAll(result.getPhotos().getPhoto());\n imageAdapter.notifyItemRangeInserted(size, photoList.size() - 1);\n imageAdapter.setLoaded();\n pageCount++;\n }\n } else {\n // Remove progress bar and display message if something wrong\n photoList.remove(photoList.size() - 1);\n imageAdapter.notifyItemRemoved(photoList.size());\n Toast.makeText(context, result.getMessage(), Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onFailure(Throwable t) {\n // Log error here since request failed\n Toast.makeText(context, t.getMessage(), Toast.LENGTH_LONG).show();\n }\n });\n }", "public interface PaginatableView<Type> extends BaseView {\n void addItems(List<Type> items, boolean hasMore);\n\n void clearItems();\n\n void showLoading();\n\n void hideLoading();\n\n void showDataState();\n\n void showEmptyState();\n}", "private void setAdapterAndListener() {\r\n CustomPagerAdapter = new CustomPagerAdapter(getSupportFragmentManager(), PhotoViewActivity.this, dataModelArrayList);\r\n pager.setAdapter(CustomPagerAdapter);\r\n pager.setOffscreenPageLimit(3);\r\n pager.setCurrentItem(position);\r\n\r\n pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {\r\n @Override\r\n public void onPageScrolled(final int pos, float positionOffset, int positionOffsetPixels) {\r\n /*\r\n * Setting the title on toolbar\r\n * */\r\n position = pos;\r\n String name = dataModelArrayList.get(position).getFile().getName();\r\n String actualName = FileUtils.getSecureFileName(name);\r\n if (actualName != null && !actualName.equalsIgnoreCase(\"\")) {\r\n updateTileBar(actualName);\r\n } else {\r\n updateTileBar(name);\r\n }\r\n\r\n\r\n }\r\n\r\n\r\n @Override\r\n public void onPageSelected(int num) {\r\n int pos = 0;\r\n //Update the toolbar menu item on page change\r\n invalidateOptionsMenu();\r\n\r\n }\r\n\r\n @Override\r\n public void onPageScrollStateChanged(int state) {\r\n\r\n }\r\n });\r\n }", "public interface PaginationAdapterCallback {\n\n void retryPageLoad();\n}", "public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }", "private void syncListFormPage() {\n\t\tif (_listForm != null && _listForm.getDataTable() != null) {\r\n\t\t\tDataStoreBuffer listFormDs = _listForm.getDataStore();\r\n\t\t\tJspDataTable listFormDataTable = _listForm.getDataTable();\r\n\t\t\tif (listFormDs != null && listFormDataTable != null) {\r\n\t\t\t\tif (listFormDs.getRow() != -1) {\r\n\t\t\t\t\tif (!listFormDataTable.isRowOnPage(listFormDs.getRow())) {\r\n\t\t\t\t\t\tlistFormDataTable.setPage(listFormDataTable.getPage(listFormDs.getRow()));\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 interface PaginationAdapterCallback {\n void retryPageLoad();\n}", "public void customLoadMoreDataFromApi(int offset) {\n// Log.d(TAG, \"page = \" + offset);\n populateTimeline();\n // This method probably sends out a network request and appends new data items to your adapter.\n // Use the offset value and add it as a parameter to your API request to retrieve paginated data.\n // Deserialize API response and then construct new objects to append to the adapter\n }", "@Override\n public void onRefresh() {\n _page_number = 1;\n callGetNotifListWS();\n\n }", "private void updateAdapterForViewPager() {\n\n// Stops the page loading animation when response is received successfully\n binding.shimmerFrameLayoutVP.stopShimmer();\n binding.shimmerFrameLayoutVP.setVisibility(View.GONE);\n\n if (vp_adapter == null) {\n vp_adapter = new MainActivityVP_Adapter(this, now_playing_movies, this);\n binding.homeViewPagerID.setAdapter(vp_adapter);\n vp_adapter.notifyDataSetChanged();\n } else if (movieNow_vm.getListLiveDataMovieNow().getValue() != null) {\n vp_adapter = new MainActivityVP_Adapter(this, movieNow_vm.getListLiveDataMovieNow().getValue(), this);\n binding.homeViewPagerID.setAdapter(vp_adapter);\n } else {\n vp_adapter.notifyDataSetChanged();\n }\n\n }", "private void setViews() {\n try {\n mFilter = findViewById(R.id.filter);\n mPListView = findViewById(R.id.property_list_view);\n layoutManager = new LinearLayoutManager(this);\n mPListView.setLayoutManager(layoutManager);\n\n mPListView.addOnScrollListener(new RecyclerView.OnScrollListener() {\n @Override\n public void onScrolled(RecyclerView recyclerView, int dx, int dy) {\n super.onScrolled(recyclerView, dx, dy);\n totalItemCount = layoutManager.getItemCount();\n lastVisibleItem = layoutManager.findLastVisibleItemPosition();\n if (!isLoading && totalItemCount <= (lastVisibleItem + visibleThreshold)) {\n pageNo = pageNo + 1;\n getPropertyList(pageNo, applyFilter);\n isLoading = true;\n }\n }\n });\n\n mFilter.setOnClickListener(this);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "private void refreshListView() {\n model.updateAllFilteredLists(history.getPrevKeywords(), history.getPrevStartDate(),\n history.getPrevEndDate(), history.getPrevState(),\n history.getPrevSearches());\n }", "void onPaginate(MessageCreateEvent event, Message paginateMessage, T currentItem, int arrow, Paginator<T> paginator);", "public interface PostListResponseListener {\n void fireInitData(List<Post> posts);\n}", "@Override\n public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,\n int totalItemCount) {\n boolean loadMore;\n\n int ultimRegistreVist= firstVisibleItem + visibleItemCount;\n boolean loadMoreTmp = firstVisibleItem + visibleItemCount >= totalItemCount;\n\n if ((this.articles.size() == 100) && (loadMoreTmp)){\n //if ((this.articles.size() == 100) && (ultimRegistreVist >= totalItemCount)){\n loadMore = true;\n }\n else{\n loadMore = false;\n }\n\n if(loadMore && this.processes==0) {\n this.processes = 1;\n activity.obtainArticlesAsync(this.urlFinal + \"/\" +\n String.valueOf(this.articles.size() + 1),this.dialog, this.articles,\n this.listArticles,(ultimRegistreVist - visibleItemCount));\n\n }\n }", "private PagedListHolder<NewsArticle> populatePagedListHolder(final HttpServletRequest request) {\n @SuppressWarnings(\"unchecked\")\n PagedListHolder<NewsArticle> pagedListHolder =\n (PagedListHolder<NewsArticle>) request.getSession().getAttribute(ARTICLE_LIST);\n\n // If first time on page populate the pagedListHolder with the news articles\n if (pagedListHolder == null) {\n List<NewsArticle> articleList = newsService.listNewsArticles();\n LOGGER.log(Level.INFO, \"articleList - articleList.size(): {0}\", articleList.size());\n pagedListHolder = new PagedListHolder<NewsArticle>(articleList);\n } else {\n String page = request.getParameter(\"page\");\n if (\"next\".equals(page)) {\n pagedListHolder.nextPage();\n } else if (\"previous\".equals(page)) {\n pagedListHolder.previousPage();\n }\n }\n\n return pagedListHolder;\n }", "public void addAsPerFilterFirstLoad(List<Job> newJob){\n int currentSize = mJobList.size();\n //remove the current items\n mJobList.clear();\n //add all the new items\n mJobList.addAll(newJob);\n //tell the recycler view that all the old items are gone\n notifyItemRangeRemoved(0, currentSize);\n //tell the recycler view how many new items we added\n notifyItemRangeInserted(0, mJobList.size());\n }", "@Override\n public void refreshList() {\n }", "@Override\n\t\t\tpublic void onSuccess(int statusCode, Header[] headers, JSONObject response) {\n\t\t\t\tsuper.onSuccess(statusCode, headers, response);\n\t\t\t\ttry {\n\t\t\t\t\tJSONArray jsonArray = response.getJSONArray(\"List\");\n\t\t\t\t\tfor (int i = 0; i < jsonArray.length(); i++) {\n\t\t\t\t\t\tJSONObject j = jsonArray.getJSONObject(i);\n\n\t\t\t\t\t\tString createDate = j.optString(\"createDate\");\n\t\t\t\t\t\tString url = j.optString(\"url\");\n\t\t\t\t\t\tString name = j.optString(\"name\");\n\t\t\t\t\t\tint price = j.optInt(\"price\");\n\t\t\t\t\t\tint count = j.optInt(\"count\");\n\t\t\t\t\t\totherFee.add(new OtherFee(price, count, name, createDate, url));\n\t\t\t\t\t\tsize++;\n\t\t\t\t\t}\n\t\t\t\t\tif (size == 10) {\n\t\t\t\t\t\tpageIndex++;\n\t\t\t\t\t\tisend = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisend = true;\n\t\t\t\t\t}\n\t\t\t\t\tsize = 0;\n\t\t\t\t\tlv_otherfee.onRefreshComplete();\n\t\t\t\t\tlvadapter.notifyDataSetChanged();\n\t\t\t\t} catch (JSONException 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}", "@Override\n\tpublic void notifyDataSetChanged() {\n\t\tsuper.notifyDataSetChanged();\n\t\tsetIndexer(list);\n\t}", "private void additems() {\n MaVolleyRequest.getInstance(getApplicationContext()).GetMethodRequest(getLink(), null, new VolleyRequestOnResultListener() {\n @Override\n public void onSucces(String result) {\n Log.d(\"qwerty\", getLink());\n ResearchResultBeanz item = (new Gson()).fromJson((new Gson()).fromJson(result, JsonObject.class).getAsJsonObject(\"data\"), ResearchResultBeanz.class);\n if (adapter == null) {\n adapter = new GridViewAdapter2(ImageGridViewActivity.this, Utils.fromArrayToList(item.items));\n gridView.setAdapter(adapter);\n } else {\n adapter.appendData (Utils.fromArrayToList(item.items));\n }\n flag_loading = false;\n }\n @Override\n public void onFailure(String error) {\n makeToast(\"Loading failure\");\n flag_loading = false;\n }\n });\n }", "@Override\n\tpublic void onMyLoadMore() {\n\t\t\n\t}", "@Override\n\tpublic void onMyLoadMore() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void onSuccess(List<QiangYu> list) {\n\t\t\t\tLogUtils.i(TAG,\"find success.\"+list.size());\n\t\t\t\tif(list.size()!=0&&list.get(list.size()-1)!=null){\n\t\t\t\t\tif(mRefreshType==RefreshType.REFRESH){\n\t\t\t\t\t\tmListItems.clear();\n\t\t\t\t\t}\n\t\t\t\t\tif(list.size()<Constant.NUMBERS_PER_PAGE){\n\t\t\t\t\t\tLogUtils.i(TAG,\"已加载完所有数据~\");\n\t\t\t\t\t}\n\t\t\t\t\tif(MyApplication.getInstance().getCurrentUser()!=null){\n\t\t\t\t\t\tlist = DatabaseUtil.getInstance(mContext).setFav(list);\n\t\t\t\t\t}\n\t\t\t\t\tmListItems.addAll(list);\n\t\t\t\t\tmAdapter.notifyDataSetChanged();\n\t\t\t\t\t\n\t\t\t\t\tsetState(LOADING_COMPLETED);\n\t\t\t\t\tmPullRefreshListView.onRefreshComplete();\n\t\t\t\t}else{\n\t\t\t\t\tActivityUtil.show(getActivity(), \"暂无更多数据~\");\n\t\t\t\t\tpageNum--;\n\t\t\t\t\tsetState(LOADING_COMPLETED);\n\t\t\t\t\tmPullRefreshListView.onRefreshComplete();\n\t\t\t\t}\n\t\t\t}", "@Override\r\n\tpublic String list() {\n\t\tList<HeadLine> dataList=new ArrayList<HeadLine>();\r\n\t\tPagerItem pagerItem=new PagerItem();\r\n\t\tpagerItem.parsePageSize(pageSize);\r\n\t\tpagerItem.parsePageNum(pageNum);\r\n\t\t\r\n\t\tLong count=headLineService.count();\r\n\t\tpagerItem.changeRowCount(count);\r\n\t\t\r\n\t\tdataList=headLineService.pager(pagerItem.getPageNum(), pagerItem.getPageSize());\r\n\t\tpagerItem.changeUrl(SysFun.generalUrl(requestURI, queryString));\r\n\t\t\r\n\t\trequest.put(\"DataList\", dataList);\r\n\t\trequest.put(\"pagerItem\", pagerItem);\r\n\t\t\r\n\t\t\r\n\t\treturn \"list\";\r\n\t}", "@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tLog.i(\"\", \"Enter hereeeeeeeeeeeeeeeeeeeee(onPageSelected!!!\");\n\t\t\t\t\n\t\t\t\t//adapter.instantiateItem(pager, arg0);\n\t\t\t\tadapter.notifyDataSetChanged();\n\t\t\t}", "public void populateListView() {\n\n\n }", "public interface LastItemVisibleCallBack {\n void loadNextPage();\n}", "private void loadLists() {\n }", "public void setupArticlesList();", "@Override\n\tpublic void onLoadMore() {\n\t\tLog.d(\"load\", \"\");\n\t\tcurrentPage++;\n\t\tmodel.getPostsByType(userId, currentPage, method, postListiner);\n\t}", "@Override\n\t\t\t\t\tpublic void onSuccess(List<Dish> arg0) {\n\t\t\t\t\t\tif (arg0.size() > 0) {\n\n\t\t\t\t\t\t\tfor (Dish dish : arg0) {\n\t\t\t\t\t\t\t\tdishlist.add(dish);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdishadapter.notifyDataSetChanged();\n\t\t\t\t\t\t\tcurPage++;\n\t\t\t\t\t\t\t//toast(\"第\" + (page + 1) + \"页数据加载完成\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttoast(\"没有更多数据了\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "void notifyListItemInserted(int position);" ]
[ "0.7216349", "0.69829756", "0.6847604", "0.6724387", "0.6716962", "0.6642826", "0.64882606", "0.6359695", "0.6336479", "0.6322234", "0.6273398", "0.6273398", "0.6222075", "0.61945426", "0.619144", "0.61872965", "0.6142674", "0.6127696", "0.61096865", "0.61036605", "0.610182", "0.60919523", "0.6091218", "0.60873073", "0.60700697", "0.6065595", "0.6065406", "0.60628676", "0.60372776", "0.6007204", "0.6005676", "0.59977305", "0.598755", "0.59727085", "0.596893", "0.5967198", "0.5956211", "0.59540653", "0.594932", "0.593232", "0.5927872", "0.5927368", "0.5925817", "0.59218794", "0.59218794", "0.59218794", "0.5918706", "0.59182733", "0.59116155", "0.59116155", "0.59078115", "0.58991474", "0.5896278", "0.58922213", "0.58898205", "0.58858013", "0.5877082", "0.58764446", "0.5852609", "0.5849074", "0.5848172", "0.58463067", "0.584559", "0.5839905", "0.5802015", "0.5795615", "0.5787427", "0.5784834", "0.57620615", "0.57593757", "0.57512873", "0.5748282", "0.57405376", "0.5734451", "0.573238", "0.5730279", "0.57009655", "0.56953984", "0.5687702", "0.5687674", "0.56858605", "0.56839466", "0.56836885", "0.5679422", "0.567786", "0.56751406", "0.56646216", "0.5662427", "0.56520355", "0.56520355", "0.56470776", "0.5633272", "0.56328243", "0.5628654", "0.56191885", "0.56179386", "0.5615445", "0.5613047", "0.5609961", "0.55982095" ]
0.68971884
2
set request that will be used to retrieve all pages
void setRequest(Request req);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void getMall(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "void startPage(RequestContextHolder request);", "@Override\r\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t this.request = request;\r\n\t}", "void setPageSize(DriveRequest<?> request, Integer pageSize);", "@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request=request;\n\t}", "@Override\r\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\r\n\t}", "public void setServletRequest(HttpServletRequest request) {\n\t\t\tthis.request = request;\r\n\t\t\t\r\n\t\t}", "@Override\r\n\t\tpublic PageDescription setPageEnv(HttpServletRequest request) {\n\t\t\tList<PubItem> pubItem = PubDataReader.getPubItems(dbValue, nation);\r\n\t\t\trequest.setAttribute(\"PUB_TITLE\", dbValue + \":\" + nation);\r\n\t\t\trequest.setAttribute(\"PUBCONTENTS\", pubItem);\r\n\t\t\treturn new PubPageDesc(dbValue + \":\" + nation);\r\n\t\t}", "@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}", "@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}", "@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}", "public void setRequestPage(PageRequest pageable) {\n List<PlayInfo> playInfoList = new ArrayList<>();\n PlayInfo playInfo1 = new PlayInfo();\n playInfo1.name = \"Adventures of Huckleberry Finn\";\n playInfo1.briefIntro = \"a boy's story\";\n playInfo1.posterURL = \"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1521049025342&di=b8152a98cb6aee22fc5cdd20e2562bbb&imgtype=0&src=http%3A%2F%2Fwww.kfzimg.com%2FG05%2FM00%2F52%2F01%2Fp4YBAFfXiF2ASrT7AALI-jIjL0M031_b.jpg\";\n PlayInfo playInfo2 = new PlayInfo();\n playInfo2.name = \"Blue whale\";\n playInfo2.briefIntro = \"a big mammal\";\n playInfo2.posterURL = \"http://pic28.photophoto.cn/20130727/0035035114302168_b.jpg\";\n playInfoList.add(playInfo1);\n playInfoList.add(playInfo2);\n Resource<List<PlayInfo>> a = Resource.success(playInfoList);\n setValue(a);\n }", "public void setRequest(Request request)\n\t{\n\t\t// It would be mighty nice if request was final. However during multipart it needs to be set\n\t\t// to\n\t\t// MultipartServletWebRequest by Form. It can't be done before creating the request cycle\n\t\t// (in wicket filter)\n\t\t// because only the form knows max upload size\n\t\tthis.request = request;\n\t}", "void setRequest(HttpServletRequest req) {\r\n\t\t_req = req;\r\n\t\t_preq=null;\r\n\t}", "void setCurrentHTTP(HttpServletRequest request, HttpServletResponse response);", "ReviewService() {queryMap.put(PAGE_QUERY_PARAM, \"1\");}", "@Override\n protected final void parseRequest(final HttpServletRequest request, HttpServletResponse response) {\n\n parsePath(request);\n\n LOGGER.warning(\"[REST]: \" + request.getMethod() + \"|\" + apiName + \"/\" + resourceName + \"|\" + request.getHeader(\"Current-Page\"));\n\n // Fixes BS-400. This is ugly.\n I18n.getInstance();\n\n api = APIs.get(apiName, resourceName);\n api.setCaller(this);\n\n super.parseRequest(request, response);\n\n }", "public void setServletRequest(HttpServletRequest request) {\n\t\tthis.request = request;\n\t}", "private void buscarLista(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "public void setRequest(final String request) {\n this.request = request;\n }", "public void setCurrentRequest(Request request) {\n if (request != null) {\n this.currentRequest = request;\n goingTo = currentRequest.getRequestToFloor();\n currentFloor = currentRequest.getRequestFromFloor();\n }\n }", "@Override\n public void setServletRequest(HttpServletRequest arg0) {\n\n }", "@Override\r\n\tpublic Type getRequestType() {\n\t\treturn Type.PAGE;\r\n\t}", "@Override\n\tpublic void setServletRequest(HttpServletRequest arg0) {\n\t\t\n\t}", "@Override\n\tpublic void initRequest() {\n\n\t}", "public void setPage(Page page) {this.page = page;}", "public void setHttpRequest( HttpRequest req ) {\r\n\trequest=req;\r\n }", "@Override\n\tpublic void setServletRequest(HttpServletRequest request) {\n\t\tthis.request=request;\n\t\tthis.session=request.getSession();\n\t}", "private void show(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tInteger page = request.getParameter(\"page\") == \"\" || request.getParameter(\"page\") == null ? 1\r\n\t\t\t\t: Integer.valueOf(request.getParameter(\"page\"));\r\n\t\tint count = service.selectCount();\r\n\t\trequest.setAttribute(\"page\", page);\r\n\t\trequest.setAttribute(\"count\", count);\r\n\t\tList<Notice> list = service.selectAll((page - 1) * 5, 5);\r\n\t\trequest.setAttribute(\"list\", list);\r\n\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/GongGaoGuanLi.jsp\").forward(request, response);\r\n\t}", "private void initRequest()\n\t{\n\t\tthis.request = new RestClientReportRequest();\n\t\tRequestHelper.copyConfigsToRequest(this.getConfigs(), this.request);\n\t\tRequestHelper.copyParamsToRequest(this.getParams(), this.request);\n\t\t\n\t\tthis.performQuery();\n\t}", "public void setRequest(Map<String, Object> request)\r\n\t{\n\t\tthis.request = request;\r\n\t}", "private void listingPage(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{\n\t\trequest.setAttribute(\"files\", new FilesDAO().getFiles());\n\t\trequest.setAttribute(\"path\", path);\n\t\trequest.getRequestDispatcher(\"listingPage.jsp\").forward(request, response);\n\t}", "private void initializePageAttributes(HttpServletRequest request) {\n if (CommandUtils.paramClarifiedInQuery(request, \"id\")) {\n UUID issueId = UUID.fromString(request.getParameter(\"id\"));\n PeriodicalIssue issue = periodicalIssueService.getEntityByPrimaryKey(issueId);\n request.setAttribute(\"issue\", issue);\n }\n }", "@Override\n protected void init(PageDto page, HttpServletRequest request, HttpServletResponse response, Model model) {\n\n }", "protected int getInitialPage(HttpServletRequest request) {\n return 0;\n }", "public void setRequest(REQ request) {\n this.request = request;\n }", "void setPagination(Pagination pagination);", "@Override\n\tpublic void setTargetListOne(Page page, HttpServletRequest request) {\n\t\tpage.setTotalRows(DAOFactory.getChangeGiftDAO().getTotalRows());\n\t\tList<ChangeGift> changeGifts = DAOFactory.getChangeGiftDAO().findNotDeliveredByPage(page);\n\t\trequest.setAttribute(\"currentPage\", page);\n\t\trequest.setAttribute(\"changeGifts\", changeGifts);\n\t\t\n\t}", "private void searchItem(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String pageId = request.getParameter(\"pageid\");\n\n // return the pageId if number or return 0\n long id = pageId != null && Helper.isNumber(pageId) ? Long.parseLong(pageId) : 0;\n\n if (id != 0) {\n // get categoryItems with dessending order\n List<Item> categoryItems = new CategoryDaoImpl(getServletContext()).getCategoryItems(id, \"DESC\");\n\n // set categoryItems to request\n request.setAttribute(\"categoryItems\", categoryItems);\n\n // forword request to show category items page\n Helper.forwardRequest(request, response, ViewPath.show_category);\n } else {\n Helper.redriectToPrevPage(request, response, \"You Must Add Page ID\", true);\n }\n }", "@Override\n public String execute(HttpServletRequest request) {\n String page = null;\n int id = Integer.parseInt(request.getParameter(ID_PARAMETER));\n ArrayList<Client> list = ClientLogic.makeClientList(id);\n request.setAttribute(CLIENT_LIST,list);\n request.setAttribute(ID_PARAMETER,id);\n LOGGER.info(\"Admin take date about client\");\n page= ConfigurationManager.getProperty(\"path.page.client\");\n return page;\n }", "private void startRequest(int pager, String keyword) {\n ServeParam param = new ServeParam();\n param.pageNo = pager;\n param.type = ftype;\n param.keyword = keyword;\n// if (ftype == 3) {\n// Request.startRequest(param, pager, ServiceMap.worknewsList, mHandler, Request.RequestFeature.CANCELABLE, Request.RequestFeature.BLOCK);\n// }else {\n Request.startRequest(param, pager, ServiceMap.newsList, mHandler, Request.RequestFeature.CANCELABLE, Request.RequestFeature.BLOCK);\n// }\n }", "private static void setRequest(Object request) {\n\t\tif (null != request) {\n\t\t\tMDC.put(ApplicationConstants.REQUEST, request.toString());\n\t\t}\n\t}", "@Override\r\n\tpublic void getRequest(Request request, Response response) {\r\n\t\tlistUsers(request, response);\r\n\t}", "private void GongGaoTongZhi(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\t\tInteger page = request.getParameter(\"page\") == \"\" || request.getParameter(\"page\") == null ? 1\r\n\t\t\t\t: Integer.valueOf(request.getParameter(\"page\"));\r\n\t\trequest.setAttribute(\"page\", page);\r\n\t\tUser user = (User) request.getSession().getAttribute(SessionKey.USER_LOGIN);\r\n\t\tList<Notice> list = service.selectAll((page - 1) * 5, 5, user);\r\n\t\trequest.setAttribute(\"list\", list);\r\n\t\trequest.setAttribute(\"count\", list.size());\r\n\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/GongGaoTongZhi.jsp\").forward(request, response);\r\n\t}", "@Override\r\n\tpublic void find(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tURL1=\"/admin/xiaoshuolist.jsp\";\r\n\t\tthis.searchFields=\"title,content,categorytitle,author\";\r\n\t\tsuper.find(request, response);\r\n\t}", "private Request() {\n initFields();\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n int currentPage = Integer.parseInt(request.getParameter(\"currentPage\"));\n // 2. get data from database by \"currentPage\"\n StudentService studentService = new StudentServiceImpl();\n try {\n PageBean<Student> studentPageBean = studentService.findStudentByPage(currentPage);\n // 3. store data into request\n request.setAttribute(\"studentPageBean\", studentPageBean);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n // 4. jump to\n request.getRequestDispatcher(\"list_pages.jsp\").forward(request, response);\n }", "void getRequests();", "void setQueryRequestUrl(String queryRequestUrl);", "public Set getPages () {\n return pages;\n }", "private void changeRequest(InstanceRequest request) {\r\n\t\t\r\n\t}", "protected abstract void onRequestPage(boolean isRequestNext,int fromIndex,int toIndex,float x,float y);", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setRequest(Request param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void initRequest() {\n repo.getData();\n }", "public void setPage(int value) {\n this.page = value;\n }", "public void setRequest(QueryDoctor param) {\r\n localRequestTracker = param != null;\r\n\r\n this.localRequest = param;\r\n }", "public void setReq(HttpServletRequest req) {\r\n\t\t_req = req;\r\n\t}", "protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n ArrayList<GroupModel> all=GroupDao.display();\n request.setAttribute(\"group\",all);\n RequestDispatcher rds=request.getRequestDispatcher(\"DisplayGroup.jsp\");\n rds.forward(request, response);\n \n \n\n \n }", "public void setPage(Integer page) {\n this.page = page;\n }", "public void setRequestUrl(String requestUrl){\n this.requestUrl = requestUrl;\n }", "public void setPage(Page page) {\n this.page=page;\n }", "public void setPage(Page page) {\n this.page=page;\n }", "protected abstract void nextRequest ();", "private void loadStoriesIntoRequest(HttpServletRequest request) {\n ArrayList<StoryModel> storiesList = StoryDao.getStories();\n\n // We're going to convert the array list to an array because it works better in the JSP.\n StoryModel[] stories = storiesList.toArray(new StoryModel[storiesList.size()]);\n request.setAttribute(\"stories\", stories);\n }", "private WebRequest() {\n initFields();\n }", "@Override\n\tpublic void setTargetListThree(Page page, HttpServletRequest request) {\n\t\t\n\t}", "protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\t\tresponse.setHeader(\"Cache-Control\", \"no-cache, no-store, must-revalidate\"); \r\n\t\t\t\tresponse.setHeader(\"Pragma\", \"no-cache\"); \r\n\t\t\t\tresponse.setHeader(\"Expires\", \"0\");\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\tList<String> nombresPaises=servicePais.recuperarPaises().keySet().stream().sorted().collect(Collectors.toList());\r\n\t\t\r\n\t\tServletContext context= request.getServletContext();\r\n\t\t\r\n\t\tcontext.setAttribute(\"nombresPaises\", nombresPaises);\r\n\t\t\r\n\t}", "public void setResponsePage(IRequestablePage page)\n\t{\n\t\tif (page instanceof Page)\n\t\t{\n\t\t\t((Page) page).setStatelessHint(false);\n\t\t}\n\n\t\tscheduleRequestHandlerAfterCurrent(new RenderPageRequestHandler(new PageProvider(page),\n\t\t\tRenderPageRequestHandler.RedirectPolicy.AUTO_REDIRECT));\n\t}", "public void setPage(int page) {\n this.page = page;\n }", "public static String paginate(HttpServletRequest request, HttpServletResponse response) {\n List page = FastList.newInstance();\n Paginator paginator = PaginatorFactory.getPaginator(request);\n String action = UtilCommon.getParameter(request, \"action\");\n String pageNumberString = UtilCommon.getParameter(request, \"pageNumber\");\n \n if (paginator != null) {\n try {\n if (pageNumberString != null) {\n try {\n long pageNumber = Long.parseLong(pageNumberString);\n page = paginator.getPageNumber(pageNumber);\n }\n catch (NumberFormatException e) {\n Debug.logWarning(\"Failed to get page numer [\" + pageNumberString + \"] to to format error: \" + e.getMessage(), module);\n page = paginator.getCurrentPage();\n }\n }\n else if (action == null || \"getCurrentPage\".equals(action)) {\n page = paginator.getCurrentPage();\n }\n else if (\"getNextPage\".equals(action)) {\n page = paginator.getNextPage();\n }\n else if (\"getPreviousPage\".equals(action)) {\n page = paginator.getPreviousPage();\n }\n else if (\"getFirstPage\".equals(action)) {\n page = paginator.getFirstPage();\n }\n else if (\"getLastPage\".equals(action)) {\n page = paginator.getLastPage();\n }\n else {\n Debug.logWarning(\"Paginate action [\" + action + \"] not supported.\", module);\n page = paginator.getCurrentPage();\n }\n }\n catch (ListBuilderException e) {\n return doListBuilderExceptionResponse(request, response, paginator, e);\n }\n }\n return doPaginationResponse(request, response, paginator, page);\n }", "protected ActionForward currentPage( UserRequest request )\n {\n int pageNumber = request.getParameterAsInt( PAGE_KEY, 1 );\n HttpServletRequest req = request.getRequest();\n req.setAttribute( PAGE_KEY, \"\" + pageNumber );\n return request.getMapping().findForward( PAGE_KEY + pageNumber );\n }", "@Override\n protected void onNextPageRequested(int page) {\n\n }", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}" ]
[ "0.63901067", "0.63346946", "0.6311434", "0.6278571", "0.62619656", "0.62395227", "0.62269425", "0.6200821", "0.6180123", "0.6180123", "0.6180123", "0.61652035", "0.61566687", "0.61447465", "0.60789007", "0.6058626", "0.60451233", "0.601836", "0.5992029", "0.59807783", "0.5956759", "0.5953546", "0.594519", "0.5916348", "0.5911896", "0.5911449", "0.59085613", "0.590821", "0.58924496", "0.5878655", "0.5860384", "0.5848777", "0.5844178", "0.5816226", "0.5766262", "0.5763083", "0.5750062", "0.5738024", "0.57261455", "0.57069063", "0.56958485", "0.5681625", "0.567383", "0.5670825", "0.56542647", "0.5654116", "0.56405115", "0.5637983", "0.56215084", "0.5614232", "0.5606954", "0.55679554", "0.5536668", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.55357474", "0.5534399", "0.5526011", "0.55232686", "0.55164474", "0.54969573", "0.5489451", "0.5487876", "0.5482407", "0.5482407", "0.5471621", "0.54684514", "0.54647136", "0.54534394", "0.5439768", "0.54390687", "0.54327214", "0.5428022", "0.5417317", "0.54169196", "0.54166436" ]
0.62676454
4
force the list to refresh
void invalidate();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void refreshList() {\n }", "public void reload(){\n populateList();\n }", "private void refreshList() {\n\n Requester.getInstance().cancelPendingRequests(BrowseCoursesNew.TAG);\n mWishListAdapter.clearData();\n\n refreshView();\n\n wishCourses = new WishCourses(mHandler);\n wishCourses.sendWishlistCoursesRequest();\n }", "private void refreshList() {\n if (loadStepsTask != null) {\n loadStepsTask.cancel(false);\n }\n loadStepsTask = new LoadStepsTask(this, dbManager);\n loadStepsTask.execute();\n }", "@Override\n public void refreshList(ArrayList<String> newList){\n }", "@Override\n\tpublic void refreshData(){\n\t\tpageNum = 1;\n\t\tlist.clear();\n\t\tloadData();\n\t}", "private void updateList() {\n Model.instace.getAllArticles(new ArticleFirebase.GetAllArticlesAndObserveCallback() {\n @Override\n public void onComplete(List<Article> list) {\n data.clear();\n data = list;\n adapter.notifyDataSetChanged();\n }\n\n @Override\n public void onCancel() {\n\n }\n });\n }", "public void refreshList() {\n mCursor.requery();\n mCount = mCursor.getCount() + mExtraOffset;\n notifyDataSetChanged();\n }", "private void refreshListView() {\n model.updateAllFilteredLists(history.getPrevKeywords(), history.getPrevStartDate(),\n history.getPrevEndDate(), history.getPrevState(),\n history.getPrevSearches());\n }", "public void refreshLists() {\n refreshCitizenList();\n refreshPlayerList();\n }", "private void refreshList() {\n List<PullRequest> storedPullRequests = mDataManager.getPullRequests();\n\n mPullRequests.clear();\n\n for (PullRequest pullRequest : storedPullRequests) {\n mPullRequests.add(pullRequest);\n }\n\n mAdapter.notifyDataSetChanged();\n\n mDialog.dismiss();\n }", "@Override\n\t\t\tpublic void onRefresh() {\n\t\t\t\tcurPage = 1;\n\t\t\t\tmList.clear();\n\t\t\t\tJiaoYiJiLuExec.getInstance().getTiXianJiLuList(mHandler,\n\t\t\t\t\t\tManagerUtils.getInstance().yjtc.getId(), curPage,\n\t\t\t\t\t\tpageSize, NetworkAsyncCommonDefines.GET_TXJL_LIST_S,\n\t\t\t\t\t\tNetworkAsyncCommonDefines.GET_TXJL_LIST_F);\n\t\t\t}", "public void refreshListView() {\n if (recyclerViewAdapter != null) {\n recyclerViewAdapter.notifyDataSetChanged();\n }\n }", "public void refreshList()\n {\n final ArrayAdapter adapter = (ArrayAdapter)this.foodListAdapter;\n this.getActivity().runOnUiThread(new Runnable() {\n public void run() {\n adapter.notifyDataSetChanged();\n }\n });\n }", "private void refreshListView() {\n\t\t\tisEnd=false;\n\t\t\tlistView.setMode(Mode.PULL_FROM_START);\n\t\t\tjsonArray=new JSONArray();\n\t\t\tcurrentPage=0;\n\t\t\tgetSharePage(++currentPage);\n\t\t\t\n\t\t}", "protected void refresh() {\n\t}", "@Override\n\tpublic void onRefresh() {\n\t\tpage = 1;\n\t\tSystem.out.println(\"onRefresh1\");\n\t\tmyList.clear();\n\t\tSystem.out.println(\"onRefresh2\");\n\t\tgetData();\n\t}", "public void refresh()\n {\n refresh( null );\n }", "public void refresh(){\n\n data2.clear();\n data2=getActionsList(\"\");\n //actionsAdapter=new ActionsAdapter(data2,getContext());\n //myList.setAdapter(actionsAdapter);\n //actionsAdapter.notifyDataSetChanged();\n }", "@Override\n public void refresh() {\n }", "public void refreshListAdapter() {\n adapter.setListContent(requests);\n //We in turn set the adapter to the RecyclerView\n recyclerView.setAdapter(adapter);\n }", "public void refresh() {\n }", "public void refresh(List<T> list) {\n this.items = list;\n notifyDataSetChanged();\n }", "private void refreshList() {\n ArrayAdapter<Plan> planAdapter = new PlanAdapter();\n mListView.setAdapter(planAdapter);\n\n }", "@Override\n public void onRefresh() {\n updateListings();\n new GetDataTask().execute();\n }", "protected void refresh()\n {\n refresh(System.currentTimeMillis());\n }", "private <T> void forceListRefreshOn(ListView<T> lsv) {\n\t\t//System.out.println(\"refreshing\");\n\t\tObservableList<T> items = lsv.<T>getItems();\n\t\tlsv.<T>setItems(null);\n\t\tlsv.<T>setItems(items);\n\t}", "@Override\n public void onRefresh() {\n reloadList();\n swipeContainer.setRefreshing(true);\n\n }", "@Override\n\tpublic void refresh() {\n\t\t\n\t}", "@Override\n\tpublic void refresh() {\n\t\t\n\t}", "public void refresh() {\n stopLoading = false;\n Place.loadMultiple(getActivity(), 0, LIST_INITIAL_LOAD, filterParams, false, new Place.onMultipleDownloadedListener() {\n @Override\n public void onDownloaded(List<Place> places) {\n setPlaces(places);\n\n }\n });\n }", "private void refreshList () {\n List<DisplayedUserCommand> list = new ArrayList<DisplayedUserCommand>();\n for (DisplayedUserCommand command : myUserDefinedCommandsList) {\n list.add(command);\n }\n myUserDefinedCommandsList.clear();\n myUserDefinedCommandsList.addAll(list);\n }", "@Override\n\tpublic void refresh() {\n\n\t}", "private void updateList() {\r\n\t\tlistaStaff.setItems(FXCollections.observableArrayList(service\r\n\t\t\t\t.getStaff()));\r\n\t}", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void refresh();", "public void reload() {\n waiterNotifications.clear();\n waiterNotifications.addAll(Local.getInstance().getWaiterNotificationList());\n notifyDataSetChanged();\n\n }", "private List<String> needRefresh(){\n\t\treturn null;\n\t}", "public void updateList() \n { \n model.clear();\n for(int i = ScholarshipTask.repository.data.size() - 1; i >= 0; i--) \n {\n model.addElement(ScholarshipTask.repository.data.get(i));\n }\n }", "@FXML\n private void handleRefresh(ActionEvent event) {\n observableListBook.clear();\n localData();\n }", "public void refreshListView() {\n \n \tLog.i(\"refresh list view\", \"Enter\");\n \ttry {\n \t\tif(taskListCursor != null) {\n\t \t\ttaskListCursor.close();\n\t \t\ttaskListCursor = null;\n \t\t}\n FileDbAdapter fda = new FileDbAdapter();\n fda.open();\n \t\ttaskListCursor = fda.fetchTasksForSource(getSource(), true);\n \tfda.close();\n \t} catch (Exception e) {\n \t\te.printStackTrace(); \t// TODO handle exception\n \t}\n \ttasks.changeCursor(taskListCursor);\n \tstartManagingCursor(taskListCursor);\n \ttasks.notifyDataSetChanged();\n\n }", "private void refreshList() {\n\t\tfor (int i = 0; i < service.getAllTimesheetRows(currentTimesheet.getTimesheetId()).size(); i++) {\n\t\t\ttimesheetRowList.add(service.getAllTimesheetRows(currentTimesheet.getTimesheetId()).get(i));\n\t\t}\n\t\ttimesheetRowList.add(new TimesheetRow(currentTimesheet.getTimesheetId()));\n\t}", "private void refresh(){\r\n if (!clientList.isEmpty()){\r\n clientList.clear();\r\n clientList = FXCollections.observableArrayList(Client.clientList());\r\n } \r\n table.setItems(clientList);\r\n }", "private void reloadListView() {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n mDevicesListViewAdapter.notifyDataSetChanged();\n }\n });\n }", "private void refreshData() {\n\r\n\t SfJdRecordFileModel model = (SfJdRecordFileModel) listCursor.getCurrentObject();\r\n\r\n\t if (model != null && !\"\".equals(ZcUtil.safeString(model.getModelId()))) {//列表页面双击进入\r\n\r\n\t this.pageStatus = ZcSettingConstants.PAGE_STATUS_BROWSE;\r\n\r\n\t model = getModel(model.getModelId());\r\n\t listCursor.setCurrentObject(model);\r\n\t this.setEditingObject(model);\r\n\t } else {//新增按钮进入\r\n\r\n\t this.pageStatus = ZcSettingConstants.PAGE_STATUS_NEW;\r\n\r\n\t model = new SfJdRecordFileModel();\r\n\t \r\n\t setDefaultValue(model);\r\n\r\n\t listCursor.getDataList().add(model);\r\n\r\n\t listCursor.setCurrentObject(model);\r\n\r\n\t this.setEditingObject(model);\r\n\r\n\t }\r\n\r\n\t refreshSubData();\r\n\t \r\n\t setOldObject();\r\n\r\n\t setButtonStatus();\r\n\r\n\t updateFieldEditorsEditable();\r\n\r\n\t }", "@Override\n public void refresh() {\n refresher.enqueueRefresh();\n }", "@Override\n public void refresh() {\n serverJList.removeAll();\n client.searchForServer();\n }", "@Override\n public void onRefresh() {\n synchronizeContent();\n }", "public abstract void refreshing();", "private void refreshList()\n\t\t{\n\t\tint cpt = 0;\n\t\tthis.combo.removeAllItems();\n\t\tthis.listPort = meteoPort.findListPortSerie();\n\t\tif (listPort.size() > 0)\n\t\t\t{\n\t\t\tfor(String string:listPort)\n\t\t\t\t{\n\t\t\t\tif (!meteoPort.isStationMeteoAvailable(string, 1000))\n\t\t\t\t\t{\n\t\t\t\t\tcombo.addItem(string);\n\t\t\t\t\tcpt++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif (cpt > 0)\n\t\t\t\t{\n\t\t\t\tbuttonValider.setEnabled(true);\n\t\t\t\t}\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tbuttonValider.setEnabled(false);\n\t\t\t}\n\t\t}", "public void refresh(Collection<Refreshable> alreadyRefreshed) {\n\t\t\r\n\t}", "private void refresh() {\n ArrayList<Note> notes = db.getAllNotes();\n ArrayList<Note> notesWithNotification = new ArrayList<Note>();\n\n for (int index = 0; index < notes.size(); index++) {\n if (notes.get(index).getNotification() != null) {\n notesWithNotification.add(notes.get(index));\n }\n }\n\n mNoteWithNotificationList = notesWithNotification;\n }", "@Override\n\tpublic void onRefresh() {\n\t\trequestTime = 1;\n\t\trefreshFromServer(ListViewCompat.REFRESH);\n\t}", "protected void refreshFromImports() {\r\n\t\t\t\t\r\n\t\tList<?> elements = collectItemsFromImports();\t\t\t\t\r\n\t\t\t\t\r\n\t\tif (fFilteredList != null) {\r\n\t\t\tfFilteredList.setAllowDuplicates(showDuplicates);\r\n\t\t\tfFilteredList.setElements( contentProvider.getElements(elements) );\r\n\t\t\tfFilteredList.setEnabled(true);\t\t\r\n\t\t}\t\t\t\t\r\n\t}", "@Override\n\t\t\t\tpublic void actionPerformed(ActionEvent e)\n\t\t\t\t\t{\n\t\t\t\t\trefreshList();\n\t\t\t\t\t}", "public void refreshMemberList () {\n if (tourMemberAdapter != null) {\n tourMemberAdapter.notifyDataSetChanged();\n }\n }", "@Override\n public void onRefresh() {\n loadData();\n }", "void refresh();", "void refresh();", "void refresh();", "void refresh();", "void refresh();", "private void refreshListView(ArrayList<MapPackage> list) {\n if (m_listAdapter != null) {\n m_listAdapter.clear();\n m_listAdapter.addAll(list);\n m_listAdapter.notifyDataSetChanged();\n } else {\n m_listAdapter = new MapListAdapter(m_activity, android.R.layout.simple_list_item_1,\n list);\n m_activity.setListAdapter(m_listAdapter);\n }\n m_currentMapPackageList = list;\n }", "private void refreshList(Context context) {\n if (mListManipulator.isListUpdated()) {\n mListManipulator.saveShownListState(context);\n }\n // Start service to refresh app\n Intent serviceIntent = new Intent(getActivity(), MainService.class);\n serviceIntent.setAction(Constants.ACTION_APP_REFRESH);\n getActivity().startService(serviceIntent);\n }", "synchronized void refresh() {\n\n\t\t// We must not call fireTableDataChanged, because that would clear the\n\t\t// selection in the task window\n\t\tfireTableRowsUpdated(0, size - 1);\n\n\t}", "protected void refreshFromRepository() {\n\t\t\r\n\t\tObject[] elements = new Object[]{};\r\n\t\tmodelObject.eContainer();\r\n\t\t\r\n\t\tif (fFilteredList != null) {\r\n\t\t\t\r\n\t\t\tfFilteredList.setAllowDuplicates(showDuplicates);\r\n\t\t\tfFilteredList.setElements(elements);\r\n\t\t\tfFilteredList.setEnabled(true);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tif (fTreeViewer != null) {\r\n\t\t\tfTreeViewer.setInput(null);\r\n\t\t}\t\t\r\n\t}", "public void Refresh()\n\t{\n\t}", "@Override\n public void onRefresh() {\n getGroupList();\n }", "private void doTheAutoRefresh() {\n handler.postDelayed(new Runnable() {\n @Override\n public void run() {\n\n setDatatoList();\n }\n }, 120000);\n }", "public void run(){\n\t\t\t\tupdateList();\r\n\t\t\t}", "public abstract void refresh();", "public abstract void refresh();", "public abstract void refresh();", "@Override\n public void onRefresh() {\n refreshData();\n }", "abstract void refresh();", "void onItemsLoadComplete() {\n adapter.notifyDataSetChanged();\n\n // Stop refresh animation\n srl.setRefreshing(false);\n }", "public void refreshPhotos() {\n\t\tif(AccessibleUsersList.masterUserList.getUsers() != null) {\n\t\t\tforceListRefreshOn(PhotoListDisplay);\n\t\t\tPhotoListDisplay.setItems(listOfPhotos);\n\t\t}\n\t}", "public void refreshUserList(){\n mUserList.clear();\n ArrayList<User> arrayList = new ArrayList<User>(mUserMap.values());\n Collections.sort(arrayList);\n mUserList.addAll(arrayList);\n }", "@Override\n public void onRefresh() {\n }", "private void refreshListView() {\n\t\tSQLiteDatabase db = dbh.getReadableDatabase();\n\t\tsharedListView.setAdapter(null);\n\t\tCursor c1 = db.rawQuery(\"SELECT _id, title, subtitle, content, author, otheruser FROM todos WHERE otheruser = '\" + author + \"'\", null);\n\t\tListAdapter adapter2 = new SimpleCursorAdapter(this, R.layout.activity_items, c1, from, to, 0);\n\t\tsharedListView.setAdapter(adapter2);\n\t\tadapter.notifyDataSetChanged();\n\t}", "@Override\n\tpublic void refreshAll(boolean b) {\n\t\t\n\t}", "void refresh() {\n List<IDevice> list = Lists.newArrayList();\n// if (fan == null) {\n// ToastUtils.showShort(R.string.dev_invalid_error);\n// } else {\n// list.add(fan);\n// if (stove != null) {\n// list.add(stove);\n// }\n// }\n list = Plat.deviceService.queryDevices();\n adapter.loadData(list);\n }", "public void refresh() {\r\n\t\tinit();\r\n\t}", "@Override\n public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {\n refresh = true;\n PageIndex = 1;\n list.clear();\n listHeader.clear();\n listmoney.clear();\n users.setLimit(12);\n getDate();\n }", "public synchronized boolean refresh() \n {\n return refresh(false);\n }", "public void refreshAll() {\n}", "@Override\n public void refreshDataEntries() {\n }", "public void redrawListView() {\n\t\tMySimpleCursorAdapter adapt = (MySimpleCursorAdapter)this.getListAdapter();\n\t\tadapt.notifyDataSetChanged();\n\t}", "public abstract void refreshItem();", "@Override\n\tpublic void refresh() {\n\t\thandler.postDelayed(new Runnable() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\trefreshListView.stopRefresh();\n\t\t\t}\n\t\t}, 2000);\n\t\t\n\t}", "@Override\r\n\tpublic void onRefresh() {\n\r\n\t}", "public void refresh(ArrayList pNewList) {\n listLivingBeings.setListData(pNewList.toArray());\n if (!pNewList.isEmpty()) {\n listLivingBeings.setSelectedIndex(0);\n }\n }", "public void refreshSuggestionList() {\n \t\tif (isAttached()) {\n \t\t\trefreshSuggestions();\n \t\t}\n \t}", "@Override\n public void onRefresh() {\n }", "public void onRefresh() {\n\t\t\t\tnew AsyncTask<Void, Void, Void>() {\r\n\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tprotected Void doInBackground(Void... params) {\r\n\t\t\t\t\t\tlist.clear();\r\n\t\t\t\t\t\tnew Getliuyan().start();\r\n\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tprotected void onPostExecute(Void result) {\r\n\t\t\t\t\t\thandler.sendEmptyMessage(2);\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t}.execute();\r\n\t\t\t}", "private void refreshItem() {\n\t\tboundSwagForm.getField(\"isFetchOnly\").setValue(true);\r\n\t\tboundSwagForm.saveData(new DSCallback() {\r\n\t\t\t//reselect selected tile (call to saveData de-selects it)\r\n\t\t\tpublic void execute(DSResponse response,\r\n\t\t\t\t\tObject rawData, DSRequest request) {\r\n\t\t\t\t//get updated record\r\n\t\t\t\tfinal TileRecord rec = new TileRecord(request.getData());\r\n\t\t\t\t//Note: selectRecord seems to only work on the tile index\r\n\t\t\t\titemsTileGrid.selectRecord(itemsTileGrid.getRecordIndex(rec));\r\n\t\t\t\t//saveData adds tileRecord to the end.\r\n\t\t\t\t//make sure sort order is preserved\r\n\t\t\t\tdoSort();\r\n\t\t\t}});\r\n\t}" ]
[ "0.8701888", "0.81662416", "0.78408074", "0.78355646", "0.77552587", "0.7728528", "0.76058733", "0.7605174", "0.7569975", "0.7564908", "0.7550703", "0.7547434", "0.75163454", "0.7515021", "0.7510637", "0.7488412", "0.7465492", "0.7421065", "0.7419876", "0.7405582", "0.7398656", "0.73625576", "0.73267555", "0.73242515", "0.73184496", "0.7311798", "0.73085463", "0.7284558", "0.7270568", "0.7270568", "0.726356", "0.7259836", "0.7251779", "0.72039354", "0.7198519", "0.7198519", "0.7198519", "0.7198519", "0.7198519", "0.7198519", "0.7198519", "0.7173809", "0.71737534", "0.7152773", "0.7148331", "0.7135636", "0.71311146", "0.7125305", "0.70866007", "0.7074613", "0.70727324", "0.7061066", "0.7048537", "0.70125306", "0.70064414", "0.6989397", "0.69856536", "0.69594145", "0.6955213", "0.69531876", "0.693495", "0.6930883", "0.6930295", "0.6930295", "0.6930295", "0.6930295", "0.6930295", "0.692669", "0.69094193", "0.6907859", "0.690001", "0.68916225", "0.6883228", "0.68736494", "0.68728286", "0.68557084", "0.68557084", "0.68557084", "0.6852307", "0.6850706", "0.6843559", "0.6839191", "0.6836915", "0.6830927", "0.6829054", "0.6823566", "0.6809521", "0.67915297", "0.6780665", "0.6777725", "0.6773029", "0.6766321", "0.67607576", "0.6760427", "0.6751042", "0.6745305", "0.67324466", "0.6726039", "0.6720978", "0.6718127", "0.67137355" ]
0.0
-1
Method for reaading the file lines and saving in the ArrayList
public void readFile(String filePath) { File file = new File(filePath); try { Scanner sc = new Scanner(file); while(sc.hasNextLine() ) { String line = sc.nextLine(); linesArray.add( line.split(",") ); } } catch (FileNotFoundException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private ArrayList<String> saveText(){\n FileReader loadDetails = null;\n String record;\n record = null;\n\n //Create an ArrayList to store the lines from text file\n ArrayList<String> lineKeeper = new ArrayList<String>();\n\n try{\n loadDetails=new FileReader(\"employees.txt\");\n BufferedReader bin=new BufferedReader (loadDetails);\n record=new String();\n while (((record=bin.readLine()) != null)){//Read the file and store it into the ArrayList line by line*\n lineKeeper.add(record);\n }//end while\n bin.close();\n bin=null;\n }//end try\n catch (IOException ioe) {}//end catc\n\n return lineKeeper;\n\n }", "private void updateListaInformacaoSalva(){\n try(Stream<String> lines = Files.lines(Paths.get(this.path))){\n this.listaInformacaoSalva = lines\n .map(SalvaCsv::pelaLinha)\n .collect(Collectors.toList());\n\n }catch (IOException e){\n e.printStackTrace();\n }\n }", "private void readListFromFile() {\n // clear existing list\n if (listArr == null || listArr.size() > 0) {\n listArr = new ArrayList<>();\n }\n\n try {\n Scanner scan = new Scanner(openFileInput(LIST_FILENAME));\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n listArr.add(line);\n }\n\n if (listAdapter != null) {\n listAdapter.notifyDataSetChanged();\n }\n\n } catch (IOException ioe) {\n Log.e(\"ReadListFromFile\", ioe.toString());\n }\n\n }", "ArrayList<String> getLines();", "public static void readFromFile(ArrayList<String> sArrayList, Context context){\n\n int i=0;\n try{\n InputStream inputStream = context.openFileInput(TxtName);\n\n if(inputStream!=null) {\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String receivedString = \"\";\n\n while((receivedString = bufferedReader.readLine())!=null){\n sArrayList.set(i,receivedString);\n Log.d(\"fileContent\", \"readFromFile: \"+sArrayList.get(i)+\"\\n\");\n i++;\n }\n inputStream.close();\n }\n\n } catch (FileNotFoundException e) {\n Log.e(\"login activity\", \"File not found: \" + e.toString());\n } catch (IOException e) {\n Log.e(\"login activity\", \"Can not read file: \" + e.toString());\n }\n\n }", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\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}", "private void takeInFile() {\n System.out.println(\"Taking in file...\");\n //Reads the file\n String fileName = \"messages.txt\";\n String line = null;\n try {\n FileReader fileReader = new FileReader(fileName);\n \n BufferedReader bufferedReader = new BufferedReader(fileReader);\n\n //Adds each line to the ArrayList\n int i = 0;\n while ((line = bufferedReader.readLine()) != null) {\n lines.add(line);\n //System.out.println(line);\n i++;\n }\n \n bufferedReader.close();\n } catch (FileNotFoundException ex) {\n System.out.println(\"Unable to open file '\" + fileName + \"'\");\n } catch (IOException ex) {\n System.out.println(\"Error reading file '\" + fileName + \"'\");\n }\n System.out.println(\"Done taking in file...\");\n }", "private void readFile() {\n try (BufferedReader br = new BufferedReader(new FileReader(\"../CS2820/src/production/StartingInventory.txt\"))) {\n String line = br.readLine();\n while (line != null) {\n line = br.readLine();\n this.items.add(line);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void getList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < slist.size(); i++) {\n\n\t\t\t\tfwriter.append(slist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public ArrayList<String> readFile() {\n data = new ArrayList<>();\n String line = \"\";\n boolean EOF = false;\n\n try {\n do {\n line = input.readLine();\n if(line == null) {\n EOF = true;\n } else {\n data.add(line);\n }\n } while(!EOF);\n } catch(IOException io) {\n System.out.println(\"Error encountered.\");\n }\n return data;\n }", "public void readFile() {\n ArrayList<Movement> onetime = new ArrayList<Movement>(); \n Movement newone = new Movement(); \n String readLine; \n\n File folder = new File(filefolder); \n File[] listOfFiles = folder.listFiles(); \n for (File file : listOfFiles) {\n if (file.isFile()&& file.getName().contains(\"200903\")) {\n try {\n onetime = new ArrayList<Movement>(); \n newone = new Movement(); \n BufferedReader br = new BufferedReader(new FileReader(filefolder+\"\\\\\"+file.getName())); \n readLine = br.readLine (); \n String[] previouline = readLine.split(\",\"); \n int previousint = Integer.parseInt(previouline[7]); \n while ( readLine != null) {\n String[] currentline = readLine.split(\",\"); \n if (Integer.parseInt(currentline[7]) == previousint)\n {\n newone.addRecord(currentline[0], currentline[1], currentline[2], currentline[4], currentline[5], currentline[6]); \n newone.ID = Integer.parseInt(currentline[7]); \n newone.filedate = file.getName();\n } else\n { \n onetime.add(newone); \n newone = new Movement(); \n newone.addRecord(currentline[0], currentline[1], currentline[2], currentline[4], currentline[5], currentline[6]);\n }\n previousint = Integer.parseInt(currentline[7]); \n readLine = br.readLine ();\n }\n }\n catch (IOException e) {\n e.printStackTrace();\n }\n rawdata.add(onetime);\n } \n }\n println(rawdata.size());\n}", "public void setClientList(String filePath) throws FileNotFoundException {\n Scanner scan = new Scanner(new File(filePath));\n while (scan.hasNextLine()) { // while there's another line in the file\n String line = scan.nextLine();\n if (line == \"\") { // if the next line is empty, stop the loop\n break;\n }\n int i = 0; // to keep track of the iterator placement in the line\n int n = 0; // to keep track of information in store\n String email = new String();\n String[] newInformation = new String[5];\n while (i < line.length()) { // checks every character in the line\n String store = \"\";\n while (i < line.length() && line.charAt(i) != ',') {\n store += line.charAt(i);\n i++;\n }\n i++;\n n++;\n switch (n) { // stores area into appropriate place for user\n case 1:\n newInformation[0] = store;\n break;\n case 2:\n newInformation[1] = store;\n break;\n case 3:\n email = store;\n break;\n case 4:\n newInformation[2] = store;\n break;\n case 5:\n newInformation[3] = store;\n break;\n case 6:\n newInformation[4] = store;\n break;\n }\n }\n boolean b = false;\n for (Client c: this.clientList) {\n if (c.getEmail().equals(email)) {\n b = true;\n c.setLastName(newInformation[0]);\n c.setFirstNames(newInformation[1]);\n c.setAddress(newInformation[2]);\n c.setCreditCardNumber(newInformation[3]);\n c.setExpiryDate(newInformation[4]);\n }\n }\n if (!b) {\n this.clientList.add(new Client(email, newInformation[0], newInformation[1], newInformation[2], newInformation[3], newInformation[4]));\n }\n }\n scan.close();\n flightSystem.setClientList(this.clientList); // updates FlightSystem\n setChanged();\n notifyObservers(clientList);\n }", "private void ReadInputFile(String filePath){\n String line;\n\n try{\n BufferedReader br = new BufferedReader(new FileReader(filePath));\n while((line = br.readLine()) != null){\n //add a return at each index\n inputFile.add(line + \"\\r\");\n }\n\n\n }catch(IOException ex){\n System.out.print(ex);\n }\n\n }", "public static ArrayList<String> getLines() throws Exception\n {\n \tArrayList<String> lines = new ArrayList<String>();\n \twhile(reader.ready())\n \t{\n \t\tlines.add(reader.readLine());//reads the line and adds them into the arraylist\n \t}\n \treturn lines;\n }", "public void getOldFile() throws FileNotFoundException, IOException, ClassNotFoundException{\r\n\t\tObjectInputStream ois = new ObjectInputStream(new FileInputStream(\"agenda.txt\"));\r\n\t\tArrayList<Artist> inputArtists = (ArrayList<Artist>) ois.readObject();\r\n\t\tArrayList<Stage> inputStages = (ArrayList<Stage>) ois.readObject();\r\n\t\tArrayList<Performance> inputPerformances = (ArrayList<Performance>) ois.readObject();\r\n\t\tartists.addAll(inputArtists);\r\n\t\tstages.addAll(inputStages);\r\n\t\tperformances.addAll(inputPerformances);\r\n\t}", "public static ArrayList getLines() {\n return lines;\n }", "public void readFile() {\r\n\t\tBufferedReader br = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tString currentLine;\r\n\r\n\t\t\tbr = new BufferedReader(new FileReader(fileName));\r\n\r\n\t\t\twhile ((currentLine = br.readLine()) != null) {\r\n\r\n\t\t\t\tif (!currentLine.equals(\"\")) {\r\n\t\t\t\t\tString[] paragraphs = currentLine.split(\"\\\\n\\\\n\");\r\n\r\n\t\t\t\t\tfor (String paragraphEntry : paragraphs) {\r\n\t\t\t\t\t\t//process(paragraphEntry);\r\n\t\t\t\t\t\t//System.out.println(\"Para:\"+paragraphEntry);\r\n\t\t\t\t\t\tParagraph paragraph = new Paragraph();\r\n\t\t\t\t\t\tparagraph.process(paragraphEntry);\r\n\t\t\t\t\t\tthis.paragraphs.add(paragraph);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (br != null)br.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "ArrayList<WordListItem> addDataFromFile(){\n BufferedReader br;\n InputStream inputStream = context.getResources().openRawResource(R.raw.animal_list);\n br = new BufferedReader(\n new InputStreamReader(inputStream, Charset.forName(\"UTF-8\"))\n );\n String currentLine;\n ArrayList<WordListItem> wordListItems = new ArrayList<WordListItem>();\n try {\n while ((currentLine = br.readLine()) != null) {\n String[] tokens = currentLine.split(\";\");\n\n String word = tokens[0];\n String pronunciation = tokens[1];\n String description = tokens[2];\n\n WordListItem wordItem = new WordListItem(word, pronunciation, description);\n wordItem.setImgResNbr(setImgResFromWord(wordItem.getWord().toLowerCase()));\n wordListItems.add(wordItem);\n }\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n try {\n if (br != null) br.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n return wordListItems;\n }", "List<String> obtenerlineas(String archivo) throws FileException;", "private ArrayList<String> parseFile(String file_name){ // extract each line from file AS string (stopList)\r\n ArrayList<String> list = new ArrayList<>();\r\n Scanner scanner = null;\r\n try{\r\n scanner = new Scanner(new BufferedReader(new FileReader(file_name)));\r\n while (scanner.hasNextLine())\r\n {\r\n list.add(scanner.nextLine());\r\n }\r\n }\r\n catch (Exception e ){ System.out.println(\"Error reading file -> \"+e.getMessage()); }\r\n finally {\r\n if(scanner != null ){scanner.close();} // close the file\r\n }\r\n return list;\r\n }", "public List<Event> fillArrayList()\r\n {\r\n List<Event> list1=new ArrayList<>();\r\n FileReader fr=null;\r\n \r\n try{\r\n \r\n fr=new FileReader(\"./event.txt\");\r\n BufferedReader bf=new BufferedReader(fr);\r\n String s;\r\n \r\n while((s=bf.readLine())!=null)\r\n {\r\n Event event=new Event();\r\n String s1[]=new String[7];\r\n for(int i=0;i<s1.length;i++)\r\n {\r\n s1=s.split(\",\");\r\n \r\n event.setId(Integer.parseInt(s1[0]));\r\n \r\n event.setName(s1[1]);\r\n \r\n event.setOrganizer(s1[2]);\r\n \r\n Date date=Date.valueOf(s1[3]);\r\n \r\n event.setDate(date);\r\n \r\n event.setFees(Double.parseDouble(s1[4]));\r\n \r\n } \r\n list1.add(event);\r\n }\r\n \r\n bf.close();\r\n \r\n }catch(Exception e){e.printStackTrace();}\r\n return list1;\r\n\r\n }", "private ArrayList<Alimento> initLista() {\n try {\n File file = new File(\"C:\\\\Users\\\\Gabri\\\\OneDrive\\\\Ambiente de Trabalho\\\\Calorie\\\\src\\\\Assets\\\\alimentos.txt\");\n FileReader fr = new FileReader(file);\n BufferedReader br = new BufferedReader(fr);\n\n ArrayList<Alimento> lista = new ArrayList<>();\n\n int noLines = Integer.parseInt(br.readLine());\n for(int l=0; l<noLines; l++) {\n String[] alimTks = (br.readLine()).split(\",\");\n\n Alimento alimento = new Alimento(idAlimCounter++,alimTks[0],100,Integer.parseInt(alimTks[1]),Float.parseFloat(alimTks[2]),Float.parseFloat(alimTks[3]),Float.parseFloat(alimTks[4]));\n lista.add(alimento);\n }\n\n return lista;\n }catch (Exception e) {\n System.out.println(\"Sistema - getLista() : \"+e.toString());\n }\n return null;\n }", "private List<KeyFileEntry> convertLinesIntoInMemoryObjectList(List<String> lines) {\n List<KeyFileEntry> retList = new ArrayList<>(1250);\n\n int i = 0;\n\n // Ignore the header lines and information\n for (; i < lines.size(); i++) {\n String lineIgnore = lines.get(i);\n if (lineIgnore.startsWith(\"______\")) {\n break;\n }\n }\n\n // Ignore underscore ___ line\n i++;\n\n // reached entries lines\n KeyFileEntry entry = new KeyFileEntry();\n\n // create in memory list of objects\n while (i < lines.size()) {\n String line = lines.get(i);\n\n // For terminating line no need to complete loop\n if (line.equals(\"//\")) {\n retList.add(entry);\n entry = new KeyFileEntry();\n i++;\n continue;\n }\n\n String[] tokens = line.split(SPLIT_SPACES);\n switch (tokens[0]) {\n case \"ID\":\n entry.id = tokens[1];\n break;\n case \"IC\":\n entry.ic = tokens[1];\n break;\n case \"AC\":\n entry.ac = tokens[1];\n break;\n case \"DE\":\n entry.de.add(tokens[1]);\n break;\n case \"SY\":\n entry.sy.add(tokens[1]);\n break;\n case \"HI\":\n entry.hi.add(tokens[1]);\n break;\n case \"GO\":\n entry.go.add(tokens[1]);\n break;\n case \"CA\":\n entry.ca = tokens[1];\n break;\n case \"WW\":\n entry.ww.add(tokens[1]);\n break;\n default:\n LOG.info(\"Unhandle line found while parsing file: {}\", line);\n\n }\n\n // read and save next line\n i++;\n }\n return retList;\n }", "public void file ( Receipt receipt){\r\n\t\t\treciptlist.add(receipt);\r\n\t\t}", "List<Line> getLines();", "private Runnable loadItems() {\n File file = new File(getFilesDir(), \"data.txt\");\n\n try {\n // Clears and adds appropriate items\n this._items.clear();\n this._items.addAll(FileUtils.readLines(file, Charset.defaultCharset()));\n } catch (IOException e) {\n Log.e(\"MainActivity\", \"Error reading items\", e);\n }\n\n // Return a callback function for saving items\n return () -> {\n try {\n FileUtils.writeLines(file, this._items);\n } catch (IOException e) {\n Log.e(\"MainActivity\", \"Error writing items\", e);\n }\n };\n }", "private void rewriteLocationList(List<Location> newLocationList) {\n Log.d(\"debugMode\", \"writing new contents\");\n for (Location location : newLocationList) {\n String line = \"\\n\" + location.returnFull();\n byte[] bytes = line.getBytes();\n\n FileOutputStream out;\n try {\n Log.d(\"debugMode\", location.returnFull());\n out = openFileOutput(\"Locations.txt\", MODE_APPEND);\n out.write(bytes);\n out.close();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "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}", "private List<String> readFile() throws FileNotFoundException {\t\n\t\tList<String> itemsLines = new ArrayList<>();\n\t\tFile inputFile = new File(filePath);\t\n\t\ttry (Scanner newScanner = new Scanner(inputFile)) {\n\t\t\twhile(newScanner.hasNextLine()) {\n\t\t\t\titemsLines.add(newScanner.nextLine());\n\t\t\t}\t\n\t\t}\n\t\treturn itemsLines;\n\t}", "private void readItems() {\n // open file\n File file = getFilesDir();\n File todoFile = new File(file, \"scores.txt\");\n // try to find items to add\n try {\n items = new ArrayList<>(FileUtils.readLines(todoFile));\n } catch (IOException e) {\n items = new ArrayList<>();\n }\n }", "static List<String> fileToList(){\n List<String> contacts = null;\n try {\n Path contactsListPath = Paths.get(\"contacts\",\"contacts.txt\");\n contacts = Files.readAllLines(contactsListPath);\n } catch (IOException ioe){\n ioe.printStackTrace();\n }\n return contacts;\n }", "private ArrayList loadfile(String file_path) throws Exception{\n\t\tFileInputStream fis = null;\n\t\tBufferedReader br = null;\n\t\tArrayList filedata = new ArrayList();\n\t\ttry {\n\t\t\tFile file = new File(file_path);\n\t\t\tfis = new FileInputStream(file);\n\t\t\tbr = new BufferedReader(new InputStreamReader(fis, charset));\n\t\t\tint i = 0;\n\t\t\twhile (br.ready()) {\n\t\t\t\tString line_data = br.readLine();\n\t\t\t\tif (line_data == null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tnode_line_data nd = new node_line_data(line_data, i++);\n\t\t\t\tfiledata.add(nd);\n\t\t\t}\n\t\t\treturn filedata;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\t\t}\n\t\tfinally {\n\t\t\ttry {\n\t\t\t\tif (br != null)\n\t\t\t\t\tbr.close();\n\t\t\t\tif (fis != null)\n\t\t\t\t\tfis.close();\n\t\t\t}\n\t\t\tcatch (IOException ex) {\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n public void update() {\n ArrayList<String>Lines=new ArrayList<>();\r\n File file =new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n BufferedReader br = null;\r\n try {\r\n br = new BufferedReader(new FileReader(\"/home/yara/Documents/4year/OODP/Task.txt\"));\r\n } catch (FileNotFoundException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n String str;\r\n String UID=id.getText();\r\n try {\r\n while((str=br.readLine()) !=null)\r\n {\r\n \r\n Lines.add(str);\r\n }\r\n String UpadetString = id.getText() +\" , \"+ name.getText()+\" , \"+ date_start.getText()+\" , \"+ date_finish.getText()+\" , \"+status.getText();\r\n for (int i=0 ;i<Lines.size();i++)\r\n {\r\n String line=Lines.get(i).trim();\r\n String[] datarow =line.split(\" , \");\r\n if(datarow[0].equals(UID))\r\n {\r\n Lines.set(i,UpadetString );\r\n } \r\n }\r\n PrintWriter Pwriter = new PrintWriter(file);\r\n Pwriter.print(\"\");\r\n Pwriter.close();\r\n \r\n File f=new File(\"/home/yara/Documents/4year/OODP/Task.txt\");\r\n FileWriter writer = new FileWriter(f.getAbsoluteFile(), true);\r\n BufferedWriter bw=new BufferedWriter(writer);\r\n for(String x:Lines)\r\n {\r\n bw.write(x);\r\n bw.newLine();\r\n }\r\n bw.close();\r\n \r\n } catch (IOException ex) {\r\n Logger.getLogger(Task.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n \r\n \r\n }", "public static ArrayList create_history(String file) throws IOException {\n todos.clear();\n file_reader = new FileReader(file);\n buffered_reader = new BufferedReader(file_reader);\n String line;\n String todo_string = \"\";\n\n while ((line = buffered_reader.readLine()) != null){\n if (!line.equals(\";\")){\n todo_string += line;\n }\n else{\n parse_todo(todo_string);\n todo_string = \"\";\n }\n }\n return todos;\n }", "List<String> getLines();", "public List<Cuenta> leerArchivoToList(InputStream archivo);", "public ArrayList<SessionLog> readLogFile(){\n ArrayList<SessionLog> sessionLogList = new ArrayList<>();\n try {\n FileInputStream inputStream = getApplicationContext().openFileInput(logFileName);\n BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));\n\n while(true){\n String line = reader.readLine();\n if (line != null){\n String[] data = line.split(\",\");\n Log.i(LOG_TAG, \" - \"+ Arrays.toString(data));\n SessionLog item = new SessionLog(\n Long.parseLong(data[0]),\n new LatLng(Double.parseDouble(data[1]), Double.parseDouble(data[2])),\n data[3].equals(\"true\")\n );\n sessionLogList.add(item);\n }\n else{\n Log.i(LOG_TAG, \"Reached end of file\");\n break; // No more lines to read\n }\n }\n }\n catch (Exception e){\n Log.i(LOG_TAG, \"Problem reading from current session log file...\");\n e.printStackTrace();\n }\n return sessionLogList;\n }", "public ArrayList<String> loadToRead() {\n\n\t\tSAVE_FILE = TO_READ_FILE;\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tlist = loadIds();\n\t\treturn list;\n\t}", "public ArrayList<String> leerArchivo(String nombreArchivo) { //\"getter\" metodo arraylist que recibe como parametro nombreArchivo\n\t\tArrayList<String> lineasArchivo = new ArrayList<String>(); //instacia del ArrayList\n\t\tBufferedReader archivo = null;\n\t\ttry {\n\t\t\t//BufferedReader para leer lineas completas de una secuencia de entrada\n\t\t\t archivo = new BufferedReader(new FileReader(nombreArchivo)); \n\t\t\tString linea = \"\";\n\t\t\twhile (linea != null) {\n\t\t\t\tlinea = archivo.readLine();\n\t\t\t\tif (linea != null) {\n\t\t\t\t\tlineasArchivo.add(linea);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarchivo.close();\t\t\t\n\t\t} catch(IOException ioe) {\n\t\t}\n\t\treturn lineasArchivo;\n\t}", "private void createLinesArray()\n {\n //This will iterate through the lines array\n for (int i = 0; i < lines.length; i++)\n {\n //Stop at end-of-File\n if (mapScanner.hasNextLine())\n {\n //Add the current line to the lines array\n lines[i] = mapScanner.nextLine();\n }\n }\n }", "public static ArrayList<String> readLines(String fileName){\n\t\treturn read(fileName, false);\n\t}", "private ArrayList limpiar() {//quita espacios en blanco y saltos de linea\n String codigoFuente = ta_source.getText();\n ArrayList retorno = new ArrayList();\n try {\n codigoFuente = codigoFuente.replaceAll(\" \", \"\");\n String aux = \"\";\n byte guardaLinea = 1, guardaBloque = 1;\n for (int i = 0; i < codigoFuente.length(); i++) {\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '/' && guardaBloque == 1) {\n guardaLinea = 0;//0: no guarda\n }\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '*' && guardaLinea == 1) {\n guardaBloque = 0;//0: no guarda\n }\n if (i > 0 && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i - 1) == '*') {\n guardaBloque = 2;//1: si guarda\n }\n if (codigoFuente.charAt(i) == '\\n' && guardaBloque == 1) {\n guardaLinea = 1;//1: si guarda\n if (aux.length() > 0) {\n retorno.add(aux);\n aux = \"\";\n }\n } else {\n if (i == codigoFuente.length() - 1) {\n aux += codigoFuente.charAt(i);\n retorno.add(aux);\n }\n }\n if (guardaBloque == 1 && guardaLinea == 1 && codigoFuente.charAt(i) != '\\n') {\n aux += codigoFuente.charAt(i);\n }\n if (guardaBloque == 2) {\n guardaBloque--;\n }\n }\n } catch (Exception e) {\n System.out.println(\"errror \" + e.getClass());\n } finally {\n return retorno;\n }\n }", "@Override\r\n public void remove() {\n ArrayList<String>Lines=new ArrayList<>();\r\n String Path = \"/home/yara/Documents/4year/OODP/Task.txt\";\r\n \r\n String RID=id.getText();\r\n String Taskname = name.getText();\r\n String startDate = date_start.getText();\r\n String EndDate = date_finish.getText();\r\n String LocalStatus = status.getText();\r\n String MemberID = MemberId.getText();\r\n \r\n Lines.add(RID);\r\n Lines.add(Taskname);\r\n Lines.add(startDate);\r\n Lines.add(EndDate);\r\n Lines.add(LocalStatus);\r\n Lines.add(MemberID);\r\n \r\n FileFacade facade = new FileFacade();\r\n facade.remove(Path, Lines);\r\n \r\n }", "public void getOrderedList() {\n\n\t\tFile opFile = new File(\"/home/bridgeit/Desktop/newfile.txt\");\n\t\ttry {\n\t\t\topFile.createNewFile();\n\t\t\tFileWriter fwriter = new FileWriter(opFile);\n\n\t\t\tfor (int i = 0; i < olist.size(); i++) {\n\n\t\t\t\tfwriter.append(olist.returnItem(i) + \" \");\n\n\t\t\t}\n\t\t\tfwriter.close();\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public ArrayList<String> getInputByLines(Class c, String file){\n this.resourceName = file;\n input = new ArrayList<String>();\n headerLine = new String();\n getFileAsResourceNewLineDelineated(c);\n return this.input;\n }", "private static ArrayList<String> fetchSaved() {\n\t\tScanner s;\n\t\tint count = 0;\n\t\tArrayList<String> savedList = new ArrayList<String>();\n\t\ttry {\n\t\t\ts = new Scanner(new File(\"saved.txt\"));\n\t\t\twhile (s.hasNext()) {\n\t\t\t\tsavedList.add(s.next());\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t\tSystem.out.println(\"Number of converted urls fetched: \" + count);\n\t\t\ts.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn savedList;\n\t}", "public void readUserFile (){\n try {\n FileReader reader = new FileReader(fileName);\n BufferedReader bufferedReader = new BufferedReader(reader);\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n Scanner s = new Scanner(line); //use of a scanner to parse the line and assign its tokens to different variables\n//each line corresponds to the values of a User object\n while(s.hasNext()){\n String usrname = s.next();\n String pass = s.next();\n User u = new User(usrname,pass);\n userlist.add(u);//added to the list\n }\n \n }\n reader.close();\n \n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void stockLoad() {\n try {\n File file = new File(stockPath);\n Scanner scanner = new Scanner(file);\n while (scanner.hasNextLine()) {\n String data = scanner.nextLine();\n String[] userData = data.split(separator);\n Stock stock = new Stock();\n stock.setProductName(userData[0]);\n int stockCountToInt = Integer.parseInt(userData[1]);\n stock.setStockCount(stockCountToInt);\n float priceToFloat = Float.parseFloat(userData[2]);\n stock.setPrice(priceToFloat);\n stock.setBarcode(userData[3]);\n\n stocks.add(stock);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "static void read()\n\t\t{\n\n\n\t\t\tString content=new String();\n\t\t\ttry {\n\t\t\t\tFile file=new File(\"Dic.txt\");\n\t\t\t\tScanner scan=new Scanner(file);\n\t\t\t\twhile(scan.hasNextLine()) {\n\t\t\t\t\tcontent=scan.nextLine();\n\t\t\t\t//\tSystem.out.println(content);\n\n\t\t\t\t//\tString [] array=content.split(\" \");\n\t\t\t\t\tlist.add(content.trim());\n\n\t\t\t\t}\n\t\t\t\tscan.close(); \n\t\t\t}\n\t\t\tcatch (Exception e) {\n\t\t\t\tSystem.out.println(e);\n\t\t\t}\n\n\n\t\t}", "public static ArrayList readData(){\n ArrayList alr = new ArrayList();\n try{\n ArrayList stringArray = (ArrayList)read(filename);\n for (int i = 0; i < stringArray.size(); i++){\n String st = (String)stringArray.get(i);\n StringTokenizer star = new StringTokenizer(st, SEPARATOR);\n int movieID = Integer.parseInt(star.nextToken().trim());\n String email = star.nextToken().trim();\n String comment = star.nextToken().trim();\n Review review = new Review(movieID, email, comment);\n alr.add(review);\n }\n }\n catch (IOException e){\n System.out.println(\"Exception > \" + e.getMessage());\n }\n return alr;\n }", "public void setLines(HashMap<String, ArrayList<Integer>> lines) {\r\n\t\tthis._fileLines = lines;\r\n\t}", "private void loadFromFile() {\n try {\n FileInputStream fis = openFileInput(FILENAME);\n InputStreamReader isr = new InputStreamReader(fis);\n BufferedReader reader = new BufferedReader(isr);\n Gson gson = new Gson();\n Type listFeelingType = new TypeToken<ArrayList<Feeling>>(){}.getType();\n recordedFeelings.clear();\n ArrayList<Feeling> tmp = gson.fromJson(reader, listFeelingType);\n recordedFeelings.addAll(tmp);\n fis.close();\n\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n recordedFeelings = new ArrayList<Feeling>();\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }", "public String[] ReadAllFileLines(String sFilePath) throws Exception {\n File f = null;\n FileInputStream fstream = null;\n DataInputStream in = null;\n BufferedReader br = null;\n String strLine = \"\";\n String[] stemp = null;\n StringBuffer strbuff = new StringBuffer();\n try {\n //getting file oject\n f = new File(sFilePath);\n if (f.exists()) {\n //get object for fileinputstream\n fstream = new FileInputStream(f);\n // Get the object of DataInputStream\n in = new DataInputStream(fstream);\n //get object for bufferreader\n br = new BufferedReader(new InputStreamReader(in, \"UTF-8\"));\n //Read File Line By Line\n while ((strLine = br.readLine()) != null) {\n strbuff.append(strLine + \"##NL##\");\n }\n\n stemp = strbuff.toString().split(\"##NL##\");\n } else {\n throw new Exception(\"File Not Found!!\");\n }\n\n return stemp;\n } catch (Exception e) {\n throw new Exception(\"ReadAllFileLines : \" + e.toString());\n } finally {\n //Close the input stream\n try {\n br.close();\n } catch (Exception e) {\n }\n try {\n fstream.close();\n } catch (Exception e) {\n }\n try {\n in.close();\n } catch (Exception e) {\n }\n }\n }", "void saveLineItemList(List<LineItem> lineItemList);", "private void leituraTexto() {\n try {\n Context context = getApplicationContext();\n\n InputStream arquivo = context.getResources().openRawResource(R.raw.catalogo_restaurantes);\n InputStreamReader isr = new InputStreamReader(arquivo);\n\n BufferedReader br = new BufferedReader(isr);\n\n String linha = \"\";\n restaurantes = new ArrayList<>();\n\n while ((linha = br.readLine()) != null) {\n restaurante = new Restaurante(linha);\n String id = Biblioteca.parserNome(restaurante.getId());\n String nome = Biblioteca.parserNome(restaurante.getNome());\n String descricao = Biblioteca.parserNome(restaurante.getDescricao());\n// Log.i(\"NOME\", nome);\n String rank = Biblioteca.parserNome(restaurante.getRank());\n int imagem = context.getResources().getIdentifier(nome, \"mipmap\", context.getPackageName());\n restaurante.setLogo(imagem);\n\n int imgrank = context.getResources().getIdentifier(rank, \"drawable\", context.getPackageName());\n restaurante.setRank(String.valueOf(imgrank));\n\n restaurantes.add(restaurante);\n }\n carregarListView();\n br.close();\n isr.close();\n arquivo.close();\n// Log.i(\"Quantidade\", \"\" + produtos.size());\n } catch (Exception erro) {\n Log.e(\"FRUTARIA Erro\", erro.getMessage());\n }\n\n }", "public List<String> nextOneLine() throws IOException {\n counterSeveralLines = linesAfter;\n if (StringUtils.isBlank(currentPath)) return null;\n String sCurrentLine;\n if ((sCurrentLine = bufferReader.readLine()) != null) {\n listBefore = addToArray(sCurrentLine);\n }\n return listBefore;\n }", "public void resetLines() {\r\n\t\tsetLines(new HashMap<String, ArrayList<Integer>>());\r\n\t}", "private static ArrayList<String> readFile() throws ApplicationException {\r\n\r\n ArrayList<String> bookList = new ArrayList<>();\r\n\r\n File sourceFile = new File(FILE_TO_READ);\r\n try (BufferedReader input = new BufferedReader(new FileReader(sourceFile))) {\r\n\r\n if (sourceFile.exists()) {\r\n LOG.debug(\"Reading book data\");\r\n String oneLine = input.readLine();\r\n\r\n while ((oneLine = input.readLine()) != null) {\r\n\r\n bookList.add(oneLine);\r\n\r\n }\r\n input.close();\r\n } else {\r\n throw new ApplicationException(\"File \" + FILE_TO_READ + \" does not exsit\");\r\n }\r\n } catch (IOException e) {\r\n LOG.error(e.getStackTrace());\r\n }\r\n\r\n return bookList;\r\n\r\n }", "public ArrayList<Client> toReadJobsFaileds(File fichero) throws Exception{\n \n ControlDateJobs controlDateJobs = ControlDateJobs.getInstance();\n \n ArrayList<Client> clients = new ArrayList();\n int i;\n boolean isNewClient;\n String clientName = null;\n String saveSetName = null;\n String groupStartTime = null;\n String saveType = null;\n String level = null;\n \n try{\n Scanner sc=new Scanner(fichero);\n String line=sc.nextLine();\n while(line.indexOf(\"Client Name,\")==-1){\n line=sc.nextLine();\n }\n while(sc.hasNextLine()){\n line=sc.nextLine();\n \n i=line.indexOf(\",\");\n clientName=line.substring(0, i);\n line=line.substring(i+1); \n\n i=line.indexOf(\",\");\n saveSetName=line.substring(0, i);\n line=line.substring(i+2);\n\n i=line.indexOf(\",\");\n groupStartTime =line.substring(0, i);\n line=line.substring(i+1);\n\n i=line.indexOf(\",\");\n saveType=line.substring(0, i);\n line=line.substring(i+1);\n\n i=line.indexOf(\",\");\n level =line.substring(0, i);\n\n isNewClient = true;\n \n i=0;\n \n while(i < clients.size() && isNewClient){\n if(clients.get(i).getName().equals(clientName)){\n ReportErrors reportError = new ReportErrors(saveSetName, groupStartTime, saveType, level, \"failed\");\n clients.get(i).addReportError(reportError);\n controlDateJobs.eventUpdateDateLastDayJobsExecuted(groupStartTime);\n isNewClient = false;\n }else{\n ++i;\n }\n }\n if(isNewClient == true){\n Client client = new Client(clientName);\n clients.add(client);\n ReportErrors reportError = new ReportErrors(saveSetName, groupStartTime, saveType, level, \"failed\");\n clients.get(i).addReportError(reportError);\n controlDateJobs.eventUpdateDateLastDayJobsExecuted(groupStartTime);\n }\n } \n }catch(FileNotFoundException e){\n throw new Exception(\"Error de lectura\");\n } \n return clients;\n }", "private void getDataLists(String path)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile file = new File(path);\n\t\t\tfile.createNewFile();\n\t\t\tBufferedReader fileReader = new BufferedReader(new FileReader(file));\n\t\t\t\n\t\t\tString str = null;\n\t\t\twhile((str = fileReader.readLine()) != null)\n\t\t\t{\n\t\t\t\tthis.dataList.push(str);\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed : data list read\");\n\t\t}\n\t}", "public void addLines(String file, ArrayList<Integer> lines) {\r\n\t\tif (!this._fileLines.containsKey(file))\r\n\t\t\tthis._fileLines.put(file, new ArrayList<Integer>());\r\n\t\tthis._fileLines.get(file).addAll(lines);\r\n\t}", "void addFile(int numberLines);", "public ArrayList<String> readFromFile(){\n ArrayList<String> results = new ArrayList<>();\n //Wrap code in a try/ catch to help with exception handling.\n try{\n //Create a object of Scanner class\n Scanner s = new Scanner(new FileReader(path));\n //While loop for iterating thru the file.\n // Reads the data and adds it to the ArrayList.\n while(s.hasNext()) {\n String c1 = s.next();\n String c2 = s.next();\n String w = s.next();\n results.add(c1);\n results.add(c2);\n results.add(w);\n }return results;\n\n }//File not found exception block.\n catch(FileNotFoundException e){\n System.out.println(e);\n }\n return results;//default return.\n }", "public ArrayList<String> getLines() {\n\t\tif (cachedocs) {\n\t\t\tif (lines == null)\n\t\t\t\tlines = Config.DB.getLines(docid);\n\t\t\treturn lines;\n\t\t}\n\t\telse {\n\t\t\treturn Config.DB.getLines(docid);\n\t\t}\n\t}", "public static List<Contract> readFromFile(String filename) {\n List<Contract> contracts = new ArrayList<>();\n\n InputStreamReader inputStreamReader = null;\n try {\n inputStreamReader = new InputStreamReader(new FileInputStream(new File(filename)),\"cp1251\");\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n String [] lines = null;\n String line = null;\n try{\n while ((line = bufferedReader.readLine()) != null) {\n\n lines= line.split(\",\");\n\n\n LocalDate conc = LocalDate.parse(lines[1], DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n LocalDate start = LocalDate.parse(lines[2], DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n LocalDate end = LocalDate.parse(lines[3], DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n\n Client client=new Client(ClientType.valueOf(lines[4]),lines[5],lines[6]);\n\n ArrayList<InsuredPerson>insuredPeople=new ArrayList<>();\n for(int i=7; i<lines.length; i+=4 ){\n LocalDate d=LocalDate.parse(lines[i+2],DateTimeFormatter.ofPattern(\"dd.MM.yyyy\"));\n InsuredPerson person = new InsuredPerson(Integer.valueOf(lines[i]),lines[i+1],d,Double.valueOf(lines[i+3]));\n insuredPeople.add(person);\n\n\n }\n Contract contract=new Contract(Integer.valueOf(lines[0]),conc,start,end,client,insuredPeople);\n contracts.add(contract);\n }\n bufferedReader.close();}\n catch (IOException e){\n System.out.println(e.getMessage());\n e.printStackTrace();\n }\n return contracts;\n\n }", "private void skaitymasIsFailo() {\n try {\n String eilute = _bufferis.readLine();\n while (eilute != null) {\n eilute = _bufferis.readLine();\n varduSarasas.add(eilute);\n }\n _bufferis.close();\n _in.close();\n } catch (Exception e) {\n\n }\n }", "public static List<Server> readFile() {\n String fileName = \"servers.txt\";\n\n List<Server> result = new LinkedList<>();\n try (Scanner sc = new Scanner(createFile(fileName))) {\n\n while (sc.hasNextLine()) {\n String line = sc.nextLine();\n result.add(lineProcessing(line));\n\n }\n\n } catch (FileNotFoundException e) {\n System.out.println(\"File is not found\");\n } catch (MyException e) {\n System.out.println(\"File is corrupted\");\n }\n return result;\n }", "public List<List<String>> read () {\n List<List<String>> information = new ArrayList<>();\n try (BufferedReader br = new BufferedReader(new FileReader(path))) {\n int aux = 0;\n while ((line = br.readLine()) != null) {\n String[] data = line.split(split_on);\n List<String> helper = new ArrayList<>();\n helper.add(data[0]);\n helper.add(data[1]);\n information.add(helper);\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return information;\n }", "private static void taskContentsFileRestore() {\n try {\n String taskContentsFilePath;\n BufferedReader taskContentsLocation = new BufferedReader(new FileReader(FILE_PATH_CONTENT));\n taskContentsFilePath = taskContentsLocation.readLine();\n\n if (taskContentsFilePath != null) {\n PrintWriter taskContentsWriter = new PrintWriter(taskContentsFilePath);\n for (String content : fileContent) {\n taskContentsWriter.println(content);\n }\n taskContentsWriter.close();\n }\n taskContentsLocation.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private ArrayList<String> readFileAndCountLines(File fileName) throws IOException\n\t{\n\t\tString line = \"\";\n\t\tFileReader strm_reader = null;\n\t\tBufferedReader bffr_reader = null;\n\t\tArrayList<String> fileContents = new ArrayList<String>();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstrm_reader = new FileReader(fileName);\t\n\t\t\tbffr_reader = new BufferedReader(strm_reader);\n\t\t\t\n\t\t\twhile((line = bffr_reader.readLine()) != null)\n\t\t\t{\n\t\t\t\t//Add the contents of a file in a variable\n\t\t\t\tfileContents.add(line);\n\t\t\t\t//Counts the number of routers\n\t\t\t\tfileLineCount++;\n\t\t\t}\n\t\t\tif(fileContents.isEmpty())\n\t\t\t\tSystem.out.println(\"The File is Empty!\");\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"File not Found!\");\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tif(bffr_reader != null)\n\t\t\t\tbffr_reader.close();\n\t\t\tif(strm_reader != null)\n\t\t\t\tstrm_reader.close();\n\t\t}\n\t\treturn fileContents;\n\t}", "public void readPatientListFromFile()\r\n\t{\n\t\tnextPatientLocation = 0;\r\n\t\ttry\r\n\t\t{\r\n\t\t\t//Makes file reader objects and passes filename\r\n\t\t\tFileReader fr = new FileReader(patientMasterfile);\r\n\t\t\tBufferedReader br = new BufferedReader(fr);\r\n\r\n\t\t\t//reads first line and makes a blank patient \r\n\t\t\tString aReadLine = br.readLine();\r\n\t\t\tPatient tempRead = new Patient();\r\n\t\t\t//loops through all lines in the file\r\n\t\t\twhile(aReadLine != null)\r\n\t\t\t{\r\n\t\t\t\t//resets patient to null\r\n\t\t\t\ttempRead = new Patient();\r\n\t\t\t\t//Splits the read in data and assigns that data to the appropriate attribute \r\n\t\t\t\tString[] splitPatientData = aReadLine.split(\"~~\");\r\n\r\n\t\t\t\ttempRead.patientID = splitPatientData[0];\r\n\t\t\t\ttempRead.forename = splitPatientData[1];\r\n\t\t\t\ttempRead.surname = splitPatientData[2];\r\n\t\t\t\ttempRead.username = splitPatientData[3];\r\n\t\t\t\ttempRead.password = splitPatientData[4];\r\n\t\t\t\ttempRead.houseNumber = splitPatientData[5];\r\n\t\t\t\ttempRead.postcode = splitPatientData[6];\r\n\t\t\t\ttempRead.telephoneNumber = splitPatientData[7];\r\n\t\t\t\ttempRead.dob = splitPatientData[8];\r\n\t\t\t\ttempRead.mode = splitPatientData[9];\r\n\t\t\t\t//adds patient to list and gets the next line\r\n\t\t\t\taddPatientToList(tempRead);\r\n\t\t\t\taReadLine = br.readLine();\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t//catches any exceptions trown by reading \r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"Error reading file, \");\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void fileReadGameHistory(String filename)\n {\n \t//ArrayList<GameObject> gameObject = new ArrayList<>();\n\t\tFileReader file = null;\n\t\ttry {\n\t\t\tfile = new FileReader(filename);\n\t\t} catch (FileNotFoundException e) {\n\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(filename);\n\t\tBufferedReader br = new BufferedReader(file);\n\t\tString s = \"\";\n\t\ttry\n\t\t{\n\t\t\twhile((s = br.readLine()) != null )\n\t\t\t{\n\t\t\t\tString[] prop1 = s.split(\"#\");\n\t\t\t\tSystem.out.println(prop1[0] + \" fgdfsgfds \" + prop1[1]);\n\t\t\t\tString indexOfList = prop1[0];\n\t\t\t\tString[] prop2 = prop1[1].split(\",\");\n\t\t\t\tString[] prop3;\n\t\t\t\tString[] prop4 = indexOfList.split(\";\");\n\t\t\t\t//gameObject.add(new GameObject(indexOfList));\n\t\t\t\tcount = count +1;\n\t\t\t\texistCount = existCount + 1;\n\t\t\t\tif (indexOfList.charAt(0) == 's')//when this line is data of a swimming game\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(prop4[0]);\n\t\t\t\t\tgames.add(new Swimming(prop4[1],\"Swimming\",prop4[0]));\n\t\t\t\t\tfor(int i = 0; i < Array.getLength(prop2); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop3 = prop2[i].split(\":\");\n\t\t\t\t\t\tgames.get(count - 1).addParticipant(prop3[0], Integer.parseInt(prop3[1]), 0);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setId(prop3[0]);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setRe(Integer.parseInt(prop3[1]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (indexOfList.charAt(0) == 'c')//when this line is data of a cycling game\n\t\t\t\t{\n\t\t\t\t\tgames.add(new Cycling(prop4[1],\"Cycling\",prop4[0]));\n\t\t\t\t\tfor(int i = 0; i < Array.getLength(prop2); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop3 = prop2[i].split(\":\");\n\t\t\t\t\t\tgames.get(count - 1).addParticipant(prop3[0], Integer.parseInt(prop3[1]), 0);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setId(prop3[0]);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setRe(Integer.parseInt(prop3[1]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (indexOfList.charAt(0) == 'r')//when this line is data of a running game\n\t\t\t\t{\n\t\t\t\t\tgames.add(new Running(prop4[1],\"Running\",prop4[0]));\n\t\t\t\t\tfor(int i = 0; i < Array.getLength(prop2); i++)\n\t\t\t\t\t{\n\t\t\t\t\t\tprop3 = prop2[i].split(\":\");\n\t\t\t\t\t\tgames.get(count - 1).addParticipant(prop3[0], Integer.parseInt(prop3[1]), 0);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setId(prop3[0]);\n//\t\t\t\t\t\tgames.get(count-1).getResults().get(i).setRe(Integer.parseInt(prop3[1]));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (NumberFormatException | IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n }", "public HashMap<String, ArrayList<Integer>> getLines() {\r\n\t\treturn _fileLines;\r\n\t}", "public void setReaderToArray(){\n try{\n String client, number = null;\n\n File reader = new File(\"clientFile/clientInfo.txt\");\n\n Scanner scn = new Scanner(reader);\n scn.useDelimiter(\",\");\n\n while(scn.hasNext()){\n number = scn.next();\n client = scn.next();\n\n clientList.add(client + \" - \" + number);\n }\n scn.close();\n }catch (FileNotFoundException exception){\n System.out.println(\"An error occurred.\");\n }\n }", "public void data() {\n\n BufferedReader br = null;\n try {\n br = new BufferedReader(new FileReader(\"/Users/macbook_user/Desktop/OOP Project/List.txt\"));\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n return;\n }\n\n String[] columnName\n = {\"Id\", \"Name\", \"Amount\", \"Shelf#\", \"Position\"};\n int i, index;\n String line;\n try {\n br.readLine();\n while ((line = br.readLine()) != null) {\n index = 0;\n String[] se = line.split(\" \");\n Map<String, Object> item = new HashMap<>();\n for (i = 0; i < se.length; i++) {\n if (\"\".equals(se[i])) {\n continue;\n }\n if (index >= columnName.length) {\n continue;\n }\n item.put(columnName[index], se[i]);\n index++;\n }\n\n //get the amount of the item from the list\n int amount = Integer.parseInt((String) item\n .get(columnName[2]));\n\n // if amount greater than 0, Existence is Y, else N\n if (amount > 0) {\n item.put(\"Existence\", \"Y\");\n } else {\n item.put(\"Existence\", \"N\");\n }\n\n inventory.add(item);// add item to ArrayList\n }\n br.close();\n\n outPutFile();\n } catch (IOException e) {\n }\n\n }", "public void populateListFromFile() \n\t{\n\t\tBufferedReader bufferedReader = null;\n\t\tallQuestions = new ArrayList<ArrayList<String>>();\n\t\tquestionAndAnswers = new ArrayList<String>();\n\n\t\ttry {\n\t\t bufferedReader = new BufferedReader(new FileReader(\"questions.txt\"));\n\t\t String line = \"\";\n\t\t \n\t\t while ((line = bufferedReader.readLine()) != null) \n\t\t {\t\t\t \t\n\t\t \tif(line.length() > 0)\n\t\t \t\tquestionAndAnswers.add(line);\n\t\t \telse if (line.length() == 0)\n\t\t \t{\n\t\t \t\tallQuestions.add(questionAndAnswers);\n\t\t \t\tquestionAndAnswers = new ArrayList<String>();\n\t\t \t}\n\t\t } \n\t\t} catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t}\n\t}", "public ArrayList<String> loadLines(String filename) {\n ArrayList<String> lines = new ArrayList<String>();\n String[] rawLines = loadStrings(filename);\n for(String str : rawLines) {\n if(str != null && !str.isEmpty()){\n lines.add(str);\n }\n }\n return lines;\n }", "public List<String> readFile() {\n \n try {\n ensureFileExists();\n return Files.readAllLines(filePath);\n } catch (FileNotFoundException ex) {\n return new ArrayList<>();\n } catch (IOException ex) {\n ex.printStackTrace();\n return new ArrayList<>();\n }\n }", "public ArrayList<String> read_file() {\n prog = new ArrayList<>();\n //Read file\n try {\n\n File myObj = new File(\"in3.txt\");\n Scanner myReader = new Scanner(myObj);\n while (myReader.hasNextLine()) {\n String data = myReader.nextLine();\n if (data.charAt(0) != '.') {\n// System.out.println(data);\n prog.add(data);\n } else {\n continue;\n// data = data.substring(1);\n// System.out.println(\"{{ \" + data + \" }}\");\n }\n\n }\n myReader.close();\n\n } catch (FileNotFoundException e) {\n System.out.println(\"An error occurred.\");\n e.printStackTrace();\n }\n\n return prog;\n }", "public ArrayList<String> readFromFile(String fileName) throws IOException {\n\t\tBufferedReader reader = new BufferedReader(new FileReader(fileName));\n\t ArrayList<String> retour = new ArrayList<String>();\n\t String line = null;\n\t while((line = reader.readLine()) != null) \n\t \tretour.add(line);\n\t \n\t reader.close();\n\t return retour; \n\t}", "public synchronized void readLog() {\n MemoryCache instance = MemoryCache.getInstance();\n try (Stream<String> stream = Files.lines(Paths.get(path)).skip(instance.getSkipLine())) {\n stream.forEach(s -> {\n Result result = readEachLine(s);\n instance.putResult(result);\n instance.setSkipLine(instance.getSkipLine() + 1);\n });\n } catch (IOException e) {\n logger.error(\"error during reading file \" + e.getMessage());\n }\n }", "static void readRecipes() {\n\t\tBufferedReader br = null;\n\t\tString line = \"\";\n\t\tString cvsSplitBy = \",\";\n\t\ttry {\n\n\t\t\tbr = new BufferedReader(new FileReader(inputFileLocation));\n\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\tString[] currentLine = line.split(cvsSplitBy);\n\t\t\t\tRecipe currentRecipe = new Recipe(currentLine[0]);\n\t\t\t\t/*\n\t\t\t\t * String[] recipe=new String[currentLine.length-1];\n\t\t\t\t * System.arraycopy(currentLine,1,recipe,0,recipe.length-2);\n\t\t\t\t */\n\t\t\t\tString[] recipe = java.util.Arrays.copyOfRange(currentLine, 1,\n\t\t\t\t\t\tcurrentLine.length);\n\t\t\t\tArrayList<String> ingredients = new ArrayList<String>();\n\t\t\t\tfor (String a : recipe) {\n\t\t\t\t\tingredients.add(a);\n\t\t\t\t}\n\t\t\t\tcurrentRecipe.setIngredients(ingredients);\n\t\t\t\tRecipes.add(currentRecipe);\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\tif (br != null) {\n\t\t\t\ttry {\n\t\t\t\t\tbr.close();\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}\n\n\t}", "static List<String> fileReader(String fileName){\n \n \n //Read a file and store the content in a string array.\n File f = new File(fileName);\n BufferedReader reader = null;\n String tempString = null;\n List<String> fileContent = new ArrayList<String>();\n //String[] fileContent = null;\n //int i = 0;\n \n try {\n reader = new BufferedReader(new FileReader(f));\n while ((tempString = reader.readLine()) != null){\n //while ((fileContent[i] = reader.readLine()) != null){\n fileContent.add(tempString);\n //i++;\n }\n reader.close();\n } catch (FileNotFoundException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n finally{\n if (reader != null){\n try{\n reader.close();\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }\n }\n \n return fileContent;\n \n }", "private static void eachLine(BufferedReader br, List<String> lines) throws IOException {\n try {\n while (true) {\n String line = br.readLine();\n if (line == null) {\n break;\n } else {\n lines.add(line);\n }\n }\n } finally {\n br.close();\n }\n }", "public static void loadArrayList() throws IOException\n\t{\n\t\tString usersXPFile = \"UsersXP.txt\";\n\t\t\n\t\tFile file = new File(usersXPFile);\n\t\t\n\t\tScanner fileReader;\n\t\t\n\t\tif(file.exists())\n\t\t{\n\t\t\tfileReader = new Scanner(file);\n\t\t\twhile(fileReader.hasNext())\n\t\t\t\tuserDetail1.add(userData.addNewuser(fileReader.nextLine().trim()));\n\t\t\tfileReader.close();\n\t\t}\n\t\telse overwriteFile(usersXPFile, \"\");\n\t\t\n\t\t\n\t}", "public static void read8() {\n List<String> list = new ArrayList<>();\n\n try (Stream<String> stream = Files.lines(Paths.get(filePath))) {\n\n //1. filter line 3\n //2. convert all content to upper case\n //3. convert it into a List\n list = stream\n .filter(line -> !line.startsWith(\"line3\"))\n .map(String::toUpperCase)\n .collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }", "protected List<String> readFile()\n {\n // Base size 620 for Google KML icons. This might be slow for larger\n // sets.\n List<String> lines = New.list(620);\n try (BufferedReader reader = new BufferedReader(\n new InputStreamReader(getClass().getResourceAsStream(myImageList), StringUtilities.DEFAULT_CHARSET)))\n {\n for (String line = reader.readLine(); line != null; line = reader.readLine())\n {\n lines.add(line);\n }\n }\n catch (IOException e)\n {\n LOGGER.warn(e.getMessage());\n }\n return lines;\n }", "public void resetLines() throws IOException {\n counterSeveralLines = linesAfter;\n if (currentPath != null) {\n bufferReader.close();\n fileReader.close();\n fileReader = new FileReader(currentPath);\n bufferReader = new BufferedReader(fileReader);\n arrayPreviousLines = new String[prevSize];\n resetDateBefore();\n }\n }", "private void getLines(File file)\n\t{\n\n\t\ttry {\n\t\t\tList<String> lines = FileUtils.readLines(file);\n\t\t\tthis.lines = lines;\n\t\t\tfor(int i = 0; i < lines.size(); i++)\n\t\t\t{\n\t\t\t\tfile = new File(lines.get(i));\n\t\t\t\tif(file.getName().contains(\".\"))\n\t\t\t\t{\n\t\t\t\t\tfile.createNewFile();\n\t\t\t\t\tString link = Main.dl + file.getName();\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"Downloading: \" + file.getName());\n\t\t\t\t\tMain.file(link, file);\n\t\t\t\t}\n\t\t\t}\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}", "public void readHistory()throws Exception {\n int currentline = 0;\n File myObj = new File(\"order_history.txt\");\n Scanner myReader = new Scanner(myObj);\n outputHistoryObj = new Order[1];\n while (myReader.hasNextLine()) {\n Pizza[] list = new Pizza[1];\n String[] commentparts = null; //This is superstitious, sorry\n String[] fullparts = myReader.nextLine().split(\" // \");\n String[] pizzaparts = fullparts[1].split(\" , \");\n for(int i=0; i<=pizzaparts.length-1; i++){\n if(pizzaparts[i].contains(\" & \")){\n commentparts = pizzaparts[i].split(\" & \");\n list[i] = new Pizza(Menu.list[Integer.parseInt(commentparts[0])-1].getName(), Menu.list[Integer.parseInt(commentparts[0])-1].getIngredients(), commentparts[1], Integer.parseInt(commentparts[0]), Menu.list[Integer.parseInt(commentparts[0])-1].getPrice());\n } else {\n list[i] = new Pizza(Menu.list[Integer.parseInt(pizzaparts[i])-1].getName(), Menu.list[Integer.parseInt(pizzaparts[i])-1].getIngredients(), \"\", Integer.parseInt(pizzaparts[i]), Menu.list[Integer.parseInt(pizzaparts[i])-1].getPrice());\n }\n list = Arrays.copyOf(list, list.length + 1); //Resize name array by one more\n }\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.SSS\");\n Date parsed = format.parse(fullparts[3]);\n java.sql.Timestamp timestamp = new java.sql.Timestamp(parsed.getTime());\n outputHistoryObj[currentline] = new Order(fullparts[0], Integer.parseInt(fullparts[2]), timestamp, list);\n outputHistoryObj = Arrays.copyOf(outputHistoryObj, outputHistoryObj.length + 1); //Resize name array by one more\n currentline++;\n }\n myReader.close();\n }", "public static ArrayList<MonitoredData> readFileData(){\n ArrayList<MonitoredData> data = new ArrayList<>();\n List<String> lines = new ArrayList<>();\n try (Stream<String> stream = Files.lines(Paths.get(\"Activities.txt\"))) {\n lines = stream\n .flatMap((line->Stream.of(line.split(\"\\t\\t\"))))\n .collect(Collectors.toList());\n for(int i=0; i<lines.size()-2; i+=3){\n MonitoredData md = new MonitoredData(lines.get(i), lines.get(i+1), lines.get(i+2));\n data.add(md);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n //data.forEach(System.out::println);\n return data;\n }", "private void readSavedFile() {\n\n String[] files = new String[0];\n \n // On récupère la liste des fichiers\n File file = new File(folderName);\n\n // check if the specified pathname is directory first\n if(file.isDirectory()){\n //list all files on directory\n files = file.list();\n }\n\n if (files != null) {\n for(String currentFile : files) {\n Vehicule voiture;\n try {\n FileInputStream fileIn = new FileInputStream(folderName + \"/\" + currentFile);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n voiture = (Vehicule) in.readObject();\n addVoitureToList(voiture);\n in.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"#Erreur : Impossible de récupérer l'objet \" + currentFile);\n c.printStackTrace();\n return;\n }\n }\n }\n }", "public static void main(String[] args) {\n\r\n\t\tArrayList<CorreoElectronico> correo = new ArrayList<>();\r\n\r\nPath path = Paths.get(\"src/main/resources/emails.txt\");\r\n\r\n try(BufferedReader reader = Files.newBufferedReader(path, Charset.forName(\"UTF-8\"))){ \r\n\r\n String currentLine = null;\r\n\r\n while((currentLine = reader.readLine()) != null){//while there is content on the current line\r\n\r\n \t CorreoElectronico correos = new CorreoElectronico();\r\n \t String[] linea = currentLine.split(\" , \");\r\n \t correos.setDireccion(linea[0]);\r\n \t correos.setAsunto(linea[1]);\r\n \t correo.add(correos);\r\n System.out.println(currentLine); // print the current line\r\n\r\n }\r\n\r\n }catch(IOException ex){\r\n\r\n ex.printStackTrace(); //handle an exception here\r\n\r\n }\r\nEnviadorCorreo enviador = new EnviadorCorreo();\r\nfor (CorreoElectronico coreos: correo) {\r\n\tenviador.enviarCorreo(coreos);\r\n}\r\n\r\n\t}", "public void readFile() {\n try\n {\n tasksList.clear();\n\n FileInputStream file = new FileInputStream(\"./tasksList.txt\");\n ObjectInputStream in = new ObjectInputStream(file);\n\n boolean cont = true;\n while(cont){\n Task readTask = null;\n try {\n readTask = (Task)in.readObject();\n } catch (Exception e) {\n }\n if(readTask != null)\n tasksList.add(readTask);\n else\n cont = false;\n }\n\n if(tasksList.isEmpty()) System.out.println(\"There are no todos.\");\n in.close();\n file.close();\n }\n\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "public ArrayList<DeliveryVehicle> getVehiclesFromFile() throws java.io.IOException {\n \n DeliveryVehicleController controller = new DeliveryVehicleController();\n \n //reading the file and adding all lines to the list\n List<String> lines = Files.readAllLines(Paths.get(_filePath));\n String[] lineTokens;\n List<String> fileLines = Files.readAllLines(Paths.get(_filePath));\n\n for(String line : fileLines) {\n lineTokens = line.split(\" \");\n \n //Possible to change if statement case statement instead\n // [0] = Bike Used to check what type (never going to change)\n // [1] = RegNumber\n // [2] = EngineSize\n // [3] = DaysInService\n // [4] = MilesCovered\n // [5] = Deliverys\n\n if (lineTokens[0].equalsIgnoreCase(\"Bike\")){\n // System.out.print(lineTokens[1] + \"THISSHOULD BE REG NUMBER\");\n controller.addBike( lineTokens[1] , Integer.parseInt(lineTokens[2]), Integer.parseInt(lineTokens[3] ), Double.parseDouble(lineTokens[4] ), Integer.parseInt(lineTokens[5]) );\n // return _vehicleList;\n // System.out.print(_vehicleList);\n }\n\n else if (lineTokens[0].equalsIgnoreCase(\"Car\")){\n controller.addCar( lineTokens[1] , Integer.parseInt(lineTokens[2]), Integer.parseInt(lineTokens[3] ), Double.parseDouble(lineTokens[4] ), Integer.parseInt(lineTokens[5]) );\n // return _vehicleList;\n }\n\n else if (lineTokens[0].equalsIgnoreCase(\"Scooter\")){\n // _vehicleList.add(new DeliveryScooter( lineTokens[1] , Integer.parseInt(lineTokens[2]), Integer.parseInt(lineTokens[3] ), Double.parseDouble(lineTokens[4] ), Integer.parseInt(lineTokens[5]) ));\n controller.addScooter( lineTokens[1] , Integer.parseInt(lineTokens[2]), Integer.parseInt(lineTokens[3] ), Double.parseDouble(lineTokens[4] ), Integer.parseInt(lineTokens[5]) );\n // return _vehicleList;\n }\n } \n \n return controller.getVehiclesList();\n \n }", "public static ArrayList<Item> readFromFile() {\n\t\t\n\t\tPath writeFile = Paths.get(\"list.txt\");\n\t\tFile file = writeFile.toFile();\n\t\tArrayList<Item> itemList = new ArrayList<Item>();\n\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\t// this is a buffer and the benefit of using this is to is to store a block of\n\t\t\t// memory that\n\t\t\t// we can read data from later -- more efficient than Scanner\n\n\t\t\tBufferedReader reader = new BufferedReader(fr);\n\t\t\t// this is attempting to read the first line from the text document\n\t\t\tString line = \"\";\n\t\t\twhile ((line = reader.readLine()) != null) {\n\n\t\t\t\tString[] stringArray= line.split(\",\");\n\t\t\t\tItem item = new Item(Integer.parseInt(stringArray[0]), stringArray[1], stringArray[2],stringArray[3],Integer.parseInt(stringArray[4]),Double.parseDouble(stringArray[5]) );\n\t\t\t\titemList.add(item);\n\t\t\t}\n\t\t\treader.close();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"There were no items!\");\n\t\t}\n\t\treturn itemList;\n\t}", "public List<String> readFile(File inputFile) {\n\n List<String> AL = new ArrayList<>();\n List<String> retAL;\n wordReplace wr = new wordReplace();\n String text;\n try{\n Scanner file_scan = new Scanner(inputFile);\n while(file_scan.hasNextLine()){\n text= file_scan.nextLine();\n AL.add(text);\n }\n file_scan.close();\n }\n catch(IOException e){\n System.out.println(\"File Not Found for some reason.\");\n }\n retAL = wr.replaceWord((ArrayList<String>) AL);\n return retAL;\n }", "public void newBufLine() {\n this.buffer.add(new ArrayList<Integer>());\n this.columnT = 0;\n this.lineT++;\n }", "public ArrayList<String> loadRead() {\n\n\t\tSAVE_FILE = READ_FILE;\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tlist = loadIds();\n\t\treturn list;\n\t}", "public void refreshImages() {\n\t\tsetContentView(R.layout.activity_overview);\n\t\trow = 0;\n\t\tcolumn = 0;\n\t\t// Open the file\n\t\tFile file = new File(getFilesDir().getAbsoluteFile() + \"/photos.txt\");\n\t\tLog.i(TAG, file.getAbsolutePath());\n\t\t// If there is no file, create a new one\n\t\tif (!file.exists()) {\n\t\t\ttry {\n\t\t\t\tfile.createNewFile();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t\ttry {\n\t\t\t// Open an inputStream for reading the file\n\t\t\tFileInputStream inStream = openFileInput(\"photos.txt\");\n\t\t\tBufferedReader readFile = new BufferedReader(new InputStreamReader(inStream));\n\t\t\tpicturePaths = new ArrayList<String>();\n\t\t\tString receiveString = \"\";\n\t\t\t// Read in each line\n\t\t\twhile ((receiveString = readFile.readLine()) != null) {\n\t\t\t\t// Add the line to picturePaths and add an Image with the path specified\n\t\t\t\tpicturePaths.add(receiveString);\n\t\t\t\tLog.i(\"picture\", receiveString);\n\t\t\t\taddImage(receiveString);\n\t\t\t\treceiveString = \"\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}" ]
[ "0.7339153", "0.6617433", "0.6520455", "0.6489618", "0.6337725", "0.6299403", "0.62544054", "0.61610925", "0.6151345", "0.61283267", "0.6117058", "0.60672635", "0.60587907", "0.6046191", "0.60350406", "0.6003925", "0.5986333", "0.59759", "0.59414005", "0.59316295", "0.58944064", "0.5866665", "0.5827429", "0.57960415", "0.577999", "0.5771345", "0.5758267", "0.5749829", "0.5745586", "0.5739967", "0.57223964", "0.5698985", "0.56988066", "0.56837195", "0.56686044", "0.56637716", "0.5661404", "0.56392324", "0.5637464", "0.5636949", "0.5634447", "0.56318754", "0.560142", "0.5591152", "0.5563625", "0.5561314", "0.5559074", "0.5553081", "0.55505735", "0.5531895", "0.5530109", "0.552982", "0.5527855", "0.55263865", "0.55188584", "0.55184203", "0.5513678", "0.5505665", "0.5485704", "0.54826134", "0.5480237", "0.5476314", "0.54669917", "0.54610366", "0.54519105", "0.5449431", "0.54419386", "0.54379445", "0.5434988", "0.54339856", "0.5428558", "0.54194736", "0.5418103", "0.5416322", "0.5413538", "0.54123247", "0.5411505", "0.5410244", "0.541004", "0.5407188", "0.54033834", "0.54002464", "0.53995085", "0.53976065", "0.5396981", "0.53904134", "0.5389414", "0.5387831", "0.5386817", "0.5384672", "0.53775406", "0.5374476", "0.53724825", "0.5354858", "0.5354474", "0.5353413", "0.53459775", "0.5344436", "0.5338018", "0.5331819" ]
0.53565156
93
Print the file content
public void printFile() { for(String[] line_i: linesArray) { System.out.println( Arrays.toString(line_i) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 void printData() {\n\t\ttry {\n\t\t\tFiles.lines(new File(PAYROLL_FILE_NAME).toPath())\n\t\t\t.forEach(System.out::println); \n\t\t}catch(IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Override\n\tpublic void printToFile() {\n\t\t\n\t}", "public void printContent() {\n\t\tSystem.out.println(this.content);\n\t}", "private void printDetails(FileDTO file) {\n\t\tif (file == null) {\n\t\t\tsafePrintln(\"The file could not be retrieved or does not exist!\");\n\t\t} else {\n\t\t\tsafePrintln(file.getName() + \"|\" + file.getPermission() + \"|\" + file.getSize().toString() + \" - \"\n\t\t\t\t\t+ file.getOwnerName());\n\t\t}\n\t}", "public String getFormattedFileContents ();", "abstract void print(String fileName);", "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 }", "void print(String fileName)\n\t{\n\t\t//Get the reference of the head of the Linked list\n\t\tNode ref = head;\n\t\t\n\t\t//Print the elements and also write them into a file if the head is initialized\n\t\tif(ref != null)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\t//Create a file output.txt\n\t\t\t\tPrintWriter writer = new PrintWriter(fileName);\n\t\t\t\t\n\t\t\t\t//Traverse till the end of the Linked List \n\t\t\t\twhile(ref != null)\n\t\t\t\t{\n\t\t\t\t\tref = ref.next;\n\t\t\t\t\tif(ref != null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//Print the elements and also write them into a file\n\t\t\t\t\t\tSystem.out.print(ref.value + \" \");\n\t\t\t\t\t\twriter.print(ref.value + \" \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Close the file\n\t\t\t\twriter.close();\n\t\t\t} \n\t\t\tcatch (FileNotFoundException e) \n\t\t\t{\n\t\t\t\t//Printing the Stack Trace if an exception has occurred\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printFileOnconsole(File file, int tabs,int lenghtOfDirectory) throws DirectoryException{\r\n\t\tSystem.out.println(\"file ->\" + file);\r\n\t\tString fileName = file.getName();\r\n\t\tString[] split = fileName.split(HelperContstants.DELIMETER);\r\n\t\tfor (int i = 0; i < tabs; i++) {\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tSystem.out.println(\"- Document: \" + file.getName() + \" - Extension: .\" + split[split.length - 1] + \" - URL: \"\r\n\t\t\t\t+ file.getAbsolutePath().substring(lenghtOfDirectory));\r\n\t}", "public String toString(){\n\t\tFileHandler fw = new FileHandler(); //Create new object for file write\n \tformatText(title);\n \tformatText(snippet);\n \tsnippet = removeLineBreak(snippet);\n \t\n \t//Print out contents to screen\n \tSystem.out.println(urlLabel + link);\n \tSystem.out.println(titleLabel + title);\n\t\tSystem.out.println(snippetLabel + snippet);\n\t\t\n\t\t//Write contents to file\n\t\tfw.writeToFile(urlLabel, link, fw.file, false);\n\t\tfw.writeToFile(titleLabel, title, fw.file, false);\n\t\tfw.writeToFile(snippetLabel, snippet, fw.file, false);\n\t\tfw.writeToFile(\"---------- END OF RESULT -----------\",\"\", fw.file, false);\n\t return \"\";\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 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 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 void print ()\n\t{\n\t\tSystem.out.println(\"Polyhedron File Name: \" + FileName);\n\t\tSystem.out.println(\"Object active: \" + Boolean.toString(isActive()));\n\t\tprintCoordinates();\n\t}", "public String fileView(RandomAccessFile file){\n StringBuilder out = new StringBuilder(\"\");\n try{\n file.seek(0);\n while(true){\n out.append(file.readInt() + \"\\n\");\n }\n }catch (IOException e){\n\n }\n return out.toString();\n }", "private String getFileContents ()\n {\n final String s = m_buffers.values ()//\n .stream ()//\n .flatMap (List::stream)//\n .collect (Collectors.joining ());\n\n return s;\n }", "public void print() {\n for (int i=0; i<lines.size(); i++)\n {\n System.out.println(lines.get(i));\n }\n }", "public static void showContentWithData() throws IOException {\n DataInputStream dataInputStream = new DataInputStream(new FileInputStream(RESOURCES_FOLDER + \"\\\\lorem_ipsum.txt\"));\n StringBuilder builder = new StringBuilder();\n while (dataInputStream.available() > 0) {\n builder.append((char) dataInputStream.read());\n }\n System.out.println(builder);\n }", "private static void printFileInfo(File file) {\n window.putLog(String.format(\"[%6dkb] Modified %s @%s\", 1 + file.length() / 1024,\n new SimpleDateFormat(\"YYYY-MM-dd HH:mm\").format(new Date(file.lastModified())),\n file.getPath().substring(workingDirectory.getParent().length())));\n }", "public static void printLoadingFile() {\n System.out.println(Message.LOADING_FILE);\n }", "@Override\r\n\tpublic void test() {\n\t\tFile file = new File(\"c:\\\\testing.txt\");\r\n\t\tFileInputStream fis = null;\r\n\t\tBufferedInputStream bis = null;\r\n\t\t\r\n\t\tbyte[] buf = new byte[1024];\r\n\t\t\r\n\t\ttry {\r\n\t\t\tfis = new FileInputStream(file);\r\n\t\t\tbis = new BufferedInputStream(fis);\r\n\t\t\t\r\n\t\t\twhile (bis.available() != 0) {\r\n\t\t\t\tSystem.out.println(bis.read(buf));\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif(bis!=null)\r\n\t\t\t\t\tbis.close();\r\n\t\t\t\tif(fis != null) \r\n\t\t\t\t\tfis.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "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 void printDataToFile(){\n\ttry {\n\t File file = new File(\"media/gameOutput.txt\");\n \n\t // if file doesnt exists, then create it\n\t if (!file.exists()) {\n\t\tfile.createNewFile();\n\t }\n \n\t FileWriter fw = new FileWriter(file.getAbsoluteFile());\n\t BufferedWriter bw = new BufferedWriter(fw);\n\t bw.write(printString);\n\t bw.close();\n\t} catch (IOException e) {\n\t e.printStackTrace();\n\t}\n }", "public static void printFileInfo(String filePath) {\n File f1 = new File(filePath);\n System.out.println(\"File name: \" + f1.getName());\n System.out.println(\"Path: \" + f1.getPath());\n System.out.println(\"Parent: \" + f1.getParent());\n System.out.println(f1.exists() ? \"file exist\" : \"file is not exist\");\n System.out.println(f1.canRead() ? \"file readable\" : \"file is not readable\");\n System.out.println(f1.canWrite() ? \"file writable\" : \"file is not writable\");\n System.out.println(f1.isDirectory() ? \"It is directory\" : \"It is not directory\");\n System.out.println(f1.isFile() ? \"It is a simple file\" : \"It can be named channel\");\n System.out.println(f1.isAbsolute() ? \"It is absolute\" : \"It is not absolute\");\n System.out.println(\"Last modified: \" + f1.lastModified());\n System.out.println(\"Size is \" + f1.length() + \" byte\");\n }", "private void displayFileContents(FileInputStream fis) throws Exception {\n\t\tScanner scanner = null;\n\t\ttry {\n\t\t\tscanner = new Scanner(fis);\n\t\t\twhile (scanner.hasNextLine()) {\n\t\t\t\tSystem.out.println(scanner.nextLine());\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tthrow new Exception(e.getMessage());\n\t\t} finally {\n\t\t\tif (scanner != null) {\n\t\t\t\tscanner.close();\n\t\t\t}\n\t\t}\n\t}", "public void print() {\n\t\tSystem.out.println(\"ONOMA IDIOKTITH: \" + fname);\n\t\tSystem.out.println(\"EPWNYMO IDIOKTITH: \" + lname);\n\t\tSystem.out.println(\"DIEUTHINSH FARMAKEIOU: \" + address);\n\t\tSystem.out.println(\"THLEFWNO FARMAKEIOU: \" + telephone);\n\t\tSystem.out.println();\n\t}", "public void printFilenames(){\n\t\tSystem.out.println(\"\\nAgent list of files: \" + this.filenames.size());\n\t\tfor(int i = 0;i<filenames.size();i++){\n\t\t\tSystem.out.println(i+1+ \") \" + filenames.get(i));\n\t\t}\n\t\tSystem.out.println(\"\");\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 }", "private static void info ( File f ) {\n\tString nume = f . getName () ;\n\tif( f.isFile () )\n\tSystem.out.println ( \" Fisier : \" + nume ) ;\n\telse\n\tif( f.isDirectory () )\n\tSystem.out.println ( \" Director : \" + nume ) ;\n\tSystem.out.println (\n\t\" Cale absoluta : \" + f.getAbsolutePath () +\n\t\" \\n Poate citi : \" + f.canRead () +\n\t\" \\n Poate scrie : \" + f.canWrite () +\n\t\" \\n Parinte : \" + f.getParent () +\n\t\" \\n Cale : \" + f.getPath () +\n\t\" \\n Lungime : \" + f.length () +\n\t\" \\n Data ultimei modificari : \" +\n\tnew Date ( f.lastModified () ) ) ;\n\tSystem.out.println ( \" --------------\" ) ;\n\t}", "private void printFile(Products print, String ufilename) {\n\t\tFile file = new File(\"output\"+File.separator+ufilename+fileId+\".xml\"); \n\t\tSystem.out.println(\"Exporting : \"+ file);\n\t\tJAXBContext jaxbContext;\n\t\ttry {\n\t\t\tjaxbContext = JAXBContext.newInstance(Products.class); \n\t\t\tMarshaller jaxbMarshaller = jaxbContext.createMarshaller();\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);\n\t\t\tjaxbMarshaller.setProperty(\"com.sun.xml.internal.bind.xmlHeaders\", \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");\n\t\t\tjaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);\n\t\t\tjaxbMarshaller.marshal(print, file); // prints the file\n\t\t\t// \t\t jaxbMarshaller.marshal(products, System.out);\n\t\t} catch (JAXBException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private String getFileContent(java.io.File fileObj) {\n String returned = \"\";\n try {\n java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(fileObj));\n while (reader.ready()) {\n returned = returned + reader.readLine() + lineSeparator;\n }\n } catch (FileNotFoundException ex) {\n JTVProg.logPrint(this, 0, \"файл [\" + fileObj.getName() + \"] не найден\");\n } catch (IOException ex) {\n JTVProg.logPrint(this, 0, \"[\" + fileObj.getName() + \"]: ошибка ввода/вывода\");\n }\n return returned;\n }", "public void handlePrintFile (File printFile) {\n // not supported\n }", "private void printInputMessage() {\n System.out.println(\"Printing the input message:\");\n try(BufferedReader inputBuffer = Files.newBufferedReader(inputPath)) {\n String inputLine;\n while((inputLine = inputBuffer.readLine()) != null) {\n System.out.print(inputLine+\"\\n\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void print() \n\t{\n\t\tSystem.out.println(\"existing files:\\n\");\n\t\tIterator<Entry<String, byte[]>> existing = this.existingFile.entrySet().iterator();\n\t\twhile (existing.hasNext()) \n\t\t{\n\t\t\tEntry<String, byte[]> entry = existing.next();\n\t\t\tString key = entry.getKey();\n\t\t\tbyte[] macValue = entry.getValue();\n\t\t\tSystem.out.println(key + \" - \" + bytes2HexString(macValue));\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\\n\\nprefix files:\\n\");\n\t\tIterator<Entry<String, byte[]>> prefix = this.prefix.entrySet().iterator();\n\t\twhile (prefix.hasNext()) \n\t\t{\n\t\t\tEntry<String, byte[]> entry = prefix.next();\n\t\t\tString key = entry.getKey();\n\t\t\tbyte[] macValue = entry.getValue();\n\t\t\tSystem.out.println(key + \" - \" + bytes2HexString(macValue));\n\t\t}\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 demoReadAll(){\n try{\n //Read entire file bytes. Return in byte format. Don't need to close() after use. \n byte[] b = Files.readAllBytes(Paths.get(\"country.txt\"));\n String s = new String(b);\n System.out.println(s);\n }\n catch(IOException e){\n e.printStackTrace();\n }\n }", "public void printData()\n {\n reader.printData();\n }", "public void showContent() {\n createStream().forEach(System.out::println);\n }", "@Override\n public String toString() {\n return fileEmpty(); //when file is empty\n }", "public void readFile();", "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 recordOrder(){\n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){//throws exception\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Coffee);//prints in file contents of Coffee\n output.close();//closes file\n }", "public void read() {\n\t\tSystem.out.println(\"word document\");\r\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 void printAll() {\r\n\t\t\t\t\r\n\t\tSystem.out.println(\"################\");\r\n\t\tSystem.out.println(\"Filename:\" +getFileName());\r\n\t\tSystem.out.println(\"Creation Date:\" +getCreationDate());\r\n\t\tSystem.out.println(\"Genre:\" +getGenre());\r\n\t\tSystem.out.println(\"Month:\" +getMonth());\r\n\t\tSystem.out.println(\"Plot:\" +getPlot());\r\n\t\tSystem.out.println(\"New Folder Name:\" + getNewFolder());\r\n\t\tSystem.out.println(\"New Thumbnail File Name:\" +getNewThumbnailName());\r\n\t\tSystem.out.println(\"New File Name:\" +getNewFilename());\r\n\t\tSystem.out.println(\"Season:\" +getSeason());\r\n\t\tSystem.out.println(\"Episode:\" +getEpisode());\r\n\t\tSystem.out.println(\"Selected:\" +getSelectEdit());\r\n\t\tSystem.out.println(\"Title:\" +getTitle());\r\n\t\tSystem.out.println(\"Year:\" +getYear());\r\n\t\tSystem.out.println(\"Remarks:\" +getRemarks());\r\n\t\tSystem.out.println(\"################\");\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 printInfo() {\n System.out.println(\"\\nThis program reads the file lab4.dat and \" +\n \"inserts the elements into a linked list in non descending \"\n + \"order.\\n\" + \"The contents of the linked list are then \" +\n \"displayed to the user in column form.\\n\");\n }", "String getFileOutput();", "private static String getText(IFile file) throws CoreException, IOException {\n\t\tInputStream in = file.getContents();\n\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\tbyte[] buf = new byte[1024];\n\t\tint read = in.read(buf);\n\t\twhile (read > 0) {\n\t\t\tout.write(buf, 0, read);\n\t\t\tread = in.read(buf);\n\t\t}\n\t\treturn out.toString();\n\t}", "public void print() {\n\n if (root == null) // If the root does not exist, then we cannot print anything\n {\n System.out.println(\"The head does not exist \");\n return;\n }\n\n directory Fileptr = root;\n while (Fileptr != null) {\n System.out.print(Fileptr.a);\n System.out.print(\" ( Available Space \" + Fileptr.availableSpace + \" ) \" + \" ----> \");\n Fileptr = Fileptr.forward;\n }\n System.out.print(\" NULL \\n\");\n }", "private static void _printResource (final String filename)\n {\n try\n {\n // find the file resource\n final InputStream is = Main.class.getResourceAsStream (filename);\n if (is == null)\n throw new java.io.FileNotFoundException (filename);\n final BufferedReader br = new BufferedReader (new InputStreamReader (is));\n boolean doOutput = true;\n String line;\n while ((line = br.readLine ()) != null)\n {\n if (line.startsWith (\"@@@ \"))\n {\n // special control line\n if (line.equals (\"@@@ START DEBUG ONLY\"))\n doOutput = CSTX.DEBUG;\n else\n if (line.equals (\"@@@ END DEBUG ONLY\"))\n doOutput = true;\n // else: ignore\n continue;\n }\n if (doOutput)\n System.err.println (line);\n }\n System.err.println (\"\");\n }\n catch (final IOException ex)\n {\n log.error (\"Exception\", ex);\n }\n }", "public String printfull(){\r\n\t\tString ans = this.toString() + \" \\n\";\r\n\t\t\r\n\t\tArrayList <String> details = getOpDetails();\r\n\t\tfor(String d: details){\r\n\t\t\tans = ans + d + \" \\n\";\r\n\t\t}\r\n\t\t\r\n\t\tans = ans + \"Input Files:\\n\" ;\r\n\t\tFileInfo fileIndex = (FileInfo)input.getFirstChild();\r\n\t\twhile(fileIndex != null){\r\n\t\t\tans = ans + fileIndex.toString() + \"\\n\";\r\n\t\t\tfileIndex = (FileInfo)fileIndex.getNextSibling();\r\n\t\t}//end input while\r\n\t\t\r\n\t\t\r\n\t\tans = ans + \"Output Files:\\n\";\r\n\t\tfileIndex = (FileInfo)output.getFirstChild();\r\n\t\twhile(fileIndex != null){\r\n\t\t\tans = ans + fileIndex.toString() + \"\\n\";\r\n\t\t\tfileIndex = (FileInfo) fileIndex.getNextSibling();\r\n\t\t}//end output while\r\n\t\treturn ans;\r\n\t}", "public String getContent() {\n String s = null;\n try {\n s = new String(Files.readAllBytes(Paths.get(filename)), StandardCharsets.UTF_8);\n }\n catch (IOException e) {\n message = \"Problem reading a file: \" + filename;\n }\n return s;\n }", "public void printWordContentDetailed()\n\t{\n\t\tthis.removeDuplicateAffixes();\n\n\n\t\tprintln(\"Printing contents of the Word object/class.\");\n\t\tif( word.finalContentsReady(true) == true)\n\t\t{\n\t\t\tprintln(\"Original: \" + word.getOriginalWord() + \"| Root: \" + this.rootWord);\n\t\t\tprintln(\"Number of Affixes in the original word: \" + word.getAffixCount());\n\t\t\tprintln(\"Prefixes: \" + this.prefixes.size() + \" | Infixes: \" + this.infixes.size() + \" | Suffixes: \" + this.suffixes.size());\n\t\t\tprintln(\"Printing Prefixes:\");\n\t\t\tfor(int i = 0; i < this.prefixes.size(); i++)\n\t\t\t{\n\t\t\t\tprintln( \"PFX: \" + this.prefixes.get(i).getAffix() );\n\t\t\t}\n\n\t\t\tprintln(\"Printing Infixes:\");\n\t\t\tfor(int i = 1; i < this.infixes.size(); i++)\n\t\t\t{\n\t\t\t\tprintln( \"IFX: \" + this.infixes.get(i).getAffix() );\n\t\t\t}\n\n\t\t\tprintln(\"Printing Suffixes:\");\n\t\t\tfor(int i = 0; i < this.suffixes.size(); i++)\n\t\t\t{\n\t\t\t\tprintln( \"SFX: \" + this.suffixes.get(i).getAffix() );\n\t\t\t}\n\t\t}\n\t}", "public void printAll(String file) throws FileNotFoundException, IOException, ParseException {\n\t\tarrayList = pareseFile(file);\n\t\tSystem.out.println(file + \" Adress book\");\n\t\tSystem.out.println(arrayList.toString());\n\n\t}", "@PostConstruct\n\tprivate void printDataFromFile() {\n\t}", "public void read_file(String filename)\n {\n out.println(\"READ\");\n out.println(filename);\n try\n {\n String content = null;\n content = in.readLine();\n System.out.println(\"READ content : \"+content);\n }\n catch (IOException e) \n {\n \tSystem.out.println(\"Read failed\");\n \tSystem.exit(-1);\n }\n }", "private void saveTextToFile(String content, File file) {\n try {\n PrintWriter writer;\n writer = new PrintWriter(file);\n writer.println(content);\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public void dumpMyData() {\n\t PrintStream output=null;\n\t try{\n\t\t output=new PrintStream(new FileOutputStream(\"/Users/saigeetha/Documents/School Documents/Fall 2016/Assignments/CSCI_572_HW2/CrawlReport.txt\"));\n\t\t System.setOut(output);\n\t\t System.out.println(\"Name: Sai Geetha Kandepalli Cherukuru\");\n\t\t System.out.println(\"USC ID : 7283210853\");\n\t\t System.out.println(\"News site crawled: nytimes.com\");\n\t\t System.out.println();\n\t\t System.out.println(\"Fetch Statistics\");\n\t\t System.out.println(\"================\");\n\t\t System.out.println(\"# fetches attempted: \"+fetchesAttempted);\n\t\t System.out.println(\"# fetches succeeded: \"+fetchesSucceeded);\n\t\t System.out.println(\"# fetches aborted: \"+fetchesAborted);\n\t\t System.out.println(\"# fetches failed: \"+fetchesFailed);\n\t\t System.out.println();\n\t\t System.out.println(\"Outgoing URLs:\");\n\t\t System.out.println(\"================\");\n\t\t System.out.println(\"Total URLs extracted:\"+urlsExtracted);\n\t\t System.out.println(\"# unique URLs extracted: \"+uniqueUrlsExtracted.size());\n\t\t System.out.println(\"# unique URLs within News Site: \"+uniqueUrlsWithinNews.size());\n\t\t System.out.println(\"# unique URLs outside News Site: \"+uniqueUrlsOutsideNews.size());\n\t\t System.out.println();\n\t\t System.out.println(\"Status Codes:\");\n\t\t System.out.println(\"================\");\n\t\t \n\t\t for(Integer k: statusCodes.keySet()) {\n\t\t\t Integer value=statusCodes.get(k);\n\t\t\t System.out.println(k+\": \"+value);\n\t\t }\n\t\t \n\t\t System.out.println();\n\t\t System.out.println(\"File Sizes:\");\n\t\t System.out.println(\"================\");\n\t\t \n\t\t for(String k: fileSizes.keySet()) {\n\t\t\t Integer value=fileSizes.get(k);\n\t\t\t System.out.println(k+\": \"+value);\n\t\t }\n\t\t \n\t\t System.out.println();\n\t\t System.out.println(\"Content Types:\");\n\t\t System.out.println(\"================\");\n\t\t \n\t\t for(String k: contentTypes.keySet()) {\n\t\t\t Integer value=contentTypes.get(k);\n\t\t\t System.out.println(k+\": \"+value);\n\t\t }\n\t\t \n\t } catch(FileNotFoundException e) {\n\t\t e.printStackTrace();\n\t }\n }", "public static void read7() {\n //read file into stream, try-with-resources\n try (Stream<String> stream = Files.lines(Paths.get(filePath))) {\n\n stream.forEach(System.out::println);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void printFile(String fileName)\n {\n try\n {\n //takes the output string and writes it in a new file\n //called output.txt\n FileOutputStream out = new FileOutputStream(\n new File(fileName), true);\n out.write(logImage.getBytes());\n out.flush();\n out.close(); \n }\n //catches all exceptions from writing into the .txt\n catch(Exception e)\n {\n System.out.println(\"There was an error while writing into file\");\n }\n }", "public void printAction() {\n this.folderList.get(currentFolder).printIt();\n }", "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}", "void print(String fileName)\n\t{\n\t\t//Print the elements and also write them into a file if the array is initialized\n\t\tif(inputArray != null)\n\t\t{\n\t\t\ttry \n\t\t\t{\n\t\t\t\t//Create a file output.txt\n\t\t\t\tPrintWriter writer = new PrintWriter(fileName);\n\t\t\t\tfor(int i=0; i < inputArray.length; i++)\n\t\t\t\t{\n\t\t\t\t\t//Print the elements and also write them into a file\n\t\t\t\t\tSystem.out.print(inputArray[i] + \" \");\n\t\t\t\t\twriter.print(inputArray[i] + \" \");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Close the file\n\t\t\t\twriter.close();\n\t\t\t} \n\t\t\tcatch (FileNotFoundException e) \n\t\t\t{\n\t\t\t\t//Printing the Stack Trace if an exception has occurred\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void showFile() throws FileNotFoundException, IOException{\r\n ArrayList<String> arxiu = new ArrayList<>();\r\n \r\n BufferedReader br = new BufferedReader(new FileReader(fitxerUsuaris));\r\n \r\n String usuari;\r\n \r\n while((usuari = br.readLine()) != null){\r\n arxiu.add(usuari);\r\n }\r\n \r\n for (int i = 0; i < arxiu.size(); i++) {\r\n System.out.println(arxiu.get(i));\r\n }\r\n }", "public void printToFile(Path filename) {\n\t\t\n\t\tlock.lockRead();\n\t\ttry{\n//\t\t\t create a new file if it is not existed; \n//\t\t\t otherwise delete previous one and create a new one.\n\t\t\tif(!Files.exists(filename)){\n\t\t\t\ttry {\n\t\t\t\t\tFiles.createFile(filename);\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\telse{\n\t\t\t\ttry {\n\t\t\t\t\tFiles.delete(filename);\n\t\t\t\t\tFiles.createFile(filename);\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\tfor(String hotelId : hotelMap.keySet()){\n\t\t\t\tString output = this.toString(hotelId);\n\t\t\t\t\t\t\t\n\t\t\t\t// start of the hotel.\n\t\t\t\tString emptyLine = \"\\n\";\n\t\t\t\tString ast = \"********************\";\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFiles.write(filename, emptyLine.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\tFiles.write(filename, ast.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\tFiles.write(filename, emptyLine.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t} catch (IOException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttry{\n\t\t\t\t\tFiles.write(filename, output.getBytes(), StandardOpenOption.APPEND);\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}\n\t\tfinally{\n\t\t\tlock.unlockRead();\n\t\t}\n\t\t\t\n\t}", "public void printer() throws Exception{\n File outputFile = new File(\"output.txt\");\n FileOutputStream is = new FileOutputStream(outputFile);\n OutputStreamWriter osw = new OutputStreamWriter(is);\n Writer w = new BufferedWriter(osw);\n w.write(this.result());\n w.close();\n }", "public String content() {\n StringWriter content = new StringWriter();\n PrintWriter w = new PrintWriter(content);\n\n printHeaderComment(w);\n\n w.println();\n\n w.println(\"#include \\\"\" + className + \".h\\\"\");\n w.println(\"#include <iostream>\");\n w.println();\n\n w.println();\n\n w.println(\"void \" + className + \"::load( PersistableInputStream& \" + INSTREAM_VAR_NAME + \" ){\");\n w.print(loadContent.toString());\n w.println(\"}\");\n\n w.println();\n\n w.println(\"void \" + className + \"::save( PersistableOutputStream& \" + OUTSTREAM_VAR_NAME + \" ){\");\n w.print(saveContent.toString());\n w.println(\"}\");\n\n return content.toString();\n }", "private static void taskContentsFileRestore() {\n try {\n String taskContentsFilePath;\n BufferedReader taskContentsLocation = new BufferedReader(new FileReader(FILE_PATH_CONTENT));\n taskContentsFilePath = taskContentsLocation.readLine();\n\n if (taskContentsFilePath != null) {\n PrintWriter taskContentsWriter = new PrintWriter(taskContentsFilePath);\n for (String content : fileContent) {\n taskContentsWriter.println(content);\n }\n taskContentsWriter.close();\n }\n taskContentsLocation.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "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}", "private void displayContents(String file)throws CoeusException, MalformedURLException{\r\n int selectedRow = subAwardBudget.tblSubAwardBudget.getSelectedRow();\r\n if(selectedRow == -1) {\r\n CoeusOptionPane.showInfoDialog(\"Select a Row\");\r\n return ;\r\n }\r\n BudgetSubAwardBean budgetSubAwardBean= (BudgetSubAwardBean)this.data.get(selectedRow);\r\n if(file.equals(BudgetSubAwardConstants.PDF) && budgetSubAwardBean.getPdfAcType() != null) {\r\n //PDF Updated. open file from local filesystem\r\n File fileObj = new File(budgetSubAwardBean.getPdfFileName());\r\n URL url = fileObj.toURL();\r\n URLOpener.openUrl(url);\r\n }else {\r\n displayContents(file, budgetSubAwardBean);\r\n }\r\n }", "private String getFileContent(String filePath) {\r\n\r\n\t\ttry {\r\n\t\t\tString text = new String(Files.readAllBytes(Paths.get(filePath)), StandardCharsets.UTF_8);\r\n\t\t\treturn text;\r\n\t\t} catch (Exception ex) {\r\n\t\t\treturn \"-1\";\r\n\t\t}\r\n\t}", "private String getContent(File file) {\n String output = \"\";\n String[] content;\n content = ((File) file).getContent().split(\"\\\\r?\\\\n\");\n for (String line : content) {\n if (line.contains(this.search)) {\n output += line + \"\\n\";\n }\n }\n if (!(output.equals(\"\"))) {\n output = Pwd.returnPathFromRoot(file) + \":\\n\" + output + \"\\n\";\n }\n return output;\n }", "public void recordOrder(){ \n PrintWriter output = null;\n try{\n output = \n new PrintWriter(new FileOutputStream(\"record.txt\", true));\n }\n catch(Exception e){\n System.out.println(\"File not found\");\n System.exit(0);\n }\n output.println(Tea);//writes into the file contents of String Tea\n output.close();//closes file\n }", "@Override\n\tpublic String toString() {\n\t\treturn this.filePath.toString();\n\t}", "private static void showFiles(File f) {\n\t\n}", "@Override\r\n\tpublic void handleFile(String inFilename, String outFilename) \r\n\t{\n\r\n\r\n\t\tString s = slurpFile(inFilename);\r\n\t\tDocument teiDocument = parsePlainText(s);\r\n\t\ttry \r\n\t\t{\r\n\t\t\tPrintStream pout = new PrintStream(new FileOutputStream(outFilename));\r\n\t\t\tpout.print(XML.documentToString(teiDocument));\r\n\t\t\tpout.close();\r\n\t\t} catch (FileNotFoundException e) \r\n\t\t{\r\n\t\t\te.printStackTrace\r\n\t\t\t();\r\n\r\n\t\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}", "public static void printCreateNewFile() {\n System.out.println(Message.CREATE_NEW_FILE);\n }", "void doShowFiles()\n\t{\n\t\ttry\n\t\t{\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tIterator itr = m_fileInfo.getAllFiles();\n\n\t\t\twhile(itr.hasNext())\n\t\t\t{\n\t\t\t\tSourceFile m = (SourceFile) ((Map.Entry)itr.next()).getValue();\n\n\t\t\t\tString name = m.getName();\n\t\t\t\tint id = m.getId();\n\t\t\t\tString path = m.getFullPath();\n\n\t\t\t\tsb.append(id);\n\t\t\t\tsb.append(' ');\n\t\t\t\tsb.append(path);\n\t\t\t\tsb.append(\", \"); //$NON-NLS-1$\n\t\t\t\tsb.append(name);\n\t\t\t\tsb.append(m_newline);\n\t\t\t}\n\t\t\tout( sb.toString() );\n\t\t}\n\t\tcatch(NullPointerException npe)\n\t\t{\n\t\t\terr(getLocalizationManager().getLocalizedTextString(\"noSourceFilesFound\")); //$NON-NLS-1$\n\t\t}\n\t}", "public String getContents(File file) {\n\t //...checks on file are elided\n\t StringBuilder contents = new StringBuilder();\n\t \n\t try {\n\t //use buffering, reading one line at a time\n\t //FileReader always assumes default encoding is OK!\n\t BufferedReader input = new BufferedReader(new FileReader(file));\n\t try {\n\t String line = null; \n\n\t while (( line = input.readLine()) != null){\n\t contents.append(line);\n\t contents.append(\"\\r\\n\");\t }\n\t }\n\t finally {\n\t input.close();\n\t }\n\t }\n\t catch (IOException ex){\n\t log.error(\"Greska prilikom citanja iz fajla: \"+ex);\n\t }\n\t \n\t return contents.toString();\n\t}", "public void tree()\n\t{\n\t\tIterable<Position<FileElement>> toPrint = fileSystem.PreOrder();\n\t\tfor (Position<FileElement> p : toPrint)\n\t\t{\n\t\t\tint depth = fileSystem.getDepth(p);\n\t\t\tfor (int i = 0; i < depth; i++)\n\t\t\t{\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.println(p.getValue());\n\t\t}\n\t}", "public static String getContentForFileFromDisk(IFile file) {\n\t\treturn getContentForFileFromDisk(file, 0);\n\t}", "public static void print(String filename) {\n // create a file writer\n UTF8FileUtility.createWriter(filename);\n // create a string buffer for storing the text\n StringBuilder sBuffer = new StringBuilder();\n int numTokens = 0;\n int freq = 0;\n for (String token : UNIGRAM.keySet()) {\n freq = UNIGRAM.get(token);\n numTokens += freq;\n sBuffer.append(token).append('\\t').append(freq).append(\"\\n\");\n }\n // write the string buffer to the file\n UTF8FileUtility.write(sBuffer.toString());\n // close the writer\n UTF8FileUtility.closeWriter();\n System.err.println(\"# of tokens = \" + numTokens);\n System.err.println(\"# of unigrams = \" + UNIGRAM.size());\n }", "public static void printFileName(String filename) {\n System.out.println(\"\\n\" + filename + \":\");\n }", "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) {\n\t\tFileInputStream fis = null;\n\t\ttry {\n\t\t\tfis = new FileInputStream(\"C:\\\\Users\\\\Admin\\\\Desktop\\\\myfile.txt\");\n\t\t\tSystem.out.println(\"File opened\");\n\t\t\tint i = 1;\n\t\t\twhile( (i = fis.read()) != -1) { // read den -1 la den cuoi file\n\t\t\t\tSystem.out.print((char) i);\n\t\t\t\t// read() returns the next byte of data\n\t\t\t}\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// Exception : File khong tim duoc hoac khong ton tai\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// file khong cho phep doc\n\t\t\te.printStackTrace();\n\t\t}finally{\n\t\t\ttry {\n\t\t\t\tfis.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// file khong cho phep dong\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tSystem.out.println(\"\\nFile Closed\");\n\t\t}\n\t}", "private void viewAllInfo(){\r\n try{\r\n Scanner scanner = new Scanner(file);\r\n String info;\r\n\r\n while (scanner.hasNext()){\r\n String line = scanner.nextLine();\r\n String[] components = line.split(separator);\r\n info = \" Name: \" + components[0] + \"\\n\";\r\n info += \" Phone No.: \"+components[1]+\"\\n\";\r\n info += \" Email: \"+components[2]+\"\\n\";\r\n info += \" Address: \"+components[3]+\"\\n\";\r\n textAreaFromAllInfo.append(info+\"\\n\");\r\n }\r\n\r\n }catch (IOException e){\r\n fileError();\r\n }\r\n }", "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}", "private void printLines() {\n for (String L: testLines) {\n print.write(L);\n }\n }", "@Override\n\t\t\tpublic void print() {\n\t\t\t\t\n\t\t\t}", "java.lang.String getContents();", "java.lang.String getContents();", "static String readFile(String path) throws IOException{\n\t\tFileInputStream fs = new FileInputStream(path);\n\t\tStringBuffer sb = new StringBuffer();\n\t\t// read a file\n\t\tint singleByte = fs.read(); // read singleByte\n\t\twhile(singleByte!=-1){\n\t\t\tsb.append((char)singleByte);\n\t\t\t///System.out.print((char)singleByte);\n\t\t\tsingleByte = fs.read();\n\t\t}\n\t\tfs.close(); // close the file\n\t\treturn sb.toString();\n\t}", "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) {\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 void printResults(String fileName) {\n\t\ttry {\n\t\t\tPrintWriter writer = new PrintWriter(fileName, \"UTF-8\");\n\t\t\tfor (int i = 0; i < results.size(); i++) {\n\t\t\t\twriter.println(results.get(i).toString());\n\t\t\t}\n\n\t\t\twriter.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.err.println(\"Error while writing to output file\");\n\t\t} finally {\n\t\t\t/*try {\n\t\t\t\twriter.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.err.println(\"Error while reading input file\");\n\t\t\t}*/\n\t\t}\t\t\n\t}", "public void afficherFile() {\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Voici la File (tete a gauche, queue a droite): \");\r\n\t\tSystem.out.println(\"----------------------------------------------\");\r\n\r\n\t\tif (this.estVide() == true) {\r\n\r\n\t\t\tSystem.out.println();\r\n\t\t} else {\r\n\r\n\t\t\tCellule<T> ref = this.tete;\r\n\r\n\t\t\tfor (int i = 1; i <= this.getLongueurFile(); i++) {\r\n\r\n\t\t\t\tSystem.out.print(ref.getValeur() + \" \");\r\n\r\n\t\t\t\tif (ref.getSuivant() != null) {\r\n\r\n\t\t\t\t\tref = ref.getSuivant();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t}", "@Override\n public String getContent() throws FileNotFound, CannotReadFile\n {\n Reader input = null;\n try\n {\n input = new InputStreamReader(resource.openStream());\n String content = IOUtils.toString(input).replace(\"\\r\\n\", \"\\n\");\n\n return content;\n } catch (FileNotFoundException ex)\n {\n throw new FileNotFound();\n } catch (IOException ex)\n {\n throw new CannotReadFile();\n } finally\n {\n InternalUtils.close(input);\n }\n }", "public void readFromFile() {\n\n\t}" ]
[ "0.76127094", "0.7048522", "0.7038998", "0.67769504", "0.64824075", "0.64471936", "0.6423134", "0.6403491", "0.63038695", "0.6291556", "0.62555635", "0.62507915", "0.6248937", "0.6236012", "0.61393213", "0.6118932", "0.60672605", "0.60596967", "0.6020744", "0.6003052", "0.5986337", "0.59826255", "0.5962272", "0.59453845", "0.59445775", "0.59331", "0.5918285", "0.5908086", "0.59055686", "0.590099", "0.59005034", "0.5880521", "0.5877768", "0.58656096", "0.58620965", "0.5857584", "0.58493334", "0.5844319", "0.5838574", "0.5836502", "0.5831832", "0.5818016", "0.5806257", "0.57721645", "0.5770603", "0.57704484", "0.5767085", "0.57648563", "0.57400715", "0.5724664", "0.57179236", "0.5715839", "0.5714596", "0.5701534", "0.5695478", "0.56846064", "0.5681519", "0.56740916", "0.5668046", "0.5665632", "0.5664396", "0.56436837", "0.56252354", "0.5621833", "0.5619296", "0.56191933", "0.56188756", "0.56174564", "0.56007016", "0.5597231", "0.55918765", "0.558417", "0.5577918", "0.55775136", "0.5576331", "0.5567524", "0.5555568", "0.5551899", "0.5526652", "0.55209154", "0.55046356", "0.5502082", "0.5495189", "0.5494188", "0.549391", "0.5492835", "0.5489323", "0.5474575", "0.5474345", "0.5469713", "0.54589313", "0.54582036", "0.54582036", "0.5449837", "0.5441294", "0.54408807", "0.54401153", "0.54380983", "0.5437865", "0.54361635" ]
0.7453442
1
Find duplicates using Set (in O(n) time), ref:
public ArrayList<String> findDuplicates(String[] column) { HashSet<String> columnEntries = new HashSet<String>(); ArrayList<String> duplicates = new ArrayList<String>(); for(int row = 0; row < column.length; ++row) { if(!columnEntries.add(column[row]) && !column[row].isBlank()){ System.out.println("Duplicate: " + column[row]); duplicates.add(column[row]); } } return duplicates; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static void findDuplicate()\n\t{\n\n\t\tList<String> oList = null;\n\t\tSet<String> oSet = null;\n\t\ttry {\n\t\t\toList = new ArrayList<String>();\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Dog\");\n\t\t\toList.add(\"Eagle\");\n\t\t\toList.add(\"Frog\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\toList.add(\"Apple\");\n\t\t\toList.add(\"Boy\");\n\t\t\tSystem.out.println(oList);\n\t\t\t\n\t\t\toSet = new TreeSet<>();\n\t\t\t\n\t\t\tString s = \"\";\n\t\t\tfor(int i=0;i<oList.size();i++)\n\t\t\t{\n\t\t\t\tif((oSet.add(oList.get(i))==false) && (!s.contains(oList.get(i))))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Duplicate: \"+oList.get(i));\n\t\t\t\t\ts+=oList.get(i);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tfinally {\n\t\t\toList = null;\n\t\t\toSet = null;\n\t\t}\n\t}", "public void testFindDuplicates() {\r\n System.out.println(\"findDuplicates\");\r\n \r\n List<String> elements = new ArrayList<>();\r\n elements.add(\"foo\");\r\n elements.add(\"bar\");\r\n elements.add(\"abc\");\r\n elements.add(\"foo\");\r\n elements.add(\"cde\");\r\n elements.add(\"cde\");\r\n elements.add(\"efg\");\r\n elements.add(\"cde\");\r\n \r\n Set<String> expResult = new LinkedHashSet<>();\r\n expResult.add(\"foo\");\r\n \r\n LexicalChecker instance = new LexicalChecker();\r\n Set<String> result = instance.findDuplicates(elements);\r\n \r\n assertNotSame(expResult, result);\r\n \r\n expResult.add(\"cde\");\r\n assertEquals(expResult, result);\r\n }", "public static <T> Set<T> findDuplicates(Iterable<T> iterable) {\n return Multisets.difference(\n HashMultiset.create(iterable),\n HashMultiset.create(ImmutableSet.copyOf(iterable))).elementSet();\n }", "public static <T> Set<T> duplicatedElementsOf(List<T> input) {\n int count = input.size();\n if (count < 2) {\n return ImmutableSet.of();\n }\n Set<T> duplicates = null;\n Set<T> elementSet = CompactHashSet.createWithExpectedSize(count);\n for (T el : input) {\n if (!elementSet.add(el)) {\n if (duplicates == null) {\n duplicates = new HashSet<>();\n }\n duplicates.add(el);\n }\n }\n return duplicates == null ? ImmutableSet.of() : duplicates;\n }", "public boolean containsDuplicate(int[] nums) {\r\n\t Set<Integer> set = new HashSet<Integer>();\r\n\t for(int i = 0; i < nums.length; i++) {\r\n\t if(set.contains(nums[i]))\r\n\t return true;\r\n\t else\r\n\t set.add(nums[i]);\r\n\t }\r\n\t return false;\r\n\t }", "public static void main(String[] args) {\n ArrayList<Integer> nums = new ArrayList<>();\n nums.addAll( Arrays.asList(100, 2000, 50, 50, 100, 200, 300, 50));\n nums=new ArrayList<>(new TreeSet<>(nums));\n System.out.println(nums);\n\n String str1 = \"babababC\";\n str1 = new TreeSet<>( Arrays.asList(str1.split(\"\")) ).toString();\n System.out.println(str1);\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * - 2. Write a program that can REMOVE THE DUPLICATES from an ArrayList. DO NOT change the ORDER\n * -> LinkedHashSet -> Remove Duplicates and Keeps the Insertion Order\n */\n ArrayList<Integer> list = new ArrayList<>(Arrays.asList(6,6,6,6,5,5,5,4,4,4,4));\n list=new ArrayList<>(new LinkedHashSet<>(list));\n System.out.println(list);\n\n\n /**\n * - 1. Write a program that can remove the duplicated characters from String and store them into variable\n */\n String str = \"ABABABCDEF\";\n String[] arr = str.split(\"\");\n str = new LinkedHashSet<>(Arrays.asList(arr)).toString().replace(\", \", \"\");\n System.out.println(str);\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * -> Does not accept duplicates, and sort the objects\n * -> HashSet accepts null\n * -> HashSet is faster than TreeSet\n */\n HashSet<Integer> numbers = new HashSet<>(Arrays.asList(10,9,10, 9, 8, 7, 8, 7, 6, 5, 6, 1));\n System.out.println(numbers ); // -> [1, 5, 6, 7, 8, 9, 10]\n\n\n System.out.println(\"=========================================================================================\");\n\n /**\n * - ITERATOR: -> is the only way to remove duplicates from collection\n * - removeIf -> removes numbers because it is uses the iterator interface internally. Iterator implicitly\n *\n * - hasNext() method only can go forward cant go backward. it stars from next index\n * - when we use it our loop hasNext() iterates from the next index\n * - iterator(); - hasNext(); - next(); - remove();\n */\n ArrayList<Integer> list2 = new ArrayList<>(Arrays.asList(1,1,2,2,3,3,4,4,5,5));\n list2.removeIf( p -> p < 4 );\n System.out.println(list2);\n\n\n ArrayList<Integer> list3 = new ArrayList<>(Arrays.asList(1,1,2,2,3,3,4,4,5,5));\n Iterator<Integer> it =list3.iterator(); // - this method will return iterator\n while( it.hasNext() ){ // - iterator explicitly. While loop only accept boolean\n if( it.next() < 4 ){\n it.remove();\n }\n }\n System.out.println(list3);\n\n\n ArrayList<Integer> list4 = new ArrayList<>(Arrays.asList(1,1,2,3,3,4,4,5,5));\n // - hasNext(); will iterate all the indexes. We do not need extra iterator in the loop\n for(Iterator<Integer> I = list4.iterator(); I.hasNext(); ){\n if( I.next() < 4) {\n I.remove();\n }\n }\n System.out.println(list4);\n\n\n\n LinkedHashSet<String> names = new LinkedHashSet<>();\n names.addAll(Arrays.asList( \"Mehmet\",\"Mohammed\",\"Yucel\",\"Sha\",\"Ozgur\", \"Ahmet\",\"Osmanj\",\"Ozgur\",\"Ozgur\",\"Irina\"));\n System.out.println(names);\n Iterator<String> it3 = names.iterator();\n while( it3.hasNext() ){\n String s = it3.next();\n if(s.contains(\"m\") || s.contains(\"M\")){ // - s.toLowerCase.contains(\"m\")\n it3.remove();\n }\n }\n System.out.println(names);\n\n /*\n ===============================================================\n for(Iterator<String> it3 = names.iterator(); it3.hasNext() ; ){\n String s = it3.next();\n if(s.toLowerCase().contains(\"m\")){\n it3.remove();\n }\n }\n ================================================================\n names.removeIf( s -> s.contains(\"m\") || s.contains(\"M\") );\n ================================================================\n names.removeAll( Arrays.asList( \"Mehmet\", \"Ozgur\", \"Mohammed\" ));\n ================================================================\n names.retainAll( Arrays.asList( \"Yucel\", \"Sha\", \"Ahmet\" ) );\n ================================================================\n boolean result = list.containsAll( Arrays.asList(5, 6, 9, 8, 11 ));\n */\n\n\n\n\n\n\n\n System.out.println(\"=========================================================================================\");\n\n\n\n\n\n }", "public static void main(String[] args) {\n\t\tint a[] = {1,2,2,6,7,3,4,4,5,5,6,7};\n\t\t\n\t\t\n\t\tMap<Integer,Integer> map =new HashMap<Integer,Integer>();\n\t\t\n\t\tfor (Integer num :a) {\n\t\t\tInteger Count =map.get(num);\n\t\t\tif(Count==null) {\n\t\t\t\tmap.put(num, 1);\n\t\t\t}else {\n\t\t\t\tmap.put(num, ++Count);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tSet<Entry<Integer, Integer>> entryset =map.entrySet();\n\t\tArrayList<Integer> list =new ArrayList<Integer>();\n\t\tfor(Entry<Integer, Integer> entry :entryset) {\n\t\t\tif(entry.getValue()>1) {\n\t\t\t\tlist.add(entry.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(\"Duplicates are \" +list);\n\t\t\n\t\tSet<Entry<Integer, Integer>> entryset1 =map.entrySet();\n\t\tArrayList<Integer> nonduplist =new ArrayList<Integer>();\n\t\tfor(Entry<Integer, Integer> entry1 :entryset1) {\n\t\t\tif(entry1.getValue()==1) {\n\t\t\t\tnonduplist.add(entry1.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(\"Non Duplicates are \" +nonduplist);\n\t\t\n \n}", "public boolean containsDuplicate(int[] nums) {\n if (nums == null || nums.length <= 1) {\n return false;\n }\n TreeSet<Integer> set = new TreeSet<>();\n for (int num : nums) {\n if (set.contains(num)) {\n return true;\n } else {\n set.add(num);\n }\n }\n return false;\n }", "Boolean same(MultiSet<X> s);", "public static void main(String[] args) {\n Set<Integer> S1 = new TreeSet<>();\r\n // add objects\r\n S1.add(65); S1.add(36); S1.add(24); S1.add(36);\r\n \r\n // show the content and assert they are sorted and no duplications\r\n System.out.println(\"set = \" + S1); \r\n //remove elements\r\n S1.remove(36); S1.remove(24);\r\n System.out.println(S1); //assert set = 65\r\n S1.add(15); S1.add(24); S1.add(80); // add 15, 24, 80\r\n System.out.println(\"set = \" +S1); //assert set = 15, 24, 65, 80\r\n \r\n System.out.println(\"Does S1 contain 10?\"\r\n + S1.contains(10)); // assert false\r\n System.out.println(\"S1 has \" + S1.size() +\" objects\"); // assert 4\r\n\r\n // create another Set object implemented using HashSet\r\n Set<Integer> S2 = new HashSet<>();\r\n // add all objects in S1 to S2\r\n S2.addAll(S1);\r\n System.out.println(\"hashset = \" +S2); //assert they may not be ordered\r\n\r\n // create another Set object implemented using LinkedHashSet\r\n Set<Integer> S3 = new LinkedHashSet<>();\r\n S3.add(150); // add 150\r\n S3.addAll(S1);// add all objects in S1 to S2\r\n System.out.println(\"LinkedHashSet = \" +S3);//assert s3=[150,15,24,65,80]\r\n \r\n S3.removeAll(S3); // remove all items\r\n System.out.println(\"LinkedHashSet = \" +S3);//assert s3=[]\r\n }", "public Set removeDuplicateUsingSet() throws ComputationException {\n Set<Integer> uniqueSet = new HashSet<>();\n log.debug(\"Removing duplicate using Set......\");\n int[] intArray = getRandomArray();\n log.debug(\"Actual size of int array:\" + intArray.length);\n for (int i = 0; i < intArray.length; i++) {\n uniqueSet.add(intArray[i]);\n }\n log.debug(\"refined size of int array using Set: \" + uniqueSet.size());\n log.debug(Arrays.toString(uniqueSet.toArray()));\n return uniqueSet;\n }", "public void hashSet() {\n\n Set<Integer> num = new java.util.HashSet<>();\n\n num.add(3);\n num.add(11);\n num.add(6);\n\n System.out.println(num);\n\n for (int i = 1; i <= 10; i++) {\n\n if (num.contains(i)) {\n\n System.out.println(\"\\n\\t\" + i + \"\\t is found in set\");\n\n }\n\n }\n\n }", "public int findDuplicate2(int[] nums) {\n\n if (nums == null || nums.length < 2){\n throw new IllegalArgumentException(\"Array size is less than 2\");\n }\n\n Set<Integer> set = new HashSet<>();\n\n for (int i = 0; i < nums.length; i++){\n if (set.contains(nums[i])){\n return nums[i];\n } else {\n set.add(nums[i]);\n }\n }\n\n return 0;\n }", "public boolean containsNearbyDuplicate(int[] nums, int k) {\n Set<Integer> numSet = new HashSet<Integer>(nums.length);\n for (int i=0;i<nums.length;i++) {\n \tif (i>k) {\n \t\tnumSet.remove(nums[i-k-1]);\n \t}\n \tif (numSet.contains(nums[i])) return true;\n \t\n \tnumSet.add(nums[i]);\n }\n return false;\n }", "static void FindDuplicate(String[] strArray){\n\t\t\n\t\tHashSet<String> set = new HashSet<String>();\n\t\t\n\t\tfor(String arrayElement : strArray){\n\t\t\tif(!set.add(arrayElement))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Duplicate Element is: \"+ arrayElement);\n\t\t\t}\n\t\t}\n\t}", "public static Set<Integer> find(int[] arr)\r\n\t{\n\t\tSet<Integer> set1=new HashSet<>();\r\n\t\tSet<Integer> set2=new HashSet<>();\r\n\t\t\r\n\t\t//Here Storing the Integers in set1 And set2 so, here set1 And set2 will not allow to store\r\n\t\t//duplicate integers\r\n\t\tfor(Integer i:arr)\r\n\t\t{\r\n\t\t\tset1.add(i);\r\n\t\t\tset2.add(i);\r\n\t\t}\r\n\t\t//Now set1 & set2 contains non duplicate Integers\r\n\t\t// One for every integer in set1 and for every integer in given array And and int counter=0\r\n\t\t //here if Integer in set1 equals to Integer in given array,Then increase the counter.\r\n\t\t\r\n\t\tfor(Integer i:set1)\r\n\t\t{\r\n\t\t\tint count=0;\r\n\t\t\tfor(Integer a:arr)\r\n\t\t\t{\r\n\t\t\t\t//Integer in set1==Integer in array counter will increases by one \r\n\t\t\t\tif(i==a)\r\n\t\t\t\t{\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//If count of that integer greater or equal to 2 then delete that Integer in set2\r\n\t\t\tif(count>=2)\r\n\t\t\t{\r\n\t\t\t\tset2.remove(i);\r\n\t\t\t\t//NOTE:- Here I Took set2 because I can not delete the Integer in set1 because it is already in use(Concurrent Modification Exception)\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Returning the set2 which containing NonRepeated Integers\r\n\t\treturn set2;\r\n\t\t\r\n\t}", "public boolean allDuplicatesEqual() {\n int[] input = {1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5};\n int dupA = findDuplicatesA(input);\n int dupB = findDuplicatesB(input);\n int dupC = findDuplicatesC(input);\n int dupD = findDuplicatesD(input);\n int dupE = findDuplicatesE(input);\n return dupA == dupB && dupA == dupC && dupA == dupD && dupA == dupE;\n }", "public static void removeDuplicates(int[] a)\r\n\t\t{\r\n\t\t\tLinkedHashSet<Integer> set\r\n\t\t\t\t= new LinkedHashSet<Integer>();\r\n\r\n\t\t\t// adding elements to LinkedHashSet\r\n\t\t\tfor (int i = 0; i < a.length; i++)\r\n\t\t\t\tset.add(a[i]);\r\n\r\n\t\t\t// Print the elements of LinkedHashSet\r\n\t\t\tSystem.out.print(set);\r\n\t\t}", "public static void main(String args[]) {\n Scanner sc = new Scanner(System.in);\n System.out.println(\"Enter the size of the array\");\n int n = sc.nextInt();\n int arr[] = new int[n];\n System.out.println(\"enter the elements in the array\");\n for (int i = 0; i < arr.length; i++) {\n arr[i] = sc.nextInt();\n }\n HashSet<Integer> set = new HashSet<Integer>();\n for (int k = 0; k < n; k++) {\n set.add(arr[k]);\n }\n LinkedList list = new LinkedList(set);\n for (int l = 0; l < list.size(); l++) {\n int val = ((Integer) list.get(l)).intValue();\n if (duplicate(arr, val) > 1)\n System.out.println(\"Occurence of \" + val + \" is \" + duplicate(arr, val));\n }\n }", "public boolean containsDuplicate(int[] nums) {\n if (nums == null || nums.length == 0)\n return false;\n Set<Integer> distinctElems = new HashSet<>();\n for (int val : nums) {\n if (!distinctElems.add(val)) {\n return true;\n }\n }\n return false;\n }", "public static void main(String[] args) {\n HashSet<Person> set = new HashSet<>();\n Person p1 = new Person(\"小妹妹\", 18);\n Person p2 = new Person(\"小妹妹\", 18);\n Person p3 = new Person(\"小妹妹\", 19);\n System.out.println(p1.hashCode());\n System.out.println(p2.hashCode());\n System.out.println(p1 == p2);\n System.out.println(p1.equals(p2));\n set.add(p1);\n set.add(p2);\n set.add(p3);\n System.out.println(set);\n }", "private static void usingLinkedHashSet()\n\t{\n Integer[] numbers = new Integer[] {1,2,3,4,5,1,3,5};\n \n //This array has duplicate elements\n System.out.println( Arrays.toString(numbers) );\n \n //Create set from array elements\n LinkedHashSet<Integer> linkedHashSet = new LinkedHashSet<>( Arrays.asList(numbers) );\n \n //Get back the array without duplicates\n Integer[] numbersWithoutDuplicates = linkedHashSet.toArray(new Integer[] {});\n \n //Verify the array content\n System.out.println( Arrays.toString(numbersWithoutDuplicates) );\n\t}", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n if (t < 0) return false;\n TreeSet<Long> set = new TreeSet<>();\n for (int i = 0; i < nums.length; ++i) {\n long num = (long)nums[i];\n Long floor = set.floor(num), ceiling = set.ceiling(num);\n if (floor != null && num - floor <= t || ceiling != null && ceiling - num <= t) return true;\n set.add(num);\n if (i >= k) set.remove((long)nums[i - k]);\n }\n return false;\n}", "public static void main(String[] args) {\n HashSet<Person> set = new HashSet<>(10);\n for (int i = 0; i < 10; i++) {\n set.add(new Person(\"person\" + i, i));\n }\n for (int i = 0; i < 10; i++) {\n set.add(new Person(\"person\", 15));\n }\n Person p1 = new Person(\"person\", 15);\n Person p2 = new Person(\"person\", 15);\n System.out.println(p1 + \" hascode: \" + p1.hashCode());\n System.out.println(p2 + \" hascode: \" + p2.hashCode());\n System.out.println(\"person1 equals person2 \" + p1.equals(p2));\n for (Person person : set) {\n System.out.println(person);\n }\n }", "void mo30185a(HashSet<zzawj> hashSet);", "public boolean containsNearbyDuplicate2(int[] nums, int k) {\n \tif(nums == null || nums.length <=1) return false;\r\n \tSet<Integer> set = new HashSet<Integer> ();\r\n \tfor(int i=0; i< nums.length; i++) {\r\n \t\tif(i>k) set.remove(nums[i-k-1]);\r\n \t\tif(!(set.add(nums[i]))) return true;\r\n \t}\r\n \treturn false;\r\n }", "public int findDuplicatesE(int[] input) {\n int duplicates = 0;\n for (int i = 0; i < input.length; i++) {\n for (int j = i + 1; j < input.length; j++) {\n if (input[i] == input[j]) {\n duplicates++;\n break;\n }\n }\n }\n return duplicates;\n }", "public static List<String> getRepetitiveElements(String[] array)\n {\n if (array == null) return null;\n\n // variable -> each index maps to a linkedlist containing the values\n List<Integer>[] hashMap = new ArrayList[array.length];\n List<String> duplicateSet = new ArrayList<>();\n int index;\n int n = array.length;\n String curString;\n for (int i = 0; i < array.length; i++) {\n curString = array[i];\n index = curString.hashCode()%n;\n if (hashMap[index] == null) {\n hashMap[index]=new ArrayList<>(); // store the i index\n hashMap[index].add(i); // put in i within the arrayList\n } else { // index is not null\n List<Integer> matchingIndice = hashMap[index];\n boolean hit = false;\n for (Integer mi: matchingIndice) {\n if (array[mi].compareTo(curString)==0) {\n // collision, and the string matches, we are happy\n if (!duplicateSet.contains(curString)) { // this is O(m) where m is # of duplicate strings in the set\n duplicateSet.add(curString);// found duplicate string\n }\n hit = true;\n break; // exit -> found a match\n }\n }\n if (!hit) {\n matchingIndice.add(i); // put i into the linkedlist\n hashMap[index] = matchingIndice;\n }\n }\n }\n\n return duplicateSet;\n }", "protected void removeDuplicates() {\n log.trace(\"Removing duplicated\");\n long startTime = System.currentTimeMillis();\n int initial = size();\n E last = null;\n int index = 0;\n while (index < size()) {\n E current = get(index);\n if (last != null && last.equals(current)) {\n if (log.isTraceEnabled()) {\n log.trace(\"Removing duplicate '\" + current + \"'\");\n }\n remove(index);\n } else {\n index++;\n }\n last = current;\n }\n log.debug(String.format(\"Removed %d duplicates from a total of %d values in %dms\",\n initial - size(), initial, System.currentTimeMillis() - startTime));\n }", "public static Set<Student> findDuplicates(List<Student> students) {\n Set<Student> uniqueStudents = new HashSet<Student>();\n Set<Student> dupStudents = new HashSet<Student>();\n\n Iterator<Student> it = students.listIterator();\n while(it.hasNext()){\n if(!uniqueStudents.contains(it.next())){\n uniqueStudents.add(it.next());\n } else {\n dupStudents.add(it.next());\n }\n }\n return dupStudents;\n }", "private void printNonDuplicates( Collection< String > collection )\r\n {\r\n \t // create a HashSet using a collection as parameter\r\n \t Set< String > set = new HashSet< String >( collection );\r\n \t System.out.println( \"Nonduplicates are: \" );\r\n \t for ( String s : set )\r\n \t\t System.out.printf( \"%s \", s );\r\n \t System.out.println();\r\n \t }", "@Test\n public void whenAddSeveralIdenticalElementsThenSetHasOnlyOneSuchElement() {\n SimpleSet<Integer> set = new SimpleSet<>();\n set.add(1);\n set.add(2);\n set.add(3);\n set.add(3);\n set.add(2);\n set.add(1);\n\n Iterator<Integer> iterator = set.iterator();\n\n assertThat(iterator.next(), is(1));\n assertThat(iterator.next(), is(2));\n assertThat(iterator.next(), is(3));\n assertThat(iterator.hasNext(), is(false));\n }", "public static void main(String[] args) {\n int [] A = {5,1,5,2,5,3,5,4};\n HashSet<Integer> aa = new HashSet<>();\n for (int i = 0; i <A.length ; i++) {\n if (aa.contains(A[i])) {\n System.out.println(A[i]);\n break;\n }else\n aa.add(A[i]);\n\n }\n\n }", "public static void main(String[] args) {\n HashSet<String> food = new HashSet<>();\n food.add(\"Sushi\");\n food.add(\"Sashimi\");\n food.add(\"Pizza\");\n food.add(\"Japadog\");\n food.add(\"Sushi\");\n System.out.println(food.size());\n\n HashSet<String> food2 = new HashSet<>();\n food2.add(\"Pizza\");\n food2.add(\"Pasta\");\n food2.add(\"Sushi\");\n food2.add(\"Taco\");\n food2.add(\"Burrito\");\n food2.add(\"Nachos\");\n food2.add(\"Feijoada\");\n food2.add(\"Coxinha\");\n// food.addAll(food2);\n// food.retainAll(food2); // common\n\n System.out.println(food);\n System.out.println(food.contains(\"Sushi\"));\n }", "public static Set removeDuplicates(int[]array){\n //sets are not allows Duplicates\n //copy array elements to Set\n Set<Integer> set = new HashSet<>();\n for(int item:array){\n set.add(item);\n }\n return set;\n }", "public Set removeDuplicateUsingLinkedHashSet() throws ComputationException {\n Set<Integer> uniqueSet = new LinkedHashSet<>();\n log.debug(\"Removing duplicate using Linked Hash Set......\");\n int[] intArray = getRandomArray();\n log.debug(\"Actual size of int array:\" + intArray.length);\n for (int i = 0; i < intArray.length; i++) {\n uniqueSet.add(intArray[i]);\n }\n log.debug(\"refined size of int array using Set: \" + uniqueSet.size());\n log.debug(Arrays.toString(uniqueSet.toArray()));\n return uniqueSet;\n }", "public boolean findAndRemoveDuplicates() {\n return mFindAndRemoveDuplicates;\n }", "public static void main( String[] args )\n {\n OrderedSet set = new OrderedSet( true );\n set.add( new Integer( 6 ) );\n set.add( new Integer( 1 ) );\n set.add( new Integer( 4 ) );\n set.add( new Integer( 1 ) );\n System.out.println( set );\n System.out.println();\n\n System.out.println( \"Enumerate the OrderedSet\" );\n Enumeration e = set.elements();\n while ( e.hasMoreElements() )\n System.out.println( e.nextElement() );\n System.out.println();\n\n System.out.println( \"Iterate through the OrderedSet\" );\n for ( OrderedSetIterator i = set.begin(); !i.atEnd(); i.advance() )\n System.out.println( i.get() );\n System.out.println();\n\n System.out.println( \"Show that duplicates can be added.\" );\n set.add( new Integer( 8 ) );\n System.out.println( \"set = \" + set );\n\n set.add( new Integer( 4 ) );\n System.out.println( \"set = \" + set );\n }", "private static void findDuplicatesByHashTable(int[] arr) {\n\t\t\n\t\t\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\t\n\t\tfor(int i=0; i<arr.length ; i++)\n\t\t{\n\t\t\tif(!map.containsKey(arr[i]))\n\t\t\t{\n\t\t\t\tmap.put(arr[i], 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmap.put(arr[i], map.get(arr[i])+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( Map.Entry<Integer, Integer> entry : map.entrySet() )\n\t\t{\n\t\t\tif(entry.getValue() > 1 )\n\t\t\t{\n\t\t\t\tSystem.out.println(\" Duplicate is by HashTable \" + entry.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}", "public boolean equals (SetADT<T> set);", "public static boolean hasDups(int num[]) {\n\n //boolean value to trigger while loop, intially false, set to true when a duplicate is found\n boolean found = false;\n\n //int i initialized to 0\n int i = 0;\n\n/*\n //while loop to search through array \n while (found != true) {\n */\n //for loop to loop through array elements after the first one\n //compares the first array element to each successive one for a duplicate\n\n for (int k = 1; k < num.length - 1; k++) {\n\n if (num[i] == num[k]) { //if statement that checks the adjacent values until the end of the array\n\n found = true; //flag for found to be set to true which will end while loop and return result \n\n } //end if\n\n else if (num[i] != num[k]) { //if statement that checks if te adjacent values are not equal to ensure found is false, and continue while loop\n\n found = false; //flag for found to be set to false which will contineu while loop to search through array\n\n } //end else if \n i++; //increments i so it is 1 less than k to check adjacent values in the array\n } //end for\n\n //} //end while\n return found; //retun value\n }", "private static void findDuplicates(int[] arr){\n Map<Integer,Integer> map = new HashMap<>();\n for(int i=0;i<arr.length;++i){\n if(map.containsKey(arr[i])){\n System.out.println(arr[i]);\n }else{\n map.put(arr[i],1);\n }\n }\n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n TreeSet<Integer> set = new TreeSet<>();\n for (int i = 0; i < nums.length; i++) {\n Integer head = set.ceiling(nums[i]);\n// if (head != null && head - nums[i] <= t) { overflow\n if (head != null && head <= t + nums[i]) {\n return true;\n }\n Integer tail = set.floor(nums[i]);\n// if (tail != null && nums[i] - tail <= t) { overflow\n if (tail != null && nums[i] <= t + tail) {\n return true;\n }\n set.add(nums[i]);\n if (set.size() > k) {\n set.remove(nums[i - k]);\n }\n }\n return false;\n }", "public static int hashCodeForSet(Collection set) {\n/* 122 */ if (set == null) {\n/* 123 */ return 0;\n/* */ }\n/* 125 */ int hashCode = 0;\n/* 126 */ Iterator it = set.iterator();\n/* 127 */ Object obj = null;\n/* */ \n/* 129 */ while (it.hasNext()) {\n/* 130 */ obj = it.next();\n/* 131 */ if (obj != null) {\n/* 132 */ hashCode += obj.hashCode();\n/* */ }\n/* */ } \n/* 135 */ return hashCode;\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 }", "public boolean isDupe(T element);", "public HashSet<T> removeDups(Node root, HashSet set) {\n if(root == null) {\n return set;\n }\n if(root.getLeftChildNode() != null) {\n removeDups(root.getLeftChildNode(), set);\n }\n if(set.contains(root.getData())){\n set.add(root.getData());\n }\n if(root.getRightChildNode() != null) {\n removeDups(root.getRightChildNode(), set);\n }\n return set;\n }", "private void printNonDuplicates( Collection< String > collection )\r\n {\r\n // create a HashSet \r\n Set< String > set = new HashSet< String >( collection ); \r\n\r\n System.out.println( \"\\nNonduplicates are: \" );\r\n\r\n for ( String s : set )\r\n System.out.printf( \"%s \", s );\r\n\r\n System.out.println();\r\n }", "@Test\n\tpublic void testRepeatedInsert() {\n\t\tSetADT<String> items = new JavaSet<>();\n\t\titems.insert(\"A\");\n\t\titems.insert(\"B\");\n\t\titems.insert(\"C\");\n\t\titems.insert(\"C\");\n\t\t\n\t\t// No matter what, \"C\" can't be added twice.\n\t\titems.insert(\"C\");\n\t\tassertEquals(3, items.size());\n\t\t\n\t\t//double checking - same as for loop\n\t\titems.insert(\"C\");\n\t\tassertEquals(3, items.size());\n\t\t\n\t\tassertEquals(3, items.size());\n\t\tassertEquals(true, items.contains(\"A\"));\n\t\tassertEquals(true, items.contains(\"B\"));\n\t\tassertEquals(true, items.contains(\"C\"));\n\t\t\n\t}", "public void removeDuplicates(){\n HashSet<Object> elements = new HashSet<>();\n Node n = head;\n int i=0;\n while(n!=null){\n if(elements.contains(n.getData())){\n if (size == 1) {\n this.head.setData(null);\n } else {\n if (n == this.head) {\n this.head = n.next;\n this.head.prev = this.head;\n } else if (n == this.tail) {\n this.tail = n.prev;\n this.tail.next = this.tail;\n } else {\n n.prev.next = n.next;\n n.next.prev = n.prev;\n }\n }\n size--;\n }else{\n elements.add(n.getData());\n }\n n=n.next;\n }\n }", "private static Set<String> m23474a(Set<String> set, Set<String> set2) {\n if (set.isEmpty()) {\n return set2;\n }\n if (set2.isEmpty()) {\n return set;\n }\n HashSet hashSet = new HashSet(set.size() + set2.size());\n hashSet.addAll(set);\n hashSet.addAll(set2);\n return hashSet;\n }", "public static void main(String[] args) {\n\t\tSet<Puppy> set = new LinkedHashSet<Puppy>(10);\n\t\t\n\t\t// this DS which can hold other object\n\t\tPuppy puppy1=new Puppy(\"Tommy\",10 );\n\t\tPuppy puppy2=new Puppy(\"AHH\", 12);\n\t\tPuppy puppy3=new Puppy(\"MYY\", 5);\n\t\tPuppy puppy4=new Puppy(\"NANY\", 3);\n\t\tPuppy puppy5=new Puppy(\"NANY\", 3);\n\t\t\n\t\t//dog4 and dog5 are duplicate elements\n\t\tset.add(puppy1);\n\t\tset.add(puppy2);\n\t\tset.add(puppy3);\n\t\tset.add(puppy4);\n\t\tset.add(puppy5);\n\t\t\n\t\tSystem.out.println(\"puppy4 . hashCode () = \"+puppy4.hashCode());\n\t\tSystem.out.println(\"puppy5 . hashCode () = \"+puppy5.hashCode());\n\t\t\n\t\tIterator<Puppy> iterator=set.iterator();\n\t\t\n\t\tSystem.out.println(\"Accessing data using Iterator interface!\");\n\t\twhile(iterator.hasNext()){\n\t\t\tPuppy puppy=iterator.next();\n\t\t\tSystem.out.println(puppy);\n\t\t}\n\t\t\n\t\t\n\t\tSystem.out.println(\"____________-----\");\n\t\tfor(Puppy puppy:set){\n\t\t\tSystem.out.println(puppy);\n\t\t}\n\t\t\n\t\tPuppy puppy6=new Puppy(\"NANY\", 3);\n\t\t\n\t\tboolean b=set.contains(puppy6);\n\t\tif(b){\n\t\t\tSystem.out.println(\"puppy6 found in set!\"+puppy6);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Run it\");\n\t\t /* final Entry<K,V> getEntry(Object key) {\n\t\t int hash = (key == null) ? 0 : hash(key.hashCode());\n\t\t for (Entry<K,V> e = table[indexFor(hash, table.length)];\n\t\t e != null;\n\t\t e = e.next) {\n\t\t Object k;\n\t\t if (e.hash == hash &&\n\t\t ((k = e.key) == key || (key != null && key.equals(k))))\n\t\t return e;\n\t\t }\n\t\t return null;\n\t\t } */\n\t\t b=set.contains(puppy1);\n\t\tif(b){\n\t\t\tSystem.out.println(b+\"is found in set!\");\n\t\t}\n\t\t\n\n\t}", "public Node removeDups(Node head) {\n if (head != null) {\n Node current = head;\n Set<Integer> set = new HashSet<>();\n set.add(current.data);//IMP step\n\n while (current.next != null) {\n if (set.contains(current.next.data)) {\n //found the dup, leave it out\n current.next = current.next.next;\n } else {\n set.add(current.data);\n current = current.next;\n }\n }\n }\n return head;\n }", "public static void main(String[] args) {\n\t\tint[] input ={1, 1, 2, 3, 5, 5, 7, 9, 9, 9};\n\t\t\n\t\tfindDuplicates(input);\n\t}", "private boolean containsDuplicate(final int[] inputarray){\n Set<Integer> cells = new HashSet<Integer>();\n for (int i : inputarray){\n if (cells.contains(i) || (i < 1 || i > inputarray.length)) return true;\n cells.add(i);\n }\n return false;\n }", "public static void main(String[] args) {\n\t\tScanner scan = new Scanner(System.in);\r\n\t\tList<Integer> nums = new ArrayList<>();\r\n\t\t\r\n\t\tnums.add(10);nums.add(10);nums.add(10);nums.add(8);\r\n\t\tnums.add(11);nums.add(10);nums.add(10);nums.add(10);\r\n\r\n\t\tSystem.out.println(nums);\r\n\t\t\r\n\t\tList<Integer> unique1 = new ArrayList<>(); \r\n\t\t\r\n\t\t\r\n\t\t // find unique NON DUPLICATE VALUES\r\n\t\tfor(Integer num: nums) {\r\n\t\t\tif(!unique1.contains(num)) { // if unique1 doesn't contains num add it\r\n\t\t\t\tunique1.add(num); //<<<<<======= adding to unique1 num one by one\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(unique1.toString());\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t \r\n\t\t\r\n\t\tList<Integer> unique2 = new ArrayList<>();\r\n\t\t\r\n\t\tfor(int i =0; i<nums.size(); i++) { // find unique ( appearence once)\r\n\t\t\tint count=0;\r\n\t\t\t\r\n\t\t\tInteger value = nums.get(i);\r\n\t\t\tfor(int k =0; k<nums.size(); k++) {\r\n\t\t\t\tif(nums.get(k)== value && i != k) {\r\n\t\t\t\t\tcount++;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(count == 0) {\r\n\t\t\t\tunique2.add(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(unique2);\r\n\t\t\r\n\t}", "public boolean containsNearbyDuplicate(int[] nums, int k) {\n for(int left = 0; left<nums.length-1; left ++) {\n int low = Math.min(left+k, nums.length-1);\n for(int i=left+1; i<=low; i++) {\n if(nums[i] == nums[left]) return true;\n }\n }\n return false;\n }", "public static void main(String[] args) {\n\t\t\r\n\t\t TreeSet<String> treeset = new TreeSet<String>();\r\n\t\t treeset.add(\"Good\");\r\n\t\t treeset.add(\"For\");\r\n\t\t treeset.add(\"Health\");\r\n\t\t //Add Duplicate Element\r\n\t\t treeset.add(\"Good\");\r\n\t\t System.out.println(\"TreeSet : \");\r\n\t\t for (String temp : treeset) {\r\n\t\t System.out.println(temp);\r\n\t\t }\r\n\t\t }", "public static void main(String[] args) {\n\t\tint[] a1 = {1,2,3,4,5,6,7,8,9};\n\t\tSystem.out.println(containsDuplicates(a1));\n\t\tint[] a2 = {1,2,3,4,6,6,7,8,9};\n\t\tSystem.out.println(containsDuplicates(a2));\n\n\t}", "public SetTest()\r\n {\r\n List< String > list = Arrays.asList( colors );\r\n System.out.printf( \"ArrayList: %s\\n\", list );\r\n printNonDuplicates( list );\r\n }", "public BSTSet intersection(BSTSet s) {\n int[] thisArray = BSTToArray();\n int[] sArray = s.BSTToArray();\n int[] interArray = justDuplicates(thisArray, sArray);\n\n sortArray(interArray);\n\n return new BSTSet(interArray);\n }", "public static List<Integer> findDisappearedNumbers_set(int[] nums) {\n List<Integer> ans = new ArrayList<>();\n int len = nums.length;\n Set<Integer> set = new HashSet<>();\n for (int x : nums) {\n set.add(x);\n }\n\n for (int i = 1; i <= len; i++) {\n if (!set.contains(i)) {\n ans.add(i);\n }\n }\n\n return ans;\n }", "public static void main(String[] args) {\n\t\tString s=\"hello world lokl\";\n\t\tchar[] chararray=s.toCharArray();\n\t\tSet<Character> set = new HashSet<Character>();\n\t\t//hashset is implementation of set interface\n\t\t\n\t\tint ctr=0;\n\t\tfor(int i=0; i<chararray.length;i++)\n\t\t{\n\t\t\tif(!set.add(chararray[i]))\n\t\t\t{\n\t\t\t\tSystem.out.println(\"index of duplicate char-\" + chararray[i]+\" \" +i);\n\t\t\t\tctr++;\n\t\t\t}\n\n\n\t\t}\n\t\t\n\t\tSystem.out.println(\"total no of duplicate characters\"+ ctr);\n\t\t\n\n\t}", "static void printFirstRepeating(int arr[]) {\n // Initialize index of first repeating element\n int min = -1;\n // Creates an empty hashset\n Set<Integer> set = new HashSet<>();\n // Traverse the input array from right to left\n for (int i = arr.length - 1; i >= 0; i--) {\n // If element is already in hash set, update min\n if (set.contains(arr[i])) {\n min = i;\n } else { // Else add element to hash set\n set.add(arr[i]);\n }\n }\n // Print the result\n if (min != -1)\n System.out.println(\"The first repeating element is \" + arr[min]);\n else\n System.out.println(\"There are no repeating elements\");\n }", "public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {\n\n if(nums==null||nums.length<2||k<0||t<0)\n return false;\n\n TreeSet<Long> sortedElems = new TreeSet<>();\n\n for(int i = 0; i< nums.length; i++){\n\n final long num = (long)nums[i];\n\n final long left = num - t;\n final long right = num + t+1;\n final SortedSet<Long> foundElems = sortedElems.subSet(left, right);\n if(!foundElems.isEmpty()){\n return true;\n }\n sortedElems.add(num);\n\n if(i>=k){\n sortedElems.remove((long)nums[i-k]);\n }\n\n }\n return false;\n\n\n }", "public static void main(String[] args) {\n int a[]={1,2,3,4,4,3,2,6,6,9,9,6,7,4,7};\n\n ArrayList<Integer> al= new ArrayList<Integer>();\n\n for (int i =0;i<a.length;i++){\n int k=0;\n if (!al.contains(a[i])){\n al.add(a[i]);\n k++;\n\n for (int j=0;j<a.length;j++){\n if(a[i]==a[j]){\n k++;\n }\n }\n System.out.println(\"The number \"+ a[i] +\"repeats \"+ k+\" number of times.\");\n if (1==k)\n System.out.println(a[i]+ \" is the unique number.\");\n }\n\n\n }\n\n\n\n }", "private static boolean duplicateSetName(String setName){\n boolean duplicate = false;\n for (Set set : SetManager.getInstance().getSets()) {\n if (set.getName() != null) {\n if (set.getName().equals(setName)) {\n duplicate = true;\n }\n }\n }\n return duplicate;\n }", "@Override\r\n\tpublic MySet intersectSets(MySet[] t) {\r\n\t\tallElements = new ArrayList<Integer>();\r\n\r\n\t\t\r\n\t\tfor(Object element: t[0]) {\r\n\t\t\tallElements.add(element);\r\n\t\t}\r\n\t\r\n\t\tfor(Object e: allElements) {\r\n\t\t\tInteger c = map.getOrDefault(e, 0);\r\n\t\t\tmap.put((E)e, c + 1);\r\n\t\t}\r\n\t\t\r\n\t\tMySet<E> returnSet = (MySet<E>) new Set2<Integer>();\r\n\t\tfor(Map.Entry<E, Integer> entry :map.entrySet())\r\n\t\t\tif(entry.getValue() >= dataSet[0].length) // check\r\n\t\t\t\treturnSet.add(entry.getKey());\r\n\t\t\r\n\t\t\r\n\t\treturn returnSet;\r\n\t}", "public static char findFirstDuplicates(String str){\n //a green apple\n // ^ now set contains 'e'\n Set<Character> set = new HashSet<>();\n\n for(Character ch:str.toCharArray()){\n if(set.contains(ch)) return ch;\n\n set.add(ch);\n }\n return Character.MIN_VALUE;\n\n }", "@Override\n public Set<T> asSet() {\n return new AbstractSet<T>() {\n @Override\n public Iterator<T> iterator() {\n return new Iterator<T>() {\n boolean foundNext;\n boolean hasNext;\n T next;\n \n private void findNext() {\n if (!foundNext) {\n hasNext = isPresent();\n if (hasNext) {\n try {\n next = get();\n } catch (NoSuchElementException e) {\n // in case there was a race and the value became absent\n hasNext = false;\n next = null;\n }\n } else {\n next = null;\n }\n foundNext = true;\n }\n }\n \n @Override\n public boolean hasNext() {\n findNext();\n return hasNext;\n }\n\n @Override\n public T next() {\n findNext();\n if (hasNext) {\n // no next after consuming the single present value \n hasNext = false;\n T ret = next;\n next = null;\n return ret;\n }\n throw new NoSuchElementException();\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException();\n }\n };\n }\n\n @Override\n public int size() {\n return isPresent() ? 1 : 0;\n }\n };\n }", "public List<TreeNode> findDuplicateSubtrees(TreeNode root) {\n // like i thought, we can take the advantage of the serialization of the tree node\n // that is how we can put them into the map and check if there already exsit the same serials\n List<TreeNode> ans = new ArrayList<>();\n dfspostorder(root,new HashMap<String,Integer>(),ans);\n return new ArrayList<TreeNode>(ans);\n }", "public Collection<BundleEntry> getDuplicates() {\n return duplicates;\n }", "public static <T> boolean hasDuplicates(final List<T> elements) {\n\t\tfor (int i = 0; i < elements.size() - 1; i++) {\n\t\t\tfinal T element = elements.get(i);\n\t\t\tfor (int j = i + 1; j < elements.size(); j++) {\n\t\t\t\tif (elements.get(j).equals(element))\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static void main(String[] args) {\n/*\n * Implementações\n * Set notas = new HashSet(); --> antes do Java 5\n * HashSet<Double> notas = new HashSet<>();\n * Set<Double> notas = new HashSet<>(); //--> Generics (jdk5) - Diamond Operator(jdk7)\n * \n */\n\t\t//--> Set não aceita elementos duplicados \n//\t\tSet<Double> notas = Set.of(7d, 8.5, 9.3, 5d, 7d, 0d, 3.6); \t\t\n//\t\tnotas.add(1d);\n//\t\tnotas.add(1d);\n//\t\tSystem.out.println(notas);\n\t\t\n\t\t\tSystem.out.println(\"Crie um conjunto e adicione as notas:\");\n\t\t\t//Elementos serão impressos em ordem aleatória\n\t\t\t//Elementos duplicados não serão impressos\n\t\t\tSet<Double> notas = new HashSet<>(Arrays.asList(7d, 8.5, 9.3, 5d, 7d, 0d, 3.6));\n\t\t\tSystem.out.println(notas.toString());\n\t\t\t\n\t\t\t//indexOf --> Set não trabalha com indice, não é possível fazer a pesquisa\n//\t\t\tSystem.out.println(\"Exiba a posição da nota 5.0: \" + notas.indexOf(5.0));\n\n\t\t\t\t// não se trabalha com indice(posição) no Set\n//\t\t\t\tSystem.out.println(\"Adicione na lista a nota 8.0 na posição 4: \");\n\n\t\t\t\t// set --> não há como fazer atualizacao usando Set\n//\t\t\t\tSystem.out.println(\"Substitua a nota 5.0 pela nota 6.0:\");\n//\t\t\t\tnotas.set(notas.indexOf(5.0), 6.0);\n//\t\t\t\tSystem.out.println(notas);\n\n\t\t\t\t// contains --> retorna boolean (true or false) se determinado elemento existe\n\t\t\t\t// na lista\n\t\t\t\tSystem.out.println(\"Confira se a nota 5.0 está na lista: \" + notas.contains(5.0));\n\n\t\t\t\t// get --> não consegue executar o método em Set apenas em List\n//\t\t\t\tSystem.out.println(\"Exiba a terceira nota: \" + notas.get(2));\n//\t\t\t\tSystem.out.println(notas.toString());\n\t\t\t\t\n\t\t\t\t// Collections.min/max --> não existem métodos nativos em Set para\n\t\t\t\t// comparacao de valores minimos e maximos\n\t\t\t\t// porém sendo Set uma Collection\n\t\t\t\t// pode-se utilizar metodos de Collections na implementacao\n\t\t\t\tSystem.out.println(\"Exiba a menor nota: \" + Collections.min(notas));\n\t\t\t\t// Collections.max\n\t\t\t\tSystem.out.println(\"Exiba a maior nota: \" + Collections.max(notas));\n\t\t\t\t\n\t\t\t\t// Soma de valores\n\t\t\t\tIterator<Double> iterator = notas.iterator();\n\t\t\t\tDouble soma = 0d;\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tDouble next = iterator.next();\n\t\t\t\t\tsoma += next;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Exiba a soma dos valores: \" + soma);\n\n\t\t\t\t// Media dos valores\n\t\t\t\tSystem.out.println(\"Exiba a média dos valores: \" + (soma / notas.size()));\n\n\t\t\t\t// remove --> pode ser usado para remocao pelo elemento ou indice\n\t\t\t\tSystem.out.println(\"Remova a nota 0.0\");\n\t\t\t\tnotas.remove(0.0); // remocao do elemento 0.0 ou 0d\n\t\t\t\tSystem.out.println(notas);\n\n\t\t\t\t// remove na posição --> não pode ser usado pois Set não é indexado\n//\t\t\t\tSystem.out.println(\"Remova a nota na posição 0\");\n//\t\t\t\tnotas.remove(0);\n//\t\t\t\tSystem.out.println(notas);\n\n\t\t\t\t// Remocao de uma colecao de elementos\n\t\t\t\tIterator<Double> iterator1 = notas.iterator();\n\t\t\t\twhile (iterator1.hasNext()) {\n\t\t\t\t\tDouble next = iterator1.next();\n\t\t\t\t\tif (next < 7)\n\t\t\t\t\t\titerator1.remove();\n\t\t\t\t}\n\t\t\t\tSystem.out.println(notas);\n\n\t\t\t\t//Implementando o conjunto com LinkedHasSet\n\t\t\t\t//Exibir os elementos na ordem em que foram inseridos\n\t\t\t\tSystem.out.println(\"Exiba todas as notas na ordem em que foram inseridos:\");\n\t\t\t\tSet<Double> notas2 = new LinkedHashSet<>();\n\t\t\t\tnotas2.add(7.0);\n\t\t\t\tnotas2.add(8.5);\n\t\t\t\tnotas2.add(9.3);\n\t\t\t\tnotas2.add(5.0);\n\t\t\t\tnotas2.add(7.0);\n\t\t\t\tnotas2.add(0.0);\n\t\t\t\tnotas2.add(3.6);\n\t\t\t\t\n\t\t\t\tSystem.out.println(notas2);\n\n\t\t\t\t//Implementando o conjunto com TreeSet\n\t\t\t\t//Exibir os elementos na ordem crescente\n\t\t\t\tSystem.out.println(\"Exiba todas as notas na ordem crescente:\");\n\t\t\t\tSet<Double> notas3 = new TreeSet<>(notas2);\n\t\t\t\tSystem.out.println(notas3);\n\t\t\t\t\n\t\t\t\t// clear --> apagar um conjunto\t\t\n\t\t\t\tSystem.out.println(\"Apague todo o conjunto\"); \n\t\t\t\tnotas.clear();\n\t\t\t\tSystem.out.println(notas);\n\t\t\t\t\n\t\t\t\t// isEmpty --> retorna boolean (true or false) para validacao se a lista\n\t\t\t\t// encontra-se vazia ou nao\n\t\t\t\tSystem.out.println(\"Confira se o conjunto está vazio notas1: \" + notas.isEmpty());\n\t\t\t\tSystem.out.println(\"Confira se o conjunto está vazio notas2: \" + notas2.isEmpty());\n\t\t\t\tSystem.out.println(\"Confira se o conjunto está vazio: notas3\" + notas3.isEmpty());\n\t\t\t}", "public static int countDuplicates(List<Integer> numbers) {\n // Write your code here\n Map<Integer, Integer> mapCount = new HashMap<>();\n Set<Integer> duplicates = new HashSet<>();\n for (Integer i : numbers) {\n Integer count = mapCount.get(i);\n if (count == null) {\n count = 1;\n } else if (count != null) {\n count++;\n duplicates.add(i);\n }\n mapCount.put(i, count);\n }\n return duplicates.size();\n }", "public ListNode deleteDuplicates(ListNode head) {\n\t\tif(head == null)\n\t\t\treturn null;\n\t\tListNode res = head;\n\t\tSet<Integer> dedupSet = new HashSet<Integer>();\n\t\tListNode pre = head;\n\t\tdedupSet.add(head.val);\n\t\thead = head.next;\n\t\twhile(head != null){\n\t\t\tif(!dedupSet.contains(head.val)){\n\t\t\t\tdedupSet.add(head.val);\n\t\t\t\tpre = head;\n\t\t\t}else{\n\t\t\t\tpre.next = head.next;\n\t\t\t}\n\t\t\thead = head.next;\n\t\t}\n return res;\n }", "public static void main(String[] args) {\n\t\tclass Person {\n\t\t\tprivate String nome;\n\n\t\t\tpublic Person(String nome) {\n\t\t\t\tthis.nome = nome;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic String toString() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\treturn nome;\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic boolean equals(Object obj) {\n\t\t\t\tSystem.out.println(\"Equals\");\n\t\t\t\tPerson person = (Person) obj;\n\t\t\t\treturn this.nome.equals(person.nome) ? true : false;\n\n\t\t\t}\n\n\t\t\t@Override\n\t\t\tpublic int hashCode() {\n\t\t\t\tSystem.out.println(\"Hashcode!\");\n\t\t\t\treturn nome.charAt(0);\n\t\t\t}\n\t\t}\n\t\tSet<String> setComHashSet = new HashSet<>();\n\t\tsetComHashSet.add(\"Nicholas\");\n\t\tsetComHashSet.add(\"Cabral\");\n\t\tsetComHashSet.add(\"Barbosa\");\n\t\tSystem.out.println(\"I dont care about order! I care about performance to add() \" + setComHashSet);\n\t\tSet<String> setTreeSet = new TreeSet<>(Set.copyOf(setComHashSet));\n\t\tSystem.out.println(\"I care about order, however I dont care about performance to add() \" + setTreeSet);\n\t\tSystem.out.println();\n\t\tSet<Person> setPerson = new HashSet<>();\n\t\tPerson person = new Person(\"Nicholas\");\n\t\tPerson person2 = new Person(\"Nicholas2\");\n\t\tsetPerson.add(person);\n\t\tsetPerson.add(person2);\n\t\tSystem.out.println(setPerson);\n\t\tString[] arr = { \"Nihcolas\" };\n\t\tList<String> lista = Arrays.asList(arr);\n\n\t\tA a = new A();\n\t\tSetCollection b = (SetCollection) a;\n\t\tSystem.out.println(a == b);\n\t}", "private static void findDuplicatesBruteForce(int[] arr) {\n\t\t\n\t\tfor(int i = 0; i< arr.length ; i++)\n\t\t{\n\t\t\tfor ( int j = i+1 ; j < arr.length ; j++)\n\t\t\t{\n\t\t\t\tif(arr[i] == arr[j])\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(arr[i] + \" is duplicate by brute force method\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static List<Integer> findDuplicates(List<Integer> numbers) {\n Integer[] cloneArray = new Integer[numbers.size()];\n Integer[] repeatNums = new Integer[numbers.size()-1];\n\n\n for (int i = 0; i < numbers.size(); i++){\n cloneArray[i] = numbers.get(i);\n }\n\n //I checked the big notation of this method is O(log(n) )\n // source https://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#sort(int[])\n Arrays.sort(cloneArray);\n\n for (int i = 0; i < cloneArray.length -1 ; i++) {\n if (cloneArray[i] == cloneArray[i+1]){\n repeatNums[i] = Integer.valueOf(cloneArray[i]);\n }\n }\n\n\n for (int i = 1; i < repeatNums.length; i++){\n if (repeatNums[i-1] == null){\n repeatNums[i-1] = repeatNums[i];\n repeatNums[i] = null;\n }\n }\n\n //Removing any nulls.\n Integer[] outArray = Arrays.stream(repeatNums).filter(Objects::nonNull).toArray(Integer[]::new);\n\n List<Integer> duplicateList = Arrays.asList(outArray);\n\n return duplicateList;\n }", "public boolean containsNearbyDuplicate(int[] nums, int k) {\n \tint len=nums.length;\n \tif(len<2){\n \t\treturn false;\n \t}\n \tHashMap<Integer,Integer> map=new HashMap<Integer,Integer>();\n \tfor(int i=0; i<len; i++){\n \t\tif(!map.containsKey(nums[i])){\n \t\t\tmap.put(nums[i], i);\n \t\t}else{\n \t\t\tif((i-map.get(nums[i])<=k)){\n \t\t\t\treturn true;\n \t\t\t}\n \t\t\tmap.put(nums[i], i);\n \t\t}\n \t}\t\n \treturn false; \n }", "public int findDuplicate(int[] nums) {\n int slow = nums[0];\n int fast = nums[0];\n do {\n slow = nums[slow];\n fast = nums[nums[fast]];\n } while (slow != fast);\n \n slow = nums[0];\n while (slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n return slow;\n }", "public ListNode deleteDuplicates(ListNode head) {\n if (head == null || head.next == null)\n return head;\n Set<Integer> hs = new HashSet();\n ListNode temp = head;\n ListNode prev = head;\n \n while (temp != null) {\n if (!hs.contains(temp.val)) {\n hs.add(temp.val);\n prev = temp;\n } else {\n prev.next = temp.next;\n }\n temp = temp.next;\n }\n return head;\n }", "public boolean containsNearbyDuplicate(int[] nums, int k) {\n if (nums.length == 0) {\n return false;\n }\n HashMap<Integer, Integer> map = new HashMap<>();\n for (int i = 0; i < nums.length; i++) {\n Integer index = map.get(nums[i]);\n if (index != null && i - index <= k) {\n return true;\n } else {\n map.put(nums[i], i);\n }\n }\n\n return false;\n }", "static public boolean setEquals(Set source, Set arg) {\n\t\tif ( source.size() != arg.size() ) {\n\t\t\treturn false;\n\t\t}\n\t\tIterator it = arg.iterator();\n\t\twhile ( it.hasNext() ) {\n\t\t\tObject elem = it.next();\n\t\t\tif ( !source.contains(elem) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\t\tHashSet<String> obj = new HashSet<String>();\n\t\t\n\t\tobj.add(\"Apple\");\n\t\tobj.add(\"Mango\");\n\t\tobj.add(\"Grapes\");\n\t\t\n\t\t//adding duplicate elements\n\t\tobj.add(\"Mango\");\n\t\tobj.add(\"Grapes\");\n\t\t\n\t\tobj.add(null);\n\t\tobj.add(null);\n\t\t\n\t\tSystem.out.println(obj);\n\t\t\n\t\t\t\t\n\t}", "public static void main(String[] args) {\n\n\t\tint [] numbers = {2, 7, 3, 2, 3, 7, 7};\n\t\tSet<Integer> set = new HashSet<>();\n\t\tfor(int i = 0; i < numbers.length; i++) {\n\t\t\tif(!set.contains(numbers[i])) {\n\t\t\t\tset.add(numbers[i]);\n\t\t\t\tSystem.out.print(numbers[i] + \" \");\n\t\t\t}\n\t\t}\n\t}", "public int findDuplicatesC(int[] input) {\n TreeSet<Integer> nonDuplicates = new TreeSet<>();\n for (int value : input) {\n nonDuplicates.add(value);\n }\n return input.length - nonDuplicates.size();\n }", "@Test\r\n\tpublic void test1() {\r\n\t\tint[] nums = {1,2,3,1,4};\r\n\t\tAssert.assertEquals(true, containsDuplicate(nums));\r\n\t}", "public List<FileDuplicate> getDuplicates() {\n List<FileDuplicate> result = new ArrayList<FileDuplicate>();\n int i = 0;\n FileDuplicate duplicates = new FileDuplicate();\n while (i < files.length) {\n if (duplicates.isEmpty() || duplicates.get(0).equals(files[i])) {\n duplicates.add(files[i]);\n i++;\n } else {\n if (duplicates.size() > 1) {\n result.add(duplicates);\n }\n duplicates = new FileDuplicate();\n }\n }\n return result;\n }", "public boolean hasDuplicates(boolean ignoreWhenIdentical) {\n boolean compareJustClassNames = !ignoreWhenIdentical;\n if (compareJustClassNames) {\n return list.size() > 1;\n }\n\n if (list.size() <= 1) {\n return false;\n }\n\n String previousHash = list.get(0).getHash();\n for (int i = 1; i < list.size(); i++) {\n String currentHash = list.get(i).getHash();\n if (!previousHash.equals(currentHash)) {\n return true;\n }\n }\n\n log.debug(\"ignoring duplicates of class \" + classFilePath + \" since the bytecode matches exactly\");\n\n return false;\n }", "List<T> getAllDistinct();", "public boolean checkDuplicates() {\n\t\tboolean[] vals = new boolean[9];\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tfor(int k = 0; k < 3; k++) {\n\t\t\t\tint num = this.getCellNum(i, k);\n\t\t\t\tif(num != 0) {\n\t\t\t\t\tif(!vals[num-1]) {\n\t\t\t\t\t\t//The number hasn't already been found\n\t\t\t\t\t\tvals[num-1] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//A duplicate number was found\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static ListNode deleteDuplicates(ListNode head) {\n \tif(head == null) return null;\n ListNode nd = head;\n HashSet hs = new HashSet();\n hs.add(nd.val);\n while(nd.next!=null){\n \tif(! hs.add(nd.next.val)){\n \t\tnd.next = nd.next.next;\n \t}\n \telse\n \t\tnd = nd.next;\n }\n return head;\n \n }", "public static boolean containsDuplicates(int[] arr) {\n for (int i = 0; i < arr.length; i++) {\n boolean dup = false;\n for (int j = i + 1; j < arr.length; j++) {\n if (arr[i] == arr[j]) {\n dup = true;\n }\n }\n if (dup) {\n return true;\n }\n }\n return false;\n }", "public Node removeDuplicates(Node head) \n {\n // Your code here\n HashSet<Integer>hs = new HashSet<>();\n Node curr=head;\n Node prev=null;\n while(curr!=null){\n if(hs.contains(curr.data)){\n prev.next = curr.next;\n }else{\n hs.add(curr.data);\n prev = curr;\n }\n curr = curr.next;\n }\n return head;\n }", "public int findDuplicatesD(int[] input) {\n HashSet<Integer> nonDuplicates = new HashSet<>();\n for (int value : input) {\n nonDuplicates.add(value);\n }\n return input.length - nonDuplicates.size();\n }", "public int findDuplicatesA(int[] input) {\n int duplicates = 0;\n Arrays.sort(input);\n for (int i = 0; i < input.length - 1; i++) {\n if (input[i] == input[i + 1]) {\n duplicates++;\n }\n }\n return duplicates;\n }", "public boolean containsDuplicate(int[] nums) {\n Arrays.sort(nums);\n for (int i=1;i<nums.length;i++) {\n \tif (nums[i]==nums[i-1]) return true;\n }\n return false;\n }", "public static void main(String[] args) {\n Set<String> mySet = new HashSet<String>(100,50);\n mySet.add(\"APPLE\");\n mySet.add(\"LG\");\n mySet.add(\"HTTC\");\n mySet.add(\"APPLE\");\n mySet.add(\"SAMSUNG\");\n Iterator<String> iterator = mySet.iterator();\n while (iterator.hasNext()){\n System.out.println(iterator.next());\n }\n\n\n\n }", "Set<X> toSet();", "public static void main(String[] args) {\n\n TreeSet<String> set = new TreeSet<String>();\n try {\n set.add(\"hello\");\n set.add(\"world\");\n set.add(\"welcome\");\n set.add(\"all\");\n set.add(\"all\");\n set.add(\"welcome\");\n\n for (String num : set) {\n System.out.println( num);\n\n }\n// set.add(null);\n } catch (NullPointerException e) {\n System.out.println(e);\n System.out.println(\"Set doesn't allow null value and duplicate value\");\n }\n\n }" ]
[ "0.761526", "0.7154552", "0.69774556", "0.6945964", "0.6931992", "0.6734415", "0.66986006", "0.66518116", "0.6614402", "0.6607473", "0.6432785", "0.6409088", "0.64013785", "0.63619196", "0.63403124", "0.6325673", "0.62955296", "0.62667215", "0.6231557", "0.6219123", "0.61930704", "0.61927336", "0.6191047", "0.6143239", "0.61302716", "0.6126142", "0.6112043", "0.6099041", "0.60506314", "0.60464233", "0.6042913", "0.6041171", "0.60356635", "0.60221", "0.6007247", "0.60024995", "0.597148", "0.5943068", "0.59361374", "0.59064764", "0.59015864", "0.5891651", "0.5887182", "0.5876951", "0.5876306", "0.58758265", "0.5867288", "0.5841894", "0.58247066", "0.5821068", "0.5814795", "0.5808355", "0.5805991", "0.58023846", "0.58016914", "0.5801354", "0.57861066", "0.5778472", "0.5775023", "0.5773654", "0.57639223", "0.57626146", "0.5761497", "0.5760668", "0.5753015", "0.5749681", "0.57445157", "0.5728729", "0.57260436", "0.57176834", "0.5708847", "0.57072777", "0.5702056", "0.57003266", "0.5697888", "0.56939894", "0.56907076", "0.56905127", "0.56784934", "0.5670826", "0.56597394", "0.5654375", "0.5653562", "0.5643381", "0.56375474", "0.5633651", "0.56325835", "0.5629031", "0.56230515", "0.5619565", "0.5614142", "0.56104964", "0.5604477", "0.56022304", "0.56014186", "0.55855805", "0.5580342", "0.55767274", "0.55648726", "0.55577725", "0.55564314" ]
0.0
-1
Check the column with OS type and count students that want to work on Android
public void worksWithAndroid() { System.out.println( "\nTASK [3]> The number of students that will work with an Android app:\n"); String [] namesColOne = columns.get(1); String [] namesColTwo = columns.get(2); String [] osType = columns.get(5); int count = 0; for(int i = 0; i < osType.length; ++i) { if( Objects.equals(osType[i], "Android App") ) { System.out.println( "[Names #1]: " + namesColOne[i] + " [Names #2]: " + namesColTwo[i]); ++count; } } int total = count * 2; System.out.println( "\nResult (both columns): " + total); System.out.println( "----------------------------------------------------"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getLocationTypeCount(){\n\t\tString countQuery = \"SELECT * FROM \" + table_locationType;\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tCursor cursor = db.rawQuery(countQuery, null);\n\t\tint count = cursor.getCount();\n\t\tdb.close();\n\t\treturn count;\n\t}", "public int getNumberOfStudents(String stream,String section){\n int number=0;\n SQLiteDatabase sqLiteDatabase=helper.getReadableDatabase();\n String query=\"SELECT \"+Constant.UID+\" FROM \"+Constant.TEACHER_EMAIL_VALUE+\" WHERE \"\n +Constant._STREAM+\" = \"+stream+\" AND \"+\n Constant.SECTION+\" = \"+section;\n Cursor cursor=sqLiteDatabase.rawQuery(query,null);\n while (cursor.moveToNext()){\n number++;\n }\n cursor.close();\n return number;\n\n }", "private void findOsVersion() {\n\t\tisGBOrLower = AppUtility.isAndroidGBOrLower();\n\t\tisICSOrHigher = AppUtility.isAndroidICSOrHigher();\n\t}", "int getUserTypesCount();", "int getSystemCount();", "public int getUangCount(){\n String countQuery = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n cursor.close();\n return cursor.getCount();\n }", "private int getEducationalCount(){\n int count = 0;\n\n String whereClause = DbHelper.IS_EDUCATIONAL + \" = ?\";\n String[] whereArgs = new String[]{String.valueOf(true)};\n\n Cursor cursor = mDbHelper.getReadableDatabase().query(DbHelper.TABLE_NAME, null, whereClause, whereArgs, null, null, null);\n\n while(cursor.moveToNext()){\n count++;\n }\n\n return count;\n }", "int getSnInfoCount();", "int getSnInfoCount();", "int getSnInfoCount();", "public int getLocationInfoCount(){\n\t\tString countQuery = \"SELECT * FROM \" + table_locationInfo;\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tCursor cursor = db.rawQuery(countQuery, null);\n\t\tint count = cursor.getCount();\n\t\tdb.close();\n\t\treturn count;\n\t}", "public int getSkoreCount() {\n \tString countQuery = \"SELECT * FROM \" + \"skore\";\n \tSQLiteDatabase db = this.getReadableDatabase();\n \tCursor cursor = db.rawQuery(countQuery, null);\n \tint count = cursor.getCount(); //added line here\n \t\n \tcursor.close(); \t\n \tdb.close();\n \t\n \treturn count;\n }", "public int dbSyncCount()\n {\n int count = 0;\n String selectQuery = \"SELECT * FROM UsersTable where udpateStatus = '\"+\"no\"+\"'\";\n SQLiteDatabase database = this.getWritableDatabase();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n database.close();\n return count;\n }", "int countByExample(DeviceExample example);", "public int dbSyncCount(){\n int count = 0;\n String selectQuery = \"SELECT * FROM farmers where updateStatus = '\"+\"no\"+\"'\";\n SQLiteDatabase database = this.getWritableDatabase();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n database.close();\n return count;\n }", "int countByExample(QtActivitytypeExample example);", "public int dbDeleteCount(){\n int count = 0;\n // String selectQuery = \"SELECT * FROM farmers where updateStatus = \"+\"yes\" +\" AND scanedBarcode = \"+\"yes\"+\" \";\n String selectQuery = \"SELECT * FROM farmers where updateStatus = '\"+\"yes\"+\"' \";\n SQLiteDatabase database = this.getWritableDatabase();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n //database.close();\n return count;\n }", "public int findAllCountBySrctype(int srctype) {\n int cnt = 0;\n Cursor cursor = null;\n try {\n cursor = this.db.rawQuery(\"SELECT count(1) FROM MOBILE_AP WHERE SRCTYPE = ? \", new String[]{String.valueOf(srctype)});\n while (cursor.moveToNext()) {\n cnt = cursor.getInt(0);\n }\n } catch (IllegalArgumentException e) {\n LogUtil.d(\"SELECT count(1) FROM MOBILE_AP WHERE SRCTYPE = ? \");\n LogUtil.e(\"findAllCountBySrctype IllegalArgumentException: \" + e.getMessage());\n } catch (Exception e2) {\n LogUtil.e(\"findAllCountBySrctype Exception: \" + e2.getMessage());\n if (cursor != null) {\n cursor.close();\n }\n return cnt;\n } catch (Throwable th) {\n if (cursor != null) {\n cursor.close();\n }\n throw th;\n }\n }", "@Override\n public int cantAlumnos(String curso) throws Exception {\n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n int cantAlumnos = 0;\n try {\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"select count(a.id) as cant from alumno a, curso cu \"\n + \"where a.idCurso = cu.idcurso \"\n + \"and UPPER(cu.nombreCurso) like UPPER(?)\");\n pstmt.setString(1, curso); \n rs = pstmt.executeQuery();\n\n while (rs.next()) { \n cantAlumnos = rs.getInt(\"cant\");\n } \n return cantAlumnos;\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (rs != null) {\n rs.close();\n }\n if (pstmt != null) {\n pstmt.close();\n }\n DBUtils.closeConnection(c);\n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return cantAlumnos;\n }", "int countByExample(TVmManufacturerExample example);", "private static String getStatus()\n {\n String query = \"SELECT COUNT(*)\"\n + \" FROM information_schema.tables\"\n + \" WHERE table_schema = '\" + userID + \"'\"\n + \" AND table_name = 'myRooms'\"\n + \" OR table_name = 'myReservations'\";\n\n try {\n Statement s = conn.createStatement();\n ResultSet result = s.executeQuery(query);\n result.next();\n\n if(result.getString(1).equals(\"0\") || \n result.getString(1).equals(\"1\"))\n return \"no database\";\n\n if(getTableCounts(\"myRooms\").equals(\"0\") ||\n getTableCounts(\"myReservations\").equals(\"0\"))\n return \"empty\";\n }\n catch (Exception ee) {\n System.out.println(\"ee170: \" + ee);\n return \"error\";\n }\n\n return \"full\";\n }", "public int countCourseRegisStudent(String year, String sem, String stdcode) {\n int maxusr = 0;\n String sql = \"select to_char(count(to_number(STD_CODE)))STD_CODE from XINT_STD_REGIS_EXAM where YEAR = ? and SEMESTER = ? and STD_CODE = ? \";\n Map<String, Object> row = db.querySingle(sql, year, sem, stdcode);\n\n if (row != null) {\n maxusr = Integer.parseInt((String) row.get(\"STD_CODE\"));\n return maxusr;\n } else {\n return 0;\n }\n }", "@Override\n\t\tpublic int getCount() {\n\t\t\treturn userapp.size() + systemapp.size();\n\t\t}", "@Override\n\tpublic int getCount() {\n\t\tString sql=\"SELECT count(*) FROM `tc_student` where project=\"+project;\n\t\tResultSet rs=mysql.query(sql);\n\t\ttry {\n\t\t\tif(rs.next())\n\t\t\t{\n\t\t\t\treturn rs.getInt(1);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\t// TODO 自动生成的 catch 块\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn 0;\n\t}", "int getStudentCount();", "public int getLocationCount(){\n\t\tString countQuery = \"SELECT * FROM \" + table_location;\n\t\tSQLiteDatabase db = this.getReadableDatabase();\n\t\tCursor cursor = db.rawQuery(countQuery, null);\n\t\tint count = cursor.getCount();\n\t\tdb.close();\n\t\treturn count;\n\t}", "public int getCapteurCount() {\n String countQuery = \"SELECT * FROM \" + TABLE_LOGIN;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n int rowCount = cursor.getCount();\n cursor.close();\n //db.close();\n return rowCount;\n }", "public long getPhoneNumberCount(String msgId) {\n\n SQLiteDatabase db = openConnection();\n String table = msgId + PHONE_NUMBER_TABLE_NAME;\n //CHECK WHETHER TABLE EXISTS\n Cursor cursor = db.rawQuery(\"select * from sqlite_master where tbl_name = '\" + table + \"'\", null);\n\n long count = 0;\n if (cursor != null) {\n if (cursor.getCount() > 0) {\n cursor.close();\n\n Log.i(TAG, \"exist\");\n count = DatabaseUtils.queryNumEntries(db, table);\n\n } else {\n Log.i(TAG, \"Not exist\");\n cursor.close();\n }\n }\n\n closeConnection();\n\n\n return count;\n }", "int countByExample(SdkMobileVcodeExample example);", "private int getForFunCount(){\n int count = 0;\n\n String whereClause = DbHelper.IS_FOR_FUN + \" = ?\";\n String[] whereArgs = new String[]{String.valueOf(true)};\n\n Cursor cursor = mDbHelper.getReadableDatabase().query(DbHelper.TABLE_NAME, null, whereClause, whereArgs, null, null, null);\n\n while(cursor.moveToNext()){\n count++;\n }\n\n return count;\n }", "public static int selectUsernameAndPasswordFromDB(Connection con, String type, String usr, String psw) throws SQLException {\r\n\t\tString sql = \"SELECT COUNT(*) FROM \" + type +\"Data\\r\\n\" + \" WHERE user ='\" + usr + \"' AND password ='\" + psw + \"'\";\r\n\t\t\r\n\t\tif (con != null) {\r\n\t\t\ttry (\t\r\n\t\t\t\t\tStatement stmt = conn.createStatement(); \r\n\t\t\t\t\tResultSet rs = stmt.executeQuery(sql)) {\r\n\t\t\t\t\treturn rs.getInt(\"COUNT(*)\");\r\n\t\t\t} catch (SQLException ex) {\r\n\t\t\t\tSystem.out.println(ex.getMessage());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public int dbSyncCount(){\n int count = 0;\n SQLiteDatabase database = null;\n try {\n int status = 0;\n String selectQuery = \"SELECT * FROM \" + Constants.config.TABLE_USERS+ \" WHERE \" + USER_STATUS + \" = '\" + status + \"' \";\n database = new DBHelper(context).getReadableDatabase();\n database.beginTransactionNonExclusive();\n Cursor cursor = database.rawQuery(selectQuery, null);\n count = cursor.getCount();\n database.setTransactionSuccessful();\n }catch (Exception e){\n e.printStackTrace();\n }finally {\n try{\n database.endTransaction();\n }catch (Exception e){\n e.printStackTrace();\n }\n }\n return count;\n }", "public static int getNumberOfStudent(int ringId) {\n\r\n String sql = \"select count(studentId) from Student where ringId = ?\";\r\n System.out.println(ringId);\r\n Connection conn = DB.connect();\r\n PreparedStatement st;\r\n ResultSet rs;\r\n try {\r\n st = conn.prepareStatement(sql);\r\n st.setInt(1, ringId);\r\n rs = st.executeQuery();\r\n\r\n if (rs.next()) {\r\n return rs.getInt(\"count(studentId)\");\r\n } else {\r\n return -1;\r\n }\r\n } catch (SQLException ex) {\r\n Logger.getLogger(User.class.getName()).log(Level.SEVERE, null, ex);\r\n return -1;\r\n }\r\n\r\n }", "@Override public boolean hasNativeTextFields () {\n return _os == OS.WINDOWS || _os == OS.LINUX;\n }", "public int countByType(long typeId);", "@Override\n\tpublic int countCase() {\n\t\treturn proSystemHeadMapper.selectCountCase()+proMultiMapper.selectCountMul()+proAppMapper.selectCountApp()+proItMapper.selectCountIt();\n\t}", "public int getcount() {\n\t\tString countQuery = \"SELECT * FROM \" + DATABASE_TABLE1;\n\t \n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t int cnt = cursor.getCount();\n\t cursor.close();\n\t return cnt;\n\t\n\t}", "public boolean LoadBooleanStatusCount(String Query) {\n try {\n int havcount = 0;\n\n\n SQLiteDatabase database = BaseConfig.GetDb();\n Cursor c = database.rawQuery(Query, null);\n\n if (c != null) {\n if (c.moveToFirst()) {\n do {\n String Status = c.getString(c.getColumnIndex(\"dstatus\"));\n\n if (Status.split(\":\")[1].trim().equalsIgnoreCase(BaseConfig.template_name)) {\n havcount++;\n }\n\n } while (c.moveToNext());\n }\n }\n\n c.close();\n database.close();\n\n return havcount > 0;\n } catch (Exception e) {\n e.printStackTrace();\n return false;\n }\n\n }", "@Override\n public long getCountWithName(String studentId) {\n return 0;\n }", "public int findGameTypeBySerialNo(String serialNo) throws ApplicationException;", "public Integer getSysUserTypesCount(SysUserType sysUserType);", "public static int getNos() {\n\t\treturn numberOfStudents;\n\t}", "public int getUsers()\n\t{\n\t\tint users=0;\n\t\tString query=\"select count(*) from login where usertype=?\";\n\t\ttry\n\t\t{\n\t\t\tConnection con=DBInfo.getConn();\t\n\t\t\tPreparedStatement ps=con.prepareStatement(query);\n\t\t\tps.setString(1, \"user\");\n\t\t\tResultSet res=ps.executeQuery();\n\t\t\twhile(res.next())\n\t\t\t{\n\t\t\t\tusers=res.getInt(1);\n\t\t\t}\n\t\t\tcon.close();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn users;\n\t}", "public int count(){\n\tboolean val = false;\n\tint cont = 0;\n\tfor(int i =0;i<arch.length && !val;i++){\n\t\tif(arch[i]!=null){\n\t\t\tcont++;\n\t\t}\n\t\telse{\n\t\t\tval=true;\n\t\t}\n\t}\n\treturn cont;\n}", "int countByExample(SdkPhoneExample example);", "int countByExample(Assist_tableExample example);", "long countByExample(TerminalInfoExample example);", "public int countArticle(){\n\n DatabaseHelper databaseHelper = DatabaseHelper.getInstance(this.mExecutionContext);\n SQLiteDatabase sqLiteDatabase = databaseHelper.getReadableDatabase();\n\n Cursor Count= sqLiteDatabase.rawQuery(\"select count(*) from\"+ ConfigDAO.TABLE_AISLE, null);\n Count.moveToFirst();\n int count= Count.getInt(0);\n Count.close();\n return count;\n }", "public static int getCountofPeople(){\n int training_set = 0;\n \n try (Connection con = DriverManager.getConnection(url, user, password)){\n String query = \"SELECT count(*) FROM \"+DATABASE_NAME+\".People;\";\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(query);\n if (rs.next()) {\n training_set = rs.getInt(1);\n }\n con.close();\n }catch (SQLException ex) {\n ex.printStackTrace();\n } \n\n return training_set;\n }", "long countByExample(PaasCustomAutomationRecordExample example);", "private boolean isSupported(Context context, int sensorType) {\n\t\t\tsensorManager =\n\t\t (SensorManager) context\n\t\t .getSystemService(Context.SENSOR_SERVICE);\n\t\t List<Sensor> sensors = sensorManager.getSensorList(sensorType);\n\t\t return sensors.size() > 0;\n\t\t}", "public String countByExample(MaterialTypeExample example) {\r\n SQL sql = new SQL();\r\n sql.SELECT(\"count(*)\").FROM(\"material_type\");\r\n applyWhere(sql, example, false);\r\n return sql.toString();\r\n }", "int countByExample(AdminTabExample example);", "public boolean check(String name){\n SQLiteDatabase db=this.getWritableDatabase();\n Cursor cursor = null;\n String sql =\"SELECT 1 FROM \"+TABLE_NAME+\" WHERE \" + COL32 + \"='\" + name + \"'\";\n cursor= db.rawQuery(sql,null);\n //Log(\"Cursor Count : \" + cursor.getCount());\n\n if(cursor.getCount()>0){\n cursor.close();\n return false;\n }else{\n cursor.close();\n return true;\n }\n //cursor.close();\n }", "public int countByProductType(String productType);", "public void jumlahanggota(){\n try{\n java.sql.Statement statement = (java.sql.Statement)conek.GetConnection().createStatement();\n ResultSet res = statement.executeQuery(\"select count(nama) from tblpegawai where grup='\"+txtgrup.getSelectedItem()+\"'\");\n \n while(res.next()){\n String jumlah = res.getString(\"count(nama)\"); \n txtanggota.setText(jumlah);\n //jmlanggota = Integer.valueOf(txtanggota.getText());\n }\n res.last();\n }catch (Exception e){\n } \n }", "long countByExample(AliUserInfoDOExample example);", "static int type_of_ora(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "int getCurrentTermActivityCount(long studentId, long universityId);", "public static int countOfTeachers() {\n\n int count = 0;\n\n String sql = \"SELECT COUNT(teacher_id) AS count FROM teachers\";\n\n try (Connection connection = Database.getConnection();\n Statement statement = connection.createStatement();\n ResultSet set = statement.executeQuery(sql)) {\n\n if (set.next())\n count = set.getInt(\"count\");\n\n } catch (SQLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n\n return count;\n }", "public void checkDevices() throws TNotFoundEx{\n\t\tString command = \"adb devices -l\";\n\t\tCommando commando = new Commando();\n\t\tString op = commando.executeCommand(command);\n\t\t\n\t\tOtherUtil oU = new OtherUtil();\n\t\tArrayList<String> devices = oU.getRegexFromString(op, \"(model:.*?device:.+$?)\");\n\t\tint eligDevices = devices.size();\n\t\t\n\t\tif (eligDevices>1)\n\t\t\tthrow new TNotFoundEx(\"ERROR: 2 or more Android devices are connected to the host, please connect only one Android device.\");\n\t\tif (eligDevices == 0)\n\t\t\tthrow new TNotFoundEx(\"ERROR: No Android devices detected by the host. Execute adb devices -l to check the connected devices\");\n\t\t\t\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 }", "private int countTables() {\r\n\tint result = -1;\r\n\r\n\tStatement stat = null;\r\n\tResultSet rs = null;\r\n\ttry {\r\n\t stat = conn.createStatement();\r\n\r\n\t rs = stat\r\n\t\t .executeQuery(\"SELECT count(1) FROM sqlite_master where name not like '%sequence%'\");\r\n\r\n\t if (rs.next()) {\r\n\t\tint count = rs.getInt(1);\r\n\r\n\t\tif (count > 0) {\r\n\t\t result = count;\r\n\t\t}\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t} finally {\r\n\t Cleanup(stat, rs);\r\n\t}\r\n\r\n\treturn result;\r\n }", "private static int getNumCoresOldPhones() {\n //Private Class to display only CPU devices in the directory listing\n class CpuFilter implements FileFilter {\n @Override\n public boolean accept(File pathname) {\n //Check if filename is \"cpu\", followed by a single digit number\n if(Pattern.matches(\"cpu[0-9]+\", pathname.getName())) {\n return true;\n }\n return false;\n }\n }\n\n try {\n //Get directory containing CPU info\n File dir = new File(\"/sys/devices/system/cpu/\");\n //Filter to only list the devices we care about\n File[] files = dir.listFiles(new CpuFilter());\n //Return the number of cores (virtual CPU devices)\n return files.length;\n } catch(Exception e) {\n //Default to return 1 core\n return 1;\n }\n }", "public boolean getCount(String type){\n if(type.equals(\"Zombie\") && zombieCounter!=0){\n return true;\n } else return type.equals(\"Sandwich\") && sandwichCounter != 0;\n }", "public void select() {\n db = helper.getReadableDatabase();\n Cursor c = db.query(\"student\", null, null, null, null, null, null);\n\n studentInfo = new String[c.getCount()];\n int count = 0;\n\n while(c.moveToNext()) {\n studentInfo[count] = c.getString(c.getColumnIndex(\"name\"))\n + \" \" + c.getString(c.getColumnIndex(\"number\"));\n count++;\n }\n c.close();\n }", "@Override\n public int getUserTypesCount() {\n return userTypes_.size();\n }", "public int getListCount() {\n String countQuery = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n cursor.close();\n return cursor.getCount();\n }", "public void fetchClassInfo() {\n try {\n telephonyClassName = \"android.telephony.TelephonyManager\";\n listofClass = new String[]{\n \"com.mediatek.telephony.TelephonyManagerEx\",\n \"android.telephony.TelephonyManager\",\n \"android.telephony.MSimTelephonyManager\",\n \"android.telephony.TelephonyManager\"};\n for (int index = 0; index < listofClass.length; index++) {\n if (isTelephonyClassExists(listofClass[index])) {\n if (isMethodExists(listofClass[index], \"getDeviceId\")) {\n if (!simVariant.equalsIgnoreCase(\"\")) {\n break;\n }\n }\n if (isMethodExists(listofClass[index], \"getNetworkOperatorName\")) {\n break;\n } else if (isMethodExists(listofClass[index], \"getSimOperatorName\")) {\n break;\n }\n }\n }\n for (int index = 0; index < listofClass.length; index++) {\n try {\n if (slotName1 == null || slotName1.equalsIgnoreCase(\"\")) {\n getValidSlotFields(listofClass[index]);\n // if(slotName1!=null || !slotName1.equalsIgnoreCase(\"\")){\n getSlotNumber(listofClass[index]);\n } else {\n break;\n }\n } catch (Exception e) {\n LOGE(TAG, \"[fetchClassInfo] Unable to get class info\", e);\n }\n }\n } catch (Exception e) {\n LOGE(TAG, \"[fetchClassInfo] Unable to get class info\", e);\n }\n }", "public Boolean checkmate(String number){\n SQLiteDatabase sqLiteDatabase = this.getReadableDatabase();\n Cursor cursor = sqLiteDatabase.rawQuery(\"Select * from user where number =?\",new String[]{number});\n if(cursor.getCount()>0) return false;\n else return true;\n\n }", "public long getCount(MigrationType type);", "public int getCountOfFreeDevices() {\n int count = 0;\n for (TestDevice td : mDevices) {\n if (td.getStatus() == TestDevice.STATUS_IDLE) {\n count++;\n }\n }\n return count;\n }", "int getSmsCodeCount();", "public int getMBMobilePhonesCount() throws SystemException {\n return mbMobilePhonePersistence.countAll();\n }", "public Cursor checkIfTypeExistForUser(String emailId, String type){\n SQLiteDatabase db = this.getWritableDatabase();\n Cursor res = db.rawQuery(\"select * from \"+USER_DATA+\" where LOWER(EMAIL_ID) = '\"+emailId.toLowerCase()+\"'\"\n +\" AND TYPE = '\"+type+\"'\" ,null);\n return res;\n }", "int getPersonInfoCount();", "private void setOsType() {\n addToMobileContext(Parameters.OS_TYPE, \"android\");\n }", "private void checkPermissions() {\n List<String> permissions = new ArrayList<>();\n String message = \"osmdroid permissions:\";\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.ACCESS_FINE_LOCATION);\n message += \"\\nLocation to show user location.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);\n message += \"\\nStorage access to store map tiles.\";\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.READ_PHONE_STATE);\n message += \"\\n access to read phone state.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.RECEIVE_SMS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.RECEIVE_SMS);\n message += \"\\n access to receive sms.\";\n //requestReadPhoneStatePermission();\n }\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNTS) != PackageManager.PERMISSION_GRANTED) {\n permissions.add(Manifest.permission.GET_ACCOUNTS);\n message += \"\\n access to read sms.\";\n //requestReadPhoneStatePermission();\n }\n if (!permissions.isEmpty()) {\n // Toast.makeText(this, message, Toast.LENGTH_LONG).show();\n String[] params = permissions.toArray(new String[permissions.size()]);\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(params, REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);\n }\n } // else: We already have permissions, so handle as normal\n }", "int getAchieveInfoCount();", "public int countWhere(String where) throws SQLException\n {\n String sql = \"select count(*) as MCOUNT from sampletype \" + where;\n Connection c = null;\n Statement pStatement = null;\n ResultSet rs = null;\n try \n {\n int iReturn = -1; \n c = getConnection();\n pStatement = c.createStatement();\n rs = pStatement.executeQuery(sql);\n if (rs.next())\n {\n iReturn = rs.getInt(\"MCOUNT\");\n }\n if (iReturn != -1)\n return iReturn;\n }\n finally\n {\n getManager().close(pStatement, rs);\n freeConnection(c);\n }\n throw new SQLException(\"Error in countWhere\");\n }", "protected int countUsers() \n\t{\n\t\tint result = -1;\n\t\ttry {\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tResultSet rs = stat.executeQuery(\"SELECT COUNT(lfm_username) FROM Persons;\");\n\t\t\tSystem.out.println(rs.toString());\n\t\t\tresult = rs.getInt(1);\n\t\t} \n\t\tcatch (SQLException e) \n\t\t{\n\t\t\tSystem.out.println(\"Something went wrong counting users from Persons\");\n\t\t}\n\t\treturn result;\n\t}", "public int getNumberOfSpaceActivitiesForUpgrade(Identity spaceIdentity);", "@Override\n public void onClick(View view) {\n List<AndroidAppProcess> runningAppProcessInfo = AndroidProcesses.getRunningAppProcesses();\n\n for (int i = 0; i < runningAppProcessInfo.size(); i++) {\n Log.i(\"MainActivity\", runningAppProcessInfo.get(i).getPackageName());\n // Check for AnkuLua\n if(runningAppProcessInfo.get(i).getPackageName().equals(\"com.appautomatic.ankulua.pro2\") ||\n runningAppProcessInfo.get(i).getPackageName().equals(\"com.appautomatic.ankulua.pro\") ||\n runningAppProcessInfo.get(i).getPackageName().equals(\"com.appautomatic.ankulua.trial\")){\n\n // AnkuLua package process has been detected! Perma ban account for abusing Terms & Conditions\n alert();\n return;\n }\n }\n Toast.makeText(MainActivity.this,\"Not Found\",Toast.LENGTH_SHORT).show();\n }", "int getInfoCount();", "int getInfoCount();", "int getInfoCount();", "int countByExample(BasicInfoPrecursorProcessTypeExample example);", "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}", "int getStudentResponseCount();", "@Override\n\tpublic Long count(String searchinfo) {\n\t\tString hql=\"select count(*) from \"+tablename +\" where 1=1 \";\n\t\tif(searchinfo!=null&& !searchinfo.equals(\"\")){\n\t\t\thql+=\" and t.name like '%\"+ searchinfo+\"%' \";\n\t\t}\n\t\treturn SApplicationcategorydao.count(hql);\n\t}", "public static String OSDetector() {\r\n\t\tString os = System.getProperty(\"os.name\").toLowerCase();\r\n\t\tif (os.contains(\"win\")) {\r\n\t\t\treturn \"Windows\";\r\n\t\t} else if (os.contains(\"nux\") || os.contains(\"nix\")) {\r\n\t\t\treturn \"Linux\";\r\n\t\t} else if (os.contains(\"mac\")) {\r\n\t\t\treturn \"Mac\";\r\n\t\t} else if (os.contains(\"sunos\")) {\r\n\t\t\treturn \"Solaris\";\r\n\t\t} else {\r\n\t\t\treturn \"Other\";\r\n\t\t}\r\n\t}", "int getColumnsCount();", "int getColumnsCount();", "@SelectProvider(type=UserRecommendedCodeSqlProvider.class, method=\"countByExample\")\n long countByExample(UserRecommendedCodeCriteria example);", "public static String getOSInfo() {\n String os = System.getProperty(\"os.name\");\n String osVersion = System.getProperty(\"os.version\");\n String osArchitecture = System.getProperty(\"os.arch\");\n\n return \"OS Detection:\" + os + \",\" + osVersion + \",\" + osArchitecture;\n }", "int getDataScansCount();", "public int user_check(String name) {\n\t\treturn Sdao.seat_numselect(name);\r\n\t}", "int getColumnCount();", "int getColumnCount();", "public int countWhere(String where) throws SQLException\n {\n String sql = \"select count(*) as MCOUNT from preference \" + where;\n Connection c = null;\n Statement pStatement = null;\n ResultSet rs = null;\n try \n {\n int iReturn = -1; \n c = getConnection();\n pStatement = c.createStatement();\n rs = pStatement.executeQuery(sql);\n if (rs.next())\n {\n iReturn = rs.getInt(\"MCOUNT\");\n }\n if (iReturn != -1)\n return iReturn;\n }\n finally\n {\n getManager().close(pStatement, rs);\n freeConnection(c);\n }\n throw new SQLException(\"Error in countWhere\");\n }" ]
[ "0.5728353", "0.5710228", "0.56543255", "0.5600694", "0.54657584", "0.54271406", "0.532434", "0.52545995", "0.52545995", "0.52545995", "0.52180237", "0.52058583", "0.5200879", "0.51540875", "0.513676", "0.51222616", "0.5059608", "0.5050754", "0.5026459", "0.50183284", "0.50136906", "0.500988", "0.49985886", "0.49407732", "0.49265268", "0.4917151", "0.49168572", "0.49093026", "0.4892837", "0.48752952", "0.48582688", "0.48532155", "0.48140496", "0.48069382", "0.48001924", "0.4785118", "0.47815657", "0.47808966", "0.47737107", "0.47716585", "0.47692907", "0.47692117", "0.47666666", "0.47530398", "0.47518137", "0.47504616", "0.47261468", "0.4720366", "0.46942475", "0.46920955", "0.46888477", "0.46878666", "0.46861452", "0.46726084", "0.46693325", "0.4667847", "0.466382", "0.46624443", "0.4656585", "0.4642554", "0.46418697", "0.46399483", "0.46369413", "0.46347377", "0.4632967", "0.46250147", "0.46195656", "0.46186608", "0.46179232", "0.46165207", "0.46160147", "0.46131524", "0.4612592", "0.461001", "0.46087942", "0.46075565", "0.46069202", "0.4606908", "0.4604043", "0.4603867", "0.45994443", "0.4594355", "0.4593673", "0.45871347", "0.45871347", "0.45871347", "0.45806426", "0.45737508", "0.45719022", "0.45649278", "0.45644572", "0.4562243", "0.4562243", "0.45599082", "0.45596498", "0.4556787", "0.45546913", "0.4550987", "0.4550987", "0.45474568" ]
0.75446784
0
Matching names with emails
public void sortNames() { System.out.println( "\nTASK [4]> Match names with e-mails, check for duplicate e-mails: \n"); // Adding all names / e-mails to ArrayLists, avoiding blank lines ArrayList<String> allNames = new ArrayList<String>(); ArrayList<String> allEmails = new ArrayList<String>(); for(int col = 1; col < 3; ++col) { String[] namesCol = columns.get(col); String[] emailsCol = columns.get(col + 2); // omit the first row with col. names for(int row = 1; row < namesCol.length; ++row) { if(!namesCol[ row ].isBlank()) { allNames.add( namesCol[ row ] ); allEmails.add( emailsCol[ row ]); } } } System.out.println("Names, e-mails (both columns): \n"); for(int row = 0; row < allNames.size(); ++row) { System.out.print( allNames.get(row) + " " + allEmails.get(row) + "\n"); } // checking for duplicates String[] emails = allEmails.toArray( new String[ allEmails.size() ] ); ArrayList<String> duplEmails = this.findDuplicates( emails ); System.out.println("\nStudents with same emails: \n"); for(int dupl = 0; dupl < duplEmails.size(); ++ dupl) { String duplicate_i = duplEmails.get(dupl); for(int row = 0; row < allEmails.size(); ++ row) { if(Objects.equals(allEmails.get(row), duplicate_i ) ) { System.out.println(allNames.get(row) + " : " + duplicate_i); } } } System.out.println( "----------------------------------------------------"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean findEmail(String email);", "public ArrayList<AddressEntry> searchByEmail(String text) {\r\n ArrayList<AddressEntry> textMatches = new ArrayList<AddressEntry>();\r\n text = text.toLowerCase();\r\n for (AddressEntry current : contacts) {\r\n String currentname = current.getEmail().toLowerCase();\r\n if (currentname.contains(text)) {\r\n textMatches.add(current);\r\n }\r\n }\r\n return textMatches;\r\n }", "public static void main(String[] args) {\r\n\t\tString input = \"[email protected]\";\r\n//\t\tString input2 = \"naveen [email protected]\";\r\n\t\tString regex = \"[A-Za-z0-9._]+@[A-Za-z0-9]+.[A-Za-z]{2,}\";\r\n\t\tPattern pattern = Pattern.compile(regex);\r\n\t\tMatcher matcher = pattern.matcher(input);\r\n//\t\tMatcher matcher2 = pattern.matcher(input2);\r\n\t\tSystem.out.println(matcher.matches());\r\n//\t\tSystem.out.println(matcher2.matches());\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t ArrayList<String> emails = new ArrayList<String>();\n\t \n\t // valid email addresses\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t \n\t \n\t //invalid email addresses\n\t emails.add(\"@gmail.com\");\n\t emails.add(\"shagun&ag.com\");\n\t emails.add(\"raghu#@example.us.org\");\n\n\t //initialize the Pattern object\n\t Pattern pattern = Pattern.compile(regex);\n\n\t //searching for occurrences of regex\n\t for (String value : emails) {\n\t Matcher matcher = pattern.matcher(value);\n\t System.out.println(\"Email \" + value + \" is \" + (matcher.matches() ? \"valid\" : \"invalid\"));\n\t System.out.println(\"-----------------------------------------------------\");\n\t \n//\t \tboolean result = Pattern.compile(regex).matcher(value).matches();\n//\t \tSystem.out.println(result);\n\t }\n\n\t}", "private List<String> pickEmailOrFullNameMatches(final String name, final List<String> fullNameMatches, final List<String> emailMatches) {\n if (emailMatches.isEmpty()) {\n return fullNameMatches;\n }\n if (fullNameMatches.isEmpty() || isEmail(name)) {\n return emailMatches;\n }\n return fullNameMatches;\n }", "private void usernameFromEmail(String email) {\n if (email.matches(\"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\")) {\n goNextEnable();\n } else {\n goNextDisable();\n }\n }", "public static void main(String[] args) {\n\t\t\n\t\t\nString regexp = \"[A-Za-z-0-9]+@[A-Za-z]+\\\\.[A-Za-z]{2,4}\";\n\t\t\n\t\tSystem.out.println(Pattern.matches(regexp, \"[email protected]\"));\n\t\tSystem.out.println(Pattern.matches(regexp, \"[email protected]\"));\n\t\tSystem.out.println(Pattern.matches(regexp, \"odksos@com\"));\n\t\tSystem.out.println(\"---------------------------------------\");\n\n\t}", "@Override\r\n\tpublic boolean overlapCheck(String email) {\n\t\treturn select(\"email\", email).size()==0;\r\n\t}", "boolean isEmailExist(String email);", "private ArrayList<String> findMentions(String text){\r\n int i = 0;\r\n ArrayList<String> userNames = new ArrayList<String>();\r\n ArrayList<User> users = new ArrayList<User>();\r\n String temp = null;\r\n text += \" \"; //adds a space to the end of text for function below.\r\n \r\n users = UserDB.selectUsers(); //all users in the database\r\n while(true)\r\n {\r\n int found = text.indexOf(\"@\", i);\r\n if (found == -1) break;\r\n int start = found + 1;\r\n int end = text.indexOf(\" \", start);\r\n temp = text.substring(start, end);\r\n for (int count=0; count < users.size(); count++) {\r\n if (users.get(count).getusername().equals(temp)){\r\n userNames.add(users.get(count).getemail()); //add email address instead of username\r\n }\r\n }\r\n i= end +1;\r\n }\r\n \r\n return userNames;\r\n }", "private void emailExistCheck() {\n usernameFromEmail(email.getText().toString());\n }", "private String findDisplayName(String emailText) {\n for (User user : userList) {\n //Log.i(TAG, \"findDisplayName() : for loop\");\n if (user.getEmail().equals(emailText)) {\n //Log.i(TAG, \"emailText: \" + emailText);\n //Log.i(TAG, \"user.getEmail(): \" + user.getEmail());\n //Log.i(TAG, \"user.getUserName(): \" + user.getUserName());\n if (user.getUserName() == null) {\n break;\n }\n return user.getUserName();\n }\n }\n return \"No UserName\";\n }", "private boolean checkemail(String s) {\n\t\tboolean flag = false;\r\n\t\tString[] m = s.split(\"@\");\r\n\t\tif (m.length < 2) {\r\n\t\t\tflag = true;\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "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 }", "public String searchEmail(String username) {\n\n db = this.getReadableDatabase();\n String query = \"select username, email from \" + TABLE_NAME;\n Cursor cursor = db.rawQuery(query,null);\n\n String uname, email;\n email = \"not found\";\n\n if (cursor.moveToFirst()) {\n\n do {\n uname = cursor.getString(0);\n if (uname.equals(username)) {\n email = cursor.getString(1);\n break;\n }\n } while (cursor.moveToNext());\n }\n return email;\n }", "public String checkEmail() {\n String email = \"\"; // Create email\n boolean isOK = true; // Condition loop\n\n while (isOK) {\n email = checkEmpty(\"Email\"); // Call method to check input of email\n // Pattern for email\n String emailRegex = \"^[a-zA-Z0-9_+&*-]+(?:\\\\.\" + \"[a-zA-Z0-9_+&*-]+)*@\"\n + \"(?:[a-zA-Z0-9-]+\\\\.)+[a-z\" + \"A-Z]{2,7}$\";\n boolean isContinue = true; // Condition loop\n\n while (isContinue) {\n // If pattern not match, the print out error\n if (!Pattern.matches(emailRegex, email)) {\n System.out.println(\"Your email invalid!\");\n System.out.print(\"Try another email: \");\n email = checkEmpty(\"Email\");\n } else {\n isContinue = false;\n }\n }\n\n boolean isExist = false; // Check exist email\n for (Account acc : accounts) {\n if (email.equals(acc.getEmail())) {\n // Check email if exist print out error\n System.out.println(\"This email has already existed!\");\n System.out.print(\"Try another email: \");\n isExist = true;\n }\n }\n\n // If email not exist then return email\n if (!isExist) {\n return email;\n }\n }\n return email; // Return email\n }", "private boolean isValidInput(String Name, String Email, String Password, String ConfirmationPassword) {\n\n String regex = \"^(.+)@(.+)$\";\n\n Pattern pattern = Pattern.compile(regex);\n\n Matcher matcher = pattern.matcher(Email);\n\n if (Name == null || Name.equals(\"\") || Name.equals(\" \") ||\n !matcher.matches() ||\n Password == null || Password.equals(\"\") ||\n ConfirmationPassword == null || !ConfirmationPassword.equals(Password)) {\n return false;\n }\n return true;\n }", "Boolean checkEmailAlready(String email);", "public static void searchEmail(Contact[] myContacts, String find)\n {\n int high = myContacts.length;\n int low = -1;\n int probe;\n while(high - low > 1)\n {\n probe = (high+low)/2;\n if(myContacts[probe].getEmail().compareTo(find) > 0)\n {\n high = probe;\n }\n else\n {\n low = probe;\n if(myContacts[probe].getEmail().compareTo(find) == 0)\n {\n break;\n }\n }\n }\n System.out.println(\"Find results: \");\n if((low>=0)&&(myContacts[low].getEmail().compareTo(find) == 0))\n {\n findMoreEmails(myContacts, low, find);\n }\n else\n {\n System.out.println(\"There are no listings for \"+find);\n }\n }", "private static List<String> getEmailList(){\n List<String> lista = new ArrayList<>();\n lista.add(\"[email protected]\");\n lista.add(\"[email protected].\");\n lista.add(\"[email protected]\");\n lista.add(\"[email protected].\");\n lista.add(\"meu#[email protected]\");\n lista.add(\"[email protected]\");\n lista.add(\"[email protected]\");\n lista.add(\"[email protected]\");\n lista.add(\"[[email protected]\");\n lista.add(\"<[email protected]\");\n lista.add(\"[email protected]\");\n lista.add(\"[email protected]\");\n lista.add(\"[email protected]\");\n\n lista.add(\"[email protected]\");\n lista.add(\"[email protected]\");\n\n\n return lista;\n\n }", "void validate(String email);", "public boolean emailFormat(String email){\n Pattern VALID_EMAIL_ADDRESS_REGEX =\n Pattern.compile(\"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\", Pattern.CASE_INSENSITIVE);\n Matcher matcher=VALID_EMAIL_ADDRESS_REGEX.matcher(email);\n return matcher.find();\n\n }", "List<ClientName> findNameByEmail(String email);", "private boolean isEmailValid(String email) {\n if (email.length() == 8){\n return true;\n }\n\t//user names first two characters must be letters\n Boolean condition1 = false;\n Boolean condition2 = false;\n\n int ascii = (int) email.charAt(0);\n if ((ascii >= 65 && ascii <= 90) || ascii >= 97 && ascii <= 122){\n condition1 = true;\n }\n ascii = (int) email.charAt(1);\n if ((ascii >= 65 && ascii <= 90) || ascii >= 97 && ascii <= 122){\n condition2 = true;\n }\n if (condition1 == true && condition2 == true){\n return true;\n }\n\n\t//user names last six characters must be numbers\n for (int i = email.length()-6; i < email.length(); i++){\n ascii = (int) email.charAt(i);\n if (!(ascii >= 48 && ascii <= 57)){\n return false;\n }\n }\n\n return true;\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\r\n }", "static boolean isValid(String email) {\r\n\t\t String regex = \"^[\\\\w-_\\\\.+]*[\\\\w-_\\\\.]\\\\@([\\\\w]+\\\\.)+[\\\\w]+[\\\\w]$\";\r\n\t\t return email.matches(regex);\r\n\t}", "private boolean checkEmail(String email) {\n\n\t\tString patternStr = \"^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\\\.[A-Z]{2,6}$\";\n\t\tPattern pattern = Pattern.compile(patternStr, Pattern.CASE_INSENSITIVE);\n\t\tMatcher matcher = pattern.matcher(email);\n\t\tboolean matchFound = matcher.matches();\n\t\treturn matchFound;\n\n\t}", "private String checkName(String name){\n\n if(name.isBlank()){\n name = \"guest\";\n }\n int i = 1;\n if(users.contains(name)) {\n while (users.contains(name + i)) {\n i++;\n }\n name+=i;\n }\n return name;\n }", "public static String emailValid(String email){\n return \"select u_email from users having u_email = '\" + email + \"'\";\n }", "public static void main(String[] args) {\n\t\tScanner sc = new Scanner(System.in);\n\t\tint T = sc.nextInt();\n\t\tString s1 = sc.nextLine();\n\t\tList<NameEmail> lst = new ArrayList<>();\n\t\tfor (int i = 0; i < T; i++) {\n\t\t\tNameEmail ne = new NameEmail();\n\t\t\tString s = sc.nextLine();\n\t\t\tString[] r = s.split(\" \");\n\t\t\tString g = r[1];\n\n\t\t\tif(g.endsWith(\"@gmail.com\")){\n\t\t\t\tne.name = r[0];\n\t\t\t\tne.email = r[1];\n\t\t\t\tlst.add(ne);\n\t\t\t}\n\n\n\t\t}\n\n\n\t\tlst.sort((p1, p2) -> p1.name.compareTo(p2.name));\n\n\t\tlst.forEach(p -> System.out.println(p.name));\n\n\t\tsc.close();\n\n\t}", "private String parseName(String email) {\n String[] parsedEmail = email.split(\"@\");\n if (parsedEmail.length > 0) {\n return parsedEmail[0];\n } else {\n return null;\n }\n }", "private boolean isEmail(String email)\n {\n Pattern pat = null;\n Matcher mat = null;\n pat = Pattern.compile(\"^[\\\\w\\\\\\\\\\\\+]+(\\\\.[\\\\w\\\\\\\\]+)*@([A-Za-z0-9-]+\\\\.)+[A-Za-z]{2,4}$\");\n mat = pat.matcher(email);\n if (mat.find()) {\n return true;\n }\n else\n {\n return false;\n }\n }", "private boolean checkEmailPattern(String email) {\n Pattern pattern = Pattern.compile(EMAIL_PATTERN);\n Matcher matcher = pattern.matcher(email);\n return matcher.matches();\n }", "public String searchForID(String searchTerm) throws Exception {\n for (User oneUser : userList) {\n if (oneUser.hasEmail(searchTerm)) {\n return searchTerm;\n }\n }\n\n // did not find an exact match, then search for partial strings\n for (User oneUser : userList) {\n if (oneUser.hasEmailMatchingSearchTerm(searchTerm)) {\n return oneUser.getEmailMatchingSearchTerm(searchTerm);\n }\n }\n\n return null;\n }", "public void getName(ArrayList<String> document) {\r\n name = \"\";\r\n int atIndex = address.indexOf('@');\r\n String username = address.substring(0, atIndex);\r\n for(int i = 0; i < document.size(); i++)\r\n {\r\n String[] words = document.get(i).split(\" \");\r\n for(int j = 0; j < words.length; j++)\r\n {\r\n if(username.contains(words[j].toLowerCase()))\r\n {\r\n name = document.get(i);\r\n break;\r\n }\r\n }\r\n if(!name.equals(\"\"))\r\n {\r\n break;\r\n }\r\n } \r\n }", "public boolean findValidEmail(String email) {\n if (allEmails.isEmpty()) {\n return true;\n }\n for (String e: allEmails) {\n if(e.equals(email)) {\n return false;\n }\n }\n return true;\n }", "private boolean isEmailValid(String email){\n return email.contains(\"@\");\n }", "private boolean isValidEmail(final String theEmail) {\n return theEmail.contains(\"@\");\n }", "@Test\n\tpublic void testValidateUsernameEmail() {\n\n\t\tassertTrue(ValidationUtil.validate(\"[email protected]\", Validate.username_valid));\n\t\tassertTrue(ValidationUtil.validate(\"[email protected]\", Validate.username_valid));\n\t\tassertTrue(ValidationUtil.validate(\"[email protected]\", Validate.username_valid));\n\t\tassertTrue(ValidationUtil.validate(\"[email protected]\", Validate.username_valid));\n\n\t\tassertFalse(ValidationUtil.validate(\"test4\", Validate.username_valid));\n\t\tassertFalse(ValidationUtil.validate(\"@com\", Validate.username_valid));\n\t\tassertFalse(ValidationUtil.validate(\"com@\", Validate.username_valid));\n\t}", "@Test\n public void testSearchUsersByName() {\n token.setGroupId(findMemberGroup(token).getGroupId());\n\n // Setting a partial name to search for. The search will look at both\n // first and last names which contain this as part of their name. In\n // this case, we're searching for \"man\", which will yield the following:\n // - Germany\n // - Oman\n // - Romania\n final SearchUserRequest request = new SearchUserRequest();\n request.setName(\"man\");\n\n // Now, invoke the search for users with a partial name given\n final SearchUserResponse response = administration.searchUsers(token, request);\n\n // And verify the result\n assertThat(response.isOk(), is(true));\n assertThat(response.getUsers().size(), is(3));\n }", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "boolean hasEmail();", "private boolean matches(String userMail, String filter) {\n\t\tfor (String curMaskedDomain : MASKED_ADDRESS_DOMAINS) {\n\t\t\tif (userMail.contains(curMaskedDomain)) {\n\t\t\t\treturn userMail.startsWith(filter);\n\t\t\t}\n\t\t}\n\n\t\t// default handling\n\t\treturn userMail.contains(filter);\n\n\t}", "@Override\n\tpublic List<Applicant> getAllApplicantUsingRegex() {\n\t\tSystem.out.println(\"Fname Ending with a \");\n\t\tQuery query = new Query().addCriteria(Criteria.where(\"fname\").regex(\"a$\"));\n\t\treturn applicantMongoTemplate.find(query, Applicant.class);\n\t}", "public boolean isRegisteredEmail(String email);", "@Override\r\n\tpublic List<AsxDataVO> findByName(String name) {\r\n\t\t// TODO Auto-generated method stub\r\n\t\treturn mongoTemplate.find(new Query(Criteria.where(\"email\").is(name)), AsxDataVO.class);\r\n\t}", "boolean existsByEmail(String email);", "@Override\n public Collection<Employee> queryByNameAndEmail( String name, String email, boolean isRemoved ) {\n final String nameLikeSql = name + \"%\";\n final String mailLikeSql = email + \"%\";\n\n return em.createNamedQuery( \"Employee.findByNameAndEmail\", Employee.class )\n .setParameter( \"name\", nameLikeSql )\n .setParameter( \"email\", mailLikeSql )\n .setParameter( \"removed\", isRemoved ).getResultList();\n\n }", "public boolean emailAvailability (String desiredEmail) {\n\t\t\n\t\tArrayList<User> companyMembers = myCompany.getCompanyMembers();\n\t\tfor(User companyMember: companyMembers) {\n\t\t\tif (companyMember.myAccount.getEmail().equalsIgnoreCase(desiredEmail))\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private static void lookupAccount(String email) {\n\t\t\n\t}", "public void searchByName() {\n System.out.println(\"enter a name to search\");\n Scanner sc = new Scanner(System.in);\n String fName = sc.nextLine();\n Iterator itr = list.iterator();\n while (itr.hasNext()) {\n Contact person = (Contact) itr.next();\n if (fName.equals(person.getFirstName())) {\n List streamlist = list.stream().\n filter(n -> n.getFirstName().\n contains(fName)).\n collect(Collectors.toList());\n System.out.println(streamlist);\n }\n }\n }", "public static String inputEmail(String s) {\n while (true) {\n System.out.print(s);\n String string = in.nextLine().trim();\n string = string.replace(\"\\\\s+\", \" \");\n Pattern p = Pattern.compile(\"^[a-z0-9A-Z]+@[a-zA-Z]+(\\\\.[a-zA-Z]+){1,3}+$\");\n if (!string.isEmpty()) { // not empty ~> finish\n if (p.matcher(string).find()) {\n return string;\n } else {\n System.err.println(\"Email must in format \"\n + \"Local-Part(name(.name2)@Domain(domain.something(.domain2.domain3))(max 3 '.'), enter again!\");\n }\n } else { // empty string ~> display error & re-enter\n System.err.println(\"Email can not empty, enter again!\");\n }\n }\n }", "private boolean comprobar_email() {\n\t\tString mail = email.getText().toString();\n\n\t\tif (mail.matches(\".*@.*\\\\.upv.es\")) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "boolean isEmail(String s) {\n return (!TextUtils.isEmpty(s) && Patterns.EMAIL_ADDRESS.matcher(s).matches());\n }", "public boolean existsByEmail(String email);", "public boolean existsByEmail(String email);", "public void searchByEmail(String partialE) {\r\n\t\tArrayList<Patron> partialEmail = dblogic.getSortedByEmails(partialE);\r\n\t\tresetTable();\r\n\t\tfor (int i = 0; i < partialEmail.size(); i++) {\r\n\t\t\ttable.setValueAt(partialEmail.get(i).getLastName(), i, COL_LAST);\r\n\t\t\ttable.setValueAt(partialEmail.get(i).getFirstName(), i, COL_FIRST);\r\n\t\t\ttable.setValueAt(partialEmail.get(i).getPatronEmail(), i, COL_EMAIL);\r\n\t\t\ttable.setValueAt(partialEmail.get(i).getPatronDOB(), i, COL_BIRTH);\r\n\t\t\ttable.setValueAt(partialEmail.get(i).getPatronSince(), i, COL_ADDED);\r\n\t\t\ttable.setValueAt(partialEmail.get(i).getAnniv().toString(), i, COL_ANNIV);\r\n\t\t}\r\n\t}", "@Test\n public void testBasicValid() {\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"admin@mailserver1\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n assertTrue(EmailValidator.isValid(\"user%[email protected]\"));\n assertTrue(EmailValidator.isValid(\"[email protected]\"));\n }", "public ArrayList<AddressEntry> searchByName(String text) {\r\n ArrayList<AddressEntry> textMatches = new ArrayList<AddressEntry>();\r\n text = text.toLowerCase();\r\n for (AddressEntry current : contacts) {\r\n String currentname = current.getName().toLowerCase();\r\n if (currentname.contains(text)) {\r\n textMatches.add(current);\r\n }\r\n }\r\n return textMatches;\r\n }", "private static boolean isEmailFormat(final String str)\n {\n return str.matches(\"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\\\.[A-Za-z]{2,6}\");\n }", "@When(\"A user enters a valid email address$\")\n public void check_valid_email(DataTable email) throws Throwable {\n List<List<String>> email_addresses = email.raw();\n for (List<String> element : email_addresses) {\n for (String ea : element) {\n home.submit_email(ea);\n }\n }\n }", "private boolean searchName(String username, ArrayList<String> existingList) {\n int low = 0;\n int high = existingList.size() - 1;\n int mid;\n\n while (low <= high) {\n mid = (low + high) / 2;\n String name = existingList.get(mid);\n String substr = name.substring(0, name.indexOf(\" \"));\n\n if (substr.compareToIgnoreCase(username) < 0) {\n low = mid + 1;\n } else if (substr.compareToIgnoreCase(username) > 0) {\n high = mid - 1;\n } else {\n return true;\n }\n\n }\n\n return false;\n }", "public static boolean email(String email) {\r\n\t\tboolean resul = false;\r\n\r\n\t\tif (email != null) {\r\n\t\t\tMatcher matcher = VALID_EMAIL_ADDRESS_REGEX.matcher(email);\r\n\t\t\tresul = matcher.find();\r\n\t\t}\r\n\r\n\t\treturn resul;\r\n\t}", "public void searchByName(String name) {\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(\"./src/data/contactInfo.text\"));\n\t\t\tString line;\n\t\t\twhile((line = reader.readLine()) != null){\n\t\t\t\tif(line.toLowerCase().contains(name.toLowerCase())) {\n\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t}\n\t\t\t}\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}", "public static void main(String[] args) {\r\n\t\t boolean matches_1 = Pattern.matches(\"[a-zA-Z0-9]{4}\", \"0Aa1\");\r\n\t\t boolean matches_2 = Pattern.matches(\"[a-zA-Z0-9]{4}\", \"0A@a1\");\r\n\t\t\t System.out.println(\"Regular Expression is \"+matches_1 +\" for given string(0Aa1)\");\r\n\t\t\t System.out.println(\"Regular Expression is \"+matches_2 +\" for given string(0A@a1)\");\r\n\t}", "@Override\n\tpublic boolean emailisValid(String email) \n\t{\n\t\treturn false;\n\t}", "protected void validateEmail(){\n\n //Creating Boolean Value And checking More Accurate Email Validator Added\n\n Boolean email = Pattern.matches(\"^[A-Za-z]+([.+-]?[a-z A-z0-9]+)?@[a-zA-z0-9]{1,6}\\\\.[a-zA-Z]{2,6},?([.][a-zA-z+,]{2,6})?$\",getEmail());\n System.out.println(emailResult(email));\n }", "public abstract Iterator getMatchingMimeHeaders(String names[]);", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "private boolean isEmailValid(String email) {\n return email.contains(\"@\");\n }", "public ArrayList<Guest> searchGuestList(String name) {\n \tString checkName = name.toUpperCase();\n \tArrayList<Guest> result = new ArrayList<>();\n \tfor(Guest guest : guestList){\n if(guest.getName().toUpperCase() != null && guest.getName().toUpperCase().contains(checkName)) {\n \tresult.add(guest);\n }\n }\n \treturn result;\n }", "public boolean verificaEmail(String correo) {\n Pattern pat = null;\r\n Matcher mat = null;\r\n pat = Pattern.compile(\"^([0-9a-zA-Z]([_.w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-w]*[0-9a-zA-Z].)+([a-zA-Z]{2,9}.)+[a-zA-Z]{2,3})$\");\r\n mat = pat.matcher(correo);\r\n if (mat.find()) {\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }", "public static boolean esEmailCorrecto(String email) {\n \n boolean valid = false;\n \n Pattern p = Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\" +\"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\");\n \n Matcher mE = p.matcher(email.toLowerCase());\n if (mE.matches()){\n valid = true; \n }\n return valid;\n }", "public boolean usernameMatches(Account a) {\n return usernameMatches(a.getCredential());\n }", "private boolean isEmailValid(String email) {\n return true;\r\n }", "public static boolean validateMulti(final String emails){\n\t\t final Matcher matcher = multiEmailPattern.matcher(emails);\n\t\t return matcher.matches();\n\t }", "@Override\n public boolean isUserEmailExists(String email, String exludeUserName) {\n Map params = new HashMap<String, Object>();\n params.put(CommonSqlProvider.PARAM_WHERE_PART, User.QUERY_WHERE_EMAIL_EXCLUDE_USERNAME);\n params.put(User.PARAM_EMAIL, email);\n params.put(User.PARAM_USERNAME, exludeUserName);\n User user = getRepository().getEntity(User.class, params);\n\n return user != null && user.getEmail() != null && !user.getEmail().equals(\"\");\n }", "private boolean isEmailValid(String email) {\n if(Patterns.EMAIL_ADDRESS.matcher(email).matches()){\n\n return true;\n }else {\n return false;\n }\n// return email.contains(\"@\");\n }" ]
[ "0.68858486", "0.6766492", "0.6708015", "0.6657686", "0.66105", "0.6459815", "0.6298337", "0.62569004", "0.6215219", "0.6159905", "0.6127737", "0.6086025", "0.6007161", "0.59640414", "0.59351236", "0.5924817", "0.591282", "0.58472973", "0.58428675", "0.5839412", "0.5830183", "0.5825693", "0.57990766", "0.577035", "0.5767963", "0.5767963", "0.5767963", "0.5767963", "0.57526004", "0.5733365", "0.57175255", "0.5717342", "0.5710164", "0.5688704", "0.5662911", "0.5648287", "0.56433165", "0.5638818", "0.56357193", "0.5630975", "0.5623791", "0.56184304", "0.5610156", "0.56021464", "0.56021464", "0.56021464", "0.56021464", "0.56021464", "0.5586214", "0.55807894", "0.5576401", "0.55407524", "0.55396897", "0.55288976", "0.5522355", "0.55052215", "0.54947996", "0.5467924", "0.54606754", "0.5460558", "0.5458841", "0.5458841", "0.54587615", "0.54579204", "0.5450571", "0.5439256", "0.5431488", "0.54307896", "0.5429654", "0.54235756", "0.5418092", "0.5412982", "0.54104203", "0.54054487", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5404363", "0.5391198", "0.5389194", "0.53872156", "0.53839636", "0.5382985", "0.5379683", "0.5376381", "0.5374997" ]
0.5844538
18